UNPKG

rxjs

Version:

Reactive Extensions for modern JavaScript

119 lines (117 loc) 80.8 kB
/** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /** @license Apache License 2.0 https://github.com/ReactiveX/RxJS/blob/master/LICENSE.txt **/ /* ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. *****************************************************************************/ (function(l,v){"object"===typeof exports&&"undefined"!==typeof module?v(exports):"function"===typeof define&&define.amd?define("rxjs",["exports"],v):v(l.rxjs={})})(this,function(l){function v(b,a){function c(){this.constructor=b}Ca(b,a);b.prototype=null===a?Object.create(a):(c.prototype=a.prototype,new c)}function uc(b,a){var c={},d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&0>a.indexOf(d)&&(c[d]=b[d]);if(null!=b&&"function"===typeof Object.getOwnPropertySymbols){var e=0;for(d=Object.getOwnPropertySymbols(b);e< d.length;e++)0>a.indexOf(d[e])&&Object.prototype.propertyIsEnumerable.call(b,d[e])&&(c[d[e]]=b[d[e]])}return c}function vc(b,a,c,d){return new (c||(c=Promise))(function(e,f){function g(a){try{h(d.next(a))}catch(q){f(q)}}function k(a){try{h(d["throw"](a))}catch(q){f(q)}}function h(a){a.done?e(a.value):(new c(function(b){b(a.value)})).then(g,k)}h((d=d.apply(b,a||[])).next())})}function cb(b,a){function c(a){return function(b){return d([a,b])}}function d(c){if(f)throw new TypeError("Generator is already executing."); for(;e;)try{if(f=1,g&&(k=c[0]&2?g["return"]:c[0]?g["throw"]||((k=g["return"])&&k.call(g),0):g.next)&&!(k=k.call(g,c[1])).done)return k;if(g=0,k)c=[c[0]&2,k.value];switch(c[0]){case 0:case 1:k=c;break;case 4:return e.label++,{value:c[1],done:!1};case 5:e.label++;g=c[1];c=[0];continue;case 7:c=e.ops.pop();e.trys.pop();continue;default:if(!(k=e.trys,k=0<k.length&&k[k.length-1])&&(6===c[0]||2===c[0])){e=0;continue}if(3===c[0]&&(!k||c[1]>k[0]&&c[1]<k[3]))e.label=c[1];else if(6===c[0]&&e.label<k[1])e.label= k[1],k=c;else if(k&&e.label<k[2])e.label=k[2],e.ops.push(c);else{k[2]&&e.ops.pop();e.trys.pop();continue}}c=a.call(b,e)}catch(q){c=[6,q],g=0}finally{f=k=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}var e={label:0,sent:function(){if(k[0]&1)throw k[1];return k[1]},trys:[],ops:[]},f,g,k,h;return h={next:c(0),"throw":c(1),"return":c(2)},"function"===typeof Symbol&&(h[Symbol.iterator]=function(){return this}),h}function D(b){var a="function"===typeof Symbol&&b[Symbol.iterator],c=0;return a? a.call(b):{next:function(){b&&c>=b.length&&(b=void 0);return{value:b&&b[c++],done:!b}}}}function db(b,a){var c="function"===typeof Symbol&&b[Symbol.iterator];if(!c)return b;b=c.call(b);var d,e=[],f;try{for(;(void 0===a||0<a--)&&!(d=b.next()).done;)e.push(d.value)}catch(g){f={error:g}}finally{try{d&&!d.done&&(c=b["return"])&&c.call(b)}finally{if(f)throw f.error;}}return e}function x(){for(var b=[],a=0;a<arguments.length;a++)b=b.concat(db(arguments[a]));return b}function wc(b){function a(a){e[a]=b[a]&& function(d){return new Promise(function(e,f){d=b[a](d);c(e,f,d.done,d.value)})}}function c(a,c,b,d){Promise.resolve(d).then(function(c){a({value:c,done:b})},c)}if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var d=b[Symbol.asyncIterator],e;return d?d.call(b):(b="function"===typeof D?D(b):b[Symbol.iterator](),e={},a("next"),a("throw"),a("return"),e[Symbol.asyncIterator]=function(){return this},e)}function r(b){return"function"===typeof b}function M(b){b=b(function(a){Error.call(a); a.stack=Error().stack});b.prototype=Object.create(Error.prototype);return b.prototype.constructor=b}function H(b,a){b&&(a=b.indexOf(a),0<=a&&b.splice(a,1))}function eb(b){return b instanceof z||b&&"closed"in b&&r(b.remove)&&r(b.add)&&r(b.unsubscribe)}function fb(b){U.setTimeout(function(){var a=N.onUnhandledError;if(a)a(b);else throw b;})}function B(){}function I(b,a,c){return{kind:b,value:a,error:c}}function gb(b){if(N.useDeprecatedSynchronousErrorHandling)throw b;fb(b)}function Da(b,a){var c=N.onStoppedNotification; c&&U.setTimeout(function(){return c(b,a)})}function C(b){return b}function Ea(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];return hb(b)}function hb(b){return 0===b.length?C:1===b.length?b[0]:function(a){return b.reduce(function(a,b){return b(a)},a)}}function ib(b){var a;return null!==(a=null!==b&&void 0!==b?b:N.Promise)&&void 0!==a?a:Promise}function n(b){return function(a){if(r(null===a||void 0===a?void 0:a.lift))return a.lift(function(a){try{return b(a,this)}catch(d){this.error(d)}}); throw new TypeError("Unable to lift unknown Observable type");}}function Fa(){return n(function(b,a){var c=null;b._refCount++;var d=new p(a,void 0,void 0,void 0,function(){if(!b||0>=b._refCount||0<--b._refCount)c=null;else{var d=b._connection,f=c;c=null;!d||f&&d!==f||d.unsubscribe();a.unsubscribe()}});b.subscribe(d);d.closed||(c=b.connect())})}function jb(b){var a=O.schedule;return new t(function(c){var d=new z,e=b||qa,f=e.now(),g=function(k){var h=e.now();c.next({timestamp:b?h:k,elapsed:h-f});c.closed|| d.add(a(g))};d.add(a(g));return d})}function kb(b){return b in Ga?(delete Ga[b],!0):!1}function xc(b){return new t(function(a){return b.schedule(function(){return a.complete()})})}function Ha(b,a){return new t(function(c){var d=0;return a.schedule(function(){d===b.length?c.complete():(c.next(b[d++]),c.closed||this.schedule())})})}function yc(b,a){return new t(function(c){var d=new z;d.add(a.schedule(function(){var e=b[V]();d.add(e.subscribe({next:function(b){d.add(a.schedule(function(){return c.next(b)}))}, error:function(b){d.add(a.schedule(function(){return c.error(b)}))},complete:function(){d.add(a.schedule(function(){return c.complete()}))}}))}));return d})}function zc(b,a){return new t(function(c){return a.schedule(function(){return b.then(function(b){c.add(a.schedule(function(){c.next(b);c.add(a.schedule(function(){return c.complete()}))}))},function(b){c.add(a.schedule(function(){return c.error(b)}))})})})}function lb(b,a,c,d){void 0===d&&(d=0);a=a.schedule(function(){try{c.call(this)}catch(e){b.error(e)}}, d);b.add(a);return a}function mb(b,a){return new t(function(c){var d;c.add(a.schedule(function(){d=b[ra]();lb(c,a,function(){var a=d.next(),b=a.value;a.done?c.complete():(c.next(b),this.schedule())})}));return function(){return r(null===d||void 0===d?void 0:d.return)&&d.return()}})}function nb(b){return r(null===b||void 0===b?void 0:b[ra])}function Ac(b,a){if(!b)throw Error("Iterable cannot be null");return new t(function(c){var d=new z;d.add(a.schedule(function(){var e=b[Symbol.asyncIterator](); d.add(a.schedule(function(){var a=this;e.next().then(function(b){b.done?c.complete():(c.next(b.value),a.schedule())})}))}));return d})}function ob(b){return Symbol.asyncIterator&&r(null===b||void 0===b?void 0:b[Symbol.asyncIterator])}function pb(b){return new TypeError("You provided "+(null!==b&&"object"===typeof b?"an invalid object":"'"+b+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, AsyncIterable, or Iterable.")}function qb(b,a){if(null!=b){if(r(b[V]))return yc(b, a);if(Ia(b))return Ha(b,a);if(r(null===b||void 0===b?void 0:b.then))return zc(b,a);if(ob(b))return Ac(b,a);if(nb(b))return mb(b,a)}throw pb(b);}function Ja(b,a){return a?qb(b,a):u(b)}function u(b){if(b instanceof t)return b;if(null!=b){if(r(b[V]))return Bc(b);if(Ia(b))return rb(b);if(r(null===b||void 0===b?void 0:b.then))return Cc(b);if(ob(b))return Dc(b);if(nb(b))return Ec(b)}throw pb(b);}function Bc(b){return new t(function(a){var c=b[V]();if(r(c.subscribe))return c.subscribe(a);throw new TypeError("Provided object does not correctly implement Symbol.observable"); })}function rb(b){return new t(function(a){for(var c=0;c<b.length&&!a.closed;c++)a.next(b[c]);a.complete()})}function Cc(b){return new t(function(a){b.then(function(b){a.closed||(a.next(b),a.complete())},function(b){return a.error(b)}).then(null,fb)})}function Ec(b){return new t(function(a){for(var c=b[ra]();!a.closed;){var d=c.next(),e=d.value;d.done?a.complete():a.next(e)}return function(){return r(null===c||void 0===c?void 0:c.return)&&c.return()}})}function Dc(b){return new t(function(a){Fc(b, a).catch(function(b){return a.error(b)})})}function Fc(b,a){var c,d,e,f;return vc(this,void 0,void 0,function(){var g,k;return cb(this,function(h){switch(h.label){case 0:h.trys.push([0,5,6,11]),c=wc(b),h.label=1;case 1:return[4,c.next()];case 2:if(d=h.sent(),d.done)return[3,4];g=d.value;a.next(g);h.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return k=h.sent(),e={error:k},[3,11];case 6:return h.trys.push([6,,9,10]),d&&!d.done&&(f=c.return)?[4,f.call(c)]:[3,8];case 7:h.sent(),h.label=8;case 8:return[3, 10];case 9:if(e)throw e.error;return[7];case 10:return[7];case 11:return a.complete(),[2]}})})}function W(b,a){return a?Ha(b,a):rb(b)}function sa(b){return b&&r(b.schedule)}function fa(b){return r(b[b.length-1])?b.pop():void 0}function J(b){return sa(b[b.length-1])?b.pop():void 0}function Ka(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];return(a=J(b))?Ha(b,a):W(b)}function sb(b,a){var c=r(b)?b:function(){return b},d=function(a){return a.error(c())};return new t(a?function(b){return a.schedule(d, 0,b)}:d)}function ta(b,a){var c,d,e,f=b.kind,g=b.value;b=b.error;if("string"!==typeof f)throw new TypeError('Invalid notification, missing "kind"');"N"===f?null===(c=a.next)||void 0===c?void 0:c.call(a,g):"E"===f?null===(d=a.error)||void 0===d?void 0:d.call(a,b):null===(e=a.complete)||void 0===e?void 0:e.call(a)}function La(b){return b instanceof Date&&!isNaN(b)}function tb(b,a){b=La(b)?{first:b}:"number"===typeof b?{each:b}:b;var c=b.first,d=b.each,e=b.with,f=void 0===e?Gc:e,e=b.scheduler,g=void 0=== e?null!==a&&void 0!==a?a:G:e;a=b.meta;var k=void 0===a?null:a;if(null==c&&null==d)throw new TypeError("No timeout provided.");return n(function(a,b){var e,h,m=null,ub=0,l=function(a){h=lb(b,g,function(){e.unsubscribe();u(f({meta:k,lastValue:m,seen:ub})).subscribe(b)},a)};e=a.subscribe(new p(b,function(a){null===h||void 0===h?void 0:h.unsubscribe();ub++;b.next(m=a);0<d&&l(d)},void 0,void 0,function(){(null===h||void 0===h?0:h.closed)||(null===h||void 0===h?void 0:h.unsubscribe());m=null}));l(null!= c?"number"===typeof c?c:+c-g.now():d)})}function Gc(b){throw new vb(b);}function wb(b,a){void 0===a&&(a=0);return n(function(c,d){d.add(b.schedule(function(){return c.subscribe(d)},a))})}function K(b,a){return n(function(c,d){var e=0;c.subscribe(new p(d,function(c){d.next(b.call(a,c,e++))}))})}function Y(b){return K(function(a){return Ic(a)?b.apply(void 0,x(a)):b(a)})}function xb(b,a){void 0===a&&(a=0);return n(function(c,d){c.subscribe(new p(d,function(c){return d.add(b.schedule(function(){return d.next(c)}, a))},function(c){return d.add(b.schedule(function(){return d.error(c)},a))},function(){return d.add(b.schedule(function(){return d.complete()},a))}))})}function ua(b,a,c,d){if(c)if(sa(c))d=c;else return function(){for(var e=[],g=0;g<arguments.length;g++)e[g]=arguments[g];return ua(b,a,d).apply(this,e).pipe(Y(c))};if(d)return function(){for(var c=[],e=0;e<arguments.length;e++)c[e]=arguments[e];return ua(b,a).apply(this,c).pipe(wb(d),xb(d))};var e=new Ma;return function(){for(var c=this,d=[],k=0;k< arguments.length;k++)d[k]=arguments[k];var h=!0;return new t(function(f){f=e.subscribe(f);if(h){var g=h=!1,k=!1;a.apply(c,x(d,[function(){for(var a=[],c=0;c<arguments.length;c++)a[c]=arguments[c];if(b&&(c=a.shift(),null!=c)){e.error(c);return}e.next(1<a.length?a:a[0]);k=!0;g&&e.complete()}]));k&&e.complete();g=!0}return f})}}function yb(b){if(1===b.length){var a=b[0];if(Jc(a))return{args:a,keys:null};if(a&&"object"===typeof a&&Kc(a)===Lc)return b=Mc(a),{args:b.map(function(b){return a[b]}),keys:b}}return{args:b, keys:null}}function zb(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];var c=J(b),a=fa(b),b=yb(b),d=b.keys,b=new t(Ab(b.args,c,d?function(a){for(var b={},c=0;c<a.length;c++)b[d[c]]=a[c];return b}:C));return a?b.pipe(Y(a)):b}function Ab(b,a,c){void 0===c&&(c=C);return function(d){Bb(a,function(){for(var e=b.length,f=Array(e),g=e,k=b.map(function(){return!1}),h=!0,m=function(e){Bb(a,function(){Ja(b[e],a).subscribe(new Nc(d,function(a){f[e]=a;h&&(k[e]=!0,h=!k.every(C));h||d.next(c(f.slice()))}, function(){return 0===--g}))},d)},q=0;q<e;q++)m(q)},d)}}function Bb(b,a,c){b?c.add(b.schedule(a)):a()}function Na(b,a,c,d,e,f,g,k){var h=[],m=0,q=0,y=!1,w=function(a){return m<d?l(a):h.push(a)},l=function(b){f&&a.next(b);m++;u(c(b,q++)).subscribe(new p(a,function(b){null===e||void 0===e?void 0:e(b);f?w(b):a.next(b)},void 0,function(){m--;for(var b=function(){var b=h.shift();g?a.add(g.schedule(function(){return l(b)})):l(b)};h.length&&m<d;)b();!y||h.length||m||a.complete()}))};b.subscribe(new p(a, w,void 0,function(){y=!0;!y||h.length||m||a.complete()}));return function(){h=null;null===k||void 0===k?void 0:k()}}function F(b,a,c){void 0===c&&(c=Infinity);if(r(a))return F(function(c,e){return K(function(b,d){return a(c,b,e,d)})(u(b(c,e)))},c);"number"===typeof a&&(c=a);return n(function(a,e){return Na(a,e,b,c)})}function va(b){void 0===b&&(b=Infinity);return F(C,b)}function Oa(){return va(1)}function ga(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];return Oa()(W(b,J(b)))}function wa(b){return new t(function(a){u(b()).subscribe(a)})} function Cb(b,a){return new t(function(c){var d=b.length;if(0===d)c.complete();else for(var e=Array(d),f=0,g=0,k=function(k){var h=u(b[k]),m=!1;c.add(h.subscribe({next:function(a){m||(m=!0,g++);e[k]=a},error:function(a){return c.error(a)},complete:function(){f++;f!==d&&m||(g===d&&c.next(a?a.reduce(function(a,b,c){return a[b]=e[c],a},{}):e),c.complete())}}))},h=0;h<d;h++)k(h)})}function Pa(b,a,c,d){r(c)&&(d=c,c=void 0);if(d)return Pa(b,a,c).pipe(Y(d));d=db(Pc(b)?Qc.map(function(d){return function(e){return b[d](a, e,c)}}):Rc(b)?Sc.map(Db(b,a)):Tc(b)?Uc.map(Db(b,a)):[],2);var e=d[0],f=d[1];return!e&&Ia(b)?F(function(b){return Pa(b,a,c)})(W(b)):new t(function(a){if(!e)throw new TypeError("Invalid event target");var b=function(){for(var b=[],c=0;c<arguments.length;c++)b[c]=arguments[c];return a.next(1<b.length?b:b[0])};e(b);return function(){return f(b)}})}function Db(b,a){return function(c){return function(d){return b[c](a,d)}}}function Rc(b){return r(b.addListener)&&r(b.removeListener)}function Tc(b){return r(b.on)&& r(b.off)}function Pc(b){return r(b.addEventListener)&&r(b.removeEventListener)}function Eb(b,a,c){return c?Eb(b,a).pipe(Y(c)):new t(function(c){var d=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return c.next(1===a.length?a[0]:a)},f=b(d);return r(a)?function(){return a(d,f)}:void 0})}function Z(b,a,c){void 0===b&&(b=0);void 0===c&&(c=ha);var d=-1;null!=a&&(sa(a)?c=a:d=a);return new t(function(a){var e=La(b)?+b-c.now():b;0>e&&(e=0);var g=0;return c.schedule(function(){a.closed|| (a.next(g++),0<=d?this.schedule(void 0,d):a.complete())},e)})}function Fb(b,a){void 0===b&&(b=0);void 0===a&&(a=G);0>b&&(b=0);return Z(b,b,a)}function P(b){return 1===b.length&&Vc(b[0])?b[0]:b}function Gb(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];var c=P(b);return n(function(a,b){var d=x([a],c),e=function(){if(!b.closed)if(0<d.length){var a=void 0;try{a=u(d.shift())}catch(m){e();return}var c=new p(b,void 0,B,B);b.add(a.subscribe(c));c.add(e)}else b.complete()};e()})}function Hb(b, a){return function(c,d){return!b.call(a,c,d)}}function L(b,a){return n(function(c,d){var e=0;c.subscribe(new p(d,function(c){return b.call(a,c,e++)&&d.next(c)}))})}function Ib(b){return function(a){for(var c=[],d=function(d){c.push(u(b[d]).subscribe(new p(a,function(b){if(c){for(var e=0;e<c.length;e++)e!==d&&c[e].unsubscribe();c=null}a.next(b)})))},e=0;c&&!a.closed&&e<b.length;e++)d(e)}}function Qa(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];var c=fa(b),d=P(b);return d.length?new t(function(a){var b= d.map(function(){return[]}),e=d.map(function(){return!1});a.add(function(){b=e=null});for(var k=function(f){u(d[f]).subscribe(new p(a,function(d){b[f].push(d);b.every(function(a){return a.length})&&(d=b.map(function(a){return a.shift()}),a.next(c?c.apply(void 0,x(d)):d),b.some(function(a,b){return!a.length&&e[b]})&&a.complete())},void 0,function(){e[f]=!0;!b[f].length&&a.complete()}))},h=0;!a.closed&&h<d.length;h++)k(h);return function(){b=e=null}}):E}function Jb(b){return n(function(a,c){var d=!1, e=null,f=null,g=!1,k=function(){null===f||void 0===f?void 0:f.unsubscribe();f=null;if(d){d=!1;var a=e;e=null;c.next(a)}g&&c.complete()},h=function(){f=null;g&&c.complete()};a.subscribe(new p(c,function(a){d=!0;e=a;f||u(b(a)).subscribe(f=new p(c,k,void 0,h))},void 0,function(){g=!0;d&&f&&!f.closed||c.complete()}))})}function Kb(b){return n(function(a,c){var d=null,e=!1,f,d=a.subscribe(new p(c,void 0,function(g){f=u(b(g,Kb(b)(a)));d?(d.unsubscribe(),d=null,f.subscribe(c)):e=!0}));e&&(d.unsubscribe(), d=null,f.subscribe(c))})}function Lb(b,a,c,d,e){return function(f,g){var k=c,h=a,m=0;f.subscribe(new p(g,function(a){var c=m++;h=k?b(h,a,c):(k=!0,a);d&&g.next(h)},void 0,e&&function(){k&&g.next(h);g.complete()}))}}function ia(b,a){return n(Lb(b,a,2<=arguments.length,!1,!0))}function Mb(){return n(function(b,a){ia(Wc,[])(b).subscribe(a)})}function Nb(b,a){return Ea(Mb(),F(function(a){return b(a)}),a?Y(a):C)}function Ra(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];return(a=fa(b))?Ea(Ra.apply(void 0, x(b)),Y(a)):n(function(a,d){Ab(x([a],P(b)))(d)})}function Sa(b,a){return r(a)?F(b,a,1):F(b,1)}function Ob(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];var c=J(b);return n(function(a,e){Oa()(W(x([a],b),c)).subscribe(e)})}function Pb(b){return n(function(a,c){var d=!1,e=null,f=null,g=function(){null===f||void 0===f?void 0:f.unsubscribe();f=null;if(d){d=!1;var a=e;e=null;c.next(a)}};a.subscribe(new p(c,function(a){null===f||void 0===f?void 0:f.unsubscribe();d=!0;e=a;f=new p(c,g,void 0, B);u(b(a)).subscribe(f)},void 0,function(){g();c.complete()},function(){e=f=null}))})}function xa(b){void 0===b&&(b=null);return n(function(a,c){var d=!1;a.subscribe(new p(c,function(a){d=!0;c.next(a)},void 0,function(){d||c.next(b);c.complete()}))})}function ja(b){return 0>=b?function(){return E}:n(function(a,c){var d=0;a.subscribe(new p(c,function(a){++d<=b&&(c.next(a),b<=d&&c.complete())}))})}function Qb(){return n(function(b,a){b.subscribe(new p(a,B))})}function Rb(b){return n(function(a,c){a.subscribe(new p(c, function(){return c.next(b)}))})}function Ta(b,a){return a?function(c){return ga(a.pipe(ja(1),Qb()),c.pipe(Ta(b)))}:F(function(a,d){return b(a,d).pipe(ja(1),Rb(a))})}function Sb(b,a){b=null!==b&&void 0!==b?b:Xc;return n(function(c,d){var e,f=!0;c.subscribe(new p(d,function(c){(f&&(e=c,1)||!b(e,e=a?a(c):c))&&d.next(c);f=!1}))})}function Xc(b,a){return b===a}function ya(b){void 0===b&&(b=Yc);return n(function(a,c){var d=!1;a.subscribe(new p(c,function(a){d=!0;c.next(a)},void 0,function(){return d?c.complete(): c.error(b())}))})}function Yc(){return new Q}function Tb(b,a){return a?function(c){return c.pipe(Tb(function(c,e){return u(b(c,e)).pipe(K(function(b,d){return a(c,b,e,d)}))}))}:n(function(a,d){var c=0,f=null,g=!1;a.subscribe(new p(d,function(a){f||(f=new p(d,void 0,void 0,function(){f=null;g&&d.complete()}),u(b(a,c++)).subscribe(f))},void 0,function(){g=!0;!f&&d.complete()}))})}function Ub(b,a,c){var d="index"===c;return function(c,f){var e=0;c.subscribe(new p(f,function(g){var k=e++;b.call(a,g,k, c)&&(f.next(d?k:g),f.complete())},void 0,function(){f.next(d?-1:void 0);f.complete()}))}}function Vb(b){return 0>=b?function(){return E}:n(function(a,c){var d=[];a.subscribe(new p(c,function(a){d.push(a);b<d.length&&d.shift()},void 0,function(){var a,b;try{for(var g=D(d),k=g.next();!k.done;k=g.next())c.next(k.value)}catch(h){a={error:h}}finally{try{k&&!k.done&&(b=g.return)&&b.call(g)}finally{if(a)throw a.error;}}c.complete()},function(){d=null}))})}function Wb(){for(var b=[],a=0;a<arguments.length;a++)b[a]= arguments[a];var c=J(b),d="number"===typeof b[b.length-1]?b.pop():Infinity,b=P(b);return n(function(a,f){va(d)(W(x([a],b),c)).subscribe(f)})}function R(b,a){var c=r(b)?b:function(){return b};return r(a)?n(function(b,e){var d=c();a(d).subscribe(e).add(b.subscribe(d))}):function(a){var b=new Xb(a,c);r(null===a||void 0===a?void 0:a.lift)&&(b.lift=a.lift);b.source=a;b.subjectFactory=c;return b}}function Yb(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];return b.length?n(function(a,d){Ib(x([a], b))(d)}):C}function Zb(b){return n(function(a,c){var d=!1,e=null;a.subscribe(new p(c,function(a){d=!0;e=a}));b.subscribe(new p(c,function(){if(d){d=!1;var a=e;e=null;c.next(a)}},void 0,B))})}function $b(b,a){return n(Lb(b,a,2<=arguments.length,!0))}function Zc(){return new A}function $c(b){var a=b.bufferSize,c=void 0===a?Infinity:a,a=b.windowTime,d=void 0===a?Infinity:a,e=b.refCount,f=b.scheduler,g,k=0,h;return function(a,b){k++;var m;g?m=g.subscribe(b):(g=new aa(c,d,f),m=g.subscribe(b),h=a.subscribe({next:function(a){g.next(a)}, error:function(a){var b=g;g=h=void 0;b.error(a)},complete:function(){h=void 0;g.complete()}}),h.closed&&(h=void 0));b.add(function(){k--;m.unsubscribe();e&&0===k&&h&&(h.unsubscribe(),g=h=void 0)})}}function ka(b,a){return n(function(c,d){var e=null,f=0,g=!1;c.subscribe(new p(d,function(c){null===e||void 0===e?void 0:e.unsubscribe();var k=0,m=f++;u(b(c,m)).subscribe(e=new p(d,function(b){return d.next(a?a(c,b,m,k++):b)},void 0,function(){e=null;g&&!e&&d.complete()}))},void 0,function(){(g=!0,!e)&& d.complete()}))})}function ac(b,a){a=void 0===a?bc:a;var c=a.leading,d=a.trailing;return n(function(a,f){var e=!1,k=null,h=null,m=!1,q=function(){null===h||void 0===h?void 0:h.unsubscribe();h=null;d&&(l(),m&&f.complete())},y=function(){h=null;m&&f.complete()},w=function(a){return h=u(b(a)).subscribe(new p(f,q,void 0,y))},l=function(){e&&(f.next(k),!m&&w(k));e=!1;k=null};a.subscribe(new p(f,function(a){e=!0;k=a;(!h||h.closed)&&(c?l():w(a))},void 0,function(){m=!0;d&&e&&h&&!h.closed||f.complete()}))})} function cc(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];return n(function(a,d){Qa.apply(void 0,x([a],b)).subscribe(d)})}function dc(b,a){for(var c=0,d=a.length;c<d;c++)for(var e=a[c],f=Object.getOwnPropertyNames(e.prototype),g=0,k=f.length;g<k;g++){var h=f[g];b.prototype[h]=e.prototype[h]}}function ec(b){switch(b.responseType){case "json":return"response"in b?b.response:JSON.parse(b.responseText);case "document":return b.responseXML;default:return"response"in b?b.response:b.responseText}} function ad(b,a){return S({method:"GET",url:b,headers:a})}function bd(b,a,c){return S({method:"POST",url:b,body:a,headers:c})}function cd(b,a){return S({method:"DELETE",url:b,headers:a})}function dd(b,a,c){return S({method:"PUT",url:b,body:a,headers:c})}function ed(b,a,c){return S({method:"PATCH",url:b,body:a,headers:c})}function fd(b,a){return gd(S({method:"GET",url:b,headers:a}))}function hd(b){return new t(function(a){var c,d,e={},f=b.headers;if(f)for(var g in f)f.hasOwnProperty(g)&&(e[g.toLowerCase()]= f[g]);b.crossDomain||"x-requested-with"in e||(e["x-requested-with"]="XMLHttpRequest");var k=b.xsrfCookieName,f=b.xsrfHeaderName;(b.withCredentials||!b.crossDomain)&&k&&f&&(k=null!==(d=null===(c=null===document||void 0===document?void 0:document.cookie.match(new RegExp("(^|;\\s*)("+k+")\x3d([^;]*)")))||void 0===c?void 0:c.pop())&&void 0!==d?d:"")&&(e[f]=k);c=id(b.body,e);var h=T(T({async:!0,crossDomain:!0,withCredentials:!1,method:"GET",timeout:0,responseType:"json"},b),{headers:e,body:c}),m;d=h.url; if(!d)throw new TypeError("url is required");m=b.createXHR?b.createXHR():new XMLHttpRequest;var q=b.progressSubscriber;m.ontimeout=function(){var b,c=new fc(m,h);null===(b=null===q||void 0===q?void 0:q.error)||void 0===b?void 0:b.call(q,c);a.error(c)};q&&(m.upload.onprogress=function(a){var b;null===(b=q.next)||void 0===b?void 0:b.call(q,a)});m.onerror=function(b){var c;null===(c=null===q||void 0===q?void 0:q.error)||void 0===c?void 0:c.call(q,b);a.error(new la("ajax error",m,h))};m.onload=function(b){var c, d;if(400>m.status){null===(c=null===q||void 0===q?void 0:q.complete)||void 0===c?void 0:c.call(q);c=void 0;try{c=new gc(b,m,h)}catch(X){a.error(X);return}a.next(c);a.complete()}else null===(d=null===q||void 0===q?void 0:q.error)||void 0===d?void 0:d.call(q,b),a.error(new la("ajax error "+m.status,m,h))};var f=h.user,k=h.method,y=h.async;f?m.open(k,d,y,f,h.password):m.open(k,d,y);y&&(m.timeout=h.timeout,m.responseType=h.responseType);"withCredentials"in m&&(m.withCredentials=h.withCredentials);for(g in e)e.hasOwnProperty(g)&& m.setRequestHeader(g,e[g]);c?m.send(c):m.send();return function(){m&&4!==m.readyState&&m.abort()}})}function id(b,a){var c;if(!b||"string"===typeof b||"undefined"!==typeof FormData&&b instanceof FormData||"undefined"!==typeof URLSearchParams&&b instanceof URLSearchParams||Ua(b,"ArrayBuffer")||Ua(b,"File")||Ua(b,"Blob")||"undefined"!==typeof ReadableStream&&b instanceof ReadableStream)return b;if("undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView(b))return b.buffer;if("object"===typeof b)return a["content-type"]= null!==(c=a["content-type"])&&void 0!==c?c:"application/json;charset\x3dutf-8",JSON.stringify(b);throw new TypeError("Unknown body type");}function Ua(b,a){return jd.call(b)==="[object "+a+"]"}var Ca=function(b,a){Ca=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return Ca(b,a)},T=function(){T=Object.assign||function(b){for(var a,c=1,d=arguments.length;c<d;c++){a=arguments[c];for(var e in a)Object.prototype.hasOwnProperty.call(a, e)&&(b[e]=a[e])}return b};return T.apply(this,arguments)},za=M(function(b){return function(a){b(this);this.message=a?a.length+" errors occurred during unsubscription:\n"+a.map(function(a,b){return b+1+") "+a.toString()}).join("\n "):"";this.name="UnsubscriptionError";this.errors=a}}),z=function(){function b(a){this.initialTeardown=a;this.closed=!1;this._teardowns=this._parentage=null}b.prototype.unsubscribe=function(){var a,b,d,e,f;if(!this.closed){this.closed=!0;var g=this._parentage;if(Array.isArray(g))try{for(var k= D(g),h=k.next();!h.done;h=k.next())h.value.remove(this)}catch(w){a={error:w}}finally{try{h&&!h.done&&(b=k.return)&&b.call(k)}finally{if(a)throw a.error;}}else null===g||void 0===g?void 0:g.remove(this);a=this.initialTeardown;if(r(a))try{a()}catch(w){f=w instanceof za?w.errors:[w]}if(a=this._teardowns){this._teardowns=null;try{for(var m=D(a),q=m.next();!q.done;q=m.next()){var y=q.value;try{a=y,r(a)?a():a.unsubscribe()}catch(w){f=null!==f&&void 0!==f?f:[],w instanceof za?f=x(f,w.errors):f.push(w)}}}catch(w){d= {error:w}}finally{try{q&&!q.done&&(e=m.return)&&e.call(m)}finally{if(d)throw d.error;}}}if(f)throw new za(f);}};b.prototype.add=function(a){var c;if(a&&a!==this)if(this.closed)r(a)?a():a.unsubscribe();else{if(a instanceof b){if(a.closed||a._hasParent(this))return;a._addParent(this)}(this._teardowns=null!==(c=this._teardowns)&&void 0!==c?c:[]).push(a)}};b.prototype._hasParent=function(a){var b=this._parentage;return b===a||Array.isArray(b)&&b.includes(a)};b.prototype._addParent=function(a){var b=this._parentage; this._parentage=Array.isArray(b)?(b.push(a),b):b?[b,a]:a};b.prototype._removeParent=function(a){var b=this._parentage;b===a?this._parentage=null:Array.isArray(b)&&H(b,a)};b.prototype.remove=function(a){var c=this._teardowns;c&&H(c,a);a instanceof b&&a._removeParent(this)};b.EMPTY=function(){var a=new b;a.closed=!0;return a}();return b}(),hc=z.EMPTY,N={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},U={setTimeout:function(){for(var b= [],a=0;a<arguments.length;a++)b[a]=arguments[a];a=U.delegate;return((null===a||void 0===a?void 0:a.setTimeout)||setTimeout).apply(void 0,x(b))},clearTimeout:function(b){var a=U.delegate;return((null===a||void 0===a?void 0:a.clearTimeout)||clearTimeout)(b)},delegate:void 0},Aa=I("C",void 0,void 0),ba=function(b){function a(a){var c=b.call(this)||this;c.isStopped=!1;a?(c.destination=a,eb(a)&&a.add(c)):c.destination=Va;return c}v(a,b);a.create=function(a,b,e){return new Wa(a,b,e)};a.prototype.next=function(a){this.isStopped? Da(I("N",a,void 0),this):this._next(a)};a.prototype.error=function(a){this.isStopped?Da(I("E",void 0,a),this):(this.isStopped=!0,this._error(a))};a.prototype.complete=function(){this.isStopped?Da(Aa,this):(this.isStopped=!0,this._complete())};a.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,b.prototype.unsubscribe.call(this))};a.prototype._next=function(a){this.destination.next(a)};a.prototype._error=function(a){this.destination.error(a);this.unsubscribe()};a.prototype._complete= function(){this.destination.complete();this.unsubscribe()};return a}(z),Wa=function(b){function a(a,d,e){var c=b.call(this)||this;c.destination=Va;if((a||d||e)&&a!==Va){var g=void 0;r(a)?g=a:a&&(g=a.next,d=a.error,e=a.complete,c&&N.useDeprecatedNextContext&&(a=Object.create(a),a.unsubscribe=function(){return c.unsubscribe()}),g=null===g||void 0===g?void 0:g.bind(a),d=null===d||void 0===d?void 0:d.bind(a),e=null===e||void 0===e?void 0:e.bind(a));c.destination={next:g||B,error:d||gb,complete:e||B}}return c} v(a,b);return a}(ba),Va={closed:!0,next:B,error:gb,complete:B},V="function"===typeof Symbol&&Symbol.observable||"@@observable",t=function(){function b(a){a&&(this._subscribe=a)}b.prototype.lift=function(a){var c=new b;c.source=this;c.operator=a;return c};b.prototype.subscribe=function(a,b,d){var c;(c=a&&a instanceof ba)||(c=a&&r(a.next)&&r(a.error)&&r(a.complete)&&eb(a));a=c?a:new Wa(a,b,d);b=this.operator;d=this.source;a.add(b?b.call(a,d):d||N.useDeprecatedSynchronousErrorHandling?this._subscribe(a): this._trySubscribe(a));return a};b.prototype._trySubscribe=function(a){try{return this._subscribe(a)}catch(c){if(N.useDeprecatedSynchronousErrorHandling)throw c;a.error(c)}};b.prototype.forEach=function(a,b){var c=this;b=ib(b);return new b(function(b,d){var e;e=c.subscribe(function(b){try{a(b)}catch(h){d(h),null===e||void 0===e?void 0:e.unsubscribe()}},d,b)})};b.prototype._subscribe=function(a){var b;return null===(b=this.source)||void 0===b?void 0:b.subscribe(a)};b.prototype[V]=function(){return this}; b.prototype.pipe=function(){for(var a=[],b=0;b<arguments.length;b++)a[b]=arguments[b];return a.length?hb(a)(this):this};b.prototype.toPromise=function(a){var b=this;a=ib(a);return new a(function(a,c){var d;b.subscribe(function(a){return d=a},function(a){return c(a)},function(){return a(d)})})};b.create=function(a){return new b(a)};return b}(),p=function(b){function a(a,d,e,f,g){a=b.call(this,a)||this;a.onUnsubscribe=g;d&&(a._next=function(a){try{d(a)}catch(h){this.destination.error(h)}});e&&(a._error= function(a){try{e(a)}catch(h){this.destination.error(h)}this.unsubscribe()});f&&(a._complete=function(){try{f()}catch(k){this.destination.error(k)}this.unsubscribe()});return a}v(a,b);a.prototype.unsubscribe=function(){var a;!this.closed&&(null===(a=this.onUnsubscribe)||void 0===a?void 0:a.call(this));b.prototype.unsubscribe.call(this)};return a}(ba),Xb=function(b){function a(a,d){var c=b.call(this)||this;c.source=a;c.subjectFactory=d;c._subject=null;c._refCount=0;c._connection=null;return c}v(a, b);a.prototype._subscribe=function(a){return this.getSubject().subscribe(a)};a.prototype.getSubject=function(){var a=this._subject;if(!a||a.isStopped)this._subject=this.subjectFactory();return this._subject};a.prototype._teardown=function(){this._refCount=0;var a=this._connection;this._subject=this._connection=null;null===a||void 0===a?void 0:a.unsubscribe()};a.prototype.connect=function(){var a=this,b=this._connection;if(!b){var b=this._connection=new z,e=this.getSubject();b.add(this.source.subscribe(new p(e, void 0,function(b){a._teardown();e.error(b)},function(){a._teardown();e.complete()},function(){return a._teardown()})));b.closed&&(this._connection=null,b=z.EMPTY)}return b};a.prototype.refCount=function(){return Fa()(this)};return a}(t),qa={now:function(){return(qa.delegate||performance).now()},delegate:void 0},O={schedule:function(b){var a=requestAnimationFrame,c=cancelAnimationFrame,d=O.delegate;d&&(a=d.requestAnimationFrame,c=d.cancelAnimationFrame);var e=a(function(a){c=void 0;b(a)});return new z(function(){return null=== c||void 0===c?void 0:c(e)})},requestAnimationFrame:function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];a=O.delegate;return((null===a||void 0===a?void 0:a.requestAnimationFrame)||requestAnimationFrame).apply(void 0,x(b))},cancelAnimationFrame:function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];a=O.delegate;return((null===a||void 0===a?void 0:a.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,x(b))},delegate:void 0},kd=jb(),ic=M(function(b){return function(){b(this); this.name="ObjectUnsubscribedError";this.message="object unsubscribed"}}),A=function(b){function a(){var a=b.call(this)||this;a.observers=[];a.closed=!1;a.isStopped=!1;a.hasError=!1;a.thrownError=null;return a}v(a,b);a.prototype.lift=function(a){var b=new Xa(this,this);b.operator=a;return b};a.prototype._throwIfClosed=function(){if(this.closed)throw new ic;};a.prototype.next=function(a){var b,c;this._throwIfClosed();if(!this.isStopped){var f=this.observers.slice();try{for(var g=D(f),k=g.next();!k.done;k= g.next())k.value.next(a)}catch(h){b={error:h}}finally{try{k&&!k.done&&(c=g.return)&&c.call(g)}finally{if(b)throw b.error;}}}};a.prototype.error=function(a){this._throwIfClosed();if(!this.isStopped){this.hasError=this.isStopped=!0;this.thrownError=a;for(var b=this.observers;b.length;)b.shift().error(a)}};a.prototype.complete=function(){this._throwIfClosed();if(!this.isStopped){this.isStopped=!0;for(var a=this.observers;a.length;)a.shift().complete()}};a.prototype.unsubscribe=function(){this.isStopped= this.closed=!0;this.observers=null};a.prototype._trySubscribe=function(a){this._throwIfClosed();return b.prototype._trySubscribe.call(this,a)};a.prototype._subscribe=function(a){this._throwIfClosed();this._checkFinalizedStatuses(a);return this._innerSubscribe(a)};a.prototype._innerSubscribe=function(a){var b=this,c=this.isStopped,f=this.observers;return this.hasError||c?hc:(f.push(a),new z(function(){return H(b.observers,a)}))};a.prototype._checkFinalizedStatuses=function(a){var b=this.thrownError, c=this.isStopped;this.hasError?a.error(b):c&&a.complete()};a.prototype.asObservable=function(){var a=new t;a.source=this;return a};a.create=function(a,b){return new Xa(a,b)};return a}(t),Xa=function(b){function a(a,d){var c=b.call(this)||this;c.destination=a;c.source=d;return c}v(a,b);a.prototype.next=function(a){var b,c;null===(c=null===(b=this.destination)||void 0===b?void 0:b.next)||void 0===c?void 0:c.call(b,a)};a.prototype.error=function(a){var b,c;null===(c=null===(b=this.destination)||void 0=== b?void 0:b.error)||void 0===c?void 0:c.call(b,a)};a.prototype.complete=function(){var a,b;null===(b=null===(a=this.destination)||void 0===a?void 0:a.complete)||void 0===b?void 0:b.call(a)};a.prototype._subscribe=function(a){var b,c;return null!==(c=null===(b=this.source)||void 0===b?void 0:b.subscribe(a))&&void 0!==c?c:hc};return a}(A),jc=function(b){function a(a){var c=b.call(this)||this;c._value=a;return c}v(a,b);Object.defineProperty(a.prototype,"value",{get:function(){return this.getValue()}, enumerable:!1,configurable:!0});a.prototype._subscribe=function(a){var c=b.prototype._subscribe.call(this,a);!c.closed&&a.next(this._value);return c};a.prototype.getValue=function(){var a=this.thrownError,b=this._value;if(this.hasError)throw a;this._throwIfClosed();return b};a.prototype.next=function(a){b.prototype.next.call(this,this._value=a)};return a}(A),ca={now:function(){return(ca.delegate||Date).now()},delegate:void 0},aa=function(b){function a(a,d,e){void 0===a&&(a=Infinity);void 0===d&&(d= Infinity);void 0===e&&(e=ca);var c=b.call(this)||this;c.bufferSize=a;c.windowTime=d;c.timestampProvider=e;c.buffer=[];c.infiniteTimeWindow=Infinity===d;c.bufferSize=Math.max(1,a);c.windowTime=Math.max(1,d);return c}v(a,b);a.prototype.next=function(a){var c=this.buffer,e=this.infiniteTimeWindow,f=this.timestampProvider,g=this.windowTime;this.isStopped||(c.push(a),!e&&c.push(f.now()+g));this.trimBuffer();b.prototype.next.call(this,a)};a.prototype._subscribe=function(a){this._throwIfClosed();this.trimBuffer(); for(var b=this._innerSubscribe(a),c=this.infiniteTimeWindow,f=this.buffer.slice(),g=0;g<f.length&&!a.closed;g+=c?1:2)a.next(f[g]);this._checkFinalizedStatuses(a);return b};a.prototype.trimBuffer=function(){var a=this.bufferSize,b=this.timestampProvider,e=this.buffer,f=this.infiniteTimeWindow,g=(f?1:2)*a;Infinity>a&&g<e.length&&e.splice(0,e.length-g);if(!f){a=b.now();b=0;for(f=1;f<e.length&&e[f]<=a;f+=2)b=f;b&&e.splice(0,b+1)}};return a}(A),Ma=function(b){function a(){var a=null!==b&&b.apply(this, arguments)||this;a.value=null;a.hasValue=!1;a.isComplete=!1;return a}v(a,b);a.prototype._checkFinalizedStatuses=function(a){var b=this.hasValue,c=this.value,f=this.thrownError,g=this.isStopped;this.hasError?a.error(f):g&&(b&&a.next(c),a.complete())};a.prototype.next=function(a){this.isStopped||(this.value=a,this.hasValue=!0)};a.prototype.complete=function(){var a=this.hasValue,d=this.value;this.isComplete||(this.isComplete=!0,a&&b.prototype.next.call(this,d),b.prototype.complete.call(this))};return a}(A), da={setInterval:function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];a=da.delegate;return((null===a||void 0===a?void 0:a.setInterval)||setInterval).apply(void 0,x(b))},clearInterval:function(b){var a=da.delegate;return((null===a||void 0===a?void 0:a.clearInterval)||clearInterval)(b)},delegate:void 0},ma=function(b){function a(a,d){var c=b.call(this,a,d)||this;c.scheduler=a;c.work=d;c.pending=!1;return c}v(a,b);a.prototype.schedule=function(a,b){void 0===b&&(b=0);if(this.closed)return this; this.state=a;a=this.id;var c=this.scheduler;null!=a&&(this.id=this.recycleAsyncId(c,a,b));this.pending=!0;this.delay=b;this.id=this.id||this.requestAsyncId(c,this.id,b);return this};a.prototype.requestAsyncId=function(a,b,e){void 0===e&&(e=0);return da.setInterval(a.flush.bind(a,this),e)};a.prototype.recycleAsyncId=function(a,b,e){void 0===e&&(e=0);if(null!=e&&this.delay===e&&!1===this.pending)return b;da.clearInterval(b)};a.prototype.execute=function(a,b){if(this.closed)return Error("executing a cancelled action"); this.pending=!1;if(a=this._execute(a,b))return a;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))};a.prototype._execute=function(a,b){b=!1;var c;try{this.work(a)}catch(f){b=!0,c=!!f&&f||Error(f)}if(b)return this.unsubscribe(),c};a.prototype.unsubscribe=function(){if(!this.closed){var a=this.id,d=this.scheduler,e=d.actions;this.work=this.state=this.scheduler=null;this.pending=!1;H(e,this);null!=a&&(this.id=this.recycleAsyncId(d,a,null));this.delay=null;b.prototype.unsubscribe.call(this)}}; return a}(function(b){function a(a,d){return b.call(this)||this}v(a,b);a.prototype.schedule=function(a,b){return this};return a}(z)),ld=1,Ya,Ga={},md=function(b){var a=ld++;Ga[a]=!0;Ya||(Ya=Promise.resolve());Ya.then(function(){return kb(a)&&b()});return a},nd=function(b){kb(b)},ea={setImmediate:function(){for(var b=[],a=0;a<arguments.length;a++)b[a]=arguments[a];a=ea.delegate;return((null===a||void 0===a?void 0:a.setImmediate)||md).apply(void 0,x(b))},clearImmediate:function(b){var a=ea.delegate; return((null===a||void 0===a?void 0:a.clearImmediate)||nd)(b)},delegate:void 0},od=function(b){function a(a,d){var c=b.call(this,a,d)||this;c.scheduler=a;c.work=d;return c}v(a,b);a.prototype.requestAsyncId=function(a,d,e){void 0===e&&(e=0);if(null!==e&&0<e)return b.prototype.requestAsyncId.call(this,a,d,e);a.actions.push(this);return a.scheduled||(a.scheduled=ea.setImmediate(a.flush.bind(a,void 0)))};a.prototype.recycleAsyncId=function(a,d,e){void 0===e&&(e=0);if(null!=e&&0<e||null==e&&0<this.delay)return b.prototype.recycleAsyncId.call(this, a,d,e);0===a.actions.length&&(ea.clearImmediate(d),a.scheduled=void 0)};return a}(ma),Za=function(){function b(a,c){void 0===c&&(c=b.now);this.schedulerActionCtor=a;this.now=c}b.prototype.schedule=function(a,b,d){void 0===b&&(b=0);return(new this.schedulerActionCtor(this,a)).schedule(d,b)};b.now=ca.now;return b}(),na=function(b){function a(a,d){void 0===d&&(d=Za.now);a=b.call(this,a,d)||this;a.actions=[];a.active=!1;a.scheduled=void 0;return a}v(a,b);a.prototype.flush=function(a){var b=this.actions; if(this.active)b.push(a);else{var c;this.active=!0;do if(c=a.execute(a.state,a.delay))break;while(a=b.shift());this.active=!1;if(c){for(;a=b.shift();)a.unsubscribe();throw c;}}};return a}(Za),kc=new (function(b){function a(){return null!==b&&b.apply(this,arguments)||this}v(a,b);a.prototype.flush=function(a){this.active=!0;this.scheduled=void 0;var b=this.actions,c,f=-1;a=a||b.shift();var g=b.length;do if(c=a.execute(a.state,a.delay))break;while(++f<g&&(a=b.shift()));this.active=!1;if(c){for(;++f< g&&(a=b.shift());)a.unsubscribe();throw c;}};return a}(na))(od),G=new na(ma),ha=G,pd=function(b){function a(a,d){var c=b.call(this,a,d)||this;c.scheduler=a;c.work=d;return c}v(a,b);a.prototype.schedule=function(a,d){void 0===d&&(d=0);if(0<d)return b.prototype.schedule.call(this,a,d);this.delay=d;this.state=a;this.scheduler.flush(this);return this};a.prototype.execute=function(a,d){return 0<d||this.closed?b.prototype.execute.call(this,a,d):this._execute(a,d)};a.prototype.requestAsyncId=function(a, d,e){void 0===e&&(e=0);return null!=e&&0<e||null==e&&0<this.delay?b.prototype.requestAsyncId.call(this,a,d,e):a.flush(this)};return a}(ma),lc=new (function(b){function a(){return null!==b&&b.apply(this,arguments)||this}v(a,b);return a}(na))(pd),qd=function(b){function a(a,d){var c=b.call(this,a,d)||this;c.scheduler=a;c.work=d;return c}v(a,b);a.prototype.requestAsyncId=function(a,d,e){void 0===e&&(e=0);if(null!==e&&0<e)return b.prototype.requestAsyncId.call(this,a,d,e);a.actions.push(this);return a.scheduled|| (a.scheduled=O.requestAnimationFrame(function(){return a.flush(void 0)}))};a.prototype.recycleAsyncId=function(a,d,e){void 0===e&&(e=0);if(null!=e&&0<e||null==e&&0<this.delay)return b.prototype.recycleAsyncId.call(this,a,d,e);0===a.actions.length&&(O.cancelAnimationFrame(d),a.scheduled=void 0)};return a}(ma),mc=new (function(b){function a(){return null!==b&&b.apply(this,arguments)||this}v(a,b);a.prototype.flush=function(a){this.active=!0;this.scheduled=void 0;var b=this.actions,c,f=-1;a=a||b.shift(); var g=b.length;do if(c=a.execute(a.state,a.delay))break;while(++f<g&&(a=b.shift()));this.active=!1;if(c){for(;++f<g&&(a=b.shift());)a.unsubscribe();throw c;}};return a}(na))(qd),nc=function(b){function a(a,d){void 0===a&&(a=$a);void 0===d&&(d=Infinity);var c=b.call(this,a,function(){return c.frame})||this;c.maxFrames=d;c.frame=0;c.index=-1;return c}v(a,b);a.prototype.flush=function(){for(var a=this.actions,b=this.maxFrames,e,f;(f=a[0])&&f.delay<=b&&!(a.shift(),this.frame=f.delay,e=f.execute(f.state, f.delay)););if(e){for(;f=a.shift();)f.unsubscribe();throw e;}};a.frameTimeFactor=10;return a}(na),$a=function(b){function a(a,d,e){void 0===e&&(e=a.index+=1);var c=b.call(this,a,d)||this;c.scheduler=a;c.work=d;c.index=e;c.active=!0;c.index=a.index=e;return c}v(a,b);a.prototype.schedule=function(c,d){void 0===d&&(d=0);if(Number.isFinite(d)){if(!this.id)return b.prototype.schedule.call(this,c,d);this.active=!1;var e=new a(this.scheduler,this.work);this.add(e);return e.schedule(c,d)}return z.EMPTY}; a.prototype.requestAsyncId=function(b,d,e){void 0===e&&(e=0);this.delay=b.frame+e;b=b.actions;b.push(this);b.sort(a.sortActions);return!0};a.prototype.recycleAsyncId=function(a,b,e){};a.prototype._execute=function(a,d){if(!0===this.active)return b.prototype._execute.call(this,a,d)};a.sortActions=function(a,b){return a.delay===b.delay?a.index===b.index?0:a.index>b.index?1:-1:a.delay>b.delay?1:-1};return a}(ma),E=new t(function(b){return b.complete()}),Ia=function(b){return b&&"number"===typeof b.length&& "function"!==typeof b},ra;ra="function"===typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";(function(b){b.NEXT="N";b.ERROR="E";b.COMPLETE="C"})(l.NotificationKind||(l.NotificationKind={}));var Ba=function(){function b(a,b,d){this.kind=a;this.value=b;this.error=d;this.hasValue="N"===a}b.prototype.observe=function(a){return ta(this,a)};b.prototype.do=function(a,b,d){var c=this.kind,f=this.value,g=this.error;return"N"===c?null===a||void 0===a?void 0:a(f):"E"===c?null===b||void 0===b?void 0: b(g):null===d||void 0===d?void 0:d()};b.prototype.accept=function(a,b,d){return r(null===a||void 0===a?void 0:a.next)?this.observe(a):this.do(a,b,d)};b.prototype.toObservable=function(){var a=this.kind,b=this.value,d=this.error,b="N"===a?Ka(b):"E"===a?sb(d):"C"===a?E:0;if(!b)throw new TypeError("Unexpected notification kind "+a);return b};b.createNext=function(a){return new b("N",a)};b.createError=function(a){return new b("E",void 0,a)};b.createComplete=function(){return b.completeNotification};b.completeNotification= new b("C");return b}(),Q=M(function(b){return function(){b(this);this.name="EmptyError";this.message="no elements in sequence"}}),ab=M(function(b){return function(){b(this);this.name="ArgumentOutOfRangeError";this.message="argument out of range"}}),oc=M(function(b){return function(a){b(this);this.name="NotFoundError";this.message=a}}),pc=M(function(b){return function(a){b(this);this.name="SequenceError";this.message=a}}),vb=M(function(b){return function(a){void 0===a&&(a=null);b(this);this.message= "Timeout has occurred";this.name="TimeoutError";this.info=a}}),Ic=Array.isArray,Jc=Array.isArray,Kc=Object.getPrototypeOf,Lc=Object.prototype,Mc=Object.keys,Nc=function(b){function a(a,d,e){a=b.call(this,a)||this;a._next=d;a.shouldComplete=e;return a}v(a,b);a.prototype._complete=function(){this.shouldComplete()?b.prototype._complete.call(this):this.unsubscribe()};return a}(ba),Sc=["addListener","removeListener"],Qc=["addEventListener","removeEventListener"],Uc=["on","off"],Vc=Array.isArray,qc=new t(B), Wc=function(b,a){return b.push(a),b},rd=function(b){function a(){var a=null!==b&&b.apply(this,arguments)||this;a.activeGroups=0;a.teardownAttempted=!1;return a}v(a,b);a.prototype.unsubscribe=function(){this.teardownAttempted=!0;0===this.activeGroups&&b.prototype.unsubscribe.call(this)};return a}(p),bc={leading:!0,trailing:!1},sd=function(){return function(b,a){this.value=b;this.interval=a}}(),ud=Object.freeze({audit:Jb,auditTime:function(b,a){void 0===a&&(a=ha);return Jb(function(){return Z(b,a)})}, buffer:function(b){return n(function(a,c){var d=[];a.subscribe(new p(c,function(a){return d.push(a)}));b.subscribe(new p(c,function(){var a=d;d=[];c.next(a)}));return function(){d=null}})},bufferCount:function(b,a){void 0===a&&(a=null);a=null!==a&&void 0!==a?a:b;return n(function(c,d){var e=[],f=0;c.subscribe(new p(d,function(c){var g,h,m,q,y=null;0===f++%a&&e.push([]);try{for(var l=D(e),p=l.next();!p.done;p=l.next()){var n=p.value;n.push(c);b<=n.length&&(y=null!==y&&void 0!==y?y:[],y.push(n))}}catch(oa){g= {error:oa}}finally{try{p&&!p.done&&(h=l.return)&&h.call(l)}finally{if(g)throw g.error;}}if(y)try{for(var X=D(y),r=X.next();!r.done;r=X.next())n=r.value,H(e,n),d.next(n)}catch(oa){m={error:oa}}finally{try{r&&!r.done&&(q=X.return)&&q.call(X)}finally{if(m)throw m.error;}}},void 0,function(){var a,b;try{for(var c=D(e),f=c.next();!f.done;f=c.next())d.next(f.value)}catch(q){a={error:q}}finally{try{f&&!f.done&&(b=c.return)&&b.call(c)}finally{if(a)throw a.error;}}d.complete()},function(){e=null}))})},bufferTime:function(b){for(var a, c,d=[],e=1;e<arguments.length;e++)d[e-1]=arguments[e];var f=null!==(a=J(d))&&void 0!==a?a:G,g=null!==(c=d[0])&&void 0!==c?c:null,k=d[1]||Infinity;return n(function(a,c){var d=[],e=!1,h=function(a){var b=a.buffer;a.subs.unsubscribe();H(d,a);c.next(b);e&&m()},m=function(){if(d){var a=new z;c.add(a);var e={buffer:[],subs:a};d.push(e);a.add(f.schedule(function(){return h(e)},b))}};null!==g&&0<=g?c.add(f.schedule(function(){m();!this.closed&&c.add(this.schedule(null,g))},g)):e=!0;m();var l=new p(c,function(a){var b, c,e=d.slice();try{for(var f=D(e),g=f.next();!g.done;g=f.next()){var m=g.value,q=m.buffer;q.push(a);k<=q.length&&h(m)}}catch(td){b={error:td}}finally{try{g&&!g.done&&(c=f.return)&&c.call(f)}finally{if(b)throw b.error;}}},void 0,function(){for(;null===d||void 0===d?0:d.length;)c.next(d.shift().buffer);null===l||void 0===l?void 0:l.unsubscribe();c.complete();c.unsubscribe()},function(){return d=null});a.subscribe(l)})},bufferToggle:function(b,a){return n(function(c,d){var e=[];u(b).subscribe(new p(d, function(b){var c=[];e.push(c);var f=new z;f.add(u(a(b)).subscribe(new p(d,function(){H(e,c);d.next(c);f.unsubscribe()},void 0,B)))},void 0,B));c.subscribe(new p(d,function(a){var b,c;try{for(var d=D(e),f=d.next();!f.done;f=d.next())f.value.push(a)}catch(q){b={error:q}}finally{try{f&&!f.done&&(c=d.return)&&c.call(d)}finally{if(b)throw b.error;}}},void 0,function(){for(;0<e.length;)d.next(e.shift());d.complete()}))})},bufferWhen:function(b){return n(function(a,c){var d=null,e=null,f=function(){null=== e||void 0===e?void 0:e.unsubscribe();var a=d;d=[];a&&c.next(a);u(b()).subscribe(e=new p(c,f,void 0,B))};f();a.subscribe(new p(c,function(a){return null===d||void 0===d?void 0:d.push