UNPKG

d2-ui

Version:
3 lines 144 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){return a&&a.Object===Object?a:null}function c(a){for(var b=[],c=0,d=a.length;d>c;c++)b.push(a[c]);return b}function d(a){return function(){try{return a.apply(this,arguments)}catch(b){return Za.e=b,Za}}}function e(a){throw a}function f(a,b){if(_a&&b.stack&&"object"==typeof a&&null!==a&&a.stack&&-1===a.stack.indexOf(db)){for(var c=[],d=b;d;d=d.source)d.stack&&c.unshift(d.stack);c.unshift(a.stack);var e=c.join("\n"+db+"\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===bb&&d>=cb&&Gg>=d}function i(a){return-1!==a.indexOf("(module.js:")||-1!==a.indexOf("(node.js:")}function j(){if(_a)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 bb=d[0],d[1]}}function k(a){var b=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(a);if(b)return[b[1],Number(b[2])];var c=/at ([^ ]+):(\d+):(?:\d+)$/.exec(a);if(c)return[c[1],Number(c[2])];var d=/.*@(.+):(\d+)$/.exec(a);return d?[d[1],Number(d[2])]:void 0}function l(b,c,d,e,f,g){var h=Sb(b),i=h.length,j=Sb(c),k=j.length;if(i!==k&&!e)return!1;for(var l,m=i;m--;)if(l=h[m],!(e?l in c:Pb.call(c,l)))return!1;for(var n=e;++m<i;){l=h[m];var o,p=b[l],q=c[l];if(!(o===a?d(p,q,e,f,g):o))return!1;n||(n="constructor"===l)}if(!n){var r=b.constructor,s=c.constructor;if(r!==s&&"constructor"in b&&"constructor"in c&&!("function"==typeof r&&r instanceof r&&"function"==typeof s&&s instanceof s))return!1}return!0}function m(a,b,c){switch(c){case sb:case tb:return+a===+b;case ub:return a.name===b.name&&a.message===b.message;case xb:return a!==+a?b!==+b:a===+b;case zb:case Bb:return a===b+""}return!1}function n(a){return!!a&&"object"==typeof a}function o(a){return"number"==typeof a&&a>-1&&a%1===0&&Rb>=a}function p(a){return n(a)&&o(a.length)&&!!Nb[Qb.call(a)]}function q(a,b){for(var c=-1,d=a.length;++c<d;)if(b(a[c],c,a))return!0;return!1}function r(b,c,d,e,f,g){var h=-1,i=b.length,j=c.length;if(i!==j&&!(e&&j>i))return!1;for(;++h<i;){var k,l=b[h],m=c[h];if(k!==a){if(k)continue;return!1}if(e){if(!q(c,function(a){return l===a||d(l,a,e,f,g)}))return!1}else if(l!==m&&!d(l,m,e,f,g))return!1}return!0}function s(a,b,c,d,e,f){var g=Ub(a),h=Ub(b),i=rb,j=rb;g||(i=Qb.call(a),i===qb?i=yb:i!==yb&&(g=p(a))),h||(j=Qb.call(b),j===qb&&(j=yb));var k=i===yb&&!Tb(a),n=j===yb&&!Tb(b),o=i===j;if(o&&!g&&!k)return m(a,b,i);if(!d){var q=k&&Pb.call(a,"__wrapped__"),s=n&&Pb.call(b,"__wrapped__");if(q||s)return c(q?a.value():a,s?b.value():b,d,e,f)}if(!o)return!1;e||(e=[]),f||(f=[]);for(var t=e.length;t--;)if(e[t]===a)return f[t]===b;e.push(a),f.push(b);var u=(g?r:l)(a,b,c,d,e,f);return e.pop(),f.pop(),u}function t(a,b,c,d,e){return a===b?!0:null==a||null==b||!ba(a)&&!n(b)?a!==a&&b!==b:s(a,b,t,c,d,e)}function u(a,b){for(var c=new Array(a),d=0;a>d;d++)c[d]=b();return c}function v(a,b){this.id=a,this.value=b}function w(a,b){this.scheduler=a,this.disposable=b,this.isDisposed=!1}function x(a,b){b.isDisposed||(b.isDisposed=!0,b.disposable.dispose())}function y(a){this._s=a,this.isDisposed=!1}function z(a){this._s=a}function A(a){this._s=a,this._l=a.length,this._i=0}function B(a){this._a=a}function C(a){this._a=a,this._l=G(a),this._i=0}function D(a){return"number"==typeof a&&Pa.isFinite(a)}function E(b){var c,d=b[kb];if(!d&&"string"==typeof b)return c=new z(b),c[kb]();if(!d&&b.length!==a)return c=new B(b),c[kb]();if(!d)throw new TypeError("Object is not iterable");return b[kb]()}function F(a){var b=+a;return 0===b?b:isNaN(b)?b:0>b?-1:1}function G(a){var b=+a.length;return isNaN(b)?0:0!==b&&D(b)?(b=F(b)*Math.floor(Math.abs(b)),0>=b?0:b>ld?ld:b):b}function H(a,b){return pc(a)||(a=wc),new nd(b,a)}function I(a,b){this.observer=a,this.parent=b}function J(a,b){return a.amb(b)}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function K(){return!1}function M(){return[]}function K(){return!1}function M(){return[]}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function N(a){return function(b){return a.subscribe(b)}}function O(a){return a.toArray()}function P(a){return a.length>0}function Q(a){return{"@@iterator":function(){return{next:function(){return{done:!1,value:a}}}}}}function Q(a){return{"@@iterator":function(){return{next:function(){return{done:!1,value:a}}}}}}function R(a,b,c){var d=ob(b,c,3);return a.map(function(b,c){var e=d(b,c,a);return Xa(e)&&(e=dd(e)),(nb(e)||mb(e))&&(e=md(e)),e}).concatAll()}function S(a,b,c){for(var d=0,e=a.length;e>d;d++)if(c(a[d],b))return d;return-1}function T(a){this.comparer=a,this.set=[]}function U(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 V(a){if(0===a.length)throw new eb;return a[0]}function W(a,b,c,d){var e=ob(b,c,3);return new xg(function(b){return a.subscribe(new gf(b,a,e,d))},a)}function X(a){return a?Sc.isObservable(a)?a:Xa(a)?Sc.fromPromise(a):aa(a)||_(a)?qf.call(this,a):Ya(a)?$.call(this,a):nb(a)||mb(a)?Y.call(this,a):ba(a)?Z.call(this,a):a:a}function Y(a){return Sc.from(a).concatMap(function(a){return Sc.isObservable(a)||ba(a)?X.call(null,a):Qa.Observable.just(a)}).toArray()}function Z(b){function c(b,c){d[c]=a,f.push(b.map(function(a){d[c]=a}))}for(var d=new b.constructor,e=Object.keys(b),f=[],g=0,h=e.length;h>g;g++){var i=e[g],j=X.call(this,b[i]);j&&Sc.isObservable(j)?c(j,i):d[i]=b[i]}return Sc.forkJoin.apply(Sc,f).map(function(){return d})}function $(a){var b=this;return new xg(function(c){a.call(b,function(){var a=arguments[0],b=arguments[1];if(a)return c.onError(a);if(arguments.length>2){for(var d=[],e=1,f=arguments.length;f>e;e++)d.push(arguments[e]);b=d}c.onNext(b),c.onCompleted()})})}function _(a){return Ya(a.next)&&Ya(a["throw"])}function aa(a){var b=a.constructor;return b?"GeneratorFunction"===b.name||"GeneratorFunction"===b.displayName?!0:_(b.prototype):!1}function ba(a){return Object==a.constructor}function ca(a,b,c,d){var e=new Cg;return d.push(da(e,b,c)),a.apply(b,d),e.asObservable()}function da(a,b,c){return function(){for(var d=arguments.length,e=new Array(d),f=0;d>f;f++)e[f]=arguments[f];if(Ya(c)){if(e=$a(c).apply(b,e),e===Za)return a.onError(e.e);a.onNext(e)}else e.length<=1?a.onNext(e[0]):a.onNext(e);a.onCompleted()}}function ea(a,b,c,d){var e=new Cg;return d.push(fa(e,b,c)),a.apply(b,d),e.asObservable()}function fa(a,b,c){return function(){var d=arguments[0];if(d)return a.onError(d);for(var e=arguments.length,f=[],g=1;e>g;g++)f[g-1]=arguments[g];if(Ya(c)){var f=$a(c).apply(b,f);if(f===Za)return a.onError(f.e);a.onNext(f)}else f.length<=1?a.onNext(f[0]):a.onNext(f);a.onCompleted()}}function ga(a){return Pa.StaticNodeList?a instanceof Pa.StaticNodeList||a instanceof Pa.NodeList:"[object NodeList]"===Object.prototype.toString.call(a)}function ha(a,b,c){this._e=a,this._n=b,this._fn=c,this._e.addEventListener(this._n,this._fn,!1),this.isDisposed=!1}function ia(a,b,c){var d=new _b,e=Object.prototype.toString.call(a);if(ga(a)||"[object HTMLCollection]"===e)for(var f=0,g=a.length;g>f;f++)d.add(ia(a.item(f),b,c));else a&&d.add(new ha(a,b,c));return d}function ja(a,b,c){return new xg(function(d){function e(a,b){if(j[b]=a,g[b]=!0,h||(h=g.every(Sa))){if(f)return d.onError(f);var e=$a(c).apply(null,j);if(e===Za)return d.onError(e.e);d.onNext(e)}i&&j[1]&&d.onCompleted()}var f,g=[!1,!1],h=!1,i=!1,j=new Array(2);return new jc(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)},function(a){d.onError(a)},function(){i=!0,e(!0,1)}))},a)}function O(a){return a.toArray()}function ka(a,b){return a.groupJoin(this,b,jd,function(a,b){return b})}function la(a){var b=this;return new xg(function(c){var d=new Bg,e=new _b,f=new lc(e);return c.onNext(Yb(d,f)),e.add(b.subscribe(function(a){d.onNext(a)},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),Xa(a)&&(a=dd(a)),e.add(a.subscribe(function(a){d.onCompleted(),d=new Bg,c.onNext(Yb(d,f))},function(a){d.onError(a),c.onError(a)},function(){d.onCompleted(),c.onCompleted()})),f},b)}function ma(a){var b=this;return new xg(function(c){function d(){var b;try{b=a()}catch(f){return void c.onError(f)}Xa(b)&&(b=dd(b));var i=new hc;e.setDisposable(i),i.setDisposable(b.take(1).subscribe(Ra,function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),h=new Bg,c.onNext(Yb(h,g)),d()}))}var e=new ic,f=new _b(e),g=new lc(f),h=new Bg;return c.onNext(Yb(h,g)),f.add(b.subscribe(function(a){h.onNext(a)},function(a){h.onError(a),c.onError(a)},function(){h.onCompleted(),c.onCompleted()})),d(),g},b)}function na(a,b){return new Hf(a,b)}function L(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return b}function oa(a){this.patterns=a}function pa(a,b){this.expression=a,this.selector=b}function qa(a){return function(b){a.onError(b)}}function ra(a,b){return function(){var c=$a(a.selector).apply(a,arguments);return c===Za?b.onError(c.e):void b.onNext(c)}}function sa(a,b,c){var d=a.get(b);if(!d){var e=new Pf(b,c);return a.set(b,e),e}return d}function ta(a,b,c){this.joinObserverArray=a,this.onNext=b,this.onCompleted=c,this.joinObservers=new Of;for(var d=0,e=this.joinObserverArray.length;e>d;d++){var f=this.joinObserverArray[d];this.joinObservers.set(f,f)}}function ua(a,b){return new Qf(a,b)}function va(a,b,c){return new xg(function(d){var e=a,f=oc(b);return c.scheduleRecursiveFuture(0,e,function(a,b){if(f>0){var g=c.now();e=new Date(e.getTime()+f),e.getTime()<=g&&(e=new Date(g+f))}d.onNext(a),b(a+1,new Date(e))})})}function wa(a,b,c){return a===b?new xg(function(a){return c.schedulePeriodic(0,b,function(b){return a.onNext(b),b+1})}):gd(function(){return va(new Date(c.now()+a),b,c)})}function xa(a,b,c){return new xg(function(d){var e,f=!1,g=new ic,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.error,k=!j):(i.push({value:a.value,timestamp:a.timestamp+b}),k=!f,f=!0),k&&(null!==h?d.onError(h):(e=new hc,g.setDisposable(e),e.setDisposable(c.scheduleRecursiveFuture(null,b,function(a,b){var e,g,k,l;if(null===h){j=!0;do k=null,i.length>0&&i[0].timestamp-c.now()<=0&&(k=i.shift().value),null!==k&&k.accept(d);while(null!==k);l=!1,g=0,i.length>0?(l=!0,g=Math.max(0,i[0].timestamp-c.now())):f=!1,e=h,j=!1,null!==e?d.onError(e):l&&b(null,g)}}))))}),new jc(e,g)},a)}function ya(a,b,c){return gd(function(){return xa(a,b-c.now(),c)})}function za(a,b,c){var d,e;return Ya(b)?e=b:(d=b,e=c),new xg(function(b){function c(){i.setDisposable(a.subscribe(function(a){var c=$a(e)(a);if(c===Za)return b.onError(c.e);var d=new hc;g.add(d),d.setDisposable(c.subscribe(function(){b.onNext(a),g.remove(d),f()},function(a){b.onError(a)},function(){b.onNext(a),g.remove(d),f()}))},function(a){b.onError(a)},function(){h=!0,i.dispose(),f()}))}function f(){h&&0===g.length&&b.onCompleted()}var g=new _b,h=!1,i=new ic;return d?i.setDisposable(d.subscribe(c,function(a){b.onError(a)},c)):c(),new jc(i,g)},a)}function Aa(a,b){return new xg(function(c){var d,e=!1,f=new ic,g=0,h=a.subscribe(function(a){var h=$a(b)(a);if(h===Za)return c.onError(h.e);Xa(h)&&(h=dd(h)),e=!0,d=a,g++;var i=g,j=new hc;f.setDisposable(j),j.setDisposable(h.subscribe(function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()},function(a){c.onError(a)},function(){e&&g===i&&c.onNext(d),e=!1,j.dispose()}))},function(a){f.dispose(),c.onError(a),e=!1,g++},function(){f.dispose(),e&&c.onNext(d),c.onCompleted(),e=!1,g++});return new jc(h,f)},a)}function O(a){return a.toArray()}function O(a){return a.toArray()}function Ba(a,b,c,d){return Ya(b)&&(d=c,c=b,b=sd()),Sc.isObservable(d)||(d=yd(new _f)),new xg(function(e){function f(a){function b(){return l=c===k}var c=k,f=new hc;i.setDisposable(f),f.setDisposable(a.subscribe(function(){b()&&h.setDisposable(d.subscribe(e)),f.dispose()},function(a){b()&&e.onError(a)},function(){b()&&h.setDisposable(d.subscribe(e))}))}function g(){var a=!l;return a&&k++,a}var h=new ic,i=new ic,j=new hc;h.setDisposable(j);var k=0,l=!1;return f(b),j.setDisposable(a.subscribe(function(a){if(g()){e.onNext(a);var b=$a(c)(a);if(b===Za)return e.onError(b.e);f(Xa(b)?dd(b):b)}},function(a){g()&&e.onError(a)},function(){g()&&e.onCompleted()})),new jc(h,i)},a)}function Ca(a,b,c,d){return pc(c)&&(d=c,c=yd(new _f)),c instanceof Error&&(c=yd(c)),pc(d)||(d=Bc),Sc.isObservable(c)||(c=yd(new _f)),new xg(function(e){function f(){var a=g;k.setDisposable(d.scheduleFuture(null,b,function(){j=g===a,j&&(Xa(c)&&(c=dd(c)),i.setDisposable(c.subscribe(e)))}))}var g=0,h=new hc,i=new ic,j=!1,k=new ic;return i.setDisposable(h),f(),h.setDisposable(a.subscribe(function(a){j||(g++,e.onNext(a),f())},function(a){j||(g++,e.onError(a))},function(){j||(g++,e.onCompleted())})),new jc(i,k)},a)}function Da(a){return{"@@transducer/init":function(){return a},"@@transducer/step":function(a,b){return a.onNext(b)},"@@transducer/result":function(a){return a.onCompleted()}}}function Ea(a){this.predicate=a}function Fa(a){this.predicate=a}function Ga(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsolute(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return dc})}(g)}}var Ha={"function":!0,object:!0},Ia=Ha[typeof exports]&&exports&&!exports.nodeType?exports:null,Ja=Ha[typeof module]&&module&&!module.nodeType?module:null,Ka=b(Ia&&Ja&&"object"==typeof global&&global),La=b(Ha[typeof self]&&self),Ma=b(Ha[typeof window]&&window),Na=Ja&&Ja.exports===Ia?Ia:null,Oa=b(Ha[typeof this]&&this),Pa=Ka||Ma!==(Oa&&Oa.window)&&Ma||La||Oa||Function("return this")(),Qa={internals:{},config:{Promise:Pa.Promise},helpers:{}},Ra=Qa.helpers.noop=function(){},Sa=Qa.helpers.identity=function(a){return a},Ta=Qa.helpers.defaultNow=Date.now,Ua=Qa.helpers.defaultComparer=function(a,b){return Vb(a,b)},Va=Qa.helpers.defaultSubComparer=function(a,b){return a>b?1:b>a?-1:0},Wa=(Qa.helpers.defaultKeySerializer=function(a){return a.toString()},Qa.helpers.defaultError=function(a){throw a}),Xa=Qa.helpers.isPromise=function(a){return!!a&&"function"!=typeof a.subscribe&&"function"==typeof a.then},Ya=Qa.helpers.isFunction=function(){var a=function(a){return"function"==typeof a||!1};return a(/x/)&&(a=function(a){return"function"==typeof a&&"[object Function]"==toString.call(a)}),a}(),Za={e:{}},$a=Qa.internals.tryCatch=function(a){if(!Ya(a))throw new TypeError("fn must be a function");return d(a)};Qa.config.longStackSupport=!1;var _a=!1,ab=$a(function(){throw new Error})();_a=!!ab.e&&!!ab.e.stack;var bb,cb=j(),db="From previous event:",eb=Qa.EmptyError=function(){this.message="Sequence contains no elements.",Error.call(this)};eb.prototype=Object.create(Error.prototype),eb.prototype.name="EmptyError";var fb=Qa.ObjectDisposedError=function(){this.message="Object has been disposed",Error.call(this)};fb.prototype=Object.create(Error.prototype),fb.prototype.name="ObjectDisposedError";var gb=Qa.ArgumentOutOfRangeError=function(){this.message="Argument out of range",Error.call(this)};gb.prototype=Object.create(Error.prototype),gb.prototype.name="ArgumentOutOfRangeError";var hb=Qa.NotSupportedError=function(a){this.message=a||"This operation is not supported",Error.call(this)};hb.prototype=Object.create(Error.prototype),hb.prototype.name="NotSupportedError";var ib=Qa.NotImplementedError=function(a){this.message=a||"This operation is not implemented",Error.call(this)};ib.prototype=Object.create(Error.prototype),ib.prototype.name="NotImplementedError";var jb=Qa.helpers.notImplemented=function(){throw new ib},kb=(Qa.helpers.notSupported=function(){throw new hb},"function"==typeof Symbol&&Symbol.iterator||"_es6shim_iterator_");Pa.Set&&"function"==typeof(new Pa.Set)["@@iterator"]&&(kb="@@iterator");var lb=Qa.doneEnumerator={done:!0,value:a},mb=Qa.helpers.isIterable=function(b){return b&&b[kb]!==a},nb=Qa.helpers.isArrayLike=function(b){return b&&b.length!==a};Qa.helpers.iterator=kb;var ob=Qa.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)}},pb=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],qb=(pb.length,"[object Arguments]"),rb="[object Array]",sb="[object Boolean]",tb="[object Date]",ub="[object Error]",vb="[object Function]",wb="[object Map]",xb="[object Number]",yb="[object Object]",zb="[object RegExp]",Ab="[object Set]",Bb="[object String]",Cb="[object WeakMap]",Db="[object ArrayBuffer]",Eb="[object Float32Array]",Fb="[object Float64Array]",Gb="[object Int8Array]",Hb="[object Int16Array]",Ib="[object Int32Array]",Jb="[object Uint8Array]",Kb="[object Uint8ClampedArray]",Lb="[object Uint16Array]",Mb="[object Uint32Array]",Nb={};Nb[Eb]=Nb[Fb]=Nb[Gb]=Nb[Hb]=Nb[Ib]=Nb[Jb]=Nb[Kb]=Nb[Lb]=Nb[Mb]=!0,Nb[qb]=Nb[rb]=Nb[Db]=Nb[sb]=Nb[tb]=Nb[ub]=Nb[vb]=Nb[wb]=Nb[xb]=Nb[yb]=Nb[zb]=Nb[Ab]=Nb[Bb]=Nb[Cb]=!1;var Ob=Object.prototype,Pb=Ob.hasOwnProperty,Qb=Ob.toString,Rb=Math.pow(2,53)-1,Sb=Object.keys||function(){var a=Object.prototype.hasOwnProperty,b=!{toString:null}.propertyIsEnumerable("toString"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],d=c.length;return function(e){if("object"!=typeof e&&("function"!=typeof e||null===e))throw new TypeError("Object.keys called on non-object");var f,g,h=[];for(f in e)a.call(e,f)&&h.push(f);if(b)for(g=0;d>g;g++)a.call(e,c[g])&&h.push(c[g]);return h}}(),ba=Qa.internals.isObject=function(a){var b=typeof a;return!!a&&("object"===b||"function"===b)},Tb=function(){try{Object({toString:0}+"")}catch(a){return function(){return!1}}return function(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}}(),Ub=Array.isArray||function(a){return n(a)&&o(a.length)&&Qb.call(a)===rb},Vb=Qa.internals.isEqual=function(a,b){return t(a,b)},Wb=({}.hasOwnProperty,Array.prototype.slice,Qa.internals.inherits=function(a,b){function c(){this.constructor=a}c.prototype=b.prototype,a.prototype=new c}),Xb=Qa.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]}},Yb=Qa.internals.addRef=function(a,b){return new xg(function(c){return new jc(b.getDisposable(),a.subscribe(c))})};v.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var Zb=Qa.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},$b=Zb.prototype;$b.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},$b.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)}}},$b.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)}}},$b.peek=function(){return this.items[0].value},$b.removeAt=function(b){this.items[b]=this.items[--this.length],this.items[this.length]=a,this.heapify()},$b.dequeue=function(){var a=this.peek();return this.removeAt(0),a},$b.enqueue=function(a){var b=this.length++;this.items[b]=new v(Zb.count++,a),this.percolate(b)},$b.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},Zb.count=0;var _b=Qa.CompositeDisposable=function(){var a,b,c=[];if(Array.isArray(arguments[0]))c=arguments[0];else for(b=arguments.length,c=new Array(b),a=0;b>a;a++)c[a]=arguments[a];this.disposables=c,this.isDisposed=!1,this.length=c.length},ac=_b.prototype;ac.add=function(a){this.isDisposed?a.dispose():(this.disposables.push(a),this.length++)},ac.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},ac.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 bc=Qa.Disposable=function(a){this.isDisposed=!1,this.action=a||Ra};bc.prototype.dispose=function(){this.isDisposed||(this.action(),this.isDisposed=!0)};var cc=bc.create=function(a){return new bc(a)},dc=bc.empty={dispose:Ra},ec=bc.isDisposable=function(a){return a&&Ya(a.dispose)},fc=bc.checkDisposed=function(a){if(a.isDisposed)throw new fb},gc=bc._fixup=function(a){return ec(a)?a:dc},hc=Qa.SingleAssignmentDisposable=function(){this.isDisposed=!1,this.current=null};hc.prototype.getDisposable=function(){return this.current},hc.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()},hc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null,a&&a.dispose()}};var ic=Qa.SerialDisposable=function(){this.isDisposed=!1,this.current=null};ic.prototype.getDisposable=function(){return this.current},ic.prototype.setDisposable=function(a){var b=this.isDisposed;if(!b){var c=this.current;this.current=a}c&&c.dispose(),b&&a&&a.dispose()},ic.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this.current;this.current=null}a&&a.dispose()};var jc=Qa.BinaryDisposable=function(a,b){this._first=a,this._second=b,this.isDisposed=!1};jc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;var a=this._first;this._first=null,a&&a.dispose();var b=this._second;this._second=null,b&&b.dispose()}};var kc=Qa.NAryDisposable=function(a){this._disposables=a,this.isDisposed=!1};kc.prototype.dispose=function(){if(!this.isDisposed){this.isDisposed=!0;for(var a=0,b=this._disposables.length;b>a;a++)this._disposables[a].dispose();this._disposables.length=0}};var lc=Qa.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?dc:new a(this)},b}();w.prototype.dispose=function(){this.scheduler.schedule(this,x)};var mc=Qa.internals.ScheduledItem=function(a,b,c,d,e){this.scheduler=a,this.state=b,this.action=c,this.dueTime=d,this.comparer=e||Va,this.disposable=new hc};mc.prototype.invoke=function(){this.disposable.setDisposable(this.invokeCore())},mc.prototype.compareTo=function(a){return this.comparer(this.dueTime,a.dueTime)},mc.prototype.isCancelled=function(){return this.disposable.isDisposed},mc.prototype.invokeCore=function(){return gc(this.action(this.scheduler,this.state))};var nc=Qa.Scheduler=function(){function a(){}a.isScheduler=function(b){return b instanceof a};var b=a.prototype;return b.schedule=function(a,b){throw new ib},b.scheduleFuture=function(b,c,d){var e=c;return e instanceof Date&&(e-=this.now()),e=a.normalize(e),0===e?this.schedule(b,d):this._scheduleFuture(b,e,d)},b._scheduleFuture=function(a,b,c){throw new ib},a.now=Ta,a.prototype.now=Ta,a.normalize=function(a){return 0>a&&(a=0),a},a}(),oc=nc.normalize,pc=nc.isScheduler;!function(a){function b(a,b){function c(b){function d(a,b){return g?f.remove(i):h=!0,e(b,c),dc}var g=!1,h=!1,i=a.schedule(b,d);h||(f.add(i),g=!0)}var d=b[0],e=b[1],f=new _b;return e(d,c),f}function c(a,b){function c(b,d){function g(a,b){return h?f.remove(j):i=!0,e(b,c),dc}var h=!1,i=!1,j=a.scheduleFuture(b,d,g);i||(f.add(j),h=!0)}var d=b[0],e=b[1],f=new _b;return e(d,c),f}a.scheduleRecursive=function(a,c){return this.schedule([a,c],b)},a.scheduleRecursiveFuture=function(a,b,d){return this.scheduleFuture([a,d],b,c)}}(nc.prototype),function(a){a.schedulePeriodic=function(a,b,c){if("undefined"==typeof Pa.setInterval)throw new hb;b=oc(b);var d=a,e=Pa.setInterval(function(){d=c(d)},b);return cc(function(){Pa.clearInterval(e)})}}(nc.prototype),function(a){a.catchError=a["catch"]=function(a){return new Cc(this,a)}}(nc.prototype);var qc,rc,sc=Qa.internals.SchedulePeriodicRecursive=function(){function a(a){return function(b,c){c(0,a._period);var d=$a(a._action)(a._state);d===Za&&(a._cancel.dispose(),e(d.e)),a._state=d}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new hc;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveFuture(0,this._period,a(this))),b},b}(),tc=function(a){function b(){a.call(this)}return Wb(b,a),b.prototype.schedule=function(a,b){return gc(b(this,a))},b}(nc),uc=nc.immediate=new tc,vc=function(a){function b(){for(;d.length>0;){var a=d.dequeue();!a.isCancelled()&&a.invoke()}}function c(){a.call(this)}var d;return Wb(c,a),c.prototype.schedule=function(a,c){var f=new mc(this,a,c,this.now());if(d)d.enqueue(f);else{d=new Zb(4),d.enqueue(f);var g=$a(b)();d=null,g===Za&&e(g.e)}return f.disposable},c.prototype.scheduleRequired=function(){return!d},c}(nc),wc=nc.currentThread=new vc,xc=function(){var a,b=Ra;if(Pa.setTimeout)a=Pa.setTimeout,b=Pa.clearTimeout;else{if(!Pa.WScript)throw new hb;a=function(a,b){Pa.WScript.Sleep(b),a()}}return{setTimeout:a,clearTimeout:b}}(),yc=xc.setTimeout,zc=xc.clearTimeout;!function(){function a(b){if(f)yc(function(){a(b)},0);else{var c=d[b];if(c){f=!0;var g=$a(c)();rc(b),f=!1,g===Za&&e(g.e)}}}function b(){if(!Pa.postMessage||Pa.importScripts)return!1;var a=!1,b=Pa.onmessage;return Pa.onmessage=function(){a=!0},Pa.postMessage("","*"),Pa.onmessage=b,a}var c=1,d={},f=!1;rc=function(a){delete d[a]};var g=new RegExp("^"+String(toString).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),h="function"==typeof(h=Ka&&Na&&Ka.setImmediate)&&!g.test(h)&&h;if(Ya(h))qc=function(b){var e=c++;return d[e]=b,h(function(){a(e)}),e};else if("undefined"!=typeof process&&"[object process]"==={}.toString.call(process))qc=function(b){var e=c++;return d[e]=b,process.nextTick(function(){a(e)}),e};else if(b()){var i="ms.rx.schedule"+Math.random(),j=function(b){"string"==typeof b.data&&b.data.substring(0,i.length)===i&&a(b.data.substring(i.length))};Pa.addEventListener("message",j,!1),qc=function(a){var b=c++;return d[b]=a,Pa.postMessage(i+b,"*"),b}}else if(Pa.MessageChannel){var k=new Pa.MessageChannel;k.port1.onmessage=function(b){a(b.data)},qc=function(a){var b=c++;return d[b]=a,k.port2.postMessage(b),b}}else qc="document"in Pa&&"onreadystatechange"in Pa.document.createElement("script")?function(b){var e=Pa.document.createElement("script"),f=c++;return d[f]=b,e.onreadystatechange=function(){a(f),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},Pa.document.documentElement.appendChild(e),f}:function(b){var e=c++;return d[e]=b,yc(function(){a(e)},0),e}}();var Ac=function(a){function b(){a.call(this)}function c(a,b,c,d){return function(){a.setDisposable(bc._fixup(b(c,d)))}}function d(a){this._id=a,this.isDisposed=!1}function e(a){this._id=a,this.isDisposed=!1}function f(a,b,c){return function(){b(a,c)}}return Wb(b,a),d.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,rc(this._id))},e.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,zc(this._id))},b.prototype.schedule=function(a,b){var e=new hc,f=qc(c(e,b,this,a));return new jc(e,new d(f))},b.prototype._scheduleFuture=function(a,b,d){if(0===b)return this.schedule(a,d);var f=new hc,g=yc(c(f,d,this,a),b);return new jc(f,new e(g))},b.prototype.scheduleLongRunning=function(a,b){var c=cc(Ra);return qc(f(a,b,c)),c},b}(nc),Bc=nc["default"]=nc.async=new Ac,Cc=function(a){function b(b,c){this._scheduler=b,this._handler=c,this._recursiveOriginal=null,this._recursiveWrapper=null,a.call(this)}return Wb(b,a),b.prototype.schedule=function(a,b){return this._scheduler.schedule(a,this._wrap(b))},b.prototype._scheduleFuture=function(a,b,c){return this._scheduler.schedule(a,b,this._wrap(c))},b.prototype.now=function(){return this._scheduler.now()},b.prototype._clone=function(a){return new b(a,this._handler)},b.prototype._wrap=function(a){var b=this;return function(c,d){var f=$a(a)(b._getRecursiveWrapper(c),d);return f===Za?(b._handler(f.e)||e(f.e),dc):gc(f)}},b.prototype._getRecursiveWrapper=function(a){if(this._recursiveOriginal!==a){this._recursiveOriginal=a;var b=this._clone(a);b._recursiveOriginal=a,b._recursiveWrapper=b,this._recursiveWrapper=b}return this._recursiveWrapper},b.prototype.schedulePeriodic=function(a,b,c){var d=this,f=!1,g=new hc;return g.setDisposable(this._scheduler.schedulePeriodic(a,b,function(a){if(f)return null;var b=$a(c)(a);return b===Za?(f=!0,d._handler(b.e)||e(b.e),g.dispose(),null):b})),g},b}(nc),Dc=Qa.Notification=function(){function a(){}return a.prototype._accept=function(a,b,c){throw new ib},a.prototype._acceptObserver=function(a,b,c){throw new ib},a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObserver(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return pc(a)||(a=uc),new xg(function(c){return a.schedule(b,function(a,b){b._acceptObserver(c),"N"===b.kind&&c.onCompleted()})})},a}(),Ec=function(a){function b(a){this.value=a,this.kind="N"}return Wb(b,a),b.prototype._accept=function(a){return a(this.value)},b.prototype._acceptObserver=function(a){return a.onNext(this.value)},b.prototype.toString=function(){return"OnNext("+this.value+")"},b}(Dc),Fc=function(a){function b(a){this.error=a,this.kind="E"}return Wb(b,a),b.prototype._accept=function(a,b){return b(this.error)},b.prototype._acceptObserver=function(a){return a.onError(this.error)},b.prototype.toString=function(){return"OnError("+this.error+")"},b}(Dc),Gc=function(a){function b(){this.kind="C"}return Wb(b,a),b.prototype._accept=function(a,b,c){return c()},b.prototype._acceptObserver=function(a){return a.onCompleted()},b.prototype.toString=function(){return"OnCompleted()"},b}(Dc),Hc=Dc.createOnNext=function(a){return new Ec(a)},Ic=Dc.createOnError=function(a){return new Fc(a)},Jc=Dc.createOnCompleted=function(){return new Gc},Kc=Qa.Observer=function(){};Kc.prototype.toNotifier=function(){var a=this;return function(b){return b.accept(a)}},Kc.prototype.asObserver=function(){var a=this;return new Oc(function(b){a.onNext(b)},function(b){a.onError(b)},function(){a.onCompleted()})},Kc.prototype.checked=function(){return new Pc(this)};var Lc=Kc.create=function(a,b,c){return a||(a=Ra),b||(b=Wa),c||(c=Ra),new Oc(a,b,c)};Kc.fromNotifier=function(a,b){var c=ob(a,b,1);return new Oc(function(a){return c(Hc(a))},function(a){return c(Ic(a))},function(){return c(Jc())})},Kc.prototype.notifyOn=function(a){return new Rc(a,this)},Kc.prototype.makeSafe=function(a){return new AnonymousSafeObserver(this._onNext,this._onError,this._onCompleted,a)};var Mc,Nc=Qa.internals.AbstractObserver=function(a){function b(){this.isStopped=!1}return Wb(b,a),b.prototype.next=jb,b.prototype.error=jb,b.prototype.completed=jb,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}(Kc),Oc=Qa.AnonymousObserver=function(a){function b(b,c,d){a.call(this),this._onNext=b,this._onError=c,this._onCompleted=d}return Wb(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}(Nc),Pc=function(a){function b(b){a.call(this),this._observer=b,this._state=0}Wb(b,a);var c=b.prototype;return c.onNext=function(a){this.checkAccess();var b=$a(this._observer.onNext).call(this._observer,a);this._state=0,b===Za&&e(b.e)},c.onError=function(a){this.checkAccess();var b=$a(this._observer.onError).call(this._observer,a);this._state=2,b===Za&&e(b.e)},c.onCompleted=function(){this.checkAccess();var a=$a(this._observer.onCompleted).call(this._observer);this._state=2,a===Za&&e(a.e)},c.checkAccess=function(){if(1===this._state)throw new Error("Re-entrancy detected");if(2===this._state)throw new Error("Observer completed");0===this._state&&(this._state=1)},b}(Kc),Qc=Qa.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 ic}function c(a,b){return function(){a.onNext(b)}}function d(a,b){return function(){a.onError(b)}}function f(a){return function(){a.onCompleted()}}function g(a,b){var c;if(!(a.queue.length>0))return void(a.isAcquired=!1);c=a.queue.shift();var d=$a(c)();return d===Za?(a.queue=[],a.hasFaulted=!0,e(d.e)):void b(a)}return Wb(b,a),b.prototype.next=function(a){this.queue.push(c(this.observer,a))},b.prototype.error=function(a){this.queue.push(d(this.observer,a))},b.prototype.completed=function(){this.queue.push(f(this.observer))},b.prototype.ensureActive=function(){var a=!1;!this.hasFaulted&&this.queue.length>0&&(a=!this.isAcquired,this.isAcquired=!0),a&&this.disposable.setDisposable(this.scheduler.scheduleRecursive(this,g))},b.prototype.dispose=function(){a.prototype.dispose.call(this),this.disposable.dispose()},b}(Nc),Rc=function(a){function b(b,c,d){a.call(this,b,c),this._cancel=d}return Wb(b,a),b.prototype.next=function(b){a.prototype.next.call(this,b),this.ensureActive()},b.prototype.error=function(b){a.prototype.error.call(this,b),this.ensureActive()},b.prototype.completed=function(){a.prototype.completed.call(this),this.ensureActive()},b.prototype.dispose=function(){a.prototype.dispose.call(this),this._cancel&&this._cancel.dispose(),this._cancel=null},b}(Qc),Sc=Qa.Observable=function(){function a(a,b){return function(c){var d=c.onError;return c.onError=function(b){f(b,a),d.call(c,b)},b.call(a,c)}}function b(){if(Qa.config.longStackSupport&&_a){var b=this._subscribe,c=$a(e)(new Error).e;this.stack=c.stack.substring(c.stack.indexOf("\n")+1),this._subscribe=a(this,b)}}return Mc=b.prototype,b.isObservable=function(a){return a&&Ya(a.subscribe)},Mc.subscribe=Mc.forEach=function(a,b,c){return this._subscribe("object"==typeof a?a:Lc(a,b,c))},Mc.subscribeOnNext=function(a,b){return this._subscribe(Lc("undefined"!=typeof b?function(c){a.call(b,c)}:a))},Mc.subscribeOnError=function(a,b){return this._subscribe(Lc(null,"undefined"!=typeof b?function(c){a.call(b,c)}:a))},Mc.subscribeOnCompleted=function(a,b){return this._subscribe(Lc(null,null,"undefined"!=typeof b?function(){a.call(b)}:a))},b}(),Tc=Qa.ObservableBase=function(a){function b(a){return a&&Ya(a.dispose)?a:Ya(a)?cc(a):dc}function c(a,c){var d=c[0],f=c[1],g=$a(f.subscribeCore).call(f,d);g!==Za||d.fail(Za.e)||e(Za.e),d.setDisposable(b(g))}function d(){a.call(this)}return Wb(d,a),d.prototype._subscribe=function(a){var b=new yg(a),d=[b,this];return wc.scheduleRequired()?wc.schedule(d,c):c(null,d),b},d.prototype.subscribeCore=jb,d}(Sc),Uc=Qa.FlatMapObservable=function(a){function b(b,c,d,e){this.resultSelector=Ya(d)?d:null,this.selector=ob(Ya(c)?c:function(){return c},e,3),this.source=b,a.call(this)}function c(a,b,c,d){this.i=0,this.selector=b,this.resultSelector=c,this.source=d,this.o=a,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a,this.selector,this.resultSelector,this))},Wb(c,Nc),c.prototype._wrapResult=function(a,b,c){return this.resultSelector?a.map(function(a,d){return this.resultSelector(b,a,c,d)},this):a},c.prototype.next=function(a){var b=this.i++,c=$a(this.selector)(a,b,this.source);return c===Za?this.o.onError(c.e):(Xa(c)&&(c=dd(c)),(nb(c)||mb(c))&&(c=Sc.from(c)),void this.o.onNext(this._wrapResult(c,a,b)))},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onCompleted()},b}(Tc),Vc=Qa.internals.Enumerable=function(){};y.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._s.isDisposed=!0)};var Wc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=$a(a.e.next).call(a.e);if(c===Za)return a.o.onError(c.e);if(c.done)return a.o.onCompleted();var e=c.value;Xa(e)&&(e=dd(e));var f=new hc;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new ic,d={isDisposed:!1,o:a,subscription:b,e:this.sources[kb]()},e=wc.scheduleRecursive(d,c);return new kc([b,e,new y(d)])},Wb(d,Nc),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.o.onError(a)},d.prototype.completed=function(){this._recurse(this._state)},b}(Tc);Vc.prototype.concat=function(){return new Wc(this)};var Xc=function(a){function b(b){this.sources=b,a.call(this)}function c(a,b){if(!a.isDisposed){var c=$a(a.e.next).call(a.e);if(c===Za)return a.o.onError(c.e);if(c.done)return null!==a.lastError?a.o.onError(a.lastError):a.o.onCompleted();var e=c.value;Xa(e)&&(e=dd(e));var f=new hc;a.subscription.setDisposable(f),f.setDisposable(e.subscribe(new d(a,b)))}}function d(a,b){this._state=a,this._recurse=b,Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new ic,d={isDisposed:!1,e:this.sources[kb](),subscription:b,lastError:null,o:a},e=wc.scheduleRecursive(d,c);return new kc([b,e,new y(d)])},Wb(d,Nc),d.prototype.next=function(a){this._state.o.onNext(a)},d.prototype.error=function(a){this._state.lastError=a,this._recurse(this._state)},d.prototype.completed=function(){this._state.o.onCompleted()},b}(Tc);Vc.prototype.catchError=function(){return new Xc(this)};var Yc=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 Wb(b,a),b.prototype[kb]=function(){return new c(this)},c.prototype.next=function(){return 0===this.l?lb:(this.l>0&&this.l--,{done:!1,value:this.v})},b}(Vc),Zc=Vc.repeat=function(a,b){return new Yc(a,b)},$c=function(a){function b(a,b,c){this.s=a,this.fn=b?ob(b,c,3):null}function c(a){this.i=-1,this.s=a.s,this.l=this.s.length,this.fn=a.fn}return Wb(b,a),b.prototype[kb]=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]}:lb},b}(Vc),_c=Vc.of=function(a,b,c){return new $c(a,b,c)},ad=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new Rc(this._s,a))},b}(Tc);Mc.observeOn=function(a){return new ad(this,a)};var bd=function(a){function b(b,c){this.source=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1],e=b[2];d.setDisposable(new w(a,c.subscribe(e)))}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new hc,d=new ic;return d.setDisposable(b),b.setDisposable(this._s.schedule([this.source,d,a],c)),d},b}(Tc);Mc.subscribeOn=function(a){return new bd(this,a)};var cd=function(a){function b(b,c){this._p=b,this._s=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];c.onNext(d),c.onCompleted()}function d(a,b){var c=b[0],d=b[1];c.onError(d)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new hc,e=this,f=this._p;return Ya(f)&&(f=$a(f)(),f===Za)?(a.onError(f.e),b):(f.then(function(d){b.setDisposable(e._s.schedule([a,d],c))},function(c){b.setDisposable(e._s.schedule([a,c],d))}),b)},b}(Tc),dd=Sc.fromPromise=function(a,b){return b||(b=Bc),new cd(a,b)};Mc.toPromise=function(a){if(a||(a=Qa.config.Promise),!a)throw new hb("Promise type not provided nor in Rx.config.Promise");var b=this;return new a(function(a,c){var d;b.subscribe(function(a){d=a},c,function(){a(d)})})};var ed=function(a){function b(b){this.source=b,a.call(this)}function c(a){this.o=a,this.a=[],Nc.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.source.subscribe(new c(a))},Wb(c,Nc),c.prototype.next=function(a){this.a.push(a)},c.prototype.error=function(a){this.o.onError(a)},c.prototype.completed=function(){this.o.onNext(this.a),this.o.onCompleted()},b}(Tc);Mc.toArray=function(){return new ed(this)},Sc.create=function(a,b){return new xg(a,b)};var fd=function(a){function b(b){this._f=b,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=$a(this._f)();return b===Za?yd(b.e).subscribe(a):(Xa(b)&&(b=dd(b)),b.subscribe(a))},b}(Tc),gd=Sc.defer=function(a){return new fd(a)},hd=function(a){function b(b){this.scheduler=b,a.call(this)}function c(a,b){this.observer=a,this.scheduler=b}function d(a,b){return b.onCompleted(),dc}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new c(a,this.scheduler);return b.run()},c.prototype.run=function(){var a=this.observer;return this.scheduler===uc?d(null,a):this.scheduler.schedule(a,d)},b}(Tc),id=new hd(uc),jd=Sc.empty=function(a){return pc(a)||(a=uc),a===uc?id:new hd(a)},kd=function(a){function b(b,c,d){this._iterable=b,this._fn=c,this._scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){var f=$a(b.next).call(b);if(f===Za)return a.onError(f.e);if(f.done)return a.onCompleted();var g=f.value;return Ya(c)&&(g=$a(c)(g,d),g===Za)?a.onError(g.e):(a.onNext(g),void e(d+1))}}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=Object(this._iterable),d=E(b);return this._scheduler.scheduleRecursive(0,c(a,d,this._fn))},b}(Tc),ld=Math.pow(2,53)-1;z.prototype[kb]=function(){return new A(this._s)},A.prototype[kb]=function(){return this},A.prototype.next=function(){return this._i<this._l?{done:!1,value:this._s.charAt(this._i++)}:lb},B.prototype[kb]=function(){return new C(this._a)},C.prototype[kb]=function(){return this},C.prototype.next=function(){return this._i<this._l?{done:!1,value:this._a[this._i++]}:lb};var md=Sc.from=function(a,b,c,d){if(null==a)throw new Error("iterable cannot be null.");if(b&&!Ya(b))throw new Error("mapFn when provided must be a function");if(b)var e=ob(b,c,2);return pc(d)||(d=wc),new kd(a,e,d)},nd=function(a){function b(b,c){this._args=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b.length;return function(d,e){c>d?(a.onNext(b[d]),e(d+1)):a.onCompleted()}}return Wb(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._args))},b}(Tc),od=Sc.fromArray=function(a,b){return pc(b)||(b=wc),new nd(a,b)},pd=function(a){function b(b,c,d,e,f){this._initialState=b,this._cndFn=c,this._itrFn=d,this._resFn=e,this._s=f,a.call(this)}function c(a,b){if(a.first)a.first=!1;else if(a.newState=$a(a.self._itrFn)(a.newState),a.newState===Za)return a.o.onError(a.newState.e);var c=$a(a.self._cndFn)(a.newState);if(c===Za)return a.o.onError(c.e);if(c){var d=$a(a.self._resFn)(a.newState);if(d===Za)return a.o.onError(d.e);a.o.onNext(d),b(a)}else a.o.onCompleted()}return Wb(b,a),b.prototype.subscribeCore=function(a){var b={o:a,self:this,first:!0,newState:this._initialState};return this._s.scheduleRecursive(b,c)},b}(Tc);Sc.generate=function(a,b,c,d,e){return pc(e)||(e=wc),new pd(a,b,c,d,e)},Sc.of=function(){for(var a=arguments.length,b=new Array(a),c=0;a>c;c++)b[c]=arguments[c];return new nd(b,wc)},Sc.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 nd(c,a)},Sc.ofArrayChanges=function(a){if(!Array.isArray(a))throw new TypeError("Array.observe only accepts arrays.");if("function"!=typeof Array.observe&&"function"!=typeof Array.unobserve)throw new TypeError("Array.observe is not supported on your platform");return new xg(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Array.observe(a,c),function(){Array.unobserve(a,c)}})},Sc.ofObjectChanges=function(a){if(null==a)throw new TypeError("object must not be null or undefined.");if("function"!=typeof Object.observe&&"function"!=typeof Object.unobserve)throw new TypeError("Object.observe is not supported on your platform");return new xg(function(b){function c(a){for(var c=0,d=a.length;d>c;c++)b.onNext(a[c])}return Object.observe(a,c),function(){Object.unobserve(a,c)}})};var qd=function(a){function b(){a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){return dc},b}(Tc),rd=new qd,sd=Sc.never=function(){return rd},td=function(a){function b(b,c){this._o=b,this._keys=Object.keys(b),this._scheduler=c,a.call(this)}function c(a,b,c){return function(d,e){if(d<c.length){var f=c[d];a.onNext([f,b[f]]),e(d+1)}else a.onCompleted()}}return Wb(b,a),b.prototype.subscribeCore=function(a){return this._scheduler.scheduleRecursive(0,c(a,this._o,this._keys))},b}(Tc);Sc.pairs=function(a,b){return b||(b=wc),new td(a,b)};var ud=function(a){function b(b,c,d){this.start=b,this.rangeCount=c,this.scheduler=d,a.call(this)}function c(a,b,c){return function(d,e){b>d?(c.onNext(a+d),e(d+1)):c.onCompleted()}}return Wb(b,a),b.prototype.subscribeCore=function(a){return this.scheduler.scheduleRecursive(0,c(this.start,this.rangeCount,a))},b}(Tc);Sc.range=function(a,b,c){return pc(c)||(c=wc),new ud(a,b,c)};var vd=function(a){function b(b,c,d){this.value=b,this.repeatCount=null==c?-1:c,this.scheduler=d,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new I(a,this);return b.run()},b}(Tc);I.prototype.run=function(){function a(a,d){return(-1===a||a>0)&&(b.onNext(c),a>0&&a--),0===a?b.onCompleted():void d(a)}var b=this.observer,c=this.parent.value;return this.parent.scheduler.scheduleRecursive(this.parent.repeatCount,a)},Sc.repeat=function(a,b,c){return pc(c)||(c=wc),new vd(a,b,c)};var wd=function(a){function b(b,c){this._value=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onNext(c),d.onCompleted(),dc}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=[this._value,a];return this._scheduler===uc?c(null,b):this._scheduler.schedule(b,c)},b}(Tc),xd=(Sc["return"]=Sc.just=function(a,b){return pc(b)||(b=uc),new wd(a,b)},function(a){function b(b,c){this._error=b,this._scheduler=c,a.call(this)}function c(a,b){var c=b[0],d=b[1];return d.onError(c),dc}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=[this._error,a];return this._scheduler===uc?c(null,b):this._scheduler.schedule(b,c)},b}(Tc)),yd=Sc["throw"]=function(a,b){return pc(b)||(b=uc),new xd(a,b)},zd=function(a){function b(b,c){this._resFn=b,this._obsFn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=dc,c=$a(this._resFn)();if(c===Za)return new jc(yd(c.e).subscribe(a),b);c&&(b=c);var d=$a(this._obsFn)(c);return d===Za?new jc(yd(d.e).subscribe(a),b):new jc(d.subscribe(a),b)},b}(Tc);Sc.using=function(a,b){return new zd(a,b)},Mc.amb=function(a){var b=this;return new xg(function(c){function d(){f||(f=g,j.dispose())}function e(){f||(f=h,i.dispose())}var f,g="L",h="R",i=new hc,j=new hc;Xa(a)&&(a=dd(a));var k=Lc(function(a){d(),f===g&&c.onNext(a)},function(a){d(),f===g&&c.onError(a)},function(){d(),f===g&&c.onCompleted()}),l=Lc(function(a){e(),f===h&&c.onNext(a)},function(a){e(),f===h&&c.onError(a)},function(){e(),f===h&&c.onCompleted()});return i.setDisposable(b.subscribe(k)),j.setDisposable(a.subscribe(l)),new jc(i,j)})},Sc.amb=function(){var a,b=sd();if(Array.isArray(arguments[0]))a=arguments[0];else{var c=arguments.length;a=new Array(a);for(var d=0;c>d;d++)a[d]=arguments[d]}for(var d=0,c=a.length;c>d;d++)b=J(b,a[d]);return b};var Ad=function(a){function b(b,c){this.source=b,this._fn=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){var b=new hc,c=new ic;return c.setDisposable(b),b.setDisposable(this.source.subscribe(new Bd(a,c,this._fn))),c},b}(Tc),Bd=function(a){function b(b,c,d){this._o=b,this._s=c,this._fn=d,a.call(this)}return Wb(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=$a(this._fn)(a);if(b===Za)return this._o.onError(b.e);Xa(b)&&(b=dd(b));var c=new hc;this._s.setDisposable(c),c.setDisposable(b.subscribe(this._o))},b}(Nc);Mc["catch"]=function(a){return Ya(a)?new Ad(this,a):Cd([this,a])};var Cd=Sc["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 _c(a).catchError()};Mc.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),Fd.apply(this,b)};var Dd=function(a){function b(b,c){this._params=b,this._cb=c,a.call(this)}return Wb(b,a),b.prototype.subscribeCore=function(a){for(var b=this._params.length,c=new Array(b),d={hasValue:u(b,K),hasValueAll:!1,isDone:u(b,K),values:new Array(b)},e=0;b>e;e++){var f=this._params[e],g=new hc;c[e]=g,Xa(f)&&(f=dd(f)),g.setDisposable(f.subscribe(new Ed(a,e,this._cb,d)))}return new kc(c)},b}(Tc),Ed=function(a){function b(b,c,d,e){this._o=b,this._i=c,this._cb=d,this._state=e,a.call(this)}function c(a){return function(b,c){return c!==a}}return Wb(b,a),b.prototype.next=function(a)