shell bypass 403
/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = "/"; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 0); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/@babel/runtime/regenerator/index.js": /*!**********************************************************!*\ !*** ./node_modules/@babel/runtime/regenerator/index.js ***! \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! regenerator-runtime */ "./node_modules/regenerator-runtime/runtime.js"); /***/ }), /***/ "./node_modules/agora-rtm-sdk/index.js": /*!*********************************************!*\ !*** ./node_modules/agora-rtm-sdk/index.js ***! \*********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* WEBPACK VAR INJECTION */(function(global, process, module) {/* @preserve AgoraRTM Web SDK 1.4.3-203 - commit: v1.4.3-17-g1e27aa38 Copyright (C) 2018-2021 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(e,t){ true?module.exports=t():undefined}(this,(function(){function be(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ua(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?be(Object(n),!0).forEach((function(t){m(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):be(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function X(e){return(X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sl(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}function J(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){function o(e){sl(s,r,i,o,a,"next",e)}function a(e){sl(s,r,i,o,a,"throw",e)}var s=e.apply(t,n);o(void 0)}))}}function W(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tl(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Ha(e,t,n){return t&&tl(e.prototype,t),n&&tl(e,n),e}function m(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function la(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&df(e,t)}function wd(e){return(wd=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function df(e,t){return(df=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ul(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Sh(e,t,n){return(Sh=ul()?Reflect.construct:function(e,t,n){var r=[null];return r.push.apply(r,t),e=new(Function.bind.apply(e,r)),n&&df(e,n.prototype),e}).apply(null,arguments)}function ef(e){var t="function"==typeof Map?new Map:void 0;return(ef=function(e){function n(){return Sh(e,arguments,wd(this).constructor)}if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),df(n,e)})(e)}function ff(e,t){if(null==e)return{};if(null==e)var n={};else{n={};var r,i=Object.keys(e);for(r=0;r<i.length;r++){var o=i[r];0<=t.indexOf(o)||(n[o]=e[o])}}if(Object.getOwnPropertySymbols)for(r=Object.getOwnPropertySymbols(e),o=0;o<r.length;o++)i=r[o],0<=t.indexOf(i)||Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i]);return n}function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ma(e){var t=ul();return function(){var r=wd(e);if(t){var i=wd(this).constructor;r=Reflect.construct(r,arguments,i)}else r=r.apply(this,arguments);return r=!r||"object"!=typeof r&&"function"!=typeof r?n(this):r}}function Th(e,t,n){return(Th="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=wd(e)););if(e)return(t=Object.getOwnPropertyDescriptor(e,t)).get?t.get.call(n):t.value})(e,t,n||e)}function ra(e,t){var n=Array.isArray(e)?e:void 0;if(!n)if(null==(n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"])))n=void 0;else{var r,i=[],o=!0,a=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);o=!0);}catch(e){a=!0;var s=e}finally{try{o||null==n.return||n.return()}finally{if(a)throw s}}n=i}if(!(e=n||vl(e,t)))throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");return e}function G(e){var t=Array.isArray(e)?Uh(e):void 0;if(t||(t="undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"]?Array.from(e):void 0),!(e=t||vl(e)))throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");return e}function vl(e,t){if(e){if("string"==typeof e)return Uh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Uh(e,t)}}function Uh(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function fa(e,t,n,r,i){var o={};return Object.keys(r).forEach((function(e){o[e]=r[e]})),o.enumerable=!!o.enumerable,o.configurable=!!o.configurable,("value"in o||o.initializer)&&(o.writable=!0),o=n.slice().reverse().reduce((function(n,r){return r(e,t,n)||n}),o),i&&void 0!==o.initializer&&(o.value=o.initializer?o.initializer.call(i):void 0,o.initializer=void 0),void 0===o.initializer&&(Object.defineProperty(e,t,o),o=null),o}function $a(e){var t={exports:{}};return e(t,t.exports),t.exports}function wl(e,t){var n,r=3>arguments.length?e:arguments[2];return va(e)===r?e[t]:(n=Fb.f(e,t))?Q(n,"value")?n.value:void 0===n.get?void 0:n.get.call(r):ha(n=Vb(e))?wl(n,t,r):void 0}function rs(e){var t=e.charCodeAt(0)<<24,n=0|ss(~t),r=0,i=0|e.length,o="";if(5>n&&i>=n){for(t=t<<n>>>24+n,r=1;r<n;r=r+1|0)t=t<<6|63&e.charCodeAt(r);65535>=t?o+=xd(t):1114111>=t?o+=xd(55296+((t=t-65536|0)>>10)|0,56320+(1023&t)|0):r=0}for(;r<i;r=r+1|0)o+="�";return o}function xl(){}function ts(e){var t=0|e.charCodeAt(0);if(55296<=t&&56319>=t){var n=0|e.charCodeAt(1);if(!(n==n&&56320<=n&&57343>=n))return xd(239,191,189);if(65535<(t=(t-55296<<10)+n-56320+65536|0))return xd(240|t>>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}return 127>=t?e:2047>=t?xd(192|t>>>6,128|63&t):xd(224|t>>>12,128|t>>>6&63,128|63&t)}function yl(){}function ea(){ea.init.call(this)}function ng(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+X(e))}function zl(e,t,n,r){ng(n);var i=e._events;if(void 0===i)i=e._events=Object.create(null),e._eventsCount=0;else{void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events);var o=i[t]}return void 0===o?(i[t]=n,++e._eventsCount):("function"==typeof o?o=i[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),0<(n=void 0===e._maxListeners?ea.defaultMaxListeners:e._maxListeners)&&o.length>n&&!o.warned&&(o.warned=!0,(n=Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit")).name="MaxListenersExceededWarning",n.emitter=e,n.type=t,n.count=o.length,console&&console.warn&&console.warn(n))),e}function us(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Al(e,t,n){return e={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},(t=us.bind(e)).listener=n,e.wrapFn=t}function Bl(e,t,n){if(void 0===(e=e._events))return[];if(void 0===(t=e[t]))return[];if("function"==typeof t)return n?[t.listener||t]:[t];if(n)for(n=Array(t.length),e=0;e<n.length;++e)n[e]=t[e].listener||t[e];else n=Cl(t,t.length);return n}function Dl(e){var t=this._events;if(void 0!==t){if("function"==typeof(e=t[e]))return 1;if(void 0!==e)return e.length}return 0}function Cl(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function vs(e,t,n){"function"==typeof e.on&&El(e,"error",t,n)}function El(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+X(e));e.addEventListener(t,(function i(o){r.once&&e.removeEventListener(t,i),n(o)}))}}function ws(e){return e?G(e):xs((function(){return[]}),(function(e,t){return e.push(t),e}))}function Fl(e,t){var n,r,i,o;return w.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:n=Gl(e)([Hl,Hl,function(e,t){return t}])[2],r=0;case 2:if(!(r<t.length)){a.next=17;break}if(i=t[r],!((o=n(Vh,i))instanceof og)){a.next=11;break}if((o=Wh(o.deref()))===Vh){a.next=10;break}return a.next=10,o;case 10:return a.abrupt("return");case 11:if(o===Vh){a.next=14;break}return a.next=14,o;case 14:r++,a.next=2;break;case 17:case"end":return a.stop()}}),ys)}function pg(e,t){return null!=t&&"function"==typeof t[Symbol.iterator]?Fl(pg(e),t):function(t){var n=t[2];return zs(t,(function(t,r){return n(t,e(r))}))}}function Ac(e){return Object.prototype.toString.call(e).slice(8,-1)}function yd(e){return"Object"===Ac(e)&&(e.constructor===Object&&Object.getPrototypeOf(e)===Object.prototype)}function Il(e){var t;return(t="Boolean"===Ac(e)||"Null"===Ac(e)||"Undefined"===Ac(e))||(t="Number"===Ac(e)&&!isNaN(e)),t||"String"===Ac(e)||"Symbol"===Ac(e)}function zd(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ce(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function de(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function gf(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new qg;++t<n;)this.add(e[t])}function ee(e){this.size=(this.__data__=new rg(e)).size}function fe(e,t,n,r,i,o){var a,s=1&t,u=2&t,c=4&t;if(n&&(a=i?n(e,r,i,o):n(e)),void 0!==a)return a;if(!lb(e))return e;if(r=Va(e)){if(a=As(e),!s)return Xh(e,a)}else{var l=hf(e),f="[object Function]"==l||"[object GeneratorFunction]"==l;if(jf(e))return Jl(e,s);if("[object Object]"==l||"[object Arguments]"==l||f&&!i){if(a=u||f?{}:Kl(e),!s)return u?Bs(e,Cs(a,e)):Ds(e,Es(a,e))}else{if(!wa[l])return i?e:{};a=Fs(e,l,s)}}if(o||(o=new ge),i=o.get(e))return i;o.set(e,a),Gs(e)?e.forEach((function(r){a.add(fe(r,t,n,r,e,o))})):Hs(e)&&e.forEach((function(r,i){a.set(i,fe(r,t,n,i,e,o))})),u=c?u?Ll:Yh:u?kf:Ad;var h=r?void 0:u(e);return Is(h||e,(function(r,i){h&&(r=e[i=r]),Ml(a,i,fe(r,t,n,i,e,o))})),a}function Zh(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function n(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;return o.has(i)?o.get(i):(r=e.apply(this,r),n.cache=o.set(i,r)||o,r)};return n.cache=new(Zh.Cache||qg),n}function Nl(e){if("string"==typeof e)return e;if(Va(e))return he(e,Nl)+"";if(ie(e))return Ol?Ol.call(e):"";var t=e+"";return"0"==t&&1/e==-Js?"-0":t}function $h(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=Ks),i||(i=[]);++o<a;){var s=e[o];0<t&&n(s)?1<t?$h(s,t-1,n,r,i):ai(i,s):r||(i[i.length]=s)}return i}function je(e,t,n,r,i){if(e===t)t=!0;else if(null==e||null==t||!gc(e)&&!gc(t))t=e!=e&&t!=t;else e:{var o=Va(e),a=Va(t),s=o?"[object Array]":hf(e),u=a?"[object Array]":hf(t),c="[object Object]"==(s="[object Arguments]"==s?"[object Object]":s);if(a="[object Object]"==(u="[object Arguments]"==u?"[object Object]":u),(u=s==u)&&jf(e)){if(!jf(t)){t=!1;break e}o=!0,c=!1}if(u&&!c)i||(i=new ge),t=o||bi(e)?Pl(e,t,n,r,je,i):Ls(e,t,s,n,r,je,i);else{if(!(1&n)&&(o=c&&Ql.call(e,"__wrapped__"),s=a&&Ql.call(t,"__wrapped__"),o||s)){e=o?e.value():e,t=s?t.value():t,i||(i=new ge),t=je(e,t,n,r,i);break e}if(u)t:if(i||(i=new ge),o=1&n,s=Yh(e),a=s.length,u=Yh(t).length,a==u||o){for(u=a;u--;){var l=s[u];if(!(o?l in t:Ms.call(t,l))){t=!1;break t}}if(c=i.get(e),l=i.get(t),c&&l)t=c==t&&l==e;else{c=!0,i.set(e,t),i.set(t,e);for(var f=o;++u<a;){var h=e[l=s[u]],p=t[l];if(r)var d=o?r(p,h,l,t,e,i):r(h,p,l,e,t,i);if(void 0===d?h!==p&&!je(h,p,n,r,i):!d){c=!1;break}f||(f="constructor"==l)}c&&!f&&((n=e.constructor)!=(r=t.constructor)&&"constructor"in e&&"constructor"in t&&!("function"==typeof n&&n instanceof n&&"function"==typeof r&&r instanceof r)&&(c=!1)),i.delete(e),i.delete(t),t=c}}else t=!1;else t=!1}}return t}function xa(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function mb(e){return!0===(e&&e.__isLong__)}function Bd(e,t){var n;if(t){if((t=0<=(e>>>=0)&&256>e)&&(n=Rl[e]))return n;n=ya(e,0>(0|e)?-1:0,!0),t&&(Rl[e]=n)}else{if((t=-128<=(e|=0)&&128>e)&&(n=Sl[e]))return n;n=ya(e,0>e?-1:0,!1),t&&(Sl[e]=n)}return n}function Gb(e,t){if(isNaN(e))return t?Cd:Hb;if(t){if(0>e)return Cd;if(e>=Tl)return Ul}else{if(e<=-Vl)return nb;if(e+1>=Vl)return Wl}return 0>e?Gb(-e,t).neg():ya(e%ke|0,e/ke|0,t)}function ya(e,t,n){return new xa(e,t,n)}function ci(e,t,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return Hb;if("number"==typeof t?(n=t,t=!1):t=!!t,2>(n=n||10)||36<n)throw RangeError("radix");var r;if(0<(r=e.indexOf("-")))throw Error("interior hyphen");if(0===r)return ci(e.substring(1),t,n).neg();r=Gb(sg(n,8));for(var i=Hb,o=0;o<e.length;o+=8){var a=Math.min(8,e.length-o),s=parseInt(e.substring(o,o+a),n);8>a?(a=Gb(sg(n,a)),i=i.mul(a).add(Gb(s))):i=(i=i.mul(r)).add(Gb(s))}return i.unsigned=t,i}function Wb(e,t){return"number"==typeof e?Gb(e,t):"string"==typeof e?ci(e,t):ya(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}function O(e,t){function n(){this.constructor=e}di(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function le(e){return"function"==typeof e}function me(e){setTimeout((function(){throw e}),0)}function ei(e){return null!==e&&"object"===X(e)}function Xl(e){return e.reduce((function(e,t){return e.concat(t instanceof lf?t.errors:t)}),[])}function fi(e){for(;e;){var t=e.destination,n=e.isStopped;if(e.closed||n)return!1;e=t&&t instanceof ia?t:null}return!0}function Yc(e){return e}function gi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Yl(e)}function Yl(e){return 0===e.length?Yc:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}function Zl(e){if(e||(e=Ib.Promise||Promise),!e)throw Error("no Promise impl found");return e}function $l(){return function(e){return e.lift(new Ns(e))}}function mf(e){return e?Os(e):vb}function Os(e){return new Y((function(t){return e.schedule((function(){return t.complete()}))}))}function Zc(e){return e&&"function"==typeof e.schedule}function hi(e,t){return new Y((function(n){var r=new Oa,i=0;return r.add(t.schedule((function(){i===e.length?n.complete():(n.next(e[i++]),n.closed||r.add(this.schedule()))}))),r}))}function nf(e,t){return t?hi(e,t):new Y(am(e))}function bb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return Zc(t=e[e.length-1])?(e.pop(),hi(e,t)):nf(e)}function Z(e,t){return new Y(t?function(n){return t.schedule(Ps,0,{error:e,subscriber:n})}:function(t){return t.error(e)})}function Ps(e){e.subscriber.error(e.error)}function Qs(e,t){return void 0===t&&(t=0),function(n){return n.lift(new Rs(e,t))}}function bm(e){return e in ii&&(delete ii[e],!0)}function hc(){}function ba(e,t){return function(n){if("function"!=typeof e)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new Ss(e,t))}}function cm(e,t,n){if(t){if(!Zc(t))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return cm(e,n).apply(void 0,r).pipe(ba((function(e){return Jb(e)?t.apply(void 0,e):t(e)})))};n=t}return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i,o=this,a={context:o,subject:i,callbackFunc:e,scheduler:n};return new Y((function(r){if(n)return n.schedule(Ts,0,{args:t,subscriber:r,params:a});if(!i){i=new of;try{e.apply(o,t.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];i.next(1>=e.length?e[0]:e),i.complete()}]))}catch(e){fi(i)?i.error(e):console.warn(e)}}return i.subscribe(r)}))}}function Ts(e){var t=this,n=e.args,r=e.subscriber,i=e.params;e=i.callbackFunc;var o=i.context,a=i.scheduler,s=i.subject;if(!s){s=i.subject=new of,i=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t.add(a.schedule(Us,0,{value:1>=e.length?e[0]:e,subject:s}))};try{e.apply(o,n.concat([i]))}catch(e){s.error(e)}}this.add(s.subscribe(r))}function Us(e){var t=e.subject;t.next(e.value),t.complete()}function dm(e,t,n){if(t){if(!Zc(t))return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return dm(e,n).apply(void 0,r).pipe(ba((function(e){return Jb(e)?t.apply(void 0,e):t(e)})))};n=t}return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i={subject:void 0,args:t,callbackFunc:e,scheduler:n,context:this};return new Y((function(r){var o=i.context,a=i.subject;if(n)return n.schedule(Vs,0,{params:i,subscriber:r,context:o});if(!a){a=i.subject=new of;try{e.apply(o,t.concat([function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];(t=e.shift())?a.error(t):(a.next(1>=e.length?e[0]:e),a.complete())}]))}catch(e){fi(a)?a.error(e):console.warn(e)}}return a.subscribe(r)}))}}function Vs(e){var t=this,n=e.params,r=e.subscriber;e=e.context;var i=n.callbackFunc,o=n.args,a=n.scheduler,s=n.subject;if(!s){s=n.subject=new of,n=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];(n=e.shift())?t.add(a.schedule(em,0,{err:n,subject:s})):t.add(a.schedule(Ws,0,{value:1>=e.length?e[0]:e,subject:s}))};try{i.apply(e,o.concat([n]))}catch(e){this.add(a.schedule(em,0,{err:e,subject:s}))}}this.add(s.subscribe(r))}function Ws(e){var t=e.subject;t.next(e.value),t.complete()}function em(e){e.subject.error(e.err)}function fm(e){return!!e&&"function"!=typeof e.subscribe&&"function"==typeof e.then}function ji(e,t,n,r,i){if(void 0===i&&(i=new Xs(e,n,r)),!i.closed)return t instanceof Y?t.subscribe(i):pf(t)(i)}function Ys(e,t){return new Y((function(n){var r=new Oa;return r.add(t.schedule((function(){var i=e[ne]();r.add(i.subscribe({next:function(e){r.add(t.schedule((function(){return n.next(e)})))},error:function(e){r.add(t.schedule((function(){return n.error(e)})))},complete:function(){r.add(t.schedule((function(){return n.complete()})))}}))}))),r}))}function Zs(e,t){return new Y((function(n){var r=new Oa;return r.add(t.schedule((function(){return e.then((function(e){r.add(t.schedule((function(){n.next(e),r.add(t.schedule((function(){return n.complete()})))})))}),(function(e){r.add(t.schedule((function(){return n.error(e)})))}))}))),r}))}function $s(e,t){if(!e)throw Error("Iterable cannot be null");return new Y((function(n){var r,i=new Oa;return i.add((function(){r&&"function"==typeof r.return&&r.return()})),i.add(t.schedule((function(){r=e[$c](),i.add(t.schedule((function(){if(!n.closed){try{var e=r.next(),t=e.value,i=e.done}catch(e){return void n.error(e)}i?n.complete():(n.next(t),this.schedule())}})))}))),i}))}function gm(e,t){if(null!=e){if(e&&"function"==typeof e[ne])return Ys(e,t);if(fm(e))return Zs(e,t);if(hm(e))return hi(e,t);if(e&&"function"==typeof e[$c]||"string"==typeof e)return $s(e,t)}throw new TypeError((null!==e&&X(e)||e)+" is not observable")}function Kb(e,t){return t?gm(e,t):e instanceof Y?e:new Y(pf(e))}function ic(e,t){if(!t.closed){if(e instanceof Y)return e.subscribe(t);try{var n=pf(e)(t)}catch(e){t.error(e)}return n}}function cb(e,t,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof t?function(r){return r.pipe(cb((function(n,r){return Kb(e(n,r)).pipe(ba((function(e,i){return t(n,e,r,i)})))}),n))}:("number"==typeof t&&(n=t),function(t){return t.lift(new at(e,n))})}function tg(e){return void 0===e&&(e=Number.POSITIVE_INFINITY),cb(Yc,e)}function im(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return tg(1)(bb.apply(void 0,e))}function ad(e){return new Y((function(t){try{var n=e()}catch(e){return void t.error(e)}return(n?Kb(n):mf()).subscribe(t)}))}function jm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){var n=e[0];if(Jb(n))return ug(n,null);if(ei(n)&&Object.getPrototypeOf(n)===Object.prototype)return ug((e=Object.keys(n)).map((function(e){return n[e]})),e)}if("function"==typeof e[e.length-1]){var r=e.pop();return ug(e=1===e.length&&Jb(e[0])?e[0]:e,null).pipe(ba((function(e){return r.apply(void 0,e)})))}return ug(e,null)}function ug(e,t){return new Y((function(n){var r=e.length;if(0===r)n.complete();else for(var i=Array(r),o=0,a=0,s=function(s){var u=Kb(e[s]),c=!1;n.add(u.subscribe({next:function(e){c||(c=!0,a++),i[s]=e},error:function(e){return n.error(e)},complete:function(){++o!==r&&c||(a===r&&n.next(t?t.reduce((function(e,t,n){return e[t]=i[n],e}),{}):i),n.complete())}}))},u=0;u<r;u++)s(u)}))}function gb(e,t,n,r){return le(n)&&(r=n,n=void 0),r?gb(e,t,n).pipe(ba((function(e){return Jb(e)?r.apply(void 0,e):r(e)}))):new Y((function(r){km(e,t,(function(e){1<arguments.length?r.next(Array.prototype.slice.call(arguments)):r.next(e)}),r,n)}))}function km(e,t,n,r,i){if(e&&"function"==typeof e.addEventListener&&"function"==typeof e.removeEventListener){e.addEventListener(t,n,i);var o=function(){return e.removeEventListener(t,n,i)}}else if(e&&"function"==typeof e.on&&"function"==typeof e.off)e.on(t,n),o=function(){return e.off(t,n)};else if(e&&"function"==typeof e.addListener&&"function"==typeof e.removeListener)e.addListener(t,n),o=function(){return e.removeListener(t,n)};else{if(!e||!e.length)throw new TypeError("Invalid event target");for(var a=0,s=e.length;a<s;a++)km(e[a],t,n,r,i)}r.add(o)}function lm(e,t,n){return n?lm(e,t).pipe(ba((function(e){return Jb(e)?n.apply(void 0,e):n(e)}))):new Y((function(n){var r=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.next(1===e.length?e[0]:e)};try{var i=e(r)}catch(e){return void n.error(e)}if(le(t))return function(){return t(r,i)}}))}function bt(e){var t=e.subscriber,n=e.condition;if(!t.closed){if(e.needIterate)try{e.state=e.iterate(e.state)}catch(e){return void t.error(e)}else e.needIterate=!0;if(n){var r=void 0;try{r=n(e.state)}catch(e){return void t.error(e)}if(!r)return void t.complete();if(t.closed)return}try{var i=e.resultSelector(e.state)}catch(e){return void t.error(e)}if(!t.closed&&(t.next(i),!t.closed))return this.schedule(e)}}function ki(e){return!Jb(e)&&0<=e-parseFloat(e)+1}function mm(e,t){return void 0===e&&(e=0),void 0===t&&(t=bd),(!ki(e)||0>e)&&(e=0),t&&"function"==typeof t.schedule||(t=bd),new Y((function(n){return n.add(t.schedule(ct,e,{subscriber:n,counter:0,period:e})),n}))}function ct(e){var t=e.subscriber,n=e.counter;e=e.period,t.next(n),this.schedule({subscriber:t,counter:n+1,period:e},e)}function Xb(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];t=Number.POSITIVE_INFINITY;var n=null,r=e[e.length-1];return Zc(r)?(n=e.pop(),1<e.length&&"number"==typeof e[e.length-1]&&(t=e.pop())):"number"==typeof r&&(t=e.pop()),null===n&&1===e.length&&e[0]instanceof Y?e[0]:tg(t)(nf(e,n))}function li(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(0===e.length)return vb;var n=e[0],r=e.slice(1);return 1===e.length&&Jb(n)?li.apply(void 0,n):new Y((function(e){var t=function(){return e.add(li.apply(void 0,r).subscribe(e))};return Kb(n).subscribe({next:function(t){e.next(t)},error:t,complete:t})}))}function dt(e){var t=e.keys,n=e.index,r=e.subscriber,i=e.subscription;if(e=e.obj,!r.closed)if(n<t.length){var o=t[n];r.next([o,e[o]]),i.add(this.schedule({keys:t,index:n+1,subscriber:r,subscription:i,obj:e}))}else r.complete()}function et(e,t){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=e,n.thisArg=t,n}function wb(e,t){return function(n){return n.lift(new ft(e,t))}}function Ca(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(1===e.length){if(!Jb(e[0]))return e[0];e=e[0]}return nf(e,void 0).lift(new gt)}function ht(e){var t=e.start,n=e.index,r=e.subscriber;n>=e.count?r.complete():(r.next(t),r.closed||(e.index=n+1,e.start=t+1,this.schedule(e)))}function Bc(e,t,n){void 0===e&&(e=0);var r=-1;return ki(t)?r=1>Number(t)?1:Number(t):Zc(t)&&(n=t),Zc(n)||(n=bd),new Y((function(t){var i=ki(e)?e:+e-n.now();return n.schedule(it,i,{index:0,period:r,subscriber:t})}))}function it(e){var t=e.index,n=e.period,r=e.subscriber;if(r.next(t),!r.closed){if(-1===n)return r.complete();e.index=t+1,this.schedule(e,n)}}function mi(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"function"==typeof(t=e[e.length-1])&&e.pop(),nf(e,void 0).lift(new jt(t))}function Ga(e){return function(t){var n=new kt(e);return t=t.lift(n),n.caught=t}}function ni(e,t){return cb(e,t,1)}function nm(e){return void 0===e&&(e=null),function(t){return t.lift(new lt(e))}}function cd(e,t){void 0===t&&(t=bd);var n=e instanceof Date&&!isNaN(+e)?+e-t.now():Math.abs(e);return function(e){return e.lift(new mt(n,t))}}function om(e,t){return function(n){return n.lift(new nt(e,t))}}function Dd(e){return void 0===e&&(e=ot),function(t){return t.lift(new pt(e))}}function ot(){return new vg}function Ka(e){return function(t){return 0===e?mf():t.lift(new qt(e))}}function pm(e,t){return t?function(n){return n.pipe(pm((function(n,r){return Kb(e(n,r)).pipe(ba((function(e,i){return t(n,e,r,i)})))})))}:function(t){return t.lift(new rt(e))}}function wg(e){return function(t){return t.lift(new st(e))}}function aa(e,t){var n=2<=arguments.length;return function(r){return r.pipe(e?wb((function(t,n){return e(t,n,r)})):Yc,Ka(1),n?nm(t):Dd((function(){return new vg})))}}function tt(){return function(e){return e.lift(new ut)}}function qm(e){return function(t){return 0===e?mf():t.lift(new vt(e))}}function qf(e){return function(t){return t.lift(new wt(e))}}function xg(e,t){var n=!1;return 2<=arguments.length&&(n=!0),function(r){return r.lift(new xt(e,t,n))}}function rm(e,t){return 2<=arguments.length?function(n){return gi(xg(e,t),qm(1),nm(t))(n)}:function(t){return gi(xg((function(t,n,r){return e(t,n,r+1)})),qm(1))(t)}}function yt(e,t){return function(n){var r="function"==typeof e?e:function(){return e};if("function"==typeof t)return n.lift(new zt(r,t));var i=Object.create(n,At);return i.source=n,i.subjectFactory=r,i}}function oe(e){return function(t){return t.lift(new Bt(e,t))}}function Ct(){return new Pa}function pe(){return function(e){return $l()(yt(Ct)(e))}}function sm(e,t,n){var r=e&&"object"===X(e)?e:{bufferSize:e,windowTime:t,refCount:!1,scheduler:n};return function(e){return e.lift(Dt(r))}}function Dt(e){var t,n,r=e.bufferSize,i=void 0===r?Number.POSITIVE_INFINITY:r,o=void 0===(r=e.windowTime)?Number.POSITIVE_INFINITY:r,a=e.refCount,s=e.scheduler,u=0,c=!1,l=!1;return function(e){if(u++,!t||c){c=!1;var r=(t=new qe(i,o,s)).subscribe(this);n=e.subscribe({next:function(e){t.next(e)},error:function(e){c=!0,t.error(e)},complete:function(){l=!0,n=void 0,t.complete()}}),l&&(n=void 0)}else r=t.subscribe(this);this.add((function(){u--,r.unsubscribe(),r=void 0,n&&!l&&a&&0===u&&(n.unsubscribe(),t=n=void 0)}))}}function Cc(e,t){return"function"==typeof t?function(n){return n.pipe(Cc((function(n,r){return Kb(e(n,r)).pipe(ba((function(e,i){return t(n,e,r,i)})))})))}:function(t){return t.lift(new Et(e))}}function ob(e){return function(t){return t.lift(new Ft(e))}}function Gt(e,t){return void 0===t&&(t=!1),function(n){return n.lift(new Ht(e,t))}}function ca(e,t,n){return function(r){return r.lift(new It(e,t,n))}}function Jt(e,t,n){return void 0===t&&(t=bd),void 0===n&&(n=Kt),function(r){return r.lift(new Lt(e,t,n.leading,n.trailing))}}function Mt(e){e.subscriber.clearThrottle()}function Nt(e,t,n){return void 0===n&&(n=bd),function(r){var i=e instanceof Date&&!isNaN(+e),o=i?+e-n.now():Math.abs(e);return r.lift(new Ot(o,i,t,n))}}function hb(e,t){return void 0===t&&(t=bd),Nt(e,Z(new pb),t)}function Pt(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return function(t){var n;return"function"==typeof e[e.length-1]&&(n=e.pop()),t.lift(new Qt(e,n))}}function tm(e,t,n,r,i){e!==t&&um(t,(function(o,a){if(i||(i=new ge),lb(o)){o=i;var s=oi(e,a),u=oi(t,a),c=o.get(u);if(c)pi(e,a,c);else{var l=void 0===(c=r?r(s,u,a+"",e,t,o):void 0);if(l){var f=Va(u),h=!f&&jf(u),p=!f&&!h&&bi(u);c=u,f||h||p?Va(s)?c=s:gc(s)&&Ed(s)?c=Xh(s):h?(l=!1,c=Jl(u,!0)):p?(l=!1,c=vm(u,!0)):c=[]:wm(u)||rf(u)?(c=s,rf(s)?c=re(s,kf(s)):lb(s)&&!qi(s)||(c=Kl(u))):l=!1}l&&(o.set(u,c),tm(c,u,n,r,o),o.delete(u)),pi(e,a,c)}}else void 0===(s=r?r(oi(e,a),o,a+"",e,t,i):void 0)&&(s=o),pi(e,a,s)}),kf)}function Rt(e){var t=1,n=ri;1==(1>=arguments.length?0:arguments.length-1)?"number"==typeof(1>=arguments.length?void 0:arguments[1])?t=1>=arguments.length?void 0:arguments[1]:n=1>=arguments.length?void 0:arguments[1]:2==(1>=arguments.length?0:arguments.length-1)&&(t=1>=arguments.length?void 0:arguments[1],n=2>=arguments.length?void 0:arguments[2]);var r=t||1;return function(t){return t.pipe(xg((function(t,i){var o=n.now(),a=o-e;if((t=t.filter((function(e){return e.until>a}))).length>=r){var s=t[t.length-1],u=t[0].until+e*Math.floor(t.length/r);t.push({delay:s.until<o?u-o:u-s.until,until:u,value:i})}else t.push({delay:0,until:o,value:i});return t}),[]),ba((function(e){return e[e.length-1]})),ni((function(e){var t=bb(e.value);return e.delay?t.pipe(cd(e.delay,n)):t})))}}function St(e,t){var n=(t=void 0===t?{protocols:xm,makeWebSocket:ym}:t).protocols,r=void 0===n?xm:n,i=void 0===(t=t.makeWebSocket)?ym:t;return new Y((function(t){var n,o=new Pa,a=i(e,r),s=!1,u=!1,c=function(e){if(n)throw s=!0,e=Error("Web socket message factory function called more than once"),t.error(e),e;return n=e.subscribe((function(e){a.send(e)})),o};return a.onopen=function(){u?(s=!0,a.close()):t.next(c)},a.onmessage=function(e){o.next(e.data)},a.onerror=function(e){s=!0,t.error(Error(e.message))},a.onclose=function(e){s||(s=!0,u?(t.complete(),o.complete()):t.error(Error(1e3===e.code?"Normal closure":e.reason)))},function(){u=!0,n&&n.unsubscribe(),s||(s=!0,a.close())}}))}function yg(){this._listeners={}}function zm(e){return"undefined"!=typeof Float32Array?function(){function t(e,t,n){o[0]=e,t[n]=a[0],t[n+1]=a[1],t[n+2]=a[2],t[n+3]=a[3]}function n(e,t,n){o[0]=e,t[n]=a[3],t[n+1]=a[2],t[n+2]=a[1],t[n+3]=a[0]}function r(e,t){return a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],o[0]}function i(e,t){return a[3]=e[t],a[2]=e[t+1],a[1]=e[t+2],a[0]=e[t+3],o[0]}var o=new Float32Array([-0]),a=new Uint8Array(o.buffer),s=128===a[3];e.writeFloatLE=s?t:n,e.writeFloatBE=s?n:t,e.readFloatLE=s?r:i,e.readFloatBE=s?i:r}():function(){function t(e,t,n,r){var i=0>t?1:0;if(i&&(t=-t),0===t)e(0<1/t?0:2147483648,n,r);else if(isNaN(t))e(2143289344,n,r);else if(34028234663852886e22<t)e((i<<31|2139095040)>>>0,n,r);else if(11754943508222875e-54>t)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,n,r);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,n,r)}}function n(e,t,n){return n=e(t,n),e=2*(n>>31)+1,t=n>>>23&255,n&=8388607,255===t?n?NaN:1/0*e:0===t?1401298464324817e-60*e*n:e*Math.pow(2,t-150)*(n+8388608)}e.writeFloatLE=t.bind(null,Am),e.writeFloatBE=t.bind(null,Bm),e.readFloatLE=n.bind(null,Cm),e.readFloatBE=n.bind(null,Dm)}(),"undefined"!=typeof Float64Array?function(){function t(e,t,n){o[0]=e,t[n]=a[0],t[n+1]=a[1],t[n+2]=a[2],t[n+3]=a[3],t[n+4]=a[4],t[n+5]=a[5],t[n+6]=a[6],t[n+7]=a[7]}function n(e,t,n){o[0]=e,t[n]=a[7],t[n+1]=a[6],t[n+2]=a[5],t[n+3]=a[4],t[n+4]=a[3],t[n+5]=a[2],t[n+6]=a[1],t[n+7]=a[0]}function r(e,t){return a[0]=e[t],a[1]=e[t+1],a[2]=e[t+2],a[3]=e[t+3],a[4]=e[t+4],a[5]=e[t+5],a[6]=e[t+6],a[7]=e[t+7],o[0]}function i(e,t){return a[7]=e[t],a[6]=e[t+1],a[5]=e[t+2],a[4]=e[t+3],a[3]=e[t+4],a[2]=e[t+5],a[1]=e[t+6],a[0]=e[t+7],o[0]}var o=new Float64Array([-0]),a=new Uint8Array(o.buffer),s=128===a[7];e.writeDoubleLE=s?t:n,e.writeDoubleBE=s?n:t,e.readDoubleLE=s?r:i,e.readDoubleBE=s?i:r}():function(){function t(e,t,n,r,i,o){var a=0>r?1:0;if(a&&(r=-r),0===r)e(0,i,o+t),e(0<1/r?0:2147483648,i,o+n);else if(isNaN(r))e(0,i,o+t),e(2146959360,i,o+n);else if(17976931348623157e292<r)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+n);else if(22250738585072014e-324>r)e((r/=5e-324)>>>0,i,o+t),e((a<<31|r/4294967296)>>>0,i,o+n);else{var s=Math.floor(Math.log(r)/Math.LN2);1024===s&&(s=1023),e(4503599627370496*(r*=Math.pow(2,-s))>>>0,i,o+t),e((a<<31|s+1023<<20|1048576*r&1048575)>>>0,i,o+n)}}function n(e,t,n,r,i){return t=e(r,i+t),r=e(r,i+n),e=2*(r>>31)+1,t=4294967296*(1048575&r)+t,2047===(n=r>>>20&2047)?t?NaN:1/0*e:0===n?5e-324*e*t:e*Math.pow(2,n-1075)*(t+4503599627370496)}e.writeDoubleLE=t.bind(null,Am,0,4),e.writeDoubleBE=t.bind(null,Bm,4,0),e.readDoubleLE=n.bind(null,Cm,0,4),e.readDoubleBE=n.bind(null,Dm,4,0)}(),e}function Am(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function Bm(e,t,n){t[n]=e>>>24,t[n+1]=e>>>16&255,t[n+2]=e>>>8&255,t[n+3]=255&e}function Cm(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function Dm(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function Wa(e,t){this.lo=e>>>0,this.hi=t>>>0}function sf(e,t,n){this.fn=e,this.len=t,this.next=void 0,this.val=n}function si(){}function Tt(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function ja(){this.len=0,this.tail=this.head=new sf(si,0,0),this.states=null}function ti(e,t,n){t[n]=255&e}function ui(e,t){this.len=e,this.next=void 0,this.val=t}function vi(e,t,n){for(;e.hi;)t[n++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;127<e.lo;)t[n++]=127&e.lo|128,e.lo>>>=7;t[n++]=e.lo}function wi(e,t,n){t[n]=255&e,t[n+1]=e>>>8&255,t[n+2]=e>>>16&255,t[n+3]=e>>>24}function jc(){xi.call(this)}function Ut(e,t,n){40>e.length?V.utf8.write(e,t,n):t.utf8Write?t.utf8Write(e,n):t.write(e,n)}function Yb(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function La(e){this.buf=e,this.pos=0,this.len=e.length}function yi(){var e=new Em(0,0),t=0;if(!(4<this.len-this.pos)){for(;3>t;++t){if(this.pos>=this.len)throw Yb(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,128>this.buf[this.pos++])return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;4>t;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,128>this.buf[this.pos++])return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,128>this.buf[this.pos++])return e;if(t=0,4<this.len-this.pos){for(;5>t;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,128>this.buf[this.pos++])return e}else for(;5>t;++t){if(this.pos>=this.len)throw Yb(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,128>this.buf[this.pos++])return e}throw Error("invalid varint encoding")}function zg(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function Fm(){if(this.pos+8>this.len)throw Yb(this,8);return new Em(zg(this.buf,this.pos+=4),zg(this.buf,this.pos+=4))}function Fd(e){zi.call(this,e)}function tf(e,t,n){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");V.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=!!t,this.responseDelimited=!!n}function za(e){return"string"==typeof e&&/^[\s\w!#$%&()+,.:;<=>?@[\]^{|}~-]{1,64}$/.test(e)&&"null"!==e}function Gm(e){try{var t=e.split(".").map((function(e){return Number(e)}))}catch(e){return!1}if(4!==t.length||0===t[0])return!1;for(e=0;e<t.length;e++){var n=t[e];if(!Number.isInteger(n)||0>n||255<n)return!1}return!0}function Hm(e,t){if(!Array.isArray(t)||0===t.length||32<t.length||t.some((function(e){return 0===e.length||32<e.length})))throw new I("arguments is not valid",Ja);if(!za(e))throw new I("ID is invalid",Ja)}function uf(e){var t=e.attributes,n=e.attrSizeMap,r=e.maxAttrsCount,i=e.maxAttrValueSize;if(e=e.maxTotalSize,!yd(t))throw new I("attributes must be an object",Ja);if(Object.keys(t).length>r)throw new ib("Exceed the limit of ".concat(r," attributes"),se);if(0===Object.keys(t).length)throw new I("The attributes is an empty object",Ja);var o=0,a=0;for(t=Object.entries(t);a<t.length;a++){var s=ra(t[a],2),u=s[1];s=new Blob([s[0]]).size;var c=new Blob([u]).size;if(0===s||32<s)throw new I("Invalid attribute key",Ja);if(c>i)throw new ib("Invalid attribute value, over the limit of ".concat(i," bytes"),se);if("string"!=typeof u||0===u.length)throw new I("Invalid attribute value",Ja);o+=s,o+=c}if(o>e)throw new ib("The attributes size overflow",se);if(void 0!==n){if(Object.keys(n).length>r)throw new ib("Exceed the limit of ".concat(r," attributes"),se);for(o=r=0,n=Object.entries(n);o<n.length;o++){if(a=(t=ra(n[o],2))[1],0===(t=new Blob([t[0]]).size))throw new I("Invalid attribute key",Ja);if(a>i)throw new ib("Invalid attribute value, over the limit of ".concat(i," bytes"),se);r+=t,r+=a}if(r>e)throw new ib("The attributes size overflow",se)}}function Ag(e,t){return Math.floor(Math.random()*(Math.floor(t)-Math.ceil(e)+1))+e}function Bg(){var e=Ag(0,4294967295),t=Ag(1,4294967295);return new U(e,t,!0)}function Xa(e){return e.toString().padEnd(32,"0")}function Im(e,t){return new TypeError("Unexpected ".concat(e,": ").concat(t))}function Jm(e,t){return e=e.split(".").map((function(e){return Number(e)})),t=t.split(".").map((function(e){return Number(e)})),Math.sqrt(1e3*Math.pow(e[0]-t[0],2)+100*Math.pow(e[1]-t[1],2)+10*Math.pow(e[2]-t[2],2)+1*Math.pow(e[3]-t[3],2))}function Km(e){return e.lessThanOrEqual(Number.MAX_SAFE_INTEGER)?e.toNumber():e.toString()}function Ai(e,t){t="".concat(e).concat(t||"");var n=Lm.get(t)||1;return Lm.set(t,n+1),"".concat(e).concat(n)}function Mm(e,t){var n="number"==typeof t?t:void 0!==t&&"string"!=typeof t?t.code:void 0;return t="number"!=typeof t&&"string"!=typeof t&&void 0!==t&&void 0!==t.serverCode?t.serverCode:void 0,n="".concat(void 0!==n?" Error Code ".concat(n):"").concat(void 0!==t?", server Code ".concat(t):""),e="string"==typeof e&&e?Cg(e):Array.isArray(e)&&"string"==typeof e[0]&&e[0]?Cg(Nm.apply(void 0,[e[0]].concat(G(e.slice(1))))):"","".concat(""===n?"":"".concat(n," - ")).concat(e)}function Om(e){return Bi.apply(this,arguments)}function Bi(){return(Bi=J(w.mark((function e(t){return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){setTimeout((function(){e()}),t)})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Pm(e){return e instanceof Blob||"[object Blob]"===Object.prototype.toString.call(e)}function Dg(e){var t=255&e,n=e>>8&255,r=e>>16&255;return"".concat(e>>24&255,".").concat(r,".").concat(n,".").concat(t)}function te(e,t,n){return Ci.apply(this,arguments)}function Ci(){return(Ci=J(w.mark((function e(t,n,r){var i,o,a,s,u,c,l,f,h,p,d,v,b,g,y,m,E,_,O,I,A,k,R,T,N,S;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=n.body,o=n.headers,a=void 0===o?{}:o,s=n.timeout,u=void 0===s?1e4:s,c=n.signal,l=n.withCredentials,f=void 0!==l&&l,h=(r||{}).useBinaryResponse,p=void 0!==h&&h,(d=new XMLHttpRequest).open("POST",t,!0),d.responseType=p?"arraybuffer":"text",d.withCredentials=f,d.timeout=u,v=i instanceof FormData,b=i instanceof Uint8Array,!(1<(g=Object.keys(a).filter((function(e){return"content-type"===e.toLowerCase()}))).length)){e.next=14;break}throw new RangeError("multiple content-type");case 14:0===g.length&&(b?a["Content-Type"]="application/octet-stream":v||(a["Content-Type"]="application/json"));case 15:if("setRequestHeader"in d){e.next=46;break}return d.abort(),e.next=19,fetch(t,{body:v||b?i:JSON.stringify(i),cache:"no-cache",credentials:f?"include":"same-origin",headers:a,method:"POST",mode:"cors",referrer:"no-referrer",signal:c});case 19:if(y=e.sent,!(200<=(m=y.status)&&300>m||304===m)){e.next=31;break}if(!p){e.next=27;break}return e.next=25,y.arrayBuffer();case 25:return E=e.sent,e.abrupt("return",{status:m,responseData:E});case 27:return e.next=29,y.text();case 29:return _=e.sent,e.abrupt("return",{status:m,responseText:_});case 31:return O=new da(["Post XHR failure, status %d",m]),e.prev=32,e.next=35,y.text();case 35:throw I=e.sent,O.statusCode=m,O.message=I||"Request failed, status ".concat(m),O;case 41:throw e.prev=41,e.t0=e.catch(32),O.statusCode=m,O.message="Request failed, status ".concat(m),O;case 46:if(0!==Object.keys(a).length)for(A=0,k=Object.entries(a);A<k.length;A++)R=ra(k[A],2),T=R[0],N=R[1],d.setRequestHeader(T,N);return void 0!==c&&(S=function e(){d.abort(),c.removeEventListener("abort",e)},c.addEventListener("abort",S)),v||b?d.send(i):d.send(JSON.stringify(i)),e.abrupt("return",new Promise((function(e,t){d.onload=function(){var n=d.status;if(200<=n&&300>n||304===n)e(p?{status:n,responseData:d.response}:{status:n,responseText:d.responseText});else{var r=new da(["Post XHR failure, status %d",n]);r.statusCode=n,r.message=d.response||"Request failed, status ".concat(d.status),t(r)}},d.ontimeout=function(e){t(new db(["XHR request timed out after %d ms",u],{originalError:e}))},d.onerror=function(){var e=new da(["Post XHR failure, status %d",d.status]);e.statusCode=d.status,e.message=d.response||"Request failed, status ".concat(d.status),t(e)},d.onabort=function(){try{t(new DOMException("The request aborted.","AbortError"))}catch(n){var e=Error("The request aborted.");e.name="AbortError",t(e)}}})));case 50:case"end":return e.stop()}}),e,null,[[32,41]])})))).apply(this,arguments)}function Rm(e){return Hi.apply(this,arguments)}function Hi(){return(Hi=J(w.mark((function e(t){var n;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return(n=new Image).src=t,e.abrupt("return",new Promise((function(e,t){n.onload=function(){e({width:n.width,height:n.height})},n.onerror=t})));case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Xt(e,t){return Ii.apply(this,arguments)}function Ii(){return(Ii=J(w.mark((function e(t,n){var r,i,o,a,s,u,c,l,f,h;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.thumbnailHeight,i=void 0===r?0:r,o=t.thumbnailWidth,a=void 0===o?0:o,s=t.width,u=void 0===s?0:s,c=t.height,l=void 0===c?0:c,f=t.thumbnail,h=[],"number"==typeof i&&"number"==typeof a&&"number"==typeof u&&"number"==typeof l){e.next=5;break}throw new I("Invalid message params",wf);case 5:return 0>=u&&0>=l&&h.push(Rm(Sm(n)).then((function(e){u=e.width,l=e.height}))),0>=a&&0>=i&&void 0!==f&&h.push(Ji(f).then(function(){var e=J(w.mark((function e(t){var n;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Rm(Sm(t));case 2:n=e.sent,a=n.width,i=n.height;case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())),e.next=9,Promise.all(h).catch((function(){}));case 9:return e.abrupt("return",{width:u,height:l,thumbnailWidth:a,thumbnailHeight:i});case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Tm(e,t){if(!yd(e))throw new I("message object is not a plain object",t);if(void 0===e.messageType)if(e.rawMessage instanceof Uint8Array){if(e.messageType="RAW",void 0!==e.text)throw new I("Raw messages cannot have text property. Use description instead",t)}else{if("string"!=typeof e.text)throw new I("messageType is undefined",t);if(e.messageType="TEXT",void 0!==e.rawMessage)throw new I("Text messages cannot have rawMessage property",t)}}function Gg(e){return Ki.apply(this,arguments)}function Ki(){return(Ki=J(w.mark((function e(t){var n,r,i,o,a,s,u,c,l,f,h,p,d,v,b,g,y,m,E,_,O;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.message,r=t.peerId,i=t.toPeer,o=t.session,a=t.errorCodes,s=t.diff,u=t.logger,c=t.options,void 0!==o){e.next=3;break}throw new K("The client is not logged in. Cannot do the operation",a.NOT_LOGGED_IN);case 3:if(l=!1,"TEXT"!==n.messageType||!n.text.startsWith("AgoraRTMLegacyEndcallCompatibleMessagePrefix")||!i){e.next=11;break}if(f=n.text.split("_"),h=ra(f,3),p=h[0],d=h[1],void 0!==h[2]&&za(d)&&"AgoraRTMLegacyEndcallCompatibleMessagePrefix"===p){e.next=10;break}throw new I("Message is not valid",ve);case 10:l=!0;case 11:if(v=Date.now(),b=o.messageSentTimes.length-1,!((g=o.messageSentTimes[b])&&g+3e3<v)){e.next=18;break}o.messageSentTimes=[v],e.next=29;break;case 18:y=b;case 19:if(!(0<=y)){e.next=28;break}if(!(o.messageSentTimes[y]+3e3<v)){e.next=23;break}return o.messageSentTimes=o.messageSentTimes.slice(y+1,b+1),e.abrupt("break",28);case 23:if(!(180<=b-y+1)){e.next=25;break}throw new ib("Message sent failed, exceeded the 180 message in 3 seconds",a.TOO_OFTEN);case 25:y--,e.next=19;break;case 28:o.messageSentTimes.push(v);case 29:e.t0=n.messageType,e.next="TEXT"===e.t0?32:"RAW"===e.t0?37:"FILE"===e.t0||"IMAGE"===e.t0?39:40;break;case 32:if(!l){e.next=36;break}return m=n.text.split("_"),E=ra(m,3),_=E[1],O=E[2],u.info("[rtm-API] EndCall message send api is called"),e.abrupt("return",o.sendInvitationMessage({peerId:r,type:"CallCancel",extra:O,channelId:_,callId:"0"}));case 36:return e.abrupt("return",o.sendTextMessage(n.text,r,i,c,1e4-s));case 37:return void 0===n.description&&(n.description=""),e.abrupt("return",o.sendRawMessage(n.rawMessage,n.description,r,i,c,1e4-s));case 39:return e.abrupt("return",o.sendMediaMessage(n.messageType,n,r,i,c,1e4-s));case 40:throw new I("Invalid message type",ve);case 41:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yt(e){var t=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],n=e.replace(/(https?:\/\/)?(www.)?/i,"");return t||(n=n.split(".").slice(e.length-2).join(".")),-1!==n.indexOf("/")?n.split("/")[0]:n}function oa(e){if("string"!=typeof e)return"[Sensitive Info]";var t=Math.floor(.7*e.length),n=e.length;return Um(e,t,n,"*".repeat(n-t))}function Vm(e,t,n){function r(i){if(void 0===e)return e;if(Il(i))return i;if(Array.isArray(i))return i.map(r);var o={},a=0;for(i=Hg(i);a<i.length;a++){var s=ra(i[a],2),u=s[0];if("string"==typeof(s=s[1])&&n.includes(u)){o[u]="string"==typeof s?oa(s):"[Sensitive Info]";break}t.includes(u)?o[u]="[Hidden Info]":o[u]=null==s?s:n.includes(u)?"[Sensitive Info]":r(s)}return o}return Array.isArray(e)?e.map(r):r(e)}function Wm(e){return Object.getOwnPropertyNames(e).forEach((function(t){"object"==X(t=e[t])&&null!==t&&Wm(t)})),Object.freeze(e)}function pa(e){return new TextDecoder("utf-8").decode(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength))}function Ig(e){return(new TextEncoder).encode(e).length}function Xm(){for(var e=0,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];for(t=0;t<n.length;t++)e+=n[t].length;for(e=new Uint8Array(e),r=t=0;r<n.length;r++){var i=n[r];e.set(i,t),t+=i.length}return e}function we(e,t,n){var r=e.match(/([^?#]+)(\?[^#]*)?(#.*)?/);if(e=null==r?void 0:r[1],r=null==r?void 0:r[2]){var i;for(r=r.substr(1).split("&"),i=0;i<r.length;i++)if(r[i].split("=")[0]==t){r[i]=t+"="+encodeURIComponent(n);break}return i==r.length&&r.push(t+"="+encodeURIComponent(n)),e+"?"+r.join("&")}return e+"?"+t+"="+encodeURIComponent(n)}function Ji(e){return new Promise((function(t,n){var r=new FileReader;r.onloadend=function(){var e=r.result||new ArrayBuffer(0);t(e)},r.onerror=n,r.readAsArrayBuffer(e)}))}function Zt(e,t){e=e=[e],"string"==typeof(t=t||{})&&(t={type:t});try{var n=new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder);for(var r=0;r<e.length;r+=1)n.append(e[r]);n=n.getBlob(t.type)}return n}function Um(e,t,n,r){return"string"!=typeof e?"[Sensitive Info]":e.substring(0,t)+r+e.substring(n)}function Ym(e){var t=[];return function e(n){if(null===n||"object"!==X(n))return n;if(-1!==t.indexOf(n))return"[Circular]";if(t.push(n),"function"==typeof n.toJSON)try{var r=e(n.toJSON());return t.pop(),r}catch(e){return"[Throws: "+(e?e.message:"?")+"]"}return Array.isArray(n)?(r=n.map(e),t.pop(),r):(r=Object.keys(n).reduce((function(t,r){e:{if($t.call(n,r))try{var i=n[r];break e}catch(e){i="[Throws: "+(e?e.message:"?")+"]";break e}i=n[r]}return t[r]=e(i),t}),{}),t.pop(),r)}(e)}function au(e){if(!(100<(e=String(e)).length)&&(e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e))){var t=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*t;case"weeks":case"week":case"w":return 6048e5*t;case"days":case"day":case"d":return 864e5*t;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*t;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*t;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t}}}function Jg(e,t,n,r){return Math.round(e/n)+" "+r+(t>=1.5*n?"s":"")}function bu(e){var t=e.areas,n=e.excludedArea;if(1===t.length&&t[0]===F.GLOBAL&&n===F.CHINA)return xe([F.OVERSEA]);if(t.includes(F.GLOBAL)){if(e=xf(Kg).filter((function(e){return e!==F.GLOBAL&&e!==F.OVERSEA})),n in yf){t=yf[n];var r=[].concat(G(null!=t?t:[]),[n]);return xe(e.filter((function(e){return!r.includes(e)})))}if(Zm(n)){var i=cu(n);return xe(e.filter((function(e){return e!==n&&e!==i})))}}if(Zm(n)||n in yf)return xe(t);throw new I("Invalid excludedArea area config")}function Ma(e,t,n){void 0===n&&(n=Object.getOwnPropertyDescriptor(e,t));var r=n.value;return n.value=function(){for(var e=this,n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];this.invokeTracker.apply(this,["%s: ".concat(0<i.length?"%s with args: ".concat(i.map((function(){return"%o"}))):"%s"),this.name,t].concat(G(i.map(ye))));try{var a=r.apply(this,i)}catch(e){throw this.logError.apply(this,["".concat(void 0!==e.code?"Error Code ".concat(e.code,": "):"","%s failed").concat(0<i.length?" with args: ".concat(i.map((function(){return"%o"}))):""),t].concat(G(i.map(ye)))),e.originalError&&this.logError(e.originalError),this.errorTracker(e),e}var s=Date.now();return J(w.mark((function n(){var r,o;return w.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,a;case 3:r=n.sent,n.next=12;break;case 6:return n.prev=6,n.t0=n.catch(0),e.logError.apply(e,["".concat(void 0!==n.t0.code?"Error Code ".concat(n.t0.code,": "):"","%s failed").concat(0<i.length?" with args: ".concat(i.map((function(){return"%o"}))):""),t].concat(G(i.map(ye)))),n.t0.originalError&&e.logError(n.t0.originalError),e.errorTracker(n.t0),n.abrupt("return");case 12:r!==a?void 0===r?e.resultTracker("%s promise resolves after %dms",t,Date.now()-s):e.resultTracker("%s promise resolves after %dms, result is %o",t,Date.now()-s,ye(r)):"Object"!==Ac(r)||yd(r)?e.resultTracker("%s result is %o",t,ye(r)):e.resultTracker("%s result is %s",t,r.name||(null===(o=r.constructor)||void 0===o?void 0:o.name));case 13:case"end":return n.stop()}}),n,null,[[0,6]])})))(),a},n}function Nb(e,t,n){void 0===n&&(n=Object.getOwnPropertyDescriptor(e,t));var r=n.value;return n.value=function(){for(var e=this,n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];this.invokeTracker.apply(this,["%s: ".concat(0<i.length?"%s with args: ".concat(i.map((function(){return"%o"}))):"%s"),this.name,t].concat(i));try{var a=r.apply(this,i)}catch(e){throw this.logError.apply(this,["".concat(void 0!==e.code?"Error Code ".concat(e.code,": "):"","%s failed").concat(0<i.length?" with args: ".concat(i.map((function(){return"%o"}))):""),t].concat(i)),e.originalError&&this.logError(e.originalError),this.errorTracker(e),e}var s=Date.now();return J(w.mark((function n(){var r,o;return w.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,a;case 3:r=n.sent,n.next=12;break;case 6:return n.prev=6,n.t0=n.catch(0),e.logError.apply(e,["".concat(void 0!==n.t0.code?"Error Code ".concat(n.t0.code,": "):"","%s failed").concat(0<i.length?" with args: ".concat(i.map((function(){return"%o"}))):""),t].concat(i)),n.t0.originalError&&e.logError(n.t0.originalError),e.errorTracker(n.t0),n.abrupt("return");case 12:r!==a?void 0===r?e.resultTracker("%s promise resolves after %dms",t,Date.now()-s):e.resultTracker("%s promise resolves after %dms, result is %o",t,Date.now()-s,r):"Object"!==Ac(r)||yd(r)?e.resultTracker("%s result is %o",t,r):e.resultTracker("%s result is %s",t,r.name||(null===(o=r.constructor)||void 0===o?void 0:o.name));case 13:case"end":return n.stop()}}),n,null,[[0,6]])})))(),a},n}function du(e,t){var n="".concat(e,"Uri");if("number"!=typeof(n=Li[n])||0===n)throw new TypeError("Got Unknown URI Name");return t=new(e=$m[e])(t),t=e.encode(t).finish(),new eu({uri:n,data:t})}function an(e,t){return"".concat(e.split(".").join("-"),".edge.").concat(t?"sd-rtn.com":"agora.io")}function eb(e,t,n){return Mi.apply(this,arguments)}function Mi(){return(Mi=J(w.mark((function e(t,n,r){var i,o;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.next=2;break;case 2:return i=fu[t].encode(n).finish(),o=function(){var e=J(w.mark((function e(n){var a,s,u,c=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(3<(s=1<c.length&&void 0!==c[1]?c[1]:0))){e.next=3;break}return e.abrupt("return");case 3:return u=we(u=r?"https://".concat(null!==(a=null==M?void 0:M.PROXY_NGINX[0])&&void 0!==a?a:"webrtc-cloud-proxy.sd-rtn.com","/rs/?h=").concat(n,"&p=6443&d=events/proto-raw"):"https://".concat(n,":6443/events/proto-raw"),"sentTs",Math.ceil(Date.now()/1e3).toString()),u=we(u,"id",gu[t].toString()),e.next=8,te(u,{body:i,timeout:2e4,headers:{"Content-Type":"application/octet-stream"}}).catch((function(e){return o(n,s+1)}));case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),e.prev=4,e.next=7,o((null==M?void 0:M.EVENT_REPORT_DOMAIN[0])||"webcollector-rtm.agora.io");case 7:e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(4),e.next=13,o(M&&bn(1<(null==M?void 0:M.EVENT_REPORT_DOMAIN.length)?null==M?void 0:M.EVENT_REPORT_DOMAIN.slice(1):null==M?void 0:M.EVENT_REPORT_DOMAIN)||"rtm.statscollector.sd-rtn.com");case 13:case"end":return e.stop()}}),e,null,[[4,9]])})))).apply(this,arguments)}function fb(e){return void 0===e?U.fromNumber(0):U.fromNumber(Date.now()-e)}function hu(e){return btoa(String.fromCharCode.apply({},e.replace(/\r|\n/g,"").replace(/([\dA-Fa-f]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ").map((function(e){return parseInt(e,16)})))).replace(/={1,2}$/,"")}function Lg(e,t){return U.fromValue(e).eq(t)}function Mg(e,t){var n=void 0===t?e.val:t,r=e.isBoolean;t=e.isNumber;var i=e.oneof,o=e.len;if(2!==[r,t,i].filter((function(e){return!e})).length)throw new TypeError("invalid field type");if(void 0!==n&&(e=!1,void 0!==i&&(i=Ni(i),iu(i,Lg).length===i.length&&void 0!==ju(i,(function(e){return Lg(n,e)}))&&(e=!0)),r=void 0!==r&&(0===n||1===n)&&1===o,t=void 0!==t&&n.toString(2).length<=o,!(e||r||t)))throw Error("invalid field value")}function cn(e){return function(){var t=e();if(!t)throw new K("Client is not logged in. Cannot do the operation");return t}}var Ya="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Ng=function(e){return e&&e.Math==Math&&e},y=Ng("object"==typeof globalThis&&globalThis)||Ng("object"==typeof window&&window)||Ng("object"==typeof self&&self)||Ng("object"==typeof Ya&&Ya)||function(){return this}()||Function("return this")(),R=function(e){try{return!!e()}catch(e){return!0}},ka=!R((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),dn={}.propertyIsEnumerable,en=Object.getOwnPropertyDescriptor,zf=en&&!dn.call({1:2},1)?function(e){return!!(e=en(this,e))&&e.enumerable}:dn,dd=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},ku={}.toString,Zb=function(e){return ku.call(e).slice(8,-1)},lu="".split,Af=R((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==Zb(e)?lu.call(e,""):Object(e)}:Object,jb=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},qb=function(e){return Af(jb(e))},ha=function(e){return"object"==typeof e?null!==e:"function"==typeof e},lc=function(e,t){if(!ha(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!ha(r=n.call(e))||"function"==typeof(n=e.valueOf)&&!ha(r=n.call(e))||!t&&"function"==typeof(n=e.toString)&&!ha(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},Qa=function(e){return Object(jb(e))},mu={}.hasOwnProperty,Q=function(e,t){return mu.call(Qa(e),t)},ze=y.document,Og=ha(ze)&&ha(ze.createElement),fn=!ka&&!R((function(){return 7!=Object.defineProperty(Og?ze.createElement("div"):{},"a",{get:function(){return 7}}).a})),gn=Object.getOwnPropertyDescriptor,Fb={f:ka?gn:function(e,t){if(e=qb(e),t=lc(t,!0),fn)try{return gn(e,t)}catch(e){}if(Q(e,t))return dd(!zf.call(e,t),e[t])}},va=function(e){if(!ha(e))throw TypeError(String(e)+" is not an object");return e},hn=Object.defineProperty,Ra={f:ka?hn:function(e,t,n){if(va(e),t=lc(t,!0),va(n),fn)try{return hn(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},Na=ka?function(e,t,n){return Ra.f(e,t,dd(1,n))}:function(e,t,n){return e[t]=n,e},Oi=function(e,t){try{Na(y,e,t)}catch(n){y[e]=t}return t},ed=y["__core-js_shared__"]||Oi("__core-js_shared__",{}),nu=Function.toString;"function"!=typeof ed.inspectSource&&(ed.inspectSource=function(e){return nu.call(e)});var Pi=ed.inspectSource,jn=y.WeakMap,ou="function"==typeof jn&&/native code/.test(Pi(jn)),fd=$a((function(e){(e.exports=function(e,t){return ed[e]||(ed[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.12.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),pu=0,qu=Math.random(),Ae=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++pu+qu).toString(36)},kn=fd("keys"),Pg=function(e){return kn[e]||(kn[e]=Ae(e))},Be={},ru=y.WeakMap;if(ou||ed.state)var Gd=ed.state||(ed.state=new ru),su=Gd.get,ln=Gd.has,tu=Gd.set,Qi=function(e,t){if(ln.call(Gd,e))throw new TypeError("Object already initialized");return t.facade=e,tu.call(Gd,e,t),t},Qg=function(e){return su.call(Gd,e)||{}},Ri=function(e){return ln.call(Gd,e)};else{var Ce=Pg("state");Be[Ce]=!0,Qi=function(e,t){if(Q(e,Ce))throw new TypeError("Object already initialized");return t.facade=e,Na(e,Ce,t),t},Qg=function(e){return Q(e,Ce)?e[Ce]:{}},Ri=function(e){return Q(e,Ce)}}var Za={set:Qi,get:Qg,has:Ri,enforce:function(e){return Ri(e)?Qg(e):Qi(e,{})},getterFor:function(e){return function(t){var n;if(!ha(t)||(n=Qg(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},Ta=$a((function(e){var t=Za.get,n=Za.enforce,r=String(String).split("String");(e.exports=function(e,t,i,o){var a=!!o&&!!o.unsafe,s=!!o&&!!o.enumerable;if(o=!!o&&!!o.noTargetGet,"function"==typeof i){"string"!=typeof t||Q(i,"name")||Na(i,"name",t);var u=n(i);u.source||(u.source=r.join("string"==typeof t?t:""))}e===y?s?e[t]=i:Oi(t,i):(a?!o&&e[t]&&(s=!0):delete e[t],s?e[t]=i:Na(e,t,i))})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||Pi(this)}))})),mn=function(e){return"function"==typeof e?e:void 0},mc=function(e,t){return 2>arguments.length?mn(y[e])||mn(y[e]):y[e]&&y[e][t]||y[e]&&y[e][t]},uu=Math.ceil,vu=Math.floor,$b=function(e){return isNaN(e=+e)?0:(0<e?vu:uu)(e)},wu=Math.min,ta=function(e){return 0<e?wu($b(e),9007199254740991):0},xu=Math.max,yu=Math.min,xb=function(e,t){return 0>(e=$b(e))?xu(e+t,0):yu(e,t)},nn=function(e){return function(t,n,r){t=qb(t);var i=ta(t.length);if(r=xb(r,i),e&&n!=n){for(;i>r;)if((n=t[r++])!=n)return!0}else for(;i>r;r++)if((e||r in t)&&t[r]===n)return e||r||0;return!e&&-1}},on=nn(!0),Si=nn(!1),pn=function(e,t){e=qb(e);var n,r=0,i=[];for(n in e)!Q(Be,n)&&Q(e,n)&&i.push(n);for(;t.length>r;)Q(e,n=t[r++])&&(~Si(i,n)||i.push(n));return i},Rg="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),zu=Rg.concat("length","prototype"),Hd={f:Object.getOwnPropertyNames||function(e){return pn(e,zu)}},Bf={f:Object.getOwnPropertySymbols},qn=mc("Reflect","ownKeys")||function(e){var t=Hd.f(va(e)),n=Bf.f;return n?t.concat(n(e)):t},rn=function(e,t){for(var n=qn(t),r=Ra.f,i=Fb.f,o=0;o<n.length;o++){var a=n[o];Q(e,a)||r(e,a,i(t,a))}},Au=/#|\.prototype\./,nc=function(e,t){return(e=Bu[Cu(e)])==Du||e!=Eu&&("function"==typeof t?R(t):!!t)},Cu=nc.normalize=function(e){return String(e).replace(Au,".").toLowerCase()},Bu=nc.data={},Eu=nc.NATIVE="N",Du=nc.POLYFILL="P",Fu=Fb.f,N=function(e,t){var n,r,i,o=e.target,a=e.global,s=e.stat;if(r=a?y:s?y[o]||Oi(o,{}):(y[o]||{}).prototype)for(i in t){var u=t[i],c=e.noTargetGet?(n=Fu(r,i))&&n.value:r[i];if(!(n=nc(a?i:o+(s?".":"#")+i,e.forced))&&void 0!==c){if(typeof u==typeof c)continue;rn(u,c)}(e.sham||c&&c.sham)&&Na(u,"sham",!0);try{Ta(r,i,u,e)}catch(e){}}},yb=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Id=function(e,t,n){if(yb(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},gd=Array.isArray||function(e){return"Array"==Zb(e)},De=mc("navigator","userAgent")||"",sn=y.process,tn=sn&&sn.versions,un=tn&&tn.v8;if(un)var hd=un.split("."),Ti=4>hd[0]?1:hd[0]+hd[1];else De&&(hd=De.match(/Edge\/(\d+)/),(!hd||74<=hd[1])&&(hd=De.match(/Chrome\/(\d+)/))&&(Ti=hd[1]));var id=Ti&&+Ti,oc=!!Object.getOwnPropertySymbols&&!R((function(){return!String(Symbol())||!Symbol.sham&&id&&41>id})),vn=oc&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Cf=fd("wks"),Df=y.Symbol,Gu=vn?Df:Df&&Df.withoutSetter||Ae,qa=function(e){return Q(Cf,e)&&(oc||"string"==typeof Cf[e])||(oc&&Q(Df,e)?Cf[e]=Df[e]:Cf[e]=Gu("Symbol."+e)),Cf[e]},Hu=qa("species"),Sg=function(e,t){if(gd(e)){var n=e.constructor;"function"!=typeof n||n!==Array&&!gd(n.prototype)?ha(n)&&(null===(n=n[Hu])&&(n=void 0)):n=void 0}return new(void 0===n?Array:n)(0===t?0:t)},wn=[].push,jd=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(u,c,l,f){var h=Qa(u),p=Af(h);c=Id(c,l,3),l=ta(p.length);var d,v=0;for(f=f||Sg,u=t?f(u,l):n||a?f(u,0):void 0;l>v;v++)if((s||v in p)&&(d=c(f=p[v],v,h),e))if(t)u[v]=d;else if(d)switch(e){case 3:return!0;case 5:return f;case 6:return v;case 2:wn.call(u,f)}else switch(e){case 4:return!1;case 7:wn.call(u,f)}return o?-1:r||i?i:u}},Jd=jd(0),xn=jd(1),yn=jd(2),Iu=jd(3),Ju=jd(4),zn=jd(5),An=jd(6);jd(7);var Ku=qa("species"),Ef=function(e){return 51<=id||!R((function(){var t=[];return(t.constructor={})[Ku]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Lu=Ef("filter");N({target:"Array",proto:!0,forced:!Lu},{filter:function(e){return yn(this,e,1<arguments.length?arguments[1]:void 0)}});var Dc=Object.keys||function(e){return pn(e,Rg)},Mu=R((function(){Dc(1)}));N({target:"Object",stat:!0,forced:Mu},{keys:function(e){return Dc(Qa(e))}});var Ee=function(e,t){var n=[][e];return!!n&&R((function(){n.call(null,t||function(){throw 1},1)}))},Nu=[].join,Ou=Af!=Object,Pu=Ee("join",",");N({target:"Array",proto:!0,forced:Ou||!Pu},{join:function(e){return Nu.call(qb(this),void 0===e?",":e)}});var Qu=Ef("map");N({target:"Array",proto:!0,forced:!Qu},{map:function(e){return xn(this,e,1<arguments.length?arguments[1]:void 0)}});var Ui=function(e){var t=e.return;if(void 0!==t)return va(t.call(e)).value},Fe={},Ru=qa("iterator"),Su=Array.prototype,Vi=function(e){return void 0!==e&&(Fe.Array===e||Su[Ru]===e)},Ge=function(e,t,n){(t=lc(t))in e?Ra.f(e,t,dd(0,n)):e[t]=n},Tu=qa("toStringTag"),Bn={};Bn[Tu]="z";var Wi="[object z]"===String(Bn),Uu=qa("toStringTag"),Vu="Arguments"==Zb(function(){return arguments}()),Ff=Wi?Zb:function(e){var t;if(void 0===e)var n="Undefined";else{if(null===e)var r="Null";else{e:{var i=e=Object(e);try{r=i[Uu];break e}catch(e){}r=void 0}r="string"==typeof(n=r)?n:Vu?Zb(e):"Object"==(t=Zb(e))&&"function"==typeof e.callee?"Arguments":t}n=r}return n},Wu=qa("iterator"),Xi=function(e){if(null!=e)return e[Wu]||e["@@iterator"]||Fe[Ff(e)]},Cn=qa("iterator"),Dn=!1;try{var Xu=0,En={next:function(){return{done:!!Xu++}},return:function(){Dn=!0}};En[Cn]=function(){return this},Array.from(En,(function(){throw 2}))}catch(c){}var Tg=function(e,t){if(!t&&!Dn)return!1;var n=!1;try{(t={})[Cn]=function(){return{next:function(){return{done:n=!0}}}},e(t)}catch(e){}return n},Yu=!Tg((function(e){Array.from(e)}));N({target:"Array",stat:!0,forced:Yu},{from:function(e){var t,n=Qa(e),r="function"==typeof this?this:Array,i=arguments.length,o=1<i?arguments[1]:void 0,a=void 0!==o,s=Xi(n),u=0;if(a&&(o=Id(o,2<i?arguments[2]:void 0,2)),null==s||r==Array&&Vi(s)){var c=ta(n.length);for(r=new r(c);c>u;u++)s=a?o(n[u],u):n[u],Ge(r,u,s)}else for(i=(n=s.call(n)).next,r=new r;!(t=i.call(n)).done;u++){if(a){s=n;var l=o;t=[t.value,u];try{c=l(va(t)[0],t[1])}catch(e){throw Ui(s),e}}else c=t.value;Ge(r,u,s=c)}return r.length=u,r}});var Fn=function(e){return function(t,n){t=String(jb(t)),n=$b(n);var r,i=t.length;if(0>n||n>=i)return e?"":void 0;var o=t.charCodeAt(n);return 55296>o||56319<o||n+1===i||56320>(r=t.charCodeAt(n+1))||57343<r?e?t.charAt(n):o:e?t.slice(n,n+2):r-56320+(o-55296<<10)+65536}};Fn(!1);var Gn=Fn(!0),Hn=!R((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),In=Pg("IE_PROTO"),Zu=Object.prototype,Vb=Hn?Object.getPrototypeOf:function(e){return e=Qa(e),Q(e,In)?e[In]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?Zu:null},Yi=qa("iterator"),Jn=!1,$u=function(){return this},Kd;if([].keys){var Kn=[].keys();if("next"in Kn){var Ln=Vb(Vb(Kn));Ln!==Object.prototype&&(Kd=Ln)}else Jn=!0}(null==Kd||R((function(){var e={};return Kd[Yi].call(e)!==e})))&&(Kd={}),Q(Kd,Yi)||Na(Kd,Yi,$u);var Ug=Kd,Vg=Jn,av=ka?Object.defineProperties:function(e,t){va(e);for(var n,r=Dc(t),i=r.length,o=0;i>o;)Ra.f(e,n=r[o++],t[n]);return e},Zi=mc("document","documentElement"),Mn=Pg("IE_PROTO"),$i=function(){},aj,Wg=function(){try{aj=document.domain&&new ActiveXObject("htmlfile")}catch(e){}if(aj){var e=aj;e.write("<script><\/script>"),e.close(),e=e.parentWindow.Object}else(e=Og?ze.createElement("iframe"):{}).style.display="none",Zi.appendChild(e),e.src="javascript:",(e=e.contentWindow.document).open(),e.write("<script>document.F=Object<\/script>"),e.close(),e=e.F;for(Wg=e,e=Rg.length;e--;)delete Wg.prototype[Rg[e]];return Wg()};Be[Mn]=!0;var ac=Object.create||function(e,t){if(null!==e){$i.prototype=va(e);var n=new $i;$i.prototype=null,n[Mn]=e}else n=Wg();return void 0===t?n:av(n,t)},bv=Ra.f,Nn=qa("toStringTag"),Ec=function(e,t,n){e&&!Q(e=n?e:e.prototype,Nn)&&bv(e,Nn,{configurable:!0,value:t})},cv=function(){return this},dv=function(e,t,n){return t+=" Iterator",e.prototype=ac(Ug,{next:dd(1,n)}),Ec(e,t,!1),Fe[t]=cv,e},Ua=Object.setPrototypeOf||("__proto__"in{}?function(){var e=!1,t={};try{var n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set;n.call(t,[]),e=t instanceof Array}catch(e){}return function(t,r){if(va(t),!ha(r)&&null!==r)throw TypeError("Can't set "+String(r)+" as a prototype");return e?n.call(t,r):t.__proto__=r,t}}():void 0),Gf=qa("iterator"),ev=function(){return this},bj=function(e,t,n,r,i,o,a){dv(n,t,r),r=function(e){if(e===i&&h)return h;if(!Vg&&e in l)return l[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}};var s,u=t+" Iterator",c=!1,l=e.prototype,f=l[Gf]||l["@@iterator"]||i&&l[i],h=!Vg&&f||r(i),p="Array"==t&&l.entries||f;if(p&&(e=Vb(p.call(new e)),Ug!==Object.prototype&&e.next&&(Vb(e)!==Ug&&(Ua?Ua(e,Ug):"function"!=typeof e[Gf]&&Na(e,Gf,ev)),Ec(e,u,!0))),"values"==i&&f&&"values"!==f.name&&(c=!0,h=function(){return f.call(this)}),l[Gf]!==h&&Na(l,Gf,h),Fe[t]=h,i){var d={values:r("values"),keys:o?h:r("keys"),entries:r("entries")};if(a)for(s in d)!Vg&&!c&&s in l||Ta(l,s,d[s]);else N({target:t,proto:!0,forced:Vg||c},d)}return d},fv=Za.set,gv=Za.getterFor("String Iterator");bj(String,"String",(function(e){fv(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e=gv(this),t=e.string,n=e.index;return n>=t.length?{value:void 0,done:!0}:(t=Gn(t,n),e.index+=t.length,{value:t,done:!1})}));var cj=qa("unscopables"),dj=Array.prototype;null==dj[cj]&&Ra.f(dj,cj,{configurable:!0,value:ac(null)});var Ld=function(e){dj[cj][e]=!0},On=!0;"find"in[]&&Array(1).find((function(){On=!1})),N({target:"Array",proto:!0,forced:On},{find:function(e){return zn(this,e,1<arguments.length?arguments[1]:void 0)}}),Ld("find");var Pn=function(e){var t=String(jb(this)),n="";if(0>(e=$b(e))||1/0==e)throw RangeError("Wrong number of repetitions");for(;0<e;(e>>>=1)&&(t+=t))1&e&&(n+=t);return n};N({target:"String",proto:!0},{repeat:Pn}),N({target:"Number",stat:!0},{MAX_SAFE_INTEGER:9007199254740991}),N({target:"Number",stat:!0},{isNaN:function(e){return e!=e}}),y.Number.isNaN;var hv=Wi?{}.toString:function(){return"[object "+Ff(this)+"]"};Wi||Ta(Object.prototype,"toString",hv,{unsafe:!0});var Fc=y.Promise,Hf=function(e,t,n){for(var r in t)Ta(e,r,t[r],n);return e},Qn=qa("species"),If=function(e){e=mc(e);var t=Ra.f;ka&&e&&!e[Qn]&&t(e,Qn,{configurable:!0,get:function(){return this}})},Gc=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Jf=function(e,t){this.stopped=e,this.result=t},Xg=function(e,t,n){var r,i=!(!n||!n.AS_ENTRIES),o=!(!n||!n.IS_ITERATOR),a=!(!n||!n.INTERRUPTED),s=Id(t,n&&n.that,1+i+a),u=function(e){return c&&Ui(c),new Jf(!0,e)};if(t=function(e){return i?(va(e),a?s(e[0],e[1],u):s(e[0],e[1])):a?s(e,u):s(e)},o)var c=e;else{if("function"!=typeof(o=Xi(e)))throw TypeError("Target is not iterable");if(Vi(o)){for(o=0,n=ta(e.length);n>o;o++)if((r=t(e[o]))&&r instanceof Jf)return r;return new Jf(!1)}c=o.call(e)}for(e=c.next;!(o=e.call(c)).done;){try{r=t(o.value)}catch(e){throw Ui(c),e}if("object"==typeof r&&r&&r instanceof Jf)return r}return new Jf(!1)},iv=qa("species"),kd=function(e,t){var n;return void 0===(e=va(e).constructor)||null==(n=va(e)[iv])?t:yb(n)},Rn=/(?:iphone|ipod|ipad).*applewebkit/i.test(De),Hc="process"==Zb(y.process),Yg=y.location,ej=y.setImmediate,Sn=y.clearImmediate,jv=y.process,Tn=y.MessageChannel,fj=y.Dispatch,gj=0,Kf={},hj=function(e){if(Kf.hasOwnProperty(e)){var t=Kf[e];delete Kf[e],t()}},ij=function(e){return function(){hj(e)}},Un=function(e){hj(e.data)},Vn=function(e){y.postMessage(e+"",Yg.protocol+"//"+Yg.host)};if(!ej||!Sn)if(ej=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return Kf[++gj]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Lf(gj),gj},Sn=function(e){delete Kf[e]},Hc)var Lf=function(e){jv.nextTick(ij(e))};else if(fj&&fj.now)Lf=function(e){fj.now(ij(e))};else if(Tn&&!Rn){var Wn=new Tn,Xn=Wn.port2;Wn.port1.onmessage=Un,Lf=Id(Xn.postMessage,Xn,1)}else y.addEventListener&&"function"==typeof postMessage&&!y.importScripts&&Yg&&"file:"!==Yg.protocol&&!R(Vn)?(Lf=Vn,y.addEventListener("message",Un,!1)):Lf="onreadystatechange"in(Og?ze.createElement("script"):{})?function(e){Zi.appendChild(Og?ze.createElement("script"):{}).onreadystatechange=function(){Zi.removeChild(this),hj(e)}}:function(e){setTimeout(ij(e),0)};var jj=ej,kv=/web0s(?!.*chrome)/i.test(De),lv=Fb.f,Yn=y.MutationObserver||y.WebKitMutationObserver,Zn=y.document,$n=y.process,Zg=y.Promise,ao=lv(y,"queueMicrotask"),bo=ao&&ao.value,Md,Mf;if(!bo){var ah=function(){var e;for(Hc&&(e=$n.domain)&&e.exit();Md;){var t=Md.fn;Md=Md.next;try{t()}catch(e){throw Md?$g():Mf=void 0,e}}Mf=void 0,e&&e.enter()};if(Rn||Hc||kv||!Yn||!Zn)if(Zg&&Zg.resolve){var kj=Zg.resolve(void 0);kj.constructor=Zg;var mv=kj.then,$g=function(){mv.call(kj,ah)}}else $g=Hc?function(){$n.nextTick(ah)}:function(){jj.call(y,ah)};else{var co=!0,eo=Zn.createTextNode("");new Yn(ah).observe(eo,{characterData:!0}),$g=function(){eo.data=co=!co}}}var fo=bo||function(e){e={fn:e,next:void 0},Mf&&(Mf.next=e),Md||(Md=e,$g()),Mf=e},nv=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=yb(t),this.reject=yb(n)},lj={f:function(e){return new nv(e)}},mj=function(e,t){return va(e),ha(t)&&t.constructor===e?t:((0,(e=lj.f(e)).resolve)(t),e.promise)},ov=function(e,t){var n=y.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))},nj=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},pv="object"==typeof window,qv=qa("species"),go=Za.get,rv=Za.set,sv=Za.getterFor("Promise"),Nd=Fc&&Fc.prototype,zb=Fc,bh=Nd,ho=y.TypeError,oj=y.document,pj=y.process,He=lj.f,tv=He,uv=!!(oj&&oj.createEvent&&y.dispatchEvent),io="function"==typeof PromiseRejectionEvent,jo=!1,Nf=nc("Promise",(function(){var e=Pi(zb)!==String(zb);if(!e&&66===id)return!0;if(51<=id&&/native code/.test(zb))return!1;var t=new zb((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};return(t.constructor={})[qv]=n,!(jo=t.then((function(){}))instanceof n)||!e&&pv&&!io})),vv=Nf||!Tg((function(e){zb.all(e).catch((function(){}))})),ko=function(e){var t;return!(!ha(e)||"function"!=typeof(t=e.then))&&t},qj=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;fo((function(){for(var r=e.value,i=1==e.state,o=0;n.length>o;){var a,s=n[o++],u=i?s.ok:s.fail,c=s.resolve,l=s.reject,f=s.domain;try{if(u){if(i||(2===e.rejection&&wv(e),e.rejection=1),!0===u)var h=r;else if(f&&f.enter(),h=u(r),f){f.exit();var p=!0}h===s.promise?l(ho("Promise-chain cycle")):(a=ko(h))?a.call(h,c,l):c(h)}else l(r)}catch(e){f&&!p&&f.exit(),l(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&xv(e)}))}},lo=function(e,t,n){var r;if(uv){var i=oj.createEvent("Event");i.promise=t,i.reason=n,i.initEvent(e,!1,!0),y.dispatchEvent(i)}else i={promise:t,reason:n};!io&&(r=y["on"+e])?r(i):"unhandledrejection"===e&&ov("Unhandled promise rejection",n)},xv=function(e){jj.call(y,(function(){var t=e.facade,n=e.value;if(1!==e.rejection&&!e.parent){var r=nj((function(){Hc?pj.emit("unhandledRejection",n,t):lo("unhandledrejection",t,n)}));if(e.rejection=Hc||1!==e.rejection&&!e.parent?2:1,r.error)throw r.value}}))},wv=function(e){jj.call(y,(function(){var t=e.facade;Hc?pj.emit("rejectionHandled",t):lo("rejectionhandled",t,e.value)}))},Ie=function(e,t,n){return function(r){e(t,r,n)}},Je=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,qj(e,!0))},rj=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw ho("Promise can't be resolved itself");var r=ko(t);r?fo((function(){var n={done:!1};try{r.call(t,Ie(rj,n,e),Ie(Je,n,e))}catch(t){Je(n,t,e)}})):(e.value=t,e.state=1,qj(e,!1))}catch(t){Je({done:!1},t,e)}}};if(Nf){zb=function(e){Gc(this,zb,"Promise"),yb(e),sj.call(this);var t=go(this);try{e(Ie(rj,t),Ie(Je,t))}catch(e){Je(t,e)}},bh=zb.prototype;var sj=function(e){rv(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})};sj.prototype=Hf(bh,{then:function(e,t){var n=sv(this),r=He(kd(this,zb));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Hc?pj.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&qj(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}});var yv=function(){var e=new sj,t=go(e);this.promise=e,this.resolve=Ie(rj,t),this.reject=Ie(Je,t)};if(lj.f=He=function(e){return e===zb||e===zv?new yv(e):tv(e)},"function"==typeof Fc&&Nd!==Object.prototype){var Av=Nd.then;jo||(Ta(Nd,"then",(function(e,t){var n=this;return new zb((function(e,t){Av.call(n,e,t)})).then(e,t)}),{unsafe:!0}),Ta(Nd,"catch",bh.catch,{unsafe:!0}));try{delete Nd.constructor}catch(c){}Ua&&Ua(Nd,bh)}}N({global:!0,wrap:!0,forced:Nf},{Promise:zb}),Ec(zb,"Promise",!1),If("Promise");var zv=mc("Promise");N({target:"Promise",stat:!0,forced:Nf},{reject:function(e){var t=He(this);return t.reject.call(void 0,e),t.promise}}),N({target:"Promise",stat:!0,forced:Nf},{resolve:function(e){return mj(this,e)}}),N({target:"Promise",stat:!0,forced:vv},{all:function(e){var t=this,n=He(t),r=n.resolve,i=n.reject,o=nj((function(){var n=yb(t.resolve),o=[],a=0,s=1;Xg(e,(function(e){var u=a++,c=!1;o.push(void 0),s++,n.call(t,e).then((function(e){c||(c=!0,o[u]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise},race:function(e){var t=this,n=He(t),r=n.reject,i=nj((function(){var i=yb(t.resolve);Xg(e,(function(e){i.call(t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var mo=[].indexOf,no=!!mo&&0>1/[1].indexOf(1,-0),Bv=Ee("indexOf");N({target:"Array",proto:!0,forced:no||!Bv},{indexOf:function(e){return no?mo.apply(this,arguments)||0:Si(this,e,1<arguments.length?arguments[1]:void 0)}});var tj=function(){var e=va(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},pc=R((function(){var e=RegExp("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Cv=R((function(){var e=RegExp("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),ch=RegExp.prototype.exec,Dv=fd("native-string-replace",String.prototype.replace),oo=ch,uj=(c=/a/,a=/b*/g,ch.call(c,"a"),ch.call(a,"a"),0!==c.lastIndex||0!==a.lastIndex),po=pc||Cv,vj=void 0!==/()??/.exec("")[1],c,a;(uj||vj||po)&&(oo=function(e){var t,n=po&&this.sticky,r=tj.call(this),i=this.source,o=0,a=e;if(n){-1===(r=r.replace("y","")).indexOf("g")&&(r+="g"),a=String(e).slice(this.lastIndex),0<this.lastIndex&&(!this.multiline||this.multiline&&"\n"!==e[this.lastIndex-1])&&(i="(?: "+i+")",a=" "+a,o++);var s=new RegExp("^(?:"+i+")",r)}if(vj&&(s=new RegExp("^"+i+"$(?!\\s)",r)),uj)var u=this.lastIndex;var c=ch.call(n?s:this,a);return n?c?(c.input=c.input.slice(o),c[0]=c[0].slice(o),c.index=this.lastIndex,this.lastIndex+=c[0].length):this.lastIndex=0:uj&&c&&(this.lastIndex=this.global?c.index+c[0].length:u),vj&&c&&1<c.length&&Dv.call(c[0],s,(function(){for(t=1;t<arguments.length-2;t++)void 0===arguments[t]&&(c[t]=void 0)})),c});var Of=oo;N({target:"RegExp",proto:!0,forced:/./.exec!==Of},{exec:Of});var Ev=qa("species"),wj=RegExp.prototype,Fv=!R((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),qo="$0"==="a".replace(/./,"$0"),ro=qa("replace"),so=!!/./[ro]&&""===/./[ro]("a","$0"),Gv=!R((function(){var e=/(?:)/,t=e.exec;return e.exec=function(){return t.apply(this,arguments)},2!==(e="ab".split(e)).length||"a"!==e[0]||"b"!==e[1]})),dh=function(e,t,n,r){var i=qa(e),o=!R((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!R((function(){var t=!1,n=/a/;return"split"===e&&((n={constructor:{}}).constructor[Ev]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!o||!a||"replace"===e&&(!Fv||!qo||so)||"split"===e&&!Gv){var s=/./[i],u=(n=n(i,""[e],(function(e,t,n,r,i){var a=t.exec;return a===Of||a===wj.exec?o&&!i?{done:!0,value:s.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:qo,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:so}))[1];Ta(String.prototype,e,n[0]),Ta(wj,i,2==t?function(e,t){return u.call(e,this,t)}:function(e){return u.call(e,this)})}r&&Na(wj[i],"sham",!0)},xj=function(e,t,n){return t+(n?Gn(e,t).length:1)},Hv=Math.floor,Iv="".replace,Jv=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Kv=/\$([$&'`]|\d{1,2})/g,Lv=function(e,t,n,r,i,o){var a=n+e.length,s=r.length,u=Kv;return void 0!==i&&(i=Qa(i),u=Jv),Iv.call(o,u,(function(o,u){switch(u.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(a);case"<":o=i[u.slice(1,-1)];break;default:var c=+u;if(0===c)return o;if(c>s)return 0===(c=Hv(c/10))?o:c<=s?void 0===r[c-1]?u.charAt(1):r[c-1]+u.charAt(1):o;o=r[c-1]}return void 0===o?"":o}))},Ke=function(e,t){var n=e.exec;if("function"==typeof n){if("object"!=typeof(e=n.call(e,t)))throw TypeError("RegExp exec method returned something other than an Object or null");return e}if("RegExp"!==Zb(e))throw TypeError("RegExp#exec called on incompatible receiver");return Of.call(e,t)},Mv=Math.max,Nv=Math.min,Ov=function(e){return void 0===e?e:String(e)};dh("replace",2,(function(e,t,n,r){var i=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,o=r.REPLACE_KEEPS_$0,a=i?"$":"$0";return[function(n,r){var i=jb(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!i&&o||"string"==typeof r&&-1===r.indexOf(a)){var s=n(t,e,this,r);if(s.done)return s.value}var u=va(e);e=String(this),(s="function"==typeof r)||(r=String(r));var c=u.global;if(c){var l=u.unicode;u.lastIndex=0}for(var f=[];;){var h=Ke(u,e);if(null===h)break;if(f.push(h),!c)break;""===String(h[0])&&(u.lastIndex=xj(e,ta(u.lastIndex),l))}for(l="",c=u=0;c<f.length;c++){h=f[c];for(var p=String(h[0]),d=Mv(Nv($b(h.index),e.length),0),v=[],b=1;b<h.length;b++)v.push(Ov(h[b]));h=h.groups,s?(v=[p].concat(v,d,e),void 0!==h&&v.push(h),h=String(r.apply(void 0,v))):h=Lv(p,e,d,v,h,r),d>=u&&(l+=e.slice(u,d)+h,u=d+p.length)}return l+e.slice(u)}]}));var Pv=Ef("slice"),Qv=qa("species"),Rv=[].slice,Sv=Math.max;N({target:"Array",proto:!0,forced:!Pv},{slice:function(e,t){var n=qb(this),r=ta(n.length);if(e=xb(e,r),t=xb(void 0===t?r:t,r),gd(n)){var i=n.constructor;if("function"!=typeof i||i!==Array&&!gd(i.prototype)?ha(i)&&(null===(i=i[Qv])&&(i=void 0)):i=void 0,i===Array||void 0===i)return Rv.call(n,e,t)}for(i=new(void 0===i?Array:i)(Sv(t-e,0)),r=0;e<t;e++,r++)e in n&&Ge(i,r,n[e]);return i.length=r,i}});var Tv=Za.set,Uv=Za.getterFor("Array Iterator"),ld=bj(Array,"Array",(function(e,t){Tv(this,{type:"Array Iterator",target:qb(e),index:0,kind:t})}),(function(){var e=Uv(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values");Fe.Arguments=Fe.Array,Ld("keys"),Ld("values"),Ld("entries");var to="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Le=function(e){if(void 0===e)return 0;e=$b(e);var t=ta(e);if(e!==t)throw RangeError("Wrong length or index");return t},Vv=Math.abs,Ic=Math.pow,Wv=Math.floor,Xv=Math.log,Yv=Math.LN2,yj=function(e){var t=Qa(this),n=ta(t.length),r=arguments.length,i=xb(1<r?arguments[1]:void 0,n);for(n=void 0===(r=2<r?arguments[2]:void 0)?n:xb(r,n);n>i;)t[i++]=e;return t},Zv=Hd.f,$v=Ra.f,Me=Za.get,uo=Za.set,bc=y.ArrayBuffer,Ab=bc,cc=y.DataView,eh=cc&&cc.prototype,vo=Object.prototype,fh=y.RangeError,wo=function(e,t,n){var r,i=Array(n),o=(1<<(n=8*n-t-1))-1,a=o>>1,s=23===t?Ic(2,-24)-Ic(2,-77):0,u=0>e||0===e&&0>1/e?1:0,c=0;if((e=Vv(e))!=e||1/0===e){e=e!=e?1:0;var l=o}else l=Wv(Xv(e)/Yv),1>e*(r=Ic(2,-l))&&(l--,r*=2),2<=(e=1<=l+a?e+s/r:e+s*Ic(2,1-a))*r&&(l++,r/=2),l+a>=o?(e=0,l=o):1<=l+a?(e=(e*r-1)*Ic(2,t),l+=a):(e=e*Ic(2,a-1)*Ic(2,t),l=0);for(;8<=t;i[c++]=255&e,e/=256,t-=8);for(l=l<<t|e,n+=t;0<n;i[c++]=255&l,l/=256,n-=8);return i[--c]|=128*u,i},xo=function(e,t){var n=e.length,r=8*n-t-1,i=(1<<r)-1,o=i>>1;r-=7,--n;var a=e[n--],s=127&a;for(a>>=7;0<r;s=256*s+e[n],n--,r-=8);var u=s&(1<<-r)-1;for(s>>=-r,r+=t;0<r;u=256*u+e[n],n--,r-=8);if(0===s)s=1-o;else{if(s===i)return u?NaN:a?-1/0:1/0;u+=Ic(2,t),s-=o}return(a?-1:1)*u*Ic(2,s-t)},yo=function(e){return[255&e]},zo=function(e){return[255&e,e>>8&255]},Ao=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Bo=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},aw=function(e){return wo(e,23,4)},bw=function(e){return wo(e,52,8)},gh=function(e,t){$v(e.prototype,t,{get:function(){return Me(this)[t]}})},md=function(e,t,n,r){n=Le(n);var i=Me(e);if(n+t>i.byteLength)throw fh("Wrong index");return e=Me(i.buffer).bytes,n+=i.byteOffset,t=e.slice(n,n+t),r?t:t.reverse()},nd=function(e,t,n,r,i,o){n=Le(n);var a=Me(e);if(n+t>a.byteLength)throw fh("Wrong index");for(e=Me(a.buffer).bytes,n+=a.byteOffset,r=r(+i),i=0;i<t;i++)e[n+i]=r[o?i:t-i-1]};if(to){if(!R((function(){bc(1)}))||!R((function(){new bc(-1)}))||R((function(){return new bc,new bc(1.5),new bc(NaN),"ArrayBuffer"!=bc.name}))){Ab=function(e){return Gc(this,Ab),new bc(Le(e))};for(var cw=Ab.prototype=bc.prototype,Co=Zv(bc),Do=0,zj;Co.length>Do;)(zj=Co[Do++])in Ab||Na(Ab,zj,bc[zj]);cw.constructor=Ab}Ua&&Vb(eh)!==vo&&Ua(eh,vo);var hh=new cc(new Ab(2)),Eo=eh.setInt8;hh.setInt8(0,2147483648),hh.setInt8(1,2147483649),!hh.getInt8(0)&&hh.getInt8(1)||Hf(eh,{setInt8:function(e,t){Eo.call(this,e,t<<24>>24)},setUint8:function(e,t){Eo.call(this,e,t<<24>>24)}},{unsafe:!0})}else Ab=function(e){Gc(this,Ab,"ArrayBuffer"),e=Le(e),uo(this,{bytes:yj.call(Array(e),0),byteLength:e}),ka||(this.byteLength=e)},cc=function(e,t,n){Gc(this,cc,"DataView"),Gc(e,Ab,"DataView");var r=Me(e).byteLength;if(0>(t=$b(t))||t>r)throw fh("Wrong offset");if(t+(n=void 0===n?r-t:ta(n))>r)throw fh("Wrong length");uo(this,{buffer:e,byteLength:n,byteOffset:t}),ka||(this.buffer=e,this.byteLength=n,this.byteOffset=t)},ka&&(gh(Ab,"byteLength"),gh(cc,"buffer"),gh(cc,"byteLength"),gh(cc,"byteOffset")),Hf(cc.prototype,{getInt8:function(e){return md(this,1,e)[0]<<24>>24},getUint8:function(e){return md(this,1,e)[0]},getInt16:function(e){var t=md(this,2,e,1<arguments.length?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=md(this,2,e,1<arguments.length?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Bo(md(this,4,e,1<arguments.length?arguments[1]:void 0))},getUint32:function(e){return Bo(md(this,4,e,1<arguments.length?arguments[1]:void 0))>>>0},getFloat32:function(e){return xo(md(this,4,e,1<arguments.length?arguments[1]:void 0),23)},getFloat64:function(e){return xo(md(this,8,e,1<arguments.length?arguments[1]:void 0),52)},setInt8:function(e,t){nd(this,1,e,yo,t)},setUint8:function(e,t){nd(this,1,e,yo,t)},setInt16:function(e,t){nd(this,2,e,zo,t,2<arguments.length?arguments[2]:void 0)},setUint16:function(e,t){nd(this,2,e,zo,t,2<arguments.length?arguments[2]:void 0)},setInt32:function(e,t){nd(this,4,e,Ao,t,2<arguments.length?arguments[2]:void 0)},setUint32:function(e,t){nd(this,4,e,Ao,t,2<arguments.length?arguments[2]:void 0)},setFloat32:function(e,t){nd(this,4,e,aw,t,2<arguments.length?arguments[2]:void 0)},setFloat64:function(e,t){nd(this,8,e,bw,t,2<arguments.length?arguments[2]:void 0)}});Ec(Ab,"ArrayBuffer"),Ec(cc,"DataView");var Pf={ArrayBuffer:Ab,DataView:cc},Aj=Pf.ArrayBuffer,Fo=Pf.DataView,Go=Aj.prototype.slice,dw=R((function(){return!new Aj(2).slice(1,void 0).byteLength}));N({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:dw},{slice:function(e,t){if(void 0!==Go&&void 0===t)return Go.call(va(this),e);var n=va(this).byteLength;e=xb(e,n),t=xb(void 0===t?n:t,n),n=new(kd(this,Aj))(ta(t-e));for(var r=new Fo(this),i=new Fo(n),o=0;e<t;)i.setUint8(o++,r.getUint8(e++));return n}});var ew=Ra.f,ih=y.Int8Array,Bj=ih&&ih.prototype,Ho=y.Uint8ClampedArray,Io=Ho&&Ho.prototype,qc=ih&&Vb(ih),dc=Bj&&Vb(Bj),Jo=Object.prototype,Ko=Jo.isPrototypeOf,Lo=qa("toStringTag"),Cj=Ae("TYPED_ARRAY_TAG"),Jc=to&&!!Ua&&"Opera"!==Ff(y.opera),Mo=!1,Bb,rc={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},fw={BigInt64Array:8,BigUint64Array:8},jh=function(e){return!!ha(e)&&(e=Ff(e),Q(rc,e)||Q(fw,e))};for(Bb in rc)y[Bb]||(Jc=!1);if((!Jc||"function"!=typeof qc||qc===Function.prototype)&&(qc=function(){throw TypeError("Incorrect invocation")},Jc))for(Bb in rc)y[Bb]&&Ua(y[Bb],qc);if((!Jc||!dc||dc===Jo)&&(dc=qc.prototype,Jc))for(Bb in rc)y[Bb]&&Ua(y[Bb].prototype,dc);if(Jc&&Vb(Io)!==dc&&Ua(Io,dc),ka&&!Q(dc,Lo))for(Bb in Mo=!0,ew(dc,Lo,{get:function(){return ha(this)?this[Cj]:void 0}}),rc)y[Bb]&&Na(y[Bb],Cj,Bb);var Qf=Jc,No=Mo&&Cj,Da=function(e){if(jh(e))return e;throw TypeError("Target is not a typed array")},Ne=function(e){if(Ua){if(Ko.call(qc,e))return e}else for(var t in rc)if(Q(rc,Bb)){var n=y[t];if(n&&(e===n||Ko.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},Aa=function(e,t,n){if(ka){if(n)for(var r in rc){var i=y[r];if(i&&Q(i.prototype,e))try{delete i.prototype[e]}catch(e){}}dc[e]&&!n||Ta(dc,e,n?t:Jc&&Bj[e]||t)}},Oo=function(e,t,n){var r,i;if(ka){if(Ua){if(n)for(r in rc)if((i=y[r])&&Q(i,e))try{delete i[e]}catch(e){}if(qc[e]&&!n)return;try{return Ta(qc,e,n?t:Jc&&qc[e]||t)}catch(e){}}for(r in rc)!(i=y[r])||i[e]&&!n||Ta(i,e,t)}},Po=qc,Rf=dc,gw=y.ArrayBuffer,Od=y.Int8Array,Dj=!Qf||!R((function(){Od(1)}))||!R((function(){new Od(-1)}))||!Tg((function(e){new Od,new Od(null),new Od(1.5),new Od(e)}),!0)||R((function(){return 1!==new Od(new gw(2),1,void 0).length})),kh=function(e,t){if(0>(e=$b(e)))throw RangeError("The argument can't be less than 0");if(e%t)throw RangeError("Wrong offset");return e},Ej=function(e){var t=Qa(e),n=arguments.length,r=1<n?arguments[1]:void 0,i=void 0!==r,o=Xi(t);if(null!=o&&!Vi(o)){var a=o.call(t),s=a.next;for(t=[];!(o=s.call(a)).done;)t.push(o.value)}for(i&&2<n&&(r=Id(r,arguments[2],2)),o=ta(t.length),a=new(Ne(this))(o),n=0;o>n;n++)a[n]=i?r(t[n],n):t[n];return a},lh=function(e,t,n){var r,i;return Ua&&"function"==typeof(r=t.constructor)&&r!==n&&ha(i=r.prototype)&&i!==n.prototype&&Ua(e,i),e},Sf=$a((function(e){var t=Hd.f,n=Za.get,r=Za.set,i=Ra.f,o=Fb.f,a=Math.round,s=y.RangeError,u=Pf.ArrayBuffer,c=Pf.DataView,l=function(e,t){var n=0,r=t.length;for(e=new(Ne(e))(r);r>n;)e[n]=t[n++];return e},f=function(e,t){i(e,t,{get:function(){return n(this)[t]}})},h=function(e){var t;return e instanceof u||"ArrayBuffer"==(t=Ff(e))||"SharedArrayBuffer"==t},p=function(e,t){return jh(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},d=function(e,t){return p(e,t=lc(t,!0))?dd(2,e[t]):o(e,t)},v=function(e,t,n){return!(p(e,t=lc(t,!0))&&ha(n)&&Q(n,"value"))||Q(n,"get")||Q(n,"set")||n.configurable||Q(n,"writable")&&!n.writable||Q(n,"enumerable")&&!n.enumerable?i(e,t,n):(e[t]=n.value,e)};ka?(Qf||(Fb.f=d,Ra.f=v,f(Rf,"buffer"),f(Rf,"byteOffset"),f(Rf,"byteLength"),f(Rf,"length")),N({target:"Object",stat:!0,forced:!Qf},{getOwnPropertyDescriptor:d,defineProperty:v}),e.exports=function(e,o,f){var p=e.match(/\d+$/)[0]/8,d=e+(f?"Clamped":"")+"Array",v="get"+e,b="set"+e,g=y[d],m=g;e=m&&m.prototype;var E={},w=function(e,t){i(e,t,{get:function(){var e=n(this);return e.view[v](t*p+e.byteOffset,!0)},set:function(e){var r=n(this);f&&(e=0>(e=a(e))?0:255<e?255:255&e),r.view[b](t*p+r.byteOffset,e,!0)},enumerable:!0})};Qf?Dj&&(m=o((function(e,t,n,r){return Gc(e,m,d),lh(ha(t)?h(t)?void 0!==r?new g(t,kh(n,p),r):void 0!==n?new g(t,kh(n,p)):new g(t):jh(t)?l(m,t):Ej.call(m,t):new g(Le(t)),e,m)})),Ua&&Ua(m,Po),Jd(t(g),(function(e){e in m||Na(m,e,g[e])})),m.prototype=e):(m=o((function(e,t,n,i){Gc(e,m,d);var o=0,a=0;if(ha(t)){if(!h(t))return jh(t)?l(m,t):Ej.call(m,t);var f=t;if(a=kh(n,p),t=t.byteLength,void 0===i){if(t%p)throw s("Wrong length");if(0>(i=t-a))throw s("Wrong length")}else if((i=ta(i)*p)+a>t)throw s("Wrong length");t=i/p}else t=Le(t),f=new u(i=t*p);for(r(e,{buffer:f,byteOffset:a,byteLength:i,length:t,view:new c(f)});o<t;)w(e,o++)})),Ua&&Ua(m,Po),e=m.prototype=ac(Rf)),e.constructor!==m&&Na(e,"constructor",m),No&&Na(e,No,d),E[d]=m,N({global:!0,forced:m!=g,sham:!Qf},E),"BYTES_PER_ELEMENT"in m||Na(m,"BYTES_PER_ELEMENT",p),"BYTES_PER_ELEMENT"in e||Na(e,"BYTES_PER_ELEMENT",p),If(d)}):e.exports=function(){}}));Sf("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var hw=Math.min,iw=[].copyWithin||function(e,t){var n=Qa(this),r=ta(n.length),i=xb(e,r),o=xb(t,r),a=2<arguments.length?arguments[2]:void 0;for(r=hw((void 0===a?r:xb(a,r))-o,r-i),a=1,o<i&&i<o+r&&(a=-1,o+=r-1,i+=r-1);0<r--;)o in n?n[i]=n[o]:delete n[i],i+=a,o+=a;return n};Aa("copyWithin",(function(e,t){return iw.call(Da(this),e,t,2<arguments.length?arguments[2]:void 0)})),Aa("every",(function(e){return Ju(Da(this),e,1<arguments.length?arguments[1]:void 0)})),Aa("fill",(function(e){return yj.apply(Da(this),arguments)})),Aa("filter",(function(e){var t=yn(Da(this),e,1<arguments.length?arguments[1]:void 0),n=kd(this,this.constructor),r=0,i=t.length;for(n=new(Ne(n))(i);i>r;)n[r]=t[r++];return n})),Aa("find",(function(e){return zn(Da(this),e,1<arguments.length?arguments[1]:void 0)})),Aa("findIndex",(function(e){return An(Da(this),e,1<arguments.length?arguments[1]:void 0)})),Aa("forEach",(function(e){Jd(Da(this),e,1<arguments.length?arguments[1]:void 0)})),Aa("includes",(function(e){return on(Da(this),e,1<arguments.length?arguments[1]:void 0)})),Aa("indexOf",(function(e){return Si(Da(this),e,1<arguments.length?arguments[1]:void 0)}));var Qo=qa("iterator"),Ro=y.Uint8Array,jw=ld.values,kw=ld.keys,lw=ld.entries,Fj=Ro&&Ro.prototype[Qo],So=!!Fj&&("values"==Fj.name||null==Fj.name),To=function(){return jw.call(Da(this))};Aa("entries",(function(){return lw.call(Da(this))})),Aa("keys",(function(){return kw.call(Da(this))})),Aa("values",To,!So),Aa(Qo,To,!So);var mw=[].join;Aa("join",(function(e){return mw.apply(Da(this),arguments)}));var nw=Math.min,Gj=[].lastIndexOf,Uo=!!Gj&&0>1/[1].lastIndexOf(1,-0),ow=Ee("lastIndexOf"),pw=Uo||!ow?function(e){if(Uo)return Gj.apply(this,arguments)||0;var t=qb(this),n=ta(t.length),r=n-1;for(1<arguments.length&&(r=nw(r,$b(arguments[1]))),0>r&&(r=n+r);0<=r;r--)if(r in t&&t[r]===e)return r||0;return-1}:Gj;Aa("lastIndexOf",(function(e){return pw.apply(Da(this),arguments)})),Aa("map",(function(e){return xn(Da(this),e,1<arguments.length?arguments[1]:void 0,(function(e,t){return new(Ne(kd(e,e.constructor)))(t)}))}));var Vo=function(e){return function(t,n,r,i){yb(n),t=Qa(t);var o=Af(t),a=ta(t.length),s=e?a-1:0,u=e?-1:1;if(2>r)for(;;){if(s in o){i=o[s],s+=u;break}if(s+=u,e?0>s:a<=s)throw TypeError("Reduce of empty array with no initial value")}for(;e?0<=s:a>s;s+=u)s in o&&(i=n(i,o[s],s,t));return i}},Wo=Vo(!1),qw=Vo(!0);Aa("reduce",(function(e){return Wo(Da(this),e,arguments.length,1<arguments.length?arguments[1]:void 0)})),Aa("reduceRight",(function(e){return qw(Da(this),e,arguments.length,1<arguments.length?arguments[1]:void 0)}));var rw=Math.floor;Aa("reverse",(function(){for(var e,t=Da(this).length,n=rw(t/2),r=0;r<n;)e=this[r],this[r++]=this[--t],this[t]=e;return this}));var sw=R((function(){new Int8Array(1).set({})}));Aa("set",(function(e){Da(this);var t=kh(1<arguments.length?arguments[1]:void 0,1),n=this.length,r=Qa(e),i=ta(r.length),o=0;if(i+t>n)throw RangeError("Wrong length");for(;o<i;)this[t+o]=r[o++]}),sw);var tw=[].slice,uw=R((function(){new Int8Array(1).slice()}));Aa("slice",(function(e,t){e=tw.call(Da(this),e,t);var n=kd(this,this.constructor);t=0;var r=e.length;for(n=new(Ne(n))(r);r>t;)n[t]=e[t++];return n}),uw),Aa("some",(function(e){return Iu(Da(this),e,1<arguments.length?arguments[1]:void 0)}));var vw=[].sort;Aa("sort",(function(e){return vw.call(Da(this),e)})),Aa("subarray",(function(e,t){var n=Da(this),r=n.length;return e=xb(e,r),new(kd(n,n.constructor))(n.buffer,n.byteOffset+e*n.BYTES_PER_ELEMENT,ta((void 0===t?r:xb(t,r))-e))}));var mh=y.Int8Array,Xo=[].toLocaleString,ww=[].slice,xw=!!mh&&R((function(){Xo.call(new mh(1))})),yw=R((function(){return[1,2].toLocaleString()!=new mh([1,2]).toLocaleString()}))||!R((function(){mh.prototype.toLocaleString.call([1,2])}));Aa("toLocaleString",(function(){return Xo.apply(xw?ww.call(Da(this)):Da(this),arguments)}),yw);var Yo=y.Uint8Array,zw=Yo&&Yo.prototype||{},nh=[].toString,Aw=[].join;R((function(){nh.call({})}))&&(nh=function(){return Aw.call(this)}),Aa("toString",nh,zw.toString!=nh);var Zo=Pf.ArrayBuffer;N({global:!0,forced:y.ArrayBuffer!==Zo},{ArrayBuffer:Zo}),If("ArrayBuffer");var Bw=Ra.f,Hj=Function.prototype,Cw=Hj.toString,Dw=/^\s*function ([^ (]*)/;!ka||"name"in Hj||Bw(Hj,"name",{configurable:!0,get:function(){try{return Cw.call(this).match(Dw)[1]}catch(e){return""}}});var $o=RegExp.prototype,ap=$o.toString,Ew=R((function(){return"/a/b"!=ap.call({source:"a",flags:"b"})})),Fw="toString"!=ap.name;(Ew||Fw)&&Ta(RegExp.prototype,"toString",(function(){var e=va(this),t=String(e.source),n=e.flags;return"/"+t+"/"+(e=String(void 0===n&&e instanceof RegExp&&!("flags"in $o)?tj.call(e):n))}),{unsafe:!0});var Gw=Ef("splice"),Hw=Math.max,Iw=Math.min;N({target:"Array",proto:!0,forced:!Gw},{splice:function(e,t){var n,r,i=Qa(this),o=ta(i.length),a=xb(e,o),s=arguments.length;if(0===s?s=n=0:1===s?(s=0,n=o-a):(s-=2,n=Iw(Hw($b(t),0),o-a)),9007199254740991<o+s-n)throw TypeError("Maximum allowed length exceeded");var u=Sg(i,n);for(r=0;r<n;r++){var c=a+r;c in i&&Ge(u,r,i[c])}if(u.length=n,s<n){for(r=a;r<o-n;r++){var l=r+s;(c=r+n)in i?i[l]=i[c]:delete i[l]}for(r=o;r>o-n+s;r--)delete i[r-1]}else if(s>n)for(r=o-n;r>a;r--)l=r+s-1,(c=r+n-1)in i?i[l]=i[c]:delete i[l];for(r=0;r<s;r++)i[r+a]=arguments[r+2];return i.length=o-n+s,u}});var Ij={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Jj=qa("iterator"),bp=qa("toStringTag"),Kj=ld.values,oh;for(oh in Ij){var cp=y[oh],Kc=cp&&cp.prototype;if(Kc){if(Kc[Jj]!==Kj)try{Na(Kc,Jj,Kj)}catch(c){Kc[Jj]=Kj}if(Kc[bp]||Na(Kc,bp,oh),Ij[oh])for(var Oe in ld)if(Kc[Oe]!==ld[Oe])try{Na(Kc,Oe,ld[Oe])}catch(c){Kc[Oe]=ld[Oe]}}}var dp=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};dh("search",1,(function(e,t,n){return[function(t){var n=jb(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;e=va(e);var i=String(this);return r=e.lastIndex,dp(r,0)||(e.lastIndex=0),i=Ke(e,i),dp(e.lastIndex,r)||(e.lastIndex=r),null===i?-1:i.index}]})),$a((function(e){!function(t,n){e.exports?e.exports=n(t):n(t)}("undefined"!=typeof self?self:Ya,(function(e){function t(e){return btoa(e).replace(/=+$/,"").replace(/\+/g,"-").replace(/\//g,"_")}function n(e){return e=(e+="===").slice(0,-e.length%4),atob(e.replace(/-/g,"+").replace(/_/g,"/"))}function r(e){for(var t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function i(e){return e instanceof ArrayBuffer&&(e=new Uint8Array(e)),String.fromCharCode.apply(String,e)}function o(e){var t={name:(e.name||e||"").toUpperCase().replace("V","v")};switch(t.name){case"SHA-1":case"SHA-256":case"SHA-384":case"SHA-512":break;case"AES-CBC":case"AES-GCM":case"AES-KW":e.length&&(t.length=e.length);break;case"HMAC":e.hash&&(t.hash=o(e.hash)),e.length&&(t.length=e.length);break;case"RSAES-PKCS1-v1_5":e.publicExponent&&(t.publicExponent=new Uint8Array(e.publicExponent)),e.modulusLength&&(t.modulusLength=e.modulusLength);break;case"RSASSA-PKCS1-v1_5":case"RSA-OAEP":e.hash&&(t.hash=o(e.hash)),e.publicExponent&&(t.publicExponent=new Uint8Array(e.publicExponent)),e.modulusLength&&(t.modulusLength=e.modulusLength);break;default:throw new SyntaxError("Bad algorithm name")}return t}function a(e){return{HMAC:{"SHA-1":"HS1","SHA-256":"HS256","SHA-384":"HS384","SHA-512":"HS512"},"RSASSA-PKCS1-v1_5":{"SHA-1":"RS1","SHA-256":"RS256","SHA-384":"RS384","SHA-512":"RS512"},"RSAES-PKCS1-v1_5":{"":"RSA1_5"},"RSA-OAEP":{"SHA-1":"RSA-OAEP","SHA-256":"RSA-OAEP-256"},"AES-KW":{128:"A128KW",192:"A192KW",256:"A256KW"},"AES-GCM":{128:"A128GCM",192:"A192GCM",256:"A256GCM"},"AES-CBC":{128:"A128CBC",192:"A192CBC",256:"A256CBC"}}[e.name][(e.hash||{}).name||e.length||""]}function s(e){(e instanceof ArrayBuffer||e instanceof Uint8Array)&&(e=JSON.parse(decodeURIComponent(escape(i(e)))));var t={kty:e.kty,alg:e.alg,ext:e.ext||e.extractable};switch(t.kty){case"oct":t.k=e.k;case"RSA":"n e d p q dp dq qi oth".split(" ").forEach((function(n){n in e&&(t[n]=e[n])}));break;default:throw new TypeError("Unsupported key type")}return t}function u(e){return e=s(e),E&&(e.extractable=e.ext,delete e.ext),r(unescape(encodeURIComponent(JSON.stringify(e)))).buffer}function c(e){var n=l(e),r=!1;switch(2<n.length&&(r=!0,n.shift()),e={ext:!0},n[0][0]){case"1.2.840.113549.1.1.1":var o="n e d p q dp dq qi".split(" ");for(n=l(n[1]),r&&n.shift(),r=0;r<n.length;r++)n[r][0]||(n[r]=n[r].subarray(1)),e[o[r]]=t(i(n[r]));e.kty="RSA";break;default:throw new TypeError("Unsupported key type")}return e}function l(e,t){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),t||(t={pos:0,end:e.length}),2>t.end-t.pos||t.end>e.length)throw new RangeError("Malformed DER");var n=e[t.pos++],r=e[t.pos++];if(128<=r){if(r&=127,t.end-t.pos<r)throw new RangeError("Malformed DER");for(var o=0;r--;)o<<=8,o|=e[t.pos++];r=o}if(t.end-t.pos<r)throw new RangeError("Malformed DER");switch(n){case 2:n=e.subarray(t.pos,t.pos+=r);break;case 3:if(e[t.pos++])throw Error("Unsupported bit string");r--;case 4:n=new Uint8Array(e.subarray(t.pos,t.pos+=r)).buffer;break;case 5:n=null;break;case 6:if(!((e=btoa(i(e.subarray(t.pos,t.pos+=r))))in _))throw Error("Unsupported OBJECT ID "+e);n=_[e];break;case 48:for(n=[],r=t.pos+r;t.pos<r;)n.push(l(e,t));break;default:throw Error("Unsupported DER tag 0x"+n.toString(16))}return n}function f(e,t){t||(t=[]);var n=t.length+2;if(t.push(0,0),e instanceof Uint8Array)for(var i=2,o=e.length,a=0;a<o;a++)t.push(e[a]);else if(e instanceof ArrayBuffer)for(i=4,o=e.byteLength,e=new Uint8Array(e),a=0;a<o;a++)t.push(e[a]);else if(null===e)i=5,o=0;else if("string"==typeof e&&e in O)for(i=6,o=(e=r(atob(O[e]))).length,a=0;a<o;a++)t.push(e[a]);else if(e instanceof Array){for(a=0;a<e.length;a++)f(e[a],t);i=48,o=t.length-n}else{if(!("object"===X(e)&&3===e.tag&&e.value instanceof ArrayBuffer))throw Error("Unsupported DER value "+e);for(i=3,o=(e=new Uint8Array(e.value)).byteLength,t.push(0),a=0;a<o;a++)t.push(e[a]);o++}if(128<=o){for(a=o,o=4,t.splice(n,0,a>>24&255,a>>16&255,a>>8&255,255&a);1<o&&!(a>>24);)a<<=8,o--;4>o&&t.splice(n,4-o),o|=128}return t.splice(n-2,2,i,o),t}function h(e,t,n,r){Object.defineProperties(this,{_key:{value:e},type:{value:e.type,enumerable:!0},extractable:{value:void 0===n?e.extractable:n,enumerable:!0},algorithm:{value:void 0===t?e.algorithm:t,enumerable:!0},usages:{value:void 0===r?e.usages:r,enumerable:!0}})}function p(e){return"verify"===e||"encrypt"===e||"wrapKey"===e}function d(e){return"sign"===e||"decrypt"===e||"unwrapKey"===e}if("function"!=typeof Promise)throw"Promise support required";var v=e.crypto||e.msCrypto;if(v){var b=v.subtle||v.webkitSubtle;if(b){var g=e.Crypto||v.constructor||Object,y=e.SubtleCrypto||b.constructor||Object;e.CryptoKey||e.Key;var m=-1<e.navigator.userAgent.indexOf("Edge/"),E=!!e.msCrypto&&!m,w=!v.subtle&&!!v.webkitSubtle;if(E||w){var _={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},O={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};if(["generateKey","importKey","unwrapKey"].forEach((function(e){var t=b[e];b[e]=function(i,l,f){var g=[].slice.call(arguments);switch(e){case"generateKey":var y=o(i),m=l,_=f;break;case"importKey":y=o(f),m=g[3],_=g[4],"jwk"===i&&((l=s(l)).alg||(l.alg=a(y)),l.key_ops||(l.key_ops="oct"!==l.kty?"d"in l?_.filter(d):_.filter(p):_.slice()),g[1]=u(l));break;case"unwrapKey":y=g[4],m=g[5],_=g[6],g[2]=f._key}if("generateKey"===e&&"HMAC"===y.name&&y.hash)return y.length=y.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[y.hash.name],b.importKey("raw",v.getRandomValues(new Uint8Array(y.length+7>>3)),y,m,_);if(w&&"generateKey"===e&&"RSASSA-PKCS1-v1_5"===y.name&&(!y.modulusLength||2048<=y.modulusLength))return(i=o(i)).name="RSAES-PKCS1-v1_5",delete i.hash,b.generateKey(i,!0,["encrypt","decrypt"]).then((function(e){return Promise.all([b.exportKey("jwk",e.publicKey),b.exportKey("jwk",e.privateKey)])})).then((function(e){return e[0].alg=e[1].alg=a(y),e[0].key_ops=_.filter(p),e[1].key_ops=_.filter(d),Promise.all([b.importKey("jwk",e[0],y,!0,e[0].key_ops),b.importKey("jwk",e[1],y,m,e[1].key_ops)])})).then((function(e){return{publicKey:e[0],privateKey:e[1]}}));if((w||E&&"SHA-1"===(y.hash||{}).name)&&"importKey"===e&&"jwk"===i&&"HMAC"===y.name&&"oct"===l.kty)return b.importKey("raw",r(n(l.k)),f,g[3],g[4]);if(w&&"importKey"===e&&("spki"===i||"pkcs8"===i))return b.importKey("jwk",c(l),f,g[3],g[4]);if(E&&"unwrapKey"===e)return b.decrypt(g[3],f,l).then((function(e){return b.importKey(i,e,g[4],g[5],g[6])}));try{var O=t.apply(b,g)}catch(e){return Promise.reject(e)}return E&&(O=new Promise((function(e,t){O.onabort=O.onerror=function(e){t(e)},O.oncomplete=function(t){e(t.target.result)}}))),O=O.then((function(e){return"HMAC"!==y.name||y.length||(y.length=8*e.algorithm.length),0==y.name.search("RSA")&&(y.modulusLength||(y.modulusLength=(e.publicKey||e).algorithm.modulusLength),y.publicExponent||(y.publicExponent=(e.publicKey||e).algorithm.publicExponent)),e.publicKey&&e.privateKey?{publicKey:new h(e.publicKey,y,m,_.filter(p)),privateKey:new h(e.privateKey,y,m,_.filter(d))}:new h(e,y,m,_)}))}})),["exportKey","wrapKey"].forEach((function(e){var o=b[e];b[e]=function(u,c,l){var h=[].slice.call(arguments);switch(e){case"exportKey":h[1]=c._key;break;case"wrapKey":h[1]=c._key,h[2]=l._key}if((w||E&&"SHA-1"===(c.algorithm.hash||{}).name)&&"exportKey"===e&&"jwk"===u&&"HMAC"===c.algorithm.name&&(h[0]="raw"),!w||"exportKey"!==e||"spki"!==u&&"pkcs8"!==u||(h[0]="jwk"),E&&"wrapKey"===e)return b.exportKey(u,c).then((function(e){return"jwk"===u&&(e=r(unescape(encodeURIComponent(JSON.stringify(s(e)))))),b.encrypt(h[3],l,e)}));try{var v=o.apply(b,h)}catch(e){return Promise.reject(e)}return E&&(v=new Promise((function(e,t){v.onabort=v.onerror=function(e){t(e)},v.oncomplete=function(t){e(t.target.result)}}))),"exportKey"===e&&"jwk"===u&&(v=v.then((function(e){return(w||E&&"SHA-1"===(c.algorithm.hash||{}).name)&&"HMAC"===c.algorithm.name?{kty:"oct",alg:a(c.algorithm),key_ops:c.usages.slice(),ext:!0,k:t(i(e))}:((e=s(e)).alg||(e.alg=a(c.algorithm)),e.key_ops||(e.key_ops="public"===c.type?c.usages.filter(p):"private"===c.type?c.usages.filter(d):c.usages.slice()),e)}))),!w||"exportKey"!==e||"spki"!==u&&"pkcs8"!==u||(v=v.then((function(e){var t=[["",null]],i=!1;switch((e=s(e)).kty){case"RSA":for(var o="n e d p q dp dq qi".split(" "),a=[],u=0;u<o.length&&o[u]in e;u++){var c=a[u]=r(n(e[o[u]]));128&c[0]&&(a[u]=new Uint8Array(c.length+1),a[u].set(c,1))}2<a.length&&(i=!0,a.unshift(new Uint8Array([0]))),t[0][0]="1.2.840.113549.1.1.1";break;default:throw new TypeError("Unsupported key type")}return t.push(new Uint8Array(f(a)).buffer),i?t.unshift(new Uint8Array([0])):t[1]={tag:3,value:t[1]},new Uint8Array(f(t)).buffer}))),v}})),["encrypt","decrypt","sign","verify"].forEach((function(e){var t=b[e];b[e]=function(n,r,i,a){if(E&&(!i.byteLength||a&&!a.byteLength))throw Error("Empty input is not allowed");var s=[].slice.call(arguments),u=o(n);if(!E||"sign"!==e&&"verify"!==e||"RSASSA-PKCS1-v1_5"!==n&&"HMAC"!==n||(s[0]={name:n}),E&&r.algorithm.hash&&(s[0].hash=s[0].hash||r.algorithm.hash),E&&"decrypt"===e&&"AES-GCM"===u.name){var c=n.tagLength>>3;s[2]=(i.buffer||i).slice(0,i.byteLength-c),n.tag=(i.buffer||i).slice(i.byteLength-c)}E&&"AES-GCM"===u.name&&void 0===s[0].tagLength&&(s[0].tagLength=128),s[1]=r._key;try{var l=t.apply(b,s)}catch(e){return Promise.reject(e)}return E&&(l=new Promise((function(t,n){l.onabort=l.onerror=function(e){n(e)},l.oncomplete=function(n){if(n=n.target.result,"encrypt"===e&&n instanceof AesGcmEncryptResult){var r=n.ciphertext,i=n.tag;(n=new Uint8Array(r.byteLength+i.byteLength)).set(new Uint8Array(r),0),n.set(new Uint8Array(i),r.byteLength),n=n.buffer}t(n)}}))),l}})),E){var I=b.digest;b.digest=function(e,t){if(!t.byteLength)throw Error("Empty input is not allowed");try{var n=I.call(b,e,t)}catch(e){return Promise.reject(e)}return n=new Promise((function(e,t){n.onabort=n.onerror=function(e){t(e)},n.oncomplete=function(t){e(t.target.result)}}))},e.crypto=Object.create(v,{getRandomValues:{value:function(e){return v.getRandomValues(e)}},subtle:{value:b}}),e.CryptoKey=h}w&&(v.subtle=b,e.Crypto=g,e.SubtleCrypto=y,e.CryptoKey=h)}}}}))}));var Jw=qa("match"),Lj=function(e){var t;return ha(e)&&(void 0!==(t=e[Jw])?!!t:"RegExp"==Zb(e))},Kw=[].push,Lw=Math.min;dh("split",2,(function(e,t,n){var r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||1<".".split(/()()/).length||"".split(/.?/).length?function(e,n){var r=String(jb(this));if(0===(n=void 0===n?4294967295:n>>>0))return[];if(void 0===e)return[r];if(!Lj(e))return t.call(r,e,n);var i,o,a,s=[],u=0;for(e=new RegExp(e.source,(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":"")+"g");(i=Of.call(e,r))&&!((o=e.lastIndex)>u&&(s.push(r.slice(u,i.index)),1<i.length&&i.index<r.length&&Kw.apply(s,i.slice(1)),a=i[0].length,u=o,s.length>=n));)e.lastIndex===i.index&&e.lastIndex++;return u===r.length?(a||!e.test(""))&&s.push(""):s.push(r.slice(u)),s.length>n?s.slice(0,n):s}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t;return[function(t,n){var i=jb(this),o=null==t?void 0:t[e];return void 0!==o?o.call(t,i,n):r.call(String(i),t,n)},function(e,i){var o=n(r,e,this,i,r!==t);if(o.done)return o.value;var a=va(e);e=String(this);var s=kd(a,RegExp);if(o=a.unicode,a=new s(pc?"^(?:"+a.source+")":a,(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(pc?"g":"y")),0===(i=void 0===i?4294967295:i>>>0))return[];if(0===e.length)return null===Ke(a,e)?[e]:[];var u=0,c=0;for(s=[];c<e.length;){a.lastIndex=pc?0:c;var l,f=Ke(a,pc?e.slice(c):e);if(null===f||(l=Lw(ta(a.lastIndex+(pc?c:0)),e.length))===u)c=xj(e,c,o);else{if(s.push(e.slice(u,c)),s.length===i)return s;for(u=1;u<=f.length-1;u++)if(s.push(f[u]),s.length===i)return s;c=u=l}}return s.push(e.slice(u)),s}]}),pc),function(e){e.console||(e.console={}),e=e.console;for(var t,n=function(){},r=["memory"],i="assert clear count debug dir dirxml error exception group groupCollapsed groupEnd info log markTimeline profile profiles profileEnd show table time timeEnd timeline timelineEnd timeStamp trace warn".split(" ");t=r.pop();)e[t]||(e[t]={});for(;t=i.pop();)e[t]||(e[t]=n)}("undefined"==typeof window?Ya:window),N({target:"Object",stat:!0},{setPrototypeOf:Ua});var Mw=R((function(){Vb(1)}));N({target:"Object",stat:!0,forced:Mw,sham:!Hn},{getPrototypeOf:function(e){return Vb(Qa(e))}});var ep=[].slice,Mj={},Nw=Function.bind||function(e){var t=yb(this),n=ep.call(arguments,1),r=function(){var i=n.concat(ep.call(arguments));if(this instanceof r){var o=i.length;if(!(o in Mj)){for(var a=[],s=0;s<o;s++)a[s]="a["+s+"]";Mj[o]=Function("C,a","return new C("+a.join(",")+")")}i=Mj[o](t,i)}else i=t.apply(e,i);return i};return ha(t.prototype)&&(r.prototype=t.prototype),r},Nj=mc("Reflect","construct"),fp=R((function(){function e(){}return!(Nj((function(){}),[],e)instanceof e)})),gp=!R((function(){Nj((function(){}))})),hp=fp||gp;N({target:"Reflect",stat:!0,forced:hp,sham:hp},{construct:function(e,t){yb(e),va(t);var n=3>arguments.length?e:yb(arguments[2]);if(gp&&!fp)return Nj(e,t,n);if(e==n){switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3])}return(n=[null]).push.apply(n,t),new(Nw.apply(e,n))}n=n.prototype,n=ac(ha(n)?n:Object.prototype);var r=Function.apply.call(e,n,t);return ha(r)?r:n}}),N({target:"Reflect",stat:!0},{get:wl});var ip=Fb.f,Ow=R((function(){ip(1)}));N({target:"Object",stat:!0,forced:!ka||Ow,sham:!ka},{getOwnPropertyDescriptor:function(e,t){return ip(qb(e),t)}});var jp=Hd.f,Pw={}.toString,kp="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Oj=function(e){if(kp&&"[object Window]"==Pw.call(e))try{var t=jp(e)}catch(e){t=kp.slice()}else t=jp(qb(e));return t},lp={f:qa},Qw=Ra.f,ph=function(e){var t=y.Symbol||(y.Symbol={});Q(t,e)||Qw(t,e,{value:lp.f(e)})},rb=Pg("hidden"),mp=qa("toPrimitive"),Rw=Za.set,np=Za.getterFor("Symbol"),Ob=Object.prototype,sb=y.Symbol,Tf=mc("JSON","stringify"),op=Fb.f,od=Ra.f,pp=Oj,Sw=zf,Lc=fd("symbols"),Uf=fd("op-symbols"),Pj=fd("string-to-symbol-registry"),Qj=fd("symbol-to-string-registry"),Tw=fd("wks"),Rj=y.QObject,Sj=!Rj||!Rj.prototype||!Rj.prototype.findChild,Tj=ka&&R((function(){return 7!=ac(od({},"a",{get:function(){return od(this,"a",{value:7}).a}})).a}))?function(e,t,n){var r=op(Ob,t);r&&delete Ob[t],od(e,t,n),r&&e!==Ob&&od(Ob,t,r)}:od,Uj=function(e,t){var n=Lc[e]=ac(sb.prototype);return Rw(n,{type:"Symbol",tag:e,description:t}),ka||(n.description=t),n},Vj=vn?function(e){return"symbol"==typeof e}:function(e){return Object(e)instanceof sb},qh=function(e,t,n){return e===Ob&&qh(Uf,t,n),va(e),t=lc(t,!0),va(n),Q(Lc,t)?(n.enumerable?(Q(e,rb)&&e[rb][t]&&(e[rb][t]=!1),n=ac(n,{enumerable:dd(0,!1)})):(Q(e,rb)||od(e,rb,dd(1,{})),e[rb][t]=!0),Tj(e,t,n)):od(e,t,n)},qp=function(e,t){va(e);var n=qb(t);return t=Dc(n).concat(Wj(n)),Jd(t,(function(t){ka&&!Xj.call(n,t)||qh(e,t,n[t])})),e},Xj=function(e){e=lc(e,!0);var t=Sw.call(this,e);return!(this===Ob&&Q(Lc,e)&&!Q(Uf,e))&&(!(t||!Q(this,e)||!Q(Lc,e)||Q(this,rb)&&this[rb][e])||t)},rp=function(e,t){if(e=qb(e),t=lc(t,!0),e!==Ob||!Q(Lc,t)||Q(Uf,t)){var n=op(e,t);return!n||!Q(Lc,t)||Q(e,rb)&&e[rb][t]||(n.enumerable=!0),n}},sp=function(e){e=pp(qb(e));var t=[];return Jd(e,(function(e){Q(Lc,e)||Q(Be,e)||t.push(e)})),t},Wj=function(e){var t=e===Ob;e=pp(t?Uf:qb(e));var n=[];return Jd(e,(function(e){!Q(Lc,e)||t&&!Q(Ob,e)||n.push(Lc[e])})),n};if(oc||(sb=function(){if(this instanceof sb)throw TypeError("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,t=Ae(e),n=function(e){this===Ob&&n.call(Uf,e),Q(this,rb)&&Q(this[rb],t)&&(this[rb][t]=!1),Tj(this,t,dd(1,e))};return ka&&Sj&&Tj(Ob,t,{configurable:!0,set:n}),Uj(t,e)},Ta(sb.prototype,"toString",(function(){return np(this).tag})),Ta(sb,"withoutSetter",(function(e){return Uj(Ae(e),e)})),zf=Xj,Ra.f=qh,Fb.f=rp,Hd.f=Oj=sp,Bf.f=Wj,lp.f=function(e){return Uj(qa(e),e)},ka&&(od(sb.prototype,"description",{configurable:!0,get:function(){return np(this).description}}),Ta(Ob,"propertyIsEnumerable",Xj,{unsafe:!0}))),N({global:!0,wrap:!0,forced:!oc,sham:!oc},{Symbol:sb}),Jd(Dc(Tw),(function(e){ph(e)})),N({target:"Symbol",stat:!0,forced:!oc},{for:function(e){if(e=String(e),Q(Pj,e))return Pj[e];var t=sb(e);return Pj[e]=t,Qj[t]=e,t},keyFor:function(e){if(!Vj(e))throw TypeError(e+" is not a symbol");if(Q(Qj,e))return Qj[e]},useSetter:function(){Sj=!0},useSimple:function(){Sj=!1}}),N({target:"Object",stat:!0,forced:!oc,sham:!ka},{create:function(e,t){return void 0===t?ac(e):qp(ac(e),t)},defineProperty:qh,defineProperties:qp,getOwnPropertyDescriptor:rp}),N({target:"Object",stat:!0,forced:!oc},{getOwnPropertyNames:sp,getOwnPropertySymbols:Wj}),N({target:"Object",stat:!0,forced:R((function(){Bf.f(1)}))},{getOwnPropertySymbols:function(e){return Bf.f(Qa(e))}}),Tf){var Uw=!oc||R((function(){var e=sb();return"[null]"!=Tf([e])||"{}"!=Tf({a:e})||"{}"!=Tf(Object(e))}));N({target:"JSON",stat:!0,forced:Uw},{stringify:function(e,t,n){for(var r,i=[e],o=1;arguments.length>o;)i.push(arguments[o++]);if(r=t,(ha(t)||void 0!==e)&&!Vj(e))return gd(t)||(t=function(e,t){if("function"==typeof r&&(t=r.call(this,e,t)),!Vj(t))return t}),i[1]=t,Tf.apply(null,i)}})}sb.prototype[mp]||Na(sb.prototype,mp,sb.prototype.valueOf),Ec(sb,"Symbol"),Be[rb]=!0;var Vw=Ra.f,Mc=y.Symbol;if(ka&&"function"==typeof Mc&&(!("description"in Mc.prototype)||void 0!==Mc().description)){var tp={},Vf=function(){var e=1>arguments.length||void 0===arguments[0]?void 0:String(arguments[0]),t=this instanceof Vf?new Mc(e):void 0===e?Mc():Mc(e);return""===e&&(tp[t]=!0),t};rn(Vf,Mc);var Yj=Vf.prototype=Mc.prototype;Yj.constructor=Vf;var Ww=Yj.toString,Xw="Symbol(test)"==String(Mc("test")),Yw=/^Symbol\((.*)\)[^)]+$/;Vw(Yj,"description",{configurable:!0,get:function(){var e=ha(this)?this.valueOf():this,t=Ww.call(e);return Q(tp,e)?"":""===(e=Xw?t.slice(7,-1):t.replace(Yw,"$1"))?void 0:e}}),N({global:!0,forced:!0},{Symbol:Vf})}ph("toStringTag"),Ec(y.JSON,"JSON",!0),Ec(Math,"Math",!0),function(){function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function n(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,t){return(o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n=i(e);if(t){var r=i(this).constructor;n=Reflect.construct(n,arguments,r)}else n=n.apply(this,arguments);return n=!n||"object"!==X(n)&&"function"!=typeof n?a(this):n}}function u(e,t,n){return(u="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=i(e)););if(e)return(t=Object.getOwnPropertyDescriptor(e,t)).get?t.get.call(n):t.value})(e,t,n||e)}var c=function(){function t(){e(this,t),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(t,[{key:"addEventListener",value:function(e,t,n){e in this.listeners||(this.listeners[e]=[]),this.listeners[e].push({callback:t,options:n})}},{key:"removeEventListener",value:function(e,t){if(e in this.listeners)for(var n=0,r=(e=this.listeners[e]).length;n<r;n++)if(e[n].callback===t){e.splice(n,1);break}}},{key:"dispatchEvent",value:function(e){if(e.type in this.listeners){for(var t=this.listeners[e.type].slice(),n=0,r=t.length;n<r;n++){var i=t[n];try{i.callback.call(this,e)}catch(e){Promise.resolve().then((function(){throw e}))}i.options&&i.options.once&&this.removeEventListener(e.type,i.callback)}return!e.defaultPrevented}}}]),t}(),l=function(t){function o(){e(this,o);var t=l.call(this);return t.listeners||c.call(a(t)),Object.defineProperty(a(t),"aborted",{value:!1,writable:!0,configurable:!0}),Object.defineProperty(a(t),"onabort",{value:null,writable:!0,configurable:!0}),t}r(o,t);var l=s(o);return n(o,[{key:"toString",value:function(){return"[object AbortSignal]"}},{key:"dispatchEvent",value:function(e){"abort"===e.type&&(this.aborted=!0,"function"==typeof this.onabort&&this.onabort.call(this,e)),u(i(o.prototype),"dispatchEvent",this).call(this,e)}}]),o}(c),f=function(){function t(){e(this,t),Object.defineProperty(this,"signal",{value:new l,writable:!0,configurable:!0})}return n(t,[{key:"abort",value:function(){try{var e=new Event("abort")}catch(t){"undefined"!=typeof document?document.createEvent?(e=document.createEvent("Event")).initEvent("abort",!1,!1):(e=document.createEventObject()).type="abort":e={type:"abort",bubbles:!1,cancelable:!1}}this.signal.dispatchEvent(e)}},{key:"toString",value:function(){return"[object AbortController]"}}]),t}();"undefined"!=typeof Symbol&&Symbol.toStringTag&&(f.prototype[Symbol.toStringTag]="AbortController",l.prototype[Symbol.toStringTag]="AbortSignal"),function(e){if(e.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL){console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill");var t=!0}else t="function"==typeof e.Request&&!e.Request.prototype.hasOwnProperty("signal")||!e.AbortController;t&&(e.AbortController=f,e.AbortSignal=l)}("undefined"!=typeof self?self:Ya)}();var Zw=Math.floor,$w=Math.log,ax=Math.LOG2E;N({target:"Math",stat:!0},{clz32:function(e){return(e>>>=0)?31-Zw($w(e+.5)*ax):32}});var bx=Math.log,cx=Math.LN2,ss=Math.clz32||function(e){return 31-bx(e>>>0)/cx|0},xd=String.fromCharCode,up={}.toString,Zj=window.Uint8Array,ak=Zj||Array,dx=up.call((window.ArrayBuffer||ak).prototype),bk;xl.prototype.decode=function(e){if(e=e&&e.buffer||e,up.call(e)!==dx)throw Error("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");for(var t="",n=0,r=0|(e=Zj?new ak(e):e).length;n<r;n=n+32768|0)t+=xd.apply(0,e[Zj?"slice":"subarray"](n,n+32768|0));return t.replace(/[\xc0-\xff][\x80-\xbf]*/g,rs)},window.TextDecoder||(window.TextDecoder=xl),yl.prototype.encode=function(e){for(var t=0|(e=void 0===e?"":(""+e).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,ts)).length,n=new ak(t),r=0;r<t;r=r+1|0)n[r]=e.charCodeAt(r);return n},window.TextEncoder||(window.TextEncoder=yl),function(e){var t,n,r,i,o,a,s,u,c,l,f;!function(e){e.LOGIN="LOGIN",e.LOGIN_SUCCESS="LOGIN_SUCCESS",e.LOGIN_FAILURE="LOGIN_FAILURE",e.LOGIN_TIMEOUT="LOGIN_TIMEOUT",e.INTERRUPTED="INTERRUPTED",e.LOGOUT="LOGOUT",e.BANNED_BY_SERVER="BANNED_BY_SERVER",e.REMOTE_LOGIN="REMOTE_LOGIN"}(t||(t={})),e.ConnectionChangeReason=t,function(e){e.DISCONNECTED="DISCONNECTED",e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.RECONNECTING="RECONNECTING",e.ABORTED="ABORTED"}(n||(n={})),e.ConnectionState=n,function(e){e.IDLE="IDLE",e.SENT_TO_REMOTE="SENT_TO_REMOTE",e.RECEIVED_BY_REMOTE="RECEIVED_BY_REMOTE",e.ACCEPTED_BY_REMOTE="ACCEPTED_BY_REMOTE",e.REFUSED_BY_REMOTE="REFUSED_BY_REMOTE",e.CANCELED="CANCELED",e.FAILURE="FAILURE"}(r||(r={})),e.LocalInvitationState=r,function(e){e.INVITATION_RECEIVED="INVITATION_RECEIVED",e.ACCEPT_SENT_TO_LOCAL="ACCEPT_SENT_TO_LOCAL",e.REFUSED="REFUSED",e.ACCEPTED="ACCEPTED",e.CANCELED="CANCELED",e.FAILURE="FAILURE"}(i||(i={})),e.RemoteInvitationState=i,function(e){e.UNKNOWN="UNKNOWN",e.PEER_NO_RESPONSE="PEER_NO_RESPONSE",e.INVITATION_EXPIRE="INVITATION_EXPIRE",e.PEER_OFFLINE="PEER_OFFLINE",e.NOT_LOGGEDIN="NOT_LOGGEDIN"}(o||(o={})),e.LocalInvitationFailureReason=o,function(e){e.UNKNOWN="UNKNOWN",e.PEER_OFFLINE="PEER_OFFLINE",e.ACCEPT_FAILURE="ACCEPT_FAILURE",e.INVITATION_EXPIRE="INVITATION_EXPIRE"}(a||(a={})),e.RemoteInvitationFailureReason=a,function(e){e.ONLINE="ONLINE",e.UNREACHABLE="UNREACHABLE",e.OFFLINE="OFFLINE"}(s||(s={})),e.PeerOnlineState=s,(u||(u={})).ONLINE_STATUS="ONLINE_STATUS",e.PeerSubscriptionOption=u,function(e){e.TEXT="TEXT",e.RAW="RAW",e.IMAGE="IMAGE",e.FILE="FILE"}(c||(c={})),e.MessageType=c,function(e){e.CN="CN",e.NA="NA",e.EU="EU",e.AS="AS",e.JP="JP",e.IN="IN",e.GLOB="GLOB",e.OC="OC",e.SA="SA",e.AF="AF",e.OVS="OVS"}(l||(l={})),e.LegacyAreaCode=l,function(e){e.GLOBAL="GLOBAL",e.INDIA="INDIA",e.JAPAN="JAPAN",e.ASIA="ASIA",e.EUROPE="EUROPE",e.CHINA="CHINA",e.NORTH_AMERICA="NORTH_AMERICA"}(f||(f={})),e.AreaCode=f}(bk||(bk={}));var S=bk;N({target:"Array",proto:!0},{includes:function(e){return on(this,e,1<arguments.length?arguments[1]:void 0)}}),Ld("includes");var ck=function(e){if(Lj(e))throw TypeError("The method doesn't accept regular expressions");return e},ex=qa("match"),dk=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[ex]=!1,"/./"[e](t)}catch(e){}}return!1};N({target:"String",proto:!0,forced:!dk("includes")},{includes:function(e){return!!~String(jb(this)).indexOf(ck(e),1<arguments.length?arguments[1]:void 0)}});var Nc={RECONNECTING_AP_INTERVAL:2500,RECONNECTING_AP_NUM:2,DISABLE_MESSAGE_COMPRESSION:!1,LOG_UPLOAD_INTERVAL:3e3,LOG_HANDLER:void 0};ph("iterator"),ph("asyncIterator");var ek=Ee("forEach")?[].forEach:function(e){return Jd(this,e,1<arguments.length?arguments[1]:void 0)},vp;for(vp in Ij){var wp=y[vp],rh=wp&&wp.prototype;if(rh&&rh.forEach!==ek)try{Na(rh,"forEach",ek)}catch(c){rh.forEach=ek}}var fx=[].reverse,xp=[1,2];N({target:"Array",proto:!0,forced:String(xp)===String(xp.reverse())},{reverse:function(){return gd(this)&&(this.length=this.length),fx.call(this)}});var w=$a((function(e){e=function(e){function t(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}function n(e,t,n,o){return t=Object.create((t&&t.prototype instanceof i?t:i).prototype),o=new h(o||[]),t._invoke=function(e,t,n){var i=_;return function(o,a){if(i===I)throw Error("Generator is already running");if(i===A){if("throw"===o)throw a;return d()}for(n.method=o,n.arg=a;;){if((o=n.delegate)&&(o=c(o,n))){if(o===k)continue;return o}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===_)throw i=A,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);if(i=I,"normal"===(o=r(e,t,n)).type){if(i=n.done?A:O,o.arg===k)continue;return{value:o.arg,done:n.done}}"throw"===o.type&&(i=A,n.method="throw",n.arg=o.arg)}}}(e,n,o),t}function r(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}function i(){}function o(){}function a(){}function s(e){["next","throw","return"].forEach((function(n){t(e,n,(function(e){return this._invoke(n,e)}))}))}function u(e,t){function n(i,o,a,s){if("throw"!==(i=r(e[i],e,o)).type){var u=i.arg;return(i=u.value)&&"object"===X(i)&&g.call(i,"__await")?t.resolve(i.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(i).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(i.arg)}var i;this._invoke=function(e,r){function o(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(o,o):o()}}function c(e,t){var n=e.iterator[t.method];if(n===v){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=v,c(e,t),"throw"===t.method))return k;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return k}return"throw"===(n=r(n,e.iterator,t.arg)).type?(t.method="throw",t.arg=n.arg,t.delegate=null,k):(n=n.arg)?n.done?(t[e.resultName]=n.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=v),t.delegate=null,k):n:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,k)}function l(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function f(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function h(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(l,this),this.reset(!0)}function p(e){if(e){var t=e[m];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1;return(t=function t(){for(;++n<e.length;)if(g.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=v,t.done=!0,t}).next=t}}return{next:d}}function d(){return{value:v,done:!0}}var v,b=Object.prototype,g=b.hasOwnProperty,y="function"==typeof Symbol?Symbol:{},m=y.iterator||"@@iterator",E=y.asyncIterator||"@@asyncIterator",w=y.toStringTag||"@@toStringTag";try{t({},"")}catch(e){t=function(e,t,n){return e[t]=n}}e.wrap=n;var _="suspendedStart",O="suspendedYield",I="executing",A="completed",k={};t(y={},m,(function(){return this}));var R=Object.getPrototypeOf;(R=R&&R(R(p([]))))&&R!==b&&g.call(R,m)&&(y=R);var T=a.prototype=i.prototype=Object.create(y);return o.prototype=a,t(T,"constructor",a),t(a,"constructor",o),o.displayName=t(a,w,"GeneratorFunction"),e.isGeneratorFunction=function(e){return!!(e="function"==typeof e&&e.constructor)&&(e===o||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,a):(e.__proto__=a,t(e,w,"GeneratorFunction")),e.prototype=Object.create(T),e},e.awrap=function(e){return{__await:e}},s(u.prototype),t(u.prototype,E,(function(){return this})),e.AsyncIterator=u,e.async=function(t,r,i,o,a){void 0===a&&(a=Promise);var s=new u(n(t,r,i,o),a);return e.isGeneratorFunction(r)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},s(T),t(T,w,"Generator"),t(T,m,(function(){return this})),t(T,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t,n=[];for(t in e)n.push(t);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=p,h.prototype={constructor:h,reset:function(e){if(this.next=this.prev=0,this.sent=this._sent=v,this.done=!1,this.delegate=null,this.method="next",this.arg=v,this.tryEntries.forEach(f),!e)for(var t in this)"t"===t.charAt(0)&&g.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=v)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){function t(t,r){return o.type="throw",o.arg=e,n.next=t,r&&(n.method="next",n.arg=v),!!r}if(this.done)throw e;for(var n=this,r=this.tryEntries.length-1;0<=r;--r){var i=this.tryEntries[r],o=i.completion;if("root"===i.tryLoc)return t("end");if(i.tryLoc<=this.prev){var a=g.call(i,"catchLoc"),s=g.call(i,"finallyLoc");if(a&&s){if(this.prev<i.catchLoc)return t(i.catchLoc,!0);if(this.prev<i.finallyLoc)return t(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return t(i.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return t(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&g.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var i=r;break}}return i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null),(n=i?i.completion:{}).type=e,n.arg=t,i?(this.method="next",this.next=i.finallyLoc,k):this.complete(n)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),k},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),f(n),k}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.tryLoc===e){if("throw"===(e=n.completion).type){var r=e.arg;f(n)}return r}}throw Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:p(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=v),k}},e}(e.exports);try{regeneratorRuntime=e}catch(t){"object"===("undefined"==typeof globalThis?"undefined":X(globalThis))?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}})),yp=!R((function(){return Object.isExtensible(Object.preventExtensions({}))})),fk=$a((function(e){var t=Ra.f,n=Ae("meta"),r=0,i=Object.isExtensible||function(){return!0},o=function(e){t(e,n,{value:{objectID:"O"+ ++r,weakData:{}}})},a=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!ha(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Q(e,n)){if(!i(e))return"F";if(!t)return"E";o(e)}return e[n].objectID},getWeakData:function(e,t){if(!Q(e,n)){if(!i(e))return!0;if(!t)return!1;o(e)}return e[n].weakData},onFreeze:function(e){return yp&&a.REQUIRED&&i(e)&&!Q(e,n)&&o(e),e}};Be[n]=!0})),zp=function(e,t,n){var r=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=r?"set":"add",a=y[e],s=a&&a.prototype,u=a,c={},l=function(e){var t=s[e];Ta(s,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!ha(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return i&&!ha(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!ha(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(nc(e,"function"!=typeof a||!(i||s.forEach&&!R((function(){(new a).entries().next()})))))u=n.getConstructor(t,e,r,o),fk.REQUIRED=!0;else if(nc(e,!0)){var f=new u,h=f[o](i?{}:-0,1)!=f,p=R((function(){f.has(1)})),d=Tg((function(e){new a(e)})),v=!i&&R((function(){for(var e=new a,t=5;t--;)e[o](t,t);return!e.has(-0)}));d||((u=t((function(t,n){return Gc(t,u,e),t=lh(new a,t,u),null!=n&&Xg(n,t[o],{that:t,AS_ENTRIES:r}),t}))).prototype=s,s.constructor=u),(p||v)&&(l("delete"),l("has"),r&&l("get")),(v||h)&&l(o),i&&s.clear&&delete s.clear}return c[e]=u,N({global:!0,forced:u!=a},c),Ec(u,e),i||n.setStrong(u,e,r),u},gx=Ra.f,Ap=fk.fastKey,Bp=Za.set,gk=Za.getterFor,Cp={getConstructor:function(e,t,n,r){var i=e((function(e,o){Gc(e,i,t),Bp(e,{type:t,index:ac(null),first:void 0,last:void 0,size:0}),ka||(e.size=0),null!=o&&Xg(o,e[r],{that:e,AS_ENTRIES:n})})),o=gk(t),a=function(e,t,n){var r,i=o(e),a=s(e,t);return a?a.value=n:(i.last=a={index:r=Ap(t,!0),key:t,value:n,previous:t=i.last,next:void 0,removed:!1},i.first||(i.first=a),t&&(t.next=a),ka?i.size++:e.size++,"F"!==r&&(i.index[r]=a)),e},s=function(e,t){e=o(e);var n=Ap(t);if("F"!==n)return e.index[n];for(e=e.first;e;e=e.next)if(e.key==t)return e};return Hf(i.prototype,{clear:function(){for(var e=o(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,ka?e.size=0:this.size=0},delete:function(e){var t=o(this);if(e=s(this,e)){var n=e.next,r=e.previous;delete t.index[e.index],e.removed=!0,r&&(r.next=n),n&&(n.previous=r),t.first==e&&(t.first=n),t.last==e&&(t.last=r),ka?t.size--:this.size--}return!!e},forEach:function(e){for(var t,n=o(this),r=Id(e,1<arguments.length?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),Hf(i.prototype,n?{get:function(e){return(e=s(this,e))&&e.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),ka&&gx(i.prototype,"size",{get:function(){return o(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=gk(t),o=gk(r);bj(e,t,(function(e,t){Bp(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),If(t)}};zp("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Cp);var hx=/^[\t\n\x0B\f\r \u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff][\t\n\x0B\f\r \u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff]*/,ix=/[\t\n\x0B\f\r \u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff][\t\n\x0B\f\r \u00a0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff]*$/,hk=function(e){return function(t){return t=String(jb(t)),1&e&&(t=t.replace(hx,"")),2&e&&(t=t.replace(ix,"")),t}};hk(1),hk(2);var ik=hk(3),sh=y.parseInt,jx=/^[+-]?0[Xx]/,Dp=8!==sh("\t\n\v\f\r \u2028\u2029\ufeff08")||22!==sh("\t\n\v\f\r \u2028\u2029\ufeff0x16")?function(e,t){return e=ik(String(e)),sh(e,t>>>0||(jx.test(e)?16:10))}:sh;N({global:!0,forced:parseInt!=Dp},{parseInt:Dp});var kx=Hd.f,lx=Fb.f,mx=Ra.f,pd=y.Number,th=pd.prototype,nx="Number"==Zb(ac(th)),Ep=function(e){var t,n=lc(e,!1);if("string"==typeof n&&2<n.length)if(43===(e=(n=ik(n)).charCodeAt(0))||45===e){if(88===(e=n.charCodeAt(2))||120===e)return NaN}else if(48===e){switch(n.charCodeAt(1)){case 66:case 98:e=2;var r=49;break;case 79:case 111:e=8,r=55;break;default:return+n}var i=(n=n.slice(2)).length;for(t=0;t<i;t++){var o=n.charCodeAt(t);if(48>o||o>r)return NaN}return parseInt(n,e)}return+n};if(nc("Number",!pd(" 0o1")||!pd("0b1")||pd("+0x1"))){for(var Pd=function(e){var t=1>arguments.length?0:e,n=this;return n instanceof Pd&&(nx?R((function(){th.valueOf.call(n)})):"Number"!=Zb(n))?lh(new pd(Ep(t)),n,Pd):Ep(t)},Fp=ka?kx(pd):"MAX_VALUE MIN_VALUE NaN NEGATIVE_INFINITY POSITIVE_INFINITY EPSILON isFinite isInteger isNaN isSafeInteger MAX_SAFE_INTEGER MIN_SAFE_INTEGER parseFloat parseInt isInteger fromString range".split(" "),jk=0,uh;Fp.length>jk;jk++)Q(pd,uh=Fp[jk])&&!Q(Pd,uh)&&mx(Pd,uh,lx(pd,uh));Pd.prototype=th,th.constructor=Pd,Ta(y,"Number",Pd)}var Gp=qa("isConcatSpreadable"),ox=51<=id||!R((function(){var e=[];return e[Gp]=!1,e.concat()[0]!==e})),px=Ef("concat");N({target:"Array",proto:!0,forced:!ox||!px},{concat:function(e){var t,n=Qa(this),r=Sg(n,0),i=0,o=-1;for(t=arguments.length;o<t;o++){var a=-1===o?n:arguments[o],s=a;if(ha(s)){var u=s[Gp];s=void 0!==u?!!u:gd(s)}else s=!1;if(s){if(9007199254740991<i+(u=ta(a.length)))throw TypeError("Maximum allowed index exceeded");for(s=0;s<u;s++,i++)s in a&&Ge(r,i,a[s])}else{if(9007199254740991<=i)throw TypeError("Maximum allowed index exceeded");Ge(r,i++,a)}}return r.length=i,r}});var kk=mc("Reflect","apply"),qx=Function.apply,rx=!R((function(){kk((function(){}))}));N({target:"Reflect",stat:!0,forced:rx},{apply:function(e,t,n){return yb(e),va(n),kk?kk(e,t,n):qx.call(e,t,n)}}),N({target:"Reflect",stat:!0},{ownKeys:qn});var sx=Oj,tx=R((function(){return!Object.getOwnPropertyNames(1)}));N({target:"Object",stat:!0,forced:tx},{getOwnPropertyNames:sx});var Pe="object"===("undefined"==typeof Reflect?"undefined":X(Reflect))?Reflect:null,Hp=Pe&&"function"==typeof Pe.apply?Pe.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},ux=Pe&&"function"==typeof Pe.ownKeys?Pe.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)},Ip=Number.isNaN||function(e){return e!=e};ea.EventEmitter=ea,ea.prototype._events=void 0,ea.prototype._eventsCount=0,ea.prototype._maxListeners=void 0;var Jp=10;Object.defineProperty(ea,"defaultMaxListeners",{enumerable:!0,get:function(){return Jp},set:function(e){if("number"!=typeof e||0>e||Ip(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Jp=e}}),ea.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ea.prototype.setMaxListeners=function(e){if("number"!=typeof e||0>e||Ip(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},ea.prototype.getMaxListeners=function(){return void 0===this._maxListeners?ea.defaultMaxListeners:this._maxListeners},ea.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);n="error"===e;var r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var i;if(0<t.length&&(i=t[0]),i instanceof Error)throw i;throw(t=Error("Unhandled error."+(i?" ("+i.message+")":""))).context=i,t}if(void 0===(n=r[e]))return!1;if("function"==typeof n)Hp(n,this,t);else for(r=Cl(n,i=n.length),n=0;n<i;++n)Hp(r[n],this,t);return!0},ea.prototype.addListener=function(e,t){return zl(this,e,t,!1)},ea.prototype.on=ea.prototype.addListener,ea.prototype.prependListener=function(e,t){return zl(this,e,t,!0)},ea.prototype.once=function(e,t){return ng(t),this.on(e,Al(this,e,t)),this},ea.prototype.prependOnceListener=function(e,t){return ng(t),this.prependListener(e,Al(this,e,t)),this},ea.prototype.removeListener=function(e,t){var n;ng(t);var r=this._events;if(void 0===r)return this;var i=r[e];if(void 0===i)return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){var o=-1;for(n=i.length-1;0<=n;n--)if(i[n]===t||i[n].listener===t){var a=i[n].listener;o=n;break}if(0>o)return this;if(0===o)i.shift();else{for(;o+1<i.length;o++)i[o]=i[o+1];i.pop()}1===i.length&&(r[e]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",e,a||t)}return this},ea.prototype.off=ea.prototype.removeListener,ea.prototype.removeAllListeners=function(e){var t=this._events;if(void 0===t)return this;if(void 0===t.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==t[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete t[e]),this;if(0===arguments.length){var n=Object.keys(t);for(t=0;t<n.length;++t){var r=n[t];"removeListener"!==r&&this.removeAllListeners(r)}return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(n=t[e]))this.removeListener(e,n);else if(void 0!==n)for(t=n.length-1;0<=t;t--)this.removeListener(e,n[t]);return this},ea.prototype.listeners=function(e){return Bl(this,e,!0)},ea.prototype.rawListeners=function(e){return Bl(this,e,!1)},ea.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):Dl.call(e,t)},ea.prototype.listenerCount=Dl,ea.prototype.eventNames=function(){return 0<this._eventsCount?ux(this._events):[]},ea.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}El(e,t,o,{once:!0}),"error"!==t&&vs(e,i,{once:!0})}))};var Qe=Object.assign,Kp=Object.defineProperty,Lp=!Qe||R((function(){if(ka&&1!==Qe({b:1},Qe(Kp({},"a",{enumerable:!0,get:function(){Kp(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=Qe({},e)[n]||"abcdefghijklmnopqrst"!=Dc(Qe({},t)).join("")}))?function(e,t){for(var n=Qa(e),r=arguments.length,i=1,o=Bf.f,a=zf;r>i;)for(var s,u=Af(arguments[i++]),c=o?Dc(u).concat(o(u)):Dc(u),l=c.length,f=0;l>f;)s=c[f++],(!ka||a.call(u,s))&&(n[s]=u[s]);return n}:Qe;N({target:"Object",stat:!0,forced:Object.assign!==Lp},{assign:Lp}),zp("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),Cp);var vx=Math.log,wx=Math.LN2;N({target:"Math",stat:!0},{log2:function(e){return vx(e)/wx}});var xx=Ra.f,yx=Hd.f,zx=Za.enforce,Ax=qa("match"),sc=y.RegExp,lk=sc.prototype,Wf=/a/g,mk=/a/g,nk=new sc(Wf)!==Wf;if(ka&&nc("RegExp",!nk||pc||R((function(){return mk[Ax]=!1,sc(Wf)!=Wf||sc(mk)==mk||"/a/i"!=sc(Wf,"i")})))){for(var Oc=function(e,t){var n,r=this instanceof Oc,i=Lj(e),o=void 0===t;return!r&&i&&e.constructor===Oc&&o||(nk?i&&!o&&(e=e.source):e instanceof Oc&&(o&&(t=tj.call(e)),e=e.source),pc&&(n=!!t&&-1<t.indexOf("y"))&&(t=t.replace(/y/g,"")),e=lh(nk?new sc(e,t):sc(e,t),r?this:lk,Oc),pc&&n&&(zx(e).sticky=!0)),e},Bx=function(e){e in Oc||xx(Oc,e,{configurable:!0,get:function(){return sc[e]},set:function(t){sc[e]=t}})},Mp=yx(sc),Np=0;Mp.length>Np;)Bx(Mp[Np++]);lk.constructor=Oc,Oc.prototype=lk,Ta(y,"RegExp",Oc)}If("RegExp"),Sf("Float32",(function(e){return function(t,n,r){return e(this,t,n,r)}})),Sf("Float64",(function(e){return function(t,n,r){return e(this,t,n,r)}})),Sf("Uint32",(function(e){return function(t,n,r){return e(this,t,n,r)}})),Sf("Uint16",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var ok=function(e,t){return e===t?0:null==e?null==t?0:-1:null==t?null==e?0:1:"function"==typeof e.compare?e.compare(t):"function"==typeof t.compare?-t.compare(e):e<t?-1:e>t?1:0},pk=[],Op=pk.sort,Cx=R((function(){pk.sort(void 0)})),Dx=R((function(){pk.sort(null)})),Ex=Ee("sort");N({target:"Array",proto:!0,forced:Cx||!Dx||!Ex},{sort:function(e){return void 0===e?Op.call(Qa(this)):Op.call(Qa(this),yb(e))}});var Pp=Object.getPrototypeOf({}),Xf=function(e,t){var n;return e===t||(null==e?e==t:"function"===X(e.equiv)?e.equiv(t):null==t?e==t:"function"===X(t.equiv)?t.equiv(e):"string"!==X(e)&&"string"!==X(t)&&(null!=(n=Object.getPrototypeOf(e))&&n!==Pp||null!=(n=Object.getPrototypeOf(t))&&n!==Pp?"function"!==X(e)&&void 0!==e.length&&"function"!==X(t)&&void 0!==t.length?Gx(e,t):e instanceof Set&&t instanceof Set?Hx(e,t):e instanceof Map&&t instanceof Map?Ix(e,t):e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():e instanceof RegExp&&t instanceof RegExp?e.toString()===t.toString():e!=e&&t!=t:Fx(e,t)))},Gx=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:Xf,r=e.length;if(r===t.length)for(;0<=--r&&n(e[r],t[r]););return 0>r},Hx=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:Xf;return e.size===t.size&&n(G(e.keys()).sort(),G(t.keys()).sort())},Ix=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:Xf;return e.size===t.size&&n(G(e).sort(),G(t).sort())},Fx=function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:Xf;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r in e)if(!t.hasOwnProperty(r)||!n(e[r],t[r]))return!1;return!0},Qp=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(e){return void 0!==e?": "+e:""};return function(n){function r(n){return W(this,r),i.call(this,e(n)+t(n))}la(r,n);var i=ma(r);return r}(ef(Error))},Jx=Qp((function(){return"illegal argument(s)"})),vh=function(e){throw new Jx(e)},qk=Qp((function(){return"index out of bounds"})),Rp=1/4294967295,Kx=function(){function e(){W(this,e)}return Ha(e,[{key:"float",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;return this.int()*Rp*e}},{key:"norm",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;return 2*(this.int()*Rp-.5)*e}},{key:"minmax",value:function(e,t){return this.float()*(t-e)+e}}]),e}(),rk=Math.random,Lx=new(function(e){function t(){return W(this,t),n.apply(this,arguments)}la(t,e);var n=ma(t);return Ha(t,[{key:"int",value:function(){return 4294967296*rk()>>>0}},{key:"float",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;return rk()*e}},{key:"norm",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1;return 2*(rk()-.5)*e}}]),t}(Kx)),Vh=Symbol(),Hl=function(){},Mx=fk.onFreeze,sk=Object.freeze,Nx=R((function(){sk(1)}));N({target:"Object",stat:!0,forced:Nx,sham:!yp},{freeze:function(e){return sk&&ha(e)?sk(Mx(e)):e}});var Ox=Ee("reduce"),Px=!Hc&&79<id&&83>id;N({target:"Array",proto:!0,forced:!Ox||Px},{reduce:function(e){return Wo(this,e,arguments.length,1<arguments.length?arguments[1]:void 0)}});var Gl=function(e){return null!=e&&"function"==typeof e.xform?e.xform():e},og=function(){function e(t){W(this,e),this.value=t}return Ha(e,[{key:"deref",value:function(){return this.value}}]),e}(),Wh=function(e){return e instanceof og?e.deref():e},xs=function(e,t){return[e,function(e){return e},t]},Qx=w.mark((function(e,t){var n,r,i,o,a,s;return w.wrap((function(u){for(;;)switch(u.prev=u.next){case 0:n=Gl(e)(ws()),r=n[1],i=n[2],o=0;case 4:if(!(o<t.length)){u.next=15;break}if(a=t[o],!((s=i([],a))instanceof og)){u.next=10;break}return u.delegateYield(Wh(r(s.deref())),"t0",9);case 9:return u.abrupt("return");case 10:if(!s.length){u.next=12;break}return u.delegateYield(s,"t1",12);case 12:o++,u.next=4;break;case 15:return u.delegateYield(Wh(r([])),"t2",16);case 16:case"end":return u.stop()}}),Qx)})),ys=w.mark(Fl),zs=function(e,t){return[e[0],e[1],t]},Sp=!0;"findIndex"in[]&&Array(1).findIndex((function(){Sp=!1})),N({target:"Array",proto:!0,forced:Sp},{findIndex:function(e){return An(this,e,1<arguments.length?arguments[1]:void 0)}}),Ld("findIndex"),N({target:"Array",proto:!0},{fill:yj}),Ld("fill");var Rx=function(){function e(t){W(this,e),this._length=0,t&&this.into(t)}return Ha(e,[{key:"length",get:function(){return this._length}},{key:"copy",value:function(){return new e(this)}},{key:"empty",value:function(){return new e}},{key:"clear",value:function(){this.release()}},{key:"release",value:function(){for(var e,t=this.head;t;)e=t.next,delete t.value,delete t.prev,delete t.next,t=e;return delete this.head,delete this.tail,this._length=0,!0}},{key:"compare",value:function(e){var t=this._length;if(t<e._length)return-1;if(t>e._length)return 1;if(0===t)return 0;t=this.head,e=e.head;for(var n=0;t&&0==n;)n=ok(t.value,e.value),t=t.next,e=e.next;return n}},{key:"equiv",value:function(t){if(!(t instanceof e||null!=t&&"function"!=typeof t&&void 0!==t.length)||this._length!==t.length)return!1;if(!this._length||this===t)return!0;for(var n=this.head,r=0;r<t.length;r++){if(!Xf(n.value,t[r]))return!1;n=n.next}return!0}},{key:Symbol.iterator,value:w.mark((function e(){var t;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this.head;case 1:if(!t){e.next=7;break}return e.next=4,t.value;case 4:t=t.next,e.next=1;break;case 7:case"end":return e.stop()}}),e,this)}))},{key:"seq",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.length;if(!(e>=t||0>e)){e=this.nthCell(e);var n=this.nthCell(t-1);return t=function e(t){return{first:function(){return t.value},next:function(){return t!==n&&t.next?e(t.next):void 0}}},e?t(e):void 0}}},{key:"cycle",value:w.mark((function e(){return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this,"t0",2);case 2:e.next=0;break;case 4:case"end":return e.stop()}}),e,this)}))},{key:"$reduce",value:function(e,t){for(var n=this.head;n&&!(t instanceof og);)t=e(t,n.value),n=n.next;return t}},{key:"drop",value:function(){var e=this.head;if(e)return(this.head=e.next)?delete this.head.prev:delete this.tail,this._length--,e.value}},{key:"cons",value:function(e){return e={value:e,next:this.head},this.head?this.head.prev=e:this.tail=e,this.head=e,this._length++,this}},{key:"insertBefore",value:function(e,t){return e||vh("cell is undefined"),t={value:t,next:e,prev:e.prev},e.prev?e.prev.next=t:this.head=t,e.prev=t,this._length++,this}},{key:"insertAfter",value:function(e,t){return e||vh("cell is undefined"),t={value:t,next:e.next,prev:e},e.next?e.next.prev=t:this.tail=t,e.next=t,this._length++,this}},{key:"insertBeforeNth",value:function(e,t){if(0>e&&(e+=this._length),0>=e)return this.cons(t);if(0>e||e>=this._length)throw new qk(e);return this.insertBefore(this.nthCellUnsafe(e),t)}},{key:"insertAfterNth",value:function(e,t){if(0>e&&(e+=this._length),e>=this._length-1)return this.push(t);if(0>e||e>=this._length)throw new qk(e);return this.insertAfter(this.nthCellUnsafe(e),t)}},{key:"insertSorted",value:function(e,t){t=t||ok;for(var n=this.head;n;){if(0>=t(e,n.value))return this.insertBefore(n,e);n=n.next}return this.push(e)}},{key:"find",value:function(e){for(var t=this.head;t;){if(t.value===e)return t;t=t.next}}},{key:"findWith",value:function(e){for(var t=this.head;t;){if(e(t.value))return t;t=t.next}}},{key:"concat",value:function(){for(var e=this.copy(),t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];for(t=0;t<n.length;t++)e.into(n[t]);return e}},{key:"into",value:function(e){for(var t=0;t<e.length;t++)this.push(e[t])}},{key:"slice",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this.length;t=0>t?t+this._length:t,n=0>n?n+this._length:n,(0>t||0>n)&&vh("invalid indices: ${from} / ${to}");for(var r=new e,i=this.nthCell(t);i&&++t<=n;)r.push(i.value),i=i.next;return r}},{key:"splice",value:function(t){var n=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,r=2<arguments.length?arguments[2]:void 0;if("number"==typeof t){if(0>t&&(t+=this._length),0>t||t>=this._length)throw new qk(t);var i=this.nthCellUnsafe(t)}else i=t;var o=new e;if(0<n)for(;i&&0<n--;)this.remove(i),o.push(i.value),i=i.next;else i&&(i=i.next);if(r)if(i)for(n=0;n<r.length;n++)this.insertBefore(i,r[n]);else for(i=0;i<r.length;i++)this.push(r[i]);return o}},{key:"remove",value:function(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,this._length--,this}},{key:"swap",value:function(e,t){if(e!==t){var n=e.value;e.value=t.value,t.value=n}return this}},{key:"push",value:function(e){return this.tail?(e={value:e,prev:this.tail},this.tail=this.tail.next=e,this._length++,this):this.cons(e)}},{key:"pop",value:function(){var e=this.tail;if(e)return(this.tail=e.prev)?delete this.tail.next:delete this.head,this._length--,e.value}},{key:"first",value:function(){return this.head&&this.head.value}},{key:"peek",value:function(){return this.tail&&this.tail.value}},{key:"setHead",value:function(e){return this.head?(this.head.value=e,this):this.cons(e)}},{key:"setTail",value:function(e){return this.tail?(this.tail.value=e,this):this.push(e)}},{key:"setNth",value:function(e,t){var n=this.nthCell(e);return!n&&vh("index out of bounds: ".concat(e)),n.value=t,this}},{key:"nth",value:function(e,t){return(e=this.nthCell(e))?e.value:t}},{key:"nthCell",value:function(e){if(0>e&&(e+=this._length),!(0>e||e>=this._length))return this.nthCellUnsafe(e)}},{key:"rotateLeft",value:function(){switch(this._length){case 0:case 1:return this;case 2:return this.swap(this.head,this.tail);default:return this.push(this.drop())}}},{key:"rotateRight",value:function(){switch(this._length){case 0:case 1:return this;case 2:return this.swap(this.head,this.tail);default:var e=this.peek();return this.pop(),this.cons(e)}}},{key:"map",value:function(t){for(var n=new e,r=this.head;r;)n.push(t(r.value)),r=r.next;return n}},{key:"filter",value:function(t){for(var n=new e,r=this.head;r;)t(r.value)&&n.push(r.value),r=r.next;return n}},{key:"reduce",value:function(e,t){for(var n=this.head;n;)t=e(t,n.value),n=n.next;return t}},{key:"shuffle",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:Lx;if(2>this._length)return this;for(e=null!=e?e:Math.ceil(1.5*Math.log2(this._length));0<e;e--)for(var n=this.head;n;){var r=n.next;.5>t.float()?this.asHead(n):this.asTail(n),n=r}return this}},{key:"sort",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:ok;if(!this._length)return this;for(var t=1;;){var n=this.head;this.tail=this.head=void 0;for(var r=0;n;){r++;for(var i=n,o=0,a=0;a<t&&(o++,i=i.next);a++);for(a=t;0<o||0<a&&i;){if(0===o){var s=i;i=i.next,a--}else i&&0!==a?0>=e(n.value,i.value)?(s=n,n=n.next,o--):(s=i,i=i.next,a--):(s=n,n=n.next,o--);this.tail?this.tail.next=s:this.head=s,s.prev=this.tail,this.tail=s}n=i}if(this.tail.next=void 0,1>=r)return this;t*=2}}},{key:"reverse",value:function(){for(var e=this.head,t=this.tail,n=(this._length>>>1)+(1&this._length);e&&t&&0<n;){var r=e.value;e.value=t.value,t.value=r,e=e.next,t=t.prev,n--}return this}},{key:"asHead",value:function(e){return e===this.head||(this.remove(e),this.head.prev=e,e.next=this.head,e.prev=void 0,this.head=e,this._length++),this}},{key:"asTail",value:function(e){return e===this.tail||(this.remove(e),this.tail.next=e,e.prev=this.tail,e.next=void 0,this.tail=e,this._length++),this}},{key:"toString",value:function(){for(var e=[],t=this.head;t;)e.push(String(t.value)),t=t.next;return e.join(", ")}},{key:"toJSON",value:function(){return G(this)}},{key:"nthCellUnsafe",value:function(e){if(e<=this._length>>1)var t=this.head,n="next";else t=this.tail,n="prev",e=this._length-e-1;for(;0<e--&&t;)t=t[n];return t}}]),e}(),tc=function(){function e(t,n){W(this,e),n=Object.assign({maxlen:1/0,maxsize:1/0,map:function(){return new Map},ksize:function(){return 0},vsize:function(){return 0}},n),this.map=n.map(),this.items=new Rx,this._size=0,this.opts=n,t&&this.into(t)}return Ha(e,[{key:"length",get:function(){return this.items.length}},{key:"size",get:function(){return this._size}},{key:Symbol.iterator,value:function(){return this.entries()}},{key:"entries",value:function(){return pg((function(e){return[e.k,e]}),this.items)}},{key:"keys",value:function(){return pg((function(e){return e.k}),this.items)}},{key:"values",value:function(){return pg((function(e){return e.v}),this.items)}},{key:"copy",value:function(){var e=this.empty();e.items=this.items.copy();for(var t=e.items.head;t;)e.map.set(t.value.k,t),t=t.next;return e}},{key:"empty",value:function(){return new e(null,this.opts)}},{key:"release",value:function(){this._size=0,this.map.clear();var e=this.opts.release;if(e){for(var t;t=this.items.drop();)e(t.k,t.v);return!0}return this.items.release()}},{key:"has",value:function(e){return this.map.has(e)}},{key:"get",value:function(e,t){return(e=this.map.get(e))?this.resetEntry(e):t}},{key:"set",value:function(e,t){var n=this.opts.ksize(e)+this.opts.vsize(t),r=this.map.get(e);return this._size+=Math.max(0,n-(r?r.value.s:0)),this.ensureSize()&&this.doSetEntry(r,e,t,n),t}},{key:"into",value:function(e){for(var t=0;t<e.length;t++){var n=e[t];this.set(n[0],n[1])}return this}},{key:"getSet",value:function(e,t){var n=this,r=this.map.get(e);return r?Promise.resolve(this.resetEntry(r)):t().then((function(t){return n.set(e,t)}))}},{key:"delete",value:function(e){return!!(e=this.map.get(e))&&(this.removeEntry(e),!0)}},{key:"resetEntry",value:function(e){return this.items.asTail(e),e.value.v}},{key:"ensureSize",value:function(){for(var e=this.opts.release,t=this.opts.maxsize,n=this.opts.maxlen;this._size>t||this.length>=n;){var r=this.items.drop();if(!r)return!1;this.map.delete(r.k),e&&e(r.k,r.v),this._size-=r.s}return!0}},{key:"removeEntry",value:function(e){var t=e.value;this.map.delete(t.k),this.items.remove(e),this.opts.release&&this.opts.release(t.k,t.v),this._size-=t.s}},{key:"doSetEntry",value:function(e,t,n,r){e?(e.value.v=n,e.value.s=r,this.items.asTail(e)):(this.items.push({k:t,v:n,s:r}),this.map.set(t,this.items.tail))}}]),e}(),Sx=function(e){function t(e,r){return W(this,t),r=Object.assign({ttl:36e5},r),n.call(this,e,r)}la(t,e);var n=ma(t);return Ha(t,[{key:"empty",value:function(){return new t(null,this.opts)}},{key:"has",value:function(e){return void 0!==this.get(e)}},{key:"get",value:function(e,t){if(e=this.map.get(e)){if(e.value.t>=Date.now())return this.resetEntry(e);this.removeEntry(e)}return t}},{key:"set",value:function(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.opts.ttl,r=this.opts.ksize(e)+this.opts.vsize(t),i=this.map.get(e);return this._size+=Math.max(0,r-(i?i.value.s:0)),this.ensureSize()&&(n=Date.now()+n,i?(i.value.v=t,i.value.s=r,i.value.t=n,this.items.asTail(i)):(this.items.push({k:e,v:t,s:r,t:n}),this.map.set(e,this.items.tail))),t}},{key:"getSet",value:function(e,t){var n=this,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:this.opts.ttl,i=this.get(e);return i?Promise.resolve(i):t().then((function(t){return n.set(e,t,r)}))}},{key:"prune",value:function(){for(var e=Date.now(),t=this.items.head;t;)t.value.t<e&&this.removeEntry(t),t=t.next}},{key:"ensureSize",value:function(){for(var e=this.opts.maxsize,n=this.opts.maxlen,r=Date.now(),i=this.items.head;i&&(this._size>e||this.length>=n);)i.value.t<r&&this.removeEntry(i),i=i.next;return Th(wd(t.prototype),"ensureSize",this).call(this)}}]),t}(tc),Tp="object"==X(Ya)&&Ya&&Ya.Object===Object&&Ya,Tx="object"==("undefined"==typeof self?"undefined":X(self))&&self&&self.Object===Object&&self,Cb=Tp||Tx||Function("return this")(),Pb=Cb.Symbol,Up=Object.prototype,Ux=Up.hasOwnProperty,Vx=Up.toString,Yf=Pb?Pb.toStringTag:void 0,Wx=Object.prototype.toString,Vp=Pb?Pb.toStringTag:void 0,Qd=function(e){if(null==e)e=void 0===e?"[object Undefined]":"[object Null]";else if(Vp&&Vp in Object(e)){var t=Ux.call(e,Yf),n=e[Yf];try{e[Yf]=void 0;var r=!0}catch(e){}var i=Vx.call(e);r&&(t?e[Yf]=n:delete e[Yf]),e=i}else e=Wx.call(e);return e},lb=function(e){var t=X(e);return null!=e&&("object"==t||"function"==t)},qi=function(e){return!!lb(e)&&("[object Function]"==(e=Qd(e))||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e)},tk=Cb["__core-js_shared__"],Wp=function(){var e=/[^.]+$/.exec(tk&&tk.keys&&tk.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Xx=Function.prototype.toString,Rd=function(e){if(null!=e){try{return Xx.call(e)}catch(e){}return e+""}return""},Yx=/^\[object .+?Constructor\]$/,Zx=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Sd=function(e,t){return e=null==e?void 0:e[t],!lb(e)||Wp&&Wp in e||!(qi(e)?Zx:Yx).test(Rd(e))?void 0:e},Zf=Sd(Object,"create"),$x=Object.prototype.hasOwnProperty,ay=Object.prototype.hasOwnProperty;zd.prototype.clear=function(){this.__data__=Zf?Zf(null):{},this.size=0},zd.prototype.delete=function(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e},zd.prototype.get=function(e){var t=this.__data__;return Zf?"__lodash_hash_undefined__"===(e=t[e])?void 0:e:$x.call(t,e)?t[e]:void 0},zd.prototype.has=function(e){var t=this.__data__;return Zf?void 0!==t[e]:ay.call(t,e)},zd.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Zf&&void 0===t?"__lodash_hash_undefined__":t,this};var $f=function(e,t){return e===t||e!=e&&t!=t},wh=function(e,t){for(var n=e.length;n--;)if($f(e[n][0],t))return n;return-1},by=Array.prototype.splice;ce.prototype.clear=function(){this.__data__=[],this.size=0},ce.prototype.delete=function(e){var t=this.__data__;return!(0>(e=wh(t,e)))&&(e==t.length-1?t.pop():by.call(t,e,1),--this.size,!0)},ce.prototype.get=function(e){var t=this.__data__;return 0>(e=wh(t,e))?void 0:t[e][1]},ce.prototype.has=function(e){return-1<wh(this.__data__,e)},ce.prototype.set=function(e,t){var n=this.__data__,r=wh(n,e);return 0>r?(++this.size,n.push([e,t])):n[r][1]=t,this};var rg=ce,ag=Sd(Cb,"Map"),xh=function(e,t){e=e.__data__;var n=X(t);return("string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t)?e["string"==typeof t?"string":"hash"]:e.map};de.prototype.clear=function(){this.size=0,this.__data__={hash:new zd,map:new(ag||rg),string:new zd}},de.prototype.delete=function(e){return e=xh(this,e).delete(e),this.size-=e?1:0,e},de.prototype.get=function(e){return xh(this,e).get(e)},de.prototype.has=function(e){return xh(this,e).has(e)},de.prototype.set=function(e,t){var n=xh(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};var qg=de;gf.prototype.add=gf.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},gf.prototype.has=function(e){return this.__data__.has(e)};var Xp=function(e,t,n,r){var i=e.length;for(n+=r?1:-1;r?n--:++n<i;)if(t(e[n],n,e))return n;return-1},cy=function(e){return e!=e},dy=function(e,t){var n;if(n=!(null==e||!e.length)){if(t==t)e:{n=-1;for(var r=e.length;++n<r;)if(e[n]===t){e=n;break e}e=-1}else e=Xp(e,cy,0);n=-1<e}return n},ey=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1},fy=function(e,t){return e.has(t)},Re=Sd(Cb,"Set"),gy=function(){},uk=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},hy=1/0,iy=Re&&1/uk(new Re([,-0]))[1]==hy?function(e){return new Re(e)}:gy,vk=function(e,t,n){var r=-1,i=dy,o=e.length,a=!0,s=[],u=s;if(n)a=!1,i=ey;else if(200<=o){if(i=t?null:iy(e))return uk(i);a=!1,i=fy,u=new gf}else u=t?[]:s;e:for(;++r<o;){var c=e[r],l=t?t(c):c;if(c=n||0!==c?c:0,a&&l==l){for(var f=u.length;f--;)if(u[f]===l)continue e;t&&u.push(l),s.push(c)}else i(u,l,n)||(u!==s&&u.push(l),s.push(c))}return s},Yp=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},he=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};ee.prototype.clear=function(){this.__data__=new rg,this.size=0},ee.prototype.delete=function(e){var t=this.__data__;return e=t.delete(e),this.size=t.size,e},ee.prototype.get=function(e){return this.__data__.get(e)},ee.prototype.has=function(e){return this.__data__.has(e)},ee.prototype.set=function(e,t){var n=this.__data__;if(n instanceof rg){var r=n.__data__;if(!ag||199>r.length)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new qg(r)}return n.set(e,t),this.size=n.size,this};var ge=ee,Is=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e},yh=function(){try{var e=Sd(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),bg=function(e,t,n){"__proto__"==t&&yh?yh(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},jy=Object.prototype.hasOwnProperty,Ml=function(e,t,n){var r=e[t];jy.call(e,t)&&$f(r,n)&&(void 0!==n||t in e)||bg(e,t,n)},re=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],u=r?r(n[s],e[s],s,n,e):void 0;void 0===u&&(u=e[s]),i?bg(n,s,u):Ml(n,s,u)}return n},gc=function(e){return null!=e&&"object"==X(e)},Zp=function(e){return gc(e)&&"[object Arguments]"==Qd(e)},$p=Object.prototype,ky=$p.hasOwnProperty,ly=$p.propertyIsEnumerable,rf=Zp(function(){return arguments}())?Zp:function(e){return gc(e)&&ky.call(e,"callee")&&!ly.call(e,"callee")},Va=Array.isArray,my=function(){return!1},jf=$a((function(e,t){var n=(t=t&&!t.nodeType&&t)&&e&&!e.nodeType&&e;t=n&&n.exports===t?Cb.Buffer:void 0,e.exports=(t?t.isBuffer:void 0)||my})),ny=/^(?:0|[1-9]\d*)$/,wk=function(e,t){var n=X(e);return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ny.test(e))&&-1<e&&0==e%1&&e<t},xk=function(e){return"number"==typeof e&&-1<e&&0==e%1&&9007199254740991>=e},Ea={};Ea["[object Float32Array]"]=Ea["[object Float64Array]"]=Ea["[object Int8Array]"]=Ea["[object Int16Array]"]=Ea["[object Int32Array]"]=Ea["[object Uint8Array]"]=Ea["[object Uint8ClampedArray]"]=Ea["[object Uint16Array]"]=Ea["[object Uint32Array]"]=!0,Ea["[object Arguments]"]=Ea["[object Array]"]=Ea["[object ArrayBuffer]"]=Ea["[object Boolean]"]=Ea["[object DataView]"]=Ea["[object Date]"]=Ea["[object Error]"]=Ea["[object Function]"]=Ea["[object Map]"]=Ea["[object Number]"]=Ea["[object Object]"]=Ea["[object RegExp]"]=Ea["[object Set]"]=Ea["[object String]"]=Ea["[object WeakMap]"]=!1;var oy=function(e){return gc(e)&&xk(e.length)&&!!Ea[Qd(e)]},zh=function(e){return function(t){return e(t)}},Se=$a((function(e,t){var n=t&&!t.nodeType&&t;n=(t=n&&e&&!e.nodeType&&e)&&t.exports===n&&Tp.process;e:{try{var r=t&&t.require&&t.require("util").types;if(r){var i=r;break e}i=n&&n.binding&&n.binding("util");break e}catch(e){}i=void 0}e.exports=i})),aq=Se&&Se.isTypedArray,bi=aq?zh(aq):oy,py=Object.prototype.hasOwnProperty,bq=function(e,t){var n=Va(e),r=!n&&rf(e),i=!n&&!r&&jf(e),o=!n&&!r&&!i&&bi(e);if(n=n||r||i||o){r=e.length;for(var a=String,s=-1,u=Array(r);++s<r;)u[s]=a(s);r=u}else r=[];for(var c in a=r.length,e)!t&&!py.call(e,c)||n&&("length"==c||i&&("offset"==c||"parent"==c)||o&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||wk(c,a))||r.push(c);return r},qy=Object.prototype,yk=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||qy)},cq=function(e,t){return function(n){return e(t(n))}},ry=cq(Object.keys,Object),sy=Object.prototype.hasOwnProperty,Ed=function(e){return null!=e&&xk(e.length)&&!qi(e)},Ad=function(e){if(Ed(e))e=bq(e);else if(yk(e)){var t,n=[];for(t in Object(e))sy.call(e,t)&&"constructor"!=t&&n.push(t);e=n}else e=ry(e);return e},Es=function(e,t){return e&&re(t,Ad(t),e)},ty=Object.prototype.hasOwnProperty,kf=function(e){if(Ed(e))e=bq(e,!0);else if(lb(e)){var t=yk(e),n=[];for(r in e)("constructor"!=r||!t&&ty.call(e,r))&&n.push(r);e=n}else{var r=[];if(null!=e)for(t in Object(e))r.push(t);e=r}return e},Cs=function(e,t){return e&&re(t,kf(t),e)},Jl=$a((function(e,t){var n=(t=t&&!t.nodeType&&t)&&e&&!e.nodeType&&e,r=(t=n&&n.exports===t?Cb.Buffer:void 0)?t.allocUnsafe:void 0;e.exports=function(e,t){return t?e.slice():(t=e.length,t=r?r(t):new e.constructor(t),e.copy(t),t)}})),Xh=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t},uy=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o},dq=function(){return[]},vy=Object.prototype.propertyIsEnumerable,eq=Object.getOwnPropertySymbols,zk=eq?function(e){return null==e?[]:(e=Object(e),uy(eq(e),(function(t){return vy.call(e,t)})))}:dq,Ds=function(e,t){return re(e,zk(e),t)},ai=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},Ak=cq(Object.getPrototypeOf,Object),fq=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)ai(t,zk(e)),e=Ak(e);return t}:dq,Bs=function(e,t){return re(e,fq(e),t)},gq=function(e,t,n){return t=t(e),Va(e)?t:ai(t,n(e))},Yh=function(e){return gq(e,Ad,zk)},Ll=function(e){return gq(e,kf,fq)},Bk=Sd(Cb,"DataView"),Ck=Sd(Cb,"Promise"),Dk=Sd(Cb,"WeakMap"),wy=Rd(Bk),xy=Rd(ag),yy=Rd(Ck),zy=Rd(Re),Ay=Rd(Dk),Td=Qd;(Bk&&"[object DataView]"!=Td(new Bk(new ArrayBuffer(1)))||ag&&"[object Map]"!=Td(new ag)||Ck&&"[object Promise]"!=Td(Ck.resolve())||Re&&"[object Set]"!=Td(new Re)||Dk&&"[object WeakMap]"!=Td(new Dk))&&(Td=function(e){var t=Qd(e);if(e=(e="[object Object]"==t?e.constructor:void 0)?Rd(e):"")switch(e){case wy:return"[object DataView]";case xy:return"[object Map]";case yy:return"[object Promise]";case zy:return"[object Set]";case Ay:return"[object WeakMap]"}return t});var hf=Td,By=Object.prototype.hasOwnProperty,As=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&By.call(e,"index")&&(n.index=e.index,n.input=e.input),n},Ah=Cb.Uint8Array,Ek=function(e){var t=new e.constructor(e.byteLength);return new Ah(t).set(new Ah(e)),t},Cy=/\w*$/,hq=Pb?Pb.prototype:void 0,iq=hq?hq.valueOf:void 0,vm=function(e,t){return t=t?Ek(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.length)},Fs=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return Ek(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return t=n?Ek(e.buffer):e.buffer,new e.constructor(t,e.byteOffset,e.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return vm(e,n);case"[object Map]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return(t=new e.constructor(e.source,Cy.exec(e))).lastIndex=e.lastIndex,t;case"[object Set]":return new r;case"[object Symbol]":return iq?Object(iq.call(e)):{}}},jq=Object.create,Dy=function(){function e(){}return function(t){return lb(t)?jq?jq(t):(e.prototype=t,t=new e,e.prototype=void 0,t):{}}}(),Kl=function(e){return"function"!=typeof e.constructor||yk(e)?{}:Dy(Ak(e))},Ey=function(e){return gc(e)&&"[object Map]"==hf(e)},kq=Se&&Se.isMap,Hs=kq?zh(kq):Ey,Fy=function(e){return gc(e)&&"[object Set]"==hf(e)},lq=Se&&Se.isSet,Gs=lq?zh(lq):Fy,wa={};wa["[object Arguments]"]=wa["[object Array]"]=wa["[object ArrayBuffer]"]=wa["[object DataView]"]=wa["[object Boolean]"]=wa["[object Date]"]=wa["[object Float32Array]"]=wa["[object Float64Array]"]=wa["[object Int8Array]"]=wa["[object Int16Array]"]=wa["[object Int32Array]"]=wa["[object Map]"]=wa["[object Number]"]=wa["[object Object]"]=wa["[object RegExp]"]=wa["[object Set]"]=wa["[object String]"]=wa["[object Symbol]"]=wa["[object Uint8Array]"]=wa["[object Uint8ClampedArray]"]=wa["[object Uint16Array]"]=wa["[object Uint32Array]"]=!0,wa["[object Error]"]=wa["[object Function]"]=wa["[object WeakMap]"]=!1;var ie=function(e){return"symbol"==X(e)||gc(e)&&"[object Symbol]"==Qd(e)},Gy=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hy=/^\w*$/,Fk=function(e,t){if(Va(e))return!1;var n=X(e);return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!ie(e))||(Hy.test(e)||!Gy.test(e)||null!=t&&e in Object(t))};Zh.Cache=qg;var Iy=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Jy=/\\(\\)?/g,Ky=function(e){var t=(e=Zh(e,(function(e){return 500===t.size&&t.clear(),e}))).cache;return e}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Iy,(function(e,n,r,i){t.push(r?i.replace(Jy,"$1"):n||e)})),t})),Js=1/0,mq=Pb?Pb.prototype:void 0,Ol=mq?mq.toString:void 0,Bh=function(e,t){return Va(e)?e:Fk(e,t)?[e]:Ky(null==e?"":Nl(e))},Ly=1/0,cg=function(e){if("string"==typeof e||ie(e))return e;var t=e+"";return"0"==t&&1/e==-Ly?"-0":t},Ch=function(e,t){for(var n=0,r=(t=Bh(t,e)).length;null!=e&&n<r;)e=e[cg(t[n++])];return n&&n==r?e:void 0},My=function(e,t){if(!(2>(t=Bh(t,e)).length)){var n=t,r=0,i=-1,o=-1,a=n.length;for(0>r&&(r=-r>a?0:a+r),0>(i=i>a?a:i)&&(i+=a),a=r>i?0:i-r>>>0,r>>>=0,i=Array(a);++o<a;)i[o]=n[o+r];e=Ch(e,i)}return(n=null==e)||(n=null==t?0:t.length,n=delete e[cg(n?t[n-1]:void 0)]),n},nq=Function.prototype.toString,Ny=Object.prototype.hasOwnProperty,Oy=nq.call(Object),wm=function(e){return!(!gc(e)||"[object Object]"!=Qd(e))&&(null===(e=Ak(e))||"function"==typeof(e=Ny.call(e,"constructor")&&e.constructor)&&e instanceof e&&nq.call(e)==Oy)},Py=function(e){return wm(e)?void 0:e},oq=Pb?Pb.isConcatSpreadable:void 0,Ks=function(e){return Va(e)||rf(e)||!!(oq&&e&&e[oq])},Qy=function(e){return null!=e&&e.length?$h(e,1):[]},Ry=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)},pq=Math.max,qq=function(e,t,n){return t=pq(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=pq(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];for(i=-1,o=Array(t+1);++i<t;)o[i]=r[i];return o[t]=n(a),Ry(e,this,o)}},Sy=function(e){return function(){return e}},Dh=function(e){return e},Ty=Date.now,rq=function(e){var t=0,n=0;return function(){var r=Ty(),i=16-(r-n);if(n=r,0<i){if(800<=++t)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}(yh?function(e,t){return yh(e,"toString",{configurable:!0,enumerable:!1,value:Sy(t),writable:!0})}:Dh),Gk=function(e){return rq(qq(e,void 0,Qy),e+"")}((function(e,t){var n={};if(null==e)return n;var r=!1;t=he(t,(function(t){return t=Bh(t,e),r||(r=1<t.length),t})),re(e,Ll(e),n),r&&(n=fe(n,7,Py));for(var i=t.length;i--;)My(n,t[i]);return n})),Uy=function(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r},um=function(e,t,n){for(var r=-1,i=Object(e),o=(n=n(e)).length;o--;){var a=n[++r];if(!1===t(i[a],a,i))break}return e},sq=function(e,t){return e&&um(e,t,Ad)},Hk=function(e,t){return function(t,n){if(null==t)return t;if(!Ed(t))return e(t,n);for(var r=t.length,i=-1,o=Object(t);++i<r&&!1!==n(o[i],i,o););return t}}(sq),Vy=function(e,t,n,r){return Hk(e,(function(e,i,o){t(r,e,n(e),o)})),r},tq=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},Pl=function(e,t,n,r,i,o){var a=1&n,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;u=o.get(e);var c=o.get(t);if(u&&c)return u==t&&c==e;u=-1,c=!0;var l=2&n?new gf:void 0;for(o.set(e,t),o.set(t,e);++u<s;){var f=e[u],h=t[u];if(r)var p=a?r(h,f,u,t,e,o):r(f,h,u,e,t,o);if(void 0!==p){if(p)continue;c=!1;break}if(l){if(!tq(t,(function(e,t){if(!l.has(t)&&(f===e||i(f,e,n,r,o)))return l.push(t)}))){c=!1;break}}else if(f!==h&&!i(f,h,n,r,o)){c=!1;break}}return o.delete(e),o.delete(t),c},Wy=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n},uq=Pb?Pb.prototype:void 0,Ik=uq?uq.valueOf:void 0,Ls=function(e,t,n,r,i,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!o(new Ah(e),new Ah(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return $f(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=Wy;case"[object Set]":if(s||(s=uk),e.size!=t.size&&!(1&r))break;return(n=a.get(e))?n==t:(r|=2,a.set(e,t),t=Pl(s(e),s(t),r,i,o,a),a.delete(e),t);case"[object Symbol]":if(Ik)return Ik.call(e)==Ik.call(t)}return!1},Ms=Object.prototype.hasOwnProperty,Ql=Object.prototype.hasOwnProperty,Xy=function(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){var u=(s=n[i])[0],c=e[u],l=s[1];if(a&&s[2]){if(void 0===c&&!(u in e))return!1}else{if(s=new ge,r)var f=r(c,l,u,e,t,s);if(void 0===f?!je(l,c,3,r,s):!f)return!1}}return!0},Yy=function(e){for(var t=Ad(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,i==i&&!lb(i)]}return t},vq=function(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in Object(n)))}},Zy=function(e){var t=Yy(e);return 1==t.length&&t[0][2]?vq(t[0][0],t[0][1]):function(n){return n===e||Xy(n,e,t)}},$y=function(e,t){return Fk(e)&&t==t&&!lb(t)?vq(cg(e),t):function(n){var r=null==n?void 0:Ch(n,e);if(void 0===(r=void 0===r?void 0:r)&&r===t){if(r=null!=n){for(var i=-1,o=(r=Bh(r=e,n)).length,a=!1;++i<o;){var s=cg(r[i]);if(!(a=null!=n&&null!=n&&s in Object(n)))break;n=n[s]}a||++i!=o?r=a:r=!!(o=null==n?0:n.length)&&xk(o)&&wk(s,o)&&(Va(n)||rf(n))}s=r}else s=je(t,r,3);return s}},az=function(e){return function(t){return null==t?void 0:t[e]}},bz=function(e){return function(t){return Ch(t,e)}},Te=function(e){return"function"==typeof e?e:null==e?Dh:"object"==X(e)?Va(e)?$y(e[0],e[1]):Zy(e):Fk(e)?az(cg(e)):bz(e)},Jk=function(e,t){return function(t,n){var r={};return(Va(t)?Uy:Vy)(t,e,Te(n),r)}}((function(e,t,n){bg(e,n,t)})),uc=function(e,t){var n={};return t=Te(t),sq(e,(function(e,r,i){bg(n,r,t(e,r,i))})),n};N({target:"String",proto:!0,forced:R((function(){var e="".sub('"');return e!==e.toLowerCase()||3<e.split('"').length}))},{sub:function(){return"<sub>"+String(jb(this))+"</sub>"}});var U=xa,Qb=null;try{Qb=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(c){}xa.prototype.__isLong__,Object.defineProperty(xa.prototype,"__isLong__",{value:!0}),xa.isLong=mb;var Sl={},Rl={};xa.fromInt=Bd,xa.fromNumber=Gb,xa.fromBits=ya;var sg=Math.pow;xa.fromString=ci,xa.fromValue=Wb;var ke=4294967296,Tl=ke*ke,Vl=Tl/2,wq=Bd(16777216),Hb=Bd(0);xa.ZERO=Hb;var Cd=Bd(0,!0);xa.UZERO=Cd;var Ue=Bd(1);xa.ONE=Ue;var xq=Bd(1,!0);xa.UONE=xq;var Kk=Bd(-1);xa.NEG_ONE=Kk;var Wl=ya(-1,2147483647,!1);xa.MAX_VALUE=Wl;var Ul=ya(-1,-1,!0);xa.MAX_UNSIGNED_VALUE=Ul;var nb=ya(0,-2147483648,!1);xa.MIN_VALUE=nb;var D=xa.prototype;D.toInt=function(){return this.unsigned?this.low>>>0:this.low},D.toNumber=function(){return this.unsigned?(this.high>>>0)*ke+(this.low>>>0):this.high*ke+(this.low>>>0)},D.toString=function(e){if(2>(e=e||10)||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(nb)){var t=Gb(e),n=this.div(t);return t=n.mul(t).sub(this),n.toString(e)+t.toInt().toString(e)}return"-"+this.neg().toString(e)}n=Gb(sg(e,6),this.unsigned),t=this;for(var r="";;){var i=t.div(n),o=(t.sub(i.mul(n)).toInt()>>>0).toString(e);if((t=i).isZero())return o+r;for(;6>o.length;)o="0"+o;r=""+o+r}},D.getHighBits=function(){return this.high},D.getHighBitsUnsigned=function(){return this.high>>>0},D.getLowBits=function(){return this.low},D.getLowBitsUnsigned=function(){return this.low>>>0},D.getNumBitsAbs=function(){if(this.isNegative())return this.eq(nb)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;0<t&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},D.isZero=function(){return 0===this.high&&0===this.low},D.eqz=D.isZero,D.isNegative=function(){return!this.unsigned&&0>this.high},D.isPositive=function(){return this.unsigned||0<=this.high},D.isOdd=function(){return 1==(1&this.low)},D.isEven=function(){return 0==(1&this.low)},D.equals=function(e){return mb(e)||(e=Wb(e)),(this.unsigned===e.unsigned||1!=this.high>>>31||1!=e.high>>>31)&&(this.high===e.high&&this.low===e.low)},D.eq=D.equals,D.notEquals=function(e){return!this.eq(e)},D.neq=D.notEquals,D.ne=D.notEquals,D.lessThan=function(e){return 0>this.comp(e)},D.lt=D.lessThan,D.lessThanOrEqual=function(e){return 0>=this.comp(e)},D.lte=D.lessThanOrEqual,D.le=D.lessThanOrEqual,D.greaterThan=function(e){return 0<this.comp(e)},D.gt=D.greaterThan,D.greaterThanOrEqual=function(e){return 0<=this.comp(e)},D.gte=D.greaterThanOrEqual,D.ge=D.greaterThanOrEqual,D.compare=function(e){if(mb(e)||(e=Wb(e)),this.eq(e))return 0;var t=this.isNegative(),n=e.isNegative();return t&&!n?-1:!t&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},D.comp=D.compare,D.negate=function(){return!this.unsigned&&this.eq(nb)?nb:this.not().add(Ue)},D.neg=D.negate,D.add=function(e){mb(e)||(e=Wb(e));var t=this.high>>>16,n=65535&this.high,r=this.low>>>16,i=e.high>>>16,o=65535&e.high,a=e.low>>>16;return r=(a=((e=(65535&this.low)+(65535&e.low))>>>16)+(r+a))>>>16,ya((65535&a)<<16|65535&e,(t=((r+=n+o)>>>16)+(t+i)&65535)<<16|65535&r,this.unsigned)},D.subtract=function(e){return mb(e)||(e=Wb(e)),this.add(e.neg())},D.sub=D.subtract,D.multiply=function(e){if(this.isZero())return Hb;if(mb(e)||(e=Wb(e)),Qb){var t=Qb.mul(this.low,this.high,e.low,e.high);return ya(t,Qb.get_high(),this.unsigned)}if(e.isZero())return Hb;if(this.eq(nb))return e.isOdd()?nb:Hb;if(e.eq(nb))return this.isOdd()?nb:Hb;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(wq)&&e.lt(wq))return Gb(this.toNumber()*e.toNumber(),this.unsigned);t=this.high>>>16;var n=65535&this.high,r=this.low>>>16,i=65535&this.low,o=e.high>>>16,a=65535&e.high,s=e.low>>>16,u=i*(e=65535&e.low),c=(u>>>16)+r*e,l=c>>>16;l+=(c=(65535&c)+i*s)>>>16;var f=(l+=n*e)>>>16;return ya((65535&c)<<16|65535&u,(f=(f+=(l=(65535&l)+r*s)>>>16)+((l=(65535&l)+i*a)>>>16)+(t*e+n*s+r*a+i*o)&65535)<<16|65535&l,this.unsigned)},D.mul=D.multiply,D.divide=function(e){if(mb(e)||(e=Wb(e)),e.isZero())throw Error("division by zero");if(Qb)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?ya(e=(this.unsigned?Qb.div_u:Qb.div_s)(this.low,this.high,e.low,e.high),Qb.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?Cd:Hb;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Cd;if(e.gt(this.shru(1)))return xq;var t=Cd}else{if(this.eq(nb)){if(e.eq(Ue)||e.eq(Kk))return nb;if(e.eq(nb))return Ue;var n=this.shr(1).div(e).shl(1);if(n.eq(Hb))return e.isNegative()?Ue:Kk;var r=this.sub(e.mul(n));return n.add(r.div(e))}if(e.eq(nb))return this.unsigned?Cd:Hb;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();t=Hb}for(r=this;r.gte(e);){n=Math.max(1,Math.floor(r.toNumber()/e.toNumber()));var i=Math.ceil(Math.log(n)/Math.LN2);i=48>=i?1:sg(2,i-48);for(var o=Gb(n),a=o.mul(e);a.isNegative()||a.gt(r);)a=(o=Gb(n-=i,this.unsigned)).mul(e);o.isZero()&&(o=Ue),t=t.add(o),r=r.sub(a)}return t},D.div=D.divide,D.modulo=function(e){return mb(e)||(e=Wb(e)),Qb?ya(e=(this.unsigned?Qb.rem_u:Qb.rem_s)(this.low,this.high,e.low,e.high),Qb.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},D.mod=D.modulo,D.rem=D.modulo,D.not=function(){return ya(~this.low,~this.high,this.unsigned)},D.and=function(e){return mb(e)||(e=Wb(e)),ya(this.low&e.low,this.high&e.high,this.unsigned)},D.or=function(e){return mb(e)||(e=Wb(e)),ya(this.low|e.low,this.high|e.high,this.unsigned)},D.xor=function(e){return mb(e)||(e=Wb(e)),ya(this.low^e.low,this.high^e.high,this.unsigned)},D.shiftLeft=function(e){return mb(e)&&(e=e.toInt()),0==(e&=63)?this:32>e?ya(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):ya(0,this.low<<e-32,this.unsigned)},D.shl=D.shiftLeft,D.shiftRight=function(e){return mb(e)&&(e=e.toInt()),0==(e&=63)?this:32>e?ya(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):ya(this.high>>e-32,0<=this.high?0:-1,this.unsigned)},D.shr=D.shiftRight,D.shiftRightUnsigned=function(e){if(mb(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return 32>e?ya(this.low>>>e|t<<32-e,t>>>e,this.unsigned):ya(32===e?t:t>>>e-32,0,this.unsigned)},D.shru=D.shiftRightUnsigned,D.shr_u=D.shiftRightUnsigned,D.toSigned=function(){return this.unsigned?ya(this.low,this.high,!1):this},D.toUnsigned=function(){return this.unsigned?this:ya(this.low,this.high,!0)},D.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},D.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},D.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},xa.fromBytes=function(e,t,n){return n?xa.fromBytesLE(e,t):xa.fromBytesBE(e,t)},xa.fromBytesLE=function(e,t){return new xa(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},xa.fromBytesBE=function(e,t){return new xa(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)};var di=function(e,t){return(di=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},Lk=!1,Ib={Promise:void 0,set useDeprecatedSynchronousErrorHandling(e){e?console.warn("DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n"+Error().stack):Lk&&console.log("RxJS: Back to a better error behavior. Thank you. <3"),Lk=e},get useDeprecatedSynchronousErrorHandling(){return Lk}},Eh={closed:!0,next:function(e){},error:function(e){if(Ib.useDeprecatedSynchronousErrorHandling)throw e;me(e)},complete:function(){}},Jb=Array.isArray||function(e){return e&&"number"==typeof e.length},lf=function(){function e(e){return Error.call(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e,this}return e.prototype=Object.create(Error.prototype),e}(),Oa=function(){function e(e){this.closed=!1,this._subscriptions=this._parentOrParents=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return e.prototype.unsubscribe=function(){if(!this.closed){var t=this._parentOrParents,n=this._ctorUnsubscribe,r=this._unsubscribe,i=this._subscriptions;if(this.closed=!0,this._subscriptions=this._parentOrParents=null,t instanceof e)t.remove(this);else if(null!==t)for(var o=0;o<t.length;++o)t[o].remove(this);if(le(r)){n&&(this._unsubscribe=void 0);try{r.call(this)}catch(e){var a=e instanceof lf?Xl(e.errors):[e]}}if(Jb(i))for(o=-1,t=i.length;++o<t;)if(ei(n=i[o]))try{n.unsubscribe()}catch(e){a=a||[],e instanceof lf?a=a.concat(Xl(e.errors)):a.push(e)}if(a)throw new lf(a)}},e.prototype.add=function(t){var n=t;if(!t)return e.EMPTY;switch(X(t)){case"function":n=new e(t);case"object":if(n===this||n.closed||"function"!=typeof n.unsubscribe)return n;if(this.closed)return n.unsubscribe(),n;n instanceof e||(t=n,(n=new e)._subscriptions=[t]);break;default:throw Error("unrecognized teardown "+t+" added to Subscription.")}if(null===(t=n._parentOrParents))n._parentOrParents=this;else if(t instanceof e){if(t===this)return n;n._parentOrParents=[t,this]}else{if(-1!==t.indexOf(this))return n;t.push(this)}return null===(t=this._subscriptions)?this._subscriptions=[n]:t.push(n),n},e.prototype.remove=function(e){var t=this._subscriptions;t&&(-1!==(e=t.indexOf(e))&&t.splice(e,1))},e.EMPTY=function(e){return e.closed=!0,e}(new e),e}(),Fh="function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random(),ia=function(e){function t(n,r,i){var o=e.call(this)||this;switch(o.syncErrorValue=null,o.syncErrorThrown=!1,o.syncErrorThrowable=!1,o.isStopped=!1,arguments.length){case 0:o.destination=Eh;break;case 1:if(!n){o.destination=Eh;break}if("object"===X(n)){n instanceof t?(o.syncErrorThrowable=n.syncErrorThrowable,o.destination=n,n.add(o)):(o.syncErrorThrowable=!0,o.destination=new yq(o,n));break}default:o.syncErrorThrowable=!0,o.destination=new yq(o,n,r,i)}return o}return O(t,e),t.prototype[Fh]=function(){return this},t.create=function(e,n,r){return(e=new t(e,n,r)).syncErrorThrowable=!1,e},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.isStopped=this.closed=!1,this._parentOrParents=e,this},t}(Oa),yq=function(e){function t(t,n,r,i){var o=e.call(this)||this;if(o._parentSubscriber=t,t=o,le(n))var a=n;else n&&(a=n.next,r=n.error,i=n.complete,n!==Eh&&(le((t=Object.create(n)).unsubscribe)&&o.add(t.unsubscribe.bind(t)),t.unsubscribe=o.unsubscribe.bind(o)));return o._context=t,o._next=a,o._error=r,o._complete=i,o}return O(t,e),t.prototype.next=function(e){if(!this.isStopped&&this._next){var t=this._parentSubscriber;Ib.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var t=this._parentSubscriber,n=Ib.useDeprecatedSynchronousErrorHandling;if(this._error)n&&t.syncErrorThrowable?this.__tryOrSetError(t,this._error,e):this.__tryOrUnsub(this._error,e),this.unsubscribe();else if(t.syncErrorThrowable)n?(t.syncErrorValue=e,t.syncErrorThrown=!0):me(e),this.unsubscribe();else{if(this.unsubscribe(),n)throw e;me(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var t=this._parentSubscriber;if(this._complete){var n=function(){return e._complete.call(e._context)};Ib.useDeprecatedSynchronousErrorHandling&&t.syncErrorThrowable?this.__tryOrSetError(t,n):this.__tryOrUnsub(n)}this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,t){try{e.call(this._context,t)}catch(e){if(this.unsubscribe(),Ib.useDeprecatedSynchronousErrorHandling)throw e;me(e)}},t.prototype.__tryOrSetError=function(e,t,n){if(!Ib.useDeprecatedSynchronousErrorHandling)throw Error("bad call");try{t.call(this._context,n)}catch(t){return Ib.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=t,e.syncErrorThrown=!0):me(t),!0}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._parentSubscriber=this._context=null,e.unsubscribe()},t}(ia),ne="function"==typeof Symbol&&Symbol.observable||"@@observable",Y=function(){function e(e){this._isScalar=!1,e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this.operator;e:{if(e){if(e instanceof ia)break e;if(e[Fh]){e=e[Fh]();break e}}e=e||t||n?new ia(e,t,n):new ia(Eh)}if(r?e.add(r.call(e,this.source)):e.add(this.source||Ib.useDeprecatedSynchronousErrorHandling&&!e.syncErrorThrowable?this._subscribe(e):this._trySubscribe(e)),Ib.useDeprecatedSynchronousErrorHandling&&e.syncErrorThrowable&&(e.syncErrorThrowable=!1,e.syncErrorThrown))throw e.syncErrorValue;return e},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){Ib.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=t),fi(e)?e.error(t):console.warn(t)}},e.prototype.forEach=function(e,t){var n=this;return new(t=Zl(t))((function(t,r){var i=n.subscribe((function(t){try{e(t)}catch(e){r(e),i&&i.unsubscribe()}}),r,t)}))},e.prototype._subscribe=function(e){var t=this.source;return t&&t.subscribe(e)},e.prototype[ne]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return 0===e.length?this:Yl(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=Zl(e))((function(e,n){var r;t.subscribe((function(e){return r=e}),(function(e){return n(e)}),(function(){return e(r)}))}))},e.create=function(t){return new e(t)},e}(),qd=function(){function e(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return e.prototype=Object.create(Error.prototype),e}(),zq=function(e){function t(t,n){var r=e.call(this)||this;return r.subject=t,r.subscriber=n,r.closed=!1,r}return O(t,e),t.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e=this.subject,t=e.observers;this.subject=null,!t||0===t.length||e.isStopped||e.closed||-1!==(e=t.indexOf(this.subscriber))&&t.splice(e,1)}},t}(Oa),Aq=function(e){function t(t){var n=e.call(this,t)||this;return n.destination=t,n}return O(t,e),t}(ia),Pa=function(e){function t(){var t=e.call(this)||this;return t.observers=[],t.closed=!1,t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return O(t,e),t.prototype[Fh]=function(){return new Aq(this)},t.prototype.lift=function(e){var t=new Bq(this,this);return t.operator=e,t},t.prototype.next=function(e){if(this.closed)throw new qd;if(!this.isStopped){var t=this.observers,n=t.length;t=t.slice();for(var r=0;r<n;r++)t[r].next(e)}},t.prototype.error=function(e){if(this.closed)throw new qd;this.hasError=!0,this.thrownError=e,this.isStopped=!0;var t=this.observers,n=t.length;t=t.slice();for(var r=0;r<n;r++)t[r].error(e);this.observers.length=0},t.prototype.complete=function(){if(this.closed)throw new qd;this.isStopped=!0;var e=this.observers,t=e.length;e=e.slice();for(var n=0;n<t;n++)e[n].complete();this.observers.length=0},t.prototype.unsubscribe=function(){this.closed=this.isStopped=!0,this.observers=null},t.prototype._trySubscribe=function(t){if(this.closed)throw new qd;return e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){if(this.closed)throw new qd;return this.hasError?(e.error(this.thrownError),Oa.EMPTY):this.isStopped?(e.complete(),Oa.EMPTY):(this.observers.push(e),new zq(this,e))},t.prototype.asObservable=function(){var e=new Y;return e.source=this,e},t.create=function(e,t){return new Bq(e,t)},t}(Y),Bq=function(e){function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return O(t,e),t.prototype.next=function(e){var t=this.destination;t&&t.next&&t.next(e)},t.prototype.error=function(e){var t=this.destination;t&&t.error&&this.destination.error(e)},t.prototype.complete=function(){var e=this.destination;e&&e.complete&&this.destination.complete()},t.prototype._subscribe=function(e){return this.source?this.source.subscribe(e):Oa.EMPTY},t}(Pa),Ns=function(){function e(e){this.connectable=e}return e.prototype.call=function(e,t){var n=this.connectable;return n._refCount++,e=new cz(e,n),t=t.subscribe(e),e.closed||(e.connection=n.connect()),t},e}(),cz=function(e){function t(t,n){return(t=e.call(this,t)||this).connectable=n,t}return O(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;0>=t?this.connection=null:(e._refCount=t-1,1<t?this.connection=null:(t=this.connection,e=e._connection,this.connection=null,!e||t&&e!==t||e.unsubscribe()))}else this.connection=null},t}(ia),Cq=function(e){function t(t,n){var r=e.call(this)||this;return r.source=t,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return O(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype.connect=function(){var e=this._connection;return e||(this._isComplete=!1,(e=this._connection=new Oa).add(this.source.subscribe(new dz(this.getSubject(),this))),e.closed&&(this._connection=null,e=Oa.EMPTY)),e},t.prototype.refCount=function(){return $l()(this)},t}(Y),At=function(){var e=Cq.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:e._subscribe},_isComplete:{value:e._isComplete,writable:!0},getSubject:{value:e.getSubject},connect:{value:e.connect},refCount:{value:e.refCount}}}(),dz=function(e){function t(t,n){return(t=e.call(this,t)||this).connectable=n,t}return O(t,e),t.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},t.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._connection;e._refCount=0,e._subject=null,e._connection=null,t&&t.unsubscribe()}},t}(Aq);!function(e){function t(t,n){return(t=e.call(this,t)||this).connectable=n,t}O(t,e),t.prototype._unsubscribe=function(){var e=this.connectable;if(e){this.connectable=null;var t=e._refCount;0>=t?this.connection=null:(e._refCount=t-1,1<t?this.connection=null:(t=this.connection,e=e._connection,this.connection=null,!e||t&&e!==t||e.unsubscribe()))}else this.connection=null}}(ia),function(e){function t(t,n,r,i,o){return(t=e.call(this,t)||this).keySelector=n,t.elementSelector=r,t.durationSelector=i,t.subjectSelector=o,t.groups=null,t.attemptedToUnsubscribe=!1,t.count=0,t}O(t,e),t.prototype._next=function(e){try{var t=this.keySelector(e)}catch(e){return void this.error(e)}this._group(e,t)},t.prototype._group=function(e,t){var n=this.groups;n||(n=this.groups=new Map);var r=n.get(t);if(this.elementSelector)try{var i=this.elementSelector(e)}catch(e){this.error(e)}else i=e;if(!r&&(r=this.subjectSelector?this.subjectSelector():new Pa,n.set(t,r),e=new Mk(t,r,this),this.destination.next(e),this.durationSelector)){e=void 0;try{e=this.durationSelector(new Mk(t,r))}catch(e){return void this.error(e)}this.add(e.subscribe(new ez(t,r,this)))}r.closed||r.next(i)},t.prototype._error=function(e){var t=this.groups;t&&(t.forEach((function(t,n){t.error(e)})),t.clear()),this.destination.error(e)},t.prototype._complete=function(){var e=this.groups;e&&(e.forEach((function(e,t){e.complete()})),e.clear()),this.destination.complete()},t.prototype.removeGroup=function(e){this.groups.delete(e)},t.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,0===this.count&&e.prototype.unsubscribe.call(this))}}(ia);var ez=function(e){function t(t,n,r){var i=e.call(this,n)||this;return i.key=t,i.group=n,i.parent=r,i}return O(t,e),t.prototype._next=function(e){this.complete()},t.prototype._unsubscribe=function(){var e=this.parent,t=this.key;this.key=this.parent=null,e&&e.removeGroup(t)},t}(ia),Mk=function(e){function t(t,n,r){var i=e.call(this)||this;return i.key=t,i.groupSubject=n,i.refCountSubscription=r,i}return O(t,e),t.prototype._subscribe=function(e){var t=new Oa,n=this.refCountSubscription,r=this.groupSubject;return n&&!n.closed&&t.add(new fz(n)),t.add(r.subscribe(e)),t},t}(Y),fz=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,t.count++,n}return O(t,e),t.prototype.unsubscribe=function(){var t=this.parent;t.closed||this.closed||(e.prototype.unsubscribe.call(this),--t.count,0===t.count&&t.attemptedToUnsubscribe&&t.unsubscribe())},t}(Oa),gz=function(e){function t(t){var n=e.call(this)||this;return n._value=t,n}return O(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),t.prototype._subscribe=function(t){var n=e.prototype._subscribe.call(this,t);return n&&!n.closed&&t.next(this._value),n},t.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new qd;return this._value},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(Pa),dg=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r.pending=!1,r}return O(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e,e=this.id;var n=this.scheduler;return null!=e&&(this.id=this.recycleAsyncId(n,e,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,n){return void 0===n&&(n=0),setInterval(e.flush.bind(e,this),n)},t.prototype.recycleAsyncId=function(e,t,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return t;clearInterval(t)},t.prototype.execute=function(e,t){return this.closed?Error("executing a cancelled action"):(this.pending=!1,(e=this._execute(e,t))?e:void(!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))))},t.prototype._execute=function(e,t){t=!1;var n=void 0;try{this.work(e)}catch(e){t=!0,n=!!e&&e||Error(e)}if(t)return this.unsubscribe(),n},t.prototype._unsubscribe=function(){var e=this.id,t=this.scheduler,n=t.actions,r=n.indexOf(this);this.state=this.work=null,this.pending=!1,this.scheduler=null,-1!==r&&n.splice(r,1),null!=e&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null},t}(function(e){function t(t,n){return e.call(this)||this}return O(t,e),t.prototype.schedule=function(e,t){return this},t}(Oa)),hz=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return O(t,e),t.prototype.schedule=function(t,n){return void 0===n&&(n=0),0<n?e.prototype.schedule.call(this,t,n):(this.delay=n,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,n){return 0<n||this.closed?e.prototype.execute.call(this,t,n):this._execute(t,n)},t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&0<r||null===r&&0<this.delay?e.prototype.requestAsyncId.call(this,t,n,r):t.flush(this)},t}(dg),Nk=function(){function e(t,n){void 0===n&&(n=e.now),this.SchedulerAction=t,this.now=n}return e.prototype.schedule=function(e,t,n){return void 0===t&&(t=0),new this.SchedulerAction(this,e).schedule(n,t)},e.now=function(){return Date.now()},e}(),eg=function(e){function t(n,r){void 0===r&&(r=Nk.now);var i=e.call(this,n,(function(){return t.delegate&&t.delegate!==i?t.delegate.now():r()}))||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return O(t,e),t.prototype.schedule=function(n,r,i){return void 0===r&&(r=0),t.delegate&&t.delegate!==this?t.delegate.schedule(n,r,i):e.prototype.schedule.call(this,n,r,i)},t.prototype.flush=function(e){var t=this.actions;if(this.active)t.push(e);else{var n;this.active=!0;do{if(n=e.execute(e.state,e.delay))break}while(e=t.shift());if(this.active=!1,n){for(;e=t.shift();)e.unsubscribe();throw n}}},t}(Nk),fg=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t}(eg))(hz),vb=new Y((function(e){return e.complete()})),am=function(e){return function(t){for(var n=0,r=e.length;n<r&&!t.closed;n++)t.next(e[n]);t.complete()}},Ok;!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(Ok||(Ok={}));var Ve=function(){function e(e,t,n){this.kind=e,this.value=t,this.error=n,this.hasValue="N"===e}return e.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},e.prototype.do=function(e,t,n){switch(this.kind){case"N":return e&&e(this.value);case"E":return t&&t(this.error);case"C":return n&&n()}},e.prototype.accept=function(e,t,n){return e&&"function"==typeof e.next?this.observe(e):this.do(e,t,n)},e.prototype.toObservable=function(){switch(this.kind){case"N":return bb(this.value);case"E":return Z(this.error);case"C":return mf()}throw Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}(),Rs=function(){function e(e,t){void 0===t&&(t=0),this.scheduler=e,this.delay=t}return e.prototype.call=function(e,t){return t.subscribe(new Dq(e,this.scheduler,this.delay))},e}(),Dq=function(e){function t(t,n,r){return void 0===r&&(r=0),(t=e.call(this,t)||this).scheduler=n,t.delay=r,t}return O(t,e),t.dispatch=function(e){e.notification.observe(e.destination),this.unsubscribe()},t.prototype.scheduleMessage=function(e){this.destination.add(this.scheduler.schedule(t.dispatch,this.delay,new iz(e,this.destination)))},t.prototype._next=function(e){this.scheduleMessage(Ve.createNext(e))},t.prototype._error=function(e){this.scheduleMessage(Ve.createError(e)),this.unsubscribe()},t.prototype._complete=function(){this.scheduleMessage(Ve.createComplete()),this.unsubscribe()},t}(ia),iz=function(e,t){this.notification=e,this.destination=t},qe=function(e){function t(t,n,r){void 0===t&&(t=Number.POSITIVE_INFINITY),void 0===n&&(n=Number.POSITIVE_INFINITY);var i=e.call(this)||this;return i.scheduler=r,i._events=[],i._infiniteTimeWindow=!1,i._bufferSize=1>t?1:t,i._windowTime=1>n?1:n,n===Number.POSITIVE_INFINITY?(i._infiniteTimeWindow=!0,i.next=i.nextInfiniteTimeWindow):i.next=i.nextTimeWindow,i}return O(t,e),t.prototype.nextInfiniteTimeWindow=function(t){if(!this.isStopped){var n=this._events;n.push(t),n.length>this._bufferSize&&n.shift()}e.prototype.next.call(this,t)},t.prototype.nextTimeWindow=function(t){this.isStopped||(this._events.push(new jz(this._getNow(),t)),this._trimBufferThenGetEvents()),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){var t=this._infiniteTimeWindow,n=t?this._events:this._trimBufferThenGetEvents(),r=this.scheduler,i=n.length;if(this.closed)throw new qd;if(this.isStopped||this.hasError)var o=Oa.EMPTY;else this.observers.push(e),o=new zq(this,e);if(r&&e.add(e=new Dq(e,r)),t)for(t=0;t<i&&!e.closed;t++)e.next(n[t]);else for(t=0;t<i&&!e.closed;t++)e.next(n[t].value);return this.hasError?e.error(this.thrownError):this.isStopped&&e.complete(),o},t.prototype._getNow=function(){return(this.scheduler||fg).now()},t.prototype._trimBufferThenGetEvents=function(){for(var e=this._getNow(),t=this._bufferSize,n=this._windowTime,r=this._events,i=r.length,o=0;o<i&&!(e-r[o].time<n);)o++;return i>t&&(o=Math.max(o,i-t)),0<o&&r.splice(0,o),r},t}(Pa),jz=function(e,t){this.time=e,this.value=t},of=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.value=null,t.hasNext=!1,t.hasCompleted=!1,t}return O(t,e),t.prototype._subscribe=function(t){return this.hasError?(t.error(this.thrownError),Oa.EMPTY):this.hasCompleted&&this.hasNext?(t.next(this.value),t.complete(),Oa.EMPTY):e.prototype._subscribe.call(this,t)},t.prototype.next=function(e){this.hasCompleted||(this.value=e,this.hasNext=!0)},t.prototype.error=function(t){this.hasCompleted||e.prototype.error.call(this,t)},t.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&e.prototype.next.call(this,this.value),e.prototype.complete.call(this)},t}(Pa),kz=1,lz=Promise.resolve(),ii={},Eq={setImmediate:function(e){var t=kz++;return ii[t]=!0,lz.then((function(){return bm(t)&&e()})),t},clearImmediate:function(e){bm(e)}},mz=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return O(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&0<r?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=Eq.setImmediate(t.flush.bind(t,null))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&0<r||null===r&&0<this.delay)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(Eq.clearImmediate(n),t.scheduled=void 0)},t}(dg),ri=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,i=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this.active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(eg))(mz),nz=ri,Pk=new eg(dg),bd=Pk,oz=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.scheduler=t,r.work=n,r}return O(t,e),t.prototype.requestAsyncId=function(t,n,r){return void 0===r&&(r=0),null!==r&&0<r?e.prototype.requestAsyncId.call(this,t,n,r):(t.actions.push(this),t.scheduled||(t.scheduled=requestAnimationFrame((function(){return t.flush(null)}))))},t.prototype.recycleAsyncId=function(t,n,r){if(void 0===r&&(r=0),null!==r&&0<r||null===r&&0<this.delay)return e.prototype.recycleAsyncId.call(this,t,n,r);0===t.actions.length&&(cancelAnimationFrame(n),t.scheduled=void 0)},t}(dg),Fq=new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.flush=function(e){this.active=!0,this.scheduled=void 0;var t,n=this.actions,r=-1,i=n.length;e=e||n.shift();do{if(t=e.execute(e.state,e.delay))break}while(++r<i&&(e=n.shift()));if(this.active=!1,t){for(;++r<i&&(e=n.shift());)e.unsubscribe();throw t}},t}(eg))(oz),pz=function(e){function t(t,n){void 0===t&&(t=Gq),void 0===n&&(n=Number.POSITIVE_INFINITY);var r=e.call(this,t,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}return O(t,e),t.prototype.flush=function(){for(var e,t,n=this.actions,r=this.maxFrames;(t=n[0])&&t.delay<=r&&(n.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=n.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10,t}(eg),Gq=function(e){function t(t,n,r){void 0===r&&(r=t.index+=1);var i=e.call(this,t,n)||this;return i.scheduler=t,i.work=n,i.index=r,i.active=!0,i.index=t.index=r,i}return O(t,e),t.prototype.schedule=function(n,r){if(void 0===r&&(r=0),!this.id)return e.prototype.schedule.call(this,n,r);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(n,r)},t.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),this.delay=e.frame+r,(e=e.actions).push(this),e.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(e,t,n){},t.prototype._execute=function(t,n){if(!0===this.active)return e.prototype._execute.call(this,t,n)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(dg),Qk=function(){function e(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return e.prototype=Object.create(Error.prototype),e}(),vg=function(){function e(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return e.prototype=Object.create(Error.prototype),e}(),pb=function(){function e(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return e.prototype=Object.create(Error.prototype),e}(),Ss=function(){function e(e,t){this.project=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new qz(e,this.project,this.thisArg))},e}(),qz=function(e){function t(t,n,r){return(t=e.call(this,t)||this).project=n,t.count=0,t.thisArg=r||t,t}return O(t,e),t.prototype._next=function(e){try{var t=this.project.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(ia),Rk=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.notifyNext=function(e,t,n,r,i){this.destination.next(t)},t.prototype.notifyError=function(e,t){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()},t}(ia),Xs=function(e){function t(t,n,r){var i=e.call(this)||this;return i.parent=t,i.outerValue=n,i.outerIndex=r,i.index=0,i}return O(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this.index++,this)},t.prototype._error=function(e){this.parent.notifyError(e,this),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},t}(ia),rz=function(e){return function(t){return e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,me),t}},$c="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator",sz=function(e){return function(t){for(var n=e[$c]();;){var r=void 0;try{r=n.next()}catch(e){return t.error(e),t}if(r.done){t.complete();break}if(t.next(r.value),t.closed)break}return"function"==typeof n.return&&t.add((function(){n.return&&n.return()})),t}},tz=function(e){return function(t){var n=e[ne]();if("function"!=typeof n.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return n.subscribe(t)}},hm=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e},pf=function(e){if(e&&"function"==typeof e[ne])return tz(e);if(hm(e))return am(e);if(fm(e))return rz(e);if(e&&"function"==typeof e[$c])return sz(e);throw e=ei(e)?"an invalid object":"'"+e+"'",new TypeError("You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")},Hq={},vz=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new uz(e,this.resultSelector))},e}(),uz=function(e){function t(t,n){return(t=e.call(this,t)||this).resultSelector=n,t.active=0,t.values=[],t.observables=[],t}return O(t,e),t.prototype._next=function(e){this.values.push(Hq),this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{this.toRespond=this.active=t;for(var n=0;n<t;n++)this.add(ji(this,e[n],void 0,n))}},t.prototype.notifyComplete=function(e){0==--this.active&&this.destination.complete()},t.prototype.notifyNext=function(e,t,n){var r=(e=this.values)[n];r=this.toRespond?r===Hq?--this.toRespond:this.toRespond:0,e[n]=t,0===r&&(this.resultSelector?this._tryResultSelector(e):this.destination.next(e.slice()))},t.prototype._tryResultSelector=function(e){try{var t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(Rk),vc=function(e){function t(t){var n=e.call(this)||this;return n.parent=t,n}return O(t,e),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(ia);!function(e){function t(t,n,r){var i=e.call(this)||this;return i.parent=t,i.outerValue=n,i.outerIndex=r,i}O(t,e),t.prototype._next=function(e){this.parent.notifyNext(this.outerValue,e,this.outerIndex,this)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()}}(ia);var wc=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(ia);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}O(t,e),t.prototype.notifyNext=function(e,t,n,r){this.destination.next(t)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(e){this.destination.complete()}}(ia);var at=function(){function e(e,t){void 0===t&&(t=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=t}return e.prototype.call=function(e,t){return t.subscribe(new wz(e,this.project,this.concurrent))},e}(),wz=function(e){function t(t,n,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),(t=e.call(this,t)||this).project=n,t.concurrent=r,t.hasCompleted=!1,t.buffer=[],t.active=0,t.index=0,t}return O(t,e),t.prototype._next=function(e){this.active<this.concurrent?this._tryNext(e):this.buffer.push(e)},t.prototype._tryNext=function(e){var t=this.index++;try{var n=this.project(e,t)}catch(e){return void this.destination.error(e)}this.active++,this._innerSub(n)},t.prototype._innerSub=function(e){var t=new vc(this),n=this.destination;n.add(t),(e=ic(e,t))!==t&&n.add(e)},t.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyComplete=function(){var e=this.buffer;this.active--,0<e.length?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},t}(wc),Sk=y.parseFloat,Iq=-1/0!=1/Sk("\t\n\v\f\r \u2028\u2029\ufeff-0")?function(e){e=ik(String(e));var t=Sk(e);return 0===t&&"-"==e.charAt(0)?-0:t}:Sk;N({global:!0,forced:parseFloat!=Iq},{parseFloat:Iq});var Tk=new Y(hc),ft=function(){function e(e,t){this.predicate=e,this.thisArg=t}return e.prototype.call=function(e,t){return t.subscribe(new xz(e,this.predicate,this.thisArg))},e}(),xz=function(e){function t(t,n,r){return(t=e.call(this,t)||this).predicate=n,t.thisArg=r,t.count=0,t}return O(t,e),t.prototype._next=function(e){try{var t=this.predicate.call(this.thisArg,e,this.count++)}catch(e){return void this.destination.error(e)}t&&this.destination.next(e)},t}(ia),gt=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new yz(e))},e}(),yz=function(e){function t(t){return(t=e.call(this,t)||this).hasFirst=!1,t.observables=[],t.subscriptions=[],t}return O(t,e),t.prototype._next=function(e){this.observables.push(e)},t.prototype._complete=function(){var e=this.observables,t=e.length;if(0===t)this.destination.complete();else{for(var n=0;n<t&&!this.hasFirst;n++){var r=ji(this,e[n],void 0,n);this.subscriptions&&this.subscriptions.push(r),this.add(r)}this.observables=null}},t.prototype.notifyNext=function(e,t,n){if(!this.hasFirst){for(this.hasFirst=!0,e=0;e<this.subscriptions.length;e++)if(e!==n){var r=this.subscriptions[e];r.unsubscribe(),this.remove(r)}this.subscriptions=null}this.destination.next(t)},t}(Rk),jt=function(){function e(e){this.resultSelector=e}return e.prototype.call=function(e,t){return t.subscribe(new zz(e,this.resultSelector))},e}(),zz=function(e){function t(t,n,r){return(t=e.call(this,t)||this).resultSelector=n,t.iterators=[],t.active=0,t.resultSelector="function"==typeof n?n:void 0,t}return O(t,e),t.prototype._next=function(e){var t=this.iterators;Jb(e)?t.push(new Az(e)):"function"==typeof e[$c]?t.push(new Bz(e[$c]())):t.push(new Cz(this.destination,this,e))},t.prototype._complete=function(){var e=this.iterators,t=e.length;if(this.unsubscribe(),0===t)this.destination.complete();else{this.active=t;for(var n=0;n<t;n++){var r=e[n];r.stillUnsubscribed?this.destination.add(r.subscribe()):this.active--}}},t.prototype.notifyInactive=function(){this.active--,0===this.active&&this.destination.complete()},t.prototype.checkIterators=function(){for(var e=this.iterators,t=e.length,n=this.destination,r=0;r<t;r++){var i=e[r];if("function"==typeof i.hasValue&&!i.hasValue())return}var o=!1,a=[];for(r=0;r<t;r++){var s=(i=e[r]).next();if(i.hasCompleted()&&(o=!0),s.done)return void n.complete();a.push(s.value)}this.resultSelector?this._tryresultSelector(a):n.next(a),o&&n.complete()},t.prototype._tryresultSelector=function(e){try{var t=this.resultSelector.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(ia),Bz=function(){function e(e){this.iterator=e,this.nextResult=e.next()}return e.prototype.hasValue=function(){return!0},e.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},e.prototype.hasCompleted=function(){var e=this.nextResult;return!(!e||!e.done)},e}(),Az=function(){function e(e){this.array=e,this.length=this.index=0,this.length=e.length}return e.prototype[$c]=function(){return this},e.prototype.next=function(e){e=this.index++;var t=this.array;return e<this.length?{value:t[e],done:!1}:{value:null,done:!0}},e.prototype.hasValue=function(){return this.array.length>this.index},e.prototype.hasCompleted=function(){return this.array.length===this.index},e}(),Cz=function(e){function t(t,n,r){return(t=e.call(this,t)||this).parent=n,t.observable=r,t.stillUnsubscribed=!0,t.buffer=[],t.isComplete=!1,t}return O(t,e),t.prototype[$c]=function(){return this},t.prototype.next=function(){var e=this.buffer;return 0===e.length&&this.isComplete?{value:null,done:!0}:{value:e.shift(),done:!1}},t.prototype.hasValue=function(){return 0<this.buffer.length},t.prototype.hasCompleted=function(){return 0===this.buffer.length&&this.isComplete},t.prototype.notifyComplete=function(){0<this.buffer.length?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},t.prototype.notifyNext=function(e){this.buffer.push(e),this.parent.checkIterators()},t.prototype.subscribe=function(){return ic(this.observable,new vc(this))},t}(wc),Dz=Object.freeze({__proto__:null,Observable:Y,ConnectableObservable:Cq,GroupedObservable:Mk,observable:ne,Subject:Pa,BehaviorSubject:gz,ReplaySubject:qe,AsyncSubject:of,asap:nz,asapScheduler:ri,async:bd,asyncScheduler:Pk,queue:fg,queueScheduler:fg,animationFrame:Fq,animationFrameScheduler:Fq,VirtualTimeScheduler:pz,VirtualAction:Gq,Scheduler:Nk,Subscription:Oa,Subscriber:ia,Notification:Ve,get NotificationKind(){return Ok},pipe:gi,noop:hc,identity:Yc,isObservable:function(e){return!!e&&(e instanceof Y||"function"==typeof e.lift&&"function"==typeof e.subscribe)},ArgumentOutOfRangeError:Qk,EmptyError:vg,ObjectUnsubscribedError:qd,UnsubscriptionError:lf,TimeoutError:pb,bindCallback:cm,bindNodeCallback:dm,combineLatest:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=t=void 0;return Zc(e[e.length-1])&&(n=e.pop()),"function"==typeof e[e.length-1]&&(t=e.pop()),1===e.length&&Jb(e[0])&&(e=e[0]),nf(e,n).lift(new vz(t))},concat:im,defer:ad,empty:mf,forkJoin:jm,from:Kb,fromEvent:gb,fromEventPattern:lm,generate:function(e,t,n,r,i){if(1==arguments.length){var o=e.initialState;t=e.condition,n=e.iterate;var a=e.resultSelector||Yc;i=e.scheduler}else void 0===r||Zc(r)?(o=e,a=Yc,i=r):(o=e,a=r);return new Y((function(e){var r=o;if(i)return i.schedule(bt,0,{subscriber:e,iterate:n,condition:t,resultSelector:a,state:r});for(;;){if(t){var s=void 0;try{s=t(r)}catch(t){e.error(t);break}if(!s){e.complete();break}}s=void 0;try{s=a(r)}catch(t){e.error(t);break}if(e.next(s),e.closed)break;try{r=n(r)}catch(t){e.error(t);break}}}))},iif:function(e,t,n){return void 0===t&&(t=vb),void 0===n&&(n=vb),ad((function(){return e()?t:n}))},interval:mm,merge:Xb,never:function(){return Tk},of:bb,onErrorResumeNext:li,pairs:function(e,t){return new Y(t?function(n){var r=Object.keys(e),i=new Oa;return i.add(t.schedule(dt,0,{keys:r,index:0,subscriber:n,subscription:i,obj:e})),i}:function(t){for(var n=Object.keys(e),r=0;r<n.length&&!t.closed;r++){var i=n[r];e.hasOwnProperty(i)&&t.next([i,e[i]])}t.complete()})},partition:function(e,t,n){return[wb(t,n)(new Y(pf(e))),wb(et(t,n))(new Y(pf(e)))]},race:Ca,range:function(e,t,n){return void 0===e&&(e=0),new Y((function(r){void 0===t&&(t=e,e=0);var i=0,o=e;if(n)return n.schedule(ht,0,{index:i,count:t,start:e,subscriber:r});for(;;){if(i++>=t){r.complete();break}if(r.next(o++),r.closed)break}}))},throwError:Z,timer:Bc,using:function(e,t){return new Y((function(n){try{var r=e()}catch(e){return void n.error(e)}try{var i=t(r)}catch(e){return void n.error(e)}var o=(i?Kb(i):vb).subscribe(n);return function(){o.unsubscribe(),r&&r.unsubscribe()}}))},zip:mi,scheduled:gm,EMPTY:vb,NEVER:Tk,config:Ib}),kt=function(){function e(e){this.selector=e}return e.prototype.call=function(e,t){return t.subscribe(new Ez(e,this.selector,this.caught))},e}(),Ez=function(e){function t(t,n,r){return(t=e.call(this,t)||this).selector=n,t.caught=r,t}return O(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(t){return void e.prototype.error.call(this,t)}this._unsubscribeAndRecycle(),t=new vc(this),this.add(t),(n=ic(n,t))!==t&&this.add(n)}},t}(wc),lt=function(){function e(e){this.defaultValue=e}return e.prototype.call=function(e,t){return t.subscribe(new Fz(e,this.defaultValue))},e}(),Fz=function(e){function t(t,n){return(t=e.call(this,t)||this).defaultValue=n,t.isEmpty=!0,t}return O(t,e),t.prototype._next=function(e){this.isEmpty=!1,this.destination.next(e)},t.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},t}(ia),mt=function(){function e(e,t){this.delay=e,this.scheduler=t}return e.prototype.call=function(e,t){return t.subscribe(new Gz(e,this.delay,this.scheduler))},e}(),Gz=function(e){function t(t,n,r){return(t=e.call(this,t)||this).delay=n,t.scheduler=r,t.queue=[],t.active=!1,t.errored=!1,t}return O(t,e),t.dispatch=function(e){for(var t=e.source,n=t.queue,r=e.scheduler,i=e.destination;0<n.length&&0>=n[0].time-r.now();)n.shift().notification.observe(i);0<n.length?(t=Math.max(0,n[0].time-r.now()),this.schedule(e,t)):(this.unsubscribe(),t.active=!1)},t.prototype._schedule=function(e){this.active=!0,this.destination.add(e.schedule(t.dispatch,this.delay,{source:this,destination:this.destination,scheduler:e}))},t.prototype.scheduleNotification=function(e){if(!0!==this.errored){var t=this.scheduler;e=new Hz(t.now()+this.delay,e),this.queue.push(e),!1===this.active&&this._schedule(t)}},t.prototype._next=function(e){this.scheduleNotification(Ve.createNext(e))},t.prototype._error=function(e){this.errored=!0,this.queue=[],this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.scheduleNotification(Ve.createComplete()),this.unsubscribe()},t}(ia),Hz=function(e,t){this.time=e,this.notification=t},nt=function(){function e(e,t){this.keySelector=e,this.flushes=t}return e.prototype.call=function(e,t){return t.subscribe(new Iz(e,this.keySelector,this.flushes))},e}(),Iz=function(e){function t(t,n,r){return(t=e.call(this,t)||this).keySelector=n,t.values=new Set,r&&t.add(ic(r,new vc(t))),t}return O(t,e),t.prototype.notifyNext=function(){this.values.clear()},t.prototype.notifyError=function(e){this._error(e)},t.prototype._next=function(e){this.keySelector?this._useKeySelector(e):this._finalizeNext(e,e)},t.prototype._useKeySelector=function(e){var t=this.destination;try{var n=this.keySelector(e)}catch(e){return void t.error(e)}this._finalizeNext(n,e)},t.prototype._finalizeNext=function(e,t){var n=this.values;n.has(e)||(n.add(e),this.destination.next(t))},t}(wc),pt=function(){function e(e){this.errorFactory=e}return e.prototype.call=function(e,t){return t.subscribe(new Jz(e,this.errorFactory))},e}(),Jz=function(e){function t(t,n){return(t=e.call(this,t)||this).errorFactory=n,t.hasValue=!1,t}return O(t,e),t.prototype._next=function(e){this.hasValue=!0,this.destination.next(e)},t.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var e=void 0;try{e=this.errorFactory()}catch(t){e=t}this.destination.error(e)},t}(ia),qt=function(){function e(e){if(this.total=e,0>this.total)throw new Qk}return e.prototype.call=function(e,t){return t.subscribe(new Kz(e,this.total))},e}(),Kz=function(e){function t(t,n){return(t=e.call(this,t)||this).total=n,t.count=0,t}return O(t,e),t.prototype._next=function(e){var t=this.total,n=++this.count;n<=t&&(this.destination.next(e),n===t&&(this.destination.complete(),this.unsubscribe()))},t}(ia),rt=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new Lz(e,this.project))},e}(),Lz=function(e){function t(t,n){return(t=e.call(this,t)||this).project=n,t.hasSubscription=!1,t.hasCompleted=!1,t.index=0,t}return O(t,e),t.prototype._next=function(e){this.hasSubscription||this.tryNext(e)},t.prototype.tryNext=function(e){var t=this.index++;try{var n=this.project(e,t)}catch(e){return void this.destination.error(e)}this.hasSubscription=!0,this._innerSub(n)},t.prototype._innerSub=function(e){var t=new vc(this),n=this.destination;n.add(t),(e=ic(e,t))!==t&&n.add(e)},t.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},t}(wc),st=function(){function e(e){this.callback=e}return e.prototype.call=function(e,t){return t.subscribe(new Mz(e,this.callback))},e}(),Mz=function(e){function t(t,n){return(t=e.call(this,t)||this).add(new Oa(n)),t}return O(t,e),t}(ia),ut=function(){function e(){}return e.prototype.call=function(e,t){return t.subscribe(new Nz(e))},e}(),Nz=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype._next=function(e){},t}(ia),vt=function(){function e(e){if(this.total=e,0>this.total)throw new Qk}return e.prototype.call=function(e,t){return t.subscribe(new Oz(e,this.total))},e}(),Oz=function(e){function t(t,n){return(t=e.call(this,t)||this).total=n,t.ring=[],t.count=0,t}return O(t,e),t.prototype._next=function(e){var t=this.ring,n=this.total,r=this.count++;t.length<n?t.push(e):t[r%n]=e},t.prototype._complete=function(){var e=this.destination,t=this.count;if(0<t)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var o=t++%n;e.next(r[o])}e.complete()},t}(ia),wt=function(){function e(e){this.value=e}return e.prototype.call=function(e,t){return t.subscribe(new Pz(e,this.value))},e}(),Pz=function(e){function t(t,n){return(t=e.call(this,t)||this).value=n,t}return O(t,e),t.prototype._next=function(e){this.destination.next(this.value)},t}(ia),xt=function(){function e(e,t,n){void 0===n&&(n=!1),this.accumulator=e,this.seed=t,this.hasSeed=n}return e.prototype.call=function(e,t){return t.subscribe(new Qz(e,this.accumulator,this.seed,this.hasSeed))},e}(),Qz=function(e){function t(t,n,r,i){return(t=e.call(this,t)||this).accumulator=n,t._seed=r,t.hasSeed=i,t.index=0,t}return O(t,e),Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this.hasSeed=!0,this._seed=e},enumerable:!0,configurable:!0}),t.prototype._next=function(e){if(this.hasSeed)return this._tryNext(e);this.seed=e,this.destination.next(e)},t.prototype._tryNext=function(e){var t=this.index++;try{var n=this.accumulator(this.seed,e,t)}catch(e){this.destination.error(e)}this.seed=n,this.destination.next(n)},t}(ia),zt=function(){function e(e,t){this.subjectFactory=e,this.selector=t}return e.prototype.call=function(e,t){var n=this.selector,r=this.subjectFactory();return(e=n(r).subscribe(e)).add(t.subscribe(r)),e},e}(),Bt=function(){function e(e,t){this.notifier=e,this.source=t}return e.prototype.call=function(e,t){return t.subscribe(new Rz(e,this.notifier,this.source))},e}(),Rz=function(e){function t(t,n,r){return(t=e.call(this,t)||this).notifier=n,t.source=r,t}return O(t,e),t.prototype.error=function(t){if(!this.isStopped){var n=this.errors,r=this.retries,i=this.retriesSubscription;if(r)this.retriesSubscription=this.errors=void 0;else{n=new Pa;try{r=(0,this.notifier)(n)}catch(t){return e.prototype.error.call(this,t)}i=ic(r,new vc(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=i,n.next(t)}},t.prototype._unsubscribe=function(){var e=this.errors,t=this.retriesSubscription;e&&(e.unsubscribe(),this.errors=void 0),t&&(t.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},t.prototype.notifyNext=function(){var e=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=e,this.source.subscribe(this)},t}(wc),Et=function(){function e(e){this.project=e}return e.prototype.call=function(e,t){return t.subscribe(new Sz(e,this.project))},e}(),Sz=function(e){function t(t,n){return(t=e.call(this,t)||this).project=n,t.index=0,t}return O(t,e),t.prototype._next=function(e){var t=this.index++;try{var n=this.project(e,t)}catch(e){return void this.destination.error(e)}this._innerSub(n)},t.prototype._innerSub=function(e){var t=this.innerSubscription;t&&t.unsubscribe(),t=new vc(this);var n=this.destination;n.add(t),this.innerSubscription=ic(e,t),this.innerSubscription!==t&&n.add(this.innerSubscription)},t.prototype._complete=function(){var t=this.innerSubscription;t&&!t.closed||e.prototype._complete.call(this),this.unsubscribe()},t.prototype._unsubscribe=function(){this.innerSubscription=void 0},t.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&e.prototype._complete.call(this)},t.prototype.notifyNext=function(e){this.destination.next(e)},t}(wc),Ft=function(){function e(e){this.notifier=e}return e.prototype.call=function(e,t){e=new Tz(e);var n=ic(this.notifier,new vc(e));return n&&!e.seenValue?(e.add(n),t.subscribe(e)):e},e}(),Tz=function(e){function t(t){return(t=e.call(this,t)||this).seenValue=!1,t}return O(t,e),t.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},t.prototype.notifyComplete=function(){},t}(wc),Ht=function(){function e(e,t){this.predicate=e,this.inclusive=t}return e.prototype.call=function(e,t){return t.subscribe(new Uz(e,this.predicate,this.inclusive))},e}(),Uz=function(e){function t(t,n,r){return(t=e.call(this,t)||this).predicate=n,t.inclusive=r,t.index=0,t}return O(t,e),t.prototype._next=function(e){var t=this.destination;try{var n=this.predicate(e,this.index++)}catch(e){return void t.error(e)}this.nextOrComplete(e,n)},t.prototype.nextOrComplete=function(e,t){var n=this.destination;t?n.next(e):(this.inclusive&&n.next(e),n.complete())},t}(ia),It=function(){function e(e,t,n){this.nextOrObserver=e,this.error=t,this.complete=n}return e.prototype.call=function(e,t){return t.subscribe(new Vz(e,this.nextOrObserver,this.error,this.complete))},e}(),Vz=function(e){function t(t,n,r,i){return(t=e.call(this,t)||this)._tapNext=hc,t._tapError=hc,t._tapComplete=hc,t._tapError=r||hc,t._tapComplete=i||hc,le(n)?(t._context=t,t._tapNext=n):n&&(t._context=n,t._tapNext=n.next||hc,t._tapError=n.error||hc,t._tapComplete=n.complete||hc),t}return O(t,e),t.prototype._next=function(e){try{this._tapNext.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.next(e)},t.prototype._error=function(e){try{this._tapError.call(this._context,e)}catch(e){return void this.destination.error(e)}this.destination.error(e)},t.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(e){return void this.destination.error(e)}return this.destination.complete()},t}(ia),Kt={leading:!0,trailing:!1};!function(e){function t(t,n,r,i){var o=e.call(this,t)||this;return o.destination=t,o.durationSelector=n,o._leading=r,o._trailing=i,o._hasValue=!1,o}O(t,e),t.prototype._next=function(e){this._hasValue=!0,this._sendValue=e,this._throttled||(this._leading?this.send():this.throttle(e))},t.prototype.send=function(){var e=this._sendValue;this._hasValue&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=void 0},t.prototype.throttle=function(e){(e=this.tryDurationSelector(e))&&this.add(this._throttled=ic(e,new vc(this)))},t.prototype.tryDurationSelector=function(e){try{return this.durationSelector(e)}catch(e){return this.destination.error(e),null}},t.prototype.throttlingDone=function(){var e=this._throttled,t=this._trailing;e&&e.unsubscribe(),this._throttled=void 0,t&&this.send()},t.prototype.notifyNext=function(){this.throttlingDone()},t.prototype.notifyComplete=function(){this.throttlingDone()}}(wc);for(var Lt=function(){function e(e,t,n,r){this.duration=e,this.scheduler=t,this.leading=n,this.trailing=r}return e.prototype.call=function(e,t){return t.subscribe(new Wz(e,this.duration,this.scheduler,this.leading,this.trailing))},e}(),Wz=function(e){function t(t,n,r,i,o){return(t=e.call(this,t)||this).duration=n,t.scheduler=r,t.leading=i,t.trailing=o,t._hasTrailingValue=!1,t._trailingValue=null,t}return O(t,e),t.prototype._next=function(e){this.throttled?this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Mt,this.duration,{subscriber:this})),this.leading?this.destination.next(e):this.trailing&&(this._trailingValue=e,this._hasTrailingValue=!0))},t.prototype._complete=function(){this._hasTrailingValue&&this.destination.next(this._trailingValue),this.destination.complete()},t.prototype.clearThrottle=function(){var e=this.throttled;e&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),e.unsubscribe(),this.remove(e),this.throttled=null)},t}(ia),Ot=function(){function e(e,t,n,r){this.waitFor=e,this.absoluteTimeout=t,this.withObservable=n,this.scheduler=r}return e.prototype.call=function(e,t){return t.subscribe(new Xz(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},e}(),Xz=function(e){function t(t,n,r,i,o){return(t=e.call(this,t)||this).absoluteTimeout=n,t.waitFor=r,t.withObservable=i,t.scheduler=o,t.scheduleTimeout(),t}return O(t,e),t.dispatchTimeout=function(e){var t=e.withObservable;e._unsubscribeAndRecycle(),e.add(ic(t,new vc(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(t){this.absoluteTimeout||this.scheduleTimeout(),e.prototype._next.call(this,t)},t.prototype._unsubscribe=function(){this.action=void 0,this.withObservable=this.scheduler=null},t}(wc),Qt=function(){function e(e,t){this.observables=e,this.project=t}return e.prototype.call=function(e,t){return t.subscribe(new Yz(e,this.observables,this.project))},e}(),Yz=function(e){function t(t,n,r){(t=e.call(this,t)||this).observables=n,t.project=r,t.toRespond=[],r=n.length,t.values=Array(r);for(var i=0;i<r;i++)t.toRespond.push(i);for(i=0;i<r;i++)t.add(ji(t,n[i],void 0,i));return t}return O(t,e),t.prototype.notifyNext=function(e,t,n){this.values[n]=t,0<(e=this.toRespond).length&&(-1!==(n=e.indexOf(n))&&e.splice(n,1))},t.prototype.notifyComplete=function(){},t.prototype._next=function(e){0===this.toRespond.length&&(e=[e].concat(this.values),this.project?this._tryProject(e):this.destination.next(e))},t.prototype._tryProject=function(e){try{var t=this.project.apply(this,e)}catch(e){return void this.destination.error(e)}this.destination.next(t)},t}(Rk),Jq=$a((function(e){var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var r=Array(16);e.exports=function(){for(var e,t=0;16>t;t++)0==(3&t)&&(e=4294967296*Math.random()),r[t]=e>>>((3&t)<<3)&255;return r}}})),ab=[],Gh=0;256>Gh;++Gh)ab[Gh]=(Gh+256).toString(16).substr(1);var Kq=function(e,t){return t=t||0,[ab[e[t++]],ab[e[t++]],ab[e[t++]],ab[e[t++]],"-",ab[e[t++]],ab[e[t++]],"-",ab[e[t++]],ab[e[t++]],"-",ab[e[t++]],ab[e[t++]],"-",ab[e[t++]],ab[e[t++]],ab[e[t++]],ab[e[t++]],ab[e[t++]],ab[e[t++]]].join("")},Ud=function(e,t,n){if(n=t&&n||0,"string"==typeof e&&(t="binary"===e?Array(16):null,e=null),(e=(e=e||{}).random||(e.rng||Jq)())[6]=15&e[6]|64,e[8]=63&e[8]|128,t)for(var r=0;16>r;++r)t[n+r]=e[r];return t||Kq(e)},gg=Ud(),Uk=!1,Pc,rd,Vk,Wk,sd,Vd,ec,We,Rb,Xk,Qc,Wd,Rc,Sc,Tc,Xe,Uc,Vc;!function(e){e[e.ATTRIBUTE_OPERATION_ERR_FAILURE=2]="ATTRIBUTE_OPERATION_ERR_FAILURE",e[e.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT=3]="ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT",e[e.ATTRIBUTE_OPERATION_ERR_SIZE_OVERFLOW=4]="ATTRIBUTE_OPERATION_ERR_SIZE_OVERFLOW",e[e.ATTRIBUTE_OPERATION_ERR_TOO_OFTEN=5]="ATTRIBUTE_OPERATION_ERR_TOO_OFTEN",e[e.ATTRIBUTE_OPERATION_ERR_USER_NOT_FOUND=6]="ATTRIBUTE_OPERATION_ERR_USER_NOT_FOUND",e[e.ATTRIBUTE_OPERATION_ERR_TIMEOUT=7]="ATTRIBUTE_OPERATION_ERR_TIMEOUT",e[e.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN=102]="ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN"}(Pc||(Pc={})),function(e){e[e.CHANNEL_MESSAGE_ERR_FAILURE=1]="CHANNEL_MESSAGE_ERR_FAILURE",e[e.CHANNEL_MESSAGE_ERR_TIMEOUT=2]="CHANNEL_MESSAGE_ERR_TIMEOUT",e[e.CHANNEL_MESSAGE_ERR_TOO_OFTEN=3]="CHANNEL_MESSAGE_ERR_TOO_OFTEN",e[e.CHANNEL_MESSAGE_ERR_INVALID_MESSAGE=4]="CHANNEL_MESSAGE_ERR_INVALID_MESSAGE",e[e.CHANNEL_MESSAGE_ERR_NOT_IN_CHANNEL=5]="CHANNEL_MESSAGE_ERR_NOT_IN_CHANNEL",e[e.CHANNEL_MESSAGE_ERR_USER_NOT_LOGGED_IN=102]="CHANNEL_MESSAGE_ERR_USER_NOT_LOGGED_IN"}(rd||(rd={})),function(e){e[e.CREATE_CHANNEL_ERR_INVALID_ARGUMENT=1]="CREATE_CHANNEL_ERR_INVALID_ARGUMENT"}(Vk||(Vk={})),function(e){e[e.CREATE_INSTANCE_ERR_INVALID_ARGUMENT=1]="CREATE_INSTANCE_ERR_INVALID_ARGUMENT"}(Wk||(Wk={})),function(e){e[e.GET_MEMBERS_ERR_FAILURE=1]="GET_MEMBERS_ERR_FAILURE",e[e.GET_MEMBERS_ERR_REJECTED=2]="GET_MEMBERS_ERR_REJECTED",e[e.GET_MEMBERS_ERR_TIMEOUT=3]="GET_MEMBERS_ERR_TIMEOUT",e[e.GET_MEMBERS_ERR_TOO_OFTEN=4]="GET_MEMBERS_ERR_TOO_OFTEN",e[e.GET_MEMBERS_ERR_NOT_IN_CHANNEL=5]="GET_MEMBERS_ERR_NOT_IN_CHANNEL",e[e.GET_MEMBERS_ERR_USER_NOT_LOGGED_IN=102]="GET_MEMBERS_ERR_USER_NOT_LOGGED_IN"}(sd||(sd={})),function(e){e[e.INVITATION_API_CALL_ERR_INVALID_ARGUMENT=1]="INVITATION_API_CALL_ERR_INVALID_ARGUMENT",e[e.INVITATION_API_CALL_ERR_NOT_STARTED=2]="INVITATION_API_CALL_ERR_NOT_STARTED",e[e.INVITATION_API_CALL_ERR_ALREADY_END=3]="INVITATION_API_CALL_ERR_ALREADY_END",e[e.INVITATION_API_CALL_ERR_ALREADY_ACCEPT=4]="INVITATION_API_CALL_ERR_ALREADY_ACCEPT",e[e.INVITATION_API_CALL_ERR_ALREADY_SENT=5]="INVITATION_API_CALL_ERR_ALREADY_SENT"}(Vd||(Vd={})),function(e){e[e.JOIN_CHANNEL_ERR_FAILURE=1]="JOIN_CHANNEL_ERR_FAILURE",e[e.JOIN_CHANNEL_ERR_REJECTED=2]="JOIN_CHANNEL_ERR_REJECTED",e[e.JOIN_CHANNEL_ERR_INVALID_ARGUMENT=3]="JOIN_CHANNEL_ERR_INVALID_ARGUMENT",e[e.JOIN_CHANNEL_TIMEOUT=4]="JOIN_CHANNEL_TIMEOUT",e[e.JOIN_CHANNEL_ERR_EXCEED_LIMIT=5]="JOIN_CHANNEL_ERR_EXCEED_LIMIT",e[e.JOIN_CHANNEL_ERR_ALREADY_JOINED=6]="JOIN_CHANNEL_ERR_ALREADY_JOINED",e[e.JOIN_CHANNEL_ERR_TOO_OFTEN=7]="JOIN_CHANNEL_ERR_TOO_OFTEN",e[e.JOIN_CHANNEL_ERR_JOIN_SAME_CHANNEL_TOO_OFTEN=8]="JOIN_CHANNEL_ERR_JOIN_SAME_CHANNEL_TOO_OFTEN",e[e.JOIN_CHANNEL_ERR_USER_NOT_LOGGED_IN=102]="JOIN_CHANNEL_ERR_USER_NOT_LOGGED_IN",e[e.JOIN_CHANNEL_ERR_ABORTED_BY_LEAVE=201]="JOIN_CHANNEL_ERR_ABORTED_BY_LEAVE",e[e.JOIN_CHANNEL_ERR_ALREADY_JOINED_CHANNEL_OF_SAME_ID=202]="JOIN_CHANNEL_ERR_ALREADY_JOINED_CHANNEL_OF_SAME_ID"}(ec||(ec={})),function(e){e[e.LEAVE_CHANNEL_ERR_FAILURE=1]="LEAVE_CHANNEL_ERR_FAILURE",e[e.LEAVE_CHANNEL_ERR_REJECTED=2]="LEAVE_CHANNEL_ERR_REJECTED",e[e.LEAVE_CHANNEL_ERR_NOT_IN_CHANNEL=3]="LEAVE_CHANNEL_ERR_NOT_IN_CHANNEL",e[e.LEAVE_CHANNEL_ERR_USER_NOT_LOGGED_IN=102]="LEAVE_CHANNEL_ERR_USER_NOT_LOGGED_IN"}(We||(We={})),function(e){e[e.LOGIN_ERR_UNKNOWN=1]="LOGIN_ERR_UNKNOWN",e[e.LOGIN_ERR_REJECTED=2]="LOGIN_ERR_REJECTED",e[e.LOGIN_ERR_INVALID_ARGUMENT=3]="LOGIN_ERR_INVALID_ARGUMENT",e[e.LOGIN_ERR_INVALID_APP_ID=4]="LOGIN_ERR_INVALID_APP_ID",e[e.LOGIN_ERR_INVALID_TOKEN=5]="LOGIN_ERR_INVALID_TOKEN",e[e.LOGIN_ERR_TOKEN_EXPIRED=6]="LOGIN_ERR_TOKEN_EXPIRED",e[e.LOGIN_ERR_NOT_AUTHORIZED=7]="LOGIN_ERR_NOT_AUTHORIZED",e[e.LOGIN_ERR_ALREADY_LOGIN=8]="LOGIN_ERR_ALREADY_LOGIN",e[e.LOGIN_ERR_TIMEOUT=9]="LOGIN_ERR_TIMEOUT",e[e.LOGIN_ERR_TOO_OFTEN=10]="LOGIN_ERR_TOO_OFTEN",e[e.LOGIN_ERR_ABORTED_BY_LOGOUT=201]="LOGIN_ERR_ABORTED_BY_LOGOUT"}(Rb||(Rb={})),function(e){e[e.LOGOUT_ERR_USER_NOT_LOGGED_IN=102]="LOGOUT_ERR_USER_NOT_LOGGED_IN"}(Xk||(Xk={})),function(e){e[e.PEER_MESSAGE_ERR_FAILURE=1]="PEER_MESSAGE_ERR_FAILURE",e[e.PEER_MESSAGE_ERR_TIMEOUT=2]="PEER_MESSAGE_ERR_TIMEOUT",e[e.PEER_MESSAGE_ERR_TOO_OFTEN=5]="PEER_MESSAGE_ERR_TOO_OFTEN",e[e.PEER_MESSAGE_ERR_INVALID_USERID=6]="PEER_MESSAGE_ERR_INVALID_USERID",e[e.PEER_MESSAGE_ERR_INVALID_MESSAGE=7]="PEER_MESSAGE_ERR_INVALID_MESSAGE",e[e.PEER_MESSAGE_ERR_INCOMPATIBLE_MESSAGE=8]="PEER_MESSAGE_ERR_INCOMPATIBLE_MESSAGE",e[e.PEER_MESSAGE_ERR_USER_NOT_LOGGED_IN=102]="PEER_MESSAGE_ERR_USER_NOT_LOGGED_IN"}(Qc||(Qc={})),function(e){e[e.QUERY_PEERS_ONLINE_STATUS_ERR_INVALID_ARGUMENT=2]="QUERY_PEERS_ONLINE_STATUS_ERR_INVALID_ARGUMENT",e[e.QUERY_PEERS_ONLINE_STATUS_ERR_REJECTED=3]="QUERY_PEERS_ONLINE_STATUS_ERR_REJECTED",e[e.QUERY_PEERS_ONLINE_STATUS_ERR_TIMEOUT=4]="QUERY_PEERS_ONLINE_STATUS_ERR_TIMEOUT",e[e.QUERY_PEERS_ONLINE_STATUS_ERR_TOO_OFTEN=5]="QUERY_PEERS_ONLINE_STATUS_ERR_TOO_OFTEN",e[e.QUERY_PEERS_ONLINE_STATUS_ERR_USER_NOT_LOGGED_IN=102]="QUERY_PEERS_ONLINE_STATUS_ERR_USER_NOT_LOGGED_IN"}(Wd||(Wd={})),function(e){e[e.RENEW_TOKEN_ERR_FAILURE=1]="RENEW_TOKEN_ERR_FAILURE",e[e.RENEW_TOKEN_ERR_INVALID_ARGUMENT=2]="RENEW_TOKEN_ERR_INVALID_ARGUMENT",e[e.RENEW_TOKEN_ERR_REJECTED=3]="RENEW_TOKEN_ERR_REJECTED",e[e.RENEW_TOKEN_ERR_TOO_OFTEN=4]="RENEW_TOKEN_ERR_TOO_OFTEN",e[e.RENEW_TOKEN_ERR_TOKEN_EXPIRED=5]="RENEW_TOKEN_ERR_TOKEN_EXPIRED",e[e.RENEW_TOKEN_ERR_INVALID_TOKEN=6]="RENEW_TOKEN_ERR_INVALID_TOKEN",e[e.RENEW_TOKEN_ERR_USER_NOT_LOGGED_IN=102]="RENEW_TOKEN_ERR_USER_NOT_LOGGED_IN",e[e.RENEW_TOKEN_ERR_ABORTED_BY_LOGOUT=201]="RENEW_TOKEN_ERR_ABORTED_BY_LOGOUT"}(Rc||(Rc={})),function(e){e[e.GET_CHANNEL_MEMBER_COUNT_ERR_FAILURE=1]="GET_CHANNEL_MEMBER_COUNT_ERR_FAILURE",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_INVALID_ARGUMENT=2]="GET_CHANNEL_MEMBER_COUNT_ERR_INVALID_ARGUMENT",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_TOO_OFTEN=3]="GET_CHANNEL_MEMBER_COUNT_ERR_TOO_OFTEN",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_TIMEOUT=4]="GET_CHANNEL_MEMBER_COUNT_ERR_TIMEOUT",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_EXCEED_LIMIT=5]="GET_CHANNEL_MEMBER_COUNT_ERR_EXCEED_LIMIT",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_NOT_INITIALIZED=101]="GET_CHANNEL_MEMBER_COUNT_ERR_NOT_INITIALIZED",e[e.GET_CHANNEL_MEMBER_COUNT_ERR_USER_NOT_LOGGED_IN=102]="GET_CHANNEL_MEMBER_COUNT_ERR_USER_NOT_LOGGED_IN"}(Sc||(Sc={})),function(e){e[e.PEER_SUBSCRIPTION_STATUS_ERR_FAILURE=1]="PEER_SUBSCRIPTION_STATUS_ERR_FAILURE",e[e.PEER_SUBSCRIPTION_STATUS_ERR_INVALID_ARGUMENT=2]="PEER_SUBSCRIPTION_STATUS_ERR_INVALID_ARGUMENT",e[e.PEER_SUBSCRIPTION_STATUS_ERR_REJECTED=3]="PEER_SUBSCRIPTION_STATUS_ERR_REJECTED",e[e.PEER_SUBSCRIPTION_STATUS_ERR_TIMEOUT=4]="PEER_SUBSCRIPTION_STATUS_ERR_TIMEOUT",e[e.PEER_SUBSCRIPTION_STATUS_ERR_TOO_OFTEN=5]="PEER_SUBSCRIPTION_STATUS_ERR_TOO_OFTEN",e[e.PEER_SUBSCRIPTION_STATUS_ERR_OVERFLOW=6]="PEER_SUBSCRIPTION_STATUS_ERR_OVERFLOW",e[e.PEER_SUBSCRIPTION_STATUS_ERR_USER_NOT_LOGGED_IN=102]="PEER_SUBSCRIPTION_STATUS_ERR_USER_NOT_LOGGED_IN"}(Tc||(Tc={})),function(e){e[e.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_FAILURE=1]="QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_FAILURE",e[e.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_TIMEOUT=2]="QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_TIMEOUT",e[e.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_TOO_OFTEN=3]="QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_TOO_OFTEN",e[e.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_USER_NOT_LOGGED_IN=102]="QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_USER_NOT_LOGGED_IN"}(Xe||(Xe={})),function(e){e[e.UPLOAD_MEDIA_ERR_FAILURE=1]="UPLOAD_MEDIA_ERR_FAILURE",e[e.UPLOAD_MEDIA_ERR_INVALID_ARGUMENT=2]="UPLOAD_MEDIA_ERR_INVALID_ARGUMENT",e[e.UPLOAD_MEDIA_ERR_TIMEOUT=3]="UPLOAD_MEDIA_ERR_TIMEOUT",e[e.UPLOAD_MEDIA_ERR_SIZE_OVERFLOW=4]="UPLOAD_MEDIA_ERR_SIZE_OVERFLOW",e[e.UPLOAD_MEDIA_ERR_CONCURRENCY_LIMIT_EXCEEDED=5]="UPLOAD_MEDIA_ERR_CONCURRENCY_LIMIT_EXCEEDED",e[e.UPLOAD_MEDIA_ERR_INTERRUPTED=6]="UPLOAD_MEDIA_ERR_INTERRUPTED",e[e.UPLOAD_MEDIA_ERR_NOT_LOGGED_IN=102]="UPLOAD_MEDIA_ERR_NOT_LOGGED_IN"}(Uc||(Uc={})),function(e){e[e.DOWNLOAD_MEDIA_ERR_FAILURE=1]="DOWNLOAD_MEDIA_ERR_FAILURE",e[e.DOWNLOAD_MEDIA_ERR_INVALID_ARGUMENT=2]="DOWNLOAD_MEDIA_ERR_INVALID_ARGUMENT",e[e.DOWNLOAD_MEDIA_ERR_TIMEOUT=3]="DOWNLOAD_MEDIA_ERR_TIMEOUT",e[e.DOWNLOAD_MEDIA_ERR_NOT_EXIST=4]="DOWNLOAD_MEDIA_ERR_NOT_EXIST",e[e.DOWNLOAD_MEDIA_ERR_CONCURRENCY_LIMIT_EXCEEDED=5]="DOWNLOAD_MEDIA_ERR_CONCURRENCY_LIMIT_EXCEEDED",e[e.DOWNLOAD_MEDIA_ERR_INTERRUPTED=6]="DOWNLOAD_MEDIA_ERR_INTERRUPTED",e[e.DOWNLOAD_MEDIA_ERR_NOT_LOGGED_IN=102]="DOWNLOAD_MEDIA_ERR_NOT_LOGGED_IN"}(Vc||(Vc={}));var Sb=Pc.ATTRIBUTE_OPERATION_ERR_FAILURE,Ja=Pc.ATTRIBUTE_OPERATION_ERR_INVALID_ARGUMENT,se=Pc.ATTRIBUTE_OPERATION_ERR_SIZE_OVERFLOW;Pc.ATTRIBUTE_OPERATION_ERR_TOO_OFTEN;var Lq=Pc.ATTRIBUTE_OPERATION_ERR_USER_NOT_FOUND,Tb=Pc.ATTRIBUTE_OPERATION_ERR_TIMEOUT,Ub=Pc.ATTRIBUTE_OPERATION_ERR_USER_NOT_LOGGED_IN,hg=rd.CHANNEL_MESSAGE_ERR_FAILURE,Yk=rd.CHANNEL_MESSAGE_ERR_TIMEOUT,Mq=rd.CHANNEL_MESSAGE_ERR_TOO_OFTEN,Hh=rd.CHANNEL_MESSAGE_ERR_INVALID_MESSAGE;rd.CHANNEL_MESSAGE_ERR_NOT_IN_CHANNEL;var ig=rd.CHANNEL_MESSAGE_ERR_USER_NOT_LOGGED_IN,Zz=Vk.CREATE_CHANNEL_ERR_INVALID_ARGUMENT,Nq=Wk.CREATE_INSTANCE_ERR_INVALID_ARGUMENT;Sc.GET_CHANNEL_MEMBER_COUNT_ERR_FAILURE;var Oq=Sc.GET_CHANNEL_MEMBER_COUNT_ERR_INVALID_ARGUMENT;Sc.GET_CHANNEL_MEMBER_COUNT_ERR_TOO_OFTEN;var Pq=Sc.GET_CHANNEL_MEMBER_COUNT_ERR_TIMEOUT,$z=Sc.GET_CHANNEL_MEMBER_COUNT_ERR_EXCEED_LIMIT;Sc.GET_CHANNEL_MEMBER_COUNT_ERR_NOT_INITIALIZED;var aA=Sc.GET_CHANNEL_MEMBER_COUNT_ERR_USER_NOT_LOGGED_IN,bA=sd.GET_MEMBERS_ERR_FAILURE,cA=sd.GET_MEMBERS_ERR_REJECTED;sd.GET_MEMBERS_ERR_TIMEOUT,sd.GET_MEMBERS_ERR_TOO_OFTEN;var dA=sd.GET_MEMBERS_ERR_NOT_IN_CHANNEL,eA=sd.GET_MEMBERS_ERR_USER_NOT_LOGGED_IN,xc=Vd.INVITATION_API_CALL_ERR_INVALID_ARGUMENT,fA=Vd.INVITATION_API_CALL_ERR_NOT_STARTED,Ih=Vd.INVITATION_API_CALL_ERR_ALREADY_END,Qq=Vd.INVITATION_API_CALL_ERR_ALREADY_ACCEPT,gA=Vd.INVITATION_API_CALL_ERR_ALREADY_SENT,Rq=ec.JOIN_CHANNEL_ERR_FAILURE;ec.JOIN_CHANNEL_ERR_REJECTED;var hA=ec.JOIN_CHANNEL_ERR_INVALID_ARGUMENT,Sq=ec.JOIN_CHANNEL_TIMEOUT,Tq=ec.JOIN_CHANNEL_ERR_EXCEED_LIMIT,Uq=ec.JOIN_CHANNEL_ERR_ALREADY_JOINED;ec.JOIN_CHANNEL_ERR_TOO_OFTEN;var Vq=ec.JOIN_CHANNEL_ERR_USER_NOT_LOGGED_IN,Wq=ec.JOIN_CHANNEL_ERR_ALREADY_JOINED_CHANNEL_OF_SAME_ID,Xq=We.LEAVE_CHANNEL_ERR_FAILURE,Yq=We.LEAVE_CHANNEL_ERR_REJECTED,iA=We.LEAVE_CHANNEL_ERR_NOT_IN_CHANNEL,jA=We.LEAVE_CHANNEL_ERR_USER_NOT_LOGGED_IN,Zq=Rb.LOGIN_ERR_UNKNOWN,jg=Rb.LOGIN_ERR_REJECTED,Jh=Rb.LOGIN_ERR_INVALID_ARGUMENT,$q=Rb.LOGIN_ERR_INVALID_APP_ID,ar=Rb.LOGIN_ERR_INVALID_TOKEN,Kh=Rb.LOGIN_ERR_TOKEN_EXPIRED;Rb.LOGIN_ERR_NOT_AUTHORIZED;var kA=Rb.LOGIN_ERR_ALREADY_LOGIN,lA=Rb.LOGIN_ERR_TIMEOUT,mA=Rb.LOGIN_ERR_TOO_OFTEN,br=Xk.LOGOUT_ERR_USER_NOT_LOGGED_IN,cr=Qc.PEER_MESSAGE_ERR_FAILURE,Zk=Qc.PEER_MESSAGE_ERR_TIMEOUT,dr=Qc.PEER_MESSAGE_ERR_TOO_OFTEN,$k=Qc.PEER_MESSAGE_ERR_INVALID_USERID,ve=Qc.PEER_MESSAGE_ERR_INVALID_MESSAGE,al=Qc.PEER_MESSAGE_ERR_USER_NOT_LOGGED_IN,nA=Qc.PEER_MESSAGE_ERR_INCOMPATIBLE_MESSAGE,er=Wd.QUERY_PEERS_ONLINE_STATUS_ERR_INVALID_ARGUMENT;Wd.QUERY_PEERS_ONLINE_STATUS_ERR_REJECTED;var oA=Wd.QUERY_PEERS_ONLINE_STATUS_ERR_TIMEOUT;Wd.QUERY_PEERS_ONLINE_STATUS_ERR_TOO_OFTEN;var pA=Wd.QUERY_PEERS_ONLINE_STATUS_ERR_USER_NOT_LOGGED_IN,qA=Rc.RENEW_TOKEN_ERR_FAILURE,rA=Rc.RENEW_TOKEN_ERR_INVALID_ARGUMENT;Rc.RENEW_TOKEN_ERR_REJECTED,Rc.RENEW_TOKEN_ERR_TOO_OFTEN;var sA=Rc.RENEW_TOKEN_ERR_TOKEN_EXPIRED,tA=Rc.RENEW_TOKEN_ERR_INVALID_TOKEN,uA=Rc.RENEW_TOKEN_ERR_USER_NOT_LOGGED_IN,fr=Tc.PEER_SUBSCRIPTION_STATUS_ERR_FAILURE,kg=Tc.PEER_SUBSCRIPTION_STATUS_ERR_INVALID_ARGUMENT;Tc.PEER_SUBSCRIPTION_STATUS_ERR_REJECTED;var vA=Tc.PEER_SUBSCRIPTION_STATUS_ERR_TIMEOUT;Tc.PEER_SUBSCRIPTION_STATUS_ERR_TOO_OFTEN;var gr=Tc.PEER_SUBSCRIPTION_STATUS_ERR_OVERFLOW,bl=Tc.PEER_SUBSCRIPTION_STATUS_ERR_USER_NOT_LOGGED_IN;Xe.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_FAILURE,Xe.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_TIMEOUT,Xe.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_TOO_OFTEN,Xe.QUERY_PEERS_BY_SUBSCRIPTION_OPTION_ERR_USER_NOT_LOGGED_IN;var lg=Uc.UPLOAD_MEDIA_ERR_FAILURE,wf=Uc.UPLOAD_MEDIA_ERR_INVALID_ARGUMENT,Lh=Uc.UPLOAD_MEDIA_ERR_TIMEOUT,wA=Uc.UPLOAD_MEDIA_ERR_SIZE_OVERFLOW,xA=Uc.UPLOAD_MEDIA_ERR_CONCURRENCY_LIMIT_EXCEEDED,hr=Uc.UPLOAD_MEDIA_ERR_INTERRUPTED,yA=Uc.UPLOAD_MEDIA_ERR_NOT_LOGGED_IN,mg=Vc.DOWNLOAD_MEDIA_ERR_FAILURE,cl=Vc.DOWNLOAD_MEDIA_ERR_INVALID_ARGUMENT,zA=Vc.DOWNLOAD_MEDIA_ERR_TIMEOUT,AA=Vc.DOWNLOAD_MEDIA_ERR_NOT_EXIST,BA=Vc.DOWNLOAD_MEDIA_ERR_CONCURRENCY_LIMIT_EXCEEDED,ir=Vc.DOWNLOAD_MEDIA_ERR_INTERRUPTED,CA=Vc.DOWNLOAD_MEDIA_ERR_NOT_LOGGED_IN,DA=function(e,t){var n;return Hk(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n},Mh=function(e,t,n){if(!lb(n))return!1;var r=X(t);return!!("number"==r?Ed(n)&&wk(t,n.length):"string"==r&&t in n)&&$f(n[t],e)},dl=function(e,t,n){var r=Va(e)?tq:DA;return n&&Mh(e,t,n)&&(t=void 0),r(e,Te(t))},EA=function(e,t){var n=-1,r=Ed(e)?Array(e.length):[];return Hk(e,(function(e,i,o){r[++n]=t(e,i,o)})),r},FA=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e},GA=function(e,t,n){t=t.length?he(t,(function(e){return Va(e)?function(t){return Ch(t,1===e.length?e[0]:e)}:e})):[Dh];var r=-1;return t=he(t,zh(Te)),e=EA(e,(function(e,n,i){return{criteria:he(t,(function(t){return t(e)})),index:++r,value:e}})),FA(e,(function(e,t){e:{for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r<a;){t:{var u=i[r],c=o[r];if(u!==c){var l=void 0!==u,f=null===u,h=u==u,p=ie(u),d=void 0!==c,v=null===c,b=c==c,g=ie(c);if(!v&&!g&&!p&&u>c||p&&d&&b&&!v&&!g||f&&d&&b||!l&&b||!h){u=1;break t}if(!f&&!p&&!g&&u<c||g&&l&&h&&!f&&!p||v&&l&&h||!d&&h||!b){u=-1;break t}}u=0}if(u){e=r>=s?u:u*("desc"==n[r]?-1:1);break e}}e=e.index-t.index}return e}))},jr=function(e,t){return rq(qq(e,t,Dh),e+"")},kr=jr((function(e,t){if(null==e)return[];var n=t.length;return 1<n&&Mh(e,t[0],t[1])?t=[]:2<n&&Mh(t[0],t[1],t[2])&&(t=[t[0]]),GA(e,$h(t,1),[])})),lr=function(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})})),t}(Dz),mr=$a((function(e,t){Object.defineProperty(t,"__esModule",{value:!0});var n=[],r=function(e,t){return new WebSocket(e,t)};t.normalClosureMessage="Normal closure",t.default=function(e,i){var o=(i=void 0===i?{protocols:n,makeWebSocket:r}:i).protocols,a=void 0===o?n:o,s=void 0===(i=i.makeWebSocket)?r:i;return new lr.Observable((function(n){var r,i=new lr.Subject,o=s(e,a),u=!1,c=!1,l=function(e){if(r)throw u=!0,e=Error("Web socket message factory function called more than once"),n.error(e),e;return r=e.subscribe((function(e){o.send(e)})),i};return o.onopen=function(){c?(u=!0,o.close()):n.next(l)},o.onmessage=function(e){i.next(e.data)},o.onerror=function(e){u=!0,n.error(Error(e.message))},o.onclose=function(e){u||(u=!0,c?(n.complete(),i.complete()):n.error(Error(1e3===e.code?t.normalClosureMessage:e.reason)))},function(){c=!0,r&&r.unsubscribe(),u||(u=!0,o.close())}}))}}));!function(e){e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")&&e.default}(mr);var pi=function(e,t,n){(void 0===n||$f(e[t],n))&&(void 0!==n||t in e)||bg(e,t,n)},oi=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]},HA=function(e){return jr((function(t,n){var r=-1,i=n.length,o=1<i?n[i-1]:void 0,a=2<i?n[2]:void 0;for(o=3<e.length&&"function"==typeof o?(i--,o):void 0,a&&Mh(n[0],n[1],a)&&(o=3>i?void 0:o,i=1),t=Object(t);++r<i;)(a=n[r])&&e(t,a,r,o);return t}))}((function(e,t,n,r){tm(e,t,n,r)})),IA=Math.floor,JA=Math.random,nr=function(e,t){return e+IA(JA()*(t-e+1))},or=function(e){var t=e.length;return t?e[nr(0,t-1)]:void 0},KA=function(e,t){return he(t,(function(t){return e[t]}))},Ni=function(e){return null==e?[]:KA(e,Ad(e))},LA=function(e){return or(Ni(e))},bn=function(e){return(Va(e)?or:LA)(e)},xm=[],ym=function(e,t){return new WebSocket(e,t)},MA=Math.floor;N({target:"Number",stat:!0},{isInteger:function(e){return!ha(e)&&isFinite(e)&&MA(e)===e}}),Oo("from",Ej,Dj);var NA=function(e,t){for(var n=Array(arguments.length-1),r=0,i=2,o=!0;i<arguments.length;)n[r++]=arguments[i++];return new Promise((function(i,a){n[r]=function(e){if(o)if(o=!1,e)a(e);else{for(var t=Array(arguments.length-1),n=0;n<t.length;)t[n++]=arguments[n];i.apply(null,t)}};try{e.apply(t||null,n)}catch(e){o&&(o=!1,a(e))}}))},OA=$a((function(e,t){t.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;1<--t%4&&"="===e.charAt(t);)++n;return Math.ceil(3*e.length)/4-n};var n=Array(64),r=Array(123);for(e=0;64>e;)r[n[e]=26>e?e+65:52>e?e+71:62>e?e-4:e-59|43]=e++;t.encode=function(e,t,r){for(var i,o=null,a=[],s=0,u=0;t<r;){var c=e[t++];switch(u){case 0:a[s++]=n[c>>2],i=(3&c)<<4,u=1;break;case 1:a[s++]=n[i|c>>4],i=(15&c)<<2,u=2;break;case 2:a[s++]=n[i|c>>6],a[s++]=n[63&c],u=0}8191<s&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=n[i],a[s++]=61,1===u&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))},t.decode=function(e,t,n){for(var i,o=n,a=0,s=0;s<e.length;){var u=e.charCodeAt(s++);if(61===u&&1<a)break;if(void 0===(u=r[u]))throw Error("invalid encoding");switch(a){case 0:i=u,a=1;break;case 1:t[n++]=i<<2|(48&u)>>4,i=u,a=2;break;case 2:t[n++]=(15&i)<<4|(60&u)>>2,i=u,a=3;break;case 3:t[n++]=(3&i)<<6|u,a=0}}if(1===a)throw Error("invalid encoding");return n-o},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}}));yg.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this},yg.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else{e=this._listeners[e];for(var n=0;n<e.length;)e[n].fn===t?e.splice(n,1):++n}return this},yg.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],r=1;r<arguments.length;)n.push(arguments[r++]);for(r=0;r<t.length;)t[r].fn.apply(t[r++].ctx,n)}return this};var PA=zm(zm),QA=function(c){try{var a=eval("quire".replace(/^/,"re"))(c);if(a&&(a.length||Object.keys(a).length))return a}catch(e){}return null},RA=$a((function(e,t){t.length=function(e){for(var t,n=0,r=0;r<e.length;++r)128>(t=e.charCodeAt(r))?n+=1:2048>t?n+=2:55296==(64512&t)&&56320==(64512&e.charCodeAt(r+1))?(++r,n+=4):n+=3;return n},t.read=function(e,t,n){if(1>n-t)return"";for(var r,i=null,o=[],a=0;t<n;)128>(r=e[t++])?o[a++]=r:191<r&&224>r?o[a++]=(31&r)<<6|63&e[t++]:239<r&&365>r?(r=((7&r)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(r>>10),o[a++]=56320+(1023&r)):o[a++]=(15&r)<<12|(63&e[t++])<<6|63&e[t++],8191<a&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},t.write=function(e,t,n){for(var r,i,o=n,a=0;a<e.length;++a)128>(r=e.charCodeAt(a))?t[n++]=r:(2048>r?t[n++]=r>>6|192:(55296==(64512&r)&&56320==(64512&(i=e.charCodeAt(a+1)))?(r=65536+((1023&r)<<10)+(1023&i),++a,t[n++]=r>>18|240,t[n++]=r>>12&63|128):t[n++]=r>>12|224,t[n++]=r>>6&63|128),t[n++]=63&r|128);return n-o}})),SA=function(e,t,n){var r=n||8192,i=r>>>1,o=null,a=r;return function(n){return 1>n||n>i?e(n):(a+n>r&&(o=e(r),a=0),n=t.call(o,a,a+=n),7&a&&(a=1+(7|a)),n)}},Xd=Wa.zero=new Wa(0,0);Xd.toNumber=function(){return 0},Xd.zzEncode=Xd.zzDecode=function(){return this},Xd.length=function(){return 1};var TA=Wa.zeroHash="\0\0\0\0\0\0\0\0";Wa.fromNumber=function(e){if(0===e)return Xd;var t=0>e;t&&(e=-e);var n=e>>>0;return e=(e-n)/4294967296>>>0,t&&(e=~e>>>0,n=~n>>>0,4294967295<++n&&(n=0,4294967295<++e&&(e=0))),new Wa(n,e)},Wa.from=function(e){if("number"==typeof e)return Wa.fromNumber(e);if(V.isString(e)){if(!V.Long)return Wa.fromNumber(parseInt(e,10));e=V.Long.fromString(e)}return e.low||e.high?new Wa(e.low>>>0,e.high>>>0):Xd},Wa.prototype.toNumber=function(e){if(!e&&this.hi>>>31){e=1+~this.lo>>>0;var t=~this.hi>>>0;return e||(t=t+1>>>0),-(e+4294967296*t)}return this.lo+4294967296*this.hi},Wa.prototype.toLong=function(e){return V.Long?new V.Long(0|this.lo,0|this.hi,!!e):{low:0|this.lo,high:0|this.hi,unsigned:!!e}};var td=String.prototype.charCodeAt;Wa.fromHash=function(e){return e===TA?Xd:new Wa((td.call(e,0)|td.call(e,1)<<8|td.call(e,2)<<16|td.call(e,3)<<24)>>>0,(td.call(e,4)|td.call(e,5)<<8|td.call(e,6)<<16|td.call(e,7)<<24)>>>0)},Wa.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},Wa.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},Wa.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},Wa.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===t?16384>e?128>e?1:2:2097152>e?3:4:16384>t?128>t?5:6:2097152>t?7:8:128>n?9:10};var V=$a((function(e,t){function n(e,t,n){for(var r=Object.keys(t),i=0;i<r.length;++i)void 0!==e[r[i]]&&n||(e[r[i]]=t[r[i]]);return e}function r(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:Error().stack||""}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}t.asPromise=NA,t.base64=OA,t.EventEmitter=yg,t.float=PA,t.inquire=QA,t.utf8=RA,t.pool=SA,t.LongBits=Wa,t.isNode=!!(void 0!==Ya&&Ya&&Ya.process&&Ya.process.versions&&Ya.process.versions.node),t.global=t.isNode&&Ya||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||Ya,t.emptyArray=Object.freeze?Object.freeze([]):[],t.emptyObject=Object.freeze?Object.freeze({}):{},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.isString=function(e){return"string"==typeof e||e instanceof String},t.isObject=function(e){return e&&"object"===X(e)},t.isset=t.isSet=function(e,t){var n=e[t];return!(null==n||!e.hasOwnProperty(t))&&("object"!==X(n)||0<(Array.isArray(n)?n.length:Object.keys(n).length))},t.Buffer=function(){try{var e=t.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),t._Buffer_from=null,t._Buffer_allocUnsafe=null,t.newBuffer=function(e){return"number"==typeof e?t.Buffer?t._Buffer_allocUnsafe(e):new t.Array(e):t.Buffer?t._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},t.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,t.Long=t.global.dcodeIO&&t.global.dcodeIO.Long||t.global.Long||t.inquire("long"),t.key2Re=/^true|false|0|1$/,t.key32Re=/^-?(?:0|[1-9][0-9]*)$/,t.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,t.longToHash=function(e){return e?t.LongBits.from(e).toHash():t.LongBits.zeroHash},t.longFromHash=function(e,n){return e=t.LongBits.fromHash(e),t.Long?t.Long.fromBits(e.lo,e.hi,n):e.toNumber(!!n)},t.merge=n,t.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},t.newError=r,t.ProtocolError=r("ProtocolError"),t.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var e=Object.keys(this),n=e.length-1;-1<n;--n)if(1===t[e[n]]&&void 0!==this[e[n]]&&null!==this[e[n]])return e[n]}},t.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}},t.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},t._configure=function(){var e=t.Buffer;e?(t._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,n){return new e(t,n)},t._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):t._Buffer_from=t._Buffer_allocUnsafe=null}})),xi=ja,el,Nh=V.LongBits,pr=V.base64,qr=V.utf8,rr=function(){return V.Buffer?function(){return(ja.create=function(){return new el})()}:function(){return new ja}};ja.create=rr(),ja.alloc=function(e){return new V.Array(e)},V.Array!==Array&&(ja.alloc=V.pool(ja.alloc,V.Array.prototype.subarray)),ja.prototype._push=function(e,t,n){return this.tail=this.tail.next=new sf(e,t,n),this.len+=t,this},ui.prototype=Object.create(sf.prototype),ui.prototype.fn=function(e,t,n){for(;127<e;)t[n++]=127&e|128,e>>>=7;t[n]=e},ja.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new ui(128>(e>>>=0)?1:16384>e?2:2097152>e?3:268435456>e?4:5,e)).len,this},ja.prototype.int32=function(e){return 0>e?this._push(vi,10,Nh.fromNumber(e)):this.uint32(e)},ja.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},ja.prototype.uint64=function(e){return e=Nh.from(e),this._push(vi,e.length(),e)},ja.prototype.int64=ja.prototype.uint64,ja.prototype.sint64=function(e){return e=Nh.from(e).zzEncode(),this._push(vi,e.length(),e)},ja.prototype.bool=function(e){return this._push(ti,1,e?1:0)},ja.prototype.fixed32=function(e){return this._push(wi,4,e>>>0)},ja.prototype.sfixed32=ja.prototype.fixed32,ja.prototype.fixed64=function(e){return e=Nh.from(e),this._push(wi,4,e.lo)._push(wi,4,e.hi)},ja.prototype.sfixed64=ja.prototype.fixed64,ja.prototype.float=function(e){return this._push(V.float.writeFloatLE,4,e)},ja.prototype.double=function(e){return this._push(V.float.writeDoubleLE,8,e)};var UA=V.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var r=0;r<e.length;++r)t[n+r]=e[r]};ja.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(ti,1,0);if(V.isString(e)){var n=ja.alloc(t=pr.length(e));pr.decode(e,n,0),e=n}return this.uint32(t)._push(UA,t,e)},ja.prototype.string=function(e){var t=qr.length(e);return t?this.uint32(t)._push(qr.write,t,e):this._push(ti,1,0)},ja.prototype.fork=function(){return this.states=new Tt(this),this.head=this.tail=new sf(si,0,0),this.len=0,this},ja.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new sf(si,0,0),this.len=0),this},ja.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this},ja.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t},ja._configure=function(e){el=e,ja.create=rr(),el._configure()},(jc.prototype=Object.create(xi.prototype)).constructor=jc,jc._configure=function(){jc.alloc=V._Buffer_allocUnsafe,jc.writeBytesBuffer=V.Buffer&&V.Buffer.prototype instanceof Uint8Array&&"set"===V.Buffer.prototype.set.name?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var r=0;r<e.length;)t[n++]=e[r++]}},jc.prototype.bytes=function(e){V.isString(e)&&(e=V._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(jc.writeBytesBuffer,t,e),this},jc.prototype.string=function(e){var t=V.Buffer.byteLength(e);return this.uint32(t),t&&this._push(Ut,t,e),this},jc._configure();var zi=La,fl,Em=V.LongBits,VA=V.utf8,sr="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new La(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new La(e);throw Error("illegal buffer")},tr=function(){return V.Buffer?function(e){return(La.create=function(e){return V.Buffer.isBuffer(e)?new fl(e):sr(e)})(e)}:sr};La.create=tr(),La.prototype._slice=V.Array.prototype.subarray||V.Array.prototype.slice,La.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,128>this.buf[this.pos++])return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,128>this.buf[this.pos++])return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,128>this.buf[this.pos++])return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,128>this.buf[this.pos++])return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,128>this.buf[this.pos++])return e;if((this.pos+=5)>this.len)throw this.pos=this.len,Yb(this,10);return e}}(),La.prototype.int32=function(){return 0|this.uint32()},La.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},La.prototype.bool=function(){return 0!==this.uint32()},La.prototype.fixed32=function(){if(this.pos+4>this.len)throw Yb(this,4);return zg(this.buf,this.pos+=4)},La.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Yb(this,4);return 0|zg(this.buf,this.pos+=4)},La.prototype.float=function(){if(this.pos+4>this.len)throw Yb(this,4);var e=V.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},La.prototype.double=function(){if(this.pos+8>this.len)throw Yb(this,4);var e=V.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},La.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw Yb(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,n):t===n?new this.buf.constructor(0):this._slice.call(this.buf,t,n)},La.prototype.string=function(){var e=this.bytes();return VA.read(e,0,e.length)},La.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw Yb(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw Yb(this)}while(128&this.buf[this.pos++]);return this},La.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},La._configure=function(e){fl=e,La.create=tr(),fl._configure();var t=V.Long?"toLong":"toNumber";V.merge(La.prototype,{int64:function(){return yi.call(this)[t](!1)},uint64:function(){return yi.call(this)[t](!0)},sint64:function(){return yi.call(this).zzDecode()[t](!1)},fixed64:function(){return Fm.call(this)[t](!0)},sfixed64:function(){return Fm.call(this)[t](!1)}})},(Fd.prototype=Object.create(zi.prototype)).constructor=Fd,Fd._configure=function(){V.Buffer&&(Fd.prototype._slice=V.Buffer.prototype.slice)},Fd.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},Fd._configure(),(tf.prototype=Object.create(V.EventEmitter.prototype)).constructor=tf,tf.prototype.rpcCall=function e(t,n,r,i,o){if(!i)throw TypeError("request must be specified");var a=this;if(!o)return V.asPromise(e,a,t,n,r,i);if(a.rpcImpl)try{return a.rpcImpl(t,n[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,n){if(e)return a.emit("error",e,t),o(e);if(null!==n){if(!(n instanceof r))try{n=r[a.responseDelimited?"decodeDelimited":"decode"](n)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",n,t),o(null,n)}a.end(!0)}))}catch(e){a.emit("error",e,t),setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},tf.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this};var WA=$a((function(e,t){t.Service=tf})),XA={},fc=$a((function(e,t){function n(){r.util._configure(),r.Writer._configure(r.BufferWriter),r.Reader._configure(r.BufferReader)}var r=t;r.build="minimal",r.Writer=xi,r.BufferWriter=jc,r.Reader=zi,r.BufferReader=Fd,r.util=V,r.rpc=WA,r.roots=XA,r.configure=n,n()}));fc.util.Long=U,fc.configure();var u=fc.Reader,L=fc.Writer,q=fc.util,t=fc.roots.default||(fc.roots.default={}),YA=t.URI=function(){var e={},t=Object.create(e);return t[e[0]="Unknown"]=0,t[e[1]="PingUri"]=1,t[e[2]="PongUri"]=2,t[e[11]="UserJoinUri"]=11,t[e[12]="UserRespUri"]=12,t[e[21]="UserQuitUri"]=21,t[e[22]="UserDropUri"]=22,t[e[31]="GroupEnterUri"]=31,t[e[32]="GroupLeaveUri"]=32,t[e[33]="GroupReplyUri"]=33,t[e[36]="GroupEnterNoticeUri"]=36,t[e[37]="GroupLeaveNoticeUri"]=37,t[e[38]="GroupEventNoticeUri"]=38,t[e[39]="GroupCountNoticeUri"]=39,t[e[41]="UserStatusListUri"]=41,t[e[42]="UserStatusResultUri"]=42,t[e[51]="GroupStatusListUri"]=51,t[e[52]="GroupStatusResultUri"]=52,t[e[55]="GroupAllUsersListUri"]=55,t[e[56]="GroupAllUsersResultUri"]=56,t[e[100]="MessageUri"]=100,t[e[101]="AckUri"]=101,t[e[115]="FileUploadIndexGetUri"]=115,t[e[116]="FileUploadIndexRetUri"]=116,t[e[117]="FileUploadIndexSetUri"]=117,t[e[118]="FileUploadIndexFinUri"]=118,t[e[119]="FileUploadIndexErrUri"]=119,t[e[125]="FileDownloadIndexGetUri"]=125,t[e[126]="FileDownloadIndexRetUri"]=126,t[e[127]="FileDownloadIndexErrUri"]=127,t[e[201]="UserJoinNoticeUri"]=201,t[e[202]="UserQuitNoticeUri"]=202,t[e[203]="UserWaitNoticeUri"]=203,t[e[301]="UserAttributeGetUri"]=301,t[e[302]="UserAttributeRetUri"]=302,t[e[303]="UserAttributeSetUri"]=303,t[e[304]="UserAttributeModUri"]=304,t[e[305]="UserAttributeDelUri"]=305,t[e[307]="UserAttributeRspUri"]=307,t[e[308]="UserAttributeErrUri"]=308,t[e[311]="UserAttributeKeysGetUri"]=311,t[e[312]="UserAttributeKeysRetUri"]=312,t[e[351]="GroupAttributeGetUri"]=351,t[e[352]="GroupAttributeRetUri"]=352,t[e[353]="GroupAttributeSetUri"]=353,t[e[354]="GroupAttributeModUri"]=354,t[e[355]="GroupAttributeDelUri"]=355,t[e[356]="GroupAttributeAltUri"]=356,t[e[357]="GroupAttributeRspUri"]=357,t[e[358]="GroupAttributeErrUri"]=358,t[e[361]="GroupAttributeKeysGetUri"]=361,t[e[362]="GroupAttributeKeysRetUri"]=362,t[e[401]="SubscribeUserStatusUri"]=401,t[e[402]="UnsubscribeUserStatusUri"]=402,t[e[499]="SubscribeResponseUri"]=499,t}(),Oh=t.Wrapper=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.uri=0,e.prototype.data=q.newBuffer([]),e.encode=function(e,t){return t||(t=L.create()),null!=e.uri&&Object.hasOwnProperty.call(e,"uri")&&t.uint32(8).int32(e.uri),null!=e.data&&Object.hasOwnProperty.call(e,"data")&&t.uint32(18).bytes(e.data),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.Wrapper;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.uri=e.int32();break;case 2:r.data=e.bytes();break;default:e.skipType(7&i)}}return r},e}(),ZA=t.Ping=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.ms=q.Long?q.Long.fromBits(0,0,!0):0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.ms&&Object.hasOwnProperty.call(e,"ms")&&t.uint32(16).uint64(e.ms),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.Ping;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.ms=e.uint64();break;default:e.skipType(7&i)}}return r},e}(),$A=t.Pong=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.ms=q.Long?q.Long.fromBits(0,0,!0):0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.ms&&Object.hasOwnProperty.call(e,"ms")&&t.uint32(16).uint64(e.ms),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.Pong;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.ms=e.uint64();break;default:e.skipType(7&i)}}return r},e}(),aB=t.UserJoin=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.opt=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.instance=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.account="",e.prototype.ticket="",e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.opt&&Object.hasOwnProperty.call(e,"opt")&&t.uint32(16).uint64(e.opt),null!=e.instance&&Object.hasOwnProperty.call(e,"instance")&&t.uint32(24).uint64(e.instance),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(34).string(e.account),null!=e.ticket&&Object.hasOwnProperty.call(e,"ticket")&&t.uint32(42).string(e.ticket),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserJoin;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.opt=e.uint64();break;case 3:r.instance=e.uint64();break;case 4:r.account=e.string();break;case 5:r.ticket=e.string();break;default:e.skipType(7&i)}}return r},e}(),bB=t.UserResp=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.account="",e.prototype.code=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(18).string(e.account),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(24).uint32(e.code),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserResp;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.account=e.string();break;case 3:r.code=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),cB=t.UserQuit=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.encode=function(e,t){return t||(t=L.create()),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserQuit;e.pos<n;){var i=e.uint32();e.skipType(7&i)}return r},e}(),dB=t.UserDrop=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.code=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(8).uint32(e.code),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserDrop;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.code=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),eB=t.GroupEnter=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.account="",e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(18).string(e.account),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupEnter;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.account=e.string();break;default:e.skipType(7&i)}}return r},e}(),fB=t.GroupLeave=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.account="",e.encode=function(e,t){return t||(t=L.create()),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(10).string(e.account),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupLeave;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.account=e.string();break;default:e.skipType(7&i)}}return r},e}(),gB=t.GroupReply=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.account="",e.prototype.code=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(18).string(e.account),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(24).uint32(e.code),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupReply;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.account=e.string();break;case 3:r.code=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),ur=t.GroupLeaveNotice=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.user="",e.prototype.group="",e.prototype.instance=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.size=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(18).string(e.user),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&t.uint32(26).string(e.group),null!=e.instance&&Object.hasOwnProperty.call(e,"instance")&&t.uint32(32).uint64(e.instance),null!=e.size&&Object.hasOwnProperty.call(e,"size")&&t.uint32(40).uint32(e.size),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupLeaveNotice;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.user=e.string();break;case 3:r.group=e.string();break;case 4:r.instance=e.uint64();break;case 5:r.size=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),vr=t.GroupEnterNotice=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.user="",e.prototype.group="",e.prototype.instance=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.size=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(18).string(e.user),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&t.uint32(26).string(e.group),null!=e.instance&&Object.hasOwnProperty.call(e,"instance")&&t.uint32(32).uint64(e.instance),null!=e.size&&Object.hasOwnProperty.call(e,"size")&&t.uint32(40).uint32(e.size),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupEnterNotice;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.user=e.string();break;case 3:r.group=e.string();break;case 4:r.instance=e.uint64();break;case 5:r.size=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),wr=t.Message=function(){function e(e){if(this.MiscMap={},e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.instance=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.dialogue=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.sequence=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.options=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.src="",e.prototype.dst="",e.prototype.payload=q.newBuffer([]),e.prototype.MiscMap=q.emptyObject,e.prototype.ms=q.Long?q.Long.fromBits(0,0,!0):0,e.encode=function(e,t){if(t||(t=L.create()),null!=e.instance&&Object.hasOwnProperty.call(e,"instance")&&t.uint32(8).uint64(e.instance),null!=e.dialogue&&Object.hasOwnProperty.call(e,"dialogue")&&t.uint32(16).uint64(e.dialogue),null!=e.sequence&&Object.hasOwnProperty.call(e,"sequence")&&t.uint32(24).uint64(e.sequence),null!=e.options&&Object.hasOwnProperty.call(e,"options")&&t.uint32(32).uint64(e.options),null!=e.src&&Object.hasOwnProperty.call(e,"src")&&t.uint32(42).string(e.src),null!=e.dst&&Object.hasOwnProperty.call(e,"dst")&&t.uint32(50).string(e.dst),null!=e.payload&&Object.hasOwnProperty.call(e,"payload")&&t.uint32(58).bytes(e.payload),null!=e.MiscMap&&Object.hasOwnProperty.call(e,"MiscMap"))for(var n=Object.keys(e.MiscMap),r=0;r<n.length;++r)t.uint32(66).fork().uint32(10).string(n[r]).uint32(18).bytes(e.MiscMap[n[r]]).ldelim();return null!=e.ms&&Object.hasOwnProperty.call(e,"ms")&&t.uint32(72).uint64(e.ms),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r,i,o=new t.Message;e.pos<n;)switch(r=e.uint32(),r>>>3){case 1:o.instance=e.uint64();break;case 2:o.dialogue=e.uint64();break;case 3:o.sequence=e.uint64();break;case 4:o.options=e.uint64();break;case 5:o.src=e.string();break;case 6:o.dst=e.string();break;case 7:o.payload=e.bytes();break;case 8:o.MiscMap===q.emptyObject&&(o.MiscMap={});var a=e.uint32()+e.pos;for(r="",i=[];e.pos<a;){var s=e.uint32();switch(s>>>3){case 1:r=e.string();break;case 2:i=e.bytes();break;default:e.skipType(7&s)}}o.MiscMap[r]=i;break;case 9:o.ms=e.uint64();break;default:e.skipType(7&r)}return o},e}(),xr=t.Ack=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.instance=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.dialogue=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.sequence=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.code=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.instance&&Object.hasOwnProperty.call(e,"instance")&&t.uint32(8).uint64(e.instance),null!=e.dialogue&&Object.hasOwnProperty.call(e,"dialogue")&&t.uint32(16).uint64(e.dialogue),null!=e.sequence&&Object.hasOwnProperty.call(e,"sequence")&&t.uint32(24).uint64(e.sequence),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(32).uint32(e.code),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.Ack;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.instance=e.uint64();break;case 2:r.dialogue=e.uint64();break;case 3:r.sequence=e.uint64();break;case 4:r.code=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),hB=t.FileUploadIndexGet=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.hash=q.newBuffer([]),e.prototype.size=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.hash&&Object.hasOwnProperty.call(e,"hash")&&t.uint32(18).bytes(e.hash),null!=e.size&&Object.hasOwnProperty.call(e,"size")&&t.uint32(24).uint32(e.size),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.FileUploadIndexGet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.hash=e.bytes();break;case 3:r.size=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),iB=t.FileUploadIndexRet=function(){function e(e){if(this.servers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.unit=0,e.prototype.servers=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.unit&&Object.hasOwnProperty.call(e,"unit")&&t.uint32(16).uint32(e.unit),null!=e.servers&&e.servers.length){t.uint32(26).fork();for(var n=0;n<e.servers.length;++n)t.uint32(e.servers[n]);t.ldelim()}return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.FileUploadIndexRet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.unit=e.uint32();break;case 3:if(r.servers&&r.servers.length||(r.servers=[]),2==(7&i))for(i=e.uint32()+e.pos;e.pos<i;)r.servers.push(e.uint32());else r.servers.push(e.uint32());break;default:e.skipType(7&i)}}return r},e}(),jB=t.FileUploadIndexSet=function(){function e(e){if(this.servers=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.hash=q.newBuffer([]),e.prototype.unit=0,e.prototype.servers=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.hash&&Object.hasOwnProperty.call(e,"hash")&&t.uint32(18).bytes(e.hash),null!=e.unit&&Object.hasOwnProperty.call(e,"unit")&&t.uint32(24).uint32(e.unit),null!=e.servers&&e.servers.length){t.uint32(34).fork();for(var n=0;n<e.servers.length;++n)t.uint32(e.servers[n]);t.ldelim()}return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.FileUploadIndexSet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.hash=e.bytes();break;case 3:r.unit=e.uint32();break;case 4:if(r.servers&&r.servers.length||(r.servers=[]),2==(7&i))for(i=e.uint32()+e.pos;e.pos<i;)r.servers.push(e.uint32());else r.servers.push(e.uint32());break;default:e.skipType(7&i)}}return r},e}(),kB=t.FileUploadIndexFin=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.zone=0,e.prototype.unit=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.zone&&Object.hasOwnProperty.call(e,"zone")&&t.uint32(16).uint32(e.zone),null!=e.unit&&Object.hasOwnProperty.call(e,"unit")&&t.uint32(24).uint32(e.unit),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.FileUploadIndexFin;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.zone=e.uint32();break;case 3:r.unit=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),lB=t.FileUploadIndexErr=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.code=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).uint32(e.code),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.FileUploadIndexErr;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.code=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),mB=t.FileDownloadIndexGet=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.zone=0,e.prototype.hash=q.newBuffer([]),e.prototype.size=0,e.prototype.unit=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.zone&&Object.hasOwnProperty.call(e,"zone")&&t.uint32(16).uint32(e.zone),null!=e.hash&&Object.hasOwnProperty.call(e,"hash")&&t.uint32(26).bytes(e.hash),null!=e.size&&Object.hasOwnProperty.call(e,"size")&&t.uint32(32).uint32(e.size),null!=e.unit&&Object.hasOwnProperty.call(e,"unit")&&t.uint32(40).uint32(e.unit),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.FileDownloadIndexGet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.zone=e.uint32();break;case 3:r.hash=e.bytes();break;case 4:r.size=e.uint32();break;case 5:r.unit=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),nB=t.FileDownloadIndexRet=function(){function e(e){if(this.servers=[],this.backups=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.unit=0,e.prototype.zone=0,e.prototype.servers=q.emptyArray,e.prototype.backups=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.unit&&Object.hasOwnProperty.call(e,"unit")&&t.uint32(16).uint32(e.unit),null!=e.zone&&Object.hasOwnProperty.call(e,"zone")&&t.uint32(24).uint32(e.zone),null!=e.servers&&e.servers.length){t.uint32(34).fork();for(var n=0;n<e.servers.length;++n)t.uint32(e.servers[n]);t.ldelim()}if(null!=e.backups&&e.backups.length){for(t.uint32(42).fork(),n=0;n<e.backups.length;++n)t.uint32(e.backups[n]);t.ldelim()}return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.FileDownloadIndexRet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.unit=e.uint32();break;case 3:r.zone=e.uint32();break;case 4:if(r.servers&&r.servers.length||(r.servers=[]),2==(7&i))for(i=e.uint32()+e.pos;e.pos<i;)r.servers.push(e.uint32());else r.servers.push(e.uint32());break;case 5:if(r.backups&&r.backups.length||(r.backups=[]),2==(7&i))for(i=e.uint32()+e.pos;e.pos<i;)r.backups.push(e.uint32());else r.backups.push(e.uint32());break;default:e.skipType(7&i)}}return r},e}(),oB=t.FileDownloadIndexErr=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.code=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).uint32(e.code),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.FileDownloadIndexErr;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.code=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),pB=t.GroupAllUsersList=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.group="",e.prototype.pageSize=0,e.prototype.pageNumber=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&t.uint32(18).string(e.group),null!=e.pageSize&&Object.hasOwnProperty.call(e,"pageSize")&&t.uint32(24).uint32(e.pageSize),null!=e.pageNumber&&Object.hasOwnProperty.call(e,"pageNumber")&&t.uint32(32).uint32(e.pageNumber),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAllUsersList;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.group=e.string();break;case 3:r.pageSize=e.uint32();break;case 4:r.pageNumber=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),qB=t.GroupAllUsersResult=function(){function e(e){if(this.memberInfos=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.group="",e.prototype.totalSize=0,e.prototype.pageSize=0,e.prototype.pageNumber=0,e.prototype.memberInfos=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&n.uint32(18).string(e.group),null!=e.totalSize&&Object.hasOwnProperty.call(e,"totalSize")&&n.uint32(24).uint32(e.totalSize),null!=e.pageSize&&Object.hasOwnProperty.call(e,"pageSize")&&n.uint32(32).uint32(e.pageSize),null!=e.pageNumber&&Object.hasOwnProperty.call(e,"pageNumber")&&n.uint32(40).uint32(e.pageNumber),null!=e.memberInfos&&e.memberInfos.length)for(var r=0;r<e.memberInfos.length;++r)t.GroupAllUsersResult.MemberInfo.encode(e.memberInfos[r],n.uint32(50).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAllUsersResult;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.group=e.string();break;case 3:r.totalSize=e.uint32();break;case 4:r.pageSize=e.uint32();break;case 5:r.pageNumber=e.uint32();break;case 6:r.memberInfos&&r.memberInfos.length||(r.memberInfos=[]),r.memberInfos.push(t.GroupAllUsersResult.MemberInfo.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.MemberInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.account="",e.prototype.ts=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(10).string(e.account),null!=e.ts&&Object.hasOwnProperty.call(e,"ts")&&t.uint32(16).uint32(e.ts),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAllUsersResult.MemberInfo;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.account=e.string();break;case 2:r.ts=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),e}(),rB=t.UserStatusList=function(){function e(e){if(this.users=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.users=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.users&&e.users.length)for(var n=0;n<e.users.length;++n)t.uint32(18).string(e.users[n]);return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserStatusList;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.users&&r.users.length||(r.users=[]),r.users.push(e.string());break;default:e.skipType(7&i)}}return r},e}(),sB=t.UserStatusResult=function(){function e(e){if(this.userInfos=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.userInfos=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.userInfos&&e.userInfos.length)for(var r=0;r<e.userInfos.length;++r)t.UserStatusResult.UserStatusInfo.encode(e.userInfos[r],n.uint32(18).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserStatusResult;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.userInfos&&r.userInfos.length||(r.userInfos=[]),r.userInfos.push(t.UserStatusResult.UserStatusInfo.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.UserStatusInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.account="",e.prototype.ts=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(10).string(e.account),null!=e.ts&&Object.hasOwnProperty.call(e,"ts")&&t.uint32(16).uint32(e.ts),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserStatusResult.UserStatusInfo;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.account=e.string();break;case 2:r.ts=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),e}(),tB=t.UserAttributeGet=function(){function e(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.account="",e.prototype.attributes=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(18).string(e.account),null!=e.attributes&&e.attributes.length)for(var n=0;n<e.attributes.length;++n)t.uint32(26).string(e.attributes[n]);return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeGet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.account=e.string();break;case 3:r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(e.string());break;default:e.skipType(7&i)}}return r},e}(),uB=t.UserAttributeRet=function(){function e(e){if(this.attributeInfos=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.attributeInfos=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.attributeInfos&&e.attributeInfos.length)for(var r=0;r<e.attributeInfos.length;++r)t.UserAttributeRet.AttributeInfo.encode(e.attributeInfos[r],n.uint32(18).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeRet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.attributeInfos&&r.attributeInfos.length||(r.attributeInfos=[]),r.attributeInfos.push(t.UserAttributeRet.AttributeInfo.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.AttributeInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.encode=function(e,t){return t||(t=L.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeRet.AttributeInfo;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&i)}}return r},e}(),e}(),vB=t.UserAttributeSet=function(){function e(e){if(this.attributeInfos=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.account="",e.prototype.attributeInfos=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&n.uint32(18).string(e.account),null!=e.attributeInfos&&e.attributeInfos.length)for(var r=0;r<e.attributeInfos.length;++r)t.UserAttributeSet.AttributeInfo.encode(e.attributeInfos[r],n.uint32(26).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeSet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.account=e.string();break;case 3:r.attributeInfos&&r.attributeInfos.length||(r.attributeInfos=[]),r.attributeInfos.push(t.UserAttributeSet.AttributeInfo.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.AttributeInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.encode=function(e,t){return t||(t=L.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeSet.AttributeInfo;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&i)}}return r},e}(),e}(),wB=t.UserAttributeMod=function(){function e(e){if(this.attributeInfos=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.account="",e.prototype.attributeInfos=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&n.uint32(18).string(e.account),null!=e.attributeInfos&&e.attributeInfos.length)for(var r=0;r<e.attributeInfos.length;++r)t.UserAttributeMod.AttributeInfo.encode(e.attributeInfos[r],n.uint32(26).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeMod;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.account=e.string();break;case 3:r.attributeInfos&&r.attributeInfos.length||(r.attributeInfos=[]),r.attributeInfos.push(t.UserAttributeMod.AttributeInfo.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.AttributeInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.encode=function(e,t){return t||(t=L.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeMod.AttributeInfo;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&i)}}return r},e}(),e}(),xB=t.UserAttributeDel=function(){function e(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.account="",e.prototype.attributes=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(18).string(e.account),null!=e.attributes&&e.attributes.length)for(var n=0;n<e.attributes.length;++n)t.uint32(26).string(e.attributes[n]);return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeDel;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.account=e.string();break;case 3:r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(e.string());break;default:e.skipType(7&i)}}return r},e}(),yB=t.UserAttributeErr=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.code=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).uint32(e.code),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeErr;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.code=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),zB=t.UserAttributeKeysGet=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.account="",e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(18).string(e.account),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeKeysGet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.account=e.string();break;default:e.skipType(7&i)}}return r},e}(),AB=t.UserAttributeKeysRet=function(){function e(e){if(this.keys=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.keys=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.keys&&e.keys.length)for(var n=0;n<e.keys.length;++n)t.uint32(18).string(e.keys[n]);return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeKeysRet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.keys&&r.keys.length||(r.keys=[]),r.keys.push(e.string());break;default:e.skipType(7&i)}}return r},e}(),BB=t.UserAttributeRsp=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserAttributeRsp;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;default:e.skipType(7&i)}}return r},e}(),CB=t.GroupStatusList=function(){function e(e){if(this.groups=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.groups=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.groups&&e.groups.length)for(var n=0;n<e.groups.length;++n)t.uint32(18).string(e.groups[n]);return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupStatusList;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.groups&&r.groups.length||(r.groups=[]),r.groups.push(e.string());break;default:e.skipType(7&i)}}return r},e}(),DB=t.GroupStatusResult=function(){function e(e){if(this.groupInfos=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.groupInfos=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.groupInfos&&e.groupInfos.length)for(var r=0;r<e.groupInfos.length;++r)t.GroupStatusResult.GroupInfo.encode(e.groupInfos[r],n.uint32(18).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupStatusResult;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.groupInfos&&r.groupInfos.length||(r.groupInfos=[]),r.groupInfos.push(t.GroupStatusResult.GroupInfo.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.GroupInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.group="",e.prototype.memberCount=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&t.uint32(10).string(e.group),null!=e.memberCount&&Object.hasOwnProperty.call(e,"memberCount")&&t.uint32(16).uint32(e.memberCount),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupStatusResult.GroupInfo;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.group=e.string();break;case 2:r.memberCount=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),e}(),EB=t.GroupCountNotice=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.instance=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.group="",e.prototype.size=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.instance&&Object.hasOwnProperty.call(e,"instance")&&t.uint32(8).uint64(e.instance),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(16).uint64(e.seq),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&t.uint32(26).string(e.group),null!=e.size&&Object.hasOwnProperty.call(e,"size")&&t.uint32(32).uint32(e.size),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupCountNotice;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.instance=e.uint64();break;case 2:r.seq=e.uint64();break;case 3:r.group=e.string();break;case 4:r.size=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),FB=t.GroupAttributeGet=function(){function e(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.group="",e.prototype.attributes=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&t.uint32(18).string(e.group),null!=e.attributes&&e.attributes.length)for(var n=0;n<e.attributes.length;++n)t.uint32(26).string(e.attributes[n]);return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeGet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.group=e.string();break;case 3:r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(e.string());break;default:e.skipType(7&i)}}return r},e}(),GB=t.GroupAttributeRet=function(){function e(e){if(this.attributeMaps=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.attributeMaps=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.attributeMaps&&e.attributeMaps.length)for(var r=0;r<e.attributeMaps.length;++r)t.GroupAttributeRet.AttributeMap.encode(e.attributeMaps[r],n.uint32(18).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeRet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.attributeMaps&&r.attributeMaps.length||(r.attributeMaps=[]),r.attributeMaps.push(t.GroupAttributeRet.AttributeMap.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.AttributeMap=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.prototype.origin="",e.prototype.ms=q.Long?q.Long.fromBits(0,0,!0):0,e.encode=function(e,t){return t||(t=L.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),null!=e.origin&&Object.hasOwnProperty.call(e,"origin")&&t.uint32(26).string(e.origin),null!=e.ms&&Object.hasOwnProperty.call(e,"ms")&&t.uint32(32).uint64(e.ms),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeRet.AttributeMap;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;case 3:r.origin=e.string();break;case 4:r.ms=e.uint64();break;default:e.skipType(7&i)}}return r},e}(),e}(),HB=t.GroupAttributeSet=function(){function e(e){if(this.attributeInfos=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.group="",e.prototype.broadcast=!1,e.prototype.attributeInfos=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&n.uint32(18).string(e.group),null!=e.broadcast&&Object.hasOwnProperty.call(e,"broadcast")&&n.uint32(24).bool(e.broadcast),null!=e.attributeInfos&&e.attributeInfos.length)for(var r=0;r<e.attributeInfos.length;++r)t.GroupAttributeSet.AttributeInfo.encode(e.attributeInfos[r],n.uint32(34).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeSet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.group=e.string();break;case 3:r.broadcast=e.bool();break;case 4:r.attributeInfos&&r.attributeInfos.length||(r.attributeInfos=[]),r.attributeInfos.push(t.GroupAttributeSet.AttributeInfo.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.AttributeInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.encode=function(e,t){return t||(t=L.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeSet.AttributeInfo;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&i)}}return r},e}(),e}(),IB=t.GroupAttributeMod=function(){function e(e){if(this.attributeInfos=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.group="",e.prototype.broadcast=!1,e.prototype.attributeInfos=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&n.uint32(18).string(e.group),null!=e.broadcast&&Object.hasOwnProperty.call(e,"broadcast")&&n.uint32(24).bool(e.broadcast),null!=e.attributeInfos&&e.attributeInfos.length)for(var r=0;r<e.attributeInfos.length;++r)t.GroupAttributeMod.AttributeInfo.encode(e.attributeInfos[r],n.uint32(34).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeMod;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.group=e.string();break;case 3:r.broadcast=e.bool();break;case 4:r.attributeInfos&&r.attributeInfos.length||(r.attributeInfos=[]),r.attributeInfos.push(t.GroupAttributeMod.AttributeInfo.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.AttributeInfo=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.encode=function(e,t){return t||(t=L.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeMod.AttributeInfo;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;default:e.skipType(7&i)}}return r},e}(),e}(),JB=t.GroupAttributeDel=function(){function e(e){if(this.attributes=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.group="",e.prototype.broadcast=!1,e.prototype.attributes=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&t.uint32(18).string(e.group),null!=e.broadcast&&Object.hasOwnProperty.call(e,"broadcast")&&t.uint32(24).bool(e.broadcast),null!=e.attributes&&e.attributes.length)for(var n=0;n<e.attributes.length;++n)t.uint32(34).string(e.attributes[n]);return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeDel;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.group=e.string();break;case 3:r.broadcast=e.bool();break;case 4:r.attributes&&r.attributes.length||(r.attributes=[]),r.attributes.push(e.string());break;default:e.skipType(7&i)}}return r},e}(),KB=t.GroupAttributeAlt=function(){function e(e){if(this.attributeMaps=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.group="",e.prototype.instance=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.attributeMaps=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&n.uint32(18).string(e.group),null!=e.instance&&Object.hasOwnProperty.call(e,"instance")&&n.uint32(24).uint64(e.instance),null!=e.attributeMaps&&e.attributeMaps.length)for(var r=0;r<e.attributeMaps.length;++r)t.GroupAttributeAlt.AttributeMap.encode(e.attributeMaps[r],n.uint32(34).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeAlt;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.group=e.string();break;case 3:r.instance=e.uint64();break;case 4:r.attributeMaps&&r.attributeMaps.length||(r.attributeMaps=[]),r.attributeMaps.push(t.GroupAttributeAlt.AttributeMap.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.AttributeMap=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.key="",e.prototype.value="",e.prototype.origin="",e.prototype.ms=q.Long?q.Long.fromBits(0,0,!0):0,e.encode=function(e,t){return t||(t=L.create()),null!=e.key&&Object.hasOwnProperty.call(e,"key")&&t.uint32(10).string(e.key),null!=e.value&&Object.hasOwnProperty.call(e,"value")&&t.uint32(18).string(e.value),null!=e.origin&&Object.hasOwnProperty.call(e,"origin")&&t.uint32(26).string(e.origin),null!=e.ms&&Object.hasOwnProperty.call(e,"ms")&&t.uint32(32).uint64(e.ms),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeAlt.AttributeMap;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.key=e.string();break;case 2:r.value=e.string();break;case 3:r.origin=e.string();break;case 4:r.ms=e.uint64();break;default:e.skipType(7&i)}}return r},e}(),e}(),LB=t.GroupAttributeRsp=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeRsp;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;default:e.skipType(7&i)}}return r},e}(),MB=t.GroupAttributeErr=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.code=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).uint32(e.code),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeErr;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.code=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),NB=t.GroupAttributeKeysGet=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.group="",e.encode=function(e,t){return t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.group&&Object.hasOwnProperty.call(e,"group")&&t.uint32(18).string(e.group),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeKeysGet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.group=e.string();break;default:e.skipType(7&i)}}return r},e}(),OB=t.GroupAttributeKeysRet=function(){function e(e){if(this.keys=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.keys=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.keys&&e.keys.length)for(var n=0;n<e.keys.length;++n)t.uint32(18).string(e.keys[n]);return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.GroupAttributeKeysRet;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.keys&&r.keys.length||(r.keys=[]),r.keys.push(e.string());break;default:e.skipType(7&i)}}return r},e}(),PB=t.SubscribeUserStatus=function(){function e(e){if(this.users=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.users=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.users&&e.users.length)for(var n=0;n<e.users.length;++n)t.uint32(18).string(e.users[n]);return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.SubscribeUserStatus;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.users&&r.users.length||(r.users=[]),r.users.push(e.string());break;default:e.skipType(7&i)}}return r},e}(),QB=t.UnsubscribeUserStatus=function(){function e(e){if(this.users=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.users=q.emptyArray,e.encode=function(e,t){if(t||(t=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(8).uint64(e.seq),null!=e.users&&e.users.length)for(var n=0;n<e.users.length;++n)t.uint32(18).string(e.users[n]);return t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UnsubscribeUserStatus;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.users&&r.users.length||(r.users=[]),r.users.push(e.string());break;default:e.skipType(7&i)}}return r},e}(),RB=t.UserJoinNotice=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.instance=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.user="",e.encode=function(e,t){return t||(t=L.create()),null!=e.instance&&Object.hasOwnProperty.call(e,"instance")&&t.uint32(8).uint64(e.instance),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(16).uint64(e.seq),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(26).string(e.user),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserJoinNotice;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.instance=e.uint64();break;case 2:r.seq=e.uint64();break;case 3:r.user=e.string();break;default:e.skipType(7&i)}}return r},e}(),SB=t.UserQuitNotice=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.instance=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.user="",e.encode=function(e,t){return t||(t=L.create()),null!=e.instance&&Object.hasOwnProperty.call(e,"instance")&&t.uint32(8).uint64(e.instance),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(16).uint64(e.seq),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(26).string(e.user),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserQuitNotice;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.instance=e.uint64();break;case 2:r.seq=e.uint64();break;case 3:r.user=e.string();break;default:e.skipType(7&i)}}return r},e}(),TB=t.UserWaitNotice=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.instance=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.user="",e.encode=function(e,t){return t||(t=L.create()),null!=e.instance&&Object.hasOwnProperty.call(e,"instance")&&t.uint32(8).uint64(e.instance),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&t.uint32(16).uint64(e.seq),null!=e.user&&Object.hasOwnProperty.call(e,"user")&&t.uint32(26).string(e.user),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.UserWaitNotice;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.instance=e.uint64();break;case 2:r.seq=e.uint64();break;case 3:r.user=e.string();break;default:e.skipType(7&i)}}return r},e}(),UB=t.SubscribeResponse=function(){function e(e){if(this.errors=[],e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.seq=q.Long?q.Long.fromBits(0,0,!0):0,e.prototype.errors=q.emptyArray,e.encode=function(e,n){if(n||(n=L.create()),null!=e.seq&&Object.hasOwnProperty.call(e,"seq")&&n.uint32(8).uint64(e.seq),null!=e.errors&&e.errors.length)for(var r=0;r<e.errors.length;++r)t.SubscribeResponse.SubscribeErrorsType.encode(e.errors[r],n.uint32(18).fork()).ldelim();return n},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.SubscribeResponse;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.seq=e.uint64();break;case 2:r.errors&&r.errors.length||(r.errors=[]),r.errors.push(t.SubscribeResponse.SubscribeErrorsType.decode(e,e.uint32()));break;default:e.skipType(7&i)}}return r},e.SubscribeErrorsType=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.account="",e.prototype.code=0,e.encode=function(e,t){return t||(t=L.create()),null!=e.account&&Object.hasOwnProperty.call(e,"account")&&t.uint32(10).string(e.account),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(16).uint32(e.code),t},e.decode=function(e,n){e instanceof u||(e=u.create(e)),n=void 0===n?e.len:e.pos+n;for(var r=new t.SubscribeResponse.SubscribeErrorsType;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.account=e.string();break;case 2:r.code=e.uint32();break;default:e.skipType(7&i)}}return r},e}(),e}(),VB=Object.freeze({__proto__:null,URI:YA,Wrapper:Oh,Ping:ZA,Pong:$A,UserJoin:aB,UserResp:bB,UserQuit:cB,UserDrop:dB,GroupEnter:eB,GroupLeave:fB,GroupReply:gB,GroupLeaveNotice:ur,GroupEnterNotice:vr,Message:wr,Ack:xr,FileUploadIndexGet:hB,FileUploadIndexRet:iB,FileUploadIndexSet:jB,FileUploadIndexFin:kB,FileUploadIndexErr:lB,FileDownloadIndexGet:mB,FileDownloadIndexRet:nB,FileDownloadIndexErr:oB,GroupAllUsersList:pB,GroupAllUsersResult:qB,UserStatusList:rB,UserStatusResult:sB,UserAttributeGet:tB,UserAttributeRet:uB,UserAttributeSet:vB,UserAttributeMod:wB,UserAttributeDel:xB,UserAttributeErr:yB,UserAttributeKeysGet:zB,UserAttributeKeysRet:AB,UserAttributeRsp:BB,GroupStatusList:CB,GroupStatusResult:DB,GroupCountNotice:EB,GroupAttributeGet:FB,GroupAttributeRet:GB,GroupAttributeSet:HB,GroupAttributeMod:IB,GroupAttributeDel:JB,GroupAttributeAlt:KB,GroupAttributeRsp:LB,GroupAttributeErr:MB,GroupAttributeKeysGet:NB,GroupAttributeKeysRet:OB,SubscribeUserStatus:PB,UnsubscribeUserStatus:QB,UserJoinNotice:RB,UserQuitNotice:SB,UserWaitNotice:TB,SubscribeResponse:UB,default:t}),WB=Math.ceil,yr=function(e){return function(t,n,r){var i=(t=String(jb(t))).length;return r=void 0===r?" ":String(r),(n=ta(n))<=i||""==r?t:(n-=i,(i=Pn.call(r,WB(n/r.length))).length>n&&(i=i.slice(0,n)),e?t+i:i+t)}},XB=yr(!1),YB=yr(!0),zr=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(De);N({target:"String",proto:!0,forced:zr},{padEnd:function(e){return YB(this,e,1<arguments.length?arguments[1]:void 0)}});var ZB=zf,Ar=function(e){return function(t){t=qb(t);for(var n,r=Dc(t),i=r.length,o=0,a=[];i>o;)n=r[o++],ka&&!ZB.call(t,n)||a.push(e?[n,t[n]]:t[n]);return a}},$B=Ar(!0),aC=Ar(!1);N({target:"Object",stat:!0},{entries:function(e){return $B(e)}});var bC=Fb.f,Br="".endsWith,cC=Math.min,Cr=dk("endsWith"),dC=!Cr&&!!function(){var e=bC(String.prototype,"endsWith");return e&&!e.writable}();N({target:"String",proto:!0,forced:!dC&&!Cr},{endsWith:function(e){var t=String(jb(this));ck(e);var n=1<arguments.length?arguments[1]:void 0,r=ta(t.length);return n=void 0===n?r:cC(ta(n),r),r=String(e),Br?Br.call(t,r,n):t.slice(n-r.length,n)===r}}),dh("match",1,(function(e,t,n){return[function(t){var n=jb(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;if(e=va(e),r=String(this),!e.global)return Ke(e,r);var i=e.unicode;e.lastIndex=0;for(var o,a=[],s=0;null!==(o=Ke(e,r));)o=String(o[0]),a[s]=o,""===o&&(e.lastIndex=xj(r,ta(e.lastIndex),i)),s++;return 0===s?null:a}]}));var eC=Fb.f,Dr="".startsWith,fC=Math.min,Er=dk("startsWith"),gC=!Er&&!!function(){var e=eC(String.prototype,"startsWith");return e&&!e.writable}();N({target:"String",proto:!0,forced:!gC&&!Er},{startsWith:function(e){var t=String(jb(this));ck(e);var n=ta(fC(1<arguments.length?arguments[1]:void 0,t.length)),r=String(e);return Dr?Dr.call(t,r,n):t.slice(n,n+r.length)===r}});var Nm=function(e){var t=/(%?)(%([jds]))/g,n=Array.prototype.slice.call(arguments,1);return n.length&&(e=e.replace(t,(function(e,t,r,i){switch(r=n.shift(),i){case"s":r=""+r;break;case"d":r=Number(r);break;case"j":r=JSON.stringify(r)}return t?(n.unshift(r),e):r}))),n.length&&(e+=" "+n.join(" ")),""+(e=e.replace(/%{2,2}/g,"%"))},hC=/\s/,iC=function(e){for(var t=e.length;t--&&hC.test(e.charAt(t)););return t},jC=/^\s+/,Fr=NaN,kC=/^[-+]0x[0-9a-f]+$/i,lC=/^0b[01]+$/i,mC=/^0o[0-7]+$/i,nC=parseInt,gl=function(e){if("number"==typeof e)return e;if(ie(e))return Fr;if(lb(e)&&(e="function"==typeof e.valueOf?e.valueOf():e,e=lb(e)?e+"":e),"string"!=typeof e)return 0===e?e:+e;e=e?e.slice(0,iC(e)+1).replace(jC,""):e;var t=lC.test(e);return t||mC.test(e)?nC(e.slice(2),t?2:8):kC.test(e)?Fr:+e},oC=Math.max,pC=Math.min,qC=function(e,t,n){function r(t){var n=u,r=c;return u=c=void 0,p=t,l=e.apply(r,n)}function i(e){var n=e-h;return e-=p,void 0===h||n>=t||0>n||v&&e>=g}function o(){var e=Cb.Date.now();if(i(e))return a(e);var n=setTimeout,r=e-p;e=t-(e-h),r=v?pC(e,g-r):e,f=n(o,r)}function a(e){return f=void 0,b&&u?r(e):(u=c=void 0,l)}function s(){var e=Cb.Date.now(),n=i(e);if(u=arguments,c=this,h=e,n){if(void 0===f)return p=e=h,f=setTimeout(o,t),d?r(e):l;if(v)return clearTimeout(f),f=setTimeout(o,t),r(h)}return void 0===f&&(f=setTimeout(o,t)),l}var u,c,l,f,h,p=0,d=!1,v=!1,b=!0;if("function"!=typeof e)throw new TypeError("Expected a function");if(t=gl(t)||0,lb(n)){d=!!n.leading;var g=(v="maxWait"in n)?oC(gl(n.maxWait)||0,t):g;b="trailing"in n?!!n.trailing:b}return s.cancel=function(){void 0!==f&&clearTimeout(f),p=0,u=h=c=f=void 0},s.flush=function(){return void 0===f?l:a(Cb.Date.now())},s},yc=function(e){function t(e,i){return W(this,t),m(n(e=r.call(this,Mm(e,i))),"originalError",void 0),m(n(e),"code",void 0),m(n(e),"serverCode",void 0),"number"==typeof i?e.code=i:"string"==typeof i?e.name=i:void 0!==i&&(i.originalError&&(e.originalError=i.originalError),void 0!==i.code&&(e.code=i.code),void 0!==i.serverCode&&(e.serverCode=i.serverCode)),e}la(t,e);var r=ma(t);return t}(ef(Error)),Ia=function(e){function t(e,i){return W(this,t),m(n(e=r.call(this,Mm(e,i))),"name","RtmInternalError"),m(n(e),"code",void 0),e.code=i,e}la(t,e);var r=ma(t);return t}(ef(Error)),Ph=function(){return function(e){function t(e){W(this,t);var r=Object.keys(e);return n.call(this,e[r[0]],r[0])}la(t,e);var n=ma(t);return t}(Ia)},Fa=Ph(),db=function(e){function t(){W(this,t);for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];return m(n(e=r.call.apply(r,[this].concat(i))),"name","RtmTimeoutError"),e}la(t,e);var r=ma(t);return t}(yc),I=function(e){function t(){W(this,t);for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];return m(n(e=r.call.apply(r,[this].concat(i))),"name","RtmInvalidArgumentError"),e}la(t,e);var r=ma(t);return t}(yc),K=function(e){function t(){W(this,t);for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];return m(n(e=r.call.apply(r,[this].concat(i))),"name","RtmInvalidStatusError"),e}la(t,e);var r=ma(t);return t}(yc),hl=function(e){function t(){W(this,t);for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];return m(n(e=r.call.apply(r,[this].concat(i))),"name","RtmInterruptedError"),e}la(t,e);var r=ma(t);return t}(yc),ib=function(e){function t(){W(this,t);for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];return m(n(e=r.call.apply(r,[this].concat(i))),"name","RtmLimitExceededError"),e}la(t,e);var r=ma(t);return t}(yc),rC=function(e){function t(){W(this,t);for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];return m(n(e=r.call.apply(r,[this].concat(i))),"name","RtmInvokeTooOftenError"),e}la(t,e);var r=ma(t);return t}(yc),da=function(e){function t(){W(this,t);for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];return m(n(e=r.call.apply(r,[this].concat(i))),"name","RtmUnavailableError"),m(n(e),"serverCode",void 0),m(n(e),"statusCode",void 0),e}la(t,e);var r=ma(t);return t}(yc),Ye=function(e){function t(){W(this,t);for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];return m(n(e=r.call.apply(r,[this].concat(i))),"name","RtmUnauthenticatedError"),m(n(e),"serverCode",void 0),e}la(t,e);var r=ma(t);return t}(yc),Wc=function(e){function t(){W(this,t);for(var e=arguments.length,i=Array(e),o=0;o<e;o++)i[o]=arguments[o];return m(n(e=r.call.apply(r,[this].concat(i))),"name","RtmUnknownError"),e}la(t,e);var r=ma(t);return t}(yc),Sa=function(e){return e instanceof db||e instanceof pb},sa=function(e){return e instanceof yc},Yd=function(e,t,n){return['Executing "%s.%s" timed out after %ds',e,t,n/1e3]},Lm=new Map,sC=function(){var e=new Date;return"".concat(e.toISOString().split("T")[1].replace(/\..+/,""),".").concat(e.getMilliseconds())},xf=Object.keys,Hg=Object.entries.bind(Object),Cg=function(e){return"string"==typeof e?e.endsWith(".")?e:"".concat(e,"."):e},Sm=function(e){for(var t="",n=(e=new Uint8Array(e)).byteLength,r=-1;++r<n;)t+=String.fromCharCode(e[r]);return t=btoa(t),"data:;base64,".concat(t)},tC=R((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}));N({target:"Date",proto:!0,forced:tC},{toJSON:function(e){e=Qa(this);var t=lc(e);return"number"!=typeof t||isFinite(t)?e.toISOString():null}}),N({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}});var $t=Object.prototype.hasOwnProperty,Gr=function(e,t,n){return JSON.stringify(Ym(e),t,n)};Gr.ensureProperties=Ym;var uC=function(e,t){t=t||{};var n=X(e);if("string"===n&&0<e.length)return au(e);if("number"===n&&isFinite(e))return t.long?e=864e5<=(t=Math.abs(e))?Jg(e,t,864e5,"day"):36e5<=t?Jg(e,t,36e5,"hour"):6e4<=t?Jg(e,t,6e4,"minute"):1e3<=t?Jg(e,t,1e3,"second"):e+" ms":e=864e5<=(t=Math.abs(e))?Math.round(e/864e5)+"d":36e5<=t?Math.round(e/36e5)+"h":6e4<=t?Math.round(e/6e4)+"m":1e3<=t?Math.round(e/1e3)+"s":e+"ms",e;throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},vC=function(e){function t(e){function r(){for(var e=arguments.length,n=Array(e),o=0;o<e;o++)n[o]=arguments[o];if(r.enabled){e=Number(new Date),r.diff=e-(i||e),r.prev=i,i=r.curr=e,n[0]=t.coerce(n[0]),"string"!=typeof n[0]&&n.unshift("%O");var a=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,(function(e,i){return"%%"===e?"%":(a++,"function"==typeof(i=t.formatters[i])&&(e=i.call(r,n[a]),n.splice(a,1),a--),e)})),t.formatArgs.call(r,n),(r.log||t.log).apply(r,n)}}var i,o=null;return r.namespace=e,r.useColors=t.useColors(),r.color=t.selectColor(e),r.extend=n,r.destroy=t.destroy,Object.defineProperty(r,"enabled",{enumerable:!0,configurable:!1,get:function(){return null===o?t.enabled(e):o},set:function(e){o=e}}),"function"==typeof t.init&&t.init(r),r}function n(e,n){return(e=t(this.namespace+(void 0===n?":":n)+e)).log=this.log,e}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){var e=[].concat(G(t.names.map(r)),G(t.skips.map(r).map((function(e){return"-"+e})))).join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.names=[],t.skips=[];var n,r=("string"==typeof e?e:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(e=r[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;var n,r=0;for(n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=uC,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((function(n){t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){for(var n=0,r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t},Hr=$a((function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),this.useColors){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(i=r))})),t.splice(i,0,n)}},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){try{var e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&31<=parseInt(RegExp.$1,10)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))};e:{try{var n=localStorage;break e}catch(e){}n=void 0}t.storage=n,t.destroy=function(){var e=!1;return function(){e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}}(),t.colors="#0000CC #0000FF #0033CC #0033FF #0066CC #0066FF #0099CC #0099FF #00CC00 #00CC33 #00CC66 #00CC99 #00CCCC #00CCFF #3300CC #3300FF #3333CC #3333FF #3366CC #3366FF #3399CC #3399FF #33CC00 #33CC33 #33CC66 #33CC99 #33CCCC #33CCFF #6600CC #6600FF #6633CC #6633FF #66CC00 #66CC33 #9900CC #9900FF #9933CC #9933FF #99CC00 #99CC33 #CC0000 #CC0033 #CC0066 #CC0099 #CC00CC #CC00FF #CC3300 #CC3333 #CC3366 #CC3399 #CC33CC #CC33FF #CC6600 #CC6633 #CC9900 #CC9933 #CCCC00 #CCCC33 #FF0000 #FF0033 #FF0066 #FF0099 #FF00CC #FF00FF #FF3300 #FF3333 #FF3366 #FF3399 #FF33CC #FF33FF #FF6600 #FF6633 #FF9900 #FF9933 #FFCC00 #FFCC33".split(" "),t.log=console.debug||console.log||function(){},e.exports=vC(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})),Ir=Hr("RTM:DEBUG"),Ze;Ir.enabled=!1,function(e){e[e.Uploading=0]="Uploading",e[e.Free=1]="Free"}(Ze||(Ze={}));var wC=function(){function e(t){W(this,e),m(this,"uploadRequest",void 0),m(this,"uploadState",void 0),m(this,"uploadResendCount",void 0),m(this,"LogCache",void 0),m(this,"LogsToPost",void 0),m(this,"processId",void 0),m(this,"sdkVersion",void 0),m(this,"logId",void 0),m(this,"rtmConfig",void 0),this.processId=t.processId,this.sdkVersion=t.sdkVersion,this.rtmConfig=t.rtmConfig,this.uploadRequest=t.uploadRequest,this.uploadState=Ze.Free,this.uploadResendCount=0,this.LogCache=[],this.LogsToPost=[],this.logId=0}return Ha(e,[{key:"upload",value:function(e){this.LogCache.push(e),this.uploadState===Ze.Free&&(this.LogsToPost=40>this.LogCache.length?this.LogCache.splice(0,this.LogCache.length):this.LogCache.splice(0,40),this.postLog(this.LogsToPost))}},{key:"postLog",value:function(e){var t=this;this.uploadState=Ze.Uploading,setTimeout(J(w.mark((function n(){var r,i,o;return w.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r={sdk_version:t.sdkVersion,process_id:t.processId,payload:JSON.stringify(e)},n.prev=1,n.next=4,t.uploadRequest(r,null!==(i=t.rtmConfig.enableCloudProxy)&&void 0!==i&&i);case 4:if(!Uk){n.next=6;break}throw Error("RTM is busy");case 6:n.next=13;break;case 8:return n.prev=8,n.t0=n.catch(1),o=2>t.uploadResendCount++?2e3:1e4,setTimeout((function(){return t.postLog(t.LogsToPost)}),o),n.abrupt("return");case 13:if(Ir('The logs uploaded for "process-'.concat(gg,'"')),0!==t.LogCache.length){n.next=17;break}return t.uploadState=Ze.Free,n.abrupt("return");case 17:t.uploadResendCount=0,t.LogsToPost=40>t.LogCache.length?t.LogCache.splice(0,t.LogCache.length):t.LogCache.splice(0,40),t.postLog(t.LogsToPost);case 20:case"end":return n.stop()}}),n,null,[[1,8]])}))),Zd.getParameter("LOG_UPLOAD_INTERVAL"))}}]),e}(),Jr=function(e,t,n,r,i,o,a,s){var u=0;for(a=!!a&&Id(a,s,3);u<r;){if(u in n){if(s=a?a(n[u],u,t):n[u],0<o&&gd(s))i=Jr(e,t,s,ta(s.length),i,o-1)-1;else{if(9007199254740991<=i)throw TypeError("Exceed the acceptable array length");e[i]=s}i++}u++}return i},xC=Jr;N({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=Qa(this),n=ta(t.length),r=Sg(t,0);return r.length=xC(r,t,t,n,0,void 0===e?1:$b(e)),r}}),N({target:"Object",stat:!0},{values:function(e){return aC(e)}});var yC=["CODE"],Db,ud,F;!function(e){e.CHINA="CN",e.ASIA="AS",e.NORTH_AMERICA="NA",e.EUROPE="EU",e.JAPAN="JP",e.INDIA="IN",e.OCEANIA="OC",e.SOUTH_AMERICA="SA",e.AFRICA="AF",e.OVERSEA="OVERSEA",e.GLOBAL="GLOBAL"}(F||(F={}));var zC={CN:F.CHINA,NA:F.NORTH_AMERICA,EU:F.EUROPE,AS:F.ASIA,JP:F.JAPAN,IN:F.INDIA,GLOB:F.GLOBAL,AF:F.AFRICA,OC:F.OVERSEA,OVS:F.OVERSEA,SA:F.SOUTH_AMERICA},Kg=Wm((Db={},m(Db,F.ASIA,{CODE:F.ASIA,AP_DOMAINS:["ap-web-1-asia.agora.io"],AP_BACKUP_DOMAINS:["ap-web-2-asia.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-asia.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-asia.agora.io"],LOG_UPLOAD_SERVER:["logservice-asia.agora.io"],PROXY_AP:["proxy-ap-web-asia.agora.io"],PROXY_NGINX:["southeast-asia.webrtc-cloud-proxy.sd-rtn.com"]}),m(Db,F.NORTH_AMERICA,{CODE:F.NORTH_AMERICA,AP_DOMAINS:["ap-web-1-north-america.agora.io"],AP_BACKUP_DOMAINS:["ap-web-2-north-america.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-north-america.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-north-america.agora.io"],LOG_UPLOAD_SERVER:["logservice-north-america.agora.io"],PROXY_AP:["proxy-ap-web-america.agora.io"],PROXY_NGINX:["east-usa.webrtc-cloud-proxy.sd-rtn.com"]}),m(Db,F.EUROPE,{CODE:F.EUROPE,AP_DOMAINS:["ap-web-1-europe.agora.io"],AP_BACKUP_DOMAINS:["ap-web-2-europe.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-europe.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-europe.agora.io"],LOG_UPLOAD_SERVER:["logservice-europe.agora.io"],PROXY_AP:["proxy-ap-web-europe.agora.io"],PROXY_NGINX:["europe.webrtc-cloud-proxy.sd-rtn.com"]}),m(Db,F.JAPAN,{CODE:F.JAPAN,AP_DOMAINS:["ap-web-1-japan.agora.io"],AP_BACKUP_DOMAINS:["ap-web-2-japan.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-japan.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-japan.agora.io"],LOG_UPLOAD_SERVER:["logservice-japan.agora.io"],PROXY_AP:["proxy-ap-web-japan.agora.io"],PROXY_NGINX:["japan.webrtc-cloud-proxy.sd-rtn.com"]}),m(Db,F.INDIA,{CODE:F.INDIA,AP_DOMAINS:["ap-web-1-india.agora.io"],AP_BACKUP_DOMAINS:["ap-web-2-india.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-india.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-india.agora.io"],LOG_UPLOAD_SERVER:["logservice-india.agora.io"],PROXY_AP:["proxy-ap-web-india.agora.io"],PROXY_NGINX:["india.webrtc-cloud-proxy.sd-rtn.com"]}),m(Db,F.OVERSEA,{CODE:F.OVERSEA,AP_DOMAINS:["ap-web-1-oversea.agora.io"],AP_BACKUP_DOMAINS:["ap-web-2-oversea.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-oversea.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-oversea.agora.io"],LOG_UPLOAD_SERVER:["logservice-oversea.agora.io"],PROXY_AP:["proxy-ap-web-oversea.agora.io"],PROXY_NGINX:["webrtc-cloud-proxy.agora.io"]}),m(Db,F.GLOBAL,{CODE:F.GLOBAL,AP_DOMAINS:["ap-web-1.agora.io","ap-web-2.agora.io"],AP_BACKUP_DOMAINS:["ap-web-3.agora.io","ap-web-4.agora.io"],EVENT_REPORT_DOMAIN:["webcollector-rtm.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["webcollector-1.agora.io"],LOG_UPLOAD_SERVER:["logservice-rtm.agora.io"],PROXY_AP:["ap-proxy-1.agora.io","ap-proxy-2.agora.io"],PROXY_NGINX:["webrtc-cloud-proxy.sd-rtn.com"]}),m(Db,F.OCEANIA,{CODE:F.OCEANIA,AP_DOMAINS:["ap-web-1-oceania.agora.io"],AP_BACKUP_DOMAINS:["ap-web-2-oceania.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-oceania.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-oceania.agora.io"],LOG_UPLOAD_SERVER:["logservice-oceania.agora.io"],PROXY_AP:["proxy-ap-web-oceania.agora.io"],PROXY_NGINX:["oceania.webrtc-cloud-proxy.sd-rtn.com"]}),m(Db,F.SOUTH_AMERICA,{CODE:F.SOUTH_AMERICA,AP_DOMAINS:["ap-web-1-south-america.agora.io"],AP_BACKUP_DOMAINS:["ap-web-2-south-america.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-south-america.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-south-america.agora.io"],LOG_UPLOAD_SERVER:["logservice-south-america.agora.io"],PROXY_AP:["proxy-ap-web-south-america.agora.io"],PROXY_NGINX:["south-america.webrtc-cloud-proxy.sd-rtn.com"]}),m(Db,F.AFRICA,{CODE:F.AFRICA,AP_DOMAINS:["ap-web-1-africa.agora.io"],AP_BACKUP_DOMAINS:["ap-web-2-africa.agora.io"],EVENT_REPORT_DOMAIN:["statscollector-1-africa.agora.io"],EVENT_REPORT_BACKUP_DOMAIN:["statscollector-2-africa.agora.io"],LOG_UPLOAD_SERVER:["logservice-south-africa.agora.io"],PROXY_AP:["proxy-ap-web-africa.agora.io"],PROXY_NGINX:["africa.webrtc-cloud-proxy.sd-rtn.com"]}),m(Db,F.CHINA,{CODE:F.CHINA,AP_DOMAINS:["webrtc2-2.ap.sd-rtn.com"],AP_BACKUP_DOMAINS:["webrtc2-4.ap.sd-rtn.com"],EVENT_REPORT_DOMAIN:["web-3.statscollector.sd-rtn.com"],EVENT_REPORT_BACKUP_DOMAIN:["web-4.statscollector.sd-rtn.com"],LOG_UPLOAD_SERVER:["logservice-china.agora.io"],PROXY_AP:["proxy-ap-web.agoraio.cn"],PROXY_NGINX:["east-cn.webrtc-cloud-proxy.sd-rtn.com"]}),Db)),yf=(ud={},m(ud,F.ASIA,[F.CHINA,F.JAPAN,F.INDIA]),m(ud,F.EUROPE,[]),m(ud,F.NORTH_AMERICA,[]),m(ud,F.SOUTH_AMERICA,[]),m(ud,F.OCEANIA,[]),m(ud,F.AFRICA,[]),ud),Kr=[F.OVERSEA,F.GLOBAL,F.CHINA,F.NORTH_AMERICA,F.EUROPE,F.ASIA,F.JAPAN,F.INDIA,F.OCEANIA,F.SOUTH_AMERICA,F.AFRICA],Zm=function(e){return Object.values(yf).flat().includes(e)},cu=function(e){var t;return null===(t=Hg(yf).find((function(t){return(t=ra(t,2))[0],t[1].includes(e)})))||void 0===t?void 0:t[0]},AC=function(e){return e.sort((function(e,t){return Kr.indexOf(e)-Kr.indexOf(t)}))},xe=function(e){var t=new Set;if(0===(e=AC(e).slice(0,3).map((function(e){var n=Kg[e];if(void 0===n)throw new Ia("invalid area key");return e=n.CODE,n=ff(n,yC),t.add(e),n}))).length)throw new Ia("areas cannot be empty");return ua({CODES:t},e.reduce((function(e,t){for(var n=0,r=Hg(e);n<r.length;n++){var i=ra(r[n],2),o=i[0];i=i[1],e[o]=Array.from(new Set([].concat(G(t[o]),G(i))))}return e})))},M,Lr=function(){var e=J(w.mark((function e(t,n){var r,i,o,a,s,u=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(2<(i=2<u.length&&void 0!==u[2]?u[2]:0))){e.next=3;break}return e.abrupt("return");case 3:return o={withCredentials:!0,body:t,timeout:2e4},a=0<i?(null==M?void 0:M.LOG_UPLOAD_SERVER[0])||"rtm.logservice.sd-rtn.com":(null==M?void 0:M.LOG_UPLOAD_SERVER[0])||"logservice-rtm.agora.io",s=n?"https://".concat(null!==(r=null==M?void 0:M.PROXY_NGINX[0])&&void 0!==r?r:"webrtc-cloud-proxy.sd-rtn.com","/ls/?h=").concat(a,"&p=443&d=upload/v1"):"https://".concat(a,"/upload/v1"),e.next=8,te(s,o).catch((function(e){return Lr(t,n,i+1)}));case 8:case"end":return e.stop()}}),e)})));return function(t,n){return e.apply(this,arguments)}}(),Mr=new wC({processId:"process-".concat(gg),sdkVersion:"Agora_RTM_SDK_for_Web_".concat("v1.4.3-17-g1e27aa38"),uploadRequest:Lr,rtmConfig:{}}),il="text payload rawMessage thumbnail attributeInfos keys value extra".split(" "),Nr="account ticket uid detail token account fileName cname user group key origin users src dst lastUpdateUserId channel cert wan_ip".split(" "),Or="serverReceivedTs isOfflineMessage enableHistoricalMessaging enableOfflineMessaging hasPeerReceived messageType enableNotificationToChannelMembers lastUpdateTs".split(" "),BC="ChannelMessage MemberLeft MessageFromPeer LocalInvitationRefused LocalInvitationAccepted RemoteInvitationCanceled PeersOnlineStatusChanged AttributesUpdated MemberJoined".split(" "),ye=function(e){if("string"==typeof e)return oa(e);if(Array.isArray(e)&&e.every((function(e){return"string"==typeof e})))return e.map((function(e){return oa(e)}));if(!Il(e)){for(var t={},n=0;n<Or.length;n++){var r=Or[n];r in e&&(t[r]=e[r])}if(0<Object.keys(t).length)return t;if(5>Object.keys(e).length){for(n=0,e=Object.entries(e);n<e.length;n++){var i=ra(e[n],2);r=i[0],i=i[1],il.includes(r)?t[r]="[Hidden Info]":t[oa(r)]="string"==typeof i?oa(i):"[Sensitive Info]"}return t}return"[Sensitive Info]"}return e},Pr=function(e){return"object"===X(e)?yd(e)?Vm(fe(e,5),il,Nr):e.constructor&&e.constructor.name:e},Qr=function(e,t){return e instanceof Error?e.message:"string"!=typeof e?JSON.stringify(Vm(fe(e,5),il,Nr)):(t=t.map((function(e){return e instanceof Error?e.message:"object"===X(e)?Gr(Array.isArray(e)?e.map(Pr):Pr(e)):e})),Nm.apply(void 0,[e.replace(/%[%Oo]/g,(function(e){return"%%"===e?"%":"%o"===e||"%O"===e?"%s":e}))].concat(G(t))))},CC=1,Rr=function(e,t,n){var r=Hr(e);return r.enabled=!0,r.log=n,r.useColors=!1,function(n){for(var i=arguments.length,o=Array(1<i?i-1:0),a=1;a<i;a++)o[a-1]=arguments[a];if(t.enableLogUpload){i=Cg(n);var s=Qr(i,o);Mr.upload({log_item_id:"".concat(CC++),log_level:e,payload_str:"[".concat(sC(),"] ").concat(e," - ").concat(256<s.length?s.slice(0,256):s)})}switch(i=function(e){var t=s||Qr(Cg(n),o),i=Nc.LOG_HANDLER;"function"==typeof i&&i({level:e,message:t}),r(t)},e){case"RTM:INFO":t.logFilter.info&&i("log");break;case"RTM:WARN":t.logFilter.warn&&i("warning");break;case"RTM:ERROR":t.logFilter.error&&i("error");break;case"RTM:TRACK":t.logFilter.track&&i("log");break;case"RTM:MSG:RECV":case"RTM:MSG:SEND":t.logFilter.debug&&i("debug");break;case"RTM:DEBUG":t.logFilter.debug&&i("debug")}}},jl,Sr=function(e){return function(t){var n=1===jl||void 0===e?"":"Ins#".concat(e," ");return"".concat(n).concat(t)}},kl=function(e,t,n){var r=Sr(jl);return Rr("RTM:".concat(t),n,(function(t){return e(r(t))}))},tb=function(){return function(e){function t(e,i){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2];W(this,t);var a=r.call(this);if(m(n(a),"logError",void 0),m(n(a),"invokeTracker",void 0),m(n(a),"resultTracker",void 0),m(n(a),"errorTracker",void 0),m(n(a),"eventTracker",void 0),m(n(a),"info",void 0),m(n(a),"warn",void 0),m(n(a),"log",void 0),m(n(a),"genLogger",void 0),m(n(a),"loggerId",void 0),m(n(a),"logger",void 0),m(n(a),"name",void 0),a.logger=e,a.name=i,a.loggerId=e.loggerId,a.info=e.info,a.warn=e.warn,a.logError=e.logError,a.genLogger=e.genLogger,a.log=e.genLogger("RTM:DEBUG","<".concat(i,"> ")),a.invokeTracker=e.genTracker("Invoke"),a.eventTracker=e.genTracker("Event"),a.resultTracker=e.genTracker("Result"),a.errorTracker=e.genTracker("Error"),o){var s=a.emit.bind(n(a));a.emit=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];e=t[0],n=t.slice(1);var r=BC.includes(e);a.eventTracker.apply(a,["%s: ".concat(0<n.length?"%s emitted with args: ".concat(n.map((function(){return"%o"}))):"%s emitted"),i,e].concat(G(r?n.map(ye):n)));try{s.apply(void 0,t)}catch(t){a.logError("Caught in the callback function of the event %s",e,t)}}}return a}la(t,e);var r=ma(t);return t}(ea)},DC=function(e){return kl(console.log.bind(console),"INFO",e)},EC=function(e){return kl(console.warn.bind(console),"WARN",e)},FC=function(e){return kl(console.error.bind(console),"ERROR",e)},Tr=function(e,t){return function(n){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"",i=Sr(e),o=console.debug.bind(console),a=Rr(n,t,(function(e){return o(i(e))}));return function(e){for(var t=arguments.length,n=Array(1<t?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];return a.apply(void 0,[r+e].concat(n))}}},GC=function(e,t){return function(n){return Tr(e,t)("RTM:TRACK","[".concat(n,"] "))}},Li=t.URI,eu=Oh,HC=ff(VB,["Wrapper"]),$m=Gk(HC,"URI"),Ur=function(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n<t;){var o=e[r=nr(n,i)];e[r]=e[n],e[n]=o}return e.length=t,e},IC=function(e){return Ur(Xh(e))},JC=function(e){return Ur(Ni(e))},$e=function(e){return(Va(e)?IC:JC)(e)},af={0:9591,1:9593},$d=function(e){return"https://".concat(e,"/api/v1")},KC=bb.apply(void 0,G($e(["web-1.ap.sd-rtn.com","web-2.ap.sd-rtn.com"].map($d)))),LC=bb.apply(void 0,G($e(["ap-web-1.agora.io","ap-web-2.agora.io"].map($d)))),MC=bb.apply(void 0,G($e(["web-3.ap.sd-rtn.com","web-4.ap.sd-rtn.com"].map($d)))),NC=bb.apply(void 0,G($e(["ap-web-3.agora.io","ap-web-4.agora.io"].map($d)))),ll=Ph(),ml=function(e){function t(e,i,o,a,s,u){W(this,t);var c=r.call(this,s,Ai("Socket-",s.loggerId));if(m(n(c),"isActiveClose",!1),m(n(c),"loggedIn",!1),m(n(c),"useNewDomain",void 0),m(n(c),"receivedPacket",new Pa),m(n(c),"open$",void 0),m(n(c),"input$",new Pa),m(n(c),"userJoin$",new Pa),m(n(c),"attemptsSinceLastError",0),m(n(c),"message$",new Pa),m(n(c),"socket$",void 0),m(n(c),"toClose",new Pa),m(n(c),"toReconnect",new Pa),m(n(c),"sendLogger",void 0),m(n(c),"receiveLogger",void 0),m(n(c),"ip",void 0),m(n(c),"env",void 0),m(n(c),"ticket",void 0),m(n(c),"context",void 0),m(n(c),"getDomain",(function(){return an(c.ip,c.useNewDomain)})),m(n(c),"socketReconnector",(function(e){var t=function(e){return c.attemptsSinceLastError+=1,c.warn("The %s of Env %d reconnecting %s",c.name,c.env,e.message),Bc(3e3)};return e.pipe(Ga((function(e){return c.log("socket connection closed"),c.loggedIn=!1,2<=c.attemptsSinceLastError?(c.warn("socket connection failure"),c.emit("connectionFailure"),c.close(),Z(e)):c.isActiveClose?vb:(c.emit("reconnect"),c.useNewDomain=!c.useNewDomain,Z(e))})),oe((function(e){return e.pipe(Cc(t))})))})),c.ip=e,c.env=i,c.ticket=o,c.context=a,c.useNewDomain=null!=u?u:.5<=Math.random(),c.sendLogger=c.genLogger("RTM:MSG:SEND"),c.receiveLogger=c.genLogger("RTM:MSG:RECV"),0!==i&&1!==i)throw new ll({ILLEGAL_RTM_ENV:"The env number is out of rtm env count"});if(!Gm(e))throw new ll({IP_NOT_VALID:"The ip from ap is not valid"});var l=af[i];c.log("Opening websocket address %s for the Env %d",c.ip,c.env);var f=Xb(c.input$,c.userJoin$.pipe(Rt(2)),c.message$).pipe(ba((function(e){return Oh.encode(e).finish()})));return e=Xb(St("",{protocols:[],makeWebSocket:function(){if(c.context.config.enableCloudProxy){if(0===c.context.cloudProxyServers.length)throw c.logError("No cloud proxy server to connect"),new da;var e="wss://".concat(an(bn(c.context.cloudProxyServers),!1),"/");e=we(e,"sid",c.context.sid),e=we(e,"remote_port",l.toString()),e=we(e,"remote_ip",c.ip),e=we(e,"token",c.context.key),e=new WebSocket(e)}else e=new WebSocket("wss://".concat(c.getDomain(),":").concat(l));return e.binaryType="arraybuffer",e}}),c.toReconnect),c.socket$=Ca(e,Tk.pipe(hb(15e3),Ga((function(e){return Sa(e)&&c.warn("socket open timed out"),Z(e)})))).pipe(ba((function(e){if(e instanceof Error)throw c.warn("Env_%d: Force reconnect the socket",c.env),e;return e(f).pipe(ba((function(e){return Oh.decode(new Uint8Array(e))})))})),c.socketReconnector),c.open$=c.socket$.pipe(ca((function(e){c.log("Websocket opened",c.name),e.subscribe((function(e){var t=e.data;e=Li[e.uri].slice(0,-3),t=$m[e].decode(t);var n=HA({},Gk(t,"toJSON"),(function(e,t){return t instanceof U?Km(t):t})),r=!1;if((t instanceof vr||t instanceof ur)&&t.instance.lessThanOrEqual(4294967295)&&(r=!0),t instanceof wr||t instanceof xr){var i=t.instance,o=t.sequence;(t.dialogue.lessThanOrEqual(4294967295)||i.lessThanOrEqual(4294967295)||o.lessThan(1))&&(r=!0)}r?c.warn("Env_%d: Illegal %s, abandoned %o",c.env,e,n):("Pong"!==e&&c.receiveLogger("Env_%d: %s %o",c.env,e,n),c.receivedPacket.next([e,t]))}),(function(){}))})),qf(void 0),ob(c.toClose),pe()),c}la(t,e);var r=ma(t);return Ha(t,[{key:"address",get:function(){return"".concat(this.ip,":").concat(af[this.env])}},{key:"sendPacket",value:function(e,t){if("Ping"!==e){var n=uc(t,(function(e){return e instanceof U?Km(e):e}));this.sendLogger("Env_%d: %s %o",this.env,e,n)}t=du(e,t),"UserJoin"===e?this.userJoin$.next(t):"Message"===e?this.message$.next(t):this.input$.next(t)}},{key:"close",value:function(){this.isActiveClose=!0,this.loggedIn=!1,this.toClose.next()}},{key:"fromReceived",value:function(e){var t=this;return this.receivedPacket.pipe(ca((function(e){var n=ra(e,2);e=n[0],n=n[1],"UserResp"===e&&(t.attemptsSinceLastError=0,t.loggedIn=!0),"UserDrop"===e&&t.emit("socketUserDrop",n)})),wb((function(t){return ra(t,1)[0]===e})),ba((function(e){return ra(e,2)[1]})))}},{key:"forceReconnect",value:function(){this.toReconnect.next(new ll({FORCE_RECONNECTING:"Connection seems broken, try force reconnecting"}))}}]),t}(tb());N({target:"String",proto:!0,forced:zr},{padStart:function(e){return XB(this,e,1<arguments.length?arguments[1]:void 0)}});var OC=function(e){var t=xf(Kg);e=Yt(e);for(var n=0;n<t.length;n++){var r=Kg[t[n]];if(null!=r&&r.AP_DOMAINS.includes(e)||null!=r&&r.AP_BACKUP_DOMAINS.includes(e)||null!=r&&r.PROXY_AP.includes(e))return[r.CODE]}return[F.CHINA,F.GLOBAL]},PC={INVALID_APP_ID:"Illegal App ID",NO_AUTHORIZED:"Signature verification failed",TOKEN_TIMEOUT:"Dynamic key expired",INVALID_TOKEN_UID:"UID in the security key(token) is not valid",APP_ID_NO_ACTIVATED:"The vendor is not activated",DYNAMIC_KEY_NOT_ENABLED:"The vendor did not enable the dynamic key, but uses the dynamic key",DYNAMIC_ENABLED_BUT_STATIC_KEY:"The vendor enabled the dynamic key, but uses the static key",TOKEN_EXPIRED:"The token has expired",INVALID_USER_ID:"The user ID to login does not match the token",FORBIDDEN_REGION:"Forbidden to access the request in this area",CANNOT_MEET_AREA_DEMAND:"Cannot allocate to meet the requirements of the given area limit"},Vr={5:"INVALID_APP_ID",7:"INVALID_USER_ID",9:"NO_AUTHORIZED",10:"TOKEN_TIMEOUT",11:"APP_ID_NO_ACTIVATED",12:"INVALID_TOKEN_UID",13:"TOKEN_EXPIRED",14:"DYNAMIC_KEY_NOT_ENABLED",15:"DYNAMIC_ENABLED_BUT_STATIC_KEY",18:"FORBIDDEN_REGION",19:"CANNOT_MEET_AREA_DEMAND"},QC=[100,101,102],Qh=/web-(\d)/,Wr=function(e){function t(e,i){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2];W(this,t);var a=r.call(this,i,"AccessPoint");return m(n(a),"handleUniLbsError",(function(e,t){var n=e;if(4<e.toString().length){var r=e.toString().padStart(8,"0"),i=parseInt(r.slice(0,4),10);if(r=parseInt(r.slice(4,8),10),201===i)n=r;else if(101===i&&!QC.includes(r))return Z(Error("service is currently unavailable"))}if(i=n.toString(),!Object.keys(Vr).includes(i))return(e=new da(["Login is rejected by the server. The response code is %d",e],jg)).serverCode=n,Z(e);switch(i=Vr[i],n=PC[i],i){case"INVALID_APP_ID":case"APP_ID_NO_ACTIVATED":return(t=new Ye(n,$q)).serverCode=e,Z(t);case"INVALID_USER_ID":return(t=new Ye(n,Jh)).serverCode=e,Z(t);case"TOKEN_EXPIRED":case"TOKEN_TIMEOUT":return(t=new Ye(n,Kh)).serverCode=e,Z(t);case"NO_AUTHORIZED":case"INVALID_TOKEN_UID":case"DYNAMIC_KEY_NOT_ENABLED":case"DYNAMIC_ENABLED_BUT_STATIC_KEY":return(t=new Ye(n,ar)).serverCode=e,Z(t);case"CANNOT_MEET_AREA_DEMAND":return(t=OC(t)).forEach((function(e){return a.failedAreas.add(e)})),a.failedAreas.size===(void 0===M?2:M.CODES.size)?((t=new I(n,jg)).serverCode=e,Z(t)):Z(Error("ap ".concat(t.join(", ")," cannot meet requirement")));case"FORBIDDEN_REGION":return(t=new da(n,jg)).serverCode=e,Z(t);default:return Z(Im("ApResErrType",i))}})),m(n(a),"getApEdgeInfo$",void 0),m(n(a),"getApEdgeInfoEndFirst$",void 0),m(n(a),"apFinish$",new Pa),m(n(a),"retryCount",0),m(n(a),"failedAreas",new Set),m(n(a),"usedUrl",[]),m(n(a),"newDomainUsed",!1),m(n(a),"backupNewDomainUsed",!1),m(n(a),"genUrl",(function(){return void 0===M?mi.apply(void 0,G($e([KC,LC]))).pipe(ni((function(e){return bb.apply(void 0,G(e))}))):bb.apply(void 0,G(M.AP_DOMAINS.slice(0,3).map($d)))})),m(n(a),"genBackupUrl",(function(){return void 0===M?mi.apply(void 0,G($e([MC,NC]))).pipe(ni((function(e){return bb.apply(void 0,G(e))}))):bb.apply(void 0,G(M.AP_BACKUP_DOMAINS.slice(0,3).map($d)))})),m(n(a),"getApUrl$",(function(e){var n,r;return a.genUrl().pipe(wb((function(e){return(!a.newDomainUsed||!e.includes("sd-rtn.com"))&&(e.includes("sd-rtn.com")&&(a.newDomainUsed=!0),!dl(a.usedUrl,(function(t){var n;return t===(null===(n=e.match(Qh))||void 0===n?void 0:n[1])})))})),ca((function(e){var t;void 0===M&&("string"==typeof(e=null===(t=e.match(Qh))||void 0===t?void 0:t[1])&&a.usedUrl.push(e))})),Ka(e?Math.max(Nc.RECONNECTING_AP_NUM,null!==(n=null==M?void 0:M.CODES.size)&&void 0!==n?n:0):null!==(r=null==M?void 0:M.CODES.size)&&void 0!==r?r:2),Dd((function(){return t.runOutOfUrlSymbol})),Ga((function(e,n){return a.newDomainUsed=!1,e===t.runOutOfUrlSymbol?(a.usedUrl=[],n):Z(e)})))})),m(n(a),"getBackupApUrl$",(function(e){var n,r;return a.genBackupUrl().pipe(wb((function(e){return(!a.backupNewDomainUsed||!e.includes("sd-rtn.com"))&&(e.includes("sd-rtn.com")&&(a.backupNewDomainUsed=!0),!dl(a.usedUrl,(function(t){var n;return t===(null===(n=e.match(Qh))||void 0===n?void 0:n[1])})))})),ca((function(e){var t;void 0===M&&("string"==typeof(e=null===(t=e.match(Qh))||void 0===t?void 0:t[1])&&a.usedUrl.push(e))})),Ka(e?Math.max(Nc.RECONNECTING_AP_NUM,null!==(n=null==M?void 0:M.CODES.size)&&void 0!==n?n:0):null!==(r=null==M?void 0:M.CODES.size)&&void 0!==r?r:2),Dd((function(){return t.runOutOfUrlSymbol})),Ga((function(e,n){return a.backupNewDomainUsed=!1,e===t.runOutOfUrlSymbol?(a.usedUrl=[],n):Z(e)})))})),m(n(a),"getProxyApUrl$",(function(e){var t,n;return bb.apply(void 0,G(((null==M?void 0:M.PROXY_AP.slice(0,3))||["ap-proxy-1.agora.io","ap-proxy-2.agora.io"]).map($d))).pipe(Ka(e?Math.max(Nc.RECONNECTING_AP_NUM,null!==(t=null==M?void 0:M.CODES.size)&&void 0!==t?t:0):null!==(n=null==M?void 0:M.CODES.size)&&void 0!==n?n:2))})),m(n(a),"context",void 0),m(n(a),"fetchCloudProxy",(function(e,t){var n=Ai("AP-",a.loggerId);a.log("The AccessPoint requests %s(%s)",e,n);var r=new AbortController;return a.apFinish$.pipe(Ka(1)).subscribe((function(){return r.abort()})),ad(J(w.mark((function i(){var o;return w.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return o=Ag(0,Number.MAX_SAFE_INTEGER),a.log("%s request opid: %d",n,o),i.abrupt("return",te(e,{headers:{"X-Packet-Service-Type":"0","X-Packet-URI":"90","Content-Type":"application/json"},body:{sid:a.context.sid,opid:o,appid:a.context.appId,client_ts:Math.ceil(Date.now()/1e3),request_bodies:[{uri:22,buffer:{service_ids:[7,16],key:null!=t?t:a.context.key,cname:a.context.uid,uid:0,detail:ua({},void 0===M?{11:[F.CHINA,F.GLOBAL].join()}:{11:Array.from(M.CODES).map((function(e){return e===F.OVERSEA?"".concat(F.ASIA,",").concat(F.EUROPE,",").concat(F.AFRICA,",").concat(F.NORTH_AMERICA,",").concat(F.SOUTH_AMERICA,",").concat(F.OCEANIA):e})).join(",")})}}]},signal:r.signal}));case 3:case"end":return i.stop()}}),i)})))).pipe(Ga((function(t){return"AbortError"!==t.name&&(a.logError(t),a.warn("The AP server %s request failure",e,t)),vb})),cb(function(){var t=J(w.mark((function t(r){var i,o,s,u,c,l,f,h,p,d,v,b,g,y,m,E,_,O,I;return w.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=r.responseText,o=JSON.parse(i),a.log("The %s response is %o",n,o),(void 0===(s=o.response_body)||0===s.length||s.some((function(e){var t;return void 0===(null===(t=e.buffer)||void 0===t?void 0:t.code)||23!==e.uri})))&&Z(new da("cloud proxy response_body not valid",jg)),0===(u=s.filter((function(e){return 0!==e.buffer.code}))).length){t.next=14;break}if(void 0===(c=u.find((function(e){return 128===e.buffer.flag})))){t.next=12;break}return t.abrupt("return",a.handleUniLbsError(c.buffer.code,e));case 12:return a.logError("cloud proxy error response"),t.abrupt("return",a.handleUniLbsError(u[0].buffer.code,e));case 14:for(l=[],f=0;f<s.length;f++)if(262144===(null==(d=s[f])||null===(h=d.buffer)||void 0===h?void 0:h.flag))null===(v=d.buffer)||void 0===v||null===(b=v.edges_services)||void 0===b||null===(g=b.forEach)||void 0===g||g.call(b,(function(e){Gm(e=e.ip)&&-1===a.context.cloudProxyServers.indexOf(e)&&(a.log("got cloud proxy server: %s",e),a.context.cloudProxyServers.push(e))}));else if(128===(null==d||null===(p=d.buffer)||void 0===p?void 0:p.flag)){for(_=function(e,t){var n=t[e];l.some((function(e){return e.ip===n.ip}))||l.push({ip:n.ip,ticket:d.buffer.cert})},O=0,I=d.buffer.edges_services;O<I.length;O++)_(O,I);a.context.rtmArea=null!==(y=null===(m=d.buffer)||void 0===m||null===(E=m.detail)||void 0===E?void 0:E[9])&&void 0!==y?y:""}return t.abrupt("return",bb.apply(void 0,G(l).concat([fg])));case 19:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),Ga((function(e){return sa(e)?Z(e):vb})),tg(),wb((function(e){return void 0!==e&&"string"==typeof e.ip&&"string"==typeof e.ticket})))})),m(n(a),"fetchAp",(function(e,t){var n=Ai("AP-",a.loggerId);a.log("The AccessPoint requests %s(%s)",e,n);var r=new AbortController;return a.apFinish$.pipe(Ka(1)).subscribe((function(){return r.abort()})),ad(J(w.mark((function i(){var o;return w.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return o=Ag(0,Number.MAX_SAFE_INTEGER),a.log("%s request opid: %d",n,o),i.abrupt("return",te(e,{headers:{"X-Packet-Service-Type":"0","X-Packet-URI":"69","Content-Type":"application/json"},body:{flag:128,opid:o,key:t||a.context.key,cname:a.context.uid,detail:ua({},void 0===M?{11:[F.CHINA,F.GLOBAL].join()}:{11:Array.from(M.CODES).map((function(e){return e===F.OVERSEA?"".concat(F.ASIA,",").concat(F.EUROPE,",").concat(F.AFRICA,",").concat(F.NORTH_AMERICA,",").concat(F.SOUTH_AMERICA,",").concat(F.OCEANIA):e})).join(",")}),uid:0,sid:a.context.sid},signal:r.signal}));case 3:case"end":return i.stop()}}),i)})))).pipe(Ga((function(t){return"AbortError"!==t.name&&(a.logError(t),a.warn("The AP server %s request failure",e,t)),vb})),cb(function(){var t=J(w.mark((function t(r){var i,o,s,u,c,l,f;return w.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=r.responseText,o=JSON.parse(i),a.log("The %s response is %o",n,o),u=(s=o).code,c=s.addresses,l=s.detail,0===u){t.next=6;break}return t.abrupt("return",a.handleUniLbsError(u,e));case 6:if(0!==(f=c).length){t.next=11;break}return t.abrupt("return",Z(Error("No available edge address to connect")));case 11:return a.context.rtmArea=null==l?void 0:l[9],t.abrupt("return",bb.apply(void 0,G(f).concat([fg])));case 13:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),tg(),Ga((function(e){return sa(e)?Z(e):vb})),wb((function(e){return void 0!==e&&"string"==typeof e.ip&&"string"==typeof e.ticket})))})),a.context=e,a.getApEdgeInfoEndFirst$=function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];return Bc(0,e||o?Nc.RECONNECTING_AP_INTERVAL:2e3).pipe(Ka(1),ca((function(){a.retryCount+=1})),cb((function(){return a.context.config.enableCloudProxy?a.getProxyApUrl$(e||o):(4<=a.retryCount&&(a.retryCount=0),3>=a.retryCount?a.getApUrl$(e||o):a.getBackupApUrl$(e||o))})),cb((function(e){return a.context.config.enableCloudProxy?a.fetchCloudProxy(e):a.fetchAp(e)})),Ga((function(e){return e instanceof pb&&a.warn("AP request timeout"),Z(e)})),om((function(e){return e.ip})),ob(a.apFinish$))},a.getApEdgeInfo$=function(e){return Bc(0,e||o?Nc.RECONNECTING_AP_INTERVAL:2e3).pipe(Ka(8),ca((function(){a.retryCount+=1})),cb((function(){return a.context.config.enableCloudProxy?a.getProxyApUrl$(e||o):3>=a.retryCount?a.getApUrl$(e||o):a.getBackupApUrl$(e||o)})),cb((function(e){return(a.context.config.enableCloudProxy?a.fetchCloudProxy(e):a.fetchAp(e)).pipe()})),Ga((function(e){return e instanceof pb&&a.warn("AP request timeout"),Z(e)})),om((function(e){return e.ip})),ob(a.apFinish$))},a}la(t,e);var r=ma(t);return Ha(t,[{key:"clearUp",value:function(){this.failedAreas.clear(),this.retryCount=0}}]),t}(tb());m(Wr,"runOutOfUrlSymbol",Symbol("AP urls are used up"));var Xr=Ph(),Yr=function(e){function t(e,i,o){W(this,t);var a=r.call(this,i,"Connection");m(n(a),"apClient",void 0),m(n(a),"lastOpenSockets",[new qe(1),new qe(1)]),m(n(a),"curOpenSockets",[void 0,void 0]),m(n(a),"ipIterator",0),m(n(a),"firstEnv",.5<=Math.random()?1:0),m(n(a),"firstSocketOpener",void 0),m(n(a),"secondSocketOpener",void 0),m(n(a),"firstOpenKeeperSubject",new Pa),m(n(a),"secondOpenKeeperSubject",new Pa),m(n(a),"edgeInfoReplayed",void 0),m(n(a),"firstEnvOpenSocket",void 0),m(n(a),"firstOpenKeeperSub",void 0),m(n(a),"secondOpenKeeperSub",void 0),m(n(a),"context",void 0),m(n(a),"logger",void 0),a.context=e,a.logger=i,a.apClient=new Wr(a.context,i),a.apClient.apFinish$.subscribe((function(){a.log("Ap client fetch finished")}));var s,u=[];return a.edgeInfoReplayed=a.apClient.getApEdgeInfo$(o).pipe(oe((function(e){return e.pipe(ca((function(e){if(sa(e))throw e})),cd(o?Zd.getParameter("RECONNECTING_AP_INTERVAL"):900),ob(Bc(2e4)))})),wb((function(e){return!dl(u,e)})),Dd((function(){return new Xr({AP_NO_AVAILABLE_EDGE:"No available edge address to connect"})})),ca((function(e){u.push(e),a.log("An edge info got %o",e)})),ca({error:function(e){a.emit("connectionInitFailure",e)}}),wg((function(){a.apClient.clearUp()})),sm()),a.firstEnvOpenSocket=a.edgeInfoReplayed.pipe(cb((function(e){if(void 0===e)return Z(Error("Invalid edge info"));var t=new ml(e.ip,a.firstEnv,e.ticket,a.context,i,s);return a.firstEnv=1===a.firstEnv?0:1,t.on("connectionFailure",(function(){return a.onSocketConnectionFailure(t)})),s=!t.useNewDomain,t.open$.pipe(qf(t))})),ca((function(e){a.log("The websocket of ENV_%d opened to %s:%d",e.env,e.ip,af[e.env]),a.curOpenSockets[e.env]=e,a.lastOpenSockets[e.env].next(e),a.firstEnv=e.env,a.openSecondSocket(e.env,e.ip,e.useNewDomain)})),Ka(1),pe()),a.firstSocketOpener=a.firstEnvOpenSocket.pipe(cb((function(e){return e.open$.pipe(ca((function(){a.log("The websocket of first ENV_%d re-opened to %s:%d",e.env,e.ip,af[e.env]),a.curOpenSockets[e.env]=e,a.lastOpenSockets[e.env].next(e)})))}))),e=a.firstOpenKeeperSubject.pipe(Cc(Yc)),a.firstOpenKeeperSub=e.subscribe({error:a.logError}),a}la(t,e);var r=ma(t);return Ha(t,[{key:"initConnection",value:function(){this.firstOpenKeeperSubject.next(this.firstSocketOpener)}},{key:"closeSocket",value:function(e,t){if(![0,1].includes(e))throw new Fa({INVALID_ENV:"The env argument is not 0 or 1"});var n=e===this.firstEnv?this.firstOpenKeeperSub:this.secondOpenKeeperSub;this.firstOpenKeeperSub=void 0;var r=this.curOpenSockets[e];this.curOpenSockets[e]=void 0,r&&(r.isActiveClose=!0,setTimeout((function(){r.close()}),t)),void 0!==n&&setTimeout((function(){null==n||n.unsubscribe()}),t)}},{key:"waitClosing",value:function(e){var t=this;return e.isActiveClose=!0,e.open$.pipe(tt(),Ga((function(e){return e.message===mr.normalClosureMessage?vb:Z(e)})),hb(5e3),Ga((function(n){return n instanceof pb?(t.warn("Force closing the ENV_%d connection",e.env),vb):Z(n)})))}},{key:"onSocketConnectionFailure",value:function(e){var t=[0,1].filter((function(t){return t!==e.env}))[0];(t=this.curOpenSockets[t])&&t.loggedIn?this.reopenSocketWithApRequest(e.env):this.emit("socketsFailure")}},{key:"openSecondSocket",value:function(e,t,n){var r=this,i=1===e?0:1;this.secondSocketOpener=this.edgeInfoReplayed.pipe(rm((function(e,t){return[].concat(G(e),[t])}),[]),ba((function(e){return kr(e,(function(e){return Jm(t,e.ip)})).slice(-1)[0]})),Ka(1),cb((function(e){if(void 0===e)return Z(Error("Invalid edge info"));var t=new ml(e.ip,i,e.ticket,r.context,r.logger,n);return t.on("connectionFailure",(function(){return r.onSocketConnectionFailure(t)})),t.open$.pipe(ca((function(){r.lastOpenSockets[i].next(t),r.curOpenSockets[i]=t})))})),pe()),this.secondOpenKeeperSub=this.secondOpenKeeperSubject.pipe(Cc(Yc)).subscribe({error:this.logError}),this.secondOpenKeeperSubject.next(this.secondSocketOpener)}},{key:"reopenSocketWithApRequest",value:function(e){var t=this,n=[0,1].filter((function(t){return t!==e}))[0];if(void 0!==(n=this.curOpenSockets[n])){var r,i=n.ip;n=this.apClient.getApEdgeInfoEndFirst$(!0).pipe(Dd((function(){return new Xr({AP_NO_AVAILABLE_EDGE:"No available edge address to connect"})})),oe((function(e){return e.pipe(ca((function(e){if(e.code===Kh)t.emit("tokenExpired"),t.apClient.apFinish$.next(void 0);else if(sa(e))throw e})),cd(Zd.getParameter("RECONNECTING_AP_INTERVAL")),ob(Bc(15e3)))})),ca((function(e){t.log("An edge info got %o",e)})),wg((function(){t.apClient.clearUp()}))).pipe(rm((function(e,t){return[].concat(G(e),[t])}),[]),ba((function(e){return(e=kr(e,(function(e){return Jm(i,e.ip)}))).length-1>=t.ipIterator?e.slice(-t.ipIterator++-1)[0]:(t.ipIterator=0,e.slice(-1)[0])})),Dd(),cb((function(n){if(void 0===n)return Z(Error("Invalid edge info"));var i=new ml(n.ip,e,n.ticket,t.context,t.logger,r);return i.on("connectionFailure",(function(){return t.onSocketConnectionFailure(i)})),r=!i.useNewDomain,i.open$.pipe(qf(i))})),ca((function(n){t.log("The websocket of ENV_%d re-opened to %s:%d using ap",n.env,n.ip,af[n.env]),t.curOpenSockets[e]=n,t.lastOpenSockets[e].next(n)})),cb((function(n){return n.open$.pipe(ca((function(){t.log("The websocket of ENV_%d re-opened to %s:%d",n.env,n.ip,af[n.env]),t.curOpenSockets[e]=n,t.lastOpenSockets[e].next(n)})))})),pe()),e===this.firstEnv?this.firstOpenKeeperSubject.next(n):this.secondOpenKeeperSubject.next(n)}}}]),t}(tb()),Xc=fc.Writer,na=fc.util,zc=fc.roots.default||(fc.roots.default={}),RC=zc.Session=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sid="",e.prototype.userId="",e.prototype.lts=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.elapse=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.appId="",e.prototype.ver="",e.prototype.buildno=0,e.prototype.installId="",e.prototype.os=0,e.prototype.did="",e.prototype.index=null,e.prototype.token="",e.prototype.version=0,e.prototype.subVersion=0,e.encode=function(e,t){return t||(t=Xc.create()),null!=e.sid&&Object.hasOwnProperty.call(e,"sid")&&t.uint32(10).string(e.sid),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.lts&&Object.hasOwnProperty.call(e,"lts")&&t.uint32(24).int64(e.lts),null!=e.elapse&&Object.hasOwnProperty.call(e,"elapse")&&t.uint32(32).int64(e.elapse),null!=e.appId&&Object.hasOwnProperty.call(e,"appId")&&t.uint32(42).string(e.appId),null!=e.ver&&Object.hasOwnProperty.call(e,"ver")&&t.uint32(50).string(e.ver),null!=e.buildno&&Object.hasOwnProperty.call(e,"buildno")&&t.uint32(56).int32(e.buildno),null!=e.installId&&Object.hasOwnProperty.call(e,"installId")&&t.uint32(66).string(e.installId),null!=e.os&&Object.hasOwnProperty.call(e,"os")&&t.uint32(128).int32(e.os),null!=e.did&&Object.hasOwnProperty.call(e,"did")&&t.uint32(138).string(e.did),null!=e.index&&Object.hasOwnProperty.call(e,"index")&&zc.Session.CommonIndex.encode(e.index,t.uint32(162).fork()).ldelim(),null!=e.token&&Object.hasOwnProperty.call(e,"token")&&t.uint32(170).string(e.token),null!=e.version&&Object.hasOwnProperty.call(e,"version")&&t.uint32(176).int32(e.version),null!=e.subVersion&&Object.hasOwnProperty.call(e,"subVersion")&&t.uint32(184).int32(e.subVersion),t},e.CommonIndex=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.index1="",e.prototype.index2="",e.prototype.index3="",e.encode=function(e,t){return t||(t=Xc.create()),null!=e.index1&&Object.hasOwnProperty.call(e,"index1")&&t.uint32(10).string(e.index1),null!=e.index2&&Object.hasOwnProperty.call(e,"index2")&&t.uint32(18).string(e.index2),null!=e.index3&&Object.hasOwnProperty.call(e,"index3")&&t.uint32(26).string(e.index3),t},e}(),e}(),SC=zc.Link=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sid="",e.prototype.userId="",e.prototype.lts=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.elapse=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.ec=0,e.prototype.sc=0,e.prototype.destServerIp="",e.prototype.ackedServerIp="",e.prototype.responseTime=0,e.encode=function(e,t){return t||(t=Xc.create()),null!=e.sid&&Object.hasOwnProperty.call(e,"sid")&&t.uint32(10).string(e.sid),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.lts&&Object.hasOwnProperty.call(e,"lts")&&t.uint32(24).int64(e.lts),null!=e.elapse&&Object.hasOwnProperty.call(e,"elapse")&&t.uint32(32).int64(e.elapse),null!=e.ec&&Object.hasOwnProperty.call(e,"ec")&&t.uint32(40).int32(e.ec),null!=e.sc&&Object.hasOwnProperty.call(e,"sc")&&t.uint32(48).int32(e.sc),null!=e.destServerIp&&Object.hasOwnProperty.call(e,"destServerIp")&&t.uint32(58).string(e.destServerIp),null!=e.ackedServerIp&&Object.hasOwnProperty.call(e,"ackedServerIp")&&t.uint32(66).string(e.ackedServerIp),null!=e.responseTime&&Object.hasOwnProperty.call(e,"responseTime")&&t.uint32(72).int32(e.responseTime),t},e}(),TC=zc.Logout=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sid="",e.prototype.userId="",e.prototype.lts=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.elapse=na.Long?na.Long.fromBits(0,0,!1):0,e.encode=function(e,t){return t||(t=Xc.create()),null!=e.sid&&Object.hasOwnProperty.call(e,"sid")&&t.uint32(10).string(e.sid),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.lts&&Object.hasOwnProperty.call(e,"lts")&&t.uint32(24).int64(e.lts),null!=e.elapse&&Object.hasOwnProperty.call(e,"elapse")&&t.uint32(32).int64(e.elapse),t},e}(),UC=zc.KickedOff=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sid="",e.prototype.userId="",e.prototype.lts=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.elapse=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.linkId=0,e.prototype.code=0,e.prototype.server="",e.prototype.serverCode=0,e.encode=function(e,t){return t||(t=Xc.create()),null!=e.sid&&Object.hasOwnProperty.call(e,"sid")&&t.uint32(10).string(e.sid),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.lts&&Object.hasOwnProperty.call(e,"lts")&&t.uint32(24).int64(e.lts),null!=e.elapse&&Object.hasOwnProperty.call(e,"elapse")&&t.uint32(32).int64(e.elapse),null!=e.linkId&&Object.hasOwnProperty.call(e,"linkId")&&t.uint32(48).int32(e.linkId),null!=e.code&&Object.hasOwnProperty.call(e,"code")&&t.uint32(56).int32(e.code),null!=e.server&&Object.hasOwnProperty.call(e,"server")&&t.uint32(66).string(e.server),null!=e.serverCode&&Object.hasOwnProperty.call(e,"serverCode")&&t.uint32(72).int32(e.serverCode),t},e}(),VC=zc.ChnJoin=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sid="",e.prototype.userId="",e.prototype.lts=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.elapse=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.cname="",e.prototype.errCode=0,e.encode=function(e,t){return t||(t=Xc.create()),null!=e.sid&&Object.hasOwnProperty.call(e,"sid")&&t.uint32(10).string(e.sid),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.lts&&Object.hasOwnProperty.call(e,"lts")&&t.uint32(24).int64(e.lts),null!=e.elapse&&Object.hasOwnProperty.call(e,"elapse")&&t.uint32(32).int64(e.elapse),null!=e.cname&&Object.hasOwnProperty.call(e,"cname")&&t.uint32(50).string(e.cname),null!=e.errCode&&Object.hasOwnProperty.call(e,"errCode")&&t.uint32(56).int32(e.errCode),t},e}(),WC=zc.ChnJoinRes=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sid="",e.prototype.userId="",e.prototype.lts=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.elapse=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.cname="",e.prototype.errCode=0,e.prototype.serverErrCode=0,e.encode=function(e,t){return t||(t=Xc.create()),null!=e.sid&&Object.hasOwnProperty.call(e,"sid")&&t.uint32(10).string(e.sid),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.lts&&Object.hasOwnProperty.call(e,"lts")&&t.uint32(24).int64(e.lts),null!=e.elapse&&Object.hasOwnProperty.call(e,"elapse")&&t.uint32(32).int64(e.elapse),null!=e.cname&&Object.hasOwnProperty.call(e,"cname")&&t.uint32(50).string(e.cname),null!=e.errCode&&Object.hasOwnProperty.call(e,"errCode")&&t.uint32(56).int32(e.errCode),null!=e.serverErrCode&&Object.hasOwnProperty.call(e,"serverErrCode")&&t.uint32(64).int32(e.serverErrCode),t},e}(),XC=zc.ChnLeave=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sid="",e.prototype.userId="",e.prototype.lts=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.elapse=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.cname="",e.prototype.errCode=0,e.encode=function(e,t){return t||(t=Xc.create()),null!=e.sid&&Object.hasOwnProperty.call(e,"sid")&&t.uint32(10).string(e.sid),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.lts&&Object.hasOwnProperty.call(e,"lts")&&t.uint32(24).int64(e.lts),null!=e.elapse&&Object.hasOwnProperty.call(e,"elapse")&&t.uint32(32).int64(e.elapse),null!=e.cname&&Object.hasOwnProperty.call(e,"cname")&&t.uint32(50).string(e.cname),null!=e.errCode&&Object.hasOwnProperty.call(e,"errCode")&&t.uint32(56).int32(e.errCode),t},e}(),YC=zc.ConnectionStateChange=function(){function e(e){if(e)for(var t=Object.keys(e),n=0;n<t.length;++n)null!=e[t[n]]&&(this[t[n]]=e[t[n]])}return e.prototype.sid="",e.prototype.userId="",e.prototype.lts=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.elapse=na.Long?na.Long.fromBits(0,0,!1):0,e.prototype.oldState=0,e.prototype.newState=0,e.prototype.reason=0,e.prototype.reconnId=0,e.encode=function(e,t){return t||(t=Xc.create()),null!=e.sid&&Object.hasOwnProperty.call(e,"sid")&&t.uint32(10).string(e.sid),null!=e.userId&&Object.hasOwnProperty.call(e,"userId")&&t.uint32(18).string(e.userId),null!=e.lts&&Object.hasOwnProperty.call(e,"lts")&&t.uint32(24).int64(e.lts),null!=e.elapse&&Object.hasOwnProperty.call(e,"elapse")&&t.uint32(32).int64(e.elapse),null!=e.oldState&&Object.hasOwnProperty.call(e,"oldState")&&t.uint32(40).int32(e.oldState),null!=e.newState&&Object.hasOwnProperty.call(e,"newState")&&t.uint32(48).int32(e.newState),null!=e.reason&&Object.hasOwnProperty.call(e,"reason")&&t.uint32(56).int32(e.reason),null!=e.reconnId&&Object.hasOwnProperty.call(e,"reconnId")&&t.uint32(64).int32(e.reconnId),t},e}(),fu=Object.freeze({__proto__:null,Session:RC,Link:SC,Logout:TC,KickedOff:UC,ChnJoin:VC,ChnJoinRes:WC,ChnLeave:XC,ConnectionStateChange:YC,default:zc}),gu=Object.freeze({__proto__:null,Counter:1,ApiExec:154,Session:164,ApEvent:165,Link:166,Logout:167,TxMessage:168,RxMessage:169,KickedOff:170,TxMessageRes:171,ChnJoin:172,ChnJoinRes:173,ChnLeave:174,ChnGetMembers:175,ChnGetMembersRes:176,ChnMemberJoined:177,ChnMemberLeft:178,QueryPeersOnlineStatus:179,QueryPeersOnlineStatusRes:180,RenewToken:181,OperateAttribute:186,OperateAttributeRes:187,ApRequest:188,LinkTcpEvent:189,LinkLoginRequest:190,ConnectionStateChange:191,default:{Counter:1,ApiExec:154,Session:164,ApEvent:165,Link:166,Logout:167,TxMessage:168,RxMessage:169,KickedOff:170,TxMessageRes:171,ChnJoin:172,ChnJoinRes:173,ChnLeave:174,ChnGetMembers:175,ChnGetMembersRes:176,ChnMemberJoined:177,ChnMemberLeft:178,QueryPeersOnlineStatus:179,QueryPeersOnlineStatusRes:180,RenewToken:181,OperateAttribute:186,OperateAttributeRes:187,ApRequest:188,LinkTcpEvent:189,LinkLoginRequest:190,ConnectionStateChange:191}}),ZC=function(e){function t(e,i,o){return W(this,t),m(n(o=r.call(this,o,"Context")),"_token",void 0),m(n(o),"config",void 0),m(n(o),"_uid",void 0),m(n(o),"_sid",void 0),m(n(o),"_area","CN"),m(n(o),"appId",void 0),m(n(o),"enableCloudProxy",!1),m(n(o),"cloudProxyServers",[]),o.appId=e,o.config=i,o}la(t,e);var r=ma(t);return Ha(t,[{key:"token",set:function(e){this._token="string"==typeof e&&e?e:void 0}},{key:"uid",get:function(){if("string"==typeof this._uid&&this._uid)return this._uid;throw new Ia("Cannot get illegal uid")},set:function(e){if(this.log("The user ID is set to %s",oa(e)),!za(e))throw new Ia;this._uid=e}},{key:"key",get:function(){if("string"==typeof this._token&&this._token)return this._token;if("string"==typeof this.appId&&this.appId)return this.appId;throw new Ia("Cannot get illegal key")}},{key:"sid",get:function(){if("string"==typeof this._sid&&this._sid)return this._sid;throw new Ia("Cannot get illegal sid")},set:function(e){if(this.log("sid is set to %s",e),"string"!=typeof e||!e)throw new Ia;this._sid=e}},{key:"rtmArea",get:function(){if("string"==typeof this._area&&this._area)return this._area;throw new Ia("Cannot get illegal area")},set:function(e){this.log("area is set to %s",e),"string"==typeof e&&e?this._area=e:this.warn("set area failed")}}]),t}(tb()),$C=!!Fc&&R((function(){Fc.prototype.finally.call({then:function(){}},(function(){}))}));if(N({target:"Promise",proto:!0,real:!0,forced:$C},{finally:function(e){var t=kd(this,mc("Promise")),n="function"==typeof e;return this.then(n?function(n){return mj(t,e()).then((function(){return n}))}:e,n?function(n){return mj(t,e()).then((function(){throw n}))}:e)}}),"function"==typeof Fc){var Zr=mc("Promise").prototype.finally;Fc.prototype.finally!==Zr&&Ta(Fc.prototype,"finally",Zr,{unsafe:!0})}var aD=function(){var e=J(w.mark((function e(t){return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Uint8Array,e.next=3,crypto.subtle.digest("SHA-256",t);case 3:return e.t1=e.sent,e.abrupt("return",new e.t0(e.t1));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),$r=function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")},bD=function(e){if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(0!=e.length%2)throw new RangeError("Expected string to be an even number of characters");for(var t=new Uint8Array(e.length/2),n=0;n<e.length;n+=2)t[n/2]=parseInt(e.substring(n,n+2),16);return t},as=function(e){return btoa(String.fromCharCode.apply(String,G(e))).replace(/={1,2}$/,"")},bs=function(){var e=J(w.mark((function e(t){var n;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,crypto.subtle.digest("SHA-1",t);case 3:n=e.sent,e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),n=sha1.arrayBuffer(t);case 9:return e.abrupt("return",as(new Uint8Array(n)));case 10:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),cs=function(e,t,n,r){r[t]=!0,n.has(e)?n.get(e).add(t):n.set(e,new Set([t]))},cD=function(e){switch(e){case"89504E47":return"image/png";case"47494638":return"image/gif";case"25504446":return"application/pdf";case"FFD8FFDB":case"FFD8FFE0":case"FFD8FFE1":return"image/jpeg";case"504B0304":return"application/zip";default:return"application/octet-stream"}},ds=function(e){function t(e,i,o,a){W(this,t);var s=r.call(this,o,"ChunkDownloadManager");if(m(n(s),"abortController",new AbortController),m(n(s),"downloadedSize",0),m(n(s),"successCount",0),m(n(s),"timer",void 0),m(n(s),"chunks",[]),m(n(s),"retUnit",void 0),m(n(s),"singleThread",!1),m(n(s),"initialized",!1),m(n(s),"ee",void 0),m(n(s),"chunkCount",void 0),m(n(s),"aborted",!1),m(n(s),"serverToIndices",new Map),m(n(s),"backupToIndices",new Map),m(n(s),"indexToBackupServers",[]),m(n(s),"busyBackupServers",new Map),m(n(s),"downloadingChunks",new Set),m(n(s),"metaInfo",void 0),m(n(s),"transHandler",void 0),s.metaInfo=e,s.transHandler=i,s.ee=void 0===a?new ea:a,o=e.size,e=e.unit,0===o)throw new Ia("size cannot be 0");return void 0!==i.cancelSignal&&i.cancelSignal.addEventListener("abort",(function(){s.abortController.abort()}),{once:!0}),s.abortController.signal.addEventListener("abort",(function(){s.aborted=!0}),{once:!0}),s.chunkCount=Math.ceil(o/(32768*e)),s}la(t,e);var r=ma(t);return Ha(t,[{key:"setInfoByResponse",value:function(e){var t=this,n=e.serverList,r=e.backupList;if(e=e.unit,n.length<this.chunkCount&&r.length<this.chunkCount)throw new Ia("servers is not enough");this.updateProgress(0),this.initialized=!0;var i=Array(this.chunkCount).fill(!1);if(n.forEach((function(e,n){return e.forEach((function(e){return cs(e,n,t.serverToIndices,i)}))})),r.forEach((function(e,n){return e.forEach((function(e){return cs(e,n,t.backupToIndices,i)}))})),i.some((function(){return!1})))throw new da("Not enough servers to download",mg);this.indexToBackupServers=r.map((function(e){return new Set(e)})),this.retUnit=e}},{key:"downloadChunks",value:function(){this.aborted?this.warn("downloadChunks after abort, ignored"):1===this.serverToIndices.size&&0===Array.from(this.serverToIndices.keys())[0]?this.serversDownload(this.backupToIndices):1<=this.serverToIndices.size?this.serversDownload(this.serverToIndices,!0):this.ee.emit("error",new da("not enough servers to download",mg))}},{key:"updateProgress",value:function(e){var t=this,n=this.downloadedSize+e;this.downloadedSize>this.metaInfo.size?(this.warn("Invalid download size, overflowed"),this.ee.emit("error",new Wc("Invalid download size",mg))):(this.downloadedSize=n,void 0!==this.timer&&0!==e&&(clearTimeout(this.timer),this.timer=void 0),void 0===this.timer&&this.successCount!==this.chunkCount&&(this.timer=setTimeout((function(){t.ee.emit("timedOut"),t.abortController.abort()}),12e4)),this.initialized&&0===e||void 0===this.transHandler.onOperationProgress||this.transHandler.onOperationProgress({totalSize:this.metaInfo.size,currentSize:this.downloadedSize}))}},{key:"getPayload",value:function(){for(var e=0,t=0,n=this.chunks;t<n.length;t++)e+=n[t].byteLength;if(e!==this.metaInfo.size)throw new Ia("invalid chunks total size");e=new Uint8Array(e),n=t=0;for(var r=this.chunks;n<r.length;n++){var i=r[n];e.set(new Uint8Array(i),t),t+=i.byteLength}return t=Array.from(e.subarray(0,4)).map((function(e){return e.toString(16)})).join("").toUpperCase(),Zt(e.buffer,cD(t))}},{key:"getDownloadUrl",value:function(e){var t=this.metaInfo.useNewDomain?"sd-rtn.com":"agora.io";return"https://".concat(Dg(e).split(".").join("-"),".edge.").concat(t,":9601/api/v1/chuck/download")}},{key:"serversDownload",value:function(){var e=J(w.mark((function e(t){var n,r=this,i=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=1<i.length&&void 0!==i[1]&&i[1],e.next=3,Promise.all(Array.from(t.entries()).map((function(e){return e=ra(e,2),r.postDownloadRequest(e[0],Array.from(e[1]),n).catch((function(e){404===e.statusCode?(r.ee.emit("notExist"),r.abortController.abort()):"AbortError"!==e.name&&(Sa(e)?r.singleThread?(r.abortController.abort(),r.ee.emit("timedOut")):(r.warn("%d download timed out after %d, retrying use single thread",e.index,r.singleThread?6e4:3e4),r.abortController.abort(),r.singleThread=!0,r.ee.emit("multiTimeOut")):(r.ee.emit("error",e),r.abortController.abort()))}))})));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"postDownloadRequest",value:function(){var e=J(w.mark((function e(t,n,r){var i,o,a,s,u,c,l,f,h,p=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(h=function(){return(h=J(w.mark((function e(o){var a,h,p,d,v,b,g,y,m;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,void 0!==o||0!==t){e.next=5;break}throw new Ia("Invalid serverIp");case 5:a=void 0===o?l.getDownloadUrl(t):o;case 6:return l.downloadingChunks.add(i),e.next=9,c(a);case 9:return h=e.sent,p=h.responseData,l.downloadingChunks.delete(i),e.abrupt("return",p);case 15:if(e.prev=15,e.t0=e.catch(0),l.downloadingChunks.delete(i),n.unshift(i),l.metaInfo.useNewDomain=!1,"AbortError"!==e.t0.name){e.next=22;break}throw e.t0;case 22:if(!Sa(e.t0)){e.next=25;break}throw e.t0.index=i,e.t0;case 25:if(d=s,s+=1,!(2>d)){e.next=30;break}return e.t0 instanceof Ia||l.warn("%o, %d download failed, retrying",e.t0,i),e.abrupt("return",f());case 30:if(504!==e.t0.statusCode){e.next=34;break}throw(v=new db("download server timed out",{originalError:e.t0,serverCode:504})).index=i,v;case 34:if(!r||2!==d||0===u[0]){e.next=45;break}return e.t0 instanceof Ia||l.warn("%d download failed, using backup: %d, %o",i,u[0],e.t0),e.next=38,l.busyBackupServers.get(u[0]);case 38:return b=f(l.getDownloadUrl(u[0])),l.busyBackupServers.set(u[0],b),e.next=42,b;case 42:return g=e.sent,l.busyBackupServers.delete(u[0]),e.abrupt("return",g);case 45:if(!(r&&2<d&&void 0!==u[1]&&0!==u[1])){e.next=56;break}return l.warn("%d download failed, using backup 1: %d",i,u[1]),e.next=49,l.busyBackupServers.get(u[1]);case 49:return y=f(l.getDownloadUrl(u[1])),l.busyBackupServers.set(u[1],y),e.next=53,y;case 53:return m=e.sent,l.busyBackupServers.delete(u[1]),e.abrupt("return",m);case 56:throw e.t0.index=i,e.t0;case 58:case"end":return e.stop()}}),e,null,[[0,15]])})))).apply(this,arguments)},f=function(e){return h.apply(this,arguments)},!this.aborted){e.next=4;break}throw new Ia("download already aborted");case 4:if(void 0!==(i=n.shift())){e.next=8;break}return this.log("%s download finished",t),e.abrupt("return");case 8:if(!(this.singleThread&&0<this.downloadingChunks.size)){e.next=10;break}return e.abrupt("return");case 10:if(!this.downloadingChunks.has(i)){e.next=13;break}return this.log("%s already downloading, return",i),e.abrupt("return");case 13:if(void 0===this.chunks[i]){e.next=19;break}return this.successCount===this.chunkCount&&(this.log("chunks all download"),this.ee.emit("finished")),this.log("%s already downloaded, do next",i),e.next=18,this.postDownloadRequest(t,n,r);case 18:return e.abrupt("return");case 19:return o=new FormData,a={hash:hu(this.metaInfo.hashHexStr),unit:void 0===this.retUnit?this.metaInfo.unit:this.retUnit,instance:this.metaInfo.instance,loginOpt:this.metaInfo.loginOpt,ticket:this.metaInfo.ticket,index:i},o.append("parameter",JSON.stringify(a)),s=0,u=Array.from(this.indexToBackupServers[i]),c=function(e){return te(e,{body:o,signal:p.abortController.signal,timeout:p.singleThread?12e4:3e4},{useBinaryResponse:!0})},l=this,e.next=28,f().then((function(e){return void 0!==p.chunks[i]?p.log("chunk %d download duplicated",i):(p.chunks[i]=e,p.log("chunk %d downloaded",i),p.successCount+=1,p.updateProgress(p.chunks[i].byteLength)),p.successCount===p.chunkCount&&(p.log("chunks all download"),p.ee.emit("finished")),p.singleThread?(p.downloadChunks(),Promise.resolve()):p.postDownloadRequest(t,n,r)}));case 28:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()}]),t}(tb()),es=function(e){function t(e,i,o,a){W(this,t);var s=r.call(this,o,"ChunkUploadManager");if(m(n(s),"chunkCount",0),m(n(s),"chunks",[]),m(n(s),"uploadedChunks",[]),m(n(s),"totalFailures",0),m(n(s),"timer",void 0),m(n(s),"initState","uninitialized"),m(n(s),"ee",void 0),m(n(s),"unit",0),m(n(s),"uploadedSize",0),m(n(s),"singleThread",!1),m(n(s),"abortController",new AbortController),m(n(s),"servers",[]),m(n(s),"aborted",!1),m(n(s),"metaInfo",void 0),m(n(s),"transHandler",void 0),s.metaInfo=e,s.transHandler=i,s.ee=void 0===a?new ea:a,0===e.file.length)throw new I("file not found or is empty",wf);return void 0!==i.cancelSignal&&i.cancelSignal.addEventListener("abort",(function(){s.abortController.abort()}),{once:!0}),s.abortController.signal.addEventListener("abort",(function(){s.aborted=!0}),{once:!0}),s}la(t,e);var r=ma(t);return Ha(t,[{key:"initChunks",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a,s=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("initialized"!==this.initState&&"initializing"!==this.initState){e.next=2;break}throw new Ia("cannot re-initialize");case 2:for(this.initState="initializing",this.unit=t,n=this.sliceFile(t,this.metaInfo.file),this.chunkCount=n.length,r=[],i=function(e,t){var n=(e=ra(t[e],2))[0],i=e[1];e=bs(i).then((function(e){s.chunks[n]={payload:i,sha1:e,uploadedTo:void 0,index:n,processed:!1}})),r.push(e)},o=0,a=Array.from(n.entries());o<a.length;o++)i(o,a);return e.next=11,Promise.all(r);case 11:this.updateProgress(0),this.initState="initialized",this.log("upload chunks initialized");case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"uploadToServers",value:function(){var e=this;if(!this.aborted){for(var t=this.chunks.filter((function(e){return!e.processed})),n=function(n){var r=t[n],i=e.servers.filter((function(e){return!e.isUploading})).sort((function(e,t){return e.successCount-t.successCount})).sort((function(e,t){return e.failureCount-t.failureCount}))[0];if(void 0===i||1<i.failureCount)return e.log("Upload server not available, waiting"),e.ee.emit("serverUsedUp"),Om(1e3).then((function(){e.totalFailures>2*e.chunkCount&&e.ee.emit("error"),e.totalFailures+=1,void 0!==i&&(i.failureCount=0),e.uploadToServers()})).catch((function(){})),"break";r.processed=!0,i.isUploading=!0,e.log("uploading chunk %d to server %s",r.index,Dg(i.ip));var o=e.getUploadUrl(i.ip);return J(w.mark((function t(){var n;return w.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.postChunk(r.payload,o,r.index);case 3:n=e.chunks.findIndex((function(e){return e===r})),r.uploadedTo=i.ip,e.chunks.splice(n,1),e.uploadedChunks.push(r),i.successCount+=1,i.isUploading=!1,e.updateProgress(r.payload.byteLength),e.log("upload chunk %d successfully",r.index),t.next=31;break;case 13:if(t.prev=13,t.t0=t.catch(0),i.isUploading=!1,r.processed=!1,504!==t.t0.statusCode&&!Sa(t.t0)){t.next=27;break}if(e.singleThread){t.next=24;break}return e.warn("%d upload timed out after %d, retrying use single thread",r.index,e.singleThread?12e4:3e4),e.abortController.abort(),e.singleThread=!0,e.ee.emit("multiTimeOut"),t.abrupt("return");case 24:return e.ee.emit("timedOut"),e.abortController.abort(),t.abrupt("return");case 27:return e.metaInfo.useNewDomain=!1,i.failureCount+=1,t.next=31,Om(1e3);case 31:e.uploadedChunks.length===e.chunkCount?(e.log("chunks uploaded"),e.ee.emit("finished")):(e.singleThread||1===e.chunks.filter((function(e){return!e.processed})).length)&&e.uploadToServers();case 32:case"end":return t.stop()}}),t,null,[[0,13]])})))(),e.singleThread?"break":void 0},r=0;r<t.length&&"break"!==n(r);r++);0===t.length&&this.uploadedChunks.length!==this.chunkCount&&this.log("%d chunks left uploading",this.chunkCount-this.uploadedChunks.length)}}},{key:"getUploadServerIPs",value:function(){var e=!0,t=[],n=G(this.uploadedChunks).sort((function(e,t){return e.index-t.index})),r=0;for(n=Array.from(n.values());r<n.length;r++){var i=n[r].uploadedTo;if(void 0===i){e=!1;break}t.push(i)}if(!e)throw new Ia("some chunks not uploaded, cannot get upload server ips");return t}},{key:"addServers",value:function(e){var t=this;e.forEach((function(e){var n=t.servers.findIndex((function(t){return t.ip===e}));-1!==n?t.servers[n].failureCount=0:(t.log("server %s added",Dg(e)),t.servers.push({successCount:0,isUploading:!1,ip:e,failureCount:0}))}))}},{key:"updateProgress",value:function(e){var t=this,n=void 0!==e?this.uploadedSize+e:this.metaInfo.file.length;n>this.metaInfo.file.length?(this.warn("Invalid upload size, overflowed"),this.ee.emit("error",new Wc("Invalid upload size",lg))):(this.uploadedSize=n,void 0!==this.timer&&0!==e&&(clearTimeout(this.timer),this.timer=void 0),void 0===this.timer&&void 0!==e&&this.uploadedChunks.length!==this.chunkCount&&(this.timer=setTimeout((function(){t.ee.emit("timedOut"),t.abortController.abort()}),12e4)),"initialized"===this.initState&&0===e||void 0===this.transHandler.onOperationProgress||this.transHandler.onOperationProgress({totalSize:this.metaInfo.file.length,currentSize:this.uploadedSize}))}},{key:"sliceFile",value:function(e,t){var n=0,r=[],i=t.length;for(e*=32768;n<i;)r.push(t.slice(n,n+e)),n+=e;return this.log("chunks split into %d",r.length),r}},{key:"postChunk",value:function(){var e=J(w.mark((function e(t,n,r){var i,o,a,s,u,c,l,f;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.aborted){e.next=2;break}throw new Ia("upload already aborted");case 2:if(void 0!==this.unit){e.next=4;break}throw new Ia("unit is undefined");case 4:return i=this.metaInfo,o=i.ticket,a=i.instance,s=i.loginOpt,u=i.hashStr,e.t0=r,e.t1=u,e.next=9,bs(t);case 9:return e.t2=e.sent,e.t3=this.unit,e.t4=o,e.t5=a,e.t6=s,c={index:e.t0,hash:e.t1,sha1:e.t2,unit:e.t3,ticket:e.t4,instance:e.t5,loginOpt:e.t6},(l=new FormData).append("parameter",JSON.stringify(c)),l.append("payload",new Blob([t])),e.next=20,te(n,{headers:{Accept:"application/json"},body:l,timeout:this.singleThread?12e4:3e4,signal:this.abortController.signal});case 20:if(f=e.sent,201===f.status){e.next=24;break}throw new da("uploading chunk ".concat(r," failed"));case 24:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"getUploadUrl",value:function(e){var t=this.metaInfo.useNewDomain?"sd-rtn.com":"agora.io";return"https://".concat(Dg(e).split(".").join("-"),".edge.").concat(t,":9601/api/v1/chuck/upload")}}]),t}(tb()),fs=function(e){function t(e){W(this,t);var i=r.call(this,e,"MediaTaskManager");return m(n(i),"isProcessing",!1),m(n(i),"authInfo",void 0),m(n(i),"taskFinishers",{}),m(n(i),"mediaTasks",new Map),m(n(i),"ongoingTask",void 0),i.on("connectionStateChanged",(function(e){if(e===S.ConnectionState.ABORTED||e===S.ConnectionState.DISCONNECTED){void 0!==i.ongoingTask&&i.cancelTask(i.ongoingTask),e=0;for(var t=Array.from(i.mediaTasks.entries());e<t.length;e++){var n=ra(t[e],2)[1];i.cancelTask(n)}i.mediaTasks.clear(),i.taskFinishers={}}else e===S.ConnectionState.RECONNECTING?void 0!==i.ongoingTask&&i.ongoingTask.manager.abortController.abort():e===S.ConnectionState.CONNECTED&&void 0!==i.ongoingTask&&i.ongoingTask.manager.ee.emit("reconnected")})),i}la(t,e);var r=ma(t);return Ha(t,[{key:"setAuthInfo",value:function(e){this.authInfo=e}},{key:"waitMediaTask",value:function(e){var t=this;return new Promise((function(n,r){t.taskFinishers[e]={resolve:n,reject:r},t.isProcessing||t.processMediaTask()})).finally((function(){void 0!==t.ongoingTask&&void 0!==t.ongoingTask.manager.timer&&clearTimeout(t.ongoingTask.manager.timer),delete t.taskFinishers[e],0!==t.mediaTasks.size?t.processMediaTask():t.isProcessing=!1}))}},{key:"addUploadTask",value:function(e,n,r,i){var o=e.file;if(e=e.hash,void 0===this.authInfo)throw new Ia("session not found");if(this.mediaTasks.size>=t.MAX_PENDING_TASK_COUNT-1)throw new ib("Upload media failed, exceed max pending jobs",xA);return i=new es({hashStr:as(e),file:o,ticket:this.authInfo.ticket,instance:this.authInfo.instance.toString(),loginOpt:this.authInfo.loginOpt.toString(),useNewDomain:this.authInfo.useNewDomain},i,this.logger),o=Ud(),this.mediaTasks.set(o,{type:"UPLOAD",manager:i,hash:e,setter:r,fetcher:n,taskId:o}),o}},{key:"addDownloadTask",value:function(e,n,r){var i=e.hashHexStr,o=e.size,a=e.unit;if(e=e.zone,void 0===this.authInfo)throw new Ia("session not found");if(this.mediaTasks.size>=t.MAX_PENDING_TASK_COUNT-1)throw new ib("Download media failed, exceed max pending jobs",BA);return r=new ds({hashHexStr:i,ticket:this.authInfo.ticket,useNewDomain:this.authInfo.useNewDomain,instance:this.authInfo.instance.toString(),loginOpt:this.authInfo.loginOpt.toString(),size:o,zone:e,unit:a},r,this.logger),i=Ud(),this.mediaTasks.set(i,{type:"DOWNLOAD",manager:r,fetcher:n,taskId:i}),i}},{key:"doDownloadTaskImpl",value:function(){var e=J(w.mark((function e(t,n){var r,i,o,a,s,u,c,l,f=this,h=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=2<h.length&&void 0!==h[2]&&h[2],o=i=t.manager,r&&(i=new ds(o.metaInfo,o.transHandler,this.logger,o.ee)),a=t.fetcher,e.next=7,a();case 7:if(s=e.sent,u=s.serverList,c=s.backupList,l=s.unit,!r||l===o.retUnit){e.next=13;break}throw new da("download unit is different, reject to continue",mg);case 13:r&&(t.manager=i,i.downloadedSize=o.downloadedSize,i.successCount=o.successCount,i.timer=o.timer,i.chunks=o.chunks,i.initialized=o.initialized,i.singleThread=o.singleThread,i.updateProgress(0)),i.ee.once("reconnected",(function(){i.ee.removeAllListeners(),f.doDownloadTaskImpl(t,n,!0).catch((function(e){n.reject(e)}))})),i.ee.once("multiTimeOut",(function(){i.ee.removeAllListeners(),f.doDownloadTaskImpl(t,n,!0).catch((function(e){n.reject(e)}))})),i.ee.once("error",(function(e){i.ee.removeAllListeners(),n.reject(new da(["download file file, index %d",e.index],{code:mg,originalError:e}))})),i.ee.once("notExist",(function(){i.abortController.abort(),i.ee.removeAllListeners(),n.reject(new da("download file not found",AA))})),i.ee.once("timedOut",(function(){i.ee.removeAllListeners(),i.abortController.abort(),n.reject(new db("download timed out",zA))})),void 0!==i.transHandler.cancelSignal&&i.transHandler.cancelSignal.addEventListener("abort",(function(){n.reject(new hl("Downloading canceled",ir))}),{once:!0}),i.ee.once("finished",(function(){n.resolve({type:"DOWNLOAD",payload:i.getPayload()})})),i.setInfoByResponse({serverList:u,backupList:c,unit:l}),i.downloadChunks();case 23:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"doDownloadTask",value:function(e,t){var n=this,r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=e.taskId;return r||(this.mediaTasks.delete(i),this.ongoingTask=e),new Promise((function(i,o){n.doDownloadTaskImpl(e,t,r).then(i).catch(o)}))}},{key:"doUploadTaskImpl",value:function(){var e=J(w.mark((function e(t,n){var r,i,o,a,s,u,c,l,f,h=this,p=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=2<p.length&&void 0!==p[2]&&p[2],o=i=t.manager,r&&(i=new es(o.metaInfo,o.transHandler,this.logger,o.ee)),a=t.fetcher,s=new Pa,c=new Promise((function(e,c){var l=a(),f=l.ret,h=l.err,p=l.timeout;l.fin.pipe(ob(s)).subscribe({next:function(e){n.resolve({type:"UPLOAD",retUnit:e.unit,zone:e.zone})},complete:function(){e({hasExist:!0}),s.next(),s.complete()}}),f.pipe(ob(s),cb(function(){var e=J(w.mark((function e(a){var s,c;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=a.servers,c=a.unit,r&&o.unit!==c?n.reject(new da("upload unit is different, reject to continue",lg)):r&&(t.manager=i,i.chunkCount=o.chunkCount,i.chunks=o.chunks,i.totalFailures=o.totalFailures,i.uploadedChunks=o.uploadedChunks,i.timer=o.timer,i.initState=o.initState,i.unit=o.unit,i.uploadedSize=o.uploadedSize,i.singleThread=o.singleThread,i.updateProgress(0)),i.addServers(s),"uninitialized"!==i.initState){e.next=7;break}return u=i.initChunks(c),e.next=7,u;case 7:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())).subscribe({complete:function(){return e({hasExist:!1})},error:c}),l=function(t){"uninitialized"!==i.initState&&u?e(u.then((function(){return{hasExist:!1}}))):c(t)},h.pipe(ob(s)).subscribe({error:l}),p.pipe(ob(s)).subscribe({error:l})})),e.next=9,c;case 9:if(l=e.sent,!l.hasExist){e.next=15;break}return i.updateProgress(),this.log("file already exists, skipping upload"),e.abrupt("return");case 15:s.next(),s.complete(),this.log("chunks initialization promise resolved"),f=gb(i.ee,"serverUsedUp").pipe(Gt((function(){return i.chunkCount!==i.uploadedChunks.length})),Jt(5e3,void 0,{leading:!1}),pm((function(){return a().ret}))).subscribe((function(e){i.addServers(e.servers)})),i.ee.once("reconnected",(function(){i.ee.removeAllListeners(),h.doUploadTask(t,n,!0).catch((function(e){n.reject(e)}))})),i.ee.once("multiTimeOut",(function(){i.ee.removeAllListeners(),h.doUploadTask(t,n,!0).catch((function(e){n.reject(e)}))})),i.ee.once("timedOut",(function(){f.unsubscribe(),i.ee.removeAllListeners(),i.abortController.abort(),n.reject(new db("upload timed out",Lh))})),i.ee.once("error",(function(e){f.unsubscribe(),i.ee.removeAllListeners(),i.abortController.abort(),n.reject(e||new da("upload error",lg))})),void 0!==i.transHandler.cancelSignal&&i.transHandler.cancelSignal.addEventListener("abort",(function(){n.reject(new hl("Uploading canceled",hr))}),{once:!0}),i.ee.once("finished",J(w.mark((function e(){var r,o,a;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return f.unsubscribe(),e.next=3,t.setter(i.unit,i.getUploadServerIPs());case 3:r=e.sent,o=r.zone,a=r.unit,i.ee.removeAllListeners(),n.resolve({type:"UPLOAD",retUnit:a,zone:o});case 8:case"end":return e.stop()}}),e)})))),i.uploadToServers();case 26:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"doUploadTask",value:function(e,t){var n=this,r=2<arguments.length&&void 0!==arguments[2]&&arguments[2],i=e.taskId;return r||(this.mediaTasks.delete(i),this.ongoingTask=e),new Promise((function(i,o){n.doUploadTaskImpl(e,t,r).then(i).catch(o)}))}},{key:"processMediaTask",value:function(){var e=J(w.mark((function e(){var t,n,r;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.mediaTasks.size){e.next=2;break}throw Error("no upload tasks");case 2:if(this.isProcessing=!0,t=this.mediaTasks.keys().next().value,void 0!==(n=this.taskFinishers[t])){e.next=7;break}throw Error("top task not found");case 7:if(void 0!==(r=this.mediaTasks.get(t))){e.next=10;break}throw new Ia("task invalid");case 10:if("UPLOAD"!==r.type){e.next=15;break}return e.next=13,this.doUploadTask(r,n).catch((function(e){r.manager.ee.removeAllListeners(),n.reject(e)}));case 13:e.next=18;break;case 15:if("DOWNLOAD"!==r.type){e.next=18;break}return e.next=18,this.doDownloadTask(r,n).catch((function(e){r.manager.ee.removeAllListeners(),n.reject(e)}));case 18:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"cancelTask",value:function(e){var t="DOWNLOAD"===e.type?ir:hr;e.manager.ee.removeAllListeners(),e.manager.abortController.abort(),void 0!==this.taskFinishers[e.taskId]&&this.taskFinishers[e.taskId].reject(new hl("User logged out or kicked off, media task canceled",t))}}]),t}(tb());m(fs,"MAX_PENDING_TASK_COUNT",9),Oo("of",(function(){for(var e=0,t=arguments.length,n=new(Ne(this))(t);t>e;)n[e]=arguments[e++];return n}),Dj);var gs=1/0,dD=Math.max,ju=function(e,t,n){var r=Object(e);if(!Ed(e)){var i=Te(t);e=Ad(e),t=function(e){return i(r[e],e,r)}}return-1<(t=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;if(null==n)n=0;else{var i=(n=n?(n=gl(n))===gs||n===-gs?17976931348623157e292*(0>n?-1:1):n==n?n:0:0===n?n:0)%1;n=n==n?i?n-i:n:0}return 0>n&&(n=dD(r+n,0)),Xp(e,Te(t),n)}(e,t,n))?r[i?e[t]:t]:void 0},iu=function(e,t){return e&&e.length?vk(e,void 0,"function"==typeof t?t:void 0):[]},hs=function(){function e(){W(this,e),m(this,"size",0),m(this,"fields",new Map)}return Ha(e,[{key:"define",value:function(e,t,n){if(this.size+=n,64<this.size)throw new RangeError("the struct over 64 bits is not supported");Mg(t={val:0,isNumber:"number"===t,isBoolean:"boolean"===t,oneof:"number"===t||"boolean"===t?void 0:t,len:n}),this.fields.set(e,t)}},{key:"set",value:function(e,t){if(!(e=this.fields.get(e)))throw Error("field not found");var n=e.oneof;if(!U.isLong(t)&&"number"!=typeof t)if("boolean"==typeof t)t=t?1:0;else{if(void 0===n)throw Error("invalid field type");if(void 0===(t=n[t]))throw Error("field type not found")}Mg(e,t),e.val=t}},{key:"toNumber",value:function(){for(var e=0,t=0,n=0,r=Array.from(this.fields);n<r.length;n++){var i=ra(r[n],2)[1],o=i.len;void 0!==(i=i.val)&&(e+=U.fromValue(i).shiftLeft(t).toNumber(),t+=o)}return e}},{key:"toLong",value:function(){for(var e=U.fromNumber(0,!0),t=0,n=0,r=Array.from(this.fields);n<r.length;n++){var i=ra(r[n],2)[1],o=i.len;void 0!==(i=i.val)&&(e=U.fromValue(i).shiftLeft(t).add(e),t+=o)}return e}},{key:"assert",value:function(e,t){function n(e){if(!U.isLong(e)&&"number"!=typeof e)if("boolean"==typeof e)e=e?1:0;else{if(void 0===i)throw Error("invalid field type");if(void 0===(e=i[e]))throw Error("field type not found")}return Mg(r,e),Lg(e,r.val)}var r=this.fields.get(e);if(!r)throw Error("field not found");var i=r.oneof;if(!Array.isArray(t))return n(t);if(1===t.length)return n(t[0]);if(t.every((function(e){return"string"==typeof e}))&&void 0!==i)return t.some((function(e){return n(e)}));throw Error("invalid valueTypes")}},{key:"from",value:function(e){e=U.fromValue(e);for(var t=0,n=0,r=Array.from(this.fields);n<r.length;n++){var i=ra(r[n],2)[1],o=i.len,a=U.fromNumber(Math.pow(2,o)-1,!0).shiftLeft(t);Mg(i,a=e.and(a).shiftRightUnsigned(t)),i.val=a,t+=o}}},{key:"typeOf",value:function(e){if(void 0!==(e=this.fields.get(e))){var t=e.oneof;if(e=e.val,void 0!==t){var n=0;for(t=Object.entries(t);n<t.length;n++){var r=ra(t[n],2),i=r[0];if(Lg(e,r[1]))return i}}}throw new TypeError("can only get type of oneof type")}}]),e}(),is=function(e){function t(e){W(this,t);var r=n.call(this);return r.define("Rejoin","boolean",1),r.define("Unused","number",31),r.define("Platform","number",8),r.define("Version","number",12),r.define("Subversion","number",12),r.set("Platform",7),r.set("Version",4),r.set("Subversion",203),r.set("Rejoin",e),r}la(t,e);var n=ma(t);return t}(hs),eD=ua(ua(ua(ua({},{PeerTextMessage:0,ChannelTextMessage:1,VendorTextMessage:2}),{PeerRawMessage:3,ChannelRawMessage:4,VendorRawMessage:5}),{PeerImageMessage:6,ChannelImageMessage:7,VendorImageMessage:8}),{PeerFileMessage:15,ChannelFileMessage:16,VendorFileMessage:17}),js={CallInvite:101,CallAccept:102,CallReject:103,CallCancel:104},fD=ua(ua({},eD),js),gD={Uncompressed:0,Zlib:1},ae=function(e){function t(e){W(this,t);var r=n.call(this);if(r.define("MessageType",fD,8),r.define("BroadcastJumps","number",2),r.define("ToCache","boolean",1),r.define("FromCache","boolean",1),r.define("CompressionMethod",gD,2),r.define("IterationNumber","number",4),r.define("BufferedMessage","boolean",1),r.define("ToArchive","boolean",1),r.define("FromArchive","boolean",1),"number"==typeof e||U.isLong(e))r.from(e);else if(void 0!==e){var i=0;for(e=Hg(e);i<e.length;i++){var o=ra(e[i],2);r.set(o[0],o[1])}}return r}la(t,e);var n=ma(t);return Ha(t,[{key:"isTextMessage",value:function(){return this.assert("MessageType",["PeerTextMessage","ChannelTextMessage","VendorTextMessage"])}},{key:"isRawMessage",value:function(){return this.assert("MessageType",["ChannelRawMessage","PeerRawMessage","VendorRawMessage"])}},{key:"isRawPeerMessage",value:function(){return this.assert("MessageType","PeerRawMessage")}},{key:"isRawChannelMessage",value:function(){return this.assert("MessageType","ChannelRawMessage")}},{key:"isPeerTextMessage",value:function(){return this.assert("MessageType","PeerTextMessage")}},{key:"isChannelTextMessage",value:function(){return this.assert("MessageType","ChannelTextMessage")}},{key:"isInvitation",value:function(e){var t=this;return void 0!==e?this.assert("MessageType",e):xf(js).some((function(e){return t.assert("MessageType",e)}))}},{key:"isFileMessage",value:function(){return this.assert("MessageType",["PeerFileMessage","ChannelFileMessage","VendorFileMessage"])}},{key:"isImageMessage",value:function(){return this.assert("MessageType",["PeerImageMessage","ChannelImageMessage","VendorImageMessage"])}},{key:"isPeerMessage",value:function(){return this.assert("MessageType",["PeerFileMessage","PeerTextMessage","PeerImageMessage","PeerRawMessage"])}},{key:"isZlibCompressed",value:function(){return this.assert("CompressionMethod","Zlib")}},{key:"isFromCache",value:function(){return this.assert("FromCache",!0)}},{key:"isBufferedMessage",value:function(){return this.assert("BufferedMessage",!0)}},{key:"getInvitationType",value:function(){if(!this.isInvitation())throw new TypeError("cannot get InvitationType of a normal message type");return this.typeOf("MessageType")}}]),t}(hs),hD=function(e){function t(e){return W(this,t),m(n(e=r.call(this,e,"ChatManager")),"dialogueLru",new Sx(void 0,{maxlen:1e4,ttl:1e4})),e}la(t,e);var r=ma(t);return Ha(t,[{key:"getChatInfo",value:function(e){var t=this.dialogueLru.get(e);if(this.dialogueLru.prune(),t){var n=t.dialogue,r={dialogue:n,sequence:t=t.sequence.add(1)};return this.dialogueLru.set(e,{dialogue:n,sequence:t}),r}return n={dialogue:Bg(),sequence:U.fromNumber(1,!0)},this.dialogueLru.set(e,n),n}}]),t}(tb()),v={};"object"==( false?undefined:X(module))&&(module.exports=v),v.parse=function(e,t){var n,r=v.bin.readUshort,i=v.bin.readUint,o={};for(n=(e=new Uint8Array(e)).length-4;101010256!=i(e,n);)n--;var a=r(e,n=n+4+4);r(e,n+=2),i(e,n+=2),n=i(e,n+=4);for(var s=0;s<a;s++){i(e,n),n+=4,n+=4,n+=4,i(e,n+=4);var u=i(e,n+=4),c=i(e,n+=4),l=r(e,n+=4),f=r(e,n+2),h=r(e,n+4);n+=6;var p=i(e,n+=8);n+=4,n+=l+f+h,v._readLocal(e,p,o,u,c,t)}return o},v._readLocal=function(e,t,n,r,i,o){var a=v.bin.readUshort,s=v.bin.readUint;s(e,t),a(e,t+=4),a(e,t+=2);var u=a(e,t+=2);s(e,t+=2),s(e,t+=4),s=a(e,t=t+4+8);var c=a(e,t+=2);if(t+=2,a=v.bin.readUTF8(e,t,s),t=t+s+c,o)n[a]={size:i,csize:r};else if(e=new Uint8Array(e.buffer,t),0==u)n[a]=new Uint8Array(e.buffer.slice(t,t+r));else{if(8!=u)throw"unknown compression method: "+u;t=new Uint8Array(i),v.inflateRaw(e,t),n[a]=t}},v.inflateRaw=function(e,t){return v.F.inflate(e,t)},v.inflate=function(e,t){return e[0],e[1],v.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-2),t)},v.deflate=function(e,t){null==t&&(t={level:6});var n=0,r=new Uint8Array(50+Math.floor(1.1*e.length));return r[n]=120,r[n+1]=156,n=v.F.deflateRaw(e,r,n+2,t.level),e=v.adler(e,0,e.length),r[n+0]=e>>>24&255,r[n+1]=e>>>16&255,r[n+2]=e>>>8&255,r[n+3]=e>>>0&255,new Uint8Array(r.buffer,0,n+4)},v.deflateRaw=function(e,t){null==t&&(t={level:6});var n=new Uint8Array(50+Math.floor(1.1*e.length)),r=v.F.deflateRaw(e,n,r,t.level);return new Uint8Array(n.buffer,0,r)},v.encode=function(e,t){null==t&&(t=!1);var n,r=0,i=v.bin.writeUint,o=v.bin.writeUshort,a={};for(n in e){var s=!v._noNeed(n)&&!t,u=e[n],c=v.crc.crc(u,0,u.length);a[n]={cpr:s,usize:u.length,crc:c,file:s?v.deflateRaw(u):u}}for(n in a)r+=a[n].file.length+30+46+2*v.bin.sizeUTF8(n);for(n in e=new Uint8Array(r+22),t=0,u=[],a)c=a[n],u.push(t),t=v._writeHeader(e,t,n,c,0);for(n in r=0,s=t,a)c=a[n],u.push(t),t=v._writeHeader(e,t,n,c,1,u[r++]);return a=t-s,i(e,t,101010256),o(e,t=t+4+4,r),o(e,t+=2,r),i(e,t+=2,a),i(e,t+4,s),e.buffer},v._noNeed=function(e){return e=e.split(".").pop().toLowerCase(),-1!="png,jpg,jpeg,zip".indexOf(e)},v._writeHeader=function(e,t,n,r,i,o){var a=v.bin.writeUint,s=v.bin.writeUshort,u=r.file;return a(e,t,0==i?67324752:33639248),t+=4,1==i&&(t+=2),s(e,t,20),s(e,t+=2,0),s(e,t+=2,r.cpr?8:0),a(e,t+=2,0),a(e,t+=4,r.crc),a(e,t+=4,u.length),a(e,t+=4,r.usize),s(e,t+=4,v.bin.sizeUTF8(n)),s(e,t+=2,0),t+=2,1==i&&(a(e,t=t+2+2+6,o),t+=4),t+=n=v.bin.writeUTF8(e,t,n),0==i&&(e.set(u,t),t+=u.length),t},v.crc={table:function(){for(var e=new Uint32Array(256),t=0;256>t;t++){for(var n=t,r=0;8>r;r++)n=1&n?3988292384^n>>>1:n>>>1;e[t]=n}return e}(),update:function(e,t,n,r){for(var i=0;i<r;i++)e=v.crc.table[255&(e^t[n+i])]^e>>>8;return e},crc:function(e,t,n){return 4294967295^v.crc.update(4294967295,e,t,n)}},v.adler=function(e,t,n){var r=1,i=0,o=t;for(t+=n;o<t;){for(n=Math.min(o+5552,t);o<n;)i+=r+=e[o++];r%=65521,i%=65521}return i<<16|r},v.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,n){e[t]=255&n,e[t+1]=n>>8&255,e[t+2]=n>>16&255,e[t+3]=n>>24&255},readASCII:function(e,t,n){for(var r="",i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},writeASCII:function(e,t,n){for(var r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},pad:function(e){return 2>e.length?"0"+e:e},readUTF8:function(e,t,n){for(var r,i="",o=0;o<n;o++)i+="%"+v.bin.pad(e[t+o].toString(16));try{r=decodeURIComponent(i)}catch(r){return v.bin.readASCII(e,t,n)}return r},writeUTF8:function(e,t,n){for(var r=n.length,i=0,o=0;o<r;o++){var a=n.charCodeAt(o);if(0==(4294967168&a))e[t+i]=a,i++;else if(0==(4294965248&a))e[t+i]=192|a>>6,e[t+i+1]=128|a>>0&63,i+=2;else if(0==(4294901760&a))e[t+i]=224|a>>12,e[t+i+1]=128|a>>6&63,e[t+i+2]=128|a>>0&63,i+=3;else{if(0!=(4292870144&a))throw"e";e[t+i]=240|a>>18,e[t+i+1]=128|a>>12&63,e[t+i+2]=128|a>>6&63,e[t+i+3]=128|a>>0&63,i+=4}}return i},sizeUTF8:function(e){for(var t=e.length,n=0,r=0;r<t;r++){var i=e.charCodeAt(r);if(0==(4294967168&i))n++;else if(0==(4294965248&i))n+=2;else if(0==(4294901760&i))n+=3;else{if(0!=(4292870144&i))throw"e";n+=4}}return n}},v.F={},v.F.deflateRaw=function(e,t,n,r){var i=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][r],o=v.F.U,a=v.F._goodIndex;v.F._hash;var s=v.F._putsE,u=0;n<<=3;var c=0,l=e.length;if(0==r){for(;u<l;){var f=Math.min(65535,l-u);s(t,n,u+f==l?1:0),n=v.F._copyExact(e,u,f,t,n+8),u+=f}return n>>>3}s=o.lits,r=o.strt;var h=o.prev,p=0,d=0,b=0,g=0,y=0;for(2<l&&(r[y=v.F._hash(e,0)]=0),u=0;u<l;u++){if(f=y,u+1<l-2){y=v.F._hash(e,u+1);var m=u+1&32767;h[m]=r[y],r[y]=m}if(c<=u){if((14e3<p||26697<d)&&100<l-u&&(c<u&&(s[p]=u-c,p+=2,c=u),n=v.F._writeBlock(u==l-1||c==l?1:0,s,p,g,e,b,u-b,t,n),p=d=g=0,b=u),m=0,u<l-2&&(m=v.F._bestMatch(e,u,h,f,Math.min(i[2],l-u),i[3])),0!=m){f=m>>>16,m&=65535;var E=a(f,o.of0);o.lhst[257+E]++;var w=a(m,o.df0);o.dhst[w]++,g+=o.exb[E]+o.dxb[w],s[p]=f<<23|u-c,s[p+1]=m<<16|E<<8|w,p+=2,c=u+f}else o.lhst[e[u]]++;d++}}for(b==u&&0!=e.length||(c<u&&(s[p]=u-c,p+=2),n=v.F._writeBlock(1,s,p,g,e,b,u-b,t,n));0!=(7&n);)n++;return n>>>3},v.F._bestMatch=function(e,t,n,r,i,o){var a=32767&t,s=n[a],u=a-s+32768&32767;if(s==a||r!=v.F._hash(e,t-u))return 0;for(var c=r=0,l=Math.min(32767,t);u<=l&&0!=--o&&s!=a;){if((0==r||e[t+r]==e[t+r-u])&&(a=v.F._howLong(e,t,u))>r){if(c=u,(r=a)>=i)break;u+2<a&&(a=u+2);for(var f=0,h=0;h<a-2;h++){var p=t-u+h+32768&32767,d=p-n[p]+32768&32767;d>f&&(f=d,s=p)}}u+=(a=s)-(s=n[a])+32768&32767}return r<<16|c},v.F._howLong=function(e,t,n){if(e[t]!=e[t-n]||e[t+1]!=e[t+1-n]||e[t+2]!=e[t+2-n])return 0;var r=t,i=Math.min(e.length,t+258);for(t+=3;t<i&&e[t]==e[t-n];)t++;return t-r},v.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},v.saved=0,v.F._writeBlock=function(e,t,n,r,i,o,a,s,u){var c=v.F.U,l=v.F._putsF,f=v.F._putsE;c.lhst[256]++;var h=v.F.getTrees(),p=h[0],d=h[1],b=h[2],g=h[3],y=h[4],m=h[5],E=h[6];h=h[7];var w=32+(0==(u+3&7)?0:8-(u+3&7))+(a<<3),_=r+v.F.contSize(c.fltree,c.lhst)+v.F.contSize(c.fdtree,c.dhst);r=r+v.F.contSize(c.ltree,c.lhst)+v.F.contSize(c.dtree,c.dhst),r+=14+3*m+v.F.contSize(c.itree,c.ihst)+(2*c.ihst[16]+3*c.ihst[17]+7*c.ihst[18]);for(var O=0;286>O;O++)c.lhst[O]=0;for(O=0;30>O;O++)c.dhst[O]=0;for(O=0;19>O;O++)c.ihst[O]=0;if(w=w<_&&w<r?0:_<r?1:2,l(s,u,e),l(s,u+1,w),u+=3,0==w){for(;0!=(7&u);)u++;u=v.F._copyExact(i,o,a,s,u)}else{if(1==w)var I=c.fltree,A=c.fdtree;if(2==w){for(v.F.makeCodes(c.ltree,p),v.F.revCodes(c.ltree,p),v.F.makeCodes(c.dtree,d),v.F.revCodes(c.dtree,d),v.F.makeCodes(c.itree,b),v.F.revCodes(c.itree,b),I=c.ltree,A=c.dtree,f(s,u,g-257),f(s,u+=5,y-1),f(s,u+=5,m-4),u+=4,e=0;e<m;e++)f(s,u+3*e,c.itree[1+(c.ordr[e]<<1)]);u=v.F._codeTiny(E,c.itree,s,u+3*m),u=v.F._codeTiny(h,c.itree,s,u)}for(m=0;m<n;m+=2){for(E=(e=t[m])>>>23,e=o+(8388607&e);o<e;)u=v.F._writeLit(i[o++],I,s,u);0!=E&&(e=(p=t[m+1])>>16,a=p>>8&255,p&=255,f(s,u=v.F._writeLit(257+a,I,s,u),E-c.of0[a]),u+=c.exb[a],l(s,u=v.F._writeLit(p,A,s,u),e-c.df0[p]),u+=c.dxb[p],o+=E)}u=v.F._writeLit(256,I,s,u)}return u},v.F._copyExact=function(e,t,n,r,i){var o=i>>>3;return r[o]=n,r[o+1]=n>>>8,r[o+2]=255-r[o],r[o+3]=255-r[o+1],o+=4,r.set(new Uint8Array(e.buffer,t,n),o),i+(n+4<<3)},v.F.getTrees=function(){for(var e=v.F.U,t=v.F._hufTree(e.lhst,e.ltree,15),n=v.F._hufTree(e.dhst,e.dtree,15),r=[],i=v.F._lenCodes(e.ltree,r),o=[],a=v.F._lenCodes(e.dtree,o),s=0;s<r.length;s+=2)e.ihst[r[s]]++;for(s=0;s<o.length;s+=2)e.ihst[o[s]]++;s=v.F._hufTree(e.ihst,e.itree,7);for(var u=19;4<u&&0==e.itree[1+(e.ordr[u-1]<<1)];)u--;return[t,n,s,i,a,u,r,o]},v.F.getSecond=function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(e[n+1]);return t},v.F.nonZero=function(e){for(var t="",n=0;n<e.length;n+=2)0!=e[n+1]&&(t+=(n>>1)+",");return t},v.F.contSize=function(e,t){for(var n=0,r=0;r<t.length;r++)n+=t[r]*e[1+(r<<1)];return n},v.F._codeTiny=function(e,t,n,r){for(var i=0;i<e.length;i+=2){var o=e[i],a=e[i+1];r=v.F._writeLit(o,t,n,r);var s=16==o?2:17==o?3:7;15<o&&(v.F._putsE(n,r,a,s),r+=s)}return r},v.F._lenCodes=function(e,t){for(var n=e.length;2!=n&&0==e[n-1];)n-=2;for(var r=0;r<n;r+=2){var i=e[r+1],o=r+3<n?e[r+3]:-1,a=r+5<n?e[r+5]:-1,s=0==r?-1:e[r-1];if(0==i&&o==i&&a==i){for(o=r+5;o+2<n&&e[o+2]==i;)o+=2;11>(i=Math.min(o+1-r>>>1,138))?t.push(17,i-3):t.push(18,i-11),r+=2*i-2}else if(i==s&&o==i&&a==i){for(o=r+5;o+2<n&&e[o+2]==i;)o+=2;i=Math.min(o+1-r>>>1,6),t.push(16,i-3),r+=2*i-2}else t.push(i,0)}return n>>>1},v.F._hufTree=function(e,t,n){var r=[],i=e.length,o=t.length,a=0;for(a=0;a<o;a+=2)t[a]=0,t[a+1]=0;for(a=0;a<i;a++)0!=e[a]&&r.push({lit:a,f:e[a]});if(e=r.length,i=r.slice(0),0==e)return 0;if(1==e)return t[1+((n=r[0].lit)<<1)]=1,t[1+((0==n?1:0)<<1)]=1;r.sort((function(e,t){return e.f-t.f})),a=r[0],o=r[1];var s=0,u=1,c=2;for(r[0]={lit:-1,f:a.f+o.f,l:a,r:o,d:0};u!=e-1;)a=s!=u&&(c==e||r[s].f<r[c].f)?r[s++]:r[c++],o=s!=u&&(c==e||r[s].f<r[c].f)?r[s++]:r[c++],r[u++]={lit:-1,f:a.f+o.f,l:a,r:o};for((r=v.F.setDepth(r[u-1],0))>n&&(v.F.restrictDepth(i,n,r),r=n),a=0;a<e;a++)t[1+(i[a].lit<<1)]=i[a].d;return r},v.F.setDepth=function(e,t){return-1!=e.lit?e.d=t:Math.max(v.F.setDepth(e.l,t+1),v.F.setDepth(e.r,t+1))},v.F.restrictDepth=function(e,t,n){var r=0,i=1<<n-t,o=0;for(e.sort((function(e,t){return t.d==e.d?e.f-t.f:t.d-e.d})),r=0;r<e.length&&e[r].d>t;r++){var a=e[r].d;e[r].d=t,o+=i-(1<<n-a)}for(o>>>=n-t;0<o;)(a=e[r].d)<t?(e[r].d++,o-=1<<t-a-1):r++;for(;0<=r;r--)e[r].d==t&&0>o&&(e[r].d--,o++);0!=o&&console.log("debt left")},v.F._goodIndex=function(e,t){var n=0;return t[16|n]<=e&&(n|=16),t[8|n]<=e&&(n|=8),t[4|n]<=e&&(n|=4),t[2|n]<=e&&(n|=2),t[1|n]<=e&&(n|=1),n},v.F._writeLit=function(e,t,n,r){return v.F._putsF(n,r,t[e<<1]),r+t[1+(e<<1)]},v.F.inflate=function(e,t){var n=Uint8Array;if(3==e[0]&&0==e[1])return t||new n(0);var r=v.F,i=r._bitsF,o=r._bitsE,a=r._decodeTiny,s=r.makeCodes,u=r.codes2map,c=r._get17,l=r.U,f=null==t;f&&(t=new n(e.length>>>2<<3));for(var h,p,d,b,g=0,y=0,m=p=0,E=0;0==g;)if(g=i(e,E,1),h=i(e,E+1,2),E+=3,0==h)0!=(7&E)&&(E+=8-(7&E)),h=e[(E=4+(E>>>3))-4]|e[E-3]<<8,f&&(t=v.F._check(t,m+h)),t.set(new n(e.buffer,e.byteOffset+E,h),m),E=E+h<<3,m+=h;else{if(f&&(t=v.F._check(t,m+131072)),1==h&&(d=l.flmap,b=l.fdmap,y=511,p=31),2==h){for(p=o(e,E,5)+257,h=o(e,E+5,5)+1,d=o(e,E+10,4)+4,E+=14,b=0;38>b;b+=2)l.itree[b]=0,l.itree[b+1]=0;for(y=1,b=0;b<d;b++){var w=o(e,E+3*b,3);l.itree[1+(l.ordr[b]<<1)]=w,w>y&&(y=w)}E+=3*d,s(l.itree,y),u(l.itree,y,l.imap),d=l.lmap,b=l.dmap,E=a(l.imap,(1<<y)-1,p+h,e,E,l.ttree),y=(1<<(w=r._copyOut(l.ttree,0,p,l.ltree)))-1,p=(1<<(h=r._copyOut(l.ttree,p,h,l.dtree)))-1,s(l.ltree,w),u(l.ltree,w,d),s(l.dtree,h),u(l.dtree,h,b)}for(;;)if(E+=15&(h=d[c(e,E)&y]),0==(w=h>>>4)>>>8)t[m++]=w;else{if(256==w)break;h=m+w-254,264<w&&(h=m+((w=l.ldef[w-257])>>>3)+o(e,E,7&w),E+=7&w),E+=15&(w=b[c(e,E)&p]);var _=((w=l.ddef[w>>>4])>>>4)+i(e,E,15&w);for(E+=15&w,f&&(t=v.F._check(t,m+131072));m<h;)t[m]=t[m++-_],t[m]=t[m++-_],t[m]=t[m++-_],t[m]=t[m++-_];m=h}}return t.length==m?t:t.slice(0,m)},v.F._check=function(e,t){var n=e.length;return t<=n?e:((t=new Uint8Array(Math.max(n<<1,t))).set(e,0),t)},v.F._decodeTiny=function(e,t,n,r,i,o){for(var a=v.F._bitsE,s=v.F._get17,u=0;u<n;){var c=e[s(r,i)&t];i+=15&c;var l=c>>>4;if(15>=l)o[u]=l,u++;else{var f=c=0;for(16==l?(f=3+a(r,i,2),i+=2,c=o[u-1]):17==l?(f=3+a(r,i,3),i+=3):18==l&&(f=11+a(r,i,7),i+=7),l=u+f;u<l;)o[u]=c,u++}}return i},v.F._copyOut=function(e,t,n,r){for(var i=0,o=0,a=r.length>>>1;o<n;){var s=e[o+t];r[o<<1]=0,r[1+(o<<1)]=s,s>i&&(i=s),o++}for(;o<a;)r[o<<1]=0,r[1+(o<<1)]=0,o++;return i},v.F.makeCodes=function(e,t){var n,r,i=v.F.U,o=e.length,a=i.bl_count;for(n=0;n<=t;n++)a[n]=0;for(n=1;n<o;n+=2)a[e[n]]++;for(i=i.next_code,n=0,a[0]=0,r=1;r<=t;r++)n=n+a[r-1]<<1,i[r]=n;for(t=0;t<o;t+=2)0!=(a=e[t+1])&&(e[t]=i[a],i[a]++)},v.F.codes2map=function(e,t,n){for(var r=e.length,i=v.F.U.rev15,o=0;o<r;o+=2)if(0!=e[o+1]){var a=e[o+1],s=o>>1<<4|a,u=t-a;for(u=(a=e[o]<<u)+(1<<u);a!=u;)n[i[a]>>>15-t]=s,a++}},v.F.revCodes=function(e,t){for(var n=v.F.U.rev15,r=15-t,i=0;i<e.length;i+=2)e[i]=n[e[i]<<t-e[i+1]]>>>r},v.F._putsE=function(e,t,n){n<<=7&t,e[t>>>=3]|=n,e[t+1]|=n>>>8},v.F._putsF=function(e,t,n){n<<=7&t,e[t>>>=3]|=n,e[t+1]|=n>>>8,e[t+2]|=n>>>16},v.F._bitsE=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<n)-1},v.F._bitsF=function(e,t,n){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<n)-1},v.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},v.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},v.F.U=function(){var e=Uint16Array,t=Uint32Array;return{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new e(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}}(),function(){function e(e,t,n){for(;0!=t--;)e.push(0,n)}for(var t=v.F.U,n=0;32768>n;n++){var r=n;r=(4278255360&(r=(4042322160&(r=(3435973836&(r=(2863311530&r)>>>1|(1431655765&r)<<1))>>>2|(858993459&r)<<2))>>>4|(252645135&r)<<4))>>>8|(16711935&r)<<8,t.rev15[n]=(r>>>16|r<<16)>>>17}for(n=0;32>n;n++)t.ldef[n]=t.of0[n]<<3|t.exb[n],t.ddef[n]=t.df0[n]<<4|t.dxb[n];e(t.fltree,144,8),e(t.fltree,112,9),e(t.fltree,24,7),e(t.fltree,8,8),v.F.makeCodes(t.fltree,9),v.F.codes2map(t.fltree,9,t.flmap),v.F.revCodes(t.fltree,9),e(t.fdtree,32,5),v.F.makeCodes(t.fdtree,5),v.F.codes2map(t.fdtree,5,t.fdmap),v.F.revCodes(t.fdtree,5),e(t.itree,19,0),e(t.ltree,286,0),e(t.dtree,30,0),e(t.ttree,320,0)}();var iD=["backups","servers"],jD=["backups","servers"],kD=["group"],nl=v.inflate,ks=v.deflate,ls=function(e){function t(e,i,o,a){W(this,t);var s=r.call(this,a,"Session");return m(n(s),"chatManager",void 0),m(n(s),"joinedChannels",new Set),m(n(s),"msgDedupLru",new tc(void 0,{maxlen:200})),m(n(s),"startTime",Date.now()),m(n(s),"seq",U.fromNumber(1,!0)),m(n(s),"userJoinOptions",new is(!1)),m(n(s),"seqSentStatuses",[!1,!1]),m(n(s),"dialogueSequenceLru",new tc(void 0,{maxlen:1e4})),m(n(s),"loggedOut",!1),m(n(s),"messageSentTimes",[]),m(n(s),"curLoginSockets",[void 0,void 0]),m(n(s),"loginSocketSubs",[{channels:new Map,receivers:[]},{channels:new Map,receivers:[]}]),m(n(s),"lastLoginSockets",[new qe(1),new qe(1)]),m(n(s),"dialPendingMsgSubjectMap",new Map),m(n(s),"context",void 0),m(n(s),"connection",void 0),m(n(s),"instanceId",void 0),m(n(s),"registerSocketsFailureListener",(function(){s.connection.once("socketsFailure",(function(){s.log("socketsFailure, creating a new connection"),ad((function(){return s.connection.removeAllListeners(),s.connection=new Yr(s.context,s.logger,!0),s.loginHandler(15e3,!0)})).pipe(oe((function(e){return e.pipe(cd(Zd.getParameter("RECONNECTING_AP_INTERVAL")))})),ob(s.connection.apClient.apFinish$)).subscribe((function(){s.log("new connection connected")}))})),0===s.connection.listenerCount("tokenExpired")&&s.connection.on("tokenExpired",(function(){s.emit("tokenExpired")}))})),s.context=e,s.connection=i,s.instanceId=o,s.chatManager=new hD(a),s.log("The instanceId is %s",s.instanceId.toString()),s}la(t,e);var r=ma(t);return Ha(t,[{key:"fetchFileUploadIndexGet",value:function(e){var n=e.hash,r=e.size;if(0===(e=this.getLoginSockets()).length)throw new K("Client is not logged in");var i=this.incGetSeq();return e.forEach((function(e){e.sendPacket("FileUploadIndexGet",{seq:i,hash:n,size:r})})),{ret:Ca.apply(void 0,G(e.map((function(e){return e.fromReceived("FileUploadIndexRet").pipe(aa((function(e){return i.eq(e.seq)})))})))),fin:Ca.apply(void 0,G(e.map((function(e){return e.fromReceived("FileUploadIndexFin").pipe(aa((function(e){return i.eq(e.seq)})))})))),err:Xb.apply(void 0,G(e.map((function(e){return e.fromReceived("FileUploadIndexErr").pipe(aa((function(e){return i.eq(e.seq)})),ba((function(e){throw new da(["The media message upload failure, code %d",e.code],lg)})))})))),timeout:t.genTimeoutError(Lh)}}},{key:"requestFileUploadIndexSet",value:function(e){var n=e.hash,r=e.unit,i=e.servers;if(0===(e=this.getLoginSockets()).length)throw new K("Client is not logged in");var o=this.incGetSeq();return e.forEach((function(e){e.sendPacket("FileUploadIndexSet",{seq:o,servers:i,hash:n,unit:r})})),Ca.apply(void 0,[t.genTimeoutError(Lh)].concat(G(e.map((function(e){return e.fromReceived("FileUploadIndexErr").pipe(aa((function(e){return o.eq(e.seq)})),ba((function(e){throw new da(["FileUploadIndexSet failure, code %d",e.code],lg)})))}))),G(e.map((function(e){return e.fromReceived("FileUploadIndexFin").pipe(aa((function(e){return o.eq(e.seq)})))})))))}},{key:"requestFileDownloadIndexGet",value:function(e){var n=e.size,r=e.zone,i=e.unit,o=e.hash,a=this.getLoginSockets();if(0===a.length)throw new K("Client is not logged in");var s=this.incGetSeq();return a.forEach((function(e){e.sendPacket("FileDownloadIndexGet",{seq:s,size:n,zone:r,unit:i,hash:o})})),e=Ca.apply(void 0,G(a.map((function(e){return e.fromReceived("FileDownloadIndexRet").pipe(aa((function(e){return s.eq(e.seq)})))})))).pipe(ba((function(e){var t=e.backups,n=e.servers;return e=ff(e,iD),ua({backupList:t.map((function(e){return[e]})),serverList:n.map((function(e){return[e]}))},e)})),cd(500)),a=jm(a.map((function(e){return e.fromReceived("FileDownloadIndexRet").pipe(aa((function(e){return s.eq(e.seq)})))}))),Ca(e,a.pipe(ba((function(e){return e.reduce((function(e,t){var n=e.backupList,r=e.serverList;e=t.backups;var i=t.servers;return t=ff(t,jD),ua({backupList:e.map((function(e,t){return[e].concat(G(void 0!==n&&Array.isArray(n[t])?n[t]:[]))})),serverList:i.map((function(e,t){return[e].concat(G(void 0!==n&&Array.isArray(r[t])?r[t]:[]))}))},t)}),{})}))),t.genTimeoutError(Lh))}},{key:"loginHandler",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:2e4,n=1<arguments.length&&void 0!==arguments[1]&&arguments[1];if(this.loggedOut&&n)throw new K("Already logged out, request ignored");n&&this.registerSocketsFailureListener(),this.connection.initConnection();var r=this.getSocketLoginObservables(this.connection.lastOpenSockets,this.seq),i=Date.now();return r.forEach((function(t,r){var o=e.loginSocketSubs[r].login;void 0!==o&&o.unsubscribe(),e.loginSocketSubs[r].login=t.pipe(ca((function(t){var o;e.curLoginSockets[r]=t;var a=Date.now();eb("Link",{ackedServerIp:t.address,destServerIp:t.ip,ec:0,sc:0,elapse:fb(e.startTime),lts:U.fromNumber(a),responseTime:i-a,sid:Xa(e.instanceId),userId:e.context.uid},null!==(o=e.context.config.enableCloudProxy)&&void 0!==o&&o),e.emit("userJoined",t.env),n&&e.connection.apClient.apFinish$.next(void 0)}))).subscribe(e.lastLoginSockets[r])})),this.initKeepAliveSender(),this.initKeepAliveReconnector(),this.initLoginReceiver(),Xb.apply(void 0,G(r).concat([gb(this.connection,"connectionInitFailure").pipe(ca((function(e){if(sa(e)||Sa(e))throw e;throw new da("Login failure",{code:Zq,originalError:e})})))])).pipe(Ka(1),hb(t),Ga((function(t){return t instanceof pb&&e.warn("Client login timeout"),t&&t.code===Kh&&(e.connection.emit("tokenExpired"),e.connection.apClient.apFinish$.next(void 0)),e.clearSockets(0,n),Z(t)})),ca((function(){n||e.registerSocketsFailureListener()})),wg((function(){n||e.connection.apClient.apFinish$.next(void 0)})))}},{key:"logoutHandler",value:function(){var e=J(w.mark((function e(){var t,n,r,i=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.loggedOut=!0,this.connection.apClient.apFinish$.next(void 0),t=this.getLoginSockets(),n=t.map((function(e){return e.sendPacket("UserQuit",{}),i.connection.waitClosing(e)})),this.clearSockets(5e3),r=t.map((function(e){return e.env})),[0,1].filter((function(e){return!r.includes(e)})).forEach((function(e){i.connection.closeSocket(e,0)})),e.abrupt("return",Xb.apply(void 0,G(n)).toPromise());case 9:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"requestChannelJoin",value:function(){var e=J(w.mark((function e(t,n){var r,i,o,a=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==this.getLoginSockets().length){e.next=2;break}throw new K("Client is not logged in. Cannot join the channel",Vq);case 2:return r=gb(this,"channelLeft").pipe(wb((function(e){return e===t})),Ka(1)),i=this.incGetSeq(),(o=this.lastLoginSockets.map((function(e){return e.pipe(Cc((function(e,t){0!==t&&a.incSeqIfNeeded(e.env);var r=0===t?i:a.seq;return e.sendPacket("GroupEnter",{account:n,seq:r}),e.fromReceived("GroupReply").pipe(aa((function(e){return r.eq(e.seq)})),ca((function(e){if(0!==(e=e.code))throw new da(["Channel join failure. The response code is %d",e],Rq)})))})),ob(r),pe())}))).forEach((function(e,n){var r=function(){return a.loginSocketSubs[n].channels.delete(t.channelId)};a.loginSocketSubs[n].channels.set(t.channelId,e.subscribe({error:r,complete:r}))})),e.next=8,Xb.apply(void 0,G(o)).pipe(Ka(1),hb(1e4),Ga((function(e){return e instanceof pb&&a.warn("Channel join timeout"),Z(e)}))).toPromise();case 8:this.joinedChannels.add(t);case 9:case"end":return e.stop()}}),e,this)})));return function(t,n){return e.apply(this,arguments)}}()},{key:"requestChannelLeave",value:function(e,t){this.emit("channelLeft",e),this.joinedChannels.delete(e),this.getLoginSockets().forEach((function(e){e.sendPacket("GroupLeave",{account:t})}))}},{key:"requestChannelMemberList",value:function(e){var n=this.getLoginSockets();if(0===n.length)throw new K("Client is not logged in. Cannot get the channel members",cA);var r=this.incGetSeq();return n.forEach((function(t){t.sendPacket("GroupAllUsersList",{group:e,pageNumber:0,pageSize:200,seq:r})})),Ca.apply(void 0,[t.genTimeoutError(Pq)].concat(G(n.map((function(t){return t.fromReceived("GroupAllUsersResult").pipe(aa((function(t){var n=t.seq;return t.group===e&&r.eq(n)})))})))))}},{key:"requestPeersOnlineStatus",value:function(e){var n=this.getLoginSockets();if(0===n.length)throw new K("Client is not logged in");var r=this.incGetSeq();return n.forEach((function(t){t.sendPacket("UserStatusList",{users:e,seq:r})})),Ca.apply(void 0,[t.genTimeoutError(oA)].concat(G(n.map((function(e){return e.fromReceived("UserStatusResult").pipe(aa((function(e){return r.eq(e.seq)})))})))))}},{key:"requestSetLocalUserAttributes",value:function(e,n){var r=this,i=this.getLoginSockets();if(0===i.length)throw new K("Client is not logged in");var o=this.incGetSeq();return i.forEach((function(t,i){void 0!==n&&i!==n||t.sendPacket("UserAttributeSet",{account:r.context.uid,attributeInfos:Object.entries(e).map((function(e){return{key:(e=ra(e,2))[0],value:e[1]}})),seq:o})})),Ca.apply(void 0,G(i.map((function(e){return e.fromReceived("UserAttributeErr").pipe(aa((function(e){return o.eq(e.seq)})),ba((function(e){throw new da(["The user attributes set failure, code %d",e.code],Sb)})))}))).concat([t.genTimeoutError(Tb)],G(i.map((function(e){return e.fromReceived("UserAttributeRsp").pipe(aa((function(e){return o.eq(e.seq)})))})))))}},{key:"requestSetChannelAttributes",value:function(e,n,r){var i=this.getLoginSockets();if(0===i.length)throw new K("Client is not logged in");var o=this.incGetSeq();return i.forEach((function(t){t.sendPacket("GroupAttributeSet",{broadcast:r,group:e,attributeInfos:Object.entries(n).map((function(e){return{key:(e=ra(e,2))[0],value:e[1]}})),seq:o})})),Ca.apply(void 0,G(i.map((function(e){return e.fromReceived("GroupAttributeErr").pipe(aa((function(e){return o.eq(e.seq)})),ba((function(e){throw new da(["The group attributes set failure, code %d",e.code],Sb)})))}))).concat([t.genTimeoutError(Tb)],G(i.map((function(e){return e.fromReceived("GroupAttributeRsp").pipe(aa((function(e){return o.eq(e.seq)})))})))))}},{key:"requestAddOrUpdateLocalUserAttributes",value:function(e){var n=this,r=this.getLoginSockets();if(0===r.length)throw new K("Client is not logged in");var i=this.incGetSeq();return r.forEach((function(t){t.sendPacket("UserAttributeMod",{account:n.context.uid,attributeInfos:Object.entries(e).map((function(e){return{key:(e=ra(e,2))[0],value:e[1]}})),seq:i})})),Ca.apply(void 0,G(r.map((function(e){return e.fromReceived("UserAttributeErr").pipe(aa((function(e){return i.eq(e.seq)})),ba((function(e){throw new da(["The user attributes add or update failure, code %d",e.code],Sb)})))}))).concat([t.genTimeoutError(Tb)],G(r.map((function(e){return e.fromReceived("UserAttributeRsp").pipe(aa((function(e){return i.eq(e.seq)})))})))))}},{key:"requestAddOrUpdateChannelAttributes",value:function(e,n,r){var i=this.getLoginSockets();if(0===i.length)throw new K("Client is not logged in");var o=this.incGetSeq();return i.forEach((function(t){t.sendPacket("GroupAttributeMod",{broadcast:r,group:e,attributeInfos:Object.entries(n).map((function(e){return{key:(e=ra(e,2))[0],value:e[1]}})),seq:o})})),Ca.apply(void 0,G(i.map((function(e){return e.fromReceived("GroupAttributeErr").pipe(aa((function(e){return o.eq(e.seq)})),ba((function(e){throw new da(["The group attributes add or update failure, code %d",e.code],Sb)})))}))).concat([t.genTimeoutError(Tb)],G(i.map((function(e){return e.fromReceived("GroupAttributeRsp").pipe(aa((function(e){return o.eq(e.seq)})))})))))}},{key:"requestDeleteLocalUserAttributesByKeys",value:function(e){var n=this,r=this.getLoginSockets();if(0===r.length)throw new K("Client is not logged in");var i=this.incGetSeq();return r.forEach((function(t){t.sendPacket("UserAttributeDel",{account:n.context.uid,attributes:e,seq:i})})),Ca.apply(void 0,G(r.map((function(e){return e.fromReceived("UserAttributeErr").pipe(aa((function(e){return i.eq(e.seq)})),ba((function(e){throw new da(["The user attributes delete failure, code %d",e.code],Sb)})))}))).concat([t.genTimeoutError(Tb)],G(r.map((function(e){return e.fromReceived("UserAttributeRsp").pipe(aa((function(e){return i.eq(e.seq)})))})))))}},{key:"requestDeleteChannelAttributesByKeys",value:function(e,n,r){var i=this.getLoginSockets();if(0===i.length)throw new K("Client is not logged in");var o=this.incGetSeq();return i.forEach((function(t){t.sendPacket("GroupAttributeDel",{group:e,broadcast:r,attributes:n,seq:o})})),Ca.apply(void 0,G(i.map((function(e){return e.fromReceived("GroupAttributeErr").pipe(aa((function(e){return o.eq(e.seq)})),ba((function(e){throw new da(["The channel attributes delete failure, code %d",e.code],Sb)})))}))).concat([t.genTimeoutError(Tb)],G(i.map((function(e){return e.fromReceived("GroupAttributeRsp").pipe(aa((function(e){return o.eq(e.seq)})))})))))}},{key:"requestClearLocalUserAttributes",value:function(){var e=this,n=this.getLoginSockets();if(0===n.length)throw new K("Client is not logged in");var r=this.incGetSeq();return n.forEach((function(t){t.sendPacket("UserAttributeSet",{account:e.context.uid,seq:r,attributeInfos:[]})})),Ca.apply(void 0,G(n.map((function(e){return e.fromReceived("UserAttributeErr").pipe(aa((function(e){return r.eq(e.seq)})),ba((function(e){throw new da(["The user attributes clear failure, code %d",e.code],Sb)})))}))).concat([t.genTimeoutError(Tb)],G(n.map((function(e){return e.fromReceived("UserAttributeRsp").pipe(aa((function(e){return r.eq(e.seq)})))})))))}},{key:"requestClearChannelAttributes",value:function(e,n){var r=this.getLoginSockets();if(0===r.length)throw new K("Client is not logged in");var i=this.incGetSeq();return r.forEach((function(t){t.sendPacket("GroupAttributeSet",{group:e,seq:i,attributeInfos:[],broadcast:n})})),Ca.apply(void 0,G(r.map((function(e){return e.fromReceived("GroupAttributeErr").pipe(aa((function(e){return i.eq(e.seq)})),ba((function(e){throw new da(["The channel attributes clear failure, code %d",e.code],Sb)})))}))).concat([t.genTimeoutError(Tb)],G(r.map((function(e){return e.fromReceived("GroupAttributeRsp").pipe(aa((function(e){return i.eq(e.seq)})))})))))}},{key:"requestGetUserAttributesByKeys",value:function(e,n){var r=this.getLoginSockets();if(0===r.length)throw new K("Client is not logged in");var i=this.incGetSeq();return r.forEach((function(t){t.sendPacket("UserAttributeGet",{account:e,seq:i,attributes:n})})),Ca.apply(void 0,[t.genTimeoutError(Tb)].concat(G(r.map((function(e){return e.fromReceived("UserAttributeErr").pipe(aa((function(e){return i.eq(e.seq)})),ba((function(e){if(10008===(e=e.code))throw new da("The user requested is not online",Lq);throw new Wc(["User attribute operation unknown error code: %d",e],Sb)})))}))),G(r.map((function(e){return e.fromReceived("UserAttributeRet").pipe(aa((function(e){return i.eq(e.seq)})))})))))}},{key:"requestGetChannelAttributesByKeys",value:function(e,n){var r=this.getLoginSockets();if(0===r.length)throw new K("Client is not logged in");var i=this.incGetSeq();return r.forEach((function(t){t.sendPacket("GroupAttributeGet",{group:e,seq:i,attributes:n})})),Ca.apply(void 0,[t.genTimeoutError(Tb)].concat(G(r.map((function(e){return e.fromReceived("GroupAttributeErr").pipe(aa((function(e){return i.eq(e.seq)})),ba((function(e){throw new da(["The channel attributes get failure, code %d",e.code],Sb)})))}))),G(r.map((function(e){return e.fromReceived("GroupAttributeRet").pipe(aa((function(e){return i.eq(e.seq)})))})))))}},{key:"requestGetUserAttributeKeys",value:function(e){var n=this.getLoginSockets();if(0===n.length)throw new K("Client is not logged in");var r=this.incGetSeq();return n.forEach((function(t){t.sendPacket("UserAttributeKeysGet",{account:e,seq:r})})),Ca.apply(void 0,[t.genTimeoutError(Tb)].concat(G(n.map((function(e){return e.fromReceived("UserAttributeErr").pipe(aa((function(e){return r.eq(e.seq)})),ba((function(e){if(10008===(e=e.code))throw new da("The user requested is not online",Lq);throw new Wc(["User attribute operation unknown error code: %d",e],Sb)})))}))),G(n.map((function(e){return e.fromReceived("UserAttributeKeysRet").pipe(aa((function(e){return r.eq(e.seq)})))})))))}},{key:"requestGetChannelAttributesKeys",value:function(e){var n=this.getLoginSockets();if(0===n.length)throw new K("Client is not logged in");var r=this.incGetSeq();return n.forEach((function(t){t.sendPacket("GroupAttributeKeysGet",{group:e,seq:r})})),Ca.apply(void 0,[t.genTimeoutError(Tb)].concat(G(n.map((function(e){return e.fromReceived("GroupAttributeErr").pipe(aa((function(e){return r.eq(e.seq)})),ba((function(e){throw new Wc(["Channel attribute operation unknown error code: %d",e.code],Sb)})))}))),G(n.map((function(e){return e.fromReceived("GroupAttributeKeysRet").pipe(aa((function(e){return r.eq(e.seq)})))})))))}},{key:"requestGetChannelMemberCount",value:function(e){var n=this.getLoginSockets();if(0===n.length)throw new K("Client is not logged in");var r=this.incGetSeq();return n.forEach((function(t){t.sendPacket("GroupStatusList",{groups:e,seq:r})})),Ca.apply(void 0,[t.genTimeoutError(Pq)].concat(G(n.map((function(e){return e.fromReceived("GroupStatusResult").pipe(aa((function(e){return r.eq(e.seq)})))})))))}},{key:"requestSubscribePeersOnlineStatus",value:function(e){var n=this.getLoginSockets();if(0===n.length)throw new K("Client is not logged in");var r=this.incGetSeq();return n.forEach((function(t){t.sendPacket("SubscribeUserStatus",{seq:r,users:e})})),Ca.apply(void 0,[t.genTimeoutError(vA)].concat(G(n.map((function(e){return e.fromReceived("SubscribeResponse").pipe(aa((function(e){return r.eq(e.seq)})))})))))}},{key:"requestUnsubscribePeersOnlineStatus",value:function(e){var t=this.getLoginSockets();if(0===t.length)throw new K("Client is not logged in");var n=this.incGetSeq();t.forEach((function(t){t.sendPacket("UnsubscribeUserStatus",{seq:n,users:e})}))}},{key:"sendInvitationMessage",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a,s,u,c,l,f,h,p,d=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.peerId,r=t.callId,i=t.extra,o=t.isAcceptAck,a=t.channelId,s=t.type,u={callId:r},void 0===o){e.next=6;break}if("CallAccept"===s){e.next=5;break}throw Error("invalid invitation type");case 5:u.type=o?"ack":"request";case 6:return u.channel=a,("CallInvite"===s||"CallCancel"===s||"CallReject"===s||"CallAccept"===s&&!1===o)&&void 0!==i&&(u.extra=i),c=Bg(),this.log("The sent invitation body is %o",u),l=function(e){return{MiscMap:{},sequence:U.fromNumber(1),dialogue:c,instance:d.instanceId,dst:n,ms:U.fromNumber(Date.now(),!0),options:new ae({IterationNumber:e,MessageType:s}).toLong(),payload:(new TextEncoder).encode(JSON.stringify(u)),src:d.context.uid}},e.next=14,Kb(this.sendMessageToRetry(l,!0)).pipe(hb(1e4),Ga((function(e){return e instanceof pb&&d.warn("Send invitation timeout"),Z(e)}))).toPromise();case 14:return f=e.sent,h=f.code,p=f.retryTimes,e.abrupt("return",{hasPeerReceived:0===h,hasReSent:0!==p});case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"sendMediaMessage",value:function(){var e=J(w.mark((function e(t,n,r,i,o,a){var s,u,c,l,f,h,p,d,v,b,g,y,E,_,O,A,k,R,T,N,S,C,x,L,P,j,M,D,q,F=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(u=n.width,c=void 0===u?0:u,l=n.height,f=void 0===l?0:l,h=n.fileName,p=void 0===h?"":h,d=n.description,v=void 0===d?"":d,b=n.thumbnail,g=void 0===b?new Blob:b,y=n.thumbnailHeight,E=void 0===y?0:y,_=n.thumbnailWidth,O=void 0===_?0:_,A=n.size,k=void 0===A?0:A,R=n.mediaId,T=o.enableOfflineMessaging,N=o.enableHistoricalMessaging,za(r)){e.next=4;break}throw new I("The send message arguments are not valid",i?$k:hg);case 4:if(!(32768<new Blob([p,g,v]).size)){e.next=6;break}throw new I("The size of message overflowed ",i?ve:Hh);case 6:return S=this.chatManager.getChatInfo(r),C=S.dialogue,x=S.sequence,L=this.instanceId,this.log('A%s media message is sending to %s: "'.concat(L,"-").concat(C,"#").concat(x,'"'),i?" peer":" channel",oa(r)),m(s={},"media_description",v),m(s,"media_width",c),m(s,"media_height",f),m(s,"media_thumbnailwidth",O),m(s,"media_thumbnailheight",E),m(s,"media_size",k),m(s,"media_id",R),m(s,"media_filename",p),P=uc(s,(function(e){return(new TextEncoder).encode(e.toString())})),e.t0=Uint8Array,e.next=14,Ji(g);case 14:return e.t1=e.sent,P.media_thumbnail=new e.t0(e.t1),j=i&&"IMAGE"===t?"PeerImageMessage":i&&"FILE"===t?"PeerFileMessage":i||"IMAGE"!==t?"ChannelFileMessage":"ChannelImageMessage",M=function(e){return{MiscMap:P,sequence:x,dialogue:C,instance:L,dst:r,ms:U.fromNumber(Date.now(),!0),options:new ae({IterationNumber:e,CompressionMethod:"Uncompressed",MessageType:j,ToCache:T,ToArchive:N}).toLong(),payload:new Uint8Array,src:F.context.uid}},e.next=20,Kb(this.sendMessageToRetry(M,!0)).pipe(hb(void 0===a?1e4:a),Ga((function(e){return e instanceof pb&&F.warn("Send message timeout"),Z(e)}))).toPromise();case 20:if(D=e.sent,2!==(q=D.code)){e.next=24;break}throw new da("The peer does not support this type of message",nA);case 24:return e.abrupt("return",{hasPeerReceived:0===q});case 25:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}()},{key:"sendRawMessage",value:function(){var e=J(w.mark((function e(t,n,r,i,o,a){var s,u,c,l,f,h,p,d,v,b,g=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=o.enableOfflineMessaging,u=o.enableHistoricalMessaging,za(r)&&t instanceof Uint8Array&&"string"==typeof n){e.next=3;break}throw new I("The send message arguments are not valid",i?$k:hg);case 3:if(!(32768<t.byteLength+new Blob([n]).size)){e.next=5;break}throw new ib("The message size is over the 32KB limit",i?ve:Hh);case 5:return c=!Zd.getParameter("DISABLE_MESSAGE_COMPRESSION")&&128<=t.byteLength,l=this.chatManager.getChatInfo(r),f=l.dialogue,h=l.sequence,p=this.instanceId,this.log('A%s %s raw message is sending to %s: "'.concat(p,"-").concat(f,"#").concat(h,'"'),c?" compressed":"",i?"peer":"channel",oa(r)),d=function(e){return{MiscMap:{description:(new TextEncoder).encode(n)},sequence:h,dialogue:f,instance:p,dst:r,ms:U.fromNumber(Date.now(),!0),options:new ae({IterationNumber:e,CompressionMethod:c?"Zlib":"Uncompressed",MessageType:i?"PeerRawMessage":"ChannelRawMessage",ToCache:s,ToArchive:u}).toLong(),payload:c?ks(t):t,src:g.context.uid}},e.next=12,Kb(this.sendMessageToRetry(d,!0)).pipe(hb(void 0===a?1e4:a),Ga((function(e){return e instanceof pb&&g.warn("Send message timeout"),Z(e)}))).toPromise();case 12:return v=e.sent,b=v.code,e.abrupt("return",{hasPeerReceived:0===b});case 15:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,o,a){return e.apply(this,arguments)}}()},{key:"sendTextMessage",value:function(){var e=J(w.mark((function e(t,n,r,i,o){var a,s,u,c,l,f,h,p,d,v,b,g=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=i.enableOfflineMessaging,s=i.enableHistoricalMessaging,za(n)){e.next=3;break}throw new I("The send message arguments are not valid",r?$k:hg);case 3:if(!(32768<new Blob([t]).size)){e.next=5;break}throw new ib("The message size is over the 32KB limit",r?ve:Hh);case 5:return u=!Zd.getParameter("DISABLE_MESSAGE_COMPRESSION")&&128<=new Blob([t]).size,c=this.chatManager.getChatInfo(n),l=c.dialogue,f=c.sequence,h=this.instanceId,this.log('A%s %s message is sending to %s: "'.concat(h,"-").concat(l,"#").concat(f,'"'),u?" compressed":"",r?"peer":"channel",oa(n)),p=(new TextEncoder).encode(t),d=function(e){return{MiscMap:{},sequence:f,dialogue:l,instance:h,dst:n,ms:U.fromNumber(Date.now(),!0),options:new ae({IterationNumber:e,CompressionMethod:u?"Zlib":"Uncompressed",MessageType:r?"PeerTextMessage":"ChannelTextMessage",ToCache:a,ToArchive:s}).toLong(),payload:u?ks(p):p,src:g.context.uid}},e.next=13,Kb(this.sendMessageToRetry(d,!0)).pipe(hb(void 0===o?1e4:o),Ga((function(e){return e instanceof pb&&g.warn("Send message timeout"),Z(e)}))).toPromise();case 13:return v=e.sent,b=v.code,e.abrupt("return",{hasPeerReceived:0===b});case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i,o){return e.apply(this,arguments)}}()},{key:"cleanLoginSubs",value:function(e,t){Object.entries(this.loginSocketSubs[e]).forEach((function(e){var n=(e=ra(e,2))[1];"channels"===e[0]&&t||(Array.isArray(n)||n instanceof Map?n.forEach((function(e){return e.unsubscribe()})):n&&n.unsubscribe())})),this.loginSocketSubs[e]={channels:t?this.loginSocketSubs[e].channels:new Map,receivers:[]}}},{key:"sendMessageToRetry",value:function(){var e=J(w.mark((function e(t,n){var r,i,o,a,s,u,c,l,f,h=this,p=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=2<p.length&&void 0!==p[2]?p[2]:0,this.log("Attempt to send the message ".concat(n?" with retrying, %o":"without retrying"),{retryTimes:r}),0!==(i=this.getLoginSockets()).length){e.next=5;break}throw Error("no logged-in sockets");case 5:return o=t(r),i.forEach((function(e){e.sendPacket("Message",o)})),a=o.dialogue,s=o.sequence,u=o.instance,c=i.map((function(e){return e.fromReceived("Ack").pipe(wb((function(e){return a.eq(e.dialogue)&&s.eq(e.sequence)&&u.eq(e.instance)})))})),e.prev=9,e.next=12,Xb.apply(void 0,G(c)).pipe(hb(6e3),Ga((function(e){return Sa(e)&&h.warn("Message send timeout, retry times %d",r),Z(e)})),Ka(1)).toPromise();case 12:return l=e.sent,f=l.code,this.log("The message has been acked, %o",{code:f}),e.abrupt("return",{code:f,retryTimes:r});case 18:if(e.prev=18,e.t0=e.catch(9),!(e.t0 instanceof pb&&n)){e.next=22;break}return e.abrupt("return",this.sendMessageToRetry(t,!1,r+1));case 22:throw e.t0;case 23:case"end":return e.stop()}}),e,this,[[9,18]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"initKeepAliveSender",value:function(){var e=this;this.lastLoginSockets.map((function(t){return t.pipe(Cc((function(t){return Bc(0,2750).pipe(ca((function(){e.incSeqIfNeeded(t.env),t.sendPacket("Ping",{ms:U.fromNumber(Date.now(),!0),seq:e.seq})})))})))})).forEach((function(t,n){var r=e.loginSocketSubs[n].keepAlive;void 0!==r&&r.unsubscribe(),e.loginSocketSubs[n].keepAlive=t.subscribe({error:function(){}})}))}},{key:"initKeepAliveReconnector",value:function(){var e=this;this.lastLoginSockets.map((function(e){return e.pipe(Cc((function(e){var t,n=!1,r=e.userJoin$.pipe(ca((function(){n=!0}))),i=e.input$.pipe(ca((function(e){"Ping"!==Li[e.uri].slice(0,-3)&&(n=!1)})));return Xb(Bc(15e3,1e4).pipe(Pt(e.receivedPacket),ca((function(r){r=ra(r,2),r=ra(r[1],2)[1],t!==r||n||e.forceReconnect(),t=r}))),r,i)})))})).forEach((function(t,n){var r=e.loginSocketSubs[n].keepAliveReconnector;void 0!==r&&r.unsubscribe(),e.loginSocketSubs[n].keepAliveReconnector=t.subscribe({error:function(){}})}))}},{key:"initLoginReceiver",value:function(){var e=this;this.lastLoginSockets.map((function(t){return t.pipe(Cc((function(t){return Xb(gb(t,"reconnect").pipe(ca(e.onSocketReconnect(t))),t.fromReceived("Message").pipe(ca(e.onMessage(t))),t.fromReceived("GroupEnterNotice").pipe(ca(e.onGroupEnterNotice())),t.fromReceived("GroupLeaveNotice").pipe(ca(e.onGroupLeaveNotice())),t.fromReceived("GroupCountNotice").pipe(ca(e.onGroupCountNotice())),t.fromReceived("GroupAttributeAlt").pipe(ca(e.onGroupAttributeAlt())),t.fromReceived("UserJoinNotice").pipe(ca(e.onUserNotice(S.PeerOnlineState.ONLINE))),t.fromReceived("UserQuitNotice").pipe(ca(e.onUserNotice(S.PeerOnlineState.OFFLINE))),t.fromReceived("UserWaitNotice").pipe(ca(e.onUserNotice(S.PeerOnlineState.UNREACHABLE)))).pipe(qf(void 0))})))})).forEach((function(t,n){e.loginSocketSubs[n].receivers.push(t.subscribe({error:function(){}}))}))}},{key:"requestSocketLogin",value:function(e,t,n){var r=this;return im(ad((function(){r.userJoinOptions=new is(t),e.sendPacket("UserJoin",{account:r.context.uid,instance:r.instanceId,opt:r.userJoinOptions.toLong(),seq:n,ticket:e.ticket})})),e.fromReceived("UserResp").pipe(aa((function(e){return n.eq(e.seq)})),ca((function(t){if(0!==(t=t.code))throw r.clearSockets(),r.logError("Connected to gateway success but the Rtm server rejected login"),new da(["Login failure. The response code from the RTM service is %d",t],jg);r.log("ENV_%d logged in",e.env)})),qf(e),hb(15e3))).pipe(wb((function(e){return void 0!==e})),Ga((function(e){return e instanceof pb&&r.warn("Login response timeout, rejoin: %s",t),Z(e)})))}},{key:"getSocketLoginObservables",value:function(e,t){var n=this;return e.map((function(e){return e.pipe(ca((function(e){0===e.listenerCount("socketUserDrop")&&e.on("socketUserDrop",(function(t){return n.onUserDrop(t,e)}))})),Cc((function(e,r){return n.incSeqIfNeeded(e.env),n.requestSocketLogin(e,0!==r,0===r?t:n.seq)})),pe())}))}},{key:"incSeqIfNeeded",value:function(e){if(![0,1].includes(e))throw new Fa({INVALID_ENV:"The env argument is not 0 or 1"});this.seqSentStatuses[e]&&(this.seq=this.seq.add(1),this.seqSentStatuses=[!1,!1]),this.seqSentStatuses[e]=!0}},{key:"incGetSeq",value:function(){return this.seq=this.seq.add(1),this.seqSentStatuses=[!0,!0],this.seq}},{key:"getLoginSockets",value:function(){for(var e=this.curLoginSockets,t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i}},{key:"emitMessage",value:function(e,n){var r=e.options,i=e.payload,o=e.src,a=e.dst,s=e.instance,u=e.dialogue,c=e.sequence,l=e.ms,f=e.MiscMap;this.dialogueSequenceLru.set(u.toString(),c),s="".concat(s,"-").concat(u,"#").concat(c),this.msgDedupLru.has(s)?this.warn("Env_%d: Messages out-of-order or not start with 1: %s",n,s):(this.msgDedupLru.set(s,void 0),n=new ae(r),this.lastLoginSockets.forEach(function(){var n=J(w.mark((function n(r){var i;return w.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,r.pipe(Ka(1)).toPromise();case 2:i=n.sent,t.sendMessageAck(e,i);case 4:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()),r=n.isZlibCompressed(),n.isInvitation()?(a=pa(r?nl(Xm(i,Uint8Array.of(0,0,0,0))):i),a=JSON.parse(a),this.log("The received invitation body is %o",a),this.emit("invitationMessage",{body:a,type:n.getInvitationType(),peerId:o,serverReceivedTs:l.toNumber()})):n.isTextMessage()?(f=n.isPeerTextMessage(),i=pa(r?nl(Xm(i,Uint8Array.of(0,0,0,0))):i),this.info("Received a %s %s text message from %s to %s, %s",r?" compressed":"",f?"peer":"channel",oa(o),oa(a),s),f?(o={text:i,peerId:o,properties:{serverReceivedTs:l.toNumber(),isOfflineMessage:n.isFromCache()}},this.emit("peerTextMessage",o)):this.emit("channelTextMessage",{channelId:a,memberId:o,text:i,properties:{serverReceivedTs:l.toNumber(),isOfflineMessage:!1}})):n.isRawMessage()?(u=n.isRawPeerMessage(),f=void 0===(f=f.description)?"":pa(f),i=r?nl(i):i,this.info("Received a %s %s raw message from %s to %s, %s",r?" compressed":"",u?"peer":"channel",oa(o),oa(a),s),u?(o={desc:f,raw:i,peerId:o,properties:{serverReceivedTs:l.toNumber(),isOfflineMessage:n.isFromCache()}},this.emit("peerRawMessage",o)):this.emit("channelRawMessage",{desc:f,raw:i,channelId:a,memberId:o,properties:{serverReceivedTs:l.toNumber(),isOfflineMessage:!1}})):(n.isImageMessage()||n.isFileMessage())&&(i=n.isPeerMessage(),this.info("Received a %s media message from %s to %s, %s",i?"peer":"channel",oa(o),oa(a),s),i?this.emit("peerMediaMessage",{messageType:n.isImageMessage()?"IMAGE":"FILE",details:f,peerId:o,properties:{serverReceivedTs:l.toNumber(),isOfflineMessage:n.isFromCache()}}):this.emit("channelMediaMessage",{messageType:n.isImageMessage()?"IMAGE":"FILE",details:f,memberId:o,channelId:a,properties:{serverReceivedTs:l.toNumber(),isOfflineMessage:n.isFromCache()}})))}},{key:"onSocketReconnect",value:function(e){var t=this;return function(){var n=[0,1].filter((function(t){return t!==e.env}))[0];(n=t.connection.curOpenSockets[n])&&!n.loggedIn&&t.emit("connectionLost")}}},{key:"onUserDrop",value:function(e,t){var n;e=e.code,eb("KickedOff",{code:0,elapse:fb(this.startTime),linkId:parseInt(t.name.split("-")[1],10),lts:U.fromNumber(Date.now()),server:t.address,serverCode:e,sid:Xa(this.instanceId),userId:this.context.uid},null!==(n=this.context.config.enableCloudProxy)&&void 0!==n&&n),10006===e||10001===e?this.warn("Login too often and kicked off, reconnect and login"):10009===e?(this.warn("The instance ID conflicts, reconnecting"),this.instanceId=Bg(),this.context.sid=Xa(this.instanceId),this.emit("instanceChanged",this.instanceId)):[11,14,15,16].includes(e)&&(this.emit("userDrop",e),this.clearSockets())}},{key:"clearSockets",value:function(){var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,n=1<arguments.length&&void 0!==arguments[1]&&arguments[1];[0,1].forEach((function(r){e.cleanLoginSubs(r,n),e.connection.closeSocket(r,t)}))}},{key:"onMessage",value:function(e){var t=this;return function(n){var r=n.dialogue,i=n.instance,o=n.sequence,a=n.options;if(n.src===t.context.uid)t.log("The message is from the local account, ignored");else{var s=r.toString(),u=t.dialPendingMsgSubjectMap.get(s);if(r="".concat(i,"-").concat(r,"#").concat(o),u)u.next(n),t.log("Env_%d: The dialogue has pending messages, next: %s",e.env,r);else{var c=t.dialogueSequenceLru.get(s);if(u=!c&&o.eq(1),i=void 0!==c&&o.sub(c).eq(1),u||i)t.emitMessage(n,e.env);else{if(c){if(o.lte(c))return;t.log("Env_%d: The message pended, the sequence is not continuous with the last: %s",e.env,r)}else t.log("Env_%d: The message pended, the first sequence is not equal to 1: %s",e.env,r);o=new Pa,t.dialPendingMsgSubjectMap.set(s,o);var l=o.pipe(Qs(Pk),xg((function(e,t){return[].concat(G(e),[t])}),[]),ba((function(e){return G(e).sort((function(e,t){return e=e.sequence,t=t.sequence,e.eq(t)?0:e.gt(t)?1:-1}))})),sm(1));a=!(a=new ae(a)).isFromCache()&&!a.isBufferedMessage(),l.pipe(ob(Bc(a?750:1500)),aa((function(e){if(2>e.length)return!1;for(var t=void 0===c?U.fromNumber(1,!0):c.add(1),n=0;n<e.length;t=t.add(1),n++)if(!e[n].sequence.eq(t))return!1;return!0})),wg((function(){t.dialPendingMsgSubjectMap.delete(s)}))).subscribe((function(n){n.forEach((function(n){t.emitMessage(n,e.env),t.log("Env_%d: The message queue has fully ordered, emitting: %s",e.env,"".concat(n.instance,"-").concat(n.dialogue,"#").concat(n.sequence))}))}),(function(n){n instanceof vg&&l.pipe(Ka(1)).subscribe((function(n){return n.forEach((function(n){t.log("Env_%d: The message pending queue expired, emitting: %s",e.env,"".concat(n.instance,"-").concat(n.dialogue,"#").concat(n.sequence)),t.emitMessage(n,e.env)}))}))})),o.next(n)}}}}}},{key:"onGroupEnterNotice",value:function(){var e=this;return function(t){e.emit("memberNotice",{channelId:t.group,seq:t.seq,instance:t.instance,memberId:t.user,type:"MemberJoined",size:t.size})}}},{key:"onGroupLeaveNotice",value:function(){var e=this;return function(t){e.emit("memberNotice",{channelId:t.group,seq:t.seq,instance:t.instance,memberId:t.user,type:"MemberLeft",size:t.size})}}},{key:"onGroupCountNotice",value:function(){var e=this;return function(t){e.emit("memberNotice",{channelId:t.group,seq:t.seq,instance:t.instance,type:"MemberCountUpdated",size:t.size})}}},{key:"onGroupAttributeAlt",value:function(){var e=this;return function(t){var n=t.group;t=ff(t,kD),e.emit("channelAttributesUpdated",ua({channelId:n},t))}}},{key:"onUserNotice",value:function(e){var t=this;return function(n){t.emit("peerOnlineStatusChanged",{peerId:n.user,instance:n.instance,seq:n.seq,state:e})}}}],[{key:"sendMessageAck",value:function(e,t){var n=new ae(e.options);(n.isInvitation()||n.isPeerMessage())&&t.sendPacket("Ack",{code:0,dialogue:e.dialogue,instance:e.instance,sequence:e.sequence})}}]),t}(tb());m(ls,"genTimeoutError",(function(e,t){return bb(void 0).pipe(cd(void 0===t?1e4:t),ba((function(){throw new db(["Request timed out after %ds",void 0===t?1e4:t],e)})))}));var ms,ol,pl=0,ql=0;Ud.v1=function(e,t,n){n=t&&n||0;var r=t||[],i=(e=e||{}).node||ms,o=void 0!==e.clockseq?e.clockseq:ol;if(null==i||null==o){var a=Jq();null==i&&(i=ms=[1|a[0],a[1],a[2],a[3],a[4],a[5]]),null==o&&(o=ol=16383&(a[6]<<8|a[7]))}a=void 0!==e.msecs?e.msecs:(new Date).getTime();var s=void 0!==e.nsecs?e.nsecs:ql+1,u=a-pl+(s-ql)/1e4;if(0>u&&void 0===e.clockseq&&(o=o+1&16383),(0>u||a>pl)&&void 0===e.nsecs&&(s=0),1e4<=s)throw Error("uuid.v1(): Can't create more than 10M uuids/sec");for(pl=a,ql=s,ol=o,e=(1e4*(268435455&(a+=122192928e5))+s)%4294967296,r[n++]=e>>>24&255,r[n++]=e>>>16&255,r[n++]=e>>>8&255,r[n++]=255&e,e=a/4294967296*1e4&268435455,r[n++]=e>>>8&255,r[n++]=255&e,r[n++]=e>>>24&15|16,r[n++]=e>>>16&255,r[n++]=o>>>8|128,r[n++]=255&o,o=0;6>o;++o)r[n+o]=i[o];return t||Kq(r)},Ud.v4=Ud;var rl=Ph(),vd,bf=S.LocalInvitationFailureReason,Ba=S.LocalInvitationState,lD=(vd=function(e){function t(e,i,o){W(this,t);var a=r.call(this,o,"RtmLocalInvitation",!0);return m(n(a),"state",Ba.IDLE),m(n(a),"localInvitationEnd$",Ca(gb(n(a),"LocalInvitationAccepted"),gb(n(a),"LocalInvitationRefused"),gb(n(a),"LocalInvitationFailure"),gb(n(a),"LocalInvitationCanceled")).pipe(Ka(1))),m(n(a),"callId",Ud.v4()),m(n(a),"_content",""),m(n(a),"_channelId",""),m(n(a),"_response",""),m(n(a),"calleeId",void 0),m(n(a),"logger",void 0),m(n(a),"getSession",void 0),a.calleeId=e,a.getSession=i,a.logger=o,a}la(t,e);var r=ma(t);return Ha(t,[{key:"channelId",get:function(){return this._channelId},set:function(e){this.state!==Ba.IDLE?this.info("set channelId only allow before invitation sent to remote"):(this.log("set channelId for %s",this.callId),this._channelId=e)}},{key:"content",get:function(){return this._content},set:function(e){this.log("set content for %s",this.callId),this._content=e}},{key:"response",get:function(){return this._response},set:function(e){throw new I('Cannot set the "response" of the LocalInvitation instance.',xc)}},{key:"send",value:function(){var e,t=this;if(this.state===Ba.SENT_TO_REMOTE||this.state===Ba.RECEIVED_BY_REMOTE)throw new K("The local invitation send failure. The call invitation has already been sent.",gA);if(this.isLocalInvitationEnd())throw new K("The local invitation send failure. The call invitation has ended.",Ih);if(0<this._channelId.length&&!za(this._channelId))throw new I("Illegal invitation channel ID",xc);if(!za(this.calleeId))throw new I("Illegal invitation callee user ID",xc);if(8192<Ig(this._content))throw new I('The length of the "content" overflows. The number of bytes representing content must not exceed 8 × 1024 if encoded in UTF-8.',xc);this.state=Ba.SENT_TO_REMOTE,ad(J(w.mark((function n(){var r,i,o;return w.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.getSession().sendInvitationMessage({peerId:t.calleeId,callId:t.callId,extra:t._content,type:"CallInvite",channelId:t._channelId});case 2:if(r=n.sent,i=r.hasPeerReceived,o=r.hasReSent,!t.isLocalInvitationEnd()){n.next=7;break}throw new db("send invitation timeout");case 7:if(t.log("The local invitation has sent to the callee"),i||o){n.next=11;break}throw e=new rl({PEER_NOT_ONLINE:"The peer of the invitation is not online"});case 11:if(i){n.next=14;break}throw e=new rl({RESENT_AND_OFFLINE:"Resent and the peer of the invitation is not online"});case 14:case"end":return n.stop()}}),n)})))).pipe(oe((function(e){return e.pipe(ca((function(e){if(!(e instanceof rl))throw e})),cd(2e3))})),hb(3e4),Ga((function(e){return Sa(e)&&t.warn("local invitation ack timed out"),Z(e)})),ob(this.localInvitationEnd$)).subscribe({next:function(){t.state===Ba.RECEIVED_BY_REMOTE?t.log('The local invitation state is already "RECEIVED_BY_REMOTE", skipped emitting "LocalInvitationReceivedByPeer"'):t.state!==Ba.SENT_TO_REMOTE?t.log("The invitation has ended, skipped emitting the %s event","LocalInvitationReceivedByPeer"):(t.info("The peer received the local invitation %s.",t.callId),t.state=Ba.RECEIVED_BY_REMOTE,t.emit("LocalInvitationReceivedByPeer"),t.localInvitationEnd$.pipe(hb(6e4),Ga((function(e){return Sa(e)&&t.warn("local invitation expired"),Z(e)}))).subscribe({error:function(){t.state=Ba.FAILURE,t.emit("LocalInvitationFailure",bf.INVITATION_EXPIRE)}}))},error:function(n){t.isLocalInvitationEnd()?t.log("The invitation has ended, skipped emitting the %s event","LocalInvitationFailure"):(t.state=Ba.FAILURE,Sa(n)&&e?"PEER_NOT_ONLINE"===e.code?t.emit("LocalInvitationFailure",bf.PEER_OFFLINE):"RESENT_AND_OFFLINE"===e.code&&t.emit("LocalInvitationFailure",bf.PEER_NO_RESPONSE):Sa(n)?t.emit("LocalInvitationFailure",bf.PEER_NO_RESPONSE):"RtmInvalidStatusError"===n.name?t.emit("LocalInvitationFailure",bf.NOT_LOGGEDIN):t.emit("LocalInvitationFailure",bf.UNKNOWN))}})}},{key:"cancel",value:function(){if(this.isLocalInvitationEnd())throw new K("The local invitation cancel failure",Ih);if(this.state===Ba.IDLE)throw new K("The local invitation has not been sent",fA);if(8192<Ig(this._content))throw new I('The length of the "content" overflows. The number of bytes representing content must not exceed 8 × 1024 if encoded in UTF-8.',xc);this.getSession().sendInvitationMessage({callId:this.callId,peerId:this.calleeId,type:"CallCancel",channelId:this._channelId,extra:this._content}),this.state=Ba.CANCELED,this.emit("LocalInvitationCanceled")}},{key:"onAcceptReceived",value:function(e){if(this.isLocalInvitationEnd()&&this.state!==Ba.ACCEPTED_BY_REMOTE)this.log("The invitation has ended, skipped emitting the %s event","LocalInvitationAccepted");else{if(this.state===Ba.IDLE)throw new K("the local have not sent the invitation, how can remote accept it?");this.getSession().sendInvitationMessage({callId:this.callId,isAcceptAck:!0,type:"CallAccept",peerId:this.calleeId,channelId:this.channelId}),this.state===Ba.ACCEPTED_BY_REMOTE?this.log("already in ACCEPTED_BY_REMOTE state, ignore emit ACCEPTED_BY_REMOTE"):(this.state===Ba.SENT_TO_REMOTE&&(this.log("receive LocalInvitationAccepted before remote response to the invitation"),this.state=Ba.RECEIVED_BY_REMOTE,this.emit("LocalInvitationReceivedByPeer")),this.state=Ba.ACCEPTED_BY_REMOTE,this._response=e,this.emit("LocalInvitationAccepted",e))}}},{key:"onRefuseReceived",value:function(e){if(this.isLocalInvitationEnd())this.log("The invitation has ended, skipped emitting the %s event","LocalInvitationRefused");else{if(this.state===Ba.IDLE)throw new K("the local have not sent the invitation, how can remote refuse it?");this.state===Ba.SENT_TO_REMOTE&&(this.log("receive LocalInvitationRefused before remote response to the invitation"),this.state=Ba.RECEIVED_BY_REMOTE,this.emit("LocalInvitationReceivedByPeer")),this._response=e,this.state=Ba.REFUSED_BY_REMOTE,this.emit("LocalInvitationRefused",e)}}},{key:"isLocalInvitationEnd",value:function(){return[Ba.CANCELED,Ba.FAILURE,Ba.ACCEPTED_BY_REMOTE,Ba.REFUSED_BY_REMOTE].includes(this.state)}}]),t}(tb()),fa(vd.prototype,"send",[Nb],Object.getOwnPropertyDescriptor(vd.prototype,"send"),vd.prototype),fa(vd.prototype,"cancel",[Nb],Object.getOwnPropertyDescriptor(vd.prototype,"cancel"),vd.prototype),vd),Rh=S.RemoteInvitationFailureReason,kb=S.RemoteInvitationState,mD=function(e){function t(e){var i=e.invitationChannel,o=e.extraContent,a=e.callId,s=e.callerId,u=e.logger;e=e.getSession,W(this,t);var c=r.call(this,u,"RtmRemoteInvitation",!0);return m(n(c),"state",kb.INVITATION_RECEIVED),m(n(c),"remoteInvitationEnd$",Ca(gb(n(c),"RemoteInvitationCanceled"),gb(n(c),"RemoteInvitationRefused"),gb(n(c),"RemoteInvitationAccepted"),gb(n(c),"RemoteInvitationFailure")).pipe(Ka(1))),m(n(c),"callerId",void 0),m(n(c),"callId",void 0),m(n(c),"_getSession",void 0),m(n(c),"logger",void 0),m(n(c),"_content",void 0),m(n(c),"_channelId",void 0),m(n(c),"_response",""),c._channelId=i,c._content=o,c.callId=a,c.callerId=s,c._getSession=e,c.logger=u,c.remoteInvitationEnd$.pipe(hb(6e4),Ga((function(e){return Sa(e)&&c.warn("Remote invitation expired"),Z(e)}))).subscribe({error:function(){c.state=kb.FAILURE,c.emit("RemoteInvitationFailure",Rh.INVITATION_EXPIRE)}}),c}la(t,e);var r=ma(t);return Ha(t,[{key:"channelId",get:function(){return this._channelId},set:function(e){throw new I('Cannot set the "response" of the RemoteInvitation instance.',xc)}},{key:"content",get:function(){return this._content},set:function(e){throw new I('Cannot set the "content" of the RemoteInvitation instance.',xc)}},{key:"response",get:function(){return this._response},set:function(e){this._response=e}},{key:"accept",value:function(){var e,t=this;if(this.isRemoteInvitationEnd())throw new K("The local invitation has ended. Cannot accept.",Ih);if(this.state===kb.ACCEPT_SENT_TO_LOCAL)throw new K("The remote invitation is accepting. Cannot do the operation.",Qq);if(8192<Ig(this._response))throw new I('The length of the "response" overflows. The number of bytes representing content must not exceed 8 × 1024 if encoded in UTF-8.',xc);this.state=kb.ACCEPT_SENT_TO_LOCAL,Xb(mm(1e3).pipe(cb((function(){return ad(J(w.mark((function e(){return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",t._getSession().sendInvitationMessage({peerId:t.callerId,callId:t.callId,extra:t.response,type:"CallAccept",isAcceptAck:!1,channelId:t.channelId}));case 1:case"end":return e.stop()}}),e)}))))})),wb((function(t){return e=t.hasPeerReceived})),Ka(1)),gb(this,"RemoteInvitationAccepted")).pipe(hb(5e3),ob(this.remoteInvitationEnd$)).subscribe({error:function(n){if(t.logError(n),t.state=kb.FAILURE,Sa(n))switch(e){case void 0:case!0:return void t.emit("RemoteInvitationFailure",Rh.ACCEPT_FAILURE);case!1:return void t.emit("RemoteInvitationFailure",Rh.PEER_OFFLINE)}t.emit("RemoteInvitationFailure",Rh.UNKNOWN)}})}},{key:"refuse",value:function(){if(this.state===kb.ACCEPT_SENT_TO_LOCAL)throw new K("The remote invitation is accepting. Cannot do the operation.",Qq);if(this.isRemoteInvitationEnd())throw new K("The invitation is end. Cannot refuse",Ih);if(8192<Ig(this._response))throw new I('The length of the "response" overflows. The number of bytes representing content must not exceed 8 × 1024 if encoded in UTF-8.',xc);this._getSession().sendInvitationMessage({peerId:this.callerId,callId:this.callId,extra:this.response,type:"CallReject",channelId:this.channelId}),this.state=kb.REFUSED,this.emit("RemoteInvitationRefused")}},{key:"onCancelReceived",value:function(e){this.isRemoteInvitationEnd()?this.log("The invitation has ended, skipped emitting the %s event","RemoteInvitationCanceled"):(this.state===kb.ACCEPT_SENT_TO_LOCAL&&this.log("caller canceled before receive accept"),this._content=e,this.state=kb.CANCELED,this.emit("RemoteInvitationCanceled",e))}},{key:"onAcceptAckReceived",value:function(){this.state!==kb.ACCEPT_SENT_TO_LOCAL?this.log("The invitation has ended, skipped emitting the %s event","ori:".concat(this.state,", to: RemoteInvitationAccepted")):(this.state=kb.ACCEPTED,this.emit("RemoteInvitationAccepted"))}},{key:"isRemoteInvitationEnd",value:function(){return[kb.ACCEPTED,kb.REFUSED,kb.CANCELED,kb.FAILURE].includes(this.state)}}]),t}(tb()),nD=function(e){function t(e,i){W(this,t);var o=r.call(this,i,"InvitationManager");return m(n(o),"getSession",void 0),m(n(o),"invitationDispatcher",new ea.EventEmitter),m(n(o),"outgoingLocalInvitations",new Map),m(n(o),"receivedRemoteInvitations",new tc(void 0,{maxlen:1e4})),m(n(o),"logger",void 0),o.getSession=cn(e),o.logger=i,o.invitationDispatcher.on("remoteInvitationToManager",(function(e){var t=e.callId,n=e.extra,r=e.callerId;e=e.channelId,o.receivedRemoteInvitations.has(t)||((n=new mD({callerId:r,callId:t,getSession:o.getSession,logger:i,extraContent:n,invitationChannel:e})).remoteInvitationEnd$.subscribe((function(){o.receivedRemoteInvitations.delete(t)})),o.receivedRemoteInvitations.set(t,n),o.emit("remoteInvitationInstance",n))})),o.invitationDispatcher.on("acceptAckToRemoteInvitation",(function(e){(e=o.receivedRemoteInvitations.get(e.callId))&&e.onAcceptAckReceived()})),o.invitationDispatcher.on("cancelToRemoteInvitation",(function(e){var t=e.extra;(e=o.receivedRemoteInvitations.get(e.callId))&&e.onCancelReceived(t)})),o.invitationDispatcher.on("acceptToLocalInvitation",(function(e){var t=e.extra;(e=o.outgoingLocalInvitations.get(e.callId))&&e.onAcceptReceived(t)})),o.invitationDispatcher.on("refuseToLocalInvitation",(function(e){var t=e.extra;(e=o.outgoingLocalInvitations.get(e.callId))&&e.onRefuseReceived(t)})),o}la(t,e);var r=ma(t);return Ha(t,[{key:"invitationMessageHandler",value:function(e){var t=e.body,n=t.callId,r=t.extra;r=void 0===r?"":r;var i=t.type,o=void 0===(t=t.channel)?"":t,a=e.type;switch(t=e.peerId,e=e.serverReceivedTs,a){case"CallAccept":"ack"===i?this.invitationDispatcher.emit("acceptAckToRemoteInvitation",{callId:n}):"request"===i&&this.invitationDispatcher.emit("acceptToLocalInvitation",{callId:n,extra:r});break;case"CallInvite":this.invitationDispatcher.emit("remoteInvitationToManager",{callId:n,callerId:t,extra:r,channelId:o});break;case"CallCancel":if("0"===n){n="".concat("AgoraRTMLegacyEndcallCompatibleMessagePrefix","_").concat(o,"_").concat(r),this.getSession().emit("peerTextMessage",{peerId:t,properties:{serverReceivedTs:e,isOfflineMessage:!1},text:n});break}this.invitationDispatcher.emit("cancelToRemoteInvitation",{callId:n,extra:r});break;case"CallReject":this.invitationDispatcher.emit("refuseToLocalInvitation",{callId:n,extra:r});break;default:throw Im("invitationType",a)}}},{key:"genLocalInvitation",value:function(e){var t=this,n=new lD(e,this.getSession,this.logger);return n.localInvitationEnd$.subscribe((function(){t.outgoingLocalInvitations.delete(n.callId)})),this.outgoingLocalInvitations.set(n.callId,n),n}}]),t}(tb()),oD=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return lb(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),qC(e,t,{leading:r,maxWait:t,trailing:i})},ub,cf;!function(e){e[e.JOINED=0]="JOINED",e[e.LEFT=1]="LEFT"}(cf||(cf={}));var ns=S.ConnectionState,pD=(ub=function(e){function t(e,i,o,a){W(this,t);var s=r.call(this,a,"RtmChannel",!0);return m(n(s),"onMemberCountUpdated",oD((function(e){e!==s.memberCount&&(s.memberCount=e,s.emit("MemberCountUpdated",e))}),1e3)),m(n(s),"getSession",void 0),m(n(s),"memberCount",0),m(n(s),"memberJoinedLru",new tc(void 0,{maxlen:1e4})),m(n(s),"memberLeftLru",new tc(void 0,{maxlen:1e4})),m(n(s),"memberJoinStateLru",new tc(void 0,{maxlen:1e4})),m(n(s),"attributesSeqLru",new tc(void 0,{maxlen:1e4})),m(n(s),"channelId",void 0),m(n(s),"client",void 0),m(n(s),"onAttributesUpdated",(function(e){var t=e.channelId,n=e.attributeMaps,r=e.seq;e=e.instance.toString();var i=s.attributesSeqLru.get(e);if((!i||r.greaterThan(i))&&(s.attributesSeqLru.set(e,r),t===s.channelId)){for(t={},r=0;r<n.length;r++){var o=n[r];e=o.key,i=o.ms;var a=o.value;if(o=o.origin,"string"!=typeof e||!U.isLong(i)||"string"!=typeof a||!za(o))break;t[e]={value:a,lastUpdateUserId:o,lastUpdateTs:i.toNumber()}}s.emit("AttributesUpdated",t)}})),m(n(s),"onChannelTextMessage",(function(e){var t=e.memberId,n=e.text,r=e.properties;e.channelId===s.channelId&&s.emit("ChannelMessage",{text:n,messageType:S.MessageType.TEXT},t,r)})),m(n(s),"onChannelMediaMessage",(function(e){var t=e.memberId,n=e.properties,r=e.details,i=e.messageType;e.channelId===s.channelId&&("FILE"===i?s.emit("ChannelMessage",{messageType:S.MessageType.FILE,size:parseInt(pa(r.media_size),10),description:pa(r.media_description),fileName:pa(r.media_filename),mediaId:pa(r.media_id),thumbnail:new Blob([r.media_thumbnail])},t,n):"IMAGE"===i&&s.emit("ChannelMessage",{messageType:S.MessageType.IMAGE,size:parseInt(pa(r.media_size),10),description:pa(r.media_description),fileName:pa(r.media_filename),mediaId:pa(r.media_id),thumbnail:new Blob([r.media_thumbnail]),height:parseInt(pa(r.media_height),10),width:parseInt(pa(r.media_width),10),thumbnailHeight:parseInt(pa(r.media_thumbnailheight),10),thumbnailWidth:parseInt(pa(r.media_thumbnailwidth),10)},t,n))})),m(n(s),"onChannelRawMessage",(function(e){var t=e.desc,n=e.raw,r=e.memberId,i=e.properties;e.channelId===s.channelId&&s.emit("ChannelMessage",{messageType:S.MessageType.RAW,rawMessage:n,description:t},r,i)})),m(n(s),"onMemberNotice",(function(e){var t=e.memberId,n=e.type,r=e.size;if(e.channelId===s.channelId){var i=e.instance.toString();e=e.seq.toString();var o={MemberLeft:s.memberLeftLru,MemberJoined:s.memberJoinedLru,MemberCountUpdated:void 0}[n];if(o){if(o.has(i+e))return void s.log("received duplicated %s notice (seq: %s), channel '%s', member '%s'",n,e,oa(s.channelId),oa(t||""));if(o.set(i+e,void 0),"string"!=typeof t)return;if(t!==s.getSession().context.uid){if((i=s.memberJoinStateLru.get(t))===cf.JOINED&&"MemberJoined"===n)return void s.log("received duplicated %s state (seq: %s), channel '%s', member '%s'",n,e,oa(s.channelId),oa(t||""));if(i===cf.LEFT&&"MemberLeft"===n)return void s.log("received duplicated %s state (seq: %s), channel '%s', member '%s'",n,e,oa(s.channelId),oa(t||""))}s.memberJoinStateLru.set(t,"MemberJoined"===n?cf.JOINED:cf.LEFT)}s.info("Channel %s - %s, memberId: %s",n,oa(s.channelId),"MemberCountUpdated"===n?"[unknown]":oa(t||"")),i=t===s.getSession().context.uid,"MemberLeft"===n&&za(t)||"MemberJoined"===n&&za(t)?(i||s.emit(n,t),s.onMemberCountUpdated(r)):"MemberCountUpdated"===n&&"number"==typeof r&&s.onMemberCountUpdated(r)}})),s.getSession=cn(i),s.channelId=e,s.client=o,s.info("A channel created, id %s",oa(e)),s}la(t,e);var r=ma(t);return Ha(t,[{key:"join",value:function(){var e=J(w.mark((function e(){var t,n,r,i,o,a,s;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(za(this.channelId)){e.next=2;break}throw new I(["The %s in the arguments is invalid","channelId"],hA);case 2:e.prev=2,t=this.getSession(),e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(2),new K("The client is not logged in. Cannot do the operation",Vq);case 9:if(!t.joinedChannels.has(this)){e.next=12;break}throw eb("ChnJoin",{cname:this.channelId,lts:U.fromNumber(Date.now()),userId:t.context.uid,elapse:fb(t.startTime),errCode:Uq,sid:Xa(t.instanceId)},null!==(n=this.client.context.config.enableCloudProxy)&&void 0!==n&&n),new K("The channel has joined. Cannot rejoin",Uq);case 12:if(e.prev=12,this.log("Joining the channel %s",oa(this.channelId)),!this.hasOtherChannelJoined()){e.next=17;break}throw eb("ChnJoin",{cname:this.channelId,lts:U.fromNumber(Date.now()),userId:t.context.uid,elapse:fb(t.startTime),errCode:Wq,sid:Xa(t.instanceId)},null!==(o=this.client.context.config.enableCloudProxy)&&void 0!==o&&o),new K("A channel of the same channel ID has already joined. Cannot rejoin",Wq);case 17:if(20!==t.joinedChannels.size){e.next=20;break}throw eb("ChnJoin",{cname:this.channelId,lts:U.fromNumber(Date.now()),userId:t.context.uid,elapse:fb(t.startTime),errCode:Tq,sid:Xa(t.instanceId)},null!==(a=this.client.context.config.enableCloudProxy)&&void 0!==a&&a),new ib("The joined channels has exceeded the limit of 20",Tq);case 20:return eb("ChnJoin",{cname:this.channelId,lts:U.fromNumber(Date.now()),userId:t.context.uid,elapse:fb(t.startTime),errCode:0,sid:Xa(t.instanceId)},null!==(r=this.client.context.config.enableCloudProxy)&&void 0!==r&&r),e.next=23,t.requestChannelJoin(this,this.channelId);case 23:eb("ChnJoinRes",{cname:this.channelId,lts:U.fromNumber(Date.now()),elapse:fb(t.startTime),errCode:0,sid:Xa(t.instanceId),serverErrCode:0,userId:t.context.uid},null!==(i=this.client.context.config.enableCloudProxy)&&void 0!==i&&i),this.info("The channel %s joined successfully",oa(this.channelId)),t.on("channelTextMessage",this.onChannelTextMessage),t.on("channelRawMessage",this.onChannelRawMessage),t.on("channelMediaMessage",this.onChannelMediaMessage),t.on("memberNotice",this.onMemberNotice),t.on("channelAttributesUpdated",this.onAttributesUpdated),e.next=41;break;case 32:if(e.prev=32,e.t1=e.catch(12),this.logError(e.t1),!sa(e.t1)){e.next=37;break}throw e.t1;case 37:if(!Sa(e.t1)){e.next=40;break}throw eb("ChnJoinRes",{cname:this.channelId,lts:U.fromNumber(Date.now()),elapse:fb(t.startTime),errCode:Sq,sid:Xa(t.instanceId),serverErrCode:0,userId:t.context.uid},null!==(s=this.client.context.config.enableCloudProxy)&&void 0!==s&&s),new db(["Join channel %s timed out",oa(this.channelId)],Sq);case 40:throw new Wc(["The channel %s join failure",oa(this.channelId)],{code:Rq,originalError:e.t1});case 41:case"end":return e.stop()}}),e,this,[[2,6],[12,32]])})));return function(){return e.apply(this,arguments)}}()},{key:"leave",value:function(){var e=J(w.mark((function e(){var t,n,r,i;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,n=this.getSession(),e.next=7;break;case 4:throw e.prev=4,e.t0=e.catch(0),new K("The client is not logged in. Cannot do the operation",jA);case 7:if(n.joinedChannels.has(this)){e.next=9;break}throw new K("The channel does not join. Cannot do the operation",iA);case 9:e.prev=9,n.requestChannelLeave(this,this.channelId),this.memberLeftLru.empty(),this.memberJoinedLru.empty(),this.attributesSeqLru.empty(),this.memberJoinStateLru.empty(),this.memberCount=0,n.removeListener("channelTextMessage",this.onChannelTextMessage),n.removeListener("channelRawMessage",this.onChannelRawMessage),n.removeListener("channelMediaMessage",this.onChannelMediaMessage),n.removeListener("memberNotice",this.onMemberNotice),n.removeListener("channelAttributesUpdated",this.onAttributesUpdated),e.next=32;break;case 23:if(e.prev=23,e.t1=e.catch(9),this.logError(e.t1),!sa(e.t1)){e.next=30;break}throw void 0===e.t1.code&&(e.t1.code=Yq),eb("ChnLeave",{cname:this.channelId,lts:U.fromNumber(Date.now()),elapse:fb(n.startTime),errCode:Yq,sid:Xa(n.instanceId),userId:n.context.uid},null!==(i=this.client.context.config.enableCloudProxy)&&void 0!==i&&i),e.t1;case 30:throw eb("ChnLeave",{cname:this.channelId,lts:U.fromNumber(Date.now()),elapse:fb(n.startTime),errCode:Xq,sid:Xa(n.instanceId),userId:n.context.uid},null!==(r=this.client.context.config.enableCloudProxy)&&void 0!==r&&r),new Wc("The channel leave failure",{code:Xq,originalError:e.t1});case 32:eb("ChnLeave",{cname:this.channelId,lts:U.fromNumber(Date.now()),elapse:fb(n.startTime),errCode:0,sid:Xa(n.instanceId),userId:n.context.uid},null!==(t=this.client.context.config.enableCloudProxy)&&void 0!==t&&t);case 33:case"end":return e.stop()}}),e,this,[[0,4],[9,23]])})));return function(){return e.apply(this,arguments)}}()},{key:"sendMessage",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a,s=this,u=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=1<u.length&&void 0!==u[1]?u[1]:{},r=n.enableHistoricalMessaging,i=void 0!==r&&r,Tm(t,Hh),e.prev=2,o=this.getSession(),e.next=9;break;case 6:throw e.prev=6,e.t0=e.catch(2),new K("The client is not logged in. Cannot do the operation",ig);case 9:if(o.joinedChannels.has(this)){e.next=11;break}throw new K("The channel does not join. Cannot do the operation",ig);case 11:if(this.client.connectionState!==ns.RECONNECTING){e.next=16;break}return a=Date.now(),e.next=15,new Promise((function(e,n){var r=function(){var r=J(w.mark((function r(){var u;return w.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return u=Date.now()-a,r.prev=1,r.next=4,Gg({message:t,peerId:s.channelId,toPeer:!1,session:s.getSession(),errorCodes:{NOT_LOGGED_IN:ig,TOO_OFTEN:Mq},diff:u,logger:s.logger,options:{enableHistoricalMessaging:i,enableOfflineMessaging:!1}});case 4:e(),r.next=12;break;case 7:r.prev=7,r.t0=r.catch(1),Sa(r.t0)&&n(new db(Yd(s.name,"sendMessageToPeer",1e4),Yk)),sa(r.t0)&&n(r.t0),n(new da("Channel message send failure",{code:hg,originalError:r.t0}));case 12:return r.prev=12,clearTimeout(o),r.finish(12);case 15:case"end":return r.stop()}}),r,null,[[1,7,12,15]])})));return function(){return r.apply(this,arguments)}}();s.client.internalEmitter.once("RECONNECTED",r);var o=setTimeout((function(){s.client.internalEmitter.off("RECONNECTED",r),n(new db(Yd(s.name,"sendMessageToPeer",1e4),Yk))}),9e3)}));case 15:return e.abrupt("return");case 16:if(this.client.connectionState===ns.CONNECTED){e.next=18;break}throw new K("The client is not logged in. Cannot do the operation",ig);case 18:return e.prev=18,e.next=21,Gg({message:t,peerId:this.channelId,toPeer:!1,session:this.getSession(),errorCodes:{NOT_LOGGED_IN:ig,TOO_OFTEN:Mq},diff:0,logger:this.logger,options:{enableHistoricalMessaging:i,enableOfflineMessaging:!1}});case 21:e.next=31;break;case 23:if(e.prev=23,e.t1=e.catch(18),!Sa(e.t1)){e.next=27;break}throw new db(Yd(this.name,"sendMessage",1e4),Yk);case 27:if(!sa(e.t1)){e.next=30;break}throw this.logError(e.t1),e.t1;case 30:throw new Wc("The channel message send failure",hg);case 31:case"end":return e.stop()}}),e,this,[[2,6],[18,23]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getMembers",value:function(){var e=J(w.mark((function e(){var t,n,r;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,e.prev=1,t=this.getSession(),e.next=8;break;case 5:throw e.prev=5,e.t0=e.catch(1),new K("The client is not logged in. Cannot do the operation",eA);case 8:if(t.joinedChannels.has(this)){e.next=10;break}throw new K("The channel does not join. Cannot do the operation",dA);case 10:return n=this.getSession().requestChannelMemberList(this.channelId),e.next=13,n.pipe(ba((function(e){return e.memberInfos.map((function(e){return e.account}))}))).toPromise();case 13:return r=e.sent,this.info("Channel %s - get members success, %o",oa(this.channelId),r.map(oa)),e.abrupt("return",r);case 18:if(e.prev=18,e.t1=e.catch(0),!sa(e.t1)){e.next=23;break}throw this.logError(e.t1),e.t1;case 23:throw new Wc("The channel members get failure",bA);case 24:case"end":return e.stop()}}),e,this,[[0,18],[1,5]])})));return function(){return e.apply(this,arguments)}}()},{key:"hasOtherChannelJoined",value:function(){var e=this;return!this.getSession().joinedChannels.has(this)&&Array.from(this.getSession().joinedChannels).some((function(t){return t.channelId===e.channelId}))}}]),t}(tb()),fa(ub.prototype,"join",[Nb],Object.getOwnPropertyDescriptor(ub.prototype,"join"),ub.prototype),fa(ub.prototype,"leave",[Nb],Object.getOwnPropertyDescriptor(ub.prototype,"leave"),ub.prototype),fa(ub.prototype,"sendMessage",[Nb],Object.getOwnPropertyDescriptor(ub.prototype,"sendMessage"),ub.prototype),fa(ub.prototype,"getMembers",[Ma],Object.getOwnPropertyDescriptor(ub.prototype,"getMembers"),ub.prototype),ub),E,Eb=S.ConnectionChangeReason,T=S.ConnectionState,os={DISCONNECTED:1,CONNECTING:2,CONNECTED:3,RECONNECTING:4,ABORTED:5},qD={LOGIN:1,LOGIN_SUCCESS:2,LOGIN_FAILURE:3,LOGIN_TIMEOUT:4,INTERRUPTED:5,LOGOUT:6,BANNED_BY_SERVER:7,REMOTE_LOGIN:8},rD=(E=function(e){function t(e,i,o,a){W(this,t);var s=r.call(this,i,"RtmClient",!0);return m(n(s),"connectionState",T.DISCONNECTED),m(n(s),"internalEmitter",new ea),m(n(s),"context",void 0),m(n(s),"attributes",{}),m(n(s),"loginPromise",void 0),m(n(s),"attributeDrafts",new Set),m(n(s),"session",void 0),m(n(s),"lastLoginTime",void 0),m(n(s),"reconnId",0),m(n(s),"channelAttributesCacheLru",new tc(void 0,{maxlen:1e4})),m(n(s),"invitationManager",void 0),m(n(s),"subscribedPeerStatusCache",{}),m(n(s),"peerStatusSeqLru",new tc(void 0,{maxlen:1e4})),m(n(s),"peerUnreachableTimers",{}),m(n(s),"mediaTaskManager",void 0),m(n(s),"setParameters",void 0),m(n(s),"updateConfig",void 0),m(n(s),"userDropHandler",(function(e){if(s.connectionState!==T.ABORTED)switch(e){case 11:s.logError("Kicked off by remote session"),s.onConnectionStateChanged(T.ABORTED,Eb.REMOTE_LOGIN);break;case 14:case 15:case 16:s.logError("Server banned because of illegal ".concat({14:"User ID",15:"IP",16:"Channel Name"}[e])),s.onConnectionStateChanged(T.ABORTED,Eb.BANNED_BY_SERVER);break;default:s.logError("User kicked off for unknown code: ".concat(e)),s.onConnectionStateChanged(T.ABORTED,Eb.INTERRUPTED)}})),s.context=new ZC(e,o,i),s.mediaTaskManager=new fs(i),s.context.config=o,s.internalEmitter.setMaxListeners(512),s.setParameters=a.bind(n(s)),s.updateConfig=a.bind(n(s)),s.invitationManager=new nD((function(){return s.session}),i),s.invitationManager.on("remoteInvitationInstance",(function(e){s.emit("RemoteInvitationReceived",e)})),s}la(t,e);var r=ma(t);return Ha(t,[{key:"renewToken",value:function(){var e=J(w.mark((function e(t){var n,r,i,o=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("string"==typeof t&&0!==t.length){e.next=2;break}throw new I("Invalid argument",rA);case 2:if(this.connectionState!==T.ABORTED){e.next=5;break}return e.next=5,new Promise((function(){}));case 5:if(this.connectionState===T.CONNECTED||this.connectionState===T.RECONNECTING){e.next=7;break}throw new K("The client is not logged in",uA);case 7:if(void 0!==this.session){e.next=9;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 9:return e.prev=9,n=this.context.token,this.context.token=t,e.next=14,this.session.connection.apClient.getApEdgeInfo$(!1).pipe(Dd((function(){return Error("No available edge address to connect")})),oe((function(e){return e.pipe(ca((function(e){if(sa(e))throw e})),cd(2500),Ka(4))})),Ka(1),hb(2e4),Ga((function(e){return Sa(e)&&o.warn("renewToken timed out"),Z(e)}))).toPromise();case 14:r=e.sent,i=r.ticket,e.next=27;break;case 18:if(e.prev=18,e.t0=e.catch(9),this.context.token=n,e.t0.code!==$q&&e.t0.code!==ar){e.next=23;break}throw new Ye("Invalid token",tA);case 23:if(e.t0.code!==Kh){e.next=25;break}throw new Ye("The token expired",sA);case 25:if(!Sa(e.t0)){e.next=27;break}throw new db("Renew token timed out",qA);case 27:this.session.curLoginSockets.filter((function(e){return void 0!==e})).forEach((function(e){return e.ticket=i}));case 28:case"end":return e.stop()}}),e,this,[[9,18]])})));return function(t){return e.apply(this,arguments)}}()},{key:"queryPeersOnlineStatus",value:function(){var e=J(w.mark((function e(t){var n,r,i=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connectionState===T.CONNECTED){e.next=2;break}throw new K("The client is not logged in",pA);case 2:if(void 0!==this.session){e.next=4;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 4:if(!(!Array.isArray(t)||0===t.length||t.some((function(e){return!za(e)}))||256<t.length)){e.next=6;break}throw new I("invalid arguments",er);case 6:return e.next=8,this.session.requestPeersOnlineStatus(t).toPromise();case 8:return n=e.sent,r=uc(Jk(n.userInfos,"account"),(function(e){return!!e.ts})),Object.keys(r).forEach((function(e){if(e in i.subscribedPeerStatusCache&&i.subscribedPeerStatusCache[e]!==S.PeerOnlineState.UNREACHABLE){var t=r[e]?S.PeerOnlineState.ONLINE:S.PeerOnlineState.OFFLINE;i.emit("PeersOnlineStatusChanged",m({},e,t)),i.subscribedPeerStatusCache[e]=t}})),e.abrupt("return",r);case 12:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"getChannelMemberCount",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a,s,u,c=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connectionState===T.CONNECTED){e.next=2;break}throw new K("The client is not logged in",aA);case 2:if(void 0!==this.session){e.next=4;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 4:if(Array.isArray(t)&&t.every((function(e){return"string"==typeof e}))&&0!==t.length){e.next=6;break}throw new I("Invalid arguments: channelIds",Oq);case 6:if(!(32<t.length)){e.next=8;break}throw new I("getChannelMemberCount exceed limit of 32 channelIds",$z);case 8:n=0;case 9:if(!(n<t.length)){e.next=16;break}if(za(r=t[n])){e.next=13;break}throw new I(["getChannelMemberCount channel id %s is invalid",r],Oq);case 13:n++,e.next=9;break;case 16:return e.next=18,this.session.requestGetChannelMemberCount(t).toPromise();case 18:for(i=e.sent,o=i.groupInfos,a={},s=function(e){var t=(e=o[e]).group,n=e.memberCount;za(t)&&"number"==typeof n&&(c.session.joinedChannels.forEach((function(e){e.channelId===t&&e.onMemberCountUpdated(n)})),a[t]=n)},u=0;u<o.length;u++)s(u);return e.abrupt("return",a);case 24:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"setLocalUserAttributes",value:function(){var e=J(w.mark((function e(t){var n,r;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(uf({attributes:t,maxAttrValueSize:8192,maxAttrsCount:32,maxTotalSize:16384}),this.connectionState===T.CONNECTED){e.next=3;break}throw new K("The client is not logged in",Ub);case 3:if(void 0!==this.session){e.next=5;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 5:return n=this.session.requestSetLocalUserAttributes(t).toPromise(),r={attribute:t,promise:n},this.attributeDrafts.add(r),e.prev=8,e.next=11,n;case 11:this.attributes=t,e.next=19;break;case 14:if(e.prev=14,e.t0=e.catch(8),!sa(e.t0)){e.next=18;break}throw e.t0;case 18:throw new I("arguments is not valid",Ja);case 19:return e.prev=19,this.attributeDrafts.delete(r),e.finish(19);case 22:case"end":return e.stop()}}),e,this,[[8,14,19,22]])})));return function(t){return e.apply(this,arguments)}}()},{key:"setChannelAttributes",value:function(){var e=J(w.mark((function e(t,n){var r,i,o,a,s,u=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=2<u.length&&void 0!==u[2]?u[2]:{},i=r.enableNotificationToChannelMembers,o=void 0!==i&&i,uf({attributes:n,maxAttrValueSize:8192,maxAttrsCount:32,maxTotalSize:32768}),this.connectionState===T.CONNECTED){e.next=4;break}throw new K("The client is not logged in",Ub);case 4:if(void 0!==this.session){e.next=6;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 6:return a=this.session.requestSetChannelAttributes(t,n,o).toPromise(),e.prev=7,e.next=10,a;case 10:s=uc(n,(function(e){return new Blob([e]).size})),this.channelAttributesCacheLru.set(t,s),e.next=19;break;case 14:if(e.prev=14,e.t0=e.catch(7),!sa(e.t0)){e.next=18;break}throw e.t0;case 18:throw new I("arguments is not valid",Ja);case 19:case"end":return e.stop()}}),e,this,[[7,14]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"addOrUpdateLocalUserAttributes",value:function(){var e=J(w.mark((function e(t){var n,r,i;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=ua(ua({},this.attributes),t),uf({attributes:t,maxAttrValueSize:8192,maxAttrsCount:32,maxTotalSize:16384}),uf({attributes:n,maxAttrValueSize:8192,maxAttrsCount:32,maxTotalSize:16384}),this.connectionState===T.CONNECTED){e.next=5;break}throw new K("The client is not logged in",Ub);case 5:if(void 0!==this.session){e.next=7;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 7:return r=this.session.requestAddOrUpdateLocalUserAttributes(t).toPromise(),i={attribute:n,promise:r},this.attributeDrafts.add(i),e.prev=10,e.next=13,r;case 13:this.attributes=n,e.next=21;break;case 16:if(e.prev=16,e.t0=e.catch(10),!sa(e.t0)){e.next=20;break}throw e.t0;case 20:throw new I("arguments is not valid",er);case 21:return e.prev=21,this.attributeDrafts.delete(i),e.finish(21);case 24:case"end":return e.stop()}}),e,this,[[10,16,21,24]])})));return function(t){return e.apply(this,arguments)}}()},{key:"addOrUpdateChannelAttributes",value:function(){var e=J(w.mark((function e(t,n){var r,i,o,a,s,u,c,l=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=2<l.length&&void 0!==l[2]?l[2]:{},i=r.enableNotificationToChannelMembers,o=void 0!==i&&i,a=this.channelAttributesCacheLru.get(t,{}),s=uc(n,(function(e){return new Blob([e]).size})),u=ua(ua({},a),s),uf({attributes:n,attrSizeMap:u,maxAttrValueSize:8192,maxAttrsCount:32,maxTotalSize:32768}),this.connectionState===T.CONNECTED){e.next=7;break}throw new K("The client is not logged in",Ub);case 7:if(void 0!==this.session){e.next=9;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 9:return c=this.session.requestAddOrUpdateChannelAttributes(t,n,o).toPromise(),e.prev=10,e.next=13,c;case 13:this.channelAttributesCacheLru.set(t,u),e.next=21;break;case 16:if(e.prev=16,e.t0=e.catch(10),!sa(e.t0)){e.next=20;break}throw e.t0;case 20:throw new I("arguments is not valid",Ja);case 21:case"end":return e.stop()}}),e,this,[[10,16]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"deleteLocalUserAttributesByKeys",value:function(){var e=J(w.mark((function e(t){var n,r,i,o;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(t)&&0!==t.length&&!t.some((function(e){return 0===e.length}))){e.next=2;break}throw new K("arguments is not valid",Ja);case 2:if(this.connectionState===T.CONNECTED){e.next=4;break}throw new K("The client is not logged in",Ub);case 4:if(void 0!==this.session){e.next=6;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 6:return n=this.session.requestDeleteLocalUserAttributesByKeys(t).toPromise(),r={attribute:Gk(this.attributes,t),promise:n},this.attributeDrafts.add(r),e.prev=9,e.next=12,n;case 12:for(i=0;i<t.length;i++)o=t[i],delete this.attributes[o];e.next=20;break;case 15:if(e.prev=15,e.t0=e.catch(9),!sa(e.t0)){e.next=19;break}throw e.t0;case 19:throw new I("arguments is not valid",Ja);case 20:return e.prev=20,this.attributeDrafts.delete(r),e.finish(20);case 23:case"end":return e.stop()}}),e,this,[[9,15,20,23]])})));return function(t){return e.apply(this,arguments)}}()},{key:"deleteChannelAttributesByKeys",value:function(){var e=J(w.mark((function e(t,n){var r,i,o,a,s,u,c,l=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=2<l.length&&void 0!==l[2]?l[2]:{},i=r.enableNotificationToChannelMembers,o=void 0!==i&&i,Array.isArray(n)&&0!==n.length&&za(t)&&!n.some((function(e){return 0===e.length||512<e.length}))){e.next=3;break}throw new K("arguments is not valid",Ja);case 3:if(this.connectionState===T.CONNECTED){e.next=5;break}throw new K("The client is not logged in",Ub);case 5:if(void 0!==this.session){e.next=7;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 7:return a=this.session.requestDeleteChannelAttributesByKeys(t,n,o).toPromise(),e.prev=8,e.next=11,a;case 11:if(s=this.channelAttributesCacheLru.get(t))for(u=0;u<n.length;u++)c=n[u],delete s[c];e.next=20;break;case 15:if(e.prev=15,e.t0=e.catch(8),!sa(e.t0)){e.next=19;break}throw e.t0;case 19:throw new I("arguments is not valid",Ja);case 20:case"end":return e.stop()}}),e,this,[[8,15]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"clearLocalUserAttributes",value:function(){var e=J(w.mark((function e(){var t,n;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connectionState===T.CONNECTED){e.next=2;break}throw new K("The client is not logged in",Ub);case 2:if(void 0!==this.session){e.next=4;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 4:return t=this.session.requestClearLocalUserAttributes().toPromise(),n={attribute:{},promise:t},this.attributeDrafts.add(n),e.prev=7,e.next=10,t;case 10:this.attributes={},e.next=18;break;case 13:if(e.prev=13,e.t0=e.catch(7),!sa(e.t0)){e.next=17;break}throw e.t0;case 17:throw new I("arguments is not valid",Ja);case 18:return e.prev=18,this.attributeDrafts.delete(n),e.finish(18);case 21:case"end":return e.stop()}}),e,this,[[7,13,18,21]])})));return function(){return e.apply(this,arguments)}}()},{key:"clearChannelAttributes",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=1<a.length&&void 0!==a[1]?a[1]:{},r=n.enableNotificationToChannelMembers,i=void 0!==r&&r,this.connectionState===T.CONNECTED){e.next=3;break}throw new K("The client is not logged in",Ub);case 3:if(void 0!==this.session){e.next=5;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 5:return o=this.session.requestClearChannelAttributes(t,i).toPromise(),e.prev=6,e.next=9,o;case 9:this.channelAttributesCacheLru.delete(t),e.next=17;break;case 12:if(e.prev=12,e.t0=e.catch(6),!sa(e.t0)){e.next=16;break}throw e.t0;case 16:throw new I("arguments is not valid",Ja);case 17:case"end":return e.stop()}}),e,this,[[6,12]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getUserAttributes",value:function(){var e=J(w.mark((function e(t){var n,r,i;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(za(t)){e.next=2;break}throw new I("Not a valid user ID",Ja);case 2:if(this.connectionState===T.CONNECTED){e.next=4;break}throw new K("The client is not logged in",Ub);case 4:if(void 0!==this.session){e.next=6;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 6:return e.prev=6,e.next=9,this.session.requestGetUserAttributeKeys(t).toPromise();case 9:return n=e.sent,r=n.keys,e.next=13,this.session.requestGetUserAttributesByKeys(t,r.slice(0,512)).toPromise();case 13:i=e.sent,e.next=21;break;case 16:if(e.prev=16,e.t0=e.catch(6),!sa(e.t0)){e.next=20;break}throw e.t0;case 20:throw new I("arguments is not valid",Ja);case 21:return e.abrupt("return",Yp(i.attributeInfos.map((function(e){return[e.key,e.value]}))));case 22:case"end":return e.stop()}}),e,this,[[6,16]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getChannelAttributes",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a,s,u,c,l,f,h;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(za(t)){e.next=2;break}throw new I("Not a valid channel ID",Ja);case 2:if(this.connectionState===T.CONNECTED){e.next=4;break}throw new K("The client is not logged in",Ub);case 4:if(void 0!==this.session){e.next=6;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 6:return e.prev=6,e.next=9,this.session.requestGetChannelAttributesKeys(t).toPromise();case 9:return n=e.sent,r=n.keys,e.next=13,this.session.requestGetChannelAttributesByKeys(t,r).toPromise();case 13:i=e.sent,o=i.attributeMaps,e.next=22;break;case 17:if(e.prev=17,e.t0=e.catch(6),!sa(e.t0)){e.next=21;break}throw e.t0;case 21:throw new I("arguments is not valid",Ja);case 22:a={},s=0;case 24:if(!(s<o.length)){e.next=32;break}if(u=o[s],c=u.key,l=u.ms,f=u.value,h=u.origin,"string"==typeof c&&U.isLong(l)&&"string"==typeof f&&za(h)){e.next=28;break}return e.abrupt("break",32);case 28:a[c]={value:f,lastUpdateUserId:h,lastUpdateTs:l.toNumber()};case 29:s++,e.next=24;break;case 32:return this.channelAttributesCacheLru.set(t,uc(a,(function(e){return new Blob([e.value]).size}))),e.abrupt("return",a);case 34:case"end":return e.stop()}}),e,this,[[6,17]])})));return function(t){return e.apply(this,arguments)}}()},{key:"getChannelAttributesByKeys",value:function(){var e=J(w.mark((function e(t,n){var r,i,o,a,s,u,c,l,f,h;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connectionState===T.CONNECTED){e.next=2;break}throw new K("The client is not logged in",Ub);case 2:if(void 0!==this.session){e.next=4;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 4:return Hm(t,n),e.prev=5,e.next=8,this.session.requestGetChannelAttributesByKeys(t,n).toPromise();case 8:r=e.sent,i=r.attributeMaps,e.next=17;break;case 12:if(e.prev=12,e.t0=e.catch(5),!sa(e.t0)){e.next=16;break}throw e.t0;case 16:throw new I("arguments is not valid",Ja);case 17:o={},a=this.channelAttributesCacheLru.get(t,{}),s=0;case 20:if(!(s<i.length)){e.next=29;break}if(u=i[s],c=u.key,l=u.ms,f=u.value,h=u.origin,"string"==typeof c&&U.isLong(l)&&"string"==typeof f&&za(h)){e.next=24;break}return e.abrupt("break",29);case 24:a[c]=new Blob([f]).size,o[c]={value:f,lastUpdateUserId:h,lastUpdateTs:l.toNumber()};case 26:s++,e.next=20;break;case 29:return this.channelAttributesCacheLru.set(t,a),e.abrupt("return",o);case 31:case"end":return e.stop()}}),e,this,[[5,12]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"getUserAttributesByKeys",value:function(){var e=J(w.mark((function e(t,n){var r;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connectionState===T.CONNECTED){e.next=2;break}throw new K("The client is not logged in",Ub);case 2:if(void 0!==this.session){e.next=4;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 4:return Hm(t,n),e.prev=5,e.next=8,this.session.requestGetUserAttributesByKeys(t,n).toPromise();case 8:r=e.sent,e.next=16;break;case 11:if(e.prev=11,e.t0=e.catch(5),!sa(e.t0)){e.next=15;break}throw e.t0;case 15:throw new I("arguments is not valid",Ja);case 16:return e.abrupt("return",Yp(r.attributeInfos.map((function(e){return[e.key,e.value]}))));case 17:case"end":return e.stop()}}),e,this,[[5,11]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"login",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Uk=!0,n=Bg(),r=t.token,t.token===this.context.appId&&(r=void 0),setTimeout((function(){var e;eb("Session",{appId:a.context.appId,did:navigator.userAgent,elapse:fb(a.session&&a.session.startTime),index:{index1:t.uid,index2:a.context.appId,index3:"enableLogUpload=".concat(a.context.config.enableLogUpload)},installId:gg,lts:U.fromNumber(Date.now()),os:7,sid:Xa(n),token:r||"",userId:t.uid,ver:"1.4.3-203",buildno:603,subVersion:203,version:4},null!==(e=a.context.config.enableCloudProxy)&&void 0!==e&&e)}),1e4),yd(t)&&za(t.uid)){e.next=7;break}throw new I("not a valid user id",Jh);case 7:if("string"!=typeof r||!r){e.next=11;break}this.context.token=r,e.next=13;break;case 11:if("string"==typeof r||null==r){e.next=13;break}throw new I('The "token" is not a valid string.',Jh);case 13:return i=Date.now(),this.context.sid=Xa(n),this.loginPromise=this.loginImpl({uid:t.uid,instanceId:n}),this.info("RTM Client logging in as ".concat(oa(t.uid))),e.prev=17,e.next=20,this.loginPromise;case 20:e.next=27;break;case 22:throw e.prev=22,e.t0=e.catch(17),sa(e.t0)&&eb("Link",{ackedServerIp:"",destServerIp:"",ec:e.t0.code||1,sc:e.t0.serverCode,elapse:fb(this.session&&this.session.startTime),lts:U.fromNumber(Date.now()),responseTime:Date.now()-i,sid:Xa(n),userId:t.uid},null!==(o=this.context.config.enableCloudProxy)&&void 0!==o&&o),this.context.token=void 0,e.t0;case 27:return e.prev=27,this.loginPromise=void 0,e.finish(27);case 30:Uk=!1;case 31:case"end":return e.stop()}}),e,this,[[17,22,27,30]])})));return function(t){return e.apply(this,arguments)}}()},{key:"logout",value:function(){var e=J(w.mark((function e(){var t;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.loginPromise){e.next=3;break}return e.next=3,this.loginPromise;case 3:if(this.connectionState!==T.DISCONNECTED){e.next=6;break}throw this.logError("Already in logout state"),new K("Logout failure. The client has already been logged out",br);case 6:if(this.connectionState!==T.ABORTED){e.next=10;break}return this.info('Reset connection state from "ABORTED" to "DISCONNECTED"'),this.onConnectionStateChanged(T.DISCONNECTED,Eb.LOGOUT),e.abrupt("return");case 10:if(void 0!==this.session){e.next=13;break}return this.onConnectionStateChanged(T.DISCONNECTED,Eb.LOGOUT),e.abrupt("return");case 13:return eb("Logout",{elapse:fb(this.session.startTime),lts:U.fromNumber(Date.now()),sid:Xa(this.session.instanceId),userId:this.context.uid},null!==(t=this.context.config.enableCloudProxy)&&void 0!==t&&t),e.next=16,this.session.logoutHandler();case 16:this.onConnectionStateChanged(T.DISCONNECTED,Eb.LOGOUT),this.log("Log out success");case 18:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"logoutSync",value:function(){var e,t=this;if(this.connectionState===T.DISCONNECTED)throw this.logError("Already in logout state"),new K("Logout failure. The client has already been logged out",br);this.connectionState===T.ABORTED?this.info('Reset connection state from "ABORTED" to "DISCONNECTED"'):void 0!==this.session&&(eb("Logout",{elapse:fb(this.session.startTime),lts:U.fromNumber(Date.now()),sid:Xa(this.session.instanceId),userId:this.context.uid},null!==(e=this.context.config.enableCloudProxy)&&void 0!==e&&e),this.session.logoutHandler().then((function(){t.log("Log out success")}))),this.onConnectionStateChanged(T.DISCONNECTED,Eb.LOGOUT)}},{key:"sendMessageToPeer",value:function(){var e=J(w.mark((function e(t,n){var r,i,o,a,s,u,c=this,l=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=2<l.length&&void 0!==l[2]?l[2]:{},i=r.enableOfflineMessaging,o=void 0!==i&&i,a=r.enableHistoricalMessaging,s=void 0!==a&&a,Tm(t,ve),this.connectionState!==T.RECONNECTING){e.next=5;break}return u=Date.now(),e.abrupt("return",new Promise((function(e,r){var i=function(){var i=J(w.mark((function i(){var l;return w.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(void 0!==c.session){i.next=2;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 2:return l=Date.now()-u,i.prev=3,i.t0=e,i.next=7,Gg({message:t,peerId:n,toPeer:!0,session:c.session,errorCodes:{NOT_LOGGED_IN:al,TOO_OFTEN:dr},diff:l,logger:c.logger,options:{enableHistoricalMessaging:s,enableOfflineMessaging:o}});case 7:i.t1=i.sent,(0,i.t0)(i.t1),i.next=16;break;case 11:i.prev=11,i.t2=i.catch(3),Sa(i.t2)&&r(new db(Yd(c.name,"sendMessageToPeer",1e4),Zk)),sa(i.t2)&&r(i.t2),r(new da("Peer-to-peer message send failure",{code:cr,originalError:i.t2}));case 16:return i.prev=16,clearTimeout(a),i.finish(16);case 19:case"end":return i.stop()}}),i,null,[[3,11,16,19]])})));return function(){return i.apply(this,arguments)}}();c.internalEmitter.once("RECONNECTED",i);var a=setTimeout((function(){c.internalEmitter.off("RECONNECTED",i),r(new db(Yd(c.name,"sendMessageToPeer",1e4),Zk))}),9e3)})));case 5:if(this.connectionState===T.CONNECTED){e.next=7;break}throw new K("Failed to send the peer-to-peer message. The client is not logged in",al);case 7:if(void 0!==this.session){e.next=9;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 9:return e.prev=9,e.next=12,Gg({message:t,peerId:n,toPeer:!0,session:this.session,errorCodes:{NOT_LOGGED_IN:al,TOO_OFTEN:dr},diff:0,logger:this.logger,options:{enableHistoricalMessaging:s,enableOfflineMessaging:o}});case 12:return e.abrupt("return",e.sent);case 15:if(e.prev=15,e.t0=e.catch(9),!Sa(e.t0)){e.next=19;break}throw new db(Yd(this.name,"sendMessageToPeer",1e4),Zk);case 19:if(!sa(e.t0)){e.next=21;break}throw e.t0;case 21:throw new da("Peer-to-peer message send failure",{code:cr,originalError:e.t0});case 22:case"end":return e.stop()}}),e,this,[[9,15]])})));return function(t,n){return e.apply(this,arguments)}}()},{key:"createChannel",value:function(e){var t=this;if(!za(e))throw new I(["The %s in the arguments is invalid",Object.keys({channelId:e})[0]],Zz);return new pD(e,(function(){return t.session}),this,this.logger)}},{key:"createLocalInvitation",value:function(e){if(!za(e))throw new I(["The %s in the arguments is invalid",Object.keys({calleeId:e})[0]],xc);return this.invitationManager.genLocalInvitation(e)}},{key:"subscribePeersOnlineStatus",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a,s,u,c,l,f,h,p,d,v=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connectionState===T.CONNECTED){e.next=2;break}throw new K("The client is not logged in",bl);case 2:if(void 0!==this.session){e.next=4;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 4:if(Array.isArray(t)&&0!==t.length){e.next=6;break}throw new I("Invalid arguments: peerIds",kg);case 6:n=0;case 7:if(!(n<t.length)){e.next=14;break}if(za(r=t[n])){e.next=11;break}throw new I(["subscribePeersOnlineStatus peer id %s is invalid",r],kg);case 11:n++,e.next=7;break;case 14:if(!(512<(i=t&&t.length?vk(t):[]).length+Object.keys(this.subscribedPeerStatusCache).length)){e.next=17;break}throw new ib("Subscribed peers overflows",gr);case 17:return e.next=19,this.session.requestSubscribePeersOnlineStatus(i).toPromise();case 19:o=e.sent,a=o.errors,s=[],u=[],c=0;case 24:if(!(c<a.length)){e.next=32;break}if(l=a[c],f=l.code,"string"==typeof(h=l.account)){e.next=28;break}throw new da("Returned account is invalid",fr);case 28:0!==f&&s.push(h);case 29:c++,e.next=24;break;case 32:for(p=0;p<i.length;p++)d=i[p],s.includes(d)||(u.push(d),this.subscribedPeerStatusCache[d]=void 0);if(this.session.requestPeersOnlineStatus(u).pipe(ba((function(e){return uc(Jk(e.userInfos,"account"),(function(e){return!!e.ts}))}))).subscribe((function(e){e=uc(e,(function(e,t){return e=e?S.PeerOnlineState.ONLINE:S.PeerOnlineState.OFFLINE,v.subscribedPeerStatusCache[t]=e})),v.emit("PeersOnlineStatusChanged",e)})),0===s.length){e.next=36;break}throw new da("Subscription failed",fr);case 36:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"unsubscribePeersOnlineStatus",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connectionState===T.CONNECTED){e.next=2;break}throw new K("The client is not logged in",bl);case 2:if(void 0!==this.session){e.next=4;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 4:if(Array.isArray(t)&&0!==t.length){e.next=6;break}throw new I("Invalid arguments: peerIds",kg);case 6:n=0;case 7:if(!(n<t.length)){e.next=14;break}if(za(r=t[n])){e.next=11;break}throw new I(["subscribePeersOnlineStatus peer id %s is invalid",r],kg);case 11:n++,e.next=7;break;case 14:if(!(512<t.length)){e.next=16;break}throw new ib("Unsubscribed peers overflows",gr);case 16:for(i=t&&t.length?vk(t):[],this.session.requestUnsubscribePeersOnlineStatus(i),o=0;o<i.length;o++)a=i[o],delete this.subscribedPeerStatusCache[a];case 19:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"queryPeersBySubscriptionOption",value:function(){var e=J(w.mark((function e(t){return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connectionState===T.CONNECTED){e.next=2;break}throw new K("The client is not logged in",bl);case 2:if(t!==S.PeerSubscriptionOption.ONLINE_STATUS){e.next=4;break}return e.abrupt("return",Object.keys(this.subscribedPeerStatusCache));case 4:throw new I("Subscription option not supported",kg);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"createMessage",value:function(e){return"IMAGE"===e.messageType?ua({width:0,height:0,fileName:"",description:"",thumbnail:new Blob,thumbnailWidth:0,thumbnailHeight:0,size:0},e):"FILE"===e.messageType?ua({fileName:"",description:"",thumbnail:new Blob,size:0},e):e}},{key:"downloadMedia",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a,s,u,c,l,f,h,p,d,v,b=this,g=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=1<g.length&&void 0!==g[1]?g[1]:{},"string"==typeof t){e.next=3;break}throw new I("invalid mediaId format",cl);case 3:if(e.prev=3,r=t.split("z"),i=ra(r,3),o=i[0],a=i[1],s=i[2],u=o.slice(1,65),c=bD(u),l=parseInt(o.slice(65),10),f=parseInt(a,10),h=parseInt(s,10),!(Number.isNaN(l)||Number.isNaN(f)||Number.isNaN(h))){e.next=12;break}throw new I("Invalid mediaId content",cl);case 12:e.next=19;break;case 14:if(e.prev=14,e.t0=e.catch(3),!sa(e.t0)){e.next=18;break}throw e.t0;case 18:throw new I("parse mediaId failure",{code:cl,originalError:e.t0});case 19:if(this.connectionState===T.CONNECTED){e.next=21;break}throw new K("The client is not logged in, cannot download",CA);case 21:if(void 0!==this.session){e.next=23;break}throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});case 23:return p=this.mediaTaskManager.addDownloadTask({unit:f,zone:l,hashHexStr:u,size:h},(function(){if(void 0===b.session)throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});return b.session.requestFileDownloadIndexGet({hash:c,zone:l,unit:f,size:h}).toPromise()}),n),e.next=26,this.mediaTaskManager.waitMediaTask(p);case 26:return d=e.sent,v=d.payload,e.abrupt("return",v);case 29:case"end":return e.stop()}}),e,this,[[3,14]])})));return function(t){return e.apply(this,arguments)}}()},{key:"createMediaMessageByUploading",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a,s,u,c,l,f,h,p,d,v,b,g,y,m,E,_,O,A,k,R,N=this,S=arguments;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=1<S.length&&void 0!==S[1]?S[1]:{},r=2<S.length&&void 0!==S[2]?S[2]:{},yd(n)){e.next=4;break}throw new I("Invalid params",wf);case 4:if(i="thumbnailWidth"in n||"thumbnailHeight"in n||"width"in n||"height"in n,o=n.messageType,a=void 0===o?i?"IMAGE":"FILE":o,s=n.description,u=void 0===s?"":s,c=n.fileName,l=void 0===c?"":c,f=n.thumbnail,"string"==typeof n.messageType&&"string"==typeof u&&"string"==typeof l&&(Pm(f)||void 0===f)&&Pm(t)){e.next=8;break}throw new I("Invalid message params type",wf);case 8:if(!i||"FILE"!==a){e.next=10;break}throw new I("Invalid message params, unexpected field in RtmFileMessage",wf);case 10:if(!(33554432<(h=t.size))){e.next=13;break}throw new ib("The payload size overflow 32 MB",wA);case 13:return e.next=15,Ji(t);case 15:return p=e.sent,e.next=18,aD(p);case 18:if(d=e.sent,this.connectionState===T.CONNECTED){e.next=21;break}throw new K("The client is not logged in",yA);case 21:if("IMAGE"!==a){e.next=29;break}return e.next=24,Xt(n,p);case 24:v=e.sent,b=v.height,g=v.width,y=v.thumbnailWidth,m=v.thumbnailHeight;case 29:return E=this.mediaTaskManager.addUploadTask({file:new Uint8Array(p),hash:d},(function(){if(void 0===N.session)throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});return N.session.fetchFileUploadIndexGet({hash:d,size:h})}),(function(e,t){if(void 0===N.session)throw new Fa({SESSION_NOT_FOUND:"Failed to get session of the client"});return N.session.requestFileUploadIndexSet({hash:d,unit:e,servers:t}).toPromise()}),r),e.next=32,this.mediaTaskManager.waitMediaTask(E);case 32:if(_=e.sent,O=_.zone,A=_.retUnit,"IMAGE"!==a){e.next=38;break}return k={height:b,width:g,fileName:l,size:h,description:u,thumbnail:f,messageType:a,thumbnailWidth:y,thumbnailHeight:m,mediaId:"0".concat($r(d)).concat(O,"z").concat(A,"z").concat(h,"z").concat(b,"z").concat(g)},e.abrupt("return",k);case 38:return R={fileName:l,size:h,description:u,mediaId:"0".concat($r(d)).concat(O,"z").concat(A,"z").concat(h),thumbnail:f,messageType:a},e.abrupt("return",R);case 40:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"loginImpl",value:function(){var e=J(w.mark((function e(t){var n,r,i,o,a=this;return w.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.uid,r=t.instanceId,!(void 0!==this.lastLoginTime&&500>Date.now()-this.lastLoginTime)){e.next=4;break}throw new rC(["The frequency of login exceeded the limit of %d queries per second",2],mA);case 4:if(this.connectionState===T.DISCONNECTED){e.next=6;break}throw new K("The SDK is either logging in or has logged in the Agora RTM system",kA);case 6:e.prev=6,this.context.uid=n,e.next=13;break;case 10:throw e.prev=10,e.t0=e.catch(6),new I(["The %s in the arguments is invalid",Object.keys({uid:n})[0]],Jh);case 13:return this.onConnectionStateChanged(T.CONNECTING,Eb.LOGIN),this.session=i=new ls(this.context,new Yr(this.context,this.logger,!1),r,this.logger),o=function(){a.connectionState===T.CONNECTED&&(a.onConnectionStateChanged(T.RECONNECTING,Eb.INTERRUPTED),a.session)&&a.session.once("userJoined",(function(){a.onConnectionStateChanged(T.CONNECTED,Eb.LOGIN_SUCCESS)}))},i.on("connectionLost",o),i.on("tokenExpired",(function(){a.emit("TokenExpired")})),i.once("userDrop",this.userDropHandler),this.session.on("peerTextMessage",(function(e){a.emit("MessageFromPeer",{text:e.text,messageType:S.MessageType.TEXT},e.peerId,e.properties)})),this.session.on("peerMediaMessage",(function(e){var t=e.peerId,n=e.properties,r=e.messageType;e=e.details,"FILE"===r?a.emit("MessageFromPeer",{messageType:S.MessageType.FILE,size:parseInt(pa(e.media_size),10),description:pa(e.media_description),fileName:pa(e.media_filename),mediaId:pa(e.media_id),thumbnail:new Blob([e.media_thumbnail])},t,n):"IMAGE"===r&&a.emit("MessageFromPeer",{messageType:S.MessageType.IMAGE,size:parseInt(pa(e.media_size),10),description:pa(e.media_description),fileName:pa(e.media_filename),mediaId:pa(e.media_id),thumbnail:new Blob([e.media_thumbnail]),height:parseInt(pa(e.media_height),10),width:parseInt(pa(e.media_width),10),thumbnailHeight:parseInt(pa(e.media_thumbnailheight),10),thumbnailWidth:parseInt(pa(e.media_thumbnailwidth),10)},t,n)})),this.session.on("peerRawMessage",(function(e){a.emit("MessageFromPeer",{rawMessage:e.raw,description:e.desc,messageType:S.MessageType.RAW},e.peerId,e.properties)})),i.on("instanceChanged",(function(e){return r=e})),i.on("peerOnlineStatusChanged",(function(e){var t=e.instance.toString()+e.state,n=a.peerStatusSeqLru.get(t);!n||e.seq.greaterThan(n)?(a.peerStatusSeqLru.set(t,e.seq),e.state!==a.subscribedPeerStatusCache[e.peerId]&&a.emit("PeersOnlineStatusChanged",m({},e.peerId,e.state)),a.subscribedPeerStatusCache[e.peerId]=e.state,clearTimeout(a.peerUnreachableTimers[t]),e.state===S.PeerOnlineState.UNREACHABLE&&(a.peerUnreachableTimers[t]=setTimeout((function(){a.subscribedPeerStatusCache[e.peerId]===S.PeerOnlineState.UNREACHABLE&&(a.subscribedPeerStatusCache[e.peerId]=S.PeerOnlineState.ONLINE,a.emit("PeersOnlineStatusChanged",m({},e.peerId,S.PeerOnlineState.ONLINE)))}),3e4))):a.log("peerOnlineStatusChanged dedup for %s, %d",t,e.seq.toNumber())})),i.on("invitationMessage",this.invitationManager.invitationMessageHandler.bind(this.invitationManager)),i.on("channelAttributesUpdated",(function(e){var t=e.channelId;e=e.attributeMaps;for(var n={},r=0;r<e.length;r++){var i=e[r],o=i.key,s=i.ms,u=i.value;if(i=i.origin,"string"!=typeof o||!U.isLong(s)||"string"!=typeof u||!za(i))break;n[o]=new Blob([u]).size}a.channelAttributesCacheLru.set(t,n)})),i.on("userJoined",(function(e){if(0!==Object.keys(a.attributes).length){if(void 0===a.session)return;a.session.requestSetLocalUserAttributes(a.attributes,e).toPromise()}if(0!==a.attributeDrafts.size)for(var t=function(t,n){var r=(t=n[t]).attribute;t.promise.then((function(){void 0!==a.session&&a.session.requestSetLocalUserAttributes(r,e).toPromise()}))},n=0,r=Array.from(a.attributeDrafts);n<r.length;n++)t(n,r);0!==Object.keys(a.subscribedPeerStatusCache).length&&i.requestSubscribePeersOnlineStatus(Object.keys(a.subscribedPeerStatusCache))})),this.lastLoginTime=Date.now(),e.prev=29,e.next=32,i.loginHandler().toPromise();case 32:this.mediaTaskManager.setAuthInfo({ticket:i.connection.curOpenSockets.filter((function(e){return void 0!==e}))[0].ticket,instance:i.instanceId,useNewDomain:.5<=Math.random(),loginOpt:i.userJoinOptions.toLong()}),e.next=44;break;case 35:if(e.prev=35,e.t1=e.catch(29),!Sa(e.t1)){e.next=40;break}throw this.onConnectionStateChanged(T.DISCONNECTED,Eb.LOGIN_TIMEOUT),new db(Yd(this.name,"login",2e4),lA);case 40:if(this.onConnectionStateChanged(T.DISCONNECTED,Eb.LOGIN_FAILURE),!sa(e.t1)){e.next=43;break}throw e.t1;case 43:throw new da("Login failure",{code:Zq,originalError:e.t1});case 44:this.onConnectionStateChanged(T.CONNECTED,Eb.LOGIN_SUCCESS);case 45:case"end":return e.stop()}}),e,this,[[6,10],[29,35]])})));return function(t){return e.apply(this,arguments)}}()},{key:"onConnectionStateChanged",value:function(e,t){var n,r=this;e===T.RECONNECTING&&(this.reconnId+=1),eb("ConnectionStateChange",{elapse:fb(this.session&&this.session.startTime),lts:U.fromNumber(Date.now()),newState:os[e],oldState:os[this.connectionState],reason:qD[t],sid:Xa(this.session&&this.session.instanceId||U.fromNumber(0)),userId:this.context.uid,reconnId:this.reconnId},null!==(n=this.context.config.enableCloudProxy)&&void 0!==n&&n),this.connectionState===T.RECONNECTING&&e===T.CONNECTED&&(0!==Object.keys(this.subscribedPeerStatusCache).length&&void 0!==this.session&&this.session.requestPeersOnlineStatus(Object.keys(this.subscribedPeerStatusCache)).pipe(ba((function(e){return uc(Jk(e.userInfos,"account"),(function(e){return!!e.ts}))}))).subscribe((function(e){e=uc(e,(function(e,t){return e=e?S.PeerOnlineState.ONLINE:S.PeerOnlineState.OFFLINE,r.subscribedPeerStatusCache[t]=e})),r.emit("PeersOnlineStatusChanged",e)})),this.internalEmitter.emit("RECONNECTED")),this.connectionState=e,e!==T.ABORTED&&e!==T.DISCONNECTED||(this.reconnId=0,this.attributes={},this.session&&(this.session.removeAllListeners(),this.session.joinedChannels.clear(),this.session.msgDedupLru.empty(),this.session.dialogueSequenceLru.empty(),this.session.dialPendingMsgSubjectMap.clear()),this.session=void 0,this.channelAttributesCacheLru.empty(),this.peerStatusSeqLru.empty(),this.peerUnreachableTimers={},this.subscribedPeerStatusCache={},this.attributeDrafts.clear(),this.context.token=void 0),this.mediaTaskManager.emit("connectionStateChanged",e),this.emit("ConnectionStateChanged",e,t)}}]),t}(tb()),fa(E.prototype,"renewToken",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"renewToken"),E.prototype),fa(E.prototype,"queryPeersOnlineStatus",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"queryPeersOnlineStatus"),E.prototype),fa(E.prototype,"getChannelMemberCount",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"getChannelMemberCount"),E.prototype),fa(E.prototype,"setLocalUserAttributes",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"setLocalUserAttributes"),E.prototype),fa(E.prototype,"setChannelAttributes",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"setChannelAttributes"),E.prototype),fa(E.prototype,"addOrUpdateLocalUserAttributes",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"addOrUpdateLocalUserAttributes"),E.prototype),fa(E.prototype,"addOrUpdateChannelAttributes",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"addOrUpdateChannelAttributes"),E.prototype),fa(E.prototype,"deleteLocalUserAttributesByKeys",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"deleteLocalUserAttributesByKeys"),E.prototype),fa(E.prototype,"deleteChannelAttributesByKeys",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"deleteChannelAttributesByKeys"),E.prototype),fa(E.prototype,"clearLocalUserAttributes",[Nb],Object.getOwnPropertyDescriptor(E.prototype,"clearLocalUserAttributes"),E.prototype),fa(E.prototype,"clearChannelAttributes",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"clearChannelAttributes"),E.prototype),fa(E.prototype,"getUserAttributes",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"getUserAttributes"),E.prototype),fa(E.prototype,"getChannelAttributes",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"getChannelAttributes"),E.prototype),fa(E.prototype,"getChannelAttributesByKeys",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"getChannelAttributesByKeys"),E.prototype),fa(E.prototype,"getUserAttributesByKeys",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"getUserAttributesByKeys"),E.prototype),fa(E.prototype,"login",[Nb],Object.getOwnPropertyDescriptor(E.prototype,"login"),E.prototype),fa(E.prototype,"logout",[Nb],Object.getOwnPropertyDescriptor(E.prototype,"logout"),E.prototype),fa(E.prototype,"logoutSync",[Nb],Object.getOwnPropertyDescriptor(E.prototype,"logoutSync"),E.prototype),fa(E.prototype,"sendMessageToPeer",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"sendMessageToPeer"),E.prototype),fa(E.prototype,"createChannel",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"createChannel"),E.prototype),fa(E.prototype,"createLocalInvitation",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"createLocalInvitation"),E.prototype),fa(E.prototype,"subscribePeersOnlineStatus",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"subscribePeersOnlineStatus"),E.prototype),fa(E.prototype,"unsubscribePeersOnlineStatus",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"unsubscribePeersOnlineStatus"),E.prototype),fa(E.prototype,"queryPeersBySubscriptionOption",[Ma],Object.getOwnPropertyDescriptor(E.prototype,"queryPeersBySubscriptionOption"),E.prototype),fa(E.prototype,"createMessage",[Nb],Object.getOwnPropertyDescriptor(E.prototype,"createMessage"),E.prototype),fa(E.prototype,"downloadMedia",[Nb],Object.getOwnPropertyDescriptor(E.prototype,"downloadMedia"),E.prototype),fa(E.prototype,"createMediaMessageByUploading",[Nb],Object.getOwnPropertyDescriptor(E.prototype,"createMediaMessageByUploading"),E.prototype),E),ps={LOG_FILTER_OFF:{error:!1,warn:!1,info:!1,track:!1,debug:!1},LOG_FILTER_ERROR:{error:!0,warn:!1,info:!1,track:!1,debug:!1},LOG_FILTER_WARNING:{error:!0,warn:!0,info:!1,track:!1,debug:!1},LOG_FILTER_INFO:{error:!0,warn:!0,info:!0,track:!1,debug:!1},LOG_FILTER_DEBUG:{error:!0,warn:!0,info:!0,track:!0,debug:!0}},qs={enableLogUpload:!1,logFilter:ps.LOG_FILTER_INFO,enableCloudProxy:!1},Zd=ua(ua({createInstance:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},n=2<arguments.length?arguments[2]:void 0;if(!/^[\dA-Za-z]{32}$/.test(e))throw new I(["The %s in the arguments is invalid",Object.keys({appId:e})[0]],Nq);var r=Object.keys(t).filter((function(e){return!(e in qs)}));if(0!==r.length)throw new I("Invalid RTM config: ".concat(r.join(", ")),Nq);var i=ua(ua({},qs),t);if(void 0!==n&&(!Array.isArray(n)||0===n.length))throw new I("Invalid area config");if(null!=n){if(!n.every((function(e){return e in S.LegacyAreaCode})))throw new I("Invalid area codes: ".concat(n.filter((function(e){return!(e in S)})).join(", ")));M=xe(n.map((function(e){return zC[e]})))}n=jl=Ya.__global_unique_id__=(Ya.__global_unique_id__||0)+1;var o=DC(i);r=EC(i);var a=FC(i),s=GC(n,i),u=Tr(n,i),c=u("RTM:DEBUG","<Entry> ");return Mr.rtmConfig=i,o("The Agora RTM Web SDK version is %s","1.4.3-203"),t.enableCloudProxy&&o("RTM cloud proxy enabled"),t.enableLogUpload&&o("Log upload enabled"),M&&c("Area is set to %s",Array.from(M.CODES).map((function(e){return xf(F).find((function(t){return F[t]===e}))})).join(", ")),c("Creating an RtmClient instance"),c('The Git commit ID is "'.concat("v1.4.3-17-g1e27aa38",'"')),c("The App ID is %s",Um(e,4,10,"*".repeat(6))),o("The process ID is %s",gg),c("The build is %s","v1.4.3-17-g1e27aa38"),c("NODE_ENV is %s","production"),new rD(e,{genLogger:u,genTracker:s,info:o,warn:r,logError:a,loggerId:n},i,(function(e){for(var t=0,n=xf(e);t<n.length;t++){var r=n[t];try{var a=e[r];null!=a&&(e.enableCloudProxy&&o("RTM cloud proxy enabled"),e.enableLogUpload&&o("Log upload enabled"),i[r]=a)}catch(e){throw new I(["The %s in the arguments is invalid",r],void 0)}}}))},BUILD:"v1.4.3-17-g1e27aa38",VERSION:"1.4.3-203",END_CALL_PREFIX:"AgoraRTMLegacyEndcallCompatibleMessagePrefix",processId:gg,ConnectionChangeReason:S.ConnectionChangeReason,ConnectionState:S.ConnectionState,LocalInvitationFailureReason:S.LocalInvitationFailureReason,LocalInvitationState:S.LocalInvitationState,RemoteInvitationFailureReason:S.RemoteInvitationFailureReason,RemoteInvitationState:S.RemoteInvitationState,MessageType:S.MessageType,PeerOnlineState:S.PeerOnlineState,PeerSubscriptionOption:S.PeerSubscriptionOption},ps),{},{setParameter:function(e,t){Object.keys(Nc).includes(e)&&(Nc[e]=t)},getParameter:function(e){return Nc[e]},setArea:function(e){var t=e.areaCodes;if(e=e.excludedArea,!Array.isArray(t)||0===t.length||!t.every((function(e){return e in S.AreaCode})))throw new I("Invalid area config");if(void 0!==e&&e===S.AreaCode.GLOBAL)throw new I("Excluded area cannot be global");if(void 0===e)M=xe(t.map((function(e){return F[e]})));else{if(t.includes(e))throw new I("Excluded area cannot be in areaCodes");if(!(e in F))throw new I("Invalid excludedArea:",e);M=bu({areas:t.map((function(e){return F[e]})),excludedArea:F[e]})}}});return Zd})); /* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) /***/ }), /***/ "./node_modules/events/events.js": /*!***************************************!*\ !*** ./node_modules/events/events.js ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. var R = typeof Reflect === 'object' ? Reflect : null var ReflectApply = R && typeof R.apply === 'function' ? R.apply : function ReflectApply(target, receiver, args) { return Function.prototype.apply.call(target, receiver, args); } var ReflectOwnKeys if (R && typeof R.ownKeys === 'function') { ReflectOwnKeys = R.ownKeys } else if (Object.getOwnPropertySymbols) { ReflectOwnKeys = function ReflectOwnKeys(target) { return Object.getOwnPropertyNames(target) .concat(Object.getOwnPropertySymbols(target)); }; } else { ReflectOwnKeys = function ReflectOwnKeys(target) { return Object.getOwnPropertyNames(target); }; } function ProcessEmitWarning(warning) { if (console && console.warn) console.warn(warning); } var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { return value !== value; } function EventEmitter() { EventEmitter.init.call(this); } module.exports = EventEmitter; module.exports.once = once; // Backwards-compat with node 0.10.x EventEmitter.EventEmitter = EventEmitter; EventEmitter.prototype._events = undefined; EventEmitter.prototype._eventsCount = 0; EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are // added to it. This is a useful default which helps finding memory leaks. var defaultMaxListeners = 10; function checkListener(listener) { if (typeof listener !== 'function') { throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); } } Object.defineProperty(EventEmitter, 'defaultMaxListeners', { enumerable: true, get: function() { return defaultMaxListeners; }, set: function(arg) { if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); } defaultMaxListeners = arg; } }); EventEmitter.init = function() { if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) { this._events = Object.create(null); this._eventsCount = 0; } this._maxListeners = this._maxListeners || undefined; }; // Obviously not all Emitters should be limited to 10. This function allows // that to be increased. Set to zero for unlimited. EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); } this._maxListeners = n; return this; }; function _getMaxListeners(that) { if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners; return that._maxListeners; } EventEmitter.prototype.getMaxListeners = function getMaxListeners() { return _getMaxListeners(this); }; EventEmitter.prototype.emit = function emit(type) { var args = []; for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); var doError = (type === 'error'); var events = this._events; if (events !== undefined) doError = (doError && events.error === undefined); else if (!doError) return false; // If there is no 'error' event listener then throw. if (doError) { var er; if (args.length > 0) er = args[0]; if (er instanceof Error) { // Note: The comments on the `throw` lines are intentional, they show // up in Node's output if this results in an unhandled exception. throw er; // Unhandled 'error' event } // At least give some kind of context to the user var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); err.context = er; throw err; // Unhandled 'error' event } var handler = events[type]; if (handler === undefined) return false; if (typeof handler === 'function') { ReflectApply(handler, this, args); } else { var len = handler.length; var listeners = arrayClone(handler, len); for (var i = 0; i < len; ++i) ReflectApply(listeners[i], this, args); } return true; }; function _addListener(target, type, listener, prepend) { var m; var events; var existing; checkListener(listener); events = target._events; if (events === undefined) { events = target._events = Object.create(null); target._eventsCount = 0; } else { // To avoid recursion in the case that type === "newListener"! Before // adding it to the listeners, first emit "newListener". if (events.newListener !== undefined) { target.emit('newListener', type, listener.listener ? listener.listener : listener); // Re-assign `events` because a newListener handler could have caused the // this._events to be assigned to a new object events = target._events; } existing = events[type]; } if (existing === undefined) { // Optimize the case of one listener. Don't need the extra array object. existing = events[type] = listener; ++target._eventsCount; } else { if (typeof existing === 'function') { // Adding the second element, need to change to array. existing = events[type] = prepend ? [listener, existing] : [existing, listener]; // If we've already got an array, just append. } else if (prepend) { existing.unshift(listener); } else { existing.push(listener); } // Check for listener leak m = _getMaxListeners(target); if (m > 0 && existing.length > m && !existing.warned) { existing.warned = true; // No error code for this since it is a Warning // eslint-disable-next-line no-restricted-syntax var w = new Error('Possible EventEmitter memory leak detected. ' + existing.length + ' ' + String(type) + ' listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit'); w.name = 'MaxListenersExceededWarning'; w.emitter = target; w.type = type; w.count = existing.length; ProcessEmitWarning(w); } } return target; } EventEmitter.prototype.addListener = function addListener(type, listener) { return _addListener(this, type, listener, false); }; EventEmitter.prototype.on = EventEmitter.prototype.addListener; EventEmitter.prototype.prependListener = function prependListener(type, listener) { return _addListener(this, type, listener, true); }; function onceWrapper() { if (!this.fired) { this.target.removeListener(this.type, this.wrapFn); this.fired = true; if (arguments.length === 0) return this.listener.call(this.target); return this.listener.apply(this.target, arguments); } } function _onceWrap(target, type, listener) { var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; var wrapped = onceWrapper.bind(state); wrapped.listener = listener; state.wrapFn = wrapped; return wrapped; } EventEmitter.prototype.once = function once(type, listener) { checkListener(listener); this.on(type, _onceWrap(this, type, listener)); return this; }; EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) { checkListener(listener); this.prependListener(type, _onceWrap(this, type, listener)); return this; }; // Emits a 'removeListener' event if and only if the listener was removed. EventEmitter.prototype.removeListener = function removeListener(type, listener) { var list, events, position, i, originalListener; checkListener(listener); events = this._events; if (events === undefined) return this; list = events[type]; if (list === undefined) return this; if (list === listener || list.listener === listener) { if (--this._eventsCount === 0) this._events = Object.create(null); else { delete events[type]; if (events.removeListener) this.emit('removeListener', type, list.listener || listener); } } else if (typeof list !== 'function') { position = -1; for (i = list.length - 1; i >= 0; i--) { if (list[i] === listener || list[i].listener === listener) { originalListener = list[i].listener; position = i; break; } } if (position < 0) return this; if (position === 0) list.shift(); else { spliceOne(list, position); } if (list.length === 1) events[type] = list[0]; if (events.removeListener !== undefined) this.emit('removeListener', type, originalListener || listener); } return this; }; EventEmitter.prototype.off = EventEmitter.prototype.removeListener; EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) { var listeners, events, i; events = this._events; if (events === undefined) return this; // not listening for removeListener, no need to emit if (events.removeListener === undefined) { if (arguments.length === 0) { this._events = Object.create(null); this._eventsCount = 0; } else if (events[type] !== undefined) { if (--this._eventsCount === 0) this._events = Object.create(null); else delete events[type]; } return this; } // emit removeListener for all listeners on all events if (arguments.length === 0) { var keys = Object.keys(events); var key; for (i = 0; i < keys.length; ++i) { key = keys[i]; if (key === 'removeListener') continue; this.removeAllListeners(key); } this.removeAllListeners('removeListener'); this._events = Object.create(null); this._eventsCount = 0; return this; } listeners = events[type]; if (typeof listeners === 'function') { this.removeListener(type, listeners); } else if (listeners !== undefined) { // LIFO order for (i = listeners.length - 1; i >= 0; i--) { this.removeListener(type, listeners[i]); } } return this; }; function _listeners(target, type, unwrap) { var events = target._events; if (events === undefined) return []; var evlistener = events[type]; if (evlistener === undefined) return []; if (typeof evlistener === 'function') return unwrap ? [evlistener.listener || evlistener] : [evlistener]; return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); } EventEmitter.prototype.listeners = function listeners(type) { return _listeners(this, type, true); }; EventEmitter.prototype.rawListeners = function rawListeners(type) { return _listeners(this, type, false); }; EventEmitter.listenerCount = function(emitter, type) { if (typeof emitter.listenerCount === 'function') { return emitter.listenerCount(type); } else { return listenerCount.call(emitter, type); } }; EventEmitter.prototype.listenerCount = listenerCount; function listenerCount(type) { var events = this._events; if (events !== undefined) { var evlistener = events[type]; if (typeof evlistener === 'function') { return 1; } else if (evlistener !== undefined) { return evlistener.length; } } return 0; } EventEmitter.prototype.eventNames = function eventNames() { return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; }; function arrayClone(arr, n) { var copy = new Array(n); for (var i = 0; i < n; ++i) copy[i] = arr[i]; return copy; } function spliceOne(list, index) { for (; index + 1 < list.length; index++) list[index] = list[index + 1]; list.pop(); } function unwrapListeners(arr) { var ret = new Array(arr.length); for (var i = 0; i < ret.length; ++i) { ret[i] = arr[i].listener || arr[i]; } return ret; } function once(emitter, name) { return new Promise(function (resolve, reject) { function eventListener() { if (errorListener !== undefined) { emitter.removeListener('error', errorListener); } resolve([].slice.call(arguments)); }; var errorListener; // Adding an error listener is not optional because // if an error is thrown on an event emitter we cannot // guarantee that the actual event we are waiting will // be fired. The result could be a silent way to create // memory or file descriptor leaks, which is something // we should avoid. if (name !== 'error') { errorListener = function errorListener(err) { emitter.removeListener(name, eventListener); reject(err); }; emitter.once('error', errorListener); } emitter.once(name, eventListener); }); } /***/ }), /***/ "./node_modules/process/browser.js": /*!*****************************************!*\ !*** ./node_modules/process/browser.js ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports) { // shim for using process in browser var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it // don't break things. But we need to wrap it in a try catch in case it is // wrapped in strict mode code which doesn't define any globals. It's inside a // function because try/catches deoptimize in certain engines. var cachedSetTimeout; var cachedClearTimeout; function defaultSetTimout() { throw new Error('setTimeout has not been defined'); } function defaultClearTimeout () { throw new Error('clearTimeout has not been defined'); } (function () { try { if (typeof setTimeout === 'function') { cachedSetTimeout = setTimeout; } else { cachedSetTimeout = defaultSetTimout; } } catch (e) { cachedSetTimeout = defaultSetTimout; } try { if (typeof clearTimeout === 'function') { cachedClearTimeout = clearTimeout; } else { cachedClearTimeout = defaultClearTimeout; } } catch (e) { cachedClearTimeout = defaultClearTimeout; } } ()) function runTimeout(fun) { if (cachedSetTimeout === setTimeout) { //normal enviroments in sane situations return setTimeout(fun, 0); } // if setTimeout wasn't available but was latter defined if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { cachedSetTimeout = setTimeout; return setTimeout(fun, 0); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedSetTimeout(fun, 0); } catch(e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedSetTimeout.call(null, fun, 0); } catch(e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error return cachedSetTimeout.call(this, fun, 0); } } } function runClearTimeout(marker) { if (cachedClearTimeout === clearTimeout) { //normal enviroments in sane situations return clearTimeout(marker); } // if clearTimeout wasn't available but was latter defined if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { cachedClearTimeout = clearTimeout; return clearTimeout(marker); } try { // when when somebody has screwed with setTimeout but no I.E. maddness return cachedClearTimeout(marker); } catch (e){ try { // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally return cachedClearTimeout.call(null, marker); } catch (e){ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. // Some versions of I.E. have different rules for clearTimeout vs setTimeout return cachedClearTimeout.call(this, marker); } } } var queue = []; var draining = false; var currentQueue; var queueIndex = -1; function cleanUpNextTick() { if (!draining || !currentQueue) { return; } draining = false; if (currentQueue.length) { queue = currentQueue.concat(queue); } else { queueIndex = -1; } if (queue.length) { drainQueue(); } } function drainQueue() { if (draining) { return; } var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; while(len) { currentQueue = queue; queue = []; while (++queueIndex < len) { if (currentQueue) { currentQueue[queueIndex].run(); } } queueIndex = -1; len = queue.length; } currentQueue = null; draining = false; runClearTimeout(timeout); } process.nextTick = function (fun) { var args = new Array(arguments.length - 1); if (arguments.length > 1) { for (var i = 1; i < arguments.length; i++) { args[i - 1] = arguments[i]; } } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { runTimeout(drainQueue); } }; // v8 likes predictible objects function Item(fun, array) { this.fun = fun; this.array = array; } Item.prototype.run = function () { this.fun.apply(null, this.array); }; process.title = 'browser'; process.browser = true; process.env = {}; process.argv = []; process.version = ''; // empty string to avoid regexp issues process.versions = {}; function noop() {} process.on = noop; process.addListener = noop; process.once = noop; process.off = noop; process.removeListener = noop; process.removeAllListeners = noop; process.emit = noop; process.prependListener = noop; process.prependOnceListener = noop; process.listeners = function (name) { return [] } process.binding = function (name) { throw new Error('process.binding is not supported'); }; process.cwd = function () { return '/' }; process.chdir = function (dir) { throw new Error('process.chdir is not supported'); }; process.umask = function() { return 0; }; /***/ }), /***/ "./node_modules/regenerator-runtime/runtime.js": /*!*****************************************************!*\ !*** ./node_modules/regenerator-runtime/runtime.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ var runtime = (function (exports) { "use strict"; var Op = Object.prototype; var hasOwn = Op.hasOwnProperty; var undefined; // More compressible than void 0. var $Symbol = typeof Symbol === "function" ? Symbol : {}; var iteratorSymbol = $Symbol.iterator || "@@iterator"; var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator"; var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); return obj[key]; } try { // IE 8 has a broken Object.defineProperty that only works on DOM objects. define({}, ""); } catch (err) { define = function(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator; var generator = Object.create(protoGenerator.prototype); var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next, // .throw, and .return methods. generator._invoke = makeInvokeMethod(innerFn, self, context); return generator; } exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion // record like context.tryEntries[i].completion. This interface could // have been (and was previously) designed to take a closure to be // invoked without arguments, but in all the cases we care about we // already have an existing method we want to call, so there's no need // to create a new function object. We can even get away with assuming // the method takes exactly one argument, since that happens to be true // in every case, so we don't have to touch the arguments object. The // only additional allocation required is the completion record, which // has a stable shape and so hopefully should be cheap to allocate. function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } var GenStateSuspendedStart = "suspendedStart"; var GenStateSuspendedYield = "suspendedYield"; var GenStateExecuting = "executing"; var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as // breaking out of the dispatch switch statement. var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and // .constructor.prototype properties for functions that return Generator // objects. For full spec compliance, you may wish to configure your // minifier not to mangle the names of these two functions. function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that // don't natively support it. var IteratorPrototype = {}; IteratorPrototype[iteratorSymbol] = function () { return this; }; var getProto = Object.getPrototypeOf; var NativeIteratorPrototype = getProto && getProto(getProto(values([]))); if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) { // This environment has a native %IteratorPrototype%; use it instead // of the polyfill. IteratorPrototype = NativeIteratorPrototype; } var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; GeneratorFunctionPrototype.constructor = GeneratorFunction; GeneratorFunction.displayName = define( GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction" ); // Helper for defining the .next, .throw, and .return methods of the // Iterator interface in terms of a single ._invoke method. function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function(method) { define(prototype, method, function(arg) { return this._invoke(method, arg); }); }); } exports.isGeneratorFunction = function(genFun) { var ctor = typeof genFun === "function" && genFun.constructor; return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can // do is to check its .name property. (ctor.displayName || ctor.name) === "GeneratorFunction" : false; }; exports.mark = function(genFun) { if (Object.setPrototypeOf) { Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); } else { genFun.__proto__ = GeneratorFunctionPrototype; define(genFun, toStringTagSymbol, "GeneratorFunction"); } genFun.prototype = Object.create(Gp); return genFun; }; // Within the body of any async function, `await x` is transformed to // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // `hasOwn.call(value, "__await")` to determine if the yielded value is // meant to be awaited. exports.awrap = function(arg) { return { __await: arg }; }; function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (record.type === "throw") { reject(record.arg); } else { var result = record.arg; var value = result.value; if (value && typeof value === "object" && hasOwn.call(value, "__await")) { return PromiseImpl.resolve(value.__await).then(function(value) { invoke("next", value, resolve, reject); }, function(err) { invoke("throw", err, resolve, reject); }); } return PromiseImpl.resolve(value).then(function(unwrapped) { // When a yielded Promise is resolved, its final value becomes // the .value of the Promise<{value,done}> result for the // current iteration. result.value = unwrapped; resolve(result); }, function(error) { // If a rejected Promise was yielded, throw the rejection back // into the async generator function so it can be handled there. return invoke("throw", error, resolve, reject); }); } } var previousPromise; function enqueue(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function(resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = // If enqueue has been called before, then we want to wait until // all previous Promises have been resolved before calling invoke, // so that results are always delivered in the correct order. If // enqueue has not been called before, then it is important to // call invoke immediately, without waiting on a callback to fire, // so that the async generator function has the opportunity to do // any necessary setup in a predictable way. This predictability // is why the Promise constructor synchronously invokes its // executor callback, and why async functions synchronously // execute code before the first await. Since we implement simple // async functions in terms of async generators, it is especially // important to get this right, even though it requires care. previousPromise ? previousPromise.then( callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later // invocations of the iterator. callInvokeWithMethodAndArg ) : callInvokeWithMethodAndArg(); } // Define the unified helper method that is used to implement .next, // .throw, and .return (see defineIteratorMethods). this._invoke = enqueue; } defineIteratorMethods(AsyncIterator.prototype); AsyncIterator.prototype[asyncIteratorSymbol] = function () { return this; }; exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of // AsyncIterator objects; they just return a Promise for the value of // the final result produced by the iterator. exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) { if (PromiseImpl === void 0) PromiseImpl = Promise; var iter = new AsyncIterator( wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl ); return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator. : iter.next().then(function(result) { return result.done ? result.value : iter.next(); }); }; function makeInvokeMethod(innerFn, self, context) { var state = GenStateSuspendedStart; return function invoke(method, arg) { if (state === GenStateExecuting) { throw new Error("Generator is already running"); } if (state === GenStateCompleted) { if (method === "throw") { throw arg; } // Be forgiving, per 25.3.3.3.3 of the spec: // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume return doneResult(); } context.method = method; context.arg = arg; while (true) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (context.method === "next") { // Setting context._sent for legacy support of Babel's // function.sent implementation. context.sent = context._sent = context.arg; } else if (context.method === "throw") { if (state === GenStateSuspendedStart) { state = GenStateCompleted; throw context.arg; } context.dispatchException(context.arg); } else if (context.method === "return") { context.abrupt("return", context.arg); } state = GenStateExecuting; var record = tryCatch(innerFn, self, context); if (record.type === "normal") { // If an exception is thrown from innerFn, we leave state === // GenStateExecuting and loop back for another invocation. state = context.done ? GenStateCompleted : GenStateSuspendedYield; if (record.arg === ContinueSentinel) { continue; } return { value: record.arg, done: context.done }; } else if (record.type === "throw") { state = GenStateCompleted; // Dispatch the exception by looping back around to the // context.dispatchException(context.arg) call above. context.method = "throw"; context.arg = record.arg; } } }; } // Call delegate.iterator[context.method](context.arg) and handle the // result, either by returning a { value, done } result from the // delegate iterator, or by modifying context.method and context.arg, // setting context.delegate to null, and returning the ContinueSentinel. function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (method === undefined) { // A .throw or .return when the delegate iterator has no .throw // method always terminates the yield* loop. context.delegate = null; if (context.method === "throw") { // Note: ["return"] must be used for ES3 parsing compatibility. if (delegate.iterator["return"]) { // If the delegate iterator has a return method, give it a // chance to clean up. context.method = "return"; context.arg = undefined; maybeInvokeDelegate(delegate, context); if (context.method === "throw") { // If maybeInvokeDelegate(context) changed context.method from // "return" to "throw", let that override the TypeError below. return ContinueSentinel; } } context.method = "throw"; context.arg = new TypeError( "The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (record.type === "throw") { context.method = "throw"; context.arg = record.arg; context.delegate = null; return ContinueSentinel; } var info = record.arg; if (! info) { context.method = "throw"; context.arg = new TypeError("iterator result is not an object"); context.delegate = null; return ContinueSentinel; } if (info.done) { // Assign the result of the finished delegate to the temporary // variable specified by delegate.resultName (see delegateYield). context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield). context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the // exception, let the outer generator proceed normally. If // context.method was "next", forget context.arg since it has been // "consumed" by the delegate iterator. If context.method was // "return", allow the original .return call to continue in the // outer generator. if (context.method !== "return") { context.method = "next"; context.arg = undefined; } } else { // Re-yield the result returned by the delegate method. return info; } // The delegate iterator is finished, so forget it and continue with // the outer generator. context.delegate = null; return ContinueSentinel; } // Define Generator.prototype.{next,throw,return} in terms of the // unified ._invoke helper method. defineIteratorMethods(Gp); define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the // @@iterator function is called on it. Some browsers' implementations of the // iterator prototype chain incorrectly implement this, causing the Generator // object to not be returned from this call. This ensures that doesn't happen. // See https://github.com/facebook/regenerator/issues/274 for more details. Gp[iteratorSymbol] = function() { return this; }; Gp.toString = function() { return "[object Generator]"; }; function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; if (1 in locs) { entry.catchLoc = locs[1]; } if (2 in locs) { entry.finallyLoc = locs[2]; entry.afterLoc = locs[3]; } this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal"; delete record.arg; entry.completion = record; } function Context(tryLocsList) { // The root entry object (effectively a try statement without a catch // or a finally block) gives us a place to store values thrown from // locations where there is no enclosing try statement. this.tryEntries = [{ tryLoc: "root" }]; tryLocsList.forEach(pushTryEntry, this); this.reset(true); } exports.keys = function(object) { var keys = []; for (var key in object) { keys.push(key); } keys.reverse(); // Rather than returning an object with a next method, we keep // things simple and return the next function itself. return function next() { while (keys.length) { var key = keys.pop(); if (key in object) { next.value = key; next.done = false; return next; } } // To avoid creating an additional object, we just hang the .value // and .done properties off the next function object itself. This // also ensures that the minifier will not anonymize the function. next.done = true; return next; }; }; function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) { return iteratorMethod.call(iterable); } if (typeof iterable.next === "function") { return iterable; } if (!isNaN(iterable.length)) { var i = -1, next = function next() { while (++i < iterable.length) { if (hasOwn.call(iterable, i)) { next.value = iterable[i]; next.done = false; return next; } } next.value = undefined; next.done = true; return next; }; return next.next = next; } } // Return an iterator with no values. return { next: doneResult }; } exports.values = values; function doneResult() { return { value: undefined, done: true }; } Context.prototype = { constructor: Context, reset: function(skipTempReset) { this.prev = 0; this.next = 0; // Resetting context._sent for legacy support of Babel's // function.sent implementation. this.sent = this._sent = undefined; this.done = false; this.delegate = null; this.method = "next"; this.arg = undefined; this.tryEntries.forEach(resetTryEntry); if (!skipTempReset) { for (var name in this) { // Not sure about the optimal order of these conditions: if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) { this[name] = undefined; } } } }, stop: function() { this.done = true; var rootEntry = this.tryEntries[0]; var rootRecord = rootEntry.completion; if (rootRecord.type === "throw") { throw rootRecord.arg; } return this.rval; }, dispatchException: function(exception) { if (this.done) { throw exception; } var context = this; function handle(loc, caught) { record.type = "throw"; record.arg = exception; context.next = loc; if (caught) { // If the dispatched exception was caught by a catch block, // then let that catch block handle the exception normally. context.method = "next"; context.arg = undefined; } return !! caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; var record = entry.completion; if (entry.tryLoc === "root") { // Exception thrown outside of any try block that could handle // it, so set the completion value of the entire function to // throw the exception. return handle("end"); } if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"); var hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } else if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else if (hasCatch) { if (this.prev < entry.catchLoc) { return handle(entry.catchLoc, true); } } else if (hasFinally) { if (this.prev < entry.finallyLoc) { return handle(entry.finallyLoc); } } else { throw new Error("try statement without catch or finally"); } } } }, abrupt: function(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) { // Ignore the finally entry if control is not jumping to a // location outside the try/catch block. finallyEntry = null; } var record = finallyEntry ? finallyEntry.completion : {}; record.type = type; record.arg = arg; if (finallyEntry) { this.method = "next"; this.next = finallyEntry.finallyLoc; return ContinueSentinel; } return this.complete(record); }, complete: function(record, afterLoc) { if (record.type === "throw") { throw record.arg; } if (record.type === "break" || record.type === "continue") { this.next = record.arg; } else if (record.type === "return") { this.rval = this.arg = record.arg; this.method = "return"; this.next = "end"; } else if (record.type === "normal" && afterLoc) { this.next = afterLoc; } return ContinueSentinel; }, finish: function(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) { this.complete(entry.completion, entry.afterLoc); resetTryEntry(entry); return ContinueSentinel; } } }, "catch": function(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (record.type === "throw") { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } // The context.catch method must only be called with a location // argument that corresponds to a known catch block. throw new Error("illegal catch attempt"); }, delegateYield: function(iterable, resultName, nextLoc) { this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }; if (this.method === "next") { // Deliberately forget the last sent value so that we don't // accidentally pass it on to the delegate. this.arg = undefined; } return ContinueSentinel; } }; // Regardless of whether this script is executing as a CommonJS module // or not, return the runtime object so that we can declare the variable // regeneratorRuntime in the outer scope, which allows this module to be // injected easily by `bin/regenerator --include-runtime script.js`. return exports; }( // If this script is executing as a CommonJS module, use module.exports // as the regeneratorRuntime namespace. Otherwise create a new empty // object. Either way, the resulting object will be used to initialize // the regeneratorRuntime variable at the top of this file. true ? module.exports : undefined )); try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { // This module should not be running in strict mode, so the above // assignment should always work unless something is misconfigured. Just // in case runtime.js accidentally runs in strict mode, we can escape // strict mode using a global Function call. This could conceivably fail // if a Content Security Policy forbids using Function, but in that case // the proper solution is to fix the accidental strict mode problem. If // you've misconfigured your bundler to force strict mode and applied a // CSP to forbid Function, and you're not willing to fix either of those // problems, please detail your unique predicament in a GitHub issue. Function("r", "regeneratorRuntime = r")(runtime); } /***/ }), /***/ "./node_modules/webpack/buildin/global.js": /*!***********************************!*\ !*** (webpack)/buildin/global.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || new Function("return this")(); } catch (e) { // This works if the window reference is available if (typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /***/ "./node_modules/webpack/buildin/module.js": /*!***********************************!*\ !*** (webpack)/buildin/module.js ***! \***********************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = function(module) { if (!module.webpackPolyfill) { module.deprecate = function() {}; module.paths = []; // module.parent = undefined by default if (!module.children) module.children = []; Object.defineProperty(module, "loaded", { enumerable: true, get: function() { return module.l; } }); Object.defineProperty(module, "id", { enumerable: true, get: function() { return module.i; } }); module.webpackPolyfill = 1; } return module; }; /***/ }), /***/ "./resources/js/parts/agora/message.js": /*!*********************************************!*\ !*** ./resources/js/parts/agora/message.js ***! \*********************************************/ /*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony import */ var _rtm_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rtm-client */ "./resources/js/parts/agora/rtm-client.js"); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } (function ($) { "use strict"; var chatView = $('#chatView'); var agoraLoading = $('.agora-loading'); var chatItemHtml = function chatItemHtml(message, memberName, date) { return "<div class=\"chat-card mt-25 mx-15\">\n <div>\n <span>".concat(memberName, "</span>\n <span class=\"ml-10 pl-10 border-left border-gray200\">").concat(date, "</span>\n </div>\n\n <p class=\"bg-gray200 p-15 font-14 font-weight-500 mt-1 rounded-sm\">").concat(message, "</p>\n </div>"); }; var joinedHtml = function joinedHtml(username) { return "<div class=\"user-card d-flex align-items-center border border-gray200 p-15 mx-15 mt-25 rounded-sm\">\n <div class=\"avatar\">\n <img src=\"".concat(userDefaultAvatar, "\" alt=\"\" class=\"img-cover rounded-circle\">\n </div>\n <div class=\"ml-10\">\n <span class=\"font-14 font-weight-500 d-block text-dark\">").concat(username, "</span>\n <span class=\"font-12 text-gray\">").concat(joinedToChannel, "</span>\n </div>\n </div>"); }; function handleLogin(rtm, callback) { if (rtm._logined) { return false; } try { rtm.init(appId); window.rtm = rtm; rtm.login(accountName, rtmToken).then(function () { console.log('login'); rtm._logined = true; callback(); })["catch"](function (err) { console.log(err); }); } catch (err) { console.error(err); } } function handleJoinToChannel(rtm, callback) { if (!rtm._logined) { return false; } rtm.joinChannel(channelName).then(function () { chatView.append(joinedHtml(rtm.accountName)); rtm.channels[channelName].joined = true; callback(); })["catch"](function (err) { console.error(err); }); } $(function () { var rtm = new _rtm_client__WEBPACK_IMPORTED_MODULE_0__["default"](); // login user by token handleLogin(rtm, function () { // join to channel handleJoinToChannel(rtm, function () { agoraLoading.addClass('d-none'); rtm.on('MemberJoined', function (_ref) { var channelName = _ref.channelName, args = _ref.args; var memberId = args[0]; chatView.append(joinedHtml(memberId)); }); rtm.on('MemberLeft', function (_ref2) { var channelName = _ref2.channelName, args = _ref2.args; var memberId = args[0]; // }); rtm.on('ChannelMessage', function (_ref3) { var channelName = _ref3.channelName, args = _ref3.args; var _args = _slicedToArray(args, 3), message = _args[0], memberId = _args[1], other = _args[2]; var date = new Date(other.serverReceivedTs).toLocaleTimeString(); chatView.append(chatItemHtml(message.text, memberId, date)); }); }); }); }); function sendMessage() { if (!rtm._logined) { alert('Please Login First'); return false; } var messageInput = $('#messageInput'); var message = messageInput.val(); if (message && message !== '') { rtm.sendChannelMessage(message, channelName).then(function () { var date = new Date().toLocaleTimeString(); chatView.append(chatItemHtml(message, rtm.accountName, date)); messageInput.val(''); })["catch"](function (err) { console.error(err); }); } } $('body').on('click', '#sendMessage', function (e) { e.preventDefault(); sendMessage(); }); })(jQuery); /***/ }), /***/ "./resources/js/parts/agora/rtm-client.js": /*!************************************************!*\ !*** ./resources/js/parts/agora/rtm-client.js ***! \************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return RTMClient; }); /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ "./node_modules/@babel/runtime/regenerator/index.js"); /* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var agora_rtm_sdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! agora-rtm-sdk */ "./node_modules/agora-rtm-sdk/index.js"); /* harmony import */ var agora_rtm_sdk__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(agora_rtm_sdk__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! events */ "./node_modules/events/events.js"); /* harmony import */ var events__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(events__WEBPACK_IMPORTED_MODULE_2__); function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } var RTMClient = /*#__PURE__*/function (_EventEmitter) { _inherits(RTMClient, _EventEmitter); var _super = _createSuper(RTMClient); function RTMClient() { var _this; _classCallCheck(this, RTMClient); _this = _super.call(this); _this.channels = {}; _this._logined = false; return _this; } _createClass(RTMClient, [{ key: "init", value: function init(appId) { this.client = agora_rtm_sdk__WEBPACK_IMPORTED_MODULE_1___default.a.createInstance(appId); this.subscribeClientEvents(); } // subscribe client events }, { key: "subscribeClientEvents", value: function subscribeClientEvents() { var _this2 = this; var clientEvents = ['ConnectionStateChanged', 'MessageFromPeer']; clientEvents.forEach(function (eventName) { _this2.client.on(eventName, function () { var _console; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } (_console = console).log.apply(_console, ['emit ', eventName].concat(args)); // log event message _this2.emit.apply(_this2, [eventName].concat(args)); }); }); } // subscribe channel events }, { key: "subscribeChannelEvents", value: function subscribeChannelEvents(channelName) { var _this3 = this; var channelEvents = ['ChannelMessage', 'MemberJoined', 'MemberLeft']; channelEvents.forEach(function (eventName) { _this3.channels[channelName].channel.on(eventName, function () { for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { args[_key2] = arguments[_key2]; } console.log('emit ', eventName, args); _this3.emit(eventName, { channelName: channelName, args: args }); }); }); } }, { key: "login", value: function () { var _login = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(accountName, token) { return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: this.accountName = accountName; return _context.abrupt("return", this.client.login({ uid: this.accountName, token: token })); case 2: case "end": return _context.stop(); } } }, _callee, this); })); function login(_x, _x2) { return _login.apply(this, arguments); } return login; }() }, { key: "logout", value: function () { var _logout = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2() { return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: return _context2.abrupt("return", this.client.logout()); case 1: case "end": return _context2.stop(); } } }, _callee2, this); })); function logout() { return _logout.apply(this, arguments); } return logout; }() }, { key: "joinChannel", value: function () { var _joinChannel = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(name) { var channel; return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: console.log('joinChannel', name); channel = this.client.createChannel(name); this.channels[name] = { channel: channel, joined: false // channel state }; this.subscribeChannelEvents(name); return _context3.abrupt("return", channel.join()); case 5: case "end": return _context3.stop(); } } }, _callee3, this); })); function joinChannel(_x3) { return _joinChannel.apply(this, arguments); } return joinChannel; }() }, { key: "leaveChannel", value: function () { var _leaveChannel = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee4(name) { return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: console.log('leaveChannel', name); if (!(!this.channels[name] || this.channels[name] && !this.channels[name].joined)) { _context4.next = 3; break; } return _context4.abrupt("return"); case 3: return _context4.abrupt("return", this.channels[name].channel.leave()); case 4: case "end": return _context4.stop(); } } }, _callee4, this); })); function leaveChannel(_x4) { return _leaveChannel.apply(this, arguments); } return leaveChannel; }() }, { key: "sendChannelMessage", value: function () { var _sendChannelMessage = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee5(text, channelName) { return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: if (!(!this.channels[channelName] || !this.channels[channelName].joined)) { _context5.next = 2; break; } return _context5.abrupt("return"); case 2: return _context5.abrupt("return", this.channels[channelName].channel.sendMessage({ text: text })); case 3: case "end": return _context5.stop(); } } }, _callee5, this); })); function sendChannelMessage(_x5, _x6) { return _sendChannelMessage.apply(this, arguments); } return sendChannelMessage; }() }, { key: "sendPeerMessage", value: function () { var _sendPeerMessage = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee6(text, peerId) { return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee6$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: console.log('sendPeerMessage', text, peerId); return _context6.abrupt("return", this.client.sendMessageToPeer({ text: text }, peerId.toString())); case 2: case "end": return _context6.stop(); } } }, _callee6, this); })); function sendPeerMessage(_x7, _x8) { return _sendPeerMessage.apply(this, arguments); } return sendPeerMessage; }() }, { key: "queryPeersOnlineStatus", value: function () { var _queryPeersOnlineStatus = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee7(memberId) { return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee7$(_context7) { while (1) { switch (_context7.prev = _context7.next) { case 0: console.log('queryPeersOnlineStatus', memberId); return _context7.abrupt("return", this.client.queryPeersOnlineStatus([memberId])); case 2: case "end": return _context7.stop(); } } }, _callee7, this); })); function queryPeersOnlineStatus(_x9) { return _queryPeersOnlineStatus.apply(this, arguments); } return queryPeersOnlineStatus; }() //send image }, { key: "uploadImage", value: function () { var _uploadImage = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee8(blob, peerId) { var mediaMessage; return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee8$(_context8) { while (1) { switch (_context8.prev = _context8.next) { case 0: _context8.next = 2; return this.client.createMediaMessageByUploading(blob, { messageType: 'IMAGE', fileName: 'agora.jpg', description: 'send image', thumbnail: blob // width: 100, // height: 200, // thumbnailWidth: 50, // thumbnailHeight: 200, }); case 2: mediaMessage = _context8.sent; return _context8.abrupt("return", this.client.sendMessageToPeer(mediaMessage, peerId)); case 4: case "end": return _context8.stop(); } } }, _callee8, this); })); function uploadImage(_x10, _x11) { return _uploadImage.apply(this, arguments); } return uploadImage; }() }, { key: "sendChannelMediaMessage", value: function () { var _sendChannelMediaMessage = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee9(blob, channelName) { var mediaMessage; return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee9$(_context9) { while (1) { switch (_context9.prev = _context9.next) { case 0: console.log('sendChannelMessage', blob, channelName); if (!(!this.channels[channelName] || !this.channels[channelName].joined)) { _context9.next = 3; break; } return _context9.abrupt("return"); case 3: _context9.next = 5; return this.client.createMediaMessageByUploading(blob, { messageType: 'IMAGE', fileName: 'agora.jpg', description: 'send image', thumbnail: blob // width: 100, // height: 200, // thumbnailWidth: 50, // thumbnailHeight: 200, }); case 5: mediaMessage = _context9.sent; return _context9.abrupt("return", this.channels[channelName].channel.sendMessage(mediaMessage)); case 7: case "end": return _context9.stop(); } } }, _callee9, this); })); function sendChannelMediaMessage(_x12, _x13) { return _sendChannelMediaMessage.apply(this, arguments); } return sendChannelMediaMessage; }() }, { key: "cancelImage", value: function () { var _cancelImage = _asyncToGenerator( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee10(message) { var controller; return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee10$(_context10) { while (1) { switch (_context10.prev = _context10.next) { case 0: controller = new AbortController(); setTimeout(function () { return controller.abort(); }, 1000); _context10.next = 4; return this.client.downloadMedia(message.mediaId, { cancelSignal: controller.signal, onOperationProgress: function onOperationProgress(_ref) { var currentSize = _ref.currentSize, totalSize = _ref.totalSize; console.log(currentSize, totalSize); } }); case 4: case "end": return _context10.stop(); } } }, _callee10, this); })); function cancelImage(_x14) { return _cancelImage.apply(this, arguments); } return cancelImage; }() }]); return RTMClient; }(events__WEBPACK_IMPORTED_MODULE_2___default.a); /***/ }), /***/ 0: /*!***************************************************!*\ !*** multi ./resources/js/parts/agora/message.js ***! \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(/*! /home/jack/projects/webinar/resources/js/parts/agora/message.js */"./resources/js/parts/agora/message.js"); /***/ }) /******/ });