UNPKG

agora-rtm

Version:
7 lines 1.5 MB
/*! @preserve * AgoraRTM Web SDK 2.2.2-2 - commit: v2.2.2-2-0-g4b39cd71 - fusion: false * Copyright (C) 2018-2025 Agora Lab. * This file is licensed under the AGORA, INC. SDK LICENSE AGREEMENT * A copy of this license may be found at https://www.agora.io/en/sdk-license-agreement/ */ !function(A,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("agora-rtc-sdk-ng")):"function"==typeof define&&define.amd?define(["agora-rtc-sdk-ng"],e):(A="undefined"!=typeof globalThis?globalThis:A||self).AgoraRTM=e(A.AgoraRTC)}(this,(function(AgoraRTC){"use strict";function _applyDecoratedDescriptor(A,e,t,g,o){var i={};return Object.keys(g).forEach((function(A){i[A]=g[A]})),i.enumerable=!!i.enumerable,i.configurable=!!i.configurable,("value"in i||i.initializer)&&(i.writable=!0),i=t.slice().reverse().reduce((function(t,g){return g(A,e,t)||t}),i),o&&void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(o):void 0,i.initializer=void 0),void 0===i.initializer?(Object.defineProperty(A,e,i),null):i}function _defineProperty$1(A,e,t){return(e=_toPropertyKey(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function ownKeys(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(A);e&&(g=g.filter((function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable}))),t.push.apply(t,g)}return t}function _objectSpread2(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?ownKeys(Object(t),!0).forEach((function(e){_defineProperty$1(A,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach((function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))}))}return A}function _objectWithoutProperties(A,e){if(null==A)return{};var t,g,o=_objectWithoutPropertiesLoose(A,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(A);for(g=0;g<i.length;g++)t=i[g],-1===e.indexOf(t)&&{}.propertyIsEnumerable.call(A,t)&&(o[t]=A[t])}return o}function _objectWithoutPropertiesLoose(A,e){if(null==A)return{};var t={};for(var g in A)if({}.hasOwnProperty.call(A,g)){if(-1!==e.indexOf(g))continue;t[g]=A[g]}return t}function _toPrimitive(A,e){if("object"!=typeof A||!A)return A;var t=A[Symbol.toPrimitive];if(void 0!==t){var g=t.call(A,e);if("object"!=typeof g)return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(A)}function _toPropertyKey(A){var e=_toPrimitive(A,"string");return"symbol"==typeof e?e:e+""}let subscribedState=function(A){return A.UNSUBSCRIBED="UNSUBSCRIBED",A.SUBSCRIBED="SUBSCRIBED",A}({}),MessageType$1=function(A){return A.STRING="STRING",A.BINARY="BINARY",A}({}),LegacyAreaCode=function(A){return A.CN="CN",A.NA="NA",A.EU="EU",A.AS="AS",A.JP="JP",A.IN="IN",A.GLOB="GLOB",A.OC="OC",A.SA="SA",A.AF="AF",A.KR="KR",A.US="US",A.OVS="OVS",A}({}),AreaCode=function(A){return A.GLOBAL="GLOBAL",A.INDIA="INDIA",A.JAPAN="JAPAN",A.ASIA="ASIA",A.EUROPE="EUROPE",A.CHINA="CHINA",A.NORTH_AMERICA="NORTH_AMERICA",A}({}),LinkStateChangeReason4Report=function(A){return A[A.UNKNOWN=0]="UNKNOWN",A[A.LOGIN=1]="LOGIN",A[A.LOGIN_SUCCESS=2]="LOGIN_SUCCESS",A[A.LOGIN_TIMEOUT=3]="LOGIN_TIMEOUT",A[A.LOGIN_NOT_AUTHORIZED=4]="LOGIN_NOT_AUTHORIZED",A[A.LOGIN_REJECTED=5]="LOGIN_REJECTED",A[A.RELOGIN=6]="RELOGIN",A[A.LOGOUT=7]="LOGOUT",A[A.AUTO_RECONNECT=8]="AUTO_RECONNECT",A[A.RECONNECT_TIMEOUT=9]="RECONNECT_TIMEOUT",A[A.RECONNECT_SUCCESS=10]="RECONNECT_SUCCESS",A[A.JOIN=11]="JOIN",A[A.JOIN_SUCCESS=12]="JOIN_SUCCESS",A[A.JOIN_FAILED=13]="JOIN_FAILED",A[A.REJOIN=14]="REJOIN",A[A.LEAVE=15]="LEAVE",A[A.INVALID_TOKEN=16]="INVALID_TOKEN",A[A.TOKEN_EXPIRED=17]="TOKEN_EXPIRED",A[A.INCONSISTENT_APP_ID=18]="INCONSISTENT_APP_ID",A[A.INVALID_CHANNEL_NAME=19]="INVALID_CHANNEL_NAME",A[A.INVALID_USER_ID=20]="INVALID_USER_ID",A[A.NOT_INITIALIZED=21]="NOT_INITIALIZED",A[A.RTM_SERVICE_NOT_CONNECTED=22]="RTM_SERVICE_NOT_CONNECTED",A[A.CHANNEL_INSTANCE_EXCEED_LIMITATION=23]="CHANNEL_INSTANCE_EXCEED_LIMITATION",A[A.OPERATION_RATE_EXCEED_LIMITATION=24]="OPERATION_RATE_EXCEED_LIMITATION",A[A.CHANNEL_IN_ERROR_STATE=25]="CHANNEL_IN_ERROR_STATE",A[A.PRESENCE_NOT_CONNECTED=26]="PRESENCE_NOT_CONNECTED",A[A.SAME_UID_LOGIN=27]="SAME_UID_LOGIN",A[A.KICKED_OUT_BY_SERVER=28]="KICKED_OUT_BY_SERVER",A[A.KEEP_ALIVE_TIMEOUT=29]="KEEP_ALIVE_TIMEOUT",A[A.CONNECTION_ERROR=30]="CONNECTION_ERROR",A[A.PRESENCE_NOT_READY=31]="PRESENCE_NOT_READY",A[A.NETWORK_CHANGE=32]="NETWORK_CHANGE",A[A.SERVICE_NOT_SUPPORTED=33]="SERVICE_NOT_SUPPORTED",A[A.STREAM_CHANNEL_NOT_AVAILABLE=34]="STREAM_CHANNEL_NOT_AVAILABLE",A[A.STORAGE_NOT_AVAILABLE=35]="STORAGE_NOT_AVAILABLE",A[A.LOCK_NOT_AVAILABLE=36]="LOCK_NOT_AVAILABLE",A[A.LOGIN_TOO_FREQUENT=37]="LOGIN_TOO_FREQUENT",A}({}),LinkStateChangeReasonDescription=function(A){return A.UNKNOWN="Unknown",A.LOGIN="Perform login operation",A.LOGIN_SUCCESS="Login success",A.LOGIN_TIMEOUT="Login timeout",A.LOGIN_NOT_AUTHORIZED="Login not authorized",A.LOGIN_REJECTED="Login rejected",A.RELOGIN="Perform login operation again",A.LOGOUT="Logout success",A.AUTO_RECONNECT="Reconnecting",A.RECONNECT_TIMEOUT="Reconnect timeout",A.RECONNECT_SUCCESS="Reconnect success",A.JOIN="Perform join operation",A.JOIN_SUCCESS="Join channel success",A.JOIN_FAILED="Join channel failed",A.REJOIN="Perform join operation again",A.LEAVE="Leave channel success",A.INVALID_TOKEN="Invalid token",A.TOKEN_EXPIRED="Token expired",A.INCONSISTENT_APP_ID="Inconsistent app ID",A.INVALID_CHANNEL_NAME="Invalid channel name",A.INVALID_USER_ID="Invalid user id",A.NOT_INITIALIZED="Not initialized",A.RTM_SERVICE_NOT_CONNECTED="RTM service not connected",A.CHANNEL_INSTANCE_EXCEED_LIMITATION="Channel instance exceed limitation",A.OPERATION_RATE_EXCEED_LIMITATION="Operation rate exceed limitation",A.CHANNEL_IN_ERROR_STATE="Channel in error state",A.PRESENCE_NOT_CONNECTED="Presence not connected",A.SAME_UID_LOGIN="The same uid login on another device",A.KICKED_OUT_BY_SERVER="Kicked out by server",A.KEEP_ALIVE_TIMEOUT="Keep alive timeout",A.CONNECTION_ERROR="Connection error",A.PRESENCE_NOT_READY="Presence not ready",A.NETWORK_CHANGE="Network change",A.SERVICE_NOT_SUPPORTED="Service not supported",A.STREAM_CHANNEL_NOT_AVAILABLE="Stream channel not available",A.STORAGE_NOT_AVAILABLE="Storage service is not available",A.LOCK_NOT_AVAILABLE="Lock service is not available",A.LOGIN_TOO_FREQUENT="Login too frequent",A}({}),ChannelTypeEnum=function(A){return A[A.MESSAGE=1]="MESSAGE",A[A.STREAM=2]="STREAM",A[A.USER=3]="USER",A}({});var ConstantsType=Object.freeze({__proto__:null,AreaCode:AreaCode,ChannelTypeEnum:ChannelTypeEnum,LegacyAreaCode:LegacyAreaCode,LinkStateChangeReason4Report:LinkStateChangeReason4Report,LinkStateChangeReasonDescription:LinkStateChangeReasonDescription,MessageType:MessageType$1,subscribedState:subscribedState}),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(A){return A&&A.__esModule&&Object.prototype.hasOwnProperty.call(A,"default")?A.default:A}function getAugmentedNamespace(A){if(A.__esModule)return A;var e=A.default;if("function"==typeof e){var t=function A(){return this instanceof A?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(A).forEach((function(e){var g=Object.getOwnPropertyDescriptor(A,e);Object.defineProperty(t,e,g.get?g:{enumerable:!0,get:function(){return A[e]}})})),t}function format(A){var e=Array.prototype.slice.call(arguments,1);return e.length&&(A=A.replace(/(%?)(%([jds]))/g,(function(A,t,g,o){var i=e.shift();switch(o){case"s":i=""+i;break;case"d":i=Number(i);break;case"j":i=JSON.stringify(i)}return t?(e.unshift(i),A):i}))),e.length&&(A+=" "+e.join(" ")),""+(A=A.replace(/%{2,2}/g,"%"))}var format_1=format,format$1=getDefaultExportFromCjs(format_1),_extendStatics=function(A,e){return _extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)e.hasOwnProperty(t)&&(A[t]=e[t])},_extendStatics(A,e)};function __extends$3(A,e){function t(){this.constructor=A}_extendStatics(A,e),A.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t)}function isFunction$7(A){return"function"==typeof A}var _enable_super_gross_mode_that_will_cause_bad_things=!1,config$1={Promise:void 0,set useDeprecatedSynchronousErrorHandling(A){A&&(new Error).stack;_enable_super_gross_mode_that_will_cause_bad_things=A},get useDeprecatedSynchronousErrorHandling(){return _enable_super_gross_mode_that_will_cause_bad_things}};function hostReportError(A){setTimeout((function(){throw A}),0)}var empty$1={closed:!0,next:function(A){},error:function(A){if(config$1.useDeprecatedSynchronousErrorHandling)throw A;hostReportError(A)},complete:function(){}},isArray$g=function(){return Array.isArray||function(A){return A&&"number"==typeof A.length}}();function isObject$e(A){return null!==A&&"object"==typeof A}var UnsubscriptionErrorImpl$1=function(){function A(A){return Error.call(this),this.message=A?A.length+" errors occurred during unsubscription:\n"+A.map((function(A,e){return e+1+") "+A.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=A,this}return A.prototype=Object.create(Error.prototype),A}(),UnsubscriptionError$1=UnsubscriptionErrorImpl$1,Subscription$2=function(){function A(A){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,A&&(this._ctorUnsubscribe=!0,this._unsubscribe=A)}return A.prototype.unsubscribe=function(){var e;if(!this.closed){var t=this,g=t._parentOrParents,o=t._ctorUnsubscribe,i=t._unsubscribe,I=t._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,g instanceof A)g.remove(this);else if(null!==g)for(var r=0;r<g.length;++r){g[r].remove(this)}if(isFunction$7(i)){o&&(this._unsubscribe=void 0);try{i.call(this)}catch(A){e=A instanceof UnsubscriptionError$1?flattenUnsubscriptionErrors$1(A.errors):[A]}}if(isArray$g(I)){r=-1;for(var n=I.length;++r<n;){var s=I[r];if(isObject$e(s))try{s.unsubscribe()}catch(A){e=e||[],A instanceof UnsubscriptionError$1?e=e.concat(flattenUnsubscriptionErrors$1(A.errors)):e.push(A)}}}if(e)throw new UnsubscriptionError$1(e)}},A.prototype.add=function(e){var t=e;if(!e)return A.EMPTY;switch(typeof e){case"function":t=new A(e);case"object":if(t===this||t.closed||"function"!=typeof t.unsubscribe)return t;if(this.closed)return t.unsubscribe(),t;if(!(t instanceof A)){var g=t;(t=new A)._subscriptions=[g]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var o=t._parentOrParents;if(null===o)t._parentOrParents=this;else if(o instanceof A){if(o===this)return t;t._parentOrParents=[o,this]}else{if(-1!==o.indexOf(this))return t;o.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[t]:i.push(t),t},A.prototype.remove=function(A){var e=this._subscriptions;if(e){var t=e.indexOf(A);-1!==t&&e.splice(t,1)}},A.EMPTY=function(A){return A.closed=!0,A}(new A),A}();function flattenUnsubscriptionErrors$1(A){return A.reduce((function(A,e){return A.concat(e instanceof UnsubscriptionError$1?e.errors:e)}),[])}var rxSubscriber=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),Subscriber=function(A){function e(t,g,o){var i=A.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=empty$1;break;case 1:if(!t){i.destination=empty$1;break}if("object"==typeof t){t instanceof e?(i.syncErrorThrowable=t.syncErrorThrowable,i.destination=t,t.add(i)):(i.syncErrorThrowable=!0,i.destination=new SafeSubscriber(i,t));break}default:i.syncErrorThrowable=!0,i.destination=new SafeSubscriber(i,t,g,o)}return i}return __extends$3(e,A),e.prototype[rxSubscriber]=function(){return this},e.create=function(A,t,g){var o=new e(A,t,g);return o.syncErrorThrowable=!1,o},e.prototype.next=function(A){this.isStopped||this._next(A)},e.prototype.error=function(A){this.isStopped||(this.isStopped=!0,this._error(A))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,A.prototype.unsubscribe.call(this))},e.prototype._next=function(A){this.destination.next(A)},e.prototype._error=function(A){this.destination.error(A),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var A=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=A,this},e}(Subscription$2),SafeSubscriber=function(A){function e(e,t,g,o){var i,I=A.call(this)||this;I._parentSubscriber=e;var r=I;return isFunction$7(t)?i=t:t&&(i=t.next,g=t.error,o=t.complete,t!==empty$1&&(isFunction$7((r=Object.create(t)).unsubscribe)&&I.add(r.unsubscribe.bind(r)),r.unsubscribe=I.unsubscribe.bind(I))),I._context=r,I._next=i,I._error=g,I._complete=o,I}return __extends$3(e,A),e.prototype.next=function(A){if(!this.isStopped&&this._next){var e=this._parentSubscriber;config$1.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?this.__tryOrSetError(e,this._next,A)&&this.unsubscribe():this.__tryOrUnsub(this._next,A)}},e.prototype.error=function(A){if(!this.isStopped){var e=this._parentSubscriber,t=config$1.useDeprecatedSynchronousErrorHandling;if(this._error)t&&e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,A),this.unsubscribe()):(this.__tryOrUnsub(this._error,A),this.unsubscribe());else if(e.syncErrorThrowable)t?(e.syncErrorValue=A,e.syncErrorThrown=!0):hostReportError(A),this.unsubscribe();else{if(this.unsubscribe(),t)throw A;hostReportError(A)}}},e.prototype.complete=function(){var A=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var t=function(){return A._complete.call(A._context)};config$1.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable?(this.__tryOrSetError(e,t),this.unsubscribe()):(this.__tryOrUnsub(t),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(A,e){try{A.call(this._context,e)}catch(A){if(this.unsubscribe(),config$1.useDeprecatedSynchronousErrorHandling)throw A;hostReportError(A)}},e.prototype.__tryOrSetError=function(A,e,t){if(!config$1.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{e.call(this._context,t)}catch(e){return config$1.useDeprecatedSynchronousErrorHandling?(A.syncErrorValue=e,A.syncErrorThrown=!0,!0):(hostReportError(e),!0)}return!1},e.prototype._unsubscribe=function(){var A=this._parentSubscriber;this._context=null,this._parentSubscriber=null,A.unsubscribe()},e}(Subscriber);function canReportError(A){for(;A;){var e=A,t=e.closed,g=e.destination,o=e.isStopped;if(t||o)return!1;A=g&&g instanceof Subscriber?g:null}return!0}function toSubscriber(A,e,t){if(A){if(A instanceof Subscriber)return A;if(A[rxSubscriber])return A[rxSubscriber]()}return A||e||t?new Subscriber(A,e,t):new Subscriber(empty$1)}var observable=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function identity$5(A){return A}function pipe(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];return pipeFromArray(A)}function pipeFromArray(A){return 0===A.length?identity$5:1===A.length?A[0]:function(e){return A.reduce((function(A,e){return e(A)}),e)}}var Observable=function(){function A(A){this._isScalar=!1,A&&(this._subscribe=A)}return A.prototype.lift=function(e){var t=new A;return t.source=this,t.operator=e,t},A.prototype.subscribe=function(A,e,t){var g=this.operator,o=toSubscriber(A,e,t);if(g?o.add(g.call(o,this.source)):o.add(this.source||config$1.useDeprecatedSynchronousErrorHandling&&!o.syncErrorThrowable?this._subscribe(o):this._trySubscribe(o)),config$1.useDeprecatedSynchronousErrorHandling&&o.syncErrorThrowable&&(o.syncErrorThrowable=!1,o.syncErrorThrown))throw o.syncErrorValue;return o},A.prototype._trySubscribe=function(A){try{return this._subscribe(A)}catch(e){config$1.useDeprecatedSynchronousErrorHandling&&(A.syncErrorThrown=!0,A.syncErrorValue=e),canReportError(A)?A.error(e):console.warn(e)}},A.prototype.forEach=function(A,e){var t=this;return new(e=getPromiseCtor(e))((function(e,g){var o;o=t.subscribe((function(e){try{A(e)}catch(A){g(A),o&&o.unsubscribe()}}),g,e)}))},A.prototype._subscribe=function(A){var e=this.source;return e&&e.subscribe(A)},A.prototype[observable]=function(){return this},A.prototype.pipe=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];return 0===A.length?this:pipeFromArray(A)(this)},A.prototype.toPromise=function(A){var e=this;return new(A=getPromiseCtor(A))((function(A,t){var g;e.subscribe((function(A){return g=A}),(function(A){return t(A)}),(function(){return A(g)}))}))},A.create=function(e){return new A(e)},A}();function getPromiseCtor(A){if(A||(A=config$1.Promise||Promise),!A)throw new Error("no Promise impl found");return A}var ObjectUnsubscribedErrorImpl=function(){function A(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return A.prototype=Object.create(Error.prototype),A}(),ObjectUnsubscribedError=ObjectUnsubscribedErrorImpl,SubjectSubscription=function(A){function e(e,t){var g=A.call(this)||this;return g.subject=e,g.subscriber=t,g.closed=!1,g}return __extends$3(e,A),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var A=this.subject,e=A.observers;if(this.subject=null,e&&0!==e.length&&!A.isStopped&&!A.closed){var t=e.indexOf(this.subscriber);-1!==t&&e.splice(t,1)}}},e}(Subscription$2),SubjectSubscriber=function(A){function e(e){var t=A.call(this,e)||this;return t.destination=e,t}return __extends$3(e,A),e}(Subscriber),Subject=function(A){function e(){var e=A.call(this)||this;return e.observers=[],e.closed=!1,e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return __extends$3(e,A),e.prototype[rxSubscriber]=function(){return new SubjectSubscriber(this)},e.prototype.lift=function(A){var e=new AnonymousSubject(this,this);return e.operator=A,e},e.prototype.next=function(A){if(this.closed)throw new ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,t=e.length,g=e.slice(),o=0;o<t;o++)g[o].next(A)},e.prototype.error=function(A){if(this.closed)throw new ObjectUnsubscribedError;this.hasError=!0,this.thrownError=A,this.isStopped=!0;for(var e=this.observers,t=e.length,g=e.slice(),o=0;o<t;o++)g[o].error(A);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new ObjectUnsubscribedError;this.isStopped=!0;for(var A=this.observers,e=A.length,t=A.slice(),g=0;g<e;g++)t[g].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(e){if(this.closed)throw new ObjectUnsubscribedError;return A.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(A){if(this.closed)throw new ObjectUnsubscribedError;return this.hasError?(A.error(this.thrownError),Subscription$2.EMPTY):this.isStopped?(A.complete(),Subscription$2.EMPTY):(this.observers.push(A),new SubjectSubscription(this,A))},e.prototype.asObservable=function(){var A=new Observable;return A.source=this,A},e.create=function(A,e){return new AnonymousSubject(A,e)},e}(Observable),AnonymousSubject=function(A){function e(e,t){var g=A.call(this)||this;return g.destination=e,g.source=t,g}return __extends$3(e,A),e.prototype.next=function(A){var e=this.destination;e&&e.next&&e.next(A)},e.prototype.error=function(A){var e=this.destination;e&&e.error&&this.destination.error(A)},e.prototype.complete=function(){var A=this.destination;A&&A.complete&&this.destination.complete()},e.prototype._subscribe=function(A){return this.source?this.source.subscribe(A):Subscription$2.EMPTY},e}(Subject);function refCount(){return function(A){return A.lift(new RefCountOperator(A))}}var RefCountOperator=function(){function A(A){this.connectable=A}return A.prototype.call=function(A,e){var t=this.connectable;t._refCount++;var g=new RefCountSubscriber(A,t),o=e.subscribe(g);return g.closed||(g.connection=t.connect()),o},A}(),RefCountSubscriber=function(A){function e(e,t){var g=A.call(this,e)||this;return g.connectable=t,g}return __extends$3(e,A),e.prototype._unsubscribe=function(){var A=this.connectable;if(A){this.connectable=null;var e=A._refCount;if(e<=0)this.connection=null;else if(A._refCount=e-1,e>1)this.connection=null;else{var t=this.connection,g=A._connection;this.connection=null,!g||t&&g!==t||g.unsubscribe()}}else this.connection=null},e}(Subscriber),ConnectableObservable=function(A){function e(e,t){var g=A.call(this)||this;return g.source=e,g.subjectFactory=t,g._refCount=0,g._isComplete=!1,g}return __extends$3(e,A),e.prototype._subscribe=function(A){return this.getSubject().subscribe(A)},e.prototype.getSubject=function(){var A=this._subject;return A&&!A.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var A=this._connection;return A||(this._isComplete=!1,(A=this._connection=new Subscription$2).add(this.source.subscribe(new ConnectableSubscriber(this.getSubject(),this))),A.closed&&(this._connection=null,A=Subscription$2.EMPTY)),A},e.prototype.refCount=function(){return refCount()(this)},e}(Observable),connectableObservableDescriptor=function(){var A=ConnectableObservable.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:A._subscribe},_isComplete:{value:A._isComplete,writable:!0},getSubject:{value:A.getSubject},connect:{value:A.connect},refCount:{value:A.refCount}}}(),ConnectableSubscriber=function(A){function e(e,t){var g=A.call(this,e)||this;return g.connectable=t,g}return __extends$3(e,A),e.prototype._error=function(e){this._unsubscribe(),A.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),A.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var A=this.connectable;if(A){this.connectable=null;var e=A._connection;A._refCount=0,A._subject=null,A._connection=null,e&&e.unsubscribe()}},e}(SubjectSubscriber),GroupedObservable=function(A){function e(e,t,g){var o=A.call(this)||this;return o.key=e,o.groupSubject=t,o.refCountSubscription=g,o}return __extends$3(e,A),e.prototype._subscribe=function(A){var e=new Subscription$2,t=this.refCountSubscription,g=this.groupSubject;return t&&!t.closed&&e.add(new InnerRefCountSubscription(t)),e.add(g.subscribe(A)),e},e}(Observable),InnerRefCountSubscription=function(A){function e(e){var t=A.call(this)||this;return t.parent=e,e.count++,t}return __extends$3(e,A),e.prototype.unsubscribe=function(){var e=this.parent;e.closed||this.closed||(A.prototype.unsubscribe.call(this),e.count-=1,0===e.count&&e.attemptedToUnsubscribe&&e.unsubscribe())},e}(Subscription$2),BehaviorSubject=function(A){function e(e){var t=A.call(this)||this;return t._value=e,t}return __extends$3(e,A),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var t=A.prototype._subscribe.call(this,e);return t&&!t.closed&&e.next(this._value),t},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new ObjectUnsubscribedError;return this._value},e.prototype.next=function(e){A.prototype.next.call(this,this._value=e)},e}(Subject),Action$2=function(A){function e(e,t){return A.call(this)||this}return __extends$3(e,A),e.prototype.schedule=function(A,e){return this},e}(Subscription$2),AsyncAction$2=function(A){function e(e,t){var g=A.call(this,e,t)||this;return g.scheduler=e,g.work=t,g.pending=!1,g}return __extends$3(e,A),e.prototype.schedule=function(A,e){if(void 0===e&&(e=0),this.closed)return this;this.state=A;var t=this.id,g=this.scheduler;return null!=t&&(this.id=this.recycleAsyncId(g,t,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(g,this.id,e),this},e.prototype.requestAsyncId=function(A,e,t){return void 0===t&&(t=0),setInterval(A.flush.bind(A,this),t)},e.prototype.recycleAsyncId=function(A,e,t){if(void 0===t&&(t=0),null!==t&&this.delay===t&&!1===this.pending)return e;clearInterval(e)},e.prototype.execute=function(A,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var t=this._execute(A,e);if(t)return t;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(A,e){var t=!1,g=void 0;try{this.work(A)}catch(A){t=!0,g=!!A&&A||new Error(A)}if(t)return this.unsubscribe(),g},e.prototype._unsubscribe=function(){var A=this.id,e=this.scheduler,t=e.actions,g=t.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==g&&t.splice(g,1),null!=A&&(this.id=this.recycleAsyncId(e,A,null)),this.delay=null},e}(Action$2),QueueAction=function(A){function e(e,t){var g=A.call(this,e,t)||this;return g.scheduler=e,g.work=t,g}return __extends$3(e,A),e.prototype.schedule=function(e,t){return void 0===t&&(t=0),t>0?A.prototype.schedule.call(this,e,t):(this.delay=t,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,t){return t>0||this.closed?A.prototype.execute.call(this,e,t):this._execute(e,t)},e.prototype.requestAsyncId=function(e,t,g){return void 0===g&&(g=0),null!==g&&g>0||null===g&&this.delay>0?A.prototype.requestAsyncId.call(this,e,t,g):e.flush(this)},e}(AsyncAction$2),Scheduler$2=function(){function A(e,t){void 0===t&&(t=A.now),this.SchedulerAction=e,this.now=t}return A.prototype.schedule=function(A,e,t){return void 0===e&&(e=0),new this.SchedulerAction(this,A).schedule(t,e)},A.now=function(){return Date.now()},A}(),AsyncScheduler$2=function(A){function e(t,g){void 0===g&&(g=Scheduler$2.now);var o=A.call(this,t,(function(){return e.delegate&&e.delegate!==o?e.delegate.now():g()}))||this;return o.actions=[],o.active=!1,o.scheduled=void 0,o}return __extends$3(e,A),e.prototype.schedule=function(t,g,o){return void 0===g&&(g=0),e.delegate&&e.delegate!==this?e.delegate.schedule(t,g,o):A.prototype.schedule.call(this,t,g,o)},e.prototype.flush=function(A){var e=this.actions;if(this.active)e.push(A);else{var t;this.active=!0;do{if(t=A.execute(A.state,A.delay))break}while(A=e.shift());if(this.active=!1,t){for(;A=e.shift();)A.unsubscribe();throw t}}},e}(Scheduler$2),QueueScheduler=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return __extends$3(e,A),e}(AsyncScheduler$2),queueScheduler=new QueueScheduler(QueueAction),queue=queueScheduler,EMPTY=new Observable((function(A){return A.complete()}));function empty(A){return A?emptyScheduled(A):EMPTY}function emptyScheduled(A){return new Observable((function(e){return A.schedule((function(){return e.complete()}))}))}function isScheduler(A){return A&&"function"==typeof A.schedule}var subscribeToArray=function(A){return function(e){for(var t=0,g=A.length;t<g&&!e.closed;t++)e.next(A[t]);e.complete()}},NotificationKind;function scheduleArray(A,e){return new Observable((function(t){var g=new Subscription$2,o=0;return g.add(e.schedule((function(){o!==A.length?(t.next(A[o++]),t.closed||g.add(this.schedule())):t.complete()}))),g}))}function fromArray(A,e){return e?scheduleArray(A,e):new Observable(subscribeToArray(A))}function of(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=A[A.length-1];return isScheduler(t)?(A.pop(),scheduleArray(A,t)):fromArray(A)}function throwError(A,e){return new Observable(e?function(t){return e.schedule(dispatch$7,0,{error:A,subscriber:t})}:function(e){return e.error(A)})}function dispatch$7(A){var e=A.error;A.subscriber.error(e)}NotificationKind||(NotificationKind={});var Notification=function(){function A(A,e,t){this.kind=A,this.value=e,this.error=t,this.hasValue="N"===A}return A.prototype.observe=function(A){switch(this.kind){case"N":return A.next&&A.next(this.value);case"E":return A.error&&A.error(this.error);case"C":return A.complete&&A.complete()}},A.prototype.do=function(A,e,t){switch(this.kind){case"N":return A&&A(this.value);case"E":return e&&e(this.error);case"C":return t&&t()}},A.prototype.accept=function(A,e,t){return A&&"function"==typeof A.next?this.observe(A):this.do(A,e,t)},A.prototype.toObservable=function(){switch(this.kind){case"N":return of(this.value);case"E":return throwError(this.error);case"C":return empty()}throw new Error("unexpected notification kind value")},A.createNext=function(e){return void 0!==e?new A("N",e):A.undefinedValueNotification},A.createError=function(e){return new A("E",void 0,e)},A.createComplete=function(){return A.completeNotification},A.completeNotification=new A("C"),A.undefinedValueNotification=new A("N",void 0),A}();function observeOn(A,e){return void 0===e&&(e=0),function(t){return t.lift(new ObserveOnOperator(A,e))}}var ObserveOnOperator=function(){function A(A,e){void 0===e&&(e=0),this.scheduler=A,this.delay=e}return A.prototype.call=function(A,e){return e.subscribe(new ObserveOnSubscriber(A,this.scheduler,this.delay))},A}(),ObserveOnSubscriber=function(A){function e(e,t,g){void 0===g&&(g=0);var o=A.call(this,e)||this;return o.scheduler=t,o.delay=g,o}return __extends$3(e,A),e.dispatch=function(A){var e=A.notification,t=A.destination;e.observe(t),this.unsubscribe()},e.prototype.scheduleMessage=function(A){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new ObserveOnMessage(A,this.destination)))},e.prototype._next=function(A){this.scheduleMessage(Notification.createNext(A))},e.prototype._error=function(A){this.scheduleMessage(Notification.createError(A)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(Notification.createComplete()),this.unsubscribe()},e}(Subscriber),ObserveOnMessage=function(){return function(A,e){this.notification=A,this.destination=e}}(),ReplaySubject=function(A){function e(e,t,g){void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===t&&(t=Number.POSITIVE_INFINITY);var o=A.call(this)||this;return o.scheduler=g,o._events=[],o._infiniteTimeWindow=!1,o._bufferSize=e<1?1:e,o._windowTime=t<1?1:t,t===Number.POSITIVE_INFINITY?(o._infiniteTimeWindow=!0,o.next=o.nextInfiniteTimeWindow):o.next=o.nextTimeWindow,o}return __extends$3(e,A),e.prototype.nextInfiniteTimeWindow=function(e){if(!this.isStopped){var t=this._events;t.push(e),t.length>this._bufferSize&&t.shift()}A.prototype.next.call(this,e)},e.prototype.nextTimeWindow=function(e){this.isStopped||(this._events.push(new ReplayEvent(this._getNow(),e)),this._trimBufferThenGetEvents()),A.prototype.next.call(this,e)},e.prototype._subscribe=function(A){var e,t=this._infiniteTimeWindow,g=t?this._events:this._trimBufferThenGetEvents(),o=this.scheduler,i=g.length;if(this.closed)throw new ObjectUnsubscribedError;if(this.isStopped||this.hasError?e=Subscription$2.EMPTY:(this.observers.push(A),e=new SubjectSubscription(this,A)),o&&A.add(A=new ObserveOnSubscriber(A,o)),t)for(var I=0;I<i&&!A.closed;I++)A.next(g[I]);else for(I=0;I<i&&!A.closed;I++)A.next(g[I].value);return this.hasError?A.error(this.thrownError):this.isStopped&&A.complete(),e},e.prototype._getNow=function(){return(this.scheduler||queue).now()},e.prototype._trimBufferThenGetEvents=function(){for(var A=this._getNow(),e=this._bufferSize,t=this._windowTime,g=this._events,o=g.length,i=0;i<o&&!(A-g[i].time<t);)i++;return o>e&&(i=Math.max(i,o-e)),i>0&&g.splice(0,i),g},e}(Subject),ReplayEvent=function(){return function(A,e){this.time=A,this.value=e}}(),AsyncSubject=function(A){function e(){var e=null!==A&&A.apply(this,arguments)||this;return e.value=null,e.hasNext=!1,e.hasCompleted=!1,e}return __extends$3(e,A),e.prototype._subscribe=function(e){return this.hasError?(e.error(this.thrownError),Subscription$2.EMPTY):this.hasCompleted&&this.hasNext?(e.next(this.value),e.complete(),Subscription$2.EMPTY):A.prototype._subscribe.call(this,e)},e.prototype.next=function(A){this.hasCompleted||(this.value=A,this.hasNext=!0)},e.prototype.error=function(e){this.hasCompleted||A.prototype.error.call(this,e)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&A.prototype.next.call(this,this.value),A.prototype.complete.call(this)},e}(Subject),nextHandle=1,RESOLVED=function(){return Promise.resolve()}(),activeHandles={};function findAndClearHandle(A){return A in activeHandles&&(delete activeHandles[A],!0)}var Immediate={setImmediate:function(A){var e=nextHandle++;return activeHandles[e]=!0,RESOLVED.then((function(){return findAndClearHandle(e)&&A()})),e},clearImmediate:function(A){findAndClearHandle(A)}},AsapAction=function(A){function e(e,t){var g=A.call(this,e,t)||this;return g.scheduler=e,g.work=t,g}return __extends$3(e,A),e.prototype.requestAsyncId=function(e,t,g){return void 0===g&&(g=0),null!==g&&g>0?A.prototype.requestAsyncId.call(this,e,t,g):(e.actions.push(this),e.scheduled||(e.scheduled=Immediate.setImmediate(e.flush.bind(e,null))))},e.prototype.recycleAsyncId=function(e,t,g){if(void 0===g&&(g=0),null!==g&&g>0||null===g&&this.delay>0)return A.prototype.recycleAsyncId.call(this,e,t,g);0===e.actions.length&&(Immediate.clearImmediate(t),e.scheduled=void 0)},e}(AsyncAction$2),AsapScheduler=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return __extends$3(e,A),e.prototype.flush=function(A){this.active=!0,this.scheduled=void 0;var e,t=this.actions,g=-1,o=t.length;A=A||t.shift();do{if(e=A.execute(A.state,A.delay))break}while(++g<o&&(A=t.shift()));if(this.active=!1,e){for(;++g<o&&(A=t.shift());)A.unsubscribe();throw e}},e}(AsyncScheduler$2),asapScheduler=new AsapScheduler(AsapAction),asap=asapScheduler,asyncScheduler=new AsyncScheduler$2(AsyncAction$2),async=asyncScheduler,AnimationFrameAction=function(A){function e(e,t){var g=A.call(this,e,t)||this;return g.scheduler=e,g.work=t,g}return __extends$3(e,A),e.prototype.requestAsyncId=function(e,t,g){return void 0===g&&(g=0),null!==g&&g>0?A.prototype.requestAsyncId.call(this,e,t,g):(e.actions.push(this),e.scheduled||(e.scheduled=requestAnimationFrame((function(){return e.flush(null)}))))},e.prototype.recycleAsyncId=function(e,t,g){if(void 0===g&&(g=0),null!==g&&g>0||null===g&&this.delay>0)return A.prototype.recycleAsyncId.call(this,e,t,g);0===e.actions.length&&(cancelAnimationFrame(t),e.scheduled=void 0)},e}(AsyncAction$2),AnimationFrameScheduler=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return __extends$3(e,A),e.prototype.flush=function(A){this.active=!0,this.scheduled=void 0;var e,t=this.actions,g=-1,o=t.length;A=A||t.shift();do{if(e=A.execute(A.state,A.delay))break}while(++g<o&&(A=t.shift()));if(this.active=!1,e){for(;++g<o&&(A=t.shift());)A.unsubscribe();throw e}},e}(AsyncScheduler$2),animationFrameScheduler=new AnimationFrameScheduler(AnimationFrameAction),animationFrame=animationFrameScheduler,VirtualTimeScheduler=function(A){function e(e,t){void 0===e&&(e=VirtualAction),void 0===t&&(t=Number.POSITIVE_INFINITY);var g=A.call(this,e,(function(){return g.frame}))||this;return g.maxFrames=t,g.frame=0,g.index=-1,g}return __extends$3(e,A),e.prototype.flush=function(){for(var A,e,t=this.actions,g=this.maxFrames;(e=t[0])&&e.delay<=g&&(t.shift(),this.frame=e.delay,!(A=e.execute(e.state,e.delay))););if(A){for(;e=t.shift();)e.unsubscribe();throw A}},e.frameTimeFactor=10,e}(AsyncScheduler$2),VirtualAction=function(A){function e(e,t,g){void 0===g&&(g=e.index+=1);var o=A.call(this,e,t)||this;return o.scheduler=e,o.work=t,o.index=g,o.active=!0,o.index=e.index=g,o}return __extends$3(e,A),e.prototype.schedule=function(t,g){if(void 0===g&&(g=0),!this.id)return A.prototype.schedule.call(this,t,g);this.active=!1;var o=new e(this.scheduler,this.work);return this.add(o),o.schedule(t,g)},e.prototype.requestAsyncId=function(A,t,g){void 0===g&&(g=0),this.delay=A.frame+g;var o=A.actions;return o.push(this),o.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(A,e,t){},e.prototype._execute=function(e,t){if(!0===this.active)return A.prototype._execute.call(this,e,t)},e.sortActions=function(A,e){return A.delay===e.delay?A.index===e.index?0:A.index>e.index?1:-1:A.delay>e.delay?1:-1},e}(AsyncAction$2);function noop$3(){}function isObservable(A){return!!A&&(A instanceof Observable||"function"==typeof A.lift&&"function"==typeof A.subscribe)}var ArgumentOutOfRangeErrorImpl=function(){function A(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return A.prototype=Object.create(Error.prototype),A}(),ArgumentOutOfRangeError=ArgumentOutOfRangeErrorImpl,EmptyErrorImpl=function(){function A(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return A.prototype=Object.create(Error.prototype),A}(),EmptyError=EmptyErrorImpl,TimeoutErrorImpl=function(){function A(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return A.prototype=Object.create(Error.prototype),A}(),TimeoutError=TimeoutErrorImpl;function map$1(A,e){return function(t){if("function"!=typeof A)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return t.lift(new MapOperator(A,e))}}var MapOperator=function(){function A(A,e){this.project=A,this.thisArg=e}return A.prototype.call=function(A,e){return e.subscribe(new MapSubscriber(A,this.project,this.thisArg))},A}(),MapSubscriber=function(A){function e(e,t,g){var o=A.call(this,e)||this;return o.project=t,o.count=0,o.thisArg=g||o,o}return __extends$3(e,A),e.prototype._next=function(A){var e;try{e=this.project.call(this.thisArg,A,this.count++)}catch(A){return void this.destination.error(A)}this.destination.next(e)},e}(Subscriber);function bindCallback(A,e,t){if(e){if(!isScheduler(e))return function(){for(var g=[],o=0;o<arguments.length;o++)g[o]=arguments[o];return bindCallback(A,t).apply(void 0,g).pipe(map$1((function(A){return isArray$g(A)?e.apply(void 0,A):e(A)})))};t=e}return function(){for(var e=[],g=0;g<arguments.length;g++)e[g]=arguments[g];var o,i=this,I={context:i,subject:o,callbackFunc:A,scheduler:t};return new Observable((function(g){if(t){var r={args:e,subscriber:g,params:I};return t.schedule(dispatch$6,0,r)}if(!o){o=new AsyncSubject;try{A.apply(i,e.concat([function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];o.next(A.length<=1?A[0]:A),o.complete()}]))}catch(A){canReportError(o)?o.error(A):console.warn(A)}}return o.subscribe(g)}))}}function dispatch$6(A){var e=this,t=A.args,g=A.subscriber,o=A.params,i=o.callbackFunc,I=o.context,r=o.scheduler,n=o.subject;if(!n){n=o.subject=new AsyncSubject;try{i.apply(I,t.concat([function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];var g=A.length<=1?A[0]:A;e.add(r.schedule(dispatchNext$2,0,{value:g,subject:n}))}]))}catch(A){n.error(A)}}this.add(n.subscribe(g))}function dispatchNext$2(A){var e=A.value,t=A.subject;t.next(e),t.complete()}function bindNodeCallback(A,e,t){if(e){if(!isScheduler(e))return function(){for(var g=[],o=0;o<arguments.length;o++)g[o]=arguments[o];return bindNodeCallback(A,t).apply(void 0,g).pipe(map$1((function(A){return isArray$g(A)?e.apply(void 0,A):e(A)})))};t=e}return function(){for(var e=[],g=0;g<arguments.length;g++)e[g]=arguments[g];var o={subject:void 0,args:e,callbackFunc:A,scheduler:t,context:this};return new Observable((function(g){var i=o.context,I=o.subject;if(t)return t.schedule(dispatch$5,0,{params:o,subscriber:g,context:i});if(!I){I=o.subject=new AsyncSubject;try{A.apply(i,e.concat([function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=A.shift();t?I.error(t):(I.next(A.length<=1?A[0]:A),I.complete())}]))}catch(A){canReportError(I)?I.error(A):console.warn(A)}}return I.subscribe(g)}))}}function dispatch$5(A){var e=this,t=A.params,g=A.subscriber,o=A.context,i=t.callbackFunc,I=t.args,r=t.scheduler,n=t.subject;if(!n){n=t.subject=new AsyncSubject;try{i.apply(o,I.concat([function(){for(var A=[],t=0;t<arguments.length;t++)A[t]=arguments[t];var g=A.shift();if(g)e.add(r.schedule(dispatchError,0,{err:g,subject:n}));else{var o=A.length<=1?A[0]:A;e.add(r.schedule(dispatchNext$1,0,{value:o,subject:n}))}}]))}catch(A){this.add(r.schedule(dispatchError,0,{err:A,subject:n}))}}this.add(n.subscribe(g))}function dispatchNext$1(A){var e=A.value,t=A.subject;t.next(e),t.complete()}function dispatchError(A){var e=A.err;A.subject.error(e)}var OuterSubscriber=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return __extends$3(e,A),e.prototype.notifyNext=function(A,e,t,g,o){this.destination.next(e)},e.prototype.notifyError=function(A,e){this.destination.error(A)},e.prototype.notifyComplete=function(A){this.destination.complete()},e}(Subscriber),InnerSubscriber=function(A){function e(e,t,g){var o=A.call(this)||this;return o.parent=e,o.outerValue=t,o.outerIndex=g,o.index=0,o}return __extends$3(e,A),e.prototype._next=function(A){this.parent.notifyNext(this.outerValue,A,this.outerIndex,this.index++,this)},e.prototype._error=function(A){this.parent.notifyError(A,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(Subscriber),subscribeToPromise=function(A){return function(e){return A.then((function(A){e.closed||(e.next(A),e.complete())}),(function(A){return e.error(A)})).then(null,hostReportError),e}};function getSymbolIterator(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var iterator=getSymbolIterator(),subscribeToIterable=function(A){return function(e){for(var t=A[iterator]();;){var g=void 0;try{g=t.next()}catch(A){return e.error(A),e}if(g.done){e.complete();break}if(e.next(g.value),e.closed)break}return"function"==typeof t.return&&e.add((function(){t.return&&t.return()})),e}},subscribeToObservable=function(A){return function(e){var t=A[observable]();if("function"!=typeof t.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return t.subscribe(e)}},isArrayLike$9=function(A){return A&&"number"==typeof A.length&&"function"!=typeof A};function isPromise(A){return!!A&&"function"!=typeof A.subscribe&&"function"==typeof A.then}var subscribeTo=function(A){if(A&&"function"==typeof A[observable])return subscribeToObservable(A);if(isArrayLike$9(A))return subscribeToArray(A);if(isPromise(A))return subscribeToPromise(A);if(A&&"function"==typeof A[iterator])return subscribeToIterable(A);var e=isObject$e(A)?"an invalid object":"'"+A+"'";throw new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")};function subscribeToResult(A,e,t,g,o){if(void 0===o&&(o=new InnerSubscriber(A,t,g)),!o.closed)return e instanceof Observable?e.subscribe(o):subscribeTo(e)(o)}var NONE={};function combineLatest(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];var t=void 0,g=void 0;return isScheduler(A[A.length-1])&&(g=A.pop()),"function"==typeof A[A.length-1]&&(t=A.pop()),1===A.length&&isArray$g(A[0])&&(A=A[0]),fromArray(A,g).lift(new CombineLatestOperator(t))}var CombineLatestOperator=function(){function A(A){this.resultSelector=A}return A.prototype.call=function(A,e){return e.subscribe(new CombineLatestSubscriber(A,this.resultSelector))},A}(),CombineLatestSubscriber=function(A){function e(e,t){var g=A.call(this,e)||this;return g.resultSelector=t,g.active=0,g.values=[],g.observables=[],g}return __extends$3(e,A),e.prototype._next=function(A){this.values.push(NONE),this.observables.push(A)},e.prototype._complete=function(){var A=this.observables,e=A.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var t=0;t<e;t++){var g=A[t];this.add(subscribeToResult(this,g,void 0,t))}}},e.prototype.notifyComplete=function(A){0==(this.active-=1)&&this.destination.complete()},e.prototype.notifyNext=function(A,e,t){var g=this.values,o=g[t],i=this.toRespond?o===NONE?--this.toRespond:this.toRespond:0;g[t]=e,0===i&&(this.resultSelector?this._tryResultSelector(g):this.destination.next(g.slice()))},e.prototype._tryResultSelector=function(A){var e;try{e=this.resultSelector.apply(this,A)}catch(A){return void this.destination.error(A)}this.destination.next(e)},e}(OuterSubscriber);function scheduleObservable(A,e){return new Observable((function(t){var g=new Subscription$2;return g.add(e.schedule((function(){var o=A[observable]();g.add(o.subscribe({next:function(A){g.add(e.schedule((function(){return t.next(A)})))},error:function(A){g.add(e.schedule((function(){return t.error(A)})))},complete:function(){g.add(e.schedule((function(){return t.complete()})))}}))}))),g}))}function schedulePromise(A,e){return new Observable((function(t){var g=new Subscription$2;return g.add(e.schedule((function(){return A.then((function(A){g.add(e.schedule((function(){t.next(A),g.add(e.schedule((function(){return t.complete()})))})))}),(function(A){g.add(e.schedule((function(){return t.error(A)})))}))}))),g}))}function scheduleIterable(A,e){if(!A)throw new Error("Iterable cannot be null");return new Observable((function(t){var g,o=new Subscription$2;return o.add((function(){g&&"function"==typeof g.return&&g.return()})),o.add(e.schedule((function(){g=A[iterator](),o.add(e.schedule((function(){if(!t.closed){var A,e;try{var o=g.next();A=o.value,e=o.done}catch(A){return void t.error(A)}e?t.complete():(t.next(A),this.schedule())}})))}))),o}))}function isInteropObservable(A){return A&&"function"==typeof A[observable]}function isIterable$1(A){return A&&"function"==typeof A[iterator]}function scheduled(A,e){if(null!=A){if(isInteropObservable(A))return scheduleObservable(A,e);if(isPromise(A))return schedulePromise(A,e);if(isArrayLike$9(A))return scheduleArray(A,e);if(isIterable$1(A)||"string"==typeof A)return scheduleIterable(A,e)}throw new TypeError((null!==A&&typeof A||A)+" is not observable")}function from(A,e){return e?scheduled(A,e):A instanceof Observable?A:new Observable(subscribeTo(A))}var SimpleInnerSubscriber=function(A){function e(e){var t=A.call(this)||this;return t.parent=e,t}return __extends$3(e,A),e.prototype._next=function(A){this.parent.notifyNext(A)},e.prototype._error=function(A){this.parent.notifyError(A),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(Subscriber),SimpleOuterSubscriber=function(A){function e(){return null!==A&&A.apply(this,arguments)||this}return __extends$3(e,A),e.prototype.notifyNext=function(A){this.destination.next(A)},e.prototype.notifyError=function(A){this.destination.error(A)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(Subscriber);function innerSubscribe(A,e){if(!e.closed){if(A instanceof Observable)return A.subscribe(e);var t;try{t=subscribeTo(A)(e)}catch(A){e.error(A)}return t}}function mergeMap(A,e,t){return void 0===t&&(t=Number.POSITIVE_INFINITY),"function"==typeof e?function(g){return g.pipe(mergeMap((function(t,g){return from(A(t,g)).pipe(map$1((function(A,o){return e(t,A,g,o)})))}),t))}:("number"==typeof e&&(t=e),function(e){return e.lift(new MergeMapOperator(A,t))})}var MergeMapOperator=function(){function A(A,e){void 0===e&&(e=Number.POSITIVE_INFINITY),this.project=A,this.concurrent=e}return A.prototype.call=function(A,e){return e.subscribe(new MergeMapSubscriber(A,this.project,this.concurrent))},A}(),MergeMapSubscriber=function(A){function e(e,t,g){void 0===g&&(g=Number.POSITIVE_INFINITY);var o=A.call(this,e)||this;return o.project=t,o.concurrent=g,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return __extends$3(e,A),e.prototype._next=function(A){this.active<this.concurrent?this._tryNext(A):this.buffer.push(A)},e.prototype._tryNext=function(A){var e,t=this.index++;try{e=this.project(A,t)}catch(A){return void this.destination.error(A)}this.active++,this._innerSub(e)},e.prototype._innerSub=function(A){var e=new SimpleInnerSubscriber(this),t=this.destination;t.add(e);var g=innerSubscribe(A,e);g!==e&&t.add(g)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(A){this.destination.next(A)},e.prototype.notifyComplete=function(){var A=this.buffer;this.active--,A.length>0?this._next(A.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},e}(SimpleOuterSubscriber);function mergeAll(A){return void 0===A&&(A=Number.POSITIVE_INFINITY),mergeMap(identity$5,A)}function concatAll(){return mergeAll(1)}function concat(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];return concatAll()(of.apply(void 0,A))}function defer(A){return new Observable((function(e){var t;try{t=A()}catch(A){return void e.error(A)}return(t?from(t):empty()).subscribe(e)}))}function forkJoin(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(1===A.length){var t=A[0];if(isArray$g(t))return forkJoinInternal(t,null);if(isObject$e(t)&&Object.getPrototypeOf(t)===Object.prototype){var g=Object.keys(t);return forkJoinInternal(g.map((function(A){return t[A]})),g)}}if("function"==typeof A[A.length-1]){var o=A.pop();return forkJoinInternal(A=1===A.length&&isArray$g(A[0])?A[0]:A,null).pipe(map$1((function(A){return o.apply(void 0,A)})))}return forkJoinInternal(A,null)}function forkJoinInternal(A,e){return new Observable((function(t){var g=A.length;if(0!==g)for(var o=new Array(g),i=0,I=0,r=function(r){var n=from(A[r]),s=!1;t.add(n.subscribe({next:function(A){s||(s=!0,I++),o[r]=A},error:function(A){return t.error(A)},complete:function(){++i!==g&&s||(I===g&&t.next(e?e.reduce((function(A,e,t){return A[e]=o[t],A}),{}):o),t.complete())}}))},n=0;n<g;n++)r(n);else t.complete()}))}function fromEvent(A,e,t,g){return isFunction$7(t)&&(g=t,t=void 0),g?fromEvent(A,e,t).pipe(map$1((function(A){return isArray$g(A)?g.apply(void 0,A):g(A)}))):new Observable((function(g){setupSubscription(A,e,(function(A){arguments.length>1?g.next(Ar