@rongcloud/engine 5.2.5-alpha.1 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/index.d.ts → index.d.ts} +322 -12
- package/index.esm.js +18 -0
- package/index.js +18 -0
- package/package.json +15 -26
- package/dist/index.esm.js +0 -18
- package/dist/index.js +0 -18
- package/dist/index.umd.js +0 -1
package/dist/index.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).RCEngine={})}(this,(function(e){"use strict";var t;!function(e){e[e.READ=1]="READ",e[e.LISTENED=2]="LISTENED",e[e.DOWNLOADED=4]="DOWNLOADED",e[e.RETRIEVED=8]="RETRIEVED",e[e.UNREAD=0]="UNREAD"}(t||(t={}));var n=t;function r(e){return(r="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 i(e,t,n,r,i,s,a){try{var o=e[s](a),u=o.value}catch(e){return void n(e)}o.done?t(u):Promise.resolve(u).then(r,i)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,s){var a=e.apply(t,n);function o(e){i(a,r,s,o,u,"next",e)}function u(e){i(a,r,s,o,u,"throw",e)}o(void 0)}))}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(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 u(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(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 h(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function f(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&&p(e,t)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(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 y(e,t,n){return(y=v()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&p(i,n.prototype),i}).apply(null,arguments)}function m(e){var t="function"==typeof Map?new Map:void 0;return(m=function(e){if(null===e||(n=e,-1===Function.toString.call(n).indexOf("[native code]")))return e;var n;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,r)}function r(){return y(e,arguments,d(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),p(r,e)})(e)}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_(e):t}function T(e){var t=v();return function(){var n,r=d(e);if(t){var i=d(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return E(this,n)}}function R(e,t,n){return(R="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null==n)return;var r,i,s=[],a=!0,o=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(s.push(r.value),!t||s.length!==t);a=!0);}catch(e){o=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(o)throw i}}return s}(e,t)||S(e,t)||function(){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 C(e){return function(e){if(Array.isArray(e))return b(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||S(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function O(e){var t={exports:{}};return e(t,t.exports),t.exports}var N=function(e){return e&&e.Math==Math&&e},k=N("object"==typeof globalThis&&globalThis)||N("object"==typeof window&&window)||N("object"==typeof self&&self)||N("object"==typeof w&&w)||function(){return this}()||Function("return this")(),M=function(e){try{return!!e()}catch(e){return!0}},A=!M((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),U={}.propertyIsEnumerable,L=Object.getOwnPropertyDescriptor,x={f:L&&!U.call({1:2},1)?function(e){var t=L(this,e);return!!t&&t.enumerable}:U},P=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},D={}.toString,V=function(e){return D.call(e).slice(8,-1)},B="".split,G=M((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==V(e)?B.call(e,""):Object(e)}:Object,F=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},q=function(e){return G(F(e))},K=function(e){return"object"==typeof e?null!==e:"function"==typeof e},j=function(e,t){if(!K(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!K(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!K(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!K(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},H=function(e){return Object(F(e))},Y={}.hasOwnProperty,Q=function(e,t){return Y.call(H(e),t)},W=k.document,J=K(W)&&K(W.createElement),z=function(e){return J?W.createElement(e):{}},Z=!A&&!M((function(){return 7!=Object.defineProperty(z("div"),"a",{get:function(){return 7}}).a})),X=Object.getOwnPropertyDescriptor,$={f:A?X:function(e,t){if(e=q(e),t=j(t,!0),Z)try{return X(e,t)}catch(e){}if(Q(e,t))return P(!x.f.call(e,t),e[t])}},ee=function(e){if(!K(e))throw TypeError(String(e)+" is not an object");return e},te=Object.defineProperty,ne={f:A?te:function(e,t,n){if(ee(e),t=j(t,!0),ee(n),Z)try{return te(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}},re=A?function(e,t,n){return ne.f(e,t,P(1,n))}:function(e,t,n){return e[t]=n,e},ie=function(e,t){try{re(k,e,t)}catch(n){k[e]=t}return t},se="__core-js_shared__",ae=k[se]||ie(se,{}),oe=Function.toString;"function"!=typeof ae.inspectSource&&(ae.inspectSource=function(e){return oe.call(e)});var ue,ce,le,he=ae.inspectSource,fe=k.WeakMap,de="function"==typeof fe&&/native code/.test(he(fe)),ge=O((function(e){(e.exports=function(e,t){return ae[e]||(ae[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.11.0",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),pe=0,ve=Math.random(),ye=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++pe+ve).toString(36)},me=ge("keys"),_e=function(e){return me[e]||(me[e]=ye(e))},Ee={},Te="Object already initialized",Re=k.WeakMap;if(de){var Ie=ae.state||(ae.state=new Re),Ce=Ie.get,Se=Ie.has,be=Ie.set;ue=function(e,t){if(Se.call(Ie,e))throw new TypeError(Te);return t.facade=e,be.call(Ie,e,t),t},ce=function(e){return Ce.call(Ie,e)||{}},le=function(e){return Se.call(Ie,e)}}else{var we=_e("state");Ee[we]=!0,ue=function(e,t){if(Q(e,we))throw new TypeError(Te);return t.facade=e,re(e,we,t),t},ce=function(e){return Q(e,we)?e[we]:{}},le=function(e){return Q(e,we)}}var Oe={set:ue,get:ce,has:le,enforce:function(e){return le(e)?ce(e):ue(e,{})},getterFor:function(e){return function(t){var n;if(!K(t)||(n=ce(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},Ne=O((function(e){var t=Oe.get,n=Oe.enforce,r=String(String).split("String");(e.exports=function(e,t,i,s){var a,o=!!s&&!!s.unsafe,u=!!s&&!!s.enumerable,c=!!s&&!!s.noTargetGet;"function"==typeof i&&("string"!=typeof t||Q(i,"name")||re(i,"name",t),(a=n(i)).source||(a.source=r.join("string"==typeof t?t:""))),e!==k?(o?!c&&e[t]&&(u=!0):delete e[t],u?e[t]=i:re(e,t,i)):u?e[t]=i:ie(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||he(this)}))})),ke=k,Me=function(e){return"function"==typeof e?e:void 0},Ae=function(e,t){return arguments.length<2?Me(ke[e])||Me(k[e]):ke[e]&&ke[e][t]||k[e]&&k[e][t]},Ue=Math.ceil,Le=Math.floor,xe=function(e){return isNaN(e=+e)?0:(e>0?Le:Ue)(e)},Pe=Math.min,De=function(e){return e>0?Pe(xe(e),9007199254740991):0},Ve=Math.max,Be=Math.min,Ge=function(e,t){var n=xe(e);return n<0?Ve(n+t,0):Be(n,t)},Fe=function(e){return function(t,n,r){var i,s=q(t),a=De(s.length),o=Ge(r,a);if(e&&n!=n){for(;a>o;)if((i=s[o++])!=i)return!0}else for(;a>o;o++)if((e||o in s)&&s[o]===n)return e||o||0;return!e&&-1}},qe={includes:Fe(!0),indexOf:Fe(!1)},Ke=qe.indexOf,je=function(e,t){var n,r=q(e),i=0,s=[];for(n in r)!Q(Ee,n)&&Q(r,n)&&s.push(n);for(;t.length>i;)Q(r,n=t[i++])&&(~Ke(s,n)||s.push(n));return s},He=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ye=He.concat("length","prototype"),Qe={f:Object.getOwnPropertyNames||function(e){return je(e,Ye)}},We={f:Object.getOwnPropertySymbols},Je=Ae("Reflect","ownKeys")||function(e){var t=Qe.f(ee(e)),n=We.f;return n?t.concat(n(e)):t},ze=function(e,t){for(var n=Je(t),r=ne.f,i=$.f,s=0;s<n.length;s++){var a=n[s];Q(e,a)||r(e,a,i(t,a))}},Ze=/#|\.prototype\./,Xe=function(e,t){var n=et[$e(e)];return n==nt||n!=tt&&("function"==typeof t?M(t):!!t)},$e=Xe.normalize=function(e){return String(e).replace(Ze,".").toLowerCase()},et=Xe.data={},tt=Xe.NATIVE="N",nt=Xe.POLYFILL="P",rt=Xe,it=$.f,st=function(e,t){var n,r,i,s,a,o=e.target,u=e.global,c=e.stat;if(n=u?k:c?k[o]||ie(o,{}):(k[o]||{}).prototype)for(r in t){if(s=t[r],i=e.noTargetGet?(a=it(n,r))&&a.value:n[r],!rt(u?r:o+(c?".":"#")+r,e.forced)&&void 0!==i){if(typeof s==typeof i)continue;ze(s,i)}(e.sham||i&&i.sham)&&re(s,"sham",!0),Ne(n,r,s,e)}},at=function(){var e=ee(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};function ot(e,t){return RegExp(e,t)}var ut={UNSUPPORTED_Y:M((function(){var e=ot("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:M((function(){var e=ot("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},ct=RegExp.prototype.exec,lt=ge("native-string-replace",String.prototype.replace),ht=ct,ft=function(){var e=/a/,t=/b*/g;return ct.call(e,"a"),ct.call(t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),dt=ut.UNSUPPORTED_Y||ut.BROKEN_CARET,gt=void 0!==/()??/.exec("")[1];(ft||gt||dt)&&(ht=function(e){var t,n,r,i,s=this,a=dt&&s.sticky,o=at.call(s),u=s.source,c=0,l=e;return a&&(-1===(o=o.replace("y","")).indexOf("g")&&(o+="g"),l=String(e).slice(s.lastIndex),s.lastIndex>0&&(!s.multiline||s.multiline&&"\n"!==e[s.lastIndex-1])&&(u="(?: "+u+")",l=" "+l,c++),n=new RegExp("^(?:"+u+")",o)),gt&&(n=new RegExp("^"+u+"$(?!\\s)",o)),ft&&(t=s.lastIndex),r=ct.call(a?n:s,l),a?r?(r.input=r.input.slice(c),r[0]=r[0].slice(c),r.index=s.lastIndex,s.lastIndex+=r[0].length):s.lastIndex=0:ft&&r&&(s.lastIndex=s.global?r.index+r[0].length:t),gt&&r&&r.length>1&<.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r});var pt=ht;st({target:"RegExp",proto:!0,forced:/./.exec!==pt},{exec:pt});var vt,yt,mt="process"==V(k.process),_t=Ae("navigator","userAgent")||"",Et=k.process,Tt=Et&&Et.versions,Rt=Tt&&Tt.v8;Rt?yt=(vt=Rt.split("."))[0]+vt[1]:_t&&(!(vt=_t.match(/Edge\/(\d+)/))||vt[1]>=74)&&(vt=_t.match(/Chrome\/(\d+)/))&&(yt=vt[1]);var It=yt&&+yt,Ct=!!Object.getOwnPropertySymbols&&!M((function(){return!Symbol.sham&&(mt?38===It:It>37&&It<41)})),St=Ct&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,bt=ge("wks"),wt=k.Symbol,Ot=St?wt:wt&&wt.withoutSetter||ye,Nt=function(e){return Q(bt,e)&&(Ct||"string"==typeof bt[e])||(Ct&&Q(wt,e)?bt[e]=wt[e]:bt[e]=Ot("Symbol."+e)),bt[e]},kt=Nt("species"),Mt=!M((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),At="$0"==="a".replace(/./,"$0"),Ut=Nt("replace"),Lt=!!/./[Ut]&&""===/./[Ut]("a","$0"),xt=!M((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Pt=function(e,t,n,r){var i=Nt(e),s=!M((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=s&&!M((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[kt]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!s||!a||"replace"===e&&(!Mt||!At||Lt)||"split"===e&&!xt){var o=/./[i],u=n(i,""[e],(function(e,t,n,r,i){return t.exec===RegExp.prototype.exec?s&&!i?{done:!0,value:o.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:At,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:Lt}),c=u[0],l=u[1];Ne(String.prototype,e,c),Ne(RegExp.prototype,i,2==t?function(e,t){return l.call(e,this,t)}:function(e){return l.call(e,this)})}r&&re(RegExp.prototype[i],"sham",!0)},Dt=function(e){return function(t,n){var r,i,s=String(F(t)),a=xe(n),o=s.length;return a<0||a>=o?e?"":void 0:(r=s.charCodeAt(a))<55296||r>56319||a+1===o||(i=s.charCodeAt(a+1))<56320||i>57343?e?s.charAt(a):r:e?s.slice(a,a+2):i-56320+(r-55296<<10)+65536}},Vt={codeAt:Dt(!1),charAt:Dt(!0)},Bt=Vt.charAt,Gt=function(e,t,n){return t+(n?Bt(e,t).length:1)},Ft=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==V(e))throw TypeError("RegExp#exec called on incompatible receiver");return pt.call(e,t)};Pt("match",1,(function(e,t,n){return[function(t){var n=F(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;var i=ee(e),s=String(this);if(!i.global)return Ft(i,s);var a=i.unicode;i.lastIndex=0;for(var o,u=[],c=0;null!==(o=Ft(i,s));){var l=String(o[0]);u[c]=l,""===l&&(i.lastIndex=Gt(s,De(i.lastIndex),a)),c++}return 0===c?null:u}]}));var qt=Array.isArray||function(e){return"Array"==V(e)},Kt=function(e,t,n){var r=j(t);r in e?ne.f(e,r,P(0,n)):e[r]=n},jt=Nt("species"),Ht=function(e,t){var n;return qt(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!qt(n.prototype)?K(n)&&null===(n=n[jt])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},Yt=Nt("species"),Qt=function(e){return It>=51||!M((function(){var t=[];return(t.constructor={})[Yt]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Wt=Nt("isConcatSpreadable"),Jt=9007199254740991,zt="Maximum allowed index exceeded",Zt=It>=51||!M((function(){var e=[];return e[Wt]=!1,e.concat()[0]!==e})),Xt=Qt("concat"),$t=function(e){if(!K(e))return!1;var t=e[Wt];return void 0!==t?!!t:qt(e)};st({target:"Array",proto:!0,forced:!Zt||!Xt},{concat:function(e){var t,n,r,i,s,a=H(this),o=Ht(a,0),u=0;for(t=-1,r=arguments.length;t<r;t++)if($t(s=-1===t?a:arguments[t])){if(u+(i=De(s.length))>Jt)throw TypeError(zt);for(n=0;n<i;n++,u++)n in s&&Kt(o,u,s[n])}else{if(u>=Jt)throw TypeError(zt);Kt(o,u++,s)}return o.length=u,o}});var en,tn,nn=72e5,rn=5e3,sn=5e3,an=["https://nav.cn.ronghub.com","https://nav2-cn.ronghub.com"],on=["wsproxy.cn.ronghub.com","wsap-cn.ronghub.com"],un=["cometproxy-cn.ronghub.com","mini-cn.ronghub.com"],cn=3e4,ln=131072,hn="RCV4-",fn=4096,dn={"RC:TxtMsg":{isCounted:!0,isPersited:!0},"RC:ImgMsg":{isCounted:!0,isPersited:!0},"RC:VcMsg":{isCounted:!0,isPersited:!0},"RC:ImgTextMsg":{isCounted:!0,isPersited:!0},"RC:FileMsg":{isCounted:!0,isPersited:!0},"RC:HQVCMsg":{isCounted:!0,isPersited:!0},"RC:LBSMsg":{isCounted:!0,isPersited:!0},"RC:PSImgTxtMsg":{isCounted:!0,isPersited:!0},"RC:PSMultiImgTxtMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpOpendMsg":{isCounted:!0,isPersited:!0},"RC:CombineMsg":{isCounted:!0,isPersited:!0},"RC:ReferenceMsg":{isCounted:!0,isPersited:!0},"RC:SightMsg":{isCounted:!0,isPersited:!0},"RC:GIFMsg":{isCounted:!0,isPersited:!0},"RC:InfoNtf":{isCounted:!1,isPersited:!0},"RC:ContactNtf":{isCounted:!1,isPersited:!0},"RC:ProfileNtf":{isCounted:!1,isPersited:!0},"RC:CmdNtf":{isCounted:!1,isPersited:!0},"RC:GrpNtf":{isCounted:!1,isPersited:!0},"RC:RcCmd":{isCounted:!1,isPersited:!0},"RC:CmdMsg":{isCounted:!1,isPersited:!1},"RC:TypSts":{isCounted:!1,isPersited:!1},"RC:PSCmd":{isCounted:!1,isPersited:!1},"RC:SRSMsg":{isCounted:!1,isPersited:!1},"RC:RRReqMsg":{isCounted:!1,isPersited:!1},"RC:RRRspMsg":{isCounted:!1,isPersited:!1},"RC:CsChaR":{isCounted:!1,isPersited:!1},"RC:CSCha":{isCounted:!1,isPersited:!1},"RC:CsEva":{isCounted:!1,isPersited:!1},"RC:CsContact":{isCounted:!1,isPersited:!1},"RC:CsHs":{isCounted:!1,isPersited:!1},"RC:CsHsR":{isCounted:!1,isPersited:!1},"RC:CsSp":{isCounted:!1,isPersited:!1},"RC:CsEnd":{isCounted:!1,isPersited:!1},"RC:CsUpdate":{isCounted:!1,isPersited:!1},"RC:ReadNtf":{isCounted:!1,isPersited:!1},"RC:chrmKVNotiMsg":{isCounted:!1,isPersited:!1},"RC:VCAccept":{isCounted:!1,isPersited:!1},"RC:VCRinging":{isCounted:!1,isPersited:!1},"RC:VCSummary":{isCounted:!1,isPersited:!1},"RC:VCHangup":{isCounted:!1,isPersited:!1},"RC:VCInvite":{isCounted:!1,isPersited:!1},"RC:VCModifyMedia":{isCounted:!1,isPersited:!1},"RC:VCModifyMem":{isCounted:!1,isPersited:!1},"RC:MsgExMsg":{isCounted:!1,isPersited:!1},"RC:RRMsg":{isCounted:!1,isPersited:!1},"RC:LogCmdMsg":{isCounted:!1,isPersited:!1},"RC:InterceptMsg":{isCounted:!1,isPersited:!1}},gn=["RC:TypSts","RC:InterceptMsg"];e.CONNECTION_TYPE=void 0,(en=e.CONNECTION_TYPE||(e.CONNECTION_TYPE={})).WEBSOCKET="websocket",en.COMET="comet";var pn=function(e){return tn||(tn={set:function(t,n){e.localStorage.setItem(t,JSON.stringify(n))},get:function(t){var n;try{n=JSON.parse(e.localStorage.getItem(t))}catch(e){n=null}return n},remove:function(t){return e.localStorage.removeItem(t)},getKeys:function(){var t=[];for(var n in e.localStorage)t.push(n);return t}}),tn},vn=function(){function e(t){a(this,e),this._caches={},t&&(this._caches=t)}return u(e,[{key:"set",value:function(e,t){this._caches[e]=t}},{key:"remove",value:function(e){var t=this.get(e);return delete this._caches[e],t}},{key:"get",value:function(e){return this._caches[e]}},{key:"getKeys",value:function(){var e=[];for(var t in this._caches)e.push(t);return e}}]),e}(),yn=function(){function e(t,n){a(this,e);var r=n?"".concat(hn).concat(n):hn;this._rootStorage=pn(t);var i=this._rootStorage.get(r)||{};this._cache=new vn(c({},r,i)),this._storageKey=r}return u(e,[{key:"_get",value:function(){var e=this._storageKey;return this._cache.get(e)||{}}},{key:"_set",value:function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)}},{key:"set",value:function(e,t){var n=this._get();n[e]=t,this._set(n)}},{key:"remove",value:function(e){var t=this._get();delete t[e],this._set(t)}},{key:"clear",value:function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)}},{key:"get",value:function(e){return this._get()[e]}},{key:"getKeys",value:function(){var e=this._get(),t=[];for(var n in e)t.push(n);return t}},{key:"getValues",value:function(){return this._get()||{}}}]),e}(),mn=function(e){f(n,e);var t=T(n);function n(e){return a(this,n),t.call(this,"TODO => ".concat(e))}return n}(m(Error)),_n=Qt("slice"),En=Nt("species"),Tn=[].slice,Rn=Math.max;st({target:"Array",proto:!0,forced:!_n},{slice:function(e,t){var n,r,i,s=q(this),a=De(s.length),o=Ge(e,a),u=Ge(void 0===t?a:t,a);if(qt(s)&&("function"!=typeof(n=s.constructor)||n!==Array&&!qt(n.prototype)?K(n)&&null===(n=n[En])&&(n=void 0):n=void 0,n===Array||void 0===n))return Tn.call(s,o,u);for(r=new(void 0===n?Array:n)(Rn(u-o,0)),i=0;o<u;o++,i++)o in s&&Kt(r,i,s[o]);return r.length=i,r}});var In=Math.floor,Cn="".replace,Sn=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,bn=/\$([$&'`]|\d{1,2})/g,wn=function(e,t,n,r,i,s){var a=n+e.length,o=r.length,u=bn;return void 0!==i&&(i=H(i),u=Sn),Cn.call(s,u,(function(s,u){var c;switch(u.charAt(0)){case"$":return"$";case"&":return e;case"`":return t.slice(0,n);case"'":return t.slice(a);case"<":c=i[u.slice(1,-1)];break;default:var l=+u;if(0===l)return s;if(l>o){var h=In(l/10);return 0===h?s:h<=o?void 0===r[h-1]?u.charAt(1):r[h-1]+u.charAt(1):s}c=r[l-1]}return void 0===c?"":c}))},On=Math.max,Nn=Math.min;Pt("replace",2,(function(e,t,n,r){var i=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,s=r.REPLACE_KEEPS_$0,a=i?"$":"$0";return[function(n,r){var i=F(this),s=null==n?void 0:n[e];return void 0!==s?s.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!i&&s||"string"==typeof r&&-1===r.indexOf(a)){var o=n(t,e,this,r);if(o.done)return o.value}var u=ee(e),c=String(this),l="function"==typeof r;l||(r=String(r));var h=u.global;if(h){var f=u.unicode;u.lastIndex=0}for(var d=[];;){var g=Ft(u,c);if(null===g)break;if(d.push(g),!h)break;""===String(g[0])&&(u.lastIndex=Gt(c,De(u.lastIndex),f))}for(var p,v="",y=0,m=0;m<d.length;m++){g=d[m];for(var _=String(g[0]),E=On(Nn(xe(g.index),c.length),0),T=[],R=1;R<g.length;R++)T.push(void 0===(p=g[R])?p:String(p));var I=g.groups;if(l){var C=[_].concat(T,E,c);void 0!==I&&C.push(I);var S=String(r.apply(void 0,C))}else S=wn(_,c,E,T,I,r);E>=y&&(v+=c.slice(y,E)+S,y=E+_.length)}return v+c.slice(y)}]}));var kn=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Mn=function(e,t,n){if(kn(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)}},An=[].push,Un=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,s=6==e,a=7==e,o=5==e||s;return function(u,c,l,h){for(var f,d,g=H(u),p=G(g),v=Mn(c,l,3),y=De(p.length),m=0,_=h||Ht,E=t?_(u,y):n||a?_(u,0):void 0;y>m;m++)if((o||m in p)&&(d=v(f=p[m],m,g),e))if(t)E[m]=d;else if(d)switch(e){case 3:return!0;case 5:return f;case 6:return m;case 2:An.call(E,f)}else switch(e){case 4:return!1;case 7:An.call(E,f)}return s?-1:r||i?i:E}},Ln={forEach:Un(0),map:Un(1),filter:Un(2),some:Un(3),every:Un(4),find:Un(5),findIndex:Un(6),filterOut:Un(7)},xn=Ln.filter,Pn=Qt("filter");st({target:"Array",proto:!0,forced:!Pn},{filter:function(e){return xn(this,e,arguments.length>1?arguments[1]:void 0)}});var Dn=Ln.map,Vn=Qt("map");st({target:"Array",proto:!0,forced:!Vn},{map:function(e){return Dn(this,e,arguments.length>1?arguments[1]:void 0)}});var Bn=Object.keys||function(e){return je(e,He)},Gn=M((function(){Bn(1)}));st({target:"Object",stat:!0,forced:Gn},{keys:function(e){return Bn(H(e))}});var Fn=function(e,t){var n=[][e];return!!n&&M((function(){n.call(null,t||function(){throw 1},1)}))},qn=[].join,Kn=G!=Object,jn=Fn("join",",");st({target:"Array",proto:!0,forced:Kn||!jn},{join:function(e){return qn.call(q(this),void 0===e?",":e)}});var Hn=function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e=e.replace(r,(function(e){return e.toUpperCase()}))},Yn=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf-8",r=0;if("utf-16"===n)for(var i=0,s=e.length;i<s;i++)r+=(t=e.charCodeAt(i))<=65535?2:4;else for(var a=0,o=e.length;a<o;a++)r+=(t=e.charCodeAt(a))<127?1:t<=2047?2:t<=65535?3:4;return r},Qn=function(e){return e.match(/\d+(\.\d+){2}/)[0]};O((function(e){var t=function(e){var t,n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",o=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,s=Object.create(i.prototype),a=new O(r||[]);return s._invoke=function(e,t,n){var r=h;return function(i,s){if(r===d)throw new Error("Generator is already running");if(r===g){if("throw"===i)throw s;return k()}for(n.method=i,n.arg=s;;){var a=n.delegate;if(a){var o=S(a,n);if(o){if(o===p)continue;return o}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var u=l(e,t,n);if("normal"===u.type){if(r=n.done?g:f,u.arg===p)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=g,n.method="throw",n.arg=u.arg)}}}(e,n,a),s}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var h="suspendedStart",f="suspendedYield",d="executing",g="completed",p={};function v(){}function y(){}function m(){}var _={};_[s]=function(){return this};var E=Object.getPrototypeOf,T=E&&E(E(N([])));T&&T!==n&&r.call(T,s)&&(_=T);var R=m.prototype=v.prototype=Object.create(_);function I(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(i,s,a,o){var u=l(e[i],e,s);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==typeof h&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,o)}),(function(e){n("throw",e,a,o)})):t.resolve(h).then((function(e){c.value=e,a(c)}),(function(e){return n("throw",e,a,o)}))}o(u.arg)}var i;this._invoke=function(e,r){function s(){return new t((function(t,i){n(e,r,t,i)}))}return i=i?i.then(s,s):s()}}function S(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,S(e,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=l(r,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var s=i.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,p):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function b(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 w(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(b,this),this.reset(!0)}function N(e){if(e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return a.next=a}}return{next:k}}function k(){return{value:t,done:!0}}return y.prototype=R.constructor=m,m.constructor=y,y.displayName=u(m,o,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,u(e,o,"GeneratorFunction")),e.prototype=Object.create(R),e},e.awrap=function(e){return{__await:e}},I(C.prototype),C.prototype[a]=function(){return this},e.AsyncIterator=C,e.async=function(t,n,r,i,s){void 0===s&&(s=Promise);var a=new C(c(t,n,r,i),s);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},I(R),u(R,o,"Generator"),R[s]=function(){return this},R.toString=function(){return"[object Generator]"},e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=N,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(w),!e)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(r,i){return o.type="throw",o.arg=e,n.next=r,i&&(n.method="next",n.arg=t),!!i}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],o=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var s=i;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=t&&t<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=t,s?(this.method="next",this.next=s.finallyLoc,p):this.complete(a)},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),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:N(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));var Wn=ne.f,Jn=Function.prototype,zn=Jn.toString,Zn=/^\s*function ([^ (]*)/,Xn="name";A&&!(Xn in Jn)&&Wn(Jn,Xn,{configurable:!0,get:function(){try{return zn.call(this).match(Zn)[1]}catch(e){return""}}});var $n,er=A?Object.defineProperties:function(e,t){ee(e);for(var n,r=Bn(t),i=r.length,s=0;i>s;)ne.f(e,n=r[s++],t[n]);return e},tr=Ae("document","documentElement"),nr=_e("IE_PROTO"),rr=function(){},ir=function(e){return"<script>"+e+"</"+"script>"},sr=function(){try{$n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;sr=$n?function(e){e.write(ir("")),e.close();var t=e.parentWindow.Object;return e=null,t}($n):((t=z("iframe")).style.display="none",tr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(ir("document.F=Object")),e.close(),e.F);for(var n=He.length;n--;)delete sr.prototype[He[n]];return sr()};Ee[nr]=!0;var ar=Object.create||function(e,t){var n;return null!==e?(rr.prototype=ee(e),n=new rr,rr.prototype=null,n[nr]=e):n=sr(),void 0===t?n:er(n,t)},or=Nt("unscopables"),ur=Array.prototype;null==ur[or]&&ne.f(ur,or,{configurable:!0,value:ar(null)});var cr,lr,hr=function(e){ur[or][e]=!0},fr=qe.includes;st({target:"Array",proto:!0},{includes:function(e){return fr(this,e,arguments.length>1?arguments[1]:void 0)}}),hr("includes"),e.LogLevel=void 0,(cr=e.LogLevel||(e.LogLevel={}))[cr.LOG=0]="LOG",cr[cr.DEBUG=0]="DEBUG",cr[cr.INFO=1]="INFO",cr[cr.WARN=2]="WARN",cr[cr.ERROR=3]="ERROR",cr[cr.FATAL=4]="FATAL",cr[cr.NONE=1e3]="NONE",e.LogType=void 0,(lr=e.LogType||(e.LogType={})).IM="IM",lr.RTC="RTC";var dr={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},gr=Ln.forEach,pr=Fn("forEach")?[].forEach:function(e){return gr(this,e,arguments.length>1?arguments[1]:void 0)};for(var vr in dr){var yr=k[vr],mr=yr&&yr.prototype;if(mr&&mr.forEach!==pr)try{re(mr,"forEach",pr)}catch(e){mr.forEach=pr}}var _r={};_r[Nt("toStringTag")]="z";var Er="[object z]"===String(_r),Tr=Nt("toStringTag"),Rr="Arguments"==V(function(){return arguments}()),Ir=Er?V:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Object(e),Tr))?n:Rr?V(t):"Object"==(r=V(t))&&"function"==typeof t.callee?"Arguments":r},Cr=Er?{}.toString:function(){return"[object "+Ir(this)+"]"};Er||Ne(Object.prototype,"toString",Cr,{unsafe:!0});var Sr=k.Promise,br=function(e,t,n){for(var r in t)Ne(e,r,t[r],n);return e},wr=ne.f,Or=Nt("toStringTag"),Nr=function(e,t,n){e&&!Q(e=n?e:e.prototype,Or)&&wr(e,Or,{configurable:!0,value:t})},kr=Nt("species"),Mr=function(e){var t=Ae(e),n=ne.f;A&&t&&!t[kr]&&n(t,kr,{configurable:!0,get:function(){return this}})},Ar=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},Ur={},Lr=Nt("iterator"),xr=Array.prototype,Pr=function(e){return void 0!==e&&(Ur.Array===e||xr[Lr]===e)},Dr=Nt("iterator"),Vr=function(e){if(null!=e)return e[Dr]||e["@@iterator"]||Ur[Ir(e)]},Br=function(e){var t=e.return;if(void 0!==t)return ee(t.call(e)).value},Gr=function(e,t){this.stopped=e,this.result=t},Fr=function(e,t,n){var r,i,s,a,o,u,c,l=n&&n.that,h=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_ITERATOR),d=!(!n||!n.INTERRUPTED),g=Mn(t,l,1+h+d),p=function(e){return r&&Br(r),new Gr(!0,e)},v=function(e){return h?(ee(e),d?g(e[0],e[1],p):g(e[0],e[1])):d?g(e,p):g(e)};if(f)r=e;else{if("function"!=typeof(i=Vr(e)))throw TypeError("Target is not iterable");if(Pr(i)){for(s=0,a=De(e.length);a>s;s++)if((o=v(e[s]))&&o instanceof Gr)return o;return new Gr(!1)}r=i.call(e)}for(u=r.next;!(c=u.call(r)).done;){try{o=v(c.value)}catch(e){throw Br(r),e}if("object"==typeof o&&o&&o instanceof Gr)return o}return new Gr(!1)},qr=Nt("iterator"),Kr=!1;try{var jr=0,Hr={next:function(){return{done:!!jr++}},return:function(){Kr=!0}};Hr[qr]=function(){return this},Array.from(Hr,(function(){throw 2}))}catch(e){}var Yr,Qr,Wr,Jr=function(e,t){if(!t&&!Kr)return!1;var n=!1;try{var r={};r[qr]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},zr=Nt("species"),Zr=function(e,t){var n,r=ee(e).constructor;return void 0===r||null==(n=ee(r)[zr])?t:kn(n)},Xr=/(?:iphone|ipod|ipad).*applewebkit/i.test(_t),$r=k.location,ei=k.setImmediate,ti=k.clearImmediate,ni=k.process,ri=k.MessageChannel,ii=k.Dispatch,si=0,ai={},oi="onreadystatechange",ui=function(e){if(ai.hasOwnProperty(e)){var t=ai[e];delete ai[e],t()}},ci=function(e){return function(){ui(e)}},li=function(e){ui(e.data)},hi=function(e){k.postMessage(e+"",$r.protocol+"//"+$r.host)};ei&&ti||(ei=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return ai[++si]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Yr(si),si},ti=function(e){delete ai[e]},mt?Yr=function(e){ni.nextTick(ci(e))}:ii&&ii.now?Yr=function(e){ii.now(ci(e))}:ri&&!Xr?(Wr=(Qr=new ri).port2,Qr.port1.onmessage=li,Yr=Mn(Wr.postMessage,Wr,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts&&$r&&"file:"!==$r.protocol&&!M(hi)?(Yr=hi,k.addEventListener("message",li,!1)):Yr=oi in z("script")?function(e){tr.appendChild(z("script")).onreadystatechange=function(){tr.removeChild(this),ui(e)}}:function(e){setTimeout(ci(e),0)});var fi,di,gi,pi,vi,yi,mi,_i,Ei={set:ei,clear:ti},Ti=/web0s(?!.*chrome)/i.test(_t),Ri=$.f,Ii=Ei.set,Ci=k.MutationObserver||k.WebKitMutationObserver,Si=k.document,bi=k.process,wi=k.Promise,Oi=Ri(k,"queueMicrotask"),Ni=Oi&&Oi.value;Ni||(fi=function(){var e,t;for(mt&&(e=bi.domain)&&e.exit();di;){t=di.fn,di=di.next;try{t()}catch(e){throw di?pi():gi=void 0,e}}gi=void 0,e&&e.enter()},Xr||mt||Ti||!Ci||!Si?wi&&wi.resolve?(mi=wi.resolve(void 0),_i=mi.then,pi=function(){_i.call(mi,fi)}):pi=mt?function(){bi.nextTick(fi)}:function(){Ii.call(k,fi)}:(vi=!0,yi=Si.createTextNode(""),new Ci(fi).observe(yi,{characterData:!0}),pi=function(){yi.data=vi=!vi}));var ki,Mi,Ai,Ui,Li=Ni||function(e){var t={fn:e,next:void 0};gi&&(gi.next=t),di||(di=t,pi()),gi=t},xi=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=kn(t),this.reject=kn(n)},Pi={f:function(e){return new xi(e)}},Di=function(e,t){if(ee(e),K(t)&&t.constructor===e)return t;var n=Pi.f(e);return(0,n.resolve)(t),n.promise},Vi=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Bi=Ei.set,Gi=Nt("species"),Fi="Promise",qi=Oe.get,Ki=Oe.set,ji=Oe.getterFor(Fi),Hi=Sr,Yi=k.TypeError,Qi=k.document,Wi=k.process,Ji=Ae("fetch"),zi=Pi.f,Zi=zi,Xi=!!(Qi&&Qi.createEvent&&k.dispatchEvent),$i="function"==typeof PromiseRejectionEvent,es="unhandledrejection",ts=rt(Fi,(function(){if(!(he(Hi)!==String(Hi))){if(66===It)return!0;if(!mt&&!$i)return!0}if(It>=51&&/native code/.test(Hi))return!1;var e=Hi.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[Gi]=t,!(e.then((function(){}))instanceof t)})),ns=ts||!Jr((function(e){Hi.all(e).catch((function(){}))})),rs=function(e){var t;return!(!K(e)||"function"!=typeof(t=e.then))&&t},is=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;Li((function(){for(var r=e.value,i=1==e.state,s=0;n.length>s;){var a,o,u,c=n[s++],l=i?c.ok:c.fail,h=c.resolve,f=c.reject,d=c.domain;try{l?(i||(2===e.rejection&&us(e),e.rejection=1),!0===l?a=r:(d&&d.enter(),a=l(r),d&&(d.exit(),u=!0)),a===c.promise?f(Yi("Promise-chain cycle")):(o=rs(a))?o.call(a,h,f):h(a)):f(r)}catch(e){d&&!u&&d.exit(),f(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&as(e)}))}},ss=function(e,t,n){var r,i;Xi?((r=Qi.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),k.dispatchEvent(r)):r={promise:t,reason:n},!$i&&(i=k["on"+e])?i(r):e===es&&function(e,t){var n=k.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},as=function(e){Bi.call(k,(function(){var t,n=e.facade,r=e.value;if(os(e)&&(t=Vi((function(){mt?Wi.emit("unhandledRejection",r,n):ss(es,n,r)})),e.rejection=mt||os(e)?2:1,t.error))throw t.value}))},os=function(e){return 1!==e.rejection&&!e.parent},us=function(e){Bi.call(k,(function(){var t=e.facade;mt?Wi.emit("rejectionHandled",t):ss("rejectionhandled",t,e.value)}))},cs=function(e,t,n){return function(r){e(t,r,n)}},ls=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,is(e,!0))},hs=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Yi("Promise can't be resolved itself");var r=rs(t);r?Li((function(){var n={done:!1};try{r.call(t,cs(hs,n,e),cs(ls,n,e))}catch(t){ls(n,t,e)}})):(e.value=t,e.state=1,is(e,!1))}catch(t){ls({done:!1},t,e)}}};ts&&(Hi=function(e){Ar(this,Hi,Fi),kn(e),ki.call(this);var t=qi(this);try{e(cs(hs,t),cs(ls,t))}catch(e){ls(t,e)}},(ki=function(e){Ki(this,{type:Fi,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=br(Hi.prototype,{then:function(e,t){var n=ji(this),r=zi(Zr(this,Hi));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=mt?Wi.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&is(n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),Mi=function(){var e=new ki,t=qi(e);this.promise=e,this.resolve=cs(hs,t),this.reject=cs(ls,t)},Pi.f=zi=function(e){return e===Hi||e===Ai?new Mi(e):Zi(e)},"function"==typeof Sr&&(Ui=Sr.prototype.then,Ne(Sr.prototype,"then",(function(e,t){var n=this;return new Hi((function(e,t){Ui.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Ji&&st({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return Di(Hi,Ji.apply(k,arguments))}}))),st({global:!0,wrap:!0,forced:ts},{Promise:Hi}),Nr(Hi,Fi,!1),Mr(Fi),Ai=Ae(Fi),st({target:Fi,stat:!0,forced:ts},{reject:function(e){var t=zi(this);return t.reject.call(void 0,e),t.promise}}),st({target:Fi,stat:!0,forced:ts},{resolve:function(e){return Di(this,e)}}),st({target:Fi,stat:!0,forced:ns},{all:function(e){var t=this,n=zi(t),r=n.resolve,i=n.reject,s=Vi((function(){var n=kn(t.resolve),s=[],a=0,o=1;Fr(e,(function(e){var u=a++,c=!1;s.push(void 0),o++,n.call(t,e).then((function(e){c||(c=!0,s[u]=e,--o||r(s))}),i)})),--o||r(s)}));return s.error&&i(s.value),n.promise},race:function(e){var t=this,n=zi(t),r=n.reject,i=Vi((function(){var i=kn(t.resolve);Fr(e,(function(e){i.call(t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var fs="RC_Logs";function ds(e){var t=e.target.result;1===e.oldVersion&&t.deleteObjectStore(fs),function(e,t,n){var r;if(!e.objectStoreNames.contains(t)){var i=h({},n.objectStoreParams);r=e.createObjectStore(t,i),n.indexs&&n.indexs.length>0&&n.indexs.forEach((function(e){r.createIndex(e.indexName,e.key,{unique:e.unique})}))}}(t,fs,{indexs:[{indexName:"time",key:"time",unique:!1}],objectStoreParams:{autoIncrement:!0}})}var gs=function(){function e(){a(this,e)}return u(e,[{key:"addList",value:function(t,n){return new Promise((function(r){if(e._db){var i=e._db.transaction([t],"readwrite"),s=i.objectStore(t);n.forEach((function(e){null==s||s.add(e)})),i.oncomplete=function(e){r(!0)},i.onerror=function(e){r(!1)}}else r(!1)}))}},{key:"getRangeData",value:function(t,n,r,i){return new Promise((function(s){if(e._db){var a=e._db.transaction([t],"readwrite").objectStore(t),o=IDBKeyRange.bound(r,i),u=a.index(n),c=[],l=u.openCursor(o);l.onsuccess=function(e){var t=e.target.result;t?(c.push(t.value),t.continue()):s(c)},l.onerror=function(e){console.error(e),s([])}}else s([])}))}},{key:"getCount",value:function(t,n){return new Promise((function(n){if(e._db){var r=e._db.transaction([t],"readonly").objectStore(t).count();r.onsuccess=function(){n(r.result)},r.onerror=function(e){console.error(e),n(0)}}else n(0)}))}},{key:"removeFirstData",value:function(t,n,r){return new Promise((function(n){if(e._db){var i=e._db.transaction([t],"readwrite").objectStore(t),s=i.getAllKeys(IDBKeyRange.lowerBound(0),r);s.onsuccess=function(){var e=s.result;e.length>0&&(i.delete(IDBKeyRange.bound(e[0],e[e.length-1])).onsuccess=function(){n(!0)})}}else n(!1)}))}}],[{key:"init",value:function(){if("undefined"!=typeof window&&window&&window.indexedDB){var t=window.indexedDB.open("RC_ENGINE_DB",2);t.onerror=function(e){console.warn("open indexDB request failed "+e.target.error)},t.onsuccess=function(t){e._db=t.target.result,e._db&&(e._db.onclose=function(t){var n;console.warn("The database ".concat(null===(n=e._db)||void 0===n?void 0:n.name," has unexpectedly closed."),t),e._db=null,window.__RCIndexDBInstance=null},e._db.onerror=function(t){var n;console.warn("The database ".concat(null===(n=e._db)||void 0===n?void 0:n.name," has opening error."),t),e._db=null,window.__RCIndexDBInstance=null},e._db.onabort=function(t){var n;console.warn("The database ".concat(null===(n=e._db)||void 0===n?void 0:n.name," has opening aborted."),t),e._db=null,window.__RCIndexDBInstance=null}),window.__RCIndexDBInstance=new e},t.onupgradeneeded=function(t){e._db=t.target.result,ds(t)}}else console.debug("IndexDB is not currently supported in the environment!")}},{key:"getInstance",value:function(){return window&&window.__RCIndexDBInstance?window.__RCIndexDBInstance:null}}]),e}();gs._db=null;var ps=Nt("match"),vs=function(e){var t;return K(e)&&(void 0!==(t=e[ps])?!!t:"RegExp"==V(e))},ys=ut.UNSUPPORTED_Y,ms=[].push,_s=Math.min,Es=4294967295;Pt("split",2,(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=String(F(this)),i=void 0===n?Es:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!vs(e))return t.call(r,e,i);for(var s,a,o,u=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,h=new RegExp(e.source,c+"g");(s=pt.call(h,r))&&!((a=h.lastIndex)>l&&(u.push(r.slice(l,s.index)),s.length>1&&s.index<r.length&&ms.apply(u,s.slice(1)),o=s[0].length,l=a,u.length>=i));)h.lastIndex===s.index&&h.lastIndex++;return l===r.length?!o&&h.test("")||u.push(""):u.push(r.slice(l)),u.length>i?u.slice(0,i):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:t.call(this,e,n)}:t,[function(t,n){var i=F(this),s=null==t?void 0:t[e];return void 0!==s?s.call(t,i,n):r.call(String(i),t,n)},function(e,i){var s=n(r,e,this,i,r!==t);if(s.done)return s.value;var a=ee(e),o=String(this),u=Zr(a,RegExp),c=a.unicode,l=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(ys?"g":"y"),h=new u(ys?"^(?:"+a.source+")":a,l),f=void 0===i?Es:i>>>0;if(0===f)return[];if(0===o.length)return null===Ft(h,o)?[o]:[];for(var d=0,g=0,p=[];g<o.length;){h.lastIndex=ys?0:g;var v,y=Ft(h,ys?o.slice(g):o);if(null===y||(v=_s(De(h.lastIndex+(ys?g:0)),o.length))===d)g=Gt(o,g,c);else{if(p.push(o.slice(d,g)),p.length===f)return p;for(var m=1;m<=y.length-1;m++)if(p.push(y[m]),p.length===f)return p;g=d=v}}return p.push(o.slice(d)),p}]}),ys);var Ts="toString",Rs=RegExp.prototype,Is=Rs.toString,Cs=M((function(){return"/a/b"!=Is.call({source:"a",flags:"b"})})),Ss=Is.name!=Ts;(Cs||Ss)&&Ne(RegExp.prototype,Ts,(function(){var e=ee(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in Rs)?at.call(e):n)}),{unsafe:!0});var bs,ws=function(e,t){return e+Math.floor(Math.random()*(t-e))},Os=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},Ns=function(){var e=Os();if(e=e.replace(/-/g,"")+"a",(e=function(e){var t="0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0".split(""),n=t.length+1,r=+e,i=[];do{var s=r%n;r=(r-s)/n,i.unshift(t[s])}while(r);return i.join("")}(e=parseInt(e,16))).length>22&&(e=e.slice(0,22)),e.length<22)for(var t=22-e.length,n=0;n<t;n++)e+="0";return e};!function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.ULTRA_GROUP=10]="ULTRA_GROUP",e[e.RTC_ROOM=12]="RTC_ROOM"}(bs||(bs={}));var ks,Ms=bs;!function(e){e[e.IMAGE=1]="IMAGE",e[e.AUDIO=2]="AUDIO",e[e.VIDEO=3]="VIDEO",e[e.FILE=4]="FILE",e[e.SIGHT=5]="SIGHT",e[e.COMBINE_HTML=6]="COMBINE_HTML"}(ks||(ks={}));var As,Us=ks,Ls=function(e){return"string"==typeof e},xs=function(e){return"boolean"==typeof e},Ps=function(e){return"number"==typeof e&&!isNaN(e)},Ds=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},Vs=function(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)},Bs=function(e){return Ls(e)&&e.length>0},Gs=function(e){return"[object Object]"===Object.prototype.toString.call(e)},Fs=function(e){return"[object Function]"===Object.prototype.toString.call(e)},qs=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},Ks=function(e){return"[object Null]"===Object.prototype.toString.call(e)},js=function(e){for(var t in e)return!0;return!1},Hs=function(e){var t=!1;if(Gs(e))for(var n in e)if(t=Ls(n)&&!/^[A-Za-z0-9_=+-]+$/.test(n))break;return t},Ys={};console&&(c(As={},e.LogLevel.DEBUG,console.debug.bind(console)),c(As,e.LogLevel.INFO,console.info.bind(console)),c(As,e.LogLevel.WARN,console.warn.bind(console)),c(As,e.LogLevel.ERROR,console.error.bind(console)),c(As,e.LogLevel.FATAL,console.log.bind(console)),Ys=As);var Qs=function(e){return Ls(e)||Ps(e)||qs(e)||xs(e)?e:e instanceof Error?JSON.stringify({name:e.name,message:e.message,stack:e.stack}):JSON.stringify(e)},Ws=function(){function t(n,r,i){a(this,t),this.tag=n,this.type=r,this.initiator=i,this._outLevel=e.LogLevel.WARN,this.debug=this.log.bind(this,e.LogLevel.DEBUG),this.info=this.log.bind(this,e.LogLevel.INFO),this.warn=this.log.bind(this,e.LogLevel.WARN),this.error=this.log.bind(this,e.LogLevel.ERROR),this.fatal=this.log.bind(this,e.LogLevel.FATAL)}var n;return u(t,[{key:"_defaultStdout",value:function(e,t){if(Ys[e]){for(var n,r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];(n=Ys)[e].apply(n,["".concat(t,":")].concat(i))}}},{key:"__pushLocalLog",value:function(n,r,i){var s;s=this.type?this.type:["RCRTCLog","RCCall","RCRTC","RTC-A"].includes(this.tag)?e.LogType.RTC:e.LogType.IM;var a=Date.now();Yn(r)>=1e3&&(r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"utf-8";if(!e||!t)return"";var r="utf-8"===n?3:2,i=0,s=0,a="";for(s=0;s<e.length;s++){if(e.charCodeAt(s)>255?i+=r:i++,i>t)return a;a+=e.charAt(s)}return e}(r,1e3));var o=JSON.stringify({message:r,userId:t.userId}).replace(/"/g,'""'),u=/^[\w]+-[\w]+-[\w]+?/.test(i)?i:"".concat(this.initiator||"L","-").concat(i,"-O"),c={sessionId:t.sessionId,time:a,level:4-n,content:"".concat(t.sessionId,",").concat(Date.now(),",").concat(s,",").concat(4-n,",").concat(u,',"').concat(o,'"\n'),userId:t.userId};t.databaseLogList.push(c),(t.databaseLogList.length>=100||n===e.LogLevel.FATAL)&&this.__insertLogIntoDatabase()}},{key:"__insertLogIntoDatabase",value:(n=s(regeneratorRuntime.mark((function e(){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=C(t.databaseLogList),t.databaseLogList=[],!(r=gs.getInstance())){e.next=14;break}return e.next=6,r.addList(fs,n);case 6:return i=e.sent,e.next=9,r.getCount(fs,"time");case 9:return e.sent>1e5&&r.removeFirstData(fs,"time",2e3),e.abrupt("return",i);case 14:return e.abrupt("return",!1);case 15:case"end":return e.stop()}}),e)}))),function(){return n.apply(this,arguments)})},{key:"setLogLevel",value:function(t){this._outLevel="number"!=typeof t?e.LogLevel.WARN:t}},{key:"setLogStdout",value:function(e){this._logStdout=e}},{key:"log",value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];if(t>e.LogLevel.DEBUG&&this.__pushLocalLog(t,r.map(Qs).join(" "),this.tag),!(t<this._outLevel)){var s="".concat((new Date).toISOString(),"[").concat(this.tag,"][").concat(e.LogLevel[t],"]"),a="".concat(s," - ").concat(r.map(Qs).join(" "));this._logStdout?this._logStdout(t,a):this._stdout?this._stdout(t,a):this._defaultStdout.apply(this,[t,s].concat(r))}}},{key:"reportLog",value:function(e,n,r){this.__pushLocalLog(4-e,r,n);var i=JSON.stringify({message:r}).replace(/"/g,'""');i='"'.concat(i,'"');var s={level:e,content:[t.sessionId,Date.now(),this.type,e,n,i].join()+"\n"};t.realTimeLogList.push(s),t.realTimeLogList.length>=600&&(t.realTimeLogList=t.realTimeLogList.slice(-500))}},{key:"set",value:function(e,t){this.warn("logger.set has being deprecated!")}},{key:"setStdout",value:function(e){this._stdout=e}},{key:"__clearRealTimeLog",value:function(){t.realTimeLogList=[]}}],[{key:"init",value:function(e){t.userId=e}},{key:"reset",value:function(){t.userId=""}}]),t}();Ws.databaseLogList=[],Ws.realTimeLogList=[],Ws.sessionId=Ns(),Ws.userId="";var Js=new Ws("RCLog"),zs=Qt("splice"),Zs=Math.max,Xs=Math.min,$s=9007199254740991,ea="Maximum allowed length exceeded";st({target:"Array",proto:!0,forced:!zs},{splice:function(e,t){var n,r,i,s,a,o,u=H(this),c=De(u.length),l=Ge(e,c),h=arguments.length;if(0===h?n=r=0:1===h?(n=0,r=c-l):(n=h-2,r=Xs(Zs(xe(t),0),c-l)),c+n-r>$s)throw TypeError(ea);for(i=Ht(u,r),s=0;s<r;s++)(a=l+s)in u&&Kt(i,s,u[a]);if(i.length=r,n<r){for(s=l;s<c-r;s++)o=s+n,(a=s+r)in u?u[o]=u[a]:delete u[o];for(s=c;s>c-r+n;s--)delete u[s-1]}else if(n>r)for(s=c-r;s>l;s--)o=s+n-1,(a=s+r-1)in u?u[o]=u[a]:delete u[o];for(s=0;s<n;s++)u[s+l]=arguments[s+2];return u.length=c-r+n,i}});var ta,na=function(){function e(){a(this,e),this._map={}}return u(e,[{key:"on",value:function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n})}},{key:"once",value:function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n,once:!0})}},{key:"off",value:function(e,t,n){var r=this._map[e];r&&((r=r.filter((function(e){return e.listener!==t||e.target!==n}))).length?this._map[e]=r:delete this._map[e])}},{key:"emit",value:function(e){var t=this._map[e];if(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];for(var s=t.length-1;s>=0;s-=1){var a=t[s],o=a.target,u=a.once,c=a.listener;u&&t.splice(s,1);try{c.call.apply(c,[o].concat(r))}catch(e){Js.error(e)}}}}},{key:"removeAll",value:function(e){delete this._map[e]}},{key:"clear",value:function(){Object.keys(this._map).forEach(this.removeAll,this)}}]),e}();!function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(ta||(ta={}));var ra,ia=ta;!function(e){e[e.TIMEOUT=-1]="TIMEOUT",e[e.UNKNOWN=-2]="UNKNOWN",e[e.PARAMETER_ERROR=-3]="PARAMETER_ERROR",e[e.EXTRA_METHOD_UNDEFINED=-4]="EXTRA_METHOD_UNDEFINED",e[e.MAIN_PROCESS_ERROR=-5]="MAIN_PROCESS_ERROR",e[e.PARAMETER_CHANGED=-6]="PARAMETER_CHANGED",e[e.SUCCESS=0]="SUCCESS",e[e.RC_MSG_UNAUTHORIZED=20406]="RC_MSG_UNAUTHORIZED",e[e.RC_DISCUSSION_GROUP_ID_INVALID=20407]="RC_DISCUSSION_GROUP_ID_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.JOIN_IN_DISCUSSION=21407]="JOIN_IN_DISCUSSION",e[e.CREATE_DISCUSSION=21408]="CREATE_DISCUSSION",e[e.INVITE_DICUSSION=21409]="INVITE_DICUSSION",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_TIMEOUT=30005]="RC_HTTP_REQ_TIMEOUT",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_RESOURCE_ERROR=30007]="RC_NAVI_RESOURCE_ERROR",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_SEND_FAIL=30012]="RC_PING_SEND_FAIL",e[e.RC_PONG_RECV_FAIL=30013]="RC_PONG_RECV_FAIL",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_ID_REJECT=31002]="RC_CONN_ID_REJECT",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_USER_OR_PASSWD_ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.CONVER_REMOVE_ERROR=34001]="CONVER_REMOVE_ERROR",e[e.CONVER_GETLIST_ERROR=34002]="CONVER_GETLIST_ERROR",e[e.CONVER_SETOP_ERROR=34003]="CONVER_SETOP_ERROR",e[e.CONVER_TOTAL_UNREAD_ERROR=34004]="CONVER_TOTAL_UNREAD_ERROR",e[e.CONVER_TYPE_UNREAD_ERROR=34005]="CONVER_TYPE_UNREAD_ERROR",e[e.CONVER_ID_TYPE_UNREAD_ERROR=34006]="CONVER_ID_TYPE_UNREAD_ERROR",e[e.CONVER_CLEAR_ERROR=34007]="CONVER_CLEAR_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.CLEAR_HIS_TIME_ERROR=34011]="CLEAR_HIS_TIME_ERROR",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.READ_RECEIPT_ERROR=35003]="READ_RECEIPT_ERROR",e[e.PACKAGE_ENVIRONMENT_ERROR=35006]="PACKAGE_ENVIRONMENT_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_NOT_SUPPORT=35012]="METHOD_NOT_SUPPORT",e[e.MSG_LIMIT_ERROR=35013]="MSG_LIMIT_ERROR",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.UPLOAD_FILE_FAILED=35020]="UPLOAD_FILE_FAILED",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.DRAF_SAVE_ERROR=38002]="DRAF_SAVE_ERROR",e[e.DRAF_REMOVE_ERROR=38003]="DRAF_REMOVE_ERROR",e[e.SUBSCRIBE_ERROR=39001]="SUBSCRIBE_ERROR",e[e.NOT_SUPPORT=39002]="NOT_SUPPORT",e[e.QNTKN_FILETYPE_ERROR=41001]="QNTKN_FILETYPE_ERROR",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.COOKIE_ENABLE=51001]="COOKIE_ENABLE",e[e.GET_MESSAGE_BY_ID_ERROR=61001]="GET_MESSAGE_BY_ID_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.VOIPISNULL=24013]="VOIPISNULL",e[e.NOENGINETYPE=24010]="NOENGINETYPE",e[e.NULLCHANNELNAME=24011]="NULLCHANNELNAME",e[e.VOIPDYANMICERROR=24012]="VOIPDYANMICERROR",e[e.NOVOIP=24014]="NOVOIP",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.VOIPCLOSE=24016]="VOIPCLOSE",e[e.CLOSE_BEFORE_OPEN=51001]="CLOSE_BEFORE_OPEN",e[e.ALREADY_IN_USE=51002]="ALREADY_IN_USE",e[e.INVALID_CHANNEL_NAME=51003]="INVALID_CHANNEL_NAME",e[e.VIDEO_CONTAINER_IS_NULL=51004]="VIDEO_CONTAINER_IS_NULL",e[e.DELETE_MESSAGE_ID_IS_NULL=61001]="DELETE_MESSAGE_ID_IS_NULL",e[e.CANCEL=1]="CANCEL",e[e.REJECT=2]="REJECT",e[e.HANGUP=3]="HANGUP",e[e.BUSYLINE=4]="BUSYLINE",e[e.NO_RESPONSE=5]="NO_RESPONSE",e[e.ENGINE_UN_SUPPORTED=6]="ENGINE_UN_SUPPORTED",e[e.NETWORK_ERROR=7]="NETWORK_ERROR",e[e.REMOTE_CANCEL=11]="REMOTE_CANCEL",e[e.REMOTE_REJECT=12]="REMOTE_REJECT",e[e.REMOTE_HANGUP=13]="REMOTE_HANGUP",e[e.REMOTE_BUSYLINE=14]="REMOTE_BUSYLINE",e[e.REMOTE_NO_RESPONSE=15]="REMOTE_NO_RESPONSE",e[e.REMOTE_ENGINE_UN_SUPPORTED=16]="REMOTE_ENGINE_UN_SUPPORTED",e[e.REMOTE_NETWORK_ERROR=17]="REMOTE_NETWORK_ERROR",e[e.VOIP_NOT_AVALIABLE=18]="VOIP_NOT_AVALIABLE",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT"}(ra||(ra={}));var sa,aa=ra;!function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT"}(sa||(sa={}));var oa,ua=sa,ca={ACCEPTED:0,UNACCEPTABLE_PROTOCOL_VERSION:1,IDENTIFIER_REJECTED:2,SERVER_UNAVAILABLE:3,TOKEN_INCORRECT:4,NOT_AUTHORIZED:5,REDIRECT:6,PACKAGE_ERROR:7,APP_BLOCK_OR_DELETE:8,BLOCK:9,TOKEN_EXPIRE:10,DEVICE_ERROR:11,HOSTNAME_ERROR:12,HASOHTERSAMECLIENTONLINE:13,IN_OTHER_CLUSTER:15,APP_AUTH_NOT_PASS:16,OTP_USED:17,PLATFORM_ERROR:18};!function(e){e.TextMessage="RC:TxtMsg",e.VOICE="RC:VcMsg",e.HQ_VOICE="RC:HQVCMsg",e.IMAGE="RC:ImgMsg",e.GIF="RC:GIFMsg",e.RICH_CONTENT="RC:ImgTextMsg",e.LOCATION="RC:LBSMsg",e.FILE="RC:FileMsg",e.SIGHT="RC:SightMsg",e.COMBINE="RC:CombineMsg",e.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",e.LOG_COMMAND="RC:LogCmdMsg",e.EXPANSION_NOTIFY="RC:MsgExMsg",e.REFERENCE="RC:ReferenceMsg",e.RECALL="RC:RcCmd",e.READ_RECEIPT="RC:ReadNtf",e.READ_RECEIPT_REQUEST="RC:RRReqMsg",e.READ_RECEIPT_RESPONSE="RC:RRRspMsg",e.SYNC_READ_STATUS="RC:SRSMsg",e.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",e.CHATROOM_JOIN="RC:ChrmJoinNtf",e.CHATROOM_LEFT="RC:ChrmQuitNtf",e.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",e.TYPING_STATUS="RC:TypSts",e.INTERCEPT="RC:InterceptMsg"}(oa||(oa={}));var la,ha=oa;!function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(la||(la={}));var fa,da=la;!function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(fa||(fa={}));var ga,pa=fa;!function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC"}(ga||(ga={}));var va,ya=ga;!function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(va||(va={}));var ma,_a=va;!function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(ma||(ma={}));var Ea,Ta=ma;!function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(Ea||(Ea={}));var Ra,Ia=Ea;!function(e){e[e.typing=0]="typing"}(Ra||(Ra={}));var Ca,Sa,ba,wa=Ra;e.RTCMode=void 0,(Ca=e.RTCMode||(e.RTCMode={}))[Ca.RTC=0]="RTC",Ca[Ca.LIVE=2]="LIVE",e.LiveType=void 0,(Sa=e.LiveType||(e.LiveType={}))[Sa.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",Sa[Sa.AUDIO=1]="AUDIO",e.LiveRole=void 0,(ba=e.LiveRole||(e.LiveRole={}))[ba.ANCHOR=1]="ANCHOR",ba[ba.AUDIENCE=2]="AUDIENCE";var Oa,Na,ka,Ma={"RC:VCAccept":"RC:VCAccept","RC:VCRinging":"RC:VCRinging","RC:VCSummary":"RC:VCSummary","RC:VCHangup":"RC:VCHangup","RC:VCInvite":"RC:VCInvite","RC:VCModifyMedia":"RC:VCModifyMedia","RC:VCModifyMem":"RC:VCModifyMem"};e.RTCApiType=void 0,(Oa=e.RTCApiType||(e.RTCApiType={}))[Oa.ROOM=1]="ROOM",Oa[Oa.PERSON=2]="PERSON",e.RTCIdentityChangeType=void 0,(Na=e.RTCIdentityChangeType||(e.RTCIdentityChangeType={}))[Na.AnchorToViewer=1]="AnchorToViewer",Na[Na.ViewerToAnchor=2]="ViewerToAnchor",e.RTCJoinType=void 0,(ka=e.RTCJoinType||(e.RTCJoinType={}))[ka.KICK=0]="KICK",ka[ka.REFUSE=1]="REFUSE",ka[ka.COEXIST=2]="COEXIST";var Aa=function(e){var t=String(F(this)),n="",r=xe(e);if(r<0||r==1/0)throw RangeError("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n},Ua=Math.ceil,La=function(e){return function(t,n,r){var i,s,a=String(F(t)),o=a.length,u=void 0===r?" ":String(r),c=De(n);return c<=o||""==u?a:((s=Aa.call(u,Ua((i=c-o)/u.length))).length>i&&(s=s.slice(0,i)),e?a+s:s+a)}},xa={start:La(!1),end:La(!0)},Pa=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(_t),Da=xa.start;st({target:"String",proto:!0,forced:Pa},{padStart:function(e){return Da(this,e,arguments.length>1?arguments[1]:void 0)}});var Va="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};Va.engine="5.2.5-alpha.1";var Ba,Ga,Fa=function(){function e(){a(this,e)}return u(e,null,[{key:"add",value:function(e,t){Va[e]=t}},{key:"validEngine",value:function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return Js.warn("The validation engine version '".concat(e,"' is invalid!")),!1;var n=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return Va.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=n}},{key:"getInfo",value:function(){return Va}}]),e}();e.AssertRules=void 0,(Ga=e.AssertRules||(e.AssertRules={}))[Ga.STRING=0]="STRING",Ga[Ga.ONLY_STRING=1]="ONLY_STRING",Ga[Ga.NUMBER=2]="NUMBER",Ga[Ga.BOOLEAN=3]="BOOLEAN",Ga[Ga.OBJECT=4]="OBJECT",Ga[Ga.ARRAY=5]="ARRAY",Ga[Ga.CALLBACK=6]="CALLBACK",Ga[Ga.CHANNEL_ID=7]="CHANNEL_ID";var qa=(c(Ba={},e.AssertRules.STRING,Bs),c(Ba,e.AssertRules.ONLY_STRING,Ls),c(Ba,e.AssertRules.NUMBER,Ps),c(Ba,e.AssertRules.BOOLEAN,(function(e){return"boolean"==typeof e})),c(Ba,e.AssertRules.OBJECT,Gs),c(Ba,e.AssertRules.ARRAY,Ds),c(Ba,e.AssertRules.CALLBACK,(function(e){var t=!0;return Gs(e)||(t=!1),(e=e||{}).onSuccess&&!Fs(e.onSuccess)&&(t=!1),e.onError&&!Fs(e.onError)&&(t=!1),t})),c(Ba,e.AssertRules.CHANNEL_ID,(function(e){var t=!1;return Ls(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t})),Ba),Ka=function(e){f(n,e);var t=T(n);function n(e){var r;return a(this,n),(r=t.call(this,e)).name="RCAssertError",r}return n}(m(Error)),ja=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];n=qa[n]||n;var i=r&&!n(t)||!r&&!(qs(t)||null===t||n(t));return i&&Js.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),!i},Ha=[].slice,Ya=/MSIE .\./.test(_t),Qa=function(e){return function(t,n){var r=arguments.length>2,i=r?Ha.call(arguments,2):void 0;return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};st({global:!0,bind:!0,forced:Ya},{setTimeout:Qa(k.setTimeout),setInterval:Qa(k.setInterval)});var Wa=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return ee(n),function(e){if(!K(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),Ja=function(e,t,n){var r,i;return Wa&&"function"==typeof(r=t.constructor)&&r!==n&&K(i=r.prototype)&&i!==n.prototype&&Wa(e,i),e},za=ne.f,Za=Qe.f,Xa=Oe.enforce,$a=Nt("match"),eo=k.RegExp,to=eo.prototype,no=/a/g,ro=/a/g,io=new eo(no)!==no,so=ut.UNSUPPORTED_Y;if(A&&rt("RegExp",!io||so||M((function(){return ro[$a]=!1,eo(no)!=no||eo(ro)==ro||"/a/i"!=eo(no,"i")})))){for(var ao=function(e,t){var n,r=this instanceof ao,i=vs(e),s=void 0===t;if(!r&&i&&e.constructor===ao&&s)return e;io?i&&!s&&(e=e.source):e instanceof ao&&(s&&(t=at.call(e)),e=e.source),so&&(n=!!t&&t.indexOf("y")>-1)&&(t=t.replace(/y/g,""));var a=Ja(io?new eo(e,t):eo(e,t),r?this:to,ao);so&&n&&(Xa(a).sticky=!0);return a},oo=function(e){e in ao||za(ao,e,{configurable:!0,get:function(){return eo[e]},set:function(t){eo[e]=t}})},uo=Za(eo),co=0;uo.length>co;)oo(uo[co++]);to.constructor=ao,ao.prototype=to,Ne(k,"RegExp",ao)}Mr("RegExp");var lo,ho,fo,go=function(e){if(!Gs(e)||void 0===e.low||void 0===e.high)return e;var t=e.low;return t<0&&(t+=4294967296),t=t.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{"+t.length+"}$"),t),16)},po=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=Os(),i=function(e){e=e||"-";var t=new Date,n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate();return"".concat(n).concat(e).concat(r).concat(e).concat(i)}(),s=(new Date).getTime(),a="";if(t){var o=t.split(".");a="."+o[o.length-1]}return"".concat(e,"__RC-").concat(i,"_").concat(n,"_").concat(s).concat(r).concat(a)},vo=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.threadId,r=e.apnsCollapseId,i=e.category,s=e.richMediaUri,a=t.channelIdMi,o=t.channelIdHW,u=t.channelIdOPPO,c=t.typeVivo,l=t.googleConfig,h={};h["thread-id"]=n||"",h["apns-collapse-id"]=r||"",h.category=i||"",h.richMediaUri=s||"";var f={};f.collapse_key=null==l?void 0:l.collapseKey,f.imageUrl=null==l?void 0:l.imageUrl;var d=null==l?void 0:l.priority;d&&!["high","normal"].includes(d)&&(d="normal"),f.priority=d;var g=[{HW:{channelId:o||""}},{MI:{channelId:a||""}},{OPPO:{channelId:u||""}},{VIVO:{classification:c||""}},{APNS:h},{FCM:f}];return JSON.stringify(g)},yo=function(e,t){var n={},r={notificationId:t||""};if(!e)return{iOSConfig:n,androidConfig:r};try{var i=JSON.parse(e);null==i||i.forEach((function(e){var t,i,s,a,o=Object.keys(e);if(0!==o.length){var u=o[0];switch(u){case"HW":return void(r.channelIdHW=null===(t=e[u])||void 0===t?void 0:t.channelId);case"MI":return void(r.channelIdMi=null===(i=e[u])||void 0===i?void 0:i.channelId);case"OPPO":return void(r.channelIdOPPO=null===(s=e[u])||void 0===s?void 0:s.channelId);case"VIVO":return void(r.typeVivo=null===(a=e[u])||void 0===a?void 0:a.classification);case"APNS":return n.threadId=e[u]["thread-id"],n.apnsCollapseId=e[u]["apns-collapse-id"],n.category=e[u].category,void(n.richMediaUri=e[u].richMediaUri);case"FCM":r.googleConfig={collapseKey:e[u].collapse_key||"",imageUrl:e[u].imageUrl||"",priority:e[u].priority||""}}}}))}catch(t){Js.error("Wrong format for pushConfigs field! content: "+e)}return{iOSConfig:n,androidConfig:r}},mo=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&(n<=128&&n>=1)},_o=function(e){var t=e.length;return t<=4096&&t>=1},Eo=function(e,t,n){t=t||function(){};var r=(n=n||{}).isReverse;Gs(e)&&function(){for(var n in e)t(e[n],n,e)}(),(Ds(e)||Ls(e))&&function(){if(r)for(var n=e.length-1;n>=0;n--)t(e[n],n);else for(var i=0,s=e.length;i<s;i++)t(e[i],i)}()},To=function(e,t){return Eo(e,(function(n,r){e[r]=t(n,r)})),e},Ro=function(e,t){if(e.indexOf)return e.indexOf(t);var n=-1;return Eo(e,(function(e,r){t===e&&(n=r)})),n},Io=function(e,t){var n=[];return Eo(e,(function(e){n.push(e)})),-1!==Ro(n,t)},Co=function(e){return JSON.parse(JSON.stringify(e))},So=function(){return"undefined"!=typeof RCCppEngine},bo=function(e){if("browser"!==e.tag)return{type:e.tag,version:"UnKonw"};var t,n,r=navigator.userAgent,i={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var s in i)if(i.hasOwnProperty(s)){var a=r.match(i[s]);if(a){n=s,t=a[1]||a[2];break}}return{type:n||"UnKonw",version:t||"UnKonw"}},wo=function(e){switch(e){case ca.SERVER_UNAVAILABLE:return aa.SERVER_UNAVAILABLE;case ca.TOKEN_INCORRECT:return aa.RC_CONN_USER_OR_PASSWD_ERROR;case ca.REDIRECT:return aa.RC_CONN_REDIRECTED;case ca.APP_BLOCK_OR_DELETE:return aa.RC_CONN_APP_BLOCKED_OR_DELETED;case ca.BLOCK:return aa.RC_CONN_USER_BLOCKED;case ca.TOKEN_EXPIRE:return aa.RC_CONN_USER_OR_PASSWD_ERROR;case ca.HOSTNAME_ERROR:return aa.HOSTNAME_ERROR;case ca.HASOHTERSAMECLIENTONLINE:return aa.HAS_OHTER_SAME_CLIENT_ON_LINE;case ca.APP_AUTH_NOT_PASS:return aa.RC_APP_AUTH_NOT_PASS;case ca.OTP_USED:return aa.RC_OTP_USED;case ca.PLATFORM_ERROR:return aa.RC_PLATFORM_ERROR;default:return aa.RC_NET_UNAVAILABLE}},Oo=function e(t){var n;if("object"===r(t))if(Array.isArray(t))for(var i in n=[],t)n.push(e(t[i]));else for(var s in n={},t)n[s]=e(t[s]);else n=t;return n},No=function(e){var t;try{t=Oo(e)}catch(n){Js.error("clone err:",n),t=JSON.parse(JSON.stringify(e))}return t},ko=function(e){var t={},n=JSON.parse(e);return Eo(n,(function(e,n){t[n]=e.v})),t},Mo={_delayTime:0,setTime:function(e){var t=(new Date).getTime();Mo._delayTime=t-e},getTime:function(){var e=Mo._delayTime;return(new Date).getTime()-e}},Ao=function(e,t){var n=0;return e.isAutoDelete&&(n|=1),e.isOverwrite&&(n|=2),2===t&&(n|=4),n},Uo=!M((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Lo=_e("IE_PROTO"),xo=Object.prototype,Po=Uo?Object.getPrototypeOf:function(e){return e=H(e),Q(e,Lo)?e[Lo]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?xo:null},Do=Nt("iterator"),Vo=!1;[].keys&&("next"in(fo=[].keys())?(ho=Po(Po(fo)))!==Object.prototype&&(lo=ho):Vo=!0),(null==lo||M((function(){var e={};return lo[Do].call(e)!==e})))&&(lo={}),Q(lo,Do)||re(lo,Do,(function(){return this}));var Bo={IteratorPrototype:lo,BUGGY_SAFARI_ITERATORS:Vo},Go=Bo.IteratorPrototype,Fo=function(){return this},qo=Bo.IteratorPrototype,Ko=Bo.BUGGY_SAFARI_ITERATORS,jo=Nt("iterator"),Ho="keys",Yo="values",Qo="entries",Wo=function(){return this},Jo=function(e,t,n,r,i,s,a){!function(e,t,n){var r=t+" Iterator";e.prototype=ar(Go,{next:P(1,n)}),Nr(e,r,!1),Ur[r]=Fo}(n,t,r);var o,u,c,l=function(e){if(e===i&&p)return p;if(!Ko&&e in d)return d[e];switch(e){case Ho:case Yo:case Qo:return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",f=!1,d=e.prototype,g=d[jo]||d["@@iterator"]||i&&d[i],p=!Ko&&g||l(i),v="Array"==t&&d.entries||g;if(v&&(o=Po(v.call(new e)),qo!==Object.prototype&&o.next&&(Po(o)!==qo&&(Wa?Wa(o,qo):"function"!=typeof o[jo]&&re(o,jo,Wo)),Nr(o,h,!0))),i==Yo&&g&&g.name!==Yo&&(f=!0,p=function(){return g.call(this)}),d[jo]!==p&&re(d,jo,p),Ur[t]=p,i)if(u={values:l(Yo),keys:s?p:l(Ho),entries:l(Qo)},a)for(c in u)(Ko||f||!(c in d))&&Ne(d,c,u[c]);else st({target:t,proto:!0,forced:Ko||f},u);return u},zo="Array Iterator",Zo=Oe.set,Xo=Oe.getterFor(zo),$o=Jo(Array,"Array",(function(e,t){Zo(this,{type:zo,target:q(e),index:0,kind:t})}),(function(){var e=Xo(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");Ur.Arguments=Ur.Array,hr("keys"),hr("values"),hr("entries");var eu="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,tu=function(e){if(void 0===e)return 0;var t=xe(e),n=De(t);if(t!==n)throw RangeError("Wrong length or index");return n},nu=Math.abs,ru=Math.pow,iu=Math.floor,su=Math.log,au=Math.LN2,ou=function(e,t,n){var r,i,s,a=new Array(n),o=8*n-t-1,u=(1<<o)-1,c=u>>1,l=23===t?ru(2,-24)-ru(2,-77):0,h=e<0||0===e&&1/e<0?1:0,f=0;for((e=nu(e))!=e||e===1/0?(i=e!=e?1:0,r=u):(r=iu(su(e)/au),e*(s=ru(2,-r))<1&&(r--,s*=2),(e+=r+c>=1?l/s:l*ru(2,1-c))*s>=2&&(r++,s/=2),r+c>=u?(i=0,r=u):r+c>=1?(i=(e*s-1)*ru(2,t),r+=c):(i=e*ru(2,c-1)*ru(2,t),r=0));t>=8;a[f++]=255&i,i/=256,t-=8);for(r=r<<t|i,o+=t;o>0;a[f++]=255&r,r/=256,o-=8);return a[--f]|=128*h,a},uu=function(e,t){var n,r=e.length,i=8*r-t-1,s=(1<<i)-1,a=s>>1,o=i-7,u=r-1,c=e[u--],l=127&c;for(c>>=7;o>0;l=256*l+e[u],u--,o-=8);for(n=l&(1<<-o)-1,l>>=-o,o+=t;o>0;n=256*n+e[u],u--,o-=8);if(0===l)l=1-a;else{if(l===s)return n?NaN:c?-1/0:1/0;n+=ru(2,t),l-=a}return(c?-1:1)*n*ru(2,l-t)},cu=function(e){for(var t=H(this),n=De(t.length),r=arguments.length,i=Ge(r>1?arguments[1]:void 0,n),s=r>2?arguments[2]:void 0,a=void 0===s?n:Ge(s,n);a>i;)t[i++]=e;return t},lu=Qe.f,hu=ne.f,fu=Oe.get,du=Oe.set,gu="ArrayBuffer",pu="DataView",vu="Wrong index",yu=k.ArrayBuffer,mu=yu,_u=k.DataView,Eu=_u&&_u.prototype,Tu=Object.prototype,Ru=k.RangeError,Iu=ou,Cu=uu,Su=function(e){return[255&e]},bu=function(e){return[255&e,e>>8&255]},wu=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Ou=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Nu=function(e){return Iu(e,23,4)},ku=function(e){return Iu(e,52,8)},Mu=function(e,t){hu(e.prototype,t,{get:function(){return fu(this)[t]}})},Au=function(e,t,n,r){var i=tu(n),s=fu(e);if(i+t>s.byteLength)throw Ru(vu);var a=fu(s.buffer).bytes,o=i+s.byteOffset,u=a.slice(o,o+t);return r?u:u.reverse()},Uu=function(e,t,n,r,i,s){var a=tu(n),o=fu(e);if(a+t>o.byteLength)throw Ru(vu);for(var u=fu(o.buffer).bytes,c=a+o.byteOffset,l=r(+i),h=0;h<t;h++)u[c+h]=l[s?h:t-h-1]};if(eu){if(!M((function(){yu(1)}))||!M((function(){new yu(-1)}))||M((function(){return new yu,new yu(1.5),new yu(NaN),yu.name!=gu}))){for(var Lu,xu=(mu=function(e){return Ar(this,mu),new yu(tu(e))}).prototype=yu.prototype,Pu=lu(yu),Du=0;Pu.length>Du;)(Lu=Pu[Du++])in mu||re(mu,Lu,yu[Lu]);xu.constructor=mu}Wa&&Po(Eu)!==Tu&&Wa(Eu,Tu);var Vu=new _u(new mu(2)),Bu=Eu.setInt8;Vu.setInt8(0,2147483648),Vu.setInt8(1,2147483649),!Vu.getInt8(0)&&Vu.getInt8(1)||br(Eu,{setInt8:function(e,t){Bu.call(this,e,t<<24>>24)},setUint8:function(e,t){Bu.call(this,e,t<<24>>24)}},{unsafe:!0})}else mu=function(e){Ar(this,mu,gu);var t=tu(e);du(this,{bytes:cu.call(new Array(t),0),byteLength:t}),A||(this.byteLength=t)},_u=function(e,t,n){Ar(this,_u,pu),Ar(e,mu,pu);var r=fu(e).byteLength,i=xe(t);if(i<0||i>r)throw Ru("Wrong offset");if(i+(n=void 0===n?r-i:De(n))>r)throw Ru("Wrong length");du(this,{buffer:e,byteLength:n,byteOffset:i}),A||(this.buffer=e,this.byteLength=n,this.byteOffset=i)},A&&(Mu(mu,"byteLength"),Mu(_u,"buffer"),Mu(_u,"byteLength"),Mu(_u,"byteOffset")),br(_u.prototype,{getInt8:function(e){return Au(this,1,e)[0]<<24>>24},getUint8:function(e){return Au(this,1,e)[0]},getInt16:function(e){var t=Au(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Au(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Ou(Au(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Ou(Au(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Cu(Au(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Cu(Au(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Uu(this,1,e,Su,t)},setUint8:function(e,t){Uu(this,1,e,Su,t)},setInt16:function(e,t){Uu(this,2,e,bu,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Uu(this,2,e,bu,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Uu(this,4,e,wu,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Uu(this,4,e,wu,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Uu(this,4,e,Nu,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Uu(this,8,e,ku,t,arguments.length>2?arguments[2]:void 0)}});Nr(mu,gu),Nr(_u,pu);var Gu={ArrayBuffer:mu,DataView:_u},Fu=Gu.ArrayBuffer,qu=Gu.DataView,Ku=Fu.prototype.slice,ju=M((function(){return!new Fu(2).slice(1,void 0).byteLength}));st({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:ju},{slice:function(e,t){if(void 0!==Ku&&void 0===t)return Ku.call(ee(this),e);for(var n=ee(this).byteLength,r=Ge(e,n),i=Ge(void 0===t?n:t,n),s=new(Zr(this,Fu))(De(i-r)),a=new qu(this),o=new qu(s),u=0;r<i;)o.setUint8(u++,a.getUint8(r++));return s}});var Hu,Yu=ne.f,Qu=k.Int8Array,Wu=Qu&&Qu.prototype,Ju=k.Uint8ClampedArray,zu=Ju&&Ju.prototype,Zu=Qu&&Po(Qu),Xu=Wu&&Po(Wu),$u=Object.prototype,ec=$u.isPrototypeOf,tc=Nt("toStringTag"),nc=ye("TYPED_ARRAY_TAG"),rc=eu&&!!Wa&&"Opera"!==Ir(k.opera),ic=!1,sc={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ac={BigInt64Array:8,BigUint64Array:8},oc=function(e){if(!K(e))return!1;var t=Ir(e);return Q(sc,t)||Q(ac,t)};for(Hu in sc)k[Hu]||(rc=!1);if((!rc||"function"!=typeof Zu||Zu===Function.prototype)&&(Zu=function(){throw TypeError("Incorrect invocation")},rc))for(Hu in sc)k[Hu]&&Wa(k[Hu],Zu);if((!rc||!Xu||Xu===$u)&&(Xu=Zu.prototype,rc))for(Hu in sc)k[Hu]&&Wa(k[Hu].prototype,Xu);if(rc&&Po(zu)!==Xu&&Wa(zu,Xu),A&&!Q(Xu,tc))for(Hu in ic=!0,Yu(Xu,tc,{get:function(){return K(this)?this[nc]:void 0}}),sc)k[Hu]&&re(k[Hu],nc,Hu);var uc={NATIVE_ARRAY_BUFFER_VIEWS:rc,TYPED_ARRAY_TAG:ic&&nc,aTypedArray:function(e){if(oc(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(Wa){if(ec.call(Zu,e))return e}else for(var t in sc)if(Q(sc,Hu)){var n=k[t];if(n&&(e===n||ec.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n){if(A){if(n)for(var r in sc){var i=k[r];i&&Q(i.prototype,e)&&delete i.prototype[e]}Xu[e]&&!n||Ne(Xu,e,n?t:rc&&Wu[e]||t)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(A){if(Wa){if(n)for(r in sc)(i=k[r])&&Q(i,e)&&delete i[e];if(Zu[e]&&!n)return;try{return Ne(Zu,e,n?t:rc&&Qu[e]||t)}catch(e){}}for(r in sc)!(i=k[r])||i[e]&&!n||Ne(i,e,t)}},isView:function(e){if(!K(e))return!1;var t=Ir(e);return"DataView"===t||Q(sc,t)||Q(ac,t)},isTypedArray:oc,TypedArray:Zu,TypedArrayPrototype:Xu},cc=uc.NATIVE_ARRAY_BUFFER_VIEWS,lc=k.ArrayBuffer,hc=k.Int8Array,fc=!cc||!M((function(){hc(1)}))||!M((function(){new hc(-1)}))||!Jr((function(e){new hc,new hc(null),new hc(1.5),new hc(e)}),!0)||M((function(){return 1!==new hc(new lc(2),1,void 0).length})),dc=function(e,t){var n=function(e){var t=xe(e);if(t<0)throw RangeError("The argument can't be less than 0");return t}(e);if(n%t)throw RangeError("Wrong offset");return n},gc=uc.aTypedArrayConstructor,pc=function(e){var t,n,r,i,s,a,o=H(e),u=arguments.length,c=u>1?arguments[1]:void 0,l=void 0!==c,h=Vr(o);if(null!=h&&!Pr(h))for(a=(s=h.call(o)).next,o=[];!(i=a.call(s)).done;)o.push(i.value);for(l&&u>2&&(c=Mn(c,arguments[2],2)),n=De(o.length),r=new(gc(this))(n),t=0;n>t;t++)r[t]=l?c(o[t],t):o[t];return r},vc=O((function(e){var t=Qe.f,n=Ln.forEach,r=Oe.get,i=Oe.set,s=ne.f,a=$.f,o=Math.round,u=k.RangeError,c=Gu.ArrayBuffer,l=Gu.DataView,h=uc.NATIVE_ARRAY_BUFFER_VIEWS,f=uc.TYPED_ARRAY_TAG,d=uc.TypedArray,g=uc.TypedArrayPrototype,p=uc.aTypedArrayConstructor,v=uc.isTypedArray,y="BYTES_PER_ELEMENT",m="Wrong length",_=function(e,t){for(var n=0,r=t.length,i=new(p(e))(r);r>n;)i[n]=t[n++];return i},E=function(e,t){s(e,t,{get:function(){return r(this)[t]}})},T=function(e){var t;return e instanceof c||"ArrayBuffer"==(t=Ir(e))||"SharedArrayBuffer"==t},R=function(e,t){return v(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},I=function(e,t){return R(e,t=j(t,!0))?P(2,e[t]):a(e,t)},C=function(e,t,n){return!(R(e,t=j(t,!0))&&K(n)&&Q(n,"value"))||Q(n,"get")||Q(n,"set")||n.configurable||Q(n,"writable")&&!n.writable||Q(n,"enumerable")&&!n.enumerable?s(e,t,n):(e[t]=n.value,e)};A?(h||($.f=I,ne.f=C,E(g,"buffer"),E(g,"byteOffset"),E(g,"byteLength"),E(g,"length")),st({target:"Object",stat:!0,forced:!h},{getOwnPropertyDescriptor:I,defineProperty:C}),e.exports=function(e,a,p){var E=e.match(/\d+$/)[0]/8,R=e+(p?"Clamped":"")+"Array",I="get"+e,C="set"+e,S=k[R],b=S,w=b&&b.prototype,O={},N=function(e,t){s(e,t,{get:function(){return function(e,t){var n=r(e);return n.view[I](t*E+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var i=r(e);p&&(n=(n=o(n))<0?0:n>255?255:255&n),i.view[C](t*E+i.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};h?fc&&(b=a((function(e,t,n,r){return Ar(e,b,R),Ja(K(t)?T(t)?void 0!==r?new S(t,dc(n,E),r):void 0!==n?new S(t,dc(n,E)):new S(t):v(t)?_(b,t):pc.call(b,t):new S(tu(t)),e,b)})),Wa&&Wa(b,d),n(t(S),(function(e){e in b||re(b,e,S[e])})),b.prototype=w):(b=a((function(e,t,n,r){Ar(e,b,R);var s,a,o,h=0,f=0;if(K(t)){if(!T(t))return v(t)?_(b,t):pc.call(b,t);s=t,f=dc(n,E);var d=t.byteLength;if(void 0===r){if(d%E)throw u(m);if((a=d-f)<0)throw u(m)}else if((a=De(r)*E)+f>d)throw u(m);o=a/E}else o=tu(t),s=new c(a=o*E);for(i(e,{buffer:s,byteOffset:f,byteLength:a,length:o,view:new l(s)});h<o;)N(e,h++)})),Wa&&Wa(b,d),w=b.prototype=ar(g)),w.constructor!==b&&re(w,"constructor",b),f&&re(w,f,R),O[R]=b,st({global:!0,forced:b!=S,sham:!h},O),y in b||re(b,y,E),y in w||re(w,y,E),Mr(R)}):e.exports=function(){}}));vc("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var yc=Math.min,mc=[].copyWithin||function(e,t){var n=H(this),r=De(n.length),i=Ge(e,r),s=Ge(t,r),a=arguments.length>2?arguments[2]:void 0,o=yc((void 0===a?r:Ge(a,r))-s,r-i),u=1;for(s<i&&i<s+o&&(u=-1,s+=o-1,i+=o-1);o-- >0;)s in n?n[i]=n[s]:delete n[i],i+=u,s+=u;return n},_c=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("copyWithin",(function(e,t){return mc.call(_c(this),e,t,arguments.length>2?arguments[2]:void 0)}));var Ec=Ln.every,Tc=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("every",(function(e){return Ec(Tc(this),e,arguments.length>1?arguments[1]:void 0)}));var Rc=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("fill",(function(e){return cu.apply(Rc(this),arguments)}));var Ic=uc.aTypedArrayConstructor,Cc=function(e,t){for(var n=Zr(e,e.constructor),r=0,i=t.length,s=new(Ic(n))(i);i>r;)s[r]=t[r++];return s},Sc=Ln.filter,bc=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("filter",(function(e){var t=Sc(bc(this),e,arguments.length>1?arguments[1]:void 0);return Cc(this,t)}));var wc=Ln.find,Oc=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("find",(function(e){return wc(Oc(this),e,arguments.length>1?arguments[1]:void 0)}));var Nc=Ln.findIndex,kc=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("findIndex",(function(e){return Nc(kc(this),e,arguments.length>1?arguments[1]:void 0)}));var Mc=Ln.forEach,Ac=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("forEach",(function(e){Mc(Ac(this),e,arguments.length>1?arguments[1]:void 0)}));var Uc=qe.includes,Lc=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("includes",(function(e){return Uc(Lc(this),e,arguments.length>1?arguments[1]:void 0)}));var xc=qe.indexOf,Pc=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("indexOf",(function(e){return xc(Pc(this),e,arguments.length>1?arguments[1]:void 0)}));var Dc=Nt("iterator"),Vc=k.Uint8Array,Bc=$o.values,Gc=$o.keys,Fc=$o.entries,qc=uc.aTypedArray,Kc=uc.exportTypedArrayMethod,jc=Vc&&Vc.prototype[Dc],Hc=!!jc&&("values"==jc.name||null==jc.name),Yc=function(){return Bc.call(qc(this))};Kc("entries",(function(){return Fc.call(qc(this))})),Kc("keys",(function(){return Gc.call(qc(this))})),Kc("values",Yc,!Hc),Kc(Dc,Yc,!Hc);var Qc=uc.aTypedArray,Wc=[].join;(0,uc.exportTypedArrayMethod)("join",(function(e){return Wc.apply(Qc(this),arguments)}));var Jc=Math.min,zc=[].lastIndexOf,Zc=!!zc&&1/[1].lastIndexOf(1,-0)<0,Xc=Fn("lastIndexOf"),$c=Zc||!Xc?function(e){if(Zc)return zc.apply(this,arguments)||0;var t=q(this),n=De(t.length),r=n-1;for(arguments.length>1&&(r=Jc(r,xe(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:zc,el=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("lastIndexOf",(function(e){return $c.apply(el(this),arguments)}));var tl=Ln.map,nl=uc.aTypedArray,rl=uc.aTypedArrayConstructor;(0,uc.exportTypedArrayMethod)("map",(function(e){return tl(nl(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(rl(Zr(e,e.constructor)))(t)}))}));var il=function(e){return function(t,n,r,i){kn(n);var s=H(t),a=G(s),o=De(s.length),u=e?o-1:0,c=e?-1:1;if(r<2)for(;;){if(u in a){i=a[u],u+=c;break}if(u+=c,e?u<0:o<=u)throw TypeError("Reduce of empty array with no initial value")}for(;e?u>=0:o>u;u+=c)u in a&&(i=n(i,a[u],u,s));return i}},sl={left:il(!1),right:il(!0)},al=sl.left,ol=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("reduce",(function(e){return al(ol(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var ul=sl.right,cl=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("reduceRight",(function(e){return ul(cl(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var ll=uc.aTypedArray,hl=uc.exportTypedArrayMethod,fl=Math.floor;hl("reverse",(function(){for(var e,t=this,n=ll(t).length,r=fl(n/2),i=0;i<r;)e=t[i],t[i++]=t[--n],t[n]=e;return t}));var dl=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("set",(function(e){dl(this);var t=dc(arguments.length>1?arguments[1]:void 0,1),n=this.length,r=H(e),i=De(r.length),s=0;if(i+t>n)throw RangeError("Wrong length");for(;s<i;)this[t+s]=r[s++]}),M((function(){new Int8Array(1).set({})})));var gl=uc.aTypedArray,pl=uc.aTypedArrayConstructor,vl=[].slice;(0,uc.exportTypedArrayMethod)("slice",(function(e,t){for(var n=vl.call(gl(this),e,t),r=Zr(this,this.constructor),i=0,s=n.length,a=new(pl(r))(s);s>i;)a[i]=n[i++];return a}),M((function(){new Int8Array(1).slice()})));var yl=Ln.some,ml=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("some",(function(e){return yl(ml(this),e,arguments.length>1?arguments[1]:void 0)}));var _l=uc.aTypedArray,El=[].sort;(0,uc.exportTypedArrayMethod)("sort",(function(e){return El.call(_l(this),e)}));var Tl=uc.aTypedArray;(0,uc.exportTypedArrayMethod)("subarray",(function(e,t){var n=Tl(this),r=n.length,i=Ge(e,r);return new(Zr(n,n.constructor))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,De((void 0===t?r:Ge(t,r))-i))}));var Rl=k.Int8Array,Il=uc.aTypedArray,Cl=uc.exportTypedArrayMethod,Sl=[].toLocaleString,bl=[].slice,wl=!!Rl&&M((function(){Sl.call(new Rl(1))}));Cl("toLocaleString",(function(){return Sl.apply(wl?bl.call(Il(this)):Il(this),arguments)}),M((function(){return[1,2].toLocaleString()!=new Rl([1,2]).toLocaleString()}))||!M((function(){Rl.prototype.toLocaleString.call([1,2])})));var Ol=uc.exportTypedArrayMethod,Nl=k.Uint8Array,kl=Nl&&Nl.prototype||{},Ml=[].toString,Al=[].join;M((function(){Ml.call({})}))&&(Ml=function(){return Al.call(this)});var Ul=kl.toString!=Ml;Ol("toString",Ml,Ul);var Ll=Nt("iterator"),xl=Nt("toStringTag"),Pl=$o.values;for(var Dl in dr){var Vl=k[Dl],Bl=Vl&&Vl.prototype;if(Bl){if(Bl[Ll]!==Pl)try{re(Bl,Ll,Pl)}catch(e){Bl[Ll]=Pl}if(Bl[xl]||re(Bl,xl,Dl),dr[Dl])for(var Gl in $o)if(Bl[Gl]!==$o[Gl])try{re(Bl,Gl,$o[Gl])}catch(e){Bl[Gl]=$o[Gl]}}}var Fl=Object.assign,ql=Object.defineProperty,Kl=!Fl||M((function(){if(A&&1!==Fl({b:1},Fl(ql({},"a",{enumerable:!0,get:function(){ql(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=Fl({},e)[n]||Bn(Fl({},t)).join("")!=r}))?function(e,t){for(var n=H(e),r=arguments.length,i=1,s=We.f,a=x.f;r>i;)for(var o,u=G(arguments[i++]),c=s?Bn(u).concat(s(u)):Bn(u),l=c.length,h=0;l>h;)o=c[h++],A&&!a.call(u,o)||(n[o]=u[o]);return n}:Fl;st({target:"Object",stat:!0,forced:Object.assign!==Kl},{assign:Kl});var jl=function(e){if(vs(e))throw TypeError("The method doesn't accept regular expressions");return e},Hl=Nt("match");st({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Hl]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~String(F(this)).indexOf(jl(e),arguments.length>1?arguments[1]:void 0)}});var Yl,Ql,Wl,Jl,zl,Zl="[\t\n\v\f\r \u2028\u2029\ufeff]",Xl=RegExp("^"+Zl+Zl+"*"),$l=RegExp(Zl+Zl+"*$"),eh=function(e){return function(t){var n=String(F(t));return 1&e&&(n=n.replace(Xl,"")),2&e&&(n=n.replace($l,"")),n}},th={start:eh(1),end:eh(2),trim:eh(3)},nh=Qe.f,rh=$.f,ih=ne.f,sh=th.trim,ah="Number",oh=k.Number,uh=oh.prototype,ch=V(ar(uh))==ah,lh=function(e){var t,n,r,i,s,a,o,u,c=j(e,!1);if("string"==typeof c&&c.length>2)if(43===(t=(c=sh(c)).charCodeAt(0))||45===t){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(a=(s=c.slice(2)).length,o=0;o<a;o++)if((u=s.charCodeAt(o))<48||u>i)return NaN;return parseInt(s,r)}return+c};if(rt(ah,!oh(" 0o1")||!oh("0b1")||oh("+0x1"))){for(var hh,fh=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof fh&&(ch?M((function(){uh.valueOf.call(n)})):V(n)!=ah)?Ja(new oh(lh(t)),n,fh):lh(t)},dh=A?nh(oh):"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(","),gh=0;dh.length>gh;gh++)Q(oh,hh=dh[gh])&&!Q(fh,hh)&&ih(fh,hh,rh(oh,hh));fh.prototype=uh,uh.constructor=fh,Ne(k,ah,fh)}!function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"}(Yl||(Yl={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.SUBSCRIBE=8]="SUBSCRIBE",e[e.SUB_ACK=9]="SUB_ACK",e[e.UNSUBSCRIBE=10]="UNSUBSCRIBE",e[e.UNSUB_ACK=11]="UNSUB_ACK",e[e.PING_REQ=12]="PING_REQ",e[e.PING_RESP=13]="PING_RESP",e[e.DISCONNECT=14]="DISCONNECT",e[e.RESERVER2=15]="RESERVER2"}(Ql||(Ql={})),function(e){e.CONN_ACK="ConnAckMessage",e.DISCONNECT="DisconnectMessage",e.PING_REQ="PingReqMessage",e.PING_RESP="PingRespMessage",e.PUBLISH="PublishMessage",e.PUB_ACK="PubAckMessage",e.QUERY="QueryMessage",e.QUERY_CON="QueryConMessage",e.QUERY_ACK="QueryAckMessage"}(Wl||(Wl={})),function(e){e.PUB="pub",e.QUERY="qry"}(Jl||(Jl={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(zl||(zl={}));var ph,vh=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Yl.AT_LEAST_ONCE,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];a(this,e),this._retain=!1,this.qos=Yl.AT_LEAST_ONCE,this._dup=!1,this.syncMsg=!1;var s=t>0;t&&s&&1===arguments.length?(this._retain=(1&t)>0,this.qos=(6&t)>>1,this._dup=(8&t)>0,this.type=t>>4&15,this.syncMsg=8==(8&t)):(this.type=t,this._retain=n,this.qos=r,this._dup=i)}return u(e,[{key:"encode",value:function(){var e=this.type<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this._dup?8:0}}]),e}(),yh=function(){function e(){a(this,e)}return u(e,null,[{key:"writeUTF",value:function(e,t){var n=[],r=0;if(Ls(e))for(var i=0,s=e.length;i<s;i++){var a=e.charCodeAt(i);a>=0&&a<=127?(r+=1,n.push(a)):a>=128&&a<=2047?(r+=2,n.push(192|31&a>>6),n.push(128|63&a)):a>=2048&&a<=65535&&(r+=3,n.push(224|15&a>>12),n.push(128|63&a>>6),n.push(128|63&a))}for(var o=0,u=n.length;o<u;o++)n[o]>255&&(n[o]&=255);return t?n:r<=255?[0,r].concat(n):[r>>8,255&r].concat(n)}},{key:"readUTF",value:function(e){for(var t,n,r=[],i=-1,s=e,a="";++i<s.length;){var o=Number(s[i]);if(o===(127&o)||(240==(240&o)?o=(o=(o=(o^=240)<<6|128^s[++i])<<6|128^s[++i])<<6|128^s[++i]:224==(224&o)?o=(o=(o^=224)<<6|128^s[++i])<<6|128^s[++i]:192==(192&o)&&(o=(o^=192)<<6|128^s[++i])),!isFinite(o)||o<0||o>1114111||Math.floor(o)!==o)throw RangeError("Invalid code point: "+o);o<=65535?r.push(o):(t=(o-=65536)>>10|55296,n=o%1024|56320,r.push(t,n)),(i+1===s.length||r.length>16384)&&(a+=String.fromCharCode.apply(null,r),r.length=0)}return a}}]),e}(),mh=function(){function e(t){a(this,e),this._position=0,this._poolLen=0,this._pool=t,this._poolLen=t.length}return u(e,[{key:"check",value:function(){return this._position>=this._pool.length}},{key:"read2Byte",value:function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<2;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0"+r),t+=r.toString()}return parseInt(t,16)}},{key:"readInt",value:function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<4;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0"+r),t+=r.toString()}return parseInt(t,16)}},{key:"readLong",value:function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<8;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0"+r),t+=r}return parseInt(t,16)}},{key:"readByte",value:function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e}},{key:"readUTF",value:function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._pool.subarray(this._position,this._position+=e);return yh.readUTF(t)}},{key:"readAll",value:function(){return this._pool.subarray(this._position,this._poolLen)}}]),e}(),_h=function(){function e(){a(this,e),this._pool=[],this._position=0,this._writen=0}return u(e,[{key:"write",value:function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")?this._pool=this._pool.concat(e):e>=0&&(e>255&&(e&=255),this._pool.push(e),this._writen++),e}},{key:"writeArr",value:function(e){return this._pool=this._pool.concat(e),e}},{key:"writeUTF",value:function(e){var t=yh.writeUTF(e);this._pool=this._pool.concat(t),this._writen+=t.length}},{key:"getBytesArray",value:function(){return this._pool}}]),e}(),Eh="UpStreamMessage",Th="PushExtra",Rh="DownStreamMessage",Ih="DownStreamMessages",Ch="SessionsAttQryInput",Sh="SessionsAttOutput",bh="SyncRequestMsg",wh="ChrmPullMsg",Oh="NotifyMsg",Nh="HistoryMsgInput",kh="HistoryMsgOuput",Mh="RelationQryInput",Ah="RelationsOutput",Uh="DeleteSessionsInput",Lh="SessionInfo",xh="DeleteSessionsOutput",Ph="RelationsInput",Dh="DeleteMsgInput",Vh="CleanHisMsgInput",Bh="SessionMsgReadInput",Gh="ChrmInput",Fh="ChrmOutput",qh="QueryChatRoomInfoInput",Kh="QueryChatRoomInfoOutput",jh="RtcInput",Hh="RtcUserListOutput",Yh="SetUserStatusInput",Qh="RtcSetDataInput",Wh="RtcUserSetDataInput",Jh="RtcDataInput",zh="RtcSetOutDataInput",Zh="MCFollowInput",Xh="RtcTokenOutput",$h="RtcQryOutput",ef="RtcQryUserOutDataInput",tf="RtcUserOutDataOutput",nf="RtcQueryListInput",rf="RtcRoomInfoOutput",sf="RtcValueInfo",af="RtcKeyDeleteInput",of="GetQNupTokenInput",uf="GetQNupTokenOutput",cf="GetQNdownloadUrlInput",lf="GetDownloadUrlInput",hf="GetQNdownloadUrlOutput",ff="GetDownloadUrlOutput",df="ChrmKVEntity",gf="SetChrmKV",pf="SetChrmKVS",vf="DeleteChrmKVS",yf="ChrmKVOutput",mf="ChrmKVSOutput",_f="ChrmKVSVersionEntity",Ef="ChrmKVSOutputEntity",Tf="QueryChrmKV",Rf="SetUserSettingInput",If="SetUserSettingOutput",Cf="PullUserSettingInput",Sf="PullUserSettingOutput",bf="UserSettingNotification",wf="SessionReq",Of="SessionStates",Nf="SessionState",kf="SessionStateItem",Mf="SessionStateModifyReq",Af="SessionStateModifyResp",Uf="GrpReadReceiptMsg",Lf="GrpReadReceiptQryReq",xf="GrpReadReceiptQryResp",Pf="GrpMsgReadUser",Df="SessionTagAddInput",Vf="SessionTagItem",Bf="SessionTagDelInput",Gf="SessionDisTagReq",Ff="ReportSDKInput",qf="ReportSDKOutput",Kf="UltraGrpPullSes",jf="UltraGrpPullMsg",Hf="MsgChangeReq",Yf="QueryMsgChange",Qf="MsgChange",Wf="MsgChangeList",Jf="MsgQuery",zf="MessageQueryInfo",Zf="MsgQueryAck",Xf="OperateStatus",$f="OperateStatusNotify",ed="OperateInfo",td="OperateSummary",nd="RtcNotifyMsg",rd="RtcPullKV",id="RtcKVOutput",sd="RtcQueryUserJoinedInput",ad="RtcQueryUserJoinedOutput",od="RtcViewerJoinedOutput",ud="RtcInviteInput",cd="RtcCancelInviteInput",ld="RtcInviteAnswerInput",hd="RtcEndInviteInput",fd="SetRtcRoomIdInput",dd="SetRtcRoomIdOutput",gd=(c(ph={},Eh,["sessionId","classname","content","pushText","userId","configFlag","appData","extraContent","pushExt","busChannel"]),c(ph,Ih,["list","syncTime","finished","broadcastSyncTime"]),c(ph,Rh,["fromUserId","type","groupId","classname","content","dataTime","status","msgId","extraContent","pushContent","configFlag","pushExt","busChannel"]),c(ph,Th,["title","templateIdNoUse","pushId","pushConfigs","templateId"]),c(ph,Ch,["nothing"]),c(ph,Sh,["inboxTime","sendboxTime","totalUnreadCount"]),c(ph,bh,["syncTime","ispolling","isweb","isPullSend","isKeeping","sendBoxSyncTime","broadcastSyncTime"]),c(ph,wh,["syncTime","count"]),c(ph,Oh,["type","time","chrmId"]),c(ph,Nh,["targetId","time","count","order","busChannel"]),c(ph,kh,["list","syncTime","hasMsg"]),c(ph,Mh,["type","count","startTime","order"]),c(ph,Ah,["info","isFinished"]),c(ph,Uh,["sessions"]),c(ph,Lh,["type","channelId","busChannel"]),c(ph,xh,["nothing"]),c(ph,Ph,["type","msg","count","busChannel","startTime","endTime"]),c(ph,Dh,["type","conversationId","msgs","busChannel"]),c(ph,Vh,["targetId","dataTime","conversationType","busChannel"]),c(ph,Bh,["type","msgTime","channelId","busChannel"]),c(ph,Gh,["nothing"]),c(ph,Fh,["nothing","sessionId","joinTime"]),c(ph,qh,["count","order"]),c(ph,Kh,["userTotalNums","userInfos"]),c(ph,of,["type","key","httpMethod","queryString"]),c(ph,cf,["type","key","fileName"]),c(ph,lf,["type","key","fileName"]),c(ph,uf,["deadline","token","bosToken","bosDate","path","osskeyId","ossPolicy","ossSign","ossBucketName"]),c(ph,hf,["downloadUrl"]),c(ph,ff,["downloadUrl"]),c(ph,df,["key","value","status","timestamp","uid","version"]),c(ph,gf,["entry","bNotify","notification","type"]),c(ph,pf,["entry","bNotify","notification","type"]),c(ph,vf,["entry","bNotify","notification","type"]),c(ph,yf,["entries","bFullUpdate","syncTime"]),c(ph,mf,["timestamp","errorKeys","keysVersion"]),c(ph,_f,["version","key"]),c(ph,Ef,["key","errorCode"]),c(ph,Tf,["timestamp"]),c(ph,Rf,["version","value"]),c(ph,If,["version","reserve"]),c(ph,Cf,["version","reserve"]),c(ph,Sf,["items","version"]),c(ph,"UserSettingItem",["targetId","type","key","value","version","status","tags"]),c(ph,wf,["time"]),c(ph,Of,["version","state"]),c(ph,Nf,["type","channelId","time","stateItem","busChannel"]),c(ph,kf,["sessionStateType","value","tags"]),c(ph,Mf,["version","state"]),c(ph,Af,["version"]),c(ph,Uf,["msgId","busChannel"]),c(ph,Lf,["msgId","busChannel"]),c(ph,xf,["totalMemberNum","list"]),c(ph,Pf,["readTime","userId"]),c(ph,Df,["version","tags"]),c(ph,Vf,["tagId","name","createdTime","isTop"]),c(ph,Bf,["version","tags"]),c(ph,Gf,["tagId"]),c(ph,bf,["version","reserve"]),c(ph,Ff,["sdkInfo"]),c(ph,qf,["nothing"]),c(ph,Kf,["syncTime","isEraseMsgContent"]),c(ph,jf,["syncTime"]),c(ph,Hf,["fromUserId","targetId","type","busChannel","msgUID","msgTime","content"]),c(ph,Yf,["syncTime"]),c(ph,Wf,["list","syncTime","hasNext"]),c(ph,Qf,["targetId","type","time","changeType","msgUID","msgTime","busChannel","isAdmin","isDel","operatorId"]),c(ph,Jf,["targetId","type","query"]),c(ph,zf,["msgTime","msgUID","busChannel"]),c(ph,Zf,["list"]),c(ph,Xf,["targetId","type","opType","busChannel"]),c(ph,$f,["type","notifyType","info","summary"]),c(ph,ed,["targetId","busChannel","userId","opType","optime"]),c(ph,td,["targetId","busChannel","count","opType"]),c(ph,jh,["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType"]),c(ph,Hh,["users","token","sessionId","roomInfo"]),c(ph,Yh,["status"]),c(ph,Qh,["interior","target","key","value","objectName","content"]),c(ph,Wh,["valueInfo","objectName","content"]),c(ph,Jh,["interior","target","key","objectName","content"]),c(ph,zh,["target","valueInfo","objectName","content"]),c(ph,Zh,["state"]),c(ph,Xh,["rtcToken"]),c(ph,$h,["outInfo"]),c(ph,ef,["userId"]),c(ph,tf,["user"]),c(ph,nf,["order"]),c(ph,rf,["roomId","roomData","userCount","list"]),c(ph,sf,["key","value"]),c(ph,af,["key"]),c(ph,nd,["type","time","roomId"]),c(ph,rd,["timestamp","roomId"]),c(ph,id,["entries","bFullUpdate","syncTime"]),c(ph,sd,["userId"]),c(ph,ad,["info"]),c(ph,ud,["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"]),c(ph,cd,["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"]),c(ph,ld,["inviteUserID","answerCode","inviteRoomId","inviteSessionId","content","key","value"]),c(ph,hd,["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"]),c(ph,fd,["rtcRoomId"]),c(ph,dd,["nothing"]),ph),pd={},vd=function(e){var t=gd[e];pd[e]=function(){for(var e={},n={getArrayData:function(){return e}},r=function(r){var i=t[r],s="set".concat(Hn(i,0,1));n[s]=function(t){e[i]=t}},i=0;i<t.length;i++)r(i);return n},pd[e].decode=function(e){var t={};Ls(e)&&(e=JSON.parse(e));var n=function(n){var r="get".concat(Hn(n,0,1));t[n]=e[n],t[r]=function(){return e[n]}};for(var r in e)n(r);return t}};for(var yd in gd)vd(yd);pd.getModule=function(e){return pd[e]()},vc("Int8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var md="\npackage Modules;\nmessage probuf {\n message ".concat(Yh,"\n {\n optional int32 status=1;\n }\n\n message SetUserStatusOutput\n {\n optional int32 nothing=1;\n }\n\n message GetUserStatusInput\n {\n optional int32 nothing=1;\n }\n\n message GetUserStatusOutput\n {\n optional string status=1;\n optional string subUserId=2;\n }\n\n message SubUserStatusInput\n {\n repeated string userid =1;\n }\n\n message SubUserStatusOutput\n {\n optional int32 nothing=1;\n }\n message VoipDynamicInput\n {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n\n message VoipDynamicOutput\n {\n required string dynamicKey=1;\n }\n message ").concat(Oh," {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message ").concat(bh," {\n required int64 syncTime = 1;\n required bool ispolling = 2;\n optional bool isweb=3;\n optional bool isPullSend=4;\n optional bool isKeeping=5;\n optional int64 sendBoxSyncTime=6;\n optional int64 broadcastSyncTime=7;\n }\n message ").concat(Eh," {\n required int32 sessionId = 1;\n required string classname = 2;\n required bytes content = 3;\n optional string pushText = 4;\n optional string appData = 5;\n repeated string userId = 6;\n optional int64 delMsgTime = 7;\n optional string delMsgId = 8;\n optional int32 configFlag = 9;\n optional int64 clientUniqueId = 10;\n optional string extraContent = 11;\n optional PushExtra pushExt = 12;\n optional string busChannel = 13; // 该消息所属会话的业务标识\n }\n message ").concat(Th," {\n optional string title = 1;\n optional int32 templateIdNoUse= 2;\n optional string pushId = 3;\n optional string pushConfigs = 4;\n optional string templateId = 5;\n }\n message ").concat(Ih," {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n }\n message ").concat(Rh," {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required bytes content = 5;\n required int64 dataTime = 6;\n required int64 status = 7;\n optional int64 extra = 8;\n optional string msgId = 9;\n optional int32 direction = 10;\n optional int32 plantform =11;\n optional int32 isRemoved = 12;\n optional string source = 13;\n optional int64 clientUniqueId = 14;\n optional string extraContent = 15;\n optional string pushContent = 16;\n optional int32 configFlag = 17;\n optional PushExtra pushExt = 18;\n optional string busChannel = 19; // 该消息所属会话的业务标识,限制20字符以内\n optional int64 extStatus = 20; // 消息的扩展标记 第0位,表示送达状态: 0x01 表示已送达;断档: 0x02 表示是否需要执行断档策略; 消息修改: 0x04 拉取历史消息时表示该消息是否修改过\n }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n image = ").concat(Us.IMAGE,";\n audio = ").concat(Us.AUDIO,";\n video = ").concat(Us.VIDEO,";\n file = ").concat(Us.FILE,";\n }\n message ").concat(of," {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n }\n message ").concat(cf," {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message ").concat(lf," {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message ").concat(uf," {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n }\n message ").concat(hf," {\n required string downloadUrl = 1;\n }\n message ").concat(ff," {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n group_success = 0x00;\n group_failure = 0x01;\n }\n message ").concat(Gh," {\n required int32 nothing = 1;\n }\n message ").concat(Fh," {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n }\n message ").concat(wh," {\n required int64 syncTime = 1;\n required int32 count = 2;\n }\n\n message ChrmPullMsgNew\n {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message ").concat(Mh,"\n {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n }\n message ").concat(Ph,"\n {\n required ChannelType type = 1;\n optional DownStreamMessage msg =2;\n optional int32 count = 3;\n repeated string busChannel = 4;\n optional int64 startTime = 5;\n optional int64 endTime = 6;\n }\n message ").concat(Ah,"\n {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;//是否结束\n }\n message RelationInfo\n {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;//该消息所属会话的业务标识\n optional int64 versionTime = 7;//会话项变更时间戳,注意:非排序时间戳\n optional int64 remindCount = 8;//被@的未读数\n }\n message RelationInfoReadTime\n {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message ").concat(Vh,"\n {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4; //该消息所属会话的业务标识,限制20字符以内\n }\n message HistoryMessageInput\n {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput\n {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n }\n message ").concat(qh,"\n {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message ").concat(Kh,"\n {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember\n {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput\n {\n required string id = 1;\n }\n\n message MPFollowOutput\n {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message ").concat(Zh,"\n {\n required string state = 1;\n }\n\n message MCFollowOutput\n {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo\n {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput\n {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput\n {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput\n {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput\n {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message ").concat(Nh,"\n {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5; //该消息所属会话的业务标识,限制20字符以内\n }\n\n message ").concat(kh,"\n {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n }\n message ").concat(nf,"{\n optional int32 order=1;\n }\n\n message ").concat(af,"{\n repeated string key=1;\n }\n\n message ").concat(sf,"{\n required string key=1;\n required string value=2;\n }\n\n message RtcUserInfo{\n required string userId=1;\n repeated ").concat(sf," userData=2; //用户资源信息\n }\n\n message ").concat(Hh,"{\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4; //房间key value\n repeated RtcKVEntity entries = 5;//直播KV属性对象集合\n optional int64 syncTime = 6;//所有属性的最大时间戳(下次拉取KV时用)。\n optional int32 offlineKickTime = 7;//server超时踢人时间,默认60s\n }\n message RtcRoomInfoOutput{\n optional string roomId = 1;\n repeated ").concat(sf," roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message ").concat(jh,"{\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4; //是否需要同步聊天室\n optional IdentityChangeType identityChangeType = 5; //身份变更类型\n optional JoinType joinType = 6; // 加入房间类型\n repeated ").concat(sf," innerDatas = 7; //用户内部inner数据,角色或者连麦信息等\n repeated ").concat(sf," outerDatas = 8; //用户内部outer数据,自定义数据结构RtcInput。\n }\n enum JoinType {\n KICK = 0; //踢前一个设备\n REFUSE = 1; //当前加入拒绝\n COEXIST = 2; //两个设备共存\n }\n message RtcQryInput{\n required bool isInterior=1;\n required targetType target=2;\n repeated string key=3;\n }\n message ").concat($h,"{\n repeated ").concat(sf," outInfo=1;\n }\n message RtcDelDataInput{\n repeated string key=1;\n required bool isInterior=2;\n required targetType target=3;\n }\n message ").concat(Jh,"{\n required bool interior=1;\n required targetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message ").concat(Qh,"{\n required bool interior=1;\n required targetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message ").concat(Wh," {\n repeated ").concat(sf," valueInfo = 1;\n required string objectName = 2;\n repeated ").concat(sf," content = 3;\n }\n message RtcOutput\n {\n optional int32 nothing=1;\n }\n message ").concat(Xh,"{\n required string rtcToken=1;\n }\n enum targetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message ").concat(zh,"{\n required targetType target=1;\n repeated ").concat(sf," valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message ").concat(ef,"{\n repeated string userId = 1;\n }\n message ").concat(tf,"{\n repeated RtcUserInfo user = 1;\n }\n message ").concat(Ch,"{\n required int32 nothing = 1;\n }\n message ").concat(Sh,"{\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message ").concat(Bh,"\n {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;\n optional string busChannel = 4;//该消息所属会话的业务标识\n }\n message SessionMsgReadOutput\n {\n optional int32 nothing=1;\n }\n message ").concat(Uh,"\n {\n repeated SessionInfo sessions = 1;\n }\n message ").concat(Lh,"\n {\n required ChannelType type = 1;\n required string channelId = 2;\n optional string busChannel = 3;//所属会话业务标识\n }\n message ").concat(xh,"\n {\n optional int32 nothing=1;\n }\n message ").concat(Dh,"\n {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4; //该消息所属会话的业务标识,限制20字符以内\n }\n message DeleteMsg\n {\n optional string msgId = 1;\n optional int64 msgDataTime = 2;\n optional int32 direct = 3;\n }\n message ChrmKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n optional int64 version = 6;\n }\n message ").concat(gf," {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ").concat(pf," {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ").concat(vf," {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ").concat(yf," {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message ").concat(mf," {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message ").concat(Ef,"\n {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message ").concat(Tf," {\n required int64 timestamp = 1;\n }\n message ").concat(Rf," {\n required int64 version=1;\n required string value=2;\n }\n message ").concat(If," {\n required int64 version=1;\n required bool reserve=2;\n }\n message ").concat(Cf," {\n required int64 version=1;\n optional bool reserve=2;\n }\n message ").concat(Sf," {\n repeated UserSettingItem items = 1;\n required int64 version=2;\n }\n message UserSettingItem {\n required string targetId= 1;\n required ChannelType type = 2;\n required string key = 4;\n required bytes value = 5;\n required int64 version=6;\n required int32 status=7;\n repeated SessionTagItem tags= 8;\n }\n message ").concat(wf," {\n required int64 time = 1;\n }\n message ").concat(Of," {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message ").concat(Nf," {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 time = 3;\n repeated SessionStateItem stateItem = 4;\n optional string busChannel = 5;//该消息所属会话的业务标识\n }\n message ").concat(kf," {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n }\n message ").concat(Mf," {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message ").concat(Af," {\n required int64 version=1;\n }\n message ").concat(Uf," {\n repeated string msgId=1; //已读消息ID\n optional string channelId = 2; // 该消息所属会话的业务标识\n }\n message ").concat(Lf," {\n repeated string msgId=1; //已读消息ID\n optional string channelId = 2; // 该消息所属会话的业务标识\n }\n message ").concat(xf," {\n required int32 totalMemberNum = 1;//群内总人数\n repeated GrpMsgReadUser list = 2;//已读用户列表(list复类型)\n }\n message ").concat(Pf," {\n required int64 readTime = 1;//已读时间\n required string userId = 2;//已读用户id\n }\n message ").concat(Df," {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message ").concat(Vf," {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message ").concat(Bf," {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message ").concat(Gf," {\n repeated string tagId=1;\n }\n message ").concat(bf," {\n required int64 version=1;\n required bool reserve=2;\n }\n message ").concat(Ff,' {\n required string sdkInfo=1; // 用户集成的 sdk 信息,json 格式 {"web-rtc": "4.0.3.7"}\n }\n message ').concat(qf,"\n {\n optional int32 nothing=1; //占位\n }\n message ").concat(nd," \n {\n required int32 type= 1; //(通知类型 1:rtc房间状态KV变更通知)\n optional int64 time= 2; //消息产生时间\n optional string roomId=3; //主播房间id\n }\n message ").concat(rd,"\n {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message ").concat(id,"\n {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n message RtcKVEntity \n {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n enum IdentityChangeType \n {\n AnchorToViewer = 1; //1为主播变观众\n ViewerToAnchor = 2; //2为观众变主播\n }\n message ").concat(sd,"\n {\n required string userId = 1;\n }\n message ").concat(ad,"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message RtcJoinedInfo\n {\n required string deviceId = 1; //设备ID\n required string roomId = 2; //加入的房间ID\n optional int64 joinTime = 3; //加入的时间\n }\n message ").concat(od,"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV属性对象集合\n optional int64 syncTime = 3;//所有属性的最大时间戳(下次拉取KV时用)。\n }\n message ").concat(ud,"\n {\n required string invitedUserId=1; //被邀请的人的uid\n optional int32 timeoutTime=2; //邀请超时时间(秒),默认三十秒\n required string invitedRoomId=3; //被邀请的房间\n required string inviteInfo=4; //邀请的信息(包含邀请人,被邀请人,各自userid)客户端定义好.协议栈和server透传\n required string inviteSessionId= 5; //客户端保证唯一性(建议roomid_userid_时间戳_随机数)\n }\n message ").concat(cd,"\n {\n required string invitedUserId=1; //被邀请的人的uid\n required string invitedRoomId=2; //被邀请的房间\n required string inviteInfo=3; //取消邀请的信息(包含邀请人,被邀请人,各自userid)客户端定义好.协议栈和server透传\n required string inviteSessionId=4; //邀请的sessionId,客户端发起邀请时产生\n }\n message ").concat(ld,"\n {\n required string inviteUserId=1; //邀请的人的uid\n required int32 answerCode=2; //是否接受连麦邀请.0为拒绝,1为接受\n required string inviteRoomId=3; //邀请的房间\n required string inviteSessionId=4; //邀请的sessionId\n required string content=5; //需要转发的content\n optional string key=6; //如果接受的话,需要加这个字段,放在room级别的k和v,新加入房间的能拉取到\n optional string value=7; //如果接受的话,需要加这个字段,放在room级别的k和v,新加入房间的能拉取到\n }\n message ").concat(hd,"\n {\n required string inviteRoomId=1; //邀请的房间\n required string inviteSessionId=2; //邀请的sessionId\n required string inviteContent=3; //结束连麦的信息(需要透传给房间内其他人)\n repeated string inviteRoomKeys=4; //需要删除连麦的信息的key\n }\n message ").concat(Kf,"\n {\n required int64 syncTime = 1;//同步时间戳\n optional bool isEraseMsgContent = 2;//拉取会话时,是否屏蔽掉消息内容\n }\n message ").concat(jf,"\n {\n required int64 syncTime = 1;//同步时间戳\n }\n message ").concat(Hf,"\n {\n required string fromUserId = 1;//(谁发的)\n required string targetId = 2;// 目标Id(超级群Id)\n required ChannelType type = 3;//发送类型如:(P2P,GROUP,ULTRAGROUP)\n required string msgUID = 4; // 扩展消息的内容体\n required int64 msgTime = 5; //原始消息时间\n optional string busChannel = 6; // 该消息所属会话的业务标识,限制20字符以内\n optional string content = 7; // 即extraContent消息扩展内容,下表格说明\n }\n message ").concat(Yf," //查询入参\n {\n required int64 syncTime = 1;//同步时间戳\n }\n message ").concat(Wf," //应答结果\n {\n repeated MsgChange list = 1; //变更\n required int64 syncTime = 2; //同步时间(用于下次同步入参)\n optional bool hasNext = 3 ;\n }\n message MsgChange //变更详情\n {\n required string targetId = 1; // 目标Id(超级群Id)\n required ChannelType type = 2; // 会话类型\n required int64 time = 3; // 变更时间\n required int32 changeType = 4; // 消息变更类型(1:扩展,2:修改,3:撤回)\n required string msgUID = 5; // 消息ID\n required int64 msgTime = 6; // 消息时间\n optional string busChannel = 7; // 频道ID\n optional bool isAdmin = 8; //是否为管理员,默认为 0,设为 1 时,IMKit 收到此条消息后,小灰条默认显示为“管理员 撤回了一条消息”。\n optional bool isDel = 9; //默认为 0 撤回该条消息同时,用户端将该条消息删除并替换为一条小灰条撤回提示消息;为 1 时,该条消息删除后,不替换为小灰条提示消息。\n optional string operatorId = 10; // 新加 - 消息变更的操作人Id\n }\n message ").concat(Jf," //请求\n {\n required string targetId = 1; // 目标Id(超级群Id)\n required ChannelType type = 2; // 会话类型\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo\n {\n required int64 msgTime = 1; // 消息时间\n required string msgUID = 2; // 消息ID\n optional string busChannel = 3; // 频道ID\n }\n message ").concat(Zf," //应答\n {\n repeated DownStreamMessage list = 1;//消息\n }\n message ").concat(Xf," //客户端发送\n {\n optional string targetId = 1;// targetId\n optional ChannelType type = 2;//发送会话类型如:(P2P,GROUP) \n optional int32 opType = 3; //0 , 正在输入, 1 正在XXX \n optional string busChannel = 4; // 频道(channelId,可以为空)\n }\n message ").concat($f," //服务端发送\n {\n optional ChannelType type = 1;//发送会话类型如(P2P,GROUP) \n optional int64 notifyType = 2; //0x1 表示明细, 0x2 表示汇总 0x3 表示明细+汇总\n repeated OperateInfo info = 3 ; //明细列表 当notifyType 为 1和3时,有效\n repeated OperateSummary summary = 4 ; //汇总列表, 当notifyType 为2和3 时,有效\n }\n message ").concat(ed," {\n // XX 正在做什么\n optional string targetId = 1; // 超级群Id 会话id\n optional string busChannel = 2; // 频道(channelId,可以为空)\n optional string userId = 3; // userId\n optional int32 opType = 4; //0 , 正在输入, 1 正在XX \n optional int64 optime = 5; //服务端收到用户操作的上行时间. \n }\n \n message ").concat(td," {\n // 几个人 正在干什么\n optional string targetId = 1; // 超级群Id 会话id\n optional string busChannel = 2; // 频道(channelId,可以为空)\n optional int32 count = 3; // 操作人数\n optional int32 opType = 4; //0, 正在输入, 1 正在XX \n }\n message ").concat(fd,"\n {\n required string rtcRoomId= 1; //rtc房间ID;\n }\n message ").concat(dd,"\n {\n required int32 nothing = 1; //用于占位\n }\n}\n"),_d=/"/g;st({target:"String",proto:!0,forced:function(e){return M((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}("sub")},{sub:function(){return e="sub",t="",n="",r=String(F(this)),i="<"+e,""!==t&&(i+=" "+t+'="'+String(n).replace(_d,""")+'"'),i+">"+r+"</"+e+">";var e,t,n,r,i}});var Ed="ArrayBuffer",Td=Gu.ArrayBuffer,Rd=k.ArrayBuffer;st({global:!0,forced:Rd!==Td},{ArrayBuffer:Td}),Mr(Ed),st({target:"Array",proto:!0},{fill:cu}),hr("fill");var Id,Cd,Sd,bd,wd,Od=(Id=md,function(e,t){var n,i,s={};return s.ByteBuffer=e,s.c=e,n=e,s.Long=t||null,s.VERSION="5.0.1",s.WIRE_TYPES={},s.WIRE_TYPES.VARINT=0,s.WIRE_TYPES.BITS64=1,s.WIRE_TYPES.LDELIM=2,s.WIRE_TYPES.STARTGROUP=3,s.WIRE_TYPES.ENDGROUP=4,s.WIRE_TYPES.BITS32=5,s.PACKABLE_WIRE_TYPES=[s.WIRE_TYPES.VARINT,s.WIRE_TYPES.BITS64,s.WIRE_TYPES.BITS32],s.TYPES={int32:{name:"int32",wireType:s.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:s.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:s.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:s.WIRE_TYPES.VARINT,defaultValue:s.Long?s.Long.ZERO:void 0},uint64:{name:"uint64",wireType:s.WIRE_TYPES.VARINT,defaultValue:s.Long?s.Long.UZERO:void 0},sint64:{name:"sint64",wireType:s.WIRE_TYPES.VARINT,defaultValue:s.Long?s.Long.ZERO:void 0},bool:{name:"bool",wireType:s.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:s.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:s.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:s.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:s.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:s.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:s.WIRE_TYPES.BITS64,defaultValue:s.Long?s.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:s.WIRE_TYPES.BITS64,defaultValue:s.Long?s.Long.ZERO:void 0},float:{name:"float",wireType:s.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:s.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:s.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:s.WIRE_TYPES.STARTGROUP,defaultValue:null}},s.MAP_KEY_TYPES=[s.TYPES.int32,s.TYPES.sint32,s.TYPES.sfixed32,s.TYPES.uint32,s.TYPES.fixed32,s.TYPES.int64,s.TYPES.sint64,s.TYPES.sfixed64,s.TYPES.uint64,s.TYPES.fixed64,s.TYPES.bool,s.TYPES.string,s.TYPES.bytes],s.ID_MIN=1,s.ID_MAX=536870911,s.convertFieldsToCamelCase=!1,s.populateAccessors=!0,s.populateDefaults=!0,s.Util=function(){var e={};return e.IS_NODE=!("object"!==("undefined"==typeof process?"undefined":r(process))||process+""!="[object process]"||process.browser),e.XHR=function(){var e,t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=null;for(e=0;e<t.length;e++){try{n=t[e]()}catch(e){continue}break}if(!n)throw Error("XMLHttpRequest is not supported");return n},e.fetch=function(t,n){if(n&&"function"!=typeof n&&(n=null),e.IS_NODE)if(n)g.readFile(t,(function(e,t){n(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var r=e.XHR();if(r.open("GET",t,!!n),r.setRequestHeader("Accept","text/plain"),"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/plain"),!n)return r.send(null),200==r.status||0==r.status&&"string"==typeof r.responseText?r.responseText:null;if(r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0==r.status&&"string"==typeof r.responseText?n(r.responseText):n(null))},4==r.readyState)return;r.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e}(),s.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},s.DotProto=function(e,t){function n(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=0|i*r,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return 1/0*n;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function i(e,t,n){void 0===e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var s,a,o={},u=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},c=u.prototype;return c._readString=function(){var e,n='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(n.lastIndex=this.index-1,!(e=n.exec(this.source)))throw Error("unterminated string");return this.index=n.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},c.next=function(){var e,n,r,i,s;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);if(this.index===this.source.length)return null;if(i=this.index,t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;return('"'===(s=this.source.substring(this.index,this.index=i))||"'"===s)&&(this._stringOpen=s),s},c.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},c.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},c.omit=function(e){return this.peek()===e&&(this.next(),!0)},c.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},o.Tokenizer=u,(a=(s=function(e){this.tn=new u(e),this.proto3=!1}).prototype).parse=function(){var e,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!r)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n.imports.push(e);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},s.parse=function(e){return new s(e).parse()},a._readString=function(){var e,t,n="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},a._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},a._parseOption=function(e,n){var r,i=this.tn.next(),s=!1;if("("===i&&(s=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal option name: "+i);r=i,s&&(this.tn.skip(")"),r="("+r+")",i=this.tn.peek(),t.FQTYPEREF.test(i)&&(r+=i,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,r),n||this.tn.skip(";")},a._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)i(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?i(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},a._parseService=function(e){var n,r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);for(n={name:r,rpc:{},options:{}},this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(n)}this.tn.omit(";"),e.services.push(n)},a._parseServiceRPC=function(e){var n,r,i="rpc",s=this.tn.next();if(!t.NAME.test(s))throw Error("illegal rpc service method name: "+s);if(n=s,r={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(s=this.tn.next()).toLowerCase()&&(r.request_stream=!0,s=this.tn.next()),!t.TYPEREF.test(s))throw Error("illegal rpc service request type: "+s);if(r.request=s,this.tn.skip(")"),"returns"!==(s=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+s);if(this.tn.skip("("),"stream"===(s=this.tn.next()).toLowerCase()&&(r.response_stream=!0,s=this.tn.next()),r.response=s,this.tn.skip(")"),"{"===(s=this.tn.peek())){for(this.tn.next();"}"!==(s=this.tn.next());){if("option"!==s)throw Error("illegal rpc service token: "+s);this._parseOption(r)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[i]&&(e[i]={}),e[i][n]=r},a._parseMessage=function(e,r){var i=!!r,s=this.tn.next(),a={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(s))throw Error("illegal "+(i?"group":"message")+" name: "+s);for(a.name=s,i&&(this.tn.skip("="),r.id=n(this.tn.next()),a.isGroup=!0),"["===(s=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(s=this.tn.next());)if(t.RULE.test(s))this._parseMessageField(a,s);else if("oneof"===s)this._parseMessageOneOf(a);else if("enum"===s)this._parseEnum(a);else if("message"===s)this._parseMessage(a);else if("option"===s)this._parseOption(a);else if("service"===s)this._parseService(a);else if("extensions"===s)a.extensions=this._parseExtensionRanges();else if("reserved"===s)this._parseIgnored();else if("extend"===s)this._parseExtend(a);else{if(!t.TYPEREF.test(s))throw Error("illegal message token: "+s);if(!this.proto3)throw Error("illegal field rule: "+s);this._parseMessageField(a,"optional",s)}return this.tn.omit(";"),e.messages.push(a),a},a._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},a._parseMessageField=function(e,r,i){var s,a,o;if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);if(s={rule:r,type:"",name:"",options:{},id:0},"map"===r){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),a=this.tn.next(),!t.TYPE.test(a)&&!t.TYPEREF.test(a))throw Error("illegal message field type: "+a);if(s.keytype=a,this.tn.skip(","),a=this.tn.next(),!t.TYPE.test(a)&&!t.TYPEREF.test(a))throw Error("illegal message field: "+a);if(s.type=a,this.tn.skip(">"),a=this.tn.next(),!t.NAME.test(a))throw Error("illegal message field name: "+a);s.name=a,this.tn.skip("="),s.id=n(this.tn.next()),"["===(a=this.tn.peek())&&this._parseFieldOptions(s),this.tn.skip(";")}else if("group"===(i=void 0!==i?i:this.tn.next())){if(o=this._parseMessage(e,s),!/^[A-Z]/.test(o.name))throw Error("illegal group name: "+o.name);s.type=o.name,s.name=o.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(s.type=i,a=this.tn.next(),!t.NAME.test(a))throw Error("illegal message field name: "+a);s.name=a,this.tn.skip("="),s.id=n(this.tn.next()),"["===(a=this.tn.peek())&&this._parseFieldOptions(s),this.tn.skip(";")}return e.fields.push(s),s},a._parseMessageOneOf=function(e){var n,r,i,s=this.tn.next();if(!t.NAME.test(s))throw Error("illegal oneof name: "+s);for(r=s,i=[],this.tn.skip("{");"}"!==(s=this.tn.next());)(n=this._parseMessageField(e,"optional",s)).oneof=r,i.push(n.id);this.tn.omit(";"),e.oneofs[r]=i},a._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},a._parseEnum=function(e){var r,i={name:"",values:[],options:{}},s=this.tn.next();if(!t.NAME.test(s))throw Error("illegal name: "+s);for(i.name=s,this.tn.skip("{");"}"!==(s=this.tn.next());)if("option"===s)this._parseOption(i);else{if(!t.NAME.test(s))throw Error("illegal name: "+s);this.tn.skip("="),r={name:s,id:n(this.tn.next(),!0)},"["===(s=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(r)}this.tn.omit(";"),e.enums.push(i)},a._parseExtensionRanges=function(){var t,n,i,s=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=r(t)}if(n.push(i),2===n.length)break;if("to"!==this.tn.peek()){n.push(i);break}this.tn.next()}s.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),s},a._parseExtend=function(e){var n,r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);for(n={ref:r,fields:[]},this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(n,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(n,"optional",r)}return this.tn.omit(";"),e.messages.push(n),n},a.toString=function(){return"Parser at line "+this.tn.line},o.Parser=s,o}(s,s.Lang),s.Reflect=function(t){function i(e,n){if(e&&"number"==typeof e.low&&"number"==typeof e.high&&"boolean"==typeof e.unsigned&&e.low==e.low&&e.high==e.high)return new t.Long(e.low,e.high,void 0===n?e.unsigned:n);if("string"==typeof e)return t.Long.fromString(e,n||!1,10);if("number"==typeof e)return t.Long.fromNumber(e,n||!1);throw Error("not convertible to Long")}function s(e,n){var r=n.readVarint32(),i=7&r,a=r>>>3;switch(i){case t.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(128==(128&r));break;case t.WIRE_TYPES.BITS64:n.offset+=8;break;case t.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case t.WIRE_TYPES.STARTGROUP:s(a,n);break;case t.WIRE_TYPES.ENDGROUP:if(a===e)return!1;throw Error("Illegal GROUPEND after unknown group: "+a+" ("+e+" expected)");case t.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+e+": "+i)}return!0}var a,o,u,c,l,h,f,d,g,p,v,y,m,_,E,T,R={},I=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},C=I.prototype;return C.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},C.toString=function(e){return(e?this.className+" ":"")+this.fqn()},C.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},R.T=I,(o=(a=function(e,t,n,r,i){I.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"}).prototype=Object.create(I.prototype)).getChildren=function(e){var t,n,r;if(null==(e=e||null))return this.children.slice();for(t=[],n=0,r=this.children.length;r>n;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},o.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof l.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof l.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},o.getChild=function(e){var t,n,r="number"==typeof e?"id":"name";for(t=0,n=this.children.length;n>t;++t)if(this.children[t][r]===e)return this.children[t];return null},o.resolve=function(e,t){var n,r="string"==typeof e?e.split("."):e,i=this,s=0;if(""===r[s]){for(;null!==i.parent;)i=i.parent;s++}do{do{if(!(i instanceof R.Namespace)){i=null;break}if(!((n=i.getChild(r[s]))&&n instanceof R.T&&(!t||n instanceof R.Namespace))){i=null;break}i=n,s++}while(s<r.length);if(null!=i)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=i);return i},o.qn=function(e){var t,n,r=[],i=e;do{r.unshift(i.name),i=i.parent}while(null!==i);for(t=1;t<=r.length;t++)if(n=r.slice(r.length-t),e===this.resolve(n,e instanceof R.Namespace))return n.join(".");return e.fqn()},o.build=function(){var e,t,n,r={},i=this.children;for(t=0,n=i.length;n>t;++t)(e=i[t])instanceof a&&(r[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt()}),r},o.buildOpt=function(){var e,t,n,r,i={},s=Object.keys(this.options);for(e=0,t=s.length;t>e;++e)n=s[e],r=this.options[s[e]],i[n]=r;return i},o.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null},R.Namespace=a,c=(u=function(e,n,r,i){if(this.type=e,this.resolvedType=n,this.isMapKey=r,this.syntax=i,r&&t.MAP_KEY_TYPES.indexOf(e)<0)throw Error("Invalid map key type: "+e.name)}).prototype,u.defaultFieldValue=function(e){if("string"==typeof e&&(e=t.TYPES[e]),void 0===e.defaultValue)throw Error("default value for type "+e.name+" is not supported");return e==t.TYPES.bytes?new n(0):e.defaultValue},c.verifyValue=function(n){var s,a,o,u=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this);switch(this.type){case t.TYPES.int32:case t.TYPES.sint32:case t.TYPES.sfixed32:return("number"!=typeof n||n==n&&n%1!=0)&&u(r(n),"not an integer"),n>4294967295?0|n:n;case t.TYPES.uint32:case t.TYPES.fixed32:return("number"!=typeof n||n==n&&n%1!=0)&&u(r(n),"not an integer"),n<0?n>>>0:n;case t.TYPES.int64:case t.TYPES.sint64:case t.TYPES.sfixed64:if(t.Long)try{return i(n,!1)}catch(e){u(r(n),e.message)}else u(r(n),"requires Long.js");case t.TYPES.uint64:case t.TYPES.fixed64:if(t.Long)try{return i(n,!0)}catch(e){u(r(n),e.message)}else u(r(n),"requires Long.js");case t.TYPES.bool:return"boolean"!=typeof n&&u(r(n),"not a boolean"),n;case t.TYPES.float:case t.TYPES.double:return"number"!=typeof n&&u(r(n),"not a number"),n;case t.TYPES.string:return"string"==typeof n||n&&n instanceof String||u(r(n),"not a string"),""+n;case t.TYPES.bytes:return e.isByteBuffer(n)?n:e.wrap(n);case t.TYPES.enum:for(s=this.resolvedType.getChildren(t.Reflect.Enum.Value),o=0;o<s.length;o++){if(s[o].name==n)return s[o].id;if(s[o].id==n)return s[o].id}if("proto3"===this.syntax)return("number"!=typeof n||n==n&&n%1!=0)&&u(r(n),"not an integer"),(n>4294967295||n<0)&&u(r(n),"not in range for uint32"),n;u(n,"not a valid enum value");case t.TYPES.group:case t.TYPES.message:if(n&&"object"===r(n)||u(r(n),"object expected"),n instanceof this.resolvedType.clazz)return n;if(n instanceof t.Builder.Message){for(o in a={},n)n.hasOwnProperty(o)&&(a[o]=n[o]);n=a}return new this.resolvedType.clazz(n)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+n+" (undefined type "+this.type+")")},c.calculateLength=function(e,r){if(null===r)return 0;var i;switch(this.type){case t.TYPES.int32:return r<0?n.calculateVarint64(r):n.calculateVarint32(r);case t.TYPES.uint32:return n.calculateVarint32(r);case t.TYPES.sint32:return n.calculateVarint32(n.zigZagEncode32(r));case t.TYPES.fixed32:case t.TYPES.sfixed32:case t.TYPES.float:return 4;case t.TYPES.int64:case t.TYPES.uint64:return n.calculateVarint64(r);case t.TYPES.sint64:return n.calculateVarint64(n.zigZagEncode64(r));case t.TYPES.fixed64:case t.TYPES.sfixed64:return 8;case t.TYPES.bool:return 1;case t.TYPES.enum:return n.calculateVarint32(r);case t.TYPES.double:return 8;case t.TYPES.string:return i=n.calculateUTF8Bytes(r),n.calculateVarint32(i)+i;case t.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");return n.calculateVarint32(r.remaining())+r.remaining();case t.TYPES.message:return i=this.resolvedType.calculate(r),n.calculateVarint32(i)+i;case t.TYPES.group:return(i=this.resolvedType.calculate(r))+n.calculateVarint32(e<<3|t.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")},c.encodeValue=function(e,r,i){var s,a;if(null===r)return i;switch(this.type){case t.TYPES.int32:r<0?i.writeVarint64(r):i.writeVarint32(r);break;case t.TYPES.uint32:i.writeVarint32(r);break;case t.TYPES.sint32:i.writeVarint32ZigZag(r);break;case t.TYPES.fixed32:i.writeUint32(r);break;case t.TYPES.sfixed32:i.writeInt32(r);break;case t.TYPES.int64:case t.TYPES.uint64:i.writeVarint64(r);break;case t.TYPES.sint64:i.writeVarint64ZigZag(r);break;case t.TYPES.fixed64:i.writeUint64(r);break;case t.TYPES.sfixed64:i.writeInt64(r);break;case t.TYPES.bool:"string"==typeof r?i.writeVarint32("false"===r.toLowerCase()?0:!!r):i.writeVarint32(r?1:0);break;case t.TYPES.enum:i.writeVarint32(r);break;case t.TYPES.float:i.writeFloat32(r);break;case t.TYPES.double:i.writeFloat64(r);break;case t.TYPES.string:i.writeVString(r);break;case t.TYPES.bytes:if(r.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+r.remaining()+" bytes remaining");s=r.offset,i.writeVarint32(r.remaining()),i.append(r),r.offset=s;break;case t.TYPES.message:a=(new n).LE(),this.resolvedType.encode(r,a),i.writeVarint32(a.offset),i.append(a.flip());break;case t.TYPES.group:this.resolvedType.encode(r,i),i.writeVarint32(e<<3|t.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+r+" (unknown type)")}return i},c.decode=function(e,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,s;switch(this.type){case t.TYPES.int32:return 0|e.readVarint32();case t.TYPES.uint32:return e.readVarint32()>>>0;case t.TYPES.sint32:return 0|e.readVarint32ZigZag();case t.TYPES.fixed32:return e.readUint32()>>>0;case t.TYPES.sfixed32:return 0|e.readInt32();case t.TYPES.int64:return e.readVarint64();case t.TYPES.uint64:return e.readVarint64().toUnsigned();case t.TYPES.sint64:return e.readVarint64ZigZag();case t.TYPES.fixed64:return e.readUint64();case t.TYPES.sfixed64:return e.readInt64();case t.TYPES.bool:return!!e.readVarint32();case t.TYPES.enum:return e.readVarint32();case t.TYPES.float:return e.readFloat();case t.TYPES.double:return e.readDouble();case t.TYPES.string:return e.readVString();case t.TYPES.bytes:if(s=e.readVarint32(),e.remaining()<s)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+s+" required but got only "+e.remaining());return(i=e.clone()).limit=i.offset+s,e.offset+=s,i;case t.TYPES.message:return s=e.readVarint32(),this.resolvedType.decode(e,s);case t.TYPES.group:return this.resolvedType.decode(e,-1,r)}throw Error("[INTERNAL] Illegal decode type")},c.valueFromString=function(e){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case t.TYPES.int32:case t.TYPES.sint32:case t.TYPES.sfixed32:case t.TYPES.uint32:case t.TYPES.fixed32:return this.verifyValue(parseInt(e));case t.TYPES.int64:case t.TYPES.sint64:case t.TYPES.sfixed64:case t.TYPES.uint64:case t.TYPES.fixed64:return this.verifyValue(e);case t.TYPES.bool:return"true"===e;case t.TYPES.string:return this.verifyValue(e);case t.TYPES.bytes:return n.fromBinary(e)}},c.valueToString=function(e){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===t.TYPES.bytes?e.toString("binary"):e.toString()},R.Element=u,(h=(l=function(e,t,n,r,i,s){a.call(this,e,t,n,r,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null}).prototype=Object.create(a.prototype)).build=function(i){var s,a,o,u;if(this.clazz&&!i)return this.clazz;for(s=function(t,i){function s(e,i,a,o){var u,c,l,h,f,d,g;if(null===e||"object"!==r(e))return o&&o instanceof t.Reflect.Enum&&null!==(u=t.Reflect.Enum.getName(o.object,e))?u:e;if(n.isByteBuffer(e))return i?e.toBase64():e.toBuffer();if(t.Long.isLong(e))return a?e.toString():t.Long.fromValue(e);if(Array.isArray(e))return c=[],e.forEach((function(e,t){c[t]=s(e,i,a,o)})),c;if(c={},e instanceof t.Map){for(h=(l=e.entries()).next();!h.done;h=l.next())c[e.keyElem.valueToString(h.value[0])]=s(h.value[1],i,a,e.valueElem.resolvedType);return c}for(g in f=e.$type,d=void 0,e)e.hasOwnProperty(g)&&(c[g]=f&&(d=f.getChild(g))?s(e[g],i,a,d.resolvedType):s(e[g],i,a));return c}var a,o,u=i.getChildren(t.Reflect.Message.Field),c=i.getChildren(t.Reflect.Message.OneOf),l=function e(s){var a,o,l,h;for(t.Builder.Message.call(this),a=0,o=c.length;o>a;++a)this[c[a].name]=null;for(a=0,o=u.length;o>a;++a)this[(l=u[a]).name]=l.repeated?[]:l.map?new t.Map(l):null,!l.required&&"proto3"!==i.syntax||null===l.defaultValue||(this[l.name]=l.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===s||"object"!==r(s)||!("function"!=typeof s.encode||s instanceof e)||Array.isArray(s)||s instanceof t.Map||n.isByteBuffer(s)||s instanceof ArrayBuffer||t.Long&&s instanceof t.Long)for(a=0,o=arguments.length;o>a;++a)void 0!==(h=arguments[a])&&this.$set(u[a].name,h);else this.$set(s)},h=l.prototype=Object.create(t.Builder.Message.prototype);for(h.add=function(e,n,r){var s=i._fieldsByName[e];if(!r){if(!s)throw Error(this+"#"+e+" is undefined");if(!(s instanceof t.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+s.toString(!0));if(!s.repeated)throw Error(this+"#"+e+" is not a repeated field");n=s.verifyValue(n,!0)}return null===this[e]&&(this[e]=[]),this[e].push(n),this},h.$add=h.add,h.set=function(e,n,s){var a,o,u;if(e&&"object"===r(e)){for(a in s=n,e)e.hasOwnProperty(a)&&void 0!==(n=e[a])&&this.$set(a,n,s);return this}if(o=i._fieldsByName[e],s)this[e]=n;else{if(!o)throw Error(this+"#"+e+" is not a field: undefined");if(!(o instanceof t.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+o.toString(!0));this[o.name]=n=o.verifyValue(n)}return o&&o.oneof&&(u=this[o.oneof.name],null!==n?(null!==u&&u!==o.name&&(this[u]=null),this[o.oneof.name]=o.name):u===e&&(this[o.oneof.name]=null)),this},h.$set=h.set,h.get=function(e,n){if(n)return this[e];var r=i._fieldsByName[e];if(!(r&&r instanceof t.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: undefined");if(!(r instanceof t.Reflect.Message.Field))throw Error(this+"#"+e+" is not a field: "+r.toString(!0));return this[r.name]},h.$get=h.get,a=0;a<u.length;a++)(o=u[a])instanceof t.Reflect.Message.ExtensionField||i.builder.options.populateAccessors&&function(e){var t,n,r,s=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));s=s.substring(0,1).toUpperCase()+s.substring(1),t=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),n=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},r=function(){return this[e.name]},null===i.getChild("set"+s)&&(h["set"+s]=n),null===i.getChild("set_"+t)&&(h["set_"+t]=n),null===i.getChild("get"+s)&&(h["get"+s]=r),null===i.getChild("get_"+t)&&(h["get_"+t]=r)}(o);return h.encode=function(t,n){var r,s;"boolean"==typeof t&&(n=t,t=void 0),r=!1,t||(t=new e,r=!0),s=t.littleEndian;try{return i.encode(this,t.LE(),n),(r?t.flip():t).LE(s)}catch(e){throw t.LE(s),e}},l.encode=function(e,t,n){return new l(e).encode(t,n)},h.calculate=function(){return i.calculate(this)},h.encodeDelimited=function(e){var t,r=!1;return e||(e=new n,r=!0),t=(new n).LE(),i.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),r?e.flip():e},h.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},h.toArrayBuffer=h.encodeAB,h.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},h.toBuffer=h.encodeNB,h.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},h.toBase64=h.encode64,h.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}},h.toHex=h.encodeHex,h.toRaw=function(e,t){return s(this,!!e,!!t,this.$type)},h.encodeJSON=function(){return JSON.stringify(s(this,!0,!0,this.$type))},l.decode=function(e,t){var r,s;"string"==typeof e&&(e=n.wrap(e,t||"base64")),r=(e=n.isByteBuffer(e)?e:n.wrap(e)).littleEndian;try{return s=i.decode(e.LE()),e.LE(r),s}catch(t){throw e.LE(r),t}},l.decodeDelimited=function(e,t){var r,s,a;if("string"==typeof e&&(e=n.wrap(e,t||"base64")),(e=n.isByteBuffer(e)?e:n.wrap(e)).remaining()<1)return null;if(r=e.offset,s=e.readVarint32(),e.remaining()<s)return e.offset=r,null;try{return a=i.decode(e.slice(e.offset,e.offset+s).LE()),e.offset+=s,a}catch(t){throw e.offset+=s,t}},l.decode64=function(e){return l.decode(e,"base64")},l.decodeHex=function(e){return l.decode(e,"hex")},l.decodeJSON=function(e){return new l(JSON.parse(e))},h.toString=function(){return i.toString()},Object.defineProperty&&(Object.defineProperty(l,"$options",{value:i.buildOpt()}),Object.defineProperty(h,"$options",{value:l.$options}),Object.defineProperty(l,"$type",{value:i}),Object.defineProperty(h,"$type",{value:i})),l}(t,this),this._fields=[],this._fieldsById={},this._fieldsByName={},o=0,u=this.children.length;u>o;o++)if((a=this.children[o])instanceof v||a instanceof l||a instanceof _){if(s.hasOwnProperty(a.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+a.toString(!0)+" cannot override static property '"+a.name+"'");s[a.name]=a.build()}else if(a instanceof l.Field)a.build(),this._fields.push(a),this._fieldsById[a.id]=a,this._fieldsByName[a.name]=a;else if(!(a instanceof l.OneOf||a instanceof m))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[o].toString(!0));return this.clazz=s},h.encode=function(e,t,n){var r,i,s,a,o,u=null;for(s=0,a=this._fields.length;a>s;++s)i=e[(r=this._fields[s]).name],r.required&&null===i?null===u&&(u=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==u)throw(o=Error("Missing at least one required field for "+this.toString(!0)+": "+u)).encoded=t,o;return t},h.calculate=function(e){for(var t,n,r=0,i=0,s=this._fields.length;s>i;++i){if(n=e[(t=this._fields[i]).name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},h.decode=function(e,n,r){var i,a,o,u,c,l,h,f,d,g,p,v;for(n="number"==typeof n?n:-1,c=e.offset,l=new this.clazz;e.offset<c+n||-1===n&&e.remaining()>0;){if(o=(i=e.readVarint32())>>>3,(a=7&i)===t.WIRE_TYPES.ENDGROUP){if(o!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+o+" ("+(r?r+" expected":"not a group")+")");break}if(u=this._fieldsById[o])u.repeated&&!u.options.packed?l[u.name].push(u.decode(a,e)):u.map?(f=u.decode(a,e),l[u.name].set(f[0],f[1])):(l[u.name]=u.decode(a,e),u.oneof&&(null!==(d=l[u.oneof.name])&&d!==u.name&&(l[d]=null),l[u.oneof.name]=u.name));else switch(a){case t.WIRE_TYPES.VARINT:e.readVarint32();break;case t.WIRE_TYPES.BITS32:e.offset+=4;break;case t.WIRE_TYPES.BITS64:e.offset+=8;break;case t.WIRE_TYPES.LDELIM:h=e.readVarint32(),e.offset+=h;break;case t.WIRE_TYPES.STARTGROUP:for(;s(o,e););break;default:throw Error("Illegal wire type for unknown field "+o+" in "+this.toString(!0)+"#decode: "+a)}}for(g=0,p=this._fields.length;p>g;++g)if(null===l[(u=this._fields[g]).name])if("proto3"===this.syntax)l[u.name]=u.defaultValue;else{if(u.required)throw(v=Error("Missing at least one required field for "+this.toString(!0)+": "+u.name)).decoded=l,v;t.populateDefaults&&null!==u.defaultValue&&(l[u.name]=u.defaultValue)}return l},R.Message=l,(d=(f=function(e,n,r,i,s,a,o,u,c,h){I.call(this,e,n,a),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=s,this.resolvedType=null,this.id=o,this.options=u||{},this.defaultValue=null,this.oneof=c||null,this.syntax=h||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof l.ExtensionField||(this.name=t.Util.toCamelCase(this.name))}).prototype=Object.create(I.prototype)).build=function(){this.element=new u(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new u(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=u.defaultFieldValue(this.type)},d.verifyValue=function(e,n){var i,s,a;if(n=n||!1,i=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this),null===e)return this.required&&i(r(e),"required"),"proto3"===this.syntax&&this.type!==t.TYPES.message&&i(r(e),"proto3 field without field presence cannot be null"),null;if(this.repeated&&!n){for(Array.isArray(e)||(e=[e]),a=[],s=0;s<e.length;s++)a.push(this.element.verifyValue(e[s]));return a}return this.map&&!n?e instanceof t.Map?e:(e instanceof Object||i(r(e),"expected ProtoBuf.Map or raw object for map field"),new t.Map(this,e)):(!this.repeated&&Array.isArray(e)&&i(r(e),"no array expected"),this.element.verifyValue(e))},d.hasWirePresence=function(e,n){if("proto3"!==this.syntax)return null!==e;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case t.TYPES.int32:case t.TYPES.sint32:case t.TYPES.sfixed32:case t.TYPES.uint32:case t.TYPES.fixed32:return 0!==e;case t.TYPES.int64:case t.TYPES.sint64:case t.TYPES.sfixed64:case t.TYPES.uint64:case t.TYPES.fixed64:return 0!==e.low||0!==e.high;case t.TYPES.bool:return e;case t.TYPES.float:case t.TYPES.double:return 0!==e;case t.TYPES.string:return e.length>0;case t.TYPES.bytes:return e.remaining()>0;case t.TYPES.enum:return 0!==e;case t.TYPES.message:return null!==e;default:return!0}},d.encode=function(e,i,s){var a,o,u,c,l;if(null===this.type||"object"!==r(this.type))throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===e||this.repeated&&0==e.length)return i;try{if(this.repeated)if(this.options.packed&&t.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i.writeVarint32(this.id<<3|t.WIRE_TYPES.LDELIM),i.ensureCapacity(i.offset+=1),o=i.offset,a=0;a<e.length;a++)this.element.encodeValue(this.id,e[a],i);u=i.offset-o,(c=n.calculateVarint32(u))>1&&(l=i.slice(o,i.offset),o+=c-1,i.offset=o,i.append(l)),i.writeVarint32(u,o-c)}else for(a=0;a<e.length;a++)i.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,e[a],i);else this.map?e.forEach((function(e,r){var s=n.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+n.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,e);i.writeVarint32(this.id<<3|t.WIRE_TYPES.LDELIM),i.writeVarint32(s),i.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,r,i),i.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,e,i)}),this):this.hasWirePresence(e,s)&&(i.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,e,i))}catch(t){throw Error("Illegal value for "+this.toString(!0)+": "+e+" ("+t+")")}return i},d.calculate=function(e,i){var s,a,o;if(e=this.verifyValue(e),null===this.type||"object"!==r(this.type))throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===e||this.repeated&&0==e.length)return 0;s=0;try{if(this.repeated)if(this.options.packed&&t.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(s+=n.calculateVarint32(this.id<<3|t.WIRE_TYPES.LDELIM),o=0,a=0;a<e.length;a++)o+=this.element.calculateLength(this.id,e[a]);s+=n.calculateVarint32(o),s+=o}else for(a=0;a<e.length;a++)s+=n.calculateVarint32(this.id<<3|this.type.wireType),s+=this.element.calculateLength(this.id,e[a]);else this.map?e.forEach((function(e,r){var i=n.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,r)+n.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,e);s+=n.calculateVarint32(this.id<<3|t.WIRE_TYPES.LDELIM),s+=n.calculateVarint32(i),s+=i}),this):this.hasWirePresence(e,i)&&(s+=n.calculateVarint32(this.id<<3|this.type.wireType),s+=this.element.calculateLength(this.id,e))}catch(t){throw Error("Illegal value for "+this.toString(!0)+": "+e+" ("+t+")")}return s},d.decode=function(e,n,r){var i,s,a,o,c,l,h;if(!(!this.map&&e==this.type.wireType||!r&&this.repeated&&this.options.packed&&e==t.WIRE_TYPES.LDELIM||this.map&&e==t.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+e+" ("+this.type.wireType+" expected)");if(e==t.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&t.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){for(s=n.readVarint32(),s=n.offset+s,a=[];n.offset<s;)a.push(this.decode(this.type.wireType,n,!0));return a}if(this.map){if(o=u.defaultFieldValue(this.keyType),i=u.defaultFieldValue(this.type),s=n.readVarint32(),n.remaining()<s)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+s+" required but got only "+n.remaining());for((c=n.clone()).limit=c.offset+s,n.offset+=s;c.remaining()>0;)if(e=7&(l=c.readVarint32()),1==(h=l>>>3))o=this.keyElement.decode(c,e,h);else{if(2!==h)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(c,e,h)}return[o,i]}return this.element.decode(n,e,this.id)},R.Message.Field=f,(g=function(e,t,n,r,i,s,a){f.call(this,e,t,n,null,r,i,s,a),this.extension}).prototype=Object.create(f.prototype),R.Message.ExtensionField=g,p=function(e,t,n){I.call(this,e,t,n),this.fields=[]},R.Message.OneOf=p,(v=function(e,t,n,r,i){a.call(this,e,t,n,r,i),this.className="Enum",this.object=null}).getName=function(e,t){var n,r,i=Object.keys(e);for(r=0;r<i.length;++r)if(e[n=i[r]]===t)return n;return null},(v.prototype=Object.create(a.prototype)).build=function(e){var n,r,i,s;if(this.object&&!e)return this.object;for(n=new t.Builder.Enum,i=0,s=(r=this.getChildren(v.Value)).length;s>i;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},R.Enum=v,(y=function(e,t,n,r){I.call(this,e,t,n),this.className="Enum.Value",this.id=r}).prototype=Object.create(I.prototype),R.Enum.Value=y,(m=function(e,t,n,r){I.call(this,e,t,n),this.field=r}).prototype=Object.create(I.prototype),R.Extension=m,((_=function(e,t,n,r){a.call(this,e,t,n,r),this.className="Service",this.clazz=null}).prototype=Object.create(a.prototype)).build=function(e){return this.clazz&&!e?this.clazz:this.clazz=function(e,t){var i,s=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},a=s.prototype=Object.create(e.Builder.Service.prototype),o=t.getChildren(e.Reflect.Service.RPCMethod);for(i=0;i<o.length;i++)!function(e){a[e.name]=function(i,s){try{try{i=e.resolvedRequestType.clazz.decode(n.wrap(i))}catch(e){if(!(e instanceof TypeError))throw e}if(null===i||"object"!==r(i))throw Error("Illegal arguments");i instanceof e.resolvedRequestType.clazz||(i=new e.resolvedRequestType.clazz(i)),this.rpcImpl(e.fqn(),i,(function(n,r){if(!n){try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void s(null,r):void s(Error("Illegal response type received in service method "+t.name+"#"+e.name))}s(n)}))}catch(e){setTimeout(s.bind(this,e),0)}},s[e.name]=function(t,n,r){new s(t)[e.name](n,r)},Object.defineProperty&&(Object.defineProperty(s[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(a[e.name],"$options",{value:s[e.name].$options}))}(o[i]);return Object.defineProperty&&(Object.defineProperty(s,"$options",{value:t.buildOpt()}),Object.defineProperty(a,"$options",{value:s.$options}),Object.defineProperty(s,"$type",{value:t}),Object.defineProperty(a,"$type",{value:t})),s}(t,this)},R.Service=_,((E=function(e,t,n,r){I.call(this,e,t,n),this.className="Service.Method",this.options=r||{}}).prototype=Object.create(I.prototype)).buildOpt=o.buildOpt,R.Service.Method=E,(T=function(e,t,n,r,i,s,a,o){E.call(this,e,t,n,o),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=s,this.responseStream=a,this.resolvedRequestType=null,this.resolvedResponseType=null}).prototype=Object.create(E.prototype),R.Service.RPCMethod=T,R}(s),s.Builder=function(e,t,n){function i(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,i(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var s=function(e){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},a=s.prototype;return s.isMessage=function(e){return"string"==typeof e.name&&void 0===e.values&&void 0===e.rpc},s.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},s.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},s.isService=function(e){return!("string"!=typeof e.name||"object"!==r(e.rpc)||!e.rpc)},s.isExtend=function(e){return"string"==typeof e.ref},a.reset=function(){return this.ptr=this.ns,this},a.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach((function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new n.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},a.create=function(t){var i,a,o,u,c;if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(i=[t];i.length>0;){if(t=i.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){if(a=t.shift(),s.isMessage(a)){if(o=new n.Message(this,this.ptr,a.name,a.options,a.isGroup,a.syntax),u={},a.oneofs&&Object.keys(a.oneofs).forEach((function(e){o.addChild(u[e]=new n.Message.OneOf(this,o,e))}),this),a.fields&&a.fields.forEach((function(e){if(null!==o.getChild(0|e.id))throw Error("duplicate or invalid field id in "+o.name+": "+e.id);if(e.options&&"object"!==r(e.options))throw Error("illegal field options in "+o.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=u[e.oneof]))throw Error("illegal oneof in "+o.name+"#"+e.name+": "+e.oneof);e=new n.Message.Field(this,o,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,a.syntax),t&&t.fields.push(e),o.addChild(e)}),this),c=[],a.enums&&a.enums.forEach((function(e){c.push(e)})),a.messages&&a.messages.forEach((function(e){c.push(e)})),a.services&&a.services.forEach((function(e){c.push(e)})),a.extensions&&(o.extensions="number"==typeof a.extensions[0]?[a.extensions]:a.extensions),this.ptr.addChild(o),c.length>0){i.push(t),t=c,c=null,this.ptr=o,o=null;continue}c=null}else if(s.isEnum(a))o=new n.Enum(this,this.ptr,a.name,a.options,a.syntax),a.values.forEach((function(e){o.addChild(new n.Enum.Value(this,o,e.name,e.id))}),this),this.ptr.addChild(o);else if(s.isService(a))o=new n.Service(this,this.ptr,a.name,a.options),Object.keys(a.rpc).forEach((function(e){var t=a.rpc[e];o.addChild(new n.Service.RPCMethod(this,o,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(o);else{if(!s.isExtend(a))throw Error("not a valid definition: "+JSON.stringify(a));if(o=this.ptr.resolve(a.ref,!0))a.fields.forEach((function(t){var r,i,s,a;if(null!==o.getChild(0|t.id))throw Error("duplicate extended field id in "+o.name+": "+t.id);if(o.extensions&&(r=!1,o.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r))throw Error("illegal extended field id in "+o.name+": "+t.id+" (not within valid ranges)");i=t.name,this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i)),s=new n.Message.ExtensionField(this,o,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new n.Extension(this,this.ptr,t.name,s),s.extension=a,this.ptr.addChild(a),o.addChild(s)}),this);else if(!/\.?google\.protobuf\./.test(a.ref))throw Error("extended message "+a.ref+" is not defined")}a=null,o=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},a.import=function(t,n){var s,a,o,u,c,l,h,f,d="/";if("string"==typeof n){if(e.Util.IS_NODE,!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"===r(n)){if(s=n.root,e.Util.IS_NODE,(s.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(d="\\"),a=s+d+n.file,!0===this.files[a])return this.reset();this.files[a]=!0}if(t.imports&&t.imports.length>0){for(u=!1,"object"===r(n)?(this.importRoot=n.root,u=!0,o=this.importRoot,n=n.file,(o.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(d="\\")):"string"==typeof n?this.importRoot?o=this.importRoot:n.indexOf("/")>=0?""===(o=n.replace(/\/[^\/]*$/,""))&&(o="/"):n.indexOf("\\")>=0?(o=n.replace(/\\[^\\]*$/,""),d="\\"):o=".":o=null,c=0;c<t.imports.length;c++)if("string"==typeof t.imports[c]){if(!o)throw Error("cannot determine import root");if("google/protobuf/descriptor.proto"===(l=t.imports[c]))continue;if(l=o+d+l,!0===this.files[l])continue;if(/\.proto$/i.test(l)&&!e.DotProto&&(l=l.replace(/\.proto$/,".json")),null===(h=e.Util.fetch(l)))throw Error("failed to import '"+l+"' in '"+n+"': file not found");/\.json$/i.test(l)?this.import(JSON.parse(h+""),l):this.import(e.DotProto.Parser.parse(h),l)}else n?/\.(\w+)$/.test(n)?this.import(t.imports[c],n.replace(/^(.+)\.(\w+)$/,(function(e,t,n){return t+"_import"+c+"."+n}))):this.import(t.imports[c],n+"_import"+c):this.import(t.imports[c]);u&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&i(t),f=this.ptr,t.options&&Object.keys(t.options).forEach((function(e){f.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=f),t.enums&&(this.create(t.enums),this.ptr=f),t.services&&(this.create(t.services),this.ptr=f),t.extends&&this.create(t.extends),this.reset()},a.resolveAll=function(){var i;if(null==this.ptr||"object"===r(this.ptr.type))return this;if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof n.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(i=(this.ptr instanceof n.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=i,i instanceof n.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==i.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(i instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=i.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((i=this.ptr.parent.resolve(this.ptr.requestName,!0))&&i instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=i,!((i=this.ptr.parent.resolve(this.ptr.responseName,!0))&&i instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=i}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+r(this.ptr)+": "+this.ptr);return this.reset()},a.build=function(e){var t,n,r;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},a.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},a.toString=function(){return"Builder"},s.Message=function(){},s.Enum=function(){},s.Service=function(){},s}(s,s.Lang,s.Reflect),s.Map=function(e,t){function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){var r,i,s,a;if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(r=Object.keys(n),i=0;i<r.length;i++)s=this.keyElem.valueFromString(r[i]),a=this.valueElem.verifyValue(n[r[i]]),this.map[this.keyElem.valueToString(s)]={key:s,value:a}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},i.entries=function(){var e,t,r=[],i=Object.keys(this.map);for(t=0;t<i.length;t++)r.push([(e=this.map[i[t]]).key,e.value]);return n(r)},i.keys=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].key);return n(t)},i.values=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].value);return n(t)},i.forEach=function(e,t){var n,r,i=Object.keys(this.map);for(r=0;r<i.length;r++)e.call(t,(n=this.map[i[r]]).value,n.key,this)},i.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map?this.map[t].value:void 0},i.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,s.Reflect),s.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),s.loadJson(s.DotProto.Parser.parse(e),t,n)},s.protoFromString=s.loadProto,s.loadProtoFile=function(e,t,n){if(t&&"object"===r(t)?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return s.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,s.loadProto(r,n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var i=s.Util.fetch("object"===r(e)?e.root+"/"+e.file:e);return null===i?null:s.loadProto(i,n,e)},s.protoFromFile=s.loadProtoFile,s.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=s.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=s.populateAccessors),new s.Builder(e)},s.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"===r(t)||(t=s.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},s.loadJsonFile=function(e,t,n){if(t&&"object"===r(t)?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return s.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,s.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var i=s.Util.fetch("object"===r(e)?e.root+"/"+e.file:e);return null===i?null:s.loadJson(JSON.parse(i),n,e)},i=Id,s.loadProto(i,void 0,"").build("Modules").probuf}(function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+u.apply(String,e):(e.length+arguments.length>1024&&(t.push(u.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function i(e,t,n,r,i){var s,a,o=8*i-r-1,u=(1<<o)-1,c=u>>1,l=-7,h=n?i-1:0,f=n?-1:1,d=e[t+h];for(h+=f,s=d&(1<<-l)-1,d>>=-l,l+=o;l>0;s=256*s+e[t+h],h+=f,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=r;l>0;a=256*a+e[t+h],h+=f,l-=8);if(0===s)s=1-c;else{if(s===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,r),s-=c}return(d?-1:1)*a*Math.pow(2,s-r)}function s(e,t,n,r,i,s){var a,o,u,c=8*s-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:s-1,g=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(o=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(o=0,a=l):a+h>=1?(o=(t*u-1)*Math.pow(2,i),a+=h):(o=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=255&o,d+=g,o/=256,i-=8);for(a=a<<i|o,c+=i;c>0;e[n+d]=255&a,d+=g,a/=256,c-=8);e[n+d-g]|=128*p}var a,o,u,c,l,h=function e(t,n,r){if(void 0===t&&(t=e.DEFAULT_CAPACITY),void 0===n&&(n=e.DEFAULT_ENDIAN),void 0===r&&(r=e.DEFAULT_NOASSERT),!r){if((t|=0)<0)throw RangeError("Illegal capacity");n=!!n,r=!!r}this.buffer=0===t?o:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=n,this.noAssert=r};return h.VERSION="5.0.1",h.LITTLE_ENDIAN=!0,h.BIG_ENDIAN=!1,h.DEFAULT_CAPACITY=16,h.DEFAULT_ENDIAN=h.BIG_ENDIAN,h.DEFAULT_NOASSERT=!1,h.Long=e||null,(a=h.prototype).__isByteBuffer__,Object.defineProperty(a,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1}),o=new ArrayBuffer(0),u=String.fromCharCode,h.accessor=function(){return Uint8Array},h.allocate=function(e,t,n){return new h(e,t,n)},h.concat=function(e,t,n,r){var i,s,a,o,u,c;for(("boolean"==typeof t||"string"!=typeof t)&&(r=n,n=t,t=void 0),i=0,a=0,o=e.length;o>a;++a)h.isByteBuffer(e[a])||(e[a]=h.wrap(e[a],t)),(s=e[a].limit-e[a].offset)>0&&(i+=s);if(0===i)return new h(0,n,r);for(c=new h(i,n,r),a=0;o>a;)(s=(u=e[a++]).limit-u.offset)<=0||(c.view.set(u.view.subarray(u.offset,u.limit),c.offset),c.offset+=s);return c.limit=c.offset,c.offset=0,c},h.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},h.type=function(){return ArrayBuffer},h.wrap=function(e,t,n,i){var s,o;if("string"!=typeof t&&(i=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return h.fromBase64(e,n);case"hex":return h.fromHex(e,n);case"binary":return h.fromBinary(e,n);case"utf8":return h.fromUTF8(e,n);case"debug":return h.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!==r(e))throw TypeError("Illegal buffer");if(h.isByteBuffer(e))return(s=a.clone.call(e)).markedOffset=-1,s;if(e instanceof Uint8Array)s=new h(0,n,i),e.length>0&&(s.buffer=e.buffer,s.offset=e.byteOffset,s.limit=e.byteOffset+e.byteLength,s.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)s=new h(0,n,i),e.byteLength>0&&(s.buffer=e,s.offset=0,s.limit=e.byteLength,s.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for((s=new h(e.length,n,i)).limit=e.length,o=0;o<e.length;++o)s.view[o]=e[o]}return s},a.writeBitSet=function(e,t){var n,r,i,s,a,o,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for(r=t,s=(i=e.length)>>3,a=0,t+=this.writeVarint32(i,t);s--;)n=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(n,t++);if(i>a){for(o=0,n=0;i>a;)n|=(1&!!e[a++])<<o++;this.writeByte(n,t++)}return u?(this.offset=t,this):t-r},a.readBitSet=function(e){var t,n,r,i,s,a,o,u=void 0===e;for(u&&(e=this.offset),i=(r=(n=this.readVarint32(e)).value)>>3,s=0,a=[],e+=n.length;i--;)t=this.readByte(e++),a[s++]=!!(1&t),a[s++]=!!(2&t),a[s++]=!!(4&t),a[s++]=!!(8&t),a[s++]=!!(16&t),a[s++]=!!(32&t),a[s++]=!!(64&t),a[s++]=!!(128&t);if(r>s)for(o=0,t=this.readByte(e++);r>s;)a[s++]=!!(1&t>>o++);return u&&(this.offset=e),a},a.readBytes=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return n=this.slice(t,t+e),r&&(this.offset+=e),n},a.writeBytes=a.append,a.writeInt8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},a.writeByte=a.writeInt8,a.readInt8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return 128==(128&(t=this.view[e]))&&(t=-(255-t+1)),n&&(this.offset+=1),t},a.readByte=a.readInt8,a.writeUint8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},a.writeUInt8=a.writeUint8,a.readUint8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],n&&(this.offset+=1),t},a.readUInt8=a.readUint8,a.writeInt16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},a.writeShort=a.writeInt16,a.readInt16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),32768==(32768&t)&&(t=-(65535-t+1)),n&&(this.offset+=2),t},a.readShort=a.readInt16,a.writeUint16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},a.writeUInt16=a.writeUint16,a.readUint16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),n&&(this.offset+=2),t},a.readUInt16=a.readUint16,a.writeInt32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},a.writeInt=a.writeInt32,a.readInt32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),t|=0,n&&(this.offset+=4),t},a.readInt=a.readInt32,a.writeUint32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},a.writeUInt32=a.writeUint32,a.readUint32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),n&&(this.offset+=4),t},a.readUInt32=a.readUint32,e&&(a.writeInt64=function(t,n){var r,i,s,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,s=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&s>>>24,this.view[n+2]=255&s>>>16,this.view[n+1]=255&s>>>8,this.view[n]=255&s):(this.view[n]=255&s>>>24,this.view[n+1]=255&s>>>16,this.view[n+2]=255&s>>>8,this.view[n+3]=255&s,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),a&&(this.offset+=8),this},a.writeLong=a.writeInt64,a.readInt64=function(t){var n,r,i,s=void 0===t;if(s&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!1),s&&(this.offset+=8),i},a.readLong=a.readInt64,a.writeUint64=function(t,n){var r,i,s,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,s=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&s>>>24,this.view[n+2]=255&s>>>16,this.view[n+1]=255&s>>>8,this.view[n]=255&s):(this.view[n]=255&s>>>24,this.view[n+1]=255&s>>>16,this.view[n+2]=255&s>>>8,this.view[n+3]=255&s,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),a&&(this.offset+=8),this},a.writeUInt64=a.writeUint64,a.readUint64=function(t){var n,r,i,s=void 0===t;if(s&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!0),s&&(this.offset+=8),i},a.readUInt64=a.readUint64),a.writeFloat32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,s(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},a.writeFloat=a.writeFloat32,a.readFloat32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=i(this.view,e,this.littleEndian,23,4),n&&(this.offset+=4),t},a.readFloat=a.readFloat32,a.writeFloat64=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=8,s(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},a.writeDouble=a.writeFloat64,a.readFloat64=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=i(this.view,e,this.littleEndian,52,8),n&&(this.offset+=8),t},a.readDouble=a.readFloat64,h.MAX_VARINT32_BYTES=5,h.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},h.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},h.zigZagDecode32=function(e){return 0|e>>>1^-(1&e)},a.writeVarint32=function(e,t){var n,r,i,s=void 0===t;if(s&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for((t+=r=h.calculateVarint32(e))>(i=this.buffer.byteLength)&&this.resize((i*=2)>t?i:t),t-=r,e>>>=0;e>=128;)n=128|127&e,this.view[t++]=n,e>>>=7;return this.view[t++]=e,s?(this.offset=t,this):r},a.writeVarint32ZigZag=function(e,t){return this.writeVarint32(h.zigZagEncode32(e),t)},a.readVarint32=function(e){var t,n,r,i,s=void 0===e;if(s&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}n=0,r=0;do{if(!this.noAssert&&e>this.limit)throw(i=Error("Truncated")).truncated=!0,i;t=this.view[e++],n<5&&(r|=(127&t)<<7*n),++n}while(0!=(128&t));return r|=0,s?(this.offset=e,r):{value:r,length:n}},a.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"===r(t)?t.value=h.zigZagDecode32(t.value):t=h.zigZagDecode32(t),t},e&&(h.MAX_VARINT64_BYTES=10,h.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:1<<21>n?3:4:r<16384?r<128?5:6:1<<21>r?7:8:i<128?9:10},h.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},h.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},a.writeVarint64=function(t,n){var r,i,s,a,o,u=void 0===n;if(u&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),r=h.calculateVarint64(t),i=t.toInt()>>>0,s=t.shiftRightUnsigned(28).toInt()>>>0,a=t.shiftRightUnsigned(56).toInt()>>>0,(n+=r)>(o=this.buffer.byteLength)&&this.resize((o*=2)>n?o:n),n-=r,r){case 10:this.view[n+9]=1&a>>>7;case 9:this.view[n+8]=9!==r?128|a:127&a;case 8:this.view[n+7]=8!==r?128|s>>>21:127&s>>>21;case 7:this.view[n+6]=7!==r?128|s>>>14:127&s>>>14;case 6:this.view[n+5]=6!==r?128|s>>>7:127&s>>>7;case 5:this.view[n+4]=5!==r?128|s:127&s;case 4:this.view[n+3]=4!==r?128|i>>>21:127&i>>>21;case 3:this.view[n+2]=3!==r?128|i>>>14:127&i>>>14;case 2:this.view[n+1]=2!==r?128|i>>>7:127&i>>>7;case 1:this.view[n]=1!==r?128|i:127&i}return u?(this.offset+=r,this):r},a.writeVarint64ZigZag=function(e,t){return this.writeVarint64(h.zigZagEncode64(e),t)},a.readVarint64=function(t){var n,r,i,s,a,o,u=void 0===t;if(u&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}if(n=t,r=0,i=0,s=0,a=0,r=127&(a=this.view[t++]),128&a&&(r|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(r|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(r|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(i=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(i|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(s=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<7,128&a||this.noAssert&&void 0===a))))))))))throw Error("Buffer overrun");return o=e.fromBits(r|i<<28,i>>>4|s<<24,!1),u?(this.offset=t,o):{value:o,length:t-n}},a.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=h.zigZagDecode64(n.value):n=h.zigZagDecode64(n),n}),a.writeCString=function(e,n){var r,i,s,a=void 0===n;if(a&&(n=this.offset),i=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;i>r;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=l.calculateUTF16asUTF8(t(e))[1],n+=i+1,s=this.buffer.byteLength,n>s&&this.resize((s*=2)>n?s:n),n-=i+1,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,a?(this.offset=n,this):i},a.readCString=function(e){var t,r,i,s=void 0===e;if(s&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,i=-1,l.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),r=n(),!0),s?(this.offset=e,r()):{string:r(),length:e-t}},a.writeIString=function(e,n){var r,i,s,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(i=n,r=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+r,s=this.buffer.byteLength,n>s&&this.resize((s*=2)>n?s:n),n-=4+r,this.littleEndian?(this.view[n+3]=255&r>>>24,this.view[n+2]=255&r>>>16,this.view[n+1]=255&r>>>8,this.view[n]=255&r):(this.view[n]=255&r>>>24,this.view[n+1]=255&r>>>16,this.view[n+2]=255&r>>>8,this.view[n+3]=255&r),n+=4,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==i+4+r)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+r));return a?(this.offset=n,this):n-i},a.readIString=function(e){var t,n,r,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=e,n=this.readUint32(e),r=this.readUTF8String(n,h.METRICS_BYTES,e+=4),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},h.METRICS_CHARS="c",h.METRICS_BYTES="b",a.writeUTF8String=function(e,n){var r,i,s,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=n,r=l.calculateUTF16asUTF8(t(e))[1],n+=r,s=this.buffer.byteLength,n>s&&this.resize((s*=2)>n?s:n),n-=r,l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),a?(this.offset=n,this):n-i},a.writeString=a.writeUTF8String,h.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(t(e))[0]},h.calculateString=h.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(t(e))[1]},a.readUTF8String=function(e,t,r){var i,s,a,o,u;if("number"==typeof t&&(r=t,t=void 0),(i=void 0===r)&&(r=this.offset),void 0===t&&(t=h.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}if(a=0,o=r,t===h.METRICS_CHARS){if(s=n(),l.decodeUTF8(function(){return e>a&&r<this.limit?this.view[r++]:null}.bind(this),(function(e){++a,l.UTF8toUTF16(e,s)})),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return i?(this.offset=r,s()):{string:s(),length:r-o}}if(t===h.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}if(u=r+e,l.decodeUTF8toUTF16(function(){return u>r?this.view[r++]:null}.bind(this),s=n(),this.noAssert),r!==u)throw RangeError("Illegal range: Truncated data, "+r+" == "+u);return i?(this.offset=r,s()):{string:s(),length:r-o}}throw TypeError("Unsupported metrics: "+t)},a.readString=a.readUTF8String,a.writeVString=function(e,n){var r,i,s,a,o=void 0===n;if(o&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(s=n,r=l.calculateUTF16asUTF8(t(e),this.noAssert)[1],i=h.calculateVarint32(r),n+=i+r,a=this.buffer.byteLength,n>a&&this.resize((a*=2)>n?a:n),n-=i+r,n+=this.writeVarint32(r,n),l.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==s+r+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+r+i));return o?(this.offset=n,this):n-s},a.readVString=function(e){var t,n,r,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,n=this.readVarint32(e),r=this.readUTF8String(n.value,h.METRICS_BYTES,e+=n.length),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},a.append=function(e,t,n){var r,i,s;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof h||(e=h.wrap(e,t)),(i=e.limit-e.offset)<=0||((n+=i)>(s=this.buffer.byteLength)&&this.resize((s*=2)>n?s:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i)),this},a.appendTo=function(e,t){return e.append(this,t),this},a.assert=function(e){return this.noAssert=!e,this},a.capacity=function(){return this.buffer.byteLength},a.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},a.clone=function(e){var t=new h(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},a.compact=function(e,t){var n,r,i;if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return 0===e&&t===this.buffer.byteLength?this:0==(n=t-e)?(this.buffer=o,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(r=new ArrayBuffer(n),(i=new Uint8Array(r)).set(this.view.subarray(e,t)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this)},a.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new h(0,this.littleEndian,this.noAssert);var n=t-e,r=new h(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},a.copyTo=function(e,t,n,r){var i,s,a;if(!this.noAssert&&!h.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(t=(s=void 0===t)?e.offset:0|t,n=(i=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);return 0==(a=r-n)?e:(e.ensureCapacity(t+a),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=a),s&&(e.offset+=a),this)},a.ensureCapacity=function(e){var t=this.buffer.byteLength;return e>t?this.resize((t*=2)>e?t:e):this},a.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;n>t;)this.view[t++]=e;return r&&(this.offset=t),this},a.flip=function(){return this.limit=this.offset,this.offset=0,this},a.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},a.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},a.LE=function(e){return this.littleEndian=void 0===e||!!e,this},a.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},a.prepend=function(e,t,n){var r,i,s,a,o;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof h||(e=h.wrap(e,t)),(i=e.limit-e.offset)<=0||((s=i-n)>0?(a=new ArrayBuffer(this.buffer.byteLength+s),(o=new Uint8Array(a)).set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=a,this.view=o,this.offset+=s,this.markedOffset>=0&&(this.markedOffset+=s),this.limit+=s,n+=s):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(this.offset-=i)),this},a.prependTo=function(e,t){return e.prepend(this,t),this},a.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},a.remaining=function(){return this.limit-this.offset},a.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},a.resize=function(e){var t,n;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}return this.buffer.byteLength<e&&(t=new ArrayBuffer(e),(n=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=n),this},a.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},a.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},a.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},a.toBuffer=function(e){var t,n=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: Not an integer");if(n>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,n<0||n>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+r+" <= "+this.buffer.byteLength)}return e||0!==n||r!==this.buffer.byteLength?n===r?o:(t=new ArrayBuffer(r-n),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(n,r),0),t):this.buffer},a.toArrayBuffer=a.toBuffer,a.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(n=t=e="utf8"),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},c=function(){var e,t,n={},r=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],i=[];for(e=0,t=r.length;t>e;++e)i[r[e]]=e;return n.encode=function(e,t){for(var n,i;null!==(n=e());)t(r[63&n>>2]),i=(3&n)<<4,null!==(n=e())?(t(r[63&((i|=15&n>>4)|15&n>>4)]),i=(15&n)<<2,null!==(n=e())?(t(r[63&(i|3&n>>6)]),t(r[63&n])):(t(r[63&i]),t(61))):(t(r[63&i]),t(61),t(61))},n.decode=function(e,t){function n(e){throw Error("Illegal character code: "+e)}for(var r,s,a;null!==(r=e());)if(void 0===(s=i[r])&&n(r),null!==(r=e())&&(void 0===(a=i[r])&&n(r),t(s<<2>>>0|(48&a)>>4),null!==(r=e()))){if(void 0===(s=i[r])){if(61===r)break;n(r)}if(t((15&a)<<4>>>0|(60&s)>>2),null!==(r=e())){if(void 0===(a=i[r])){if(61===r)break;n(r)}t((3&s)<<6>>>0|a)}}},n.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},n}(),a.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return c.encode(function(){return t>e?this.view[e++]:null}.bind(this),r=n()),r()},h.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new h(e.length/4*3,n),i=0;return c.decode(t(e),(function(e){r.view[i++]=e})),r.limit=i,r},h.btoa=function(e){return h.fromBinary(e).toBase64()},h.atob=function(e){return h.fromBase64(e).toBinary()},a.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];t>e;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},h.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,s=new h(i,t);i>r;){if((n=e.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);s.view[r++]=n}return s.limit=i,s},a.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",s="",a="";r>n;){if(-1!==n&&(i+=(t=this.view[n])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(s+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";a+=i+s+"\n",i=s=""}i+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";a+=i+s+"\n"}return e?a:i},h.fromDebug=function(e,t,n){for(var r,i,s=e.length,a=new h(0|(s+1)/3,t,n),o=0,u=0,c=!1,l=!1,f=!1,d=!1,g=!1;s>o;){switch(r=e.charAt(o++)){case"!":if(!n){if(l||f||d){g=!0;break}l=f=d=!0}a.offset=a.markedOffset=a.limit=u,c=!1;break;case"|":if(!n){if(l||d){g=!0;break}l=d=!0}a.offset=a.limit=u,c=!1;break;case"[":if(!n){if(l||f){g=!0;break}l=f=!0}a.offset=a.markedOffset=u,c=!1;break;case"<":if(!n){if(l){g=!0;break}l=!0}a.offset=u,c=!1;break;case"]":if(!n){if(d||f){g=!0;break}d=f=!0}a.limit=a.markedOffset=u,c=!1;break;case">":if(!n){if(d){g=!0;break}d=!0}a.limit=u,c=!1;break;case"'":if(!n){if(f){g=!0;break}f=!0}a.markedOffset=u,c=!1;break;case" ":c=!1;break;default:if(!n&&c){g=!0;break}if(i=parseInt(r+e.charAt(o++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[u++]=i,c=!0}if(g)throw TypeError("Illegal str: Invalid symbol at "+o)}if(!n){if(!l||!d)throw TypeError("Illegal str: Missing offset or limit");if(u<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+u+" < "+s)}return a},a.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);t>e;)(n=this.view[e++])<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},h.fromHex=function(e,t,n){var r,i,s,a,o;if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(i=e.length,s=new h(0|i/2,t),a=0,o=0;i>a;a+=2){if(r=parseInt(e.substring(a,a+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");s.view[o++]=r}return s.limit=o,s},l=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(192|31&n>>6),t(128|63&n)):n<65536?(t(224|15&n>>12),t(128|63&n>>6),t(128|63&n)):(t(240|7&n>>18),t(128|63&n>>12),t(128|63&n>>6),t(128|63&n)),n=null},decodeUTF8:function(e,t){for(var n,r,i,s,a=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(0==(128&n))t(n);else if(192==(224&n))null===(r=e())&&a([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(i=e()))&&a([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(s=e()))&&a([n,r,i,s]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&s)}},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(t(55296+((n-=65536)>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,n)}))},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,n)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,(function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4})),[n,r]}};return e}(),a.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{l.decodeUTF8toUTF16(function(){return t>e?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},h.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new h(l.calculateUTF16asUTF8(t(e),!0)[1],n,r),s=0;return l.encodeUTF16toUTF8(t(e),(function(e){i.view[s++]=e})),i.limit=s,i},h}(Cd=function(){function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,r,s;return t?(s=(e>>>=0)>=0&&e<256)&&(r=u[e])?r:(n=i(e,(0|e)<0?-1:0,!0),s&&(u[e]=n),n):(s=(e|=0)>=-128&&e<128)&&(r=o[e])?r:(n=i(e,e<0?-1:0,!1),s&&(o[e]=n),n)}function r(e,t){if(isNaN(e)||!isFinite(e))return t?p:g;if(t){if(e<0)return p;if(e>=h)return E}else{if(-f>=e)return T;if(e+1>=f)return _}return e<0?r(-e,t).neg():i(0|e%l,0|e/l,t)}function i(t,n,r){return new e(t,n,r)}function s(e,t,n){var i,a,o,u,l,h,f;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||n>36)throw RangeError("radix");if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return s(e.substring(1),t,n).neg();for(a=r(c(n,8)),o=g,u=0;u<e.length;u+=8)l=Math.min(8,e.length-u),h=parseInt(e.substring(u,u+l),n),l<8?(f=r(c(n,l)),o=o.mul(f).add(r(h))):o=(o=o.mul(a)).add(r(h));return o.unsigned=t,o}function a(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?s(t):i(t.low,t.high,t.unsigned)}var o,u,c,l,h,f,d,g,p,v,y,m,_,E,T,R;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,o={},u={},e.fromInt=n,e.fromNumber=r,e.fromBits=i,c=Math.pow,e.fromString=s,e.fromValue=a,f=(h=(l=4294967296)*l)/2,d=n(16777216),g=n(0),e.ZERO=g,p=n(0,!0),e.UZERO=p,v=n(1),e.ONE=v,y=n(1,!0),e.UONE=y,m=n(-1),e.NEG_ONE=m,_=i(-1,2147483647,!1),e.MAX_VALUE=_,E=i(-1,-1,!0),e.MAX_UNSIGNED_VALUE=E,T=i(0,-2147483648,!1),e.MIN_VALUE=T,(R=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},R.toString=function(e){var t,n,i,s,a,o,u,l;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(T)?(t=r(e),i=(n=this.div(t)).mul(t).sub(this),n.toString(e)+i.toInt().toString(e)):"-"+this.neg().toString(e);for(s=r(c(e,6),this.unsigned),a=this,o="";;){if(u=a.div(s),l=(a.sub(u.mul(s)).toInt()>>>0).toString(e),(a=u).isZero())return l+o;for(;l.length<6;)l="0"+l;o=""+l+o}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){var e,t;if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},R.isZero=function(){return 0===this.high&&0===this.low},R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return 1==(1&this.low)},R.isEven=function(){return 0==(1&this.low)},R.equals=function(e){return t(e)||(e=a(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.compare=function(e){if(t(e)||(e=a(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?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},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(v)},R.neg=R.negate,R.add=function(e){var n,r,s,o,u,c,l,h,f,d,g;return t(e)||(e=a(e)),n=this.high>>>16,r=65535&this.high,s=this.low>>>16,o=65535&this.low,u=e.high>>>16,c=65535&e.high,l=e.low>>>16,h=0,f=0,d=0,g=0,d+=(g+=o+(65535&e.low))>>>16,f+=(d+=s+l)>>>16,h+=(f+=r+c)>>>16,h+=n+u,i((d&=65535)<<16|(g&=65535),(h&=65535)<<16|(f&=65535),this.unsigned)},R.subtract=function(e){return t(e)||(e=a(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){var n,s,o,u,c,l,h,f,p,v,y,m;return this.isZero()?g:(t(e)||(e=a(e)),e.isZero()?g:this.eq(T)?e.isOdd()?T:g:e.eq(T)?this.isOdd()?T:g:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(d)&&e.lt(d)?r(this.toNumber()*e.toNumber(),this.unsigned):(n=this.high>>>16,s=65535&this.high,o=this.low>>>16,u=65535&this.low,c=e.high>>>16,l=65535&e.high,h=e.low>>>16,p=0,v=0,y=0,m=0,y+=(m+=u*(f=65535&e.low))>>>16,v+=(y+=o*f)>>>16,y&=65535,v+=(y+=u*h)>>>16,p+=(v+=s*f)>>>16,v&=65535,p+=(v+=o*h)>>>16,v&=65535,p+=(v+=u*l)>>>16,p+=n*f+s*h+o*l+u*c,i((y&=65535)<<16|(m&=65535),(p&=65535)<<16|(v&=65535),this.unsigned)))},R.mul=R.multiply,R.divide=function(e){var n,i,s,o,u,l,h;if(t(e)||(e=a(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?p:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return p;if(e.gt(this.shru(1)))return y;s=p}else{if(this.eq(T))return e.eq(v)||e.eq(m)?T:e.eq(T)?v:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?v:m:(i=this.sub(e.mul(n)),s=n.add(i.div(e)));if(e.eq(T))return this.unsigned?p:g;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();s=g}for(i=this;i.gte(e);){for(n=Math.max(1,Math.floor(i.toNumber()/e.toNumber())),u=(o=Math.ceil(Math.log(n)/Math.LN2))<=48?1:c(2,o-48),h=(l=r(n)).mul(e);h.isNegative()||h.gt(i);)h=(l=r(n-=u,this.unsigned)).mul(e);l.isZero()&&(l=v),s=s.add(l),i=i.sub(h)}return s},R.div=R.divide,R.modulo=function(e){return t(e)||(e=a(e)),this.sub(this.div(e).mul(e))},R.mod=R.modulo,R.not=function(){return i(~this.low,~this.high,this.unsigned)},R.and=function(e){return t(e)||(e=a(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return t(e)||(e=a(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return t(e)||(e=a(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){var n;return t(e)&&(e=e.toInt()),0==(e&=63)?this:(n=this.high,e<32?i(this.low>>>e|n<<32-e,n>>>e,this.unsigned):i(32===e?n:n>>>e-32,0,this.unsigned))},R.shru=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,255&t>>>8,255&t>>>16,255&t>>>24,255&e,255&e>>>8,255&e>>>16,255&e>>>24]},R.toBytesBE=function(){var e=this.high,t=this.low;return[255&e>>>24,255&e>>>16,255&e>>>8,255&e,255&t>>>24,255&t>>>16,255&t>>>8,255&t]},e}()),Cd));Od.getModule=function(e){var t=new Od[e];return t.getArrayData=function(){var e=t.toArrayBuffer();return e=Vs(e)?[].slice.call(new Int8Array(e)):e},t};var Nd="pgMsgP",kd="chatMsg",Md="pcMsgP",Ad={PRIVATE:"ppMsgS",GROUP:"pgMsgS",CHATROOM:"chatMsgS"},Ud="delMsg",Ld="joinChrm",xd="joinChrmR",Pd="exitChrm",Dd="setKV",Vd="delKV",Bd="setKVS",Gd="delKVS",Fd="qryRelationR",qd="delRelation",Kd="setSeAtt",jd={PRIVATE:"cleanPMsg",GROUP:"cleanGMsg",ULTRA_GROUP:"cleanGMsg",CUSTOMER_SERVICE:"cleanCMsg",SYSTEM:"cleanSMsg"},Hd="qryPMsg",Yd="qryGMsg",Qd="qryCHMsg",Wd="qryCMsg",Jd="qrySMsg",zd=(c(Sd={},"ppMsgP",Ms.PRIVATE),c(Sd,Nd,Ms.GROUP),c(Sd,kd,Ms.CHATROOM),c(Sd,Md,Ms.CUSTOMER_SERVICE),Sd),Zd=(c(bd={},Ms.PRIVATE,Hd),c(bd,Ms.GROUP,Yd),c(bd,Ms.CHATROOM,Qd),c(bd,Ms.CUSTOMER_SERVICE,Wd),c(bd,Ms.SYSTEM,Jd),bd),Xd=(c(wd={},Ms.PRIVATE,jd.PRIVATE),c(wd,Ms.GROUP,jd.GROUP),c(wd,Ms.ULTRA_GROUP,jd.ULTRA_GROUP),c(wd,Ms.CUSTOMER_SERVICE,jd.CUSTOMER_SERVICE),c(wd,Ms.SYSTEM,jd.SYSTEM),wd),$d="1",eg="0",tg=1,ng=2,rg=3,ig=function(){function t(e){a(this,t),this._codec="websocket"===e?Od:pd,this._connectType=e}return u(t,[{key:"decodeByPBName",value:function(e,t,n){var r,i=this,s=e,a=(c(r={},Ih,i._formatSyncMessages),c(r,Rh,i._formatReceivedMessage),c(r,Eh,i._formatSentMessage),c(r,kh,i._formatHistoryMessages),c(r,Ah,i._formatConversationList),c(r,Kh,i._formatChatRoomInfos),c(r,Hh,i._formatRTCUserList),c(r,$h,i._formatRTCData),c(r,yf,i._formatChatRoomKVList),c(r,Sf,i._formatUserSetting),c(r,Of,i._formatConversationStatus),c(r,xf,i._formatGrpReadReceiptQryResp),c(r,If,i._formatSetUserSettingOutput),c(r,bf,i._formatUserSettingNotification),c(r,Wf,i._formatUltraMsgChangeList),c(r,$f,i._formatUltraOperateStatusNotifyList),c(r,Zf,i._formatUltraMsgList),c(r,Fh,i._formatChrmKVVersion),c(r,id,i._formatRTCRoomKVList),c(r,Xh,i._formatRTCAuidenceJoinRoomData),c(r,ad,i._formatRTCJoinedUserInfo),r)[t];try{s=e.length>0&&i._codec[t].decode(e),Gs(s)&&(s=function(e){for(var t in e)Gs(e[t])&&(e[t]=go(e[t]));return e}(s)),Fs(a)&&(s=a.call(this,s,n))}catch(n){Js.error("PB parse error\n",n,e,t)}return s}},{key:"_readBytes",value:function(e){var t=e.offset,n=e.buffer,r=e.limit;if(t)try{var i=Vs(n)?new Uint8Array(n):n;return yh.readUTF(i.subarray(t,r))}catch(e){Js.info("readBytes error\n",e)}return e}},{key:"_formatBytes",value:function(e){if(!e)return e;var t=this._readBytes(e);try{t=JSON.parse(t)}catch(e){Js.info("formatBytes error\n",e)}return t||e}},{key:"_formatSyncMessages",value:function(e,t){t=t||{};var n=this,r=e.list,i=e.syncTime,s=e.finished;return(qs(s)||null===s)&&(e.finished=!0),e.syncTime=go(i),e.list=To(r,(function(e){return n._formatReceivedMessage(e,t)})),e}},{key:"_formatReceivedMessage",value:function(e,t){if(!e)return e;var r=t=t||{},i=r.currentUserId,s=r.connectedTime,a=e.content,o=e.fromUserId,u=e.type,c=e.groupId,l=e.status,f=e.dataTime,d=e.classname,g=e.msgId,p=e.extraContent,v=e.pushContent,y=e.pushExt,m=e.configFlag,_=e.extStatus,E=(e.direction||ia.RECEIVE)===ia.SEND,T=function(e){var t=n.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:t=2&e?n.RETRIEVED:t,canIncludeExpansion:!!(1024&e)}}(l),R=T.isPersited,I=T.isCounted,C=T.isMentioned,S=T.disableNotification,b=T.receivedStatus,w=T.canIncludeExpansion,O=!!(2&(_||0)),N=!!(4&(_||0)),k=[Ms.GROUP,Ms.CHATROOM,Ms.RTC_ROOM,Ms.ULTRA_GROUP].indexOf(u)>-1?c:o,M=E?i:o,A=go(f),U=A<s,L=u===Ms.CHATROOM,x=this._formatBytes(a),P={};if(y&&(P=yo(y.pushConfigs,y.pushId)),x.user){var D=x.user,V=D.portrait,B=D.portraitUri,G=V||B;G&&(x.user.portrait=x.user.portraitUri=G)}var F,q=h(h({},P),{},{pushTitle:null==y?void 0:y.title,pushContent:v,pushData:v,disablePushTitle:!!m&&Boolean(4&m),forceShowDetailContent:!!m&&Boolean(8&m),templateId:null==y?void 0:y.templateId}),K=E?ia.SEND:ia.RECEIVE;L&&o===i&&(K=ia.SEND),p&&(F={},F=ko(p));var j={conversationType:u,targetId:k,senderUserId:M,messageType:d,messageUId:g,isPersited:R,isCounted:I,isMentioned:C,sentTime:A,messageDirection:K,receivedTime:Mo.getTime(),disableNotification:S,receivedStatus:b,canIncludeExpansion:w,content:x,expansion:F,configFlag:m,pushConfig:q,channelId:e.busChannel||"",isInterrupt:O,isModifyMessage:N};return u!==Ms.ULTRA_GROUP&&(j.isOffLineMessage=U),j}},{key:"_formatSentMessage",value:function(e,t){var n,r=e.content,i=e.classname,s=e.sessionId,a=e.msgId,o=e.extraContent,u=e.pushExt,c=e.pushContent,l=e.configFlag,f=e.extStatus,d=t.signal,g=t.currentUserId,p=d.date,v=d.topic,y=d.targetId,m=!!(2&(f||0)),_=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e)}}(s),E=_.isPersited,T=_.isCounted,R=_.disableNotification,I=_.canIncludeExpansion,C=zd[v]||Ms.PRIVATE,S=Io(Ad,v),b=this._formatBytes(r),w=y;i===ha.RECALL&&(C=b.conversationType||C,w=b.targetId||y),o&&(n={},n=ko(o));var O={};u&&(O=yo(u.pushConfigs,u.pushId));var N=h(h({},O),{},{pushTitle:null==u?void 0:u.title,pushContent:c,pushData:c,disablePushTitle:!!l&&Boolean(4&l),forceShowDetailContent:!!l&&Boolean(8&l),templateId:null==u?void 0:u.templateId});return{conversationType:C,targetId:w,messageType:i,messageUId:a,isPersited:E,isCounted:T,isStatusMessage:S,senderUserId:g,content:this._formatBytes(r),sentTime:1e3*p,receivedTime:Mo.getTime(),messageDirection:ia.SEND,isOffLineMessage:!1,disableNotification:R,canIncludeExpansion:I,expansion:n,pushConfig:N,channelId:e.busChannel||"",isInterrupt:m}}},{key:"_formatHistoryMessages",value:function(e,t){var n=this,r=t.conversation||{},i=e.list,s=e.hasMsg,a=r.targetId,o=go(e.syncTime),u=[];return Eo(i,(function(e){var i=n._formatReceivedMessage(e,t);r.conversationType===Ms.ULTRA_GROUP?i.targetId=e.groupId||r.targetId:i.targetId=a,u.push(i)}),{isReverse:!0}),{syncTime:o,list:u,hasMore:!!s}}},{key:"_formatUltraMsgChangeList",value:function(e){var t=e.list,n=e.syncTime,r=e.hasNext;return{syncTime:n,list:t&&t.map((function(e){var t=e.targetId,n=e.type,r=e.time,i=e.changeType,s=e.msgUID,a=e.msgTime,o=e.busChannel,u=e.isAdmin,c=e.isDel,l=e.operatorId;return{targetId:t,conversationType:n,changeType:i,messageUId:s,changeTime:go(r),sendTime:go(a),channelId:o,isAdmin:u,isDel:c,operatorId:l}})),hasNext:r}}},{key:"_formatUltraOperateStatusNotifyList",value:function(e){var t=e.type,n=e.notifyType,r=e.info,i=e.summary,s=[],a=[],o=2==(2&n),u=1==(1&n);return u&&Array.isArray(r)&&r.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.userId,i=e.opType,a=e.optime,o=go(a);s.push({targetId:t,channelId:n,userId:r,operationType:i,operationTime:o})})),o&&Array.isArray(i)&&i.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.count,i=e.opType;a.push({targetId:t,channelId:n,count:r,operationType:i})})),{conversationType:t,info:s,summary:a,hasInfo:u,hasSummary:o}}},{key:"_formatUltraMsgList",value:function(e,t){var n=this,r=e.list;return{list:r&&r.map((function(e){return n._formatReceivedMessage(e,t)}))}}},{key:"_formatConversationList",value:function(e,t){var n=this,r=e.info,i=t.afterDecode||function(){},s={list:(r=To(r,(function(e){var r=e.msg,s=e.userId,a=e.type,o=e.unreadCount,u=e.busChannel,c=e.versionTime,l=e.remindCount,h=null;r&&((h=n._formatReceivedMessage(r,t)).targetId=s);var f={targetId:s,conversationType:a,unreadMessageCount:go(o)||0,latestMessage:h||{},channelId:u||""};return a===Ms.ULTRA_GROUP&&(f.versionTime=go(c)||0,f.unreadMentionedCount=go(l)||0),i(f)||f})))||[]};return((null==t?void 0:t.conversationType)||Ms.NONE)===Ms.ULTRA_GROUP&&(s.isFinished=e.isFinished),s}},{key:"_formatSetUserSettingOutput",value:function(e){return e}},{key:"_formatChatRoomInfos",value:function(e){var t=e.userTotalNums,n=e.userInfos;return{userCount:t,userInfos:To(n,(function(e){var t=e.id,n=e.time;return{id:t,time:go(n)}}))}}},{key:"_formatChatRoomKVList",value:function(e){var t=e.entries,n=e.bFullUpdate,r=e.syncTime;return{kvEntries:t=To(t=t||[],(function(e){var t=e.key,n=e.value,r=e.status,i=e.timestamp,s=e.uid,a=e.version,o=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),type:4&e?_a.DELETE:_a.UPDATE}}(r);return{key:t,value:n,isAutoDelete:o.isAutoDelete,isOverwrite:o.isOverwrite,type:o.type,userId:s,timestamp:go(i),version:go(a)}})),isFullUpdate:n,syncTime:r}}},{key:"_formatUserSetting",value:function(e){var t=this,n=e.items,r=e.version,i={};return Eo(n||[],(function(e){var n=e.key,r=e.version,s=e.value;e.version=go(r),e.value=t._readBytes(s),"Tag"===n&&e.tags.forEach((function(e){e.createdTime=go(e.createdTime),e.tagName=e.name})),i[n]=e})),{settings:i,version:r}}},{key:"_formatConversationStatus",value:function(e){var t=e.state,n=[];return Eo(t,(function(e){var t=e.type,r=e.channelId,i=e.time,s=e.stateItem,a=e.busChannel,o=da.CLOSE,u=!1,c=[];Eo(s,(function(e){var t=e.sessionStateType,n=e.value,r=e.tags;switch(t){case tg:o=n===$d?da.OPEN:da.CLOSE;break;case ng:u=n===$d;break;case rg:c=r}})),n.push({conversationType:t,type:t,targetId:r,notificationStatus:o,isTop:u,updatedTime:go(i),tags:c,channelId:a||""})})),n}},{key:"_formatRTCUserList",value:function(e){var t=e.users,n=e.token,r=e.sessionId,i=e.roomInfo,s=e.entries,a={};return Eo(t,(function(e){var t=e.userId,n=e.userData,r={};Eo(n,(function(e){var t=e.key,n=e.value;r[t]=n})),a[t]=r})),{users:a,token:n,sessionId:r,roomInfo:i,kvEntries:s}}},{key:"_formatRTCData",value:function(e){var t=e.outInfo,n={};return Eo(t,(function(e){n[e.key]=e.value})),n}},{key:"_formatRTCRoomInfo",value:function(e){var t=e.roomId,n=e.userCount,r=e.roomData,i={id:t,total:n};return Eo(r,(function(e){i[e.key]=e.value})),i}},{key:"_formatGrpReadReceiptQryResp",value:function(e){var t=e.totalMemberNum,n=e.list;return n.forEach((function(e){e.readTime=go(e.readTime)})),{totalMemberCount:t,list:n}}},{key:"_formatUserSettingNotification",value:function(e){return e}},{key:"_formatRTCRoomKVList",value:function(e){var t=e.entries,n=e.bFullUpdate,r=e.syncTime;return{kvEntries:t=(t=t||[]).map((function(e){var t=e.timestamp;return Object.assign(e,{timestamp:go(t)})})),isFullUpdate:n,syncTime:r}}},{key:"_formatChrmKVVersion",value:function(e){return e}},{key:"_formatRTCAuidenceJoinRoomData",value:function(e){return e}},{key:"_formatRTCJoinedUserInfo",value:function(e){return(e.info||[]).map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:go(e.joinTime)}}))}},{key:"encodeServerConfParams",value:function(){var e=this._codec.getModule(Ch);return e.setNothing(1),e.getArrayData()}},{key:"_getUpMsgModule",value:function(e,t){var n="comet"===this._connectType,r=e.conversationType,i=t.messageType,s=t.isMentioned,a=t.mentionedType,o=t.mentionedUserIdList,u=t.content,c=t.pushContent,l=t.pushData,h=t.directionalUserIdList,f=t.isFilerWhiteBlacklist,d=t.isVoipPush,g=t.canIncludeExpansion,p=t.expansion,v=t.pushConfig,y=t.channelId;[Ms.GROUP,Ms.ULTRA_GROUP].includes(r);var m,_,E,T=this._codec.getModule(Eh),R=function(e){var t=e.isStatusMessage,n=e.isPersited,r=e.isCounted;t&&(n=r=!1);var i=0;return n&&(i|=1),r&&(i|=2),e.isMentioned&&(i|=4),e.disableNotification&&(i|=32),e.canIncludeExpansion&&(i|=64),i}(t),I=v||{},C=I.pushTitle,S=I.pushContent,b=I.pushData,w=I.iOSConfig,O=I.androidConfig,N=I.templateId,k=I.disablePushTitle,M=I.forceShowDetailContent,A=0;(T.setSessionId(R),s&&u)&&(u.mentionedInfo={userIdList:(null===(m=u.mentionedInfo)||void 0===m?void 0:m.userIdList)||o||[],type:(null===(_=u.mentionedInfo)||void 0===_?void 0:_.type)||a||pa.ALL,mentionedContent:(null===(E=u.mentionedInfo)||void 0===E?void 0:E.mentionedContent)||""});var U=S||c||"",L=b||l||"";if(U&&T.setPushText(U),L&&T.setAppData(L),h&&T.setUserId(h),A|=d?1:0,A|=f?2:0,A|=k?4:0,A|=M?8:0,T.setConfigFlag(A),T.setClassname(i),u.user&&u.user.portraitUri&&(u.user.portrait=u.user.portraitUri),T.setContent(JSON.stringify(u)),g&&p){var x={};Eo(p,(function(e,t){x[t]={v:e}})),T.setExtraContent(JSON.stringify(x))}if(v){var P=this._codec.getModule(Th);if(C&&P.setTitle(C),w&&O){var D=vo(w,O);P.setPushConfigs(D)}(null==O?void 0:O.notificationId)&&P.setPushId(null==O?void 0:O.notificationId),P.setTemplateId(N||""),T.setPushExt(n?P.getArrayData():P)}return qs(y)||T.setBusChannel(y),T}},{key:"encodeUpMsg",value:function(e,t){return this._getUpMsgModule(e,t).getArrayData()}},{key:"encodeSyncMsg",value:function(e){var t=e.sendboxTime,n=e.inboxTime,r=e.broadcastSyncTime,i=this._codec.getModule(bh);return i.setIspolling(!1),i.setIsPullSend(!0),i.setSendBoxSyncTime(t),i.setSyncTime(n),i.setBroadcastSyncTime(r),i.getArrayData()}},{key:"encodeChrmSyncMsg",value:function(e,t){e=e||0,t=t||0;var n=this._codec.getModule(wh);return n.setCount(t),n.setSyncTime(e),n.getArrayData()}},{key:"encodeGetHistoryMsg",value:function(e,t){var n=t.count,r=t.order,i=t.timestamp,s=t.channelId,a=this._codec.getModule(Nh);return a.setTargetId(e),a.setTime(i),a.setCount(n),a.setOrder(r),a.setBusChannel(s||""),a.getArrayData()}},{key:"encodeSuperSyncMsg",value:function(e){var t=this._codec.getModule(jf);return t.setSyncTime(e),t.getArrayData()}},{key:"encodeGetConversationList",value:function(e){var t=e=e||{},n=t.count,r=t.startTime,i=this._codec.getModule(Mh);return i.setType(1),i.setCount(n),i.setStartTime(r),i.getArrayData()}},{key:"encodeOldConversationList",value:function(e){var t=e=e||{},n=t.count,r=t.type,i=t.startTime,s=t.order;n=n||0,i=i||0,s=s||0;var a=this._codec.getModule(Mh);return a.setType(r),a.setCount(n),a.setStartTime(i),a.setOrder(s),a.getArrayData()}},{key:"encodeRemoveOldConversationList",value:function(e){var t=e=e||{},n=t.conversationType,r=t.channelId,i=this._codec.getModule(Ph);return i.setType(n),r&&i.setBusChannel([r]),i.getArrayData()}},{key:"encodeRemoveConversationList",value:function(e){var t=this,n=this._codec.getModule(Uh),r=[];return Eo(e,(function(e){var n=e.conversationType,i=e.targetId,s=t._codec.getModule(Lh);s.setType(n),s.setChannelId(i),r.push(s)})),n.setSessions(r),n.getArrayData()}},{key:"encodeDeleteMessages",value:function(e,t,n,r){var i=this._codec.getModule(Dh),s=[];return Eo(n,(function(e){s.push({msgId:e.messageUId,msgDataTime:e.sentTime,direct:e.messageDirection})})),i.setType(e),i.setConversationId(t),i.setMsgs(s),i.setBusChannel(r),i.getArrayData()}},{key:"encodeClearMessages",value:function(e,t,n,r){var i=this._codec.getModule(Vh);return t=t||(new Date).getTime(),i.setDataTime(t),i.setTargetId(e),i.setBusChannel(n),i.setConversationType(r),i.getArrayData()}},{key:"encodeClearUnreadCount",value:function(e,t){var n=e.conversationType,r=e.targetId,i=e.channelId,s=t.timestamp,a=this._codec.getModule(Bh);return s=s||+new Date,a.setType(n),a.setChannelId(r),a.setMsgTime(s),a.setBusChannel(i),a.getArrayData()}},{key:"encodeExpandUltraMessage",value:function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,s=e.messageUId,a=e.sendTime,o=e.keys,u={mid:s,put:e.expansion,del:o,clear:e.removeAll?1:0},c=this._codec.getModule(Hf);return c.setFromUserId(t),c.setTargetId(n),c.setType(r),c.setBusChannel(i||""),c.setMsgUID(s),c.setMsgTime(a),c.setContent(JSON.stringify(u)),c.getArrayData()}},{key:"encodemodifyMessage",value:function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,s=e.messageUId,a=e.sendTime,o=e.content,u=this._codec.getModule(Hf);return u.setFromUserId(t),u.setTargetId(n),u.setType(r),u.setBusChannel(i||""),u.setMsgUID(s),u.setMsgTime(a),u.setContent(JSON.stringify(o)),u.getArrayData()}},{key:"encodeQueryMsgChange",value:function(e){var t=this._codec.getModule(Yf);return t.setSyncTime(e),t.getArrayData()}},{key:"encodeMsgQuery",value:function(e){var t=e.targetId,n=e.conversationType,r=e.messages,i=this._codec.getModule(Jf),s=r.map((function(e){return{msgTime:e.sendTime,msgUID:e.messageUId,busChannel:e.channelId}}));return i.setTargetId(t),i.setType(n),i.setQuery(s),i.getArrayData()}},{key:"encodeOperateStatus",value:function(e,t,n,r){var i=this._codec.getModule(Xf);return i.setTargetId(e),i.setType(t),i.setBusChannel(n),i.setOpType(r),i.getArrayData()}},{key:"encodeJoinOrQuitChatRoom",value:function(){var e=this._codec.getModule(Gh);return e.setNothing(1),e.getArrayData()}},{key:"encodeGetChatRoomInfo",value:function(e,t){var n=this._codec.getModule(qh);return n.setCount(e),n.setOrder(t),n.getArrayData()}},{key:"encodeGetFileToken",value:function(e,t,n,r){var i=this._codec.getModule(of);return i.setType(e),i.setKey(t),i.setHttpMethod(n),i.setQueryString(r),i.getArrayData()}},{key:"encodeGetFileUrl",value:function(e,t,n,r){var i=this._codec.getModule(e);return i.setType(t),i.setKey(n),r&&i.setFileName(r),i.getArrayData()}},{key:"encodeModifyChatRoomKV",value:function(e,t,n){var r="comet"===this._connectType,i=this._codec.getModule(gf),s=t.key,a=t.value,o=t.notificationExtra,u=t.isSendNotification,c=t.type,l=t.timestamp,h=c||_a.UPDATE,f=Ao(t,h),d={key:s,value:a||"",uid:n,version:l};if(qs(f)||(d.status=f),i.setEntry(d),u){var g={conversationType:Ms.CHATROOM,targetId:e},p={key:s,value:a,extra:o,type:h},v=this._getUpMsgModule(g,{messageType:ha.CHRM_KV_NOTIFY,content:p,isPersited:!1,isCounted:!1});r?i.setNotification(v.getArrayData()):i.setNotification(v),i.setBNotify(!0),i.setType(Ms.CHATROOM)}return i.getArrayData()}},{key:"encodeModifyChatRoomKVS",value:function(e,t,n){this._connectType;var r=this._codec.getModule(pf),i=t.entries,s=t.type||_a.UPDATE,a=Ao(t,s),o=[];return i.forEach((function(e){var t={key:e.key,value:e.value||"",uid:n,version:e.timestamp};qs(a)||(t.status=a),o.push(t)})),r.setEntry(o),r.getArrayData()}},{key:"encodePullChatRoomKV",value:function(e){var t=this._codec.getModule(Tf);return t.setTimestamp(e),t.getArrayData()}},{key:"encodePullUserSetting",value:function(e){var t=this._codec.getModule(Cf);return t.setVersion(e),t.getArrayData()}},{key:"encodeGetConversationStatus",value:function(e){var t=this._codec.getModule(wf);return t.setTime(e),t.getArrayData()}},{key:"encodeSetConversationStatus",value:function(e){var t=this,n="comet"===this._connectType,r=this._codec.getModule(Mf),i=Mo.getTime(),s=[];return Eo(e,(function(e){var r=t._codec.getModule(Nf),a=e.conversationType,o=e.targetId,u=e.notificationStatus,c=e.isTop,l=e.channelId,h=[];r.setType(a),r.setChannelId(o),r.setTime(i),r.setBusChannel(l);var f=u===da.OPEN,d={};qs(u)||(d[tg]=f),qs(c)||(d[ng]=c),Eo(d,(function(e,r){if(!qs(e)){var i=t._codec.getModule(kf);e=e?$d:eg,i.setSessionStateType(Number(r)),i.setValue(e);var s=n?i.getArrayData():i;h.push(s)}})),r.setStateItem(h);var g=n?r.getArrayData():r;s.push(g)})),r.setVersion(i),r.setState(s),r.getArrayData()}},{key:"encodeReadReceipt",value:function(e,t){var n=this._codec.getModule(Uf);return n.setMsgId(e),t&&n.setChannelId(t),n.getArrayData()}},{key:"encodeCreateTag",value:function(e,t){var n=this,r="comet"===this._connectType,i=this._codec.getModule(Df),s=[];return e.forEach((function(e){var t=n._codec.getModule(Vf);t.setTagId(e.tagId),t.setName(e.tagName),s.push(r?t.getArrayData():t)})),i.setTags(s),i.setVersion(t),i.getArrayData()}},{key:"encodeMessageReader",value:function(e,t){var n=this._codec.getModule(Uf);return n.setMsgId(e),t&&n.setChannelId(t),n.getArrayData()}},{key:"encodeRemoveTag",value:function(e,t){var n=this,r="comet"===this._connectType,i=this._codec.getModule(Bf),s=[];return e.forEach((function(e){var t=n._codec.getModule(Vf);t.setTagId(e),s.push(r?t.getArrayData():t)})),i.setTags(s),i.setVersion(t),i.getArrayData()}},{key:"encodeDisConversationTag",value:function(e){var t=this._codec.getModule(Gf);return t.setTagId(e),t.getArrayData()}},{key:"encodeUpdateConversationTag",value:function(e,t){var n=this,r="comet"===this._connectType,i=this._codec.getModule(Mf),s=[];return t.forEach((function(t){var i=n._codec.getModule(Nf),a=n._codec.getModule(kf),o=[];e.forEach((function(e){var t=n._codec.getModule(Vf);t.setTagId(e.tagId),qs(e.isTop)||t.setIsTop(e.isTop),o.push(r?t.getArrayData():t)})),a.setSessionStateType(rg),a.setValue(JSON.stringify(o)),a.setTags(o),i.setType(t.conversationType),i.setChannelId(t.targetId),i.setTime(Date.now()),i.setStateItem([r?a.getArrayData():a]),s.push(r?i.getArrayData():i)})),i.setState(s),i.setVersion(Mo.getTime()),i.getArrayData()}},{key:"encodeReportSDKInfo",value:function(e){var t=this._codec.getModule(Ff);return t.setSdkInfo(e),t.getArrayData()}},{key:"encodeUltraGroup",value:function(e,t){var n=this._codec.getModule(Kf);return n.setSyncTime(e),n.setIsEraseMsgContent(t),n.getArrayData()}},{key:"encodeJoinRTCRoom",value:function(e,t,n,r,i){var s=this,a="comet"===this._connectType,o=this._codec.getModule(jh);if(e=e||0,o.setRoomType(e),qs(t)||o.setBroadcastType(t),qs(n)||o.setJoinType(n),r){var u=[],c=this._codec.getModule(sf);for(var l in r)c.setKey(l),c.setValue(r[l]),a?u.push(c.getArrayData()):u.push(c);o.setInnerDatas(u)}if(i){var h=[];Object.keys(i).forEach((function(e){var t=s._codec.getModule(sf);t.setKey(e),t.setValue(i[e]),a?h.push(t.getArrayData()):h.push(t)})),o.setOuterDatas(h)}return o.getArrayData()}},{key:"encodeQuitRTCRoom",value:function(){return this._codec.getModule(Yh).getArrayData()}},{key:"encodeSetRTCData",value:function(e,t,n,r,i){var s=this._codec.getModule(Qh);if(s.setInterior(n),s.setTarget(r),s.setKey(e),s.setValue(t),i){i.name&&s.setObjectName(i.name);var a=i.content;a&&(Gs(a)&&(a=JSON.stringify(a)),s.setContent(a))}return s.getArrayData()}},{key:"encodeUserSetRTCData",value:function(e,t,n,r){var i=this,s="comet"===this._connectType,a=this._codec.getModule(Wh);a.setObjectName(n);var o=this._codec.getModule(sf);o.setKey(e.name),o.setValue(e.content),s?a.setContent(o.getArrayData()):a.setContent(o);var u=[];return["uris","mcu_uris"].forEach((function(e){var n=i._codec.getModule(sf);n.setKey(e);var a="uris"===e?t:r;n.setValue(a),s?u.push(n.getArrayData()):u.push(n)})),a.setValueInfo(u),a.getArrayData()}},{key:"encodeUserSetRTCCDNUris",value:function(e,t){this._connectType;var n=this._codec.getModule(Wh);n.setObjectName(e);var r=this._codec.getModule(sf);return r.setKey("cdn_uris"),r.setValue(t),n.setValueInfo(r),n.getArrayData()}},{key:"encodeGetRTCData",value:function(e,t,n){var r=this._codec.getModule(Jh);return r.setInterior(t),r.setTarget(n),r.setKey(e),r.getArrayData()}},{key:"encodeRemoveRTCData",value:function(e,t,n,r){var i=this._codec.getModule(Jh);i.setInterior(t),i.setTarget(n),i.setKey(e);var s=r=r||{},a=s.name,o=s.content;return!qs(a)&&i.setObjectName(a),qs(o)||(Gs(o)&&(o=JSON.stringify(o)),i.setContent(o)),i.getArrayData()}},{key:"encodeSetRTCOutData",value:function(e,t,n){var r=this._codec.getModule(zh);r.setTarget(t),Ds(e)||(e=[e]),Eo(e,(function(t,n){t.key=t.key?t.key.toString():t.key,t.value=t.value?t.value.toString():t.value,e[n]=t})),r.setValueInfo(e);var i=n=n||{},s=i.name,a=i.content;return!qs(s)&&r.setObjectName(s),qs(a)||(Gs(a)&&(a=JSON.stringify(a)),r.setContent(a)),r.getArrayData()}},{key:"ecnodeGetRTCOutData",value:function(e){var t=this._codec.getModule(ef);return t.setUserId(e),t.getArrayData()}},{key:"encodeSetRTCState",value:function(e){var t=this._codec.getModule(Zh);return t.setState(e),t.getArrayData()}},{key:"encodeGetRTCRoomInfo",value:function(){var e=this._codec.getModule(nf);return e.setOrder(2),e.getArrayData()}},{key:"encodeSetRTCUserInfo",value:function(e,t){var n=this._codec.getModule(sf);return n.setKey(e),n.setValue(t),n.getArrayData()}},{key:"encodeRemoveRTCUserInfo",value:function(e){var t=this._codec.getModule(af);return t.setKey(e),t.getArrayData()}},{key:"encodeIdentityChangeInfo",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this._codec.getModule(jh);return i.setRoomType(e.RTCMode.LIVE),n&&i.setBroadcastType(n),i.setIdentityChangeType(t),i.setNeedSysChatroom(r),i.getArrayData()}},{key:"encodePullRTCRoomKV",value:function(e,t){var n=this._codec.getModule(rd);return n.setTimestamp(t),n.setRoomId(e),n.getArrayData()}},{key:"encodeQueryUserJoinedInfo",value:function(e){var t=this._codec.getModule(sd);return t.setUserId(e),t.getArrayData()}},{key:"encodeRequestRoomPK",value:function(e){var t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteTimeout,s=e.inviteInfo,a=this._codec.getModule(ud);return a.setInvitedRoomId(t),a.setInvitedUserId(n),a.setInviteSessionId(r),a.setTimeoutTime(i),a.setInviteInfo(s),a.getArrayData()}},{key:"encodeCancelRoomPK",value:function(e){var t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteInfo,s=this._codec.getModule(cd);return s.setInvitedRoomId(t),s.setInvitedUserId(n),s.setInviteSessionId(r),s.setInviteInfo(i),s.getArrayData()}},{key:"encodeResponseRoomPK",value:function(e){var t=e.inviteUserId,n=e.inviteRoomId,r=e.inviteSessionId,i=e.content,s=e.key,a=e.value,o=e.agree?1:0,u=this._codec.getModule(ld);return u.setInviteUserId(t),u.setInviteRoomId(n),u.setInviteSessionId(r),u.setContent(i),u.setKey(s),u.setValue(a),u.setAnswerCode(o),u.getArrayData()}},{key:"encodeEndRoomPK",value:function(e){var t=e.endRoomId,n=e.sessionId,r=e.content,i=e.keys,s=this._codec.getModule(hd);return s.setInviteRoomId(t),s.setInviteSessionId(n),s.setInviteContent(r),s.setInviteRoomKeys(i),s.getArrayData()}},{key:"encodebindRTCRoomForChatroom",value:function(e){var t=this._codec.getModule(fd);return t.setRtcRoomId(e.rtcRoomId),t.getArrayData()}}]),t}(),sg=function e(t,n){a(this,e),this._watcher=n,this.codec=new ig(t)},ag=function(e,t){return e&&t?t+"_"+e:e||Date.now()},og=function(){function e(t){a(this,e),this.header=t,this._name=null,this.lengthSize=0,this.messageId=0,this.timestamp=0,this.syncMsg=!1,this.identifier=""}return u(e,[{key:"getIdentifier",value:function(){var e=this.messageId,t=this.identifier;return ag(e,t)}},{key:"read",value:function(e,t,n){this.readMessage(e,t,n)}},{key:"readMessage",value:function(e,t,n){return{stream:e,length:t}}}]),e}(),ug=function(){function e(t){a(this,e),this.lengthSize=0,this.messageId=0,this.topic="",this.targetId="",this.identifier="",this._header=new vh(t,!1,Yl.AT_MOST_ONCE,!1)}return u(e,[{key:"getIdentifier",value:function(){var e=this.messageId,t=this.identifier;return ag(e,t)}},{key:"write",value:function(e){var t=this.getHeaderFlag();e.write(t),this.writeMessage(e)}},{key:"setHeaderQos",value:function(e){this._header.qos=e}},{key:"getHeaderFlag",value:function(){return this._header.encode()}},{key:"getLengthSize",value:function(){return this.lengthSize}},{key:"getBufferData",value:function(){var e=new _h;this.write(e);var t=e.getBytesArray();return new Int8Array(t)}},{key:"getCometData",value:function(){var e=this.data||{};return JSON.stringify(e)}}]),e}(),cg=function(e){f(n,e);var t=T(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments))._name=Wl.CONN_ACK,e.status=null,e.userId=null,e.timestamp=0,e}return u(n,[{key:"readMessage",value:function(e,t,r){if(e.readByte(),this.status=+e.readByte(),t<=n.MESSAGE_LENGTH)return{stream:e,length:t};if(r===zl.V4){var i=e.readByte();1&i&&(this.userId=e.readUTF()),2&i&&e.readUTF(),4&i&&(this.timestamp=e.readLong()),8&i&&(this.messageId=e.read2Byte())}else{this.userId=e.readUTF();var s=e.readUTF();Js.debug("server sessionId -> "+s),this.timestamp=e.readLong()}return{stream:e,length:t}}}]),n}(og);cg.MESSAGE_LENGTH=2;var lg=function(e){f(n,e);var t=T(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments))._name=Wl.DISCONNECT,e.status=0,e}return u(n,[{key:"readMessage",value:function(e,t){return e.readByte(),this.status=+e.readByte(),{stream:e,length:t}}}]),n}(og);lg.MESSAGE_LENGTH=2;var hg,fg=function(e){f(n,e);var t=T(n);function n(){var e;return a(this,n),(e=t.call(this,Ql.PING_REQ))._name=Wl.PING_REQ,e}return u(n,[{key:"writeMessage",value:function(e){}}]),n}(ug),dg=function(e){f(n,e);var t=T(n);function n(e){var r;return a(this,n),(r=t.call(this,e))._name=Wl.PING_RESP,r}return n}(og),gg=function(e){f(n,e);var t=T(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).messageId=0,e}return u(n,[{key:"readMessage",value:function(e,t){var n=256*e.readByte()+e.readByte();return this.messageId=parseInt(n.toString(),10),{stream:e,length:t}}}]),n}(og),pg=function(e){f(n,e);var t=T(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments)).messageId=0,e}return u(n,[{key:"writeMessage",value:function(e){var t=this.messageId,n=255&t,r=(65280&t)>>8;e.write(r),e.write(n)}}]),n}(ug),vg=function(e){f(n,e);var t=T(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments))._name=Wl.PUBLISH,e.topic="",e.targetId="",e.syncMsg=!1,e.identifier=Jl.PUB,e}return u(n,[{key:"readMessage",value:function(e,t){return this.date=e.readInt(),this.topic=e.readUTF(),this.targetId=e.readUTF(),R(d(n.prototype),"readMessage",this).call(this,e,t),this.data=e.readAll(),{stream:e,length:t}}}]),n}(gg),yg=function(e){f(n,e);var t=T(n);function n(e,r,i){var s;return a(this,n),(s=t.call(this,Ql.PUBLISH))._name=Wl.PUBLISH,s.syncMsg=!1,s.identifier=Jl.PUB,s.topic=e,s.data=Ls(r)?yh.writeUTF(r):r,s.targetId=i,s}return u(n,[{key:"writeMessage",value:function(e){e.writeUTF(this.topic),e.writeUTF(this.targetId),R(d(n.prototype),"writeMessage",this).call(this,e),e.write(this.data)}}]),n}(pg),mg=function(e){f(n,e);var t=T(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments))._name=Wl.PUB_ACK,e.status=0,e.date=0,e.millisecond=0,e.messageUId="",e.timestamp=0,e.identifier=Jl.PUB,e.topic="",e.targetId="",e}return u(n,[{key:"readMessage",value:function(e,t){return R(d(n.prototype),"readMessage",this).call(this,e,t),this.date=e.readInt(),this.status=256*e.readByte()+e.readByte(),this.millisecond=256*e.readByte()+e.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=e.readUTF(),{stream:e,length:t}}}]),n}(gg),_g=function(e){f(n,e);var t=T(n);function n(e){var r;return a(this,n),(r=t.call(this,Ql.PUB_ACK))._name=Wl.PUB_ACK,r.status=0,r.date=0,r.millisecond=0,r.messageUId="",r.timestamp=0,r.messageId=e,r}return u(n,[{key:"writeMessage",value:function(e){R(d(n.prototype),"writeMessage",this).call(this,e)}}]),n}(pg),Eg=function(e){f(n,e);var t=T(n);function n(e,r,i){var s;return a(this,n),(s=t.call(this,Ql.QUERY)).name=Wl.QUERY,s.identifier=Jl.QUERY,s.topic=e,s.data=Ls(r)?yh.writeUTF(r):r,s.targetId=i,s}return u(n,[{key:"writeMessage",value:function(e){e.writeUTF(this.topic),e.writeUTF(this.targetId),R(d(n.prototype),"writeMessage",this).call(this,e),e.write(this.data)}}]),n}(pg),Tg=function(e){f(n,e);var t=T(n);function n(e){var r;return a(this,n),(r=t.call(this,Ql.QUERY_CONFIRM))._name=Wl.QUERY_CON,r.messageId=e,r}return n}(pg),Rg=function(e){f(n,e);var t=T(n);function n(){var e;return a(this,n),(e=t.apply(this,arguments))._name=Wl.QUERY_ACK,e.status=0,e.identifier=Jl.QUERY,e.topic="",e.targetId="",e}return u(n,[{key:"readMessage",value:function(e,t){return R(d(n.prototype),"readMessage",this).call(this,e,t),this.date=e.readInt(),this.status=256*e.readByte()+e.readByte(),this.data=e.readAll(),{stream:e,length:t}}}]),n}(gg),Ig=function(e){var t,n=e.type;switch(n){case Ql.CONN_ACK:t=new cg(e);break;case Ql.PUBLISH:(t=new vg(e)).syncMsg=e.syncMsg;break;case Ql.PUB_ACK:t=new mg(e);break;case Ql.QUERY_ACK:t=new Rg(e);break;case Ql.SUB_ACK:case Ql.UNSUB_ACK:case Ql.PING_RESP:t=new dg(e);break;case Ql.DISCONNECT:t=new lg(e);break;default:t=new og(e),Js.error("No support for deserializing "+n+" messages")}return t},Cg=function(e,t){var n=new Uint8Array(e),r=new mh(n),i=r.readByte(),s=new vh(i),a=Ig(s);return a.read(r,n.length-1,t),a},Sg=function(e){var t=e.headerCode,n=new vh(t),r=Ig(n);for(var i in e)r[i]=e[i];return r},bg=Vt.charAt,wg="String Iterator",Og=Oe.set,Ng=Oe.getterFor(wg);Jo(String,"String",(function(e){Og(this,{type:wg,string:String(e),index:0})}),(function(){var e,t=Ng(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=bg(n,r),t.index+=e.length,{value:e,done:!1})})),function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgN=2]="ppMsgN",e[e.ppMsgS=3]="ppMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.qryPMsg=7]="qryPMsg",e[e.qryGMsg=8]="qryGMsg",e[e.qryCHMsg=9]="qryCHMsg",e[e.qryCMsg=10]="qryCMsg",e[e.qrySMsg=11]="qrySMsg",e[e.recallMsg=12]="recallMsg",e[e.prMsgS=13]="prMsgS",e[e.rrMsg=14]="rrMsg",e[e.rrList=15]="rrList",e[e.s_ntf=16]="s_ntf",e[e.s_msg=17]="s_msg",e[e.s_stat=18]="s_stat",e[e.s_cmd=19]="s_cmd",e[e.s_us=20]="s_us",e[e.pullUS=21]="pullUS",e[e.pgMsgS=22]="pgMsgS",e[e.chatMsgS=23]="chatMsgS",e[e.qrySessionsAtt=24]="qrySessionsAtt",e[e.pullMsg=25]="pullMsg",e[e.qrySessions=26]="qrySessions",e[e.delSessions=27]="delSessions",e[e.delMsg=28]="delMsg",e[e.updRRTime=29]="updRRTime",e[e.chrmPull=30]="chrmPull",e[e.joinChrm=31]="joinChrm",e[e.joinChrmR=32]="joinChrmR",e[e.exitChrm=33]="exitChrm",e[e.queryChrmI=34]="queryChrmI",e[e.setKV=35]="setKV",e[e.delKV=36]="delKV",e[e.pullKV=37]="pullKV",e[e.qryRelation=38]="qryRelation",e[e.delRelation=39]="delRelation",e[e.pullSeAtts=40]="pullSeAtts",e[e.setSeAtt=41]="setSeAtt",e[e.qnTkn=42]="qnTkn",e[e.qnUrl=43]="qnUrl",e[e.aliUrl=44]="aliUrl",e[e.s3Url=45]="s3Url",e[e.stcUrl=46]="stcUrl",e[e.cleanPMsg=47]="cleanPMsg",e[e.cleanGMsg=48]="cleanGMsg",e[e.cleanCMsg=49]="cleanCMsg",e[e.cleanSMsg=50]="cleanSMsg",e[e.rtcRJoin_data=51]="rtcRJoin_data",e[e.rtcRExit=52]="rtcRExit",e[e.rtcPing=53]="rtcPing",e[e.rtcSetData=54]="rtcSetData",e[e.rtc_ntf=55]="rtc_ntf",e[e.viewerJoinR=56]="viewerJoinR",e[e.viewerExitR=57]="viewerExitR",e[e.rtcPullKv=58]="rtcPullKv",e[e.rtcIdentityChange=59]="rtcIdentityChange",e[e.userSetData=60]="userSetData",e[e.rtcQryData=61]="rtcQryData",e[e.rtcDelData=62]="rtcDelData",e[e.rtcSetOutData=63]="rtcSetOutData",e[e.rtcQryUserOutData=64]="rtcQryUserOutData",e[e.rtcToken=65]="rtcToken",e[e.rtcUserState=66]="rtcUserState",e[e.rtcRInfo=67]="rtcRInfo",e[e.rtcUData=68]="rtcUData",e[e.rtcUPut=69]="rtcUPut",e[e.rtcUDel=70]="rtcUDel",e[e.rtcUList=71]="rtcUList",e[e.rtcQueryJoined=72]="rtcQueryJoined",e[e.rtcInvite=73]="rtcInvite",e[e.rtcCancelInvite=74]="rtcCancelInvite",e[e.rtcInviteAnswer=75]="rtcInviteAnswer",e[e.rtcEndInvite=76]="rtcEndInvite",e[e.addSeTag=77]="addSeTag",e[e.delSeTag=78]="delSeTag",e[e.addTag=79]="addTag",e[e.delTag=80]="delTag",e[e.disTag=81]="disTag",e[e.reportsdk=82]="reportsdk",e[e.pullUgSes=83]="pullUgSes",e[e.pullUgMsg=84]="pullUgMsg",e[e.ugMsg=85]="ugMsg",e[e.qryUgMsg=86]="qryUgMsg",e[e.updUgRTime=87]="updUgRTime",e[e.upMsgEx=88]="upMsgEx",e[e.modifyMsg=89]="modifyMsg",e[e.qryMsgChange=90]="qryMsgChange",e[e.qryMsg=91]="qryMsg",e[e.operate=92]="operate",e[e.s_opNtf=93]="s_opNtf",e[e.setRtcRoomId=94]="setRtcRoomId"}(hg||(hg={}));var kg=hg;s(regeneratorRuntime.mark((function e(t,n,r){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(t.map(function(){var e=s(regeneratorRuntime.mark((function e(t){var i,s,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Date.now(),s="".concat(n,"://").concat(t,"/ping?r=").concat(ws(1e3,9999)),e.next=4,r.httpReq({url:s,timeout:rn});case 4:return a=e.sent,e.abrupt("return",{status:a.status,host:t,cost:Date.now()-i});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:return(i=(i=e.sent).filter((function(e){return 200===e.status}))).length>1&&(i=i.sort((function(e,t){return e.cost-t.cost}))),e.abrupt("return",i.map((function(e){return e.host})));case 6:case"end":return e.stop()}}),e)})));var Mg,Ag,Ug=(Mg=s(regeneratorRuntime.mark((function e(t,n,r,i){var a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=0,t.forEach(function(){var e=s(regeneratorRuntime.mark((function e(s){var o,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u="".concat(n,"://").concat(s,"/ping?r=").concat(ws(1e3,9999)),Js.debug("start ping",u),a++,e.prev=3,e.next=6,r.httpReq({url:u,timeout:rn});case 6:c=e.sent,e.next=14;break;case 9:return e.prev=9,e.t0=e.catch(3),Js.error("ping error: ",e.t0),i({finished:a===t.length,code:-2,host:s}),e.abrupt("return");case 14:Js.debug("end ping",a,u,null===(o=c)||void 0===o?void 0:o.status),i({finished:a===t.length,code:c.status,host:s});case 16:case"end":return e.stop()}}),e,null,[[3,9]])})));return function(t){return e.apply(this,arguments)}}());case 2:case"end":return e.stop()}}),e)}))),function(e,t,n,r){return Mg.apply(this,arguments)}),Lg=function(e,t,n,r,i,s,a,o){return"".concat(e,"://").concat(t,"/websocket?appId=").concat(n,"&token=").concat(encodeURIComponent(r),"&sdkVer=").concat(s,"&pid=").concat(a,"&apiVer=").concat(i.isFromUniapp?"uniapp":"normal").concat(i.connectPlatform?"&platform="+i.connectPlatform:"").concat(o?"&protocolVer="+o:"")},xg=function(e){return[kg.ppMsgS,kg.pgMsgS,kg.chatMsgS].map((function(e){return kg[e]})).indexOf(e)>=0};!function(e){e[e.REDIRECT=0]="REDIRECT",e[e.OTHER_DEVICE_LOGIN=1]="OTHER_DEVICE_LOGIN",e[e.BLOCK=2]="BLOCK",e[e.REMOTE_CLOSE=3]="REMOTE_CLOSE",e[e.LOGOUT=4]="LOGOUT",e[e.BLOCK_NEW=5]="BLOCK_NEW",e[e.REDIRECT_NEW=6]="REDIRECT_NEW"}(Ag||(Ag={}));var Pg,Dg=function(e,t){Js.info("websocket send -> messageId: ".concat(e.messageId," topic: ").concat(e.topic));var n=e.getBufferData();t.send(n.buffer)},Vg=function(e){f(l,e);var t,n,r,i,o,c=T(l);function l(e,t){var n;return a(this,l),(n=c.call(this,"websocket",t))._runtime=e,n._socket=null,n._messageIds={},n._syncMessageIds={},n._failedCount=0,n.ALLOW_FAILED_TIMES=2,n._timer=null,n._idCount=0,n._generateMessageId=function(){return n._idCount>=65535&&(n._idCount=0),++n._idCount},n}return u(l,[{key:"connect",value:(o=s(regeneratorRuntime.mark((function e(t,n,r,i,a,o){var u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e){var c=[],l=0,h=!1,f=!1,d=function(){var r=s(regeneratorRuntime.mark((function r(){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==c.length&&!h){r.next=2;break}return r.abrupt("return");case 2:return h=!0,r.next=5,u._connect(t,n,c.shift(),i,a,o);case 5:if((s=r.sent)!==aa.SUCCESS){r.next=11;break}u._checkAlive(),e(s),r.next=20;break;case 11:if(s!==ca.REDIRECT){r.next=15;break}e(s),r.next=20;break;case 15:if(!f||0!==c.length){r.next=18;break}return e(wo(s)),r.abrupt("return");case 18:h=!1,d();case 20:case"end":return r.stop()}}),r)})));return function(){return r.apply(this,arguments)}}();a=Qn(a),u._watcher.status(ua.CONNECTING),Ug(r,i,u._runtime,(function(t){var n=t.code,r=t.finished,i=t.host;f=r,200===n&&(c.push(i),l++,d()),r&&0===l&&(Js.error("No valid websocket server hosts!"),e(aa.RC_SOCKET_NOT_CREATED))}))})));case 1:case"end":return e.stop()}}),e)}))),function(e,t,n,r,i,s){return o.apply(this,arguments)})},{key:"_connect",value:(i=s(regeneratorRuntime.mark((function e(t,n,r,i,s,a){var o,u,c,l,h,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=i.replace("http","ws"),u=Lg(o,r,t,n,this._runtime,s,"",a),Js.debug("conenct start -> ".concat(u)),this.sendConnectTime=Date.now(),c=this._runtime.createWebSocket(u),l=function(e){f._timer&&(clearTimeout(f._timer),f._timer=null),f._socket===c&&(f._socket=null,f._watcher.status(e))},e.next=8,new Promise((function(e){c.onMessage((function(t){if("[object ArrayBuffer]"===Object.prototype.toString.call(t)){var n=Cg(t,a);if(n instanceof dg&&f._pingResolve)return f._pingResolve(aa.SUCCESS),void(f._pingResolve=void 0);if(n instanceof cg)return Js.debug("recv connect ack -> ".concat(n.status)),n.status!==ca.ACCEPTED?(Js.warn("connect failed: ".concat(n.status)),void e(n.status)):(Js.info("connect success -> ".concat(u)),f.connectedTime=n.timestamp,f.userId=n.userId||"",f._idCount=n.messageId,void e(aa.SUCCESS));if(n instanceof lg){var r=n.status;switch(Js.warn("recv disconnect signal -> status: ".concat(r)),r){case Ag.BLOCK_NEW:case Ag.BLOCK:f._watcher.status(ua.BLOCKED);break;case Ag.OTHER_DEVICE_LOGIN:f._watcher.status(ua.KICKED_OFFLINE_BY_OTHER_CLIENT);break;case Ag.REDIRECT_NEW:case Ag.REDIRECT:f._watcher.status(ua.REDIRECT);break;default:f._watcher.status(ua.DISCONNECT_BY_SERVER)}}else f._onReceiveSignal(n)}else Js.error("Socket received invalid data:",t)})),c.onClose((function(t,n){for(var r in Js.warn("websocket closed! code:",t,"reason:",n),l(ua.CONNECTION_CLOSED),f._messageIds){var i=f._messageIds[r];delete f._messageIds[r],i(aa.RC_NET_CHANNEL_INVALID)}e(t)})),c.onError((function(t){for(var n in Js.error("websocket error!",null==t?void 0:t.stack),l(ua.WEBSOCKET_ERROR),f._messageIds){var r=f._messageIds[n];delete f._messageIds[n],r(aa.RC_NET_CHANNEL_INVALID)}e(aa.NETWORK_ERROR)})),c.onOpen((function(){return Js.debug("websocket open =>",u)})),setTimeout((function(){e(aa.TIMEOUT)}),sn)}));case 8:return(h=e.sent)===aa.SUCCESS?this._socket=c:(Js.warn("connect result -> code: ".concat(h,", url: ").concat(u)),c.close()),e.abrupt("return",h);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,s,a){return i.apply(this,arguments)})},{key:"_checkAlive",value:(r=s(regeneratorRuntime.mark((function e(){var t,n,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._socket){e.next=2;break}return e.abrupt("return");case 2:return Js.debug("send ping ->"),this.sendOnly(new fg),e.next=6,new Promise((function(e){r._pingResolve=e,r._timer&&clearTimeout(r._timer),r._timer=setTimeout((function(){r._pingResolve=void 0,e(aa.TIMEOUT)}),15e3)}));case 6:if((t=e.sent)===aa.SUCCESS){e.next=12;break}return this._failedCount+=1,Js.warn("ping failed count: ".concat(this._failedCount,", code: ").concat(t)),this._failedCount>=this.ALLOW_FAILED_TIMES?(this._failedCount=0,Js.warn("ping timeout, close current websocket to reconnect!"),null===(n=this._socket)||void 0===n||n.close(),this._watcher.status(ua.NETWORK_UNAVAILABLE)):this._checkAlive(),e.abrupt("return");case 12:Js.debug("recv pong <-"),this._failedCount=0,setTimeout((function(){return r._checkAlive()}),15e3);case 15:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})},{key:"_onReceiveSignal",value:(n=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.messageId,t.header&&t.header.qos!==Yl.AT_MOST_ONCE&&(t instanceof vg&&!t.syncMsg&&(Js.info("send pubAck -> ".concat(n," ").concat(t.topic)),this.sendOnly(new _g(n))),t instanceof Rg&&(Js.info("send queryCon -> ".concat(n," ").concat(t.topic)),this.sendOnly(new Tg(n)))),n>0&&(t instanceof mg||t instanceof Rg)&&(Js.info("recv ack -> messageId: ".concat(n," ").concat(t.topic)),(r=this._messageIds[n])&&(r(t),delete this._messageIds[n]),(i=this._syncMessageIds[n])&&(delete this._syncMessageIds[n],i(t))),!(t instanceof vg)){e.next=17;break}if(s=t.syncMsg,a=t.topic,Js.info("recv PublishReader -> messageId: ".concat(n," ").concat(a)),a!==kg[kg.userSetData]){e.next=9;break}return e.abrupt("return");case 9:if(s&&!xg(a)){e.next=12;break}return this._watcher.signal(t),e.abrupt("return");case 12:return e.next=14,new Promise((function(e){u._syncMessageIds[n]=e}));case 14:o=e.sent,delete this._syncMessageIds[n],this._watcher.signal(t,o);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"sendOnly",value:function(e){this._socket&&((e instanceof yg||e instanceof Eg)&&(e.messageId=this._generateMessageId()),Dg(e,this._socket))}},{key:"send",value:(t=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u=this,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=c.length>3&&void 0!==c[3]?c[3]:cn,!this._socket){e.next=18;break}return s=this._generateMessageId(),t.messageId=s,Dg(t,this._socket),e.next=7,new Promise((function(e){u._messageIds[s]=e,setTimeout((function(){u._messageIds[s]&&delete u._messageIds[s],e()}),i)}));case 7:if(a=e.sent){e.next=11;break}return Js.warn("send timeout -> message: ".concat(s,", respPBName: ").concat(n,", timeout: ").concat(i)),e.abrupt("return",{code:aa.TIMEOUT});case 11:if(a instanceof Rg||a instanceof mg){e.next=13;break}return e.abrupt("return",{code:a});case 13:if(o=n&&a.data?this.codec.decodeByPBName(a.data,n,r):a,0===a.status){e.next=17;break}return Js.warn("send failed -> message: ".concat(s,", respPBName: ").concat(n,", status: ").concat(a.status)),e.abrupt("return",{code:a.status,data:n&&a.data?o:null});case 17:return e.abrupt("return",{code:aa.SUCCESS,data:o});case 18:return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 19:case"end":return e.stop()}}),e,this)}))),function(e,n,r){return t.apply(this,arguments)})},{key:"close",value:function(){this._socket&&(this._socket.close(),this._socket=null,this._watcher.status(ua.DISCONNECTED))}}]),l}(sg);e.HttpMethod=void 0,(Pg=e.HttpMethod||(e.HttpMethod={})).GET="GET",Pg.POST="POST";var Bg=function(e){if(Gs(e))return!0;var t=!1;try{var n=JSON.parse(e);t=JSON.stringify(n)===e}catch(e){t=!1}return t},Gg=function(t){f(h,t);var n,r,i,o,c,l=T(h);function h(e,t){var n;return a(this,h),(n=l.call(this,"comet",t))._runtime=e,n._messageIds={},n._syncMessageIds={},n._idCount=0,n._generateMessageId=function(){return++n._idCount},n._pid=encodeURIComponent((new Date).getTime()+Math.random()+""),n}return u(h,[{key:"handleCometRes",value:function(e){var t=this;if(200!==e.status&&202!==e.status)return!1;var n=Ls(e.data)?JSON.parse(e.data):e.data;return n?!Ds(n)||(Eo(n,function(){var e=s(regeneratorRuntime.mark((function e(n){var r,i,s,a,o,u,c,l,h,f,d,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=n.sessionid)&&(t._sessionid=r),i=Sg(n),s=i.messageId,a=i._header,o=i.status,i.identifier,u=a&&a.qos!==Yl.AT_MOST_ONCE,s&&i.getIdentifier&&((c=t._messageIds[s])&&c(i),t._syncMessageIds[s]&&t._syncMessageIds[s](i)),u&&(i instanceof vg&&!i.syncMsg&&(l=new _g(s),t.sendOnly(l)),i instanceof Rg&&(h=new Tg(s),t.sendOnly(h))),!(i instanceof lg)){e.next=20;break}e.t0=o,e.next=e.t0===Ag.OTHER_DEVICE_LOGIN?11:e.t0===Ag.BLOCK||e.t0===Ag.BLOCK_NEW?13:e.t0===Ag.REDIRECT_NEW||e.t0===Ag.REDIRECT?15:17;break;case 11:return t._watcher.status(ua.KICKED_OFFLINE_BY_OTHER_CLIENT),e.abrupt("break",19);case 13:return t._watcher.status(ua.BLOCKED),e.abrupt("break",19);case 15:return t._watcher.status(ua.REDIRECT),e.abrupt("break",19);case 17:return t._watcher.status(ua.DISCONNECT_BY_SERVER),e.abrupt("break",19);case 19:return e.abrupt("return");case 20:if(!(i instanceof vg)){e.next=30;break}if(f=i.syncMsg,d=i.topic,f&&!xg(d)){e.next=25;break}return t._watcher.signal(i),e.abrupt("return",!1);case 25:return e.next=27,new Promise((function(e){t._syncMessageIds[s]=e}));case 27:g=e.sent,delete t._syncMessageIds[s],t._watcher.signal(i,g);case 30:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),!0):(Js.error("received data is not a validJson",n),!1)}},{key:"_startPullSignal",value:(c=s(regeneratorRuntime.mark((function e(t){var n,r,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=(new Date).getTime(),r="".concat(t,"://").concat(this._domain,"/pullmsg.js?sessionid=").concat(this._sessionid,"×trap=").concat(n,"&pid=").concat(this._pid),e.next=4,this._runtime.httpReq({url:r,body:{pid:this._pid},timeout:45e3});case 4:i=e.sent,s=this.handleCometRes(i),this._isDisconnected||(s?this._startPullSignal(t):(this._isDisconnected=!0,this._watcher.status(ua.NETWORK_UNAVAILABLE)));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return c.apply(this,arguments)})},{key:"connect",value:(o=s(regeneratorRuntime.mark((function e(t,n,r,i,a,o){var u,c,l,h,f=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=Qn(a),this._protocol=i,this._isDisconnected=!1,this._watcher.status(ua.CONNECTING),u=[],c=0,l=!1,h=!1,e.abrupt("return",new Promise((function(e){var o,d=(o=s(regeneratorRuntime.mark((function r(){var s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==u.length&&!l){r.next=2;break}return r.abrupt("return");case 2:return l=!0,r.next=5,f._connect(t,n,u.shift(),i,a);case 5:if((s=r.sent)!==aa.SUCCESS){r.next=11;break}f._startPullSignal(i),e(s),r.next=20;break;case 11:if(s!==ca.REDIRECT){r.next=15;break}e(s),r.next=20;break;case 15:if(!h||0!==u.length){r.next=18;break}return e(wo(s)),r.abrupt("return");case 18:l=!1,d();case 20:case"end":return r.stop()}}),r)}))),function(){return o.apply(this,arguments)});f._watcher.status(ua.CONNECTING),Ug(r,i,f._runtime,(function(t){var n=t.code,r=t.finished,i=t.host;h=r,200===n&&(u.push(i),c++,d()),r&&0===c&&(Js.error("No valid websocket server hosts!"),e(aa.RC_SOCKET_NOT_CREATED))}))})));case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i,s){return o.apply(this,arguments)})},{key:"_connect",value:(i=s(regeneratorRuntime.mark((function e(t,n,r,i,s){var a,o,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=function(e){return 200!==e.status&&202!==e.status?(Js.error("handle comet res -> res: ".concat(JSON.stringify(e||{}))),!1):!!e.data&&(Bg(e.data)?Gs(e.data)?e.data:JSON.parse(e.data):(Js.error("received data is not a validJson",e.data),!1))},o=Lg(i,r,t,n,this._runtime,s,this._pid),this.sendConnectTime=Date.now(),Js.debug("conenct start -> ".concat(o)),e.next=6,this._runtime.httpReq({url:o,body:{pid:this._pid},timeout:sn});case 6:return u=e.sent,c=a(u),this._domain=r,c&&0===c.status?(this._sessionid=c.sessionid,this.userId=c.userId,this.connectedTime=c.timestamp):Js.warn("connect result -> code: ".concat(null==c?void 0:c.status,", url: ").concat(o)),e.abrupt("return",null==c?void 0:c.status);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,s){return i.apply(this,arguments)})},{key:"sendCometData",value:(r=s(regeneratorRuntime.mark((function t(n){var r,i,s,a,o,u,c,l,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this._domain,i=this._sessionid,s=this._pid,a=n.messageId,o=n.topic,u=n.targetId,n.identifier,c=n.getHeaderFlag(),l=o?"".concat(this._protocol,"://").concat(r,"/websocket?messageid=").concat(a,"&header=").concat(c,"&sessionid=").concat(i,"&topic=").concat(o,"&targetid=").concat(u,"&pid=").concat(s):"".concat(this._protocol,"://").concat(r,"/websocket?messageid=").concat(a,"&header=").concat(c,"&sessionid=").concat(i,"&pid=").concat(s),t.next=7,this._runtime.httpReq({url:l,method:e.HttpMethod.POST,body:n.getCometData()});case 7:h=t.sent,this.handleCometRes(h);case 9:case"end":return t.stop()}}),t,this)}))),function(e){return r.apply(this,arguments)})},{key:"sendOnly",value:function(e){this.sendCometData(e)}},{key:"send",value:(n=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u=this,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=c.length>3&&void 0!==c[3]?c[3]:cn,s=this._generateMessageId(),t.messageId=s,this.sendCometData(t),e.next=6,new Promise((function(e){u._messageIds[s]=e,setTimeout((function(){delete u._messageIds[s],e()}),i)}));case 6:if(a=e.sent){e.next=9;break}return e.abrupt("return",{code:aa.TIMEOUT});case 9:if(o=n&&a.data?this.codec.decodeByPBName(a.data,n,r):a,0===a.status){e.next=12;break}return e.abrupt("return",{code:a.status,data:n&&a.data?o:null});case 12:return e.abrupt("return",{code:aa.SUCCESS,data:o});case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"close",value:function(){this._isDisconnected=!0,this._watcher.status(ua.DISCONNECTED)}}]),h}(sg),Fg=function e(t,n,r){a(this,e),this.runtime=t,this._watcher=n,this._options=r,this.currentUserId="",this._appkey=this._options.appkey,this._apiVer=this._options.apiVersion,this.navi=this._createNavi()},qg=Ln.find,Kg="find",jg=!0;Kg in[]&&Array(1).find((function(){jg=!1})),st({target:"Array",proto:!0,forced:jg},{find:function(e){return qg(this,e,arguments.length>1?arguments[1]:void 0)}}),hr(Kg);var Hg=function(e){return["navi",e].join("_")},Yg=function(e,t,n){var r,i,s=Hg(e);try{var a=n.getItem(s);i=a?JSON.parse(a):[]}catch(e){i=[]}var o=Date.now();return i.length>0&&(i=i.filter((function(e){return o-e.timestamp<nn}))),0===i.length?n.removeItem(s):n.setItem(s,JSON.stringify(i)),(null===(r=i.find((function(e){return e.token===t})))||void 0===r?void 0:r.naviInfo)||null},Qg=function(){function e(t,n){a(this,e),this._runtime=t,this._options=n,this._naviInfo=null,this._appkey=this._options.appkey,this._apiVersion=Qn(this._options.apiVersion)}var t;return u(e,[{key:"getInfo",value:(t=s(regeneratorRuntime.mark((function e(t,n,r,i){var s,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r&&this._clear(t),!(s=Yg(this._appkey,t,this._runtime.localStorage))){e.next=5;break}return this._naviInfo=s,e.abrupt("return",s);case 5:return a=this._options.navigators.slice(),n.length&&n.forEach((function(e){a.indexOf(e)<0&&a.unshift(e)})),e.next=9,this._reqNavi(a,this._appkey,t,i);case 9:if(!(s=e.sent)){e.next=14;break}return this._naviInfo=s,this.setNaviInfo2Cache(t,s),e.abrupt("return",s);case 14:return e.abrupt("return",s);case 15:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i){return t.apply(this,arguments)})},{key:"setNaviInfo2Cache",value:function(e,t){this._naviInfo=t,function(e,t,n,r){var i,s=Hg(e);try{var a=r.getItem(s);i=a?JSON.parse(a):[]}catch(e){i=[]}var o=Date.now();i.length>0&&(i=i.filter((function(e){return o-e.timestamp<nn&&t!==e.token}))),i.push({timestamp:o,naviInfo:n,token:t}),r.setItem(s,JSON.stringify(i))}(this._appkey,e,t,this._runtime.localStorage)}},{key:"getInfoFromCache",value:function(e){return this._naviInfo}},{key:"_clear",value:function(e){!function(e,t,n){var r,i=Hg(e);try{var s=n.getItem(i);r=s?JSON.parse(s):[]}catch(e){r=[]}var a=Date.now();r.length>0&&(r=r.filter((function(e){return a-e.timestamp<nn&&t!==e.token}))),0===r.length?n.removeItem(i):n.setItem(i,JSON.stringify(r))}(this._appkey,e,this._runtime.localStorage)}}]),e}(),Wg=Ln.findIndex,Jg="findIndex",zg=!0;Jg in[]&&Array(1).findIndex((function(){zg=!1})),st({target:"Array",proto:!0,forced:zg},{findIndex:function(e){return Wg(this,e,arguments.length>1?arguments[1]:void 0)}}),hr(Jg);var Zg=x.f,Xg=function(e){return function(t){for(var n,r=q(t),i=Bn(r),s=i.length,a=0,o=[];s>a;)n=i[a++],A&&!Zg.call(r,n)||o.push(e?[n,r[n]]:r[n]);return o}},$g={entries:Xg(!0),values:Xg(!1)}.values;st({target:"Object",stat:!0},{values:function(e){return $g(e)}});var ep=!M((function(){return Object.isExtensible(Object.preventExtensions({}))})),tp=O((function(e){var t=ne.f,n=ye("meta"),r=0,i=Object.isExtensible||function(){return!0},s=function(e){t(e,n,{value:{objectID:"O"+ ++r,weakData:{}}})},a=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!K(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";s(e)}return e[n].objectID},getWeakData:function(e,t){if(!Q(e,n)){if(!i(e))return!0;if(!t)return!1;s(e)}return e[n].weakData},onFreeze:function(e){return ep&&a.REQUIRED&&i(e)&&!Q(e,n)&&s(e),e}};Ee[n]=!0})),np=ne.f,rp=tp.fastKey,ip=Oe.set,sp=Oe.getterFor;!function(e,t,n){var r=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),s=r?"set":"add",a=k[e],o=a&&a.prototype,u=a,c={},l=function(e){var t=o[e];Ne(o,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!K(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return i&&!K(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!K(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(rt(e,"function"!=typeof a||!(i||o.forEach&&!M((function(){(new a).entries().next()})))))u=n.getConstructor(t,e,r,s),tp.REQUIRED=!0;else if(rt(e,!0)){var h=new u,f=h[s](i?{}:-0,1)!=h,d=M((function(){h.has(1)})),g=Jr((function(e){new a(e)})),p=!i&&M((function(){for(var e=new a,t=5;t--;)e[s](t,t);return!e.has(-0)}));g||((u=t((function(t,n){Ar(t,u,e);var i=Ja(new a,t,u);return null!=n&&Fr(n,i[s],{that:i,AS_ENTRIES:r}),i}))).prototype=o,o.constructor=u),(d||p)&&(l("delete"),l("has"),r&&l("get")),(p||f)&&l(s),i&&o.clear&&delete o.clear}c[e]=u,st({global:!0,forced:u!=a},c),Nr(u,e),i||n.setStrong(u,e,r)}("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(e,t,n,r){var i=e((function(e,s){Ar(e,i,t),ip(e,{type:t,index:ar(null),first:void 0,last:void 0,size:0}),A||(e.size=0),null!=s&&Fr(s,e[r],{that:e,AS_ENTRIES:n})})),s=sp(t),a=function(e,t,n){var r,i,a=s(e),u=o(e,t);return u?u.value=n:(a.last=u={index:i=rp(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||(a.first=u),r&&(r.next=u),A?a.size++:e.size++,"F"!==i&&(a.index[i]=u)),e},o=function(e,t){var n,r=s(e),i=rp(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return br(i.prototype,{clear:function(){for(var e=s(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,A?e.size=0:this.size=0},delete:function(e){var t=this,n=s(t),r=o(t,e);if(r){var i=r.next,a=r.previous;delete n.index[r.index],r.removed=!0,a&&(a.next=i),i&&(i.previous=a),n.first==r&&(n.first=i),n.last==r&&(n.last=a),A?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=s(this),r=Mn(e,arguments.length>1?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!!o(this,e)}}),br(i.prototype,n?{get:function(e){var t=o(this,e);return t&&t.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)}}),A&&np(i.prototype,"size",{get:function(){return s(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=sp(t),s=sp(r);Jo(e,t,(function(e,t){ip(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=s(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),Mr(t)}});var ap="outbox",op="inbox",up="broadcastbox",cp=function(e,t,n){return[e,t,n].join("_")},lp=function(){function e(t,n){a(this,e),this._runtime=t,this._appkey=n,this._users={}}return u(e,[{key:"_getMemData",value:function(e){return this._users[e]||(this._users[e]={inboxTime:0,outboxTime:0,broadcastSyncTime:0})}},{key:"setInboxTime",value:function(e,t){var n=this._getMemData(t);if(!(n.inboxTime>e)){n.inboxTime=e;var r=cp(op,this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}}},{key:"getInboxTime",value:function(e){var t=this._getMemData(e);if(0===t.inboxTime){var n=cp(op,this._appkey,e);t.inboxTime=parseInt(this._runtime.localStorage.getItem(n))||0}return t.inboxTime}},{key:"setBroadcastSyncTime",value:function(e,t){var n=this._getMemData(t);if(!(n.broadcastSyncTime>=e)){n.broadcastSyncTime=e;var r=cp(up,this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}}},{key:"getBroadcastSyncTime",value:function(e){var t=this._getMemData(e);if(!t||0===t.broadcastSyncTime){var n=cp(up,this._appkey,e);t.broadcastSyncTime=parseInt(this._runtime.localStorage.getItem(n))||1}return t.broadcastSyncTime}},{key:"setOutboxTime",value:function(e,t){var n=this._getMemData(t);if(!(n.outboxTime>=e)){n.outboxTime=e;var r=cp(ap,this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}}},{key:"getOutboxTime",value:function(e){var t=this._getMemData(e);if(0===t.outboxTime){var n=cp(ap,this._appkey,e);t.outboxTime=parseInt(this._runtime.localStorage.getItem(n))||0}return t.outboxTime}}]),e}(),hp={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},fp=function(){function e(t,n){a(this,e),this._kvCaches={},this._chatroomId=t,this._currentUserId=n}return u(e,[{key:"_add",value:function(e){var t=e.key;e.isDeleted=!1,this._kvCaches[t]=e}},{key:"_remove",value:function(e){var t=e.key,n=this._kvCaches[t];n&&(n.isDeleted=!0,this._kvCaches[t]=n)}},{key:"_setEntry",value:function(e,t){var n=e.key,r=e.type,i=e.isOverwrite,s=e.userId,a=this._getSetUserId(n),o=r===_a.DELETE,u=a===s,c=!this._isExisted(n),l=o?this._remove:this._add;(t||i||u||c)&&l.call(this,e)}},{key:"getValue",value:function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.value}},{key:"getVersion",value:function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.version}},{key:"getAllValue",value:function(){var e={};for(var t in this._kvCaches)this._kvCaches[t].isDeleted||(e[t]=this._kvCaches[t].value);return e}},{key:"_getSetUserId",value:function(e){return(this._kvCaches[e]||{}).userId}},{key:"_isExisted",value:function(e){var t=this._kvCaches[e]||{},n=t.value,r=t.isDeleted;return n&&!r}},{key:"setEntries",value:function(e){var t=this,n=e.kvEntries,r=e.isFullUpdate;n=n||[],(r=r||!1)&&this.clear(),n.forEach((function(e){t._setEntry(e,r)})),Js.debug("end setEntries")}},{key:"clear",value:function(){this._kvCaches={}}}]),e}(),dp=function(){function e(t){a(this,e),this._pullQueue=[],this._isPulling=!1,this._storeCaches={},this._engine=t}var t;return u(e,[{key:"_startPull",value:(t=s(regeneratorRuntime.mark((function e(){var t,n,r,i,s,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isPulling&&0!==this._pullQueue.length){e.next=2;break}return e.abrupt("return");case 2:if(this._isPulling=!0,t=this._pullQueue.splice(0,1)[0],n=t.chrmId,r=t.timestamp,!((i=hp.get(n))>r)){e.next=9;break}return this._isPulling=!1,this._startPull(),e.abrupt("return");case 9:return e.next=11,this._engine.pullChatroomEntry(n,i);case 11:s=e.sent,a=s.code,o=s.data,this._isPulling=!1,a===aa.SUCCESS?(hp.set(n,o.syncTime||0),this._startPull()):this._startPull();case 16:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"reset",value:function(e){hp.clear(e);var t=this._storeCaches[e];t&&t.clear()}},{key:"pullEntry",value:function(e,t){this._pullQueue.push({chrmId:e,timestamp:t}),this._startPull()}},{key:"setLocal",value:function(e,t,n){var r=this._storeCaches[e];js(r)||(r=new fp(e,n)),r.setEntries(t),this._storeCaches[e]=r}},{key:"getValue",value:function(e,t){var n=this._storeCaches[e];return n?n.getValue(t):null}},{key:"getVersion",value:function(e,t){var n=this._storeCaches[e];return n?n.getVersion(t):null}},{key:"getAll",value:function(e){var t=this._storeCaches[e],n={};return t&&(n=t.getAllValue()),n}}]),e}(),gp=function(){function e(t,n,r,i){a(this,e),this._runtime=t,this._appkey=n,this._userId=r,this._canJoinMulipleChrm=i,this._sessionKey="",this._joinedChrmsInfo={},this._sessionKey="sync-chrm-".concat(this._appkey,"-").concat(this._userId)}return u(e,[{key:"set",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;!this._canJoinMulipleChrm&&(this._joinedChrmsInfo={}),this._joinedChrmsInfo[e]=t,this._runtime.sessionStorage.setItem(this._sessionKey,JSON.stringify(this._joinedChrmsInfo))}},{key:"get",value:function(){var e,t;try{t=this._runtime.sessionStorage.getItem(this._sessionKey),e=JSON.parse(t||"{}")}catch(n){Js.error("parse rejoined chrm infos error -> ".concat(t)),e={}}return e}},{key:"remove",value:function(e){delete this._joinedChrmsInfo[e],js(this._joinedChrmsInfo)?this._runtime.sessionStorage.setItem(this._sessionKey,JSON.stringify(this._joinedChrmsInfo)):this.clear()}},{key:"clear",value:function(){this._joinedChrmsInfo={},this._runtime.sessionStorage.removeItem(this._sessionKey)}}]),e}(),pp="converStatusChanged",vp=function(){function e(t,n,r){a(this,e),this._eventEmitter=new na,this._pullQueue=[],this._isPulling=!1,this._storage=pn(t.runtime),this._appkey=n,this._currentUserId=r,this._engine=t,this._storagePullTimeKey="con-s-".concat(n,"-").concat(r)}var t;return u(e,[{key:"_set",value:function(e){var t=this;if(!qs(e)&&Array.isArray(e)){var n=this._storage.get(this._storagePullTimeKey)||0,r=e.length;e.forEach((function(e,i){var s=e.updatedTime||0;n=s>n?s:n,e.conversationType=e.type,t._eventEmitter.emit(pp,{statusItem:e,isLastPull:i===r-1})})),this._storage.set(this._storagePullTimeKey,n)}}},{key:"_startPull",value:(t=s(regeneratorRuntime.mark((function e(){var t,n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isPulling&&0!==this._pullQueue.length){e.next=2;break}return e.abrupt("return");case 2:return this._isPulling=!0,t=this._pullQueue.splice(0,1)[0],e.next=6,this._engine.pullConversationStatus(t);case 6:n=e.sent,r=n.code,i=n.data,r===aa.SUCCESS?(this._isPulling=!1,this._set(i),this._startPull()):this._startPull();case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"pull",value:function(e){var t=this._storage.get(this._storagePullTimeKey)||0;(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())}},{key:"watch",value:function(e){this._eventEmitter.on(pp,(function(t){e(t)}))}},{key:"unwatch",value:function(){this._eventEmitter.off(pp,(function(e){}))}}]),e}(),yp={c:{keyName:"unreadMessageCount",defaultVal:0},hm:{keyName:"hasMentioned",defaultVal:!1},m:{keyName:"mentionedInfo",defaultVal:null},t:{keyName:"lastUnreadTime",defaultVal:0},nc:{keyName:"notificationStatus",defaultVal:2},to:{keyName:"isTop",defaultVal:!1},tg:{keyName:"tags",defaultVal:{}},mc:{keyName:"unreadMentionedCount",defaultVal:0}},mp={};for(var _p in yp){var Ep=yp[_p].keyName;mp[Ep]=_p}var Tp,Rp=function(){function e(t,n,r){a(this,e),this._appkey=n,this._currentUserId=r;var i="con-".concat(n,"-").concat(r);this.storage=new yn(t,i),this._localStore=new yn(t,"CONVER-".concat(n,"-").concat(r))}return u(e,[{key:"_getStoreKey",value:function(e,t,n){return"".concat(n,"_").concat(e,"_").concat(t)}},{key:"_getConOptionByKey",value:function(e){var t=(e=e||"").split("_");if(t.length>=2){var n=t.shift(),r=t.shift(),i=t.join("_");return{conversationType:Number(r),targetId:i,channelId:n}}return{conversationType:Ms.PRIVATE,targetId:"",channelId:""}}},{key:"updateMentionedData",value:function(e){var t,n=this,r=e.conversationType,i=e.targetId,s=e.messageType,a=e.isMentioned,o=e.content,u=e.senderUserId,c=e.channelId,l=this._getStoreKey(r,i,c),h=this._localStore.get(l)||{},f=mp.mentionedInfo,d=mp.hasMentioned,g=h[f]||{},p=g.userIdList||[],v=o.mentionedInfo;if(v){if(a&&r===Ms.GROUP)(v.userIdList||[]).forEach((function(e){e===n._currentUserId&&p.indexOf(u)<0&&p.push(u)})),v.type===pa.ALL&&p.indexOf(u)<0&&p.push(u);if(s===ha.RECALL&&r===Ms.GROUP){var y=p.indexOf(u);y>=0&&p.splice(y,1)}v={userIdList:p,type:(null===(t=v)||void 0===t?void 0:t.type)||g.type},0!==p.length?(h[f]=v,h[d]=!0):(delete h[f],delete h[d]),js(h)?this._localStore.set(l,h):this._localStore.remove(l)}}},{key:"set",value:function(e,t,n,r){var i=this._getStoreKey(e,t,r),s=this._localStore.get(i)||{};for(var a in n){var o=mp[a],u=n[a];if(!qs(o)&&!qs(u)&&"hasMentioned"!==a&&"MentionedInfo"!==a){if(u===yp[o].defaultVal||"tags"===a&&!js(u))delete s[o];else if("tags"===a){var c=u;for(var l in c)c[l].isTop||delete c[l].isTop;s[o]=u}else s[o]=u;s.c||(delete s.t,delete s.hm,delete s.m,delete s.mc)}}js(s)?this._localStore.set(i,s):this._localStore.remove(i)}},{key:"get",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=this._getStoreKey(e,t,n),i=this._localStore.get(r)||{},s={};for(var a in yp){var o=yp[a],u=o.keyName,c=o.defaultVal;s[u]=i[a]||Co(c)}return s}},{key:"getValue",value:function(e){var t=this._localStore.getValues()||{},n=[];for(var r in t){var i=this._getConOptionByKey(r),s={conversationType:i.conversationType,targetId:i.targetId,channelId:i.channelId},a=t[r];for(var o in a){var u=yp[o],c=u.keyName,l=u.defaultVal;s[c]=a[o]||Co(l)}s=e?e(s):s,n.push(s)}return n}},{key:"getValueForTag",value:function(){var e=this._localStore.getValues()||{},t={};for(var n in e){var r=this._getConOptionByKey(n),i=r.conversationType,s=r.targetId,a={},o=e[n];for(var u in o){var c=yp[u],l=c.keyName,h=c.defaultVal;a[l]=o[u]||Co(h)}for(var f in a.tags){qs(t[f])&&(t[f]=[]);var d=Object.assign({},a,{conversationType:i,targetId:s});delete d.tags,t[f].push(d)}}return t}},{key:"adaptOldStore",value:function(){try{var e=this.storage.getValues();if(0===Object.keys(e).length)return;for(var t in e){var n="_".concat(t);this._localStore.set(n,e[t])}}catch(e){Js.error("adaptOldStore error: ".concat(e.message))}}}]),e}(),Ip=[Ms.PRIVATE,Ms.GROUP,Ms.SYSTEM,Ms.PUBLIC_SERVICE,Ms.APP_PUBLIC_SERVICE],Cp="conversationChanged",Sp="conTagStatusChanged",bp=function(){function e(t,n,r,i,s){var o=this;a(this,e),this._updatedConversations={},this._conTagStatusChanged=!1,this._eventEmitter=new na,this._draftMap={},this._appkey=n,this._loginUserId=r,this._store=new Rp(t.runtime,n,r),this._statusManager=new vp(t,n,r),this._statusManager.watch((function(e){var t=e.statusItem,n=e.isLastPull;o.addStatus(t,n)})),this._eventEmitter.on(Cp,(function(e){i(e)})),this._eventEmitter.on(Sp,(function(){s()}))}return u(e,[{key:"_calcUnreadCount",value:function(e,t){var n=e.content,r=e.messageType,i=e.sentTime,s=e.isCounted,a=e.messageDirection,o=e.senderUserId,u=a===ia.SEND&&o===this._loginUserId,c=r===ha.RECALL,l=Gs(n),h=!1,f={},d=t.lastUnreadTime||0,g=t.unreadMessageCount||0;if(d>i||u)return{hasChanged:h,localConversation:t,updateItems:f};(s&&(t.unreadMessageCount=g+1,t.lastUnreadTime=i,h=!0),c&&l)&&(d>=n.sentTime&&g&&(t.unreadMessageCount=g-1,h=!0));return h&&(f.unreadMessageCount={val:t.unreadMessageCount,time:i}),{hasChanged:h,localConversation:t,updateItems:f}}},{key:"_calcMentionedInfo",value:function(e,t){var n=e.content,r=(e.messageDirection,e.isMentioned),i=e.sentTime;ia.SEND;var s=Gs(n),a=!1,o={};return r&&s&&n.mentionedInfo&&(t.hasMentioned=!0,a=!0,o.hasMentioned={val:!0,time:i},o.mentionedInfo={val:n.mentionedInfo,time:i}),{hasChanged:a,localConversation:t,updateItems:o}}},{key:"_calcMentionedCount",value:function(e,t){var n=e.content,r=e.messageDirection,i=!1;if(e.isMentioned&&r===ia.RECEIVE&&null!=n&&n.mentionedInfo){var s=n.mentionedInfo,a=s.type,o=s.userIdList;if(a===pa.ALL||(o||[]).includes(this._loginUserId)){i=!0;var u=t.unreadMentionedCount||0;t.unreadMentionedCount=u+1}}return{hasChanged:i,localConversation:t}}},{key:"_setUpdatedConversation",value:function(e){if(Gs(e)){var t=e.conversationType,n=e.targetId,r=e.channelId,i="".concat(t,"_").concat(n),s=this._store.get(t,n,r)||{};this._updatedConversations[i]=Object.assign(s,e)}}},{key:"_setConTagStatusChanged",value:function(e,t,n,r){var i=(this._store.get(e,t,r)||{}).tags||{};if(Object.keys(i).length===Object.keys(n).length){for(var s in i)if(!n[s]||i[s].isTop!==n[s].isTop)return void(this._conTagStatusChanged=!0)}else this._conTagStatusChanged=!0}},{key:"addStatus",value:function(e,t){var n=e.conversationType,r=e.targetId,i=e.updatedTime,s=e.notificationStatus,a=e.isTop,o=e.tags,u=e.channelId,c={},l={};n!==Ms.ULTRA_GROUP&&(qs(s)||(l.notificationStatus={time:i,val:s}),qs(a)||(l.isTop={time:i,val:a}),qs(o)||(l.tags={time:i,val:o},null==o||o.forEach((function(e){c[e.tagId]={isTop:e.isTop}}))),this._setConTagStatusChanged(n,r,c,u),this._store.set(n,r,{notificationStatus:s,isTop:a,tags:c},u),this._setUpdatedConversation({conversationType:n,targetId:r,updatedItems:l,channelId:u}),t&&this._notifyConversationChanged())}},{key:"_notifyConversationChanged",value:function(){var e=[];for(var t in this._updatedConversations)e.push(this._updatedConversations[t]);0!==e.length&&(this._eventEmitter.emit(Cp,e),this._updatedConversations={},this._conTagStatusChanged&&(this._eventEmitter.emit(Sp),this._conTagStatusChanged=!1))}},{key:"setConversationCacheByMessage",value:function(e,t){var n=this,r=e.conversationType,i=e.isPersited,s=e.targetId,a=e.channelId;if(Ip.indexOf(r)>=0){var o=!1,u=this._store.get(r,s,a),c={};if([this._calcUnreadCount,this._calcMentionedInfo,this._calcMentionedCount].forEach((function(t){var r=t.call(n,e,u),i=r.hasChanged,s=r.localConversation,a=r.updateItems;o=o||i,c=h(h({},c),a),u=Co(s)})),o&&this._store.set(r,s,u,a),this._store.updateMentionedData(e),i){var l=this._store.get(r,s,a);l.updatedItems=h({latestMessage:{time:e.sentTime,val:e}},c),l.latestMessage=e;var f=Object.assign(l,{conversationType:r,targetId:s,channelId:a});this._setUpdatedConversation(f)}(o||i)&&this._notifyConversationChanged()}}},{key:"get",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this._store.get(e,t,n)}},{key:"getAllUnreadCount",value:function(e,t,n){var r=this._store.getValue(),i=0;return r.forEach((function(e){var r=e.unreadMessageCount,s=e.notificationStatus,a=e.conversationType;r=r||0,(n||1!==s)&&(t.length>0?t.includes(Number(a))&&(i+=Number(r)):i+=Number(r))})),i}},{key:"getUnreadCountByTag",value:function(e,t){var n=this._store.getValueForTag()[e]||[],r=0;return n.forEach((function(e){var n=e.unreadMessageCount,i=e.notificationStatus;(t||1!==i)&&(n=n||0,r+=Number(n))})),r}},{key:"getUnreadCount",value:function(e,t,n){return this._store.get(e,t,n).unreadMessageCount||0}},{key:"clearUnreadCount",value:function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=this._store.get(e,t,n),s=i.unreadMessageCount,a=i.hasMentioned,o={};if(s&&(i.unreadMessageCount=0,o.unreadMessageCount={val:0,time:Date.now()}),a&&(i.hasMentioned=!1,i.unreadMentionedCount=0,i.mentionedInfo=void 0,o.hasMentioned={val:!1,time:Date.now()},o.mentionedInfo={val:void 0,time:Date.now()}),this._store.set(e,t,i,n),r&&0!==Object.keys(o).length){var u=Object.assign(i,{conversationType:e,targetId:t,channelId:n,updatedItems:o});this._setUpdatedConversation(u),this._notifyConversationChanged()}}},{key:"clearAllUnreadCount",value:function(){var e=this;this._store.getValue().forEach((function(t){t.unreadMessageCount&&(t.unreadMessageCount=0,e._store.set(t.conversationType,t.targetId,t,t.channelId))}))}},{key:"startPullConversationStatus",value:function(e){this._statusManager.pull(e)}},{key:"setDraft",value:function(e,t,n,r){var i="".concat(e,"_").concat(t,"_").concat(r);this._draftMap[i]=n}},{key:"getDraft",value:function(e,t,n){var r="".concat(e,"_").concat(t,"_").concat(n);return this._draftMap[r]}},{key:"clearDraft",value:function(e,t,n){var r="".concat(e,"_").concat(t,"_").concat(n);delete this._draftMap[r]}},{key:"addTagStatus",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=this._store.get(e,t,r),s=i.tags;s=Object.assign(s,n),this._store.set(e,t,{tags:s},r)}},{key:"deleteTagStatus",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",i=this._store.get(e,t,r),s=i.tags;n.forEach((function(e){delete s[e]})),this._store.set(e,t,{tags:s},r)}},{key:"getConversationListForTag",value:function(){return this._store.getValueForTag()}},{key:"getBlockConversationList",value:function(){return this._store.getValue().filter((function(e){return e.notificationStatus===da.OPEN})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}}))}},{key:"getTopConversationList",value:function(){return(this._store.getValue()||{}).filter((function(e){return e.isTop})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}}))}},{key:"adaptOldStore",value:function(){this._store.adaptOldStore()}},{key:"getUnreadMentionedCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=this.get(t,n,e);return r.unreadMentionedCount||0}},{key:"getAllUnreadMentionedCount",value:function(){var e=this._store.getValue(),t=0;return e.forEach((function(e){var n=e.unreadMentionedCount;n=n||0,t+=Number(n)})),t}},{key:"getAllConversationState",value:function(){return this._store.getValue().filter((function(e){return e.unreadMessageCount||e.unreadMentionedCount})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,unreadCount:e.unreadMessageCount||0,unreadMentionedCount:e.unreadMentionedCount||0}}))}}]),e}(),wp=function(){function e(t,n,r,i){a(this,e),this._pullQueue=[],this._isPulling=!1,this._storageTagKey="tag-".concat(n,"-").concat(r),this._storagePullTimeKey="us-s-".concat(n,"-").concat(r),this._storage=pn(t.runtime),this._engine=t,this._tagWatcherFunc=i}var t;return u(e,[{key:"_updateTag",value:function(e){var t=e.tags,n={};t.forEach((function(e){n[e.tagId]={tagName:e.tagName,createdTime:e.createdTime}})),this._storage.set(this._storageTagKey,n),this._tagWatcherFunc()}},{key:"addTag",value:function(e,t){var n=this._storage.get(this._storageTagKey)||{};e.forEach((function(e){var t,r=(null===(t=n[e.tagId])||void 0===t?void 0:t.createdTime)||e.createdTime||0;n[e.tagId]={tagName:e.tagName,createdTime:r}})),this._storage.set(this._storageTagKey,n),this._storage.set(this._storagePullTimeKey,t)}},{key:"deleteTag",value:function(e,t){var n=this._storage.get(this._storageTagKey)||{};e.forEach((function(e){delete n[e]})),this._storage.set(this._storageTagKey,n),this._storage.set(this._storagePullTimeKey,t)}},{key:"getTagsInfo",value:function(){return this._storage.get(this._storageTagKey)||{}}},{key:"getTags",value:function(){var e=this._storage.get(this._storageTagKey)||{},t=[];for(var n in e)t.push({tagId:n,tagName:e[n].tagName,createdTime:e[n].createdTime,conversationCount:0});return t.sort((function(e,t){return(e.createdTime||0)-(t.createdTime||0)}))}},{key:"getTagById",value:function(e){var t=this._storage.get(this._storageTagKey)||{};return t[e]?{tagId:e,tagName:t[e].tagName,createdTime:t[e].createdTime,conversationCount:0}:null}},{key:"_startPull",value:(t=s(regeneratorRuntime.mark((function e(){var t,n,r,i,s,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isPulling&&0!==this._pullQueue.length){e.next=2;break}return e.abrupt("return");case 2:return this._isPulling=!0,t=this._pullQueue.splice(0,1)[0],e.next=6,this._engine.pullUserSettings(t);case 6:n=e.sent,r=n.code,i=n.data,r!==aa.SUCCESS||qs(i)?(this._isPulling=!1,this._startPull()):(s=i.settings,a=i.version,o=s.Tag,qs(o)||this._updateTag(o),this._storage.set(this._storagePullTimeKey,a),this._isPulling=!1,this._startPull());case 10:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"pullUserSettings",value:function(e){var t=this._storage.get(this._storagePullTimeKey)||0;(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())}},{key:"getVersion",value:function(){return this._storage.get(this._storagePullTimeKey)||0}}]),e}(),Op=function(e){f(i,e);var t,n,r=T(i);function i(e,t){var n;return a(this,i),(n=r.call(this,e,t))._miniConnectUrl="",n._connectType=t.connectionType,n}return u(i,[{key:"_formatJSONPUrl",value:function(e,t,n,r){var i=this._runtime.isSupportSocket()&&"websocket"===this._connectType?"navi":"cometnavi";return"".concat(e,"/").concat(i,".js?appId=").concat(n,"&token=").concat(encodeURIComponent(t),"&callBack=").concat(r,"&v=").concat(this._apiVersion,"&r=").concat(Date.now())}},{key:"getInfo",value:(n=s(regeneratorRuntime.mark((function e(t,n,r){var s,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._runtime.useNavi||(a=this._runtime.isSupportSocket()&&"websocket"===this._connectType?on.join(","):un.join(","),this._miniConnectUrl=null!==(s=this._options.miniCMPProxy)&&void 0!==s&&s.length?this._options.miniCMPProxy.join(","):a||"",n=[]),e.abrupt("return",R(d(i.prototype),"getInfo",this).call(this,t,n,r));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"_reqNavi",value:(t=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u,c,l,h,f,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i="getServerEndpoint",s=0,a=t.length;case 2:if(!(s<a)){e.next=28;break}return o=this._formatJSONPUrl(t[s],r,n,i),Js.debug("req navi => ".concat(o)),e.next=7,this._runtime.httpReq({url:o,timeout:1e4,dataType:"text"});case 7:if(200===(u=e.sent).status){e.next=11;break}return 403===u.status?Js.error("request navi error: "+aa.RC_CONN_USER_OR_PASSWD_ERROR):401===u.status&&Js.error("request navi error: "+aa.RC_CONN_APP_BLOCKED_OR_DELETED),e.abrupt("continue",25);case 11:return e.prev=11,c=u.data.match(/{[\d\D]+}/),0===(l=c&&c[0]?c[0]:"").indexOf('{\\"code\\":')&&(l=JSON.parse('"'+l+'"')),h=JSON.parse(l),f=/^https/.test(o)?"https":"http",h.protocol=f,this._runtime.useNavi||(h.server="",h.backupServer=this._miniConnectUrl,h.logSwitch=0),e.abrupt("return",h);case 22:e.prev=22,e.t0=e.catch(11),Js.error("parse navi err =>",e.t0);case 25:s+=1,e.next=2;break;case 28:if(this._runtime.useNavi){e.next=31;break}return d={code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,uploadServer:"https://upload.qiniup.com",bosAddr:"https://gz.bcebos.com",location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:0,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:this._miniConnectUrl},e.abrupt("return",d);case 31:return e.abrupt("return",null);case 32:case"end":return e.stop()}}),e,this,[[11,22]])}))),function(e,n,r){return t.apply(this,arguments)})}]),i}(Qg),Np=function(){function e(t){a(this,e),this._pullQueue=[],this._isPulling=!1,this._pullTime=0,this._engine=t}var t;return u(e,[{key:"_startPull",value:(t=s(regeneratorRuntime.mark((function e(){var t,n,r,i,s,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._isPulling&&0!==this._pullQueue.length){e.next=2;break}return e.abrupt("return");case 2:if(this._isPulling=!0,t=this._pullQueue.splice(0,1)[0],n=t.roomId,r=t.timestamp,!((i=this._pullTime)>r)){e.next=9;break}return this._isPulling=!1,this._startPull(),e.abrupt("return");case 9:return e.next=11,this._engine.pullRTCRoomEntry(n,i);case 11:s=e.sent,a=s.code,o=s.data,a===aa.SUCCESS?(this._isPulling=!1,this._pullTime=o.syncTime||0,this._startPull()):this._startPull();case 15:case"end":return e.stop()}}),e,this)}))),function(){return t.apply(this,arguments)})},{key:"pullEntry",value:function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()}},{key:"reset",value:function(){this._pullTime=0,this._isPulling=!1}}]),e}(),kp=function(e,t){return["send_msg",e,t].join("_")},Mp=function(){function e(t,n){a(this,e),this._runtime=t,this._appkey=n,this._sendMessageMap={},this._userId=""}return u(e,[{key:"init",value:function(e){this._userId=e;var t=kp(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)}},{key:"_getLocalInfo",value:function(e){var t=this._runtime.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}}},{key:"setMessage",value:function(e,t){this._sendMessageMap[e]=t;var n=kp(this._appkey,this._userId),r=this._getLocalInfo(n);r[e]=t,this._runtime.localStorage.setItem(n,JSON.stringify(r))}},{key:"getSendMessageMap",value:function(){return this._sendMessageMap}},{key:"removeByUID",value:function(e){delete this._sendMessageMap[e]}},{key:"removeByTimestamp",value:function(e){var t=kp(this._appkey,this._userId),n=this._getLocalInfo(t);Object.keys(n).forEach((function(t){n[t]<e&&delete n[t]})),this._runtime.localStorage.setItem(t,JSON.stringify(n))}}]),e}(),Ap=function(e){var t="RCDeviceId",n=pn(e),r="",i=n.get(t);return i?r=i:(r=Ns(),n.set(t,r)),r};c(Tp={},Ms.PRIVATE,kg.qryPMsg),c(Tp,Ms.GROUP,kg.qryGMsg),c(Tp,Ms.CHATROOM,kg.qryCHMsg),c(Tp,Ms.CUSTOMER_SERVICE,kg.qryCMsg),c(Tp,Ms.SYSTEM,kg.qrySMsg);var Up=[kg[kg.recallMsg],kg[kg.ppMsgS],kg[kg.pgMsgS],kg[kg.ppMsgP],kg[kg.pgMsgP],kg[kg.chatMsg],kg[kg.pcMsgP],kg[kg.prMsgS],kg[kg.updUgRTime]],Lp=function(e){var t;return(t={},c(t,Ms.PRIVATE,kg.ppMsgP),c(t,Ms.GROUP,kg.pgMsgP),c(t,Ms.CHATROOM,kg.chatMsg),c(t,Ms.CUSTOMER_SERVICE,kg.pcMsgP),c(t,Ms.RTC_ROOM,kg.prMsgS),t)[e]},xp=function(e,t,r,i,s,a){return{conversationType:e,targetId:t,senderUserId:a,messageDirection:ia.SEND,isCounted:!!r.isCounted,isMentioned:!!r.isMentioned,content:r.content,messageType:r.messageType,isOffLineMessage:!1,isPersited:!!r.isPersited,messageUId:i,sentTime:s,receivedTime:0,disableNotification:!!r.disableNotification,isStatusMessage:!!r.isStatusMessage,canIncludeExpansion:!!r.canIncludeExpansion,expansion:r.canIncludeExpansion?r.expansion:null,receivedStatus:n.UNREAD,pushConfig:r.pushConfig,channelId:r.channelId,isInterrupt:r.isInterrupt}},Pp=function(e,t){return"RC:SRSMsg"===e.messageType&&Object.assign(e,{directionalUserIdList:[t]}),e},Dp=function(e){return e.sort((function(e,t){var n,r,i=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-i}))},Vp=function(t){f(je,t);var n,r,i,o,l,d,g,p,v,y,m,E,R,S,b,w,O,N,k,M,A,U,L,x,P,D,V,B,G,F,q,K,j,H,Y,Q,W,J,z,Z,X,$,ee,te,ne,re,ie,se,ae,oe,ue,ce,le,he,fe,de,ge,pe,ve,ye,me,_e,Ee,Te,Re,Ie,Ce,Se,be,we,Oe,Ne,ke,Me,Ae,Ue,Le,xe,Pe,De,Ve,Be,Ge,Fe,qe,Ke=T(je);function je(e,t,n){var r;return a(this,je),(r=Ke.call(this,e,t,n))._customMessageType={},r._reconnectTimer=-1,r._pullOfflineFinished=!1,r._connectedTime=0,r._localConnectedTime=0,r._status=ua.DISCONNECTED,r._pullingMsg=!1,r._pullQueue=[],r._chrmsQueue={},r._latestSyncTimestamp=0,r._intervalTimer=-1,r._pullChatroomEntryTimestamp=0,r._lastSyncUltraMsgTimeStamp=0,r._lastSyncUltraMsgLocalTimeStamp=0,r._ultraGroupTimer=-1,r._isUltraPulling=!1,r._ultraGroupTimeQue=[],r._isUltraGroupListExist=!1,r._ultraGroupMap={},r._firstPullUltraGroupTime=0,r._ultraMsgMap={},r._pullUltraChangeMessageQue=[],r._isPullingUltraChangeMessage=!1,r._lastPullingUltraChangeMessageTime=0,r._ultraMsgChangeMap={},r._letterbox=new lp(e,n.appkey),r._sendMessageStore=new Mp(e,n.appkey),r._chrmEntryHandler=new dp(_(r)),r}return u(je,[{key:"_createNavi",value:function(){return new Op(this.runtime,this._options)}},{key:"getConnectedTime",value:function(){return this._connectedTime}},{key:"connect",value:(qe=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o,u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=[],this._naviInfo=n,n.server?r.push(n.server):Js.warn("navi.server is invalid"),(i=n.backupServer)&&i.split(",").forEach((function(e){r.indexOf(e)<0&&r.push(e)})),0!==r.length){e.next=8;break}return Js.error("navi invaild.",r),e.abrupt("return",aa.UNKNOWN);case 8:return s=this.runtime.createDataChannel({status:function(e){u._connectionStatusHandler(e,t,r,n.protocol)},signal:this._signalHandler.bind(this)},this._options.connectionType),a=zl.V3,1===n.openAnti&&(a=zl.V4),e.next=13,s.connect(this._appkey,t,r,n.protocol,this._apiVer,a);case 13:return(o=e.sent)===aa.SUCCESS?(this._channel=s,this.currentUserId=s.userId,this._connectedTime=s.connectedTime,this._localConnectedTime=Math.floor((Date.now()+s.sendConnectTime)/2),this._watcher.status(ua.CONNECTED),this._status=ua.CONNECTED,this._pullOfflineFinished=!1,this._conversationManager=new bp(this,this._appkey,this.currentUserId,this._watcher.conversation,this._watcher.conversationTag),this._conversationManager.startPullConversationStatus(0),this._userSettingManager=new wp(this,this._appkey,this.currentUserId,this._watcher.tag),this._userSettingManager.pullUserSettings(0),this._sendMessageStore.init(this.currentUserId),this._conversationManager.adaptOldStore(),this._rtcKVManager=new Np(this),this._joinedChrmManager=new gp(this.runtime,this._appkey,this.currentUserId,n.joinMChrm),this._startSyncInterval(),1===n.ugMsg&&this._startUltraSyncInterval()):s.close(),e.abrupt("return",o);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return qe.apply(this,arguments)})},{key:"_connectionStatusHandler",value:function(e,t,n,r){if(Js.warn("connection status changed:",e),this._status=e,e!==ua.CONNECTING)if(e!==ua.CONNECTED){if(this._channel&&e!==ua.DISCONNECTED)return e===ua.BLOCKED||e===ua.KICKED_OFFLINE_BY_OTHER_CLIENT||e===ua.DISCONNECT_BY_SERVER?(this.disconnect(),void this._watcher.status(e)):void(e!==ua.REDIRECT?(this._watcher.status(e),this._try2Reconnect(t,n,r)):this._watcher.status(e));this._watcher.status(e)}else this._watcher.status(e);else this._watcher.status(e)}},{key:"_try2Reconnect",value:(Fe=s(regeneratorRuntime.mark((function e(t,n,r){var i,s=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return");case 2:return i=zl.V3,1===this._naviInfo.openAnti&&(i=zl.V4),e.next=6,this._channel.connect(this._appkey,t,n,r,this._apiVer,i);case 6:if(e.sent!==aa.SUCCESS){e.next=16;break}return this._pullOfflineFinished=!1,this._startSyncInterval(),this._watcher.status(ua.CONNECTED),this._status=ua.CONNECTED,this._startUltraSyncInterval(),this._rejoinChrm(),Js.__insertLogIntoDatabase(),e.abrupt("return");case 16:this._watcher.status(ua.WEBSOCKET_UNAVAILABLE),this._status=ua.WEBSOCKET_UNAVAILABLE,this._reconnectTimer=setTimeout((function(){s._reconnectTimer=-1,s._try2Reconnect(t,n,r)}),5e3);case 19:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return Fe.apply(this,arguments)})},{key:"_signalHandler",value:function(e,t){var n=e.syncMsg,r=e.topic;if(n)this._receiveSyncMsg(e,t);else{var i=kg[r];if(i)switch(i){case kg.s_ntf:Js.info("recv s_ntf -> signal.messageId: ".concat(e.messageId)),this._pullMsg(e);break;case kg.s_msg:this._receiveMsg(e);break;case kg.s_cmd:this._receiveStateNotify(e);break;case kg.s_us:this._receiveSettingNotify(e);break;case kg.rtc_ntf:this._receiveRtcKv(e);break;case kg.s_opNtf:this._pullOperateStatusNotify(e)}else Js.error("unknown topic:",r)}}},{key:"_receiveStateNotify",value:function(e){var t,n=null===(t=this._channel)||void 0===t?void 0:t.codec.decodeByPBName(e.data,Oh),r=n.time,i=n.type,s=n.chrmId;switch(i){case 2:this._chrmEntryHandler.pullEntry(s,r);break;case 3:this._conversationManager.startPullConversationStatus(r);break;case 4:this._chrmEntryHandler.reset(s),this._watcher.chatroom({chatroomDestroyed:e.targetId});break;case 6:this._ultraGroupTimeQue.push(r),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp);break;case 7:this._pullUltraChangeMessageQue.push(r),this._pullUltraChangeMessageList(this._lastPullingUltraChangeMessageTime)}}},{key:"_receiveSettingNotify",value:function(e){var t,n=(null===(t=this._channel)||void 0===t?void 0:t.codec.decodeByPBName(e.data,bf)).version;this._userSettingManager.pullUserSettings(n)}},{key:"_receiveRtcKv",value:function(e){var t,n=null===(t=this._channel)||void 0===t?void 0:t.codec.decodeByPBName(e.data,nd),r=n.time,i=n.type,s=n.roomId;switch(i){case 1:this._rtcKVManager.pullEntry(s,r)}}},{key:"_receiveMessageExpansion",value:function(e){var t=e.content,n=t.put,r=t.del,i=t.mid;n&&this._watcher.expansion({updatedExpansion:{messageUId:i,expansion:n}}),r&&this._watcher.expansion({deletedExpansion:{messageUId:i,deletedKeys:r}})}},{key:"_receiveSyncMsg",value:function(e,t){var n;if(Up.includes(e.topic)){if(e.topic===kg[kg.updUgRTime]){var r,i=null===(r=this._channel)||void 0===r?void 0:r.codec.decodeByPBName(e.data,Bh),s=i.channelId,a=i.busChannel,o=this._ultraGroupMap[a+"_"+s];return o&&(o.unreadMessageCount=0,o.unreadMentionedCount=0,o.lastReadTime=t.timestamp,this._watcher.conversation(No([o]))),void(t&&(this._ultraMsgMap[t.messageUId]=t.timestamp))}var u=null===(n=this._channel)||void 0===n?void 0:n.codec.decodeByPBName(e.data,Eh,{currentUserId:this.currentUserId,signal:e});u=this._handleMsgProperties(u),t&&(u.sentTime=t.timestamp,u.messageUId=t.messageUId),this._pullingMsg?this._pullQueue.push((null==t?void 0:t.timestamp)||u.sentTime):(t&&this._sendMessageStore.setMessage(t.messageUId,t.timestamp),u.messageType!==ha.EXPANSION_NOTIFY?(u.messageType===ha.SYNC_READ_STATUS&&this._conversationManager.clearUnreadCount(u.conversationType,u.targetId,u.channelId),this._conversationManager.setConversationCacheByMessage(u,!0),this._watcher.batchMessage([u])):this._receiveMessageExpansion(u))}}},{key:"_pullMsg",value:function(e){if(this._channel){var t=this._channel.codec.decodeByPBName(e.data,Oh),n=t.type,r=t.chrmId,i=t.time;if(Js.info("s_ntf -> type: ".concat(n,", chrmId: ").concat(r,", time: ").concat(i)),2===n){var s=this._chrmsQueue[r];if(!s)return;s.queue.push(i),this._pullChrmMsg(r)}else this._pullQueue.push(i),this._syncMsg()}}},{key:"_startSyncInterval",value:function(){var e=this;this._stopSyncInterval();this._intervalTimer=setInterval((function(){Date.now()-e._latestSyncTimestamp>=18e4&&e._syncMsg()}),3e4),this._latestSyncTimestamp=Date.now(),this._syncMsg()}},{key:"_stopSyncInterval",value:function(){-1!==this._intervalTimer&&(clearInterval(this._intervalTimer),this._intervalTimer=-1)}},{key:"_syncMsg",value:(Ge=s(regeneratorRuntime.mark((function e(){var t,n,r,i,s,a,o,u,c,l,h,f,d,g,p,v,y=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._pullingMsg){e.next=2;break}return e.abrupt("return");case 2:if(this._channel){e.next=5;break}return this._pullingMsg=!1,e.abrupt("return");case 5:return this._pullingMsg=!0,n=this._letterbox.getOutboxTime(this.currentUserId),r=this._letterbox.getInboxTime(this.currentUserId),i=this._letterbox.getBroadcastSyncTime(this.currentUserId),Js.info("pullMsg -> sendboxTime: ".concat(n,", inboxTime: ").concat(r,", broadcastSyncTime: ").concat(i)),s=this._channel.codec.encodeSyncMsg({sendboxTime:n,inboxTime:r,broadcastSyncTime:i}),a=new Eg(kg[kg.pullMsg],s,this.currentUserId),e.next=14,this._channel.send(a,Ih,{connectedTime:this._channel.connectedTime,currentUserId:this.currentUserId});case 14:if(o=e.sent,u=o.code,c=o.data,this._latestSyncTimestamp=Date.now(),u===aa.SUCCESS&&c&&!qs(c.finished)&&!qs(c.list)&&!qs(c.syncTime)){e.next=22;break}return Js.warn("pullMsg failed -> code:",u,", data: ",c),this._pullingMsg=!1,e.abrupt("return");case 22:l=c.list,h=c.finished,f=c.syncTime,d=c.broadcastSyncTime,Js.info("pullMsg success -> syncTime: ".concat(f,", finished: ").concat(h)),g=0,p=[],l.forEach((function(e){if(e.messageDirection===ia.SEND&&(g=Math.max(e.sentTime,g),y._sendMessageStore.getSendMessageMap()[e.messageUId]))y._sendMessageStore.removeByUID(e.messageUId);else if(e.messageType!==ha.EXPANSION_NOTIFY){if(e.messageType===ha.SYNC_READ_STATUS){if(e.senderUserId!==y.currentUserId)return;y._conversationManager.clearUnreadCount(e.conversationType,e.targetId,e.channelId)}var t=y._handleMsgProperties(e);y._conversationManager.setConversationCacheByMessage(t,!0),p.push(t)}else y._receiveMessageExpansion(e)})),this._watcher.batchMessage(p),this._letterbox.setInboxTime(f,this.currentUserId),this._letterbox.setOutboxTime(g,this.currentUserId),this._letterbox.setBroadcastSyncTime(d,this.currentUserId),this._sendMessageStore.removeByTimestamp(g),this._pullingMsg=!1,v=this._pullQueue.filter((function(e){return e>f})),this._pullQueue.length=0,(t=this._pullQueue).push.apply(t,C(v)),h&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this._watcher.pullFinished()),(!h||v.length>0)&&this._syncMsg();case 38:case"end":return e.stop()}}),e,this)}))),function(){return Ge.apply(this,arguments)})},{key:"_receiveMsg",value:function(e){if(this._channel){var t=this._channel.codec.decodeByPBName(e.data,Rh,{currentUserId:this.currentUserId,connectedTime:this._channel.connectedTime});if((t=this._handleMsgProperties(t)).conversationType!==Ms.RTC_ROOM){if(this._pullingMsg)return;if(this._pullQueue.length>0)return void this._syncMsg()}t.senderUserId===this.currentUserId&&this._sendMessageStore.setMessage(t.messageUId,t.sentTime),t.isStatusMessage||t.senderUserId===this.currentUserId||this._letterbox.setInboxTime(t.sentTime,this.currentUserId),t.messageType!==ha.EXPANSION_NOTIFY?t.messageType===ha.SYNC_READ_STATUS&&t.senderUserId!==this.currentUserId||(this._conversationManager.setConversationCacheByMessage(t,!0),this._watcher.batchMessage([t])):this._receiveMessageExpansion(t)}}},{key:"_handleMsgProperties",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=e.messageType,i=e.isCounted,s=e.isPersited,a=e.isStatusMessage,o=r in dn,u=r in this._customMessageType;if(t=o?h(h({},dn[r]),{},{isStatusMessage:gn.includes(r)}):u?this._customMessageType[r]:{isCounted:!Ks(i)&&i,isPersited:!Ks(s)&&s,isStatusMessage:!1},Object.assign(e,t),n&&!qs(a)&&(e.isStatusMessage=a),!n){var c=e.content.user;if(c){var l=c.portrait,f=c.portraitUri,d=l||f;d&&(c.portrait=c.portraitUri=d)}}return e}},{key:"getHistoryMessage",value:(Be=s(regeneratorRuntime.mark((function e(t,n,r,i,s){var a,o,u,c,l,h,f,d,g,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=p.length>5&&void 0!==p[5]?p[5]:"",o=this.currentUserId,u=this._channel,c=Zd[t]||Hd,l=1===i&&0===r,!u){e.next=15;break}return h=u.codec.encodeGetHistoryMsg(n,{timestamp:r,count:l?2:i,order:s,channelId:a}),e.next=8,u.send(new Eg(c,h,o),kh,{currentUserId:o,connectedTime:u.connectedTime,conversation:{targetId:n}});case 8:if(f=e.sent,(d=f.code)===aa.SUCCESS){e.next=12;break}return e.abrupt("return",{code:d});case 12:return g=f.data,l&&2===g.list.length&&(g.hasMore=!0,0===s?g.list.shift():g.list.pop()),e.abrupt("return",{code:d,data:{list:g.list,hasMore:g.hasMore}});case 15:return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 16:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return Be.apply(this,arguments)})},{key:"reportSDKInfo",value:function(e){var t=this.currentUserId,n=this._channel;if(n){Js.info("reportSDKInfo ->",e);var r=n.codec.encodeReportSDKInfo(JSON.stringify(e)),i=new Eg(kg[kg.reportsdk],r,t);n.send(i).then((function(e){var t=e.code;t!==aa.SUCCESS&&Js.warn("reportSDKInfo failed -> code: ".concat(t))}))}}},{key:"deleteRemoteMessage",value:(Ve=s(regeneratorRuntime.mark((function e(t,n,r,i){var s,a,o,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=this.currentUserId,!(a=this._channel)){e.next=11;break}return o=a.codec.encodeDeleteMessages(t,n,r,i),u=new Eg(Ud,o,s),e.next=6,a.send(u);case 6:if(c=e.sent,(l=c.code)===aa.SUCCESS){e.next=10;break}return e.abrupt("return",l);case 10:return e.abrupt("return",l);case 11:return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return Ve.apply(this,arguments)})},{key:"deleteRemoteMessageByTimestamp",value:(De=s(regeneratorRuntime.mark((function e(t,n,r,i){var s,a,o,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=this.currentUserId,!(a=this._channel)){e.next=12;break}return o=a.codec.encodeClearMessages(n,r,i,t),u=new Eg(Xd[t],o,s),e.next=7,a.send(u);case 7:if(c=e.sent,(l=c.code)===aa.SUCCESS){e.next=11;break}return e.abrupt("return",l);case 11:return e.abrupt("return",l);case 12:return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return De.apply(this,arguments)})},{key:"getConversationList",value:(Pe=s(regeneratorRuntime.mark((function e(){var t,n,r,i,s,a,o,u,c,l,h,f=this,d=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=d.length>0&&void 0!==d[0]?d[0]:300,n=d.length>1?d[1]:void 0,r=d.length>2?d[2]:void 0,i=d.length>3?d[3]:void 0,s=this.currentUserId,a=this._channel,n=n||Ms.PRIVATE,!a){e.next=17;break}return o=a.codec.encodeOldConversationList({count:t,type:n,startTime:r,order:i}),u=new Eg(Fd,o,s),e.next=12,a.send(u,Ah,{currentUserId:s,connectedTime:a.connectedTime,afterDecode:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=f._conversationManager.get(t,n,r);return Object.assign(e,i),e}});case 12:if(c=e.sent,l=c.code,h=c.data,l===aa.SUCCESS){e.next=16;break}return e.abrupt("return",{code:l});case 16:return e.abrupt("return",{code:l,data:null==h?void 0:h.list});case 17:return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 18:case"end":return e.stop()}}),e,this)}))),function(){return Pe.apply(this,arguments)})},{key:"removeConversation",value:(xe=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(i=this._channel)){e.next=12;break}return s=i.codec.encodeRemoveOldConversationList({conversationType:t,channelId:r,targetId:n}),a=new Eg(qd,s,n),e.next=6,i.send(a);case 6:if(o=e.sent,Js.info("RemoveConversation =>",o),(u=o.code)===aa.SUCCESS){e.next=11;break}return e.abrupt("return",u);case 11:return e.abrupt("return",u);case 12:return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return xe.apply(this,arguments)})},{key:"getConversation",value:(Le=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==Ms.ULTRA_GROUP){e.next=6;break}if(i=this._ultraGroupMap[r+"_"+n]){e.next=4;break}return e.abrupt("return",{code:aa.CONVER_GET_ERROR});case 4:e.next=18;break;case 6:if(s=this._conversationManager.get(t,n,r)){e.next=9;break}return e.abrupt("return",{code:aa.CONVER_GET_ERROR});case 9:return e.next=11,this.getHistoryMessage(t,n,0,1,0);case 11:if(a=e.sent,o=a.code,u=a.data,o===aa.SUCCESS){e.next=16;break}return e.abrupt("return",{code:aa.CONVER_GET_ERROR});case 16:c=(null==u?void 0:u.list[0])||null,i={conversationType:t,targetId:n,channelId:r,unreadMessageCount:s.unreadMessageCount||0,latestMessage:c,notificationStatus:s.notificationStatus||da.CLOSE,isTop:s.isTop||!1,lastUnreadTime:s.lastUnreadTime||0,unreadMentionedCount:s.unreadMentionedCount||0};case 18:return e.abrupt("return",{code:aa.SUCCESS,data:i});case 19:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return Le.apply(this,arguments)})},{key:"getAllConversationUnreadCount",value:function(e,t,n){var r=this._conversationManager.getAllUnreadCount(e,t,n);return Promise.resolve({code:aa.SUCCESS,data:r})}},{key:"getConversationUnreadCount",value:function(e,t,n){var r,i;e===Ms.ULTRA_GROUP?r=(null===(i=this._ultraGroupMap[n+"_"+t])||void 0===i?void 0:i.unreadMessageCount)||0:r=this._conversationManager.getUnreadCount(e,t,n);return Promise.resolve({code:aa.SUCCESS,data:r})}},{key:"clearConversationUnreadCount",value:function(e,t,n){return this._conversationManager.clearUnreadCount(e,t,n,!1),Promise.resolve(aa.SUCCESS)}},{key:"clearAllUnreadCount",value:function(){return this._conversationManager.clearAllUnreadCount(),Promise.resolve(aa.SUCCESS)}},{key:"getFirstUnreadMessage",value:function(e,t){throw new Error("Method not implemented.")}},{key:"saveConversationMessageDraft",value:function(e,t,n,r){return this._conversationManager.setDraft(e,t,n,r),Promise.resolve(aa.SUCCESS)}},{key:"getConversationMessageDraft",value:function(e,t,n){var r=this._conversationManager.getDraft(e,t,n);return Promise.resolve({code:aa.SUCCESS,data:r})}},{key:"clearConversationMessageDraft",value:function(e,t,n){return this._conversationManager.clearDraft(e,t,n),Promise.resolve(aa.SUCCESS)}},{key:"pullConversationStatus",value:(Ue=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._channel,r=this.currentUserId,!n){e.next=13;break}return i=n.codec.encodeGetConversationStatus(t),s=new Eg(kg[kg.pullSeAtts],i,r),e.next=6,n.send(s,Of);case 6:if(a=e.sent,o=a.code,u=a.data,o===aa.SUCCESS){e.next=10;break}return e.abrupt("return",{code:o});case 10:return c=[],Array.isArray(u)&&u.forEach((function(e){var t=e.conversationType,n=e.targetId,r=e.notificationStatus,i=e.channelId,s=e.isTop,a=l._ultraGroupMap[i+"_"+n];t===Ms.ULTRA_GROUP?a&&(void 0!==r&&(a.notificationStatus=r),"boolean"==typeof s&&(a.isTop=s)):c.push(e)})),e.abrupt("return",{code:o,data:c});case 13:return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 14:case"end":return e.stop()}}),e,this)}))),function(e){return Ue.apply(this,arguments)})},{key:"batchSetConversationStatus",value:(Ae=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l,f,d=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.currentUserId,!(r=this._channel)){e.next=15;break}return i=r.codec.encodeSetConversationStatus(t),s=new Eg(Kd,i,n),e.next=6,r.send(s,Af);case 6:if(a=e.sent,o=a.code,u=a.data,o!==aa.SUCCESS){e.next=14;break}return c=u,l=[],t.forEach((function(e){var t=e.conversationType,n=e.targetId,r=e.notificationStatus,i=e.channelId,s=e.isTop;if(t===Ms.ULTRA_GROUP){var a=d._ultraGroupMap[i+"_"+n];a&&(void 0!==r&&(a.notificationStatus=r),void 0!==s&&(a.isTop=s),l.push(a))}else d._conversationManager.addStatus(h(h({},e),{},{updatedTime:c.version}),!0)})),l.length>0&&(f=No(l),f=Dp(f),this._watcher.conversation(f)),e.abrupt("return",o);case 14:return e.abrupt("return",o);case 15:return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 16:case"end":return e.stop()}}),e,this)}))),function(e){return Ae.apply(this,arguments)})},{key:"_joinChrm",value:(Me=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this._channel){e.next=3;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 3:return s=i.codec.encodeJoinOrQuitChatRoom(),a=new Eg(r?xd:Ld,s,t),e.next=8,i.send(a,Fh);case 8:return o=e.sent,u=o.code,c=o.data,u===aa.SUCCESS&&(l=c.joinTime,this._chrmsQueue[t]||(this._chrmsQueue[t]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(t,n,l),this._naviInfo.kvStorage&&this._chrmEntryHandler.pullEntry(t,0),this._joinedChrmManager.set(t,n)),e.abrupt("return",u);case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return Me.apply(this,arguments)})},{key:"_rejoinChrm",value:(ke=s(regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=this._joinedChrmManager.get(),e.t0=regeneratorRuntime.keys(t);case 2:if((e.t1=e.t0()).done){e.next=10;break}return n=e.t1.value,e.next=6,this._joinChrm(n,t[n]||10,!0);case 6:(r=e.sent)===aa.SUCCESS?this._watcher.chatroom({rejoinedRoom:{chatroomId:n,count:t[n]}}):this._watcher.chatroom({rejoinedRoom:{chatroomId:n,errorCode:r}}),e.next=2;break;case 10:case"end":return e.stop()}}),e,this)}))),function(){return ke.apply(this,arguments)})},{key:"_pullChrmMsg",value:(Ne=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l,h,f,d,g,p,v=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=v.length>1&&void 0!==v[1]?v[1]:10,r=v.length>2&&void 0!==v[2]?v[2]:0,this._channel){e.next=4;break}return e.abrupt("return");case 4:if(i=this._chrmsQueue[t],s=i.pulling,a=i.timestamp,!s){e.next=8;break}return e.abrupt("return");case 8:return i.pulling=!0,o=this._channel.codec.encodeChrmSyncMsg(a,n),u=new Eg(kg[kg.chrmPull],o,t),e.next=13,this._channel.send(u,Ih,{connectedTime:this._channel.connectedTime,currentUserId:this.currentUserId});case 13:if(c=e.sent,l=c.code,h=c.data,i.pulling=!1,l===aa.SUCCESS&&h){e.next=20;break}return Js.warn("pull chatroom msg failed, code:",l,", data:",h),e.abrupt("return");case 20:f=h.list,d=h.syncTime,g=h.finished,i.timestamp=r?Math.max(d,r):d,i.queue=i.queue.filter((function(e){return e>d})),p=[],f.forEach((function(e){e.sentTime<a||p.push(e)})),this._watcher.batchMessage(p),(!g||i.queue.length>0)&&this._pullChrmMsg(t);case 27:case"end":return e.stop()}}),e,this)}))),function(e){return Ne.apply(this,arguments)})},{key:"joinChatroom",value:(Oe=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._joinChrm(t,n,!1));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return Oe.apply(this,arguments)})},{key:"joinExistChatroom",value:(we=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._joinChrm(t,n,!0));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return we.apply(this,arguments)})},{key:"quitChatroom",value:(be=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._channel){e.next=3;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 3:return r=n.codec.encodeJoinOrQuitChatRoom(),i=new Eg(Pd,r,t),e.next=7,n.send(i);case 7:return s=e.sent,(a=s.code)===aa.SUCCESS&&(delete this._chrmsQueue[t],this._chrmEntryHandler.reset(t),this._joinedChrmManager.remove(t)),e.abrupt("return",a);case 11:case"end":return e.stop()}}),e,this)}))),function(e){return be.apply(this,arguments)})},{key:"getChatroomInfo",value:(Se=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this._channel){e.next=3;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 3:return s=i.codec.encodeGetChatRoomInfo(n,r),a=new Eg(kg[kg.queryChrmI],s,t),e.next=7,i.send(a,Kh);case 7:if(o=e.sent,u=o.code,c=o.data,u===aa.SUCCESS){e.next=11;break}return e.abrupt("return",{code:u});case 11:return e.abrupt("return",{code:u,data:c});case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return Se.apply(this,arguments)})},{key:"getChatroomHistoryMessages",value:(Ce=s(regeneratorRuntime.mark((function e(t,n,r,i){var s,a,o,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=this._channel){e.next=3;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 3:return a=s.codec.encodeGetHistoryMsg(t,{timestamp:n,count:r,order:i}),o=new Eg(Qd,a,t),e.next=7,s.send(o,kh,{conversation:{targetId:t}});case 7:if(u=e.sent,c=u.code,l=u.data,c===aa.SUCCESS){e.next=12;break}return e.abrupt("return",{code:c});case 12:return e.abrupt("return",{code:c,data:{list:l.list,hasMore:l.hasMore}});case 13:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return Ce.apply(this,arguments)})},{key:"_modifyChatroomKV",value:(Ie=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._channel,i=this.currentUserId,r){e.next=3;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 3:return s=this._chrmEntryHandler.getVersion(t,n.key),n.version=null==s?this.getServerTime():s,a=r.codec.encodeModifyChatRoomKV(t,n,i),o=n.type===_a.UPDATE?Dd:Vd,u=new Eg(o,a,t),e.next=10,r.send(u,Fh);case 10:if(c=e.sent,(l=c.code)!==aa.SUCCESS){e.next=15;break}return this._chrmEntryHandler.setLocal(t,{kvEntries:[n],syncTime:(new Date).getTime()},i),e.abrupt("return",l);case 15:return e.abrupt("return",l);case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ie.apply(this,arguments)})},{key:"_modifyChatroomKVS",value:(Re=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o,u,c,l,h,f,d,g=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._channel,i=this.currentUserId,r){e.next=3;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 3:return n.entries.forEach((function(e){var n=g._chrmEntryHandler.getVersion(t,e.key);e.version=null==n?g.getServerTime():n})),s=r.codec.encodeModifyChatRoomKVS(t,n,i),a=n.type===_a.UPDATE?Bd:Gd,o=new Eg(a,s,t),e.next=10,r.send(o,mf);case 10:return u=e.sent,c=u.code,-1!==[aa.SUCCESS,aa.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(c)&&(h=[],delete(f=Object.assign({},n)).entries,n.entries.forEach((function(e){h.push(Object.assign({},e,f))})),c===aa.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(d=u.data,Js.warn("设置失败的属性:",d.errorKeys),l=d.errorKeys,d&&Array.isArray(d.errorKeys)&&d.errorKeys.forEach((function(e){var t=h.findIndex((function(t){return e.key===t.key}));-1!==t&&h.splice(t,1)}))),Js.warn("设置成功的属性:",h),this._chrmEntryHandler.setLocal(t,{kvEntries:h,syncTime:(new Date).getTime()},i)),e.abrupt("return",{code:c,data:l});case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return Re.apply(this,arguments)})},{key:"setChatroomEntry",value:(Te=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.type=_a.UPDATE,n.userId=n.userId||this.currentUserId,e.abrupt("return",this._modifyChatroomKV(t,n));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return Te.apply(this,arguments)})},{key:"setChatroomEntries",value:(Ee=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.type=_a.UPDATE,n.userId=n.userId||this.currentUserId,e.abrupt("return",this._modifyChatroomKVS(t,n));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return Ee.apply(this,arguments)})},{key:"forceSetChatroomEntry",value:(_e=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.type=_a.UPDATE,n.isOverwrite=!0,n.userId=n.userId||this.currentUserId,e.abrupt("return",this._modifyChatroomKV(t,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return _e.apply(this,arguments)})},{key:"removeChatroomEntry",value:(me=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.type=_a.DELETE,n.userId=n.userId||this.currentUserId,e.abrupt("return",this._modifyChatroomKV(t,n));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return me.apply(this,arguments)})},{key:"removeChatroomEntries",value:(ye=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.type=_a.DELETE,n.userId=n.userId||this.currentUserId,e.abrupt("return",this._modifyChatroomKVS(t,n));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return ye.apply(this,arguments)})},{key:"forceRemoveChatroomEntry",value:(ve=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.type=_a.DELETE,n.isOverwrite=!0,n.userId=n.userId||this.currentUserId,e.abrupt("return",this._modifyChatroomKV(t,n));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return ve.apply(this,arguments)})},{key:"getChatroomEntry",value:(pe=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r=this._chrmEntryHandler.getValue(t,n))){e.next=5;break}return e.abrupt("return",Promise.resolve({code:aa.SUCCESS,data:r}));case 5:if(i=this._channel){e.next=8;break}return e.abrupt("return",Promise.reject({code:aa.RC_NET_CHANNEL_INVALID}));case 8:return s=i.codec.encodePullChatRoomKV(0),a=new Eg(kg[kg.pullKV],s,t),e.next=12,i.send(a,yf);case 12:if(o=e.sent,!((u=o.data||{})&&u.kvEntries&&u.kvEntries.length)){e.next=18;break}if(void 0===(c=u.kvEntries.find((function(e){return e.key===n})))){e.next=18;break}return e.abrupt("return",Promise.resolve({code:aa.SUCCESS,data:null==c?void 0:c.value}));case 18:return e.abrupt("return",Promise.resolve({code:aa.CHATROOM_KEY_NOT_EXIST}));case 19:case"end":return e.stop()}}),e,this)}))),function(e,t){return pe.apply(this,arguments)})},{key:"getAllChatroomEntry",value:(ge=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n=this._chrmEntryHandler.getAll(t))||!Object.keys(n).length){e.next=5;break}return e.abrupt("return",Promise.resolve({code:aa.SUCCESS,data:n}));case 5:if(r=this._channel){e.next=8;break}return e.abrupt("return",Promise.reject({code:aa.RC_NET_CHANNEL_INVALID}));case 8:return i={},s=r.codec.encodePullChatRoomKV(0),a=new Eg(kg[kg.pullKV],s,t),e.next=13,r.send(a,yf);case 13:return o=e.sent,(u=o.data||{})&&u.kvEntries&&u.kvEntries.length&&u.kvEntries.forEach((function(e){e.key&&(i[e.key]=e.value||"")})),e.abrupt("return",Promise.resolve({code:aa.SUCCESS,data:i}));case 17:case"end":return e.stop()}}),e,this)}))),function(e){return ge.apply(this,arguments)})},{key:"pullChatroomEntry",value:(de=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o,u,c,l,h,f;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._channel,i=this.currentUserId,r){e.next=3;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 3:return n||(n=this._pullChatroomEntryTimestamp),s=r.codec.encodePullChatRoomKV(n),a=new Eg(kg[kg.pullKV],s,t),e.next=8,r.send(a,yf);case 8:if(o=e.sent,u=o.code,c=o.data,u!==aa.SUCCESS){e.next=19;break}return Js.info("Pull success ChrmKV, "+JSON.stringify(o)),this._chrmEntryHandler.setLocal(t,c,i),Js.info("Save into cache success!"),l=c.kvEntries,h=c.syncTime,this._pullChatroomEntryTimestamp=h||0,f=[],l.length>0&&(l.forEach((function(e){var n=e.key,r=e.value,i=e.type,s=e.timestamp;f.push({key:n,value:r,type:i,timestamp:s,chatroomId:t})})),this._watcher.chatroom({updatedEntries:f})),e.abrupt("return",{code:u,data:c});case 19:return e.abrupt("return",{code:u});case 20:case"end":return e.stop()}}),e,this)}))),function(e,t){return de.apply(this,arguments)})},{key:"sendMessage",value:(fe=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u,l,f,d,g,p;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(r=Pp(r,this.currentUserId),r=this._handleMsgProperties(r,!0),i=!![Ms.PRIVATE,Ms.GROUP].includes(t)&&r.isStatusMessage,s=i?(v=t,y=void 0,(y={},c(y,Ms.PRIVATE,kg.ppMsgS),c(y,Ms.GROUP,kg.pgMsgS),y)[v]):Lp(t)||kg.ppMsgP,i&&(r.isPersited=!1,r.isCounted=!1),a=this._channel.codec.encodeUpMsg({conversationType:t,targetId:n},r),(o=new yg(kg[s],a,n)).setHeaderQos(Yl.AT_LEAST_ONCE),!i){e.next=13;break}return this._channel.sendOnly(o),e.abrupt("return",{code:aa.SUCCESS,data:xp(t,n,h({},r),"",0,this.currentUserId)});case 13:return u=Date.now()-this._localConnectedTime+this._connectedTime,l=xp(t,n,h({},r),"",u,this.currentUserId),e.next=17,this._channel.send(o);case 17:if(f=e.sent,d=f.code,g=f.data,d===aa.SUCCESS){e.next=22;break}return e.abrupt("return",{code:d,data:l});case 22:return p=g,this._sendMessageStore.setMessage(p.messageUId,p.timestamp),l.sentTime=p.timestamp,l.messageUId=p.messageUId,this._conversationManager.setConversationCacheByMessage(l,!0),e.abrupt("return",{code:aa.SUCCESS,data:l});case 28:case"end":return e.stop()}var v,y}),e,this)}))),function(e,t,n){return fe.apply(this,arguments)})},{key:"recallMsg",value:(he=s(regeneratorRuntime.mark((function e(t,n,r,i,s){var a,o,u,c,l,f,d,g,p,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return o=s.user,u={content:{conversationType:t,targetId:n,messageUId:r,sentTime:i,user:o},messageType:"RC:RcCmd",disableNotification:null==s?void 0:s.disableNotification,pushConfig:null==s?void 0:s.pushConfig,pushContent:(null===(a=s.pushConfig)||void 0===a?void 0:a.pushContent)||s.pushContent||"",channelId:s.channelId},c=kg[kg.recallMsg],l=this._channel.codec.encodeUpMsg({conversationType:t,targetId:n},u),(f=new yg(c,l,this.currentUserId)).setHeaderQos(Yl.AT_LEAST_ONCE),e.next=10,this._channel.send(f);case 10:if(d=e.sent,g=d.code,p=d.data,g===aa.SUCCESS){e.next=15;break}return e.abrupt("return",{code:g});case 15:if(v=p,t!==Ms.ULTRA_GROUP){e.next=21;break}return this._ultraMsgMap[v.messageUId]=v.timestamp,e.abrupt("return",{code:aa.SUCCESS});case 21:return this._sendMessageStore.setMessage(v.messageUId,v.timestamp),y=xp(t,n,h(h({},u),{},{isPersited:!0}),v.messageUId,v.timestamp,this.currentUserId),this._conversationManager.setConversationCacheByMessage(y,!0),e.abrupt("return",{code:aa.SUCCESS,data:y});case 25:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return he.apply(this,arguments)})},{key:"sendReadReceiptMessage",value:(le=s(regeneratorRuntime.mark((function e(t,n,r){var i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return i=this._channel.codec.encodeReadReceipt(n,r),s=new Eg(kg[kg.rrMsg],i,t),e.next=6,this._channel.send(s);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return le.apply(this,arguments)})},{key:"getMessageReader",value:(ce=s(regeneratorRuntime.mark((function e(t,n,r){var i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return i=this._channel.codec.encodeMessageReader(n,r),s=new Eg(kg[kg.rrList],i,t),e.next=6,this._channel.send(s,xf);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return ce.apply(this,arguments)})},{key:"pullUserSettings",value:(ue=s(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return n=this._channel.codec.encodePullUserSetting(t),r=new Eg(kg[kg.pullUS],n,this.currentUserId),e.abrupt("return",this._channel.send(r,Sf));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return ue.apply(this,arguments)})},{key:"getFileToken",value:(oe=s(regeneratorRuntime.mark((function e(t,n,r,i){var s,a,o,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return s=i&&"uploads"!==i?n||"":po(t,n),a=this._channel.codec.encodeGetFileToken(t,s,r||"",i||""),o=new Eg(kg[kg.qnTkn],a,this.currentUserId),e.next=7,this._channel.send(o,uf);case 7:if(u=e.sent,c=u.code,l=u.data,l=Object.assign(l,{fileName:s}),c!==aa.SUCCESS){e.next=13;break}return e.abrupt("return",{code:c,data:l});case 13:return e.abrupt("return",{code:c});case 14:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return oe.apply(this,arguments)})},{key:"getFileUrl",value:(ae=s(regeneratorRuntime.mark((function e(t,n,r,i){var s,a,o,u,c,l,h,f,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return s="",a="",o="",n===ya.QINIU?(a=cf,o=hf):(a=lf,o=ff),s=n===ya.QINIU?kg[kg.qnUrl]:n===ya.AWS?kg[kg.s3Url]:n===ya.STC?kg[kg.stcUrl]:kg[kg.aliUrl],u=this._channel.codec.encodeGetFileUrl(a,t,r,i),c=new Eg(s,u,this.currentUserId),e.next=11,this._channel.send(c,o);case 11:if(l=e.sent,h=l.code,f=l.data,d=f,h!==aa.SUCCESS){e.next=17;break}return e.abrupt("return",{code:h,data:d});case 17:return e.abrupt("return",{code:h});case 18:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return ae.apply(this,arguments)})},{key:"disconnect",value:function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._channel&&(this._channel.close(),this._channel=void 0),this._pullQueue.length=0,this._stopSyncInterval(),this._stopUltraSyncInterval()}},{key:"destroy",value:function(){throw new Error("JSEngine's method not implemented.")}},{key:"registerMessageType",value:function(e,t,n,r,i){this._customMessageType[e]={isPersited:t,isCounted:n,isStatusMessage:i}}},{key:"getServerTime",value:function(){return Date.now()-this._localConnectedTime+this._connectedTime}},{key:"getCurrentUserId",value:function(){return this.currentUserId}},{key:"createTag",value:(se=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return n=this._userSettingManager.getVersion(),r=this._channel.codec.encodeCreateTag([t],n),i=new Eg(kg[kg.addSeTag],r,this.currentUserId),e.next=7,this._channel.send(i,If);case 7:if(s=e.sent,a=s.code,o=s.data,a===aa.SUCCESS){e.next=12;break}return e.abrupt("return",{code:a});case 12:return u=o.version,this._userSettingManager.addTag([h(h({},t),{},{createdTime:u})],u),e.abrupt("return",{code:aa.SUCCESS,data:o});case 15:case"end":return e.stop()}}),e,this)}))),function(e){return se.apply(this,arguments)})},{key:"removeTag",value:(ie=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return n=this._userSettingManager.getVersion(),r=this._channel.codec.encodeRemoveTag([t],n),i=new Eg(kg[kg.delSeTag],r,this.currentUserId),e.next=7,this._channel.send(i,If);case 7:if(s=e.sent,a=s.code,o=s.data,a===aa.SUCCESS){e.next=12;break}return e.abrupt("return",{code:a});case 12:return u=o.version,this._userSettingManager.deleteTag([t],u),e.abrupt("return",{code:aa.SUCCESS});case 15:case"end":return e.stop()}}),e,this)}))),function(e){return ie.apply(this,arguments)})},{key:"updateTag",value:(re=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return n=this._userSettingManager.getVersion(),r=this._channel.codec.encodeCreateTag([t],n),i=new Eg(kg[kg.addSeTag],r,this.currentUserId),e.next=7,this._channel.send(i,If);case 7:if(s=e.sent,a=s.code,o=s.data,a===aa.SUCCESS){e.next=12;break}return e.abrupt("return",{code:a});case 12:return u=o.version,this._userSettingManager.addTag([t],u),e.abrupt("return",{code:aa.SUCCESS,data:o});case 15:case"end":return e.stop()}}),e,this)}))),function(e){return re.apply(this,arguments)})},{key:"getTagList",value:(ne=s(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=this._userSettingManager.getTags(),n=this._conversationManager.getConversationListForTag(),t.forEach((function(e){e.conversationCount=n[e.tagId]?n[e.tagId].length:0})),e.abrupt("return",{code:aa.SUCCESS,data:t});case 4:case"end":return e.stop()}}),e,this)}))),function(){return ne.apply(this,arguments)})},{key:"addTagForConversations",value:(te=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o,u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(this._userSettingManager.getTagById(t)){e.next=4;break}return e.abrupt("return",{code:aa.TAG_NOT_EXIST});case 4:return r=this._channel.codec.encodeUpdateConversationTag([{tagId:t}],n),i=new Eg(kg[kg.addTag],r,this.currentUserId),e.next=8,this._channel.send(i);case 8:if(s=e.sent,(a=s.code)===aa.SUCCESS){e.next=12;break}return e.abrupt("return",{code:a});case 12:return(o={})[t]={},n.forEach((function(e){u._conversationManager.addTagStatus(e.conversationType,e.targetId,o,e.channelId)})),e.abrupt("return",{code:aa.SUCCESS});case 16:case"end":return e.stop()}}),e,this)}))),function(e,t){return te.apply(this,arguments)})},{key:"removeTagForConversations",value:(ee=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return r=this._channel.codec.encodeUpdateConversationTag([{tagId:t}],n),i=new Eg(kg[kg.delTag],r,this.currentUserId),e.next=6,this._channel.send(i);case 6:if(s=e.sent,(a=s.code)===aa.SUCCESS){e.next=10;break}return e.abrupt("return",{code:a});case 10:return n.forEach((function(e){o._conversationManager.deleteTagStatus(e.conversationType,e.targetId,[t],e.channelId)})),e.abrupt("return",{code:aa.SUCCESS});case 12:case"end":return e.stop()}}),e,this)}))),function(e,t){return ee.apply(this,arguments)})},{key:"removeTagsForConversation",value:($=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return r=t.conversationType,i=t.targetId,s=t.channelId,a=n.map((function(e){return{tagId:e}})),o=this._channel.codec.encodeUpdateConversationTag(a,[t]),u=new Eg(kg[kg.delTag],o,this.currentUserId),e.next=8,this._channel.send(u);case 8:if(c=e.sent,(l=c.code)===aa.SUCCESS){e.next=12;break}return e.abrupt("return",{code:l});case 12:return this._conversationManager.deleteTagStatus(r,i,n,s),e.abrupt("return",{code:aa.SUCCESS});case 14:case"end":return e.stop()}}),e,this)}))),function(e,t){return $.apply(this,arguments)})},{key:"getConversationListByTag",value:(X=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u,c,l,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=this.currentUserId,s=this._channel){e.next=3;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 3:return a=s.codec.encodeOldConversationList({count:r,type:Ms.PRIVATE,startTime:n}),o=new Eg(Fd,a,i),e.next=7,s.send(o,Ah,{currentUserId:i,connectedTime:s.connectedTime});case 7:if(u=e.sent,c=u.code,l=u.data,h=this._conversationHasTagFilter(t,null==l?void 0:l.list),Js.info("GetConversationListByTag",h),c===aa.SUCCESS){e.next=13;break}return e.abrupt("return",{code:c});case 13:return e.abrupt("return",{code:c,data:h});case 14:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return X.apply(this,arguments)})},{key:"_conversationHasTagFilter",value:function(e,t){var n=this,r=[],i=[];function s(e,t){return e.latestMessage&&t.latestMessage?e.latestMessage.sentTime-t.latestMessage.sentTime:0}return t.forEach((function(t){var s=t.conversationType,a=t.targetId,o=t.channelId,u=n._conversationManager.get(s,a,o),c=u.hasMentioned,l=u.mentionedInfo,f=u.lastUnreadTime,d=u.notificationStatus,g=u.isTop,p=u.tags,v=u.unreadMessageCount,y=p&&p[e];if(y){var m=h(h({},t),{},{hasMentioned:c,mentionedInfo:l,lastUnreadTime:f,notificationStatus:d,isTop:g,unreadMessageCount:v});y.isTop?r.push(h(h({},m),{},{isTopInTag:!0})):i.push(h(h({},m),{},{isTopInTag:!1}))}})),[].concat(C(r.sort(s)),C(i.sort(s)))}},{key:"getUnreadCountByTag",value:(Z=s(regeneratorRuntime.mark((function e(t,n){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return r=this._conversationManager.getUnreadCountByTag(t,n),e.abrupt("return",{code:aa.SUCCESS,data:r});case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return Z.apply(this,arguments)})},{key:"setConversationStatusInTag",value:(z=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u,c,l,h,f,d,g;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(i=n.targetId,s=n.conversationType,a=n.channelId,o=r.isTop,u=[{tagId:t,isTop:o}],(c=this._conversationManager.get(s,i,a)).tags&&Object.hasOwnProperty.call(c.tags,t)){e.next=8;break}return e.abrupt("return",{code:aa.NO_TAG_IN_CONVER});case 8:return l=this._channel.codec.encodeUpdateConversationTag(u,[n]),h=new Eg(kg[kg.addTag],l,this.currentUserId),e.next=12,this._channel.send(h);case 12:if(f=e.sent,(d=f.code)===aa.SUCCESS){e.next=16;break}return e.abrupt("return",{code:d});case 16:return(g={})[t]={},o&&(g[t].isTop=!0),this._conversationManager.addTagStatus(s,i,g,a),e.abrupt("return",{code:aa.SUCCESS});case 21:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return z.apply(this,arguments)})},{key:"getTagsForConversation",value:(J=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(n=this._conversationManager.get(t.conversationType,t.targetId,t.channelId),r=this._userSettingManager.getTagsInfo(),i=[],n.tags)for(s in n.tags)i.push({tagId:s,tagName:null===(a=r[s])||void 0===a?void 0:a.tagName});return e.abrupt("return",{code:aa.SUCCESS,data:i});case 7:case"end":return e.stop()}}),e,this)}))),function(e){return J.apply(this,arguments)})},{key:"getBlockConversationList",value:function(){var e=this._conversationManager.getBlockConversationList();return Promise.resolve({code:aa.SUCCESS,data:e})}},{key:"getTopConversationList",value:function(){var e=this._conversationManager.getTopConversationList();return Promise.resolve({code:aa.SUCCESS,data:e})}},{key:"getUnreadMentionedCount",value:function(e){var t,n;e.conversationType===Ms.ULTRA_GROUP?t=(null===(n=this._ultraGroupMap[e.channelId+"_"+e.targetId])||void 0===n?void 0:n.unreadMentionedCount)||0:t=this._conversationManager.getUnreadMentionedCount(e.channelId,e.conversationType,e.targetId);return Promise.resolve({code:aa.SUCCESS,data:t})}},{key:"getAllUnreadMentionedCount",value:function(){var e=this._conversationManager.getAllUnreadMentionedCount();return Promise.resolve({code:aa.SUCCESS,data:e})}},{key:"getUltraGroupList",value:(W=s(regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._isUltraGroupListExist){e.next=2;break}return e.abrupt("return",{code:aa.METHOD_NOT_AVAILABLE});case 2:return t=Object.values(this._ultraGroupMap),t=Dp(t),n=No(t),e.abrupt("return",{code:aa.SUCCESS,data:n});case 6:case"end":return e.stop()}}),e,this)}))),function(){return W.apply(this,arguments)})},{key:"getBlockUltraGroupList",value:function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:aa.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){e.notificationStatus===da.OPEN&&t.push({conversationType:Ms.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:aa.SUCCESS,data:t})}},{key:"getTopUltraGroupList",value:function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:aa.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){!0===e.isTop&&t.push({conversationType:Ms.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:aa.SUCCESS,data:t})}},{key:"getUltraGroupUnreadMentionedCountByTargetId",value:function(e){if(!this._isUltraGroupListExist)return Promise.resolve({code:aa.METHOD_NOT_AVAILABLE});var t=0;for(var n in this._ultraGroupMap){n.match(/_.*/g)[0].substring(1)===e&&(t+=this._ultraGroupMap[n].unreadMentionedCount)}return Promise.resolve({code:aa.SUCCESS,data:t})}},{key:"clearUltraUnreadcount",value:(Q=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=c.length>1&&void 0!==c[1]?c[1]:"",this._isUltraGroupListExist){e.next=3;break}return e.abrupt("return",Promise.resolve(aa.METHOD_NOT_AVAILABLE));case 3:if(this._channel){e.next=5;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 5:if(this._status===ua.CONNECTED){e.next=7;break}return e.abrupt("return",aa.RC_NET_UNAVAILABLE);case 7:return r=Date.now(),i=this._channel.codec.encodeClearUnreadCount({conversationType:Ms.ULTRA_GROUP,targetId:t,channelId:n},{timestamp:r}),(s=new yg(kg[kg.updUgRTime],i,this.currentUserId)).setHeaderQos(Yl.AT_LEAST_ONCE),e.next=13,this._channel.send(s);case 13:return a=e.sent,(o=a.code)===aa.SUCCESS&&(u=this._ultraGroupMap[n+"_"+t])&&(u.unreadMessageCount=0,u.unreadMentionedCount=0,u.lastReadTime=r),e.abrupt("return",o);case 17:case"end":return e.stop()}}),e,this)}))),function(e){return Q.apply(this,arguments)})},{key:"_getUltraGroupList",value:(Y=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l,h,f,d,g,p=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel&&this._status===ua.CONNECTED){e.next=2;break}return e.abrupt("return");case 2:return n=this._channel.codec.encodeUltraGroup(t,!1),r=new Eg(kg[kg.pullUgSes],n,this.currentUserId),e.next=7,this._channel.send(r,Ah,{currentUserId:this.currentUserId,conversationType:Ms.ULTRA_GROUP});case 7:if(i=e.sent,s=i.code,a=i.data,s===aa.SUCCESS&&a){e.next=14;break}return Js.warn("pull super conversation failed, code:",s,", data:",a,"retrying..."),o=setTimeout((function(){p._firstPullUltraGroupTime=t,p._getUltraGroupList(t),clearTimeout(o)}),3e3),e.abrupt("return");case 14:if(u=(null==a?void 0:a.list)||[],c=null==a?void 0:a.isFinished,u.forEach((function(e){e.notificationStatus=da.CLOSE,e.isTop=!1,p._ultraGroupMap[e.channelId+"_"+e.targetId]=e})),!1!==c){e.next=22;break}l=u.length>0&&u[u.length-1].versionTime||0,this._getUltraGroupList(l),e.next=33;break;case 22:return e.next=24,this.pullConversationStatus(this._firstPullUltraGroupTime);case 24:h=e.sent,f=h.code,d=h.data,f!==aa.SUCCESS&&Js.warn("pullConversationStatus fail code: ".concat(f,", data: ").concat(d)),g=Object.values(this._ultraGroupMap),g=Dp(g),this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable(No(g)),0===this._firstPullUltraGroupTime&&this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp);case 33:case"end":return e.stop()}}),e,this)}))),function(e){return Y.apply(this,arguments)})},{key:"_startUltraSyncInterval",value:function(){var e=this;this._lastSyncUltraMsgLocalTimeStamp=Date.now(),this._syncUltraMsg(0),function t(){e._ultraGroupTimer=setTimeout((function(){Date.now()-e._lastSyncUltraMsgLocalTimeStamp>=18e4&&e._syncUltraMsg(e._lastSyncUltraMsgTimeStamp),e._stopUltraSyncInterval(),t()}),3e4)}()}},{key:"_stopUltraSyncInterval",value:function(){-1!==this._ultraGroupTimer&&(clearTimeout(this._ultraGroupTimer),this._ultraGroupTimer=-1)}},{key:"_syncUltraMsg",value:(H=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l,h,f,d,g,p=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel&&this._status===ua.CONNECTED){e.next=2;break}return e.abrupt("return");case 2:if(!this._isUltraPulling){e.next=4;break}return e.abrupt("return");case 4:return Js.info("start pull ultra msg, time: ".concat(t)),this._isUltraPulling=!0,r=this._channel.codec.encodeSuperSyncMsg(t),i=new Eg(kg[kg.pullUgMsg],r,this.currentUserId),e.next=10,this._channel.send(i,Ih,{currentUserId:this.currentUserId,conversation:{conversationType:Ms.ULTRA_GROUP}});case 10:if(s=e.sent,a=s.code,o=s.data,Js.info("end pull ultra msg, code: ".concat(a,", syncTime: ").concat(null==o?void 0:o.syncTime,", count: ").concat(null==o||null===(n=o.list)||void 0===n?void 0:n.length)),this._lastSyncUltraMsgLocalTimeStamp=Date.now(),a===aa.SUCCESS&&o){e.next=19;break}return Js.warn("sync super message failed, code:",a,", data:",o),this._isUltraPulling=!1,e.abrupt("return");case 19:if(this._isUltraPulling=!1,u=o.list,c=o.syncTime,l=o.finished,this._isUltraGroupListExist){e.next=27;break}return Js.info("init getUltraGroupList"),this._firstPullUltraGroupTime=0,this._getUltraGroupList(0),this._lastSyncUltraMsgTimeStamp=c,e.abrupt("return");case 27:for(g in h={},f=[],u.forEach((function(e){var t,n,r,i=e.targetId,s=e.content,a=e.messageType,o=e.messageUId,u=e.channelId,l=e.isCounted;if(p._ultraMsgMap[o])delete p._ultraMsgMap[o];else{var d=0;((null==s||null===(t=s.mentionedInfo)||void 0===t?void 0:t.type)===pa.ALL||null!=s&&null!==(n=s.mentionedInfo)&&void 0!==n&&null!==(r=n.userIdList)&&void 0!==r&&r.includes(p.currentUserId))&&(d=1);var g=p._ultraGroupMap[u+"_"+i];if(g)l&&(a===ha.RECALL?g.unreadMessageCount>0&&(g.unreadMessageCount-=1):(g.unreadMessageCount+=1,g.unreadMentionedCount+=d)),g.versionTime=c,g.latestMessage=e,h[u+"_"+i]=g;else{var v={conversationType:Ms.ULTRA_GROUP,targetId:i,channelId:u,unreadMessageCount:l?1:0,unreadMentionedCount:l?d:0,versionTime:c,latestMessage:e,notificationStatus:da.CLOSE,isTop:!1};p._ultraGroupMap[u+"_"+i]=v,h[u+"_"+i]=v}f.push(e)}})),Object.keys(h).length>0&&(Js.info("notice ultragroups"),d=Object.values(h),d=Dp(d),this._watcher.conversation(No(d))),Js.info("notice ultragroup message"),this._watcher.batchMessage(f),this._ultraGroupTimeQue=this._ultraGroupTimeQue.filter((function(e){return e>c})),this._ultraMsgMap)this._ultraMsgMap[g]<c&&delete this._ultraMsgMap[g];!1===l?this._syncUltraMsg(c):u&&u.length>0&&(this._lastSyncUltraMsgTimeStamp=c),this._ultraGroupTimeQue.length>0&&this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp);case 37:case"end":return e.stop()}}),e,this)}))),function(e){return H.apply(this,arguments)})},{key:"sendUltraMessage",value:(j=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o,u,c,l,f,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(this._status===ua.CONNECTED){e.next=4;break}return e.abrupt("return",{code:aa.RC_NET_UNAVAILABLE});case 4:return"RC:SRSMsg"===n.messageType&&Js.warn("ultra group -> direction message convert to message"),n=this._handleMsgProperties(n,!0),r=this._channel.codec.encodeUpMsg({conversationType:Ms.ULTRA_GROUP,targetId:t},n),(i=new yg(kg[kg.ugMsg],r,t)).setHeaderQos(Yl.AT_LEAST_ONCE),s=Date.now()-this._localConnectedTime+this._connectedTime,a=xp(Ms.ULTRA_GROUP,t,h({},n),"",s,this.currentUserId),e.next=13,this._channel.send(i);case 13:if(o=e.sent,u=o.code,c=o.data,u===aa.SUCCESS){e.next=18;break}return e.abrupt("return",{code:u,data:a});case 18:return l=c,a.sentTime=l.timestamp,a.messageUId=l.messageUId,this._ultraMsgMap[l.messageUId]=l.timestamp,f=n.channelId||"",(d=this._ultraGroupMap[f+"_"+t])?d.latestMessage=a:(d={conversationType:Ms.ULTRA_GROUP,targetId:t,channelId:f,unreadMessageCount:0,unreadMentionedCount:0,versionTime:a.sentTime,latestMessage:a,notificationStatus:da.CLOSE,isTop:!1},this._ultraGroupMap[f+"_"+t]=d),this._watcher.conversation(No([d])),e.abrupt("return",{code:u,data:a});case 27:case"end":return e.stop()}}),e,this)}))),function(e,t){return j.apply(this,arguments)})},{key:"sendUltraGroupTypingStatus",value:(K=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(this._status===ua.CONNECTED){e.next=4;break}return e.abrupt("return",{code:aa.RC_NET_UNAVAILABLE});case 4:return r=t.conversationType,i=t.channelId,s=t.targetId,a=this._channel.codec.encodeOperateStatus(s,r,i||"",n||0),(o=new yg(kg[kg.operate],a,s)).setHeaderQos(Yl.AT_LEAST_ONCE),e.next=10,this._channel.send(o);case 10:if(u=e.sent,(c=u.code)===aa.SUCCESS){e.next=14;break}return e.abrupt("return",{code:c,msg:aa[c]});case 14:return e.abrupt("return",{code:c});case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return K.apply(this,arguments)})},{key:"getUltraGroupMessageListByMessageUId",value:(q=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(this._status===ua.CONNECTED){e.next=4;break}return e.abrupt("return",{code:aa.RC_NET_UNAVAILABLE});case 4:if(!(t.messages&&t.messages.length<1)){e.next=6;break}return e.abrupt("return",{code:aa.MSG_LIMIT_ERROR});case 6:if(!(t.messages&&t.messages.length>20)){e.next=8;break}return e.abrupt("return",{code:aa.MSG_LIMIT_ERROR});case 8:return n={},t.messages.forEach((function(e){n[e.messageUId]=void 0})),r=this._channel.codec.encodeMsgQuery(t),(i=new Eg(kg[kg.qryMsg],r,this.currentUserId)).setHeaderQos(Yl.AT_LEAST_ONCE),e.next=16,this._channel.send(i,Zf);case 16:if(s=e.sent,a=s.code,o=s.data,a===aa.SUCCESS){e.next=21;break}return e.abrupt("return",{code:a,msg:aa[a]});case 21:return u=(o||{}).list,Array.isArray(u)&&u.forEach((function(e){var t=e.messageUId;n[t]=e})),e.abrupt("return",{code:0,data:n});case 24:case"end":return e.stop()}}),e,this)}))),function(e){return q.apply(this,arguments)})},{key:"_pullOperateStatusNotify",value:function(e){if(this._channel){var t=this._channel.codec.decodeByPBName(e.data,$f),n=t.conversationType,r=t.info,i=t.summary;Js.info("s_opNtf -> type: ".concat(n,", info: ").concat(r,", summary: ").concat(i)),this._watcher.operateStatus(t)}}},{key:"expandUltraMessage",value:(F=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(this._status===ua.CONNECTED){e.next=4;break}return e.abrupt("return",{code:aa.RC_NET_UNAVAILABLE});case 4:return n=this._channel.codec.encodeExpandUltraMessage(t,this.currentUserId),(r=new yg(kg[kg.upMsgEx],n,t.targetId)).setHeaderQos(Yl.AT_LEAST_ONCE),e.next=9,this._channel.send(r);case 9:if(i=e.sent,s=i.code,a=i.data,s===aa.SUCCESS){e.next=14;break}return e.abrupt("return",{code:s,msg:aa[s]});case 14:return o=a,this._ultraMsgMap[o.messageUId]=o.timestamp,e.abrupt("return",{code:s});case 17:case"end":return e.stop()}}),e,this)}))),function(e){return F.apply(this,arguments)})},{key:"modifyMessage",value:(G=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(this._status===ua.CONNECTED){e.next=4;break}return e.abrupt("return",{code:aa.RC_NET_UNAVAILABLE});case 4:return n=this._channel.codec.encodemodifyMessage(t,this.currentUserId),(r=new yg(kg[kg.modifyMsg],n,t.targetId)).setHeaderQos(Yl.AT_LEAST_ONCE),e.next=9,this._channel.send(r);case 9:if(i=e.sent,s=i.code,a=i.data,s===aa.SUCCESS){e.next=14;break}return e.abrupt("return",{code:s,msg:aa[s]});case 14:return o=a,this._ultraMsgMap[o.messageUId]=o.timestamp,e.abrupt("return",{code:s});case 17:case"end":return e.stop()}}),e,this)}))),function(e){return G.apply(this,arguments)})},{key:"_pullUltraChangeMessageList",value:(B=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l,h,f,d,g,p,v,y,m=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return");case 2:if(this._status===ua.CONNECTED){e.next=4;break}return e.abrupt("return");case 4:if(!this._isPullingUltraChangeMessage){e.next=6;break}return e.abrupt("return");case 6:return this._isPullingUltraChangeMessage=!0,r=this._channel.codec.encodeQueryMsgChange(t),(i=new yg(kg[kg.qryMsgChange],r,this.currentUserId)).setHeaderQos(Yl.AT_LEAST_ONCE),e.next=12,this._channel.send(i,Wf);case 12:if(s=e.sent,a=s.code,o=s.data,this._isPullingUltraChangeMessage=!1,a===aa.SUCCESS){e.next=18;break}return e.abrupt("return");case 18:for(p in c=(u=o||{}).hasNext,l=u.list,h=(null==o?void 0:o.syncTime)||0,f=[],d={},Array.isArray(l)&&l.forEach((function(e){var t=e.targetId,n=e.conversationType,r=e.sendTime,i=e.messageUId,s=e.changeType,a=e.operatorId,o=e.channelId||"",u=n+"_"+t,c=i+"_"+o+"_"+r,l=d[u];if(l)l.add(c);else{var h=new Set([c]);d[u]=h}3!==s?m._ultraMsgChangeMap[i]=s:f.push({targetId:t,conversationType:n,sendTime:r,messageUId:i,senderUserId:a,channelId:o})})),Array.isArray(f)&&f.length>0&&this._watcher.ultraGroupMessageRecalled(f),g=function(e){var t=e.split("_"),n=t.shift(),r=t.join("_"),i=d[e],s=[];i.forEach((function(e){var t=I(e.split("_"),3),n=t[0],r=t[1],i=t[2];s.push({sendTime:Number(i),messageUId:n,channelId:r})}));var a={targetId:r,conversationType:Number(n),messages:s};m._pullUltraMessageList(a)},d)g(p);for(y in v=this._pullUltraChangeMessageQue.filter((function(e){return e>h})),this._pullUltraChangeMessageQue.length=0,(n=this._pullUltraChangeMessageQue).push.apply(n,C(v)),this._ultraMsgMap)this._ultraMsgMap[y]<h&&delete this._ultraMsgMap[y];c?this._pullUltraChangeMessageList(h):this._lastPullingUltraChangeMessageTime=h;case 31:case"end":return e.stop()}}),e,this)}))),function(e){return B.apply(this,arguments)})},{key:"_pullUltraMessageList",value:(V=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(this._status===ua.CONNECTED){e.next=4;break}return e.abrupt("return",{code:aa.RC_NET_UNAVAILABLE});case 4:return n=this._channel.codec.encodeMsgQuery(t),(r=new Eg(kg[kg.qryMsg],n,this.currentUserId)).setHeaderQos(Yl.AT_LEAST_ONCE),e.next=9,this._channel.send(r,Zf);case 9:if(i=e.sent,s=i.code,a=i.data,s===aa.SUCCESS){e.next=14;break}return e.abrupt("return",{code:s,msg:aa[s]});case 14:o=(a||{}).list,u=[],c=[],Array.isArray(o)&&o.forEach((function(e){var t=e.targetId,n=e.channelId,r=e.messageUId,i=l._ultraGroupMap[n+"_"+t];i&&i.latestMessage.messageUId===e.messageUId&&(i.latestMessage=e);var s=l._ultraMsgChangeMap[r+""];1===s?u.push(e):2===s&&c.push(e)})),u.length>0&&this._watcher.ultraGroupMessageExpansionUpdated(u||[]),c.length>0&&this._watcher.ultraGroupMessageModified(c||[]);case 20:case"end":return e.stop()}}),e,this)}))),function(e){return V.apply(this,arguments)})},{key:"getUltraHistoryMsg",value:(D=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(this._status===ua.CONNECTED){e.next=4;break}return e.abrupt("return",{code:aa.RC_NET_UNAVAILABLE});case 4:return r=this._channel.codec.encodeGetHistoryMsg(t,n),i=new Eg(kg[kg.qryUgMsg],r,this.currentUserId),e.next=8,this._channel.send(i,kh,{currentUserId:this.currentUserId,conversation:{conversationType:Ms.ULTRA_GROUP,targetId:t}});case 8:if(s=e.sent,a=s.code,o=s.data,a===aa.SUCCESS&&o){e.next=14;break}return Js.warn("get super history message failed, code:",a,", data:",o),e.abrupt("return",{code:a});case 14:return e.abrupt("return",{code:a,data:o});case 15:case"end":return e.stop()}}),e,this)}))),function(e,t){return D.apply(this,arguments)})},{key:"searchUltraGroupMessages",value:(P=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:if(this._status===ua.CONNECTED){e.next=4;break}return e.abrupt("return",{code:aa.RC_NET_UNAVAILABLE});case 4:return e.abrupt("return",{code:aa.SUCCESS});case 5:case"end":return e.stop()}}),e,this)}))),function(e){return P.apply(this,arguments)})},{key:"getAllConversationState",value:function(){return Promise.resolve({code:aa.SUCCESS,data:this._conversationManager.getAllConversationState()})}},{key:"joinRTCRoom",value:(x=s(regeneratorRuntime.mark((function e(t,n,r,i,s,a){var o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return o=this._channel.codec.encodeJoinRTCRoom(n,r,i,s,a),u=new Eg(kg[kg.rtcRJoin_data],o,t),e.abrupt("return",this._channel.send(u,Hh));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i,s){return x.apply(this,arguments)})},{key:"quitRTCRoom",value:(L=s(regeneratorRuntime.mark((function e(t){var n,r,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return n=this._channel.codec.encodeQuitRTCRoom(),r=new Eg(kg[kg.rtcRExit],n,t),e.next=6,this._channel.send(r);case 6:return i=e.sent,s=i.code,e.abrupt("return",s);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return L.apply(this,arguments)})},{key:"rtcPing",value:(U=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return i=this._channel.codec.encodeJoinRTCRoom(n,r),s=new Eg(kg[kg.rtcPing],i,t),e.next=6,this._channel.send(s);case 6:return a=e.sent,o=a.code,e.abrupt("return",o);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return U.apply(this,arguments)})},{key:"getRTCRoomInfo",value:(A=s(regeneratorRuntime.mark((function e(t){var n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return n=this._channel.codec.encodeGetRTCRoomInfo(),r=new Eg(kg[kg.rtcRInfo],n,t),e.abrupt("return",this._channel.send(r,rf));case 5:case"end":return e.stop()}}),e,this)}))),function(e){return A.apply(this,arguments)})},{key:"getRTCUserInfoList",value:(M=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return n=this._channel.codec.encodeGetRTCRoomInfo(),r=new Eg(kg[kg.rtcUData],n,t),e.next=6,this._channel.send(r,Hh);case 6:return i=e.sent,s=i.code,a=i.data,e.abrupt("return",{code:s,data:a?{users:a.users}:a});case 10:case"end":return e.stop()}}),e,this)}))),function(e){return M.apply(this,arguments)})},{key:"setRTCUserInfo",value:(k=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return i=this._channel.codec.encodeSetRTCUserInfo(n,r),s=new Eg(kg[kg.rtcUPut],i,t),e.next=6,this._channel.send(s);case 6:return a=e.sent,o=a.code,e.abrupt("return",o);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return k.apply(this,arguments)})},{key:"removeRTCUserInfo",value:(N=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return r=this._channel.codec.encodeRemoveRTCUserInfo(n),i=new yg(kg[kg.rtcUDel],r,t),e.next=6,this._channel.send(i);case 6:return s=e.sent,a=s.code,e.abrupt("return",a);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return N.apply(this,arguments)})},{key:"setRTCData",value:(O=s(regeneratorRuntime.mark((function e(t,n,r,i,s,a){var o,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return o=this._channel.codec.encodeSetRTCData(n,r,i,s,a),u=new yg(kg[kg.rtcSetData],o,t),e.next=6,this._channel.send(u);case 6:return c=e.sent,l=c.code,e.abrupt("return",l);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i,s){return O.apply(this,arguments)})},{key:"setRTCTotalRes",value:(w=s(regeneratorRuntime.mark((function e(t,n,r,i,s){var a,o,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return a=this._channel.codec.encodeUserSetRTCData(n,r,i,s),o=new Eg(kg[kg.userSetData],a,t),e.next=6,this._channel.send(o);case 6:return u=e.sent,c=u.code,e.abrupt("return",c);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return w.apply(this,arguments)})},{key:"setRTCCDNUris",value:(b=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return i=this._channel.codec.encodeUserSetRTCCDNUris(n,r),s=new Eg(kg[kg.userSetData],i,t),e.next=6,this._channel.send(s);case 6:return a=e.sent,o=a.code,e.abrupt("return",o);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return b.apply(this,arguments)})},{key:"getRTCData",value:function(e,t,n,r){if(!this._channel)return Promise.resolve({code:aa.RC_NET_CHANNEL_INVALID});var i=this._channel.codec.encodeGetRTCData(t,n,r),s=new Eg(kg[kg.rtcQryData],i,e);return this._channel.send(s,$h)}},{key:"removeRTCData",value:(S=s(regeneratorRuntime.mark((function e(t,n,r,i,s){var a,o,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return a=this._channel.codec.encodeRemoveRTCData(n,r,i,s),o=new yg(kg[kg.rtcDelData],a,t),e.next=6,this._channel.send(o);case 6:return u=e.sent,c=u.code,e.abrupt("return",c);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return S.apply(this,arguments)})},{key:"setRTCOutData",value:function(e,t,n,r){throw new Error("JSEngine's method not implemented.")}},{key:"getRTCOutData",value:function(e,t){throw new Error("JSEngine's method not implemented.")}},{key:"getRTCToken",value:(R=s(regeneratorRuntime.mark((function e(t,n,r){var i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return i=this._channel.codec.encodeJoinRTCRoom(n,r),s=new Eg(kg[kg.rtcToken],i,t),e.abrupt("return",this._channel.send(s,Xh));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return R.apply(this,arguments)})},{key:"setRTCState",value:(E=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return r=this._channel.codec.encodeSetRTCState(n),i=new Eg(kg[kg.rtcUserState],r,t),e.next=6,this._channel.send(i);case 6:return s=e.sent,a=s.code,e.abrupt("return",a);case 9:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"getRTCUserInfo",value:(m=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:throw new Error("Method not implemented.");case 1:case"end":return e.stop()}}),e)}))),function(e){return m.apply(this,arguments)})},{key:"getRTCUserList",value:function(e){if(!this._channel)return Promise.resolve({code:aa.RC_NET_CHANNEL_INVALID});var t=this._channel.codec.encodeGetRTCRoomInfo(),n=new Eg(kg[kg.rtcUList],t,e);return this._channel.send(n,Hh)}},{key:"joinLivingRoomAsAudience",value:(y=s(regeneratorRuntime.mark((function t(n){var r,i,s,a,o,u,c,l,h,f=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=f.length>1&&void 0!==f[1]?f[1]:e.RTCMode.LIVE,i=f.length>2?f[2]:void 0,this._channel){t.next=4;break}return t.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 4:return s=this._channel.codec.encodeJoinRTCRoom(r,i),a=new Eg(kg[kg.viewerJoinR],s,n),t.next=8,this._channel.send(a,od);case 8:if(o=t.sent,u=o.code,c=o.data,u===aa.SUCCESS){t.next=13;break}return t.abrupt("return",{code:u});case 13:return l=c.rtcToken,h=c.entries,t.abrupt("return",{code:u,data:{token:l,kvEntries:h}});case 15:case"end":return t.stop()}}),t,this)}))),function(e){return y.apply(this,arguments)})},{key:"quitLivingRoomAsAudience",value:(v=s(regeneratorRuntime.mark((function e(t){var n,r,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return n=this._channel.codec.encodeQuitRTCRoom(),r=new Eg(kg[kg.viewerExitR],n,t),e.next=6,this._channel.send(r);case 6:return i=e.sent,s=i.code,this._rtcKVManager.reset(),e.abrupt("return",s);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return v.apply(this,arguments)})},{key:"rtcIdentityChange",value:(p=s(regeneratorRuntime.mark((function e(t,n,r){var i,s,a,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 2:return i=this._channel.codec.encodeIdentityChangeInfo(n,r),s=new Eg(kg[kg.rtcIdentityChange],i,t),e.next=6,this._channel.send(s,Hh);case 6:if(a=e.sent,o=a.code,u=a.data,o===aa.SUCCESS){e.next=11;break}return e.abrupt("return",{code:o});case 11:return e.abrupt("return",{code:o,data:u});case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return p.apply(this,arguments)})},{key:"pullRTCRoomEntry",value:(g=s(regeneratorRuntime.mark((function e(t,n){var r,i,s,a,o,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=this._channel,i=this.currentUserId,r){e.next=3;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 3:return Js.info("audience in room start pull KV"),s=r.codec.encodePullRTCRoomKV(t,0),a=new Eg(kg[kg.rtcPullKv],s,i),e.next=8,r.send(a,id);case 8:if(o=e.sent,u=o.code,c=o.data,Js.info("audience in room end pull KV, code: ".concat(u,", data: ").concat(JSON.stringify(c||{}))),u!==aa.SUCCESS){e.next=16;break}return l=c.kvEntries,this._watcher.onRTCDataChange(l,t),e.abrupt("return",{code:u,data:c});case 16:return e.abrupt("return",{code:u});case 17:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"getRTCJoinedUserInfo",value:(d=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this._channel,r=this.currentUserId,n){e.next=3;break}return e.abrupt("return",{code:aa.RC_NET_CHANNEL_INVALID});case 3:return i=n.codec.encodeQueryUserJoinedInfo(t),s=new Eg(kg[kg.rtcQueryJoined],i,r),e.next=7,n.send(s,ad);case 7:if(a=e.sent,o=a.code,u=a.data,o!==aa.SUCCESS){e.next=12;break}return e.abrupt("return",{code:o,data:u});case 12:return e.abrupt("return",{code:o});case 13:case"end":return e.stop()}}),e,this)}))),function(e){return d.apply(this,arguments)})},{key:"getDeviceId",value:function(){return Ap(this.runtime)}},{key:"requestRoomPK",value:(l=s(regeneratorRuntime.mark((function e(t){var n,r,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return n=this._channel.codec.encodeRequestRoomPK(t),r=new Eg(kg[kg.rtcInvite],n,t.roomId),e.next=6,this._channel.send(r);case 6:return i=e.sent,s=i.code,this._rtcKVManager.reset(),e.abrupt("return",s);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return l.apply(this,arguments)})},{key:"cancelRoomPK",value:(o=s(regeneratorRuntime.mark((function e(t){var n,r,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return n=this._channel.codec.encodeCancelRoomPK(t),r=new Eg(kg[kg.rtcCancelInvite],n,t.roomId),e.next=6,this._channel.send(r);case 6:return i=e.sent,s=i.code,this._rtcKVManager.reset(),e.abrupt("return",s);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"responseRoomPK",value:(i=s(regeneratorRuntime.mark((function e(t){var n,r,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return n=this._channel.codec.encodeResponseRoomPK(t),r=new Eg(kg[kg.rtcInviteAnswer],n,t.roomId),e.next=6,this._channel.send(r);case 6:return i=e.sent,s=i.code,this._rtcKVManager.reset(),e.abrupt("return",s);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"endRoomPK",value:(r=s(regeneratorRuntime.mark((function e(t){var n,r,i,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return n=this._channel.codec.encodeEndRoomPK(t),r=new Eg(kg[kg.rtcEndInvite],n,t.roomId),e.next=6,this._channel.send(r);case 6:return i=e.sent,s=i.code,this._rtcKVManager.reset(),e.abrupt("return",s);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"bindRTCRoomForChatroom",value:(n=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._channel){e.next=2;break}return e.abrupt("return",aa.RC_NET_CHANNEL_INVALID);case 2:return n=t.chatRoomId,r=this._channel.codec.encodebindRTCRoomForChatroom(t),i=new Eg(kg[kg.setRtcRoomId],r,n),e.next=7,this._channel.send(i);case 7:return s=e.sent,a=s.code,e.abrupt("return",a);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"callExtra",value:function(e){return Promise.resolve({code:aa.EXTRA_METHOD_UNDEFINED})}},{key:"getConversationListWithAllChannel",value:function(){throw new Error("Method not implemented.")}},{key:"getConversationListWithAllChannelByPage",value:function(e,t){throw new Error("Method not implemented.")}},{key:"clearConversations",value:function(){throw new Error("Method not implemented.")}},{key:"setUserStatusListener",value:function(e,t){throw new Error("Method not implemented.")}},{key:"setUserStatus",value:function(e){throw new Error("Method not implemented.")}},{key:"subscribeUserStatus",value:function(e){throw new Error("Method not implemented.")}},{key:"getUserStatus",value:function(e){throw new Error("Method not implemented.")}},{key:"addToBlacklist",value:function(e){throw new Error("Method not implemented.")}},{key:"removeFromBlacklist",value:function(e){throw new Error("Method not implemented.")}},{key:"getBlacklist",value:function(){throw new Error("Method not implemented.")}},{key:"getBlacklistStatus",value:function(e){throw new Error("Method not implemented.")}},{key:"insertMessage",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"deleteMessages",value:function(e){throw new Error("Method not implemented.")}},{key:"deleteMessagesByTimestamp",value:function(e,t,n,r,i){throw new Error("Method not implemented.")}},{key:"clearMessages",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"getMessage",value:function(e){throw new Error("Method not implemented.")}},{key:"setMessageContent",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"setMessageSearchField",value:function(e,t,n){throw new Error("Method not implemented.")}},{key:"searchConversationByContent",value:function(e,t,n,r){throw new Error("Method not implemented.")}},{key:"searchMessageByContent",value:function(e,t,n,r,i,s){throw new Error("Method not implemented.")}},{key:"getUnreadMentionedMessages",value:function(e,t){throw new Error("Method not implemented.")}},{key:"setMessageSentStatus",value:function(e,t){throw new Error("Method not implemented.")}},{key:"setMessageReceivedStatus",value:function(e,t){throw new Error("Method not implemented.")}},{key:"clearUnreadCountByTimestamp",value:function(e,t,n,r){throw new Error("Method not implemented.")}},{key:"getConversationNotificationStatus",value:function(e,t,n){var r=this._conversationManager.get(e,t,n);return r?Promise.resolve({code:aa.SUCCESS,data:r.notificationStatus}):Promise.resolve({code:aa.CONVER_GET_ERROR})}},{key:"getRemoteHistoryMessages",value:function(e,t,n,r,i,s){return this.getHistoryMessage(e,t,n,r,i,s)}}]),je}(Fg),Bp=function(){function e(t){a(this,e),this._context=t}return u(e,[{key:"__getContext",value:function(){return this._context}},{key:"getNaviInfo",value:function(){return this._context.getInfoFromCache()}},{key:"getCoreVersion",value:function(){return this._context.coreVersion}},{key:"getAPIVersion",value:function(){return this._context.apiVersion}},{key:"getAppkey",value:function(){return this._context.appkey}},{key:"getCurrentId",value:function(){return this._context.getCurrentUserId()}},{key:"getConnectionStatus",value:function(){return this._context.getConnectionStatus()}},{key:"getDeviceId",value:function(){return this._context.getDeviceId()}},{key:"sendMessage",value:function(e,t,n){return this._context.sendMessage(e,t,n)}},{key:"registerMessageType",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];this._context.registerMessageType(e,t,n,r)}},{key:"getServerTime",value:function(){return this._context.getServerTime()}},{key:"getRTCJoinedUserInfo",value:function(e){return this._context.getRTCJoinedUserInfo(e)}}]),e}(),Gp=function(e){f(n,e);var t=T(n);function n(){return a(this,n),t.apply(this,arguments)}return u(n,[{key:"getNaviInfo",value:function(){return this._context.getInfoFromCache()}},{key:"joinRTCRoom",value:function(e,t,n,r,i,s){return this._context.joinRTCRoom(e,t,n,r,i,s)}},{key:"quitRTCRoom",value:function(e){return this._context.quitRTCRoom(e)}},{key:"rtcPing",value:function(e,t,n){return this._context.rtcPing(e,t,n)}},{key:"getRTCRoomInfo",value:function(e){return this._context.getRTCRoomInfo(e)}},{key:"getRTCUserInfoList",value:function(e){return this._context.getRTCUserInfoList(e)}},{key:"getRTCUserInfo",value:function(e){return this._context.getRTCUserInfo(e)}},{key:"setRTCUserInfo",value:function(e,t,n){return this._context.setRTCUserInfo(e,t,n)}},{key:"removeRTCUserInfo",value:function(e,t){return this._context.removeRTCUserInfo(e,t)}},{key:"setRTCData",value:function(e,t,n,r,i,s){return this._context.setRTCData(e,t,n,r,i,s)}},{key:"setRTCTotalRes",value:function(e,t,n,r,i){return this._context.setRTCTotalRes(e,t,n,r,i)}},{key:"setRTCCDNUris",value:function(e,t,n){return this._context.setRTCCDNUris(e,t,n)}},{key:"getRTCData",value:function(e,t,n,r){return this._context.getRTCData(e,t,n,r)}},{key:"removeRTCData",value:function(e,t,n,r,i){return this._context.removeRTCData(e,t,n,r,i)}},{key:"setRTCOutData",value:function(e,t,n,r){return this._context.setRTCOutData(e,t,n,r)}},{key:"getRTCOutData",value:function(e,t){return this._context.getRTCOutData(e,t)}},{key:"getRTCToken",value:function(e,t,n){return this._context.getRTCToken(e,t,n)}},{key:"setRTCState",value:function(e,t){return this._context.setRTCState(e,t)}},{key:"getRTCUserList",value:function(e){return this._context.getRTCUserList(e)}},{key:"joinLivingRoomAsAudience",value:function(e,t,n){return this._context.joinLivingRoomAsAudience(e,t,n)}},{key:"quitLivingRoomAsAudience",value:function(e){return this._context.quitLivingRoomAsAudience(e)}},{key:"rtcIdentityChange",value:function(e,t,n){return this._context.rtcIdentityChange(e,t,n)}},{key:"requestRoomPK",value:function(e){return this._context.requestRoomPK(e)}},{key:"cancelRoomPK",value:function(e){return this._context.cancelRoomPK(e)}},{key:"responseRoomPK",value:function(e){return this._context.responseRoomPK(e)}},{key:"endRoomPK",value:function(e){return this._context.endRoomPK(e)}}]),n}(Bp),Fp=function(){function e(){a(this,e)}return u(e,null,[{key:"compress",value:function(e){for(var t=this,n={},r=0;r<e.length-1;r++){var i=e.charAt(r)+e.charAt(r+1);n.hasOwnProperty(i)?n[i].push(r):n[i]=[r]}for(var s=[],a=[],o=function(){if(a.length>0){var e=a.join("");if(a=[],e.length>26){var n=t.numberEncode(e.length),r=String.fromCharCode(t.dataType.NormalExt|n.length);s.push(r+n)}else{var i=String.fromCharCode(t.dataType.Normal|e.length);s.push(i)}s.push(e)}},u=0;u<e.length;){var c=t.indexOf(n,e,u);if(c.length<2)a.push(e.charAt(u++));else if(c.length<4)a.push(e.substr(u,c.length)),u+=c.length;else{var l=t.numberEncode(u-c.offset),h=t.numberEncode(c.length);if(l.length+h.length>=c.length)a.push(e.substr(u,c.length)),u+=c.length;else{o();var f=String.fromCharCode(t.dataType.Compressed|l.length<<2|h.length);s.push(f+l+h),u+=c.length}}}o();var d=t.numberEncode(e.length),g=String.fromCharCode(t.dataType.Tail|d.length);return s.push(g+d),s.join("")}},{key:"uncompress",value:function(e){var t=this,n=0,r="";e:do{var i=e.charCodeAt(n++),s=i&t.dataType.Mark,a=15&i,o=void 0;switch(s){case t.dataType.Compressed:var u=a>>2,c=3&a;if(0===u||0===c)throw new Error("Data parsing error,at "+n);var l=t.numberDecode(e.substr(n,u)),h=t.numberDecode(e.substr(n+=u,c));if((l=r.length-l)+h>r.length)throw new Error("Data parsing error,at "+n);n+=c,r+=r.substr(l,h);break;case t.dataType.Tail:if((o=t.numberDecode(e.substr(n,a)))!==r.length)throw console.log(r.length),console.log(o),new Error("Data parsing error,at "+n);n+=a;break e;case t.dataType.NormalExt:o=t.numberDecode(e.substr(n,a)),r+=e.substr(n+=a,o),n+=o;break;case t.dataType.Normal:r+=e.substr(n,a),n+=a;break;case t.dataType.Mark:if(a>10)throw new Error("Data parsing error,at "+n);r+=e.substr(n,16+a),n+=16+a;break;default:throw new Error("Data parsing error,at "+n+" header:"+s)}}while(n<e.length);return r}},{key:"indexOf",value:function(e,t,n){var r={length:0,offset:-1};if(t.length,n>=t.length-1)return r;var i=e[t.charAt(n)+t.charAt(n+1)];if(i[0]===n)return r;for(var s=t.length-n,a=0,o=i.length;a<o;a++){var u=i[a],c=n-u;if(!(c>this.max)){var l=Math.min(s,c);if(l<=r.length)break;if(!(r.length>2&&t.charAt(u+r.length-1)!==t.charAt(n+r.length-1))){for(var h=2,f=h;f<l&&t.charAt(u+f)===t.charAt(n+f);f++)h++;h>=r.length&&(r.length=h,r.offset=u)}}}return r}},{key:"numberEncode",value:function(e){var t=this,n=[],r=0;do{r=e%t.scale,n.push(t.chars.charAt(r)),e=(e-r)/t.scale}while(e>0);return n.join("")}},{key:"numberDecode",value:function(e){for(var t=0,n=0,r=e.length-1;r>=0;r--){if(-1===(n=this.chars.indexOf(e.charAt(r))))throw new Error('decode number error, data is "'+e+'"');t=t*this.scale+n}return t}}]),e}();Fp.dataType={Tail:48,Compressed:64,NormalExt:80,Normal:96,Mark:112},Fp.chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Fp.scale=Fp.chars.length,Fp.max=238327;var qp=1,Kp=!1,jp=function(){function e(t){a(this,e),this.info=t,this.logUrl="logcollection.ronghub.com",this.level=1,this.itv=30,this.times=5,this.deviceId="",this.deviceInfo="",this.logSwitch=0,this.logUrl=t.logPolicy.url||this.logUrl,this.level=t.logPolicy.level||this.level,this.itv=t.logPolicy.itv||this.itv,this.times=t.logPolicy.times||this.times,this.deviceId=Ap(t.runtime),this.logSwitch=t.logSwitch;var n=bo(t.runtime);this.deviceInfo="".concat(n.type,"|").concat(n.version,"|").concat(Ws.sessionId),this.startReport()}var t;return u(e,[{key:"startReport",value:function(){var e=this;if(this.logSwitch&&Kp){var t=this.itv*Math.pow(2,qp-1);qp<this.times&&qp++,setTimeout((function(){e.reportRealtimeLog()}),1e3*t)}}},{key:"reportRealtimeLog",value:function(){var e=this,t=Ws.realTimeLogList.filter((function(t){return t.level<=e.level}));if(0!==t.length){var n=Fp.compress(t.map((function(e){return e.content})).join("")),r="https://".concat(this.logUrl,"?version=").concat(this.info.version,"&appkey=").concat(this.info.appkey,"&userId=").concat(this.info.userId,"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web");this.info.runtime.httpReq({method:"POST",url:r,body:n}).then((function(t){Js.__clearRealTimeLog(),Js.debug("report real-time log success");var n=t.data;n&&(n=JSON.parse(n),e.itv=n.nextTime,e.level=n.level,e.logSwitch=n.logSwitch,qp=1),e.startReport()})).catch((function(t){Js.debug("report real-time log error -> "+t),e.startReport()}))}else this.startReport()}},{key:"reportFullLog",value:(t=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l,h=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.startTime,r=t.endTime,i=t.platform,s=t.logId,a=t.uri,o=gs.getInstance(),Js.debug("received report log msg, ".concat(i.toLowerCase()),o),"web"===i.toLowerCase()&&o){e.next=5;break}return e.abrupt("return");case 5:if(!(n>r)){e.next=8;break}return Js.warn("report error: The start time(".concat(n,") cannot be greater than the end time(").concat(n,")")),e.abrupt("return");case 8:return e.next=10,Js.__insertLogIntoDatabase();case 10:return e.next=12,o.getRangeData(fs,"time",n,r);case 12:u=(u=e.sent).filter((function(e){return!e.userId||e.userId===h.info.userId})),c=Fp.compress(u.map((function(e){return e.content})).join("")||"no data"),l=1,function e(){if(!(l>3)&&Kp){var t=a||h.logUrl,n="https://".concat(t,"?version=").concat(h.info.version,"&appkey=").concat(h.info.appkey,"&userId=").concat(h.info.userId,"&logId=").concat(s,"&deviceId=").concat(h.deviceId,"&deviceInfo=").concat(h.deviceInfo,"&platform=Web"),r=5e3*(l-1);l++,setTimeout((function(){Kp&&h.info.runtime.httpReq({url:n,method:"POST",body:c}).then((function(){Js.debug("report full log success!")})).catch((function(t){e(),Js.warn("report full log error -> "+t)}))}),r)}}();case 19:case"end":return e.stop()}}),e)}))),function(e){return t.apply(this,arguments)})},{key:"distroy",value:function(){qp=1,Kp=!1}}],[{key:"init",value:function(t){return Kp=!0,e._instance||(e._instance=new e(t)),e._instance}},{key:"getInstance",value:function(){return e._instance}}]),e}();function Hp(e){return Object.assign({},e)}var Yp,Qp=function(){function e(t,n){var r;(a(this,e),this._runtime=t,this._token="",this._pluginContextQueue=[],this._pluginInstanseMap={},this.coreVersion="5.2.5-alpha.1",this._versionInfo={},this._typingInfo={},this._isInternalConnected=!1,this._connectionStatus=ua.DISCONNECTED,this._canRedirectConnect=!1,this._watcher={message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connectionState:void 0,rtcInnerWatcher:void 0,expansion:void 0,tag:void 0,conversationTagChanged:void 0,pullFinished:void 0,onConnecting:void 0,onConnected:void 0,onDisconnect:void 0,onSuspend:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0,ultraGroupEnable:void 0,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageModified:void 0,ultraGroupMessageRecalled:void 0},this._typingInternalTimer=-1,this._typingExpireTime=2e3,this._typingChangedList=[],this.getChatRoomHistoryMessages=this.getChatroomHistoryMessages,this._options=Object.assign({},n),this.appkey=this._options.appkey,this.apiVersion=this._options.apiVersion,this._options.typingExpireTime&&(this._options.typingExpireTime<2e3?this._typingExpireTime=2e3:this._options.typingExpireTime>6e3?this._typingExpireTime=6e3:this._typingExpireTime=this._options.typingExpireTime),this._options.navigators=this._options.navigators.filter((function(e){return/^https?:\/\//.test(e)})),this._options.navigators=this._options.navigators.map((function(e){return e.replace(/\/$/g,"")})),0===this._options.navigators.length)&&(r=this._options.navigators).push.apply(r,C(an));var i={status:this._connectionStatusListener.bind(this),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),conversationTag:this._conversationTagListener.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageModified:this._ultraGroupMessageModifiedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this)};this._engine=So()?new RCCppEngine(t,i,this._options):new Vp(t,i,this._options)}var t,n,r,i,o,l,h,f,d,g,p,v,y,m,_,E,T,R,S,b,w,O,N,k,M,A,U,L,x,P,D,V,B,G,F,q,K,j,H,Y,Q;return u(e,[{key:"install",value:function(e,t){if(this._pluginInstanseMap[e.tag])return Js.warn("Repeat install plugin: ".concat(e.tag)),this._pluginInstanseMap[e.tag];var n="RCRTC"===e.tag?new Gp(this):new Bp(this),r=null;try{if(!e.verify(this._runtime))return null;r=e.setup(n,this._runtime,t)}catch(e){Js.error("install plugin error!\n",e)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),r&&this._pluginContextQueue.push(n),r&&(this._pluginInstanseMap[e.tag]=r),r}},{key:"_handleRedirect",value:(Q=s(regeneratorRuntime.mark((function e(){var t,n,r=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return Js.debug("_handleRedirct",this._token),e.next=3,this.connect(this._token,!0);case 3:t=e.sent,(n=t.code)!==aa.SUCCESS&&this._canRedirectConnect&&(this._handleSuspend(n),setTimeout((function(){r._handleRedirect()}),5e3));case 6:case"end":return e.stop()}}),e,this)}))),function(){return Q.apply(this,arguments)})},{key:"_connectionStatusListener",value:(Y=s(regeneratorRuntime.mark((function e(t){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t===ua.REDIRECT?(this._canRedirectConnect=!0,this._handleSuspend(t),this._handleRedirect()):t===ua.BLOCKED||t===ua.KICKED_OFFLINE_BY_OTHER_CLIENT||t===ua.DISCONNECT_BY_SERVER?(this._canRedirectConnect=!1,this._handleDisconnect(t)):t===ua.CONNECTING?this._handleConnecting():t===ua.CONNECTED?this._handleConnected():t===ua.DISCONNECTED?this._handleDisconnect(t):t===ua.NETWORK_UNAVAILABLE&&this._handleSuspend(t),this._connectionStatus=t,(null===(n=this._watcher.rtcInnerWatcher)||void 0===n?void 0:n.status)&&this._watcher.rtcInnerWatcher.status(t),this._pluginContextQueue.forEach((function(e){e.onconnectionstatechange&&e.onconnectionstatechange(t)})),this._watcher.connectionState&&this._watcher.connectionState(t);case 5:case"end":return e.stop()}}),e,this)}))),function(e){return Y.apply(this,arguments)})},{key:"_handleConnecting",value:function(){this._watcher.onConnecting&&this._watcher.onConnecting()}},{key:"_handleConnected",value:function(){this._watcher.onConnected&&this._watcher.onConnected()}},{key:"_handleDisconnect",value:function(e){this._watcher.onDisconnect&&this._watcher.onDisconnect(e)}},{key:"_handleSuspend",value:function(e){this._watcher.onSuspend&&this._watcher.onSuspend(e)}},{key:"_messageReceiver",value:function(e,t,n){if((e.conversationType===Ms.RTC_ROOM||Object.prototype.hasOwnProperty.call(Ma,e.messageType))&&this._watcher.rtcInnerWatcher&&this._watcher.rtcInnerWatcher.message)this._watcher.rtcInnerWatcher.message(Hp(e));else if(-1===["RC:ChrmJoinNtf","RC:ChrmQuitNtf"].indexOf(e.messageType)||"function"!=typeof this._watcher.chatroomState){if("RC:ChrmMemChange"!==e.messageType){if(e.messageType!==ha.TYPING_STATUS||(this._addTypingInfo(Hp(e)),!this._watcher.typingState))if(e.messageType!==ha.LOG_COMMAND||"rongcloudsystem"!==e.senderUserId)if(e.messageType!==ha.INTERCEPT){if(!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(Hp(e))}catch(e){return Js.error("plugin error =>",e),!1}})))if(this._watcher.message&&this._watcher.message(Hp(e),t,n),"RC:ReadNtf"!==e.messageType)if("RC:RRReqMsg"!==e.messageType){if("RC:RRRspMsg"!==e.messageType)return e;var r,i=null===(r=e.content)||void 0===r?void 0:r.receiptMessageDic;i&&Array.isArray(i[this._engine.currentUserId])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,i[this._engine.currentUserId])}else"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId);else"function"==typeof this._watcher.readReceiptReceived&&this._watcher.readReceiptReceived({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.content.lastMessageSendTime)}else this._MessageBlockedListener({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||"",blockType:e.content.interceptType,blockedMessageUId:e.content.msgUId});else{var s,a=e.content,o=a.startTime,u=a.endTime,l=a.platform,h=a.logId,f=a.uri,d=a.packageName,g={startTime:parseInt(o),endTime:parseInt(u),platform:l,logId:h,uri:f,packageName:d};null===(s=jp.getInstance())||void 0===s||s.reportFullLog(g)}}else if("function"==typeof this._watcher.chatroomState){var p={};Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){p[e.userId]=e.status})),this._watcher.chatroomState({userChange:{users:p,chatroomId:e.targetId}})}}else this._watcher.chatroomState({userChange:{users:c({},e.senderUserId,"RC:ChrmQuitNtf"===e.messageType?Ta.QUIT:Ta.JOIN),chatroomId:e.targetId}})}},{key:"_batchMessageReceiver",value:function(e,t,n){var r=this,i=[];e.forEach((function(e){var s=r._messageReceiver(e,t,n);s&&i.push(s)})),i.length&&this._watcher.batchMessage&&this._watcher.batchMessage(i)}},{key:"_chatroomInfoListener",value:function(e){this._watcher.chatroomState&&this._watcher.chatroomState(e)}},{key:"_conversationInfoListener",value:function(e){this._watcher.conversationState&&this._watcher.conversationState(e)}},{key:"_expansionInfoListener",value:function(e){this._watcher.expansion&&this._watcher.expansion(e)}},{key:"_tagListener",value:function(){this._watcher.tag&&this._watcher.tag()}},{key:"_conversationTagListener",value:function(){this._watcher.conversationTagChanged&&this._watcher.conversationTagChanged()}},{key:"_typingStatusListener",value:function(e){this._watcher.typingState&&this._watcher.typingState(e)}},{key:"_pullFinishedListener",value:function(){this._watcher.pullFinished&&this._watcher.pullFinished()}},{key:"_MessageBlockedListener",value:function(e){this._watcher.messageBlocked&&this._watcher.messageBlocked(e)}},{key:"_ultraGroupEnableListener",value:function(e){this._watcher.ultraGroupEnable&&this._watcher.ultraGroupEnable(e)}},{key:"_operateStatusListener",value:function(e){this._watcher.operateStatus&&this._watcher.operateStatus(e)}},{key:"_ultraGroupMessageExpansionUpdatedListener",value:function(e){this._watcher.ultraGroupMessageExpansionUpdated&&this._watcher.ultraGroupMessageExpansionUpdated(e)}},{key:"_ultraGroupMessageModifiedListener",value:function(e){this._watcher.ultraGroupMessageModified&&this._watcher.ultraGroupMessageModified(e)}},{key:"_ultraGroupMessageRecalledListener",value:function(e){this._watcher.ultraGroupMessageRecalled&&this._watcher.ultraGroupMessageRecalled(e)}},{key:"_rtcDataChange",value:function(e,t){this._pluginContextQueue.forEach((function(n){n.onrtcdatachange&&n.onrtcdatachange(e,t)}))}},{key:"assignWatcher",value:function(e){var t=this;Object.keys(this._watcher).forEach((function(n){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t._watcher[n]=Fs(r)||Gs(r)?r:void 0}}))}},{key:"resetWatcher",value:function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))}},{key:"_addTypingInfo",value:function(e){var t=e.senderUserId,n=e.conversationType,r=e.targetId,i=e.content,s=e.channelId,a=i.typingContentType,o=s||"",u="".concat(n,"#").concat(r,"#").concat(o);this._typingInfo[u]||(this._typingInfo[u]=[]);var c=this._typingInfo[u].findIndex((function(e){return e.userId===t}));c>=0&&this._typingInfo[u][c].messageType===a?this._typingInfo[u][c].timestamp=Date.now():(c>=0&&this._typingInfo[u].splice(c,1),this._typingInfo[u].push({userId:t,messageType:a,timestamp:Date.now()}),this._typingChangedList.includes(u)||this._typingChangedList.push(u),this._startCheckTypingInfo())}},{key:"_startCheckTypingInfo",value:function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var n=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._typingExpireTime})),e._typingInfo[t].length===n||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}if(e._typingChangedList.length>0){var r=e._typingChangedList.map((function(t){return{conversationType:Number(t.split("#")[0]),targetId:t.split("#")[1],channelId:t.split("#")[2],list:e._typingInfo[t]||[]}}));e._typingStatusListener(r),e._typingChangedList=[]}0===Object.keys(e._typingInfo).length&&(clearInterval(e._typingInternalTimer),e._typingInternalTimer=-1)}),500))}},{key:"getConnectedTime",value:function(){return this._engine.getConnectedTime()}},{key:"getServerTime",value:function(){return this._engine.getServerTime()}},{key:"getDeviceId",value:function(){return this._engine.getDeviceId()}},{key:"getCurrentUserId",value:function(){return this._engine.currentUserId}},{key:"getConnectionStatus",value:function(){return this._connectionStatus}},{key:"token",get:function(){return this._token}},{key:"connect",value:(H=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l,h=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=h.length>1&&void 0!==h[1]&&h[1],r=h.length>2?h[2]:void 0,this._connectionStatus!==ua.CONNECTED){e.next=4;break}return e.abrupt("return",{code:aa.SUCCESS,userId:this._engine.currentUserId});case 4:if(this._connectionStatus!==ua.CONNECTING){e.next=6;break}return e.abrupt("return",{code:aa.BIZ_ERROR_CONNECTING});case 6:if("string"==typeof t&&0!==t.length){e.next=8;break}return e.abrupt("return",{code:aa.RC_CONN_USER_OR_PASSWD_ERROR});case 8:return this._token=t,i=t.split("@"),s=I(i,2),a=s[1],o=a?a.split(";").map((function(e){return/^https?:/.test(e)?e:"https://".concat(e)})):[],e.next=13,this._engine.navi.getInfo(this._getTokenWithoutNavi(),o,n,this._options.checkCA);case 13:if(u=e.sent){e.next=16;break}return e.abrupt("return",{code:aa.RC_NAVI_RESOURCE_ERROR});case 16:if(1!==(null==u?void 0:u.type)){e.next=18;break}return e.abrupt("return",{code:aa.PACKAGE_ENVIRONMENT_ERROR});case 18:return c=Fa.getInfo(),e.next=21,this._engine.connect(this._getTokenWithoutNavi(),u,r);case 21:if(l=e.sent,Js.__insertLogIntoDatabase(),l!==ca.REDIRECT){e.next=28;break}return this._connectionStatus=ua.REDIRECT,e.next=27,this.connect(t,!0);case 27:return e.abrupt("return",e.sent);case 28:return l===aa.SUCCESS&&(Js.info("connect success, userId: ".concat(this._engine.currentUserId)),1!==(null==u?void 0:u.type)&&this._engine.reportSDKInfo&&this._engine.reportSDKInfo(c),jp.init({runtime:this._runtime,logSwitch:(null==u?void 0:u.logSwitch)||0,logPolicy:JSON.parse((null==u?void 0:u.logPolicy)||"{}"),appkey:this.appkey,version:this.apiVersion,userId:this._engine.currentUserId}),Ws.init(this._engine.currentUserId),this._isInternalConnected=!0),l!==aa.SUCCESS||So()||1===u.openUS&&this._pullUserSettings(),l!==aa.SUCCESS&&(this._connectionStatus=ua.CONNECTION_CLOSED),e.abrupt("return",{code:l,userId:this._engine.currentUserId});case 32:case"end":return e.stop()}}),e,this)}))),function(e){return H.apply(this,arguments)})},{key:"_pullUserSettings",value:(j=s(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case 1:case"end":return e.stop()}}),e)}))),function(){return j.apply(this,arguments)})},{key:"disconnect",value:function(){var e;return this._isInternalConnected=!1,clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},null===(e=jp.getInstance())||void 0===e||e.distroy(),Js.__insertLogIntoDatabase(),Ws.reset(),this._engine.disconnect(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){Js.error("plugin error =>",e)}})),Promise.resolve()}},{key:"reconnect",value:function(e){return this._isInternalConnected?Promise.resolve({code:aa.CAN_NOT_RECONNECT}):this.connect(this._getTokenWithoutNavi(),!1,e)}},{key:"_getTokenWithoutNavi",value:function(){return this._token.replace(/@.+$/,"@")}},{key:"getInfoFromCache",value:function(){return this._engine.navi.getInfoFromCache(this._getTokenWithoutNavi())}},{key:"registerMessageType",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];this._engine.registerMessageType(e,t,n,r,i)}},{key:"sendMessage",value:function(e,t,n,r){if(e!==Ms.ULTRA_GROUP){var i=this.getInfoFromCache();if(1===((null==i?void 0:i.grpRRVer)||0)&&n.messageType===ha.READ_RECEIPT_RESPONSE)return Promise.resolve({code:aa.READ_RECEIPT_ERROR})}var s=n.canIncludeExpansion,a=void 0!==s&&s,o=n.expansion;if(a&&Hs(o))return Promise.resolve({code:aa.BIZ_ERROR_INVALID_PARAMETER});var u=JSON.stringify(n.content);return Yn(u)>ln?Promise.resolve({code:aa.RC_MSG_CONTENT_EXCEED_LIMIT}):e===Ms.ULTRA_GROUP?this._engine.sendUltraMessage(t,n):this._engine.sendMessage(e,t,n,r)}},{key:"sendExpansionMessage",value:(K=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l,h,f,d,g,p,v,y;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.channelId,r=t.conversationType,i=t.targetId,s=t.messageUId,a=t.keys,o=t.expansion,u=t.removeAll,t.canIncludeExpansion){e.next=3;break}return e.abrupt("return",{code:aa.MESSAGE_KV_NOT_SUPPORT});case 3:if(c=!1,l=Hs(o),h=!1,!Gs(o)){e.next=18;break}f=Object.keys(o).length,c=f>20,e.t0=regeneratorRuntime.keys(o);case 10:if((e.t1=e.t0()).done){e.next=18;break}if(d=e.t1.value,g=o[d],!(h=d.length>32||g.length>fn)&&!l){e.next=16;break}return e.abrupt("break",18);case 16:e.next=10;break;case 18:if(!c&&!h){e.next=20;break}return e.abrupt("return",{code:aa.EXPANSION_LIMIT_EXCEET});case 20:if(!l){e.next=22;break}return e.abrupt("return",{code:aa.BIZ_ERROR_INVALID_PARAMETER});case 22:return p={mid:s},o&&(p.put=o),a&&(p.del=a),u&&(p.removeAll=1),e.next=28,this._engine.sendMessage(r,i,{content:p,messageType:ha.EXPANSION_NOTIFY,channelId:n});case 28:return v=e.sent,y=v.code,e.abrupt("return",{code:y});case 31:case"end":return e.stop()}}),e,this)}))),function(e){return K.apply(this,arguments)})},{key:"sendReadReceiptMessage",value:(q=s(regeneratorRuntime.mark((function e(t,n,r){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==((null==(i=this.getInfoFromCache())?void 0:i.grpRRVer)||0)){e.next=4;break}return e.abrupt("return",{code:aa.READ_RECEIPT_ERROR,data:"The read receipt switch is not on, please call the sendMessage method!"});case 4:return e.abrupt("return",this._engine.sendReadReceiptMessage(t,n,r));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return q.apply(this,arguments)})},{key:"getMessageReader",value:(F=s(regeneratorRuntime.mark((function e(t,n,r){var i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==((null==(i=this.getInfoFromCache())?void 0:i.grpRRVer)||0)){e.next=4;break}return e.abrupt("return",{code:aa.READ_RECEIPT_ERROR});case 4:return e.abrupt("return",this._engine.getMessageReader(t,n,r));case 5:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return F.apply(this,arguments)})},{key:"_destroy",value:function(){var e;this._isInternalConnected=!1,this._watcher={batchMessage:void 0,message:void 0,conversationState:void 0,chatroomState:void 0,connectionState:void 0,rtcInnerWatcher:void 0,expansion:void 0,tag:void 0,conversationTagChanged:void 0,typingState:void 0,pullFinished:void 0,onConnecting:void 0,onConnected:void 0,onDisconnect:void 0,onSuspend:void 0},this._engine.disconnect(),this._pluginContextQueue.forEach((function(e){if(e.ondestroy)try{e.ondestroy()}catch(e){Js.error("plugin error =>",e)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},null===(e=jp.getInstance())||void 0===e||e.distroy(),Ws.reset()}},{key:"getHistoryMessage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:20,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",a=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";if(e===Ms.ULTRA_GROUP){var o={timestamp:n,count:r,order:i,channelId:s};return this._engine.getUltraHistoryMsg(t,o)}return this._engine.getHistoryMessage(e,t,n,r,i,s,a||"")}},{key:"getConversationList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:300,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(t===Ms.ULTRA_GROUP){var s=aa.METHOD_NOT_SUPPORT;return Promise.resolve({code:s,msg:aa[s]})}return this._engine.getConversationList(e,t,n,r,i)}},{key:"getConversation",value:function(e,t,n){return this._engine.getConversation(e,t,n)}},{key:"removeConversation",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e===Ms.ULTRA_GROUP?Promise.resolve(aa.METHOD_NOT_SUPPORT):this._engine.removeConversation(e,t,n)}},{key:"getUltraGroupList",value:function(){return this._engine.getUltraGroupList()}},{key:"getBlockUltraGroupList",value:function(){return this._engine.getBlockUltraGroupList()}},{key:"getTopUltraGroupList",value:function(){return this._engine.getTopUltraGroupList()}},{key:"clearUnreadCount",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return e===Ms.ULTRA_GROUP?this._engine.clearUltraUnreadcount(t,n):this._engine.clearConversationUnreadCount(e,t,n)}},{key:"clearAllUnreadCount",value:function(){return this._engine.clearAllUnreadCount()}},{key:"getUnreadCount",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this._engine.getConversationUnreadCount(e,t,n)}},{key:"getTotalUnreadCount",value:function(e,t,n){if(t&&t.includes(Ms.ULTRA_GROUP)){var r=aa.METHOD_NOT_SUPPORT;return Promise.resolve({code:r,msg:aa[r]})}return this._engine.getAllConversationUnreadCount(e,t&&t.length>0?t:[Ms.PRIVATE,Ms.GROUP,Ms.SYSTEM,Ms.PUBLIC_SERVICE],!!n)}},{key:"getFirstUnreadMessage",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this._engine.getFirstUnreadMessage(e,t,n)}},{key:"setConversationStatus",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(e===Ms.ULTRA_GROUP&&void 0!==n)return Promise.resolve(aa.METHOD_NOT_SUPPORT);var s=[{conversationType:e,targetId:t,isTop:n,notificationStatus:r,channelId:i}];return this._engine.batchSetConversationStatus(s)}},{key:"saveConversationMessageDraft",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return this._engine.saveConversationMessageDraft(e,t,n,r)}},{key:"getConversationMessageDraft",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this._engine.getConversationMessageDraft(e,t,n)}},{key:"clearConversationMessageDraft",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this._engine.clearConversationMessageDraft(e,t,n)}},{key:"recallMessage",value:function(e,t,n,r,i){return this._engine.recallMsg(e,t,n,r,i)}},{key:"deleteRemoteMessage",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return e===Ms.ULTRA_GROUP?Promise.resolve(aa.METHOD_NOT_SUPPORT):this._engine.deleteRemoteMessage(e,t,n,r)}},{key:"deleteRemoteMessageByTimestamp",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return this._engine.deleteRemoteMessageByTimestamp(e,t,n,r)}},{key:"joinChatroom",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return this._engine.joinChatroom(e,t)}},{key:"joinExistChatroom",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;return this._engine.joinExistChatroom(e,t)}},{key:"quitChatroom",value:function(e){return this._engine.quitChatroom(e)}},{key:"getChatroomInfo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return this._engine.getChatroomInfo(e,t,n)}},{key:"setChatroomEntry",value:function(e,t){var n=t.key,r=t.value;return mo(n)&&_o(r)?this._engine.setChatroomEntry(e,t):Promise.resolve(aa.BIZ_ERROR_INVALID_PARAMETER)}},{key:"setChatroomEntries",value:function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n],i=r.key,s=r.value;if(!mo(i)||!_o(s))return Promise.resolve({code:aa.BIZ_ERROR_INVALID_PARAMETER})}return this._engine.setChatroomEntries(e,t)}},{key:"forceSetChatroomEntry",value:function(e,t){var n=t.key,r=t.value;return mo(n)&&_o(r)?this._engine.forceSetChatroomEntry(e,t):Promise.resolve(aa.BIZ_ERROR_INVALID_PARAMETER)}},{key:"removeChatroomEntry",value:function(e,t){var n=t.key;return mo(n)?this._engine.removeChatroomEntry(e,t):Promise.resolve(aa.BIZ_ERROR_INVALID_PARAMETER)}},{key:"removeChatroomEntries",value:function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n].key;if(!mo(r))return Promise.resolve({code:aa.BIZ_ERROR_INVALID_PARAMETER})}return this._engine.removeChatroomEntries(e,t)}},{key:"forceRemoveChatroomEntry",value:function(e,t){var n=t.key;return mo(n)?this._engine.forceRemoveChatroomEntry(e,t):Promise.resolve(aa.BIZ_ERROR_INVALID_PARAMETER)}},{key:"getChatroomEntry",value:function(e,t){return this._engine.getChatroomEntry(e,t)}},{key:"getAllChatroomEntries",value:function(e){return this._engine.getAllChatroomEntry(e)}},{key:"getChatroomHistoryMessages",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return this._engine.getChatroomHistoryMessages(e,r,t,n)}},{key:"getFileToken",value:(G=s(regeneratorRuntime.mark((function e(t,n,r,i){var s,a,o,u,c,l,h;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=this.getInfoFromCache(),a=(null==s?void 0:s.bosAddr)||"",o=(null==s?void 0:s.uploadServer)||"",u=(null==s?void 0:s.ossConfig)||"",e.next=6,this._engine.getFileToken(t,n,r,i);case 6:if(c=e.sent,l=c.code,h=c.data,l!==aa.SUCCESS){e.next=11;break}return e.abrupt("return",Promise.resolve(Object.assign(h,{bos:a,qiniu:o,ossConfig:u})));case 11:return e.abrupt("return",Promise.reject(l));case 12:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return G.apply(this,arguments)})},{key:"getFileUrl",value:(B=s(regeneratorRuntime.mark((function e(t,n,r,i){var s,a,o,u,c=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(s=c.length>4&&void 0!==c[4]?c[4]:ya.QINIU,null==i||!i.isBosRes){e.next=3;break}return e.abrupt("return",Promise.resolve(i));case 3:return e.next=5,this._engine.getFileUrl(t,s,n,r);case 5:if(a=e.sent,o=a.code,u=a.data,o!==aa.SUCCESS){e.next=10;break}return e.abrupt("return",Promise.resolve(u));case 10:return e.abrupt("return",Promise.reject(o));case 11:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return B.apply(this,arguments)})},{key:"createTag",value:(V=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.createTag(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return V.apply(this,arguments)})},{key:"removeTag",value:(D=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.removeTag(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return D.apply(this,arguments)})},{key:"updateTag",value:(P=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.updateTag(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return P.apply(this,arguments)})},{key:"getTagList",value:(x=s(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.getTagList());case 1:case"end":return e.stop()}}),e,this)}))),function(){return x.apply(this,arguments)})},{key:"addTagForConversations",value:(L=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n.length>1e3)){e.next=2;break}return e.abrupt("return",Promise.reject(aa.CONVER_OUT_LIMIT_ERROR));case 2:return e.abrupt("return",this._engine.addTagForConversations(t,n));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return L.apply(this,arguments)})},{key:"removeTagForConversations",value:(U=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.removeTagForConversations(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return U.apply(this,arguments)})},{key:"removeTagsForConversation",value:(A=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.removeTagsForConversation(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"getConversationListByTag",value:(M=s(regeneratorRuntime.mark((function e(t,n,r,i){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.getConversationListByTag(t,n,r,i));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return M.apply(this,arguments)})},{key:"getUnreadCountByTag",value:(k=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.getUnreadCountByTag(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return k.apply(this,arguments)})},{key:"setConversationStatusInTag",value:(N=s(regeneratorRuntime.mark((function e(t,n,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.setConversationStatusInTag(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return N.apply(this,arguments)})},{key:"getTagsForConversation",value:(O=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.getTagsForConversation(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"getBlockConversationList",value:function(){return this._engine.getBlockConversationList()}},{key:"getTopConversationList",value:function(){return this._engine.getTopConversationList()}},{key:"getUnreadMentionedCount",value:function(e){return this._engine.getUnreadMentionedCount(e)}},{key:"getAllUnreadMentionedCount",value:function(){return this._engine.getAllUnreadMentionedCount()}},{key:"sendUltraGroupTypingStatus",value:function(e){if(e.conversationType!==Ms.ULTRA_GROUP){var t=aa.METHOD_ONLY_SUPPORT_ULTRA_GROUP;return Promise.resolve({code:t,msg:aa[t]})}return this._engine.sendUltraGroupTypingStatus(e)}},{key:"getUltraGroupMessageListByMessageUId",value:function(e){return this._engine.getUltraGroupMessageListByMessageUId(e)}},{key:"expandUltraMessage",value:(w=s(regeneratorRuntime.mark((function e(t){var n,r,i,s,a,o,u,c,l,h,f,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.channelId,n=t.conversationType,t.targetId,t.messageUId,t.keys,r=t.expansion,t.removeAll,i=t.canIncludeExpansion,n===Ms.ULTRA_GROUP){e.next=4;break}return s=aa.METHOD_ONLY_SUPPORT_ULTRA_GROUP,e.abrupt("return",{code:s,msg:aa[s]});case 4:if(i){e.next=6;break}return e.abrupt("return",{code:aa.MESSAGE_KV_NOT_SUPPORT});case 6:if(a=!1,o=Hs(r),u=!1,!Gs(r)){e.next=21;break}c=Object.keys(r).length,a=c>20,e.t0=regeneratorRuntime.keys(r);case 13:if((e.t1=e.t0()).done){e.next=21;break}if(l=e.t1.value,h=r[l],!(u=l.length>32||h.length>fn)){e.next=19;break}return e.abrupt("break",21);case 19:e.next=13;break;case 21:if(!a&&!u){e.next=23;break}return e.abrupt("return",{code:aa.EXPANSION_LIMIT_EXCEET});case 23:if(!o){e.next=25;break}return e.abrupt("return",{code:aa.BIZ_ERROR_INVALID_PARAMETER});case 25:return e.next=27,this._engine.expandUltraMessage(t);case 27:return f=e.sent,d=f.code,e.abrupt("return",{code:d});case 30:case"end":return e.stop()}}),e,this)}))),function(e){return w.apply(this,arguments)})},{key:"modifyMessage",value:(b=s(regeneratorRuntime.mark((function e(t){var n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.conversationType===Ms.ULTRA_GROUP){e.next=3;break}return n=aa.METHOD_ONLY_SUPPORT_ULTRA_GROUP,e.abrupt("return",{code:n,msg:aa[n]});case 3:return e.next=5,this._engine.modifyMessage(t);case 5:return r=e.sent,i=r.code,e.abrupt("return",{code:i});case 8:case"end":return e.stop()}}),e,this)}))),function(e){return b.apply(this,arguments)})},{key:"getUltraGroupUnreadMentionedCountByTargetId",value:function(e){return this._engine.getUltraGroupUnreadMentionedCountByTargetId(e)}},{key:"getAllConversationState",value:function(){return this._engine.getAllConversationState()}},{key:"callExtra",value:function(e){for(var t,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return(t=this._engine).callExtra.apply(t,[e].concat(r))}},{key:"clearConversations",value:(S=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._engine.clearConversations(t,n);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"setUserStatusListener",value:function(e,t){return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){Js.error(e)}}))}},{key:"addToBlacklist",value:(R=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.addToBlacklist(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return R.apply(this,arguments)})},{key:"removeFromBlacklist",value:(T=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.removeFromBlacklist(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return T.apply(this,arguments)})},{key:"getBlacklist",value:(E=s(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.getBlacklist());case 1:case"end":return e.stop()}}),e,this)}))),function(){return E.apply(this,arguments)})},{key:"getBlacklistStatus",value:(_=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.getBlacklistStatus(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return _.apply(this,arguments)})},{key:"insertMessage",value:(m=s(regeneratorRuntime.mark((function e(t,n,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.insertMessage(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return m.apply(this,arguments)})},{key:"deleteMessages",value:(y=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.deleteMessages(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return y.apply(this,arguments)})},{key:"deleteMessagesByTimestamp",value:(v=s(regeneratorRuntime.mark((function e(t,n,r,i){var s,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s=a.length>4&&void 0!==a[4]?a[4]:"",e.abrupt("return",this._engine.deleteMessagesByTimestamp(t,n,r,i,s));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return v.apply(this,arguments)})},{key:"clearMessages",value:(p=s(regeneratorRuntime.mark((function e(t,n){var r,i=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:"",e.abrupt("return",this._engine.clearMessages(t,n,r));case 2:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"getMessage",value:(g=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.getMessage(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return g.apply(this,arguments)})},{key:"setMessageContent",value:(d=s(regeneratorRuntime.mark((function e(t,n,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.setMessageContent(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return d.apply(this,arguments)})},{key:"setMessageSearchField",value:(f=s(regeneratorRuntime.mark((function e(t,n,r){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.setMessageSearchField(t,n,r));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return f.apply(this,arguments)})},{key:"setMessageSentStatus",value:(h=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.setMessageSentStatus(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"setMessageReceivedStatus",value:(l=s(regeneratorRuntime.mark((function e(t,n){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.setMessageReceivedStatus(t,n));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"setUserStatus",value:(o=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.setUserStatus(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"subscribeUserStatus",value:(i=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.subscribeUserStatus(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"getUserStatus",value:(r=s(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._engine.getUserStatus(t));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"searchConversationByContent",value:(n=s(regeneratorRuntime.mark((function e(t){var n,r,i,s=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:[],r=s.length>2&&void 0!==s[2]?s[2]:"",i=s.length>3?s[3]:void 0,e.abrupt("return",this._engine.searchConversationByContent(t,n,r,i));case 4:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{key:"searchMessageByContent",value:(t=s(regeneratorRuntime.mark((function e(t,n,r,i,s,a){var o,u=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=u.length>6&&void 0!==u[6]?u[6]:"",e.abrupt("return",this._engine.searchMessageByContent(t,n,r,i,s,a,o));case 2:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i,s,a){return t.apply(this,arguments)})},{key:"getUnreadMentionedMessages",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this._engine.getUnreadMentionedMessages(e,t,n)}},{key:"clearUnreadCountByTimestamp",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";return this._engine.clearUnreadCountByTimestamp(e,t,n,r)}},{key:"getConversationNotificationStatus",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this._engine.getConversationNotificationStatus(e,t,n)}},{key:"getRemoteHistoryMessages",value:function(e,t,n,r,i,s){return this._engine.getRemoteHistoryMessages(e,t,n,r,i,s)}},{key:"getConversationListWithAllChannel",value:function(){return this._engine.getConversationListWithAllChannel()}},{key:"getConversationListWithAllChannelByPage",value:function(e,t){return this._engine.getConversationListWithAllChannelByPage(e,t)}},{key:"joinRTCRoom",value:function(e,t,n,r,i,s){return this._engine.joinRTCRoom(e,t,n,r,i,s)}},{key:"quitRTCRoom",value:function(e){return this._engine.quitRTCRoom(e)}},{key:"rtcPing",value:function(e,t,n){return this._engine.rtcPing(e,t,n)}},{key:"getRTCRoomInfo",value:function(e){return this._engine.getRTCRoomInfo(e)}},{key:"getRTCUserInfoList",value:function(e){return this._engine.getRTCUserInfoList(e)}},{key:"getRTCUserInfo",value:function(e){return this._engine.getRTCUserInfo(e)}},{key:"setRTCUserInfo",value:function(e,t,n){return this._engine.setRTCUserInfo(e,t,n)}},{key:"removeRTCUserInfo",value:function(e,t){return this._engine.removeRTCUserInfo(e,t)}},{key:"setRTCData",value:function(e,t,n,r,i,s){return this._engine.setRTCData(e,t,n,r,i,s)}},{key:"setRTCTotalRes",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";return this._engine.setRTCTotalRes(e,t,n,r,i)}},{key:"setRTCCDNUris",value:function(e,t,n){return this._engine.setRTCCDNUris(e,t,n)}},{key:"getRTCData",value:function(e,t,n,r){return this._engine.getRTCData(e,t,n,r)}},{key:"removeRTCData",value:function(e,t,n,r,i){return this._engine.removeRTCData(e,t,n,r,i)}},{key:"setRTCOutData",value:function(e,t,n,r){return this._engine.setRTCOutData(e,t,n,r)}},{key:"getRTCOutData",value:function(e,t){return this._engine.getRTCOutData(e,t)}},{key:"getRTCToken",value:function(e,t,n){return this._engine.getRTCToken(e,t,n)}},{key:"setRTCState",value:function(e,t){return this._engine.setRTCState(e,t)}},{key:"getRTCUserList",value:function(e){return this._engine.getRTCUserList(e)}},{key:"joinLivingRoomAsAudience",value:function(e,t,n){return this._engine.joinLivingRoomAsAudience(e,t,n)}},{key:"quitLivingRoomAsAudience",value:function(e){return this._engine.quitLivingRoomAsAudience(e)}},{key:"rtcIdentityChange",value:function(e,t,n){return this._engine.rtcIdentityChange(e,t,n)}},{key:"getRTCJoinedUserInfo",value:function(e){return this._engine.getRTCJoinedUserInfo(e)}},{key:"requestRoomPK",value:function(e){return this._engine.requestRoomPK(e)}},{key:"cancelRoomPK",value:function(e){return this._engine.cancelRoomPK(e)}},{key:"responseRoomPK",value:function(e){return this._engine.responseRoomPK(e)}},{key:"endRoomPK",value:function(e){return this._engine.endRoomPK(e)}},{key:"bindRTCRoomForChatroom",value:function(e){return this._engine.bindRTCRoomForChatroom(e)}}],[{key:"init",value:function(t,n){return Js.setLogLevel(n.logLevel),Js.setLogStdout(n.logStdout),(n.indexDBSwitch||qs(n.indexDBSwitch))&&gs.init(),Js.debug("APIContext.init =>",n.appkey,n.navigators),this._context?(Js.error("Repeat initialize!"),this._context):(Js.warn("RCEngine Commit:","ad1880737e9cafc9108824f145582ade925e0d78"),this._context=new e(t,n),Js.__insertLogIntoDatabase(),this._context)}},{key:"destroy",value:function(){this._context&&(this._context._destroy(),this._context=void 0)}}]),e}();e.TagChangeType=void 0,(Yp=e.TagChangeType||(e.TagChangeType={}))[Yp.add=1]="add",Yp[Yp.update=2]="update",Yp[Yp.delete=3]="delete";e.AEngine=Fg,e.ANavi=Qg,e.APIContext=Qp,e.AppStorage=yn,e.CPP_PROTOCAL_MSGTYPE_OPTION={"RC:DizNtf":{isCounted:!1,isPersited:!1}},e.CallLibMsgType=Ma,e.ChatroomEntryType=_a,e.ChatroomMemberChangeType=Ta,e.CometChannel=Gg,e.ConnectResultCode=ca,e.ConnectionStatus=ua,e.ConversationType=Ms,e.DelayTimer=Mo,e.ErrorCode=aa,e.EventEmitter=na,e.FileType=Us,e.IM_COMET_PULLMSG_TIMEOUT=45e3,e.IM_PING_INTERVAL_TIME=15e3,e.IM_PING_MIN_TIMEOUT=2e3,e.IM_PING_TIMEOUT=15e3,e.IM_SIGNAL_TIMEOUT=cn,e.Logger=Ws,e.MAX_MESSAGE_CONTENT_BYTES=ln,e.MAX_MESSAGE_EXPANSION_KEY_LENGTH=32,e.MAX_MESSAGE_EXPANSION_VAL_LENGTH=fn,e.MINI_COMET_CONNECT_URIS=un,e.MINI_SOCKET_CONNECT_URIS=on,e.MentionedType=pa,e.MessageBlockType=Ia,e.MessageDirection=ia,e.MessageType=ha,e.NAVI_CACHE_DURATION=nn,e.NAVI_REQ_TIMEOUT=1e4,e.NotificationStatus=da,e.OperateStatus=wa,e.PING_REQ_TIMEOUT=rn,e.PUBLIC_CLOUD_NAVI_URIS=an,e.PluginContext=Bp,e.RCAssertError=Ka,e.RTCPluginContext=Gp,e.ReceivedStatus=n,e.SEND_MESSAGE_TYPE_OPTION=dn,e.STATUS_MESSAGE=gn,e.STORAGE_ROOT_KEY=hn,e.UploadMethod=ya,e.VersionManage=Fa,e.WEB_SOCKET_TIMEOUT=sn,e.WebSocketChannel=Vg,e.appendUrl=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return n.length?[e,n.join("&")].join("?"):e},e.assert=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!ja(e,t,n,r))throw new Ka("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},e.clone=No,e.cloneByJSON=Co,e.forEach=Eo,e.formatConnectResponseCode=wo,e.getBrowser=bo,e.getMimeKey=function(e){var t="application/octet-stream";switch(e){case Us.IMAGE:t="image/jpeg";break;case Us.AUDIO:t="audio/amr";break;case Us.VIDEO:t="video/3gpp";break;case Us.SIGHT:t="video/mpeg4";break;case Us.COMBINE_HTML:t="text/html"}return t},e.getUploadFileName=po,e.indexOf=Ro,e.isArray=Ds,e.isArrayBuffer=Vs,e.isBoolean=xs,e.isFunction=Fs,e.isHttpUrl=function(e){return Ls(e)&&/https?:\/\//.test(e)},e.isInObject=Io,e.isInclude=function(e,t){return-1!==Ro(e,t)},e.isNull=Ks,e.isNumber=Ps,e.isObject=Gs,e.isString=Ls,e.isUndefined=qs,e.isValidChrmEntryKey=mo,e.isValidChrmEntryValue=_o,e.isValidConversationType=function(e){return Ps(e)&&Object.prototype.hasOwnProperty.call(Ms,e)},e.isValidExpansion=Hs,e.isValidFileType=function(e){return Ps(e)&&Object.prototype.hasOwnProperty.call(Us,e)},e.map=To,e.notEmptyArray=function(e){return Ds(e)&&e.length>0},e.notEmptyObject=js,e.notEmptyString=Bs,e.pushConfigsToJSON=vo,e.pushJSONToConfigs=yo,e.todo=function(e){return new mn(e)},e.usingCppEngine=So,e.validate=ja,e.version="5.2.5-alpha.1",Object.defineProperty(e,"__esModule",{value:!0})}));
|