bztang-admin/addons/yun_shop/static/app/js/chunk-2d224cb5.064063e0.js

1 line
618 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d224cb5"],{e23e:function(e,t,n){"use strict";(function(o){var r,a,s=n("7037").default;n("b64b"),n("a4d3"),n("4de4"),n("d3b7"),n("e439"),n("159b"),n("dbb4"),n("e01a"),n("d28b"),n("3ca3"),n("ddb0"),n("d9e2"),n("131a"),n("3410"),n("f8c9"),n("4ae1"),n("4ec9"),n("25f0"),n("a630"),n("fb6a"),n("b0c0"),n("ac1f"),n("00b4"),n("6c57"),n("1276"),n("466d"),n("0541"),n("5319"),n("a15b"),n("99af"),n("7039"),n("4d63"),n("c607"),n("2c3e"),n("498a"),n("d81d"),n("6062"),n("10d1"),n("1fe2"),n("ace4"),n("944a"),n("0c47"),n("23dc"),n("5377"),n("caad"),n("2532"),n("a6fd"),n("7db0"),n("2ca0"),n("a9e3"),n("c19f"),n("c906"),n("cee85"),n("a434"),n("e9c4"),n("2b3d"),n("9861"),n("4e82"),n("841c"),n("07ac"),n("c740"),n("f5b2"),n("8ba4"),n("a874"),n("8a59"),n("907a"),n("9a8c"),n("a975"),n("735e"),n("c1ac"),n("d139"),n("3a7b"),n("d5d6"),n("82f8"),n("e91f"),n("60bd"),n("5f96"),n("3280"),n("3fcc"),n("ca91"),n("25a1"),n("cd26"),n("3c5d"),n("2954"),n("649e"),n("219c"),n("170b"),n("b39a"),n("72f7"),n("fa9e"),n("77d9"),n("fd87"),n("f6d6"),n("5cc6"),function(o,i){"object"==s(t)&&"undefined"!=typeof e?e.exports=i():(r=i,a="function"===typeof r?r.call(t,n,t,e):r,void 0===a||(e.exports=a))}(0,(function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?e(Object(o),!0).forEach((function(e){u(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e){return(n="function"==typeof Symbol&&"symbol"==s(Symbol.iterator)?function(e){return s(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":s(e)})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function i(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function u(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(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}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}function l(e){return(l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(){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 g(e,t,n){return(g=p()?Reflect.construct:function(e,t,n){var o=[null];o.push.apply(o,t);var r=new(Function.bind.apply(e,o));return n&&d(r,n.prototype),r}).apply(null,arguments)}function _(e){var t="function"==typeof Map?new Map:void 0;return(_=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,o)}function o(){return g(e,arguments,l(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),d(o,e)})(e)}function h(e,t){if(null==e)return{};var n,o,r=function(e,t){if(null==e)return{};var n,o,r={},a=Object.keys(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e,t){if(t&&("object"==s(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return f(e)}function v(e){var t=p();return function(){var n,o=l(e);if(t){var r=l(this).constructor;n=Reflect.construct(o,arguments,r)}else n=o.apply(this,arguments);return m(this,n)}}function M(e,t){return I(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,a=[],s=!0,i=!1;try{for(n=n.call(e);!(s=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);s=!0);}catch(l){i=!0,r=l}finally{try{s||null==n.return||n.return()}finally{if(i)throw r}}return a}}(e,t)||E(e,t)||S()}function y(e){return function(e){if(Array.isArray(e))return C(e)}(e)||T(e)||E(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 I(e){if(Array.isArray(e))return e}function T(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function E(e,t){if(e){if("string"==typeof e)return C(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)?C(e,t):void 0}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function S(){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 A(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=E(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var o=0,r=function(){};return{s:r,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,s=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){i=!0,a=e},f:function(){try{s||null==n.return||n.return()}finally{if(i)throw a}}}}var D="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof o?o:"undefined"!=typeof self?self:{};function N(e,t){return e(t={exports:{}},t.exports),t.exports}var O,R,L=function(e){return e&&e.Math==Math&&e},k=L("object"==("undefined"===typeof globalThis?"undefined":s(globalThis))&&globalThis)||L("object"==("undefined"===typeof window?"undefined":s(window))&&window)||L("object"==("undefined"===typeof self?"undefined":s(self))&&self)||L("object"==s(D)&&D)||function(){return this}()||Function("return this")(),G=function(e){try{return!!e()}catch(t){return!0}},P=!G((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),U=!G((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),b=Function.prototype.call,w=U?b.bind(b):function(){return b.apply(b,arguments)},F={}.propertyIsEnumerable,q=Object.getOwnPropertyDescriptor,V={f:q&&!F.call({1:2},1)?function(e){var t=q(this,e);return!!t&&t.enumerable}:F},x=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},B=Function.prototype,K=B.bind,H=B.call,j=U&&K.bind(H,H),W=U?function(e){return e&&j(e)}:function(e){return e&&function(){return H.apply(e,arguments)}},Y=W({}.toString),z=W("".slice),J=function(e){return z(Y(e),8,-1)},X=k.Object,Q=W("".split),Z=G((function(){return!X("z").propertyIsEnumerable(0)}))?function(e){return"String"==J(e)?Q(e,""):X(e)}:X,$=k.TypeError,ee=function(e){if(null==e)throw $("Can't call method on "+e);return e},te=function(e){return Z(ee(e))},ne=function(e){return"function"==typeof e},oe=function(e){return"object"==s(e)?null!==e:ne(e)},re=function(e){return ne(e)?e:void 0},ae=function(e,t){return arguments.length<2?re(k[e]):k[e]&&k[e][t]},se=W({}.isPrototypeOf),ie=ae("navigator","userAgent")||"",ue=k.process,ce=k.Deno,le=ue&&ue.versions||ce&&ce.version,de=le&&le.v8;de&&(R=(O=de.split("."))[0]>0&&O[0]<4?1:+(O[0]+O[1])),!R&&ie&&(!(O=ie.match(/Edge\/(\d+)/))||O[1]>=74)&&(O=ie.match(/Chrome\/(\d+)/))&&(R=+O[1]);var pe=R,ge=!!Object.getOwnPropertySymbols&&!G((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&pe&&pe<41})),_e=ge&&!Symbol.sham&&"symbol"==s(Symbol.iterator),he=k.Object,fe=_e?function(e){return"symbol"==s(e)}:function(e){var t=ae("Symbol");return ne(t)&&se(t.prototype,he(e))},me=k.String,ve=function(e){try{return me(e)}catch(t){return"Object"}},Me=k.TypeError,ye=function(e){if(ne(e))return e;throw Me(ve(e)+" is not a function")},Ie=function(e,t){var n=e[t];return null==n?void 0:ye(n)},Te=k.TypeError,Ee=Object.defineProperty,Ce=function(e,t){try{Ee(k,e,{value:t,configurable:!0,writable:!0})}catch(n){k[e]=t}return t},Se=k["__core-js_shared__"]||Ce("__core-js_shared__",{}),Ae=N((function(e){(e.exports=function(e,t){return Se[e]||(Se[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.21.0",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.0/LICENSE",source:"https://github.com/zloirock/core-js"})})),De=k.Object,Ne=function(e){return De(ee(e))},Oe=W({}.hasOwnProperty),Re=Object.hasOwn||function(e,t){return Oe(Ne(e),t)},Le=0,ke=Math.random(),Ge=W(1..toString),Pe=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Ge(++Le+ke,36)},Ue=Ae("wks"),be=k.Symbol,we=be&&be.for,Fe=_e?be:be&&be.withoutSetter||Pe,qe=function(e){if(!Re(Ue,e)||!ge&&"string"!=typeof Ue[e]){var t="Symbol."+e;ge&&Re(be,e)?Ue[e]=be[e]:Ue[e]=_e&&we?we(t):Fe(t)}return Ue[e]},Ve=k.TypeError,xe=qe("toPrimitive"),Be=function(e,t){if(!oe(e)||fe(e))return e;var n,o=Ie(e,xe);if(o){if(void 0===t&&(t="default"),n=w(o,e,t),!oe(n)||fe(n))return n;throw Ve("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,o;if("string"===t&&ne(n=e.toString)&&!oe(o=w(n,e)))return o;if(ne(n=e.valueOf)&&!oe(o=w(n,e)))return o;if("string"!==t&&ne(n=e.toString)&&!oe(o=w(n,e)))return o;throw Te("Can't convert object to primitive value")}(e,t)},Ke=function(e){var t=Be(e,"string");return fe(t)?t:t+""},He=k.document,je=oe(He)&&oe(He.createElement),We=function(e){return je?He.createElement(e):{}},Ye=!P&&!G((function(){return 7!=Object.defineProperty(We("div"),"a",{get:function(){return 7}}).a})),ze=Object.getOwnPropertyDescriptor,Je={f:P?ze:function(e,t){if(e=te(e),t=Ke(t),Ye)try{return ze(e,t)}catch(n){}if(Re(e,t))return x(!w(V.f,e,t),e[t])}},Xe=P&&G((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Qe=k.String,Ze=k.TypeError,$e=function(e){if(oe(e))return e;throw Ze(Qe(e)+" is not an object")},et=k.TypeError,nt=Object.defineProperty,ot=Object.getOwnPropertyDescriptor,rt={f:P?Xe?function(e,t,n){if($e(e),t=Ke(t),$e(n),"function"==typeof e&&"prototype"===t&&"value"in n&&"writable"in n&&!n.writable){var o=ot(e,t);o&&o.writable&&(e[t]=n.value,n={configurable:"configurable"in n?n.configurable:o.configurable,enumerable:"enumerable"in n?n.enumerable:o.enumerable,writable:!1})}return nt(e,t,n)}:nt:function(e,t,n){if($e(e),t=Ke(t),$e(n),Ye)try{return nt(e,t,n)}catch(r){}if("get"in n||"set"in n)throw et("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},at=P?function(e,t,n){return rt.f(e,t,x(1,n))}:function(e,t,n){return e[t]=n,e},st=W(Function.toString);ne(Se.inspectSource)||(Se.inspectSource=function(e){return st(e)});var it,ut,ct,lt=Se.inspectSource,dt=k.WeakMap,pt=ne(dt)&&/native code/.test(lt(dt)),gt=Ae("keys"),_t=function(e){return gt[e]||(gt[e]=Pe(e))},ht={},ft=k.TypeError,mt=k.WeakMap;if(pt||Se.state){var vt=Se.state||(Se.state=new mt),Mt=W(vt.get),yt=W(vt.has),It=W(vt.set);it=function(e,t){if(yt(vt,e))throw new ft("Object already initialized");return t.facade=e,It(vt,e,t),t},ut=function(e){return Mt(vt,e)||{}},ct=function(e){return yt(vt,e)}}else{var Tt=_t("state");ht[Tt]=!0,it=function(e,t){if(Re(e,Tt))throw new ft("Object already initialized");return t.facade=e,at(e,Tt,t),t},ut=function(e){return Re(e,Tt)?e[Tt]:{}},ct=function(e){return Re(e,Tt)}}var Et={set:it,get:ut,has:ct,enforce:function(e){return ct(e)?ut(e):it(e,{})},getterFor:function(e){return function(t){var n;if(!oe(t)||(n=ut(t)).type!==e)throw ft("Incompatible receiver, "+e+" required");return n}}},Ct=Function.prototype,St=P&&Object.getOwnPropertyDescriptor,At=Re(Ct,"name"),Dt={EXISTS:At,PROPER:At&&"something"===function(){}.name,CONFIGURABLE:At&&(!P||P&&St(Ct,"name").configurable)},Nt=N((function(e){var t=Dt.CONFIGURABLE,n=Et.get,o=Et.enforce,r=String(String).split("String");(e.exports=function(e,n,a,s){var i,u=!!s&&!!s.unsafe,c=!!s&&!!s.enumerable,l=!!s&&!!s.noTargetGet,d=s&&void 0!==s.name?s.name:n;ne(a)&&("Symbol("===String(d).slice(0,7)&&(d="["+String(d).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!Re(a,"name")||t&&a.name!==d)&&at(a,"name",d),(i=o(a)).source||(i.source=r.join("string"==typeof d?d:""))),e!==k?(u?!l&&e[n]&&(c=!0):delete e[n],c?e[n]=a:at(e,n,a)):c?e[n]=a:Ce(n,a)})(Function.prototype,"toString",(function(){return ne(this)&&n(this).source||lt(this)}))})),Ot=Math.ceil,Rt=Math.floor,Lt=function(e){var t=+e;return t!=t||0===t?0:(t>0?Rt:Ot)(t)},kt=Math.max,Gt=Math.min,Pt=function(e,t){var n=Lt(e);return n<0?kt(n+t,0):Gt(n,t)},Ut=Math.min,bt=function(e){return e>0?Ut(Lt(e),9007199254740991):0},wt=function(e){return bt(e.length)},Ft=function(e){return function(t,n,o){var r,a=te(t),s=wt(a),i=Pt(o,s);if(e&&n!=n){for(;s>i;)if((r=a[i++])!=r)return!0}else for(;s>i;i++)if((e||i in a)&&a[i]===n)return e||i||0;return!e&&-1}},qt={includes:Ft(!0),indexOf:Ft(!1)},Vt=qt.indexOf,xt=W([].push),Bt=function(e,t){var n,o=te(e),r=0,a=[];for(n in o)!Re(ht,n)&&Re(o,n)&&xt(a,n);for(;t.length>r;)Re(o,n=t[r++])&&(~Vt(a,n)||xt(a,n));return a},Kt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ht=Kt.concat("length","prototype"),jt={f:Object.getOwnPropertyNames||function(e){return Bt(e,Ht)}},Wt={f:Object.getOwnPropertySymbols},Yt=W([].concat),zt=ae("Reflect","ownKeys")||function(e){var t=jt.f($e(e)),n=Wt.f;return n?Yt(t,n(e)):t},Jt=function(e,t,n){for(var o=zt(t),r=rt.f,a=Je.f,s=0;s<o.length;s++){var i=o[s];Re(e,i)||n&&Re(n,i)||r(e,i,a(t,i))}},Xt=/#|\.prototype\./,Qt=function(e,t){var n=$t[Zt(e)];return n==tn||n!=en&&(ne(t)?G(t):!!t)},Zt=Qt.normalize=function(e){return String(e).replace(Xt,".").toLowerCase()},$t=Qt.data={},en=Qt.NATIVE="N",tn=Qt.POLYFILL="P",nn=Qt,on=Je.f,rn=function(e,t){var n,o,r,a,i,u=e.target,c=e.global,l=e.stat;if(n=c?k:l?k[u]||Ce(u,{}):(k[u]||{}).prototype)for(o in t){if(a=t[o],r=e.noTargetGet?(i=on(n,o))&&i.value:n[o],!nn(c?o:u+(l?".":"#")+o,e.forced)&&void 0!==r){if(s(a)==s(r))continue;Jt(a,r)}(e.sham||r&&r.sham)&&at(a,"sham",!0),Nt(n,o,a,e)}},an={};an[qe("toStringTag")]="z";var sn="[object z]"===String(an),un=qe("toStringTag"),cn=k.Object,ln="Arguments"==J(function(){return arguments}()),dn=sn?J:function(e){var t,n,o;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(n){}}(t=cn(e),un))?n:ln?J(t):"Object"==(o=J(t))&&ne(t.callee)?"Arguments":o},pn=k.String,gn=function(e){if("Symbol"===dn(e))throw TypeError("Cannot convert a Symbol value to a string");return pn(e)},_n="\t\n\v\f\r    \u2028\u2029\ufeff",hn=W("".replace),fn="["+_n+"]",mn=RegExp("^"+fn+fn+"*"),vn=RegExp(fn+fn+"*$"),Mn=function(e){return function(t){var n=gn(ee(t));return 1&e&&(n=hn(n,mn,"")),2&e&&(n=hn(n,vn,"")),n}},yn={start:Mn(1),end:Mn(2),trim:Mn(3)},In=yn.trim,Tn=k.parseInt,En=k.Symbol,Cn=En&&En.iterator,Sn=/^[+-]?0x/i,An=W(Sn.exec),Dn=8!==Tn(_n+"08")||22!==Tn(_n+"0x16")||Cn&&!G((function(){Tn(Object(Cn))}))?function(e,t){var n=In(gn(e));return Tn(n,t>>>0||(An(Sn,n)?16:10))}:Tn;rn({global:!0,forced:parseInt!=Dn},{parseInt:Dn});var Nn,On=Object.keys||function(e){return Bt(e,Kt)},Rn={f:P&&!Xe?Object.defineProperties:function(e,t){$e(e);for(var n,o=te(t),r=On(t),a=r.length,s=0;a>s;)rt.f(e,n=r[s++],o[n]);return e}},Ln=ae("document","documentElement"),kn=_t("IE_PROTO"),Gn=function(){},Pn=function(e){return"<script>"+e+"<\/script>"},Un=function(e){e.write(Pn("")),e.close();var t=e.parentWindow.Object;return e=null,t},bn=function(){try{Nn=new ActiveXObject("htmlfile")}catch(r){}var e,t;bn="undefined"!=typeof document?document.domain&&Nn?Un(Nn):((t=We("iframe")).style.display="none",Ln.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Pn("document.F=Object")),e.close(),e.F):Un(Nn);for(var n=Kt.length;n--;)delete bn.prototype[Kt[n]];return bn()};ht[kn]=!0;var wn=Object.create||function(e,t){var n;return null!==e?(Gn.prototype=$e(e),n=new Gn,Gn.prototype=null,n[kn]=e):n=bn(),void 0===t?n:Rn.f(n,t)};rn({target:"Object",stat:!0,sham:!P},{create:wn});var Fn=W(W.bind),qn=function(e,t){return ye(e),void 0===t?e:U?Fn(e,t):function(){return e.apply(t,arguments)}},Vn=Array.isArray||function(e){return"Array"==J(e)},xn=function(){},Bn=[],Kn=ae("Reflect","construct"),Hn=/^\s*(?:class|function)\b/,jn=W(Hn.exec),Wn=!Hn.exec(xn),Yn=function(e){if(!ne(e))return!1;try{return Kn(xn,Bn,e),!0}catch(t){return!1}},zn=function(e){if(!ne(e))return!1;switch(dn(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Wn||!!jn(Hn,lt(e))}catch(t){return!0}};zn.sham=!0;var Jn=!Kn||G((function(){var e;return Yn(Yn.call)||!Yn(Object)||!Yn((function(){e=!0}))||e}))?zn:Yn,Xn=qe("species"),Qn=k.Array,Zn=function(e,t){return new(function(e){var t;return Vn(e)&&(t=e.constructor,(Jn(t)&&(t===Qn||Vn(t.prototype))||oe(t)&&null===(t=t[Xn]))&&(t=void 0)),void 0===t?Qn:t}(e))(0===t?0:t)},$n=W([].push),eo=function(e){var t=1==e,n=2==e,o=3==e,r=4==e,a=6==e,s=7==e,i=5==e||a;return function(u,c,l,d){for(var p,g,_=Ne(u),h=Z(_),f=qn(c,l),m=wt(h),v=0,M=d||Zn,y=t?M(u,m):n||s?M(u,0):void 0;m>v;v++)if((i||v in h)&&(g=f(p=h[v],v,_),e))if(t)y[v]=g;else if(g)switch(e){case 3:return!0;case 5:return p;case 6:return v;case 2:$n(y,p)}else switch(e){case 4:return!1;case 7:$n(y,p)}return a?-1:o||r?r:y}},to={forEach:eo(0),map:eo(1),filter:eo(2),some:eo(3),every:eo(4),find:eo(5),findIndex:eo(6),filterReject:eo(7)},no=function(e,t){var n=[][e];return!!n&&G((function(){n.call(null,t||function(){throw 1},1)}))},oo=to.forEach,ro=no("forEach")?[].forEach:function(e){return oo(this,e,arguments.length>1?arguments[1]:void 0)};rn({target:"Array",proto:!0,forced:[].forEach!=ro},{forEach:ro});var ao=sn?{}.toString:function(){return"[object "+dn(this)+"]"};sn||Nt(Object.prototype,"toString",ao,{unsafe:!0});var so={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},io=We("span").classList,uo=io&&io.constructor&&io.constructor.prototype,co=uo===Object.prototype?void 0:uo,lo=function(e){if(e&&e.forEach!==ro)try{at(e,"forEach",ro)}catch(t){e.forEach=ro}};for(var po in so)so[po]&&lo(k[po]&&k[po].prototype);lo(co);var go=G((function(){On(1)}));rn({target:"Object",stat:!0,forced:go},{keys:function(e){return On(Ne(e))}});var _o=function(e,t,n){var o,r;$e(e);try{if(!(o=Ie(e,"return"))){if("throw"===t)throw n;return n}o=w(o,e)}catch(i){r=!0,o=i}if("throw"===t)throw n;if(r)throw o;return $e(o),n},ho=function(e,t,n,o){try{return o?t($e(n)[0],n[1]):t(n)}catch(a){_o(e,"throw",a)}},fo={},mo=qe("iterator"),vo=Array.prototype,Mo=function(e){return void 0!==e&&(fo.Array===e||vo[mo]===e)},yo=function(e,t,n){var o=Ke(t);o in e?rt.f(e,o,x(0,n)):e[o]=n},Io=qe("iterator"),To=function(e){if(null!=e)return Ie(e,Io)||Ie(e,"@@iterator")||fo[dn(e)]},Eo=k.TypeError,Co=function(e,t){var n=arguments.length<2?To(e):t;if(ye(n))return $e(w(n,e));throw Eo(ve(e)+" is not iterable")},So=k.Array,Ao=function(e){var t=Ne(e),n=Jn(this),o=arguments.length,r=o>1?arguments[1]:void 0,a=void 0!==r;a&&(r=qn(r,o>2?arguments[2]:void 0));var s,i,u,c,l,d,p=To(t),g=0;if(!p||this==So&&Mo(p))for(s=wt(t),i=n?new this(s):So(s);s>g;g++)d=a?r(t[g],g):t[g],yo(i,g,d);else for(l=(c=Co(t,p)).next,i=n?new this:[];!(u=w(l,c)).done;g++)d=a?ho(c,r,[u.value,g],!0):u.value,yo(i,g,d);return i.length=g,i},Do=qe("iterator"),No=!1;try{var Oo=0,Ro={next:function(){return{done:!!Oo++}},return:function(){No=!0}};Ro[Do]=function(){return this},Array.from(Ro,(function(){throw 2}))}catch(kC){}var Lo=function(e,t){if(!t&&!No)return!1;var n=!1;try{var o={};o[Do]=function(){return{next:function(){return{done:n=!0}}}},e(o)}catch(kC){}return n},ko=!Lo((function(e){Array.from(e)}));rn({target:"Array",stat:!0,forced:ko},{from:Ao});var Go,Po,Uo,bo=W("".charAt),wo=W("".charCodeAt),Fo=W("".slice),qo=function(e){return function(t,n){var o,r,a=gn(ee(t)),s=Lt(n),i=a.length;return s<0||s>=i?e?"":void 0:(o=wo(a,s))<55296||o>56319||s+1===i||(r=wo(a,s+1))<56320||r>57343?e?bo(a,s):o:e?Fo(a,s,s+2):r-56320+(o-55296<<10)+65536}},Vo={codeAt:qo(!1),charAt:qo(!0)},xo=!G((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Bo=_t("IE_PROTO"),Ko=k.Object,Ho=Ko.prototype,jo=xo?Ko.getPrototypeOf:function(e){var t=Ne(e);if(Re(t,Bo))return t[Bo];var n=t.constructor;return ne(n)&&t instanceof n?n.prototype:t instanceof Ko?Ho:null},Wo=qe("iterator"),Yo=!1;[].keys&&("next"in(Uo=[].keys())?(Po=jo(jo(Uo)))!==Object.prototype&&(Go=Po):Yo=!0),(null==Go||G((function(){var e={};return Go[Wo].call(e)!==e})))&&(Go={}),ne(Go[Wo])||Nt(Go,Wo,(function(){return this}));var zo={IteratorPrototype:Go,BUGGY_SAFARI_ITERATORS:Yo},Jo=rt.f,Xo=qe("toStringTag"),Qo=function(e,t,n){e&&!n&&(e=e.prototype),e&&!Re(e,Xo)&&Jo(e,Xo,{configurable:!0,value:t})},Zo=zo.IteratorPrototype,$o=function(){return this},er=function(e,t,n,o){var r=t+" Iterator";return e.prototype=wn(Zo,{next:x(+!o,n)}),Qo(e,r,!1),fo[r]=$o,e},tr=k.String,nr=k.TypeError,or=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=W(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(kC){}return function(n,o){return $e(n),function(e){if("object"==s(e)||ne(e))return e;throw nr("Can't set "+tr(e)+" as a prototype")}(o),t?e(n,o):n.__proto__=o,n}}():void 0),rr=Dt.PROPER,ar=Dt.CONFIGURABLE,sr=zo.IteratorPrototype,ir=zo.BUGGY_SAFARI_ITERATORS,ur=qe("iterator"),cr=function(){return this},lr=function(e,t,n,o,r,a,s){er(n,t,o);var i,u,c,l=function(e){if(e===r&&h)return h;if(!ir&&e in g)return g[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},d=t+" Iterator",p=!1,g=e.prototype,_=g[ur]||g["@@iterator"]||r&&g[r],h=!ir&&_||l(r),f="Array"==t&&g.entries||_;if(f&&(i=jo(f.call(new e)))!==Object.prototype&&i.next&&(jo(i)!==sr&&(or?or(i,sr):ne(i[ur])||Nt(i,ur,cr)),Qo(i,d,!0)),rr&&"values"==r&&_&&"values"!==_.name&&(ar?at(g,"name","values"):(p=!0,h=function(){return w(_,this)})),r)if(u={values:l("values"),keys:a?h:l("keys"),entries:l("entries")},s)for(c in u)(ir||p||!(c in g))&&Nt(g,c,u[c]);else rn({target:t,proto:!0,forced:ir||p},u);return g[ur]!==h&&Nt(g,ur,h,{name:r}),fo[t]=h,u},dr=Vo.charAt,pr=Et.set,gr=Et.getterFor("String Iterator");lr(String,"String",(function(e){pr(this,{type:"String Iterator",string:gn(e),index:0})}),(function(){var e,t=gr(this),n=t.string,o=t.index;return o>=n.length?{value:void 0,done:!0}:(e=dr(n,o),t.index+=e.length,{value:e,done:!1})}));var _r={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_SYSTEM_NOTICE_RECEIVED:"receiveGroupSystemNotice",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange",SDK_RELOAD:"sdkReload"},hr={MSG_TEXT:"TIMTextElem",MSG_IMAGE:"TIMImageElem",MSG_SOUND:"TIMSoundElem",MSG_AUDIO:"TIMSoundElem",MSG_FILE:"TIMFileElem",MSG_FACE:"TIMFaceElem",MSG_VIDEO:"TIMVideoFileElem",MSG_GEO:"TIMLocationElem",MSG_LOCATION:"TIMLocationElem",MSG_GRP_TIP:"TIMGroupTipElem",MSG_GRP_SYS_NOTICE:"TIMGroupSystemNoticeElem",MSG_CUSTOM:"TIMCustomElem",MSG_MERGER:"TIMRelayElem",MSG_PRIORITY_HIGH:"High",MSG_PRIORITY_NORMAL:"Normal",MSG_PRIORITY_LOW:"Low",MSG_PRIORITY_LOWEST:"Lowest",CONV_C2C:"C2C",CONV_GROUP:"GROUP",CONV_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",GENDER_UNKNOWN:"Gender_Type_Unknown",GENDER_FEMALE:"Gender_Type_Female",GENDER_MALE:"Gender_Type_Male",KICKED_OUT_MULT_ACCOUNT:"multipleAccount",KICKED_OUT_MULT_DEVICE:"multipleDevice",KICKED_OUT_USERSIG_EXPIRED:"userSigExpired",KICKED_OUT_REST_API:"REST_API_Kick",ALLOW_TYPE_ALLOW_ANY:"AllowType_Type_AllowAny",ALLOW_TYPE_NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_TYPE_DENY_ANY:"AllowType_Type_DenyAny",FORBID_TYPE_NONE:"AdminForbid_Type_None",FORBID_TYPE_SEND_OUT:"AdminForbid_Type_SendOut",JOIN_OPTIONS_FREE_ACCESS:"FreeAccess",JOIN_OPTIONS_NEED_PERMISSION:"NeedPermission",JOIN_OPTIONS_DISABLE_APPLY:"DisableApply",JOIN_STATUS_SUCCESS:"JoinedSuccess",JOIN_STATUS_ALREADY_IN_GROUP:"AlreadyInGroup",JOIN_STATUS_WAIT_APPROVAL:"WaitAdminApproval",GRP_PROFILE_OWNER_ID:"ownerID",GRP_PROFILE_CREATE_TIME:"createTime",GRP_PROFILE_LAST_INFO_TIME:"lastInfoTime",GRP_PROFILE_MEMBER_NUM:"memberNum",GRP_PROFILE_MAX_MEMBER_NUM:"maxMemberNum",GRP_PROFILE_JOIN_OPTION:"joinOption",GRP_PROFILE_INTRODUCTION:"introduction",GRP_PROFILE_NOTIFICATION:"notification",GRP_PROFILE_MUTE_ALL_MBRS:"muteAllMembers",SNS_ADD_TYPE_SINGLE:"Add_Type_Single",SNS_ADD_TYPE_BOTH:"Add_Type_Both",SNS_DELETE_TYPE_SINGLE:"Delete_Type_Single",SNS_DELETE_TYPE_BOTH:"Delete_Type_Both",SNS_APPLICATION_TYPE_BOTH:"Pendency_Type_Both",SNS_APPLICATION_SENT_TO_ME:"Pendency_Type_ComeIn",SNS_APPLICATION_SENT_BY_ME:"Pendency_Type_SendOut",SNS_APPLICATION_AGREE:"Response_Action_Agree",SNS_APPLICATION_AGREE_AND_ADD:"Response_Action_AgreeAndAdd",SNS_CHECK_TYPE_BOTH:"CheckResult_Type_Both",SNS_CHECK_TYPE_SINGLE:"CheckResult_Type_Single",SNS_TYPE_NO_RELATION:"CheckResult_Type_NoRelation",SNS_TYPE_A_WITH_B:"CheckResult_Type_AWithB",SNS_TYPE_B_WITH_A:"CheckResult_Type_BWithA",SNS_TYPE_BOTH_WAY:"CheckResult_Type_BothWay",NET_STATE_CONNECTED:"connected",NET_STATE_CONNECTING:"connecting",NET_STATE_DISCONNECTED:"disconnected",MSG_AT_ALL:"__kImSDK_MesssageAtALL__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3},fr=W([].slice),mr=k.Function,vr=W([].concat),Mr=W([].join),yr={},Ir=function(e,t,n){if(!Re(yr,t)){for(var o=[],r=0;r<t;r++)o[r]="a["+r+"]";yr[t]=mr("C,a","return new C("+Mr(o,",")+")")}return yr[t](e,n)},Tr=U?mr.bind:function(e){var t=ye(this),n=t.prototype,o=fr(arguments,1),r=function n(){var r=vr(o,fr(arguments));return this instanceof n?Ir(t,r.length,r):t.apply(e,r)};return oe(n)&&(r.prototype=n),r};rn({target:"Function",proto:!0,forced:Function.bind!==Tr},{bind:Tr});var Er=qe("species"),Cr=function(e){return pe>=51||!G((function(){var t=[];return(t.constructor={})[Er]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},Sr=to.map,Ar=Cr("map");rn({target:"Array",proto:!0,forced:!Ar},{map:function(e){return Sr(this,e,arguments.length>1?arguments[1]:void 0)}});var Dr=function(){function e(){r(this,e),this.cache=[],this.options=null}return i(e,[{key:"use",value:function(e){if("function"!=typeof e)throw"middleware must be a function";return this.cache.push(e),this}},{key:"next",value:function(e){if(this.middlewares&&this.middlewares.length>0)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:"run",value:function(e){return this.middlewares=this.cache.map((function(e){return e})),this.options=e,this.next()}}]),e}(),Nr=Dt.EXISTS,Or=rt.f,Rr=Function.prototype,Lr=W(Rr.toString),kr=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Gr=W(kr.exec);P&&!Nr&&Or(Rr,"name",{configurable:!0,get:function(){try{return Gr(kr,Lr(this))[1]}catch(kC){return""}}});var Pr=qe("isConcatSpreadable"),Ur=k.TypeError,br=pe>=51||!G((function(){var e=[];return e[Pr]=!1,e.concat()[0]!==e})),wr=Cr("concat"),Fr=function(e){if(!oe(e))return!1;var t=e[Pr];return void 0!==t?!!t:Vn(e)};rn({target:"Array",proto:!0,forced:!br||!wr},{concat:function(e){var t,n,o,r,a,s=Ne(this),i=Zn(s,0),u=0;for(t=-1,o=arguments.length;t<o;t++)if(Fr(a=-1===t?s:arguments[t])){if(u+(r=wt(a))>9007199254740991)throw Ur("Maximum allowed index exceeded");for(n=0;n<r;n++,u++)n in a&&yo(i,u,a[n])}else{if(u>=9007199254740991)throw Ur("Maximum allowed index exceeded");yo(i,u++,a)}return i.length=u,i}});var qr=N((function(e,t){var n,o,r,a,i,u,c,l,d,p,g,_,h,f,m,v,M,y;e.exports=(n="function"==typeof Promise,o="object"==("undefined"===typeof self?"undefined":s(self))?self:D,r="undefined"!=typeof Symbol,a="undefined"!=typeof Map,i="undefined"!=typeof Set,u="undefined"!=typeof WeakMap,c="undefined"!=typeof WeakSet,l="undefined"!=typeof DataView,d=r&&void 0!==Symbol.iterator,p=r&&void 0!==Symbol.toStringTag,g=i&&"function"==typeof Set.prototype.entries,_=a&&"function"==typeof Map.prototype.entries,h=g&&Object.getPrototypeOf((new Set).entries()),f=_&&Object.getPrototypeOf((new Map).entries()),m=d&&"function"==typeof Array.prototype[Symbol.iterator],v=m&&Object.getPrototypeOf([][Symbol.iterator]()),M=d&&"function"==typeof String.prototype[Symbol.iterator],y=M&&Object.getPrototypeOf(""[Symbol.iterator]()),function(e){var t=s(e);if("object"!==t)return t;if(null===e)return"null";if(e===o)return"global";if(Array.isArray(e)&&(!1===p||!(Symbol.toStringTag in e)))return"Array";if("object"==("undefined"===typeof window?"undefined":s(window))&&null!==window){if("object"==s(window.location)&&e===window.location)return"Location";if("object"==s(window.document)&&e===window.document)return"Document";if("object"==s(window.navigator)){if("object"==s(window.navigator.mimeTypes)&&e===window.navigator.mimeTypes)return"MimeTypeArray";if("object"==s(window.navigator.plugins)&&e===window.navigator.plugins)return"PluginArray"}if(("function"==typeof window.HTMLElement||"object"==s(window.HTMLElement))&&e instanceof window.HTMLElement){if("BLOCKQUOTE"===e.tagName)return"HTMLQuoteElement";if("TD"===e.tagName)return"HTMLTableDataCellElement";if("TH"===e.tagName)return"HTMLTableHeaderCellElement"}}var r=p&&e[Symbol.toStringTag];if("string"==typeof r)return r;var d=Object.getPrototypeOf(e);return d===RegExp.prototype?"RegExp":d===Date.prototype?"Date":n&&d===Promise.prototype?"Promise":i&&d===Set.prototype?"Set":a&&d===Map.prototype?"Map":c&&d===WeakSet.prototype?"WeakSet":u&&d===WeakMap.prototype?"WeakMap":l&&d===DataView.prototype?"DataView":a&&d===f?"Map Iterator":i&&d===h?"Set Iterator":m&&d===v?"Array Iterator":M&&d===y?"String Iterator":null===d?"Object":Object.prototype.toString.call(e).slice(8,-1)})}));rn({target:"Array",stat:!0},{isArray:Vn});var Vr=function(e,t,n){var o,r;return or&&ne(o=t.constructor)&&o!==n&&oe(r=o.prototype)&&r!==n.prototype&&or(e,r),e},xr=W(1..valueOf),Br=jt.f,Kr=Je.f,Hr=rt.f,jr=yn.trim,Wr=k.Number,Yr=Wr.prototype,zr=k.TypeError,Jr=W("".slice),Xr=W("".charCodeAt),Qr=function(e){var t=Be(e,"number");return"bigint"==typeof t?t:Zr(t)},Zr=function(e){var t,n,o,r,a,s,i,u,c=Be(e,"number");if(fe(c))throw zr("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=jr(c),43===(t=Xr(c,0))||45===t){if(88===(n=Xr(c,2))||120===n)return NaN}else if(48===t){switch(Xr(c,1)){case 66:case 98:o=2,r=49;break;case 79:case 111:o=8,r=55;break;default:return+c}for(s=(a=Jr(c,2)).length,i=0;i<s;i++)if((u=Xr(a,i))<48||u>r)return NaN;return parseInt(a,o)}return+c};if(nn("Number",!Wr(" 0o1")||!Wr("0b1")||Wr("+0x1"))){for(var $r,ea=function e(t){var n=arguments.length<1?0:Wr(Qr(t)),o=this;return se(Yr,o)&&G((function(){xr(o)}))?Vr(Object(n),o,e):n},ta=P?Br(Wr):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),na=0;ta.length>na;na++)Re(Wr,$r=ta[na])&&!Re(ea,$r)&&Hr(ea,$r,Kr(Wr,$r));ea.prototype=Yr,Yr.constructor=ea,Nt(k,"Number",ea)}var oa=G((function(){jo(1)}));rn({target:"Object",stat:!0,forced:oa,sham:!xo},{getPrototypeOf:function(e){return jo(Ne(e))}});var ra,aa,sa=function(){var e=$e(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},ia=k.RegExp,ua=G((function(){var e=ia("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),ca=ua||G((function(){return!ia("a","y").sticky})),la={BROKEN_CARET:ua||G((function(){var e=ia("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:ca,UNSUPPORTED_Y:ua},da=k.RegExp,pa=G((function(){var e=da(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),ga=k.RegExp,_a=G((function(){var e=ga("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),ha=Et.get,fa=Ae("native-string-replace",String.prototype.replace),ma=RegExp.prototype.exec,va=ma,Ma=W("".charAt),ya=W("".indexOf),Ia=W("".replace),Ta=W("".slice),Ea=(aa=/b*/g,w(ma,ra=/a/,"a"),w(ma,aa,"a"),0!==ra.lastIndex||0!==aa.lastIndex),Ca=la.BROKEN_CARET,Sa=void 0!==/()??/.exec("")[1];(Ea||Sa||Ca||pa||_a)&&(va=function(e){var t,n,o,r,a,s,i,u=this,c=ha(u),l=gn(e),d=c.raw;if(d)return d.lastIndex=u.lastIndex,t=w(va,d,l),u.lastIndex=d.lastIndex,t;var p=c.groups,g=Ca&&u.sticky,_=w(sa,u),h=u.source,f=0,m=l;if(g&&(_=Ia(_,"y",""),-1===ya(_,"g")&&(_+="g"),m=Ta(l,u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==Ma(l,u.lastIndex-1))&&(h="(?: "+h+")",m=" "+m,f++),n=new RegExp("^(?:"+h+")",_)),Sa&&(n=new RegExp("^"+h+"$(?!\\s)",_)),Ea&&(o=u.lastIndex),r=w(ma,g?n:u,m),g?r?(r.input=Ta(r.input,f),r[0]=Ta(r[0],f),r.index=u.lastIndex,u.lastIndex+=r[0].length):u.lastIndex=0:Ea&&r&&(u.lastIndex=u.global?r.index+r[0].length:o),Sa&&r&&r.length>1&&w(fa,r[0],n,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(r[a]=void 0)})),r&&p)for(r.groups=s=wn(null),a=0;a<p.length;a++)s[(i=p[a])[0]]=r[i[1]];return r});var Aa=va;rn({target:"RegExp",proto:!0,forced:/./.exec!==Aa},{exec:Aa});var Da=Date.prototype,Na=W(Da.toString),Oa=W(Da.getTime);"Invalid Date"!=String(new Date(NaN))&&Nt(Da,"toString",(function(){var e=Oa(this);return e==e?Na(this):"Invalid Date"}));var Ra=Dt.PROPER,La=RegExp.prototype,ka=La.toString,Ga=W(sa),Pa=G((function(){return"/a/b"!=ka.call({source:"a",flags:"b"})})),Ua=Ra&&"toString"!=ka.name;(Pa||Ua)&&Nt(RegExp.prototype,"toString",(function(){var e=$e(this),t=gn(e.source),n=e.flags;return"/"+t+"/"+gn(void 0===n&&se(La,e)&&!("flags"in La)?Ga(e):n)}),{unsafe:!0});var ba=qe("species"),wa=RegExp.prototype,Fa=function(e,t,n,o){var r=qe(e),a=!G((function(){var t={};return t[r]=function(){return 7},7!=""[e](t)})),s=a&&!G((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[ba]=function(){return n},n.flags="",n[r]=/./[r]),n.exec=function(){return t=!0,null},n[r](""),!t}));if(!a||!s||n){var i=W(/./[r]),u=t(r,""[e],(function(e,t,n,o,r){var s=W(e),u=t.exec;return u===Aa||u===wa.exec?a&&!r?{done:!0,value:i(t,n,o)}:{done:!0,value:s(n,t,o)}:{done:!1}}));Nt(String.prototype,e,u[0]),Nt(wa,r,u[1])}o&&at(wa[r],"sham",!0)},qa=Vo.charAt,Va=function(e,t,n){return t+(n?qa(e,t).length:1)},xa=k.TypeError,Ba=function(e,t){var n=e.exec;if(ne(n)){var o=w(n,e,t);return null!==o&&$e(o),o}if("RegExp"===J(e))return w(Aa,e,t);throw xa("RegExp#exec called on incompatible receiver")};Fa("match",(function(e,t,n){return[function(t){var n=ee(this),o=null==t?void 0:Ie(t,e);return o?w(o,t,n):new RegExp(t)[e](gn(n))},function(e){var o=$e(this),r=gn(e),a=n(t,o,r);if(a.done)return a.value;if(!o.global)return Ba(o,r);var s=o.unicode;o.lastIndex=0;for(var i,u=[],c=0;null!==(i=Ba(o,r));){var l=gn(i[0]);u[c]=l,""===l&&(o.lastIndex=Va(r,bt(o.lastIndex),s)),c++}return 0===c?null:u}]}));var Ka=k.Date,Ha=W(Ka.prototype.getTime);rn({target:"Date",stat:!0},{now:function(){return Ha(new Ka)}});var ja=qe("unscopables"),Wa=Array.prototype;null==Wa[ja]&&rt.f(Wa,ja,{configurable:!0,value:wn(null)});var Ya=function(e){Wa[ja][e]=!0},za=qt.includes;rn({target:"Array",proto:!0},{includes:function(e){return za(this,e,arguments.length>1?arguments[1]:void 0)}}),Ya("includes");var Ja=qe("match"),Xa=function(e){var t;return oe(e)&&(void 0!==(t=e[Ja])?!!t:"RegExp"==J(e))},Qa=k.TypeError,Za=function(e){if(Xa(e))throw Qa("The method doesn't accept regular expressions");return e},$a=qe("match"),es=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[$a]=!1,"/./"[e](t)}catch(r){}}return!1},ts=W("".indexOf);rn({target:"String",proto:!0,forced:!es("includes")},{includes:function(e){return!!~ts(gn(ee(this)),gn(Za(e)),arguments.length>1?arguments[1]:void 0)}});var ns=k.RangeError,os=W((function(e){var t=gn(ee(this)),n="",o=Lt(e);if(o<0||1/0==o)throw ns("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(t+=t))1&o&&(n+=t);return n})),rs=W("".slice),as=Math.ceil,ss=function(e){return function(t,n,o){var r,a,s=gn(ee(t)),i=bt(n),u=s.length,c=void 0===o?" ":gn(o);return i<=u||""==c?s:((a=os(c,as((r=i-u)/c.length))).length>r&&(a=rs(a,0,r)),e?s+a:a+s)}},is={start:ss(!1),end:ss(!0)}.start,us=k.RangeError,cs=Math.abs,ls=Date.prototype,ds=ls.toISOString,ps=W(ls.getTime),gs=W(ls.getUTCDate),_s=W(ls.getUTCFullYear),hs=W(ls.getUTCHours),fs=W(ls.getUTCMilliseconds),ms=W(ls.getUTCMinutes),vs=W(ls.getUTCMonth),Ms=W(ls.getUTCSeconds),ys=G((function(){return"0385-07-25T07:06:39.999Z"!=ds.call(new Date(-50000000000001))}))||!G((function(){ds.call(new Date(NaN))}))?function(){if(!isFinite(ps(this)))throw us("Invalid time value");var e=_s(this),t=fs(this),n=e<0?"-":e>9999?"+":"";return n+is(cs(e),n?6:4,0)+"-"+is(vs(this)+1,2,0)+"-"+is(gs(this),2,0)+"T"+is(hs(this),2,0)+":"+is(ms(this),2,0)+":"+is(Ms(this),2,0)+"."+is(t,3,0)+"Z"}:ds;rn({target:"Date",proto:!0,forced:Date.prototype.toISOString!==ys},{toISOString:ys});var Is=Function.prototype,Ts=Is.apply,Es=Is.call,Cs="object"==("undefined"===typeof Reflect?"undefined":s(Reflect))&&Reflect.apply||(U?Es.bind(Ts):function(){return Es.apply(Ts,arguments)}),Ss=Math.floor,As=W("".charAt),Ds=W("".replace),Ns=W("".slice),Os=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Rs=/\$([$&'`]|\d{1,2})/g,Ls=function(e,t,n,o,r,a){var s=n+e.length,i=o.length,u=Rs;return void 0!==r&&(r=Ne(r),u=Os),Ds(a,u,(function(a,u){var c;switch(As(u,0)){case"$":return"$";case"&":return e;case"`":return Ns(t,0,n);case"'":return Ns(t,s);case"<":c=r[Ns(u,1,-1)];break;default:var l=+u;if(0===l)return a;if(l>i){var d=Ss(l/10);return 0===d?a:d<=i?void 0===o[d-1]?As(u,1):o[d-1]+As(u,1):a}c=o[l-1]}return void 0===c?"":c}))},ks=qe("replace"),Gs=Math.max,Ps=Math.min,Us=W([].concat),bs=W([].push),ws=W("".indexOf),Fs=W("".slice),qs="$0"==="a".replace(/./,"$0"),Vs=!!/./[ks]&&""===/./[ks]("a","$0");Fa("replace",(function(e,t,n){var o=Vs?"$":"$0";return[function(e,n){var o=ee(this),r=null==e?void 0:Ie(e,ks);return r?w(r,e,o,n):w(t,gn(o),e,n)},function(e,r){var a=$e(this),s=gn(e);if("string"==typeof r&&-1===ws(r,o)&&-1===ws(r,"$<")){var i=n(t,a,s,r);if(i.done)return i.value}var u=ne(r);u||(r=gn(r));var c=a.global;if(c){var l=a.unicode;a.lastIndex=0}for(var d=[];;){var p=Ba(a,s);if(null===p)break;if(bs(d,p),!c)break;""===gn(p[0])&&(a.lastIndex=Va(s,bt(a.lastIndex),l))}for(var g,_="",h=0,f=0;f<d.length;f++){for(var m=gn((p=d[f])[0]),v=Gs(Ps(Lt(p.index),s.length),0),M=[],y=1;y<p.length;y++)bs(M,void 0===(g=p[y])?g:String(g));var I=p.groups;if(u){var T=Us([m],M,v,s);void 0!==I&&bs(T,I);var E=gn(Cs(r,void 0,T))}else E=Ls(m,s,v,M,I,r);v>=h&&(_+=Fs(s,h,v)+E,h=v+m.length)}return _+Fs(s,h)}]}),!!G((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!qs||Vs);var xs=rt.f,Bs=Et.set,Ks=Et.getterFor("Array Iterator"),Hs=lr(Array,"Array",(function(e,t){Bs(this,{type:"Array Iterator",target:te(e),index:0,kind:t})}),(function(){var e=Ks(this),t=e.target,n=e.kind,o=e.index++;return!t||o>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:o,done:!1}:"values"==n?{value:t[o],done:!1}:{value:[o,t[o]],done:!1}}),"values"),js=fo.Arguments=fo.Array;if(Ya("keys"),Ya("values"),Ya("entries"),P&&"values"!==js.name)try{xs(js,"name",{value:"values"})}catch(kC){}var Ws=qe("iterator"),Ys=qe("toStringTag"),zs=Hs.values,Js=function(e,t){if(e){if(e[Ws]!==zs)try{at(e,Ws,zs)}catch(kC){e[Ws]=zs}if(e[Ys]||at(e,Ys,t),so[t])for(var n in Hs)if(e[n]!==Hs[n])try{at(e,n,Hs[n])}catch(kC){e[n]=Hs[n]}}};for(var Xs in so)Js(k[Xs]&&k[Xs].prototype,Xs);Js(co,"DOMTokenList");var Qs=Cr("slice"),Zs=qe("species"),$s=k.Array,ei=Math.max;rn({target:"Array",proto:!0,forced:!Qs},{slice:function(e,t){var n,o,r,a=te(this),s=wt(a),i=Pt(e,s),u=Pt(void 0===t?s:t,s);if(Vn(a)&&(n=a.constructor,(Jn(n)&&(n===$s||Vn(n.prototype))||oe(n)&&null===(n=n[Zs]))&&(n=void 0),n===$s||void 0===n))return fr(a,i,u);for(o=new(void 0===n?$s:n)(ei(u-i,0)),r=0;i<u;i++,r++)i in a&&yo(o,r,a[i]);return o.length=r,o}});var ti=W([].join),ni=Z!=Object,oi=no("join",",");rn({target:"Array",proto:!0,forced:ni||!oi},{join:function(e){return ti(te(this),void 0===e?",":e)}});var ri=qt.indexOf,ai=W([].indexOf),si=!!ai&&1/ai([1],1,-0)<0,ii=no("indexOf");rn({target:"Array",proto:!0,forced:si||!ii},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return si?ai(this,e,t)||0:ri(this,e,t)}});var ui=k.Array,ci=Math.max,li=function(e,t,n){for(var o=wt(e),r=Pt(t,o),a=Pt(void 0===n?o:n,o),s=ui(ci(a-r,0)),i=0;r<a;r++,i++)yo(s,i,e[r]);return s.length=i,s},di=jt.f,pi="object"==("undefined"===typeof window?"undefined":s(window))&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],gi={f:function(e){return pi&&"Window"==J(e)?function(e){try{return di(e)}catch(kC){return li(pi)}}(e):di(te(e))}},_i=gi.f,hi=G((function(){return!Object.getOwnPropertyNames(1)}));rn({target:"Object",stat:!0,forced:hi},{getOwnPropertyNames:_i});var fi=to.find,mi=!0;"find"in[]&&Array(1).find((function(){mi=!1})),rn({target:"Array",proto:!0,forced:mi},{find:function(e){return fi(this,e,arguments.length>1?arguments[1]:void 0)}}),Ya("find");var vi,Mi=Je.f,yi=W("".startsWith),Ii=W("".slice),Ti=Math.min,Ei=es("startsWith"),Ci=!(Ei||(vi=Mi(String.prototype,"startsWith"),!vi||vi.writable));rn({target:"String",proto:!0,forced:!Ci&&!Ei},{startsWith:function(e){var t=gn(ee(this));Za(e);var n=bt(Ti(arguments.length>1?arguments[1]:void 0,t.length)),o=gn(e);return yi?yi(t,o,n):Ii(t,n,n+o.length)===o}});var Si,Ai,Di,Ni,Oi=k.Promise,Ri=function(e,t,n){for(var o in t)Nt(e,o,t[o],n);return e},Li=qe("species"),ki=function(e){var t=ae(e),n=rt.f;P&&t&&!t[Li]&&n(t,Li,{configurable:!0,get:function(){return this}})},Gi=k.TypeError,Pi=function(e,t){if(se(t,e))return e;throw Gi("Incorrect invocation")},Ui=k.TypeError,bi=function(e,t){this.stopped=e,this.result=t},wi=bi.prototype,Fi=function(e,t,n){var o,r,a,i,u,c,l,d=n&&n.that,p=!(!n||!n.AS_ENTRIES),g=!(!n||!n.IS_ITERATOR),_=!(!n||!n.INTERRUPTED),h=qn(t,d),f=function(e){return o&&_o(o,"normal",e),new bi(!0,e)},m=function(e){return p?($e(e),_?h(e[0],e[1],f):h(e[0],e[1])):_?h(e,f):h(e)};if(g)o=e;else{if(!(r=To(e)))throw Ui(ve(e)+" is not iterable");if(Mo(r)){for(a=0,i=wt(e);i>a;a++)if((u=m(e[a]))&&se(wi,u))return u;return new bi(!1)}o=Co(e,r)}for(c=o.next;!(l=w(c,o)).done;){try{u=m(l.value)}catch(kC){_o(o,"throw",kC)}if("object"==s(u)&&u&&se(wi,u))return u}return new bi(!1)},qi=k.TypeError,Vi=function(e){if(Jn(e))return e;throw qi(ve(e)+" is not a constructor")},xi=qe("species"),Bi=function(e,t){var n,o=$e(e).constructor;return void 0===o||null==(n=$e(o)[xi])?t:Vi(n)},Ki=k.TypeError,Hi=function(e,t){if(e<t)throw Ki("Not enough arguments");return e},ji=/(?:ipad|iphone|ipod).*applewebkit/i.test(ie),Wi="process"==J(k.process),Yi=k.setImmediate,zi=k.clearImmediate,Ji=k.process,Xi=k.Dispatch,Qi=k.Function,Zi=k.MessageChannel,$i=k.String,eu=0,tu={};try{Si=k.location}catch(kC){}var nu=function(e){if(Re(tu,e)){var t=tu[e];delete tu[e],t()}},ou=function(e){return function(){nu(e)}},ru=function(e){nu(e.data)},au=function(e){k.postMessage($i(e),Si.protocol+"//"+Si.host)};Yi&&zi||(Yi=function(e){Hi(arguments.length,1);var t=ne(e)?e:Qi(e),n=fr(arguments,1);return tu[++eu]=function(){Cs(t,void 0,n)},Ai(eu),eu},zi=function(e){delete tu[e]},Wi?Ai=function(e){Ji.nextTick(ou(e))}:Xi&&Xi.now?Ai=function(e){Xi.now(ou(e))}:Zi&&!ji?(Ni=(Di=new Zi).port2,Di.port1.onmessage=ru,Ai=qn(Ni.postMessage,Ni)):k.addEventListener&&ne(k.postMessage)&&!k.importScripts&&Si&&"file:"!==Si.protocol&&!G(au)?(Ai=au,k.addEventListener("message",ru,!1)):Ai="onreadystatechange"in We("script")?function(e){Ln.appendChild(We("script")).onreadystatechange=function(){Ln.removeChild(this),nu(e)}}:function(e){setTimeout(ou(e),0)});var su,iu,uu,cu,lu,du,pu,gu,_u={set:Yi,clear:zi},hu=/ipad|iphone|ipod/i.test(ie)&&void 0!==k.Pebble,fu=/web0s(?!.*chrome)/i.test(ie),mu=Je.f,vu=_u.set,Mu=k.MutationObserver||k.WebKitMutationObserver,yu=k.document,Iu=k.process,Tu=k.Promise,Eu=mu(k,"queueMicrotask"),Cu=Eu&&Eu.value;Cu||(su=function(){var e,t;for(Wi&&(e=Iu.domain)&&e.exit();iu;){t=iu.fn,iu=iu.next;try{t()}catch(kC){throw iu?cu():uu=void 0,kC}}uu=void 0,e&&e.enter()},ji||Wi||fu||!Mu||!yu?!hu&&Tu&&Tu.resolve?((pu=Tu.resolve(void 0)).constructor=Tu,gu=qn(pu.then,pu),cu=function(){gu(su)}):Wi?cu=function(){Iu.nextTick(su)}:(vu=qn(vu,k),cu=function(){vu(su)}):(lu=!0,du=yu.createTextNode(""),new Mu(su).observe(du,{characterData:!0}),cu=function(){du.data=lu=!lu}));var Su=Cu||function(e){var t={fn:e,next:void 0};uu&&(uu.next=t),iu||(iu=t,cu()),uu=t},Au=function(e){var t,n;this.promise=new e((function(e,o){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=o})),this.resolve=ye(t),this.reject=ye(n)},Du={f:function(e){return new Au(e)}},Nu=function(e,t){if($e(e),oe(t)&&t.constructor===e)return t;var n=Du.f(e);return(0,n.resolve)(t),n.promise},Ou=function(e){try{return{error:!1,value:e()}}catch(kC){return{error:!0,value:kC}}},Ru=function(){this.head=null,this.tail=null};Ru.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var Lu,ku,Gu,Pu,Uu=Ru,bu="object"==("undefined"===typeof window?"undefined":s(window)),wu=_u.set,Fu=qe("species"),qu="Promise",Vu=Et.getterFor(qu),xu=Et.set,Bu=Et.getterFor(qu),Ku=Oi&&Oi.prototype,Hu=Oi,ju=Ku,Wu=k.TypeError,Yu=k.document,zu=k.process,Ju=Du.f,Xu=Ju,Qu=!!(Yu&&Yu.createEvent&&k.dispatchEvent),Zu=ne(k.PromiseRejectionEvent),$u=!1,ec=nn(qu,(function(){var e=lt(Hu),t=e!==String(Hu);if(!t&&66===pe)return!0;if(pe>=51&&/native code/.test(e))return!1;var n=new Hu((function(e){e(1)})),o=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Fu]=o,!($u=n.then((function(){}))instanceof o)||!t&&bu&&!Zu})),tc=ec||!Lo((function(e){Hu.all(e).catch((function(){}))})),nc=function(e){var t;return!(!oe(e)||!ne(t=e.then))&&t},oc=function(e,t){var n,o,r,a=t.value,s=1==t.state,i=s?e.ok:e.fail,u=e.resolve,c=e.reject,l=e.domain;try{i?(s||(2===t.rejection&&uc(t),t.rejection=1),!0===i?n=a:(l&&l.enter(),n=i(a),l&&(l.exit(),r=!0)),n===e.promise?c(Wu("Promise-chain cycle")):(o=nc(n))?w(o,n,u,c):u(n)):c(a)}catch(kC){l&&!r&&l.exit(),c(kC)}},rc=function(e,t){e.notified||(e.notified=!0,Su((function(){for(var n,o=e.reactions;n=o.get();)oc(n,e);e.notified=!1,t&&!e.rejection&&sc(e)})))},ac=function(e,t,n){var o,r;Qu?((o=Yu.createEvent("Event")).promise=t,o.reason=n,o.initEvent(e,!1,!0),k.dispatchEvent(o)):o={promise:t,reason:n},!Zu&&(r=k["on"+e])?r(o):"unhandledrejection"===e&&function(e,t){var n=k.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},sc=function(e){w(wu,k,(function(){var t,n=e.facade,o=e.value;if(ic(e)&&(t=Ou((function(){Wi?zu.emit("unhandledRejection",o,n):ac("unhandledrejection",n,o)})),e.rejection=Wi||ic(e)?2:1,t.error))throw t.value}))},ic=function(e){return 1!==e.rejection&&!e.parent},uc=function(e){w(wu,k,(function(){var t=e.facade;Wi?zu.emit("rejectionHandled",t):ac("rejectionhandled",t,e.value)}))},cc=function(e,t,n){return function(o){e(t,o,n)}},lc=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,rc(e,!0))},dc=function e(t,n,o){if(!t.done){t.done=!0,o&&(t=o);try{if(t.facade===n)throw Wu("Promise can't be resolved itself");var r=nc(n);r?Su((function(){var o={done:!1};try{w(r,n,cc(e,o,t),cc(lc,o,t))}catch(kC){lc(o,kC,t)}})):(t.value=n,t.state=1,rc(t,!1))}catch(kC){lc({done:!1},kC,t)}}};if(ec&&(ju=(Hu=function(e){Pi(this,ju),ye(e),w(Lu,this);var t=Vu(this);try{e(cc(dc,t),cc(lc,t))}catch(kC){lc(t,kC)}}).prototype,(Lu=function(e){xu(this,{type:qu,done:!1,notified:!1,parent:!1,reactions:new Uu,rejection:!1,state:0,value:void 0})}).prototype=Ri(ju,{then:function(e,t){var n=Bu(this),o=Ju(Bi(this,Hu));return n.parent=!0,o.ok=!ne(e)||e,o.fail=ne(t)&&t,o.domain=Wi?zu.domain:void 0,0==n.state?n.reactions.add(o):Su((function(){oc(o,n)})),o.promise},catch:function(e){return this.then(void 0,e)}}),ku=function(){var e=new Lu,t=Vu(e);this.promise=e,this.resolve=cc(dc,t),this.reject=cc(lc,t)},Du.f=Ju=function(e){return e===Hu||e===Gu?new ku(e):Xu(e)},ne(Oi)&&Ku!==Object.prototype)){Pu=Ku.then,$u||(Nt(Ku,"then",(function(e,t){var n=this;return new Hu((function(e,t){w(Pu,n,e,t)})).then(e,t)}),{unsafe:!0}),Nt(Ku,"catch",ju.catch,{unsafe:!0}));try{delete Ku.constructor}catch(kC){}or&&or(Ku,ju)}rn({global:!0,wrap:!0,forced:ec},{Promise:Hu}),Qo(Hu,qu,!1),ki(qu),Gu=ae(qu),rn({target:qu,stat:!0,forced:ec},{reject:function(e){var t=Ju(this);return w(t.reject,void 0,e),t.promise}}),rn({target:qu,stat:!0,forced:ec},{resolve:function(e){return Nu(this,e)}}),rn({target:qu,stat:!0,forced:tc},{all:function(e){var t=this,n=Ju(t),o=n.resolve,r=n.reject,a=Ou((function(){var n=ye(t.resolve),a=[],s=0,i=1;Fi(e,(function(e){var u=s++,c=!1;i++,w(n,t,e).then((function(e){c||(c=!0,a[u]=e,--i||o(a))}),r)})),--i||o(a)}));return a.error&&r(a.value),n.promise},race:function(e){var t=this,n=Ju(t),o=n.reject,r=Ou((function(){var r=ye(t.resolve);Fi(e,(function(e){w(r,t,e).then(n.resolve,o)}))}));return r.error&&o(r.value),n.promise}});var pc=la.UNSUPPORTED_Y,gc=Math.min,_c=[].push,hc=W(/./.exec),fc=W(_c),mc=W("".slice);Fa("split",(function(e,t,n){var o;return o="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 o=gn(ee(this)),r=void 0===n?4294967295:n>>>0;if(0===r)return[];if(void 0===e)return[o];if(!Xa(e))return w(t,o,e,r);for(var a,s,i,u=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,d=new RegExp(e.source,c+"g");(a=w(Aa,d,o))&&!((s=d.lastIndex)>l&&(fc(u,mc(o,l,a.index)),a.length>1&&a.index<o.length&&Cs(_c,u,li(a,1)),i=a[0].length,l=s,u.length>=r));)d.lastIndex===a.index&&d.lastIndex++;return l===o.length?!i&&hc(d,"")||fc(u,""):fc(u,mc(o,l)),u.length>r?li(u,0,r):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:w(t,this,e,n)}:t,[function(t,n){var r=ee(this),a=null==t?void 0:Ie(t,e);return a?w(a,t,r,n):w(o,gn(r),t,n)},function(e,r){var a=$e(this),s=gn(e),i=n(o,a,s,r,o!==t);if(i.done)return i.value;var u=Bi(a,RegExp),c=a.unicode,l=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.unicode?"u":"")+(pc?"g":"y"),d=new u(pc?"^(?:"+a.source+")":a,l),p=void 0===r?4294967295:r>>>0;if(0===p)return[];if(0===s.length)return null===Ba(d,s)?[s]:[];for(var g=0,_=0,h=[];_<s.length;){d.lastIndex=pc?0:_;var f,m=Ba(d,pc?mc(s,_):s);if(null===m||(f=gc(bt(d.lastIndex+(pc?_:0)),s.length))===g)_=Va(s,_,c);else{if(fc(h,mc(s,g,_)),h.length===p)return h;for(var v=1;v<=m.length-1;v++)if(fc(h,m[v]),h.length===p)return h;_=g=f}}return fc(h,mc(s,g)),h}]}),!!G((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]})),pc);var vc=Vo.codeAt;rn({target:"String",proto:!0},{codePointAt:function(e){return vc(this,e)}});var Mc=yn.trim,yc=W("".charAt),Ic=k.parseFloat,Tc=k.Symbol,Ec=Tc&&Tc.iterator,Cc=1/Ic(_n+"-0")!=-1/0||Ec&&!G((function(){Ic(Object(Ec))}))?function(e){var t=Mc(gn(e)),n=Ic(t);return 0===n&&"-"==yc(t,0)?-0:n}:Ic;rn({global:!0,forced:parseFloat!=Cc},{parseFloat:Cc});var Sc=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;r(this,e),this.high=t,this.low=n}return i(e,[{key:"equal",value:function(e){return null!==e&&this.low===e.low&&this.high===e.high}},{key:"toString",value:function(){var e=Number(this.high).toString(16),t=Number(this.low).toString(16);if(t.length<8)for(var n=8-t.length;n;)t="0"+t,n--;return e+t}}]),e}(),Ac={TEST:{CHINA:{DEFAULT:"wss://wss-dev.tim.qq.com"},OVERSEA:{DEFAULT:"wss://wss-dev.tim.qq.com"},SINGAPORE:{DEFAULT:"wss://wsssgp-dev.im.qcloud.com"},KOREA:{DEFAULT:"wss://wsskr-dev.im.qcloud.com"},GERMANY:{DEFAULT:"wss://wssger-dev.im.qcloud.com"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",STAT:"https://api.im.qcloud.com"},OVERSEA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT:"wss://wsssgp.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",STAT:"https://apisgp.my-imcloud.com"},KOREA:{DEFAULT:"wss://wsskr.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",STAT:"https://apikr.my-imcloud.com"},GERMANY:{DEFAULT:"wss://wssger.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",STAT:"https://apiger.my-imcloud.com"},IND:{DEFAULT:"wss://wssind.im.qcloud.com",BACKUP:"wss://wssind.my-imcloud.com",STAT:"https://apiind.my-imcloud.com"}}},Dc={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15},Nc="1.7.3",Oc=537048168,Rc="CHINA",Lc="OVERSEA",kc="SINGAPORE",Gc="KOREA",Pc="GERMANY",Uc="IND",bc={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://api.im.qcloud.com"},setCurrent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rc;this.CURRENT=Ac.PRODUCTION[e]}},NAME:{OPEN_IM:"openim",GROUP:"group_open_http_svc",GROUP_AVCHATROOM:"group_open_avchatroom_http_svc",GROUP_COMMUNITY:"million_group_open_http_svc",GROUP_ATTR:"group_open_attr_http_svc",FRIEND:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GROUP_NO_AUTH:"group_open_http_noauth_svc",BIG_GROUP_LONG_POLLING:"group_open_long_polling_http_svc",BIG_GROUP_LONG_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MESSAGE:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush"},CMD:{LOGIN:"wslogin",LOGOUT_LONG_POLL:"longpollinglogout",LOGOUT:"wslogout",HELLO:"wshello",STAT_BACKGROUND:"ws_stat_background",STAT_FOREGROUND:"ws_stat_foreground",SET_TOKEN:"ws_stat_settoken",PORTRAIT_GET:"portrait_get_all",PORTRAIT_SET:"portrait_set",GET_LONG_POLL_ID:"getlongpollingid",LONG_POLL:"longpolling",AVCHATROOM_LONG_POLL:"get_msg",ADD_FRIEND:"friend_add",UPDATE_FRIEND:"friend_update",GET_FRIEND_LIST:"friend_get",GET_FRIEND_PROFILE:"friend_get_list",DELETE_FRIEND:"friend_delete",CHECK_FRIEND:"friend_check",GET_FRIEND_GROUP_LIST:"group_get",RESPOND_FRIEND_APPLICATION:"friend_response",GET_FRIEND_APPLICATION_LIST:"pendency_get",DELETE_FRIEND_APPLICATION:"pendency_delete",REPORT_FRIEND_APPLICATION:"pendency_report",GET_GROUP_APPLICATION:"get_pendency",CREATE_FRIEND_GROUP:"group_add",DELETE_FRIEND_GROUP:"group_delete",UPDATE_FRIEND_GROUP:"group_update",GET_BLACKLIST:"black_list_get",ADD_BLACKLIST:"black_list_add",DELETE_BLACKLIST:"black_list_delete",CREATE_GROUP:"create_group",GET_JOINED_GROUPS:"get_joined_group_list",SET_GROUP_ATTRIBUTES:"set_group_attr",MODIFY_GROUP_ATTRIBUTES:"modify_group_attr",DELETE_GROUP_ATTRIBUTES:"delete_group_attr",CLEAR_GROUP_ATTRIBUTES:"clear_group_attr",GET_GROUP_ATTRIBUTES:"get_group_attr",SEND_MESSAGE:"sendmsg",REVOKE_C2C_MESSAGE:"msgwithdraw",DELETE_C2C_MESSAGE:"delete_c2c_msg_ramble",MODIFY_C2C_MESSAGE:"modify_c2c_msg",SEND_GROUP_MESSAGE:"send_group_msg",REVOKE_GROUP_MESSAGE:"group_msg_recall",DELETE_GROUP_MESSAGE:"delete_group_ramble_msg_by_seq",MODIFY_GROUP_MESSAGE:"modify_group_msg",GET_GROUP_INFO:"get_group_self_member_info",GET_GROUP_MEMBER_INFO:"get_specified_group_member_info",GET_GROUP_MEMBER_LIST:"get_group_member_info",GET_AVCHATROOM_MEMBER_LIST:"get_members",QUIT_GROUP:"quit_group",CHANGE_GROUP_OWNER:"change_group_owner",DESTROY_GROUP:"destroy_group",ADD_GROUP_MEMBER:"add_group_member",DELETE_GROUP_MEMBER:"delete_group_member",BAN_AVCHATROOM_MEMBER:"ban_group_member",SEARCH_GROUP_BY_ID:"get_group_public_info",APPLY_JOIN_GROUP:"apply_join_group",HANDLE_APPLY_JOIN_GROUP:"handle_apply_join_group",HANDLE_GROUP_INVITATION:"handle_invite_join_group",MODIFY_GROUP_INFO:"modify_group_base_info",MODIFY_GROUP_MEMBER_INFO:"modify_group_member_info",DELETE_GROUP_SYSTEM_MESSAGE:"deletemsg",DELETE_GROUP_AT_TIPS:"deletemsg",GET_CONVERSATION_LIST:"get",PAGING_GET_CONVERSATION_LIST:"page_get",DELETE_CONVERSATION:"delete",PIN_CONVERSATION:"top",SET_CONVERSATION_CUSTOM_DATA:"mark_contact",MARK_CONVERSATION:"mark_contact",CREATE_CONVERSATION_GROUP:"create_contact_group",DELETE_CONVERSATION_GROUP:"del_contact_group",UPDATE_CONVERSATION_GROUP:"update_contact_group",GET_CONVERSATION_GROUP_LIST:"get_contact_group",GET_MESSAGES:"getmsg",GET_C2C_ROAM_MESSAGES:"getroammsg",SET_C2C_PEER_MUTE_NOTIFICATIONS:"set_c2c_peer_mute_notifications",GET_C2C_PEER_MUTE_NOTIFICATIONS:"get_c2c_peer_mute_notifications",GET_GROUP_ROAM_MESSAGES:"group_msg_get",GET_READ_RECEIPT:"get_group_msg_receipt",GET_READ_RECEIPT_DETAIL:"get_group_msg_receipt_detail",SEND_READ_RECEIPT:"group_msg_receipt",SEND_C2C_READ_RECEIPT:"c2c_msg_read_receipt",SET_C2C_MESSAGE_READ:"msgreaded",GET_PEER_READ_TIME:"get_peer_read_time",SET_GROUP_MESSAGE_READ:"msg_read_report",FILE_READ_AND_WRITE_AUTHKEY:"authkey",FILE_UPLOAD:"pic_up",COS_SIGN:"cos",COS_PRE_SIG:"pre_sig",VIDEO_COVER:"video_cover",TIM_WEB_REPORT_V2:"tim_web_report_v2",BIG_DATA_HALLWAY_AUTH_KEY:"authkey",GET_ONLINE_MEMBER_NUM:"get_online_member_num",ALIVE:"alive",MESSAGE_PUSH:"msg_push",MULTI_MESSAGE_PUSH:"multi_msg_push_ws",MESSAGE_PUSH_ACK:"ws_msg_push_ack",STATUS_FORCE_OFFLINE:"stat_forceoffline",DOWNLOAD_MERGER_MESSAGE:"get_relay_json_msg",UPLOAD_MERGER_MESSAGE:"save_relay_json_msg",FETCH_CLOUD_CONTROL_CONFIG:"fetch_config",PUSHED_CLOUD_CONTROL_CONFIG:"push_configv2",FETCH_COMMERCIAL_CONFIG:"fetch_imsdk_purchase_bitsv2",PUSHED_COMMERCIAL_CONFIG:"push_imsdk_purchase_bitsv2",KICK_OTHER:"KickOther",OVERLOAD_NOTIFY:"notify2",SET_ALL_MESSAGE_READ:"read_all_unread_msg",CREATE_TOPIC:"create_topic",DELETE_TOPIC:"destroy_topic",UPDATE_TOPIC_PROFILE:"modify_topic",GET_TOPIC_LIST:"get_topic",SET_SELF_STATUS:"ws_set_custom_status",GET_USER_STATUS:"ws_get_user_status",SUBSCRIBE_USER_STATUS:"ws_status_subscribe",UNSUBSCRIBE_USER_STATUS:"ws_status_unsubscribe"},CHANNEL:{SOCKET:1,XHR:2,AUTO:0},NAME_VERSION:{openim:"v4",group_open_http_svc:"v4",sns:"v4",profile:"v4",recentcontact:"v4",openpic:"v4",group_open_http_noauth_svc:"v4",group_open_long_polling_http_svc:"v4",group_open_long_polling_http_noauth_svc:"v4",imopenstat:"v4",im_cos_sign_svr:"v4",im_cos_msg:"v4",webim:"v4",im_open_push:"v4",im_open_status:"v4"}},wc={SEARCH_MSG:new Sc(0,Math.pow(2,0)).toString(),SEARCH_GRP_SNS:new Sc(0,Math.pow(2,1)).toString(),AVCHATROOM_HISTORY_MSG:new Sc(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new Sc(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new Sc(0,Math.pow(2,4)).toString(),AVCHATROOM_MBR_LIST:new Sc(0,Math.pow(2,6)).toString(),USER_STATUS:new Sc(0,Math.pow(2,7)).toString(),CONV_MARK:new Sc(0,Math.pow(2,9)).toString(),CONV_GROUP:new Sc(0,Math.pow(2,10)).toString(),AVCHATROOM_BAN_MBR:new Sc(0,Math.pow(2,11)).toString()};bc.HOST.setCurrent(Rc);var Fc,qc="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),Vc="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),xc="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),Bc="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),Kc="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),Hc="undefined"!=typeof uni&&"undefined"==typeof window,jc="undefined"!=typeof uni,Wc=qc||Vc||xc||Bc||Kc||Hc,Yc=("undefined"!=typeof uni||"undefined"!=typeof window)&&!Wc,zc=Vc?qq:xc?tt:Bc?swan:Kc?my:qc?wx:Hc?uni:{},Jc=(Fc="WEB",cl?Fc="WEB":Vc?Fc="QQ_MP":xc?Fc="TT_MP":Bc?Fc="BAIDU_MP":Kc?Fc="ALI_MP":qc?Fc="WX_MP":Hc&&(Fc="UNI_NATIVE_APP"),Dc[Fc]),Xc=Yc&&window&&window.navigator&&window.navigator.userAgent||"",Qc=/AppleWebKit\/([\d.]+)/i.exec(Xc),Zc=(Qc&&parseFloat(Qc.pop()),/iPad/i.test(Xc)),$c=/iPhone/i.test(Xc)&&!Zc,el=/iPod/i.test(Xc),tl=$c||Zc||el,nl=function(){var e=Xc.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),ol=/Android/i.test(Xc),rl=function(){var e=Xc.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),al=(ol&&/webkit/i.test(Xc),/Firefox/i.test(Xc),/Edge/i.test(Xc)),sl=(!al&&/Chrome/i.test(Xc),function(){var e=Xc.match(/Chrome\/(\d+)/);e&&e[1]&&parseFloat(e[1])}(),/MSIE/.test(Xc)||Xc.indexOf("Trident")>-1&&Xc.indexOf("rv:11.0")>-1),il=(/MSIE\s8\.0/.test(Xc),function(){var e=/MSIE\s(\d+)\.\d/.exec(Xc),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(Xc)&&/rv:11.0/.test(Xc)&&(t=11),t}()),ul=(/Safari/i.test(Xc),/TBS\/\d+/i.test(Xc)),cl=(function(){var e=Xc.match(/TBS\/(\d+)/i);e&&e[1]&&e[1]}(),!ul&&/MQQBrowser\/\d+/i.test(Xc),!ul&&/ QQBrowser\/\d+/i.test(Xc),/(micromessenger|webbrowser)/i.test(Xc)),ll=/Windows/i.test(Xc),dl=/MAC OS X/i.test(Xc),pl=(/MicroMessenger/i.test(Xc),Yc&&"undefined"!=typeof Worker&&!sl),gl=ol||tl,_l=G((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),hl=Object.isExtensible,fl=G((function(){hl(1)}))||_l?function(e){return!!oe(e)&&(!_l||"ArrayBuffer"!=J(e))&&(!hl||hl(e))}:hl,ml=!G((function(){return Object.isExtensible(Object.preventExtensions({}))})),vl=N((function(e){var t=rt.f,n=!1,o=Pe("meta"),r=0,a=function(e){t(e,o,{value:{objectID:"O"+r++,weakData:{}}})},i=e.exports={enable:function(){i.enable=function(){},n=!0;var e=jt.f,t=W([].splice),r={};r[o]=1,e(r).length&&(jt.f=function(n){for(var r=e(n),a=0,s=r.length;a<s;a++)if(r[a]===o){t(r,a,1);break}return r},rn({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:gi.f}))},fastKey:function(e,t){if(!oe(e))return"symbol"==s(e)?e:("string"==typeof e?"S":"P")+e;if(!Re(e,o)){if(!fl(e))return"F";if(!t)return"E";a(e)}return e[o].objectID},getWeakData:function(e,t){if(!Re(e,o)){if(!fl(e))return!0;if(!t)return!1;a(e)}return e[o].weakData},onFreeze:function(e){return ml&&n&&fl(e)&&!Re(e,o)&&a(e),e}};ht[o]=!0})),Ml=(vl.enable,vl.fastKey,vl.getWeakData,vl.onFreeze,rt.f),yl=vl.fastKey,Il=Et.set,Tl=Et.getterFor;!function(e,t,n){var o=-1!==e.indexOf("Map"),r=-1!==e.indexOf("Weak"),a=o?"set":"add",s=k[e],i=s&&s.prototype,u=s,c={},l=function(e){var t=W(i[e]);Nt(i,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(r&&!oe(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return r&&!oe(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(r&&!oe(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(nn(e,!ne(s)||!(r||i.forEach&&!G((function(){(new s).entries().next()})))))u=n.getConstructor(t,e,o,a),vl.enable();else if(nn(e,!0)){var d=new u,p=d[a](r?{}:-0,1)!=d,g=G((function(){d.has(1)})),_=Lo((function(e){new s(e)})),h=!r&&G((function(){for(var e=new s,t=5;t--;)e[a](t,t);return!e.has(-0)}));_||((u=t((function(e,t){Pi(e,i);var n=Vr(new s,e,u);return null!=t&&Fi(t,n[a],{that:n,AS_ENTRIES:o}),n}))).prototype=i,i.constructor=u),(g||h)&&(l("delete"),l("has"),o&&l("get")),(h||p)&&l(a),r&&i.clear&&delete i.clear}c[e]=u,rn({global:!0,forced:u!=s},c),Qo(u,e),r||n.setStrong(u,e,o)}("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(e,t,n,o){var r=e((function(e,r){Pi(e,a),Il(e,{type:t,index:wn(null),first:void 0,last:void 0,size:0}),P||(e.size=0),null!=r&&Fi(r,e[o],{that:e,AS_ENTRIES:n})})),a=r.prototype,s=Tl(t),i=function(e,t,n){var o,r,a=s(e),i=u(e,t);return i?i.value=n:(a.last=i={index:r=yl(t,!0),key:t,value:n,previous:o=a.last,next:void 0,removed:!1},a.first||(a.first=i),o&&(o.next=i),P?a.size++:e.size++,"F"!==r&&(a.index[r]=i)),e},u=function(e,t){var n,o=s(e),r=yl(t);if("F"!==r)return o.index[r];for(n=o.first;n;n=n.next)if(n.key==t)return n};return Ri(a,{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,P?e.size=0:this.size=0},delete:function(e){var t=s(this),n=u(this,e);if(n){var o=n.next,r=n.previous;delete t.index[n.index],n.removed=!0,r&&(r.next=o),o&&(o.previous=r),t.first==n&&(t.first=o),t.last==n&&(t.last=r),P?t.size--:this.size--}return!!n},forEach:function(e){for(var t,n=s(this),o=qn(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(o(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!u(this,e)}}),Ri(a,n?{get:function(e){var t=u(this,e);return t&&t.value},set:function(e,t){return i(this,0===e?0:e,t)}}:{add:function(e){return i(this,e=0===e?0:e,e)}}),P&&Ml(a,"size",{get:function(){return s(this).size}}),r},setStrong:function(e,t,n){var o=t+" Iterator",r=Tl(t),a=Tl(o);lr(e,t,(function(e,t){Il(this,{type:o,target:e,state:r(e),kind:t,last:void 0})}),(function(){for(var e=a(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),ki(t)}});var El,Cl,Sl="undefined"!=typeof o?o:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};El="undefined"!=typeof console?console:void 0!==Sl&&Sl.console?Sl.console:"undefined"!=typeof window&&window.console?window.console:{};for(var Al=function(){},Dl=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],Nl=Dl.length;Nl--;)Cl=Dl[Nl],function(){}||(El[Cl]=Al);var Ol=El,Rl=0,Ll=function(){return(new Date).getTime()+Rl},kl=function(){Rl=0},Gl=function(){return Math.floor(Ll()/1e3)},Pl=0,Ul=new Map;function bl(){var e,t=((e=new Date).setTime(Ll()),e);return"TIM "+t.toLocaleTimeString("en-US",{hour12:!1})+"."+function(e){var t;switch(e.toString().length){case 1:t="00"+e;break;case 2:t="0"+e;break;default:t=e}return t}(t.getMilliseconds())+":"}var wl={arguments2String:function(e){var t;if(1===e.length)t=bl()+e[0];else{t=bl();for(var n=0,o=e.length;n<o;n++)td(e[n])?od(e[n])?t+=cd(e[n]):t+=JSON.stringify(e[n]):t+=e[n],t+=" "}return t},debug:function(){if(Pl<=-1){var e=this.arguments2String(arguments);Ol.debug(e)}},log:function(){if(Pl<=0){var e=this.arguments2String(arguments);Ol.log(e)}},info:function(){if(Pl<=1){var e=this.arguments2String(arguments);Ol.info(e)}},warn:function(){if(Pl<=2){var e=this.arguments2String(arguments);Ol.warn(e)}},error:function(){if(Pl<=3){var e=this.arguments2String(arguments);Ol.error(e)}},time:function(e){Ul.set(e,id.now())},timeEnd:function(e){if(Ul.has(e)){var t=id.now()-Ul.get(e);return Ul.delete(e),t}return Ol.warn("未找到对应label: ".concat(e,", 请在调用 logger.timeEnd 前,调用 logger.time")),0},setLevel:function(e){e<4&&Ol.log(bl()+"set level from "+Pl+" to "+e),Pl=e},getLevel:function(){return Pl}},Fl={JPG:1,JPEG:1,GIF:2,PNG:3,BMP:4,UNKNOWN:255},ql={NICK:"Tag_Profile_IM_Nick",GENDER:"Tag_Profile_IM_Gender",BIRTHDAY:"Tag_Profile_IM_BirthDay",LOCATION:"Tag_Profile_IM_Location",SELFSIGNATURE:"Tag_Profile_IM_SelfSignature",ALLOWTYPE:"Tag_Profile_IM_AllowType",LANGUAGE:"Tag_Profile_IM_Language",AVATAR:"Tag_Profile_IM_Image",MESSAGESETTINGS:"Tag_Profile_IM_MsgSettings",ADMINFORBIDTYPE:"Tag_Profile_IM_AdminForbidType",LEVEL:"Tag_Profile_IM_Level",ROLE:"Tag_Profile_IM_Role"},Vl={UNKNOWN:"Gender_Type_Unknown",FEMALE:"Gender_Type_Female",MALE:"Gender_Type_Male"},xl={NONE:"AdminForbid_Type_None",SEND_OUT:"AdminForbid_Type_SendOut"},Bl={NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_ANY:"AllowType_Type_AllowAny",DENY_ANY:"AllowType_Type_DenyAny"},Kl="JoinedSuccess",Hl="WaitAdminApproval",jl="@TGS#_",Wl="@TOPIC#_",Yl=["url"],zl=function(e){return"file"===rd(e)},Jl=function(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"===n(e)&&e.constructor===Number)},Xl=function(e){return"string"==typeof e},Ql=function(e){return null!==e&&"object"===n(e)},Zl=function(e){if("object"!==n(e)||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var o=t;null!==Object.getPrototypeOf(o);)o=Object.getPrototypeOf(o);return t===o},$l=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"array"===rd(e)},ed=function(e){return void 0===e},td=function(e){return $l(e)||Ql(e)},nd=function(e){return"function"==typeof e},od=function(e){return e instanceof Error},rd=function(e){return Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase()},ad=function(e){if("string"!=typeof e)return!1;var t=e[0];return!/[^a-zA-Z0-9]/.test(t)},sd=0;Date.now||(Date.now=function(){return(new Date).getTime()});var id={now:function(){0===sd&&(sd=Date.now()-1);var e=Date.now()-sd;return e>4294967295?(sd+=4294967295,Date.now()-sd):e},utc:function(){return Math.round(Date.now()/1e3)}},ud=function e(t,n,o,r){if(!td(t)||!td(n))return 0;for(var a,s=0,i=Object.keys(n),u=0,c=i.length;u<c;u++)if(a=i[u],!(ed(n[a])||o&&o.includes(a)))if(td(t[a])&&td(n[a]))s+=e(t[a],n[a],o,r);else{if(r&&r.includes(n[a]))continue;t[a]!==n[a]&&(t[a]=n[a],s+=1)}return s},cd=function(e){return JSON.stringify(e,["message","code"])},ld=function(e){if(0===e.length)return 0;for(var t=0,n=0,o="undefined"!=typeof document&&void 0!==document.characterSet?document.characterSet:"UTF-8";void 0!==e[t];)n+=e[t++].charCodeAt[t]<=255?1:!1===o?3:2;return n},dd=function(e){var t=e||99999999;return Math.round(Math.random()*t)},pd="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",gd=pd.length,_d=function(e,t){for(var n in e)if(e[n]===t)return!0;return!1},hd={},fd=function(e){return-1===e.indexOf("http://")||-1===e.indexOf("https://")?"https://"+e:e.replace(/https|http/,"https")},md=function e(t){if(0===Object.getOwnPropertyNames(t).length)return Object.create(null);var o=Array.isArray(t)?[]:Object.create(null),r="";for(var a in t)null!==t[a]?void 0!==t[a]?(r=n(t[a]),["string","number","function","boolean"].indexOf(r)>=0?o[a]=t[a]:o[a]=e(t[a])):o[a]=void 0:o[a]=null;return o};function vd(e,t){$l(e)&&$l(t)?t.forEach((function(t){var n=t.key,o=t.value,r=e.find((function(e){return e.key===n}));r?r.value=o:e.push({key:n,value:o})})):wl.warn("updateCustomField target 或 source 不是数组,忽略此次更新。")}var Md=function(e){return e===hr.GRP_PUBLIC},yd=function(e){return e===hr.GRP_AVCHATROOM},Id=function(e){var t=e.type,n=e.groupID;return t===hr.GRP_COMMUNITY||"".concat(n).startsWith(jl)&&!"".concat(n).includes(Wl)},Td=function(e){return"".concat(e).startsWith(jl)&&"".concat(e).includes(Wl)},Ed=function(e){return Xl(e)&&e.slice(0,3)===hr.CONV_C2C},Cd=function(e){return Xl(e)&&e.slice(0,5)===hr.CONV_GROUP},Sd=function(e){return Xl(e)&&e===hr.CONV_SYSTEM};function Ad(e,t){var n={};return Object.keys(e).forEach((function(o){n[o]=t(e[o],o)})),n}function Dd(e){return Wc?new Promise((function(t,n){zc.getImageInfo({src:e,success:function(e){t({width:e.width,height:e.height})},fail:function(){t({width:0,height:0})}})})):sl&&9===il?Promise.resolve({width:0,height:0}):new Promise((function(t,n){var o=new Image;o.onload=function(){t({width:this.width,height:this.height}),o=null},o.onerror=function(){t({width:0,height:0}),o=null},o.src=e}))}function Nd(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return"".concat(e()+e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e())}function Od(){var e="unknown";if(dl&&(e="mac"),ll&&(e="windows"),tl&&(e="ios"),ol&&(e="android"),Wc)try{var t=zc.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(kC){}return e}function Rd(e,t){e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.length<n;)e.push("0");for(;t.length<n;)t.push("0");for(var o=0;o<n;o++){var r=parseInt(e[o]),a=parseInt(t[o]);if(r>a)return 1;if(r<a)return-1}return 0}function Ld(e){var t=e.originUrl,n=void 0===t?void 0:t,o=e.originWidth,r=e.originHeight,a=e.min,s=void 0===a?198:a,i=parseInt(o),u=parseInt(r),c={url:void 0,width:0,height:0};if((i<=u?i:u)<=s)c.url=n,c.width=i,c.height=u;else{u<=i?(c.width=Math.ceil(i*s/u),c.height=s):(c.width=s,c.height=Math.ceil(u*s/i));var l=n&&n.indexOf("?")>-1?"".concat(n,"&"):"".concat(n,"?");c.url="".concat(l,198===s?"imageView2/3/w/198/h/198":"imageView2/3/w/720/h/720")}return ed(n)?h(c,Yl):c}function kd(e){var t=e[2];e[2]=e[1],e[1]=t;for(var n=0;n<e.length;n++)e[n].setType(n)}function Gd(e){var t=e.servcmd;return t.slice(t.indexOf(".")+1)}function Pd(e,t){return Math.round(Number(e)*Math.pow(10,t))/Math.pow(10,t)}function Ud(e,t){return e.includes(t)}function bd(e,t){return e.includes(t)}function wd(e){return e.split(Wl)[0]}var Fd=function(e,t){if(ed(t))return"";switch(e){case hr.MSG_TEXT:return t.text;case hr.MSG_IMAGE:return"[图片]";case hr.MSG_LOCATION:return"[位置]";case hr.MSG_AUDIO:return"[语音]";case hr.MSG_VIDEO:return"[视频]";case hr.MSG_FILE:return"[文件]";case hr.MSG_CUSTOM:return"[自定义消息]";case hr.MSG_GRP_TIP:return"[群提示消息]";case hr.MSG_GRP_SYS_NOTICE:return"[群系统通知]";case hr.MSG_FACE:return"[动画表情]";case hr.MSG_MERGER:return"[聊天记录]";default:return""}};function qd(e){return e===hr.MSG_TEXT||e===hr.MSG_CUSTOM||e===hr.MSG_LOCATION||e===hr.MSG_FACE}function Vd(e){var t=[];if(!Xl(e))return t;var n=e.length;if(0===n)return t;for(var o=n-1;o>=0;o--)"1"===e[o]&&t.push(Math.pow(2,n-o-1));return t}var xd=Object.prototype.hasOwnProperty;function Bd(e){if(null==e)return!0;if("boolean"==typeof e)return!1;if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if(Zl(e)){for(var t in e)if(xd.call(e,t))return!1;return!0}return!("map"!==rd(e)&&!function(e){return"set"===rd(e)}(e)&&!zl(e))&&0===e.size}function Kd(e,t,n){if(void 0===t)return!0;var o=!0;if("object"===qr(t).toLowerCase())Object.keys(t).forEach((function(r){var a=1===e.length?e[0][r]:void 0;o=!!Hd(a,t[r],n,r)&&o}));else if("array"===qr(t).toLowerCase())for(var r=0;r<t.length;r++)o=!!Hd(e[r],t[r],n,t[r].name)&&o;if(o)return o;throw new Error("Params validate failed.")}function Hd(e,t,n,o){if(void 0===t)return!0;var r=!0;return t.required&&Bd(e)&&(Ol.error("TIM [".concat(n,'] Missing required params: "').concat(o,'".')),r=!1),Bd(e)||qr(e).toLowerCase()===t.type.toLowerCase()||(Ol.error("TIM [".concat(n,'] Invalid params: type check failed for "').concat(o,'".Expected ').concat(t.type,".")),r=!1),t.validator&&!t.validator(e)&&(Ol.error("TIM [".concat(n,"] Invalid params: custom validator check failed for params.")),r=!1),r}var jd={f:qe},Wd=k,Yd=rt.f,zd=to.forEach,Jd=_t("hidden"),Xd=qe("toPrimitive"),Qd=Et.set,Zd=Et.getterFor("Symbol"),$d=Object.prototype,ep=k.Symbol,tp=ep&&ep.prototype,np=k.TypeError,op=k.QObject,rp=ae("JSON","stringify"),ap=Je.f,sp=rt.f,ip=gi.f,up=V.f,cp=W([].push),lp=Ae("symbols"),dp=Ae("op-symbols"),pp=Ae("string-to-symbol-registry"),gp=Ae("symbol-to-string-registry"),_p=Ae("wks"),hp=!op||!op.prototype||!op.prototype.findChild,fp=P&&G((function(){return 7!=wn(sp({},"a",{get:function(){return sp(this,"a",{value:7}).a}})).a}))?function(e,t,n){var o=ap($d,t);o&&delete $d[t],sp(e,t,n),o&&e!==$d&&sp($d,t,o)}:sp,mp=function(e,t){var n=lp[e]=wn(tp);return Qd(n,{type:"Symbol",tag:e,description:t}),P||(n.description=t),n},vp=function e(t,n,o){t===$d&&e(dp,n,o),$e(t);var r=Ke(n);return $e(o),Re(lp,r)?(o.enumerable?(Re(t,Jd)&&t[Jd][r]&&(t[Jd][r]=!1),o=wn(o,{enumerable:x(0,!1)})):(Re(t,Jd)||sp(t,Jd,x(1,{})),t[Jd][r]=!0),fp(t,r,o)):sp(t,r,o)},Mp=function(e,t){$e(e);var n=te(t),o=On(n).concat(Ep(n));return zd(o,(function(t){P&&!w(yp,n,t)||vp(e,t,n[t])})),e},yp=function(e){var t=Ke(e),n=w(up,this,t);return!(this===$d&&Re(lp,t)&&!Re(dp,t))&&(!(n||!Re(this,t)||!Re(lp,t)||Re(this,Jd)&&this[Jd][t])||n)},Ip=function(e,t){var n=te(e),o=Ke(t);if(n!==$d||!Re(lp,o)||Re(dp,o)){var r=ap(n,o);return!r||!Re(lp,o)||Re(n,Jd)&&n[Jd][o]||(r.enumerable=!0),r}},Tp=function(e){var t=ip(te(e)),n=[];return zd(t,(function(e){Re(lp,e)||Re(ht,e)||cp(n,e)})),n},Ep=function(e){var t=e===$d,n=ip(t?dp:te(e)),o=[];return zd(n,(function(e){!Re(lp,e)||t&&!Re($d,e)||cp(o,lp[e])})),o};if(ge||(tp=(ep=function(){if(se(tp,this))throw np("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?gn(arguments[0]):void 0,t=Pe(e),n=function e(n){this===$d&&w(e,dp,n),Re(this,Jd)&&Re(this[Jd],t)&&(this[Jd][t]=!1),fp(this,t,x(1,n))};return P&&hp&&fp($d,t,{configurable:!0,set:n}),mp(t,e)}).prototype,Nt(tp,"toString",(function(){return Zd(this).tag})),Nt(ep,"withoutSetter",(function(e){return mp(Pe(e),e)})),V.f=yp,rt.f=vp,Rn.f=Mp,Je.f=Ip,jt.f=gi.f=Tp,Wt.f=Ep,jd.f=function(e){return mp(qe(e),e)},P&&(sp(tp,"description",{configurable:!0,get:function(){return Zd(this).description}}),Nt($d,"propertyIsEnumerable",yp,{unsafe:!0}))),rn({global:!0,wrap:!0,forced:!ge,sham:!ge},{Symbol:ep}),zd(On(_p),(function(e){!function(e){var t=Wd.Symbol||(Wd.Symbol={});Re(t,e)||Yd(t,e,{value:jd.f(e)})}(e)})),rn({target:"Symbol",stat:!0,forced:!ge},{for:function(e){var t=gn(e);if(Re(pp,t))return pp[t];var n=ep(t);return pp[t]=n,gp[n]=t,n},keyFor:function(e){if(!fe(e))throw np(e+" is not a symbol");if(Re(gp,e))return gp[e]},useSetter:function(){hp=!0},useSimple:function(){hp=!1}}),rn({target:"Object",stat:!0,forced:!ge,sham:!P},{create:function(e,t){return void 0===t?wn(e):Mp(wn(e),t)},defineProperty:vp,defineProperties:Mp,getOwnPropertyDescriptor:Ip}),rn({target:"Object",stat:!0,forced:!ge},{getOwnPropertyNames:Tp,getOwnPropertySymbols:Ep}),rn({target:"Object",stat:!0,forced:G((function(){Wt.f(1)}))},{getOwnPropertySymbols:function(e){return Wt.f(Ne(e))}}),rp){var Cp=!ge||G((function(){var e=ep();return"[null]"!=rp([e])||"{}"!=rp({a:e})||"{}"!=rp(Object(e))}));rn({target:"JSON",stat:!0,forced:Cp},{stringify:function(e,t,n){var o=fr(arguments),r=t;if((oe(t)||void 0!==e)&&!fe(e))return Vn(t)||(t=function(e,t){if(ne(r)&&(t=w(r,this,e,t)),!fe(t))return t}),o[1]=t,Cs(rp,null,o)}})}if(!tp[Xd]){var Sp=tp.valueOf;Nt(tp,Xd,(function(e){return w(Sp,this)}))}Qo(ep,"Symbol"),ht[Jd]=!0;var Ap=rt.f,Dp=k.Symbol,Np=Dp&&Dp.prototype;if(P&&ne(Dp)&&(!("description"in Np)||void 0!==Dp().description)){var Op={},Rp=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:gn(arguments[0]),t=se(Np,this)?new Dp(e):void 0===e?Dp():Dp(e);return""===e&&(Op[t]=!0),t};Jt(Rp,Dp),Rp.prototype=Np,Np.constructor=Rp;var Lp="Symbol(test)"==String(Dp("test")),kp=W(Np.toString),Gp=W(Np.valueOf),Pp=/^Symbol\((.*)\)[^)]+$/,Up=W("".replace),bp=W("".slice);Ap(Np,"description",{configurable:!0,get:function(){var e=Gp(this),t=kp(e);if(Re(Op,e))return"";var n=Lp?bp(t,7,-1):Up(t,Pp,"$1");return""===n?void 0:n}}),rn({global:!0,forced:!0},{Symbol:Rp})}var wp={UNSEND:"unSend",SUCCESS:"success",FAIL:"fail"},Fp={NOT_START:"notStart",PENDING:"pengding",RESOLVED:"resolved",REJECTED:"rejected"},qp=function(e){return!!e&&(!!(Ed(e)||Cd(e)||Sd(e))||!1)},Vp={type:"String",required:!0},xp={type:"Array",required:!0},Bp={type:"Object",required:!0},Kp={type:"Boolean",required:!0},Hp={login:{userID:Vp,userSig:Vp},addToBlacklist:{userIDList:xp},on:[{name:"eventName",type:"String",validator:function(e){return"string"==typeof e&&0!==e.length||!1}},{name:"handler",type:"Function",validator:function(e){return"function"==typeof e&&(e.name,!0)}}],once:[{name:"eventName",type:"String",validator:function(e){return"string"==typeof e&&0!==e.length||!1}},{name:"handler",type:"Function",validator:function(e){return"function"==typeof e&&(e.name,!0)}}],off:[{name:"eventName",type:"String",validator:function(e){return"string"==typeof e&&0!==e.length||!1}},{name:"handler",type:"Function",validator:function(e){return"function"==typeof e&&(e.name,!0)}}],sendMessage:[t({name:"message"},Bp)],getMessageList:{conversationID:t(t({},Vp),{},{validator:function(e){return qp(e)}}),nextReqMessageID:{type:"String"},count:{type:"Number",validator:function(e){return!(!ed(e)&&!/^[1-9][0-9]*$/.test(e))||!1}}},getMessageListHopping:{conversationID:t(t({},Vp),{},{validator:function(e){return qp(e)}}),sequence:{type:"Number"},time:{type:"Number"},direction:{type:"Number",validator:function(e){return!(!ed(e)&&0!==e&&1!==e)||!1}},count:{type:"Number",validator:function(e){return!(!ed(e)&&!/^[1-9][0-9]*$/.test(e))||!1}}},setMessageRead:{conversationID:t(t({},Vp),{},{validator:function(e){return qp(e)}})},setAllMessageRead:{scope:{type:"String",required:!1,validator:function(e){return!e||-1!==[hr.READ_ALL_C2C_MSG,hr.READ_ALL_GROUP_MSG,hr.READ_ALL_MSG].indexOf(e)||!1}}},getConversationProfile:[t(t({name:"conversationID"},Vp),{},{validator:function(e){return qp(e)}})],deleteConversation:[t(t({name:"conversationID"},Vp),{},{validator:function(e){return qp(e)}})],pinConversation:{conversationID:t(t({},Vp),{},{validator:function(e){return qp(e)}}),isPinned:t({},Kp)},setConversationCustomData:{conversationIDList:t({},xp),customData:{type:"String",validator:function(e){return Xl(e)&&!(e.length>256)||!1}}},markConversation:{conversationIDList:t({},xp),markType:{type:"number",validator:function(e){return!!Jl(e)&&(!(e<=0)&&(!(e>=Math.pow(2,64))||!1))}},enableMark:t({},Kp)},createConversationGroup:{conversationIDList:t({},xp),groupName:t(t({},Vp),{},{validator:function(e){return!!e&&(!(e.length>32)||!1)}})},deleteConversationGroup:[t({name:"groupName"},Vp)],renameConversationGroup:{oldName:t({},Vp),newName:t(t({},Vp),{},{validator:function(e){return!!e&&(!(e.length>32)||!1)}})},addConversationsToGroup:{conversationIDList:t({},xp),groupName:t({},Vp)},deleteConversationsFromGroup:{conversationIDList:t({},xp),groupName:t({},Vp)},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:Vp,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:xp},createGroup:{name:Vp},joinGroup:{groupID:Vp,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[t({name:"groupID"},Vp)],handleApplication:{message:Bp,handleAction:Vp,handleMessage:{type:"String"}},changeGroupOwner:{groupID:Vp,newOwnerID:Vp},updateGroupProfile:{groupID:Vp,muteAllMembers:{type:"Boolean"}},dismissGroup:[t({name:"groupID"},Vp)],searchGroupByID:[t({name:"groupID"},Vp)],initGroupAttributes:{groupID:Vp,groupAttributes:t(t({},Bp),{},{validator:function(e){var t=!0;return Object.keys(e).forEach((function(n){if(!Xl(e[n]))return t=!1})),t}})},setGroupAttributes:{groupID:Vp,groupAttributes:t(t({},Bp),{},{validator:function(e){var t=!0;return Object.keys(e).forEach((function(n){if(!Xl(e[n]))return t=!1})),t}})},deleteGroupAttributes:{groupID:Vp,keyList:{type:"Array",validator:function(e){if(ed(e))return!1;if(!$l(e))return!1;if(!Bd(e)){var t=!0;return e.forEach((function(e){if(!Xl(e))return t=!1})),t}return!0}}},getGroupAttributes:{groupID:Vp,keyList:{type:"Array",validator:function(e){if(ed(e))return!1;if(!$l(e))return!1;if(!Bd(e)){var t=!0;return e.forEach((function(e){if(!Xl(e))return t=!1})),t}return!0}}},getGroupMemberList:{groupID:Vp,count:{type:"Number"}},getGroupMemberProfile:{groupID:Vp,userIDList:xp,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:Vp,userIDList:xp},setGroupMemberRole:{groupID:Vp,userID:Vp,role:Vp},setGroupMemberMuteTime:{groupID:Vp,userID:Vp,muteTime:{type:"Number",validator:function(e){return e>=0}}},setGroupMemberNameCard:{groupID:Vp,userID:{type:"String"},nameCard:{type:"String",validator:function(e){return!!Xl(e)&&(e.length,!0)}}},setGroupMemberCustomField:{groupID:Vp,userID:{type:"String"},memberCustomField:xp},deleteGroupMember:{groupID:Vp},createTextMessage:{to:Vp,conversationType:Vp,payload:t(t({},Bp),{},{validator:function(e){return Zl(e)&&Xl(e.text)&&0!==e.text.length||!1}})},createTextAtMessage:{to:Vp,conversationType:Vp,payload:t(t({},Bp),{},{validator:function(e){return!!Zl(e)&&(!!Xl(e.text)&&(0!==e.text.length&&(!(e.atUserList&&!$l(e.atUserList))||!1)))}})},createCustomMessage:{to:Vp,conversationType:Vp,payload:t(t({},Bp),{},{validator:function(e){return!!Zl(e)&&(!(e.data&&!Xl(e.data))&&(!(e.description&&!Xl(e.description))&&(!(e.extension&&!Xl(e.extension))||!1)))}})},createImageMessage:{to:Vp,conversationType:Vp,payload:t(t({},Bp),{},{validator:function(e){if(!Zl(e))return!1;if(ed(e.file))return!1;if(Yc){if(!(e.file instanceof HTMLInputElement||zl(e.file)))return Zl(e.file)&&"undefined"!=typeof uni&&0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||!1;if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return!1}return!0},onProgress:{type:"Function",required:!1,validator:function(e){return ed(e),!0}}})},createAudioMessage:{to:Vp,conversationType:Vp,payload:t(t({},Bp),{},{validator:function(e){return!!Zl(e)||!1}}),onProgress:{type:"Function",required:!1,validator:function(e){return ed(e),!0}}},createVideoMessage:{to:Vp,conversationType:Vp,payload:t(t({},Bp),{},{validator:function(e){if(!Zl(e))return!1;if(ed(e.file))return!1;if(Yc){if(!(e.file instanceof HTMLInputElement||zl(e.file)))return Zl(e.file)&&"undefined"!=typeof uni&&!!zl(e.file.tempFile)||!1;if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e){return ed(e),!0}}},createFaceMessage:{to:Vp,conversationType:Vp,payload:t(t({},Bp),{},{validator:function(e){return Zl(e)&&Jl(e.index)&&!!Xl(e.data)||!1}})},createFileMessage:{to:Vp,conversationType:Vp,payload:t(t({},Bp),{},{validator:function(e){if(!Zl(e))return!1;if(ed(e.file))return!1;if(Yc){if(!(e.file instanceof HTMLInputElement||zl(e.file)))return Zl(e.file)&&"undefined"!=typeof uni&&0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||!1;if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e){return ed(e),!0}}},createLocationMessage:{to:Vp,conversationType:Vp,payload:t(t({},Bp),{},{validator:function(e){return Zl(e)&&Xl(e.description)&&Jl(e.longitude)&&!!Jl(e.latitude)||!1}})},createMergerMessage:{to:Vp,conversationType:Vp,payload:t(t({},Bp),{},{validator:function(e){if(Bd(e.messageList))return!1;if(Bd(e.compatibleText))return!1;var t=!1;return e.messageList.forEach((function(e){e.status===wp.FAIL&&(t=!0)})),!t||!1}})},revokeMessage:[t(t({name:"message"},Bp),{},{validator:function(e){return!Bd(e)&&(e.conversationType!==hr.CONV_SYSTEM&&(!0!==e.isRevoked||!1))}})],deleteMessage:[t(t({name:"messageList"},xp),{},{validator:function(e){return!Bd(e)||!1}})],modifyMessage:[t(t({name:"message"},Bp),{},{validator:function(e){return!Bd(e)&&(e.conversationType!==hr.CONV_SYSTEM&&(!0!==e._onlineOnlyFlag||!1))}})],getUserProfile:{userIDList:{type:"Array",validator:function(e){return!!$l(e)&&(e.length,!0)}}},updateMyProfile:{profileCustomField:{type:"Array",validator:function(e){return!!ed(e)||!!$l(e)||!1}}},setSelfStatus:{customStatus:{type:"String",validator:function(e){return!!Xl(e)||!1}}},getUserStatus:{userIDList:{type:"Array",validator:function(e){return $l(e)&&0!==e.length||!1}}},subscribeUserStatus:{userIDList:{type:"Array",validator:function(e){return $l(e)&&0!==e.length||!1}}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:function(e){return!e||!!$l(e)||!1}}},addFriend:{to:Vp,source:{type:"String",required:!0,validator:function(e){return!!e&&(e.startsWith("AddSource_Type_")&&!(e.replace("AddSource_Type_","").length>8)||!1)}},remark:{type:"String",required:!1,validator:function(e){return!(Xl(e)&&e.length>96)||!1}}},deleteFriend:{userIDList:xp},checkFriend:{userIDList:xp},getFriendProfile:{userIDList:xp},updateFriend:{userID:Vp,remark:{type:"String",required:!1,validator:function(e){return!(Xl(e)&&e.length>96)||!1}},friendCustomField:{type:"Array",required:!1,validator:function(e){if(e){if(!$l(e))return!1;var t=!0;return e.forEach((function(e){return Xl(e.key)&&-1!==e.key.indexOf("Tag_SNS_Custom")&&Xl(e.value)?e.value.length>8?t=!1:void 0:t=!1})),t}return!0}}},acceptFriendApplication:{userID:Vp},refuseFriendApplication:{userID:Vp},deleteFriendApplication:{userID:Vp},createFriendGroup:{name:Vp},deleteFriendGroup:{name:Vp},addToFriendGroup:{name:Vp,userIDList:xp},removeFromFriendGroup:{name:Vp,userIDList:xp},renameFriendGroup:{oldName:Vp,newName:Vp},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:function(e){return $l(e)&&0!==e.length||!1}}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:function(e){return $l(e)&&0!==e.length||!1}}],createTopicInCommunity:{groupID:Vp,topicName:Vp},deleteTopicFromCommunity:{groupID:Vp,topicIDList:{type:"Array",validator:function(e){return!e||!!$l(e)||!1}}},updateTopicProfile:{groupID:Vp,topicID:Vp},getTopicList:{groupID:Vp,topicIDList:{type:"Array",validator:function(e){return!e||!!$l(e)||!1}}}},jp={login:"login",logout:"logout",on:"on",once:"once",off:"off",setLogLevel:"setLogLevel",registerPlugin:"registerPlugin",destroy:"destroy",createTextMessage:"createTextMessage",createTextAtMessage:"createTextAtMessage",createImageMessage:"createImageMessage",createAudioMessage:"createAudioMessage",createVideoMessage:"createVideoMessage",createCustomMessage:"createCustomMessage",createFaceMessage:"createFaceMessage",createFileMessage:"createFileMessage",createLocationMessage:"createLocationMessage",createMergerMessage:"createMergerMessage",downloadMergerMessage:"downloadMergerMessage",createForwardMessage:"createForwardMessage",sendMessage:"sendMessage",resendMessage:"resendMessage",revokeMessage:"revokeMessage",deleteMessage:"deleteMessage",modifyMessage:"modifyMessage",sendMessageReadReceipt:"sendMessageReadReceipt",getGroupMessageReadMemberList:"getGroupMessageReadMemberList",getMessageReadReceiptList:"getMessageReadReceiptList",getMessageList:"getMessageList",findMessage:"findMessage",getMessageListHopping:"getMessageListHopping",setMessageRead:"setMessageRead",setAllMessageRead:"setAllMessageRead",getConversationList:"getConversationList",getConversationProfile:"getConversationProfile",deleteConversation:"deleteConversation",pinConversation:"pinConversation",setConversationCustomData:"setConversationCustomData",markConversation:"markConversation",createConversationGroup:"createConversationGroup",getConversationGroupList:"getConversationGroupList",deleteConversationGroup:"deleteConversationGroup",renameConversationGroup:"renameConversationGroup",addConversationsToGroup:"addConversationsToGroup",deleteConversationsFromGroup:"deleteConversationsFromGroup",getGroupList:"getGroupList",getGroupProfile:"getGroupProfile",createGroup:"createGroup",joinGroup:"joinGroup",updateGroupProfile:"updateGroupProfile",quitGroup:"quitGroup",dismissGroup:"dismissGroup",changeGroupOwner:"changeGroupOwner",searchGroupByID:"searchGroupByID",setMessageRemindType:"setMessageRemindType",handleGroupApplication:"handleGroupApplication",initGroupAttributes:"initGroupAttributes",setGroupAttributes:"setGroupAttributes",deleteGroupAttributes:"deleteGroupAttributes",getGroupAttributes:"getGroupAttributes",getJoinedCommunityList:"getJoinedCommunityList",createTopicInCommunity:"createTopicInCommunity",deleteTopicFromCommunity:"deleteTopicFromCommunity",updateTopicProfile:"updateTopicProfile",getTopicList:"getTopicList",getGroupMemberProfile:"getGroupMemberProfile",getGroupMemberList:"getGroupMemberList",addGroupMember:"addGroupMember",deleteGroupMember:"deleteGroupMember",setGroupMemberNameCard:"setGroupMemberNameCard",setGroupMemberMuteTime:"setGroupMemberMuteTime",setGroupMemberRole:"setGroupMemberRole",setGroupMemberCustomField:"setGroupMemberCustomField",getGroupOnlineMemberCount:"getGroupOnlineMemberCount",getMyProfile:"getMyProfile",getUserProfile:"getUserProfile",updateMyProfile:"updateMyProfile",setSelfStatus:"setSelfStatus",getUserStatus:"getUserStatus",subscribeUserStatus:"subscribeUserStatus",unsubscribeUserStatus:"unsubscribeUserStatus",getBlacklist:"getBlacklist",addToBlacklist:"addToBlacklist",removeFromBlacklist:"removeFromBlacklist",getFriendList:"getFriendList",addFriend:"addFriend",deleteFriend:"deleteFriend",checkFriend:"checkFriend",updateFriend:"updateFriend",getFriendProfile:"getFriendProfile",getFriendApplicationList:"getFriendApplicationList",refuseFriendApplication:"refuseFriendApplication",deleteFriendApplication:"deleteFriendApplication",acceptFriendApplication:"acceptFriendApplication",setFriendApplicationRead:"setFriendApplicationRead",getFriendGroupList:"getFriendGroupList",createFriendGroup:"createFriendGroup",renameFriendGroup:"renameFriendGroup",deleteFriendGroup:"deleteFriendGroup",addToFriendGroup:"addToFriendGroup",removeFromFriendGroup:"removeFromFriendGroup",callExperimentalAPI:"callExperimentalAPI"},Wp=!!Oi&&G((function(){Oi.prototype.finally.call({then:function(){}},(function(){}))}));if(rn({target:"Promise",proto:!0,real:!0,forced:Wp},{finally:function(e){var t=Bi(this,ae("Promise")),n=ne(e);return this.then(n?function(n){return Nu(t,e()).then((function(){return n}))}:e,n?function(n){return Nu(t,e()).then((function(){throw n}))}:e)}}),ne(Oi)){var Yp=ae("Promise").prototype.finally;Oi.prototype.finally!==Yp&&Nt(Oi.prototype,"finally",Yp,{unsafe:!0})}var zp=/MSIE .\./.test(ie),Jp=k.Function,Xp=function(e){return function(t,n){var o=Hi(arguments.length,1)>2,r=ne(t)?t:Jp(t),a=o?fr(arguments,2):void 0;return e(o?function(){Cs(r,this,a)}:r,n)}};rn({global:!0,bind:!0,forced:zp},{setTimeout:Xp(k.setTimeout),setInterval:Xp(k.setInterval)});var Qp=to.filter,Zp=Cr("filter");rn({target:"Array",proto:!0,forced:!Zp},{filter:function(e){return Qp(this,e,arguments.length>1?arguments[1]:void 0)}});var $p,eg="sign",tg="message",ng="user",og="c2c",rg="group",ag="sns",sg="groupMember",ig="Topic",ug="conversation",cg="context",lg="storage",dg="eventStat",pg="netMonitor",gg="bigDataChannel",_g="upload",hg="plugin",fg="syncUnreadMessage",mg="session",vg="channel",Mg="message_loss_detection",yg="cloudControl",Ig="workerTimer",Tg="pullGroupMessage",Eg="qualityStat",Cg="commercialConfig",Sg="offlinePush",Ag=function(){function e(t){r(this,e),this._moduleManager=t,this._className=""}return i(e,[{key:"isLoggedIn",value:function(){return this._moduleManager.getModule(cg).isLoggedIn()}},{key:"isOversea",value:function(){return this._moduleManager.getModule(cg).isOversea()}},{key:"isPrivateNetWork",value:function(){return this._moduleManager.getModule(cg).isPrivateNetWork()}},{key:"getMyUserID",value:function(){return this._moduleManager.getModule(cg).getUserID()}},{key:"getMyTinyID",value:function(){return this._moduleManager.getModule(cg).getTinyID()}},{key:"getModule",value:function(e){return this._moduleManager.getModule(e)}},{key:"getPlatform",value:function(){return Jc}},{key:"getNetworkType",value:function(){return this._moduleManager.getModule(pg).getNetworkType()}},{key:"probeNetwork",value:function(e){return this._moduleManager.getModule(pg).probe(e)}},{key:"getCloudConfig",value:function(e){return this._moduleManager.getModule(yg).getCloudConfig(e)}},{key:"emitOuterEvent",value:function(e,t){this._moduleManager.getOuterEmitterInstance().emit(e,t)}},{key:"emitInnerEvent",value:function(e,t){this._moduleManager.getInnerEmitterInstance().emit(e,t)}},{key:"getInnerEmitterInstance",value:function(){return this._moduleManager.getInnerEmitterInstance()}},{key:"generateTjgID",value:function(e){return this._moduleManager.getModule(cg).getTinyID()+"-"+e.random}},{key:"filterModifiedMessage",value:function(e){if(!Bd(e)){var t=e.filter((function(e){return!0===e.isModified}));t.length>0&&this.emitOuterEvent(_r.MESSAGE_MODIFIED,t)}}},{key:"filterUnmodifiedMessage",value:function(e){return Bd(e)?[]:e.filter((function(e){return!1===e.isModified}))}},{key:"request",value:function(e){return this._moduleManager.getModule(mg).request(e)}},{key:"canIUse",value:function(e){return this._moduleManager.getModule(Cg).canIUse(e)}}]),e}(),Dg="wslogin",Ng="wslogout",Og="wshello",Rg="KickOther",Lg="getmsg",kg="authkey",Gg="sendmsg",Pg="send_group_msg",Ug="portrait_get_all",bg="portrait_set",wg="black_list_get",Fg="black_list_add",qg="black_list_delete",Vg="msgwithdraw",xg="msgreaded",Bg="set_c2c_peer_mute_notifications",Kg="get_c2c_peer_mute_notifications",Hg="getroammsg",jg="get_peer_read_time",Wg="delete_c2c_msg_ramble",Yg="modify_c2c_msg",zg="page_get",Jg="get",Xg="delete",Qg="top",Zg="deletemsg",$g="set_conv_custom_data",e_="mark_contact",t_="create_contact_group",n_="del_contact_group",o_="update_contact_group",r_="add_conv_to_group",a_="del_conv_from_group",s_="get_contact_group",i_="get_joined_group_list",u_="get_group_self_member_info",c_="create_group",l_="destroy_group",d_="modify_group_base_info",p_="apply_join_group",g_="apply_join_group_noauth",__="quit_group",h_="get_group_public_info",f_="change_group_owner",m_="handle_apply_join_group",v_="handle_invite_join_group",M_="group_msg_recall",y_="msg_read_report",I_="read_all_unread_msg",T_="group_msg_get",E_="get_group_msg_receipt",C_="group_msg_receipt",S_="c2c_msg_read_receipt",A_="get_group_msg_receipt_detail",D_="get_pendency",N_="deletemsg",O_="get_msg",R_="get_msg_noauth",L_="get_online_member_num",k_="delete_group_ramble_msg_by_seq",G_="modify_group_msg",P_="set_group_attr",U_="modify_group_attr",b_="delete_group_attr",w_="clear_group_attr",F_="get_group_attr",q_="get_group_member_info",V_="get_members",x_="get_specified_group_member_info",B_="add_group_member",K_="delete_group_member",H_="ban_group_member",j_="modify_group_member_info",W_="cos",Y_="pre_sig",z_="video_cover",J_="tim_web_report_v2",X_="alive",Q_="msg_push",Z_="multi_msg_push_ws",$_="ws_msg_push_ack",eh="stat_forceoffline",th="save_relay_json_msg",nh="get_relay_json_msg",oh="fetch_config",rh="push_configv2",ah="fetch_imsdk_purchase_bitsv2",sh="push_imsdk_purchase_bitsv2",ih="notify2",uh="create_topic",ch="destroy_topic",lh="modify_topic",dh="get_topic",ph="ws_set_custom_status",gh="ws_get_user_status",_h="ws_status_subscribe",hh="ws_status_unsubscribe",fh="ws_stat_background",mh="ws_stat_foreground",vh="ws_stat_settoken",Mh={NO_SDKAPPID:2e3,NO_ACCOUNT_TYPE:2001,NO_IDENTIFIER:2002,NO_USERSIG:2003,NO_TINYID:2022,NO_A2KEY:2023,USER_NOT_LOGGED_IN:2024,REPEAT_LOGIN:2025,COS_UNDETECTED:2040,COS_GET_SIG_FAIL:2041,MESSAGE_SEND_FAIL:2100,MESSAGE_LIST_CONSTRUCTOR_NEED_OPTIONS:2103,MESSAGE_SEND_NEED_MESSAGE_INSTANCE:2105,MESSAGE_SEND_INVALID_CONVERSATION_TYPE:2106,MESSAGE_FILE_IS_EMPTY:2108,MESSAGE_ONPROGRESS_FUNCTION_ERROR:2109,MESSAGE_REVOKE_FAIL:2110,MESSAGE_DELETE_FAIL:2111,MESSAGE_UNREAD_ALL_FAIL:2112,MESSAGE_CONTROL_INFO_FAIL:2113,READ_RECEIPT_MESSAGE_LIST_EMPTY:2114,MESSAGE_SEND_GROUP_WITH_TOPIC_FAIL:2115,CANNOT_DELETE_GROUP_SYSTEM_NOTICE:2116,MESSAGE_IMAGE_SELECT_FILE_FIRST:2251,MESSAGE_IMAGE_TYPES_LIMIT:2252,MESSAGE_IMAGE_SIZE_LIMIT:2253,MESSAGE_AUDIO_UPLOAD_FAIL:2300,MESSAGE_AUDIO_SIZE_LIMIT:2301,MESSAGE_VIDEO_UPLOAD_FAIL:2350,MESSAGE_VIDEO_SIZE_LIMIT:2351,MESSAGE_VIDEO_TYPES_LIMIT:2352,MESSAGE_FILE_UPLOAD_FAIL:2400,MESSAGE_FILE_SELECT_FILE_FIRST:2401,MESSAGE_FILE_SIZE_LIMIT:2402,MESSAGE_FILE_URL_IS_EMPTY:2403,MESSAGE_MERGER_TYPE_INVALID:2450,MESSAGE_MERGER_KEY_INVALID:2451,MESSAGE_MERGER_DOWNLOAD_FAIL:2452,MESSAGE_FORWARD_TYPE_INVALID:2453,MESSAGE_MODIFY_CONFLICT:2480,MESSAGE_MODIFY_DISABLED_IN_AVCHATROOM:2481,CONVERSATION_NOT_FOUND:2500,USER_OR_GROUP_NOT_FOUND:2501,CONVERSATION_UN_RECORDED_TYPE:2502,INVALID_CONVERSATION_ID:2503,ILLEGAL_GROUP_TYPE:2600,CANNOT_JOIN_WORK:2601,ILLEGAL_GROUP_ID:2602,CANNOT_FIND_GROUP:2603,CANNOT_CHANGE_OWNER_IN_AVCHATROOM:2620,CANNOT_CHANGE_OWNER_TO_SELF:2621,CANNOT_DISMISS_Work:2622,MEMBER_NOT_IN_GROUP:2623,CANNOT_USE_GRP_ATTR_NOT_AVCHATROOM:2641,CANNOT_USE_GRP_ATTR_AVCHATROOM_UNJOIN:2642,JOIN_GROUP_FAIL:2660,CANNOT_ADD_MEMBER_IN_AVCHATROOM:2661,CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN:2662,CANNOT_KICK_MEMBER_IN_AVCHATROOM:2680,NOT_OWNER:2681,CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM:2682,INVALID_MEMBER_ROLE:2683,CANNOT_SET_SELF_MEMBER_ROLE:2684,CANNOT_MUTE_SELF:2685,BAN_DURATION_INVALID:2686,NOT_MY_FRIEND:2700,ALREADY_MY_FRIEND:2701,FRIEND_GROUP_EXISTED:2710,FRIEND_GROUP_NOT_EXIST:2711,FRIEND_APPLICATION_NOT_EXIST:2716,UPDATE_PROFILE_INVALID_PARAM:2721,UPDATE_PROFILE_NO_KEY:2722,ADD_BLACKLIST_INVALID_PARAM:2740,DEL_BLACKLIST_INVALID_PARAM:2741,CANNOT_ADD_SELF_TO_BLACKLIST:2742,ADD_FRIEND_INVALID_PARAM:2760,NETWORK_ERROR:2800,NETWORK_TIMEOUT:2801,NETWORK_BASE_OPTIONS_NO_URL:2802,NETWORK_UNDEFINED_SERVER_NAME:2803,NETWORK_PACKAGE_UNDEFINED:2804,NO_NETWORK:2805,CONVERTOR_IRREGULAR_PARAMS:2900,NOTICE_RUNLOOP_UNEXPECTED_CONDITION:2901,NOTICE_RUNLOOP_OFFSET_LOST:2902,UNCAUGHT_ERROR:2903,GET_LONGPOLL_ID_FAILED:2904,INVALID_OPERATION:2905,OVER_FREQUENCY_LIMIT:2996,CANNOT_FIND_PROTOCOL:2997,CANNOT_FIND_MODULE:2998,SDK_IS_NOT_READY:2999,LOGGING_IN:3e3,LOGIN_FAILED:3001,KICKED_OUT_MULT_DEVICE:3002,KICKED_OUT_MULT_ACCOUNT:3003,KICKED_OUT_USERSIG_EXPIRED:3004,LOGGED_OUT:3005,KICKED_OUT_REST_API:3006,ILLEGAL_TOPIC_ID:3021,CANNOT_USE_COMMERCIAL_ABILITY:3122,LONG_POLL_KICK_OUT:91101,MESSAGE_A2KEY_EXPIRED:20002,ACCOUNT_A2KEY_EXPIRED:70001,LONG_POLL_API_PARAM_ERROR:90001,HELLO_ANSWER_KICKED_OUT:1002,OPEN_SERVICE_OVERLOAD_ERROR:60022},yh={NO_SDKAPPID:"无 SDKAppID",NO_ACCOUNT_TYPE:"无 accountType",NO_IDENTIFIER:"无 userID",NO_USERSIG:"无 userSig",NO_TINYID:"无 tinyID",NO_A2KEY:"无 a2key",USER_NOT_LOGGED_IN:"用户未登录",REPEAT_LOGIN:"重复登录",COS_UNDETECTED:"未检测到 COS 上传插件",COS_GET_SIG_FAIL:"获取 COS 预签名 URL 失败",MESSAGE_SEND_FAIL:"消息发送失败",MESSAGE_LIST_CONSTRUCTOR_NEED_OPTIONS:"MessageController.constructor() 需要参数 options",MESSAGE_SEND_NEED_MESSAGE_INSTANCE:"需要 Message 的实例",MESSAGE_SEND_INVALID_CONVERSATION_TYPE:'Message.conversationType 只能为 "C2C" 或 "GROUP"',MESSAGE_FILE_IS_EMPTY:"无法发送空文件",MESSAGE_ONPROGRESS_FUNCTION_ERROR:"回调函数运行时遇到错误,请检查接入侧代码",MESSAGE_REVOKE_FAIL:"消息撤回失败",MESSAGE_DELETE_FAIL:"消息删除失败",MESSAGE_UNREAD_ALL_FAIL:"设置所有未读消息为已读处理失败",MESSAGE_CONTROL_INFO_FAIL:"社群不支持消息发送控制选项",READ_RECEIPT_MESSAGE_LIST_EMPTY:"消息列表中没有需要发送已读回执的消息",MESSAGE_SEND_GROUP_WITH_TOPIC_FAIL:"不能在支持话题的群组中发消息,请检查群组 isSupportTopic 属性",CANNOT_DELETE_GROUP_SYSTEM_NOTICE:"不支持删除群系统通知",MESSAGE_IMAGE_SELECT_FILE_FIRST:"请先选择一个图片",MESSAGE_IMAGE_TYPES_LIMIT:"只允许上传 jpg png jpeg gif bmp image webp 格式的图片",MESSAGE_IMAGE_SIZE_LIMIT:"图片大小超过20M无法发送",MESSAGE_AUDIO_UPLOAD_FAIL:"语音上传失败",MESSAGE_AUDIO_SIZE_LIMIT:"语音大小大于20M无法发送",MESSAGE_VIDEO_UPLOAD_FAIL:"视频上传失败",MESSAGE_VIDEO_SIZE_LIMIT:"视频大小超过100M无法发送",MESSAGE_VIDEO_TYPES_LIMIT:"只允许上传 mp4 格式的视频",MESSAGE_FILE_UPLOAD_FAIL:"文件上传失败",MESSAGE_FILE_SELECT_FILE_FIRST:"请先选择一个文件",MESSAGE_FILE_SIZE_LIMIT:"文件大小超过100M无法发送 ",MESSAGE_FILE_URL_IS_EMPTY:"缺少必要的参数文件 URL",MESSAGE_MERGER_TYPE_INVALID:"非合并消息",MESSAGE_MERGER_KEY_INVALID:"合并消息的 messageKey 无效",MESSAGE_MERGER_DOWNLOAD_FAIL:"下载合并消息失败",MESSAGE_FORWARD_TYPE_INVALID:"选择的消息类型(如群提示消息)不可以转发",MESSAGE_MODIFY_CONFLICT:"修改消息时发生冲突",MESSAGE_MODIFY_DISABLED_IN_AVCHATROOM:"直播群不支持修改消息",CONVERSATION_NOT_FOUND:"没有找到相应的会话,请检查传入参数",USER_OR_GROUP_NOT_FOUND:"没有找到相应的用户或群组,请检查传入参数",CONVERSATION_UN_RECORDED_TYPE:"未记录的会话类型",INVALID_CONVERSATION_ID:"无效的会话 ID",ILLEGAL_GROUP_TYPE:"非法的群类型,请检查传入参数",CANNOT_JOIN_WORK:"不能加入 Work 类型的群组",ILLEGAL_GROUP_ID:"群组 ID 非法,非 Community 类型群组不能以 @TGS#_ 为前缀Community 类型群组必须以 @TGS#_ 为前缀且不能包含 @TOPIC#_ 字符串",CANNOT_FIND_GROUP:"找不到指定 ID 的群组",CANNOT_CHANGE_OWNER_IN_AVCHATROOM:"AVChatRoom 类型的群组不能转让群主",CANNOT_CHANGE_OWNER_TO_SELF:"不能把群主转让给自己",CANNOT_DISMISS_WORK:"不能解散 Work 类型的群组",MEMBER_NOT_IN_GROUP:"用户不在该群组内",JOIN_GROUP_FAIL:"加群失败,请检查传入参数或重试",CANNOT_ADD_MEMBER_IN_AVCHATROOM:"AVChatRoom 类型的群不支持邀请群成员",CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN:"非 AVChatRoom 类型的群组不允许匿名加群,请先登录后再加群",CANNOT_KICK_MEMBER_IN_AVCHATROOM:"不能在 AVChatRoom 类型的群组踢人",NOT_OWNER:"你不是群主,只有群主才有权限操作",CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM:"不能在 Work / AVChatRoom 类型的群中设置群成员身份",INVALID_MEMBER_ROLE:"不合法的群成员身份,请检查传入参数",CANNOT_SET_SELF_MEMBER_ROLE:"不能设置自己的群成员身份,请检查传入参数",CANNOT_MUTE_SELF:"不能将自己禁言,请检查传入参数",BAN_DURATION_INVALID:"封禁时长无效,必须传入 duration 参数且要大于 0",NOT_MY_FRIEND:"非好友关系",ALREADY_MY_FRIEND:"已经是好友关系",FRIEND_GROUP_EXISTED:"好友分组已存在",FRIEND_GROUP_NOT_EXIST:"好友分组不存在",FRIEND_APPLICATION_NOT_EXIST:"好友申请不存在",UPDATE_PROFILE_INVALID_PARAM:"传入 updateMyProfile 接口的参数无效",UPDATE_PROFILE_NO_KEY:"updateMyProfile 无标配资料字段或自定义资料字段",ADD_BLACKLIST_INVALID_PARAM:"传入 addToBlacklist 接口的参数无效",DEL_BLACKLIST_INVALID_PARAM:"传入 removeFromBlacklist 接口的参数无效",CANNOT_ADD_SELF_TO_BLACKLIST:"不能拉黑自己",ADD_FRIEND_INVALID_PARAM:"传入 addFriend 接口的参数无效",NETWORK_ERROR:"网络错误",NETWORK_TIMEOUT:"请求超时",NETWORK_BASE_OPTIONS_NO_URL:"网络层初始化错误,缺少 URL 参数",NETWORK_UNDEFINED_SERVER_NAME:"打包错误,未定义的 serverName",NETWORK_PACKAGE_UNDEFINED:"未定义的 packageConfig",NO_NETWORK:"未连接到网络",CONVERTOR_IRREGULAR_PARAMS:"不规范的参数名称",NOTICE_RUNLOOP_UNEXPECTED_CONDITION:"意料外的通知条件",NOTICE_RUNLOOP_OFFSET_LOST:"_syncOffset 丢失",GET_LONGPOLL_ID_FAILED:"获取 longpolling id 失败",UNCAUGHT_ERROR:"未经明确定义的错误",INVALID_OPERATION:"无效操作,如调用了未定义或者未实现的方法等",CANNOT_FIND_PROTOCOL:"无法找到协议",CANNOT_FIND_MODULE:"无法找到模块请参考https://web.sdk.qcloud.com/im/doc/zh-cn/tutorial-03-sns.html",SDK_IS_NOT_READY:"接口需要 SDK 处于 ready 状态后才能调用",LOGGING_IN:"用户正在登录中",LOGIN_FAILED:"用户登录失败",KICKED_OUT_MULT_DEVICE:"用户多终端登录被踢出",KICKED_OUT_MULT_ACCOUNT:"用户多实例登录被踢出",KICKED_OUT_USERSIG_EXPIRED:"用户 userSig 过期被踢出",LOGGED_OUT:"用户已登出",KICKED_OUT_REST_API:"用户被 REST API - kick 接口: https://cloud.tencent.com/document/product/269/3853 踢出",OVER_FREQUENCY_LIMIT:"超出 SDK 频率控制",LONG_POLL_KICK_OUT:"检测到多个 web 实例登录,消息通道下线",OPEN_SERVICE_OVERLOAD_ERROR:"后台服务正忙,请稍后再试",MESSAGE_A2KEY_EXPIRED:"消息错误码UserSig 或 A2 失效。",ACCOUNT_A2KEY_EXPIRED:"帐号错误码UserSig 已过期,请重新生成。建议 UserSig 有效期设置不小于24小时。",LONG_POLL_API_PARAM_ERROR:"longPoll API parameters error",ILLEGAL_TOPIC_ID:"topicID 非法",CANNOT_USE_COMMERCIAL_ABILITY:"套餐包不支持该接口的使用,请升级到旗舰版套餐"},Ih="networkRTT",Th="messageE2EDelay",Eh="sendMessageC2C",Ch="sendMessageGroup",Sh="sendMessageGroupAV",Ah="sendMessageRichMedia",Dh="cosUpload",Nh="messageReceivedGroup",Oh="messageReceivedGroupAVPush",Rh="messageReceivedGroupAVPull",Lh=(u($p={},Ih,2),u($p,Th,3),u($p,Eh,4),u($p,Ch,5),u($p,Sh,6),u($p,Ah,7),u($p,Nh,8),u($p,Oh,9),u($p,Rh,10),u($p,Dh,11),$p),kh={info:4,warning:5,error:6},Gh={wifi:1,"2g":2,"3g":3,"4g":4,"5g":5,unknown:6,none:7,online:8},Ph={login:4},Uh=function(){function e(t){r(this,e),this.eventType=Ph[t]||0,this.timestamp=0,this.networkType=8,this.code=0,this.message="",this.moreMessage="",this.extension=t,this.costTime=0,this.duplicate=!1,this.level=4,this.uiPlatform=void 0,this._sentFlag=!1,this._startts=Ll()}return i(e,[{key:"updateTimeStamp",value:function(){this.timestamp=Ll()}},{key:"start",value:function(e){return this._startts=e,this}},{key:"end",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._sentFlag){var n=Ll();0===this.costTime&&(this.costTime=n-this._startts),this.setMoreMessage("startts:".concat(this._startts," endts:").concat(n)),t?(this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)):setTimeout((function(){e._sentFlag=!0,e._eventStatModule&&e._eventStatModule.pushIn(e)}),0)}}},{key:"setError",value:function(e,t,n){return e instanceof Error?(this._sentFlag||(this.setNetworkType(n),t?(e.code&&this.setCode(e.code),e.message&&this.setMoreMessage(e.message)):(this.setCode(Mh.NO_NETWORK),this.setMoreMessage(yh.NO_NETWORK)),this.setLevel("error")),this):(wl.warn("SSOLogData.setError value not instanceof Error, please check!"),this)}},{key:"setCode",value:function(e){return ed(e)||this._sentFlag||("ECONNABORTED"===e&&(this.code=103),Jl(e)?this.code=e:wl.warn("SSOLogData.setCode value not a number, please check!",e,n(e))),this}},{key:"setMessage",value:function(e){return ed(e)||this._sentFlag||(Jl(e)&&(this.message=e.toString()),Xl(e)&&(this.message=e)),this}},{key:"setCostTime",value:function(e){return this.costTime=e,this}},{key:"setLevel",value:function(e){return ed(e)||this._sentFlag||(this.level=kh[e]),this}},{key:"setMoreMessage",value:function(e){return Bd(this.moreMessage)?this.moreMessage="".concat(e):this.moreMessage+=" ".concat(e),this}},{key:"setNetworkType",value:function(e){if(ed(e))wl.warn("SSOLogData.setNetworkType value is undefined, please check!");else{var t=Gh[e.toLowerCase()];ed(t)||(this.networkType=t)}return this}},{key:"getStartTs",value:function(){return this._startts}},{key:"setUIPlatform",value:function(e){this.uiPlatform=e}}],[{key:"bindEventStatModule",value:function(t){e.prototype._eventStatModule=t}}]),e}(),bh={SDK_CONSTRUCT:"sdkConstruct",SDK_READY:"sdkReady",LOGIN:"login",LOGOUT:"logout",KICKED_OUT:"kickedOut",REGISTER_PLUGIN:"registerPlugin",KICK_OTHER:"kickOther",WS_CONNECT:"wsConnect",WS_ON_OPEN:"wsOnOpen",WS_ON_CLOSE:"wsOnClose",WS_ON_ERROR:"wsOnError",NETWORK_CHANGE:"networkChange",GET_COS_AUTH_KEY:"getCosAuthKey",GET_COS_PRE_SIG_URL:"getCosPreSigUrl",GET_SNAPSHOT_INFO:"getSnapshotInfo",UPLOAD:"upload",SEND_MESSAGE:"sendMessage",SEND_MESSAGE_WITH_RECEIPT:"sendMessageWithReceipt",SEND_COMBO_MESSAGE:"sendComboMessage",GET_C2C_ROAMING_MESSAGES:"getC2CRoamingMessages",GET_GROUP_ROAMING_MESSAGES:"getGroupRoamingMessages",GET_C2C_ROAMING_MESSAGES_HOPPING:"getC2CRoamingMessagesHopping",GET_GROUP_ROAMING_MESSAGES_HOPPING:"getGroupRoamingMessagesHopping",GET_READ_RECEIPT:"getReadReceipt",GET_READ_RECEIPT_DETAIL:"getReadReceiptDetail",SEND_READ_RECEIPT:"sendReadReceipt",SEND_C2C_READ_RECEIPT:"sendC2CReadReceipt",REVOKE_MESSAGE:"revokeMessage",DELETE_MESSAGE:"deleteMessage",EDIT_MESSAGE:"modifyMessage",SET_C2C_MESSAGE_READ:"setC2CMessageRead",SET_GROUP_MESSAGE_READ:"setGroupMessageRead",EMPTY_MESSAGE_BODY:"emptyMessageBody",GET_PEER_READ_TIME:"getPeerReadTime",UPLOAD_MERGER_MESSAGE:"uploadMergerMessage",DOWNLOAD_MERGER_MESSAGE:"downloadMergerMessage",JSON_PARSE_ERROR:"jsonParseError",MESSAGE_E2E_DELAY_EXCEPTION:"messageE2EDelayException",GET_CONVERSATION_LIST:"getConversationList",GET_CONVERSATION_PROFILE:"getConversationProfile",DELETE_CONVERSATION:"deleteConversation",PIN_CONVERSATION:"pinConversation",GET_CONVERSATION_LIST_IN_STORAGE:"getConversationListInStorage",SYNC_CONVERSATION_LIST:"syncConversationList",SET_ALL_MESSAGE_READ:"setAllMessageRead",SET_CONV_CUSTOM_DATA:"setConvCustomData",MARK_CONVERSATION:"markConversation",GET_REMOTE_CONV_GROUP_LIST:"getRemoteConvGroupList",CREATE_CONV_GROUP:"createConvGroup",DELETE_CONV_GROUP:"deleteConvGroup",RENAME_CONV_GROUP:"renameConvGroup",ADD_CONVS_TO_GROUP:"addConvsToGroup",DELETE_CONVS_FROM_GROUP:"deleteConvsFromGroup",CREATE_GROUP:"createGroup",APPLY_JOIN_GROUP:"applyJoinGroup",QUIT_GROUP:"quitGroup",SEARCH_GROUP_BY_ID:"searchGroupByID",CHANGE_GROUP_OWNER:"changeGroupOwner",HANDLE_GROUP_APPLICATION:"handleGroupApplication",HANDLE_GROUP_INVITATION:"handleGroupInvitation",SET_MESSAGE_REMIND_TYPE:"setMessageRemindType",DISMISS_GROUP:"dismissGroup",UPDATE_GROUP_PROFILE:"updateGroupProfile",GET_GROUP_LIST:"getGroupList",GET_GROUP_PROFILE:"getGroupProfile",GET_GROUP_LIST_IN_STORAGE:"getGroupListInStorage",GET_GROUP_LAST_SEQUENCE:"getGroupLastSequence",GET_GROUP_MISSING_MESSAGE:"getGroupMissingMessage",PAGING_GET_GROUP_LIST:"pagingGetGroupList",PAGING_GET_GROUP_LIST_WITH_TOPIC:"pagingGetGroupListWithTopic",GET_GROUP_SIMPLIFIED_INFO:"getGroupSimplifiedInfo",JOIN_WITHOUT_AUTH:"joinWithoutAuth",INIT_GROUP_ATTRIBUTES:"initGroupAttributes",SET_GROUP_ATTRIBUTES:"setGroupAttributes",DELETE_GROUP_ATTRIBUTES:"deleteGroupAttributes",GET_GROUP_ATTRIBUTES:"getGroupAttributes",GET_GROUP_MEMBER_LIST:"getGroupMemberList",GET_AVCHATROOM_MEMBER_LIST:"getAVChatRoomMemberList",GET_GROUP_MEMBER_PROFILE:"getGroupMemberProfile",ADD_GROUP_MEMBER:"addGroupMember",DELETE_GROUP_MEMBER:"deleteGroupMember",BAN_AVCHATROOM_MEMBER:"banAVChatRoomMember",SET_GROUP_MEMBER_MUTE_TIME:"setGroupMemberMuteTime",SET_GROUP_MEMBER_NAME_CARD:"setGroupMemberNameCard",SET_GROUP_MEMBER_ROLE:"setGroupMemberRole",SET_GROUP_MEMBER_CUSTOM_FIELD:"setGroupMemberCustomField",GET_GROUP_ONLINE_MEMBER_COUNT:"getGroupOnlineMemberCount",SYNC_MESSAGE:"syncMessage",LONG_POLLING_AV_ERROR:"longPollingAVError",MESSAGE_LOSS:"messageLoss",MESSAGE_STACKED:"messageStacked",GET_USER_PROFILE:"getUserProfile",UPDATE_MY_PROFILE:"updateMyProfile",GET_BLACKLIST:"getBlacklist",ADD_TO_BLACKLIST:"addToBlacklist",REMOVE_FROM_BLACKLIST:"removeFromBlacklist",SET_SELF_STATUS:"ws_set_custom_status",GET_USER_STATUS:"ws_get_user_status",SUBSCRIBE_USER_STATUS:"ws_status_subscribe",UNSUBSCRIBE_USER_STATUS:"ws_status_unsubscribe",ADD_FRIEND:"addFriend",CHECK_FRIEND:"checkFriend",DELETE_FRIEND:"removeFromFriendList",GET_FRIEND_PROFILE:"getFriendProfile",GET_FRIEND_LIST:"getFriendList",UPDATE_FRIEND:"updateFriend",GET_FRIEND_APPLICATION_LIST:"getFriendApplicationList",DELETE_FRIEND_APPLICATION:"deleteFriendApplication",ACCEPT_FRIEND_APPLICATION:"acceptFriendApplication",REFUSE_FRIEND_APPLICATION:"refuseFriendApplication",SET_FRIEND_APPLICATION_READ:"setFriendApplicationRead",CREATE_FRIEND_GROUP:"createFriendGroup",DELETE_FRIEND_GROUP:"deleteFriendGroup",RENAME_FRIEND_GROUP:"renameFriendGroup",ADD_TO_FRIEND_GROUP:"addToFriendGroup",REMOVE_FROM_FRIEND_GROUP:"removeFromFriendGroup",GET_FRIEND_GROUP_LIST:"getFriendGroupList",CREATE_TOPIC:"createTopic",DELETE_TOPIC:"deleteTopic",UPDATE_TOPIC_PROFILE:"updateTopicProfile",GET_TOPIC_LIST:"getTopicList",RELAY_GET_TOPIC_LIST:"relayGetTopicList",GET_TOPIC_LAST_SEQUENCE:"getTopicLastSequence",GET_DEVICE_TOKEN:"getDeviceToken",OFFLINE_PUSH_SET_TOKEN:"offlinePushSetToken",MP_HIDE_TO_SHOW:"mpHideToShow",CALLBACK_FUNCTION_ERROR:"callbackFunctionError",FETCH_CLOUD_CONTROL_CONFIG:"fetchCloudControlConfig",PUSHED_CLOUD_CONTROL_CONFIG:"pushedCloudControlConfig",FETCH_COMMERCIAL_CONFIG:"fetchCommercialConfig",PUSHED_COMMERCIAL_CONFIG:"pushedCommercialConfig",ERROR:"error",LAST_MESSAGE_NOT_EXIST:"lastMessageNotExist"},wh=V.f,Fh=W(wh),qh=W([].push),Vh=function(e){return function(t){for(var n,o=te(t),r=On(o),a=r.length,s=0,i=[];a>s;)n=r[s++],P&&!Fh(o,n)||qh(i,e?[n,o[n]]:o[n]);return i}},xh={entries:Vh(!0),values:Vh(!1)}.values;rn({target:"Object",stat:!0},{values:function(e){return xh(e)}});var Bh=function(){function e(t){r(this,e),this.type=hr.MSG_TEXT,this.content={text:t.text||""}}return i(e,[{key:"setText",value:function(e){this.content.text=e}},{key:"sendable",value:function(){return 0!==this.content.text.length}}]),e}(),Kh=qe("iterator"),Hh=!G((function(){var e=new URL("b?a=1&b=2&c=3","http://a"),t=e.searchParams,n="";return e.pathname="c%20d",t.forEach((function(e,o){t.delete("b"),n+=o+e})),!t.sort||"http://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[Kh]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://тест").host||"#%D0%B1"!==new URL("http://a#б").hash||"a1c3"!==n||"x"!==new URL("http://x",void 0).host})),jh=Object.assign,Wh=Object.defineProperty,Yh=W([].concat),zh=!jh||G((function(){if(P&&1!==jh({b:1},jh(Wh({},"a",{enumerable:!0,get:function(){Wh(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=jh({},e)[n]||"abcdefghijklmnopqrst"!=On(jh({},t)).join("")}))?function(e,t){for(var n=Ne(e),o=arguments.length,r=1,a=Wt.f,s=V.f;o>r;)for(var i,u=Z(arguments[r++]),c=a?Yh(On(u),a(u)):On(u),l=c.length,d=0;l>d;)i=c[d++],P&&!w(s,u,i)||(n[i]=u[i]);return n}:jh,Jh=/[^\0-\u007E]/,Xh=/[.\u3002\uFF0E\uFF61]/g,Qh="Overflow: input needs wider integers to process",Zh=k.RangeError,$h=W(Xh.exec),ef=Math.floor,tf=String.fromCharCode,nf=W("".charCodeAt),of=W([].join),rf=W([].push),af=W("".replace),sf=W("".split),uf=W("".toLowerCase),cf=function(e){return e+22+75*(e<26)},lf=function(e,t,n){var o=0;for(e=n?ef(e/700):e>>1,e+=ef(e/t);e>455;)e=ef(e/35),o+=36;return ef(o+36*e/(e+38))},df=function(e){var t,n,o=[],r=(e=function(e){for(var t=[],n=0,o=e.length;n<o;){var r=nf(e,n++);if(r>=55296&&r<=56319&&n<o){var a=nf(e,n++);56320==(64512&a)?rf(t,((1023&r)<<10)+(1023&a)+65536):(rf(t,r),n--)}else rf(t,r)}return t}(e)).length,a=128,s=0,i=72;for(t=0;t<e.length;t++)(n=e[t])<128&&rf(o,tf(n));var u=o.length,c=u;for(u&&rf(o,"-");c<r;){var l=2147483647;for(t=0;t<e.length;t++)(n=e[t])>=a&&n<l&&(l=n);var d=c+1;if(l-a>ef((2147483647-s)/d))throw Zh(Qh);for(s+=(l-a)*d,a=l,t=0;t<e.length;t++){if((n=e[t])<a&&++s>2147483647)throw Zh(Qh);if(n==a){for(var p=s,g=36;;){var _=g<=i?1:g>=i+26?26:g-i;if(p<_)break;var h=p-_,f=36-_;rf(o,tf(cf(_+h%f))),p=ef(h/f),g+=36}rf(o,tf(cf(p))),i=lf(s,d,c==u),s=0,c++}}s++,a++}return of(o,"")},pf=Math.floor,gf=function e(t,n){var o=t.length,r=pf(o/2);return o<8?_f(t,n):hf(t,e(li(t,0,r),n),e(li(t,r),n),n)},_f=function(e,t){for(var n,o,r=e.length,a=1;a<r;){for(o=a,n=e[a];o&&t(e[o-1],n)>0;)e[o]=e[--o];o!==a++&&(e[o]=n)}return e},hf=function(e,t,n,o){for(var r=t.length,a=n.length,s=0,i=0;s<r||i<a;)e[s+i]=s<r&&i<a?o(t[s],n[i])<=0?t[s++]:n[i++]:s<r?t[s++]:n[i++];return e},ff=gf,mf=qe("iterator"),vf=Et.set,Mf=Et.getterFor("URLSearchParams"),yf=Et.getterFor("URLSearchParamsIterator"),If=ae("fetch"),Tf=ae("Request"),Ef=ae("Headers"),Cf=Tf&&Tf.prototype,Sf=Ef&&Ef.prototype,Af=k.RegExp,Df=k.TypeError,Nf=k.decodeURIComponent,Of=k.encodeURIComponent,Rf=W("".charAt),Lf=W([].join),kf=W([].push),Gf=W("".replace),Pf=W([].shift),Uf=W([].splice),bf=W("".split),wf=W("".slice),Ff=/\+/g,qf=Array(4),Vf=function(e){return qf[e-1]||(qf[e-1]=Af("((?:%[\\da-f]{2}){"+e+"})","gi"))},xf=function(e){try{return Nf(e)}catch(kC){return e}},Bf=function(e){var t=Gf(e,Ff," "),n=4;try{return Nf(t)}catch(kC){for(;n;)t=Gf(t,Vf(n--),xf);return t}},Kf=/[!'()~]|%20/g,Hf={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},jf=function(e){return Hf[e]},Wf=function(e){return Gf(Of(e),Kf,jf)},Yf=er((function(e,t){vf(this,{type:"URLSearchParamsIterator",iterator:Co(Mf(e).entries),kind:t})}),"Iterator",(function(){var e=yf(this),t=e.kind,n=e.iterator.next(),o=n.value;return n.done||(n.value="keys"===t?o.key:"values"===t?o.value:[o.key,o.value]),n}),!0),zf=function(e){this.entries=[],this.url=null,void 0!==e&&(oe(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Rf(e,0)?wf(e,1):e:gn(e)))};zf.prototype={type:"URLSearchParams",bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,o,r,a,s,i,u=To(e);if(u)for(n=(t=Co(e,u)).next;!(o=w(n,t)).done;){if(a=(r=Co($e(o.value))).next,(s=w(a,r)).done||(i=w(a,r)).done||!w(a,r).done)throw Df("Expected sequence with length 2");kf(this.entries,{key:gn(s.value),value:gn(i.value)})}else for(var c in e)Re(e,c)&&kf(this.entries,{key:c,value:gn(e[c])})},parseQuery:function(e){if(e)for(var t,n,o=bf(e,"&"),r=0;r<o.length;)(t=o[r++]).length&&(n=bf(t,"="),kf(this.entries,{key:Bf(Pf(n)),value:Bf(Lf(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],o=0;o<t.length;)e=t[o++],kf(n,Wf(e.key)+"="+Wf(e.value));return Lf(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var Jf=function(){Pi(this,Xf);var e=arguments.length>0?arguments[0]:void 0;vf(this,new zf(e))},Xf=Jf.prototype;if(Ri(Xf,{append:function(e,t){Hi(arguments.length,2);var n=Mf(this);kf(n.entries,{key:gn(e),value:gn(t)}),n.updateURL()},delete:function(e){Hi(arguments.length,1);for(var t=Mf(this),n=t.entries,o=gn(e),r=0;r<n.length;)n[r].key===o?Uf(n,r,1):r++;t.updateURL()},get:function(e){Hi(arguments.length,1);for(var t=Mf(this).entries,n=gn(e),o=0;o<t.length;o++)if(t[o].key===n)return t[o].value;return null},getAll:function(e){Hi(arguments.length,1);for(var t=Mf(this).entries,n=gn(e),o=[],r=0;r<t.length;r++)t[r].key===n&&kf(o,t[r].value);return o},has:function(e){Hi(arguments.length,1);for(var t=Mf(this).entries,n=gn(e),o=0;o<t.length;)if(t[o++].key===n)return!0;return!1},set:function(e,t){Hi(arguments.length,1);for(var n,o=Mf(this),r=o.entries,a=!1,s=gn(e),i=gn(t),u=0;u<r.length;u++)(n=r[u]).key===s&&(a?Uf(r,u--,1):(a=!0,n.value=i));a||kf(r,{key:s,value:i}),o.updateURL()},sort:function(){var e=Mf(this);ff(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=Mf(this).entries,o=qn(e,arguments.length>1?arguments[1]:void 0),r=0;r<n.length;)o((t=n[r++]).value,t.key,this)},keys:function(){return new Yf(this,"keys")},values:function(){return new Yf(this,"values")},entries:function(){return new Yf(this,"entries")}},{enumerable:!0}),Nt(Xf,mf,Xf.entries,{name:"entries"}),Nt(Xf,"toString",(function(){return Mf(this).serialize()}),{enumerable:!0}),Qo(Jf,"URLSearchParams"),rn({global:!0,forced:!Hh},{URLSearchParams:Jf}),!Hh&&ne(Ef)){var Qf=W(Sf.has),Zf=W(Sf.set),$f=function(e){if(oe(e)){var t,n=e.body;if("URLSearchParams"===dn(n))return t=e.headers?new Ef(e.headers):new Ef,Qf(t,"content-type")||Zf(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),wn(e,{body:x(0,gn(n)),headers:x(0,t)})}return e};if(ne(If)&&rn({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return If(e,arguments.length>1?$f(arguments[1]):{})}}),ne(Tf)){var em=function(e){return Pi(this,Cf),new Tf(e,arguments.length>1?$f(arguments[1]):{})};Cf.constructor=em,em.prototype=Cf,rn({global:!0,forced:!0},{Request:em})}}var tm,nm={URLSearchParams:Jf,getState:Mf},om=Rn.f,rm=Vo.codeAt,am=Et.set,sm=Et.getterFor("URL"),im=nm.URLSearchParams,um=nm.getState,cm=k.URL,lm=k.TypeError,dm=k.parseInt,pm=Math.floor,gm=Math.pow,_m=W("".charAt),hm=W(/./.exec),fm=W([].join),mm=W(1..toString),vm=W([].pop),Mm=W([].push),ym=W("".replace),Im=W([].shift),Tm=W("".split),Em=W("".slice),Cm=W("".toLowerCase),Sm=W([].unshift),Am=/[a-z]/i,Dm=/[\d+-.a-z]/i,Nm=/\d/,Om=/^0x/i,Rm=/^[0-7]+$/,Lm=/^\d+$/,km=/^[\da-f]+$/i,Gm=/[\0\t\n\r #%/:<>?@[\\\]^|]/,Pm=/[\0\t\n\r #/:<>?@[\\\]^|]/,Um=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,bm=/[\t\n\r]/g,wm=function(e){var t,n,o,r;if("number"==typeof e){for(t=[],n=0;n<4;n++)Sm(t,e%256),e=pm(e/256);return fm(t,".")}if("object"==s(e)){for(t="",o=function(e){for(var t=null,n=1,o=null,r=0,a=0;a<8;a++)0!==e[a]?(r>n&&(t=o,n=r),o=null,r=0):(null===o&&(o=a),++r);return r>n&&(t=o,n=r),t}(e),n=0;n<8;n++)r&&0===e[n]||(r&&(r=!1),o===n?(t+=n?":":"::",r=!0):(t+=mm(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},Fm={},qm=zh({},Fm,{" ":1,'"':1,"<":1,">":1,"`":1}),Vm=zh({},qm,{"#":1,"?":1,"{":1,"}":1}),xm=zh({},Vm,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),Bm=function(e,t){var n=rm(e,0);return n>32&&n<127&&!Re(t,e)?e:encodeURIComponent(e)},Km={ftp:21,file:null,http:80,https:443,ws:80,wss:443},Hm=function(e,t){var n;return 2==e.length&&hm(Am,_m(e,0))&&(":"==(n=_m(e,1))||!t&&"|"==n)},jm=function(e){var t;return e.length>1&&Hm(Em(e,0,2))&&(2==e.length||"/"===(t=_m(e,2))||"\\"===t||"?"===t||"#"===t)},Wm=function(e){return"."===e||"%2e"===Cm(e)},Ym={},zm={},Jm={},Xm={},Qm={},Zm={},$m={},ev={},tv={},nv={},ov={},rv={},av={},sv={},iv={},uv={},cv={},lv={},dv={},pv={},gv={},_v=function e(t,n,o){var r,a,s,i=gn(t);if(n){if(a=this.parse(i))throw lm(a);this.searchParams=null}else{if(void 0!==o&&(r=new e(o,!0)),a=this.parse(i,null,r))throw lm(a);(s=um(new im)).bindURL(this),this.searchParams=s}};_v.prototype={type:"URL",parse:function(e,t,n){var o,r,a,s,i,u=this,c=t||Ym,l=0,d="",p=!1,g=!1,_=!1;for(e=gn(e),t||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,e=ym(e,Um,"")),e=ym(e,bm,""),o=Ao(e);l<=o.length;){switch(r=o[l],c){case Ym:if(!r||!hm(Am,r)){if(t)return"Invalid scheme";c=Jm;continue}d+=Cm(r),c=zm;break;case zm:if(r&&(hm(Dm,r)||"+"==r||"-"==r||"."==r))d+=Cm(r);else{if(":"!=r){if(t)return"Invalid scheme";d="",c=Jm,l=0;continue}if(t&&(u.isSpecial()!=Re(Km,d)||"file"==d&&(u.includesCredentials()||null!==u.port)||"file"==u.scheme&&!u.host))return;if(u.scheme=d,t)return void(u.isSpecial()&&Km[u.scheme]==u.port&&(u.port=null));d="","file"==u.scheme?c=sv:u.isSpecial()&&n&&n.scheme==u.scheme?c=Xm:u.isSpecial()?c=ev:"/"==o[l+1]?(c=Qm,l++):(u.cannotBeABaseURL=!0,Mm(u.path,""),c=dv)}break;case Jm:if(!n||n.cannotBeABaseURL&&"#"!=r)return"Invalid scheme";if(n.cannotBeABaseURL&&"#"==r){u.scheme=n.scheme,u.path=li(n.path),u.query=n.query,u.fragment="",u.cannotBeABaseURL=!0,c=gv;break}c="file"==n.scheme?sv:Zm;continue;case Xm:if("/"!=r||"/"!=o[l+1]){c=Zm;continue}c=tv,l++;break;case Qm:if("/"==r){c=nv;break}c=lv;continue;case Zm:if(u.scheme=n.scheme,r==tm)u.username=n.username,u.password=n.password,u.host=n.host,u.port=n.port,u.path=li(n.path),u.query=n.query;else if("/"==r||"\\"==r&&u.isSpecial())c=$m;else if("?"==r)u.username=n.username,u.password=n.password,u.host=n.host,u.port=n.port,u.path=li(n.path),u.query="",c=pv;else{if("#"!=r){u.username=n.username,u.password=n.password,u.host=n.host,u.port=n.port,u.path=li(n.path),u.path.length--,c=lv;continue}u.username=n.username,u.password=n.password,u.host=n.host,u.port=n.port,u.path=li(n.path),u.query=n.query,u.fragment="",c=gv}break;case $m:if(!u.isSpecial()||"/"!=r&&"\\"!=r){if("/"!=r){u.username=n.username,u.password=n.password,u.host=n.host,u.port=n.port,c=lv;continue}c=nv}else c=tv;break;case ev:if(c=tv,"/"!=r||"/"!=_m(d,l+1))continue;l++;break;case tv:if("/"!=r&&"\\"!=r){c=nv;continue}break;case nv:if("@"==r){p&&(d="%40"+d),p=!0,a=Ao(d);for(var h=0;h<a.length;h++){var f=a[h];if(":"!=f||_){var m=Bm(f,xm);_?u.password+=m:u.username+=m}else _=!0}d=""}else if(r==tm||"/"==r||"?"==r||"#"==r||"\\"==r&&u.isSpecial()){if(p&&""==d)return"Invalid authority";l-=Ao(d).length+1,d="",c=ov}else d+=r;break;case ov:case rv:if(t&&"file"==u.scheme){c=uv;continue}if(":"!=r||g){if(r==tm||"/"==r||"?"==r||"#"==r||"\\"==r&&u.isSpecial()){if(u.isSpecial()&&""==d)return"Invalid host";if(t&&""==d&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(d))return s;if(d="",c=cv,t)return;continue}"["==r?g=!0:"]"==r&&(g=!1),d+=r}else{if(""==d)return"Invalid host";if(s=u.parseHost(d))return s;if(d="",c=av,t==rv)return}break;case av:if(!hm(Nm,r)){if(r==tm||"/"==r||"?"==r||"#"==r||"\\"==r&&u.isSpecial()||t){if(""!=d){var v=dm(d,10);if(v>65535)return"Invalid port";u.port=u.isSpecial()&&v===Km[u.scheme]?null:v,d=""}if(t)return;c=cv;continue}return"Invalid port"}d+=r;break;case sv:if(u.scheme="file","/"==r||"\\"==r)c=iv;else{if(!n||"file"!=n.scheme){c=lv;continue}if(r==tm)u.host=n.host,u.path=li(n.path),u.query=n.query;else if("?"==r)u.host=n.host,u.path=li(n.path),u.query="",c=pv;else{if("#"!=r){jm(fm(li(o,l),""))||(u.host=n.host,u.path=li(n.path),u.shortenPath()),c=lv;continue}u.host=n.host,u.path=li(n.path),u.query=n.query,u.fragment="",c=gv}}break;case iv:if("/"==r||"\\"==r){c=uv;break}n&&"file"==n.scheme&&!jm(fm(li(o,l),""))&&(Hm(n.path[0],!0)?Mm(u.path,n.path[0]):u.host=n.host),c=lv;continue;case uv:if(r==tm||"/"==r||"\\"==r||"?"==r||"#"==r){if(!t&&Hm(d))c=lv;else if(""==d){if(u.host="",t)return;c=cv}else{if(s=u.parseHost(d))return s;if("localhost"==u.host&&(u.host=""),t)return;d="",c=cv}continue}d+=r;break;case cv:if(u.isSpecial()){if(c=lv,"/"!=r&&"\\"!=r)continue}else if(t||"?"!=r)if(t||"#"!=r){if(r!=tm&&(c=lv,"/"!=r))continue}else u.fragment="",c=gv;else u.query="",c=pv;break;case lv:if(r==tm||"/"==r||"\\"==r&&u.isSpecial()||!t&&("?"==r||"#"==r)){if(".."===(i=Cm(i=d))||"%2e."===i||".%2e"===i||"%2e%2e"===i?(u.shortenPath(),"/"==r||"\\"==r&&u.isSpecial()||Mm(u.path,"")):Wm(d)?"/"==r||"\\"==r&&u.isSpecial()||Mm(u.path,""):("file"==u.scheme&&!u.path.length&&Hm(d)&&(u.host&&(u.host=""),d=_m(d,0)+":"),Mm(u.path,d)),d="","file"==u.scheme&&(r==tm||"?"==r||"#"==r))for(;u.path.length>1&&""===u.path[0];)Im(u.path);"?"==r?(u.query="",c=pv):"#"==r&&(u.fragment="",c=gv)}else d+=Bm(r,Vm);break;case dv:"?"==r?(u.query="",c=pv):"#"==r?(u.fragment="",c=gv):r!=tm&&(u.path[0]+=Bm(r,Fm));break;case pv:t||"#"!=r?r!=tm&&("'"==r&&u.isSpecial()?u.query+="%27":u.query+="#"==r?"%23":Bm(r,Fm)):(u.fragment="",c=gv);break;case gv:r!=tm&&(u.fragment+=Bm(r,qm))}l++}},parseHost:function(e){var t,n,o;if("["==_m(e,0)){if("]"!=_m(e,e.length-1))return"Invalid host";if(!(t=function(e){var t,n,o,r,a,s,i,u=[0,0,0,0,0,0,0,0],c=0,l=null,d=0,p=function(){return _m(e,d)};if(":"==p()){if(":"!=_m(e,1))return;d+=2,l=++c}for(;p();){if(8==c)return;if(":"!=p()){for(t=n=0;n<4&&hm(km,p());)t=16*t+dm(p(),16),d++,n++;if("."==p()){if(0==n)return;if(d-=n,c>6)return;for(o=0;p();){if(r=null,o>0){if(!("."==p()&&o<4))return;d++}if(!hm(Nm,p()))return;for(;hm(Nm,p());){if(a=dm(p(),10),null===r)r=a;else{if(0==r)return;r=10*r+a}if(r>255)return;d++}u[c]=256*u[c]+r,2!=++o&&4!=o||c++}if(4!=o)return;break}if(":"==p()){if(d++,!p())return}else if(p())return;u[c++]=t}else{if(null!==l)return;d++,l=++c}}if(null!==l)for(s=c-l,c=7;0!=c&&s>0;)i=u[c],u[c--]=u[l+s-1],u[l+--s]=i;else if(8!=c)return;return u}(Em(e,1,-1))))return"Invalid host";this.host=t}else if(this.isSpecial()){if(e=function(e){var t,n,o=[],r=sf(af(uf(e),Xh,"."),".");for(t=0;t<r.length;t++)n=r[t],rf(o,$h(Jh,n)?"xn--"+df(n):n);return of(o,".")}(e),hm(Gm,e))return"Invalid host";if(null===(t=function(e){var t,n,o,r,a,s,i,u=Tm(e,".");if(u.length&&""==u[u.length-1]&&u.length--,(t=u.length)>4)return e;for(n=[],o=0;o<t;o++){if(""==(r=u[o]))return e;if(a=10,r.length>1&&"0"==_m(r,0)&&(a=hm(Om,r)?16:8,r=Em(r,8==a?1:2)),""===r)s=0;else{if(!hm(10==a?Lm:8==a?Rm:km,r))return e;s=dm(r,a)}Mm(n,s)}for(o=0;o<t;o++)if(s=n[o],o==t-1){if(s>=gm(256,5-t))return null}else if(s>255)return null;for(i=vm(n),o=0;o<n.length;o++)i+=n[o]*gm(256,3-o);return i}(e)))return"Invalid host";this.host=t}else{if(hm(Pm,e))return"Invalid host";for(t="",n=Ao(e),o=0;o<n.length;o++)t+=Bm(n[o],Fm);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return Re(Km,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&Hm(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,o=e.password,r=e.host,a=e.port,s=e.path,i=e.query,u=e.fragment,c=t+":";return null!==r?(c+="//",e.includesCredentials()&&(c+=n+(o?":"+o:"")+"@"),c+=wm(r),null!==a&&(c+=":"+a)):"file"==t&&(c+="//"),c+=e.cannotBeABaseURL?s[0]:s.length?"/"+fm(s,"/"):"",null!==i&&(c+="?"+i),null!==u&&(c+="#"+u),c},setHref:function(e){var t=this.parse(e);if(t)throw lm(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new hv(e.path[0]).origin}catch(kC){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+wm(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(gn(e)+":",Ym)},getUsername:function(){return this.username},setUsername:function(e){var t=Ao(gn(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=Bm(t[n],xm)}},getPassword:function(){return this.password},setPassword:function(e){var t=Ao(gn(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=Bm(t[n],xm)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?wm(e):wm(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,ov)},getHostname:function(){var e=this.host;return null===e?"":wm(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,rv)},getPort:function(){var e=this.port;return null===e?"":gn(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=gn(e))?this.port=null:this.parse(e,av))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+fm(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,cv))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=gn(e))?this.query=null:("?"==_m(e,0)&&(e=Em(e,1)),this.query="",this.parse(e,pv)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=gn(e))?("#"==_m(e,0)&&(e=Em(e,1)),this.fragment="",this.parse(e,gv)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var hv=function(e){var t=Pi(this,fv),n=Hi(arguments.length,1)>1?arguments[1]:void 0,o=am(t,new _v(e,!1,n));P||(t.href=o.serialize(),t.origin=o.getOrigin(),t.protocol=o.getProtocol(),t.username=o.getUsername(),t.password=o.getPassword(),t.host=o.getHost(),t.hostname=o.getHostname(),t.port=o.getPort(),t.pathname=o.getPathname(),t.search=o.getSearch(),t.searchParams=o.getSearchParams(),t.hash=o.getHash())},fv=hv.prototype,mv=function(e,t){return{get:function(){return sm(this)[e]()},set:t&&function(e){return sm(this)[t](e)},configurable:!0,enumerable:!0}};if(P&&om(fv,{href:mv("serialize","setHref"),origin:mv("getOrigin"),protocol:mv("getProtocol","setProtocol"),username:mv("getUsername","setUsername"),password:mv("getPassword","setPassword"),host:mv("getHost","setHost"),hostname:mv("getHostname","setHostname"),port:mv("getPort","setPort"),pathname:mv("getPathname","setPathname"),search:mv("getSearch","setSearch"),searchParams:mv("getSearchParams"),hash:mv("getHash","setHash")}),Nt(fv,"toJSON",(function(){return sm(this).serialize()}),{enumerable:!0}),Nt(fv,"toString",(function(){return sm(this).serialize()}),{enumerable:!0}),cm){var vv=cm.createObjectURL,Mv=cm.revokeObjectURL;vv&&Nt(hv,"createObjectURL",qn(vv,cm)),Mv&&Nt(hv,"revokeObjectURL",qn(Mv,cm))}Qo(hv,"URL"),rn({global:!0,forced:!Hh,sham:!P},{URL:hv}),rn({target:"Object",stat:!0,forced:Object.assign!==zh},{assign:zh});var yv=function(){function e(t){r(this,e),this._imageMemoryURL="",Wc?this.createImageDataASURLInWXMiniApp(t.file):this.createImageDataASURLInWeb(t.file),this._initImageInfoModel(),this.type=hr.MSG_IMAGE,this._percent=0,this.content={imageFormat:t.imageFormat||Fl.UNKNOWN,uuid:t.uuid,imageInfoArray:[]},this.initImageInfoArray(t.imageInfoArray),this._defaultImage="http://imgcache.qq.com/open/qcloud/video/act/webim-images/default.jpg",this._autoFixUrl()}return i(e,[{key:"_initImageInfoModel",value:function(){var e=this;this._ImageInfoModel=function(t){this.instanceID=dd(9999999),this.sizeType=t.type||0,this.type=0,this.size=t.size||0,this.width=t.width||0,this.height=t.height||0,this.imageUrl=t.url||"",this.url=t.url||e._imageMemoryURL||e._defaultImage},this._ImageInfoModel.prototype={setSizeType:function(e){this.sizeType=e},setType:function(e){this.type=e},setImageUrl:function(e){e&&(this.imageUrl=e)},getImageUrl:function(){return this.imageUrl}}}},{key:"initImageInfoArray",value:function(e){for(var t=0,n=null,o=null;t<=2;)o=ed(e)||ed(e[t])?{type:0,size:0,width:0,height:0,url:""}:e[t],(n=new this._ImageInfoModel(o)).setSizeType(t+1),n.setType(t),this.addImageInfo(n),t++;this.updateAccessSideImageInfoArray()}},{key:"updateImageInfoArray",value:function(e){for(var t,n=this.content.imageInfoArray.length,o=0;o<n;o++)t=this.content.imageInfoArray[o],e[o].size&&(t.size=e[o].size),e[o].url&&t.setImageUrl(e[o].url),e[o].width&&(t.width=e[o].width),e[o].height&&(t.height=e[o].height)}},{key:"_autoFixUrl",value:function(){for(var e=this.content.imageInfoArray.length,t="",n="",o=["http","https"],r=null,a=0;a<e;a++)this.content.imageInfoArray[a].url&&""!==(r=this.content.imageInfoArray[a]).imageUrl&&(n=r.imageUrl.slice(0,r.imageUrl.indexOf("://")+1),t=r.imageUrl.slice(r.imageUrl.indexOf("://")+1),o.indexOf(n)<0&&(n="https:"),this.content.imageInfoArray[a].setImageUrl([n,t].join("")))}},{key:"updatePercent",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:"updateImageFormat",value:function(e){this.content.imageFormat=Fl[e.toUpperCase()]||Fl.UNKNOWN}},{key:"createImageDataASURLInWeb",value:function(e){void 0!==e&&e.files.length>0&&(this._imageMemoryURL=window.URL.createObjectURL(e.files[0]))}},{key:"createImageDataASURLInWXMiniApp",value:function(e){e&&e.url&&(this._imageMemoryURL=e.url)}},{key:"replaceImageInfo",value:function(e,t){this.content.imageInfoArray[t]instanceof this._ImageInfoModel||(this.content.imageInfoArray[t]=e)}},{key:"addImageInfo",value:function(e){this.content.imageInfoArray.length>=3||this.content.imageInfoArray.push(e)}},{key:"updateAccessSideImageInfoArray",value:function(){var e=this.content.imageInfoArray,t=e[0],n=t.width,o=void 0===n?0:n,r=t.height,a=void 0===r?0:r;0!==o&&0!==a&&(kd(e),Object.assign(e[2],Ld({originWidth:o,originHeight:a,min:720})))}},{key:"sendable",value:function(){return 0!==this.content.imageInfoArray.length&&""!==this.content.imageInfoArray[0].imageUrl&&0!==this.content.imageInfoArray[0].size}}]),e}(),Iv=function(){function e(t){r(this,e),this.type=hr.MSG_FACE,this.content=t||null}return i(e,[{key:"sendable",value:function(){return null!==this.content}}]),e}(),Tv=function(){function e(t){r(this,e),this.type=hr.MSG_AUDIO,this._percent=0,this.content={downloadFlag:2,second:t.second,size:t.size,url:t.url,remoteAudioUrl:t.url||"",uuid:t.uuid}}return i(e,[{key:"updatePercent",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:"updateAudioUrl",value:function(e){this.content.remoteAudioUrl=e}},{key:"sendable",value:function(){return""!==this.content.remoteAudioUrl}}]),e}(),Ev={from:!0,groupID:!0,groupName:!0,to:!0},Cv=function(){function e(t){r(this,e),this.type=hr.MSG_GRP_TIP,this.content={},this._initContent(t)}return i(e,[{key:"_initContent",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"remarkInfo":break;case"groupProfile":t.content.groupProfile={},t._initGroupProfile(e[n]);break;case"operatorInfo":break;case"memberInfoList":case"msgMemberInfo":t._updateMemberList(e[n]);break;case"memberExtraInfo":case"onlineMemberInfo":break;case"memberNum":t.content[n]=e[n],t.content.memberCount=e[n];break;case"newGroupProfile":t.content.newGroupProfile={},t._initNewGroupProfile(e[n]);break;default:t.content[n]=e[n]}})),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}},{key:"_initGroupProfile",value:function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var o=t[n];Ev[o]&&(this.content.groupProfile[o]=e[o])}}},{key:"_updateMemberList",value:function(e){Bd(this.content.memberList)?this.content.memberList=e:this.content.memberList.forEach((function(t){e.forEach((function(e){t.userID===e.userID&&Object.assign(t,e)}))}))}},{key:"_initNewGroupProfile",value:function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var o=t[n];this.content.newGroupProfile[o]="muteAllMembers"!==o?e[o]:1===e[o]}}}]),e}(),Sv={from:!0,groupID:!0,groupName:!0,to:!0},Av=function(){function e(t){r(this,e),this.type=hr.MSG_GRP_SYS_NOTICE,this.content={},this._initContent(t)}return i(e,[{key:"_initContent",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"memberInfoList":break;case"remarkInfo":t.content.handleMessage=e[n];break;case"groupProfile":t.content.groupProfile={},t._initGroupProfile(e[n]);break;default:t.content[n]=e[n]}}))}},{key:"_initGroupProfile",value:function(e){for(var t=Object.keys(e),n=0;n<t.length;n++){var o=t[n];Sv[o]&&("groupName"===o?this.content.groupProfile.name=e[o]:this.content.groupProfile[o]=e[o])}}}]),e}(),Dv=Math.min,Nv=[].lastIndexOf,Ov=!!Nv&&1/[1].lastIndexOf(1,-0)<0,Rv=no("lastIndexOf"),Lv=Ov||!Rv?function(e){if(Ov)return Cs(Nv,this,arguments)||0;var t=te(this),n=wt(t),o=n-1;for(arguments.length>1&&(o=Dv(o,Lt(arguments[1]))),o<0&&(o=n+o);o>=0;o--)if(o in t&&t[o]===e)return o||0;return-1}:Nv;rn({target:"Array",proto:!0,forced:Lv!==[].lastIndexOf},{lastIndexOf:Lv});var kv=function(){function e(t){r(this,e),this.type=hr.MSG_FILE,this._percent=0;var n=this._getFileInfo(t);this.content={downloadFlag:2,fileUrl:t.url||"",uuid:t.uuid,fileName:n.name||"",fileSize:n.size||0}}return i(e,[{key:"_getFileInfo",value:function(e){if(!ed(e.fileName)&&!ed(e.fileSize))return{size:e.fileSize,name:e.fileName};var t=e.file.files[0];if(Hc){if(t.path&&-1!==t.path.indexOf(".")){var n=t.path.slice(t.path.lastIndexOf(".")+1).toLowerCase();t.type=n,t.name||(t.name="".concat(dd(999999),".").concat(n))}t.name||(t.type="",t.name=t.path.slice(t.path.lastIndexOf("/")+1).toLowerCase()),t.suffix&&(t.type=t.suffix),t.url||(t.url=t.path)}return{size:t.size,name:t.name}}},{key:"updatePercent",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:"updateFileUrl",value:function(e){this.content.fileUrl=e}},{key:"sendable",value:function(){return""!==this.content.fileUrl&&""!==this.content.fileName&&0!==this.content.fileSize}}]),e}(),Gv=function(){function e(t){r(this,e),this.type=hr.MSG_CUSTOM,this.content={data:t.data||"",description:t.description||"",extension:t.extension||""}}return i(e,[{key:"setData",value:function(e){return this.content.data=e,this}},{key:"setDescription",value:function(e){return this.content.description=e,this}},{key:"setExtension",value:function(e){return this.content.extension=e,this}},{key:"sendable",value:function(){return 0!==this.content.data.length||0!==this.content.description.length||0!==this.content.extension.length}}]),e}(),Pv=function(){function e(t){r(this,e),this.type=hr.MSG_VIDEO,this._percent=0,this.content={remoteVideoUrl:t.remoteVideoUrl||t.videoUrl||"",videoFormat:t.videoFormat,videoSecond:parseInt(t.videoSecond,10),videoSize:t.videoSize,videoUrl:t.videoUrl,videoDownloadFlag:2,videoUUID:t.videoUUID,thumbUUID:t.thumbUUID,thumbFormat:t.thumbFormat,thumbWidth:t.thumbWidth,snapshotWidth:t.thumbWidth,thumbHeight:t.thumbHeight,snapshotHeight:t.thumbHeight,thumbSize:t.thumbSize,snapshotSize:t.thumbSize,thumbDownloadFlag:2,thumbUrl:t.thumbUrl,snapshotUrl:t.thumbUrl}}return i(e,[{key:"updatePercent",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:"updateVideoUrl",value:function(e){e&&(this.content.remoteVideoUrl=e)}},{key:"updateSnapshotInfo",value:function(e){var t=e.snapshotUrl,n=e.snapshotWidth,o=e.snapshotHeight;Bd(t)||(this.content.thumbUrl=this.content.snapshotUrl=t),Bd(n)||(this.content.thumbWidth=this.content.snapshotWidth=Number(n)),Bd(o)||(this.content.thumbHeight=this.content.snapshotHeight=Number(o))}},{key:"sendable",value:function(){return""!==this.content.remoteVideoUrl}}]),e}(),Uv=function(){function e(t){r(this,e),this.type=hr.MSG_LOCATION;var n=t.description,o=t.longitude,a=t.latitude;this.content={description:n,longitude:o,latitude:a}}return i(e,[{key:"sendable",value:function(){return!0}}]),e}(),bv=function(){function e(t){if(r(this,e),this.from=t.from,this.messageSender=t.from,this.time=t.time,this.messageSequence=t.sequence,this.clientSequence=t.clientSequence||t.sequence,this.messageRandom=t.random,this.cloudCustomData=t.cloudCustomData||"",this.clientTime=t.clientTime||void 0,t.ID)this.ID=t.ID||"",this.nick=t.nick||"",this.avatar=t.avatar||"",this.messageBody=[{type:t.type,payload:t.payload}],t.conversationType.startsWith(hr.CONV_C2C)?this.receiverUserID=t.to:t.conversationType.startsWith(hr.CONV_GROUP)&&(this.receiverGroupID=t.to),this.messageReceiver=t.to;else{this.nick=t.nick||"",this.avatar=t.avatar||"",this.messageBody=[];var n=t.elements[0].type,o=t.elements[0].content;this._patchRichMediaPayload(n,o),n===hr.MSG_MERGER?this.messageBody.push({type:n,payload:new wv(o).content}):this.messageBody.push({type:n,payload:o}),t.groupID&&(this.receiverGroupID=t.groupID,this.messageReceiver=t.groupID),t.to&&(this.receiverUserID=t.to,this.messageReceiver=t.to),this.ID="".concat(t.tinyID,"-").concat(t.clientTime,"-").concat(t.random)}}return i(e,[{key:"_patchRichMediaPayload",value:function(e,t){e===hr.MSG_IMAGE?t.imageInfoArray.forEach((function(e){!e.imageUrl&&e.url&&(e.imageUrl=e.url,e.sizeType=e.type,1===e.type?e.type=0:3===e.type&&(e.type=1))})):e===hr.MSG_VIDEO?!t.remoteVideoUrl&&t.videoUrl&&(t.remoteVideoUrl=t.videoUrl):e===hr.MSG_AUDIO?!t.remoteAudioUrl&&t.url&&(t.remoteAudioUrl=t.url):e===hr.MSG_FILE&&!t.fileUrl&&t.url&&(t.fileUrl=t.url,t.url=void 0)}}]),e}(),wv=function(){function e(t){if(r(this,e),this.type=hr.MSG_MERGER,this.content={downloadKey:"",pbDownloadKey:"",messageList:[],title:"",abstractList:[],compatibleText:"",version:0,layersOverLimit:!1},t.downloadKey){var n=t.downloadKey,o=t.pbDownloadKey,a=t.title,s=t.abstractList,i=t.compatibleText,u=t.version;this.content.downloadKey=n,this.content.pbDownloadKey=o,this.content.title=a,this.content.abstractList=s,this.content.compatibleText=i,this.content.version=u||0}else if(Bd(t.messageList))1===t.layersOverLimit&&(this.content.layersOverLimit=!0);else{var c=t.messageList,l=t.title,d=t.abstractList,p=t.compatibleText,g=t.version,_=[];c.forEach((function(e){if(!Bd(e)){var t=new bv(e);_.push(t)}})),this.content.messageList=_,this.content.title=l,this.content.abstractList=d,this.content.compatibleText=p,this.content.version=g||0}wl.debug("MergerElement.content:",this.content)}return i(e,[{key:"sendable",value:function(){return!Bd(this.content.messageList)||!Bd(this.content.downloadKey)}}]),e}(),Fv={1:hr.MSG_PRIORITY_HIGH,2:hr.MSG_PRIORITY_NORMAL,3:hr.MSG_PRIORITY_LOW,4:hr.MSG_PRIORITY_LOWEST},qv=function(){function e(t){r(this,e),this.ID="",this.conversationID=t.conversationID||null,this.conversationType=t.conversationType||hr.CONV_C2C,this.conversationSubType=t.conversationSubType,this.time=t.time||Math.ceil(Date.now()/1e3),this.sequence=t.sequence||0,this.clientSequence=t.clientSequence||t.sequence||0,this.random=t.random||0===t.random?t.random:dd(),this.priority=this._computePriority(t.priority),this.nick=t.nick||"",this.avatar=t.avatar||"",this.isPeerRead=1===t.isPeerRead||!1,this.nameCard="",this._elements=[],this.isPlaceMessage=t.isPlaceMessage||0,this.isRevoked=2===t.isPlaceMessage||8===t.msgFlagBits,this.from=t.from||null,this.to=t.to||null,this.flow="",this.isSystemMessage=t.isSystemMessage||!1,this.protocol=t.protocol||"JSON",this.isResend=!1,this.isRead=!1,this.status=t.status||wp.SUCCESS,this._onlineOnlyFlag=!1,this._groupAtInfoList=[],this._relayFlag=!1,this.atUserList=[],this.cloudCustomData=t.cloudCustomData||"",this.isDeleted=!1,this.isModified=!1,this._isExcludedFromUnreadCount=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromUnreadCount),this._isExcludedFromLastMessage=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromLastMessage),this.clientTime=t.clientTime||Gl()||0,this.senderTinyID=t.senderTinyID||t.tinyID||"",this.readReceiptInfo=t.readReceiptInfo||{readCount:void 0,unreadCount:void 0},this.needReadReceipt=!0===t.needReadReceipt||1===t.needReadReceipt,this.version=t.messageVersion||0,this.isBroadcastMessage=t.isBroadcastMessage||!1,this.reInitialize(t.currentUser),this.extractGroupInfo(t.groupProfile||null),this.handleGroupAtInfo(t)}return i(e,[{key:"elements",get:function(){return wl.warn("Message 实例的 elements 属性即将废弃,请尽快修改。使用 type 和 payload 属性处理单条消息,兼容组合消息使用 _elements 属性!!!"),this._elements}},{key:"getElements",value:function(){return this._elements}},{key:"extractGroupInfo",value:function(e){if(null!==e){Xl(e.nick)&&(this.nick=e.nick),Xl(e.avatar)&&(this.avatar=e.avatar);var t=e.messageFromAccountExtraInformation;Zl(t)&&Xl(t.nameCard)&&(this.nameCard=t.nameCard)}}},{key:"handleGroupAtInfo",value:function(e){var t=this;e.payload&&e.payload.atUserList&&e.payload.atUserList.forEach((function(e){e!==hr.MSG_AT_ALL?(t._groupAtInfoList.push({groupAtAllFlag:0,groupAtUserID:e}),t.atUserList.push(e)):(t._groupAtInfoList.push({groupAtAllFlag:1}),t.atUserList.push(hr.MSG_AT_ALL))})),$l(e.groupAtInfo)&&e.groupAtInfo.forEach((function(e){0===e.groupAtAllFlag?t.atUserList.push(e.groupAtUserID):1===e.groupAtAllFlag&&t.atUserList.push(hr.MSG_AT_ALL)}))}},{key:"getGroupAtInfoList",value:function(){return this._groupAtInfoList}},{key:"_initProxy",value:function(){this._elements[0]&&(this.payload=this._elements[0].content,this.type=this._elements[0].type)}},{key:"reInitialize",value:function(e){e&&(this.status=this.from?wp.SUCCESS:wp.UNSEND,!this.from&&(this.from=e)),this._initFlow(e),this._initSequence(e),this._concatConversationID(e),this.generateMessageID()}},{key:"isSendable",value:function(){return 0!==this._elements.length&&("function"!=typeof this._elements[0].sendable?(wl.warn("".concat(this._elements[0].type,' need "boolean : sendable()" method')),!1):this._elements[0].sendable())}},{key:"_initTo",value:function(e){this.conversationType===hr.CONV_GROUP&&(this.to=e.groupID)}},{key:"_initSequence",value:function(e){0===this.clientSequence&&e&&(this.clientSequence=function(e){if(!e)return wl.error("autoIncrementIndex(string: key) need key parameter"),!1;if(void 0===hd[e]){var t=new Date,n="3".concat(t.getHours()).slice(-2),o="0".concat(t.getMinutes()).slice(-2),r="0".concat(t.getSeconds()).slice(-2);hd[e]=parseInt([n,o,r,"0001"].join("")),n=null,o=null,r=null,wl.log("autoIncrementIndex start index:".concat(hd[e]))}return hd[e]++}(e)),0===this.sequence&&this.conversationType===hr.CONV_C2C&&(this.sequence=this.clientSequence)}},{key:"generateMessageID",value:function(){this.from===hr.CONV_SYSTEM&&(this.senderTinyID="144115198244471703"),this.ID="".concat(this.senderTinyID,"-").concat(this.clientTime,"-").concat(this.random)}},{key:"_initFlow",value:function(e){""!==e&&(e===this.from?(this.flow="out",this.isRead=!0):this.flow="in")}},{key:"_concatConversationID",value:function(e){var t=this.to,n="",o=this.conversationType;o!==hr.CONV_SYSTEM?(n=o===hr.CONV_C2C?e===this.from?t:this.from:this.to,this.conversationID="".concat(o).concat(n)):this.conversationID=hr.CONV_SYSTEM}},{key:"isElement",value:function(e){return e instanceof Bh||e instanceof yv||e instanceof Iv||e instanceof Tv||e instanceof kv||e instanceof Pv||e instanceof Cv||e instanceof Av||e instanceof Gv||e instanceof Uv||e instanceof wv}},{key:"setElement",value:function(e){var t=this;if(this.isElement(e))return this._elements=[e],void this._initProxy();var n=function(e){if(e.type&&e.content)switch(e.type){case hr.MSG_TEXT:t.setTextElement(e.content);break;case hr.MSG_IMAGE:t.setImageElement(e.content);break;case hr.MSG_AUDIO:t.setAudioElement(e.content);break;case hr.MSG_FILE:t.setFileElement(e.content);break;case hr.MSG_VIDEO:t.setVideoElement(e.content);break;case hr.MSG_CUSTOM:t.setCustomElement(e.content);break;case hr.MSG_LOCATION:t.setLocationElement(e.content);break;case hr.MSG_GRP_TIP:t.setGroupTipElement(e.content);break;case hr.MSG_GRP_SYS_NOTICE:t.setGroupSystemNoticeElement(e.content);break;case hr.MSG_FACE:t.setFaceElement(e.content);break;case hr.MSG_MERGER:t.setMergerElement(e.content);break;default:wl.warn(e.type,e.content,"no operation......")}};if($l(e))for(var o=0;o<e.length;o++)n(e[o]);else n(e);this._initProxy()}},{key:"clearElement",value:function(){this._elements.length=0}},{key:"setTextElement",value:function(e){var t="string"==typeof e?e:e.text,n=new Bh({text:t});this._elements.push(n)}},{key:"setImageElement",value:function(e){var t=new yv(e);this._elements.push(t)}},{key:"setAudioElement",value:function(e){var t=new Tv(e);this._elements.push(t)}},{key:"setFileElement",value:function(e){var t=new kv(e);this._elements.push(t)}},{key:"setVideoElement",value:function(e){var t=new Pv(e);this._elements.push(t)}},{key:"setLocationElement",value:function(e){var t=new Uv(e);this._elements.push(t)}},{key:"setCustomElement",value:function(e){var t=new Gv(e);this._elements.push(t)}},{key:"setGroupTipElement",value:function(e){var t={},n=e.operationType;if(Bd(e.memberInfoList)?e.operatorInfo&&(t=e.operatorInfo):n!==hr.GRP_TIP_MBR_JOIN&&n!==hr.GRP_TIP_MBR_KICKED_OUT&&n!==hr.GRP_TIP_MBR_SET_ADMIN&&n!==hr.GRP_TIP_MBR_CANCELED_ADMIN||(t=e.memberInfoList[0]),!Bd(e.memberExtraInfo)){var o=e.memberExtraInfo.reason;e.msgMemberInfo.forEach((function(e){e.reason=o}))}var r=t,a=r.nick,s=r.avatar;Xl(a)&&(this.nick=a),Xl(s)&&(this.avatar=s);var i=new Cv(e);this._elements.push(i)}},{key:"setGroupSystemNoticeElement",value:function(e){var t=new Av(e);this._elements.push(t)}},{key:"setFaceElement",value:function(e){var t=new Iv(e);this._elements.push(t)}},{key:"setMergerElement",value:function(e){var t=new wv(e);this._elements.push(t)}},{key:"setIsRead",value:function(e){this.isRead=e}},{key:"setRelayFlag",value:function(e){this._relayFlag=e}},{key:"getRelayFlag",value:function(){return this._relayFlag}},{key:"_computePriority",value:function(e){if(ed(e))return hr.MSG_PRIORITY_NORMAL;if(Xl(e)&&-1!==Object.values(Fv).indexOf(e))return e;if(Jl(e)){var t=""+e;if(-1!==Object.keys(Fv).indexOf(t))return Fv[t]}return hr.MSG_PRIORITY_NORMAL}},{key:"setNickAndAvatar",value:function(e){var t=e.nick,n=e.avatar;Xl(t)&&(this.nick=t),Xl(n)&&(this.avatar=n)}},{key:"setNameCard",value:function(e){Xl(e)&&(this.nameCard=e)}}]),e}(),Vv=function(e){return{code:0,data:e||{}}},xv="https://cloud.tencent.com/document/product/",Bv="您可以在即时通信 IM 控制台的【开发辅助工具(https://console.cloud.tencent.com/im-detail/tool-usersig)】 页面校验 UserSig。",Kv="UserSig 非法,请使用官网提供的 API 重新生成 UserSig(".concat(xv,"269/32688)。"),Hv="#.E6.B6.88.E6.81.AF.E5.85.83.E7.B4.A0-timmsgelement",jv={70001:"UserSig 已过期,请重新生成。建议 UserSig 有效期设置不小于24小时。",70002:"UserSig 长度为0请检查传入的 UserSig 是否正确。",70003:Kv,70005:Kv,70009:"UserSig 验证失败,可能因为生成 UserSig 时混用了其他 SDKAppID 的私钥或密钥导致,请使用对应 SDKAppID 下的私钥或密钥重新生成 UserSig(".concat(xv,"269/32688)。"),70013:"请求中的 UserID 与生成 UserSig 时使用的 UserID 不匹配。".concat(Bv),70014:"请求中的 SDKAppID 与生成 UserSig 时使用的 SDKAppID 不匹配。".concat(Bv),70016:"密钥不存在UserSig 验证失败,请在即时通信 IM 控制台获取密钥(".concat(xv,"269/32578#.E8.8E.B7.E5.8F.96.E5.AF.86.E9.92.A5)。"),70020:"SDKAppID 未找到,请在即时通信 IM 控制台确认应用信息。",70050:"UserSig 验证次数过于频繁。请检查 UserSig 是否正确并于1分钟后重新验证。".concat(Bv),70051:"帐号被拉入黑名单。",70052:"UserSig 已经失效,请重新生成,再次尝试。",70107:"因安全原因被限制登录,请不要频繁登录。",70169:"请求的用户帐号不存在。",70114:"".concat("服务端内部超时,请稍后重试。"),70202:"".concat("服务端内部超时,请稍后重试。"),70206:"请求中批量数量不合法。",70402:"参数非法,请检查必填字段是否填充,或者字段的填充是否满足协议要求。",70403:"请求失败,需要 App 管理员权限。",70398:"帐号数超限。如需创建多于100个帐号请将应用升级为专业版具体操作指引请参见购买指引(".concat(xv,"269/32458)。"),70500:"".concat("服务端内部错误,请重试。"),71e3:"删除帐号失败。仅支持删除体验版帐号,您当前应用为专业版,暂不支持帐号删除。",20001:"请求包非法。",20002:"UserSig 或 A2 失效。",20003:"消息发送方或接收方 UserID 无效或不存在,请检查 UserID 是否已导入即时通信 IM。",20004:"网络异常,请重试。",20005:"".concat("服务端内部错误,请重试。"),20006:"触发发送".concat("单聊消息","之前回调App 后台返回禁止下发该消息。"),20007:"发送".concat("单聊消息",",被对方拉黑,禁止发送。消息发送状态默认展示为失败,您可以登录控制台修改该场景下的消息发送状态展示结果,具体操作请参见消息保留设置(").concat(xv,"269/38656)。"),20009:"消息发送双方互相不是好友,禁止发送(配置".concat("单聊消息","校验好友关系才会出现)。"),20010:"发送".concat("单聊消息",",自己不是对方的好友(单向关系),禁止发送。"),20011:"发送".concat("单聊消息",",对方不是自己的好友(单向关系),禁止发送。"),20012:"发送方被禁言,该条消息被禁止发送。",20016:"消息撤回超过了时间限制默认2分钟。",20018:"删除漫游内部错误。",90001:"JSON 格式解析失败,请检查请求包是否符合 JSON 规范。",90002:"".concat("JSON 格式请求包体","中 MsgBody 不符合消息格式描述,或者 MsgBody 不是 Array 类型,请参考 TIMMsgElement 对象的定义(").concat(xv,"269/2720").concat(Hv,")。"),90003:"".concat("JSON 格式请求包体","中缺少 To_Account 字段或者 To_Account 帐号不存在。"),90005:"".concat("JSON 格式请求包体","中缺少 MsgRandom 字段或者 MsgRandom 字段不是 Integer 类型。"),90006:"".concat("JSON 格式请求包体","中缺少 MsgTimeStamp 字段或者 MsgTimeStamp 字段不是 Integer 类型。"),90007:"".concat("JSON 格式请求包体","中 MsgBody 类型不是 Array 类型,请将其修改为 Array 类型。"),90008:"".concat("JSON 格式请求包体","中缺少 From_Account 字段或者 From_Account 帐号不存在。"),90009:"请求需要 App 管理员权限。",90010:"".concat("JSON 格式请求包体","不符合消息格式描述,请参考 TIMMsgElement 对象的定义(").concat(xv,"269/2720").concat(Hv,")。"),90011:"批量发消息目标帐号超过500请减少 To_Account 中目标帐号数量。",90012:"To_Account 没有注册或不存在,请确认 To_Account 是否导入即时通信 IM 或者是否拼写错误。",90026:"消息离线存储时间错误最多不能超过7天。",90031:"".concat("JSON 格式请求包体","中 SyncOtherMachine 字段不是 Integer 类型。"),90044:"".concat("JSON 格式请求包体","中 MsgLifeTime 字段不是 Integer 类型。"),90048:"请求的用户帐号不存在。",90054:"撤回请求中的 MsgKey 不合法。",90994:"".concat("服务端内部错误,请重试。"),90995:"".concat("服务端内部错误,请重试。"),91e3:"".concat("服务端内部错误,请重试。"),90992:"".concat("服务端内部错误,请重试。","如果所有请求都返回该错误码,且 App 配置了第三方回调,请检查 App 服务端是否正常向即时通信 IM 后台服务端返回回调结果。"),93e3:"JSON 数据包超长消息包体请不要超过8k。",91101:"Web 端长轮询被踢Web 端同时在线实例个数超出限制)。",10002:"".concat("服务端内部错误,请重试。"),10003:"请求中的接口名称错误,请核对接口名称并重试。",10004:"参数非法,请根据错误描述检查请求是否正确。",10005:"请求包体中携带的帐号数量过多。",10006:"操作频率限制,请尝试降低调用的频率。",10007:"操作权限不足,例如 Work ".concat("群组","中普通成员尝试执行踢人操作,但只有 App 管理员才有权限。"),10008:"请求非法,可能是请求中携带的签名信息验证不正确,请再次尝试。",10009:"该群不允许群主主动退出。",10010:"".concat("群组","不存在,或者曾经存在过,但是目前已经被解散。"),10011:"解析 JSON 包体失败,请检查包体的格式是否符合 JSON 格式。",10012:"发起操作的 UserID 非法,请检查发起操作的用户 UserID 是否填写正确。",10013:"被邀请加入的用户已经是群成员。",10014:"群已满员,无法将请求中的用户加入".concat("群组",",如果是批量加人,可以尝试减少加入用户的数量。"),10015:"找不到指定 ID 的".concat("群组","。"),10016:"App 后台通过第三方回调拒绝本次操作。",10017:"因被禁言而不能发送消息,请检查发送者是否被设置禁言。",10018:"应答包长度超过最大包长1MB请求的内容过多请尝试减少单次请求的数据量。",10019:"请求的用户帐号不存在。",10021:"".concat("群组"," ID 已被使用,请选择其他的").concat("群组"," ID。"),10023:"发消息的频率超限,请延长两次发消息时间的间隔。",10024:"此邀请或者申请请求已经被处理。",10025:"".concat("群组"," ID 已被使用,并且操作者为群主,可以直接使用。"),10026:"该 SDKAppID 请求的命令字已被禁用。",10030:"请求撤回的消息不存在。",10031:"消息撤回超过了时间限制默认2分钟。",10032:"请求撤回的消息不支持撤回操作。",10033:"".concat("群组","类型不支持消息撤回操作。"),10034:"该消息类型不支持删除操作。",10035:"直播群和在线成员广播大群不支持删除消息。",10036:"直播群创建数量超过了限制,请参考价格说明(".concat(xv,"269/11673)购买预付费套餐“IM直播群”。"),10037:"单个用户可创建和加入的".concat("群组","数量超过了限制,请参考价格说明(").concat(xv,"269/11673)购买或升级预付费套餐“单人可创建与加入").concat("群组","数”。"),10038:"群成员数量超过限制,请参考价格说明(".concat(xv,"269/11673)购买或升级预付费套餐“扩展群人数上限”。"),10041:"该应用SDKAppID已配置不支持群消息撤回。",10050:"群属性 key 不存在",10056:"请在写入群属性前先使用 getGroupAttributes 接口更新本地群属性,避免冲突。",10059:"非旗舰版",10060:"群人数超过已读回执人数上限",10061:"在线消息不支持已读回执",10062:"找不到群消息的已读回执信息",20026:"消息不存在",20029:"该群类型不支持修改消息。",30001:"请求参数错误,请根据错误描述检查请求参数",30002:"SDKAppID 不匹配",30003:"请求的用户帐号不存在",30004:"请求需要 App 管理员权限",30005:"关系链字段中包含敏感词",30006:"".concat("服务端内部错误,请重试。"),30007:"".concat("网络超时,请稍后重试. "),30008:"并发写导致写冲突,建议使用批量方式",30009:"后台禁止该用户发起加好友请求",30010:"自己的好友数已达系统上限",30011:"分组已达系统上限",30012:"未决数已达系统上限",30014:"对方的好友数已达系统上限",30515:"请求添加好友时,对方在自己的黑名单中,不允许加好友",30516:"请求添加好友时,对方的加好友验证方式是不允许任何人添加自己为好友",30525:"请求添加好友时,自己在对方的黑名单中,不允许加好友",30539:"等待对方同意",30540:"添加好友请求被安全策略打击,请勿频繁发起添加好友请求",31704:"与请求删除的帐号之间不存在好友关系",31707:"删除好友请求被安全策略打击,请勿频繁发起删除好友请求",50001:"解包失败",50002:"请求参数错误,请根据错误描述检查请求是否正确",50004:"会话分组不存在",51006:"会话标记每次调整的会话数为空或者超过了100个上限",51007:"GroupID 换 GroupCode 失败,内部错误或 Group 已经解散",51008:"会话分组的总的会话数超过了1000",51009:"删除会话分组时分组不存在",51010:"会话分组数超过了上限默认20个",51011:"分组名超过了32个字节"},Wv=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this)).code=e.code,o.message=jv[e.code]||e.message,o.data=e.data||{},o}return i(n)}(_(Error)),Yv=null,zv=function(e){Yv=e},Jv=function(e){return Promise.resolve(Vv(e))},Xv=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof Wv)return t&&null!==Yv&&Yv.emit(_r.ERROR,e),Promise.reject(e);if(e instanceof Error){var n=new Wv({code:Mh.UNCAUGHT_ERROR,message:e.message});return t&&null!==Yv&&Yv.emit(_r.ERROR,n),Promise.reject(n)}if(ed(e)||ed(e.code)||ed(e.message))wl.error("IMPromise.reject 必须指定code(错误码)和message(错误信息)!!!");else{if(Jl(e.code)&&Xl(e.message)){var o=new Wv(e);return t&&null!==Yv&&Yv.emit(_r.ERROR,o),Promise.reject(o)}wl.error("IMPromise.reject code(错误码)必须为数字message(错误信息)必须为字符串!!!")}},Qv=function(e){c(o,e);var n=v(o);function o(e){var t;return r(this,o),(t=n.call(this,e))._className="C2CModule",t._messageFromUnreadDBMap=new Map,t}return i(o,[{key:"onNewC2CMessage",value:function(e){var t=e.dataList,n=e.isInstantMessage,o=e.C2CRemainingUnreadList,r=e.C2CPairUnreadList;wl.debug("".concat(this._className,".onNewC2CMessage count:").concat(t.length," isInstantMessage:").concat(n));var a=this._newC2CMessageStoredAndSummary({dataList:t,C2CRemainingUnreadList:o,C2CPairUnreadList:r,isInstantMessage:n}),s=a.conversationOptionsList,i=a.messageList,u=a.isUnreadC2CMessage;this.filterModifiedMessage(i),s.length>0&&this.getModule(ug).onNewMessage({conversationOptionsList:s,isInstantMessage:n,isUnreadC2CMessage:u});var c=this.filterUnmodifiedMessage(i);n&&c.length>0&&this.emitOuterEvent(_r.MESSAGE_RECEIVED,c),i.length=0}},{key:"_newC2CMessageStoredAndSummary",value:function(e){for(var t=e.dataList,n=e.C2CRemainingUnreadList,o=e.C2CPairUnreadList,r=e.isInstantMessage,a=null,s=[],i=[],u={},c=this.getModule(gg),l=this.getModule(Eg),d=!1,p=this.getModule(ug),g=0,_=t.length;g<_;g++){var h=t[g];h.currentUser=this.getMyUserID(),h.conversationType=hr.CONV_C2C,h.isSystemMessage=!!h.isSystemMessage,(ed(h.nick)||ed(h.avatar))&&(d=!0,wl.debug("".concat(this._className,"._newC2CMessageStoredAndSummary nick or avatar missing!"))),a=new qv(h),h.elements=c.parseElements(h.elements,h.from),a.setElement(h.elements),a.setNickAndAvatar({nick:h.nick,avatar:h.avatar});var f=a.conversationID;if(r){if(1===this._messageFromUnreadDBMap.get(a.ID))continue;var m=!1;if(a.from!==this.getMyUserID()){var v=p.getLatestMessageSentByPeer(f);if(v){var M=v.nick,y=v.avatar;d?a.setNickAndAvatar({nick:M,avatar:y}):M===a.nick&&y===a.avatar||(m=!0)}}else{var I=p.getLatestMessageSentByMe(f);if(I){var T=I.nick,E=I.avatar;T===a.nick&&E===a.avatar||p.modifyMessageSentByMe({conversationID:f,latestNick:a.nick,latestAvatar:a.avatar})}}var C=1===t[g].isModified;if(p.isMessageSentByCurrentInstance(a)?a.isModified=C:C=!1,0===h.msgLifeTime)a._onlineOnlyFlag=!0,p.isMessageSentByCurrentInstance(a)||i.push(a);else{if(!p.pushIntoMessageList(i,a,C))continue;m&&(p.modifyMessageSentByPeer({conversationID:f,latestNick:a.nick,latestAvatar:a.avatar}),p.updateUserProfileSpecifiedKey({conversationID:f,nick:a.nick,avatar:a.avatar}))}r&&a.clientTime>0&&l.addMessageDelay(a.clientTime)}else this._messageFromUnreadDBMap.set(a.ID,1);if(0!==h.msgLifeTime){if(!1===a._onlineOnlyFlag){var S=p.getLastMessageTime(f);if(Jl(S)&&a.time<S)continue;if(ed(u[f])){var A=0;"in"===a.flow&&(a._isExcludedFromUnreadCount||(A=1)),u[f]=s.push({conversationID:f,unreadCount:A,type:a.conversationType,subType:a.conversationSubType,lastMessage:a._isExcludedFromLastMessage?"":a})-1}else{var D=u[f];s[D].type=a.conversationType,s[D].subType=a.conversationSubType,s[D].lastMessage=a._isExcludedFromLastMessage?"":a,"in"===a.flow&&(a._isExcludedFromUnreadCount||s[D].unreadCount++)}}}else a._onlineOnlyFlag=!0}var N=!1;if($l(o))for(var O=function(e,t){if(o[e].unreadCount>0){N=!0;var n=s.find((function(t){return t.conversationID==="C2C".concat(o[e].from)}));n?n.unreadCount=o[e].unreadCount:s.push({conversationID:"C2C".concat(o[e].from),unreadCount:o[e].unreadCount,type:hr.CONV_C2C})}},R=0,L=o.length;R<L;R++)O(R);if($l(n))for(var k=function(e,t){s.find((function(t){return t.conversationID==="C2C".concat(n[e].from)}))||s.push({conversationID:"C2C".concat(n[e].from),type:hr.CONV_C2C,lastMsgTime:n[e].lastMsgTime})},G=0,P=n.length;G<P;G++)k(G);return{conversationOptionsList:s,messageList:i,isUnreadC2CMessage:N}}},{key:"onC2CMessageRevoked",value:function(e){var t=this;wl.debug("".concat(this._className,".onC2CMessageRevoked count:").concat(e.dataList.length));var n=this.getModule(ug),o=[],r=null;e.dataList.forEach((function(e){if(e.c2cMessageRevokedNotify){var a=e.c2cMessageRevokedNotify.revokedInfos;ed(a)||a.forEach((function(e){var a=t.getMyUserID()===e.from?"".concat(hr.CONV_C2C).concat(e.to):"".concat(hr.CONV_C2C).concat(e.from);(r=n.revoke(a,e.sequence,e.random))&&o.push(r)}))}})),0!==o.length&&(n.onMessageRevoked(o),this.emitOuterEvent(_r.MESSAGE_REVOKED,o))}},{key:"onC2CMessageReadReceipt",value:function(e){var t=this;e.dataList.forEach((function(e){if(!Bd(e.c2cMessageReadReceipt)){var n=e.c2cMessageReadReceipt.to;e.c2cMessageReadReceipt.uinPairReadArray.forEach((function(e){var o=e.peerReadTime;wl.debug("".concat(t._className,"._onC2CMessageReadReceipt to:").concat(n," peerReadTime:").concat(o));var r="".concat(hr.CONV_C2C).concat(n),a=t.getModule(ug);a.recordPeerReadTime(r,o),a.updateMessageIsPeerReadProperty(r,o)}))}}))}},{key:"onC2CMessageReadNotice",value:function(e){var t=this;e.dataList.forEach((function(e){if(!Bd(e.c2cMessageReadNotice)){var n=t.getModule(ug);e.c2cMessageReadNotice.uinPairReadArray.forEach((function(e){var o=e.from,r=e.peerReadTime;wl.debug("".concat(t._className,".onC2CMessageReadNotice from:").concat(o," lastReadTime:").concat(r));var a="".concat(hr.CONV_C2C).concat(o);n.updateIsReadAfterReadReport({conversationID:a,lastMessageTime:r}),n.updateUnreadCount(a)}))}}))}},{key:"onC2CMessageModified",value:function(e){wl.debug("".concat(this._className,".onC2CMessageModified options:"),JSON.stringify(e));var n=this.getModule(ug);e.dataList.forEach((function(e){n.onMessageModified(t(t({},e),{},{conversationType:hr.CONV_C2C}))}))}},{key:"onReadReceiptList",value:function(e){wl.debug("".concat(this._className,".onReadReceiptList options:"),JSON.stringify(e));var t=e.dataList,n=t.userID,o=t.readReceiptList;this.getModule(ug).updateReadReceiptInfo({userID:n,readReceiptList:o})}},{key:"sendMessage",value:function(e,t){var n=this._createC2CMessagePack(e,t);return this.request(n)}},{key:"_createC2CMessagePack",value:function(e,t){var n=null;t&&(t.offlinePushInfo&&(n=t.offlinePushInfo),!0===t.onlineUserOnly&&(n?n.disablePush=!0:n={disablePush:!0}));var o="";Xl(e.cloudCustomData)&&e.cloudCustomData.length>0&&(o=e.cloudCustomData);var r=[];if(Zl(t)&&Zl(t.messageControlInfo)){var a=t.messageControlInfo,s=a.excludedFromUnreadCount,i=a.excludedFromLastMessage;!0===s&&r.push("NoUnread"),!0===i&&r.push("NoLastMsg")}return{protocolName:Gg,tjgID:this.generateTjgID(e),requestData:{fromAccount:this.getMyUserID(),toAccount:e.to,msgBody:e.getElements(),cloudCustomData:o,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:this.isOnlineMessage(e,t)?0:void 0,nick:e.nick,avatar:e.avatar,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||"",desc:n.description||"",ext:n.extension||"",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||""}}:void 0,messageControlInfo:r,clientTime:e.clientTime,needReadReceipt:!0===e.needReadReceipt?1:0}}}},{key:"isOnlineMessage",value:function(e,t){return!(!t||!0!==t.onlineUserOnly)}},{key:"revokeMessage",value:function(e){return this.request({protocolName:Vg,requestData:{msgInfo:{fromAccount:e.from,toAccount:e.to,msgSeq:e.sequence,msgRandom:e.random,msgTimeStamp:e.time}}})}},{key:"deleteMessage",value:function(e){var t=e.to,n=e.keyList;return wl.log("".concat(this._className,".deleteMessage toAccount:").concat(t," count:").concat(n.length)),this.request({protocolName:Wg,requestData:{fromAccount:this.getMyUserID(),to:t,keyList:n}})}},{key:"modifyRemoteMessage",value:function(e){var t=e.from,n=e.to,o=e.version,r=void 0===o?0:o,a=e.sequence,s=e.random,i=e.time,u=e.payload,c=e.type,l=e.cloudCustomData,d=void 0;return qd(c)&&(d=[]).push({type:c,content:u}),this.request({protocolName:Yg,requestData:{from:t,to:n,version:r,sequence:a,random:s,time:i,elements:d,cloudCustomData:l}})}},{key:"setMessageRead",value:function(e){var t=this,n=e.conversationID,o=e.lastMessageTime,r="".concat(this._className,".setMessageRead");wl.log("".concat(r," conversationID:").concat(n," lastMessageTime:").concat(o)),Jl(o)||wl.warn("".concat(r," 请勿修改 Conversation.lastMessage.lastTime否则可能会导致已读上报结果不准确"));var a=new Uh(bh.SET_C2C_MESSAGE_READ);return a.setMessage("conversationID:".concat(n," lastMessageTime:").concat(o)),this.request({protocolName:xg,requestData:{C2CMsgReaded:{cookie:"",C2CMsgReadedItem:[{toAccount:n.replace("C2C",""),lastMessageTime:o,receipt:1}]}}}).then((function(){a.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(r," ok"));var e=t.getModule(ug);return e.updateIsReadAfterReadReport({conversationID:n,lastMessageTime:o}),e.updateUnreadCount(n),Vv()})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];a.setError(e,o,r).end()})),wl.log("".concat(r," failed. error:"),e),Xv(e)}))}},{key:"getRoamingMessage",value:function(e){var t=this,n="".concat(this._className,".getRoamingMessage"),o=e.peerAccount,r=e.conversationID,a=e.count,s=e.lastMessageTime,i=e.messageKey,u="peerAccount:".concat(o," count:").concat(a||15," lastMessageTime:").concat(s||0," messageKey:").concat(i);wl.log("".concat(n," ").concat(u));var c=new Uh(bh.GET_C2C_ROAMING_MESSAGES);return this.request({protocolName:Hg,requestData:{peerAccount:o,count:a||15,lastMessageTime:s||0,messageKey:i}}).then((function(e){var o=e.data,a=o.complete,s=o.messageList,i=o.messageKey,l=o.lastMessageTime;ed(s)?wl.log("".concat(n," ok. complete:").concat(a," but messageList is undefined!")):wl.log("".concat(n," ok. complete:").concat(a," count:").concat(s.length)),c.setNetworkType(t.getNetworkType()).setMessage("".concat(u," complete:").concat(a," length:").concat(s.length)).end();var d=t.getModule(ug);1===a&&d.setCompleted(r);var p=d.onRoamingMessage(s,r);d.modifyMessageList(r),d.updateIsRead(r),d.updateRoamingMessageKeyAndTime(r,i,l);var g=d.getPeerReadTime(r);if(wl.log("".concat(n," update isPeerRead property. conversationID:").concat(r," peerReadTime:").concat(g)),g)d.updateMessageIsPeerReadProperty(r,g);else{var _=r.replace(hr.CONV_C2C,"");t.getRemotePeerReadTime([_]).then((function(){d.updateMessageIsPeerReadProperty(r,d.getPeerReadTime(r))}))}var h="";if(p.length>0)h=p[0].ID;else{var f=d.getLocalOldestMessage(r);f&&(h=f.ID)}return wl.log("".concat(n," nextReqID:").concat(h," stored message count:").concat(p.length)),{nextReqID:h,storedMessageList:p}})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];c.setMessage(u).setError(e,o,r).end()})),wl.warn("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"getRoamingMessagesHopping",value:function(e){var t=this,n="".concat(this._className,".getRoamingMessagesHopping"),o=e.peerAccount,r=e.time,a=void 0===r?0:r,s=e.count,i=e.direction,u="".concat(hr.CONV_C2C).concat(o),c="peerAccount:".concat(o," count:").concat(s," time:").concat(a," direction:").concat(i);wl.log("".concat(n," ").concat(c));var l=new Uh(bh.GET_C2C_ROAMING_MESSAGES_HOPPING);return this.request({protocolName:Hg,requestData:{peerAccount:o,count:s+1,lastMessageTime:a,direction:i}}).then((function(e){var o=e.data,r=o.complete,a=o.messageList,s=void 0===a?[]:a,d=o.lastMessageTime;wl.log("".concat(n," ok. complete:").concat(r," count:").concat(s.length)),l.setNetworkType(t.getNetworkType()).setMessage("".concat(c," complete:").concat(r," length:").concat(s.length)).end(),1!==r&&(1===i?s.pop():s.shift());var p=t.getModule(ug).onRoamingMessage(s,u,!1);t._modifyMessageList(u,p);var g=t._computeResult({complete:r,lastMessageTime:d,resultList:p});return Vv(g)})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];l.setMessage(c).setError(e,o,r).end()})),wl.warn("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"_computeResult",value:function(e){var t=e.complete,n=void 0===t?0:t,o=e.lastMessageTime,r=e.resultList,a={messageList:y(void 0===r?[]:r),isCompleted:!1,nextMessageTime:""};return 1===n?(a.isCompleted=!0,a):(a.nextMessageTime=o,a)}},{key:"_modifyMessageList",value:function(e,t){var n=this.getModule(ug).getLocalConversation(e);if(n)for(var o=n.userProfile.nick,r=n.userProfile.avatar,a=this.getModule(ng).getNickAndAvatarByUserID(this.getMyUserID()),s=a.nick,i=a.avatar,u=t.length-1;u>=0;u--){var c=t[u];"in"===c.flow&&(c.nick!==o&&c.setNickAndAvatar({nick:o}),c.avatar!==r&&c.setNickAndAvatar({avatar:r})),"out"===c.flow&&(c.nick!==s&&c.setNickAndAvatar({nick:s}),c.avatar!==i&&c.setNickAndAvatar({avatar:i}))}}},{key:"getRemotePeerReadTime",value:function(e){var t=this,n="".concat(this._className,".getRemotePeerReadTime");if(Bd(e))return wl.warn("".concat(n," userIDList is empty!")),Promise.resolve();var o=new Uh(bh.GET_PEER_READ_TIME);return wl.log("".concat(n," userIDList:").concat(e)),this.request({protocolName:jg,requestData:{userIDList:e}}).then((function(r){var a=r.data.peerReadTimeList;wl.log("".concat(n," ok. peerReadTimeList:").concat(a));for(var s="",i=t.getModule(ug),u=0;u<e.length;u++)s+="".concat(e[u],"-").concat(a[u]," "),a[u]>0&&i.recordPeerReadTime("C2C".concat(e[u]),a[u]);o.setNetworkType(t.getNetworkType()).setMessage(s).end()})).catch((function(e){t.probeNetwork().then((function(t){var n=M(t,2),r=n[0],a=n[1];o.setError(e,r,a).end()})),wl.warn("".concat(n," failed. error:"),e)}))}},{key:"sendReadReceipt",value:function(e){var t=this,n=e[0].conversationID.replace(hr.CONV_C2C,""),o=new Uh(bh.SEND_C2C_READ_RECEIPT);o.setMessage("peerAccount:".concat(n));var r=this.getMyUserID(),a=e.filter((function(e){return e.from!==r&&!0===e.needReadReceipt})).map((function(e){return{fromAccount:e.from,toAccount:e.to,sequence:e.sequence,random:e.random,time:e.time,clientTime:e.clientTime}}));if(0===a.length)return Xv({code:Mh.READ_RECEIPT_MESSAGE_LIST_EMPTY,message:yh.READ_RECEIPT_MESSAGE_LIST_EMPTY});var s="".concat(this._className,".sendReadReceipt");return wl.log("".concat(s,". peerAccount:").concat(n," messageInfoList length:").concat(a.length)),this.request({protocolName:S_,requestData:{peerAccount:n,messageInfoList:a}}).then((function(e){return o.end(),wl.log("".concat(s," ok")),Vv()})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),r=n[0],a=n[1];o.setError(e,r,a).end()})),wl.warn("".concat(s," failed. error:"),e),Xv(e)}))}},{key:"getReadReceiptList",value:function(e){var t="".concat(this._className,".getReadReceiptList"),n=this.getMyUserID(),o=e.filter((function(e){return e.from===n&&!0===e.needReadReceipt}));return wl.log("".concat(t," userID:").concat(n," messageList length:").concat(o.length)),Jv({messageList:o})}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._messageFromUnreadDBMap.clear()}}]),o}(Ag),Zv=ie.match(/firefox\/(\d+)/i),$v=!!Zv&&+Zv[1],eM=/MSIE|Trident/.test(ie),tM=ie.match(/AppleWebKit\/(\d+)\./),nM=!!tM&&+tM[1],oM=[],rM=W(oM.sort),aM=W(oM.push),sM=G((function(){oM.sort(void 0)})),iM=G((function(){oM.sort(null)})),uM=no("sort"),cM=!G((function(){if(pe)return pe<70;if(!($v&&$v>3)){if(eM)return!0;if(nM)return nM<603;var e,t,n,o,r="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(o=0;o<47;o++)oM.push({k:t+o,v:n})}for(oM.sort((function(e,t){return t.v-e.v})),o=0;o<oM.length;o++)t=oM[o].k.charAt(0),r.charAt(r.length-1)!==t&&(r+=t);return"DGBEFHACIJK"!==r}}));rn({target:"Array",proto:!0,forced:sM||!iM||!uM||!cM},{sort:function(e){void 0!==e&&ye(e);var t=Ne(this);if(cM)return void 0===e?rM(t):rM(t,e);var n,o,r=[],a=wt(t);for(o=0;o<a;o++)o in t&&aM(r,t[o]);for(ff(r,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:gn(t)>gn(n)?1:-1}}(e)),n=r.length,o=0;o<n;)t[o]=r[o++];for(;o<a;)delete t[o++];return t}});var lM=to.findIndex,dM=!0;"findIndex"in[]&&Array(1).findIndex((function(){dM=!1})),rn({target:"Array",proto:!0,forced:dM},{findIndex:function(e){return lM(this,e,arguments.length>1?arguments[1]:void 0)}}),Ya("findIndex");var pM=function(){function e(){r(this,e),this.list=new Map,this._className="MessageListHandler",this._latestMessageSentByPeerMap=new Map,this._latestMessageSentByMeMap=new Map,this._groupLocalLastMessageSequenceMap=new Map}return i(e,[{key:"getLocalOldestMessageByConversationID",value:function(e){if(!e)return null;if(!this.list.has(e))return null;var t=this.list.get(e).values();return t?t.next().value:null}},{key:"pushIn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.conversationID,o=!0;this.list.has(n)||this.list.set(n,new Map);var r=this._getUniqueIDOfMessage(e),a=this.list.get(n).has(r);if(a){var s=this.list.get(n).get(r);if(!t||!0===s.isModified)return!1}return this.list.get(n).set(r,e),this._setLatestMessageSentByPeer(n,e),this._setLatestMessageSentByMe(n,e),this._setGroupLocalLastMessageSequence(n,e),o}},{key:"unshift",value:function(e,t){var n;if($l(e)){if(e.length>0){n=e[0].conversationID;var o=e.length;this._unshiftMultipleMessages(e,t),this._setGroupLocalLastMessageSequence(n,e[o-1])}}else n=e.conversationID,this._unshiftSingleMessage(e,t),this._setGroupLocalLastMessageSequence(n,e);if(n&&n.startsWith(hr.CONV_C2C)){var r=Array.from(this.list.get(n).values()),a=r.length;if(0===a)return;for(var s=a-1;s>=0;s--)if("out"===r[s].flow){this._setLatestMessageSentByMe(n,r[s]);break}for(var i=a-1;i>=0;i--)if("in"===r[i].flow){this._setLatestMessageSentByPeer(n,r[i]);break}}}},{key:"_unshiftSingleMessage",value:function(e,t){var n=e.conversationID,o=this._getUniqueIDOfMessage(e);if(!this.list.has(n))return this.list.set(n,new Map),this.list.get(n).set(o,e),void t.push(e);var r=this.list.get(n),a=Array.from(r);r.has(o)||(a.unshift([o,e]),this.list.set(n,new Map(a)),t.push(e))}},{key:"_unshiftMultipleMessages",value:function(e,t){for(var n=e.length,o=[],r=e[0].conversationID,a=this.list.get(r),s=this.list.has(r)?Array.from(a):[],i=0;i<n;i++){var u=this._getUniqueIDOfMessage(e[i]);a&&a.has(u)||(o.push([u,e[i]]),t.push(e[i]))}this.list.set(r,new Map(o.concat(s)))}},{key:"remove",value:function(e){var t=e.conversationID,n=this._getUniqueIDOfMessage(e);this.list.has(t)&&this.list.get(t).delete(n)}},{key:"revoke",value:function(e,t,n){if(wl.debug("revoke message",e,t,n),this.list.has(e)){var o,r=A(this.list.get(e));try{for(r.s();!(o=r.n()).done;){var a=M(o.value,2)[1];if(a.sequence===t&&!a.isRevoked&&(ed(n)||a.random===n))return a.isRevoked=!0,a}}catch(u){r.e(u)}finally{r.f()}}return null}},{key:"removeByConversationID",value:function(e){this.list.has(e)&&(this.list.delete(e),this._latestMessageSentByPeerMap.delete(e),this._latestMessageSentByMeMap.delete(e))}},{key:"findMessage",value:function(e){var t,n=null,o=A(this.list);try{for(o.s();!(t=o.n()).done;)for(var r=y(M(t.value,2)[1].values()),a=r.length,s=0;s<a;s++)if(r[s].ID===e){n=r[s];break}}catch(c){o.e(c)}finally{o.f()}return n}},{key:"updateMessageIsPeerReadProperty",value:function(e,t){var n=[];if(this.list.has(e)){var o,r=A(this.list.get(e));try{for(r.s();!(o=r.n()).done;){var a=M(o.value,2)[1];a.time<=t&&!a.isPeerRead&&"out"===a.flow&&(a.isPeerRead=!0,n.push(a))}}catch(u){r.e(u)}finally{r.f()}wl.log("".concat(this._className,".updateMessageIsPeerReadProperty conversationID:").concat(e," peerReadTime:").concat(t," count:").concat(n.length))}return n}},{key:"updateMessageIsModifiedProperty",value:function(e){var t=e.conversationID;if(this.list.has(t)){var n=this._getUniqueIDOfMessage(e),o=this.list.get(t).get(n);o&&(o.isModified=!0)}}},{key:"hasLocalMessageList",value:function(e){return this.list.has(e)}},{key:"getLocalMessageList",value:function(e){return this.hasLocalMessageList(e)?y(this.list.get(e).values()):[]}},{key:"hasLocalMessage",value:function(e,t){for(var n=!1,o=this.getLocalMessageList(e),r=o.length,a=0;a<r;a++)o[a].ID===t&&(n=!0);return n}},{key:"getLocalMessage",value:function(e,t){for(var n=null,o=this.getLocalMessageList(e),r=o.length,a=0;a<r;a++)if(o[a].ID===t){n=o[a];break}return n}},{key:"getLocalLastMessage",value:function(e){var t=this.getLocalMessageList(e);return t[t.length-1]}},{key:"getLocalOldestMessage",value:function(e){return this.getLocalMessageList(e)[0]}},{key:"_setLatestMessageSentByPeer",value:function(e,t){e.startsWith(hr.CONV_C2C)&&"in"===t.flow&&this._latestMessageSentByPeerMap.set(e,t)}},{key:"_setLatestMessageSentByMe",value:function(e,t){e.startsWith(hr.CONV_C2C)&&"out"===t.flow&&this._latestMessageSentByMeMap.set(e,t)}},{key:"_setGroupLocalLastMessageSequence",value:function(e,t){e.startsWith(hr.CONV_GROUP)&&this._groupLocalLastMessageSequenceMap.set(e,t.sequence)}},{key:"getLatestMessageSentByPeer",value:function(e){return this._latestMessageSentByPeerMap.get(e)}},{key:"getLatestMessageSentByMe",value:function(e){return this._latestMessageSentByMeMap.get(e)}},{key:"getGroupLocalLastMessageSequence",value:function(e){return this._groupLocalLastMessageSequenceMap.get(e)||0}},{key:"modifyMessageSentByPeer",value:function(e){var t=e.conversationID,n=e.latestNick,o=e.latestAvatar,r=this.list.get(t);if(!Bd(r)){var a=Array.from(r.values()),s=a.length;if(0!==s){for(var i=null,u=0,c=!1,l=s-1;l>=0;l--)"in"===a[l].flow&&((i=a[l]).nick!==n&&(i.setNickAndAvatar({nick:n}),c=!0),i.avatar!==o&&(i.setNickAndAvatar({avatar:o}),c=!0),c&&(u+=1));wl.log("".concat(this._className,".modifyMessageSentByPeer conversationID:").concat(t," count:").concat(u))}}}},{key:"modifyMessageSentByMe",value:function(e){var t=e.conversationID,n=e.latestNick,o=e.latestAvatar,r=this.list.get(t);if(!Bd(r)){var a=Array.from(r.values()),s=a.length;if(0!==s){for(var i=null,u=0,c=!1,l=s-1;l>=0;l--)"out"===a[l].flow&&((i=a[l]).nick!==n&&(i.setNickAndAvatar({nick:n}),c=!0),i.avatar!==o&&(i.setNickAndAvatar({avatar:o}),c=!0),c&&(u+=1));wl.log("".concat(this._className,".modifyMessageSentByMe conversationID:").concat(t," count:").concat(u))}}}},{key:"getTopicConversationIDList",value:function(e){return y(this.list.keys()).filter((function(t){return t.startsWith("".concat(hr.CONV_GROUP).concat(e))}))}},{key:"traversal",value:function(){if(0!==this.list.size&&-1===wl.getLevel()){var e,t=A(this.list);try{for(t.s();!(e=t.n()).done;){var n=M(e.value,2);n[0],n[1]}}catch(i){t.e(i)}finally{t.f()}}}},{key:"onMessageModified",value:function(e,t){if(!this.list.has(e))return{isUpdated:!1,message:null};var n=this._getUniqueIDOfMessage(t),o=this.list.get(e).has(n);if(wl.debug("".concat(this._className,".onMessageModified conversationID:").concat(e," uniqueID:").concat(n," has:").concat(o)),o){var r=this.list.get(e).get(n),a=t.messageVersion,s=t.elements,i=t.cloudCustomData;return r.version<a?(r.version=a,r._elements=JSON.parse(JSON.stringify(s)),r.payload=JSON.parse(JSON.stringify(s[0].content)),r.type=s[0].type,r.cloudCustomData=i,r.isModified=!0,{isUpdated:!0,message:r}):{isUpdated:!1,message:r}}return{isUpdated:!1,message:null}}},{key:"_getUniqueIDOfMessage",value:function(e){var t=e.from,n=e.to,o=e.random,r=e.sequence,a=e.time;return"".concat(t,"-").concat(n,"-").concat(o,"-").concat(r,"-").concat(a)}},{key:"reset",value:function(){this.list.clear(),this._latestMessageSentByPeerMap.clear(),this._latestMessageSentByMeMap.clear(),this._groupLocalLastMessageSequenceMap.clear()}}]),e}(),gM="_a2KeyAndTinyIDUpdated",_M="_cloudConfigUpdated",hM="_profileUpdated";function fM(e){this.mixin(e)}fM.mixin=function(e){var t=e.prototype||e;t._isReady=!1,t.ready=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e)return this._isReady?void(t?e.call(this):setTimeout(e,1)):(this._readyQueue=this._readyQueue||[],void this._readyQueue.push(e))},t.triggerReady=function(){var e=this;this._isReady=!0,setTimeout((function(){var t=e._readyQueue;e._readyQueue=[],t&&t.length>0&&t.forEach((function(e){e.call(this)}),e)}),1)},t.resetReady=function(){this._isReady=!1,this._readyQueue=[]},t.isReady=function(){return this._isReady}};var mM=["jpg","jpeg","gif","png","bmp","image","webp"],vM=["mp4"],MM=1,yM=2,IM=3,TM=255,EM=function(){function e(t){var n=this;r(this,e),Bd(t)||(this.userID=t.userID||"",this.nick=t.nick||"",this.gender=t.gender||"",this.birthday=t.birthday||0,this.location=t.location||"",this.selfSignature=t.selfSignature||"",this.allowType=t.allowType||hr.ALLOW_TYPE_ALLOW_ANY,this.language=t.language||0,this.avatar=t.avatar||"",this.messageSettings=t.messageSettings||0,this.adminForbidType=t.adminForbidType||hr.FORBID_TYPE_NONE,this.level=t.level||0,this.role=t.role||0,this.lastUpdatedTime=0,this.profileCustomField=[],Bd(t.profileCustomField)||t.profileCustomField.forEach((function(e){n.profileCustomField.push({key:e.key,value:e.value})})))}return i(e,[{key:"validate",value:function(e){var t=!0,n="";if(Bd(e))return{valid:!1,tips:"empty options"};if(e.profileCustomField)for(var o=e.profileCustomField.length,r=null,a=0;a<o;a++){if(r=e.profileCustomField[a],!Xl(r.key)||-1===r.key.indexOf("Tag_Profile_Custom"))return{valid:!1,tips:"自定义资料字段的前缀必须是 Tag_Profile_Custom"};if(!Xl(r.value))return{valid:!1,tips:"自定义资料字段的 value 必须是字符串"}}for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)){if("profileCustomField"===s)continue;if(Bd(e[s])&&!Xl(e[s])&&!Jl(e[s])){n="key:"+s+", invalid value:"+e[s],t=!1;continue}switch(s){case"nick":Xl(e[s])||(n="nick should be a string",t=!1),ld(e[s])>500&&(n="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(ld(e[s])," bytes"),t=!1);break;case"gender":_d(Vl,e.gender)||(n="key:gender, invalid value:"+e.gender,t=!1);break;case"birthday":Jl(e.birthday)||(n="birthday should be a number",t=!1);break;case"location":Xl(e.location)||(n="location should be a string",t=!1);break;case"selfSignature":Xl(e.selfSignature)||(n="selfSignature should be a string",t=!1);break;case"allowType":_d(Bl,e.allowType)||(n="key:allowType, invalid value:"+e.allowType,t=!1);break;case"language":Jl(e.language)||(n="language should be a number",t=!1);break;case"avatar":Xl(e.avatar)||(n="avatar should be a string",t=!1);break;case"messageSettings":0!==e.messageSettings&&1!==e.messageSettings&&(n="messageSettings should be 0 or 1",t=!1);break;case"adminForbidType":_d(xl,e.adminForbidType)||(n="key:adminForbidType, invalid value:"+e.adminForbidType,t=!1);break;case"level":Jl(e.level)||(n="level should be a number",t=!1);break;case"role":Jl(e.role)||(n="role should be a number",t=!1);break;default:n="unknown key:"+s+" "+e[s],t=!1}}return{valid:t,tips:n}}}]),e}(),CM=i((function e(t){r(this,e),this.value=t,this.next=null})),SM=function(){function e(t){r(this,e),this.MAX_LENGTH=t,this.pTail=null,this.pNodeToDel=null,this.map=new Map,wl.debug("SinglyLinkedList init MAX_LENGTH:".concat(this.MAX_LENGTH))}return i(e,[{key:"set",value:function(e){var t=new CM(e);if(this.map.size<this.MAX_LENGTH)null===this.pTail?(this.pTail=t,this.pNodeToDel=t):(this.pTail.next=t,this.pTail=t),this.map.set(e,1);else{var n=this.pNodeToDel;this.pNodeToDel=this.pNodeToDel.next,this.map.delete(n.value),n.next=null,n=null,this.pTail.next=t,this.pTail=t,this.map.set(e,1)}}},{key:"has",value:function(e){return this.map.has(e)}},{key:"delete",value:function(e){this.has(e)&&this.map.delete(e)}},{key:"tail",value:function(){return this.pTail}},{key:"size",value:function(){return this.map.size}},{key:"data",value:function(){return Array.from(this.map.keys())}},{key:"reset",value:function(){for(var e;null!==this.pNodeToDel;)e=this.pNodeToDel,this.pNodeToDel=this.pNodeToDel.next,e.next=null,e=null;this.pTail=null,this.map.clear()}}]),e}(),AM=["groupID","name","avatar","type","introduction","notification","ownerID","selfInfo","createTime","infoSequence","lastInfoTime","lastMessage","nextMessageSeq","memberNum","maxMemberNum","memberList","joinOption","groupCustomField","muteAllMembers","isSupportTopic"],DM=function(){function e(t){r(this,e),this.groupID="",this.name="",this.avatar="",this.type="",this.introduction="",this.notification="",this.ownerID="",this.createTime="",this.infoSequence="",this.lastInfoTime="",this.selfInfo={messageRemindType:"",joinTime:"",nameCard:"",role:"",userID:"",memberCustomField:void 0,readedSequence:0,excludedUnreadSequenceList:void 0},this.lastMessage={lastTime:"",lastSequence:"",fromAccount:"",messageForShow:""},this.nextMessageSeq="",this.memberNum="",this.memberCount="",this.maxMemberNum="",this.maxMemberCount="",this.joinOption="",this.groupCustomField=[],this.muteAllMembers=!1,this.isSupportTopic=!1,this._initGroup(t)}return i(e,[{key:"memberNum",get:function(){return wl.warn("v2.8.0起弃用memberNum请使用 memberCount"),this.memberCount},set:function(e){}},{key:"maxMemberNum",get:function(){return wl.warn("v2.8.0起弃用maxMemberNum请使用 maxMemberCount"),this.maxMemberCount},set:function(e){}},{key:"_initGroup",value:function(e){for(var t in e)AM.indexOf(t)<0||("selfInfo"!==t?("memberNum"===t&&(this.memberCount=e[t]),"maxMemberNum"===t&&(this.maxMemberCount=e[t]),"isSupportTopic"!==t?this[t]=e[t]:this.isSupportTopic=1===e[t]):this.updateSelfInfo(e[t]))}},{key:"updateGroup",value:function(e){var t=this,n=JSON.parse(JSON.stringify(e));n.lastMsgTime&&(this.lastMessage.lastTime=n.lastMsgTime),ed(n.muteAllMembers)||("On"===n.muteAllMembers?n.muteAllMembers=!0:n.muteAllMembers=!1),n.groupCustomField&&vd(this.groupCustomField,n.groupCustomField),ed(n.memberNum)||(this.memberCount=n.memberNum),ed(n.maxMemberNum)||(this.maxMemberCount=n.maxMemberNum),ed(n.isSupportTopic)||(this.isSupportTopic=Jl(n.isSupportTopic)?1===n.isSupportTopic:n.isSupportTopic),ud(this,n,["members","errorCode","lastMsgTime","groupCustomField","memberNum","maxMemberNum","isSupportTopic"]),$l(n.members)&&n.members.length>0&&n.members.forEach((function(e){e.userID===t.selfInfo.userID&&ud(t.selfInfo,e,["sequence"])}))}},{key:"updateSelfInfo",value:function(e){var n={nameCard:e.nameCard,joinTime:e.joinTime,role:e.role,messageRemindType:e.messageRemindType,readedSequence:e.readedSequence,excludedUnreadSequenceList:e.excludedUnreadSequenceList};ud(this.selfInfo,t({},n),[],["",null,void 0,0,NaN])}},{key:"setSelfNameCard",value:function(e){this.selfInfo.nameCard=e}}]),e}(),NM=function(e){return ed(e)?{lastTime:0,lastSequence:0,fromAccount:0,messageForShow:"",payload:null,type:"",isRevoked:!1,cloudCustomData:"",onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:!1}:e instanceof qv?{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",messageForShow:Fd(e.type,e.payload),payload:e.payload||null,type:e.type||null,isRevoked:e.isRevoked||!1,cloudCustomData:e.cloudCustomData||"",onlineOnlyFlag:e._onlineOnlyFlag||!1,nick:e.nick||"",nameCard:e.nameCard||"",version:e.version||0,isPeerRead:e.isPeerRead||!1}:t(t({},e),{},{messageForShow:Fd(e.type,e.payload)})},OM=function(){function e(t){r(this,e),this.conversationID=t.conversationID||"",this.unreadCount=t.unreadCount||0,this.type=t.type||"",this.lastMessage=NM(t.lastMessage),t.lastMsgTime&&(this.lastMessage.lastTime=t.lastMsgTime),this._isInfoCompleted=!1,this.peerReadTime=t.peerReadTime||0,this.groupAtInfoList=[],this.remark="",this.isPinned=t.isPinned||!1,this.messageRemindType="",this.markList=[],this.customData="",this.conversationGroupList=t.conversationGroupList||[],this._initProfile(t)}return i(e,[{key:"toAccount",get:function(){return this.conversationID.startsWith(hr.CONV_C2C)?this.conversationID.replace(hr.CONV_C2C,""):this.conversationID.startsWith(hr.CONV_GROUP)?this.conversationID.replace(hr.CONV_GROUP,""):""}},{key:"subType",get:function(){return this.groupProfile?this.groupProfile.type:""}},{key:"_initProfile",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"userProfile":t.userProfile=e.userProfile;break;case"groupProfile":t.groupProfile=e.groupProfile}})),ed(this.userProfile)&&this.type===hr.CONV_C2C?this.userProfile=new EM({userID:e.conversationID.replace("C2C","")}):ed(this.groupProfile)&&this.type===hr.CONV_GROUP&&(this.groupProfile=new DM({groupID:e.conversationID.replace("GROUP","")}))}},{key:"updateUnreadCount",value:function(e){var t=e.nextUnreadCount,n=e.isFromGetConversations,o=e.isUnreadC2CMessage;ed(t)||(yd(this.subType)?this.unreadCount=0:n&&this.type===hr.CONV_GROUP||n&&this.type===hr.CONV_TOPIC||o&&this.type===hr.CONV_C2C?this.unreadCount=t:this.unreadCount=this.unreadCount+t)}},{key:"updateLastMessage",value:function(e){this.lastMessage=NM(e)}},{key:"updateGroupAtInfoList",value:function(e){if(!this._isNeedMergeGroupAtInfo(e)){var t,n=(I(t=e.groupAtType)||T(t)||E(t)||S()).slice(0);-1!==n.indexOf(hr.CONV_AT_ME)&&-1!==n.indexOf(hr.CONV_AT_ALL)&&(n=[hr.CONV_AT_ALL_AT_ME]);var o={from:e.from,groupID:e.groupID,topicID:e.topicID,messageSequence:e.sequence,atTypeArray:n,__random:e.__random,__sequence:e.__sequence};this.groupAtInfoList.push(o),wl.debug("Conversation.updateGroupAtInfoList conversationID:".concat(this.conversationID),this.groupAtInfoList)}}},{key:"_isNeedMergeGroupAtInfo",value:function(e){var t=e.groupID,n=e.sequence;if(!Id({groupID:t}))return!1;var o=!1;return this.groupAtInfoList.forEach((function(t){t.messageSequence===n&&(t.atTypeArray.indexOf(hr.CONV_AT_ME)>-1&&e.groupAtType.indexOf(hr.CONV_AT_ALL)>-1&&(t.atTypeArray=[hr.CONV_AT_ALL_AT_ME]),t.atTypeArray.indexOf(hr.CONV_AT_ALL)>-1&&e.groupAtType.indexOf(hr.CONV_AT_ME)>-1&&(t.atTypeArray=[hr.CONV_AT_ALL_AT_ME],t.__random=e.__random,t.__sequence=e.__sequence),o=!0)})),o}},{key:"clearGroupAtInfoList",value:function(){this.groupAtInfoList.length=0}},{key:"reduceUnreadCount",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:"isLastMessageRevoked",value:function(e){var t=e.sequence,n=e.time;return this.type===hr.CONV_C2C&&t===this.lastMessage.lastSequence&&n===this.lastMessage.lastTime||this.type===hr.CONV_GROUP&&t===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}}]),e}(),RM=function(){function e(t){r(this,e),this._conversationModule=t,this._className="MessageRemindHandler",this._updateSequence=0}return i(e,[{key:"getC2CMessageRemindType",value:function(){var e=this,t="".concat(this._className,".getC2CMessageRemindType");return this._conversationModule.request({protocolName:Kg,updateSequence:this._updateSequence}).then((function(n){wl.log("".concat(t," ok"));var o=n.data,r=o.updateSequence,a=o.muteFlagList;e._updateSequence=r,e._patchC2CMessageRemindType(a)})).catch((function(e){wl.error("".concat(t," failed. error:"),e)}))}},{key:"_patchC2CMessageRemindType",value:function(e){var t=this,n=0,o="";$l(e)&&e.length>0&&e.forEach((function(e){var r=e.userID,a=e.muteFlag;0===a?o=hr.MSG_REMIND_ACPT_AND_NOTE:1===a?o=hr.MSG_REMIND_DISCARD:2===a&&(o=hr.MSG_REMIND_ACPT_NOT_NOTE),!0===t._conversationModule.patchMessageRemindType({ID:r,isC2CConversation:!0,messageRemindType:o})&&(n+=1)})),wl.log("".concat(this._className,"._patchC2CMessageRemindType count:").concat(n))}},{key:"set",value:function(e){return e.groupID?this._setGroupMessageRemindType(e):$l(e.userIDList)?this._setC2CMessageRemindType(e):void 0}},{key:"_setGroupMessageRemindType",value:function(e){var t=this,n="".concat(this._className,"._setGroupMessageRemindType"),o=e.groupID,r=e.messageRemindType,a="groupID:".concat(o," messageRemindType:").concat(r),s=new Uh(bh.SET_MESSAGE_REMIND_TYPE);return s.setMessage(a),this._getModule(sg).modifyGroupMemberInfo({groupID:o,messageRemindType:r,userID:this._conversationModule.getMyUserID()}).then((function(){s.setNetworkType(t._conversationModule.getNetworkType()).end(),wl.log("".concat(n," ok. ").concat(a));var o=t.onGroupMessageRemindTypeUpdated(e);return Vv(o)})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"onGroupMessageRemindTypeUpdated",value:function(e){var t=e.groupID,n=e.messageRemindType,o=this._getModule(rg).getLocalGroupProfile(t);if(o&&(o.selfInfo.messageRemindType=n),Td(t)){var r=t,a=wd(r),s=this._getModule(ig).getLocalTopic(a,r);return s&&(s.updateSelfInfo({messageRemindType:n}),this._conversationModule.emitOuterEvent(_r.TOPIC_UPDATED,{groupID:a,topic:s})),{topic:s}}return this._conversationModule.patchMessageRemindType({ID:t,isC2CConversation:!1,messageRemindType:n})&&this._emitConversationUpdate(),{group:o}}},{key:"_setC2CMessageRemindType",value:function(e){var t=this,n="".concat(this._className,"._setC2CMessageRemindType"),o=e.userIDList,r=e.messageRemindType,a=o.slice(0,30),s=0;r===hr.MSG_REMIND_DISCARD?s=1:r===hr.MSG_REMIND_ACPT_NOT_NOTE&&(s=2);var i="userIDList:".concat(a," messageRemindType:").concat(r),u=new Uh(bh.SET_MESSAGE_REMIND_TYPE);return u.setMessage(i),this._conversationModule.request({protocolName:Bg,requestData:{userIDList:a,muteFlag:s}}).then((function(e){u.setNetworkType(t._conversationModule.getNetworkType()).end();var o=e.data,s=o.updateSequence,i=o.errorList;t._updateSequence=s;var c=[],l=[];$l(i)&&i.forEach((function(e){c.push(e.userID),l.push({userID:e.userID,code:e.errorCode})}));var d=a.filter((function(e){return-1===c.indexOf(e)}));wl.log("".concat(n," ok. successUserIDList:").concat(d," failureUserIDList:").concat(JSON.stringify(l)));var p=0;return d.forEach((function(e){t._conversationModule.patchMessageRemindType({ID:e,isC2CConversation:!0,messageRemindType:r})&&(p+=1)})),p>=1&&t._emitConversationUpdate(),a.length=c.length=0,Jv({successUserIDList:d.map((function(e){return{userID:e}})),failureUserIDList:l})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];u.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"_getModule",value:function(e){return this._conversationModule.getModule(e)}},{key:"_emitConversationUpdate",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:"setUpdateSequence",value:function(e){this._updateSequence=e}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._updateSequence=0}}]),e}(),LM=Cr("splice"),kM=k.TypeError,GM=Math.max,PM=Math.min;rn({target:"Array",proto:!0,forced:!LM},{splice:function(e,t){var n,o,r,a,s,i,u=Ne(this),c=wt(u),l=Pt(e,c),d=arguments.length;if(0===d?n=o=0:1===d?(n=0,o=c-l):(n=d-2,o=PM(GM(Lt(t),0),c-l)),c+n-o>9007199254740991)throw kM("Maximum allowed length exceeded");for(r=Zn(u,o),a=0;a<o;a++)(s=l+a)in u&&yo(r,a,u[s]);if(r.length=o,n<o){for(a=l;a<c-o;a++)i=a+n,(s=a+o)in u?u[i]=u[s]:delete u[i];for(a=c;a>c-o+n;a--)delete u[a-1]}else if(n>o)for(a=c-o;a>l;a--)i=a+n-1,(s=a+o-1)in u?u[i]=u[s]:delete u[i];for(a=0;a<n;a++)u[a+l]=arguments[a+2];return u.length=c-o+n,r}});var UM=function(){function e(t){r(this,e),this._conversationModule=t,this._className="ConvGroupHandler",this._convGroupMap=new Map,this._startIndex=0,this._pagingStatus=Fp.NOT_START}return i(e,[{key:"setConvCustomData",value:function(e){var t=this,n="".concat(this._className,".setConvCustomData"),o=e.conversationIDList,r=e.customData;wl.log("".concat(n," options:"),e);var a=new Uh(bh.SET_CONV_CUSTOM_DATA);a.setMessage(JSON.stringify(e));var s={fromAccount:this._getMyUserID(),itemList:[]},i=[],u=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(u,e),!0;if(!Ed(e)&&!Cd(e))return t._onConversationIDInvalid(u,e),!0;var n={operationType:2,contactItem:void 0,customMark:r};Ed(e)?n.contactItem={type:1,toAccount:e.replace(hr.CONV_C2C,"")}:Cd(e)&&(n.contactItem={type:2,groupID:e.replace(hr.CONV_GROUP,"")}),s.itemList.push(n)})),u.length===o.length?Jv({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:$g,requestData:s}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),wl.log("".concat(n," ok"));var o=e.data.resultItem;if($l(o)){var s,c,l=!1;o.forEach((function(e){s=t._concatConversationID(e.contactItem),0===e.resultCode?(i.push(s),(c=t._getLocalConversation(s))&&c.customData!==r&&(c.customData=r,l=!0)):u.push({conversationID:s,code:e.resultCode,message:e.resultInfo})})),!0===l&&t._emitConversationUpdate()}return Vv({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];a.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"markConversation",value:function(e){var t=this;if(!this._conversationModule.canIUse(wc.CONV_MARK))return Xv({code:Mh.CANNOT_USE_COMMERCIAL_ABILITY,message:yh.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._className,".markConversation"),o=e.conversationIDList,r=e.markType,a=e.enableMark;wl.log("".concat(n," options:"),e);var s=new Uh(bh.MARK_CONVERSATION);s.setMessage(JSON.stringify(e));var i=void 0,u=void 0,c=this._getFlagBit(r);!0===a?u=[c]:i=[c];var l={fromAccount:this._getMyUserID(),itemList:[]},d=[],p=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(p,e),!0;if(!Ed(e)&&!Cd(e))return t._onConversationIDInvalid(p,e),!0;var n={operationType:1,contactItem:void 0,clearMark:i,setMark:u};Ed(e)?n.contactItem={type:1,toAccount:e.replace(hr.CONV_C2C,"")}:Cd(e)&&(n.contactItem={type:2,groupID:e.replace(hr.CONV_GROUP,"")}),l.itemList.push(n)})),p.length===o.length?Jv({successConversationIDList:d,failureConversationIDList:p}):this._conversationModule.request({protocolName:e_,requestData:l}).then((function(e){s.setNetworkType(t._conversationModule.getNetworkType()).end(),wl.log("".concat(n," ok"));var o=e.data.resultItem;if($l(o)){var i,u,c=!1;o.forEach((function(e){if(i=t._concatConversationID(e.contactItem),0===e.resultCode){if(d.push(i),u=t._getLocalConversation(i)){var n=u.markList.indexOf(r);!0===a?-1===n&&(u.markList.push(r),c=!0):-1!==n&&(u.markList.splice(n,1),c=!0)}}else p.push({conversationID:i,code:e.resultCode,message:e.resultInfo})})),!0===c&&t._emitConversationUpdate()}return Vv({successConversationIDList:d,failureConversationIDList:p})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"getLocalConvGroupList",value:function(){var e=this;return wl.log("".concat(this._className,".getLocalConvGroupList pagingStatus:").concat(this._pagingStatus)),this._pagingStatus===Fp.REJECTED?this.getRemoteConvGroupList().then((function(){return Vv(y(e._convGroupMap.values()))})):Jv(y(this._convGroupMap.values()))}},{key:"getRemoteConvGroupList",value:function(){var e=this,t="".concat(this._className,".getRemoteConvGroupList");return this._pagingStatus=Fp.PENDING,this._conversationModule.request({protocolName:s_,requestData:{fromAccount:this._getMyUserID(),startIndex:this._startIndex}}).then((function(n){var o,r,a=n.data,s=a.completeFlag,i=a.contactItem,u=a.nextStartIndex,c=void 0===u?0:u,l=a.groupItem;if(e._startIndex=c,wl.log("".concat(t," completeFlag:").concat(s," nextStartIndex:").concat(c)),$l(l)&&l.forEach((function(t){var n=t.convGroupID,o=t.groupName;e._convGroupMap.set(n,o)})),$l(i)&&i.forEach((function(t){var n=t.standardMark,a=t.customData,s=t.convGroupIDList;if(o=e._concatConversationID(t),(r=e._getLocalConversation(o))&&(r.markList=Vd(n),r.customData=a||"",$l(s))){var i=[];s.forEach((function(t){e._convGroupMap.has(t)&&i.push(e._convGroupMap.get(t))})),r.conversationGroupList=[].concat(i),i.length=0}})),0===s)return e.getRemoteConvGroupList();1===s&&(e._pagingStatus=Fp.RESOLVED,e._emitConversationUpdate(),e._emitConvGroupListUpdate())})).catch((function(n){e._pagingStatus=Fp.REJECTED,wl.warn("".concat(t," failed. error:"),n)}))}},{key:"createConvGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(wc.CONV_GROUP))return Xv({code:Mh.CANNOT_USE_COMMERCIAL_ABILITY,message:yh.CANNOT_USE_COMMERCIAL_ABILITY});var n=new Uh(bh.CREATE_CONV_GROUP);n.setMessage(JSON.stringify(e));var o="".concat(this._className,".createConvGroup");wl.log("".concat(o," options:"),e);var r=e.groupName,a=e.conversationIDList,s={fromAccount:this._getMyUserID(),itemList:[{groupName:r,contactItem:[]}]},i=[],u=[];return a.forEach((function(e){return t._hasLocalConversation(e)?Ed(e)||Cd(e)?void(Ed(e)?s.itemList[0].contactItem.push({type:1,toAccount:e.replace(hr.CONV_C2C,"")}):Cd(e)&&s.itemList[0].contactItem.push({type:2,groupID:e.replace(hr.CONV_GROUP,"")})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===a.length?Jv({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:t_,requestData:s}).then((function(e){n.setNetworkType(t._conversationModule.getNetworkType()).end(),wl.log("".concat(o," ok"));var a=e.data.groupResultItem[0],s=a.groupItem,c=a.resultItem;if(Zl(s)&&(t._convGroupMap.set(s.convGroupID,s.groupName),t._emitConvGroupListUpdate()),$l(c)){var l,d,p=!1;c.forEach((function(e){l=t._concatConversationID(e.contactItem),0===e.resultCode?(i.push(l),(d=t._getLocalConversation(l))&&-1===d.conversationGroupList.indexOf(r)&&(d.conversationGroupList.push(r),p=!0)):u.push({conversationID:l,code:e.resultCode,message:e.resultInfo})})),!0===p&&(t._emitConversationUpdate(),t._emitConvGroupListUpdate())}return Vv({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var o=M(t,2),r=o[0],a=o[1];n.setError(e,r,a).end()})),wl.error("".concat(o," failed. error:"),e),Xv(e)}))}},{key:"deleteConvGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(wc.CONV_GROUP))return Xv({code:Mh.CANNOT_USE_COMMERCIAL_ABILITY,message:yh.CANNOT_USE_COMMERCIAL_ABILITY});var n=new Uh(bh.DELETE_CONV_GROUP);n.setMessage(e);var o="".concat(this._className,".deleteConvGroup");return wl.log("".concat(o," groupName:").concat(e)),this._conversationModule.request({protocolName:n_,requestData:{fromAccount:this._getMyUserID(),groupName:[e]}}).then((function(r){n.setNetworkType(t._conversationModule.getNetworkType()).end(),wl.log("".concat(o," ok"));var a=r.data.groupItem;if($l(a)){var s=!1;a.forEach((function(e){t._convGroupMap.has(e.convGroupID)&&(t._convGroupMap.delete(e.convGroupID),s=!0)})),!0===s&&t._emitConvGroupListUpdate()}t._eraseFromConversationGroupList([e])})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var o=M(t,2),r=o[0],a=o[1];n.setError(e,r,a).end()})),wl.error("".concat(o," failed. error:"),e),Xv(e)}))}},{key:"renameConvGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(wc.CONV_GROUP))return Xv({code:Mh.CANNOT_USE_COMMERCIAL_ABILITY,message:yh.CANNOT_USE_COMMERCIAL_ABILITY});var n=new Uh(bh.RENAME_CONV_GROUP);n.setMessage(JSON.stringify(e));var o="".concat(this._className,".renameConvGroup");wl.log("".concat(o," options:"),e);var r=e.oldName,a=e.newName;return this._conversationModule.request({protocolName:o_,requestData:{fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:1,oldName:r,newName:a}}}).then((function(e){n.setNetworkType(t._conversationModule.getNetworkType()).end(),wl.log("".concat(o," ok"));var s=e.data.updateGroupResult.convGroupID;t._convGroupMap.set(s,a),t._emitConvGroupListUpdate();var i,u,c=t._conversationModule.getLocalConversationList(),l=!1;c.forEach((function(e){i=e.conversationGroupList,-1!==(u=i.indexOf(r))&&(i.splice(u,1,a),l=!0)})),!0===l&&t._emitConversationUpdate()})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var o=M(t,2),r=o[0],a=o[1];n.setError(e,r,a).end()})),wl.error("".concat(o," failed. error:"),e),Xv(e)}))}},{key:"addConvsToGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(wc.CONV_GROUP))return Xv({code:Mh.CANNOT_USE_COMMERCIAL_ABILITY,message:yh.CANNOT_USE_COMMERCIAL_ABILITY});var n=new Uh(bh.ADD_CONVS_TO_GROUP);n.setMessage(JSON.stringify(e));var o="".concat(this._className,".addConvsToGroup");wl.log("".concat(o," options:"),e);var r=e.conversationIDList,a=e.groupName,s={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:a,updateItem:[]}},i=[],u=[];return r.forEach((function(e){return t._hasLocalConversation(e)?Ed(e)||Cd(e)?void(Ed(e)?s.updateGroup.updateItem.push({operationType:1,contactItem:{type:1,toAccount:e.replace(hr.CONV_C2C,"")}}):Cd(e)&&s.updateGroup.updateItem.push({operationType:1,contactItem:{type:2,groupID:e.replace(hr.CONV_GROUP,"")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===r.length?Jv({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:r_,requestData:s}).then((function(e){n.setNetworkType(t._conversationModule.getNetworkType()).end(),wl.log("".concat(o," ok"));var r=e.data.updateGroupResult.contactResultItem;if($l(r)){var s,c,l=!1;r.forEach((function(e){0===e.resultCode&&(s=t._concatConversationID(e.contactItem),(c=t._getLocalConversation(s))?-1===c.conversationGroupList.indexOf(a)&&(c.conversationGroupList.push(a),i.push(s),l=!0):u.push({conversationID:s,code:e.resultCode,message:e.resultInfo}))})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(a))}return Vv({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var o=M(t,2),r=o[0],a=o[1];n.setError(e,r,a).end()})),wl.error("".concat(o," failed. error:"),e),Xv(e)}))}},{key:"deleteConvsFromGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(wc.CONV_GROUP))return Xv({code:Mh.CANNOT_USE_COMMERCIAL_ABILITY,message:yh.CANNOT_USE_COMMERCIAL_ABILITY});var n=new Uh(bh.DELETE_CONVS_FROM_GROUP);n.setMessage(JSON.stringify(e));var o="".concat(this._className,".deleteConvsFromGroup");wl.log("".concat(o," options:"),e);var r=e.conversationIDList,a=e.groupName,s={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:a,updateItem:[]}},i=[],u=[];return r.forEach((function(e){return t._hasLocalConversation(e)?Ed(e)||Cd(e)?void(Ed(e)?s.updateGroup.updateItem.push({operationType:2,contactItem:{type:1,toAccount:e.replace(hr.CONV_C2C,"")}}):Cd(e)&&s.updateGroup.updateItem.push({operationType:2,contactItem:{type:2,groupID:e.replace(hr.CONV_GROUP,"")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===r.length?Jv({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:a_,requestData:s}).then((function(e){n.setNetworkType(t._conversationModule.getNetworkType()).end(),wl.log("".concat(o," ok"));var r=e.data.updateGroupResult.contactResultItem;if($l(r)){var s,c,l=!1;r.forEach((function(e){if(0===e.resultCode)if(s=t._concatConversationID(e.contactItem),c=t._getLocalConversation(s)){var n=c.conversationGroupList.indexOf(a);-1!==n&&(c.conversationGroupList.splice(n,1),i.push(s),l=!0)}else u.push({conversationID:s,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate())}return Vv({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var o=M(t,2),r=o[0],a=o[1];n.setError(e,r,a).end()})),wl.error("".concat(o," failed. error:"),e),Xv(e)}))}},{key:"onConvMarkUpdated",value:function(e){var t=this;if(!Bd(e)){var n,o,r=!1;e.forEach((function(e){if(n=t._concatConversationID(e.recentContactItem),o=t._getLocalConversation(n))if(1===e.optType){var a=Vd(e.standardMark);!0!==function(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var n=0,o=e.length;n<o;n++)if(e[n]!==t[n])return!1;return!0}(o.markList,a)&&(o.markList=a,r=!0)}else 2===e.optType&&o.customData!==e.customMark&&void 0!==e.customMark&&(o.customData=e.customMark,r=!0)})),!0===r&&this._emitConversationUpdate()}}},{key:"onConvGroupCreated",value:function(e){var t=this,n=!1,o=!1;$l(e)&&(e.forEach((function(e){var r=e.msgGroupItem,a=r.groupID,s=r.groupName;t._convGroupMap.get(a)!==s&&(t._convGroupMap.set(a,s),o=!0);var i,u,c=e.msgRecentContactItem;$l(c)&&c.forEach((function(e){i=t._concatConversationID(e),(u=t._getLocalConversation(i))&&-1===u.conversationGroupList.indexOf(s)&&(u.conversationGroupList.push(s),n=!0)}))})),!0===n&&this._emitConversationUpdate(),!0===o&&this._emitConvGroupListUpdate())}},{key:"onConvGroupDeleted",value:function(e){var t=this,n=[];if($l(e)){var o=!1;e.forEach((function(e){var r=e.groupID,a=e.groupName;t._convGroupMap.has(r)&&(t._convGroupMap.delete(r),o=!0,n.push(a))})),!0===o&&this._emitConvGroupListUpdate()}this._eraseFromConversationGroupList(n)}},{key:"_eraseFromConversationGroupList",value:function(e){Bd(e)||(this._conversationModule.getLocalConversationList().forEach((function(t){t.conversationGroupList=t.conversationGroupList.filter((function(t){return!e.includes(t)}))})),this._emitConversationUpdate())}},{key:"onConvGroupNameUpdated",value:function(e){var t=e.groupID,n=e.groupName,o=e.oldGroupName;if(this._convGroupMap.get(t)!==n){this._convGroupMap.set(t,n),this._emitConvGroupListUpdate();var r,a,s=this._conversationModule.getLocalConversationList(),i=!1;s.forEach((function(e){r=e.conversationGroupList,-1!==(a=r.indexOf(o))&&(r.splice(a,1,n),i=!0)})),!0===i&&this._emitConversationUpdate()}}},{key:"onConvInGroupUpdated",value:function(e){var t=this,n=e.oldGroupName,o=e.recentContactUpdateGroupItem;if($l(o)){var r,a,s=!1;o.forEach((function(e){var o=e.contactOptType;if(r=t._concatConversationID(e.recentContactItem),a=t._getLocalConversation(r))if(1===o)-1===a.conversationGroupList.indexOf(n)&&(a.conversationGroupList.push(n),s=!0);else if(2===o){var i=a.conversationGroupList.indexOf(n);-1!==i&&(a.conversationGroupList.splice(i,1),s=!0)}})),!0===s&&(this._emitConversationUpdate(),this._emitConvInGroupUpdate(n))}}},{key:"onConvGroupListSynced",value:function(e){var t=this;$l(e)&&0!==e.length&&(wl.log("".concat(this._className,".onConvGroupListSynced count:").concat(e.length)),e.forEach((function(e){t._convGroupMap.set(e.convGroupID,e.groupName)})))}},{key:"getConvGroupListByID",value:function(e){var t=this;if(!Bd(e)){var n=[];return e.forEach((function(e){t._convGroupMap.has(e)&&n.push(t._convGroupMap.get(e))})),n}}},{key:"_onConversationNotFound",value:function(e,t){e.push({conversationID:t,code:Mh.CONVERSATION_NOT_FOUND,message:yh.CONVERSATION_NOT_FOUND})}},{key:"_onConversationIDInvalid",value:function(e,t){e.push({conversationID:t,code:Mh.INVALID_CONVERSATION_ID,message:yh.INVALID_CONVERSATION_ID})}},{key:"_getFlagBit",value:function(e){for(var t=e.toString(2),n=t.length,o=n-1;o>=0;o--)if("1"===t[o])return n-o-1}},{key:"_concatConversationID",value:function(e){var t,n=e.type,o=e.to,r=e.groupID,a=e.userID;return 1===n?ed(a)?ed(o)||(t="".concat(hr.CONV_C2C).concat(o)):t="".concat(hr.CONV_C2C).concat(a):2===n&&(t="".concat(hr.CONV_GROUP).concat(r)),t}},{key:"_getMyUserID",value:function(){return this._conversationModule.getMyUserID()}},{key:"_insertConversationGroup",value:function(e,t){var n=this._getLocalConversation(e);if(n){var o=n.conversationGroupList;-1===o.indexOf(t)&&o.push(t)}}},{key:"_getLocalConversation",value:function(e){return this._conversationModule.getLocalConversation(e)}},{key:"_hasLocalConversation",value:function(e){return this._conversationModule.hasLocalConversation(e)}},{key:"_emitConversationUpdate",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:"_emitConvGroupListUpdate",value:function(){this._conversationModule.emitOuterEvent(_r.CONVERSATION_GROUP_LIST_UPDATED,y(this._convGroupMap.values()))}},{key:"_emitConvInGroupUpdate",value:function(e){var t={groupName:e,conversationList:[]},n=this._conversationModule.getLocalConversationList();t.conversationList=n.filter((function(t){return t.conversationGroupList.includes(e)})),this._conversationModule.emitOuterEvent(_r.CONVERSATION_IN_GROUP_UPDATED,t)}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._convGroupMap.clear(),this._startIndex=0,this._pagingStatus=Fp.NOT_START}}]),e}(),bM=function(e){c(o,e);var n=v(o);function o(e){var t;return r(this,o),(t=n.call(this,e))._className="ConversationModule",fM.mixin(f(t)),t._messageListHandler=new pM,t._messageRemindHandler=new RM(f(t)),t._convGroupHandler=new UM(f(t)),t.singlyLinkedList=new SM(100),t._pagingStatus=Fp.NOT_START,t._pagingTimeStamp=0,t._pagingStartIndex=0,t._pagingPinnedTimeStamp=0,t._pagingPinnedStartIndex=0,t._conversationMap=new Map,t._tmpGroupList=[],t._tmpGroupAtTipsList=[],t._peerReadTimeMap=new Map,t._completedMap=new Map,t._roamingMessageKeyAndTimeMap=new Map,t._roamingMessageSequenceMap=new Map,t._remoteGroupReadSequenceMap=new Map,t._initListeners(),t}return i(o,[{key:"_initListeners",value:function(){var e=this.getInnerEmitterInstance();e.on(gM,this._initLocalConversationList,this),e.on(hM,this._onProfileUpdated,this)}},{key:"onCheckTimer",value:function(e){e%60==0&&this._messageListHandler.traversal()}},{key:"_initLocalConversationList",value:function(){var e=this,t=new Uh(bh.GET_CONVERSATION_LIST_IN_STORAGE);wl.log("".concat(this._className,"._initLocalConversationList."));var n="",o=this._getStorageConversationList();if(o){for(var r=o.length,a=0;a<r;a++){var s=o[a];if(s){if(s.conversationID==="".concat(hr.CONV_C2C,"@TLS#ERROR")||s.conversationID==="".concat(hr.CONV_C2C,"@TLS#NOT_FOUND"))continue;if(s.groupProfile){var i=s.groupProfile.type;if(yd(i))continue}}this._conversationMap.set(o[a].conversationID,new OM(o[a]))}this.emitConversationUpdate(!0,!1),n="count:".concat(r)}else n="count:0";t.setNetworkType(this.getNetworkType()).setMessage(n).end(),this.getModule(og)||this.triggerReady(),this.ready((function(){e._tmpGroupList.length>0&&(e.updateConversationGroupProfile(e._tmpGroupList),e._tmpGroupList.length=0)})),this.syncConversationList()}},{key:"onMessageSent",value:function(e){this._onSendOrReceiveMessage({conversationOptionsList:e.conversationOptionsList,isInstantMessage:!0})}},{key:"onNewMessage",value:function(e){this._onSendOrReceiveMessage(e)}},{key:"_onSendOrReceiveMessage",value:function(e){var t=this,n=e.conversationOptionsList,o=e.isInstantMessage,r=void 0===o||o,a=e.isUnreadC2CMessage,s=void 0!==a&&a;this._isReady?0!==n.length&&(this._getC2CPeerReadTime(n),this._updateLocalConversationList({conversationOptionsList:n,isInstantMessage:r,isUnreadC2CMessage:s,isFromGetConversations:!1}),this._setStorageConversationList(),n.filter((function(e){return e.type===hr.CONV_TOPIC})).length>0||this.emitConversationUpdate()):this.ready((function(){t._onSendOrReceiveMessage(e)}))}},{key:"updateConversationGroupProfile",value:function(e){var t=this;if(!$l(e)||0!==e.length)if(0!==this._conversationMap.size){var n=!1;e.forEach((function(e){var o="GROUP".concat(e.groupID);if(t._conversationMap.has(o)){n=!0;var r=t._conversationMap.get(o);r.groupProfile=JSON.parse(JSON.stringify(e)),r.lastMessage.lastSequence<e.nextMessageSeq&&(r.lastMessage.lastSequence=e.nextMessageSeq-1),r.subType||(r.subType=e.type)}})),n&&this.emitConversationUpdate(!0,!1)}else this._tmpGroupList=e}},{key:"_updateConversationUserProfile",value:function(e){var t=this;e.data.forEach((function(e){var n="C2C".concat(e.userID);t._conversationMap.has(n)&&(t._conversationMap.get(n).userProfile=e)})),this.emitConversationUpdate(!0,!1)}},{key:"onMessageRevoked",value:function(e){var t=this;if(0!==e.length){var n=null,o=!1,r=[];e.forEach((function(e){(n=t._conversationMap.get(e.conversationID))&&(n.type===hr.CONV_TOPIC?r.push(e):(n.reduceUnreadCount()&&(o=!0),n.isLastMessageRevoked(e)&&(n.setLastMessageRevoked(!0),o=!0)))})),this.getModule(ig).onMessageRevoked(r),o&&this.emitConversationUpdate(!0,!1)}}},{key:"onMessageDeleted",value:function(e){var t=this;if(0!==e.length){var n=null;e.forEach((function(e){(n=t._messageListHandler.getLocalMessage(e.conversationID,e.ID))&&(n.isDeleted=!0),e!==n&&(e.isDeleted=!0)}));for(var o=e[0].conversationID,r=this._messageListHandler.getLocalMessageList(o),a={},s=r.length-1;s>=0;s--)if(!r[s].isDeleted){a=r[s];break}var i=this._conversationMap.get(o);if(i){var u=!1;i.lastMessage.lastSequence===a.sequence&&i.lastMessage.lastTime===a.time||(Bd(a)&&(a=void 0),i.updateLastMessage(a),i.type!==hr.CONV_TOPIC&&(u=!0),wl.log("".concat(this._className,".onMessageDeleted. update conversationID:").concat(o," with lastMessage:"),i.lastMessage)),o.startsWith(hr.CONV_C2C)&&this.updateUnreadCount(o),u&&this.emitConversationUpdate(!0,!1)}}}},{key:"onMessageModified",value:function(e){var t=e.conversationType,n=e.from,o=e.to,r=e.time,a=e.sequence,s=e.elements,i=e.cloudCustomData,u=e.messageVersion,c=this.getMyUserID(),l="".concat(t).concat(o);o===c&&t===hr.CONV_C2C&&(l="".concat(t).concat(n));var d=this._messageListHandler.onMessageModified(l,e),p=d.isUpdated,g=d.message;!0===p&&this.emitOuterEvent(_r.MESSAGE_MODIFIED,[g]);var _=this._isTopicConversation(l);if(wl.log("".concat(this._className,".onMessageModified isUpdated:").concat(p," isTopicMessage:").concat(_," from:").concat(n," to:").concat(o)),_)this.getModule(ig).onMessageModified(e);else{var h=this._conversationMap.get(l);if(h){var f=h.lastMessage;wl.debug("".concat(this._className.onMessageModified," lastMessage:"),JSON.stringify(f),"options:",JSON.stringify(e)),f&&f.lastTime===r&&f.lastSequence===a&&f.version!==u&&(f.type=s[0].type,f.payload=s[0].content,f.messageForShow=Fd(f.type,f.payload),f.cloudCustomData=i,f.version=u,this.emitConversationUpdate(!0,!1))}}return g}},{key:"onNewGroupAtTips",value:function(e){var n=this,o=e.dataList,r=null;o.forEach((function(e){e.groupAtTips?r=e.groupAtTips:e.elements?r=t(t({},e.elements),{},{sync:!0}):e.groupAtType&&(r=t(t({},e),{},{sync:!0})),r.__random=e.random,r.__sequence=e.clientSequence,n._tmpGroupAtTipsList.push(r)})),wl.debug("".concat(this._className,".onNewGroupAtTips isReady:").concat(this._isReady),this._tmpGroupAtTipsList),this._isReady&&this._handleGroupAtTipsList()}},{key:"_handleGroupAtTipsList",value:function(){var e=this;if(0!==this._tmpGroupAtTipsList.length){var t=!1;this._tmpGroupAtTipsList.forEach((function(n){var o=n.groupID,r=n.from,a=n.topicID,s=void 0===a?void 0:a,i=n.sync,u=void 0!==i&&i;if(r!==e.getMyUserID())if(ed(s)){var c=e._conversationMap.get("".concat(hr.CONV_GROUP).concat(o));c&&(c.updateGroupAtInfoList(n),t=!0)}else{var l=e._conversationMap.get("".concat(hr.CONV_GROUP).concat(s));if(l){l.updateGroupAtInfoList(n);var d=e.getModule(ig),p=l.groupAtInfoList;d.onConversationProxy({topicID:s,groupAtInfoList:p})}Bd(l)&&u&&(e.updateTopicConversation([{conversationID:"".concat(hr.CONV_GROUP).concat(s),type:hr.CONV_TOPIC}]),e._conversationMap.get("".concat(hr.CONV_GROUP).concat(s)).updateGroupAtInfoList(n))}})),t&&this.emitConversationUpdate(!0,!1),this._tmpGroupAtTipsList.length=0}}},{key:"_getC2CPeerReadTime",value:function(e){var t=this,n=[];if(e.forEach((function(e){t._conversationMap.has(e.conversationID)||e.type!==hr.CONV_C2C||n.push(e.conversationID.replace(hr.CONV_C2C,""))})),n.length>0){wl.debug("".concat(this._className,"._getC2CPeerReadTime userIDList:").concat(n));var o=this.getModule(og);o&&o.getRemotePeerReadTime(n)}}},{key:"_getStorageConversationList",value:function(){return this.getModule(lg).getItem("conversationMap")}},{key:"_setStorageConversationList",value:function(){var e=this.getLocalConversationList().slice(0,20).map((function(e){return{conversationID:e.conversationID,type:e.type,subType:e.subType,lastMessage:e.lastMessage,groupProfile:e.groupProfile,userProfile:e.userProfile}}));this.getModule(lg).setItem("conversationMap",e)}},{key:"emitConversationUpdate",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversationList();if(t){var o=this.getModule(rg);o&&o.updateGroupLastMessage(n)}e&&this.emitOuterEvent(_r.CONVERSATION_LIST_UPDATED)}},{key:"getLocalConversationList",value:function(){return y(this._conversationMap.values()).filter((function(e){return e.type!==hr.CONV_TOPIC}))}},{key:"getLocalConversation",value:function(e){return this._conversationMap.get(e)}},{key:"hasLocalConversation",value:function(e){return this._conversationMap.has(e)}},{key:"getLocalOldestMessage",value:function(e){return this._messageListHandler.getLocalOldestMessage(e)}},{key:"syncConversationList",value:function(){var e=this,t=new Uh(bh.SYNC_CONVERSATION_LIST);return this._pagingStatus===Fp.NOT_START&&this._conversationMap.clear(),this._pagingGetConversationList().then((function(n){return e._pagingStatus=Fp.RESOLVED,e._setStorageConversationList(),e._handleC2CPeerReadTime(),e._patchConversationProperties(),t.setMessage(e._conversationMap.size).setNetworkType(e.getNetworkType()).end(),n})).catch((function(n){return e._pagingStatus=Fp.REJECTED,t.setMessage(e._pagingTimeStamp),e.probeNetwork().then((function(e){var o=M(e,2),r=o[0],a=o[1];t.setError(n,r,a).end()})),Xv(n)}))}},{key:"_patchConversationProperties",value:function(){var e=this,t=Date.now(),n=this.checkAndPatchRemark(),o=this._messageRemindHandler.getC2CMessageRemindType(),r=this.getModule(rg).getGroupList();Promise.all([n,o,r]).then((function(){var n=Date.now()-t;wl.log("".concat(e._className,"._patchConversationProperties ok. cost ").concat(n," ms")),e.emitConversationUpdate(!0,!1)}))}},{key:"_pagingGetConversationList",value:function(){var e=this,t="".concat(this._className,"._pagingGetConversationList");return wl.log("".concat(t," timeStamp:").concat(this._pagingTimeStamp," startIndex:").concat(this._pagingStartIndex)+" pinnedTimeStamp:".concat(this._pagingPinnedTimeStamp," pinnedStartIndex:").concat(this._pagingPinnedStartIndex)),this._pagingStatus=Fp.PENDING,this.request({protocolName:zg,requestData:{fromAccount:this.getMyUserID(),timeStamp:this._pagingTimeStamp,startIndex:this._pagingStartIndex,pinnedTimeStamp:this._pagingPinnedTimeStamp,pinnedStartIndex:this._pagingStartIndex,orderType:1}}).then((function(n){var o=n.data,r=o.completeFlag,a=o.conversations,s=void 0===a?[]:a,i=o.timeStamp,u=o.startIndex,c=o.pinnedTimeStamp,l=o.pinnedStartIndex,d=o.groupItem;if(wl.log("".concat(t," ok. completeFlag:").concat(r," count:").concat(s.length," isReady:").concat(e._isReady)),e._convGroupHandler.onConvGroupListSynced(d),s.length>0){var p=e._getConversationOptions(s);e._updateLocalConversationList({conversationOptionsList:p,isFromGetConversations:!0}),e.isLoggedIn()&&e.emitConversationUpdate()}if(!e._isReady){if(!e.isLoggedIn())return Jv();e.triggerReady()}return e._pagingTimeStamp=i,e._pagingStartIndex=u,e._pagingPinnedTimeStamp=c,e._pagingPinnedStartIndex=l,1!==r?e._pagingGetConversationList():(e._handleGroupAtTipsList(),e._convGroupHandler.getRemoteConvGroupList(),Jv())})).catch((function(n){throw e.isLoggedIn()&&(e._isReady||(wl.warn("".concat(t," failed. error:"),n),e.triggerReady())),n}))}},{key:"_updateLocalConversationList",value:function(e){var t,n=e.isFromGetConversations,o=Date.now();t=this._getTmpConversationListMapping(e),this._conversationMap=new Map(this._sortConversationList([].concat(y(t.toBeUpdatedConversationList),y(this._conversationMap)))),n||this._updateUserOrGroupProfile(t.newConversationList),wl.debug("".concat(this._className,"._updateLocalConversationList cost ").concat(Date.now()-o," ms"))}},{key:"_getTmpConversationListMapping",value:function(e){for(var t=e.conversationOptionsList,n=e.isFromGetConversations,o=e.isInstantMessage,r=e.isUnreadC2CMessage,a=void 0!==r&&r,s=[],i=[],u=this.getModule(rg),c=this.getModule(ag),l=0,d=t.length;l<d;l++){var p=new OM(t[l]),g=p.conversationID;if(g!=="".concat(hr.CONV_C2C,"@TLS#ERROR")&&g!=="".concat(hr.CONV_C2C,"@TLS#NOT_FOUND"))if(this._conversationMap.has(g)){var _=this._conversationMap.get(g),h=["unreadCount","allowType","adminForbidType","payload","isPinned"];!1===o&&h.push("lastMessage");var f=t[l].lastMessage,m=!ed(f);m||t[l].type===hr.CONV_TOPIC||this._onLastMessageNotExist(t[l]),ed(o)&&m&&null===_.lastMessage.payload&&(_.lastMessage.payload=f.payload),ud(_,p,h,[null,void 0,"",0,NaN]),_.updateUnreadCount({nextUnreadCount:p.unreadCount,isFromGetConversations:n,isUnreadC2CMessage:a}),o&&m&&(f.payload&&(_.lastMessage.payload=f.payload),_.type===hr.CONV_GROUP&&(_.lastMessage.nameCard=f.nameCard,_.lastMessage.nick=f.nick)),m&&_.lastMessage.cloudCustomData!==f.cloudCustomData&&(_.lastMessage.cloudCustomData=f.cloudCustomData||""),this._conversationMap.delete(g),s.push([g,_])}else{if(p.type===hr.CONV_GROUP&&u){var v=p.groupProfile.groupID,M=u.getLocalGroupProfile(v);M&&(p.groupProfile=M,p.updateUnreadCount({nextUnreadCount:0}))}else if(p.type===hr.CONV_C2C){var y=g.replace(hr.CONV_C2C,"");c&&c.isMyFriend(y)&&(p.remark=c.getFriendRemark(y))}i.push(p),s.push([g,p])}}var I=this.getModule(ig);return s.forEach((function(e){if(e[1].type===hr.CONV_TOPIC){var t=e[1],n=t.conversationID,o=t.unreadCount,r=t.groupAtInfoList;I.onConversationProxy({topicID:n.replace(hr.CONV_GROUP,""),unreadCount:o,groupAtInfoList:Bd(r)?void 0:r})}})),{toBeUpdatedConversationList:s,newConversationList:i}}},{key:"_onLastMessageNotExist",value:function(e){new Uh(bh.LAST_MESSAGE_NOT_EXIST).setMessage("".concat(JSON.stringify(e))).setNetworkType(this.getNetworkType()).end()}},{key:"_sortConversationList",value:function(e){var t=[],n=[];return e.forEach((function(e){!0===e[1].isPinned?t.push(e):n.push(e)})),t.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime})).concat(n.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime})))}},{key:"_sortConversationListAndEmitEvent",value:function(){this._conversationMap=new Map(this._sortConversationList(y(this._conversationMap))),this.emitConversationUpdate(!0,!1)}},{key:"_updateUserOrGroupProfile",value:function(e){var t=this;if(0!==e.length){var n=[],o=[],r=this.getModule(ng),a=this.getModule(rg);e.forEach((function(e){if(e.type===hr.CONV_C2C)n.push(e.toAccount);else if(e.type===hr.CONV_GROUP){var t=e.toAccount;a.hasLocalGroup(t)?e.groupProfile=a.getLocalGroupProfile(t):o.push(t)}})),wl.log("".concat(this._className,"._updateUserOrGroupProfile c2cUserIDList:").concat(n," groupIDList:").concat(o)),n.length>0&&r.getUserProfile({userIDList:n}).then((function(e){var n=e.data;$l(n)?n.forEach((function(e){t._conversationMap.get("C2C".concat(e.userID)).userProfile=e})):t._conversationMap.get("C2C".concat(n.userID)).userProfile=n})),o.length>0&&a.getGroupProfileAdvance({groupIDList:o,responseFilter:{groupBaseInfoFilter:["Type","Name","FaceUrl"]}}).then((function(e){e.data.successGroupList.forEach((function(e){var n="GROUP".concat(e.groupID);if(t._conversationMap.has(n)){var o=t._conversationMap.get(n);ud(o.groupProfile,e,[],[null,void 0,"",0,NaN]),!o.subType&&e.type&&(o.subType=e.type)}}))}))}}},{key:"_getConversationOptions",value:function(e){var n=this,o=[],r=e.filter((function(e){var t=e.lastMsg;return Zl(t)})).filter((function(e){var t=e.type,n=e.userID;return 1===t&&"@TLS#NOT_FOUND"!==n&&"@TLS#ERROR"!==n||2===t})),a=this.getMyUserID(),s=r.map((function(e){if(1===e.type){var r={userID:e.userID,nick:e.peerNick,avatar:e.peerAvatar};return o.push(r),{conversationID:"C2C".concat(e.userID),type:"C2C",lastMessage:{lastTime:e.time,lastSequence:e.sequence,fromAccount:e.lastC2CMsgFromAccount,messageForShow:e.messageShow,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:null,payload:e.lastMsg.elements[0]?e.lastMsg.elements[0].content:null,cloudCustomData:e.lastMsg.cloudCustomData||"",isRevoked:8===e.lastMessageFlag,onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:e.lastC2CMsgFromAccount===a&&e.time<=e.c2cPeerReadTime},userProfile:new EM(r),peerReadTime:e.c2cPeerReadTime,isPinned:1===e.isPinned,messageRemindType:"",customData:e.customMark||"",markList:Vd(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId)}}return{conversationID:"GROUP".concat(e.groupID),type:"GROUP",lastMessage:t(t({lastTime:e.time,lastSequence:e.messageReadSeq+e.unreadCount,fromAccount:e.msgGroupFromAccount,messageForShow:e.messageShow},n._patchTypeAndPayload(e)),{},{cloudCustomData:e.lastMsg.cloudCustomData||"",isRevoked:2===e.lastMessageFlag,onlineOnlyFlag:!1,nick:e.senderNick||"",nameCard:e.senderNameCard||""}),groupProfile:new DM({groupID:e.groupID,name:e.groupNick,avatar:e.groupImage}),unreadCount:e.unreadCount,peerReadTime:0,isPinned:1===e.isPinned,messageRemindType:"",version:0,customData:e.customMark||"",markList:Vd(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId)}}));return o.length>0&&this.getModule(ng).onConversationsProfileUpdated(o),s}},{key:"_patchTypeAndPayload",value:function(e){var n=e.lastMsg,o=n.event,r=void 0===o?void 0:o,a=n.elements,s=void 0===a?[]:a,i=n.groupTips,u=void 0===i?{}:i;if(!ed(r)&&!Bd(u)){var c=new qv(u);c.setElement({type:hr.MSG_GRP_TIP,content:t(t({},u.elements),{},{groupProfile:u.groupProfile})});var l=JSON.parse(JSON.stringify(c.payload));return c=null,{type:hr.MSG_GRP_TIP,payload:l}}return{type:s[0]?s[0].type:null,payload:s[0]?s[0].content:null}}},{key:"getLocalMessageList",value:function(e){return this._messageListHandler.getLocalMessageList(e)}},{key:"deleteLocalMessage",value:function(e){e instanceof qv&&this._messageListHandler.remove(e)}},{key:"onConversationDeleted",value:function(e){var t=this;wl.log("".concat(this._className,".onConversationDeleted")),$l(e)&&e.forEach((function(e){var n=e.type,o=e.userID,r=e.groupID,a="";1===n?a="".concat(hr.CONV_C2C).concat(o):2===n&&(a="".concat(hr.CONV_GROUP).concat(r)),t.deleteLocalConversation(a)}))}},{key:"onConversationPinned",value:function(e){var t=this;if($l(e)){var n=!1;e.forEach((function(e){var o,r=e.type,a=e.userID,s=e.groupID;1===r?o=t.getLocalConversation("".concat(hr.CONV_C2C).concat(a)):2===r&&(o=t.getLocalConversation("".concat(hr.CONV_GROUP).concat(s))),o&&(wl.log("".concat(t._className,".onConversationPinned conversationID:").concat(o.conversationID," isPinned:").concat(o.isPinned)),o.isPinned||(o.isPinned=!0,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:"onConversationUnpinned",value:function(e){var t=this;if($l(e)){var n=!1;e.forEach((function(e){var o,r=e.type,a=e.userID,s=e.groupID;1===r?o=t.getLocalConversation("".concat(hr.CONV_C2C).concat(a)):2===r&&(o=t.getLocalConversation("".concat(hr.CONV_GROUP).concat(s))),o&&(wl.log("".concat(t._className,".onConversationUnpinned conversationID:").concat(o.conversationID," isPinned:").concat(o.isPinned)),o.isPinned&&(o.isPinned=!1,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:"getMessageList",value:function(e){var t=this,n=e.conversationID,o=e.nextReqMessageID,r=e.count,a="".concat(this._className,".getMessageList"),s=this.getLocalConversation(n),i="";if(s&&s.groupProfile&&(i=s.groupProfile.type),yd(i))return wl.log("".concat(a," not available in avchatroom. conversationID:").concat(n)),Jv({messageList:[],nextReqMessageID:"",isCompleted:!0});(ed(r)||r>15)&&(r=15),!o&&this._isNotInCommunity(n)&&(this._messageListHandler.removeByConversationID(n),this._completedMap.delete(n),this._roamingMessageSequenceMap.delete(n));var u=this._computeRemainingCount({conversationID:n,nextReqMessageID:o}),c=this._completedMap.has(n);if(wl.log("".concat(a," conversationID:").concat(n," nextReqMessageID:").concat(o)+" remainingCount:".concat(u," count:").concat(r," isCompleted:").concat(c)),this._needGetHistory({conversationID:n,remainingCount:u,count:r}))return this.getHistoryMessages({conversationID:n,nextReqMessageID:o,count:20}).then((function(e){var o=e.nextReqID,r=e.storedMessageList,s=t._completedMap.has(n),i=r;u>0&&(i=t._messageListHandler.getLocalMessageList(n).slice(0,r.length+u));var c={nextReqMessageID:s?"":o,messageList:i,isCompleted:s};return wl.log("".concat(a," ret.nextReqMessageID:").concat(c.nextReqMessageID," ret.isCompleted:").concat(c.isCompleted," ret.length:").concat(i.length)),Vv(c)}));this.modifyMessageList(n);var l=this._getMessageListFromMemory({conversationID:n,nextReqMessageID:o,count:r});return Jv(l)}},{key:"_getMessageListFromMemory",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=e.count,r="".concat(this._className,"._getMessageListFromMemory"),a=this._messageListHandler.getLocalMessageList(t),s=a.length,i=0,u={isCompleted:!1,nextReqMessageID:"",messageList:[]};return n?(i=a.findIndex((function(e){return e.ID===n})))>o?(u.messageList=a.slice(i-o,i),u.nextReqMessageID=a[i-o].ID):(u.messageList=a.slice(0,i),u.isCompleted=!0):s>o?(i=s-o,u.messageList=a.slice(i,s),u.nextReqMessageID=a[i].ID):(u.messageList=a.slice(0,s),u.isCompleted=!0),wl.log("".concat(r," conversationID:").concat(t)+" ret.nextReqMessageID:".concat(u.nextReqMessageID," ret.isCompleted:").concat(u.isCompleted," ret.length:").concat(u.messageList.length)),u}},{key:"getMessageListHopping",value:function(e){var t=e.conversationID,n=e.sequence,o=e.time,r=e.count,a=e.direction,s=void 0===a?0:a;if((ed(r)||r>15)&&(r=15),t.startsWith(hr.CONV_C2C)){var i=this.getModule(og),u=t.replace(hr.CONV_C2C,"");return i.getRoamingMessagesHopping({peerAccount:u,time:o,count:r,direction:s})}if(t.startsWith(hr.CONV_GROUP)){var c=this.getModule(rg),l=t.replace(hr.CONV_GROUP,"");return c.getRoamingMessagesHopping({groupID:l,sequence:n,count:r,direction:s})}}},{key:"_computeRemainingCount",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=this._messageListHandler.getLocalMessageList(t),r=o.length;if(!n)return r;var a=0;return Ed(t)?a=o.findIndex((function(e){return e.ID===n})):Cd(t)&&(a=-1!==n.indexOf("-")?o.findIndex((function(e){return e.ID===n})):o.findIndex((function(e){return e.sequence===n}))),-1===a&&(a=0),a}},{key:"_getMessageListSize",value:function(e){return this._messageListHandler.getLocalMessageList(e).length}},{key:"_needGetHistory",value:function(e){var t=e.conversationID,n=e.remainingCount,o=e.count,r=this.getLocalConversation(t),a="";return r&&r.groupProfile&&(a=r.groupProfile.type),!Sd(t)&&!yd(a)&&!(Cd(t)&&this._isPagingGetGroupListCompleted()&&!this._hasLocalGroup(t)&&!this._isTopicConversation(t))&&n<=o&&!this._completedMap.has(t)}},{key:"_isTopicConversation",value:function(e){var t=e.replace(hr.CONV_GROUP,"");return Td(t)}},{key:"getHistoryMessages",value:function(e){var t=e.conversationID,n=e.count;if(t===hr.CONV_SYSTEM)return Jv();var o=15;n>20&&(o=20);var r=null;if(Ed(t)){var a=this._roamingMessageKeyAndTimeMap.has(t);return(r=this.getModule(og))?r.getRoamingMessage({conversationID:t,peerAccount:t.replace(hr.CONV_C2C,""),count:o,lastMessageTime:a?this._roamingMessageKeyAndTimeMap.get(t).lastMessageTime:0,messageKey:a?this._roamingMessageKeyAndTimeMap.get(t).messageKey:""}):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}if(Cd(t)){if(!(r=this.getModule(rg)))return Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE});var s=null;this._conversationMap.has(t)&&(s=this._conversationMap.get(t).lastMessage);var i=0;s&&(i=s.lastSequence);var u=this._roamingMessageSequenceMap.get(t);return r.getRoamingMessage({conversationID:t,groupID:t.replace(hr.CONV_GROUP,""),count:o,sequence:u||i})}return Jv()}},{key:"patchConversationLastMessage",value:function(e){var t=this.getLocalConversation(e);if(t){var n=t.lastMessage,o=n.messageForShow,r=n.payload;if(Bd(o)||Bd(r)){var a=this._messageListHandler.getLocalMessageList(e);if(0===a.length)return;var s=a[a.length-1];wl.log("".concat(this._className,".patchConversationLastMessage conversationID:").concat(e," payload:"),s.payload),t.updateLastMessage(s)}}}},{key:"onRoamingMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=n.startsWith(hr.CONV_C2C)?hr.CONV_C2C:hr.CONV_GROUP,a=null,s=[],i=[],u=0,c=e.length,l=null,d=r===hr.CONV_GROUP,p=this.getModule(gg),g=function(){u=d?e.length-1:0,c=d?0:e.length},_=function(){d?--u:++u},h=function(){return d?u>=c:u<c};for(g();h();_())if(d&&1===e[u].sequence&&o&&this.setCompleted(n),1!==e[u].isPlaceMessage)if((a=new qv(e[u])).to=e[u].to,r!==hr.CONV_GROUP||ed(e[u].topicID)||(a.to=e[u].topicID),a.isSystemMessage=!!e[u].isSystemMessage,a.conversationType=r,4===e[u].event?l={type:hr.MSG_GRP_TIP,content:t(t({},e[u].elements),{},{groupProfile:e[u].groupProfile})}:(e[u].elements=p.parseElements(e[u].elements,e[u].from),l=e[u].elements),d||a.setNickAndAvatar({nick:e[u].nick,avatar:e[u].avatar}),Bd(l)){var f=new Uh(bh.EMPTY_MESSAGE_BODY);f.setMessage("from:".concat(a.from," to:").concat(a.to," sequence:").concat(a.sequence," event:").concat(e[u].event)),f.setNetworkType(this.getNetworkType()).setLevel("warning").end()}else a.setElement(l),a.reInitialize(this.getMyUserID()),s.push(a);return g=_=h=null,o?(this._messageListHandler.unshift(s,i),s=null,i):(i=null,s)}},{key:"findMessage",value:function(e){return this._messageListHandler.findMessage(e)}},{key:"_isNotInCommunity",value:function(e){var t=!1;if(e.startsWith(hr.CONV_GROUP)&&this._isTopicConversation(e)){var n=wd(e.replace(hr.CONV_GROUP,""));this.getModule(rg).hasLocalGroup(n)||(t=!0)}return t}},{key:"deleteTopicRoamingMessageInfo",value:function(e){var t=this;Id({groupID:e})&&this._messageListHandler.getTopicConversationIDList(e).forEach((function(e){t._messageListHandler.removeByConversationID(e),t._completedMap.delete(e),t._roamingMessageSequenceMap.delete(e)}))}},{key:"deleteGroupRomaingMessageInfo",value:function(e){var t="".concat(hr.CONV_GROUP).concat(e);this._messageListHandler.removeByConversationID(t),this._completedMap.delete(t),this._roamingMessageSequenceMap.delete(t)}},{key:"setMessageRead",value:function(e){var t=e.conversationID,n=this.getLocalConversation(t);if(wl.log("".concat(this._className,".setMessageRead conversationID:").concat(t," unreadCount:").concat(n?n.unreadCount:0)),!n)return Jv();if(n.type!==hr.CONV_GROUP&&n.type!==hr.CONV_TOPIC||Bd(n.groupAtInfoList)||this.deleteGroupAtTips(t),0===n.unreadCount)return Jv();if(n.type===hr.CONV_GROUP&&!this._hasLocalGroup(t))return 0!==n.unreadCount&&(n.unreadCount=0,this.emitConversationUpdate(!0,!1)),Jv();var o=this._messageListHandler.getLocalLastMessage(t),r=n.lastMessage.lastTime;o&&r<o.time&&(r=o.time);var a=n.lastMessage.lastSequence;if(o&&a<o.sequence&&(a=o.sequence),n.type===hr.CONV_TOPIC&&ed(o)){var s=this.getModule(ig),i=t.replace(hr.CONV_GROUP,""),u=wd(i),c=s.getLocalTopic(u,i);c&&(a=c.nextMessageSeq-1)}var l=null;switch(n.type){case hr.CONV_C2C:return(l=this.getModule(og))?l.setMessageRead({conversationID:t,lastMessageTime:r}):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE});case hr.CONV_GROUP:case hr.CONV_TOPIC:return(l=this.getModule(rg))?l.setMessageRead({conversationID:t,lastMessageSeq:a}):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE});case hr.CONV_SYSTEM:return n.unreadCount=0,this.emitConversationUpdate(!0,!1),Jv();default:return Jv()}}},{key:"setAllMessageRead",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="".concat(this._className,".setAllMessageRead");t.scope||(t.scope=hr.READ_ALL_MSG),wl.log("".concat(n," options:"),t);var o=this._createSetAllMessageReadPack(t);if(0===o.readAllC2CMessage&&0===o.groupMessageReadInfoList.length)return Jv();var r=new Uh(bh.SET_ALL_MESSAGE_READ);return this.request({protocolName:I_,requestData:o}).then((function(n){var o=n.data,a=e._handleAllMessageRead(o);return r.setMessage("scope:".concat(t.scope," failureGroups:").concat(JSON.stringify(a))).setNetworkType(e.getNetworkType()).end(),Jv()})).catch((function(t){return e.probeNetwork().then((function(e){var n=M(e,2),o=n[0],a=n[1];r.setError(t,o,a).end()})),wl.warn("".concat(n," failed. error:"),t),Xv({code:t&&t.code?t.code:Mh.MESSAGE_UNREAD_ALL_FAIL,message:t&&t.message?t.message:yh.MESSAGE_UNREAD_ALL_FAIL})}))}},{key:"setConversationCustomData",value:function(e){return this._convGroupHandler.setConvCustomData(e)}},{key:"markConversation",value:function(e){return this._convGroupHandler.markConversation(e)}},{key:"getConversationGroupList",value:function(){return this._convGroupHandler.getLocalConvGroupList()}},{key:"createConversationGroup",value:function(e){return this._convGroupHandler.createConvGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._convGroupHandler.deleteConvGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._convGroupHandler.renameConvGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._convGroupHandler.addConvsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._convGroupHandler.deleteConvsFromGroup(e)}},{key:"onConversationMarkUpdated",value:function(e){this._convGroupHandler.onConvMarkUpdated(e)}},{key:"onConversationGroupCreated",value:function(e){this._convGroupHandler.onConvGroupCreated(e)}},{key:"onConversationGroupDeleted",value:function(e){this._convGroupHandler.onConvGroupDeleted(e)}},{key:"onConversationGroupNameUpdated",value:function(e){this._convGroupHandler.onConvGroupNameUpdated(e)}},{key:"onConversationInGroupUpdated",value:function(e){this._convGroupHandler.onConvInGroupUpdated(e)}},{key:"_getConversationLastMessageSequence",value:function(e){var t=this._messageListHandler.getLocalLastMessage(e.conversationID),n=e.lastMessage.lastSequence;return t&&n<t.sequence&&(n=t.sequence),n}},{key:"_getConversationLastMessageTime",value:function(e){var t=this._messageListHandler.getLocalLastMessage(e.conversationID),n=e.lastMessage.lastTime;return t&&n<t.time&&(n=t.time),n}},{key:"_createSetAllMessageReadPack",value:function(e){var t,n={readAllC2CMessage:0,groupMessageReadInfoList:[]},o=e.scope,r=A(this._conversationMap);try{for(r.s();!(t=r.n()).done;){var a=M(t.value,2)[1];if(a.unreadCount>0)if(a.type===hr.CONV_C2C&&0===n.readAllC2CMessage){if(o===hr.READ_ALL_MSG)n.readAllC2CMessage=1;else if(o===hr.READ_ALL_C2C_MSG){n.readAllC2CMessage=1;break}}else if(a.type===hr.CONV_GROUP&&(o===hr.READ_ALL_GROUP_MSG||o===hr.READ_ALL_MSG)){var s=this._getConversationLastMessageSequence(a);n.groupMessageReadInfoList.push({groupID:a.groupProfile.groupID,messageSequence:s})}}}catch(c){r.e(c)}finally{r.f()}return n}},{key:"onPushedAllMessageRead",value:function(e){this._handleAllMessageRead(e)}},{key:"_handleAllMessageRead",value:function(e){var t=e.groupMessageReadInfoList,n=e.readAllC2CMessage,o=this._parseGroupReadInfo(t);return this._updateAllConversationUnreadCount({readAllC2CMessage:n})>=1&&this.emitConversationUpdate(!0,!1),o}},{key:"_parseGroupReadInfo",value:function(e){var t=[];if(e&&e.length)for(var n=0,o=e.length;n<o;n++){var r=e[n],a=r.groupID,s=r.sequence,i=r.retCode,u=r.lastMessageSeq;ed(i)?this._remoteGroupReadSequenceMap.set(a,u):(this._remoteGroupReadSequenceMap.set(a,s),0!==i&&t.push("".concat(a,"-").concat(s,"-").concat(i)))}return t}},{key:"_updateAllConversationUnreadCount",value:function(e){var t,n=e.readAllC2CMessage,o=0,r=A(this._conversationMap);try{for(r.s();!(t=r.n()).done;){var a=M(t.value,2),s=a[0],i=a[1];if(i.unreadCount>=1){if(1===n&&i.type===hr.CONV_C2C){var u=this._getConversationLastMessageTime(i);this.updateIsReadAfterReadReport({conversationID:s,lastMessageTime:u})}else if(i.type===hr.CONV_GROUP){var c=s.replace(hr.CONV_GROUP,"");if(this._remoteGroupReadSequenceMap.has(c)){var l=this._remoteGroupReadSequenceMap.get(c),d=this._getConversationLastMessageSequence(i);this.updateIsReadAfterReadReport({conversationID:s,remoteReadSequence:l}),d>=l&&this._remoteGroupReadSequenceMap.delete(c)}}this.updateUnreadCount(s,!1)&&(o+=1)}}}catch(_){r.e(_)}finally{r.f()}return o}},{key:"isRemoteRead",value:function(e){var t=e.conversationID,n=e.sequence,o=t.replace(hr.CONV_GROUP,""),r=!1;if(this._remoteGroupReadSequenceMap.has(o)){var a=this._remoteGroupReadSequenceMap.get(o);n<=a&&(r=!0,wl.log("".concat(this._className,".isRemoteRead conversationID:").concat(t," messageSequence:").concat(n," remoteReadSequence:").concat(a))),n>=a+10&&this._remoteGroupReadSequenceMap.delete(o)}return r}},{key:"updateIsReadAfterReadReport",value:function(e){var t=e.conversationID,n=e.lastMessageSeq,o=e.lastMessageTime,r=this._messageListHandler.getLocalMessageList(t);if(0!==r.length)for(var a,s=r.length-1;s>=0;s--)if(a=r[s],!(o&&a.time>o||n&&a.sequence>n)){if("in"===a.flow&&a.isRead)break;a.setIsRead(!0)}}},{key:"updateUnreadCount",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!1,o=this.getLocalConversation(e),r=this._messageListHandler.getLocalMessageList(e);if(o){var a=o.unreadCount,s=r.filter((function(e){return!e.isRead&&!e._onlineOnlyFlag&&!e.isDeleted})).length;if(a!==s&&(o.unreadCount=s,n=!0,wl.log("".concat(this._className,".updateUnreadCount from ").concat(a," to ").concat(s,", conversationID:").concat(e)),!0===t&&this.emitConversationUpdate(!0,!1)),n&&o.type===hr.CONV_TOPIC){var i=o.unreadCount,u=this.getModule(ig),c=e.replace(hr.CONV_GROUP,"");u.onConversationProxy({topicID:c,unreadCount:i})}return n}}},{key:"clearGroupAtInfoList",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversation(e);if(n&&n.groupAtInfoList.length>0){if(n.clearGroupAtInfoList(),wl.log("".concat(this._className,".clearGroupAtInfoList conversationID:").concat(e)),n.type===hr.CONV_TOPIC){var o=n.groupAtInfoList,r=this.getModule(ig),a=e.replace(hr.CONV_GROUP,"");r.onConversationProxy({topicID:a,groupAtInfoList:o})}!0===t&&this.emitConversationUpdate(!0,!1)}}},{key:"updateReadReceiptInfo",value:function(e){var t=this,n=e.userID,o=void 0===n?void 0:n,r=e.groupID,a=void 0===r?void 0:r,s=e.readReceiptList;if(!Bd(s)){var i=[];if(ed(o)){if(!ed(a)){var u="".concat(hr.CONV_GROUP).concat(a);s.forEach((function(e){var n=e.tinyID,o=e.clientTime,r=e.random,s=e.readCount,c=e.unreadCount,l="".concat(n,"-").concat(o,"-").concat(r),d=t._messageListHandler.getLocalMessage(u,l),p={groupID:a,messageID:l,readCount:0,unreadCount:0};d&&(Jl(s)&&(d.readReceiptInfo.readCount=s,p.readCount=s),Jl(c)&&(d.readReceiptInfo.unreadCount=c,p.unreadCount=c),i.push(p))}))}}else{var c="".concat(hr.CONV_C2C).concat(o);s.forEach((function(e){var n=e.tinyID,r=e.clientTime,a=e.random,s="".concat(n,"-").concat(r,"-").concat(a),u=t._messageListHandler.getLocalMessage(c,s);if(u&&!u.isPeerRead){u.isPeerRead=!0;var l={userID:o,messageID:s,isPeerRead:!0};i.push(l)}}))}i.length>0&&this.emitOuterEvent(_r.MESSAGE_READ_RECEIPT_RECEIVED,i)}}},{key:"recomputeGroupUnreadCount",value:function(e){var t=e.conversationID,n=e.count,o=this.getLocalConversation(t);if(o){var r=o.unreadCount,a=r-n;a<0&&(a=0),o.unreadCount=a,wl.log("".concat(this._className,".recomputeGroupUnreadCount from ").concat(r," to ").concat(a,", conversationID:").concat(t))}}},{key:"updateIsRead",value:function(e){var t=this.getLocalConversation(e),n=this.getLocalMessageList(e);if(t&&0!==n.length&&!Sd(t.type)){for(var o=[],r=0,a=n.length;r<a;r++)"in"!==n[r].flow?"out"!==n[r].flow||n[r].isRead||n[r].setIsRead(!0):o.push(n[r]);var s=0;if(t.type===hr.CONV_C2C){var i=o.slice(-t.unreadCount).filter((function(e){return e.isRevoked})).length;s=o.length-t.unreadCount-i}else s=o.length-t.unreadCount;for(var u=0;u<s&&!o[u].isRead;u++)o[u].setIsRead(!0)}}},{key:"deleteGroupAtTips",value:function(e){var t=this,n="".concat(this._className,".deleteGroupAtTips");wl.log("".concat(n));var o=this._conversationMap.get(e);if(!o)return Promise.resolve();var r=o.groupAtInfoList;if(0===r.length)return Promise.resolve();var a=void 0;e.startsWith(hr.CONV_GROUP)&&(a=e.replace(hr.CONV_GROUP,""));var s=y(r);if((Id({groupID:a})||Td(a))&&0===(s=r.filter((function(e){return!e.atTypeArray.includes(hr.CONV_AT_ALL)}))).length)return this.clearGroupAtInfoList(e,!1),Promise.resolve();var i=this.getMyUserID();return this.request({protocolName:Zg,requestData:{messageListToDelete:s.map((function(e){return{from:e.from,to:i,messageSeq:e.__sequence,messageRandom:e.__random,groupID:ed(e.topicID)?e.groupID:e.topicID}}))}}).then((function(){return wl.log("".concat(n," ok. count:").concat(r.length)),t.clearGroupAtInfoList(e,!1),Promise.resolve()})).catch((function(e){return wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"appendToMessageList",value:function(e){this._messageListHandler.pushIn(e)}},{key:"setMessageRandom",value:function(e){this.singlyLinkedList.set(e.random)}},{key:"deleteMessageRandom",value:function(e){this.singlyLinkedList.delete(e.random)}},{key:"pushIntoMessageList",value:function(e,t,n){return!(!this._messageListHandler.pushIn(t,n)||this._isMessageFromCurrentInstance(t)&&!n)&&(e.push(t),!0)}},{key:"_isMessageFromCurrentInstance",value:function(e){return this.singlyLinkedList.has(e.random)}},{key:"revoke",value:function(e,t,n){return this._messageListHandler.revoke(e,t,n)}},{key:"getPeerReadTime",value:function(e){return this._peerReadTimeMap.get(e)}},{key:"recordPeerReadTime",value:function(e,t){this._peerReadTimeMap.has(e)?this._peerReadTimeMap.get(e)<t&&this._peerReadTimeMap.set(e,t):this._peerReadTimeMap.set(e,t)}},{key:"updateMessageIsPeerReadProperty",value:function(e,t){if(e.startsWith(hr.CONV_C2C)&&t>0){var n=this._messageListHandler.updateMessageIsPeerReadProperty(e,t);if(n.length>0&&this.emitOuterEvent(_r.MESSAGE_READ_BY_PEER,n),this._conversationMap.has(e)){var o=this._conversationMap.get(e).lastMessage;Bd(o)||o.fromAccount===this.getMyUserID()&&o.lastTime<=t&&!o.isPeerRead&&(o.isPeerRead=!0,this.emitConversationUpdate(!0,!1))}}}},{key:"updateMessageIsModifiedProperty",value:function(e){this._messageListHandler.updateMessageIsModifiedProperty(e)}},{key:"setCompleted",value:function(e){wl.log("".concat(this._className,".setCompleted. conversationID:").concat(e)),this._completedMap.set(e,!0)}},{key:"updateRoamingMessageKeyAndTime",value:function(e,t,n){this._roamingMessageKeyAndTimeMap.set(e,{messageKey:t,lastMessageTime:n})}},{key:"updateRoamingMessageSequence",value:function(e,t){this._roamingMessageSequenceMap.set(e,t)}},{key:"getConversationList",value:function(e){var t=this,n="".concat(this._className,".getConversationList"),o="pagingStatus:".concat(this._pagingStatus,", local conversation count:").concat(this._conversationMap.size,", options:").concat(e);if(wl.log("".concat(n,". ").concat(o)),this._pagingStatus===Fp.REJECTED){var r=new Uh(bh.GET_CONVERSATION_LIST);return r.setMessage(o),this.syncConversationList().then((function(){r.setNetworkType(t.getNetworkType()).end();var n=t._getConversationList(e);return Vv({conversationList:n})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}if(0===this._conversationMap.size){var a=new Uh(bh.GET_CONVERSATION_LIST);return a.setMessage(o),this.syncConversationList().then((function(){a.setNetworkType(t.getNetworkType()).end();var n=t._getConversationList(e);return Vv({conversationList:n})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];a.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}var s=this._getConversationList(e);return wl.log("".concat(n,". returned conversation count:").concat(s.length)),Jv({conversationList:s})}},{key:"_getConversationList",value:function(e){if(ed(e))return this.getLocalConversationList();if($l(e))return 0===e.length?[]:this.getLocalConversationList().filter((function(t){return e.includes(t.conversationID)}));if(Zl(e)){var t=e.type,n=e.markType,o=e.groupName;return this.getLocalConversationList().filter((function(e){return(t!==hr.CONV_C2C&&t!==hr.CONV_GROUP||e.type===t)&&(!Xl(o)||e.conversationGroupList.includes(o))&&(!Jl(n)||e.markList.includes(n))}))}return[]}},{key:"_handleC2CPeerReadTime",value:function(){var e,t=A(this._conversationMap);try{for(t.s();!(e=t.n()).done;){var n=M(e.value,2),o=n[0],r=n[1];r.type===hr.CONV_C2C&&(wl.debug("".concat(this._className,"._handleC2CPeerReadTime conversationID:").concat(o," peerReadTime:").concat(r.peerReadTime)),this.recordPeerReadTime(o,r.peerReadTime))}}catch(i){t.e(i)}finally{t.f()}}},{key:"_isPagingGetGroupListCompleted",value:function(){return this.getModule(rg).isPagingGetCompleted()}},{key:"_hasLocalGroup",value:function(e){return this.getModule(rg).hasLocalGroup(e.replace(hr.CONV_GROUP,""))}},{key:"getConversationProfile",value:function(e){var t,n=this;if((t=this._conversationMap.has(e)?this._conversationMap.get(e):new OM({conversationID:e,type:e.slice(0,3)===hr.CONV_C2C?hr.CONV_C2C:hr.CONV_GROUP}))._isInfoCompleted||t.type===hr.CONV_SYSTEM)return Jv({conversation:t});if(Cd(e)&&!this._hasLocalGroup(e))return Jv({conversation:t});var o=new Uh(bh.GET_CONVERSATION_PROFILE),r="".concat(this._className,".getConversationProfile");return wl.log("".concat(r,". conversationID:").concat(e," remark:").concat(t.remark," lastMessage:"),t.lastMessage),this._updateUserOrGroupProfileCompletely(t).then((function(a){o.setNetworkType(n.getNetworkType()).setMessage("conversationID:".concat(e," unreadCount:").concat(a.data.conversation.unreadCount)).end();var s=n.getModule(ag);if(s&&t.type===hr.CONV_C2C){var i=e.replace(hr.CONV_C2C,"");if(s.isMyFriend(i)){var u=s.getFriendRemark(i);t.remark!==u&&(t.remark=u,wl.log("".concat(r,". conversationID:").concat(e," patch remark:").concat(t.remark)))}}return wl.log("".concat(r," ok. conversationID:").concat(e)),a})).catch((function(t){return n.probeNetwork().then((function(n){var r=M(n,2),a=r[0],s=r[1];o.setError(t,a,s).setMessage("conversationID:".concat(e)).end()})),wl.error("".concat(r," failed. error:"),t),Xv(t)}))}},{key:"_updateUserOrGroupProfileCompletely",value:function(e){var t=this;return e.type===hr.CONV_C2C?this.getModule(ng).getUserProfile({userIDList:[e.toAccount]}).then((function(n){var o=n.data;return 0===o.length?Xv(new Wv({code:Mh.USER_OR_GROUP_NOT_FOUND,message:yh.USER_OR_GROUP_NOT_FOUND})):(e.userProfile=o[0],e._isInfoCompleted=!0,t._unshiftConversation(e),Jv({conversation:e}))})):this.getModule(rg).getGroupProfile({groupID:e.toAccount}).then((function(n){return e.groupProfile=n.data.group,e._isInfoCompleted=!0,t._unshiftConversation(e),Jv({conversation:e})}))}},{key:"_unshiftConversation",value:function(e){e instanceof OM&&!this._conversationMap.has(e.conversationID)&&(this._conversationMap=new Map([[e.conversationID,e]].concat(y(this._conversationMap))),this._setStorageConversationList(),this.emitConversationUpdate(!0,!1))}},{key:"_onProfileUpdated",value:function(e){var t=this;e.data.forEach((function(e){var n=e.userID;if(n===t.getMyUserID())t._onMyProfileModified({latestNick:e.nick,latestAvatar:e.avatar});else{var o=t._conversationMap.get("".concat(hr.CONV_C2C).concat(n));o&&(o.userProfile=e)}}))}},{key:"deleteConversation",value:function(e){var t=this,n={fromAccount:this.getMyUserID(),toAccount:void 0,type:void 0,toGroupID:void 0};if(!this._conversationMap.has(e)){var o=new Wv({code:Mh.CONVERSATION_NOT_FOUND,message:yh.CONVERSATION_NOT_FOUND});return Xv(o)}var r=this._conversationMap.get(e).type;if(r===hr.CONV_C2C)n.type=1,n.toAccount=e.replace(hr.CONV_C2C,"");else{if(r!==hr.CONV_GROUP){if(r===hr.CONV_SYSTEM)return this.getModule(rg).deleteGroupSystemNotice({messageList:this._messageListHandler.getLocalMessageList(e)}),this.deleteLocalConversation(e),Jv({conversationID:e});var a=new Wv({code:Mh.CONVERSATION_UN_RECORDED_TYPE,message:yh.CONVERSATION_UN_RECORDED_TYPE});return Xv(a)}if(!this._hasLocalGroup(e))return this.deleteLocalConversation(e),Jv({conversationID:e});n.type=2,n.toGroupID=e.replace(hr.CONV_GROUP,"")}var s=new Uh(bh.DELETE_CONVERSATION);s.setMessage("conversationID:".concat(e));var i="".concat(this._className,".deleteConversation");return wl.log("".concat(i,". conversationID:").concat(e)),this.setMessageRead({conversationID:e}).then((function(){return t.request({protocolName:Xg,requestData:n})})).then((function(){return s.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(i," ok")),t.deleteLocalConversation(e),Jv({conversationID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setError(e,o,r).end()})),wl.error("".concat(i," failed. error:"),e),Xv(e)}))}},{key:"pinConversation",value:function(e){var t=this,n=e.conversationID,o=e.isPinned;if(!this._conversationMap.has(n))return Xv({code:Mh.CONVERSATION_NOT_FOUND,message:yh.CONVERSATION_NOT_FOUND});var r=this.getLocalConversation(n);if(r.isPinned===o)return Jv({conversationID:n});var a=new Uh(bh.PIN_CONVERSATION);a.setMessage("conversationID:".concat(n," isPinned:").concat(o));var s="".concat(this._className,".pinConversation");wl.log("".concat(s,". conversationID:").concat(n," isPinned:").concat(o));var i=null;return Ed(n)?i={type:1,toAccount:n.replace(hr.CONV_C2C,"")}:Cd(n)&&(i={type:2,groupID:n.replace(hr.CONV_GROUP,"")}),this.request({protocolName:Qg,requestData:{fromAccount:this.getMyUserID(),operationType:!0===o?1:2,itemList:[i]}}).then((function(){return a.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(s," ok")),r.isPinned!==o&&(r.isPinned=o,t._sortConversationListAndEmitEvent()),Vv({conversationID:n})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];a.setError(e,o,r).end()})),wl.error("".concat(s," failed. error:"),e),Xv(e)}))}},{key:"setMessageRemindType",value:function(e){return this._messageRemindHandler.set(e)}},{key:"patchMessageRemindType",value:function(e){var t=e.ID,n=e.isC2CConversation,o=e.messageRemindType,r=!1,a=this.getLocalConversation(n?"".concat(hr.CONV_C2C).concat(t):"".concat(hr.CONV_GROUP).concat(t));return a&&a.messageRemindType!==o&&(a.messageRemindType=o,r=!0),wl.debug("".concat(this._className,".patchMessageRemindType options:"),e,"ret:".concat(r)),r}},{key:"onC2CMessageRemindTypeSynced",value:function(e){var t=this;wl.debug("".concat(this._className,".onC2CMessageRemindTypeSynced options:"),e),e.dataList.forEach((function(e){if(!Bd(e.muteNotificationsSync)){var n,o=e.muteNotificationsSync,r=o.to,a=o.updateSequence,s=o.muteFlag;t._messageRemindHandler.setUpdateSequence(a),0===s?n=hr.MSG_REMIND_ACPT_AND_NOTE:1===s?n=hr.MSG_REMIND_DISCARD:2===s&&(n=hr.MSG_REMIND_ACPT_NOT_NOTE);var i=0;t.patchMessageRemindType({ID:r,isC2CConversation:!0,messageRemindType:n})&&(i+=1),wl.log("".concat(t._className,".onC2CMessageRemindTypeSynced updateCount:").concat(i)),i>=1&&t.emitConversationUpdate(!0,!1)}}))}},{key:"onGroupMessageRemindTypeSynced",value:function(e){wl.debug("".concat(this._className,".onGroupMessageRemindTypeSynced options:"),e),this._messageRemindHandler.onGroupMessageRemindTypeUpdated(e)}},{key:"deleteLocalConversation",value:function(e){var t=this._conversationMap.has(e);if(wl.log("".concat(this._className,".deleteLocalConversation conversationID:").concat(e," has:").concat(t)),t){this._conversationMap.delete(e),this._roamingMessageKeyAndTimeMap.has(e)&&this._roamingMessageKeyAndTimeMap.delete(e),this._roamingMessageSequenceMap.has(e)&&this._roamingMessageSequenceMap.delete(e),this._setStorageConversationList(),this._messageListHandler.removeByConversationID(e),this._completedMap.delete(e);var n=!this._isTopicConversation(e);this.emitConversationUpdate(n,!1)}}},{key:"isMessageSentByCurrentInstance",value:function(e){return!(!this._messageListHandler.hasLocalMessage(e.conversationID,e.ID)&&!this.singlyLinkedList.has(e.random))}},{key:"modifyMessageList",value:function(e){if(e.startsWith(hr.CONV_C2C)&&this._conversationMap.has(e)){var t=this._conversationMap.get(e),n=Date.now();this._messageListHandler.modifyMessageSentByPeer({conversationID:e,latestNick:t.userProfile.nick,latestAvatar:t.userProfile.avatar});var o=this.getModule(ng).getNickAndAvatarByUserID(this.getMyUserID());this._messageListHandler.modifyMessageSentByMe({conversationID:e,latestNick:o.nick,latestAvatar:o.avatar}),wl.log("".concat(this._className,".modifyMessageList conversationID:").concat(e," cost ").concat(Date.now()-n," ms"))}}},{key:"updateUserProfileSpecifiedKey",value:function(e){wl.log("".concat(this._className,".updateUserProfileSpecifiedKey options:"),e);var t=e.conversationID,n=e.nick,o=e.avatar;if(this._conversationMap.has(t)){var r=this._conversationMap.get(t).userProfile;Xl(n)&&r.nick!==n&&(r.nick=n),Xl(o)&&r.avatar!==o&&(r.avatar=o),this.emitConversationUpdate(!0,!1)}}},{key:"_onMyProfileModified",value:function(e){var n=this,o=this.getLocalConversationList(),r=Date.now();o.forEach((function(o){n.modifyMessageSentByMe(t({conversationID:o.conversationID},e))})),wl.log("".concat(this._className,"._onMyProfileModified. modify all messages sent by me, cost ").concat(Date.now()-r," ms"))}},{key:"modifyMessageSentByMe",value:function(e){this._messageListHandler.modifyMessageSentByMe(e)}},{key:"getLatestMessageSentByMe",value:function(e){return this._messageListHandler.getLatestMessageSentByMe(e)}},{key:"modifyMessageSentByPeer",value:function(e){this._messageListHandler.modifyMessageSentByPeer(e)}},{key:"getLatestMessageSentByPeer",value:function(e){return this._messageListHandler.getLatestMessageSentByPeer(e)}},{key:"pushIntoNoticeResult",value:function(e,t){return!(!this._messageListHandler.pushIn(t)||this.singlyLinkedList.has(t.random))&&(e.push(t),!0)}},{key:"getGroupLocalLastMessageSequence",value:function(e){return this._messageListHandler.getGroupLocalLastMessageSequence(e)}},{key:"checkAndPatchRemark",value:function(){var e=Promise.resolve();if(0===this._conversationMap.size)return e;var t=this.getModule(ag);if(!t)return e;var n=y(this._conversationMap.values()).filter((function(e){return e.type===hr.CONV_C2C}));if(0===n.length)return e;var o=0;return n.forEach((function(e){var n=e.conversationID.replace(hr.CONV_C2C,"");if(t.isMyFriend(n)){var r=t.getFriendRemark(n);e.remark!==r&&(e.remark=r,o+=1)}})),wl.log("".concat(this._className,".checkAndPatchRemark. c2c conversation count:").concat(n.length,", patched count:").concat(o)),e}},{key:"updateTopicConversation",value:function(e){this._updateLocalConversationList({conversationOptionsList:e,isFromGetConversations:!0})}},{key:"sendReadReceipt",value:function(e){var t=e[0],n=null;return t.conversationType===hr.CONV_C2C?n=this._moduleManager.getModule(og):t.conversationType===hr.CONV_GROUP&&(n=this._moduleManager.getModule(rg)),n?n.sendReadReceipt(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"getReadReceiptList",value:function(e){var t=e[0],n=null;return t.conversationType===hr.CONV_C2C?n=this._moduleManager.getModule(og):t.conversationType===hr.CONV_GROUP&&(n=this._moduleManager.getModule(rg)),n?n.getReadReceiptList(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"getLastMessageTime",value:function(e){var t=this.getLocalConversation(e);return t?t.lastMessage.lastTime:0}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._pagingStatus=Fp.NOT_START,this._messageListHandler.reset(),this._messageRemindHandler.reset(),this._roamingMessageKeyAndTimeMap.clear(),this._roamingMessageSequenceMap.clear(),this.singlyLinkedList.reset(),this._peerReadTimeMap.clear(),this._completedMap.clear(),this._conversationMap.clear(),this._pagingTimeStamp=0,this._pagingStartIndex=0,this._pagingPinnedTimeStamp=0,this._pagingPinnedStartIndex=0,this._remoteGroupReadSequenceMap.clear(),this.resetReady()}}]),o}(Ag),wM=function(){function e(t){r(this,e),this._groupModule=t,this._className="GroupTipsHandler",this._cachedGroupTipsMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map}return i(e,[{key:"onCheckTimer",value:function(e){e%1==0&&this._cachedGroupTipsMap.size>0&&this._checkCachedGroupTips()}},{key:"_checkCachedGroupTips",value:function(){var e=this;this._cachedGroupTipsMap.forEach((function(t,n){var o=e._checkCountMap.get(n),r=e._groupModule.hasLocalGroup(n);wl.log("".concat(e._className,"._checkCachedGroupTips groupID:").concat(n," hasLocalGroup:").concat(r," checkCount:").concat(o)),r?(e._notifyCachedGroupTips(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupTips(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:"onNewGroupTips",value:function(e){wl.debug("".concat(this._className,".onReceiveGroupTips count:").concat(e.dataList.length));var t=this.newGroupTipsStoredAndSummary(e),n=t.eventDataList,o=t.result,r=t.AVChatRoomMessageList;r.length>0&&this._groupModule.onAVChatRoomMessage(r),n.length>0&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(ug).onNewMessage({conversationOptionsList:n,isInstantMessage:!0})),o.length>0&&(this._groupModule.emitOuterEvent(_r.MESSAGE_RECEIVED,o),this.handleMessageList(o))}},{key:"newGroupTipsStoredAndSummary",value:function(e){for(var n=this,o=e.event,r=e.dataList,a=null,s=[],i=[],u={},c=[],l=function(e,l){var d=md(r[e]),p=d.groupProfile,g=p.groupID,_=p.communityType,h=void 0===_?0:_,f=p.topicID,m=void 0===f?void 0:f,v=void 0,M=2===h&&!Bd(m);if(M){v=hr.CONV_TOPIC,d.to=m;var y=n._groupModule.getModule(ig);y.hasLocalTopic(g,m)||n._getTopicPendingMap.has(m)||(n._getTopicPendingMap.set(m,1),y.getTopicList({groupID:g,topicIDList:[m]}).finally((function(){n._getTopicPendingMap.delete(m)})))}if(2===h&&Bd(m))return"continue";var I=n._groupModule.hasLocalGroup(g);if(!I&&n._groupModule.isUnjoinedAVChatRoom(g))return"continue";if(!I&&!M)return n._cacheGroupTipsAndProbe({groupID:g,event:o,item:d}),"continue";if(n._groupModule.isMessageFromOrToAVChatroom(g))return d.event=o,c.push(d),"continue";d.currentUser=n._groupModule.getMyUserID(),d.conversationType=hr.CONV_GROUP,(a=new qv(d)).setElement({type:hr.MSG_GRP_TIP,content:t(t({},d.elements),{},{groupProfile:d.groupProfile})}),a.isSystemMessage=!1;var T=n._groupModule.getModule(ug),E=a,C=E.conversationID,S=E.sequence;if(6===o)a._onlineOnlyFlag=!0,i.push(a);else if(!T.pushIntoNoticeResult(i,a))return"continue";if(6===o&&T.getLocalConversation(C))return"continue";6!==o&&n._groupModule.getModule(Eg).addMessageSequence({key:Nh,message:a});var A=T.isRemoteRead({conversationID:C,sequence:S});if(ed(u[C])){var D=0;"in"===a.flow&&(a._isExcludedFromUnreadCount||a._onlineOnlyFlag||A||(D=1)),u[C]=s.push({conversationID:C,unreadCount:D,type:ed(v)?a.conversationType:v,subType:a.conversationSubType,lastMessage:a._isExcludedFromLastMessage?"":a})-1}else{var N=u[C];s[N].type=a.conversationType,s[N].subType=a.conversationSubType,s[N].lastMessage=a._isExcludedFromLastMessage?"":a,"in"===a.flow&&(a._isExcludedFromUnreadCount||a._onlineOnlyFlag||A||s[N].unreadCount++)}},d=0,p=r.length;d<p;d++)l(d);return{eventDataList:s,result:i,AVChatRoomMessageList:c}}},{key:"handleMessageList",value:function(e){var t=this;e.forEach((function(e){switch(e.payload.operationType){case 1:t._onNewMemberComeIn(e);break;case 2:t._onMemberQuit(e);break;case 3:t._onMemberKickedOut(e);break;case 4:t._onMemberSetAdmin(e);break;case 5:t._onMemberCancelledAdmin(e);break;case 6:t._onGroupProfileModified(e);break;case 7:t._onMemberInfoModified(e);break;case 8:t._onTopicProfileUpdated(e);break;default:wl.warn("".concat(t._className,".handleMessageList unknown operationType:").concat(e.payload.operationType))}}))}},{key:"_onNewMemberComeIn",value:function(e){var t=e.payload,n=t.memberNum,o=t.groupProfile.groupID,r=this._groupModule.getLocalGroupProfile(o);r&&Jl(n)&&r.memberCount!==n&&(r.memberCount=n,this._updateConversationGroupProfile(r))}},{key:"_onMemberQuit",value:function(e){var t=e.payload,n=t.memberNum,o=t.groupProfile.groupID,r=this._groupModule.getLocalGroupProfile(o);r&&Jl(n)&&r.memberCount!==n&&(r.memberCount=n,this._updateConversationGroupProfile(r)),this._groupModule.getModule(sg).deleteLocalGroupMembers(o,e.payload.userIDList)}},{key:"_onMemberKickedOut",value:function(e){var t=e.payload,n=t.memberNum,o=t.groupProfile.groupID,r=this._groupModule.getLocalGroupProfile(o);r&&Jl(n)&&r.memberCount!==n&&(r.memberCount=n,this._updateConversationGroupProfile(r)),this._groupModule.getModule(sg).deleteLocalGroupMembers(o,e.payload.userIDList)}},{key:"_updateConversationGroupProfile",value:function(e){this._groupModule.getModule(ug).updateConversationGroupProfile([e])}},{key:"_onMemberSetAdmin",value:function(e){var t=e.payload.groupProfile.groupID,n=e.payload.userIDList,o=this._groupModule.getModule(sg);n.forEach((function(e){var n=o.getLocalGroupMemberInfo(t,e);n&&n.updateRole(hr.GRP_MBR_ROLE_ADMIN)}))}},{key:"_onMemberCancelledAdmin",value:function(e){var t=e.payload.groupProfile.groupID,n=e.payload.userIDList,o=this._groupModule.getModule(sg);n.forEach((function(e){var n=o.getLocalGroupMemberInfo(t,e);n&&n.updateRole(hr.GRP_MBR_ROLE_MEMBER)}))}},{key:"_onGroupProfileModified",value:function(e){var t=this,n=e.payload,o=n.newGroupProfile,r=n.groupProfile.groupID,a=this._groupModule.getLocalGroupProfile(r);Object.keys(o).forEach((function(e){switch(e){case"ownerID":t._ownerChanged(a,o);break;case"muteAllMembers":a.muteAllMembers=o.muteAllMembers;break;case"joinOption":a.joinOption=o.joinOption;break;default:a[e]=o[e]}}));var s=!a.isSupportTopic;this._groupModule.emitGroupListUpdate(!0,s)}},{key:"_ownerChanged",value:function(e,t){var n=e.groupID,o=this._groupModule.getLocalGroupProfile(n),r=this._groupModule.getMyUserID();if(r===t.ownerID){o.updateGroup({selfInfo:{role:hr.GRP_MBR_ROLE_OWNER}});var a=this._groupModule.getModule(sg),s=a.getLocalGroupMemberInfo(n,r),i=this._groupModule.getLocalGroupProfile(n).ownerID,u=a.getLocalGroupMemberInfo(n,i);s&&s.updateRole(hr.GRP_MBR_ROLE_OWNER),u&&u.updateRole(hr.GRP_MBR_ROLE_MEMBER)}}},{key:"_onMemberInfoModified",value:function(e){var t=e.to,n=e.payload,o=n.groupProfile,r=n.memberList,a=o.groupID;Td(t)&&this._updateTopicMuteTime(e);var s=this._groupModule.getModule(sg);r.forEach((function(e){var t=s.getLocalGroupMemberInfo(a,e.userID);t&&Jl(e.muteTime)&&t.updateMuteUntil(e.muteTime)}))}},{key:"_updateTopicMuteTime",value:function(e){var t=e.to,n=e.payload,o=n.groupProfile,r=n.memberList,a=void 0===r?[]:r,s=this._groupModule.getModule(ig),i=o.groupID,u=s.getLocalTopic(i,t);if(u){for(var c=!1,l=0;l<a.length;l++){var d=a[l];if(d.userID===this._groupModule.getMyUserID()&&d.muteTime>=0){u.updateSelfInfo({muteTime:d.muteTime}),c=!0;break}}c&&this._groupModule.emitOuterEvent(_r.TOPIC_UPDATED,{groupID:i,topic:u})}}},{key:"_onTopicProfileUpdated",value:function(e){var n=e.payload,o=n.groupProfile.groupID,r=n.newTopicInfo;this._groupModule.getModule(ig).onTopicProfileUpdated(t({groupID:o,topicID:e.to},r))}},{key:"_cacheGroupTips",value:function(e,t){this._cachedGroupTipsMap.has(e)||this._cachedGroupTipsMap.set(e,[]),this._cachedGroupTipsMap.get(e).push(t)}},{key:"_deleteCachedGroupTips",value:function(e){this._cachedGroupTipsMap.has(e)&&this._cachedGroupTipsMap.delete(e)}},{key:"_notifyCachedGroupTips",value:function(e){var t=this,n=this._cachedGroupTipsMap.get(e)||[];n.forEach((function(e){t.onNewGroupTips(e)})),this._deleteCachedGroupTips(e),wl.log("".concat(this._className,"._notifyCachedGroupTips groupID:").concat(e," count:").concat(n.length))}},{key:"_cacheGroupTipsAndProbe",value:function(e){var t=this,n=e.groupID,o=e.event,r=e.item;this._cacheGroupTips(n,{event:o,dataList:[r]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===hr.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupTips(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupTips(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),wl.log("".concat(this._className,"._cacheGroupTipsAndProbe groupID:").concat(n))}},{key:"reset",value:function(){this._cachedGroupTipsMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear()}}]),e}(),FM=function(){function e(t){r(this,e),this._groupModule=t,this._className="CommonGroupHandler",this.tempConversationList=null,this._cachedGroupMessageMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map,this._isPagingGetCompleted=!1,t.getInnerEmitterInstance().once(gM,this._initGroupList,this)}return i(e,[{key:"onCheckTimer",value:function(e){e%1==0&&this._cachedGroupMessageMap.size>0&&this._checkCachedGroupMessage()}},{key:"_checkCachedGroupMessage",value:function(){var e=this;this._cachedGroupMessageMap.forEach((function(t,n){var o=e._checkCountMap.get(n),r=e._groupModule.hasLocalGroup(n);wl.log("".concat(e._className,"._checkCachedGroupMessage groupID:").concat(n," hasLocalGroup:").concat(r," checkCount:").concat(o)),r?(e._notifyCachedGroupMessage(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupMessage(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:"_initGroupList",value:function(){var e=this;wl.log("".concat(this._className,"._initGroupList"));var t=new Uh(bh.GET_GROUP_LIST_IN_STORAGE),n=this._groupModule.getStorageGroupList();if($l(n)&&n.length>0){n.forEach((function(t){e._groupModule.initGroupMap(t)})),this._groupModule.emitGroupListUpdate(!0,!1);var o=this._groupModule.getLocalGroupList().length;t.setNetworkType(this._groupModule.getNetworkType()).setMessage("group count:".concat(o)).end()}else t.setNetworkType(this._groupModule.getNetworkType()).setMessage("group count:0").end();wl.log("".concat(this._className,"._initGroupList ok"))}},{key:"handleUpdateGroupLastMessage",value:function(e){var t="".concat(this._className,".handleUpdateGroupLastMessage");if(wl.debug("".concat(t," conversation count:").concat(e.length,", local group count:").concat(this._groupModule.getLocalGroupList().length)),0!==this._groupModule.getGroupMap().size){for(var n,o,r,a=!1,s=0,i=e.length;s<i;s++)(n=e[s]).type===hr.CONV_GROUP&&(o=n.conversationID.split(/^GROUP/)[1],(r=this._groupModule.getLocalGroupProfile(o))&&(r.lastMessage=n.lastMessage,a=!0));a&&(this._groupModule.sortLocalGroupList(),this._groupModule.emitGroupListUpdate(!0,!1))}else this.tempConversationList=e}},{key:"onNewGroupMessage",value:function(e){wl.debug("".concat(this._className,".onNewGroupMessage count:").concat(e.dataList.length));var t=this._newGroupMessageStoredAndSummary(e),n=t.conversationOptionsList,o=t.messageList,r=t.AVChatRoomMessageList;r.length>0&&this._groupModule.onAVChatRoomMessage(r),this._groupModule.filterModifiedMessage(o),n.length>0&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(ug).onNewMessage({conversationOptionsList:n,isInstantMessage:!0}));var a=this._groupModule.filterUnmodifiedMessage(o);a.length>0&&this._groupModule.emitOuterEvent(_r.MESSAGE_RECEIVED,a),o.length=0}},{key:"_newGroupMessageStoredAndSummary",value:function(e){var t=this,n=e.dataList,o=e.event,r=e.isInstantMessage,a=null,s=[],i=[],u=[],c={},l=this._groupModule.getModule(gg),d=this._groupModule.getModule(Eg),p=n.length;p>1&&n.sort((function(e,t){return e.sequence-t.sequence}));for(var g=function(e){var p=md(n[e]),g=p.groupProfile,_=g.groupID,h=g.communityType,f=void 0===h?0:h,m=g.topicID,v=void 0===m?void 0:m,M=void 0,y=2===f&&!Bd(v);if(y){M=hr.CONV_TOPIC,p.to=v;var I=t._groupModule.getModule(ig);I.hasLocalTopic(_,v)||t._getTopicPendingMap.has(v)||(t._getTopicPendingMap.set(v,1),I.getTopicList({groupID:_,topicIDList:[v]}).finally((function(){t._getTopicPendingMap.delete(v)})))}if(2===f&&Bd(v))return"continue";var T=t._groupModule.hasLocalGroup(_);if(!T&&t._groupModule.isUnjoinedAVChatRoom(_))return"continue";if(!T&&!y)return t._cacheGroupMessageAndProbe({groupID:_,event:o,item:p}),"continue";if(t._groupModule.isMessageFromOrToAVChatroom(_))return p.event=o,u.push(p),"continue";p.currentUser=t._groupModule.getMyUserID(),p.conversationType=hr.CONV_GROUP,p.isSystemMessage=!!p.isSystemMessage,a=new qv(p),p.elements=l.parseElements(p.elements,p.from),a.setElement(p.elements);var E=1===n[e].isModified,C=t._groupModule.getModule(ug);if(C.isMessageSentByCurrentInstance(a)?a.isModified=E:E=!1,1===p.onlineOnlyFlag)a._onlineOnlyFlag=!0,C.isMessageSentByCurrentInstance(a)||i.push(a);else{if(!C.pushIntoMessageList(i,a,E))return"continue";d.addMessageSequence({key:Nh,message:a}),r&&a.clientTime>0&&d.addMessageDelay(a.clientTime);var S=a,A=S.conversationID,D=S.sequence,N=C.isRemoteRead({conversationID:A,sequence:D});if(ed(c[A])){var O=0;"in"===a.flow&&(a._isExcludedFromUnreadCount||N||(O=1)),c[A]=s.push({conversationID:A,unreadCount:O,type:ed(M)?a.conversationType:M,subType:a.conversationSubType,lastMessage:a._isExcludedFromLastMessage?"":a})-1}else{var R=c[A];s[R].type=ed(M)?a.conversationType:M,s[R].subType=a.conversationSubType,s[R].lastMessage=a._isExcludedFromLastMessage?"":a,"in"===a.flow&&(a._isExcludedFromUnreadCount||N||s[R].unreadCount++)}}},_=0;_<p;_++)g(_);return{conversationOptionsList:s,messageList:i,AVChatRoomMessageList:u}}},{key:"onGroupMessageRevoked",value:function(e){wl.debug("".concat(this._className,".onGroupMessageRevoked nums:").concat(e.dataList.length));var t=this._groupModule.getModule(ug),n=[],o=null;e.dataList.forEach((function(e){var r=e.elements.revokedInfos;ed(r)||r.forEach((function(e){var r=ed(e.topicID)?"GROUP".concat(e.groupID):"GROUP".concat(e.topicID);(o=t.revoke(r,e.sequence,e.random))&&n.push(o)}))})),0!==n.length&&(t.onMessageRevoked(n),this._groupModule.emitOuterEvent(_r.MESSAGE_REVOKED,n))}},{key:"_groupListTreeShaking",value:function(e){for(var t=new Map(y(this._groupModule.getGroupMap())),n=0,o=e.length;n<o;n++)t.delete(e[n].groupID);this._groupModule.hasJoinedAVChatRoom()&&this._groupModule.getJoinedAVChatRoom().forEach((function(e){t.delete(e)})),this._groupModule.getGroupMap().forEach((function(e,n){e.isSupportTopic&&t.delete(n)}));for(var r=y(t.keys()),a=0,s=r.length;a<s;a++)this._groupModule.deleteGroup(r[a])}},{key:"getGroupList",value:function(e){var t=this,n="".concat(this._className,".getGroupList"),o=new Uh(bh.GET_GROUP_LIST);wl.log("".concat(n));var r={introduction:"Introduction",notification:"Notification",createTime:"CreateTime",ownerID:"Owner_Account",lastInfoTime:"LastInfoTime",memberNum:"MemberNum",maxMemberNum:"MaxMemberNum",joinOption:"ApplyJoinOption",muteAllMembers:"ShutUpAllMember"},a=["Type","Name","FaceUrl","NextMsgSeq","LastMsgTime","AtInfoList"],s=[];e&&e.groupProfileFilter&&e.groupProfileFilter.forEach((function(e){r[e]&&a.push(r[e])}));var i=(e||{}).isGroupWithTopicOnly,u=void 0!==i&&i;return this._pagingGetGroupList({limit:50,offset:0,groupBaseInfoFilter:a,groupList:s,isGroupWithTopicOnly:u}).then((function(){wl.log("".concat(n," ok. count:").concat(s.length," isGroupWithTopicOnly:").concat(u)),u||t._groupListTreeShaking(s),t._groupModule.updateGroupMap(s);var e=t._groupModule.getLocalGroupList().length;o.setNetworkType(t._groupModule.getNetworkType()).setMessage("remote count:".concat(s.length,", after tree shaking, local count:").concat(e,", isGroupWithTopicOnly:").concat(u)).end(),t.tempConversationList&&(wl.log("".concat(n," update last message with tempConversationList, count:").concat(t.tempConversationList.length)),t.handleUpdateGroupLastMessage({data:t.tempConversationList}),t.tempConversationList=null),t._groupModule.patchGroupMessageRemindType(),t._groupModule.recomputeUnreadCount(),t._groupModule.emitGroupListUpdate(!0,!u);var r=t._groupModule.getLocalGroupList();if(u){var a=r.filter((function(e){return!0===e.isSupportTopic}));return Vv({groupList:a})}return t._isPagingGetCompleted=!0,Vv({groupList:r})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=M(t,2),r=n[0],a=n[1];o.setError(e,r,a).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"isPagingGetCompleted",value:function(){return this._isPagingGetCompleted}},{key:"_pagingGetGroupList",value:function(e){var t=this,n="".concat(this._className,"._pagingGetGroupList"),o=e.isCommunityRelay,r=void 0!==o&&o,a=e.isGroupWithTopicOnly,s=void 0!==a&&a,i=e.limit,u=e.offset,c=e.groupBaseInfoFilter,l=e.groupList;if(s)return this._pagingGetGroupListWithTopic({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l});var d=new Uh(bh.PAGING_GET_GROUP_LIST);return this._groupModule.request({protocolName:i_,requestData:{type:r?hr.GRP_COMMUNITY:void 0,memberAccount:this._groupModule.getMyUserID(),limit:i,offset:u,responseFilter:{groupBaseInfoFilter:c,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]}}}).then((function(e){var o=e.data,a=o.groups,s=void 0===a?[]:a,p=o.totalCount;l.push.apply(l,y(s)),t._handleGroupAtInfoWithoutTopic(r,s);var g=u+i,_=!(p>g),h="offset:".concat(u," totalCount:").concat(p," isCompleted:").concat(_," ")+"currentCount:".concat(l.length," isCommunityRelay:").concat(r);return d.setNetworkType(t._groupModule.getNetworkType()).setMessage("".concat(h)).end(),r||_?!r&&_?(wl.log("".concat(n," start to get community list")),u=0,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l,isCommunityRelay:!0})):r&&!_?(u=g,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l,isCommunityRelay:!0})):(wl.log("".concat(n," ok. totalCount:").concat(l.length)),Vv({groupList:l})):(u=g,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l}))})).catch((function(e){return 11e3!==e.code&&t._groupModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],a=n[1];d.setMessage("isCommunityRelay:".concat(r)).setError(e,o,a).end()})),r?(11e3===e.code&&(d=null,wl.log("".concat(n," ok. community unavailable"))),Jv({groupList:l})):Xv(e)}))}},{key:"_pagingGetGroupListWithTopic",value:function(e){var t=this,n="".concat(this._className,"._pagingGetGroupListWithTopic"),o=e.limit,r=e.offset,a=e.groupBaseInfoFilter,s=e.groupList,i=new Uh(bh.PAGING_GET_GROUP_LIST_WITH_TOPIC);return this._groupModule.request({protocolName:i_,requestData:{type:hr.GRP_COMMUNITY,memberAccount:this._groupModule.getMyUserID(),limit:o,offset:r,responseFilter:{groupBaseInfoFilter:a,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]},isSupportTopic:1}}).then((function(e){var u=e.data,c=u.groups,l=void 0===c?[]:c,d=u.totalCount;s.push.apply(s,y(l));var p=r+o,g=!(d>p),_="offset:".concat(r," totalCount:").concat(d," isCompleted:").concat(g," ")+"currentCount:".concat(s.length);return i.setNetworkType(t._groupModule.getNetworkType()).setMessage("".concat(_)).end(),g?(wl.log("".concat(n," ok. totalCount:").concat(s.length)),Vv({groupList:s})):(r=p,t._pagingGetGroupListWithTopic({limit:o,offset:r,groupBaseInfoFilter:a,groupList:s}))})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];i.setError(e,o,r).end()})),Xv(e)}))}},{key:"_cacheGroupMessage",value:function(e,t){this._cachedGroupMessageMap.has(e)||this._cachedGroupMessageMap.set(e,[]),this._cachedGroupMessageMap.get(e).push(t)}},{key:"_deleteCachedGroupMessage",value:function(e){this._cachedGroupMessageMap.has(e)&&this._cachedGroupMessageMap.delete(e)}},{key:"_notifyCachedGroupMessage",value:function(e){var t=this,n=this._cachedGroupMessageMap.get(e)||[];n.forEach((function(e){t.onNewGroupMessage(e)})),this._deleteCachedGroupMessage(e),wl.log("".concat(this._className,"._notifyCachedGroupMessage groupID:").concat(e," count:").concat(n.length))}},{key:"_cacheGroupMessageAndProbe",value:function(e){var t=this,n=e.groupID,o=e.event,r=e.item;this._cacheGroupMessage(n,{event:o,dataList:[r]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===hr.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupMessage(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupMessage(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),wl.log("".concat(this._className,"._cacheGroupMessageAndProbe groupID:").concat(n))}},{key:"_handleGroupAtInfoWithoutTopic",value:function(e,n){var o=this;e&&0!==n.length&&n.forEach((function(e){var n=e.groupID,r=e.groupAtInfoList,a=[];ed(r)||(r.forEach((function(e){a.push(t(t({},e),{},{groupID:n}))})),o._groupModule.getModule(ug).onNewGroupAtTips({dataList:a}))}))}},{key:"reset",value:function(){this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear(),this._isPagingGetCompleted=!1,this._groupModule.getInnerEmitterInstance().once(gM,this._initGroupList,this)}}]),e}(),qM={1:"init",2:"modify",3:"clear",4:"delete"},VM=function(){function e(t){r(this,e),this._groupModule=t,this._className="GroupAttributesHandler",this._groupAttributesMap=new Map,this.CACHE_EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on(_M,this._onCloudConfigUpdated,this)}return i(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._groupModule.getCloudConfig("grp_attr_cache_time");ed(e)||(this.CACHE_EXPIRE_TIME=Number(e))}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesMap.forEach((function(e){e.localMainSequence=0}))}},{key:"onGroupAttributesUpdated",value:function(e){var t=this,n=e.groupID,o=e.groupAttributeOption,r=o.mainSequence,a=o.hasChangedAttributeInfo,s=o.groupAttributeList,i=void 0===s?[]:s,u=o.operationType;if(wl.log("".concat(this._className,".onGroupAttributesUpdated. groupID:").concat(n," hasChangedAttributeInfo:").concat(a," operationType:").concat(u)),!ed(u)){if(1===a){if(4===u){var c=[];i.forEach((function(e){c.push(e.key)})),i=y(c),c=null}return this._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:r,groupAttributeList:i,operationType:qM[u]}),void this._emitGroupAttributesUpdated(n)}if(this._groupAttributesMap.has(n)){var l=this._groupAttributesMap.get(n).avChatRoomKey;this._getGroupAttributes({groupID:n,avChatRoomKey:l}).then((function(){t._emitGroupAttributesUpdated(n)}))}}}},{key:"initGroupAttributesCache",value:function(e){var t=e.groupID,n=e.avChatRoomKey;this._groupAttributesMap.set(t,{lastUpdateTime:0,localMainSequence:0,remoteMainSequence:0,attributes:new Map,avChatRoomKey:n}),wl.log("".concat(this._className,".initGroupAttributesCache groupID:").concat(t," avChatRoomKey:").concat(n))}},{key:"initGroupAttributes",value:function(e){var t=this,n=e.groupID,o=e.groupAttributes,r=this._checkCachedGroupAttributes({groupID:n,funcName:"initGroupAttributes"});if(!0!==r)return Xv(r);var a=this._groupAttributesMap.get(n),s=a.remoteMainSequence,i=a.avChatRoomKey,u=new Uh(bh.INIT_GROUP_ATTRIBUTES);return u.setMessage("groupID:".concat(n," mainSequence:").concat(s," groupAttributes:").concat(JSON.stringify(o))),this._groupModule.request({protocolName:P_,requestData:{groupID:n,avChatRoomKey:i,mainSequence:s,groupAttributeList:this._transformGroupAttributes(o)}}).then((function(e){var r=e.data,a=r.mainSequence,s=y(r.groupAttributeList);return s.forEach((function(e){e.value=o[e.key]})),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:a,groupAttributeList:s,operationType:"init"}),u.setNetworkType(t._groupModule.getNetworkType()).end(),wl.log("".concat(t._className,".initGroupAttributes ok. groupID:").concat(n)),Vv({groupAttributes:o})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];u.setError(e,o,r).end()})),Xv(e)}))}},{key:"setGroupAttributes",value:function(e){var t=this,n=e.groupID,o=e.groupAttributes,r=this._checkCachedGroupAttributes({groupID:n,funcName:"setGroupAttributes"});if(!0!==r)return Xv(r);var a=this._groupAttributesMap.get(n),s=a.remoteMainSequence,i=a.avChatRoomKey,u=a.attributes,c=this._transformGroupAttributes(o);c.forEach((function(e){var t=e.key;e.sequence=0,u.has(t)&&(e.sequence=u.get(t).sequence)}));var l=new Uh(bh.SET_GROUP_ATTRIBUTES);return l.setMessage("groupID:".concat(n," mainSequence:").concat(s," groupAttributes:").concat(JSON.stringify(o))),this._groupModule.request({protocolName:U_,requestData:{groupID:n,avChatRoomKey:i,mainSequence:s,groupAttributeList:c}}).then((function(e){var r=e.data,a=r.mainSequence,s=y(r.groupAttributeList);return s.forEach((function(e){e.value=o[e.key]})),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:a,groupAttributeList:s,operationType:"modify"}),l.setNetworkType(t._groupModule.getNetworkType()).end(),wl.log("".concat(t._className,".setGroupAttributes ok. groupID:").concat(n)),Vv({groupAttributes:o})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];l.setError(e,o,r).end()})),Xv(e)}))}},{key:"deleteGroupAttributes",value:function(e){var t=this,n=e.groupID,o=e.keyList,r=void 0===o?[]:o,a=this._checkCachedGroupAttributes({groupID:n,funcName:"deleteGroupAttributes"});if(!0!==a)return Xv(a);var s=this._groupAttributesMap.get(n),i=s.remoteMainSequence,u=s.avChatRoomKey,c=s.attributes,l=y(c.keys()),d=w_,p="clear",g={groupID:n,avChatRoomKey:u,mainSequence:i};if(r.length>0){var _=[];l=[],d=b_,p="delete",r.forEach((function(e){var t=0;c.has(e)&&(t=c.get(e).sequence,l.push(e)),_.push({key:e,sequence:t})})),g.groupAttributeList=_}var h=new Uh(bh.DELETE_GROUP_ATTRIBUTES);return h.setMessage("groupID:".concat(n," mainSequence:").concat(i," keyList:").concat(r," protocolName:").concat(d)),this._groupModule.request({protocolName:d,requestData:g}).then((function(e){var o=e.data.mainSequence;return t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:o,groupAttributeList:r,operationType:p}),h.setNetworkType(t._groupModule.getNetworkType()).end(),wl.log("".concat(t._className,".deleteGroupAttributes ok. groupID:").concat(n)),Vv({keyList:l})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];h.setError(e,o,r).end()})),Xv(e)}))}},{key:"getGroupAttributes",value:function(e){var t=this,n=e.groupID,o=this._checkCachedGroupAttributes({groupID:n,funcName:"getGroupAttributes"});if(!0!==o)return Xv(o);var r=this._groupAttributesMap.get(n),a=r.avChatRoomKey,s=r.lastUpdateTime,i=r.localMainSequence,u=r.remoteMainSequence,c=new Uh(bh.GET_GROUP_ATTRIBUTES);if(c.setMessage("groupID:".concat(n," localMainSequence:").concat(i," remoteMainSequence:").concat(u," keyList:").concat(e.keyList)),Date.now()-s>=this.CACHE_EXPIRE_TIME||i<u)return this._getGroupAttributes({groupID:n,avChatRoomKey:a}).then((function(o){c.setMoreMessage("get attributes from remote. count:".concat(o.length)).setNetworkType(t._groupModule.getNetworkType()).end(),wl.log("".concat(t._className,".getGroupAttributes from remote. groupID:").concat(n));var r=t._getLocalGroupAttributes(e);return Vv({groupAttributes:r})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];c.setError(e,o,r).end()})),Xv(e)}));c.setMoreMessage("get attributes from cache").setNetworkType(this._groupModule.getNetworkType()).end(),wl.log("".concat(this._className,".getGroupAttributes from cache. groupID:").concat(n));var l=this._getLocalGroupAttributes(e);return Jv({groupAttributes:l})}},{key:"_getGroupAttributes",value:function(e){var n=this;return this._groupModule.request({protocolName:F_,requestData:t({},e)}).then((function(t){var o=t.data,r=o.mainSequence,a=o.groupAttributeList,s=y(a);return ed(r)||n._refreshCachedGroupAttributes({groupID:e.groupID,remoteMainSequence:r,groupAttributeList:s,operationType:"get"}),wl.log("".concat(n._className,"._getGroupAttributes ok. groupID:").concat(e.groupID)),a})).catch((function(e){return Xv(e)}))}},{key:"_getLocalGroupAttributes",value:function(e){var t=e.groupID,n=e.keyList,o=void 0===n?[]:n,r={};if(!this._groupAttributesMap.has(t))return r;var a=this._groupAttributesMap.get(t).attributes;if(o.length>0)o.forEach((function(e){a.has(e)&&(r[e]=a.get(e).value)}));else{var s,i=A(a.keys());try{for(i.s();!(s=i.n()).done;){var u=s.value;r[u]=a.get(u).value}}catch(d){i.e(d)}finally{i.f()}}return r}},{key:"_refreshCachedGroupAttributes",value:function(e){var t=e.groupID,n=e.remoteMainSequence,o=e.groupAttributeList,r=e.operationType;if(this._groupAttributesMap.has(t)){var a=this._groupAttributesMap.get(t),s=a.localMainSequence;if("get"===r||n-s==1)a.remoteMainSequence=n,a.localMainSequence=n,a.lastUpdateTime=Date.now(),this._updateCachedAttributes({groupAttributes:a,groupAttributeList:o,operationType:r});else{if(s===n)return;a.remoteMainSequence=n}this._groupAttributesMap.set(t,a);var i="operationType:".concat(r," localMainSequence:").concat(s," remoteMainSequence:").concat(n);wl.log("".concat(this._className,"._refreshCachedGroupAttributes. ").concat(i))}}},{key:"_updateCachedAttributes",value:function(e){var t=e.groupAttributes,n=e.groupAttributeList,o=e.operationType;"clear"!==o?"delete"!==o?("init"===o&&t.attributes.clear(),n.forEach((function(e){var n=e.key,o=e.value,r=e.sequence;t.attributes.set(n,{value:o,sequence:r})}))):n.forEach((function(e){t.attributes.delete(e)})):t.attributes.clear()}},{key:"_checkCachedGroupAttributes",value:function(e){var t=e.groupID,n=e.funcName;if(this._groupModule.hasLocalGroup(t)&&this._groupModule.getLocalGroupProfile(t).type!==hr.GRP_AVCHATROOM)return wl.warn("".concat(this._className,"._checkCachedGroupAttributes. ").concat("非直播群不能使用群属性 API")),new Wv({code:Mh.CANNOT_USE_GRP_ATTR_NOT_AVCHATROOM,message:"非直播群不能使用群属性 API"});var o=this._groupAttributesMap.get(t);if(ed(o)){var r="如果 groupID:".concat(t," 是直播群,使用 ").concat(n," 前先使用 joinGroup 接口申请加入群组,详细请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#joinGroup");return wl.warn("".concat(this._className,"._checkCachedGroupAttributes. ").concat(r)),new Wv({code:Mh.CANNOT_USE_GRP_ATTR_AVCHATROOM_UNJOIN,message:r})}return!0}},{key:"_transformGroupAttributes",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:"_emitGroupAttributesUpdated",value:function(e){var t=this._getLocalGroupAttributes({groupID:e});this._groupModule.emitOuterEvent(_r.GROUP_ATTRIBUTES_UPDATED,{groupID:e,groupAttributes:t})}},{key:"reset",value:function(){this._groupAttributesMap.clear(),this.CACHE_EXPIRE_TIME=3e4}}]),e}(),xM=function(){function e(t){r(this,e);var n=t.manager,o=t.groupID,a=t.onInit,s=t.onSuccess,i=t.onFail;this._className="Polling",this._manager=n,this._groupModule=n._groupModule,this._onInit=a,this._onSuccess=s,this._onFail=i,this._groupID=o,this._timeoutID=-1,this._isRunning=!1,this._protocolName=O_}return i(e,[{key:"start",value:function(){var e=this._groupModule.isLoggedIn();e||(this._protocolName=R_),wl.log("".concat(this._className,".start pollingInterval:").concat(this._manager.getPollingInterval()," isLoggedIn:").concat(e)),this._isRunning=!0,this._request()}},{key:"isRunning",value:function(){return this._isRunning}},{key:"_request",value:function(){var e=this,t=this._onInit(this._groupID);this._groupModule.request({protocolName:this._protocolName,requestData:t}).then((function(t){e._onSuccess(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.getPollingInterval()))})).catch((function(t){e._onFail(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.MAX_POLLING_INTERVAL))}))}},{key:"stop",value:function(){wl.log("".concat(this._className,".stop")),this._timeoutID>0&&(clearTimeout(this._timeoutID),this._timeoutID=-1),this._isRunning=!1}}]),e}(),BM={3:!0,4:!0,5:!0,6:!0,17:!0},KM=function(){function e(t){r(this,e),this._groupModule=t,this._className="AVChatRoomHandler",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this.sequencesLinkedList=new SM(200),this.messageIDLinkedList=new SM(100),this.receivedMessageCount=0,this._reportMessageStackedCount=0,this._onlineMemberCountMap=new Map,this.DEFAULT_EXPIRE_TIME=60,this.DEFAULT_POLLING_INTERVAL=300,this.MAX_POLLING_INTERVAL=2e3,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0,this._startBroadcastSeq=1,this._broadcastMessageIDMap=new Map}return i(e,[{key:"hasJoinedAVChatRoom",value:function(){return this._joinedGroupMap.size>0}},{key:"checkJoinedAVChatRoomByID",value:function(e){return this._joinedGroupMap.has(e)}},{key:"getJoinedAVChatRoom",value:function(){return this._joinedGroupMap.size>0?y(this._joinedGroupMap.keys()):null}},{key:"_updateRequestData",value:function(e){var n=this._pollingRequestInfoMap.get(e);return e===y(this._pollingInstanceMap.keys())[0]?t(t({},n),{},{startBroadcastSeq:this._startBroadcastSeq}):t({},n)}},{key:"_handleSuccess",value:function(e,t){var n=t.data,o=n.key,r=n.nextSeq,a=n.rspMsgList,s=n.errorCode,i=n.nextBroadcastSeq,u=n.broadcastMessageList;if(0!==s){var c=this._pollingRequestInfoMap.get(e),l=new Uh(bh.LONG_POLLING_AV_ERROR),d=c?"".concat(c.key,"-").concat(c.startSeq):"requestInfo is undefined";l.setMessage("".concat(e,"-").concat(d,"-").concat(t.errorInfo)).setCode(t.errorCode).setNetworkType(this._groupModule.getNetworkType()).end(!0)}else{if(!this.checkJoinedAVChatRoomByID(e))return;Xl(o)&&Jl(r)&&this._pollingRequestInfoMap.set(e,{key:o,startSeq:r}),Jl(i)&&i>this._startBroadcastSeq&&(this._startBroadcastSeq=i),$l(a)&&a.length>0?(a.forEach((function(e){e.to=e.groupID})),this.onMessage(a)):(this._pollingNoMessageCount+=1,this._pollingNoMessageCount===this.DEFAULT_POLLING_NO_MESSAGE_COUNT&&(this._pollingInterval=this.DEFAULT_POLLING_INTERVAL+this.DEFAULT_POLLING_INTERVAL_PLUS)),this._onBroadcastMessage(u)}}},{key:"_handleFailure",value:function(e,t){}},{key:"onMessage",value:function(e){if($l(e)&&0!==e.length){0!==this._pollingNoMessageCount&&(this._pollingNoMessageCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL);var t=null,n=[],o=this._getModule(ug),r=this._getModule(Eg),a=e.length;a>1&&e.sort((function(e,t){return e.sequence-t.sequence}));for(var s=this._getModule(cg),i=0;i<a;i++)if(BM[e[i].event]){this.receivedMessageCount+=1,t=this.packMessage(e[i],e[i].event);var u=1===e[i].isModified,c=1===e[i].isHistoryMessage;if((s.isUnlimitedAVChatRoom()||!this.sequencesLinkedList.has(t.sequence))&&!this.messageIDLinkedList.has(t.ID)){var l=t.conversationID;if(this.receivedMessageCount%50==0?this._getModule(Mg).detectFirstRound(l,this.sequencesLinkedList.data()):this.receivedMessageCount%80==0&&this._getModule(Mg).detectSecondRound(l,this.sequencesLinkedList.data()),null!==this.sequencesLinkedList.tail()){var d=this.sequencesLinkedList.tail().value,p=t.sequence-d;p>1&&p<=20?this._getModule(Mg).onMessageMaybeLost(l,d+1,p-1):p<-1&&p>=-20&&this._getModule(Mg).onMessageMaybeLost(l,t.sequence+1,Math.abs(p)-1)}this.sequencesLinkedList.set(t.sequence),this.messageIDLinkedList.set(t.ID);var g=!1;if(this._isMessageSentByCurrentInstance(t)?u&&(g=!0,t.isModified=u,o.updateMessageIsModifiedProperty(t)):g=!0,g){if(t.conversationType===hr.CONV_SYSTEM&&5===t.payload.operationType&&this._onGroupDismissed(t.payload.groupProfile.groupID),!c&&t.conversationType!==hr.CONV_SYSTEM){var _=t.conversationID.replace(hr.CONV_GROUP,"");this._pollingInstanceMap.has(_)?r.addMessageSequence({key:Rh,message:t}):(t.type!==hr.MSG_GRP_TIP&&t.clientTime>0&&r.addMessageDelay(t.clientTime),r.addMessageSequence({key:Oh,message:t}))}n.push(t)}}}else wl.warn("".concat(this._className,".onMessage 未处理的 event 类型: ").concat(e[i].event));if(0!==n.length){this._groupModule.filterModifiedMessage(n);var h=this.packConversationOption(n);h.length>0&&this._getModule(ug).onNewMessage({conversationOptionsList:h,isInstantMessage:!0}),wl.debug("".concat(this._className,".onMessage count:").concat(n.length)),this._checkMessageStacked(n);var f=this._groupModule.filterUnmodifiedMessage(n);f.length>0&&this._groupModule.emitOuterEvent(_r.MESSAGE_RECEIVED,f),n.length=0}}}},{key:"_onGroupDismissed",value:function(e){wl.log("".concat(this._className,"._onGroupDismissed groupID:").concat(e)),this._groupModule.deleteLocalGroupAndConversation(e),this.reset(e)}},{key:"_checkMessageStacked",value:function(e){var t=e.length;t>=100&&(wl.warn("".concat(this._className,"._checkMessageStacked 直播群消息堆积数:").concat(e.length,'!可能会导致微信小程序渲染时遇到 "Dom limit exceeded" 的错误建议接入侧此时只渲染最近的10条消息')),this._reportMessageStackedCount<5&&(new Uh(bh.MESSAGE_STACKED).setNetworkType(this._groupModule.getNetworkType()).setMessage("count:".concat(t," groupID:").concat(y(this._joinedGroupMap.keys()))).setLevel("warning").end(),this._reportMessageStackedCount+=1))}},{key:"_isMessageSentByCurrentInstance",value:function(e){return!!this._getModule(ug).isMessageSentByCurrentInstance(e)}},{key:"packMessage",value:function(e,t){e.currentUser=this._groupModule.getMyUserID(),e.conversationType=5===t?hr.CONV_SYSTEM:hr.CONV_GROUP,e.isSystemMessage=!!e.isSystemMessage;var n=new qv(e),o=this.packElements(e,t);return n.setElement(o),n}},{key:"packElements",value:function(e,n){return 4===n||6===n?(this._updateMemberCountByGroupTips(e),this._onGroupAttributesUpdated(e),{type:hr.MSG_GRP_TIP,content:t(t({},e.elements),{},{groupProfile:e.groupProfile})}):5===n?{type:hr.MSG_GRP_SYS_NOTICE,content:t(t({},e.elements),{},{groupProfile:t(t({},e.groupProfile),{},{groupID:e.groupID})})}:this._getModule(gg).parseElements(e.elements,e.from)}},{key:"packConversationOption",value:function(e){for(var t=new Map,n=0;n<e.length;n++){var o=e[n],r=o.conversationID;if(t.has(r)){var a=t.get(r);a.lastMessage=o,"in"===o.flow&&a.unreadCount++}else t.set(r,{conversationID:o.conversationID,unreadCount:"out"===o.flow?0:1,type:o.conversationType,subType:o.conversationSubType,lastMessage:o})}return y(t.values())}},{key:"_updateMemberCountByGroupTips",value:function(e){var t=e.groupProfile.groupID,n=e.elements.onlineMemberInfo,o=void 0===n?void 0:n;if(!Bd(o)){var r=o.onlineMemberNum,a=void 0===r?0:r,s=o.expireTime,i=void 0===s?this.DEFAULT_EXPIRE_TIME:s,u=this._onlineMemberCountMap.get(t)||{},c=Date.now();Bd(u)?Object.assign(u,{lastReqTime:0,lastSyncTime:0,latestUpdateTime:c,memberCount:a,expireTime:i}):(u.latestUpdateTime=c,u.memberCount=a),wl.debug("".concat(this._className,"._updateMemberCountByGroupTips info:"),u),this._onlineMemberCountMap.set(t,u)}}},{key:"_onBroadcastMessage",value:function(e){if(!Bd(e)){for(var t=[],n=e.length,o=null,r=0;r<n;r++)BM[e[r].event]?((o=this.packMessage(e[r],e[r].event)).isBroadcastMessage=!0,this._broadcastMessageIDMap.has(o.ID)||(t.push(o),this._broadcastMessageIDMap.set(o.ID,1))):wl.warn("".concat(this._className,"._onBroadcastMessage 未处理的 event 类型: ").concat(e[r].event));t.length>0&&this._groupModule.emitOuterEvent(_r.MESSAGE_RECEIVED,t)}}},{key:"start",value:function(e){if(this._pollingInstanceMap.has(e)){var t=this._pollingInstanceMap.get(e);t.isRunning()||t.start()}else{var n=new xM({manager:this,groupID:e,onInit:this._updateRequestData.bind(this),onSuccess:this._handleSuccess.bind(this),onFail:this._handleFailure.bind(this)});n.start(),this._pollingInstanceMap.set(e,n),wl.log("".concat(this._className,".start groupID:").concat(e))}}},{key:"handleJoinResult",value:function(e){var t=this;return this._preCheck().then((function(){var n=e.longPollingKey,o=e.group,r=o.groupID;return t._joinedGroupMap.set(r,o),t._groupModule.updateGroupMap([o]),t._groupModule.deleteUnjoinedAVChatRoom(r),t._groupModule.emitGroupListUpdate(!0,!1),ed(n)?Jv({status:Kl,group:o}):Promise.resolve()}))}},{key:"startRunLoop",value:function(e){var t=this;return this.handleJoinResult(e).then((function(){var n=e.longPollingKey,o=e.group,r=e.startSeq,a=void 0===r?0:r,s=o.groupID;return t._pollingRequestInfoMap.set(s,{key:n,startSeq:a}),t.start(s),t._groupModule.isLoggedIn()?Jv({status:Kl,group:o}):Jv({status:Kl})}))}},{key:"_preCheck",value:function(){if(this._getModule(cg).isUnlimitedAVChatRoom())return Promise.resolve();if(!this.hasJoinedAVChatRoom())return Promise.resolve();var e=M(this._joinedGroupMap.entries().next().value,2),t=e[0],n=e[1];if(this._groupModule.isLoggedIn()){if(n.selfInfo.role!==hr.GRP_MBR_ROLE_OWNER&&n.ownerID!==this._groupModule.getMyUserID())return this._groupModule.quitGroup(t);this._groupModule.deleteLocalGroupAndConversation(t)}else this._groupModule.deleteLocalGroupAndConversation(t);return this.reset(t),Promise.resolve()}},{key:"joinWithoutAuth",value:function(e){var t=this,n=e.groupID,o="".concat(this._className,".joinWithoutAuth"),r=new Uh(bh.JOIN_WITHOUT_AUTH);return this._groupModule.request({protocolName:g_,requestData:e}).then((function(e){var a=e.data.longPollingKey;if(t._groupModule.probeNetwork().then((function(e){var t=M(e,2),o=(t[0],t[1]);r.setNetworkType(o).setMessage("groupID:".concat(n," longPollingKey:").concat(a)).end(!0)})),ed(a))return Xv(new Wv({code:Mh.CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN,message:yh.CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN}));wl.log("".concat(o," ok. groupID:").concat(n)),t._getModule(ug).setCompleted("".concat(hr.CONV_GROUP).concat(n));var s=new DM({groupID:n});return t.startRunLoop({group:s,longPollingKey:a}),Vv({status:Kl})})).catch((function(e){return wl.error("".concat(o," failed. groupID:").concat(n," error:"),e),t._groupModule.probeNetwork().then((function(t){var o=M(t,2),a=o[0],s=o[1];r.setError(e,a,s).setMessage("groupID:".concat(n)).end(!0)})),Xv(e)})).finally((function(){t._groupModule.getModule(dg).reportAtOnce()}))}},{key:"getGroupOnlineMemberCount",value:function(e){var t=this._onlineMemberCountMap.get(e)||{},n=Date.now();return Bd(t)||n-t.lastSyncTime>1e3*t.expireTime&&n-t.latestUpdateTime>1e4&&n-t.lastReqTime>3e3?(t.lastReqTime=n,this._onlineMemberCountMap.set(e,t),this._getGroupOnlineMemberCount(e).then((function(e){return Vv({memberCount:e.memberCount})})).catch((function(e){return Xv(e)}))):Jv({memberCount:t.memberCount})}},{key:"_getGroupOnlineMemberCount",value:function(e){var t=this,n="".concat(this._className,"._getGroupOnlineMemberCount");return this._groupModule.request({protocolName:L_,requestData:{groupID:e}}).then((function(o){var r=t._onlineMemberCountMap.get(e)||{},a=o.data,s=a.onlineMemberNum,i=void 0===s?0:s,u=a.expireTime,c=void 0===u?t.DEFAULT_EXPIRE_TIME:u;wl.log("".concat(n," ok. groupID:").concat(e," memberCount:").concat(i," expireTime:").concat(c));var l=Date.now();return Bd(r)&&(r.lastReqTime=l),t._onlineMemberCountMap.set(e,Object.assign(r,{lastSyncTime:l,latestUpdateTime:l,memberCount:i,expireTime:c})),{memberCount:i}})).catch((function(o){return wl.warn("".concat(n," failed. error:"),o),new Uh(bh.GET_GROUP_ONLINE_MEMBER_COUNT).setCode(o.code).setMessage("groupID:".concat(e," error:").concat(JSON.stringify(o))).setNetworkType(t._groupModule.getNetworkType()).end(),Promise.reject(o)}))}},{key:"_onGroupAttributesUpdated",value:function(e){var t=e.groupID,n=e.elements,o=n.operationType,r=n.newGroupProfile;if(6===o){var a=(void 0===r?void 0:r).groupAttributeOption;Bd(a)||this._groupModule.onGroupAttributesUpdated({groupID:t,groupAttributeOption:a})}}},{key:"_getModule",value:function(e){return this._groupModule.getModule(e)}},{key:"setPollingInterval",value:function(e){ed(e)||(Jl(e)?this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=e:this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=parseInt(e,10))}},{key:"setPollingIntervalPlus",value:function(e){ed(e)||(Jl(e)?this.DEFAULT_POLLING_INTERVAL_PLUS=e:this.DEFAULT_POLLING_INTERVAL_PLUS=parseInt(e,10))}},{key:"setPollingNoMessageCount",value:function(e){ed(e)||(Jl(e)?this.DEFAULT_POLLING_NO_MESSAGE_COUNT=e:this.DEFAULT_POLLING_NO_MESSAGE_COUNT=parseInt(e,10))}},{key:"getPollingInterval",value:function(){return this._pollingInterval}},{key:"onAVChatRoomMemberBanned",value:function(e){var t=e.payload.groupProfile.groupID;wl.log("".concat(this._className,".onAVChatRoomMemberBanned groupID:").concat(t)),this._groupModule.deleteLocalGroupAndConversation(t),this.reset(t)}},{key:"reset",value:function(e){if(e){wl.log("".concat(this._className,".reset groupID:").concat(e));var t=this._pollingInstanceMap.get(e);t&&t.stop(),this._pollingInstanceMap.delete(e),this._joinedGroupMap.delete(e),this._pollingRequestInfoMap.delete(e),this._onlineMemberCountMap.delete(e)}else{wl.log("".concat(this._className,".reset all"));var n,o=A(this._pollingInstanceMap.values());try{for(o.s();!(n=o.n()).done;)n.value.stop()}catch(a){o.e(a)}finally{o.f()}this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear(),this._broadcastMessageIDMap.clear()}this.sequencesLinkedList.reset(),this.messageIDLinkedList.reset(),this.receivedMessageCount=0,this._reportMessageStackedCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=300,this.DEFAULT_POLLING_NO_MESSAGE_COUNT=20,this.DEFAULT_POLLING_INTERVAL_PLUS=2e3,this._pollingNoMessageCount=0}}]),e}(),HM=1,jM=15,WM=function(){function e(t){r(this,e),this._groupModule=t,this._className="GroupSystemNoticeHandler",this.pendencyMap=new Map}return i(e,[{key:"onNewGroupSystemNotice",value:function(e){var t=e.dataList,n=e.isSyncingEnded,o=e.isInstantMessage;wl.debug("".concat(this._className,".onReceiveSystemNotice count:").concat(t.length));var r=this.newSystemNoticeStoredAndSummary({notifiesList:t,isInstantMessage:o}),a=r.eventDataList,s=r.result;a.length>0&&(this._groupModule.getModule(ug).onNewMessage({conversationOptionsList:a,isInstantMessage:o}),this._onReceivedGroupSystemNotice({result:s,isInstantMessage:o})),o?s.length>0&&this._groupModule.emitOuterEvent(_r.MESSAGE_RECEIVED,s):!0===n&&this._clearGroupSystemNotice()}},{key:"newSystemNoticeStoredAndSummary",value:function(e){var n=e.notifiesList,o=e.isInstantMessage,r=null,a=n.length,s=0,i=[],u={conversationID:hr.CONV_SYSTEM,unreadCount:0,type:hr.CONV_SYSTEM,subType:null,lastMessage:null};for(s=0;s<a;s++){var c=n[s],l=c.groupProfile,d=l.communityType,p=void 0===d?0:d,g=l.topicID,_=void 0===g?void 0:g,h=c.elements,f=h.topicIDList,m=void 0===f?void 0:f,v=h.operationType;if(!(2!==p||Bd(_)&&Bd(m))){if([17,18,20].includes(v)){this._handleTopicSystemNotice(c);continue}Bd(_)||(c.to=_)}c.elements.operationType!==jM&&(c.currentUser=this._groupModule.getMyUserID(),c.conversationType=hr.CONV_SYSTEM,c.conversationID=hr.CONV_SYSTEM,(r=new qv(c)).setElement({type:hr.MSG_GRP_SYS_NOTICE,content:t(t({},c.elements),{},{groupProfile:t({},c.groupProfile)})}),r.isSystemMessage=!0,(1===r.sequence&&1===r.random||2===r.sequence&&2===r.random)&&(r.sequence=dd(),r.random=dd(),r.generateMessageID(),wl.log("".concat(this._className,".newSystemNoticeStoredAndSummary sequence and random maybe duplicated, regenerate. ID:").concat(r.ID))),this._groupModule.getModule(ug).pushIntoNoticeResult(i,r)&&(o?u.unreadCount++:r.setIsRead(!0),u.subType=r.conversationSubType))}return u.lastMessage=i[i.length-1],{eventDataList:i.length>0?[u]:[],result:i}}},{key:"_clearGroupSystemNotice",value:function(){var e=this;this.getPendencyList().then((function(t){t.forEach((function(t){e.pendencyMap.set("".concat(t.from,"_").concat(t.groupID,"_").concat(t.to),t)}));var n=e._groupModule.getModule(ug).getLocalMessageList(hr.CONV_SYSTEM),o=[];n.forEach((function(t){var n=t.payload,r=n.operatorID,a=n.operationType,s=n.groupProfile;if(a===HM){var i="".concat(r,"_").concat(s.groupID,"_").concat(s.to),u=e.pendencyMap.get(i);u&&Jl(u.handled)&&0!==u.handled&&o.push(t)}})),e.deleteGroupSystemNotice({messageList:o})}))}},{key:"deleteGroupSystemNotice",value:function(e){var t=this,n="".concat(this._className,".deleteGroupSystemNotice");return $l(e.messageList)&&0!==e.messageList.length?(wl.log("".concat(n," ")+e.messageList.map((function(e){return e.ID}))),this._groupModule.request({protocolName:N_,requestData:{messageListToDelete:e.messageList.map((function(e){return{from:hr.CONV_SYSTEM,messageSeq:e.clientSequence,messageRandom:e.random}}))}}).then((function(){wl.log("".concat(n," ok"));var o=t._groupModule.getModule(ug);return e.messageList.forEach((function(e){o.deleteLocalMessage(e)})),Vv()})).catch((function(e){return wl.error("".concat(n," error:"),e),Xv(e)}))):Jv()}},{key:"getPendencyList",value:function(e){var t=this;return this._groupModule.request({protocolName:D_,requestData:{startTime:e&&e.startTime?e.startTime:0,limit:e&&e.limit?e.limit:10,handleAccount:this._groupModule.getMyUserID()}}).then((function(e){var n=e.data.pendencyList;return 0!==e.data.nextStartTime?t.getPendencyList({startTime:e.data.nextStartTime}).then((function(e){return[].concat(y(n),y(e))})):n}))}},{key:"_onReceivedGroupSystemNotice",value:function(e){var t=this,n=e.result;e.isInstantMessage&&n.forEach((function(e){switch(e.payload.operationType){case 1:break;case 2:t._onApplyGroupRequestAgreed(e);break;case 3:break;case 4:t._onMemberKicked(e);break;case 5:t._onGroupDismissed(e);break;case 6:break;case 7:t._onInviteGroup(e);break;case 8:t._onQuitGroup(e);break;case 9:t._onSetManager(e);break;case 10:t._onDeleteManager(e);break;case 11:case 12:case 15:break;case 20:t._onMessageRemindTypeSynced(e);break;case 21:t._groupModule.onAVChatRoomMemberBanned(e)}}))}},{key:"_onApplyGroupRequestAgreed",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;if(n){t._groupModule.updateGroupMap([n]);var o=!n.isSupportTopic;t._groupModule.emitGroupListUpdate(!0,o)}}))}},{key:"_onMemberKicked",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:"_onGroupDismissed",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t);var n=this._groupModule._AVChatRoomHandler;n&&n.checkJoinedAVChatRoomByID(t)&&n.reset(t)}},{key:"_onInviteGroup",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;n&&(t._groupModule.updateGroupMap([n]),t._groupModule.emitGroupListUpdate())}))}},{key:"_onQuitGroup",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:"_onSetManager",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,r=this._groupModule.getModule(sg).getLocalGroupMemberInfo(o,n);r&&r.updateRole(hr.GRP_MBR_ROLE_ADMIN)}},{key:"_onDeleteManager",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,r=this._groupModule.getModule(sg).getLocalGroupMemberInfo(o,n);r&&r.updateRole(hr.GRP_MBR_ROLE_MEMBER)}},{key:"_onMessageRemindTypeSynced",value:function(e){var t=e.payload.groupProfile.groupID,n=e.payload.messageRemindType;this._groupModule.getModule(ug).onGroupMessageRemindTypeSynced({groupID:t,messageRemindType:n})}},{key:"_handleTopicSystemNotice",value:function(e){var t=e.groupProfile,n=t.groupID,o=t.topicID,r=e.elements,a=r.operationType,s=r.topicIDList,i=r.messageRemindType,u=this._groupModule.getModule(ig);17===a?u.onTopicCreated({groupID:n,topicID:o}):18===a?u.onTopicDeleted({groupID:n,topicIDList:s}):20===a&&u.onTopicMessageRemindTypeUpdated({groupID:n,topicID:o,messageRemindType:i})}},{key:"reset",value:function(){this.pendencyMap.clear()}}]),e}(),YM=["relayFlag"],zM=function(e){c(o,e);var n=v(o);function o(e){var t;return r(this,o),(t=n.call(this,e))._className="GroupModule",t._commonGroupHandler=null,t._AVChatRoomHandler=null,t._groupSystemNoticeHandler=null,t._commonGroupHandler=new FM(f(t)),t._groupAttributesHandler=new VM(f(t)),t._AVChatRoomHandler=new KM(f(t)),t._groupTipsHandler=new wM(f(t)),t._groupSystemNoticeHandler=new WM(f(t)),t.groupMap=new Map,t._unjoinedAVChatRoomList=new Map,t._receiptDetailCompleteMap=new Map,t.getInnerEmitterInstance().on(_M,t._onCloudConfigUpdated,f(t)),t}return i(o,[{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("polling_interval"),t=this.getCloudConfig("polling_interval_plus"),n=this.getCloudConfig("polling_no_msg_count");this._AVChatRoomHandler&&(wl.log("".concat(this._className,"._onCloudConfigUpdated pollingInterval:").concat(e)+" pollingIntervalPlus:".concat(t," pollingNoMessageCount:").concat(n)),this._AVChatRoomHandler.setPollingInterval(e),this._AVChatRoomHandler.setPollingIntervalPlus(t),this._AVChatRoomHandler.setPollingNoMessageCount(n))}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(e),this._groupTipsHandler.onCheckTimer(e))}},{key:"guardForAVChatRoom",value:function(e){var t=this;if(e.conversationType===hr.CONV_GROUP){var n=Td(e.to)?wd(e.to):e.to;return this.hasLocalGroup(n)?Jv():this.getGroupProfile({groupID:n}).then((function(o){var r=o.data.group.type;if(wl.log("".concat(t._className,".guardForAVChatRoom. groupID:").concat(n," type:").concat(r)),r===hr.GRP_AVCHATROOM){var a="userId:".concat(e.from," 未加入群 groupID:").concat(n,"。发消息前先使用 joinGroup 接口申请加群,详细请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#joinGroup");return wl.warn("".concat(t._className,".guardForAVChatRoom sendMessage not allowed. ").concat(a)),Xv(new Wv({code:Mh.MESSAGE_SEND_FAIL,message:a,data:{message:e}}))}return Jv()}))}return Jv()}},{key:"checkJoinedAVChatRoomByID",value:function(e){return!!this._AVChatRoomHandler&&this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"onNewGroupMessage",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.onNewGroupMessage(e)}},{key:"updateNextMessageSeq",value:function(e){var t=this;if($l(e)){var n=this.getModule(ig);e.forEach((function(e){var o=e.conversationID.replace(hr.CONV_GROUP,"");if(Td(o)){var r=o,a=e.lastMessage.sequence+1;o=wd(r);var s=n.getLocalTopic(o,r);s&&(s.updateNextMessageSeq(a),s.updateLastMessage(e.lastMessage))}t.groupMap.has(o)&&(t.groupMap.get(o).nextMessageSeq=e.lastMessage.sequence+1)}))}}},{key:"onNewGroupTips",value:function(e){this._groupTipsHandler&&this._groupTipsHandler.onNewGroupTips(e)}},{key:"onGroupMessageRevoked",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.onGroupMessageRevoked(e)}},{key:"onNewGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler&&this._groupSystemNoticeHandler.onNewGroupSystemNotice(e)}},{key:"onGroupMessageReadNotice",value:function(e){var t=this;e.dataList.forEach((function(e){var n=e.elements.groupMessageReadNotice;if(!ed(n)){var o=t.getModule(ug);n.forEach((function(e){var n=e.groupID,r=e.topicID,a=void 0===r?void 0:r,s=e.lastMessageSeq;wl.debug("".concat(t._className,".onGroupMessageReadNotice groupID:").concat(n," lastMessageSeq:").concat(s));var i="".concat(hr.CONV_GROUP).concat(n),u=!0;Bd(a)||(i="".concat(hr.CONV_GROUP).concat(a),u=!1),o.updateIsReadAfterReadReport({conversationID:i,lastMessageSeq:s}),o.updateUnreadCount(i,u),o.clearGroupAtInfoList(i,u)}))}}))}},{key:"onReadReceiptList",value:function(e){var t=this;wl.debug("".concat(this._className,".onReadReceiptList options:"),JSON.stringify(e)),e.dataList.forEach((function(e){var n=e.groupProfile,o=e.elements,r=n.groupID,a=t.getModule(ug),s=o.readReceiptList;a.updateReadReceiptInfo({groupID:r,readReceiptList:s})}))}},{key:"onGroupMessageModified",value:function(e){wl.debug("".concat(this._className,".onGroupMessageModified options:"),JSON.stringify(e));var n=this.getModule(ug);e.dataList.forEach((function(e){n.onMessageModified(t(t({},e),{},{conversationType:hr.CONV_GROUP,to:e.topicID?e.topicID:e.groupID}))}))}},{key:"deleteGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler&&this._groupSystemNoticeHandler.deleteGroupSystemNotice(e)}},{key:"initGroupMap",value:function(e){this.groupMap.set(e.groupID,new DM(e))}},{key:"deleteGroup",value:function(e){this.groupMap.delete(e)}},{key:"updateGroupMap",value:function(e){var t,n=this,o=this.getModule(ug);e.forEach((function(e){t=e.groupID,n.groupMap.has(t)?n.groupMap.get(t).updateGroup(e):(n.groupMap.set(t,new DM(e)),o.deleteGroupRomaingMessageInfo(t))}));var r,a=this.getMyUserID(),s=A(this.groupMap);try{for(s.s();!(r=s.n()).done;)M(r.value,2)[1].selfInfo.userID=a}catch(c){s.e(c)}finally{s.f()}this._setStorageGroupList()}},{key:"getStorageGroupList",value:function(){return this.getModule(lg).getItem("groupMap")}},{key:"_setStorageGroupList",value:function(){var e=this.getLocalGroupList().filter((function(e){var t=e.type;return!yd(t)})).filter((function(e){return!e.isSupportTopic})).slice(0,20).map((function(e){return{groupID:e.groupID,name:e.name,avatar:e.avatar,type:e.type}}));this.getModule(lg).setItem("groupMap",e)}},{key:"getGroupMap",value:function(){return this.groupMap}},{key:"getLocalGroupList",value:function(){return y(this.groupMap.values())}},{key:"getLocalGroupProfile",value:function(e){return this.groupMap.get(e)}},{key:"sortLocalGroupList",value:function(){var e=y(this.groupMap).filter((function(e){var t=M(e,2);return t[0],!Bd(t[1].lastMessage)}));e.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime})),this.groupMap=new Map(y(e))}},{key:"updateGroupLastMessage",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.handleUpdateGroupLastMessage(e)}},{key:"emitGroupListUpdate",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalGroupList();if(e&&this.emitOuterEvent(_r.GROUP_LIST_UPDATED),t){var o=JSON.parse(JSON.stringify(n)),r=this.getModule(ug);r.updateConversationGroupProfile(o)}}},{key:"patchGroupMessageRemindType",value:function(){var e=this.getLocalGroupList(),t=this.getModule(ug),n=0;e.forEach((function(e){!0===t.patchMessageRemindType({ID:e.groupID,isC2CConversation:!1,messageRemindType:e.selfInfo.messageRemindType})&&(n+=1)})),wl.log("".concat(this._className,".patchGroupMessageRemindType count:").concat(n))}},{key:"recomputeUnreadCount",value:function(){var e=this.getLocalGroupList(),t=this.getModule(ug);e.forEach((function(e){var n=e.groupID,o=e.selfInfo,r=o.excludedUnreadSequenceList,a=o.readedSequence;if($l(r)){var s=0;r.forEach((function(t){t>=a&&t<=e.nextMessageSeq-1&&(s+=1)})),s>=1&&t.recomputeGroupUnreadCount({conversationID:"".concat(hr.CONV_GROUP).concat(n),count:s})}}))}},{key:"getMyNameCardByGroupID",value:function(e){var t=this.getLocalGroupProfile(e);return t?t.selfInfo.nameCard:""}},{key:"isPagingGetCompleted",value:function(){return!!this._commonGroupHandler&&this._commonGroupHandler.isPagingGetCompleted()}},{key:"getGroupList",value:function(e){return this._commonGroupHandler?this._commonGroupHandler.getGroupList(e):Jv()}},{key:"getGroupProfile",value:function(e){var t=this,n=new Uh(bh.GET_GROUP_PROFILE),o="".concat(this._className,".getGroupProfile"),r=e.groupID,a=e.groupCustomFieldFilter;wl.log("".concat(o," groupID:").concat(r));var s={groupIDList:[r],responseFilter:{groupBaseInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember"],groupCustomFieldFilter:a,memberInfoFilter:["Role","JoinTime","MsgSeq","MsgFlag","NameCard"]}};return this.getGroupProfileAdvance(s).then((function(e){var a,s=e.data,i=s.successGroupList,u=s.failureGroupList;return wl.log("".concat(o," ok")),u.length>0?Xv(u[0]):(yd(i[0].type)&&!t.hasLocalGroup(r)?a=new DM(i[0]):(t.updateGroupMap(i),a=t.getLocalGroupProfile(r)),a.isSupportTopic||t.getModule(ug).updateConversationGroupProfile([a]),n.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(r," type:").concat(a.type," muteAllMembers:").concat(a.muteAllMembers," ownerID:").concat(a.ownerID)).end(),Vv({group:a}))})).catch((function(r){return t.probeNetwork().then((function(t){var o=M(t,2),a=o[0],s=o[1];n.setError(r,a,s).setMessage("groupID:".concat(e.groupID)).end()})),wl.error("".concat(o," failed. error:"),r),Xv(r)}))}},{key:"getGroupProfileAdvance",value:function(e){var n=this,o="".concat(this._className,".getGroupProfileAdvance"),r=e.groupIDList;$l(r)&&r.length>50&&(wl.warn("".concat(o," 获取群资料的数量不能超过50个")),r.length=50);var a=[],s=[];r.forEach((function(e){Id({groupID:e})?s.push(e):a.push(e)}));var i=[];if(a.length>0){var u=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:a}));i.push(u)}if(s.length>0){var c=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:s,relayFlag:a.length>0}));i.push(c)}return Promise.all(i).then((function(e){var t=[],n=[];return e.forEach((function(e){t.push.apply(t,y(e.successGroupList)),n.push.apply(n,y(e.failureGroupList))})),Vv({successGroupList:t,failureGroupList:n})})).catch((function(e){return wl.error("".concat(n._className,"._getGroupProfileAdvance failed. error:"),e),Xv(e)}))}},{key:"_getGroupProfileAdvance",value:function(e){var t=this,n=e.relayFlag,o=void 0!==n&&n,r=h(e,YM);return this.request({protocolName:u_,requestData:r}).then((function(e){wl.log("".concat(t._className,"._getGroupProfileAdvance ok."));var n=e.data.groups;return{successGroupList:n.filter((function(e){return ed(e.errorCode)||0===e.errorCode})),failureGroupList:n.filter((function(e){return e.errorCode&&0!==e.errorCode})).map((function(e){return new Wv({code:e.errorCode,message:e.errorInfo,data:{groupID:e.groupID}})}))}})).catch((function(t){return o&&Id({groupID:e.groupIDList[0]})?{successGroupList:[],failureGroupList:[]}:Xv(t)}))}},{key:"createGroup",value:function(e){var n=this,o="".concat(this._className,".createGroup"),r=e.type,a=e.groupID;if(!["Public","Private","ChatRoom","AVChatRoom","Community"].includes(r))return Xv({code:Mh.ILLEGAL_GROUP_TYPE,message:yh.ILLEGAL_GROUP_TYPE});if(!Id({type:r})){if(!Bd(a)&&Id({groupID:a}))return Xv({code:Mh.ILLEGAL_GROUP_ID,message:yh.ILLEGAL_GROUP_ID});e.isSupportTopic=void 0}if(yd(r)&&!ed(e.memberList)&&e.memberList.length>0&&(wl.warn("".concat(o," 创建 AVChatRoom 时不能添加群成员,自动忽略该字段")),e.memberList=void 0),Md(r)||ed(e.joinOption)||(wl.warn("".concat(o," 创建 Work/Meeting/AVChatRoom/Community 群时不能设置字段 joinOption自动忽略该字段")),e.joinOption=void 0),Id({type:r})){if(!Bd(a)&&!Id({groupID:a}))return Xv({code:Mh.ILLEGAL_GROUP_ID,message:yh.ILLEGAL_GROUP_ID});e.isSupportTopic=!0===e.isSupportTopic?1:0}var s=new Uh(bh.CREATE_GROUP);wl.log("".concat(o," options:"),e);var i=[];return this.request({protocolName:c_,requestData:t(t({},e),{},{ownerID:this.getMyUserID(),webPushFlag:1})}).then((function(r){var a=r.data,u=a.groupID,c=a.overLimitUserIDList,l=void 0===c?[]:c;if(i=l,s.setNetworkType(n.getNetworkType()).setMessage("groupType:".concat(e.type," groupID:").concat(u," overLimitUserIDList=").concat(l)).end(),wl.log("".concat(o," ok groupID:").concat(u," overLimitUserIDList:"),l),e.type===hr.GRP_AVCHATROOM)return n.getGroupProfile({groupID:u});if(e.type===hr.GRP_COMMUNITY&&1===e.isSupportTopic)return n.getGroupProfile({groupID:u});Bd(e.memberList)||Bd(l)||(e.memberList=e.memberList.filter((function(e){return-1===l.indexOf(e.userID)}))),n.updateGroupMap([t(t({},e),{},{groupID:u})]);var d=n.getModule(tg),p=d.createCustomMessage({to:u,conversationType:hr.CONV_GROUP,payload:{data:"group_create",extension:"".concat(n.getMyUserID(),"创建群组")}});return d.sendMessageInstance(p),n.emitGroupListUpdate(),n.getGroupProfile({groupID:u})})).then((function(e){var t=e.data.group,n=t.selfInfo,o=n.nameCard,r=n.joinTime;return t.updateSelfInfo({nameCard:o,joinTime:r,messageRemindType:hr.MSG_REMIND_ACPT_AND_NOTE,role:hr.GRP_MBR_ROLE_OWNER}),Vv({group:t,overLimitUserIDList:i})})).catch((function(t){return s.setMessage("groupType:".concat(e.type)),n.probeNetwork().then((function(e){var n=M(e,2),o=n[0],r=n[1];s.setError(t,o,r).end()})),wl.error("".concat(o," failed. error:"),t),Xv(t)}))}},{key:"dismissGroup",value:function(e){var t=this,n="".concat(this._className,".dismissGroup");if(this.hasLocalGroup(e)&&this.getLocalGroupProfile(e).type===hr.GRP_WORK)return Xv(new Wv({code:Mh.CANNOT_DISMISS_WORK,message:yh.CANNOT_DISMISS_WORK}));var o=new Uh(bh.DISMISS_GROUP);return o.setMessage("groupID:".concat(e)),wl.log("".concat(n," groupID:").concat(e)),this.request({protocolName:l_,requestData:{groupID:e}}).then((function(){return o.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(n," ok")),t.deleteLocalGroupAndConversation(e),t.checkJoinedAVChatRoomByID(e)&&t._AVChatRoomHandler.reset(e),Vv({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),r=n[0],a=n[1];o.setError(e,r,a).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"updateGroupProfile",value:function(e){var t=this,n="".concat(this._className,".updateGroupProfile");!this.hasLocalGroup(e.groupID)||Md(this.getLocalGroupProfile(e.groupID).type)||ed(e.joinOption)||(wl.warn("".concat(n," Work/Meeting/AVChatRoom/Community 群不能设置字段 joinOption自动忽略该字段")),e.joinOption=void 0),ed(e.muteAllMembers)||(e.muteAllMembers?e.muteAllMembers="On":e.muteAllMembers="Off");var o=new Uh(bh.UPDATE_GROUP_PROFILE);return o.setMessage(JSON.stringify(e)),wl.log("".concat(n," groupID:").concat(e.groupID)),this.request({protocolName:d_,requestData:e}).then((function(){return o.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(n," ok")),t.hasLocalGroup(e.groupID)&&(t.groupMap.get(e.groupID).updateGroup(e),t._setStorageGroupList()),Vv({group:t.groupMap.get(e.groupID)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),r=n[0],a=n[1];o.setError(e,r,a).end()})),wl.log("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"joinGroup",value:function(e){var t=this,n=e.groupID,o=e.type,r="".concat(this._className,".joinGroup");if(o===hr.GRP_WORK){var a=new Wv({code:Mh.CANNOT_JOIN_WORK,message:yh.CANNOT_JOIN_WORK});return Xv(a)}if(this.deleteUnjoinedAVChatRoom(n),this.hasLocalGroup(n)){if(!this.isLoggedIn())return Jv({status:hr.JOIN_STATUS_ALREADY_IN_GROUP});var s=new Uh(bh.APPLY_JOIN_GROUP);return this.getGroupProfile({groupID:n}).then((function(){return s.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(n," joinedStatus:").concat(hr.JOIN_STATUS_ALREADY_IN_GROUP)).end(),Jv({status:hr.JOIN_STATUS_ALREADY_IN_GROUP})})).catch((function(o){return s.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(n," unjoined")).end(),wl.warn("".concat(r," ").concat(n," was unjoined, now join!")),t.groupMap.delete(n),t.applyJoinGroup(e)}))}return wl.log("".concat(r," groupID:").concat(n)),this.isLoggedIn()?this.applyJoinGroup(e):this._AVChatRoomHandler.joinWithoutAuth(e)}},{key:"applyJoinGroup",value:function(e){var n=this,o="".concat(this._className,".applyJoinGroup"),r=e.groupID,a=new Uh(bh.APPLY_JOIN_GROUP),s=t({},e),i=this.canIUse(wc.AVCHATROOM_HISTORY_MSG);return i&&(s.historyMessageFlag=1),this.getModule(ug).deleteTopicRoamingMessageInfo(r),this.request({protocolName:p_,requestData:s}).then((function(e){var t=e.data,s=t.joinedStatus,u=t.longPollingKey,c=t.startSeq,l=t.avChatRoomFlag,d=t.avChatRoomKey,p=t.messageList,g="groupID:".concat(r," joinedStatus:").concat(s," longPollingKey:").concat(u," startSeq:").concat(c)+" avChatRoomFlag:".concat(l," canGetAVChatRoomHistoryMessage:").concat(i,",")+" history message count:".concat(Bd(p)?0:p.length);switch(a.setNetworkType(n.getNetworkType()).setMessage("".concat(g)).end(),wl.log("".concat(o," ok. ").concat(g)),s){case Hl:return Vv({status:Hl});case Kl:return n.getGroupProfile({groupID:r}).then((function(e){var t,o=e.data.group,a={status:Kl,group:o};return 1===l?(n.getModule(ug).setCompleted("".concat(hr.CONV_GROUP).concat(r)),n._groupAttributesHandler.initGroupAttributesCache({groupID:r,avChatRoomKey:d}),(t=ed(u)?n._AVChatRoomHandler.handleJoinResult({group:o}):n._AVChatRoomHandler.startRunLoop({longPollingKey:u,group:o,startSeq:c})).then((function(){n._onAVChatRoomHistoryMessage(p)})),t):(n.emitGroupListUpdate(!0,!1),Vv(a))}));default:var _=new Wv({code:Mh.JOIN_GROUP_FAIL,message:yh.JOIN_GROUP_FAIL});return wl.error("".concat(o," error:"),_),Xv(_)}})).catch((function(t){return a.setMessage("groupID:".concat(e.groupID)),n.probeNetwork().then((function(e){var n=M(e,2),o=n[0],r=n[1];a.setError(t,o,r).end()})),wl.error("".concat(o," error:"),t),Xv(t)}))}},{key:"quitGroup",value:function(e){var t=this,n="".concat(this._className,".quitGroup");wl.log("".concat(n," groupID:").concat(e));var o=this.checkJoinedAVChatRoomByID(e);if(!o&&!this.hasLocalGroup(e)){var r=new Wv({code:Mh.MEMBER_NOT_IN_GROUP,message:yh.MEMBER_NOT_IN_GROUP});return Xv(r)}if(o&&!this.isLoggedIn())return wl.log("".concat(n," anonymously ok. groupID:").concat(e)),this.deleteLocalGroupAndConversation(e),this._AVChatRoomHandler.reset(e),Jv({groupID:e});var a=new Uh(bh.QUIT_GROUP);return a.setMessage("groupID:".concat(e)),this.request({protocolName:__,requestData:{groupID:e}}).then((function(){return a.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(n," ok")),t.deleteLocalGroupAndConversation(e),o&&t._AVChatRoomHandler.reset(e),Vv({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];a.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"searchGroupByID",value:function(e){var t=this,n="".concat(this._className,".searchGroupByID"),o={groupIDList:[e]},r=new Uh(bh.SEARCH_GROUP_BY_ID);return r.setMessage("groupID:".concat(e)),wl.log("".concat(n," groupID:").concat(e)),this.request({protocolName:h_,requestData:o}).then((function(e){var o=e.data.groupProfile;if(0!==o[0].errorCode)throw new Wv({code:o[0].errorCode,message:o[0].errorInfo});return r.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(n," ok")),Vv({group:new DM(o[0])})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),wl.warn("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"changeGroupOwner",value:function(e){var t=this,n="".concat(this._className,".changeGroupOwner");if(this.hasLocalGroup(e.groupID)&&this.getLocalGroupProfile(e.groupID).type===hr.GRP_AVCHATROOM)return Xv(new Wv({code:Mh.CANNOT_CHANGE_OWNER_IN_AVCHATROOM,message:yh.CANNOT_CHANGE_OWNER_IN_AVCHATROOM}));if(e.newOwnerID===this.getMyUserID())return Xv(new Wv({code:Mh.CANNOT_CHANGE_OWNER_TO_SELF,message:yh.CANNOT_CHANGE_OWNER_TO_SELF}));var o=new Uh(bh.CHANGE_GROUP_OWNER);return o.setMessage("groupID:".concat(e.groupID," newOwnerID:").concat(e.newOwnerID)),wl.log("".concat(n," groupID:").concat(e.groupID)),this.request({protocolName:f_,requestData:e}).then((function(){o.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(n," ok"));var r=e.groupID,a=e.newOwnerID;t.groupMap.get(r).ownerID=a;var s=t.getModule(sg).getLocalGroupMemberList(r);if(s instanceof Map){var i=s.get(t.getMyUserID());ed(i)||(i.updateRole("Member"),t.groupMap.get(r).selfInfo.role="Member");var u=s.get(a);ed(u)||u.updateRole("Owner")}return t.emitGroupListUpdate(!0,!1),Vv({group:t.groupMap.get(r)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),r=n[0],a=n[1];o.setError(e,r,a).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"handleGroupApplication",value:function(e){var n=this,o="".concat(this._className,".handleGroupApplication"),r=e.message.payload,a=r.groupProfile.groupID,s=r.authentication,i=r.messageKey,u=r.operatorID,c=new Uh(bh.HANDLE_GROUP_APPLICATION);return c.setMessage("groupID:".concat(a)),wl.log("".concat(o," groupID:").concat(a)),this.request({protocolName:m_,requestData:t(t({},e),{},{applicant:u,groupID:a,authentication:s,messageKey:i})}).then((function(){return c.setNetworkType(n.getNetworkType()).end(),wl.log("".concat(o," ok")),n._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),Vv({group:n.getLocalGroupProfile(a)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];c.setError(e,o,r).end()})),wl.error("".concat(o," failed. error"),e),Xv(e)}))}},{key:"handleGroupInvitation",value:function(e){var n=this,o="".concat(this._className,".handleGroupInvitation"),r=e.message.payload,a=r.groupProfile.groupID,s=r.authentication,i=r.messageKey,u=r.operatorID,c=e.handleAction,l=new Uh(bh.HANDLE_GROUP_INVITATION);return l.setMessage("groupID:".concat(a," inviter:").concat(u," handleAction:").concat(c)),wl.log("".concat(o," groupID:").concat(a," inviter:").concat(u," handleAction:").concat(c)),this.request({protocolName:v_,requestData:t(t({},e),{},{inviter:u,groupID:a,authentication:s,messageKey:i})}).then((function(){return l.setNetworkType(n.getNetworkType()).end(),wl.log("".concat(o," ok")),n._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),Vv({group:n.getLocalGroupProfile(a)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];l.setError(e,o,r).end()})),wl.error("".concat(o," failed. error"),e),Xv(e)}))}},{key:"getGroupOnlineMemberCount",value:function(e){return this._AVChatRoomHandler?this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)?this._AVChatRoomHandler.getGroupOnlineMemberCount(e):Jv({memberCount:0}):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"hasLocalGroup",value:function(e){return this.groupMap.has(e)}},{key:"deleteLocalGroupAndConversation",value:function(e){var t=this.checkJoinedAVChatRoomByID(e);if(wl.log("".concat(this._className,".deleteLocalGroupAndConversation isJoinedAVChatRoom:").concat(t)),t&&this.getModule(ug).deleteLocalConversation("".concat(hr.CONV_GROUP).concat(e)),Id({groupID:e})){var n=this.getLocalGroupProfile(e);n&&!0===n.isSupportTopic&&this.getModule(ig).deleteTopicListInCommunity(e)}this._deleteLocalGroup(e),this.emitGroupListUpdate(!0,!1)}},{key:"_deleteLocalGroup",value:function(e){this.groupMap.delete(e),this.getModule(sg).deleteGroupMemberList(e),this._setStorageGroupList()}},{key:"sendMessage",value:function(e,t){var n=this.createGroupMessagePack(e,t);return this.request(n)}},{key:"createGroupMessagePack",value:function(e,t){var n=null;t&&t.offlinePushInfo&&(n=t.offlinePushInfo);var o="";Xl(e.cloudCustomData)&&e.cloudCustomData.length>0&&(o=e.cloudCustomData);var r=[];if(Zl(t)&&Zl(t.messageControlInfo)){var a=t.messageControlInfo,s=a.excludedFromUnreadCount,i=a.excludedFromLastMessage;!0===s&&r.push("NoUnread"),!0===i&&r.push("NoLastMsg")}var u=e.getGroupAtInfoList(),c={fromAccount:this.getMyUserID(),groupID:e.to,msgBody:e.getElements(),cloudCustomData:o,random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:e.type!==hr.MSG_TEXT||Bd(u)?void 0:u,onlineOnlyFlag:this.isOnlineMessage(e,t)?1:0,clientTime:e.clientTime,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||"",desc:n.description||"",ext:n.extension||"",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||""}}:void 0,messageControlInfo:r,needReadReceipt:!0!==e.needReadReceipt||this.isMessageFromOrToAVChatroom(e.to)?0:1};return Td(e.to)&&(c.groupID=wd(e.to),c.topicID=e.to),{protocolName:Pg,tjgID:this.generateTjgID(e),requestData:c}}},{key:"revokeMessage",value:function(e){var t={groupID:e.to,msgSeqList:[{msgSeq:e.sequence}]};return Td(e.to)&&(t.groupID=wd(e.to),t.topicID=e.to),this.request({protocolName:M_,requestData:t})}},{key:"deleteMessage",value:function(e){var t=e.to,n=e.keyList;wl.log("".concat(this._className,".deleteMessage groupID:").concat(t," count:").concat(n.length));var o={groupID:t,deleter:this.getMyUserID(),keyList:n};return Td(t)&&(o.groupID=wd(t),o.topicID=t),this.request({protocolName:k_,requestData:o})}},{key:"modifyRemoteMessage",value:function(e){var t=e.to,n=e.sequence,o=e.payload,r=e.type,a=e.version,s=void 0===a?0:a,i=e.cloudCustomData,u=t,c=void 0;Td(t)&&(u=wd(t),c=t);var l=void 0;return qd(r)&&(l=[]).push({type:r,content:o}),this.request({protocolName:G_,requestData:{groupID:u,topicID:c,sequence:n,version:s,elements:l,cloudCustomData:i}})}},{key:"getRoamingMessage",value:function(e){var t=this,n="".concat(this._className,".getRoamingMessage"),o=e.conversationID,r=e.groupID,a=e.sequence,s=new Uh(bh.GET_GROUP_ROAMING_MESSAGES),i=0,u=void 0;return Td(r)&&(r=wd(u=r)),this._computeLastSequence({groupID:r,topicID:u,sequence:a}).then((function(e){return i=e,wl.log("".concat(n," groupID:").concat(r," startSequence:").concat(i)),t.request({protocolName:T_,requestData:{groupID:r,count:21,sequence:i,topicID:u}})})).then((function(e){var a=e.data,c=a.messageList,l=a.complete;ed(c)?wl.log("".concat(n," ok. complete:").concat(l," but messageList is undefined!")):wl.log("".concat(n," ok. complete:").concat(l," count:").concat(c.length)),s.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(r," topicID:").concat(u," startSequence:").concat(i," complete:").concat(l," count:").concat(c?c.length:"undefined")).end();var d=t.getModule(ug);if(2===l||Bd(c))return d.setCompleted(o),{nextReqID:"",storedMessageList:[]};var p=c[c.length-1].sequence-1;d.updateRoamingMessageSequence(o,p);var g=d.onRoamingMessage(c,o);return d.updateIsRead(o),d.patchConversationLastMessage(o),wl.log("".concat(n," nextReqID:").concat(p," stored message count:").concat(g.length)),{nextReqID:p+"",storedMessageList:g}})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],a=n[1];s.setError(e,o,a).setMessage("groupID:".concat(r," topicID:").concat(u," startSequence:").concat(i)).end()})),wl.warn("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"_getGroupIDOfMessage",value:function(e){return e.conversationID.replace(hr.CONV_GROUP,"")}},{key:"getReadReceiptList",value:function(e){var t=this,n="".concat(this._className,".getReadReceiptList"),o=this._getGroupIDOfMessage(e[0]),r=this.getMyUserID(),a=e.filter((function(e){return e.from===r&&!0===e.needReadReceipt})).map((function(e){return{sequence:e.sequence}}));if(wl.log("".concat(n," groupID:").concat(o," sequenceList:").concat(JSON.stringify(a))),0===a.length)return Jv({messageList:e});var s=new Uh(bh.GET_READ_RECEIPT);return s.setMessage("groupID:".concat(o)),this.request({protocolName:E_,requestData:{groupID:o,sequenceList:a}}).then((function(t){s.end(),wl.log("".concat(n," ok"));var o=t.data.readReceiptList;return $l(o)&&o.forEach((function(t){e.forEach((function(e){0===t.code&&t.sequence===e.sequence&&(e.readReceiptInfo.readCount=t.readCount,e.readReceiptInfo.unreadCount=t.unreadCount)}))})),Vv({messageList:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setError(e,o,r).end()})),wl.warn("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"sendReadReceipt",value:function(e){var t=this,n=this._getGroupIDOfMessage(e[0]),o=new Uh(bh.SEND_READ_RECEIPT);o.setMessage("groupID:".concat(n));var r=this.getMyUserID(),a=e.filter((function(e){return e.from!==r&&!0===e.needReadReceipt})).map((function(e){return{sequence:e.sequence}}));if(0===a.length)return Xv({code:Mh.READ_RECEIPT_MESSAGE_LIST_EMPTY,message:yh.READ_RECEIPT_MESSAGE_LIST_EMPTY});var s="".concat(this._className,".sendReadReceipt");return wl.log("".concat(s,". sequenceList:").concat(JSON.stringify(a))),this.request({protocolName:C_,requestData:{groupID:n,sequenceList:a}}).then((function(e){return o.end(),wl.log("".concat(s," ok")),Vv()})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),r=n[0],a=n[1];o.setError(e,r,a).end()})),wl.warn("".concat(s," failed. error:"),e),Xv(e)}))}},{key:"getReadReceiptDetail",value:function(e){var t=this,n=e.message,o=e.filter,r=e.cursor,a=e.count,s=this._getGroupIDOfMessage(n),i=n.ID,u=n.sequence,c="".concat(this._className,".getReadReceiptDetail"),l=this._receiptDetailCompleteMap.get(i)||!1,d=0!==o&&1!==o?0:o,p=Xl(r)?r:"",g=!Jl(a)||a<=0||a>=100?100:a,_="groupID:".concat(s," sequence:").concat(u," cursor:").concat(p," filter:").concat(d," completeFlag:").concat(l);wl.log("".concat(c," ").concat(_));var h={cursor:"",isCompleted:!1,messageID:i,unreadUserIDList:[],readUserIDList:[]},f=new Uh(bh.GET_READ_RECEIPT_DETAIL);return f.setMessage(_),this.request({protocolName:A_,requestData:{groupID:s,sequence:u,flag:d,cursor:p,count:g}}).then((function(e){f.end();var n=e.data,o=n.cursor,r=n.isCompleted,a=n.unreadUserIDList,s=n.readUserIDList;return h.cursor=o,1===r&&(h.isCompleted=!0,t._receiptDetailCompleteMap.set(i,!0)),0===d?h.readUserIDList=s.map((function(e){return e.userID})):1===d&&(h.unreadUserIDList=a.map((function(e){return e.userID}))),wl.log("".concat(c," ok")),Vv(h)})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];f.setError(e,o,r).end()})),wl.warn("".concat(c," failed. error:"),e),Xv(e)}))}},{key:"getRoamingMessagesHopping",value:function(e){var t=this,n="".concat(this._className,".getRoamingMessagesHopping"),o=new Uh(bh.GET_GROUP_ROAMING_MESSAGES_HOPPING),r=e.groupID,a=e.count,s=e.sequence,i=e.direction,u=s;1===i&&(u=s+a-1);var c=void 0;Td(r)&&(r=wd(c=r));var l="".concat(c?"topicID:".concat(c):"groupID:".concat(r)," sequence:").concat(s," direction:").concat(i);return wl.log("".concat(n," ").concat(l)),this.request({protocolName:T_,requestData:{groupID:r,topicID:c,count:a,sequence:u}}).then((function(r){var a=r.data,u=a.messageList,d=a.complete;if(wl.log("".concat(n," ok. complete:").concat(d," count:").concat(u?u.length:0)),o.setNetworkType(t.getNetworkType()).setMessage("".concat(l," complete:").concat(d," count:").concat(u?u.length:0)).end(),2===d||Bd(u)){var p=t._computeResult();return Vv(p)}var g="".concat(hr.CONV_GROUP).concat(e.groupID),_=t.getModule(ug).onRoamingMessage(u,g,!1),h=t._computeResult({direction:i,sequence:s,topicID:c,messageList:u,resultList:_});return Vv(h)})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),i=n[0],u=n[1];o.setError(e,i,u).setMessage("groupID:".concat(r," sequence:").concat(s," count:").concat(a)).end()})),wl.warn("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"_computeResult",value:function(e){var t={messageList:[],isCompleted:!1,nextMessageSeq:""};if(ed(e))return t.isCompleted=!0,t;var n=e.direction,o=e.sequence,r=e.topicID,a=e.messageList,s=void 0===a?[]:a,i=e.resultList,u=void 0===i?[]:i,c=s.length;if(1===n){if(t.nextMessageSeq=s[0].sequence+1,!ed(r)){var l=u.findIndex((function(e){return e.sequence===o}));if(-1===l){var d=u.length;return 0===d?s[0].sequence<o&&(t.isCompleted=!0,t.nextMessageSeq=""):u[d-1].sequence<o?(t.isCompleted=!0,t.nextMessageSeq=""):t.messageList=y(u),t}return t.messageList=u.slice(l),t}return t.messageList=y(u),t}return t.nextMessageSeq=s[c-1].sequence-1,t.messageList=y(u),0===t.nextMessageSeq&&(t.isCompleted=!0,t.nextMessageSeq=""),t}},{key:"setMessageRead",value:function(e){var t=this,n=e.conversationID,o=e.lastMessageSeq,r="".concat(this._className,".setMessageRead");wl.log("".concat(r," conversationID:").concat(n," lastMessageSeq:").concat(o)),Jl(o)||wl.warn("".concat(r," 请勿修改 Conversation.lastMessage.lastSequence否则可能会导致已读上报结果不准确"));var a=new Uh(bh.SET_GROUP_MESSAGE_READ);a.setMessage("".concat(n,"-").concat(o));var s=n.replace(hr.CONV_GROUP,""),i=void 0;return Td(s)&&(s=wd(i=s)),this.request({protocolName:y_,requestData:{groupID:s,topicID:i,messageReadSeq:o}}).then((function(){a.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(r," ok."));var e=t.getModule(ug);e.updateIsReadAfterReadReport({conversationID:n,lastMessageSeq:o});var u=!0;if(!ed(i)){u=!1;var c=t.getModule(ig).getLocalTopic(s,i);c&&c.updateSelfInfo({readedSequence:o})}return e.updateUnreadCount(n,u),Vv()})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];a.setError(e,o,r).end()})),wl.log("".concat(r," failed. error:"),e),Xv(e)}))}},{key:"_computeLastSequence",value:function(e){var t=e.groupID,n=e.topicID,o=void 0===n?void 0:n,r=e.sequence;return r>0?Promise.resolve(r):ed(o)||this.hasLocalGroup(t)?ed(o)?this.getGroupLastSequence(t):this.getTopicLastSequence({groupID:t,topicID:o}):Promise.resolve(0)}},{key:"getGroupLastSequence",value:function(e){var t=this,n="".concat(this._className,".getGroupLastSequence"),o=new Uh(bh.GET_GROUP_LAST_SEQUENCE),r=0,a="";if(this.hasLocalGroup(e)){var s=this.getLocalGroupProfile(e),i=s.lastMessage;if(i.lastSequence>0&&!1===i.onlineOnlyFlag)return r=i.lastSequence,a="got lastSequence:".concat(r," from local group profile[lastMessage.lastSequence]. groupID:").concat(e),wl.log("".concat(n," ").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage("".concat(a)).end(),Promise.resolve(r);if(s.nextMessageSeq>1)return r=s.nextMessageSeq-1,a="got lastSequence:".concat(r," from local group profile[nextMessageSeq]. groupID:").concat(e),wl.log("".concat(n," ").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage("".concat(a)).end(),Promise.resolve(r)}var u="GROUP".concat(e),c=this.getModule(ug).getLocalConversation(u);if(c&&c.lastMessage.lastSequence&&!1===c.lastMessage.onlineOnlyFlag)return r=c.lastMessage.lastSequence,a="got lastSequence:".concat(r," from local conversation profile[lastMessage.lastSequence]. groupID:").concat(e),wl.log("".concat(n," ").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage("".concat(a)).end(),Promise.resolve(r);var l={groupIDList:[e],responseFilter:{groupBaseInfoFilter:["NextMsgSeq"]}};return this.getGroupProfileAdvance(l).then((function(s){var i=s.data.successGroupList;return Bd(i)?wl.log("".concat(n," successGroupList is empty. groupID:").concat(e)):(r=i[0].nextMessageSeq-1,a="got lastSequence:".concat(r," from getGroupProfileAdvance. groupID:").concat(e),wl.log("".concat(n," ").concat(a))),o.setNetworkType(t.getNetworkType()).setMessage("".concat(a)).end(),r})).catch((function(r){return t.probeNetwork().then((function(t){var n=M(t,2),a=n[0],s=n[1];o.setError(r,a,s).setMessage("get lastSequence failed from getGroupProfileAdvance. groupID:".concat(e)).end()})),wl.warn("".concat(n," failed. error:"),r),Xv(r)}))}},{key:"getTopicLastSequence",value:function(e){var t=this,n=e.groupID,o=e.topicID,r="".concat(this._className,".getTopicLastSequence"),a=new Uh(bh.GET_TOPIC_LAST_SEQUENCE),s=0,i="",u=this.getModule(ig);return u.hasLocalTopic(n,o)?(s=u.getLocalTopic(n,o).nextMessageSeq-1,i="get lastSequence:".concat(s," from local topic info[nextMessageSeq]. topicID:").concat(o),wl.log("".concat(r," ").concat(i)),a.setNetworkType(this.getNetworkType()).setMessage("".concat(i)).end(),Promise.resolve(s)):u.getTopicList({groupID:n,topicIDList:[o]}).then((function(e){var n=e.data.successTopicList;return Bd(n)?wl.log("".concat(r," successTopicList is empty. topicID:").concat(o)):(s=n[0].nextMessageSeq-1,i="get lastSequence:".concat(s," from getTopicList. topicID:").concat(o),wl.log("".concat(r," ").concat(i))),a.setNetworkType(t.getNetworkType()).setMessage("".concat(i)).end(),s})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),r=n[0],s=n[1];a.setError(e,r,s).setMessage("get lastSequence failed from getTopicList. topicID:".concat(o)).end()})),wl.warn("".concat(r," failed. error:"),e),Xv(e)}))}},{key:"isMessageFromOrToAVChatroom",value:function(e){return!!this._AVChatRoomHandler&&this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"hasJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler?this._AVChatRoomHandler.hasJoinedAVChatRoom():0}},{key:"getJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler?this._AVChatRoomHandler.getJoinedAVChatRoom():[]}},{key:"isOnlineMessage",value:function(e,t){return!(!this._canIUseOnlineOnlyFlag(e)||!t||!0!==t.onlineUserOnly)}},{key:"_canIUseOnlineOnlyFlag",value:function(e){var t=this.getJoinedAVChatRoom();return!t||!t.includes(e.to)||e.conversationType!==hr.CONV_GROUP}},{key:"_onAVChatRoomHistoryMessage",value:function(e){if(!Bd(e)){wl.log("".concat(this._className,"._onAVChatRoomHistoryMessage count:").concat(e.length));var n=[];e.forEach((function(e){n.push(t(t({},e),{},{isHistoryMessage:1}))})),this.onAVChatRoomMessage(n)}}},{key:"onAVChatRoomMessage",value:function(e){this._AVChatRoomHandler&&this._AVChatRoomHandler.onMessage(e)}},{key:"onAVChatRoomMemberBanned",value:function(e){this._AVChatRoomHandler&&this._AVChatRoomHandler.onAVChatRoomMemberBanned(e)}},{key:"getGroupSimplifiedInfo",value:function(e){var t=this,n=new Uh(bh.GET_GROUP_SIMPLIFIED_INFO),o={groupIDList:[e],responseFilter:{groupBaseInfoFilter:["Type","Name"]}};return this.getGroupProfileAdvance(o).then((function(o){var r=o.data.successGroupList;return n.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(e," type:").concat(r[0].type)).end(),r[0]})).catch((function(o){t.probeNetwork().then((function(t){var r=M(t,2),a=r[0],s=r[1];n.setError(o,a,s).setMessage("groupID:".concat(e)).end()}))}))}},{key:"setUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.set(e,1)}},{key:"deleteUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.has(e)&&this._unjoinedAVChatRoomList.delete(e)}},{key:"isUnjoinedAVChatRoom",value:function(e){return this._unjoinedAVChatRoomList.has(e)}},{key:"onGroupAttributesUpdated",value:function(e){this._groupAttributesHandler&&this._groupAttributesHandler.onGroupAttributesUpdated(e)}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesHandler&&this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}},{key:"initGroupAttributes",value:function(e){return this._groupAttributesHandler.initGroupAttributes(e)}},{key:"setGroupAttributes",value:function(e){return this._groupAttributesHandler.setGroupAttributes(e)}},{key:"deleteGroupAttributes",value:function(e){return this._groupAttributesHandler.deleteGroupAttributes(e)}},{key:"getGroupAttributes",value:function(e){return this._groupAttributesHandler.getGroupAttributes(e)}},{key:"reset",value:function(){this.groupMap.clear(),this._unjoinedAVChatRoomList.clear(),this._receiptDetailCompleteMap.clear(),this._commonGroupHandler.reset(),this._groupSystemNoticeHandler.reset(),this._groupTipsHandler.reset(),this._AVChatRoomHandler&&this._AVChatRoomHandler.reset()}}]),o}(Ag),JM=function(){function e(t){r(this,e),this.userID="",this.avatar="",this.nick="",this.role="",this.joinTime="",this.lastSendMsgTime="",this.nameCard="",this.muteUntil=0,this.memberCustomField=[],this._initMember(t)}return i(e,[{key:"_initMember",value:function(e){this.updateMember(e)}},{key:"updateMember",value:function(e){var t=[null,void 0,"",0,NaN];e.memberCustomField&&vd(this.memberCustomField,e.memberCustomField),ud(this,e,["memberCustomField"],t)}},{key:"updateRole",value:function(e){["Owner","Admin","Member"].indexOf(e)<0||(this.role=e)}},{key:"updateMuteUntil",value:function(e){ed(e)||(this.muteUntil=Math.floor((Date.now()+1e3*e)/1e3))}},{key:"updateNameCard",value:function(e){ed(e)||(this.nameCard=e)}},{key:"updateMemberCustomField",value:function(e){e&&vd(this.memberCustomField,e)}}]),e}(),XM=function(e){c(o,e);var n=v(o);function o(e){var t;return r(this,o),(t=n.call(this,e))._className="GroupMemberModule",t.groupMemberListMap=new Map,t.getInnerEmitterInstance().on(hM,t._onProfileUpdated,f(t)),t}return i(o,[{key:"_onProfileUpdated",value:function(e){for(var t=this,n=e.data,o=function(e){var o=n[e];t.groupMemberListMap.forEach((function(e){e.has(o.userID)&&e.get(o.userID).updateMember({nick:o.nick,avatar:o.avatar})}))},r=0;r<n.length;r++)o(r)}},{key:"deleteGroupMemberList",value:function(e){this.groupMemberListMap.delete(e)}},{key:"getGroupMemberList",value:function(e){var t=this,n=e.groupID,o=e.offset,r=void 0===o?0:o,a=e.count,s=void 0===a?15:a,i="".concat(this._className,".getGroupMemberList"),u=this.getModule(rg),c=u.hasLocalGroup(n);if(wl.log("".concat(i," groupID:").concat(n," offset:").concat(r," count:").concat(s," hasLocalGroup:").concat(c)),!c)return Jv({memberList:[],offset:0});if(u.getLocalGroupProfile(n).type===hr.GRP_AVCHATROOM){if(this.canIUse(wc.AVCHATROOM_MBR_LIST))return this._getAVChatRoomMemberList({groupID:n,offset:r});wl.warn("".concat(i," 从 v2.22.0 起,支持获取直播群在线成员列表,请升级旗舰版套餐且前往 [控制台](https://console.cloud.tencent.com/im) 开启开关。"))}var l=new Uh(bh.GET_GROUP_MEMBER_LIST),d=0,p={groupID:n,limit:s>100?100:s};Id({groupID:n})?p.next="".concat(r):(p.offset=r,d=r+s);var g=[];return this.request({protocolName:q_,requestData:p}).then((function(e){var o=e.data,r=o.members,a=o.memberNum,s=o.next,i=void 0===s?void 0:s;if(ed(i)||(d=Bd(i)?0:i),!$l(r)||0===r.length)return d=0,Promise.resolve([]);var u=t.getModule(rg);return u.hasLocalGroup(n)&&(u.getLocalGroupProfile(n).memberNum=a),g=t._updateLocalGroupMemberMap(n,r),t.getModule(ng).getUserProfile({userIDList:r.map((function(e){return e.userID})),tagList:[ql.NICK,ql.AVATAR]})})).then((function(e){var o=e.data;if(!$l(o)||0===o.length)return Jv({memberList:[],offset:d});var a=o.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));return t._updateLocalGroupMemberMap(n,a),g.length<s&&(d=0),l.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(n," offset:").concat(r," count:").concat(s)).end(),wl.log("".concat(i," ok.")),Vv({memberList:g,offset:d})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];l.setError(e,o,r).end()})),wl.error("".concat(i," failed. error:"),e),Xv(e)}))}},{key:"_getAVChatRoomMemberList",value:function(e){var t=this,n=e.groupID,o=e.offset,r="".concat(this._className,"._getVChatRoomMemberList"),a=new Uh(bh.GET_AVCHATROOM_MEMBER_LIST);return a.setMessage("groupID:".concat(n," offset:").concat(o)),this.request({protocolName:V_,requestData:{groupID:n,offset:o}}).then((function(e){var o=e.data,s=o.memberList,i=void 0===s?[]:s,u=o.offset,c=void 0===u?0:u;a.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(r," ok, member count:").concat(i.length,", next request timestamp:").concat(c,"."));var l=t._updateLocalGroupMemberMap(n,i);return Vv({memberList:l,offset:c})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];a.setError(e,o,r).end()})),wl.error("".concat(r," failed. error:"),e),Xv(e)}))}},{key:"getGroupMemberProfile",value:function(e){var n=this,o="".concat(this._className,".getGroupMemberProfile"),r=new Uh(bh.GET_GROUP_MEMBER_PROFILE);r.setMessage(e.userIDList.length>5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)),wl.log("".concat(o," groupID:").concat(e.groupID," userIDList:").concat(e.userIDList.join(","))),e.userIDList.length>50&&(e.userIDList=e.userIDList.slice(0,50));var a=e.groupID,s=e.userIDList;return this._getGroupMemberProfileAdvance(t(t({},e),{},{userIDList:s})).then((function(e){var t=e.data.members;return $l(t)&&0!==t.length?(n._updateLocalGroupMemberMap(a,t),n.getModule(ng).getUserProfile({userIDList:t.map((function(e){return e.userID})),tagList:[ql.NICK,ql.AVATAR]})):Jv([])})).then((function(e){var t=e.data.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));n._updateLocalGroupMemberMap(a,t);var o=s.filter((function(e){return n.hasLocalGroupMember(a,e)})).map((function(e){return n.getLocalGroupMemberInfo(a,e)}));return r.setNetworkType(n.getNetworkType()).end(),Vv({memberList:o})}))}},{key:"addGroupMember",value:function(e){var t=this,n="".concat(this._className,".addGroupMember"),o=e.groupID,r=this.getModule(rg).getLocalGroupProfile(o),a=r.type,s=new Uh(bh.ADD_GROUP_MEMBER);if(s.setMessage("groupID:".concat(o," groupType:").concat(a)),yd(a)){var i=new Wv({code:Mh.CANNOT_ADD_MEMBER_IN_AVCHATROOM,message:yh.CANNOT_ADD_MEMBER_IN_AVCHATROOM});return s.setCode(Mh.CANNOT_ADD_MEMBER_IN_AVCHATROOM).setError(yh.CANNOT_ADD_MEMBER_IN_AVCHATROOM).setNetworkType(this.getNetworkType()).end(),Xv(i)}return e.userIDList=e.userIDList.map((function(e){return{userID:e}})),wl.log("".concat(n," groupID:").concat(o)),this.request({protocolName:B_,requestData:e}).then((function(o){var a=o.data.members;wl.log("".concat(n," ok"));var i=a.filter((function(e){return 1===e.result})).map((function(e){return e.userID})),u=a.filter((function(e){return 0===e.result})).map((function(e){return e.userID})),c=a.filter((function(e){return 2===e.result})).map((function(e){return e.userID})),l=a.filter((function(e){return 4===e.result})).map((function(e){return e.userID})),d="groupID:".concat(e.groupID,", ")+"successUserIDList:".concat(i,", ")+"failureUserIDList:".concat(u,", ")+"existedUserIDList:".concat(c,", ")+"overLimitUserIDList:".concat(l);return s.setNetworkType(t.getNetworkType()).setMoreMessage(d).end(),0===i.length?Vv({successUserIDList:i,failureUserIDList:u,existedUserIDList:c,overLimitUserIDList:l}):(r.memberCount+=i.length,t._updateConversationGroupProfile(r),Vv({successUserIDList:i,failureUserIDList:u,existedUserIDList:c,overLimitUserIDList:l,group:r}))})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"deleteGroupMember",value:function(e){var t=this,n="".concat(this._className,".deleteGroupMember"),o=e.groupID,r=e.userIDList,a=this.getModule(rg).getLocalGroupProfile(o);if(ed(a))return Xv({code:Mh.CANNOT_FIND_GROUP,message:yh.CANNOT_FIND_GROUP});if(yd(a.type))return this.canIUse(wc.AVCHATROOM_BAN_MBR)?this._banAVChatRoomMember(e):Xv({code:Mh.CANNOT_USE_COMMERCIAL_ABILITY,message:yh.CANNOT_USE_COMMERCIAL_ABILITY});var s=new Uh(bh.DELETE_GROUP_MEMBER),i="groupID:".concat(o," ").concat(r.length>5?"userIDList.length:".concat(r.length):"userIDList:".concat(r));return s.setMessage(i),wl.log("".concat(n," groupID:").concat(o," userIDList:"),r),this.request({protocolName:K_,requestData:e}).then((function(){return s.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(n," ok")),a.memberCount-=1,t._updateConversationGroupProfile(a),t.deleteLocalGroupMembers(o,r),Vv({group:a,userIDList:r})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"_updateConversationGroupProfile",value:function(e){this.getModule(ug).updateConversationGroupProfile([e])}},{key:"_banAVChatRoomMember",value:function(e){var t=this,n="".concat(this._className,"._banAVChatRoomMember"),o=e.groupID,r=e.userIDList,a="groupID:".concat(o," ").concat(r.length>5?"userIDList.length:".concat(r.length):"userIDList:".concat(r)),s=new Uh(bh.BAN_AVCHATROOM_MEMBER);s.setMessage(a),wl.log("".concat(n," groupID:").concat(o," userIDList:"),r);var i=this.getModule(rg).getLocalGroupProfile(o);return ed(e.duration)||0===e.duration?Xv({code:Mh.BAN_DURATION_INVALID,message:yh.BAN_DURATION_INVALID}):this.request({protocolName:H_,requestData:e}).then((function(){return s.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(n," ok")),t.deleteLocalGroupMembers(o,r),Vv({group:i,userIDList:r})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"setGroupMemberMuteTime",value:function(e){var t=this,n=e.groupID,o=e.userID,r=e.muteTime,a="".concat(this._className,".setGroupMemberMuteTime");if(o===this.getMyUserID())return Xv(new Wv({code:Mh.CANNOT_MUTE_SELF,message:yh.CANNOT_MUTE_SELF}));wl.log("".concat(a," groupID:").concat(n," userID:").concat(o));var s=new Uh(bh.SET_GROUP_MEMBER_MUTE_TIME);return s.setMessage("groupID:".concat(n," userID:").concat(o," muteTime:").concat(r)),this.modifyGroupMemberInfo({groupID:n,userID:o,muteTime:r}).then((function(e){s.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(a," ok"));var o=t.getModule(rg);return Vv({group:o.getLocalGroupProfile(n),member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setError(e,o,r).end()})),wl.error("".concat(a," failed. error:"),e),Xv(e)}))}},{key:"setGroupMemberRole",value:function(e){var t=this,n="".concat(this._className,".setGroupMemberRole"),o=e.groupID,r=e.userID,a=e.role,s=this.getModule(rg).getLocalGroupProfile(o);if(s.selfInfo.role!==hr.GRP_MBR_ROLE_OWNER)return Xv({code:Mh.NOT_OWNER,message:yh.NOT_OWNER});if([hr.GRP_WORK,hr.GRP_AVCHATROOM].includes(s.type))return Xv({code:Mh.CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM,message:yh.CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM});var i=[hr.GRP_MBR_ROLE_ADMIN,hr.GRP_MBR_ROLE_MEMBER];if(Id({groupID:o})&&i.push(hr.GRP_MBR_ROLE_CUSTOM),i.indexOf(a)<0)return Xv({code:Mh.INVALID_MEMBER_ROLE,message:yh.INVALID_MEMBER_ROLE});if(r===this.getMyUserID())return Xv({code:Mh.CANNOT_SET_SELF_MEMBER_ROLE,message:yh.CANNOT_SET_SELF_MEMBER_ROLE});var u=new Uh(bh.SET_GROUP_MEMBER_ROLE);return u.setMessage("groupID:".concat(o," userID:").concat(r," role:").concat(a)),wl.log("".concat(n," groupID:").concat(o," userID:").concat(r)),this.modifyGroupMemberInfo({groupID:o,userID:r,role:a}).then((function(e){return u.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(n," ok")),Vv({group:s,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];u.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"setGroupMemberNameCard",value:function(e){var t=this,n="".concat(this._className,".setGroupMemberNameCard"),o=e.groupID,r=e.userID,a=void 0===r?this.getMyUserID():r,s=e.nameCard;wl.log("".concat(n," groupID:").concat(o," userID:").concat(a));var i=new Uh(bh.SET_GROUP_MEMBER_NAME_CARD);return i.setMessage("groupID:".concat(o," userID:").concat(a," nameCard:").concat(s)),this.modifyGroupMemberInfo({groupID:o,userID:a,nameCard:s}).then((function(e){wl.log("".concat(n," ok")),i.setNetworkType(t.getNetworkType()).end();var r=t.getModule(rg).getLocalGroupProfile(o);return a===t.getMyUserID()&&r&&r.setSelfNameCard(s),Vv({group:r,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];i.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"setGroupMemberCustomField",value:function(e){var t=this,n="".concat(this._className,".setGroupMemberCustomField"),o=e.groupID,r=e.userID,a=void 0===r?this.getMyUserID():r,s=e.memberCustomField;wl.log("".concat(n," groupID:").concat(o," userID:").concat(a));var i=new Uh(bh.SET_GROUP_MEMBER_CUSTOM_FIELD);return i.setMessage("groupID:".concat(o," userID:").concat(a," memberCustomField:").concat(JSON.stringify(s))),this.modifyGroupMemberInfo({groupID:o,userID:a,memberCustomField:s}).then((function(e){i.setNetworkType(t.getNetworkType()).end(),wl.log("".concat(n," ok"));var r=t.getModule(rg).getLocalGroupProfile(o);return Vv({group:r,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];i.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"modifyGroupMemberInfo",value:function(e){var n=this,o=e.groupID,r=e.userID,a=void 0;return Td(o)&&(o=wd(a=o)),this.request({protocolName:j_,requestData:t(t({},e),{},{groupID:o,topicID:a})}).then((function(){if(n.hasLocalGroupMember(o,r)){var t=n.getLocalGroupMemberInfo(o,r);return ed(e.muteTime)||t.updateMuteUntil(e.muteTime),ed(e.role)||t.updateRole(e.role),ed(e.nameCard)||t.updateNameCard(e.nameCard),ed(e.memberCustomField)||t.updateMemberCustomField(e.memberCustomField),t}return n.getGroupMemberProfile({groupID:o,userIDList:[r]}).then((function(e){return M(e.data.memberList,1)[0]}))}))}},{key:"_getGroupMemberProfileAdvance",value:function(e){return this.request({protocolName:x_,requestData:t(t({},e),{},{memberInfoFilter:e.memberInfoFilter?e.memberInfoFilter:["Role","JoinTime","NameCard","ShutUpUntil"]})})}},{key:"_updateLocalGroupMemberMap",value:function(e,t){var n=this;return $l(t)&&0!==t.length?t.map((function(t){return n.hasLocalGroupMember(e,t.userID)?n.getLocalGroupMemberInfo(e,t.userID).updateMember(t):n.setLocalGroupMember(e,new JM(t)),n.getLocalGroupMemberInfo(e,t.userID)})):[]}},{key:"deleteLocalGroupMembers",value:function(e,t){var n=this.groupMemberListMap.get(e);n&&t.forEach((function(e){n.delete(e)}))}},{key:"getLocalGroupMemberInfo",value:function(e,t){return this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).get(t):null}},{key:"setLocalGroupMember",value:function(e,t){if(this.groupMemberListMap.has(e))this.groupMemberListMap.get(e).set(t.userID,t);else{var n=(new Map).set(t.userID,t);this.groupMemberListMap.set(e,n)}}},{key:"getLocalGroupMemberList",value:function(e){return this.groupMemberListMap.get(e)}},{key:"hasLocalGroupMember",value:function(e,t){return this.groupMemberListMap.has(e)&&this.groupMemberListMap.get(e).has(t)}},{key:"hasLocalGroupMemberMap",value:function(e){return this.groupMemberListMap.has(e)}},{key:"reset",value:function(){this.groupMemberListMap.clear()}}]),o}(Ag),QM=["topicID","topicName","avatar","introduction","notification","unreadCount","muteAllMembers","customData","groupAtInfoList","nextMessageSeq","selfInfo"],ZM=function(e){return Bd(e)?{lastTime:0,lastSequence:0,fromAccount:"",payload:null,type:"",messageForShow:"",nick:"",version:0,cloudCustomData:"",isRevoked:!1}:{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",payload:e.payload||null,type:e.type||"",messageForShow:Fd(e.type,e.payload),nick:e.nick||"",version:e.version||0,cloudCustomData:e.cloudCustomData||"",isRevoked:e.isRevoked||!1}},$M=function(){function e(t){r(this,e),this.topicID="",this.topicName="",this.avatar="",this.introduction="",this.notification="",this.unreadCount=0,this.muteAllMembers=!1,this.customData="",this.groupAtInfoList=[],this.nextMessageSeq=0,this.lastMessage=ZM(t.lastMessage),this.selfInfo={muteTime:0,readedSequence:0,messageRemindType:""},this._initTopic(t)}return i(e,[{key:"_initTopic",value:function(e){for(var t in e)QM.indexOf(t)<0||("selfInfo"===t?this.updateSelfInfo(e[t]):this[t]="muteAllMembers"===t?1===e[t]:e[t])}},{key:"updateUnreadCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.unreadCount=e}},{key:"updateNextMessageSeq",value:function(e){this.nextMessageSeq=e}},{key:"updateLastMessage",value:function(e){this.lastMessage=ZM(e)}},{key:"updateGroupAtInfoList",value:function(e){this.groupAtInfoList=JSON.parse(JSON.stringify(e))}},{key:"updateTopic",value:function(e){ed(e.selfInfo)||this.updateSelfInfo(e.selfInfo),ed(e.muteAllMembers)||(this.muteAllMembers=1===e.muteAllMembers),ud(this,e,["groupID","lastMessageTime","selfInfo","muteAllMembers","lastMsg"])}},{key:"updateSelfInfo",value:function(e){return 0!==ud(this.selfInfo,e,[],[""])}},{key:"reduceUnreadCount",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:"isLastMessageRevoked",value:function(e){return e.sequence===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}}]),e}(),ey=function(e){c(o,e);var n=v(o);function o(e){var t;return r(this,o),(t=n.call(this,e))._className="TopicModule",t._topicMap=new Map,t._getTopicTimeMap=new Map,t.TOPIC_CACHE_TIME=300,t.TOPIC_LAST_ACTIVE_TIME=3600,t.getInnerEmitterInstance().on(_M,t._onCloudConfigUpdated,f(t)),t}return i(o,[{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("topic_cache_time"),t=this.getCloudConfig("topic_last_active_time");ed(e)||(this.TOPIC_CACHE_TIME=Number(e)),ed(t)||(this.TOPIC_LAST_ACTIVE_TIME=Number(t))}},{key:"onTopicCreated",value:function(e){var t=e.groupID;this.resetGetTopicTime(t),this.emitOuterEvent(_r.TOPIC_CREATED,e)}},{key:"onTopicDeleted",value:function(e){var t=this,n=e.groupID,o=e.topicIDList;(void 0===o?[]:o).forEach((function(e){t._deleteLocalTopic(n,e)})),this.emitOuterEvent(_r.TOPIC_DELETED,e)}},{key:"onTopicMessageRemindTypeUpdated",value:function(e){var t=e.groupID,n=e.topicID,o=e.messageRemindType,r=this.getLocalTopic(t,n);if(r){var a=r.updateSelfInfo({messageRemindType:o});a&&this.emitOuterEvent(_r.TOPIC_UPDATED,{groupID:t,topic:r}),wl.debug("".concat(this._className,".onTopicMessageRemindTypeUpdated topicID:").concat(n)+" messageRemindType:".concat(o," isTopicUpdated:").concat(a))}}},{key:"onTopicProfileUpdated",value:function(e){var t=e.groupID,n=e.topicID,o=this.getLocalTopic(t,n);o&&(o.updateTopic(e),this.emitOuterEvent(_r.TOPIC_UPDATED,{groupID:t,topic:o}))}},{key:"onConversationProxy",value:function(e){var t=e.topicID,n=e.unreadCount,o=e.groupAtInfoList,r=wd(t),a=this.getLocalTopic(r,t),s=!1;a&&(ed(n)||a.unreadCount===n||(a.updateUnreadCount(n),s=!0),ed(o)||(a.updateGroupAtInfoList(o),s=!0)),s&&this.emitOuterEvent(_r.TOPIC_UPDATED,{groupID:r,topic:a})}},{key:"onMessageSent",value:function(e){var t=e.groupID,n=e.topicID,o=e.lastMessage,r=this.getLocalTopic(t,n);r&&(r.nextMessageSeq+=1,r.updateLastMessage(o),this.emitOuterEvent(_r.TOPIC_UPDATED,{groupID:t,topic:r}))}},{key:"onMessageModified",value:function(e){var t=e.to,n=e.time,o=e.sequence,r=e.elements,a=e.cloudCustomData,s=e.messageVersion,i=wd(t),u=this.getLocalTopic(i,t);if(u){var c=u.lastMessage;wl.debug("".concat(this._className,".onMessageModified topicID:").concat(t," lastMessage:"),JSON.stringify(c),"options:",JSON.stringify(e)),c&&(null===c.payload||c.lastTime===n&&c.lastSequence===o&&c.version!==s)&&(c.type=r[0].type,c.payload=r[0].content,c.messageForShow=Fd(c.type,c.payload),c.cloudCustomData=a,c.version=s,c.lastSequence=o,c.lastTime=n,this.emitOuterEvent(_r.TOPIC_UPDATED,{groupID:i,topic:u}))}}},{key:"onMessageRevoked",value:function(e){var t=this;if(0!==e.length){var n=null,o=null,r=!1;e.forEach((function(e){var a=e.to;o=wd(a),(n=t.getLocalTopic(o,a))&&(n.reduceUnreadCount()&&(r=!0),n.isLastMessageRevoked(e)&&(n.setLastMessageRevoked(!0),r=!0))})),r&&this.emitOuterEvent(_r.TOPIC_UPDATED,{groupID:o,topic:n})}}},{key:"getJoinedCommunityList",value:function(){return this.getModule(rg).getGroupList({isGroupWithTopicOnly:!0}).then((function(e){var t=e.data.groupList;return Vv({groupList:void 0===t?[]:t})})).catch((function(e){return Xv(e)}))}},{key:"createTopicInCommunity",value:function(e){var n=this,o="".concat(this._className,".createTopicInCommunity"),r=e.topicID;if(!ed(r)&&!Td(r))return Xv({code:Mh.ILLEGAL_TOPIC_ID,message:yh.ILLEGAL_TOPIC_ID});var a=new Uh(bh.CREATE_TOPIC);return this.request({protocolName:uh,requestData:t({},e)}).then((function(r){var s=r.data.topicID;return a.setMessage("topicID:".concat(s)).setNetworkType(n.getNetworkType()).end(),wl.log("".concat(o," ok")),n._updateTopicMap([t(t({},e),{},{topicID:s})]),Vv({topicID:s})})).catch((function(e){return n.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];a.setError(e,o,r).end()})),wl.error("".concat(o," failed. error:"),e),Xv(e)}))}},{key:"deleteTopicFromCommunity",value:function(e){var t=this,n="".concat(this._className,".deleteTopicFromCommunity"),o=e.groupID,r=e.topicIDList,a=void 0===r?[]:r,s=new Uh(bh.DELETE_TOPIC);return s.setMessage("groupID:".concat(o," topicIDList:").concat(a)),this.request({protocolName:ch,requestData:{groupID:o,topicIDList:a}}).then((function(e){var n=e.data.resultList,r=[],a=[];(void 0===n?[]:n).forEach((function(e){var t=e.topicID,n=e.errorCode,o=e.errorInfo;0===n?r.push({topicID:t}):a.push({topicID:t,code:n,message:o})}));var i="success count:".concat(r.length,", fail count:").concat(a.length);return s.setMoreMessage("".concat(i)).setNetworkType(t.getNetworkType()).end(),wl.log("".concat(i)),r.forEach((function(e){t._deleteLocalTopic(o,e.topicID)})),Vv({successTopicList:r,failureTopicList:a})})).catch((function(e){return t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"updateTopicProfile",value:function(e){var n=this,o="".concat(this._className,".updateTopicProfile"),r=new Uh(bh.UPDATE_TOPIC_PROFILE);return r.setMessage("groupID:".concat(e.groupID," topicID:").concat(e.topicID)),wl.log("".concat(o," options:"),e),ed(e.muteAllMembers)||(e.muteAllMembers=!0===e.muteAllMembers?"On":"Off"),this.request({protocolName:lh,requestData:t({},e)}).then((function(){return r.setNetworkType(n.getNetworkType()).end(),wl.log("".concat(o," ok")),n._updateTopicMap([e]),Vv({topic:n.getLocalTopic(e.groupID,e.topicID)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=M(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),wl.error("".concat(o," failed. error:"),e),Xv(e)}))}},{key:"getTopicList",value:function(e){var n=this,o="".concat(this._className,".getTopicList"),r=e.groupID,a=e.topicIDList,s=void 0===a?[]:a,i=0===s.length,u=new Uh(bh.GET_TOPIC_LIST);if(u.setMessage("groupID:".concat(r)),this._getTopicTimeMap.has(r)){var c=this._getTopicTimeMap.get(r),l=c.isGetAll,d=c.time;if((l||!l&&!i)&&Date.now()-d<1e3*this.TOPIC_CACHE_TIME){var p=this._getLocalTopicList(r,s);if(i||p.length===s.length)return u.setNetworkType(this.getNetworkType()).setMoreMessage("from cache, topic count:".concat(p.length)).end(),wl.log("".concat(o," groupID:").concat(r," from cache, topic count:").concat(p.length)),Jv({successTopicList:p,failureTopicList:[]})}}return this.request({protocolName:dh,requestData:{groupID:r,topicIDList:s}}).then((function(e){var a=e.data.topicInfoList,s=[],c=[],l=[];(void 0===a?[]:a).forEach((function(e){var n=e.topic,o=e.selfInfo,r=e.errorCode,a=e.errorInfo,i=n.topicID;0===r?(s.push(t(t({},n),{},{selfInfo:o})),c.push(i)):l.push({topicID:i,code:r,message:a})})),n._updateTopicMap(s),n._handleTopicAtInfo(s);var d="success count:".concat(c.length,", fail count:").concat(l.length);u.setNetworkType(n.getNetworkType()).setMoreMessage("".concat(d)).end(),wl.log("".concat(o," groupID:").concat(r," from remote, ").concat(d));var p=[];return Bd(c)||(n._getTopicTimeMap.set(r,{time:Date.now(),isGetAll:i}),p=n._getLocalTopicList(r,c)),Vv({successTopicList:p,failureTopicList:l})})).catch((function(e){return n.probeNetwork(e).then((function(t){var n=M(t,2),o=n[0],r=n[1];u.setError(e,o,r).end()})),wl.error("".concat(o," failed. error:"),e),Xv(e)}))}},{key:"hasLocalTopic",value:function(e,t){return!!this._topicMap.has(e)&&this._topicMap.get(e).has(t)}},{key:"getLocalTopic",value:function(e,t){var n=null;return this._topicMap.has(e)&&(n=this._topicMap.get(e).get(t)),n}},{key:"_getLocalTopicList",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this._topicMap.get(e),o=[];return n&&(o=y(n.values())),0===t.length?o:o.filter((function(e){return t.includes(e.topicID)}))}},{key:"_deleteLocalTopic",value:function(e,t){this._topicMap.has(e)&&(this._topicMap.get(e).delete(t),wl.log("".concat(this._className,"._deleteLocalTopic groupID:").concat(e," topicID:").concat(t)))}},{key:"_updateTopicMap",value:function(e){var t=this,n=[];e.forEach((function(e){var o=e.groupID,r=e.topicID,a=null;t._topicMap.has(o)||t._topicMap.set(o,new Map),t._topicMap.get(o).has(r)?(a=t._topicMap.get(o).get(r)).updateTopic(e):(t._getTopicLastMessage(e),a=new $M(e),t._topicMap.get(o).set(r,a));var s=a.nextMessageSeq-a.selfInfo.readedSequence-1,i=s>0?s:0;a.updateUnreadCount(i),n.push({conversationID:"".concat(hr.CONV_GROUP).concat(r),type:hr.CONV_TOPIC,unreadCount:i})})),n.length>0&&this.getModule(ug).updateTopicConversation(n)}},{key:"resetGetTopicTime",value:function(e){var t=this;ed(e)?y(this._getTopicTimeMap.keys()).forEach((function(e){t._getTopicTimeMap.set(e,0)})):this._getTopicTimeMap.set(e,0)}},{key:"getTopicListOnReconnected",value:function(){var e=this,t=y(this._topicMap.keys()),n=[];t.forEach((function(t){var o=[];e._getLocalTopicList(t).forEach((function(t){var n=t.lastMessage.lastTime,r=void 0===n?0:n;Date.now()-1e3*r<1e3*e.TOPIC_LAST_ACTIVE_TIME&&o.push(t.topicID)})),o.length>0&&n.push({groupID:t,topicIDList:o})})),wl.log("".concat(this._className,".getTopicListOnReconnected. active community count:").concat(n.length)),this._relayGetTopicList(n)}},{key:"_relayGetTopicList",value:function(e){var t=this;if(0!==e.length){var n=e.shift(),o=n.topicIDList.length>5?"topicIDList.length:".concat(n.topicIDList.length):"topicIDList:".concat(n.topicIDList),r=new Uh(bh.RELAY_GET_TOPIC_LIST);r.setMessage(o),wl.log("".concat(this._className,"._relayGetTopicList. ").concat(o)),this.getTopicList(n).then((function(){r.setNetworkType(t.getNetworkType()).end(),t._relayGetTopicList(e)})).catch((function(n){t.probeNetwork().then((function(e){var t=M(e,2),o=t[0],a=t[1];r.setError(n,o,a).end()})),t._relayGetTopicList(e)}))}}},{key:"_handleTopicAtInfo",value:function(e){var n=this;0!==e.length&&e.forEach((function(e){var o=e.groupID,r=e.topicID,a=e.groupAtInfoList,s=[];ed(a)||(a.forEach((function(e){s.push(t(t({},e),{},{groupID:o,topicID:r}))})),n.getModule(ug).onNewGroupAtTips({dataList:s}))}))}},{key:"_getTopicLastMessage",value:function(e){if(!ed(e.lastMsg)){var t={time:e.lastMsg.time,sequence:e.lastMsg.sequence,from:e.lastMsg.from,payload:e.lastMsg.elements[0]?e.lastMsg.elements[0].content:null,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:"",nick:e.lastMsg.nick,version:e.lastMsg.messageVersion,cloudCustomData:e.lastMsg.cloudCustomData};e.lastMessage=t}}},{key:"deleteTopicListInCommunity",value:function(e){var t=this,n=this._getLocalTopicList(e),o=this.getModule(ug);n.forEach((function(n){var r=n.topicID;t._deleteLocalTopic(e,r),t._getTopicTimeMap.delete(e),o.deleteLocalConversation("".concat(hr.CONV_GROUP).concat(r))}))}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._topicMap.clear(),this._getTopicTimeMap.clear(),this.TOPIC_CACHE_TIME=300,this.TOPIC_LAST_ACTIVE_TIME=3600}}]),o}(Ag),ty=function(){function e(t){r(this,e),this._userModule=t,this._className="ProfileHandler",this.TAG="profile",this.accountProfileMap=new Map,this.expirationTime=864e5}return i(e,[{key:"setExpirationTime",value:function(e){this.expirationTime=e}},{key:"getUserProfile",value:function(e){var t=this,n=e.userIDList;e.fromAccount=this._userModule.getMyAccount(),n.length>100&&(wl.warn("".concat(this._className,".getUserProfile 获取用户资料人数不能超过100人")),n.length=100);for(var o,r=[],a=[],s=0,i=n.length;s<i;s++)o=n[s],this._userModule.isMyFriend(o)&&this._containsAccount(o)?a.push(this._getProfileFromMap(o)):r.push(o);if(0===r.length)return Jv(a);e.toAccount=r;var u=e.bFromGetMyProfile||!1,c=[];e.toAccount.forEach((function(e){c.push({toAccount:e,standardSequence:0,customSequence:0})})),e.userItem=c;var l=new Uh(bh.GET_USER_PROFILE);return l.setMessage(n.length>5?"userIDList.length:".concat(n.length):"userIDList:".concat(n)),this._userModule.request({protocolName:Ug,requestData:e}).then((function(e){l.setNetworkType(t._userModule.getNetworkType()).end(),wl.info("".concat(t._className,".getUserProfile ok"));var n=t._handleResponse(e).concat(a);return Vv(u?n[0]:n)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];l.setError(e,o,r).end()})),wl.error("".concat(t._className,".getUserProfile failed. error:"),e),Xv(e)}))}},{key:"getMyProfile",value:function(){var e=this._userModule.getMyAccount();if(wl.log("".concat(this._className,".getMyProfile myAccount:").concat(e)),this._fillMap(),this._containsAccount(e)){var t=this._getProfileFromMap(e);return wl.debug("".concat(this._className,".getMyProfile from cache, myProfile:")+JSON.stringify(t)),Jv(t)}return this.getUserProfile({fromAccount:e,userIDList:[e],bFromGetMyProfile:!0})}},{key:"_handleResponse",value:function(e){for(var t,n,o=id.now(),r=e.data.userProfileItem,a=[],s=0,i=r.length;s<i;s++)"@TLS#NOT_FOUND"!==r[s].to&&""!==r[s].to&&(t=r[s].to,n=this._updateMap(t,this._getLatestProfileFromResponse(t,r[s].profileItem)),a.push(n));return wl.log("".concat(this._className,"._handleResponse cost ").concat(id.now()-o," ms")),a}},{key:"_getLatestProfileFromResponse",value:function(e,t){var n={};if(n.userID=e,n.profileCustomField=[],!Bd(t))for(var o=0,r=t.length;o<r;o++)if(t[o].tag.indexOf("Tag_Profile_Custom")>-1)n.profileCustomField.push({key:t[o].tag,value:t[o].value});else switch(t[o].tag){case ql.NICK:n.nick=t[o].value;break;case ql.GENDER:n.gender=t[o].value;break;case ql.BIRTHDAY:n.birthday=t[o].value;break;case ql.LOCATION:n.location=t[o].value;break;case ql.SELFSIGNATURE:n.selfSignature=t[o].value;break;case ql.ALLOWTYPE:n.allowType=t[o].value;break;case ql.LANGUAGE:n.language=t[o].value;break;case ql.AVATAR:n.avatar=t[o].value;break;case ql.MESSAGESETTINGS:n.messageSettings=t[o].value;break;case ql.ADMINFORBIDTYPE:n.adminForbidType=t[o].value;break;case ql.LEVEL:n.level=t[o].value;break;case ql.ROLE:n.role=t[o].value;break;default:wl.warn("".concat(this._className,"._handleResponse unknown tag:"),t[o].tag,t[o].value)}return n}},{key:"updateMyProfile",value:function(e){var t=this,n="".concat(this._className,".updateMyProfile"),o=new Uh(bh.UPDATE_MY_PROFILE);o.setMessage(JSON.stringify(e));var r=(new EM).validate(e);if(!r.valid)return o.setCode(Mh.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("".concat(n," info:").concat(r.tips)).setNetworkType(this._userModule.getNetworkType()).end(),wl.error("".concat(n," info:").concat(r.tips,",请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#updateMyProfile")),Xv({code:Mh.UPDATE_PROFILE_INVALID_PARAM,message:yh.UPDATE_PROFILE_INVALID_PARAM});var a=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&("profileCustomField"===s?e.profileCustomField.forEach((function(e){a.push({tag:e.key,value:e.value})})):a.push({tag:ql[s.toUpperCase()],value:e[s]}));return 0===a.length?(o.setCode(Mh.UPDATE_PROFILE_NO_KEY).setMoreMessage(yh.UPDATE_PROFILE_NO_KEY).setNetworkType(this._userModule.getNetworkType()).end(),wl.error("".concat(n," info:").concat(yh.UPDATE_PROFILE_NO_KEY,",请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#updateMyProfile")),Xv({code:Mh.UPDATE_PROFILE_NO_KEY,message:yh.UPDATE_PROFILE_NO_KEY})):this._userModule.request({protocolName:bg,requestData:{fromAccount:this._userModule.getMyAccount(),profileItem:a}}).then((function(r){o.setNetworkType(t._userModule.getNetworkType()).end(),wl.info("".concat(n," ok"));var a=t._updateMap(t._userModule.getMyAccount(),e);return t._userModule.emitOuterEvent(_r.PROFILE_UPDATED,[a]),Jv(a)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=M(t,2),r=n[0],a=n[1];o.setError(e,r,a).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"onProfileModified",value:function(e){var t=e.dataList;if(!Bd(t)){var n,o,r=t.length;wl.debug("".concat(this._className,".onProfileModified count:").concat(r," dataList:"),e.dataList);for(var a=[],s=0;s<r;s++)n=t[s].userID,o=this._updateMap(n,this._getLatestProfileFromResponse(n,t[s].profileList)),a.push(o);a.length>0&&(this._userModule.emitInnerEvent(hM,a),this._userModule.emitOuterEvent(_r.PROFILE_UPDATED,a))}}},{key:"_fillMap",value:function(){if(0===this.accountProfileMap.size){for(var e=this._getCachedProfiles(),t=Date.now(),n=0,o=e.length;n<o;n++)t-e[n].lastUpdatedTime<this.expirationTime&&this.accountProfileMap.set(e[n].userID,e[n]);wl.log("".concat(this._className,"._fillMap from cache, map.size:").concat(this.accountProfileMap.size))}}},{key:"_updateMap",value:function(e,t){var n,o=Date.now();return this._containsAccount(e)?(n=this._getProfileFromMap(e),t.profileCustomField&&vd(n.profileCustomField,t.profileCustomField),ud(n,t,["profileCustomField"]),n.lastUpdatedTime=o):(n=new EM(t),(this._userModule.isMyFriend(e)||e===this._userModule.getMyAccount())&&(n.lastUpdatedTime=o,this.accountProfileMap.set(e,n))),this._flushMap(e===this._userModule.getMyAccount()),n}},{key:"_flushMap",value:function(e){var t=y(this.accountProfileMap.values()),n=this._userModule.getStorageModule();wl.debug("".concat(this._className,"._flushMap length:").concat(t.length," flushAtOnce:").concat(e)),n.setItem(this.TAG,t,e)}},{key:"_containsAccount",value:function(e){return this.accountProfileMap.has(e)}},{key:"_getProfileFromMap",value:function(e){return this.accountProfileMap.get(e)}},{key:"_getCachedProfiles",value:function(){var e=this._userModule.getStorageModule().getItem(this.TAG);return Bd(e)?[]:e}},{key:"onConversationsProfileUpdated",value:function(e){for(var t,n,o,r=[],a=0,s=e.length;a<s;a++)n=(t=e[a]).userID,this._userModule.isMyFriend(n)||(this._containsAccount(n)?(o=this._getProfileFromMap(n),ud(o,t)>0&&r.push(n)):r.push(t.userID));0!==r.length&&(wl.info("".concat(this._className,".onConversationsProfileUpdated toAccountList:").concat(r)),this.getUserProfile({userIDList:r}))}},{key:"getNickAndAvatarByUserID",value:function(e){if(this._containsAccount(e)){var t=this._getProfileFromMap(e);return{nick:t.nick,avatar:t.avatar}}return{nick:"",avatar:""}}},{key:"reset",value:function(){this._flushMap(!0),this.accountProfileMap.clear()}}]),e}(),ny=i((function e(t){r(this,e),Bd||(this.userID=t.userID||"",this.timeStamp=t.timeStamp||0)})),oy=function(){function e(t){r(this,e),this._userModule=t,this._className="BlacklistHandler",this._blacklistMap=new Map,this.startIndex=0,this.maxLimited=100,this.currentSequence=0}return i(e,[{key:"getLocalBlacklist",value:function(){return y(this._blacklistMap.keys())}},{key:"getBlacklist",value:function(){var e=this,t="".concat(this._className,".getBlacklist"),n={fromAccount:this._userModule.getMyAccount(),maxLimited:this.maxLimited,startIndex:0,lastSequence:this.currentSequence},o=new Uh(bh.GET_BLACKLIST);return this._userModule.request({protocolName:wg,requestData:n}).then((function(n){var r=n.data,a=r.blackListItem,s=r.currentSequence,i=Bd(a)?0:a.length;o.setNetworkType(e._userModule.getNetworkType()).setMessage("blackList count:".concat(i)).end(),wl.info("".concat(t," ok")),e.currentSequence=s,e._handleResponse(a,!0),e._userModule.emitOuterEvent(_r.BLACKLIST_UPDATED,y(e._blacklistMap.keys()))})).catch((function(n){return e._userModule.probeNetwork().then((function(e){var t=M(e,2),r=t[0],a=t[1];o.setError(n,r,a).end()})),wl.error("".concat(t," failed. error:"),n),Xv(n)}))}},{key:"addBlacklist",value:function(e){var t=this,n="".concat(this._className,".addBlacklist"),o=new Uh(bh.ADD_TO_BLACKLIST);if(!$l(e.userIDList))return o.setCode(Mh.ADD_BLACKLIST_INVALID_PARAM).setMessage(yh.ADD_BLACKLIST_INVALID_PARAM).setNetworkType(this._userModule.getNetworkType()).end(),wl.error("".concat(n," options.userIDList 必需是数组")),Xv({code:Mh.ADD_BLACKLIST_INVALID_PARAM,message:yh.ADD_BLACKLIST_INVALID_PARAM});var r=this._userModule.getMyAccount();return 1===e.userIDList.length&&e.userIDList[0]===r?(o.setCode(Mh.CANNOT_ADD_SELF_TO_BLACKLIST).setMessage(yh.CANNOT_ADD_SELF_TO_BLACKLIST).setNetworkType(this._userModule.getNetworkType()).end(),wl.error("".concat(n," 不能把自己拉黑")),Xv({code:Mh.CANNOT_ADD_SELF_TO_BLACKLIST,message:yh.CANNOT_ADD_SELF_TO_BLACKLIST})):(e.userIDList.includes(r)&&(e.userIDList=e.userIDList.filter((function(e){return e!==r})),wl.warn("".concat(n," 不能把自己拉黑,已过滤"))),e.fromAccount=this._userModule.getMyAccount(),e.toAccount=e.userIDList,this._userModule.request({protocolName:Fg,requestData:e}).then((function(r){return o.setNetworkType(t._userModule.getNetworkType()).setMessage(e.userIDList.length>5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),wl.info("".concat(n," ok")),t._handleResponse(r.resultItem,!0),Vv(y(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=M(t,2),r=n[0],a=n[1];o.setError(e,r,a).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)})))}},{key:"_handleResponse",value:function(e,t){if(!Bd(e))for(var n,o,r,a=0,s=e.length;a<s;a++)o=e[a].to,r=e[a].resultCode,(ed(r)||0===r)&&(t?((n=this._blacklistMap.has(o)?this._blacklistMap.get(o):new ny).userID=o,!Bd(e[a].addBlackTimeStamp)&&(n.timeStamp=e[a].addBlackTimeStamp),this._blacklistMap.set(o,n)):this._blacklistMap.has(o)&&(n=this._blacklistMap.get(o),this._blacklistMap.delete(o)));wl.log("".concat(this._className,"._handleResponse total:").concat(this._blacklistMap.size," bAdd:").concat(t))}},{key:"deleteBlacklist",value:function(e){var t=this,n="".concat(this._className,".deleteBlacklist"),o=new Uh(bh.REMOVE_FROM_BLACKLIST);return $l(e.userIDList)?(e.fromAccount=this._userModule.getMyAccount(),e.toAccount=e.userIDList,this._userModule.request({protocolName:qg,requestData:e}).then((function(r){return o.setNetworkType(t._userModule.getNetworkType()).setMessage(e.userIDList.length>5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),wl.info("".concat(n," ok")),t._handleResponse(r.data.resultItem,!1),Vv(y(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=M(t,2),r=n[0],a=n[1];o.setError(e,r,a).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))):(o.setCode(Mh.DEL_BLACKLIST_INVALID_PARAM).setMessage(yh.DEL_BLACKLIST_INVALID_PARAM).setNetworkType(this._userModule.getNetworkType()).end(),wl.error("".concat(n," options.userIDList 必需是数组")),Xv({code:Mh.DEL_BLACKLIST_INVALID_PARAM,message:yh.DEL_BLACKLIST_INVALID_PARAM}))}},{key:"onAccountDeleted",value:function(e){for(var t,n=[],o=0,r=e.length;o<r;o++)t=e[o],this._blacklistMap.has(t)&&(this._blacklistMap.delete(t),n.push(t));n.length>0&&(wl.log("".concat(this._className,".onAccountDeleted count:").concat(n.length," userIDList:"),n),this._userModule.emitOuterEvent(_r.BLACKLIST_UPDATED,y(this._blacklistMap.keys())))}},{key:"onAccountAdded",value:function(e){for(var t,n=[],o=0,r=e.length;o<r;o++)t=e[o],this._blacklistMap.has(t)||(this._blacklistMap.set(t,new ny({userID:t})),n.push(t));n.length>0&&(wl.log("".concat(this._className,".onAccountAdded count:").concat(n.length," userIDList:"),n),this._userModule.emitOuterEvent(_r.BLACKLIST_UPDATED,y(this._blacklistMap.keys())))}},{key:"reset",value:function(){this._blacklistMap.clear(),this.startIndex=0,this.maxLimited=100,this.currentSequence=0}}]),e}(),ry=function(e){var t=String(e).replace(/[=]+$/,""),n="";if(t.length%4==1)return wl.warn("decodeBase64 failed: ".concat(e," to be decoded is not correctly encoded.")),"";for(var o,r,a=0,s=0;r=t.charAt(s++);~r&&(o=a%4?64*o+r:r,a++%4)?n+=String.fromCharCode(255&o>>(-2*a&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);try{return decodeURIComponent(escape(n))}catch(kC){return wl.warn("decodeBase64 failed: ".concat(e," to be decoded is not correctly encoded.")),""}},ay=function(){function e(t){r(this,e),this._userModule=t,this._className="UserStatusHandler",this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100,this._userModule.getInnerEmitterInstance().on(_M,this._onCloudConfigUpdated,this)}return i(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._userModule.getCloudConfig("status_query_count"),t=this._userModule.getCloudConfig("status_sub_count"),n=this._userModule.getCloudConfig("status_unsub_count");wl.log("".concat(this._className,"._onCloudConfigUpdated statusQueryCount:").concat(e," statusSubscribeCount:").concat(t)+" statusUnsubscribeCount:".concat(n)),ed(e)||(this.MAX_QUERY_USER_COUNT=parseInt(e,10)),ed(e)||(this.MAX_SUBSCRIBE_USER_COUNT=parseInt(t,10)),ed(e)||(this.MAX_UNSUBSCRIBE_USER_COUNT=parseInt(n,10))}},{key:"onUserStatusUpdated",value:function(e){var t=e.dataList,n=this._userModule.getMyUserID(),o=this._userModule.getModule(cg),r=t.map((function(e){var t=e.to,r=e.statusType,a=e.customStatus,s=ry(a);return t===n&&o.setCustomStatus(s),{userID:t,statusType:r,customStatus:s}}));this._userModule.emitOuterEvent(_r.USER_STATUS_UPDATED,r)}},{key:"setSelfStatus",value:function(e){var t=this,n="".concat(this._className,".setSelfStatus"),o=e.customStatus,r=new Uh(bh.SET_SELF_STATUS);return this._userModule.request({protocolName:ph,requestData:{customStatus:o}}).then((function(e){return r.setNetworkType(t._userModule.getNetworkType()).setMessage("customStatus:".concat(o)).end(),wl.log("".concat(n," ok. customStatus:").concat(o)),t._userModule.getModule(cg).setCustomStatus(o),Vv({userID:t._userModule.getMyUserID(),statusType:1,customStatus:o})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"getUserStatus",value:function(e){var t=this,n="".concat(this._className,".getUserStatus"),o=e.userIDList,r=void 0===o?[]:o,a=this._userModule.getMyUserID(),s=y(r),i=void 0,u=s.indexOf(a);if(u>-1){s.splice(u,1);var c=this._userModule.getModule(cg).getCustomStatus();i={userID:a,statusType:1,customStatus:c}}if(0===s.length)return Jv({successUserList:[i],failureUserList:[]});if(!this.canIUse(wc.USER_STATUS))return Xv({code:Mh.CANNOT_USE_COMMERCIAL_ABILITY,message:yh.CANNOT_USE_COMMERCIAL_ABILITY});s.length>this.MAX_QUERY_USER_COUNT&&(wl.warn("".concat(n," 查询用户状态单次请求不能超过").concat(this.MAX_QUERY_USER_COUNT,"个用户")),s=r.slice(0,this.MAX_QUERY_USER_COUNT));var l=new Uh(bh.GET_USER_STATUS);return this._userModule.request({protocolName:gh,requestData:{userIDList:s}}).then((function(e){var o=e.data,a=o.successUserList,s=void 0===a?[]:a,u=o.failureUserList,c=void 0===u?[]:u,d=s.map((function(e){var t=e.userID,n=e.statusType,o=e.customStatus;return{userID:t,statusType:n,customStatus:ry(o)}})),p=c.map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,r=e.errorInfo;return{userID:Bd(n)?t:n,code:o,message:r}}));ed(i)||d.unshift(i);var g="userID count:".concat(r.length,", success count:").concat(d.length,", fail count:").concat(p.length);return l.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(g)).end(),wl.log("".concat(n," ok. ").concat(g,".")),Vv({successUserList:d,failureUserList:p})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],a=n[1];l.setMessage("userID count:".concat(r.length)).setError(e,o,a).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"subscribeUserStatus",value:function(e){var t=this;if(!this.canIUse(wc.USER_STATUS))return Xv({code:Mh.CANNOT_USE_COMMERCIAL_ABILITY,message:yh.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._className,".subscribeUserStatus"),o=e.userIDList,r=void 0===o?[]:o,a=y(r);a.length>this.MAX_SUBSCRIBE_USER_COUNT&&(wl.warn("".concat(n," 订阅用户状态单次请求不能超过").concat(this.MAX_SUBSCRIBE_USER_COUNT,"个用户")),a=r.slice(0,this.MAX_SUBSCRIBE_USER_COUNT));var s=new Uh(bh.SUBSCRIBE_USER_STATUS),i="userID count:".concat(r.length);return wl.log("".concat(n," ").concat(i)),this._userModule.request({protocolName:_h,requestData:{userIDList:a}}).then((function(e){var o=e.data.failureUserList,r=(void 0===o?[]:o).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,r=e.errorInfo;return{userID:Bd(n)?t:n,code:o,message:r}}));return s.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(i," fail count:").concat(r.length)).end(),wl.log("".concat(n," ok. fail count:").concat(r.length,".")),Vv({failureUserList:r})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setMessage("".concat(i)).setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"unsubscribeUserStatus",value:function(e){var t=this;if(!this.canIUse(wc.USER_STATUS))return Xv({code:Mh.CANNOT_USE_COMMERCIAL_ABILITY,message:yh.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._className,".unsubscribeUserStatus"),o=(e||{}).userIDList,r=void 0===o?[]:o,a=y(r);r.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(wl.warn("".concat(n," 取消订阅用户状态单次请求不能超过").concat(this.MAX_UNSUBSCRIBE_USER_COUNT,"个用户")),a=r.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT));var s=new Uh(bh.UNSUBSCRIBE_USER_STATUS),i="userID count:".concat(r.length);wl.log("".concat(n," ").concat(i));var u={userIDList:a};return 0===a.length&&(u.userIDList=void 0,u.unsubscribeAll=1),this._userModule.request({protocolName:hh,requestData:u}).then((function(e){var o=e.data.failureUserList,r=(void 0===o?[]:o).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,r=e.errorInfo;return{userID:Bd(n)?t:n,code:o,message:r}}));return s.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(i," fail count:").concat(r.length)).end(),wl.log("".concat(n," ok. fail count:").concat(r.length,".")),Vv({failureUserList:r})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];s.setMessage("".concat(i)).setError(e,o,r).end()})),wl.error("".concat(n," failed. error:"),e),Xv(e)}))}},{key:"reset",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),e}(),sy=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._className="UserModule",o._profileHandler=new ty(f(o)),o._blacklistHandler=new oy(f(o)),o._userStatusHandler=new ay(f(o)),o.getInnerEmitterInstance().on(gM,o.onContextUpdated,f(o)),o}return i(n,[{key:"onContextUpdated",value:function(e){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:"onProfileModified",value:function(e){this._profileHandler.onProfileModified(e)}},{key:"onRelationChainModified",value:function(e){var t=e.dataList;if(!Bd(t)){var n=[];t.forEach((function(e){e.blackListDelAccount&&n.push.apply(n,y(e.blackListDelAccount))})),n.length>0&&this._blacklistHandler.onAccountDeleted(n);var o=[];t.forEach((function(e){e.blackListAddAccount&&o.push.apply(o,y(e.blackListAddAccount))})),o.length>0&&this._blacklistHandler.onAccountAdded(o)}}},{key:"onConversationsProfileUpdated",value:function(e){this._profileHandler.onConversationsProfileUpdated(e)}},{key:"getMyAccount",value:function(){return this.getMyUserID()}},{key:"getMyProfile",value:function(){return this._profileHandler.getMyProfile()}},{key:"getStorageModule",value:function(){return this.getModule(lg)}},{key:"isMyFriend",value:function(e){var t=this.getModule(ag);return!!t&&t.isMyFriend(e)}},{key:"getUserProfile",value:function(e){return this._profileHandler.getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._profileHandler.updateMyProfile(e)}},{key:"getNickAndAvatarByUserID",value:function(e){return this._profileHandler.getNickAndAvatarByUserID(e)}},{key:"getLocalBlacklist",value:function(){var e=this._blacklistHandler.getLocalBlacklist();return Jv(e)}},{key:"addBlacklist",value:function(e){return this._blacklistHandler.addBlacklist(e)}},{key:"deleteBlacklist",value:function(e){return this._blacklistHandler.deleteBlacklist(e)}},{key:"onUserStatusUpdated",value:function(e){this._userStatusHandler.onUserStatusUpdated(e)}},{key:"setSelfStatus",value:function(e){return this._userStatusHandler.setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._userStatusHandler.getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._userStatusHandler.subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._userStatusHandler.unsubscribeUserStatus(e)}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._profileHandler.reset(),this._blacklistHandler.reset(),this._userStatusHandler.reset()}}]),n}(Ag),iy=function(){function e(t,n){r(this,e),this._moduleManager=t,this._isLoggedIn=!1,this._SDKAppID=n.SDKAppID,this._userID=n.userID||"",this._userSig=n.userSig||"",this._version="2.22.0",this._a2Key="",this._tinyID="",this._customStatus="",this._contentType="json",this._unlimitedAVChatRoom=n.unlimitedAVChatRoom,this._scene=n.scene||"",this._oversea=n.oversea,this._instanceID=n.instanceID,this._statusInstanceID=0,this._isDevMode=n.devMode,this._proxyServer=n.proxyServer}return i(e,[{key:"isLoggedIn",value:function(){return this._isLoggedIn}},{key:"isOversea",value:function(){return this._oversea}},{key:"isPrivateNetWork",value:function(){return this._proxyServer}},{key:"isDevMode",value:function(){return this._isDevMode}},{key:"isSingaporeSite",value:function(){return this._SDKAppID>=2e7&&this._SDKAppID<3e7}},{key:"isKoreaSite",value:function(){return this._SDKAppID>=3e7&&this._SDKAppID<4e7}},{key:"isGermanySite",value:function(){return this._SDKAppID>=4e7&&this._SDKAppID<5e7}},{key:"isIndiaSite",value:function(){return this._SDKAppID>=5e7&&this._SDKAppID<6e7}},{key:"isUnlimitedAVChatRoom",value:function(){return this._unlimitedAVChatRoom}},{key:"setUserID",value:function(e){this._userID=e}},{key:"getUserID",value:function(){return this._userID}},{key:"setUserSig",value:function(e){this._userSig=e}},{key:"getUserSig",value:function(){return this._userSig}},{key:"getSDKAppID",value:function(){return this._SDKAppID}},{key:"setTinyID",value:function(e){this._tinyID=e,this._isLoggedIn=!0}},{key:"getTinyID",value:function(){return this._tinyID}},{key:"setCustomStatus",value:function(e){this._customStatus=e}},{key:"getCustomStatus",value:function(){return this._customStatus}},{key:"getScene",value:function(){return this._isTUIKit()?"tuikit":this._scene}},{key:"getInstanceID",value:function(){return this._instanceID}},{key:"getStatusInstanceID",value:function(){return this._statusInstanceID}},{key:"setStatusInstanceID",value:function(e){this._statusInstanceID=e}},{key:"getVersion",value:function(){return this._version}},{key:"getA2Key",value:function(){return this._a2Key}},{key:"setA2Key",value:function(e){this._a2Key=e}},{key:"getContentType",value:function(){return this._contentType}},{key:"getProxyServer",value:function(){return this._proxyServer}},{key:"_isTUIKit",value:function(){var e=!1,t=!1,n=!1,o=!1,r=[];Wc&&(r=Object.keys(zc)),Yc&&(r=jc?Object.keys(uni):Object.keys(window));for(var a=0,s=r.length;a<s;a++)if(r[a].toLowerCase().includes("uikit")){e=!0;break}if(r=null,Wc&&nd(getApp)){var i=getApp().globalData;Zl(i)&&!0===i.isTUIKit&&(t=!0)}!0===this._moduleManager.getModule(lg).getStorageSync("TIM_".concat(this._SDKAppID,"_isTUIKit"))&&(n=!0);var u=null;if(qc&&!xc&&"undefined"==typeof uni&&__wxConfig&&(u=__wxConfig.pages),Vc&&"undefined"==typeof uni&&__qqConfig&&(u=__qqConfig.pages),$l(u)&&u.length>0){for(var c=0,l=u.length;c<l;c++)if(u[c].toLowerCase().includes("tui")){o=!0;break}u=null}return e||t||n||o}},{key:"reset",value:function(){this._isLoggedIn=!1,this._userSig="",this._a2Key="",this._tinyID="",this._customStatus="",this._statusInstanceID=0}}]),e}(),uy=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._className="SignModule",o._helloInterval=120,o._lastLoginTs=0,o._lastWsHelloTs=0,o._isWebUniapp=0,fM.mixin(f(o)),o}return i(n,[{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&e%this._helloInterval==0&&this._hello()}},{key:"login",value:function(e){if(this.isLoggedIn()){var t="您已经登录帐号".concat(e.userID,"!如需切换帐号登录,请先调用 logout 接口登出,再调用 login 接口登录。");return wl.warn(t),Jv({actionStatus:"OK",errorCode:0,errorInfo:t,repeatLogin:!0})}if(Date.now()-this._lastLoginTs<=15e3)return wl.warn("您正在尝试登录帐号".concat(e.userID,"!请勿重复登录。")),Xv({code:Mh.REPEAT_LOGIN,message:yh.REPEAT_LOGIN});wl.log("".concat(this._className,".login userID:").concat(e.userID));var n=this._checkLoginInfo(e);if(0!==n.code)return Xv(n);var o=this.getModule(cg),r=e.userID,a=e.userSig;return o.setUserID(r),o.setUserSig(a),this.getModule(mg).updateProtocolConfig(),this._login()}},{key:"_login",value:function(){var e=this,t=this.getModule(cg),n=t.getScene(),o=0,r=new Uh(bh.LOGIN);r.setMessage("".concat(n)).setMoreMessage("identifier:".concat(this.getMyUserID())),jc?"tuikit"===n?r.setUIPlatform(4):r.setUIPlatform(3):Wc?"tuikit"===n?r.setUIPlatform(12):r.setUIPlatform(11):Yc&&(gl?"tuikit"===n?r.setUIPlatform(17):r.setUIPlatform(16):"tuikit"===n?r.setUIPlatform(14):r.setUIPlatform(13));var a=this.getModule(Sg);if(a.canIUseOfflinePush()){this._isWebUniapp=a.getUniAppPlatform();var s=this._getStatusInstanceID();t.setStatusInstanceID(s),this.getModule(mg).updateProtocolConfig(),o=a.getDeviceBrand()}return this._lastLoginTs=Date.now(),this.request({protocolName:Dg,requestData:{deviceBrand:o,isWebUniapp:this._isWebUniapp}}).then((function(o){e._lastLoginTs=0;var a=Date.now(),s=null,i=o.data,u=i.a2Key,c=i.tinyID,l=i.helloInterval,d=i.instanceID,p=i.timeStamp,g=i.customStatus,_=void 0===g?"":g;wl.log("".concat(e._className,".login ok. scene:").concat(n," helloInterval:").concat(l," instanceID:").concat(d," timeStamp:").concat(p));var h=1e3*p,f=a-r.getStartTs(),m=h+parseInt(f/2)-a,v=r.getStartTs()+m;if(r.start(v),function(e,t){Rl=t;var n=new Date;n.setTime(e),wl.info("baseTime from server: ".concat(n," offset: ").concat(Rl))}(h,m),!c)throw s=new Wv({code:Mh.NO_TINYID,message:yh.NO_TINYID}),r.setError(s,!0,e.getNetworkType()).end(),s;if(!u)throw s=new Wv({code:Mh.NO_A2KEY,message:yh.NO_A2KEY}),r.setError(s,!0,e.getNetworkType()).end(),s;r.setNetworkType(e.getNetworkType()).setMoreMessage("helloInterval:".concat(l," instanceID:").concat(d," offset:").concat(m)).end(),t.setA2Key(u),t.setTinyID(c),t.setStatusInstanceID(d);var M=ry(_);t.setCustomStatus(M),e.getModule(mg).updateProtocolConfig(),e.emitInnerEvent(gM),e._helloInterval=l,e.triggerReady();var y=e.getModule(Sg);return y.canIUseOfflinePush()&&(uni.setStorageSync("timUniAppInstanceID",d),y.init()),e._fetchCloudControlConfig(),o})).catch((function(t){return e.probeNetwork().then((function(e){var n=M(e,2),o=n[0],a=n[1];r.setError(t,o,a).end(!0)})),e._moduleManager.setNotReadyReason(Mh.LOGIN_FAILED),wl.error("".concat(e._className,".login failed. error:"),t),e._lastLoginTs=0,e._moduleManager.onLoginFailed(),Xv(t)}))}},{key:"logout",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(!this.isLoggedIn())return Xv({code:Mh.USER_NOT_LOGGED_IN,message:yh.USER_NOT_LOGGED_IN});var n=new Uh(bh.LOGOUT);return n.setNetworkType(this.getNetworkType()).setMessage("identifier:".concat(this.getMyUserID())).end(!0),wl.info("".concat(this._className,".logout type:").concat(t)),0===t&&this._moduleManager.setNotReadyReason(Mh.LOGGED_OUT),this.request({protocolName:Ng,requestData:{type:t}}).then((function(){return e.resetReady(),Jv({})})).catch((function(t){return wl.error("".concat(e._className,"._logout error:"),t),e.resetReady(),Jv({})}))}},{key:"_fetchCloudControlConfig",value:function(){this.getModule(yg).fetchConfig()}},{key:"_getStatusInstanceID",value:function(){return uni.getStorageSync("timUniAppInstanceID")}},{key:"_hello",value:function(){var e=this;this._lastWsHelloTs=Date.now(),this.request({protocolName:Og,requestData:{isWebUniapp:this._isWebUniapp}}).catch((function(t){wl.warn("".concat(e._className,"._hello error:"),t)}))}},{key:"getLastWsHelloTs",value:function(){return this._lastWsHelloTs}},{key:"_checkLoginInfo",value:function(e){var t=0,n="";return Bd(this.getModule(cg).getSDKAppID())?(t=Mh.NO_SDKAPPID,n=yh.NO_SDKAPPID):Bd(e.userID)?(t=Mh.NO_IDENTIFIER,n=yh.NO_IDENTIFIER):Bd(e.userSig)&&(t=Mh.NO_USERSIG,n=yh.NO_USERSIG),{code:t,message:n}}},{key:"onMultipleAccountKickedOut",value:function(e){var t=this;new Uh(bh.KICKED_OUT).setNetworkType(this.getNetworkType()).setMessage("type:".concat(hr.KICKED_OUT_MULT_ACCOUNT," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),wl.warn("".concat(this._className,".onMultipleAccountKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then((function(){t.emitOuterEvent(_r.KICKED_OUT,{type:hr.KICKED_OUT_MULT_ACCOUNT}),t._moduleManager.setNotReadyReason(Mh.KICKED_OUT_MULT_ACCOUNT),t._moduleManager.reset()}))}},{key:"onMultipleDeviceKickedOut",value:function(e){var t=this;new Uh(bh.KICKED_OUT).setNetworkType(this.getNetworkType()).setMessage("type:".concat(hr.KICKED_OUT_MULT_DEVICE," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),wl.warn("".concat(this._className,".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then((function(){t.emitOuterEvent(_r.KICKED_OUT,{type:hr.KICKED_OUT_MULT_DEVICE}),t._moduleManager.setNotReadyReason(Mh.KICKED_OUT_MULT_DEVICE),t._moduleManager.reset()}))}},{key:"onUserSigExpired",value:function(){new Uh(bh.KICKED_OUT).setNetworkType(this.getNetworkType()).setMessage(hr.KICKED_OUT_USERSIG_EXPIRED).end(!0),wl.warn("".concat(this._className,".onUserSigExpired: userSig 签名过期被踢下线")),0!==this.getModule(cg).getStatusInstanceID()&&(this.emitOuterEvent(_r.KICKED_OUT,{type:hr.KICKED_OUT_USERSIG_EXPIRED}),this._moduleManager.setNotReadyReason(Mh.KICKED_OUT_USERSIG_EXPIRED),this._moduleManager.reset())}},{key:"onRestApiKickedOut",value:function(e){new Uh(bh.KICKED_OUT).setNetworkType(this.getNetworkType()).setMessage("type:".concat(hr.KICKED_OUT_REST_API," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),wl.warn("".concat(this._className,".onRestApiKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),0!==this.getModule(cg).getStatusInstanceID()&&(this.emitOuterEvent(_r.KICKED_OUT,{type:hr.KICKED_OUT_REST_API}),this._moduleManager.setNotReadyReason(Mh.KICKED_OUT_REST_API),this._moduleManager.reset(),this.getModule(vg).onRestApiKickedOut())}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this.resetReady(),this._helloInterval=120,this._lastLoginTs=0,this._lastWsHelloTs=0,this._isWebUniapp=0}}]),n}(Ag),cy=rt.f;function ly(){return null}rn({target:"Object",stat:!0,forced:Object.defineProperty!==cy,sham:!P},{defineProperty:cy});var dy,py=function(){function e(t){r(this,e),this._moduleManager=t,this._className="StorageModule",this._storageQueue=new Map,this._errorTolerantHandle()}return i(e,[{key:"_errorTolerantHandle",value:function(){Wc||!ed(window)&&!ed(window.localStorage)||(this.getItem=ly,this.setItem=ly,this.removeItem=ly,this.clear=ly)}},{key:"onCheckTimer",value:function(e){if(e%20==0){if(0===this._storageQueue.size)return;this._doFlush()}}},{key:"_doFlush",value:function(){try{var e,t=A(this._storageQueue);try{for(t.s();!(e=t.n()).done;){var n=M(e.value,2),o=n[0],r=n[1];this._setStorageSync(this._getKey(o),r)}}catch(i){t.e(i)}finally{t.f()}this._storageQueue.clear()}catch(kC){wl.warn("".concat(this._className,"._doFlush error:"),kC)}}},{key:"_getPrefix",value:function(){var e=this._moduleManager.getModule(cg);return"TIM_".concat(e.getSDKAppID(),"_").concat(e.getUserID(),"_")}},{key:"_getKey",value:function(e){return"".concat(this._getPrefix()).concat(e)}},{key:"getItem",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;return this.getStorageSync(n)}catch(kC){return wl.warn("".concat(this._className,".getItem error:"),kC),{}}}},{key:"setItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(n){var r=o?this._getKey(e):e;this._setStorageSync(r,t)}else this._storageQueue.set(e,t)}},{key:"clear",value:function(){try{Wc?zc.clearStorageSync():localStorage&&localStorage.clear()}catch(kC){wl.warn("".concat(this._className,".clear error:"),kC)}}},{key:"removeItem",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;this._removeStorageSync(n)}catch(kC){wl.warn("".concat(this._className,".removeItem error:"),kC)}}},{key:"getSize",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"b";try{var o={size:0,limitSize:5242880,unit:n};if(Object.defineProperty(o,"leftSize",{enumerable:!0,get:function(){return o.limitSize-o.size}}),Wc&&(o.limitSize=1024*zc.getStorageInfoSync().limitSize),e)o.size=JSON.stringify(this.getItem(e)).length+this._getKey(e).length;else if(Wc){var r=zc.getStorageInfoSync(),a=r.keys;a.forEach((function(e){o.size+=JSON.stringify(t.getStorageSync(e)).length+t._getKey(e).length}))}else if(localStorage)for(var s in localStorage)localStorage.hasOwnProperty(s)&&(o.size+=localStorage.getItem(s).length+s.length);return this._convertUnit(o)}catch(kC){wl.warn("".concat(this._className," error:"),kC)}}},{key:"_convertUnit",value:function(e){var t={},n=e.unit;for(var o in t.unit=n,e)"number"==typeof e[o]&&("kb"===n.toLowerCase()?t[o]=Math.round(e[o]/1024):"mb"===n.toLowerCase()?t[o]=Math.round(e[o]/1024/1024):t[o]=e[o]);return t}},{key:"_setStorageSync",value:function(e,t){Wc?Kc?my.setStorageSync({key:e,data:t}):zc.setStorageSync(e,t):localStorage&&localStorage.setItem(e,JSON.stringify(t))}},{key:"getStorageSync",value:function(e){return Wc?Kc?my.getStorageSync({key:e}).data:zc.getStorageSync(e):localStorage?JSON.parse(localStorage.getItem(e)):{}}},{key:"_removeStorageSync",value:function(e){Wc?Kc?my.removeStorageSync({key:e}):zc.removeStorageSync(e):localStorage&&localStorage.removeItem(e)}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._doFlush()}}]),e}(),gy=function(){function e(t){r(this,e),this._className="SSOLogBody",this._report=[]}return i(e,[{key:"pushIn",value:function(e){wl.debug("".concat(this._className,".pushIn"),this._report.length,e),this._report.push(e)}},{key:"backfill",value:function(e){var t;$l(e)&&0!==e.length&&(wl.debug("".concat(this._className,".backfill"),this._report.length,e.length),(t=this._report).unshift.apply(t,y(e)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return 0===this._report.length}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getLogsInMemory",value:function(){var e=this._report.slice();return this._reset(),e}}]),e}(),_y=function(e){var t=e.getModule(cg);return{SDKType:10,SDKAppID:t.getSDKAppID(),SDKVersion:t.getVersion(),tinyID:Number(t.getTinyID()),userID:t.getUserID(),platform:e.getPlatform(),instanceID:t.getInstanceID(),traceID:Ll()}},hy=function(e){c(o,e);var n=v(o);function o(e){var t;r(this,o),(t=n.call(this,e))._className="EventStatModule",t.TAG="im-ssolog-event",t._reportBody=new gy,t.MIN_THRESHOLD=20,t.MAX_THRESHOLD=100,t.WAITING_TIME=6e4,t.REPORT_LEVEL=[4,5,6],t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._lastReportTime=Date.now();var a=t.getInnerEmitterInstance();return a.on(gM,t._onLoginSuccess,f(t)),a.on(_M,t._onCloudConfigUpdated,f(t)),t}return i(o,[{key:"reportAtOnce",value:function(){wl.debug("".concat(this._className,".reportAtOnce")),this._report()}},{key:"_onLoginSuccess",value:function(){var e=this,t=this.getModule(lg),n=t.getItem(this.TAG,!1);!Bd(n)&&nd(n.forEach)&&(wl.log("".concat(this._className,"._onLoginSuccess get ssolog in storage, count:").concat(n.length)),n.forEach((function(t){e._reportBody.pushIn(t)})),t.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("evt_rpt_threshold"),t=this.getCloudConfig("evt_rpt_waiting"),n=this.getCloudConfig("evt_rpt_level"),o=this.getCloudConfig("evt_rpt_sdkappid_bl"),r=this.getCloudConfig("evt_rpt_tinyid_wl");ed(e)||(this.MIN_THRESHOLD=Number(e)),ed(t)||(this.WAITING_TIME=Number(t)),ed(n)||(this.REPORT_LEVEL=n.split(",").map((function(e){return Number(e)}))),ed(o)||(this.REPORT_SDKAPPID_BLACKLIST=o.split(",").map((function(e){return Number(e)}))),ed(r)||(this.REPORT_TINYID_WHITELIST=r.split(","))}},{key:"pushIn",value:function(e){e instanceof Uh&&(e.updateTimeStamp(),this._reportBody.pushIn(e),this._reportBody.getLogsNumInMemory()>=this.MIN_THRESHOLD&&this._report())}},{key:"onCheckTimer",value:function(){Date.now()<this._lastReportTime+this.WAITING_TIME||this._reportBody.isEmpty()||this._report()}},{key:"_filterLogs",value:function(e){var t=this,n=this.getModule(cg),o=n.getSDKAppID(),r=n.getTinyID();return Ud(this.REPORT_SDKAPPID_BLACKLIST,o)&&!bd(this.REPORT_TINYID_WHITELIST,r)?[]:e.filter((function(e){return t.REPORT_LEVEL.includes(e.level)}))}},{key:"_report",value:function(){var e=this;if(!this._reportBody.isEmpty()){var n=this._reportBody.getLogsInMemory(),o=this._filterLogs(n);if(0!==o.length){var r={header:_y(this),event:o};this.request({protocolName:J_,requestData:t({},r)}).then((function(){e._lastReportTime=Date.now()})).catch((function(t){wl.warn("".concat(e._className,".report failed. networkType:").concat(e.getNetworkType()," error:"),t),e._reportBody.backfill(n),e._reportBody.getLogsNumInMemory()>e.MAX_THRESHOLD&&e._flushAtOnce()}))}else this._lastReportTime=Date.now()}}},{key:"_flushAtOnce",value:function(){var e=this.getModule(lg),t=e.getItem(this.TAG,!1),n=this._reportBody.getLogsInMemory();if(Bd(t))wl.log("".concat(this._className,"._flushAtOnce count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var o=n.concat(t);o.length>this.MAX_THRESHOLD&&(o=o.slice(0,this.MAX_THRESHOLD)),wl.log("".concat(this._className,"._flushAtOnce count:").concat(o.length)),e.setItem(this.TAG,o,!0,!1)}}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}]),o}(Ag),fy="none",vy="online",My=[Mh.OVER_FREQUENCY_LIMIT,Mh.OPEN_SERVICE_OVERLOAD_ERROR],yy=function(){function e(t){r(this,e),this._moduleManager=t,this._networkType="",this._className="NetMonitorModule",this.MAX_WAIT_TIME=3e3,this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null}return i(e,[{key:"start",value:function(){var e=this;Wc?(zc.getNetworkType({success:function(t){e._networkType=t.networkType,t.networkType===fy?wl.warn("".concat(e._className,".start no network, please check!")):wl.info("".concat(e._className,".start networkType:").concat(t.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),zc.onNetworkStatusChange(this._mpNetworkStatusCallback)):(this._networkType=vy,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window&&(window.addEventListener("online",this._webOnlineCallback),window.addEventListener("offline",this._webOfflineCallback)))}},{key:"_onWebOnline",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:vy})}},{key:"_onWebOffline",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:fy})}},{key:"_onNetworkStatusChange",value:function(e){var t=e.isConnected,n=e.networkType,o=!1;t?(wl.info("".concat(this._className,"._onNetworkStatusChange previousNetworkType:").concat(this._networkType," currentNetworkType:").concat(n)),this._networkType!==n&&(o=!0,this._moduleManager.getModule(vg).reConnect(!0))):this._networkType!==n&&(o=!0,wl.warn("".concat(this._className,"._onNetworkStatusChange no network, please check!")),this._moduleManager.getModule(vg).offline()),o&&(new Uh(bh.NETWORK_CHANGE).setMessage("isConnected:".concat(t," previousNetworkType:").concat(this._networkType," networkType:").concat(n)).end(),this._networkType=n)}},{key:"probe",value:function(e){var t=this;return!ed(e)&&My.includes(e.code)?Promise.resolve([!0,this._networkType]):new Promise((function(e,n){Wc?zc.getNetworkType({success:function(n){t._networkType=n.networkType,n.networkType===fy?(wl.warn("".concat(t._className,".probe no network, please check!")),e([!1,n.networkType])):(wl.info("".concat(t._className,".probe networkType:").concat(n.networkType)),e([!0,n.networkType]))}}):t._networkType===fy?e([!1,fy]):e([!0,vy])}))}},{key:"getNetworkType",value:function(){return this._networkType}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),Wc?null!==this._mpNetworkStatusCallback&&(zc.offNetworkStatusChange&&(Hc||xc?zc.offNetworkStatusChange(this._mpNetworkStatusCallback):zc.offNetworkStatusChange()),this._mpNetworkStatusCallback=null):window&&(null!==this._webOnlineCallback&&(window.removeEventListener("online",this._webOnlineCallback),this._webOnlineCallback=null),null!==this._onWebOffline&&(window.removeEventListener("offline",this._webOfflineCallback),this._webOfflineCallback=null))}}]),e}(),Iy=N((function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,o,a,s){if("function"!=typeof o)throw new TypeError("The listener must be a function");var i=new r(o,a||e,s),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],i]:e._events[u].push(i):(e._events[u]=i,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function i(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),i.prototype.eventNames=function(){var e,o,r=[];if(0===this._eventsCount)return r;for(o in e=this._events)t.call(e,o)&&r.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},i.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var r=0,a=o.length,s=new Array(a);r<a;r++)s[r]=o[r].fn;return s},i.prototype.listenerCount=function(e){var t=n?n+e:e,o=this._events[t];return o?o.fn?1:o.length:0},i.prototype.emit=function(e,t,o,r,a,s){var i=n?n+e:e;if(!this._events[i])return!1;var u,c,l=this._events[i],d=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),d){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,o),!0;case 4:return l.fn.call(l.context,t,o,r),!0;case 5:return l.fn.call(l.context,t,o,r,a),!0;case 6:return l.fn.call(l.context,t,o,r,a,s),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,g=l.length;for(c=0;c<g;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),d){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,o);break;case 4:l[c].fn.call(l[c].context,t,o,r);break;default:if(!u)for(p=1,u=new Array(d-1);p<d;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},i.prototype.on=function(e,t,n){return a(this,e,t,n,!1)},i.prototype.once=function(e,t,n){return a(this,e,t,n,!0)},i.prototype.removeListener=function(e,t,o,r){var a=n?n+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var i=this._events[a];if(i.fn)i.fn!==t||r&&!i.once||o&&i.context!==o||s(this,a);else{for(var u=0,c=[],l=i.length;u<l;u++)(i[u].fn!==t||r&&!i[u].once||o&&i[u].context!==o)&&c.push(i[u]);c.length?this._events[a]=1===c.length?c[0]:c:s(this,a)}return this},i.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new o,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prefixed=n,i.EventEmitter=i,e.exports=i})),Ty=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._className="BigDataChannelModule",o.FILETYPE={SOUND:2106,FILE:2107,VIDEO:2113},o._bdh_download_server="grouptalk.c2c.qq.com",o._BDHBizID=10001,o._authKey="",o._expireTime=0,o.getInnerEmitterInstance().on(gM,o._getAuthKey,f(o)),o}return i(n,[{key:"_getAuthKey",value:function(){var e=this;this.request({protocolName:kg}).then((function(t){t.data.authKey&&(e._authKey=t.data.authKey,e._expireTime=parseInt(t.data.expireTime))}))}},{key:"_isFromOlderVersion",value:function(e){return!(!e.content||2===e.content.downloadFlag)}},{key:"parseElements",value:function(e,t){if(!$l(e)||!t)return[];for(var n=[],o=null,r=0;r<e.length;r++)o=e[r],this._needParse(o)?n.push(this._parseElement(o,t)):n.push(e[r]);return n}},{key:"_needParse",value:function(e){return!e.cloudCustomData&&!(!this._isFromOlderVersion(e)||e.type!==hr.MSG_AUDIO&&e.type!==hr.MSG_FILE&&e.type!==hr.MSG_VIDEO)}},{key:"_parseElement",value:function(e,t){switch(e.type){case hr.MSG_AUDIO:return this._parseAudioElement(e,t);case hr.MSG_FILE:return this._parseFileElement(e,t);case hr.MSG_VIDEO:return this._parseVideoElement(e,t)}}},{key:"_parseAudioElement",value:function(e,t){return e.content.url=this._genAudioUrl(e.content.uuid,t),e}},{key:"_parseFileElement",value:function(e,t){return e.content.url=this._genFileUrl(e.content.uuid,t,e.content.fileName),e}},{key:"_parseVideoElement",value:function(e,t){return e.content.url=this._genVideoUrl(e.content.uuid,t),e}},{key:"_genAudioUrl",value:function(e,t){if(""===this._authKey)return wl.warn("".concat(this._className,"._genAudioUrl no authKey!")),"";var n=this.getModule(cg).getSDKAppID();return"https://".concat(this._bdh_download_server,"/asn.com/stddownload_common_file?authkey=").concat(this._authKey,"&bid=").concat(this._BDHBizID,"&subbid=").concat(n,"&fileid=").concat(e,"&filetype=").concat(this.FILETYPE.SOUND,"&openid=").concat(t,"&ver=0")}},{key:"_genFileUrl",value:function(e,t,n){if(""===this._authKey)return wl.warn("".concat(this._className,"._genFileUrl no authKey!")),"";n||(n="".concat(Math.floor(1e5*Math.random()),"-").concat(Date.now()));var o=this.getModule(cg).getSDKAppID();return"https://".concat(this._bdh_download_server,"/asn.com/stddownload_common_file?authkey=").concat(this._authKey,"&bid=").concat(this._BDHBizID,"&subbid=").concat(o,"&fileid=").concat(e,"&filetype=").concat(this.FILETYPE.FILE,"&openid=").concat(t,"&ver=0&filename=").concat(encodeURIComponent(n))}},{key:"_genVideoUrl",value:function(e,t){if(""===this._authKey)return wl.warn("".concat(this._className,"._genVideoUrl no authKey!")),"";var n=this.getModule(cg).getSDKAppID();return"https://".concat(this._bdh_download_server,"/asn.com/stddownload_common_file?authkey=").concat(this._authKey,"&bid=").concat(this._BDHBizID,"&subbid=").concat(n,"&fileid=").concat(e,"&filetype=").concat(this.FILETYPE.VIDEO,"&openid=").concat(t,"&ver=0")}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._authKey="",this.expireTime=0}}]),n}(Ag),Ey=["requestSnapshotUrl"],Cy=function(e){c(o,e);var n=v(o);function o(e){var t;return r(this,o),(t=n.call(this,e))._className="UploadModule",t.TIMUploadPlugin=null,t.timUploadPlugin=null,t.COSSDK=null,t._cosUploadMethod=null,t.expiredTimeLimit=600,t.appid=0,t.bucketName="",t.ciUrl="",t.directory="",t.downloadUrl="",t.uploadUrl="",t.region="ap-shanghai",t.cos=null,t.cosOptions={secretId:"",secretKey:"",sessionToken:"",expiredTime:0},t.uploadFileType="",t.duration=900,t.tryCount=0,t.getInnerEmitterInstance().on(gM,t._init,f(t)),t}return i(o,[{key:"_init",value:function(){var e="".concat(this._className,"._init"),t=this.getModule(hg);if(this.TIMUploadPlugin=t.getPlugin("tim-upload-plugin"),this.TIMUploadPlugin)this._initUploaderMethod();else{var n=Wc?"cos-wx-sdk":"cos-js-sdk";this.COSSDK=t.getPlugin(n),this.COSSDK?(this._getAuthorizationKey(),wl.warn("".concat(e," v2.9.2起推荐使用 tim-upload-plugin 代替 ").concat(n,",上传更快更安全。详细请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#registerPlugin"))):wl.warn("".concat(e," 没有检测到上传插件,将无法发送图片、音频、视频、文件等类型的消息。详细请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#registerPlugin"))}}},{key:"_getAuthorizationKey",value:function(){var e=this,t=new Uh(bh.GET_COS_AUTH_KEY),n=Math.ceil(Date.now()/1e3);this.request({protocolName:W_,requestData:{duration:this.expiredTimeLimit}}).then((function(o){var r=o.data;wl.log("".concat(e._className,"._getAuthorizationKey ok. data:"),r);var a=r.expiredTime-n;t.setMessage("requestId:".concat(r.requestId," requestTime:").concat(n," expiredTime:").concat(r.expiredTime," diff:").concat(a,"s")).setNetworkType(e.getNetworkType()).end(),!Wc&&r.region&&(e.region=r.region),e.appid=r.appid,e.bucketName=r.bucketName,e.ciUrl=r.ciUrl,e.directory=r.directory,e.downloadUrl=r.downloadUrl,e.uploadUrl=r.uploadUrl,e.cosOptions={secretId:r.secretId,secretKey:r.secretKey,sessionToken:r.sessionToken,expiredTime:r.expiredTime},wl.log("".concat(e._className,"._getAuthorizationKey ok. region:").concat(e.region," bucketName:").concat(e.bucketName)),e._initUploaderMethod()})).catch((function(n){e.probeNetwork().then((function(e){var o=M(e,2),r=o[0],a=o[1];t.setError(n,r,a).end()})),wl.warn("".concat(e._className,"._getAuthorizationKey failed. error:"),n)}))}},{key:"_getCosPreSigUrl",value:function(e){var t=this,n="".concat(this._className,"._getCosPreSigUrl"),o=Math.ceil(Date.now()/1e3),r=new Uh(bh.GET_COS_PRE_SIG_URL);return this.request({protocolName:Y_,requestData:{fileType:e.fileType,fileName:e.fileName,uploadMethod:e.uploadMethod,duration:e.duration}}).then((function(e){t.tryCount=0;var a=e.data||{},s=a.expiredTime-o;return wl.log("".concat(n," ok. data:"),a),r.setMessage("requestId:".concat(a.requestId," expiredTime:").concat(a.expiredTime," diff:").concat(s,"s")).setNetworkType(t.getNetworkType()).end(),a})).catch((function(o){return-1===o.code&&(o.code=Mh.COS_GET_SIG_FAIL),t.probeNetwork().then((function(e){var t=M(e,2),n=t[0],a=t[1];r.setError(o,n,a).end()})),wl.warn("".concat(n," failed. error:"),o),t.tryCount<1?(t.tryCount++,t._getCosPreSigUrl(e)):(t.tryCount=0,Xv({code:Mh.COS_GET_SIG_FAIL,message:yh.COS_GET_SIG_FAIL}))}))}},{key:"_initUploaderMethod",value:function(){var e=this;if(this.TIMUploadPlugin)return this.timUploadPlugin=new this.TIMUploadPlugin,void(this._cosUploadMethod=function(t,n){e.timUploadPlugin.uploadFile(t,n)});this.appid&&(this.cos=Wc?new this.COSSDK({ForcePathStyle:!0,getAuthorization:this._getAuthorization.bind(this)}):new this.COSSDK({getAuthorization:this._getAuthorization.bind(this)}),this._cosUploadMethod=Wc?function(t,n){e.cos.postObject(t,n)}:function(t,n){e.cos.uploadFiles(t,n)})}},{key:"onCheckTimer",value:function(e){this.COSSDK&&(this.TIMUploadPlugin||this.isLoggedIn()&&e%60==0&&Math.ceil(Date.now()/1e3)>=this.cosOptions.expiredTime-120&&this._getAuthorizationKey())}},{key:"_getAuthorization",value:function(e,t){t({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:"upload",value:function(e){if(!0===e.getRelayFlag())return Promise.resolve();var t=this.getModule(Eg);switch(e.type){case hr.MSG_IMAGE:return t.addTotalCount(Dh),this._uploadImage(e);case hr.MSG_FILE:return t.addTotalCount(Dh),this._uploadFile(e);case hr.MSG_AUDIO:return t.addTotalCount(Dh),this._uploadAudio(e);case hr.MSG_VIDEO:return t.addTotalCount(Dh),this._uploadVideo(e);default:return Promise.resolve()}}},{key:"_uploadImage",value:function(e){var n=this,o=this.getModule(tg),r=e.getElements()[0],a=o.getMessageOption(e.clientSequence);return this.doUploadImage({file:a.payload.file,to:a.to,onProgress:function(e){if(r.updatePercent(e),nd(a.onProgress))try{a.onProgress(e)}catch(t){return Xv({code:Mh.MESSAGE_ONPROGRESS_FUNCTION_ERROR,message:yh.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(o){var a=o.location,s=o.fileType,i=o.fileSize,u=o.width,c=o.height,l=n.isPrivateNetWork()?a:fd(a);r.updateImageFormat(s);var d=Ld({originUrl:l,originWidth:u,originHeight:c,min:198}),p=Ld({originUrl:l,originWidth:u,originHeight:c,min:720});return r.updateImageInfoArray([{size:i,url:l,width:u,height:c},t({},p),t({},d)]),e}))}},{key:"_uploadFile",value:function(e){var t=this,n=this.getModule(tg),o=e.getElements()[0],r=n.getMessageOption(e.clientSequence);return this.doUploadFile({file:r.payload.file,to:r.to,onProgress:function(e){if(o.updatePercent(e),nd(r.onProgress))try{r.onProgress(e)}catch(t){return Xv({code:Mh.MESSAGE_ONPROGRESS_FUNCTION_ERROR,message:yh.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(n){var r=n.location,a=t.isPrivateNetWork()?r:fd(r);return o.updateFileUrl(a),e}))}},{key:"_uploadAudio",value:function(e){var t=this,n=this.getModule(tg),o=e.getElements()[0],r=n.getMessageOption(e.clientSequence);return this.doUploadAudio({file:r.payload.file,to:r.to,onProgress:function(e){if(o.updatePercent(e),nd(r.onProgress))try{r.onProgress(e)}catch(t){return Xv({code:Mh.MESSAGE_ONPROGRESS_FUNCTION_ERROR,message:yh.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(n){var r=n.location,a=t.isPrivateNetWork()?r:fd(r);return o.updateAudioUrl(a),e}))}},{key:"_uploadVideo",value:function(e){var t=this,n=this.getModule(tg),o=e.getElements()[0],r=n.getMessageOption(e.clientSequence);return this.doUploadVideo({file:r.payload.file,to:r.to,onProgress:function(e){if(o.updatePercent(e),nd(r.onProgress))try{r.onProgress(e)}catch(t){return Xv({code:Mh.MESSAGE_ONPROGRESS_FUNCTION_ERROR,message:yh.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(n){var r=n.location,a=n.snapshotInfo,s=t.isPrivateNetWork()?r:fd(r);return o.updateVideoUrl(s),Bd(a)||o.updateSnapshotInfo(a),e}))}},{key:"doUploadImage",value:function(e){var t=this;if(!e.file)return Xv({code:Mh.MESSAGE_IMAGE_SELECT_FILE_FIRST,message:yh.MESSAGE_IMAGE_SELECT_FILE_FIRST});var n=this._checkImageType(e.file);if(!0!==n)return n;var o=this._checkImageSize(e.file);if(!0!==o)return o;var r=null;return this._setUploadFileType(MM),this.uploadByCOS(e).then((function(e){return r=e,t.isPrivateNetWork()?Dd(e.location):Dd("https://".concat(e.location))})).then((function(e){return r.width=e.width,r.height=e.height,Promise.resolve(r)}))}},{key:"_checkImageType",value:function(e){var t="";return t=Wc?e.url.slice(e.url.lastIndexOf(".")+1):e.files[0].name.slice(e.files[0].name.lastIndexOf(".")+1),mM.indexOf(t.toLowerCase())>=0||Xv({code:Mh.MESSAGE_IMAGE_TYPES_LIMIT,message:yh.MESSAGE_IMAGE_TYPES_LIMIT})}},{key:"_checkImageSize",value:function(e){var t=0;return 0===(t=Wc?e.size:e.files[0].size)?Xv({code:Mh.MESSAGE_FILE_IS_EMPTY,message:"".concat(yh.MESSAGE_FILE_IS_EMPTY)}):t<20971520||Xv({code:Mh.MESSAGE_IMAGE_SIZE_LIMIT,message:"".concat(yh.MESSAGE_IMAGE_SIZE_LIMIT)})}},{key:"doUploadFile",value:function(e){var t=null;return e.file?e.file.files[0].size>104857600?Xv(t={code:Mh.MESSAGE_FILE_SIZE_LIMIT,message:yh.MESSAGE_FILE_SIZE_LIMIT}):0===e.file.files[0].size?(t={code:Mh.MESSAGE_FILE_IS_EMPTY,message:"".concat(yh.MESSAGE_FILE_IS_EMPTY)},Xv(t)):(this._setUploadFileType(TM),this.uploadByCOS(e)):Xv(t={code:Mh.MESSAGE_FILE_SELECT_FILE_FIRST,message:yh.MESSAGE_FILE_SELECT_FILE_FIRST})}},{key:"doUploadVideo",value:function(e){return e.file.videoFile.size>104857600?Xv({code:Mh.MESSAGE_VIDEO_SIZE_LIMIT,message:"".concat(yh.MESSAGE_VIDEO_SIZE_LIMIT)}):0===e.file.videoFile.size?Xv({code:Mh.MESSAGE_FILE_IS_EMPTY,message:"".concat(yh.MESSAGE_FILE_IS_EMPTY)}):-1===vM.indexOf(e.file.videoFile.type)?Xv({code:Mh.MESSAGE_VIDEO_TYPES_LIMIT,message:"".concat(yh.MESSAGE_VIDEO_TYPES_LIMIT)}):(this._setUploadFileType(yM),Wc?this.handleVideoUpload({file:e.file.videoFile,onProgress:e.onProgress}):Yc?this.handleVideoUpload(e):void 0)}},{key:"handleVideoUpload",value:function(e){var t=this;return new Promise((function(n,o){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){o(new Wv({code:Mh.MESSAGE_VIDEO_UPLOAD_FAIL,message:yh.MESSAGE_VIDEO_UPLOAD_FAIL}))}))}))}))}},{key:"doUploadAudio",value:function(e){return e.file?e.file.size>20971520?Xv(new Wv({code:Mh.MESSAGE_AUDIO_SIZE_LIMIT,message:"".concat(yh.MESSAGE_AUDIO_SIZE_LIMIT)})):0===e.file.size?Xv(new Wv({code:Mh.MESSAGE_FILE_IS_EMPTY,message:"".concat(yh.MESSAGE_FILE_IS_EMPTY)})):(this._setUploadFileType(IM),this.uploadByCOS(e)):Xv(new Wv({code:Mh.MESSAGE_AUDIO_UPLOAD_FAIL,message:yh.MESSAGE_AUDIO_UPLOAD_FAIL}))}},{key:"uploadByCOS",value:function(e){var t=this,n="".concat(this._className,".uploadByCOS");if(!nd(this._cosUploadMethod))return wl.warn("".concat(n," 没有检测到上传插件,将无法发送图片、音频、视频、文件等类型的消息。详细请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/SDK.html#registerPlugin")),Xv({code:Mh.COS_UNDETECTED,message:yh.COS_UNDETECTED});if(this.timUploadPlugin)return this._uploadWithPreSigUrl(e);var o=new Uh(bh.UPLOAD),r=Date.now(),a=this._getFile(e);return new Promise((function(s,i){var u=Wc?t._createCosOptionsWXMiniApp(e):t._createCosOptionsWeb(e),c=t;t._cosUploadMethod(u,(function(e,u){var l=Object.create(null);if(u){if(e||$l(u.files)&&u.files[0].error){var d=new Wv({code:Mh.MESSAGE_FILE_UPLOAD_FAIL,message:yh.MESSAGE_FILE_UPLOAD_FAIL});return o.setError(d,!0,t.getNetworkType()).end(),wl.log("".concat(n," failed. error:"),u.files[0].error),403===u.files[0].error.statusCode&&(wl.warn("".concat(n," failed. cos AccessKeyId was invalid, regain auth key!")),t._getAuthorizationKey()),void i(d)}l.fileName=a.name,l.fileSize=a.size,l.fileType=a.type.slice(a.type.indexOf("/")+1).toLowerCase(),l.location=Wc?u.Location:u.files[0].data.Location;var p=Date.now()-r,g=c._formatFileSize(a.size),_=c._formatSpeed(1e3*a.size/p),h="size:".concat(g," time:").concat(p,"ms speed:").concat(_);wl.log("".concat(n," success. name:").concat(a.name," ").concat(h)),s(l);var f=t.getModule(Eg);return f.addCost(Dh,p),f.addFileSize(Dh,a.size),void o.setNetworkType(t.getNetworkType()).setMessage(h).end()}var m=new Wv({code:Mh.MESSAGE_FILE_UPLOAD_FAIL,message:yh.MESSAGE_FILE_UPLOAD_FAIL});o.setError(m,!0,c.getNetworkType()).end(),wl.warn("".concat(n," failed. error:"),e),403===e.statusCode&&(wl.warn("".concat(n," failed. cos AccessKeyId was invalid, regain auth key!")),t._getAuthorizationKey()),i(m)}))}))}},{key:"_uploadWithPreSigUrl",value:function(e){var t=this,n="".concat(this._className,"._uploadWithPreSigUrl"),o=this._getFile(e);return this._createCosOptionsPreSigUrl(e).then((function(e){return new Promise((function(r,a){var s=new Uh(bh.UPLOAD),i=e.requestSnapshotUrl,u=void 0===i?void 0:i,c=h(e,Ey),l=Date.now();t._cosUploadMethod(c,(function(e,i){var c=Object.create(null);if(e||403===i.statusCode)return s.setError(new Wv(e),!0,t.getNetworkType()).end(),wl.log("".concat(n," failed, error:"),e),void a(new Wv({code:Mh.MESSAGE_FILE_UPLOAD_FAIL,message:yh.MESSAGE_FILE_UPLOAD_FAIL}));var d=i.data.location||"";t.isPrivateNetWork()||0!==d.indexOf("https://")&&0!==d.indexOf("http://")||(d=d.split("//")[1]),c.fileName=o.name,c.fileSize=o.size,c.fileType=o.type.slice(o.type.indexOf("/")+1).toLowerCase(),c.location=d;var p=Date.now()-l,g=t._formatFileSize(o.size),_=t._formatSpeed(1e3*o.size/p),h="size:".concat(g,",time:").concat(p,"ms,speed:").concat(_," res:").concat(JSON.stringify(i.data));wl.log("".concat(n," success name:").concat(o.name,",").concat(h)),s.setNetworkType(t.getNetworkType()).setMessage(h).end();var f=t.getModule(Eg);if(f.addCost(Dh,p),f.addFileSize(Dh,o.size),!Bd(u))return t._getSnapshotInfoByUrl(u).then((function(e){c.snapshotInfo=e,r(c)}));r(c)}))}))}))}},{key:"_getFile",value:function(e){var t;return $l(e.file.files)||(t=e.file.files,"filelist"===rd(t))?e.file.files[0]:e.file}},{key:"_formatFileSize",value:function(e){return e<1024?e+"B":e<1048576?Math.floor(e/1024)+"KB":Math.floor(e/1048576)+"MB"}},{key:"_formatSpeed",value:function(e){return e<=1048576?Pd(e/1024,1)+"KB/s":Pd(e/1048576,1)+"MB/s"}},{key:"_createCosOptionsWeb",value:function(e){var t=this._getFile(e),n=t.name,o=n.slice(n.lastIndexOf(".")),r=this._genFileName("".concat(dd(999999)).concat(o));return{files:[{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(r),Body:t}],SliceSize:1048576,onProgress:function(t){if("function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){wl.warn("onProgress callback error:",n)}},onFileFinish:function(e,t,n){}}}},{key:"_createCosOptionsWXMiniApp",value:function(e){var t=this._getFile(e),n=this._genFileName(t.name),o=t.url;return{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(n),FilePath:o,onProgress:function(t){if(wl.log(JSON.stringify(t)),"function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){wl.warn("onProgress callback error:",n)}}}}},{key:"_createCosOptionsPreSigUrl",value:function(e){var t=this,n="",o="",r=0,a=this._getFile(e);if(Wc)n=this._genFileName(a.name),o=a.url,r=1;else{var s=a.name,i=s.slice(s.lastIndexOf("."));n=this._genFileName("".concat(dd(999999)).concat(i)),o=a,r=0}return this._getCosPreSigUrl({fileType:this.uploadFileType,fileName:n,uploadMethod:r,duration:this.duration}).then((function(r){var a=r.uploadUrl,s=r.downloadUrl,i=r.requestSnapshotUrl,u=void 0===i?void 0:i;return{url:a,fileType:t.uploadFileType,fileName:n,resources:o,downloadUrl:s,requestSnapshotUrl:u,onProgress:function(t){if("function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){wl.warn("onProgress callback error:",n),wl.error(n)}}}}))}},{key:"_genFileName",value:function(e){return"".concat(Nd(),"-").concat(e)}},{key:"_setUploadFileType",value:function(e){this.uploadFileType=e}},{key:"_getSnapshotInfoByUrl",value:function(e){var t=this,n=new Uh(bh.GET_SNAPSHOT_INFO);return this.request({protocolName:z_,requestData:{platform:this.getPlatform(),coverName:this._genFileName(dd(99999)),requestSnapshotUrl:e}}).then((function(e){var t=(e.data||{}).snapshotUrl;return n.setMessage("snapshotUrl:".concat(t)).end(),Bd(t)?{}:Dd(t).then((function(e){return{snapshotUrl:t,snapshotWidth:e.width,snapshotHeight:e.height}}))})).catch((function(e){return wl.warn("".concat(t._className,"._getSnapshotInfoByUrl failed. error:"),e),n.setCode(e.errorCode).setMessage(e.errorInfo).end(),{}}))}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset"))}}]),o}(Ag),Sy=["downloadKey","pbDownloadKey","messageList"],Ay=function(){function e(t){r(this,e),this._className="MergerMessageHandler",this._messageModule=t}return i(e,[{key:"uploadMergerMessage",value:function(e,t){var n=this;wl.debug("".concat(this._className,".uploadMergerMessage message:"),e,"messageBytes:".concat(t));var o=e.payload.messageList,r=o.length,a=new Uh(bh.UPLOAD_MERGER_MESSAGE);return this._messageModule.request({protocolName:th,requestData:{messageList:o}}).then((function(e){wl.debug("".concat(n._className,".uploadMergerMessage ok. response:"),e.data);var o=e.data,s=o.pbDownloadKey,i=o.downloadKey,u={pbDownloadKey:s,downloadKey:i,messageNumber:r};return a.setNetworkType(n._messageModule.getNetworkType()).setMessage("".concat(r,"-").concat(t,"-").concat(i)).end(),u})).catch((function(e){throw wl.warn("".concat(n._className,".uploadMergerMessage failed. error:"),e),n._messageModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];a.setError(e,o,r).end()})),e}))}},{key:"downloadMergerMessage",value:function(e){var n=this;wl.debug("".concat(this._className,".downloadMergerMessage message:"),e);var o=e.payload.downloadKey,r=new Uh(bh.DOWNLOAD_MERGER_MESSAGE);return r.setMessage("downloadKey:".concat(o)),this._messageModule.request({protocolName:nh,requestData:{downloadKey:o}}).then((function(o){if(wl.debug("".concat(n._className,".downloadMergerMessage ok. response:"),o.data),nd(e.clearElement)){var a=e.payload,s=(a.downloadKey,a.pbDownloadKey,a.messageList,h(a,Sy));e.clearElement(),e.setElement({type:e.type,content:t({messageList:o.data.messageList},s)})}else{var i=[];o.data.messageList.forEach((function(e){if(!Bd(e)){var t=new bv(e);i.push(t)}})),e.payload.messageList=i,e.payload.downloadKey="",e.payload.pbDownloadKey=""}return r.setNetworkType(n._messageModule.getNetworkType()).end(),e})).catch((function(e){throw wl.warn("".concat(n._className,".downloadMergerMessage failed. key:").concat(o," error:"),e),n._messageModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),e}))}},{key:"createMergerMessagePack",value:function(e,t,n){return e.conversationType===hr.CONV_C2C?this._createC2CMergerMessagePack(e,t,n):this._createGroupMergerMessagePack(e,t,n)}},{key:"_createC2CMergerMessagePack",value:function(e,t,n){var o=null;t&&(t.offlinePushInfo&&(o=t.offlinePushInfo),!0===t.onlineUserOnly&&(o?o.disablePush=!0:o={disablePush:!0}));var r="";Xl(e.cloudCustomData)&&e.cloudCustomData.length>0&&(r=e.cloudCustomData);var a=n.pbDownloadKey,s=n.downloadKey,i=n.messageNumber,u=e.payload,c=u.title,l=u.abstractList,d=u.compatibleText,p=this._messageModule.getModule(og);return{protocolName:Gg,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),toAccount:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:a,downloadKey:s,title:c,abstractList:l,compatibleText:d,messageNumber:i}}],cloudCustomData:r,clientTime:e.clientTime,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:p&&p.isOnlineMessage(e,t)?0:void 0,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||"",desc:o.description||"",ext:o.extension||"",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||""}}:void 0}}}},{key:"_createGroupMergerMessagePack",value:function(e,t,n){var o=null;t&&t.offlinePushInfo&&(o=t.offlinePushInfo);var r="";Xl(e.cloudCustomData)&&e.cloudCustomData.length>0&&(r=e.cloudCustomData);var a=n.pbDownloadKey,s=n.downloadKey,i=n.messageNumber,u=e.payload,c=u.title,l=u.abstractList,d=u.compatibleText,p=this._messageModule.getModule(rg);return{protocolName:Pg,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),groupID:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:a,downloadKey:s,title:c,abstractList:l,compatibleText:d,messageNumber:i}}],random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:void 0,cloudCustomData:r,onlineOnlyFlag:p&&p.isOnlineMessage(e,t)?1:0,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||"",desc:o.description||"",ext:o.extension||"",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||""}}:void 0,clientTime:e.clientTime,needReadReceipt:!0!==e.needReadReceipt||p.isMessageFromOrToAVChatroom(e.to)?0:1}}}}]),e}(),Dy={ERR_SVR_COMM_SENSITIVE_TEXT:80001,ERR_SVR_COMM_BODY_SIZE_LIMIT:80002,OPEN_SERVICE_OVERLOAD_ERROR:60022,ERR_SVR_MSG_PKG_PARSE_FAILED:20001,ERR_SVR_MSG_INTERNAL_AUTH_FAILED:20002,ERR_SVR_MSG_INVALID_ID:20003,ERR_SVR_MSG_PUSH_DENY:20006,ERR_SVR_MSG_IN_PEER_BLACKLIST:20007,ERR_SVR_MSG_BOTH_NOT_FRIEND:20009,ERR_SVR_MSG_NOT_PEER_FRIEND:20010,ERR_SVR_MSG_NOT_SELF_FRIEND:20011,ERR_SVR_MSG_SHUTUP_DENY:20012,ERR_SVR_GROUP_INVALID_PARAMETERS:10004,ERR_SVR_GROUP_PERMISSION_DENY:10007,ERR_SVR_GROUP_NOT_FOUND:10010,ERR_SVR_GROUP_INVALID_GROUPID:10015,ERR_SVR_GROUP_REJECT_FROM_THIRDPARTY:10016,ERR_SVR_GROUP_SHUTUP_DENY:10017,MESSAGE_SEND_FAIL:2100,OVER_FREQUENCY_LIMIT:2996},Ny=[Mh.MESSAGE_ONPROGRESS_FUNCTION_ERROR,Mh.MESSAGE_IMAGE_SELECT_FILE_FIRST,Mh.MESSAGE_IMAGE_TYPES_LIMIT,Mh.MESSAGE_FILE_IS_EMPTY,Mh.MESSAGE_IMAGE_SIZE_LIMIT,Mh.MESSAGE_FILE_SELECT_FILE_FIRST,Mh.MESSAGE_FILE_SIZE_LIMIT,Mh.MESSAGE_VIDEO_SIZE_LIMIT,Mh.MESSAGE_VIDEO_TYPES_LIMIT,Mh.MESSAGE_AUDIO_UPLOAD_FAIL,Mh.MESSAGE_AUDIO_SIZE_LIMIT,Mh.COS_UNDETECTED],Oy=function(e){c(o,e);var n=v(o);function o(e){var t;return r(this,o),(t=n.call(this,e))._className="MessageModule",t._messageOptionsMap=new Map,t._mergerMessageHandler=new Ay(f(t)),t}return i(o,[{key:"createTextMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new qv(e),o="string"==typeof e.payload?e.payload:e.payload.text,r=new Bh({text:o}),a=this._getNickAndAvatarByUserID(t);return n.setElement(r),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createImageMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new qv(e);if(Wc){var o=e.payload.file;if(zl(o))return void wl.warn("小程序环境下调用 createImageMessage 接口时payload.file 不支持传入 File 对象");var r=o.tempFilePaths[0],a={url:r,name:r.slice(r.lastIndexOf("/")+1),size:o.tempFiles&&o.tempFiles[0].size||1,type:r.slice(r.lastIndexOf(".")+1).toLowerCase()};e.payload.file=a}else if(Yc)if(zl(e.payload.file)){var s=e.payload.file;e.payload.file={files:[s]}}else if(Zl(e.payload.file)&&"undefined"!=typeof uni){var i=e.payload.file.tempFiles[0];e.payload.file={files:[i]}}var u=new yv({imageFormat:Fl.UNKNOWN,uuid:this._generateUUID(),file:e.payload.file}),c=this._getNickAndAvatarByUserID(t);return n.setElement(u),n.setNickAndAvatar(c),n.setNameCard(this._getNameCardByGroupID(n)),this._messageOptionsMap.set(n.clientSequence,e),n}},{key:"createAudioMessage",value:function(e){var t=e.payload.file;if(Wc){var n={url:t.tempFilePath,name:t.tempFilePath.slice(t.tempFilePath.lastIndexOf("/")+1),size:t.fileSize,second:parseInt(t.duration)/1e3,type:t.tempFilePath.slice(t.tempFilePath.lastIndexOf(".")+1).toLowerCase()};e.payload.file=n}var o=this.getMyUserID();e.currentUser=o,e.senderTinyID=this.getMyTinyID();var r=new qv(e),a=new Tv({second:Math.floor(t.duration/1e3),size:t.fileSize||t.size,url:t.tempFilePath,uuid:this._generateUUID()}),s=this._getNickAndAvatarByUserID(o);return r.setElement(a),r.setNickAndAvatar(s),r.setNameCard(this._getNameCardByGroupID(r)),this._messageOptionsMap.set(r.clientSequence,e),r}},{key:"createVideoMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID(),e.payload.file.thumbUrl="https://web.sdk.qcloud.com/im/assets/images/transparent.png",e.payload.file.thumbSize=1668;var n={};if(Wc){if(Kc)return void wl.warn("createVideoMessage 不支持在支付宝小程序环境下使用");if(zl(e.payload.file))return void wl.warn("小程序环境下调用 createVideoMessage 接口时payload.file 不支持传入 File 对象");var o=e.payload.file;n.url=o.tempFilePath,n.name=o.tempFilePath.slice(o.tempFilePath.lastIndexOf("/")+1),n.size=o.size,n.second=o.duration,n.type=o.tempFilePath.slice(o.tempFilePath.lastIndexOf(".")+1).toLowerCase()}else if(Yc){if(zl(e.payload.file)){var r=e.payload.file;e.payload.file.files=[r]}else if(Zl(e.payload.file)&&"undefined"!=typeof uni){var a=e.payload.file.tempFile;e.payload.file.files=[a]}var s=e.payload.file;n.url=window.URL.createObjectURL(s.files[0]),n.name=s.files[0].name,n.size=s.files[0].size,n.second=s.files[0].duration||0,n.type=s.files[0].type.split("/")[1]}e.payload.file.videoFile=n;var i=new qv(e),u=new Pv({videoFormat:n.type,videoSecond:Pd(n.second,0),videoSize:n.size,remoteVideoUrl:"",videoUrl:n.url,videoUUID:this._generateUUID(),thumbUUID:this._generateUUID(),thumbWidth:e.payload.file.width||200,thumbHeight:e.payload.file.height||200,thumbUrl:e.payload.file.thumbUrl,thumbSize:e.payload.file.thumbSize,thumbFormat:e.payload.file.thumbUrl.slice(e.payload.file.thumbUrl.lastIndexOf(".")+1).toLowerCase()}),c=this._getNickAndAvatarByUserID(t);return i.setElement(u),i.setNickAndAvatar(c),i.setNameCard(this._getNameCardByGroupID(i)),this._messageOptionsMap.set(i.clientSequence,e),i}},{key:"createCustomMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new qv(e),o=new Gv({data:e.payload.data,description:e.payload.description,extension:e.payload.extension}),r=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(r),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createFaceMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new qv(e),o=new Iv(e.payload),r=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(r),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createMergerMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=this._getNickAndAvatarByUserID(t),o=new qv(e),r=new wv(e.payload);return o.setElement(r),o.setNickAndAvatar(n),o.setNameCard(this._getNameCardByGroupID(o)),o.setRelayFlag(!0),o}},{key:"createForwardMessage",value:function(e){var t=e.to,n=e.conversationType,o=e.priority,r=e.payload,a=e.needReadReceipt,s=this.getMyUserID(),i=this._getNickAndAvatarByUserID(s);if(r.type===hr.MSG_GRP_TIP)return Xv(new Wv({code:Mh.MESSAGE_FORWARD_TYPE_INVALID,message:yh.MESSAGE_FORWARD_TYPE_INVALID}));var u={to:t,conversationType:n,conversationID:"".concat(n).concat(t),priority:o,isPlaceMessage:0,status:wp.UNSEND,currentUser:s,senderTinyID:this.getMyTinyID(),cloudCustomData:e.cloudCustomData||r.cloudCustomData||"",needReadReceipt:a},c=new qv(u);return c.setElement(r.getElements()[0]),c.setNickAndAvatar(i),c.setNameCard(this._getNameCardByGroupID(r)),c.setRelayFlag(!0),c}},{key:"downloadMergerMessage",value:function(e){return this._mergerMessageHandler.downloadMergerMessage(e)}},{key:"createFileMessage",value:function(e){if(Wc){var n,o="createFileMessage 接口不可用!";if(!qc&&!Vc&&!Hc)return void wl.warn("小程序目前不支持选择文件,".concat(o));var r=zc.getSystemInfoSync().SDKVersion;if(qc&&Rd(r,n="2.5.0")<0)return void wl.warn("wx.chooseMessageFile 需要基础库".concat(n,"或更高版本,").concat(o));if(Vc&&Rd(r,n="1.18.0")<0)return void wl.warn("qq.chooseMessageFile 需要基础库".concat(n,"或更高版本,").concat(o))}if(Yc||Hc){if(zl(e.payload.file)){var a=e.payload.file;e.payload.file={files:[a]}}else if(Zl(e.payload.file)&&"undefined"!=typeof uni){var s=e.payload.file,i=s.tempFiles,u=s.files,c=null;$l(i)?c=i[0]:$l(u)&&(c=u[0]),e.payload.file={files:[c]}}}else if(qc||Vc){var l=e.payload.file.tempFiles,d=t(t({},l[0]),{},{url:l[0].path});e.payload.file={files:[d]}}var p=this.getMyUserID();e.currentUser=p,e.senderTinyID=this.getMyTinyID();var g=new qv(e),_=new kv({uuid:this._generateUUID(),file:e.payload.file}),h=this._getNickAndAvatarByUserID(p);return g.setElement(_),g.setNickAndAvatar(h),g.setNameCard(this._getNameCardByGroupID(g)),this._messageOptionsMap.set(g.clientSequence,e),g}},{key:"createLocationMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new qv(e),o=new Uv(e.payload),r=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(r),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"_onCannotFindModule",value:function(){return Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"sendMessageInstance",value:function(e,t){var n,o=this,r=null;switch(e.conversationType){case hr.CONV_C2C:if(!(r=this.getModule(og)))return this._onCannotFindModule();break;case hr.CONV_GROUP:if(!(r=this.getModule(rg)))return this._onCannotFindModule();if(Id({groupID:e.to})){var a=r.getLocalGroupProfile(e.to);if(a&&a.isSupportTopic)return Xv({code:Mh.MESSAGE_SEND_GROUP_WITH_TOPIC_FAIL,message:yh.MESSAGE_SEND_GROUP_WITH_TOPIC_FAIL});if(!ed(t)&&!ed(t.messageControlInfo))return Xv({code:Mh.MESSAGE_CONTROL_INFO_FAIL,message:yh.MESSAGE_CONTROL_INFO_FAIL})}break;default:return Xv({code:Mh.MESSAGE_SEND_INVALID_CONVERSATION_TYPE,message:yh.MESSAGE_SEND_INVALID_CONVERSATION_TYPE})}var s=this.getModule(_g),i=this.getModule(rg);return s.upload(e).then((function(){return o._getSendMessageSpecifiedKey(e)===Ah&&o.getModule(Eg).addSuccessCount(Dh),i.guardForAVChatRoom(e).then((function(){if(!e.isSendable())return Xv({code:Mh.MESSAGE_FILE_URL_IS_EMPTY,message:yh.MESSAGE_FILE_URL_IS_EMPTY});o._addSendMessageTotalCount(e),n=Date.now();var a=function(e){var t="utf-8";Yc&&document&&(t=document.charset.toLowerCase());var n,o,r=0;if(o=e.length,"utf-8"===t||"utf8"===t)for(var a=0;a<o;a++)(n=e.codePointAt(a))<=127?r+=1:n<=2047?r+=2:n<=65535?r+=3:(r+=4,a++);else if("utf-16"===t||"utf16"===t)for(var s=0;s<o;s++)(n=e.codePointAt(s))<=65535?r+=2:(r+=4,s++);else r=e.replace(/[^\x00-\xff]/g,"aa").length;return r}(JSON.stringify(e));return e.type===hr.MSG_MERGER&&a>7e3?o._mergerMessageHandler.uploadMergerMessage(e,a).then((function(n){var r=o._mergerMessageHandler.createMergerMessagePack(e,t,n);return o.request(r)})):(o.getModule(ug).setMessageRandom(e),e.conversationType===hr.CONV_C2C||e.conversationType===hr.CONV_GROUP?r.sendMessage(e,t):void 0)})).then((function(a){var s=a.data,i=s.time,u=s.sequence,c=s.readReceiptCode;Jl(c)&&0!==c&&(new Uh(bh.SEND_MESSAGE_WITH_RECEIPT).setMessage("from:".concat(e.from," to:").concat(e.to," sequence:").concat(u," readReceiptCode:").concat(c)).end(),wl.warn("".concat(o._className,".sendMessageInstance readReceiptCode:").concat(c," message:").concat(jv[c]))),o._addSendMessageSuccessCount(e,n),o._messageOptionsMap.delete(e.clientSequence);var l=o.getModule(ug);e.status=wp.SUCCESS,e.time=i;var d=!1;if(e.conversationType===hr.CONV_GROUP)e.sequence=u;else if(e.conversationType===hr.CONV_C2C){var p=l.getLatestMessageSentByMe(e.conversationID);if(p){var g=p.nick,_=p.avatar;g===e.nick&&_===e.avatar||(d=!0)}}if(d&&l.modifyMessageSentByMe({conversationID:e.conversationID,latestNick:e.nick,latestAvatar:e.avatar}),r.isOnlineMessage(e,t))e._onlineOnlyFlag=!0;else{l.appendToMessageList(e);var h=e;Zl(t)&&Zl(t.messageControlInfo)&&(!0===t.messageControlInfo.excludedFromLastMessage&&(e._isExcludedFromLastMessage=!0,h=""),!0===t.messageControlInfo.excludedFromUnreadCount&&(e._isExcludedFromUnreadCount=!0));var f=e.conversationType;Td(e.to)&&(f=hr.CONV_TOPIC,o.getModule(ig).onMessageSent({groupID:wd(e.to),topicID:e.to,lastMessage:h})),l.onMessageSent({conversationOptionsList:[{conversationID:e.conversationID,unreadCount:0,type:f,subType:e.conversationSubType,lastMessage:h}]})}return e.getRelayFlag()||"TIMImageElem"!==e.type||kd(e.payload.imageInfoArray),Vv({message:e})}))})).catch((function(t){return o._onSendMessageFailed(e,t)}))}},{key:"_onSendMessageFailed",value:function(e,t){e.status=wp.FAIL,this.getModule(ug).deleteMessageRandom(e),this._addSendMessageFailCountOnUser(e,t);var n=new Uh(bh.SEND_MESSAGE);return n.setMessage("tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to)),this.probeNetwork().then((function(e){var o=M(e,2),r=o[0],a=o[1];n.setError(t,r,a).end()})),wl.error("".concat(this._className,"._onSendMessageFailed error:"),t),Xv(new Wv({code:t&&t.code?t.code:Mh.MESSAGE_SEND_FAIL,message:t&&t.message?t.message:yh.MESSAGE_SEND_FAIL,data:{message:e}}))}},{key:"_getSendMessageSpecifiedKey",value:function(e){if([hr.MSG_IMAGE,hr.MSG_AUDIO,hr.MSG_VIDEO,hr.MSG_FILE].includes(e.type))return Ah;if(e.conversationType===hr.CONV_C2C)return Eh;if(e.conversationType===hr.CONV_GROUP){var t=this.getModule(rg).getLocalGroupProfile(e.to);if(!t)return;var n=t.type;return yd(n)?Sh:Ch}}},{key:"_addSendMessageTotalCount",value:function(e){var t=this._getSendMessageSpecifiedKey(e);t&&this.getModule(Eg).addTotalCount(t)}},{key:"_addSendMessageSuccessCount",value:function(e,t){var n=Math.abs(Date.now()-t),o=this._getSendMessageSpecifiedKey(e);if(o){var r=this.getModule(Eg);r.addSuccessCount(o),r.addCost(o,n)}}},{key:"_addSendMessageFailCountOnUser",value:function(e,t){var n,o,r=t.code,a=void 0===r?-1:r,s=this.getModule(Eg),i=this._getSendMessageSpecifiedKey(e);i===Ah&&(n=a,o=!1,Ny.includes(n)&&(o=!0),o)?s.addFailedCountOfUserSide(Dh):function(e){var t=!1;return Object.values(Dy).includes(e)&&(t=!0),(e>=120001&&e<=13e4||e>=10100&&e<=10200)&&(t=!0),t}(a)&&i&&s.addFailedCountOfUserSide(i)}},{key:"resendMessage",value:function(e){return e.isResend=!0,e.status=wp.UNSEND,this.sendMessageInstance(e)}},{key:"revokeMessage",value:function(e){var t=this,n=null;if(e.conversationType===hr.CONV_C2C){if(!(n=this.getModule(og)))return this._onCannotFindModule()}else if(e.conversationType===hr.CONV_GROUP&&!(n=this.getModule(rg)))return this._onCannotFindModule();var o=new Uh(bh.REVOKE_MESSAGE);return o.setMessage("tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to)),n.revokeMessage(e).then((function(n){var r=n.data.recallRetList;if(!Bd(r)&&0!==r[0].retCode){var a=new Wv({code:r[0].retCode,message:jv[r[0].retCode]||yh.MESSAGE_REVOKE_FAIL,data:{message:e}});return o.setCode(a.code).setMoreMessage(a.message).end(),Xv(a)}return wl.info("".concat(t._className,".revokeMessage ok. ID:").concat(e.ID)),e.isRevoked=!0,o.end(),t.getModule(ug).onMessageRevoked([e]),Vv({message:e})})).catch((function(n){t.probeNetwork().then((function(e){var t=M(e,2),r=t[0],a=t[1];o.setError(n,r,a).end()}));var r=new Wv({code:n&&n.code?n.code:Mh.MESSAGE_REVOKE_FAIL,message:n&&n.message?n.message:yh.MESSAGE_REVOKE_FAIL,data:{message:e}});return wl.warn("".concat(t._className,".revokeMessage failed. error:"),n),Xv(r)}))}},{key:"deleteMessage",value:function(e){var t=this,n=null,o=e[0],r=o.conversationID,a="",s=[],i=[];if(o.conversationType===hr.CONV_C2C)n=this.getModule(og),a=r.replace(hr.CONV_C2C,""),e.forEach((function(e){e&&e.status===wp.SUCCESS&&e.conversationID===r&&(e._onlineOnlyFlag||s.push("".concat(e.sequence,"_").concat(e.random,"_").concat(e.time)),i.push(e))}));else if(o.conversationType===hr.CONV_GROUP)n=this.getModule(rg),a=r.replace(hr.CONV_GROUP,""),e.forEach((function(e){e&&e.status===wp.SUCCESS&&e.conversationID===r&&(e._onlineOnlyFlag||s.push("".concat(e.sequence)),i.push(e))}));else if(o.conversationType===hr.CONV_SYSTEM)return Xv({code:Mh.CANNOT_DELETE_GROUP_SYSTEM_NOTICE,message:yh.CANNOT_DELETE_GROUP_SYSTEM_NOTICE});if(!n)return this._onCannotFindModule();if(0===s.length)return this._onMessageDeleted(i);s.length>30&&(s=s.slice(0,30),i=i.slice(0,30));var u=new Uh(bh.DELETE_MESSAGE);return u.setMessage("to:".concat(a," count:").concat(s.length)),n.deleteMessage({to:a,keyList:s}).then((function(e){return u.end(),wl.info("".concat(t._className,".deleteMessage ok")),t._onMessageDeleted(i)})).catch((function(e){t.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];u.setError(e,o,r).end()})),wl.warn("".concat(t._className,".deleteMessage failed. error:"),e);var n=new Wv({code:e&&e.code?e.code:Mh.MESSAGE_DELETE_FAIL,message:e&&e.message?e.message:yh.MESSAGE_DELETE_FAIL});return Xv(n)}))}},{key:"_onMessageDeleted",value:function(e){return this.getModule(ug).onMessageDeleted(e),Jv({messageList:e})}},{key:"modifyRemoteMessage",value:function(e){var t=this,n=null,o=e.conversationType,r=e.to;if(this.getModule(rg).isMessageFromOrToAVChatroom(r))return Xv({code:Mh.MESSAGE_MODIFY_DISABLED_IN_AVCHATROOM,message:yh.MESSAGE_MODIFY_DISABLED_IN_AVCHATROOM,data:{message:e}});o===hr.CONV_C2C?n=this.getModule(og):o===hr.CONV_GROUP&&(n=this.getModule(rg));var a=new Uh(bh.MODIFY_MESSAGE);return a.setMessage("to:".concat(r)),n.modifyRemoteMessage(e).then((function(n){a.end(),wl.info("".concat(t._className,".modifyRemoteMessage ok"));var o=t._onModifyRemoteMessageResp(e,n.data);return Vv({message:o})})).catch((function(n){if(a.setCode(n.code).setMoreMessage(n.message).end(),wl.warn("".concat(t._className,".modifyRemoteMessage failed. error:"),n),20027===n.code){var o=t._onModifyRemoteMessageResp(e,n.data);return Xv({code:Mh.MESSAGE_MODIFY_CONFLICT,message:yh.MESSAGE_MODIFY_CONFLICT,data:{message:o}})}return Xv({code:n.code,message:n.message,data:{message:e}})}))}},{key:"_onModifyRemoteMessageResp",value:function(e,t){wl.debug("".concat(this._className,"._onModifyRemoteMessageResp options:"),t);var n=e.conversationType,o=e.from,r=e.to,a=e.random,s=e.sequence,i=e.time,u=t.elements,c=t.messageVersion,l=t.cloudCustomData,d=void 0===l?"":l;return this.getModule(ug).onMessageModified({conversationType:n,from:o,to:r,time:i,random:a,sequence:s,elements:u,cloudCustomData:d,messageVersion:c})}},{key:"_generateUUID",value:function(){var e=this.getModule(cg);return"".concat(e.getSDKAppID(),"-").concat(e.getUserID(),"-").concat(function(){for(var e="",t=32;t>0;--t)e+=pd[Math.floor(Math.random()*gd)];return e}())}},{key:"getMessageOption",value:function(e){return this._messageOptionsMap.get(e)}},{key:"_getNickAndAvatarByUserID",value:function(e){return this.getModule(ng).getNickAndAvatarByUserID(e)}},{key:"_getNameCardByGroupID",value:function(e){if(e.conversationType===hr.CONV_GROUP){var t=this.getModule(rg);if(t)return t.getMyNameCardByGroupID(e.to)}return""}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._messageOptionsMap.clear()}}]),o}(Ag),Ry=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._className="PluginModule",o.plugins={},o}return i(n,[{key:"registerPlugin",value:function(e){var t=this;Object.keys(e).forEach((function(n){t.plugins[n]=e[n]})),new Uh(bh.REGISTER_PLUGIN).setMessage("".concat(Object.keys(e))).end()}},{key:"getPlugin",value:function(e){return this.plugins[e]}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset"))}}]),n}(Ag),Ly=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._className="SyncUnreadMessageModule",o._cookie="",o._onlineSyncFlag=!1,o.getInnerEmitterInstance().on(gM,o._onLoginSuccess,f(o)),o}return i(n,[{key:"_onLoginSuccess",value:function(e){this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:0})}},{key:"_startSync",value:function(e){var t=this,n=e.cookie,o=e.syncFlag,r=e.isOnlineSync;wl.log("".concat(this._className,"._startSync cookie:").concat(n," syncFlag:").concat(o," isOnlineSync:").concat(r)),this.request({protocolName:Lg,requestData:{cookie:n,syncFlag:o,isOnlineSync:r}}).then((function(e){var n=e.data,o=n.cookie,r=n.syncFlag,a=n.eventArray,s=n.messageList,i=n.C2CRemainingUnreadList,u=n.C2CPairUnreadList;t._cookie=o,Bd(o)||(0===r||1===r?(a&&t.getModule(mg).onMessage({head:{},body:{eventArray:a,isInstantMessage:t._onlineSyncFlag,isSyncingEnded:!1}}),t.getModule(og).onNewC2CMessage({dataList:s,isInstantMessage:!1,C2CRemainingUnreadList:i,C2CPairUnreadList:u}),t._startSync({cookie:o,syncFlag:r,isOnlineSync:0})):2===r&&(a&&t.getModule(mg).onMessage({head:{},body:{eventArray:a,isInstantMessage:t._onlineSyncFlag,isSyncingEnded:!0}}),t.getModule(og).onNewC2CMessage({dataList:s,isInstantMessage:t._onlineSyncFlag,C2CRemainingUnreadList:i,C2CPairUnreadList:u})))})).catch((function(e){wl.error("".concat(t._className,"._startSync failed. error:"),e)}))}},{key:"startOnlineSync",value:function(){wl.log("".concat(this._className,".startOnlineSync")),this._onlineSyncFlag=!0,this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:1})}},{key:"startSyncOnReconnected",value:function(){wl.log("".concat(this._className,".startSyncOnReconnected.")),this._onlineSyncFlag=!0,this._startSync({cookie:this._cookie,syncFlag:0,isOnlineSync:0})}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._onlineSyncFlag=!1,this._cookie=""}}]),n}(Ag),ky={request:{toAccount:"To_Account",fromAccount:"From_Account",to:"To_Account",from:"From_Account",groupID:"GroupId",groupAtUserID:"GroupAt_Account",extension:"Ext",data:"Data",description:"Desc",elements:"MsgBody",sizeType:"Type",downloadFlag:"Download_Flag",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",videoUrl:"",imageUrl:"URL",fileUrl:"Url",uuid:"UUID",priority:"MsgPriority",receiverUserID:"To_Account",receiverGroupID:"GroupId",messageSender:"SenderId",messageReceiver:"ReceiverId",nick:"From_AccountNick",avatar:"From_AccountHeadurl",messageNumber:"MsgNum",pbDownloadKey:"PbMsgKey",downloadKey:"JsonMsgKey",applicationType:"PendencyType",userIDList:"To_Account",groupNameList:"GroupName",userID:"To_Account",groupAttributeList:"GroupAttr",mainSequence:"AttrMainSeq",avChatRoomKey:"BytesKey",attributeControl:"AttrControl",sequence:"seq",messageControlInfo:"SendMsgControl",updateSequence:"UpdateSeq",clientTime:"MsgClientTime",sequenceList:"MsgSeqList",topicID:"TopicId",customData:"CustomString",isSupportTopic:"SupportTopic",isWebUniapp:"is_web_uniapp"},response:{MsgPriority:"priority",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID",Download_Flag:"downloadFlag",GroupId:"groupID",Member_Account:"userID",MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",MsgSeq:"sequence",MsgRandom:"random",MsgTime:"time",MsgTimeStamp:"time",MsgContent:"content",MsgBody:"elements",From_AccountNick:"nick",From_AccountHeadurl:"avatar",GroupWithdrawInfoArray:"revokedInfos",GroupReadInfoArray:"groupMessageReadNotice",LastReadMsgSeq:"lastMessageSeq",WithdrawC2cMsgNotify:"c2cMessageRevokedNotify",C2cWithdrawInfoArray:"revokedInfos",C2cReadedReceipt:"c2cMessageReadReceipt",ReadC2cMsgNotify:"c2cMessageReadNotice",LastReadTime:"peerReadTime",MsgRand:"random",MsgType:"type",MsgShow:"messageShow",NextMsgSeq:"nextMessageSeq",FaceUrl:"avatar",ProfileDataMod:"profileModify",Profile_Account:"userID",ValueBytes:"value",ValueNum:"value",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgFrom_AccountExtraInfo:"messageFromAccountExtraInformation",Operator_Account:"operatorID",OpType:"operationType",ReportType:"operationType",UserId:"userID",User_Account:"userID",List_Account:"userIDList",MsgOperatorMemberExtraInfo:"operatorInfo",MsgMemberExtraInfo:"memberInfoList",ImageUrl:"avatar",NickName:"nick",MsgGroupNewInfo:"newGroupProfile",MsgAppDefinedData:"groupCustomField",Owner_Account:"ownerID",GroupFaceUrl:"avatar",GroupIntroduction:"introduction",GroupNotification:"notification",GroupApplyJoinOption:"joinOption",MsgKey:"messageKey",GroupInfo:"groupProfile",ShutupTime:"muteTime",Desc:"description",Ext:"extension",GroupAt_Account:"groupAtUserID",MsgNum:"messageNumber",PbMsgKey:"pbDownloadKey",JsonMsgKey:"downloadKey",MsgModifiedFlag:"isModified",PendencyItem:"applicationItem",PendencyType:"applicationType",AddTime:"time",AddSource:"source",AddWording:"wording",ProfileImImage:"avatar",PendencyAdd:"friendApplicationAdded",FrienPencydDel_Account:"friendApplicationDeletedUserIDList",Peer_Account:"userID",GroupAttr:"groupAttributeList",GroupAttrAry:"groupAttributeList",AttrMainSeq:"mainSequence",seq:"sequence",GroupAttrOption:"groupAttributeOption",BytesChangedKeys:"changedKeyList",GroupAttrInfo:"groupAttributeList",GroupAttrSeq:"mainSequence",PushChangedAttrValFlag:"hasChangedAttributeInfo",SubKeySeq:"sequence",Val:"value",MsgGroupFromCardName:"senderNameCard",MsgGroupFromNickName:"senderNick",C2cNick:"peerNick",C2cImage:"peerAvatar",SendMsgControl:"messageControlInfo",NoLastMsg:"excludedFromLastMessage",NoUnread:"excludedFromUnreadCount",UpdateSeq:"updateSequence",MuteNotifications:"muteFlag",MsgClientTime:"clientTime",TinyId:"tinyID",GroupMsgReceiptList:"readReceiptList",ReadNum:"readCount",UnreadNum:"unreadCount",TopicId:"topicID",MillionGroupFlag:"communityType",SupportTopic:"isSupportTopic",MsgTopicNewInfo:"newTopicInfo",ShutupAll:"muteAllMembers",CustomString:"customData",TopicFaceUrl:"avatar",TopicIntroduction:"introduction",TopicNotification:"notification",TopicIdArray:"topicIDList",MsgVersion:"messageVersion",C2cMsgModNotifys:"c2cMessageModified",GroupMsgModNotifys:"groupMessageModified",ApplyJoinOption:"joinOption",MsgFlag:"messageRemindType",AtInfoList:"groupAtInfoList",AtFlagList:"groupAtType",AtMsgSeq:"sequence",BanDuration:"duration",BanDescription:"reason"},ignoreKeyWord:["C2C","ID","USP"]},Gy=Dt.PROPER,Py=yn.trim;function Uy(e,t){if("string"!=typeof e&&!Array.isArray(e))throw new TypeError("Expected the input to be `string | string[]`");var n;return t=Object.assign({pascalCase:!1},t),0===(e=Array.isArray(e)?e.map((function(e){return e.trim()})).filter((function(e){return e.length})).join("-"):e.trim()).length?"":1===e.length?t.pascalCase?e.toUpperCase():e.toLowerCase():(e!==e.toLowerCase()&&(e=by(e)),e=e.replace(/^[_.\- ]+/,"").toLowerCase().replace(/[_.\- ]+(\w|$)/g,(function(e,t){return t.toUpperCase()})).replace(/\d+(\w|$)/g,(function(e){return e.toUpperCase()})),n=e,t.pascalCase?n.charAt(0).toUpperCase()+n.slice(1):n)}rn({target:"String",proto:!0,forced:(dy="trim",G((function(){return!!_n[dy]()||"…"!=="…"[dy]()||Gy&&_n[dy].name!==dy})))},{trim:function(){return Py(this)}});var by=function(e){for(var t=!1,n=!1,o=!1,r=0;r<e.length;r++){var a=e[r];t&&/[a-zA-Z]/.test(a)&&a.toUpperCase()===a?(e=e.slice(0,r)+"-"+e.slice(r),t=!1,o=n,n=!0,r++):n&&o&&/[a-zA-Z]/.test(a)&&a.toLowerCase()===a?(e=e.slice(0,r-1)+"-"+e.slice(r-1),o=n,n=!1,t=!0):(t=a.toLowerCase()===a&&a.toUpperCase()!==a,o=n,n=a.toUpperCase()===a&&a.toLowerCase()!==a)}return e};function wy(e,t){var n=0;return function e(t,o){if(++n>100)return n--,t;if($l(t)){var r=t.map((function(t){return Ql(t)?e(t,o):t}));return n--,r}if(Ql(t)){var a=(s=t,i=function(e,t){if(!ad(t))return!1;if((r=t)!==Uy(r))for(var n=0;n<ky.ignoreKeyWord.length&&!t.includes(ky.ignoreKeyWord[n]);n++);var r;return ed(o[t])?function(e){return"OPPOChannelID"===e?e:e[0].toUpperCase()+Uy(e).slice(1)}(t):o[t]},u=Object.create(null),Object.keys(s).forEach((function(e){var t=i(s[e],e);t&&(u[t]=s[e])})),u);return a=Ad(a,(function(t,n){return $l(t)||Ql(t)?e(t,o):t})),n--,a}var s,i,u}(e,t)}function Fy(e,t){if($l(e))return e.map((function(e){return Ql(e)?Fy(e,t):e}));if(Ql(e)){var n=(o=e,r=function(e,n){return ed(t[n])?Uy(n):t[n]},a={},Object.keys(o).forEach((function(e){a[r(o[e],e)]=o[e]})),a);return Ad(n,(function(e){return $l(e)||Ql(e)?Fy(e,t):e}))}var o,r,a}var qy="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Vy=k.RangeError,xy=function(e){if(void 0===e)return 0;var t=Lt(e),n=bt(t);if(t!==n)throw Vy("Wrong length or index");return n},By=k.Array,Ky=Math.abs,Hy=Math.pow,jy=Math.floor,Wy=Math.log,Yy=Math.LN2,zy=function(e,t,n){var o,r,a,s=By(n),i=8*n-t-1,u=(1<<i)-1,c=u>>1,l=23===t?Hy(2,-24)-Hy(2,-77):0,d=e<0||0===e&&1/e<0?1:0,p=0;for((e=Ky(e))!=e||1/0===e?(r=e!=e?1:0,o=u):(o=jy(Wy(e)/Yy),e*(a=Hy(2,-o))<1&&(o--,a*=2),(e+=o+c>=1?l/a:l*Hy(2,1-c))*a>=2&&(o++,a/=2),o+c>=u?(r=0,o=u):o+c>=1?(r=(e*a-1)*Hy(2,t),o+=c):(r=e*Hy(2,c-1)*Hy(2,t),o=0));t>=8;)s[p++]=255&r,r/=256,t-=8;for(o=o<<t|r,i+=t;i>0;)s[p++]=255&o,o/=256,i-=8;return s[--p]|=128*d,s},Jy=function(e,t){var n,o=e.length,r=8*o-t-1,a=(1<<r)-1,s=a>>1,i=r-7,u=o-1,c=e[u--],l=127&c;for(c>>=7;i>0;)l=256*l+e[u--],i-=8;for(n=l&(1<<-i)-1,l>>=-i,i+=t;i>0;)n=256*n+e[u--],i-=8;if(0===l)l=1-s;else{if(l===a)return n?NaN:c?-1/0:1/0;n+=Hy(2,t),l-=s}return(c?-1:1)*n*Hy(2,l-t)},Xy=function(e){for(var t=Ne(this),n=wt(t),o=arguments.length,r=Pt(o>1?arguments[1]:void 0,n),a=o>2?arguments[2]:void 0,s=void 0===a?n:Pt(a,n);s>r;)t[r++]=e;return t},Qy=jt.f,Zy=rt.f,$y=Dt.PROPER,eI=Dt.CONFIGURABLE,tI=Et.get,nI=Et.set,oI=k.ArrayBuffer,rI=oI,aI=rI&&rI.prototype,sI=k.DataView,iI=sI&&sI.prototype,uI=Object.prototype,cI=k.Array,lI=k.RangeError,dI=W(Xy),pI=W([].reverse),gI=zy,_I=Jy,hI=function(e){return[255&e]},fI=function(e){return[255&e,e>>8&255]},mI=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},vI=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},MI=function(e){return gI(e,23,4)},yI=function(e){return gI(e,52,8)},II=function(e,t){Zy(e.prototype,t,{get:function(){return tI(this)[t]}})},TI=function(e,t,n,o){var r=xy(n),a=tI(e);if(r+t>a.byteLength)throw lI("Wrong index");var s=tI(a.buffer).bytes,i=r+a.byteOffset,u=li(s,i,i+t);return o?u:pI(u)},EI=function(e,t,n,o,r,a){var s=xy(n),i=tI(e);if(s+t>i.byteLength)throw lI("Wrong index");for(var u=tI(i.buffer).bytes,c=s+i.byteOffset,l=o(+r),d=0;d<t;d++)u[c+d]=l[a?d:t-d-1]};if(qy){var CI=$y&&"ArrayBuffer"!==oI.name;if(G((function(){oI(1)}))&&G((function(){new oI(-1)}))&&!G((function(){return new oI,new oI(1.5),new oI(NaN),CI&&!eI})))CI&&eI&&at(oI,"name","ArrayBuffer");else{(rI=function(e){return Pi(this,aI),new oI(xy(e))}).prototype=aI;for(var SI,AI=Qy(oI),DI=0;AI.length>DI;)(SI=AI[DI++])in rI||at(rI,SI,oI[SI]);aI.constructor=rI}or&&jo(iI)!==uI&&or(iI,uI);var NI=new sI(new rI(2)),OI=W(iI.setInt8);NI.setInt8(0,2147483648),NI.setInt8(1,2147483649),!NI.getInt8(0)&&NI.getInt8(1)||Ri(iI,{setInt8:function(e,t){OI(this,e,t<<24>>24)},setUint8:function(e,t){OI(this,e,t<<24>>24)}},{unsafe:!0})}else aI=(rI=function(e){Pi(this,aI);var t=xy(e);nI(this,{bytes:dI(cI(t),0),byteLength:t}),P||(this.byteLength=t)}).prototype,iI=(sI=function(e,t,n){Pi(this,iI),Pi(e,aI);var o=tI(e).byteLength,r=Lt(t);if(r<0||r>o)throw lI("Wrong offset");if(r+(n=void 0===n?o-r:bt(n))>o)throw lI("Wrong length");nI(this,{buffer:e,byteLength:n,byteOffset:r}),P||(this.buffer=e,this.byteLength=n,this.byteOffset=r)}).prototype,P&&(II(rI,"byteLength"),II(sI,"buffer"),II(sI,"byteLength"),II(sI,"byteOffset")),Ri(iI,{getInt8:function(e){return TI(this,1,e)[0]<<24>>24},getUint8:function(e){return TI(this,1,e)[0]},getInt16:function(e){var t=TI(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=TI(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return vI(TI(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return vI(TI(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return _I(TI(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return _I(TI(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){EI(this,1,e,hI,t)},setUint8:function(e,t){EI(this,1,e,hI,t)},setInt16:function(e,t){EI(this,2,e,fI,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){EI(this,2,e,fI,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){EI(this,4,e,mI,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){EI(this,4,e,mI,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){EI(this,4,e,MI,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){EI(this,8,e,yI,t,arguments.length>2?arguments[2]:void 0)}});Qo(rI,"ArrayBuffer"),Qo(sI,"DataView");var RI={ArrayBuffer:rI,DataView:sI},LI=RI.ArrayBuffer,kI=RI.DataView,GI=kI.prototype,PI=W(LI.prototype.slice),UI=W(GI.getUint8),bI=W(GI.setUint8),wI=G((function(){return!new LI(2).slice(1,void 0).byteLength}));rn({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:wI},{slice:function(e,t){if(PI&&void 0===t)return PI($e(this),e);for(var n=$e(this).byteLength,o=Pt(e,n),r=Pt(void 0===t?n:t,n),a=new(Bi(this,LI))(bt(r-o)),s=new kI(this),i=new kI(a),u=0;o<r;)bI(i,u++,UI(s,o++));return a}});var FI,qI,VI,xI=rt.f,BI=k.Int8Array,KI=BI&&BI.prototype,HI=k.Uint8ClampedArray,jI=HI&&HI.prototype,WI=BI&&jo(BI),YI=KI&&jo(KI),zI=Object.prototype,JI=k.TypeError,XI=qe("toStringTag"),QI=Pe("TYPED_ARRAY_TAG"),ZI=Pe("TYPED_ARRAY_CONSTRUCTOR"),$I=qy&&!!or&&"Opera"!==dn(k.opera),eT=!1,tT={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},nT={BigInt64Array:8,BigUint64Array:8},oT=function(e){if(!oe(e))return!1;var t=dn(e);return Re(tT,t)||Re(nT,t)};for(FI in tT)(VI=(qI=k[FI])&&qI.prototype)?at(VI,ZI,qI):$I=!1;for(FI in nT)(VI=(qI=k[FI])&&qI.prototype)&&at(VI,ZI,qI);if((!$I||!ne(WI)||WI===Function.prototype)&&(WI=function(){throw JI("Incorrect invocation")},$I))for(FI in tT)k[FI]&&or(k[FI],WI);if((!$I||!YI||YI===zI)&&(YI=WI.prototype,$I))for(FI in tT)k[FI]&&or(k[FI].prototype,YI);if($I&&jo(jI)!==YI&&or(jI,YI),P&&!Re(YI,XI))for(FI in eT=!0,xI(YI,XI,{get:function(){return oe(this)?this[QI]:void 0}}),tT)k[FI]&&at(k[FI],QI,FI);var rT={NATIVE_ARRAY_BUFFER_VIEWS:$I,TYPED_ARRAY_CONSTRUCTOR:ZI,TYPED_ARRAY_TAG:eT&&QI,aTypedArray:function(e){if(oT(e))return e;throw JI("Target is not a typed array")},aTypedArrayConstructor:function(e){if(ne(e)&&(!or||se(WI,e)))return e;throw JI(ve(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,o){if(P){if(n)for(var r in tT){var a=k[r];if(a&&Re(a.prototype,e))try{delete a.prototype[e]}catch(kC){try{a.prototype[e]=t}catch(u){}}}YI[e]&&!n||Nt(YI,e,n?t:$I&&KI[e]||t,o)}},exportTypedArrayStaticMethod:function(e,t,n){var o,r;if(P){if(or){if(n)for(o in tT)if((r=k[o])&&Re(r,e))try{delete r[e]}catch(kC){}if(WI[e]&&!n)return;try{return Nt(WI,e,n?t:$I&&WI[e]||t)}catch(kC){}}for(o in tT)!(r=k[o])||r[e]&&!n||Nt(r,e,t)}},isView:function(e){if(!oe(e))return!1;var t=dn(e);return"DataView"===t||Re(tT,t)||Re(nT,t)},isTypedArray:oT,TypedArray:WI,TypedArrayPrototype:YI},aT=rT.NATIVE_ARRAY_BUFFER_VIEWS,sT=k.ArrayBuffer,iT=k.Int8Array,uT=!aT||!G((function(){iT(1)}))||!G((function(){new iT(-1)}))||!Lo((function(e){new iT,new iT(null),new iT(1.5),new iT(e)}),!0)||G((function(){return 1!==new iT(new sT(2),1,void 0).length})),cT=Math.floor,lT=Number.isInteger||function(e){return!oe(e)&&isFinite(e)&&cT(e)===e},dT=k.RangeError,pT=k.RangeError,gT=function(e,t){var n=function(e){var t=Lt(e);if(t<0)throw dT("The argument can't be less than 0");return t}(e);if(n%t)throw pT("Wrong offset");return n},_T=rT.aTypedArrayConstructor,hT=function(e){var t,n,o,r,a,s,i=Vi(this),u=Ne(e),c=arguments.length,l=c>1?arguments[1]:void 0,d=void 0!==l,p=To(u);if(p&&!Mo(p))for(s=(a=Co(u,p)).next,u=[];!(r=w(s,a)).done;)u.push(r.value);for(d&&c>2&&(l=qn(l,arguments[2])),n=wt(u),o=new(_T(i))(n),t=0;n>t;t++)o[t]=d?l(u[t],t):u[t];return o};N((function(e){var t=jt.f,n=to.forEach,o=Et.get,r=Et.set,a=rt.f,s=Je.f,i=Math.round,u=k.RangeError,c=RI.ArrayBuffer,l=c.prototype,d=RI.DataView,p=rT.NATIVE_ARRAY_BUFFER_VIEWS,g=rT.TYPED_ARRAY_CONSTRUCTOR,_=rT.TYPED_ARRAY_TAG,h=rT.TypedArray,f=rT.TypedArrayPrototype,m=rT.aTypedArrayConstructor,v=rT.isTypedArray,M=function(e,t){m(e);for(var n=0,o=t.length,r=new e(o);o>n;)r[n]=t[n++];return r},y=function(e,t){a(e,t,{get:function(){return o(this)[t]}})},I=function(e){var t;return se(l,e)||"ArrayBuffer"==(t=dn(e))||"SharedArrayBuffer"==t},T=function(e,t){return v(e)&&!fe(t)&&t in e&&lT(+t)&&t>=0},E=function(e,t){return t=Ke(t),T(e,t)?x(2,e[t]):s(e,t)},C=function(e,t,n){return t=Ke(t),!(T(e,t)&&oe(n)&&Re(n,"value"))||Re(n,"get")||Re(n,"set")||n.configurable||Re(n,"writable")&&!n.writable||Re(n,"enumerable")&&!n.enumerable?a(e,t,n):(e[t]=n.value,e)};P?(p||(Je.f=E,rt.f=C,y(f,"buffer"),y(f,"byteOffset"),y(f,"byteLength"),y(f,"length")),rn({target:"Object",stat:!0,forced:!p},{getOwnPropertyDescriptor:E,defineProperty:C}),e.exports=function(e,s,l){var m=e.match(/\d+$/)[0]/8,y=e+(l?"Clamped":"")+"Array",T="get"+e,E="set"+e,C=k[y],S=C,A=S&&S.prototype,D={},N=function(e,t){a(e,t,{get:function(){return function(e,t){var n=o(e);return n.view[T](t*m+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var r=o(e);l&&(n=(n=i(n))<0?0:n>255?255:255&n),r.view[E](t*m+r.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};p?uT&&(S=s((function(e,t,n,o){return Pi(e,A),Vr(oe(t)?I(t)?void 0!==o?new C(t,gT(n,m),o):void 0!==n?new C(t,gT(n,m)):new C(t):v(t)?M(S,t):w(hT,S,t):new C(xy(t)),e,S)})),or&&or(S,h),n(t(C),(function(e){e in S||at(S,e,C[e])})),S.prototype=A):(S=s((function(e,t,n,o){Pi(e,A);var a,s,i,l=0,p=0;if(oe(t)){if(!I(t))return v(t)?M(S,t):w(hT,S,t);a=t,p=gT(n,m);var g=t.byteLength;if(void 0===o){if(g%m)throw u("Wrong length");if((s=g-p)<0)throw u("Wrong length")}else if((s=bt(o)*m)+p>g)throw u("Wrong length");i=s/m}else i=xy(t),a=new c(s=i*m);for(r(e,{buffer:a,byteOffset:p,byteLength:s,length:i,view:new d(a)});l<i;)N(e,l++)})),or&&or(S,h),A=S.prototype=wn(f)),A.constructor!==S&&at(A,"constructor",S),at(A,g,S),_&&at(A,_,y),D[y]=S,rn({global:!0,forced:S!=C,sham:!p},D),"BYTES_PER_ELEMENT"in S||at(S,"BYTES_PER_ELEMENT",m),"BYTES_PER_ELEMENT"in A||at(A,"BYTES_PER_ELEMENT",m),ki(y)}):e.exports=function(){}}))("Uint8",(function(e){return function(t,n,o){return e(this,t,n,o)}}));var fT=Math.min,mT=W([].copyWithin||function(e,t){var n=Ne(this),o=wt(n),r=Pt(e,o),a=Pt(t,o),s=arguments.length>2?arguments[2]:void 0,i=fT((void 0===s?o:Pt(s,o))-a,o-r),u=1;for(a<r&&r<a+i&&(u=-1,a+=i-1,r+=i-1);i-- >0;)a in n?n[r]=n[a]:delete n[r],r+=u,a+=u;return n}),vT=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("copyWithin",(function(e,t){return mT(vT(this),e,t,arguments.length>2?arguments[2]:void 0)}));var MT=to.every,yT=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("every",(function(e){return MT(yT(this),e,arguments.length>1?arguments[1]:void 0)}));var IT=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("fill",(function(e){var t=arguments.length;return w(Xy,IT(this),e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}));var TT=rT.TYPED_ARRAY_CONSTRUCTOR,ET=rT.aTypedArrayConstructor,CT=function(e){return ET(Bi(e,e[TT]))},ST=function(e,t){return function(e,t){for(var n=0,o=wt(t),r=new e(o);o>n;)r[n]=t[n++];return r}(CT(e),t)},AT=to.filter,DT=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("filter",(function(e){var t=AT(DT(this),e,arguments.length>1?arguments[1]:void 0);return ST(this,t)}));var NT=to.find,OT=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("find",(function(e){return NT(OT(this),e,arguments.length>1?arguments[1]:void 0)}));var RT=to.findIndex,LT=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("findIndex",(function(e){return RT(LT(this),e,arguments.length>1?arguments[1]:void 0)}));var kT=to.forEach,GT=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("forEach",(function(e){kT(GT(this),e,arguments.length>1?arguments[1]:void 0)}));var PT=qt.includes,UT=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("includes",(function(e){return PT(UT(this),e,arguments.length>1?arguments[1]:void 0)}));var bT=qt.indexOf,wT=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("indexOf",(function(e){return bT(wT(this),e,arguments.length>1?arguments[1]:void 0)}));var FT=qe("iterator"),qT=k.Uint8Array,VT=W(Hs.values),xT=W(Hs.keys),BT=W(Hs.entries),KT=rT.aTypedArray,HT=rT.exportTypedArrayMethod,jT=qT&&qT.prototype,WT=!G((function(){jT[FT].call([1])})),YT=!!jT&&jT.values&&jT[FT]===jT.values&&"values"===jT.values.name,zT=function(){return VT(KT(this))};HT("entries",(function(){return BT(KT(this))}),WT),HT("keys",(function(){return xT(KT(this))}),WT),HT("values",zT,WT||!YT,{name:"values"}),HT(FT,zT,WT||!YT,{name:"values"});var JT=rT.aTypedArray,XT=rT.exportTypedArrayMethod,QT=W([].join);XT("join",(function(e){return QT(JT(this),e)}));var ZT=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return Cs(Lv,ZT(this),t>1?[e,arguments[1]]:[e])}));var $T=to.map,eE=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("map",(function(e){return $T(eE(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(CT(e))(t)}))}));var tE=k.TypeError,nE=function(e){return function(t,n,o,r){ye(n);var a=Ne(t),s=Z(a),i=wt(a),u=e?i-1:0,c=e?-1:1;if(o<2)for(;;){if(u in s){r=s[u],u+=c;break}if(u+=c,e?u<0:i<=u)throw tE("Reduce of empty array with no initial value")}for(;e?u>=0:i>u;u+=c)u in s&&(r=n(r,s[u],u,a));return r}},oE={left:nE(!1),right:nE(!0)},rE=oE.left,aE=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return rE(aE(this),e,t,t>1?arguments[1]:void 0)}));var sE=oE.right,iE=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return sE(iE(this),e,t,t>1?arguments[1]:void 0)}));var uE=rT.aTypedArray,cE=rT.exportTypedArrayMethod,lE=Math.floor;cE("reverse",(function(){for(var e,t=uE(this).length,n=lE(t/2),o=0;o<n;)e=this[o],this[o++]=this[--t],this[t]=e;return this}));var dE=k.RangeError,pE=k.Int8Array,gE=pE&&pE.prototype,_E=gE&&gE.set,hE=rT.aTypedArray,fE=rT.exportTypedArrayMethod,mE=!G((function(){var e=new Uint8ClampedArray(2);return w(_E,e,{length:1,0:3},1),3!==e[1]})),vE=mE&&rT.NATIVE_ARRAY_BUFFER_VIEWS&&G((function(){var e=new pE(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));fE("set",(function(e){hE(this);var t=gT(arguments.length>1?arguments[1]:void 0,1),n=Ne(e);if(mE)return w(_E,this,n,t);var o=this.length,r=wt(n),a=0;if(r+t>o)throw dE("Wrong length");for(;a<r;)this[t+a]=n[a++]}),!mE||vE);var ME=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("slice",(function(e,t){for(var n=fr(ME(this),e,t),o=CT(this),r=0,a=n.length,s=new o(a);a>r;)s[r]=n[r++];return s}),G((function(){new Int8Array(1).slice()})));var yE=to.some,IE=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("some",(function(e){return yE(IE(this),e,arguments.length>1?arguments[1]:void 0)}));var TE=k.Array,EE=rT.aTypedArray,CE=rT.exportTypedArrayMethod,SE=k.Uint16Array,AE=SE&&W(SE.prototype.sort),DE=!(!AE||G((function(){AE(new SE(2),null)}))&&G((function(){AE(new SE(2),{})}))),NE=!!AE&&!G((function(){if(pe)return pe<74;if($v)return $v<67;if(eM)return!0;if(nM)return nM<602;var e,t,n=new SE(516),o=TE(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,o[e]=e-2*t+3;for(AE(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==o[e])return!0}));CE("sort",(function(e){return void 0!==e&&ye(e),NE?AE(this,e):ff(EE(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))}),!NE||DE);var OE=rT.aTypedArray;(0,rT.exportTypedArrayMethod)("subarray",(function(e,t){var n=OE(this),o=n.length,r=Pt(e,o);return new(CT(n))(n.buffer,n.byteOffset+r*n.BYTES_PER_ELEMENT,bt((void 0===t?o:Pt(t,o))-r))}));var RE=k.Int8Array,LE=rT.aTypedArray,kE=rT.exportTypedArrayMethod,GE=[].toLocaleString,PE=!!RE&&G((function(){GE.call(new RE(1))}));kE("toLocaleString",(function(){return Cs(GE,PE?fr(LE(this)):LE(this),fr(arguments))}),G((function(){return[1,2].toLocaleString()!=new RE([1,2]).toLocaleString()}))||!G((function(){RE.prototype.toLocaleString.call([1,2])})));var UE=rT.exportTypedArrayMethod,bE=k.Uint8Array,wE=bE&&bE.prototype||{},FE=[].toString,qE=W([].join);G((function(){FE.call({})}))&&(FE=function(){return qE(this)});var VE=wE.toString!=FE;UE("toString",FE,VE);var xE=k.RangeError,BE=String.fromCharCode,KE=String.fromCodePoint,HE=W([].join),jE=!!KE&&1!=KE.length;rn({target:"String",stat:!0,forced:jE},{fromCodePoint:function(e){for(var t,n=[],o=arguments.length,r=0;o>r;){if(t=+arguments[r++],Pt(t,1114111)!==t)throw xE(t+" is not a valid code point");n[r]=t<65536?BE(t):BE(55296+((t-=65536)>>10),t%1024+56320)}return HE(n,"")}});var WE=String.fromCharCode,YE=function(e){var t=0|e.charCodeAt(0);if(55296<=t)if(t<56320){var n=0|e.charCodeAt(1);if(56320<=n&&n<=57343){if((t=(t<<10)+n-56613888|0)>65535)return WE(240|t>>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}else t=65533}else t<=57343&&(t=65533);return t<=2047?WE(192|t>>>6,128|63&t):WE(224|t>>>12,128|t>>>6&63,128|63&t)},zE=function(e){for(var t=void 0===e?"":(""+e).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,YE),n=0|t.length,o=new Uint8Array(n),r=0;r<n;r=r+1|0)o[r]=0|t.charCodeAt(r);return o},JE=function(e){for(var t=new Uint8Array(e),n="",o=0,r=t.length;o<r;){var a=t[o],s=0,i=0;if(a<=127?(s=0,i=255&a):a<=223?(s=1,i=31&a):a<=239?(s=2,i=15&a):a<=244&&(s=3,i=7&a),r-o-s>0)for(var u=0;u<s;)i=i<<6|63&(a=t[o+u+1]),u+=1;else i=65533,s=r-o;n+=String.fromCodePoint(i),o+=s+1}return n},XE=function(){function e(t){r(this,e),this._handler=t;var n=t.getURL();if(this._socket=null,this._workerSocket=null,this._id=dd(),this._handler.getIsWorkerEnabled()){var o=URL.createObjectURL(new Blob([';let _socket = null;onmessage = function(event) { if (event.data.cmd === "start") { const url = event.data.url; _socket = new WebSocket(url); _socket.binaryType = "arraybuffer"; _socket.onopen = function() { postMessage({ callback: "onOpen" }); }; _socket.onclose = function(e) { postMessage({ callback: "onOpen", e: { code: e.code, reason: e.reason } }); }; _socket.onmessage = function(e) { postMessage({ callback: "onMessage", data: e.data }); }; _socket.onerror = function(e) { postMessage({ callback: "onError", e: { isTrusted: "true" } }); }; } else if (event.data.cmd === "sendMessage") { if (_socket !== null) { _socket.send(event.data.data); } } else if (event.data.cmd === "stop") { if (_socket !== null) { _socket.close(event.data.code); _socket = null; } }};'],{type:"application/javascript; charset=utf-8"}));this._workerSocket=new Worker(o);var a=this;this._workerSocket.onmessage=function(e){var t=e.data,n=t.callback,o=t.e;"onOpen"===n?a._onOpen():"onClose"===n?a._onClose(o):"onError"===n?a._onError(o):"onMessage"===n&&a._onMessage(e.data)},this._workerSocket.postMessage({cmd:"start",id:this._id,url:n})}else Wc?Kc?(zc.connectSocket({url:n,header:{"content-type":"application/json"}}),zc.onSocketClose(this._onClose.bind(this)),zc.onSocketOpen(this._onOpen.bind(this)),zc.onSocketMessage(this._onMessage.bind(this)),zc.onSocketError(this._onError.bind(this))):(this._socket=zc.connectSocket({url:n,header:{"content-type":"application/json"},complete:function(){}}),this._socket.onClose(this._onClose.bind(this)),this._socket.onOpen(this._onOpen.bind(this)),this._socket.onMessage(this._onMessage.bind(this)),this._socket.onError(this._onError.bind(this))):Yc&&(this._socket=new WebSocket(n),this._socket.binaryType="arraybuffer",this._socket.onopen=this._onOpen.bind(this),this._socket.onmessage=this._onMessage.bind(this),this._socket.onclose=this._onClose.bind(this),this._socket.onerror=this._onError.bind(this));this._canIUseBinaryFrame=t.canIUseBinaryFrame()}return i(e,[{key:"getID",value:function(){return this._id}},{key:"_onOpen",value:function(){this._handler.onOpen({id:this._id})}},{key:"_onClose",value:function(e){this._handler.onClose({id:this._id,e:e})}},{key:"_onMessage",value:function(e){this._handler.onMessage({data:this._canIUseBinaryFrame?JE(e.data):e.data})}},{key:"_onError",value:function(e){this._handler.onError({id:this._id,e:e})}},{key:"setIsWorkerEnabled",value:function(e){this._isWorkerEnabled=!0}},{key:"close",value:function(e){if(this._workerSocket&&(this._workerSocket.postMessage({cmd:"stop",code:e}),this._workerSocket.terminate(),this._workerSocket=null),Kc)return zc.offSocketClose(),zc.offSocketMessage(),zc.offSocketOpen(),zc.offSocketError(),void zc.closeSocket();this._socket&&(Wc?(this._socket.onClose((function(){})),this._socket.onOpen((function(){})),this._socket.onMessage((function(){})),this._socket.onError((function(){}))):Yc&&(this._socket.onopen=null,this._socket.onmessage=null,this._socket.onclose=null,this._socket.onerror=null),Bc?this._socket.close({code:e}):this._socket.close(e),this._socket=null)}},{key:"send",value:function(e){if(this._workerSocket)this._workerSocket.postMessage({cmd:"sendMessage",data:this._canIUseBinaryFrame?zE(e.data).buffer:e.data});else{if(Kc)return void zc.sendSocketMessage({data:e.data,fail:function(){e.fail&&e.requestID&&e.fail(e.requestID)}});this._socket&&(Wc?this._socket.send({data:this._canIUseBinaryFrame?zE(e.data).buffer:e.data,fail:function(){e.fail&&e.requestID&&e.fail(e.requestID)}}):Yc&&this._socket.send(this._canIUseBinaryFrame?zE(e.data).buffer:e.data))}}}]),e}(),QE=4e3,ZE=4001,$E=["keyMap"],eC=["keyMap"],tC="connected",nC="connecting",oC="disconnected",rC=function(){function e(t){r(this,e),this._channelModule=t,this._className="SocketHandler",this._promiseMap=new Map,this._readyState=oC,this._simpleRequestMap=new Map,this.MAX_SIZE=100,this._startSequence=dd(),this._startTs=0,this._reConnectFlag=!1,this._nextPingTs=0,this._reConnectCount=0,this.MAX_RECONNECT_COUNT=3,this._socketID=-1,this._random=0,this._socket=null,this._url="",this._onOpenTs=0,this._canIUseBinaryFrame=!0,this._isWorkerEnabled=!0,this._setWebsocketHost(),this._initConnection()}return i(e,[{key:"_setWebsocketHost",value:function(){var e=this._channelModule.getModule(cg),t=Rc;this._channelModule.isOversea()&&(t=Lc),e.isSingaporeSite()?t=kc:e.isKoreaSite()?t=Gc:e.isGermanySite()?t=Pc:e.isIndiaSite()&&(t=Uc),bc.HOST.setCurrent(t)}},{key:"_initConnection",value:function(){ed(bc.HOST.CURRENT.BACKUP)||""===this._url?this._url=bc.HOST.CURRENT.DEFAULT:this._url===bc.HOST.CURRENT.DEFAULT?this._url=bc.HOST.CURRENT.BACKUP:this._url===bc.HOST.CURRENT.BACKUP&&(this._url=bc.HOST.CURRENT.DEFAULT);var e=this._channelModule.getModule(cg).getProxyServer();Bd(e)||(this._url=e),this._connect(),this._nextPingTs=0}},{key:"onCheckTimer",value:function(e){e%1==0&&this._checkPromiseMap()}},{key:"_checkPromiseMap",value:function(){var e=this;0!==this._promiseMap.size&&this._promiseMap.forEach((function(t,n){var o=t.reject,r=t.timestamp,a=15e3;-1!==n.indexOf(Dg)&&(a=9e4),Date.now()-r>=a&&(wl.log("".concat(e._className,"._checkPromiseMap request timeout, delete requestID:").concat(n)),e._promiseMap.delete(n),o(new Wv({code:Mh.NETWORK_TIMEOUT,message:yh.NETWORK_TIMEOUT})),e._channelModule.onRequestTimeout(n))}))}},{key:"onOpen",value:function(e){if(""!==this._readyState){this._onOpenTs=Date.now();var t=e.id;this._socketID=t;var n=Date.now()-this._startTs;wl.log("".concat(this._className,"._onOpen cost ").concat(n," ms. socketID:").concat(t)),new Uh(bh.WS_ON_OPEN).setMessage(n).setCostTime(n).setMoreMessage("socketID:".concat(t)).end(),e.id===this._socketID&&(this._readyState=tC,this._reConnectCount=0,this._resend(),!0===this._reConnectFlag&&(this._channelModule.onReconnected(),this._reConnectFlag=!1),this._channelModule.onOpen())}}},{key:"onClose",value:function(e){var t=new Uh(bh.WS_ON_CLOSE),n=e.id,o=e.e,r="sourceSocketID:".concat(n," currentSocketID:").concat(this._socketID," code:").concat(o.code," reason:").concat(o.reason),a=0;0!==this._onOpenTs&&(a=Date.now()-this._onOpenTs),t.setMessage(a).setCostTime(a).setMoreMessage(r).setCode(o.code).end(),wl.log("".concat(this._className,"._onClose ").concat(r," onlineTime:").concat(a)),n===this._socketID&&(this._readyState=oC,a<1e3?this._channelModule.onReconnectFailed():this._channelModule.onClose())}},{key:"onError",value:function(e){var t=e.id,n=e.e,o="sourceSocketID:".concat(t," currentSocketID:").concat(this._socketID);new Uh(bh.WS_ON_ERROR).setMessage(n.errMsg||cd(n)).setMoreMessage(o).setLevel("error").end(),wl.warn("".concat(this._className,"._onError"),n,o),t===this._socketID&&(this._readyState="",this._channelModule.onError())}},{key:"onMessage",value:function(e){var t;try{t=JSON.parse(e.data)}catch(kC){new Uh(bh.JSON_PARSE_ERROR).setMessage(e.data).end()}if(t&&t.head){var n=this._getRequestIDFromHead(t.head),o=Gd(t.head),r=Fy(t.body,this._getResponseKeyMap(o));if(wl.debug("".concat(this._className,".onMessage ret:").concat(JSON.stringify(r)," requestID:").concat(n," has:").concat(this._promiseMap.has(n))),this._setNextPingTs(),this._promiseMap.has(n)){var a=this._promiseMap.get(n),s=a.resolve,i=a.reject,u=a.timestamp;return this._promiseMap.delete(n),this._calcRTT(u),void(r.errorCode&&0!==r.errorCode?(this._channelModule.onErrorCodeNotZero(r),i(new Wv({code:r.errorCode,message:r.errorInfo||"",data:n.includes(Yg)||n.includes(G_)?{elements:r.elements,messageVersion:r.messageVersion,cloudCustomData:r.cloudCustomData}:void 0}))):s(Vv(r)))}this._channelModule.onMessage({head:t.head,body:r})}}},{key:"_calcRTT",value:function(e){var t=Date.now()-e;this._channelModule.getModule(Eg).addRTT(t)}},{key:"_connect",value:function(){this._startTs=Date.now(),this._onOpenTs=0,this._socket=new XE(this),this._socketID=this._socket.getID(),this._readyState=nC,wl.log("".concat(this._className,"._connect isWorkerEnabled:").concat(this.getIsWorkerEnabled()," socketID:").concat(this._socketID," url:").concat(this.getURL())),new Uh(bh.WS_CONNECT).setMessage("socketID:".concat(this._socketID," url:").concat(this.getURL())).end()}},{key:"getURL",value:function(){var e=this._channelModule.getModule(cg);e.isDevMode()&&(this._canIUseBinaryFrame=!1);var t=Od();(Kc||qc&&"windows"===t||Hc)&&(this._canIUseBinaryFrame=!1);var n=-1;"ios"===t?n=nl||-1:"android"===t&&(n=rl||-1);var o=this._channelModule.getPlatform(),r=e.getSDKAppID(),a=e.getInstanceID();return this._canIUseBinaryFrame?"".concat(this._url,"/binfo?sdkappid=").concat(r,"&instanceid=").concat(a,"&random=").concat(this._getRandom(),"&platform=").concat(o,"&host=").concat(t,"&version=").concat(n):"".concat(this._url,"/info?sdkappid=").concat(r,"&instanceid=").concat(a,"&random=").concat(this._getRandom(),"&platform=").concat(o,"&host=").concat(t,"&version=").concat(n)}},{key:"_closeConnection",value:function(e){wl.log("".concat(this._className,"._closeConnection socketID:").concat(this._socketID)),this._socket&&(this._socket.close(e),this._socketID=-1,this._socket=null,this._readyState=oC)}},{key:"_resend",value:function(){var e=this;if(wl.log("".concat(this._className,"._resend reConnectFlag:").concat(this._reConnectFlag),"promiseMap.size:".concat(this._promiseMap.size," simpleRequestMap.size:").concat(this._simpleRequestMap.size)),this._promiseMap.size>0&&this._promiseMap.forEach((function(t,n){var o=t.uplinkData,r=t.resolve,a=t.reject;e._promiseMap.set(n,{resolve:r,reject:a,timestamp:Date.now(),uplinkData:o}),e._execute(n,o)})),this._simpleRequestMap.size>0){var t,n=A(this._simpleRequestMap);try{for(n.s();!(t=n.n()).done;){var o=M(t.value,2),r=o[0],a=o[1];this._execute(r,a)}}catch(u){n.e(u)}finally{n.f()}this._simpleRequestMap.clear()}}},{key:"send",value:function(e){var t=this;e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var n=h(e,$E),o=this._getRequestIDFromHead(e.head),r=JSON.stringify(n);return new Promise((function(e,a){t._promiseMap.set(o,{resolve:e,reject:a,timestamp:Date.now(),uplinkData:r}),wl.debug("".concat(t._className,".send uplinkData:").concat(JSON.stringify(n)," requestID:").concat(o," readyState:").concat(t._readyState)),t._readyState!==tC?t._reConnect():(t._execute(o,r),t._channelModule.getModule(Eg).addRequestCount())}))}},{key:"simplySend",value:function(e){e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var t=h(e,eC),n=this._getRequestIDFromHead(e.head),o=JSON.stringify(t);this._readyState!==tC?(this._simpleRequestMap.size<this.MAX_SIZE?this._simpleRequestMap.set(n,o):wl.log("".concat(this._className,".simplySend. simpleRequestMap is full, drop request!")),this._reConnect()):this._execute(n,o)}},{key:"_execute",value:function(e,t){this._socket.send({data:t,fail:Wc?this._onSendFail.bind(this):void 0,requestID:e})}},{key:"_onSendFail",value:function(e){wl.log("".concat(this._className,"._onSendFail requestID:").concat(e))}},{key:"_getSequence",value:function(){var e;if(this._startSequence<2415919103)return e=this._startSequence,this._startSequence+=1,2415919103===this._startSequence&&(this._startSequence=dd()),e}},{key:"_getRequestIDFromHead",value:function(e){return e.servcmd+e.seq}},{key:"_getResponseKeyMap",value:function(e){var n=this._channelModule.getKeyMap(e);return t(t({},ky.response),n.response)}},{key:"_reConnect",value:function(){this._readyState!==tC&&this._readyState!==nC&&this.forcedReconnect()}},{key:"forcedReconnect",value:function(){var e=this;wl.log("".concat(this._className,".forcedReconnect count:").concat(this._reConnectCount," readyState:").concat(this._readyState)),this._reConnectFlag=!0,this._resetRandom(),this._reConnectCount<this.MAX_RECONNECT_COUNT?(this._reConnectCount+=1,this._closeConnection(ZE),this._initConnection()):(this._reConnectCount=0,this._channelModule.probeNetwork().then((function(t){var n=M(t,2),o=n[0];n[1],o?(wl.warn("".concat(e._className,".forcedReconnect disconnected from wsserver but network is ok, continue...")),e._closeConnection(ZE),e._initConnection()):e._channelModule.onReconnectFailed()})))}},{key:"getReconnectFlag",value:function(){return this._reConnectFlag}},{key:"_setNextPingTs",value:function(){this._nextPingTs=Date.now()+1e4}},{key:"getNextPingTs",value:function(){return this._nextPingTs}},{key:"isConnected",value:function(){return this._readyState===tC}},{key:"canIUseBinaryFrame",value:function(){return this._canIUseBinaryFrame}},{key:"setIsWorkerEnabled",value:function(e){wl.log("".concat(this._className,".setIsWorkerEnabled flag:").concat(e)),this._isWorkerEnabled=e}},{key:"getIsWorkerEnabled",value:function(){return this._isWorkerEnabled&&pl}},{key:"_getRandom",value:function(){return 0===this._random&&(this._random=Math.random()),this._random}},{key:"_resetRandom",value:function(){this._random=0}},{key:"close",value:function(){wl.log("".concat(this._className,".close")),this._closeConnection(QE),this._promiseMap.clear(),this._startSequence=dd(),this._readyState=oC,this._simpleRequestMap.clear(),this._reConnectFlag=!1,this._reConnectCount=0,this._onOpenTs=0,this._url="",this._random=0,this._canIUseBinaryFrame=!0,this._isWorkerEnabled=!0}}]),e}(),aC=function(e){c(n,e);var t=v(n);function n(e){var o;if(r(this,n),(o=t.call(this,e))._className="ChannelModule",o._socketHandler=new rC(f(o)),o._probing=!1,o._isAppShowing=!0,o._previousState=hr.NET_STATE_CONNECTED,Wc&&"function"==typeof zc.onAppShow&&"function"==typeof zc.onAppHide){var a=o._onAppHide.bind(f(o)),s=o._onAppShow.bind(f(o));"function"==typeof zc.offAppHide&&zc.offAppHide(a),"function"==typeof zc.offAppShow&&zc.offAppShow(s),zc.onAppHide(a),zc.onAppShow(s)}return o._timerForNotLoggedIn=-1,o._timerForNotLoggedIn=setInterval(o.onCheckTimer.bind(f(o)),1e3),o._fatalErrorFlag=!1,o}return i(n,[{key:"onCheckTimer",value:function(e){this._socketHandler&&(this.isLoggedIn()?(this._timerForNotLoggedIn>0&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(e)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{key:"onErrorCodeNotZero",value:function(e){this.getModule(mg).onErrorCodeNotZero(e)}},{key:"onMessage",value:function(e){this.getModule(mg).onMessage(e)}},{key:"send",value:function(e){return this._socketHandler?this._previousState!==hr.NET_STATE_CONNECTED&&e.head.servcmd.includes(J_)?(this.reConnect(),this._sendLogViaHTTP(e)):this._socketHandler.send(e):Promise.reject()}},{key:"_sendLogViaHTTP",value:function(e){var t=bc.HOST.CURRENT.STAT;return new Promise((function(n,o){var r="".concat(t,"/v4/imopenstat/tim_web_report_v2?sdkappid=").concat(e.head.sdkappid,"&reqtime=").concat(Date.now()),a=JSON.stringify(e.body),s="application/x-www-form-urlencoded;charset=UTF-8";if(Wc)zc.request({url:r,data:a,method:"POST",timeout:3e3,header:{"content-type":s},success:function(){n()},fail:function(){o(new Wv({code:Mh.NETWORK_ERROR,message:yh.NETWORK_ERROR}))}});else{var i=new XMLHttpRequest,u=setTimeout((function(){i.abort(),o(new Wv({code:Mh.NETWORK_TIMEOUT,message:yh.NETWORK_TIMEOUT}))}),3e3);i.onreadystatechange=function(){4===i.readyState&&(clearTimeout(u),200===i.status||304===i.status?n():o(new Wv({code:Mh.NETWORK_ERROR,message:yh.NETWORK_ERROR})))},i.open("POST",r,!0),i.setRequestHeader("Content-type",s),i.send(a)}}))}},{key:"simplySend",value:function(e){return this._socketHandler?this._socketHandler.simplySend(e):Promise.reject()}},{key:"onOpen",value:function(){this._ping()}},{key:"onClose",value:function(){this._socketHandler&&this._socketHandler.getReconnectFlag()&&this._emitNetStateChangeEvent(hr.NET_STATE_DISCONNECTED),this.reConnect()}},{key:"onError",value:function(){Wc&&!Hc&&wl.error("".concat(this._className,".onError 从v2.11.2起SDK 支持了 WebSocket如您未添加相关受信域名请先添加(如已添加请忽略),升级指引: https://web.sdk.qcloud.com/im/doc/zh-cn/tutorial-02-upgradeguideline.html")),this._emitNetStateChangeEvent(hr.NET_STATE_DISCONNECTED)}},{key:"getKeyMap",value:function(e){return this.getModule(mg).getKeyMap(e)}},{key:"_onAppHide",value:function(){this._isAppShowing=!1}},{key:"_onAppShow",value:function(){this._isAppShowing=!0}},{key:"onRequestTimeout",value:function(e){}},{key:"onReconnected",value:function(){wl.log("".concat(this._className,".onReconnected")),this.getModule(mg).onReconnected(),this._emitNetStateChangeEvent(hr.NET_STATE_CONNECTED)}},{key:"onReconnectFailed",value:function(){wl.log("".concat(this._className,".onReconnectFailed")),this._emitNetStateChangeEvent(hr.NET_STATE_DISCONNECTED)}},{key:"setIsWorkerEnabled",value:function(e){this._socketHandler&&this._socketHandler.setIsWorkerEnabled(!1)}},{key:"offline",value:function(){this._emitNetStateChangeEvent(hr.NET_STATE_DISCONNECTED)}},{key:"reConnect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!1;this._socketHandler&&(t=this._socketHandler.getReconnectFlag());var n="forcedFlag:".concat(e," fatalErrorFlag:").concat(this._fatalErrorFlag," previousState:").concat(this._previousState," reconnectFlag:").concat(t);if(wl.log("".concat(this._className,".reConnect ").concat(n)),!this._fatalErrorFlag&&this._socketHandler){if(!0===e)this._socketHandler.forcedReconnect();else{if(this._previousState===hr.NET_STATE_CONNECTING&&t)return;this._socketHandler.forcedReconnect()}this._emitNetStateChangeEvent(hr.NET_STATE_CONNECTING)}}},{key:"_emitNetStateChangeEvent",value:function(e){this._previousState!==e&&(wl.log("".concat(this._className,"._emitNetStateChangeEvent from ").concat(this._previousState," to ").concat(e)),this._previousState=e,this.emitOuterEvent(_r.NET_STATE_CHANGE,{state:e}))}},{key:"_ping",value:function(){var e=this;if(!0!==this._probing){this._probing=!0;var t=this.getModule(mg).getProtocolData({protocolName:X_});this.send(t).then((function(){e._probing=!1})).catch((function(t){if(wl.warn("".concat(e._className,"._ping failed. error:"),t),e._probing=!1,t&&60002===t.code)return new Uh(bh.ERROR).setMessage("code:".concat(t.code," message:").concat(t.message)).setNetworkType(e.getModule(pg).getNetworkType()).end(),e._fatalErrorFlag=!0,void e._emitNetStateChangeEvent(hr.NET_STATE_DISCONNECTED);e.probeNetwork().then((function(t){var n=M(t,2),o=n[0],r=n[1];wl.log("".concat(e._className,"._ping failed. probe network, isAppShowing:").concat(e._isAppShowing," online:").concat(o," networkType:").concat(r)),o?e.reConnect():e._emitNetStateChangeEvent(hr.NET_STATE_DISCONNECTED)}))}))}}},{key:"_checkNextPing",value:function(){this._socketHandler&&this._socketHandler.isConnected()&&Date.now()>=this._socketHandler.getNextPingTs()&&this._ping()}},{key:"dealloc",value:function(){this._socketHandler&&(this._socketHandler.close(),this._socketHandler=null),this._timerForNotLoggedIn>-1&&clearInterval(this._timerForNotLoggedIn)}},{key:"onRestApiKickedOut",value:function(){this._socketHandler&&(this._socketHandler.close(),this.reConnect(!0))}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._previousState=hr.NET_STATE_CONNECTED,this._probing=!1,this._fatalErrorFlag=!1,this._timerForNotLoggedIn=setInterval(this.onCheckTimer.bind(this),1e3)}}]),n}(Ag),sC=["a2","tinyid"],iC=["a2","tinyid"],uC=function(){function e(t){r(this,e),this._className="ProtocolHandler",this._sessionModule=t,this._configMap=new Map,this._fillConfigMap()}return i(e,[{key:"_fillConfigMap",value:function(){this._configMap.clear();var e=this._sessionModule.genCommonHead(),n=this._sessionModule.genCosSpecifiedHead(),o=this._sessionModule.genSSOReportHead();this._configMap.set(Dg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.LOGIN)}),body:{state:"Online",isWebUniapp:0,deviceBrand:0},keyMap:{request:{deviceBrand:"InstType"},response:{InstId:"instanceID",HelloInterval:"helloInterval"}}}}(e)),this._configMap.set(Ng,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.LOGOUT)}),body:{type:0},keyMap:{request:{type:"wslogout_type"}}}}(e)),this._configMap.set(Og,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.HELLO)}),body:{isWebUniapp:0},keyMap:{response:{NewInstInfo:"newInstanceInfo"}}}}(e)),this._configMap.set(Rg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.STAT_SERVICE,".").concat(bc.CMD.KICK_OTHER)}),body:{}}}(e)),this._configMap.set(W_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_COS_SIGN,".").concat(bc.CMD.COS_SIGN)}),body:{cmd:"open_im_cos_svc",subCmd:"get_cos_token",duration:300,version:2},keyMap:{request:{userSig:"usersig",subCmd:"sub_cmd",cmd:"cmd",duration:"duration",version:"version"},response:{expired_time:"expiredTime",bucket_name:"bucketName",session_token:"sessionToken",tmp_secret_id:"secretId",tmp_secret_key:"secretKey"}}}}(n)),this._configMap.set(Y_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.CUSTOM_UPLOAD,".").concat(bc.CMD.COS_PRE_SIG)}),body:{fileType:void 0,fileName:void 0,uploadMethod:0,duration:900},keyMap:{request:{userSig:"usersig",fileType:"file_type",fileName:"file_name",uploadMethod:"upload_method"},response:{expired_time:"expiredTime",request_id:"requestId",head_url:"headUrl",upload_url:"uploadUrl",download_url:"downloadUrl",ci_url:"ciUrl",snapshot_url:"requestSnapshotUrl"}}}}(n)),this._configMap.set(z_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.CUSTOM_UPLOAD,".").concat(bc.CMD.VIDEO_COVER)}),body:{version:1,platform:void 0,coverName:void 0,requestSnapshotUrl:void 0},keyMap:{request:{version:"version",platform:"platform",coverName:"cover_name",requestSnapshotUrl:"snapshot_url"},response:{error_code:"errorCode",error_msg:"errorInfo",download_url:"snapshotUrl"}}}}(n)),this._configMap.set(ah,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_CONFIG_MANAGER,".").concat(bc.CMD.FETCH_COMMERCIAL_CONFIG)}),body:{SDKAppID:0},keyMap:{request:{SDKAppID:"uint32_sdkappid"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(e)),this._configMap.set(sh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_CONFIG_MANAGER,".").concat(bc.CMD.PUSHED_COMMERCIAL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(e)),this._configMap.set(oh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_CONFIG_MANAGER,".").concat(bc.CMD.FETCH_CLOUD_CONTROL_CONFIG)}),body:{SDKAppID:0,version:0},keyMap:{request:{SDKAppID:"uint32_sdkappid",version:"uint64_version"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}}(e)),this._configMap.set(rh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_CONFIG_MANAGER,".").concat(bc.CMD.PUSHED_CLOUD_CONTROL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}}(e)),this._configMap.set(ih,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OVERLOAD_PUSH,".").concat(bc.CMD.OVERLOAD_NOTIFY)}),body:{},keyMap:{response:{OverLoadServCmd:"overloadCommand",DelaySecs:"waitingTime"}}}}(e)),this._configMap.set(Lg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.GET_MESSAGES)}),body:{cookie:"",syncFlag:0,needAbstract:1,isOnlineSync:0},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",from:"From_Account",to:"To_Account",time:"MsgTimeStamp",sequence:"MsgSeq",random:"MsgRandom",elements:"MsgBody"},response:{MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",ClientSeq:"clientSequence",MsgSeq:"sequence",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgRandom:"random",MsgTimeStamp:"time",MsgContent:"content",ToGroupId:"groupID",MsgKey:"messageKey",GroupTips:"groupTips",MsgBody:"elements",MsgType:"type",C2CRemainingUnreadCount:"C2CRemainingUnreadList",C2CPairUnreadCount:"C2CPairUnreadList"}}}}(e)),this._configMap.set(kg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.BIG_DATA_HALLWAY_AUTH_KEY)}),body:{}}}(e)),this._configMap.set(Gg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.SEND_MESSAGE)}),body:{fromAccount:"",toAccount:"",msgSeq:0,msgRandom:0,msgBody:[],cloudCustomData:void 0,nick:"",avatar:"",msgLifeTime:void 0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0},androidInfo:{OPPOChannelID:""}},messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",count:"MaxCnt",lastMessageTime:"LastMsgTime",messageKey:"MsgKey",peerAccount:"Peer_Account",data:"Data",description:"Desc",extension:"Ext",type:"MsgType",content:"MsgContent",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",nick:"From_AccountNick",avatar:"From_AccountHeadurl",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",elements:"MsgBody",clientSequence:"ClientSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody",needReadReceipt:"IsNeedReadReceipt"}}}}(e)),this._configMap.set(Pg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.SEND_GROUP_MESSAGE)}),body:{fromAccount:"",groupID:"",random:0,clientSequence:0,priority:"",msgBody:[],cloudCustomData:void 0,onlineOnlyFlag:0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0},androidInfo:{OPPOChannelID:""}},groupAtInfo:[],messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,topicID:void 0},keyMap:{request:{to:"GroupId",extension:"Ext",data:"Data",description:"Desc",random:"Random",sequence:"ReqMsgSeq",count:"ReqMsgNumber",type:"MsgType",priority:"MsgPriority",content:"MsgContent",elements:"MsgBody",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",clientSequence:"ClientSeq",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody",needReadReceipt:"NeedReadReceipt"},response:{MsgTime:"time",MsgSeq:"sequence"}}}}(e)),this._configMap.set(Vg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.REVOKE_C2C_MESSAGE)}),body:{msgInfo:{fromAccount:"",toAccount:"",msgTimeStamp:0,msgSeq:0,msgRandom:0}},keyMap:{request:{msgInfo:"MsgInfo",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom"}}}}(e)),this._configMap.set(M_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.REVOKE_GROUP_MESSAGE)}),body:{groupID:"",msgSeqList:void 0,topicID:""},keyMap:{request:{msgSeqList:"MsgSeqList",msgSeq:"MsgSeq"}}}}(e)),this._configMap.set(Hg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.GET_C2C_ROAM_MESSAGES)}),body:{peerAccount:"",count:15,lastMessageTime:0,messageKey:"",withRecalledMessage:1,direction:0},keyMap:{request:{messageKey:"MsgKey",peerAccount:"Peer_Account",count:"MaxCnt",lastMessageTime:"LastMsgTime",withRecalledMessage:"WithRecalledMsg",direction:"GetDirection"},response:{LastMsgTime:"lastMessageTime",IsNeedReadReceipt:"needReadReceipt"}}}}(e)),this._configMap.set(Yg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.MODIFY_C2C_MESSAGE)}),body:{from:"",to:"",sequence:0,random:0,time:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}}(e)),this._configMap.set(T_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.GET_GROUP_ROAM_MESSAGES)}),body:{withRecalledMsg:1,groupID:"",count:15,sequence:"",topicID:void 0},keyMap:{request:{sequence:"ReqMsgSeq",count:"ReqMsgNumber",withRecalledMessage:"WithRecalledMsg"},response:{Random:"random",MsgTime:"time",MsgSeq:"sequence",ReqMsgSeq:"sequence",RspMsgList:"messageList",IsPlaceMsg:"isPlaceMessage",IsSystemMsg:"isSystemMessage",ToGroupId:"to",EnumFrom_AccountType:"fromAccountType",EnumTo_AccountType:"toAccountType",GroupCode:"groupCode",MsgPriority:"priority",MsgBody:"elements",MsgType:"type",MsgContent:"content",IsFinished:"complete",Download_Flag:"downloadFlag",ClientSeq:"clientSequence",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID",ToTopicId:"topicID"}}}}(e)),this._configMap.set(xg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.SET_C2C_MESSAGE_READ)}),body:{C2CMsgReaded:void 0},keyMap:{request:{lastMessageTime:"LastedMsgTime"}}}}(e)),this._configMap.set(Bg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.SET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{userIDList:void 0,muteFlag:0},keyMap:{request:{userIDList:"Peer_Account",muteFlag:"Mute_Notifications"}}}}(e)),this._configMap.set(Kg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.GET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{updateSequence:0},keyMap:{response:{MuteNotificationsList:"muteFlagList"}}}}(e)),this._configMap.set(y_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.SET_GROUP_MESSAGE_READ)}),body:{groupID:void 0,messageReadSeq:void 0,topicID:void 0},keyMap:{request:{messageReadSeq:"MsgReadedSeq"}}}}(e)),this._configMap.set(I_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.SET_ALL_MESSAGE_READ)}),body:{readAllC2CMessage:0,groupMessageReadInfoList:[]},keyMap:{request:{readAllC2CMessage:"C2CReadAllMsg",groupMessageReadInfoList:"GroupReadInfo",messageSequence:"MsgSeq"},response:{C2CReadAllMsg:"readAllC2CMessage",GroupReadInfoArray:"groupMessageReadInfoList"}}}}(e)),this._configMap.set(Wg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.DELETE_C2C_MESSAGE)}),body:{fromAccount:"",to:"",keyList:void 0},keyMap:{request:{keyList:"MsgKeyList"}}}}(e)),this._configMap.set(k_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.DELETE_GROUP_MESSAGE)}),body:{groupID:"",deleter:"",keyList:void 0,topicID:void 0},keyMap:{request:{deleter:"Deleter_Account",keyList:"Seqs"}}}}(e)),this._configMap.set(G_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.MODIFY_GROUP_MESSAGE)}),body:{groupID:"",topicID:void 0,sequence:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}}(e)),this._configMap.set(E_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.GET_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequence:"MsgSeq"}}}}(e)),this._configMap.set(S_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.SEND_C2C_READ_RECEIPT)}),body:{peerAccount:"",messageInfoList:void 0},keyMap:{request:{peerAccount:"Peer_Account",messageInfoList:"C2CMsgInfo",fromAccount:"From_Account",toAccount:"To_Account",sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",clientTime:"MsgClientTime"}}}}(e)),this._configMap.set(C_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.SEND_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequenceList:"MsgSeqList",sequence:"MsgSeq"}}}}(e)),this._configMap.set(A_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.GET_READ_RECEIPT_DETAIL)}),body:{groupID:"",sequence:void 0,flag:0,cursor:0,count:0},keyMap:{request:{sequence:"MsgSeq",count:"Num"},response:{ReadList:"readUserIDList",Read_Account:"userID",UnreadList:"unreadUserIDList",Unread_Account:"userID",IsFinish:"isCompleted"}}}}(e)),this._configMap.set(jg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.GET_PEER_READ_TIME)}),body:{userIDList:void 0},keyMap:{request:{userIDList:"To_Account"},response:{ReadTime:"peerReadTimeList"}}}}(e)),this._configMap.set(Jg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.GET_CONVERSATION_LIST)}),body:{fromAccount:void 0,count:0},keyMap:{request:{},response:{SessionItem:"conversations",ToAccount:"groupID",To_Account:"userID",UnreadMsgCount:"unreadCount",MsgGroupReadedSeq:"messageReadSeq",C2cPeerReadTime:"c2cPeerReadTime"}}}}(e)),this._configMap.set(zg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.PAGING_GET_CONVERSATION_LIST)}),body:{fromAccount:void 0,timeStamp:void 0,startIndex:void 0,pinnedTimeStamp:void 0,pinnedStartIndex:void 0,orderType:void 0,messageAssistFlag:4,assistFlag:15},keyMap:{request:{messageAssistFlag:"MsgAssistFlags",assistFlag:"AssistFlags",pinnedTimeStamp:"TopTimeStamp",pinnedStartIndex:"TopStartIndex"},response:{SessionItem:"conversations",ToAccount:"groupID",To_Account:"userID",UnreadMsgCount:"unreadCount",MsgGroupReadedSeq:"messageReadSeq",C2cPeerReadTime:"c2cPeerReadTime",LastMsgFlags:"lastMessageFlag",TopFlags:"isPinned",TopTimeStamp:"pinnedTimeStamp",TopStartIndex:"pinnedStartIndex",GroupId:"convGroupID"}}}}(e)),this._configMap.set(Xg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.DELETE_CONVERSATION)}),body:{fromAccount:"",toAccount:void 0,type:1,toGroupID:void 0,clearHistoryMessage:1},keyMap:{request:{toGroupID:"ToGroupid",clearHistoryMessage:"ClearRamble"}}}}(e)),this._configMap.set(Qg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.PIN_CONVERSATION)}),body:{fromAccount:"",operationType:1,itemList:void 0},keyMap:{request:{itemList:"RecentContactItem"}}}}(e)),this._configMap.set(Zg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.DELETE_GROUP_AT_TIPS)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(e)),this._configMap.set($g,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.MARK_CONVERSATION)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(e_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.MARK_CONVERSATION)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(t_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.CREATE_CONVERSATION_GROUP)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"GroupContactItem",groupID:"ToGroupId"},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(n_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.DELETE_CONVERSATION_GROUP)}),body:{fromAccount:"",groupName:void 0},keyMap:{request:{},response:{GroupId:"convGroupID"}}}}(e)),this._configMap.set(o_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{oldName:"OldGroupName",newName:"NewGroupName",groupID:"ToGroupId",operationType:"ContactOptType",groupName:"OldGroupName",updateItem:"ContactUpdateItem"},response:{ContactOptType:"operationType",ToGroupId:"groupID",GroupId:"convGroupID"}}}}(e)),this._configMap.set(r_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:{groupName:void 0,updateGroupType:void 0,updateItem:void 0}},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(a_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(s_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.RECENT_CONTACT,".").concat(bc.CMD.GET_CONVERSATION_GROUP_LIST)}),body:{fromAccount:"",startTime:void 0,startIndex:void 0},keyMap:{request:{},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType",CustomMark:"customData",ContactGroupId:"convGroupIDList"}}}}(e)),this._configMap.set(Ug,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.PROFILE,".").concat(bc.CMD.PORTRAIT_GET)}),body:{fromAccount:"",userItem:[]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(e)),this._configMap.set(bg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.PROFILE,".").concat(bc.CMD.PORTRAIT_SET)}),body:{fromAccount:"",profileItem:[{tag:ql.NICK,value:""},{tag:ql.GENDER,value:""},{tag:ql.ALLOWTYPE,value:""},{tag:ql.AVATAR,value:""}]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(e)),this._configMap.set(wg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.FRIEND,".").concat(bc.CMD.GET_BLACKLIST)}),body:{fromAccount:"",startIndex:0,maxLimited:30,lastSequence:0},keyMap:{response:{CurruentSequence:"currentSequence"}}}}(e)),this._configMap.set(Fg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.FRIEND,".").concat(bc.CMD.ADD_BLACKLIST)}),body:{fromAccount:"",toAccount:[]}}}(e)),this._configMap.set(qg,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.FRIEND,".").concat(bc.CMD.DELETE_BLACKLIST)}),body:{fromAccount:"",toAccount:[]}}}(e)),this._configMap.set(ph,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.SET_SELF_STATUS)}),body:{customStatus:""},keyMap:{}}}(e)),this._configMap.set(gh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.GET_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{UserStatusList:"successUserList",ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID",Status:"statusType"}}}}(e)),this._configMap.set(_h,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.SUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}}(e)),this._configMap.set(hh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.UNSUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0,unsubscribeAll:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}}(e)),this._configMap.set(i_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.GET_JOINED_GROUPS)}),body:{memberAccount:"",limit:void 0,offset:void 0,groupType:void 0,responseFilter:{groupBaseInfoFilter:void 0,selfInfoFilter:void 0},isSupportTopic:0},keyMap:{request:{memberAccount:"Member_Account"},response:{GroupIdList:"groups",NoUnreadSeqList:"excludedUnreadSequenceList",MsgSeq:"readedSequence"}}}}(e)),this._configMap.set(u_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.GET_GROUP_INFO)}),body:{groupIDList:void 0,responseFilter:{groupBaseInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember"],groupCustomFieldFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0}},keyMap:{request:{groupIDList:"GroupIdList",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",groupCustomFieldFilter:"AppDefinedDataFilter_Group",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{GroupIdList:"groups",AppDefinedData:"groupCustomField",AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_Group:"groupCustomFieldFilter",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",InfoSeq:"infoSequence",MemberList:"members",GroupInfo:"groups",ShutUpUntil:"muteUntil",ShutUpAllMember:"muteAllMembers"}}}}(e)),this._configMap.set(c_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.CREATE_GROUP)}),body:{type:void 0,name:void 0,groupID:void 0,ownerID:void 0,introduction:void 0,notification:void 0,maxMemberNum:void 0,joinOption:void 0,memberList:void 0,groupCustomField:void 0,memberCustomField:void 0,webPushFlag:1,avatar:"",isSupportTopic:void 0},keyMap:{request:{ownerID:"Owner_Account",userID:"Member_Account",avatar:"FaceUrl",maxMemberNum:"MaxMemberCount",joinOption:"ApplyJoinOption",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData"},response:{HugeGroupFlag:"avChatRoomFlag",OverJoinedGroupLimit_Account:"overLimitUserIDList"}}}}(e)),this._configMap.set(l_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.DESTROY_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set(d_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.MODIFY_GROUP_INFO)}),body:{groupID:void 0,name:void 0,introduction:void 0,notification:void 0,avatar:void 0,maxMemberNum:void 0,joinOption:void 0,groupCustomField:void 0,muteAllMembers:void 0},keyMap:{request:{maxMemberNum:"MaxMemberCount",groupCustomField:"AppDefinedData",muteAllMembers:"ShutUpAllMember",joinOption:"ApplyJoinOption",avatar:"FaceUrl"},response:{AppDefinedData:"groupCustomField",ShutUpAllMember:"muteAllMembers"}}}}(e)),this._configMap.set(p_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1,historyMessageFlag:void 0},keyMap:{request:{applyMessage:"ApplyMsg",historyMessageFlag:"HugeGroupHistoryMsgFlag"},response:{HugeGroupFlag:"avChatRoomFlag",AVChatRoomKey:"avChatRoomKey",RspMsgList:"messageList",ToGroupId:"to"}}}}(e)),this._configMap.set(g_,function(e){return e.a2,e.tinyid,{head:t(t({},h(e,sC)),{},{servcmd:"".concat(bc.NAME.BIG_GROUP_NO_AUTH,".").concat(bc.CMD.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1},keyMap:{request:{applyMessage:"ApplyMsg"},response:{HugeGroupFlag:"avChatRoomFlag"}}}}(e)),this._configMap.set(__,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.QUIT_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set(h_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.SEARCH_GROUP_BY_ID)}),body:{groupIDList:void 0,responseFilter:{groupBasePublicInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","CreateTime","Owner_Account","LastInfoTime","LastMsgTime","NextMsgSeq","MemberNum","MaxMemberNum","ApplyJoinOption"]}},keyMap:{response:{}}}}(e)),this._configMap.set(f_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.CHANGE_GROUP_OWNER)}),body:{groupID:void 0,newOwnerID:void 0},keyMap:{request:{newOwnerID:"NewOwner_Account"}}}}(e)),this._configMap.set(m_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.HANDLE_APPLY_JOIN_GROUP)}),body:{groupID:void 0,applicant:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}}(e)),this._configMap.set(v_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.HANDLE_GROUP_INVITATION)}),body:{groupID:void 0,inviter:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{inviter:"Inviter_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}}(e)),this._configMap.set(D_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.GET_GROUP_APPLICATION)}),body:{startTime:void 0,limit:void 0,handleAccount:void 0},keyMap:{request:{handleAccount:"Handle_Account"}}}}(e)),this._configMap.set(N_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.DELETE_GROUP_SYSTEM_MESSAGE)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(e)),this._configMap.set(O_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.BIG_GROUP_LONG_POLLING,".").concat(bc.CMD.AVCHATROOM_LONG_POLL)}),body:{USP:1,startSeq:1,startBroadcastSeq:void 0,holdTime:90,key:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}}(e)),this._configMap.set(R_,function(e){return e.a2,e.tinyid,{head:t(t({},h(e,iC)),{},{servcmd:"".concat(bc.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,".").concat(bc.CMD.AVCHATROOM_LONG_POLL)}),body:{USP:1,startSeq:1,holdTime:90,key:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID"}}}}(e)),this._configMap.set(L_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.GET_ONLINE_MEMBER_NUM)}),body:{groupID:void 0}}}(e)),this._configMap.set(P_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.SET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}}(e)),this._configMap.set(U_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.MODIFY_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}}(e)),this._configMap.set(b_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.DELETE_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key"}}}}(e)),this._configMap.set(w_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.CLEAR_GROUP_ATTRIBUTES)}),body:{groupID:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]}}}(e)),this._configMap.set(F_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP_ATTR,".").concat(bc.CMD.GET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,avChatRoomKey:void 0,groupType:1},keyMap:{request:{avChatRoomKey:"Key",groupType:"GroupType"}}}}(e)),this._configMap.set(uh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP_COMMUNITY,".").concat(bc.CMD.CREATE_TOPIC)}),body:{groupID:void 0,topicName:void 0,avatar:void 0,customData:void 0,topicID:void 0,notification:void 0,introduction:void 0},keyMap:{request:{avatar:"FaceUrl"}}}}(e)),this._configMap.set(ch,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP_COMMUNITY,".").concat(bc.CMD.DELETE_TOPIC)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{request:{topicIDList:"TopicIdList"},response:{DestroyResultItem:"resultList"}}}}(e)),this._configMap.set(lh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP_COMMUNITY,".").concat(bc.CMD.UPDATE_TOPIC_PROFILE)}),body:{groupID:void 0,topicID:void 0,avatar:void 0,customData:void 0,notification:void 0,introduction:void 0,muteAllMembers:void 0,topicName:void 0},keyMap:{request:{avatar:"FaceUrl",muteAllMembers:"ShutUpAllMember"}}}}(e)),this._configMap.set(dh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP_COMMUNITY,".").concat(bc.CMD.GET_TOPIC_LIST)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{request:{topicIDList:"TopicIdList"},response:{TopicAndSelfInfo:"topicInfoList",TopicInfo:"topic",GroupID:"groupID",ShutUpTime:"muteTime",ShutUpAllFlag:"muteAllMembers",LastMsgTime:"lastMessageTime",MsgSeq:"readedSequence",LastMsgSeq:"sequence"}}}}(e)),this._configMap.set(q_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.GET_GROUP_MEMBER_LIST)}),body:{groupID:void 0,limit:0,offset:void 0,next:void 0,memberRoleFilter:void 0,memberInfoFilter:["Role","NameCard","ShutUpUntil","JoinTime"],memberCustomFieldFilter:void 0},keyMap:{request:{memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",MemberList:"members",ShutUpUntil:"muteUntil"}}}}(e)),this._configMap.set(V_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP_AVCHATROOM,".").concat(bc.CMD.GET_AVCHATROOM_MEMBER_LIST)}),body:{groupID:void 0,offset:void 0},keyMap:{request:{offset:"Timestamp"},response:{NextTimestamp:"offset"}}}}(e)),this._configMap.set(x_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.GET_GROUP_MEMBER_INFO)}),body:{groupID:void 0,userIDList:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{userIDList:"Member_List_Account",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{MemberList:"members",ShutUpUntil:"muteUntil",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",AppMemberDefinedData:"memberCustomField"}}}}(e)),this._configMap.set(B_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.ADD_GROUP_MEMBER)}),body:{groupID:void 0,silence:void 0,userIDList:void 0},keyMap:{request:{userID:"Member_Account",userIDList:"MemberList"},response:{MemberList:"members"}}}}(e)),this._configMap.set(K_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.DELETE_GROUP_MEMBER)}),body:{groupID:void 0,userIDList:void 0,reason:void 0},keyMap:{request:{userIDList:"MemberToDel_Account"}}}}(e)),this._configMap.set(H_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.BAN_AVCHATROOM_MEMBER)}),body:{groupID:void 0,userIDList:void 0,duration:void 0,reason:""},keyMap:{request:{userIDList:"Members_Account",duration:"Duration",reason:"Description"}}}}(e)),this._configMap.set(j_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.GROUP,".").concat(bc.CMD.MODIFY_GROUP_MEMBER_INFO)}),body:{groupID:void 0,topicID:void 0,userID:void 0,messageRemindType:void 0,nameCard:void 0,role:void 0,memberCustomField:void 0,muteTime:void 0},keyMap:{request:{userID:"Member_Account",memberCustomField:"AppMemberDefinedData",muteTime:"ShutUpTime",messageRemindType:"MsgFlag"}}}}(e)),this._configMap.set(J_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STAT,".").concat(bc.CMD.TIM_WEB_REPORT_V2)}),body:{header:{},event:[],quality:[]},keyMap:{request:{SDKType:"sdk_type",SDKVersion:"sdk_version",deviceType:"device_type",platform:"platform",instanceID:"instance_id",traceID:"trace_id",SDKAppID:"sdk_app_id",userID:"user_id",tinyID:"tiny_id",extension:"extension",timestamp:"timestamp",networkType:"network_type",eventType:"event_type",code:"error_code",message:"error_message",moreMessage:"more_message",duplicate:"duplicate",costTime:"cost_time",level:"level",qualityType:"quality_type",reportIndex:"report_index",wholePeriod:"whole_period",totalCount:"total_count",rttCount:"success_count_business",successRateOfRequest:"percent_business",countLessThan1Second:"success_count_business",percentOfCountLessThan1Second:"percent_business",countLessThan3Second:"success_count_platform",percentOfCountLessThan3Second:"percent_platform",successCountOfBusiness:"success_count_business",successRateOfBusiness:"percent_business",successCountOfPlatform:"success_count_platform",successRateOfPlatform:"percent_platform",successCountOfMessageReceived:"success_count_business",successRateOfMessageReceived:"percent_business",avgRTT:"average_value",avgDelay:"average_value",avgValue:"average_value",uiPlatform:"ui_platform"}}}}(o)),this._configMap.set(X_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.HEARTBEAT,".").concat(bc.CMD.ALIVE)}),body:{}}}(e)),this._configMap.set(Q_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_PUSH,".").concat(bc.CMD.MESSAGE_PUSH)}),body:{},keyMap:{response:{C2cMsgArray:"C2CMessageArray",GroupMsgArray:"groupMessageArray",GroupTips:"groupTips",C2cNotifyMsgArray:"C2CNotifyMessageArray",C2cMsgInfo:"C2CReadReceiptArray",ClientSeq:"clientSequence",MsgPriority:"priority",NoticeSeq:"noticeSequence",MsgContent:"content",MsgType:"type",MsgBody:"elements",ToGroupId:"to",Desc:"description",Ext:"extension",IsSyncMsg:"isSyncMessage",Flag:"needSync",NeedAck:"needAck",PendencyAdd_Account:"userID",ProfileImNick:"nick",PendencyType:"applicationType",C2CReadAllMsg:"readAllC2CMessage",IsNeedReadReceipt:"needReadReceipt",Status:"statusType"}}}}(e)),this._configMap.set(Z_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_PUSH,".").concat(bc.CMD.MULTI_MESSAGE_PUSH)}),body:{},keyMap:{response:{GroupMsgArray:"groupMessageArray",GroupTips:"groupTips",ClientSeq:"clientSequence",MsgPriority:"priority",NoticeSeq:"noticeSequence",MsgContent:"content",MsgType:"type",MsgBody:"elements",ToGroupId:"to",Desc:"description",Ext:"extension",IsSyncMsg:"isSyncMessage",Flag:"needSync",NeedAck:"needAck",PendencyType:"applicationType"}}}}(e)),this._configMap.set($_,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.OPEN_IM,".").concat(bc.CMD.MESSAGE_PUSH_ACK)}),body:{sessionData:void 0},keyMap:{request:{sessionData:"SessionData"}}}}(e)),this._configMap.set(eh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.STATUS_FORCE_OFFLINE)}),body:{},keyMap:{response:{C2cNotifyMsgArray:"C2CNotifyMessageArray",NoticeSeq:"noticeSequence",KickoutMsgNotify:"kickoutMsgNotify",NewInstInfo:"newInstanceInfo"}}}}(e)),this._configMap.set(nh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_LONG_MESSAGE,".").concat(bc.CMD.DOWNLOAD_MERGER_MESSAGE)}),body:{downloadKey:""},keyMap:{response:{Data:"data",Desc:"description",Ext:"extension",Download_Flag:"downloadFlag",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID"}}}}(e)),this._configMap.set(th,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_LONG_MESSAGE,".").concat(bc.CMD.UPLOAD_MERGER_MESSAGE)}),body:{messageList:[]},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",type:"MsgType",content:"MsgContent",data:"Data",description:"Desc",extension:"Ext",sizeType:"Type",uuid:"UUID",url:"",imageUrl:"URL",fileUrl:"Url",remoteAudioUrl:"Url",remoteVideoUrl:"VideoUrl",thumbUUID:"ThumbUUID",videoUUID:"VideoUUID",videoUrl:"",downloadFlag:"Download_Flag",from:"From_Account",time:"MsgTimeStamp",messageRandom:"MsgRandom",messageSequence:"MsgSeq",elements:"MsgBody",clientSequence:"ClientSeq",payload:"MsgContent",messageList:"MsgList",messageNumber:"MsgNum",abstractList:"AbstractList",messageBody:"MsgBody"}}}}(e)),this._configMap.set(vh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.SET_TOKEN)}),body:{tokenID:"",pushMsg:0,sdkAppID:0,businessID:"",deviceBrand:"",deviceToken:"",isTpns:0,isWebUniapp:0},keyMap:{request:{tokenID:"TokenID",pushMsg:"PushMsg",sdkAppID:"EnterVersion",businessID:"BusiID",deviceBrand:"InstType",deviceToken:"VarToken",isTpns:"IsTpns"}}}}(e)),this._configMap.set(mh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.STAT_FOREGROUND)}),body:{isWebUniapp:0}}}(e)),this._configMap.set(fh,function(e){return{head:t(t({},e),{},{servcmd:"".concat(bc.NAME.IM_OPEN_STATUS,".").concat(bc.CMD.STAT_BACKGROUND)}),body:{C2CUnread:0,GroupUnread:0,isWebUniapp:0},keyMap:{request:{c2cUnreadCount:"C2cUnread",groupUnreadCount:"GrpUnread"}}}}(e))}},{key:"has",value:function(e){return this._configMap.has(e)}},{key:"get",value:function(e){return this._configMap.get(e)}},{key:"update",value:function(){this._fillConfigMap()}},{key:"getKeyMap",value:function(e){return this.has(e)?this.get(e).keyMap||{}:(wl.warn("".concat(this._className,".getKeyMap unknown protocolName:").concat(e)),{})}},{key:"getProtocolData",value:function(e){var t=e.protocolName,n=e.requestData,o=this.get(t),r=null;if(n){var a=this._simpleDeepCopy(o),s=this._updateService(n,a),i=s.body,u=Object.create(null);for(var c in i)if(Object.prototype.hasOwnProperty.call(i,c)){if(u[c]=i[c],void 0===n[c])continue;u[c]=n[c]}s.body=u,r=this._getUplinkData(s)}else r=this._getUplinkData(o);return r}},{key:"_getUplinkData",value:function(e){var t=this._requestDataCleaner(e),n=Gd(t.head),o=wy(t.body,this._getRequestKeyMap(n));return t.body=o,t}},{key:"_updateService",value:function(e,t){var n=Gd(t.head);if(t.head.servcmd.includes(bc.NAME.GROUP)){var o=e.type,r=e.groupID,a=void 0===r?void 0:r,s=e.groupIDList,i=void 0===s?[]:s;ed(a)&&(a=i[0]||""),Id({type:o,groupID:a})&&(t.head.servcmd="".concat(bc.NAME.GROUP_COMMUNITY,".").concat(n))}return t}},{key:"_getRequestKeyMap",value:function(e){var n=this.getKeyMap(e);return t(t({},ky.request),n.request)}},{key:"_requestDataCleaner",value:function(e){var t=Array.isArray(e)?[]:Object.create(null);for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&ad(o)&&null!==e[o]&&void 0!==e[o]&&("object"!==n(e[o])?t[o]=e[o]:t[o]=this._requestDataCleaner.bind(this)(e[o]));return t}},{key:"_simpleDeepCopy",value:function(e){for(var t,n=Object.keys(e),o={},r=0,a=n.length;r<a;r++)t=n[r],$l(e[t])?o[t]=Array.from(e[t]):Ql(e[t])?o[t]=this._simpleDeepCopy(e[t]):o[t]=e[t];return o}}]),e}(),cC=[$_],lC=function(){function e(t){r(this,e),this._sessionModule=t,this._className="DownlinkHandler",this._eventHandlerMap=new Map,this._eventHandlerMap.set("C2CMessageArray",this._c2cMessageArrayHandler.bind(this)),this._eventHandlerMap.set("groupMessageArray",this._groupMessageArrayHandler.bind(this)),this._eventHandlerMap.set("groupTips",this._groupTipsHandler.bind(this)),this._eventHandlerMap.set("C2CNotifyMessageArray",this._C2CNotifyMessageArrayHandler.bind(this)),this._eventHandlerMap.set("C2CReadReceiptArray",this._C2CReadReceiptArrayHandler.bind(this)),this._eventHandlerMap.set("profileModify",this._profileHandler.bind(this)),this._eventHandlerMap.set("friendListMod",this._relationChainHandler.bind(this)),this._eventHandlerMap.set("recentContactMod",this._recentContactHandler.bind(this)),this._eventHandlerMap.set("readAllC2CMessage",this._allMessageReadHandler.bind(this)),this._eventHandlerMap.set("c2cMessageModified",this._c2cMessageModifiedHandler.bind(this)),this._eventHandlerMap.set("groupMessageModified",this._groupMessageModifiedHandler.bind(this)),this._eventHandlerMap.set("userStatusList",this._userStatusListHandler.bind(this)),this._keys=y(this._eventHandlerMap.keys())}return i(e,[{key:"_c2cMessageArrayHandler",value:function(e){var t=this._sessionModule.getModule(og);t&&(e.dataList.forEach((function(e){if(1===e.isSyncMessage){var t=e.from;e.from=e.to,e.to=t}})),1===e.needSync&&this._sessionModule.getModule(fg).startOnlineSync(),t.onNewC2CMessage({dataList:e.dataList,isInstantMessage:!0}))}},{key:"_c2cMessageModifiedHandler",value:function(e){var t=this._sessionModule.getModule(og);t&&t.onC2CMessageModified(e)}},{key:"_groupMessageArrayHandler",value:function(e){var t=this._sessionModule.getModule(rg);t&&t.onNewGroupMessage({event:e.event,dataList:e.dataList,isInstantMessage:!0})}},{key:"_groupMessageModifiedHandler",value:function(e){var t=this._sessionModule.getModule(rg);t&&t.onGroupMessageModified(e)}},{key:"_groupTipsHandler",value:function(e){var t=this._sessionModule.getModule(rg);if(t){var n=e.event,o=e.dataList,r=e.isInstantMessage,a=void 0===r||r,s=e.isSyncingEnded;switch(n){case 4:case 6:t.onNewGroupTips({event:n,dataList:o});break;case 5:o.forEach((function(e){$l(e.elements.revokedInfos)?t.onGroupMessageRevoked({dataList:o}):$l(e.elements.groupMessageReadNotice)?t.onGroupMessageReadNotice({dataList:o}):$l(e.elements.readReceiptList)?t.onReadReceiptList({dataList:o}):t.onNewGroupSystemNotice({dataList:o,isInstantMessage:a,isSyncingEnded:s})}));break;case 12:this._sessionModule.getModule(ug).onNewGroupAtTips({dataList:o});break;default:wl.log("".concat(this._className,"._groupTipsHandler unknown event:").concat(n," dataList:"),o)}}}},{key:"_C2CNotifyMessageArrayHandler",value:function(e){var t=this,n=e.dataList;if($l(n)){var o=this._sessionModule.getModule(og);n.forEach((function(e){if(Zl(e))if(e.hasOwnProperty("kickoutMsgNotify")){var r=e.kickoutMsgNotify,a=r.kickType,s=r.newInstanceInfo,i=void 0===s?{}:s;1===a?t._sessionModule.onMultipleAccountKickedOut(i):2===a?t._sessionModule.onMultipleDeviceKickedOut(i):3===a&&t._sessionModule.onRestApiKickedOut(i)}else e.hasOwnProperty("c2cMessageRevokedNotify")?o&&o.onC2CMessageRevoked({dataList:n}):e.hasOwnProperty("c2cMessageReadReceipt")?o&&o.onC2CMessageReadReceipt({dataList:n}):e.hasOwnProperty("c2cMessageReadNotice")?o&&o.onC2CMessageReadNotice({dataList:n}):e.hasOwnProperty("muteNotificationsSync")&&t._sessionModule.getModule(ug).onC2CMessageRemindTypeSynced({dataList:n})}))}}},{key:"_C2CReadReceiptArrayHandler",value:function(e){this._sessionModule.getModule(og).onReadReceiptList(e)}},{key:"_profileHandler",value:function(e){this._sessionModule.getModule(ng).onProfileModified({dataList:e.dataList});var t=this._sessionModule.getModule(ag);t&&t.onFriendProfileModified({dataList:e.dataList})}},{key:"_relationChainHandler",value:function(e){this._sessionModule.getModule(ng).onRelationChainModified({dataList:e.dataList});var t=this._sessionModule.getModule(ag);t&&t.onRelationChainModified({dataList:e.dataList})}},{key:"_recentContactHandler",value:function(e){var t=e.dataList;if($l(t)){var n=this._sessionModule.getModule(ug);n&&t.forEach((function(e){var t=e.pushType;if(1===t){var o=e.recentContactDeleteItem;n.onConversationDeleted(o.recentContactList)}else if(2===t){var r=e.recentContactTopItem;n.onConversationPinned(r.recentContactList)}else if(3===t){var a=e.recentContactTopItem;n.onConversationUnpinned(a.recentContactList)}else if(4===t){var s=e.recentContactMarkContact;n.onConversationMarkUpdated(s.recentContactMarkContactItem)}else if(5===t){var i=e.recentContactCreateContactGroup;n.onConversationGroupCreated(i.msgContactGroupContactItem)}else if(6===t){var u=e.recentContactDelContactGroup;n.onConversationGroupDeleted(u.msgGroupItem)}else if(7===t){var c=e.recentContactUpdateContactGroup,l=c.msgUpdateGroup.updateGroupType;1===l?n.onConversationGroupNameUpdated(c.msgUpdateGroup):2===l&&n.onConversationInGroupUpdated(c.msgUpdateGroup)}}))}}},{key:"_allMessageReadHandler",value:function(e){var t=e.dataList,n=this._sessionModule.getModule(ug);n&&n.onPushedAllMessageRead(t)}},{key:"_userStatusListHandler",value:function(e){this._sessionModule.getModule(ng).onUserStatusUpdated(e)}},{key:"onMessage",value:function(e){var t=this,n=e.body;if(this._filterMessageFromIMOpenPush(e)){var o=n.eventArray,r=n.isInstantMessage,a=n.isSyncingEnded,s=n.needSync;if($l(o))for(var i=null,u=null,c=0,l=0,d=o.length;l<d;l++){c=(i=o[l]).event;var p=Object.keys(i).find((function(e){return-1!==t._keys.indexOf(e)}));p?(u=14===c?{readAllC2CMessage:i[p],groupMessageReadInfoList:i.groupMessageReadNotice||[]}:16===c?{userID:i.userID,readReceiptList:i[p]}:i[p],this._eventHandlerMap.get(p)({event:c,dataList:u,isInstantMessage:r,isSyncingEnded:a,needSync:s})):wl.log("".concat(this._className,".onMessage unknown eventItem:").concat(i))}}}},{key:"_filterMessageFromIMOpenPush",value:function(e){var t=e.head,n=e.body,o=t.servcmd,r=!1;if(ed(o)||(r=o.includes(bc.NAME.IM_CONFIG_MANAGER)||o.includes(bc.NAME.OVERLOAD_PUSH)||o.includes(bc.NAME.STAT_SERVICE)),!r)return!0;if(o.includes(bc.CMD.PUSHED_CLOUD_CONTROL_CONFIG))this._sessionModule.getModule(yg).onPushedCloudControlConfig(n);else if(o.includes(bc.CMD.PUSHED_COMMERCIAL_CONFIG))this._sessionModule.getModule(Cg).onPushedConfig(n);else if(o.includes(bc.CMD.OVERLOAD_NOTIFY))this._sessionModule.onPushedServerOverload(n);else if(o.includes(bc.CMD.KICK_OTHER)){var a=Date.now();this._sessionModule.reLoginOnKickOther();var s=new Uh(bh.KICK_OTHER),i=this._sessionModule.getModule(eg).getLastWsHelloTs(),u=a-i;s.setMessage("last wshello time:".concat(i," diff:").concat(u,"ms")).setNetworkType(this._sessionModule.getNetworkType()).end()}return!1}}]),e}(),dC=[{cmd:bc.CMD.GET_GROUP_INFO,interval:1,count:20},{cmd:bc.CMD.GET_AVCHATROOM_MEMBER_LIST,interval:3,count:1},{cmd:bc.CMD.GET_TOPIC_LIST,interval:1,count:10},{cmd:bc.CMD.SET_GROUP_ATTRIBUTES,interval:5,count:10},{cmd:bc.CMD.MODIFY_GROUP_ATTRIBUTES,interval:5,count:10},{cmd:bc.CMD.DELETE_GROUP_ATTRIBUTES,interval:5,count:10},{cmd:bc.CMD.CLEAR_GROUP_ATTRIBUTES,interval:5,count:10},{cmd:bc.CMD.GET_GROUP_ATTRIBUTES,interval:5,count:20},{cmd:bc.CMD.SET_ALL_MESSAGE_READ,interval:1,count:1},{cmd:bc.CMD.GET_USER_STATUS,interval:5,count:20},{cmd:bc.CMD.SUBSCRIBE_USER_STATUS,interval:5,count:20},{cmd:bc.CMD.UNSUBSCRIBE_USER_STATUS,interval:5,count:20}],pC=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._className="SessionModule",o._platform=o.getPlatform(),o._protocolHandler=new uC(f(o)),o._messageDispatcher=new lC(f(o)),o._commandFrequencyLimitMap=new Map,o._commandRequestInfoMap=new Map,o._serverOverloadInfoMap=new Map,o._init(),o.getInnerEmitterInstance().on(_M,o._onCloudConfigUpdated,f(o)),o}return i(n,[{key:"_init",value:function(){this._updateCommandFrequencyLimitMap(dC)}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("cmd_frequency_limit");ed(e)||(e=JSON.parse(e),this._updateCommandFrequencyLimitMap(e))}},{key:"_updateCommandFrequencyLimitMap",value:function(e){var t=this;e.forEach((function(e){t._commandFrequencyLimitMap.set(e.cmd,{interval:e.interval,count:e.count})}))}},{key:"updateProtocolConfig",value:function(){this._protocolHandler.update()}},{key:"request",value:function(e){wl.debug("".concat(this._className,".request options:"),e);var t=e.protocolName,n=e.tjgID;if(!this._protocolHandler.has(t))return wl.warn("".concat(this._className,".request unknown protocol:").concat(t)),Xv({code:Mh.CANNOT_FIND_PROTOCOL,message:yh.CANNOT_FIND_PROTOCOL});var o=this.getProtocolData(e),r=o.head.servcmd;if(this._isFrequencyOverLimit(r))return Xv({code:Mh.OVER_FREQUENCY_LIMIT,message:yh.OVER_FREQUENCY_LIMIT});if(this._isServerOverload(r))return Xv({code:Mh.OPEN_SERVICE_OVERLOAD_ERROR,message:yh.OPEN_SERVICE_OVERLOAD_ERROR});Bd(n)||(o.head.tjgID=n);var a=this.getModule(vg);return cC.includes(t)?a.simplySend(o):a.send(o)}},{key:"getKeyMap",value:function(e){return this._protocolHandler.getKeyMap(e)}},{key:"genCommonHead",value:function(){var e=this.getModule(cg);return{ver:"v4",platform:this._platform,websdkappid:Oc,websdkversion:Nc,a2:e.getA2Key()||void 0,tinyid:e.getTinyID()||void 0,status_instid:e.getStatusInstanceID(),sdkappid:e.getSDKAppID(),contenttype:e.getContentType(),reqtime:0,identifier:e.getA2Key()?void 0:e.getUserID(),usersig:e.getA2Key()?void 0:e.getUserSig(),sdkability:11827,tjgID:""}}},{key:"genCosSpecifiedHead",value:function(){var e=this.getModule(cg);return{ver:"v4",platform:this._platform,websdkappid:Oc,websdkversion:Nc,sdkappid:e.getSDKAppID(),contenttype:e.getContentType(),reqtime:0,identifier:e.getUserID(),usersig:e.getUserSig(),status_instid:e.getStatusInstanceID(),sdkability:11827}}},{key:"genSSOReportHead",value:function(){var e=this.getModule(cg);return{ver:"v4",platform:this._platform,websdkappid:Oc,websdkversion:Nc,sdkappid:e.getSDKAppID(),contenttype:"",reqtime:0,identifier:"",usersig:"",status_instid:e.getStatusInstanceID(),sdkability:11827}}},{key:"getProtocolData",value:function(e){return this._protocolHandler.getProtocolData(e)}},{key:"onErrorCodeNotZero",value:function(e){var t=e.errorCode;if(t===Mh.HELLO_ANSWER_KICKED_OUT){var n=e.kickType,o=e.newInstanceInfo,r=void 0===o?{}:o;1===n?this.onMultipleAccountKickedOut(r):2===n?this.onMultipleDeviceKickedOut(r):3===n&&this.onRestApiKickedOut(r)}t!==Mh.MESSAGE_A2KEY_EXPIRED&&t!==Mh.ACCOUNT_A2KEY_EXPIRED||(this._onUserSigExpired(),this.getModule(vg).reConnect())}},{key:"onMessage",value:function(e){var t=e.body,n=t.needAck,o=void 0===n?0:n,r=t.sessionData;1===o&&this._sendACK(r),this._messageDispatcher.onMessage(e)}},{key:"onReconnected",value:function(){this._reLoginOnReconnected()}},{key:"reLoginOnKickOther",value:function(){wl.log("".concat(this._className,".reLoginOnKickOther")),this._reLogin()}},{key:"_reLoginOnReconnected",value:function(){wl.log("".concat(this._className,"._reLoginOnReconnected")),this._reLogin()}},{key:"_reLogin",value:function(){var e=this;if(this.isLoggedIn()){var t=0,n=this.getModule(Sg);n.canIUseOfflinePush()&&(t=n.getUniAppPlatform()),this.request({protocolName:Dg,requestData:{isWebUniapp:t}}).then((function(t){var n=t.data.instanceID;e.getModule(cg).setStatusInstanceID(n),wl.log("".concat(e._className,"._reLogin ok. start to sync unread messages")),e.getModule(fg).startSyncOnReconnected(),e.getModule(ug).syncConversationList(),e.getModule(Tg).startPull(),e.getModule(rg).updateLocalMainSequenceOnReconnected();var o=e.getModule(ig);o.resetGetTopicTime(),o.getTopicListOnReconnected()}))}}},{key:"onMultipleAccountKickedOut",value:function(e){this.getModule(eg).onMultipleAccountKickedOut(e)}},{key:"onMultipleDeviceKickedOut",value:function(e){this.getModule(eg).onMultipleDeviceKickedOut(e)}},{key:"_onUserSigExpired",value:function(){this.getModule(eg).onUserSigExpired()}},{key:"onRestApiKickedOut",value:function(e){this.getModule(eg).onRestApiKickedOut(e)}},{key:"_sendACK",value:function(e){this.request({protocolName:$_,requestData:{sessionData:e}})}},{key:"_isFrequencyOverLimit",value:function(e){var t=e.split(".")[1];if(!this._commandFrequencyLimitMap.has(t))return!1;if(!this._commandRequestInfoMap.has(t))return this._commandRequestInfoMap.set(t,{startTime:Date.now(),requestCount:1}),!1;var n=this._commandFrequencyLimitMap.get(t),o=n.count,r=n.interval,a=this._commandRequestInfoMap.get(t),s=a.startTime,i=a.requestCount;if(Date.now()-s>1e3*r)return this._commandRequestInfoMap.set(t,{startTime:Date.now(),requestCount:1}),!1;i+=1,this._commandRequestInfoMap.set(t,{startTime:s,requestCount:i});var u=!1;return i>o&&(u=!0),u}},{key:"_isServerOverload",value:function(e){if(!this._serverOverloadInfoMap.has(e))return!1;var t=this._serverOverloadInfoMap.get(e),n=t.overloadTime,o=t.waitingTime,r=!1;return Date.now()-n<=1e3*o?r=!0:(this._serverOverloadInfoMap.delete(e),r=!1),r}},{key:"onPushedServerOverload",value:function(e){var t=e.overloadCommand,n=e.waitingTime;this._serverOverloadInfoMap.set(t,{overloadTime:Date.now(),waitingTime:n}),wl.warn("".concat(this._className,".onPushedServerOverload waitingTime:").concat(n,"s"))}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._updateCommandFrequencyLimitMap(dC),this._commandRequestInfoMap.clear(),this._serverOverloadInfoMap.clear()}}]),n}(Ag),gC=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._className="MessageLossDetectionModule",o._maybeLostSequencesMap=new Map,o._firstRoundRet=[],o}return i(n,[{key:"onMessageMaybeLost",value:function(e,t,n){this._maybeLostSequencesMap.has(e)||this._maybeLostSequencesMap.set(e,[]);for(var o=this._maybeLostSequencesMap.get(e),r=0;r<n;r++)-1===o.indexOf(t+r)&&o.push(t+r)}},{key:"detectFirstRound",value:function(e,t){var n=this._maybeLostSequencesMap.get(e);if(!Bd(n)&&!Bd(t)){var o=n.filter((function(e){return-1===t.indexOf(e)}));0===o.length?wl.info("".concat(this._className,".detectFirstRound no message loss. conversationID:").concat(e)):this._firstRoundRet=this._firstRoundRet.concat(o),n.length=0}}},{key:"detectSecondRound",value:function(e,t){if(!Bd(this._firstRoundRet)&&!Bd(t)){var n=this._firstRoundRet.filter((function(e){return-1===t.indexOf(e)}));this._firstRoundRet.length=0;var o,r=n.length;0!==r&&(r<=5?o=e+"-"+n.join("-"):(n.sort((function(e,t){return e-t})),o=e+" start:"+n[0]+" end:"+n[r-1]+" count:"+r),new Uh(bh.MESSAGE_LOSS).setMessage(o).setNetworkType(this.getNetworkType()).setLevel("warning").end(),wl.info("".concat(this._className,".detectSecondRound message loss detected. conversationID:").concat(e," lostSequences:").concat(n)))}}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._maybeLostSequencesMap.clear(),this._firstRoundRet.length=0}}]),n}(Ag),_C=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._className="CloudControlModule",o._cloudConfig=new Map,o._expiredTime=0,o._version=0,o._isFetching=!1,o}return i(n,[{key:"getCloudConfig",value:function(e){return ed(e)?this._cloudConfig:this._cloudConfig.has(e)?this._cloudConfig.get(e):void 0}},{key:"_canFetchConfig",value:function(){return this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime}},{key:"fetchConfig",value:function(){var e=this,t=this._canFetchConfig();if(wl.log("".concat(this._className,".fetchConfig canFetchConfig:").concat(t)),t){var n=new Uh(bh.FETCH_CLOUD_CONTROL_CONFIG),o=this.getModule(cg).getSDKAppID();this._isFetching=!0,this.request({protocolName:oh,requestData:{SDKAppID:o,version:this._version}}).then((function(t){e._isFetching=!1,n.setMessage("version:".concat(e._version," newVersion:").concat(t.data.version," config:").concat(t.data.cloudControlConfig)).setNetworkType(e.getNetworkType()).end(),wl.log("".concat(e._className,".fetchConfig ok")),e._parseCloudControlConfig(t.data)})).catch((function(t){e._isFetching=!1,e.probeNetwork().then((function(e){var o=M(e,2),r=o[0],a=o[1];n.setError(t,r,a).end()})),wl.log("".concat(e._className,".fetchConfig failed. error:"),t),e._setExpiredTimeOnResponseError(12e4)}))}}},{key:"onPushedCloudControlConfig",value:function(e){wl.log("".concat(this._className,".onPushedCloudControlConfig")),new Uh(bh.PUSHED_CLOUD_CONTROL_CONFIG).setNetworkType(this.getNetworkType()).setMessage("newVersion:".concat(e.version," config:").concat(e.cloudControlConfig)).end(),this._parseCloudControlConfig(e)}},{key:"onCheckTimer",value:function(e){this._canFetchConfig()&&this.fetchConfig()}},{key:"_parseCloudControlConfig",value:function(e){var t=this,n="".concat(this._className,"._parseCloudControlConfig"),o=e.errorCode,r=e.errorMessage,a=e.cloudControlConfig,s=e.version,i=e.expiredTime;if(0===o){if(this._version!==s){var u=null;try{u=JSON.parse(a)}catch(kC){wl.error("".concat(n," JSON parse error:").concat(a))}u&&(this._cloudConfig.clear(),Object.keys(u).forEach((function(e){t._cloudConfig.set(e,u[e])})),this._version=s,this.emitInnerEvent(_M))}this._expiredTime=Date.now()+1e3*i}else ed(o)?(wl.log("".concat(n," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(wl.error("".concat(n," errorCode:").concat(o," errorMessage:").concat(r)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}]),n}(Ag),hC=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._className="PullGroupMessageModule",o._remoteLastMessageSequenceMap=new Map,o.PULL_LIMIT_COUNT=15,o}return i(n,[{key:"startPull",value:function(){var e=this,t=this._getNeedPullConversationList();this._getRemoteLastMessageSequenceList().then((function(){var n=e.getModule(ug);t.forEach((function(t){var o=t.conversationID,r=o.replace(hr.CONV_GROUP,""),a=n.getGroupLocalLastMessageSequence(o),s=e._remoteLastMessageSequenceMap.get(r)||0,i=s-a;wl.log("".concat(e._className,".startPull groupID:").concat(r," localLastMessageSequence:").concat(a," ")+"remoteLastMessageSequence:".concat(s," diff:").concat(i)),a>0&&i>=1&&i<300&&e._pullMissingMessage({groupID:r,localLastMessageSequence:a,remoteLastMessageSequence:s,diff:i})}))}))}},{key:"_getNeedPullConversationList",value:function(){return this.getModule(ug).getLocalConversationList().filter((function(e){return e.type===hr.CONV_GROUP&&e.groupProfile.type!==hr.GRP_AVCHATROOM}))}},{key:"_getRemoteLastMessageSequenceList",value:function(){var e=this;return this.getModule(rg).getGroupList().then((function(t){for(var n=t.data.groupList,o=void 0===n?[]:n,r=0;r<o.length;r++){var a=o[r],s=a.groupID,i=a.nextMessageSeq;if(a.type!==hr.GRP_AVCHATROOM){var u=i-1;e._remoteLastMessageSequenceMap.set(s,u)}}}))}},{key:"_pullMissingMessage",value:function(e){var t=this,n=e.localLastMessageSequence,o=e.remoteLastMessageSequence,r=e.diff;e.count=r>this.PULL_LIMIT_COUNT?this.PULL_LIMIT_COUNT:r,e.sequence=r>this.PULL_LIMIT_COUNT?n+this.PULL_LIMIT_COUNT:n+r,this._getGroupMissingMessage(e).then((function(a){a.length>0&&(a[0].sequence+1<=o&&(e.localLastMessageSequence=n+t.PULL_LIMIT_COUNT,e.diff=r-t.PULL_LIMIT_COUNT,t._pullMissingMessage(e)),t.getModule(rg).onNewGroupMessage({dataList:a,isInstantMessage:!1}))}))}},{key:"_getGroupMissingMessage",value:function(e){var t=this,n=new Uh(bh.GET_GROUP_MISSING_MESSAGE);return this.request({protocolName:T_,requestData:{groupID:e.groupID,count:e.count,sequence:e.sequence}}).then((function(o){var r=o.data.messageList,a=void 0===r?[]:r;return n.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(e.groupID," count:").concat(e.count," sequence:").concat(e.sequence," messageList length:").concat(a.length)).end(),a})).catch((function(e){t.probeNetwork().then((function(t){var o=M(t,2),r=o[0],a=o[1];n.setError(e,r,a).end()}))}))}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._remoteLastMessageSequenceMap.clear()}}]),n}(Ag),fC=function(){function e(){r(this,e),this._className="AvgE2EDelay",this._e2eDelayArray=[]}return i(e,[{key:"addMessageDelay",value:function(e){var t=Gl()-e;t>=0&&this._e2eDelayArray.push(t)}},{key:"_calcAvg",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),Pd(n/t,1)}},{key:"_calcCountWithLimit",value:function(e){var t=e.e2eDelayArray,n=e.min,o=e.max;return t.filter((function(e){return n<=e&&e<o})).length}},{key:"_calcPercent",value:function(e,t){var n=Pd(e/t*100,2);return n>100&&(n=100),n}},{key:"_checkE2EDelayException",value:function(e,t){var n=e.filter((function(e){return e>t}));if(n.length>0){var o=n.length,r=Math.min.apply(Math,y(n)),a=Math.max.apply(Math,y(n)),s=this._calcAvg(n,o),i=Pd(o/e.length*100,2);i>50&&new Uh(bh.MESSAGE_E2E_DELAY_EXCEPTION).setMessage("message e2e delay exception. count:".concat(o," min:").concat(r," max:").concat(a," avg:").concat(s," percent:").concat(i)).setLevel("warning").end()}}},{key:"getStatResult",value:function(){var e=this._e2eDelayArray.length;if(0===e)return null;var t=y(this._e2eDelayArray),n=this._calcCountWithLimit({e2eDelayArray:t,min:0,max:1}),o=this._calcCountWithLimit({e2eDelayArray:t,min:1,max:3}),r=this._calcPercent(n,e),a=this._calcPercent(o,e),s=this._calcAvg(t,e);return this._checkE2EDelayException(t,3),t.length=0,this.reset(),{totalCount:e,countLessThan1Second:n,percentOfCountLessThan1Second:r,countLessThan3Second:o,percentOfCountLessThan3Second:a,avgDelay:s}}},{key:"reset",value:function(){this._e2eDelayArray.length=0}}]),e}(),mC=function(){function e(){r(this,e),this._className="AvgRTT",this._requestCount=0,this._rttArray=[]}return i(e,[{key:"addRequestCount",value:function(){this._requestCount+=1}},{key:"addRTT",value:function(e){this._rttArray.push(e)}},{key:"_calcTotalCount",value:function(){return this._requestCount}},{key:"_calcRTTCount",value:function(e){return e.length}},{key:"_calcSuccessRateOfRequest",value:function(e,t){if(0===t)return 0;var n=Pd(e/t*100,2);return n>100&&(n=100),n}},{key:"_calcAvg",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),parseInt(n/t)}},{key:"_calcMax",value:function(){return Math.max.apply(Math,y(this._rttArray))}},{key:"_calcMin",value:function(){return Math.min.apply(Math,y(this._rttArray))}},{key:"getStatResult",value:function(){var e=this._calcTotalCount(),t=y(this._rttArray);if(0===e)return null;var n=this._calcRTTCount(t),o=this._calcSuccessRateOfRequest(n,e),r=this._calcAvg(t,n);return wl.log("".concat(this._className,".getStatResult max:").concat(this._calcMax()," min:").concat(this._calcMin()," avg:").concat(r)),this.reset(),{totalCount:e,rttCount:n,successRateOfRequest:o,avgRTT:r}}},{key:"reset",value:function(){this._requestCount=0,this._rttArray.length=0}}]),e}(),vC=function(){function e(){r(this,e),this._map=new Map}return i(e,[{key:"initMap",value:function(e){var t=this;e.forEach((function(e){t._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}))}},{key:"addTotalCount",value:function(e){return!(ed(e)||!this._map.has(e))&&(this._map.get(e).totalCount+=1,!0)}},{key:"addSuccessCount",value:function(e){return!(ed(e)||!this._map.has(e))&&(this._map.get(e).successCount+=1,!0)}},{key:"addFailedCountOfUserSide",value:function(e){return!(ed(e)||!this._map.has(e))&&(this._map.get(e).failedCountOfUserSide+=1,!0)}},{key:"addCost",value:function(e,t){return!(ed(e)||!this._map.has(e))&&(this._map.get(e).costArray.push(t),!0)}},{key:"addFileSize",value:function(e,t){return!(ed(e)||!this._map.has(e))&&(this._map.get(e).fileSizeArray.push(t),!0)}},{key:"_calcSuccessRateOfBusiness",value:function(e){if(ed(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=Pd(t.successCount/t.totalCount*100,2);return n>100&&(n=100),n}},{key:"_calcSuccessRateOfPlatform",value:function(e){if(ed(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=this._calcSuccessCountOfPlatform(e)/t.totalCount*100;return(n=Pd(n,2))>100&&(n=100),n}},{key:"_calcTotalCount",value:function(e){return ed(e)||!this._map.has(e)?-1:this._map.get(e).totalCount}},{key:"_calcSuccessCountOfBusiness",value:function(e){return ed(e)||!this._map.has(e)?-1:this._map.get(e).successCount}},{key:"_calcSuccessCountOfPlatform",value:function(e){if(ed(e)||!this._map.has(e))return-1;var t=this._map.get(e);return t.successCount+t.failedCountOfUserSide}},{key:"_calcAvg",value:function(e){return ed(e)||!this._map.has(e)?-1:e===Dh?this._calcAvgSpeed(e):this._calcAvgCost(e)}},{key:"_calcAvgCost",value:function(e){var t=this._map.get(e).costArray.length;if(0===t)return 0;var n=0;return this._map.get(e).costArray.forEach((function(e){n+=e})),parseInt(n/t)}},{key:"_calcAvgSpeed",value:function(e){var t=0,n=0;return this._map.get(e).costArray.forEach((function(e){t+=e})),this._map.get(e).fileSizeArray.forEach((function(e){n+=e})),parseInt(1e3*n/t)}},{key:"getStatResult",value:function(e){var t=this._calcTotalCount(e);if(0===t)return null;var n=this._calcSuccessCountOfBusiness(e),o=this._calcSuccessRateOfBusiness(e),r=this._calcSuccessCountOfPlatform(e),a=this._calcSuccessRateOfPlatform(e),s=this._calcAvg(e);return this.reset(e),{totalCount:t,successCountOfBusiness:n,successRateOfBusiness:o,successCountOfPlatform:r,successRateOfPlatform:a,avgValue:s}}},{key:"reset",value:function(e){ed(e)?this._map.clear():this._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}}]),e}(),MC=function(){function e(){r(this,e),this._lastMap=new Map,this._currentMap=new Map}return i(e,[{key:"initMap",value:function(e){var t=this;e.forEach((function(e){t._lastMap.set(e,new Map),t._currentMap.set(e,new Map)}))}},{key:"addMessageSequence",value:function(e){var t=e.key,n=e.message;if(ed(t)||!this._lastMap.has(t)||!this._currentMap.has(t))return!1;var o=n.conversationID,r=n.sequence,a=o.replace(hr.CONV_GROUP,"");if(0===this._lastMap.get(t).size)this._addCurrentMap(e);else if(this._lastMap.get(t).has(a)){var s=this._lastMap.get(t).get(a),i=s.length-1;r>s[0]&&r<s[i]?(s.push(r),s.sort(),this._lastMap.get(t).set(a,s)):this._addCurrentMap(e)}else this._addCurrentMap(e);return!0}},{key:"_addCurrentMap",value:function(e){var t=e.key,n=e.message,o=n.conversationID,r=n.sequence,a=o.replace(hr.CONV_GROUP,"");this._currentMap.get(t).has(a)||this._currentMap.get(t).set(a,[]),this._currentMap.get(t).get(a).push(r)}},{key:"_copyData",value:function(e){if(!ed(e)){this._lastMap.set(e,new Map);var t,n=this._lastMap.get(e),o=A(this._currentMap.get(e));try{for(o.s();!(t=o.n()).done;){var r=M(t.value,2),a=r[0],s=r[1];n.set(a,s)}}catch(c){o.e(c)}finally{o.f()}n=null,this._currentMap.set(e,new Map)}}},{key:"getStatResult",value:function(e){if(ed(this._currentMap.get(e))||ed(this._lastMap.get(e)))return null;if(0===this._lastMap.get(e).size)return this._copyData(e),null;var t=0,n=0;if(this._lastMap.get(e).forEach((function(e,o){var r=y(e.values()),a=r.length,s=r[a-1]-r[0]+1;t+=s,n+=a})),0===t)return null;var o=Pd(n/t*100,2);return o>100&&(o=100),this._copyData(e),{totalCount:t,successCountOfMessageReceived:n,successRateOfMessageReceived:o}}},{key:"reset",value:function(){this._currentMap.clear(),this._lastMap.clear()}}]),e}(),yC=function(e){c(o,e);var n=v(o);function o(e){var t;r(this,o),(t=n.call(this,e))._className="QualityStatModule",t.TAG="im-ssolog-quality-stat",t.reportIndex=0,t.wholePeriod=!1,t._qualityItems=[Ih,Th,Eh,Ch,Sh,Ah,Dh,Nh,Oh,Rh],t._messageSentItems=[Eh,Ch,Sh,Ah,Dh],t._messageReceivedItems=[Nh,Oh,Rh],t.REPORT_INTERVAL=120,t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._statInfoArr=[],t._avgRTT=new mC,t._avgE2EDelay=new fC,t._rateMessageSent=new vC,t._rateMessageReceived=new MC;var a=t.getInnerEmitterInstance();return a.on(gM,t._onLoginSuccess,f(t)),a.on(_M,t._onCloudConfigUpdated,f(t)),t}return i(o,[{key:"_onLoginSuccess",value:function(){var e=this;this._rateMessageSent.initMap(this._messageSentItems),this._rateMessageReceived.initMap(this._messageReceivedItems);var t=this.getModule(lg),n=t.getItem(this.TAG,!1);!Bd(n)&&nd(n.forEach)&&(wl.log("".concat(this._className,"._onLoginSuccess.get quality stat log in storage, nums=").concat(n.length)),n.forEach((function(t){e._statInfoArr.push(t)})),t.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("q_rpt_interval"),t=this.getCloudConfig("q_rpt_sdkappid_bl"),n=this.getCloudConfig("q_rpt_tinyid_wl");ed(e)||(this.REPORT_INTERVAL=Number(e)),ed(t)||(this.REPORT_SDKAPPID_BLACKLIST=t.split(",").map((function(e){return Number(e)}))),ed(n)||(this.REPORT_TINYID_WHITELIST=n.split(","))}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&e%this.REPORT_INTERVAL==0&&(this.wholePeriod=!0,this._report())}},{key:"addRequestCount",value:function(){this._avgRTT.addRequestCount()}},{key:"addRTT",value:function(e){this._avgRTT.addRTT(e)}},{key:"addMessageDelay",value:function(e){this._avgE2EDelay.addMessageDelay(e)}},{key:"addTotalCount",value:function(e){this._rateMessageSent.addTotalCount(e)||wl.warn("".concat(this._className,".addTotalCount invalid key:"),e)}},{key:"addSuccessCount",value:function(e){this._rateMessageSent.addSuccessCount(e)||wl.warn("".concat(this._className,".addSuccessCount invalid key:"),e)}},{key:"addFailedCountOfUserSide",value:function(e){this._rateMessageSent.addFailedCountOfUserSide(e)||wl.warn("".concat(this._className,".addFailedCountOfUserSide invalid key:"),e)}},{key:"addCost",value:function(e,t){this._rateMessageSent.addCost(e,t)||wl.warn("".concat(this._className,".addCost invalid key or cost:"),e,t)}},{key:"addFileSize",value:function(e,t){this._rateMessageSent.addFileSize(e,t)||wl.warn("".concat(this._className,".addFileSize invalid key or size:"),e,t)}},{key:"addMessageSequence",value:function(e){this._rateMessageReceived.addMessageSequence(e)||wl.warn("".concat(this._className,".addMessageSequence invalid key:"),e.key)}},{key:"_getQualityItem",value:function(e){var n={},o=Gh[this.getNetworkType()];ed(o)&&(o=8);var r={qualityType:Lh[e],timestamp:Ll(),networkType:o,extension:""};switch(e){case Ih:n=this._avgRTT.getStatResult();break;case Th:n=this._avgE2EDelay.getStatResult();break;case Eh:case Ch:case Sh:case Ah:case Dh:n=this._rateMessageSent.getStatResult(e);break;case Nh:case Oh:case Rh:n=this._rateMessageReceived.getStatResult(e)}return null===n?null:t(t({},r),n)}},{key:"_report",value:function(e){var t=this,n=[],o=null;ed(e)?this._qualityItems.forEach((function(e){null!==(o=t._getQualityItem(e))&&(o.reportIndex=t.reportIndex,o.wholePeriod=t.wholePeriod,n.push(o))})):null!==(o=this._getQualityItem(e))&&(o.reportIndex=this.reportIndex,o.wholePeriod=this.wholePeriod,n.push(o)),wl.debug("".concat(this._className,"._report"),n),this._statInfoArr.length>0&&(n=n.concat(this._statInfoArr),this._statInfoArr=[]);var r=this.getModule(cg),a=r.getSDKAppID(),s=r.getTinyID();Ud(this.REPORT_SDKAPPID_BLACKLIST,a)&&!bd(this.REPORT_TINYID_WHITELIST,s)&&(n=[]),n.length>0&&this._doReport(n)}},{key:"_doReport",value:function(e){var n=this,o={header:_y(this),quality:e};this.request({protocolName:J_,requestData:t({},o)}).then((function(){n.reportIndex++,n.wholePeriod=!1})).catch((function(t){wl.warn("".concat(n._className,"._doReport, online:").concat(n.getNetworkType()," error:"),t),n._statInfoArr=n._statInfoArr.concat(e),n._flushAtOnce()}))}},{key:"_flushAtOnce",value:function(){var e=this.getModule(lg),t=e.getItem(this.TAG,!1),n=this._statInfoArr;if(Bd(t))wl.log("".concat(this._className,"._flushAtOnce count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var o=n.concat(t);o.length>10&&(o=o.slice(0,10)),wl.log("".concat(this.className,"._flushAtOnce count:").concat(o.length)),e.setItem(this.TAG,o,!0,!1)}this._statInfoArr=[]}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._report(),this.reportIndex=0,this.wholePeriod=!1,this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[],this._avgRTT.reset(),this._avgE2EDelay.reset(),this._rateMessageSent.reset(),this._rateMessageReceived.reset()}}]),o}(Ag),IC=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._className="WorkerTimerModule",o._isWorkerEnabled=!0,o._workerTimer=null,o._init(),o.getInnerEmitterInstance().on(_M,o._onCloudConfigUpdated,f(o)),o}return i(n,[{key:"isWorkerEnabled",value:function(){return this._isWorkerEnabled&&pl}},{key:"startWorkerTimer",value:function(){wl.log("".concat(this._className,".startWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("start")}},{key:"stopWorkerTimer",value:function(){wl.log("".concat(this._className,".stopWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("stop")}},{key:"_init",value:function(){if(pl){var e=URL.createObjectURL(new Blob(['let interval = -1;onmessage = function(event) { if (event.data === "start") { if (interval > 0) { clearInterval(interval); } interval = setInterval(() => { postMessage(""); }, 1000) } else if (event.data === "stop") { clearInterval(interval); interval = -1; }};'],{type:"application/javascript; charset=utf-8"}));this._workerTimer=new Worker(e);var t=this;this._workerTimer.onmessage=function(){t._moduleManager.onCheckTimer()}}}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("enable_worker");wl.log("".concat(this._className,"._onCloudConfigUpdated enableWorker:").concat(e)),ed(e)||"1"===e?!this._isWorkerEnabled&&pl&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._moduleManager.onWorkerTimerEnabled()):this._isWorkerEnabled&&pl&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._moduleManager.onWorkerTimerDisabled())}},{key:"terminate",value:function(){wl.log("".concat(this._className,".terminate")),this._workerTimer&&(this._workerTimer.terminate(),this._workerTimer=null)}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset"))}}]),n}(Ag),TC=function(){function e(){r(this,e),this._className="PurchasedFeatureHandler",this._purchasedFeatureMap=new Map}return i(e,[{key:"isValidPurchaseBits",value:function(e){return e&&"string"==typeof e&&e.length>=1&&e.length<=64&&/[01]{1,64}/.test(e)}},{key:"parsePurchaseBits",value:function(e){var t="".concat(this._className,".parsePurchaseBits");if(this.isValidPurchaseBits(e)){this._purchasedFeatureMap.clear();for(var n=null,o=e.length-1,r=0;o>=0;o--,r++)n=r<32?new Sc(0,Math.pow(2,r)).toString():new Sc(Math.pow(2,r-32),0).toString(),"1"===e[o]?this._purchasedFeatureMap.set(n,!0):this._purchasedFeatureMap.set(n,!1)}else wl.warn("".concat(t," invalid purchase bits:").concat(e))}},{key:"hasPurchasedFeature",value:function(e){return!!this._purchasedFeatureMap.get(e)}},{key:"isFeatureEnabled",value:function(e){for(var t=parseInt(e).toString(2),n=void 0,o=!0,r=t.length-1,a=0;r>=0;r--,a++)if("1"===t.charAt(r)&&(n=a<32?new Sc(0,Math.pow(2,a)).toString():new Sc(Math.pow(2,a-32),0).toString(),!this._purchasedFeatureMap.get(n))){o=!1;break}return wl.log("".concat(this._className,".isFeatureEnabled decimalNumber:").concat(e," binaryString:").concat(t," ret:").concat(o)),Jv({enabled:o})}},{key:"clear",value:function(){this._purchasedFeatureMap.clear()}}]),e}(),EC=function(){function e(t){r(this,e),this._moduleManager=t,this._className="CommercialConfigModule",this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler=new TC}return i(e,[{key:"_canFetch",value:function(){return this._getModule(cg).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:"onCheckTimer",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:"fetchConfig",value:function(){var e=this,t=this._canFetch(),n="".concat(this._className,".fetchConfig");if(wl.log("".concat(n," canFetch:").concat(t)),t){var o=this._getModule(pg),r=new Uh(bh.FETCH_COMMERCIAL_CONFIG);r.setNetworkType(o.getNetworkType());var a=this._getModule(cg).getSDKAppID(),s=this._getModule(mg);this._isFetching=!0,s.request({protocolName:ah,requestData:{SDKAppID:a}}).then((function(t){r.setMessage("purchaseBits:".concat(t.data.purchaseBits)).end(),wl.log("".concat(n," ok.")),e._parseConfig(t.data),e._isFetching=!1})).catch((function(t){o.probe().then((function(e){var n=M(e,2),o=n[0],a=n[1];r.setError(t,o,a).end()})),e._isFetching=!1}))}}},{key:"onPushedConfig",value:function(e){var t="".concat(this._className,".onPushedConfig");wl.log("".concat(t)),new Uh(bh.PUSHED_COMMERCIAL_CONFIG).setNetworkType(this._getModule(pg).getNetworkType()).setMessage("purchaseBits:".concat(e.purchaseBits)).end(),this._parseConfig(e)}},{key:"_parseConfig",value:function(e){var t="".concat(this._className,"._parseConfig"),n=e.errorCode,o=e.errorMessage,r=e.purchaseBits,a=e.expiredTime;0===n?(this._purchasedFeatureHandler.parsePurchaseBits(r),this._expiredTime=Date.now()+1e3*a):ed(n)?(wl.log("".concat(t," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(wl.error("".concat(t," errorCode:").concat(n," errorMessage:").concat(o)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"canIUse",value:function(e){return this._purchasedFeatureHandler.hasPurchasedFeature(e)}},{key:"isFeatureEnabled",value:function(e){return this._purchasedFeatureHandler.isFeatureEnabled(e)}},{key:"_getModule",value:function(e){return this._moduleManager.getModule(e)}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),e}(),CC=function(e){c(n,e);var t=v(n);function n(e){var o;return r(this,n),(o=t.call(this,e))._moduleManager=e,o._className="OfflinePushModule",o._offlinePushPlugin=void 0,o._androidPushConfig={huaweiPushBussinessId:"",xiaomiPushBussinessId:"",xiaomiPushAppId:"",xiaomiPushAppKey:"",meizuPushBussinessId:"",meizuPushAppId:"",meizuPushAppKey:"",vivoPushBussinessId:"",fcmPushBussinessId:"",oppoPushBussinessId:"",oppoPushAppKey:"",oppoPushAppSecret:""},o._deviceToken="",o._businessID=0,o._iosBusinessID=0,o._c2cUnreadCount=0,o._groupUnreadCount=0,o._isWebUniapp=0,o}return i(n,[{key:"registerPlugin",value:function(e){if(Hc){this._offlinePushPlugin=e["tim-offline-push-plugin"];var t=e.offlinePushConfig||{},n=t.huaweiBusinessID,o=t.xiaomiBusinessID,r=t.xiaomiAppID,a=t.xiaomiAppKey,s=t.meizuBusinessID,i=t.meizuAppID,u=t.meizuAppKey,c=t.vivoBusinessID,l=t.oppoBusinessID,d=t.oppoAppKey,p=t.oppoAppSecret,g=t.iosBusinessID;this._androidPushConfig.huaweiPushBussinessId=n,this._androidPushConfig.xiaomiPushBussinessId=o,this._androidPushConfig.xiaomiPushAppId=r,this._androidPushConfig.xiaomiPushAppKey=a,this._androidPushConfig.meizuPushBussinessId=s,this._androidPushConfig.meizuPushAppId=i,this._androidPushConfig.meizuPushAppKey=u,this._androidPushConfig.vivoPushBussinessId=c,this._androidPushConfig.oppoPushBussinessId=l,this._androidPushConfig.oppoPushAppKey=d,this._androidPushConfig.oppoPushAppSecret=p,new Uh(bh.REGISTER_PLUGIN).setMessage("tim-offline-push-plugin").end(),this._iosBusinessID=g,this._setDeviceState(),wl.log("".concat(this._className,".registerPlugin offlinePushConfig:").concat(e.offlinePushConfig))}else wl.warn("!!!离线推送插件仅支持在 uni-app 打包的 native app 环境使用")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:"_getDeviceToken",value:function(){var e=this;wl.log("".concat(this._className,"._getDeviceToken androidPushConfig:").concat(JSON.stringify(this._androidPushConfig),", iosBusinessID:").concat(this._iosBusinessID)),!ed(this._offlinePushPlugin)&&nd(this._offlinePushPlugin.getDeviceToken)&&this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,(function(t){var n=t.data,o=n.deviceToken,r=n.deviceBrand,a=n.deviceType,s=n.bussinessId;e._deviceToken=o,e._businessID=s||e._iosBusinessID,new Uh(bh.GET_DEVICE_TOKEN).setMessage("androidPushConfig:".concat(JSON.stringify(e._androidPushConfig),", deviceToken:").concat(o,", deviceBrand:").concat(r||a,", businessID:").concat(e._businessID)).end(),e._setToken()}))}},{key:"canIUseOfflinePush",value:function(){return Hc&&!ed(this._offlinePushPlugin)}},{key:"_setDeviceState",value:function(){var e=this;!ed(this._offlinePushPlugin)&&nd(this._offlinePushPlugin.setAppShowListener)&&this._offlinePushPlugin.setAppShowListener((function(t){var n=t.appShow;e._moduleManager.isReady()&&(0===n?(e._getConvUnreadCount(),e._onBackground()):1===n&&e._onForeground())}))}},{key:"getDeviceBrand",value:function(){if(!ed(this._offlinePushPlugin)&&nd(this._offlinePushPlugin.getDeviceType))return(this._offlinePushPlugin.getDeviceType()||{}).deviceType}},{key:"_setToken",value:function(){var e=this,t=this.getModule(cg),n=1,o="",r="";Bd(this._deviceToken)&&(n=0);var a=this.getUniAppPlatform(),s=this.getDeviceBrand();wl.log("".concat(this._className,".setToken platform:").concat(a)),a===Dc.IOS||a===Dc.IPAD||a===Dc.MAC?r=this._deviceToken:a===Dc.ANDROID&&(o=this._deviceToken);var i=new Uh(bh.OFFLINE_PUSH_SET_TOKEN);return i.setMessage("deviceToken:".concat(r||o,", businessID:").concat(this._businessID,", deviceBrand:").concat(s,", isWebUniapp:").concat(this._isWebUniapp,", pushMsg:").concat(n)),this.request({protocolName:vh,requestData:{tokenID:o,pushMsg:n,sdkAppID:t.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:s,deviceToken:r,isWebUniapp:this._isWebUniapp}}).then((function(t){return i.setNetworkType(e.getNetworkType()).end(),wl.log("".concat(e._className,".setToken ok")),t})).catch((function(t){return e.probeNetwork().then((function(e){var n=M(e,2),o=n[0],r=n[1];i.setError(t,o,r).end()})),wl.error("".concat(e._className,".setToken failed. error:"),t),Xv(t)}))}},{key:"_getConvUnreadCount",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.getModule(ug).getLocalConversationList().forEach((function(t){t.type===hr.CONV_C2C&&(e._c2cUnreadCount+=t.unreadCount),t.type===hr.CONV_GROUP&&(e._groupUnreadCount+=t.unreadCount)}))}},{key:"_onBackground",value:function(){var e=this;this.request({protocolName:fh,requestData:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then((function(t){return wl.log("".concat(e._className,"._onBackground ok")),t})).catch((function(t){wl.warn("".concat(e._className,"._onBackground error:"),t)}))}},{key:"_onForeground",value:function(){var e=this;this.request({protocolName:mh,requestData:{isWebUniapp:this._isWebUniapp}}).then((function(t){return wl.log("".concat(e._className,"._onForeground ok")),t})).catch((function(t){wl.warn("".concat(e._className,"._onForeground error:"),t)}))}},{key:"getUniAppPlatform",value:function(){var e=uni.getSystemInfoSync().platform,t=this.getDeviceBrand();return"ios"===e?Dc.IOS:"android"===e?Dc.ANDROID:1002===t?Dc.IPAD:1001===t?Dc.MAC:void 0}},{key:"reset",value:function(){this._deviceToken="",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,wl.log("".concat(this._className,".reset"))}}]),n}(Ag),SC=function(){function e(t){r(this,e);var n=new Uh(bh.SDK_CONSTRUCT);this._className="ModuleManager",this._isReady=!1,this._reason=Mh.USER_NOT_LOGGED_IN,this._startLoginTs=0,this._moduleMap=new Map,this._innerEmitter=null,this._outerEmitter=null,this._checkCount=0,this._checkTimer=-1,this._moduleMap.set(cg,new iy(this,t)),this._moduleMap.set(Cg,new EC(this)),this._moduleMap.set(yg,new _C(this)),this._moduleMap.set(Ig,new IC(this)),this._moduleMap.set(Eg,new yC(this)),this._moduleMap.set(vg,new aC(this)),this._moduleMap.set(mg,new pC(this)),this._moduleMap.set(eg,new uy(this)),this._moduleMap.set(tg,new Oy(this)),this._moduleMap.set(ng,new sy(this)),this._moduleMap.set(og,new Qv(this)),this._moduleMap.set(ug,new bM(this)),this._moduleMap.set(rg,new zM(this)),this._moduleMap.set(sg,new XM(this)),this._moduleMap.set(ig,new ey(this)),this._moduleMap.set(lg,new py(this)),this._moduleMap.set(dg,new hy(this)),this._moduleMap.set(pg,new yy(this)),this._moduleMap.set(gg,new Ty(this)),this._moduleMap.set(_g,new Cy(this)),this._moduleMap.set(hg,new Ry(this)),this._moduleMap.set(fg,new Ly(this)),this._moduleMap.set(Mg,new gC(this)),this._moduleMap.set(Tg,new hC(this)),this._moduleMap.set(Sg,new CC(this)),this._eventThrottleMap=new Map;var o=t.instanceID,a=t.oversea,s=t.SDKAppID,i="instanceID:".concat(o," SDKAppID:").concat(s," host:").concat(Od()," oversea:").concat(a," inBrowser:").concat(Yc," inMiniApp:").concat(Wc)+" workerAvailable:".concat(pl," UserAgent:").concat(Xc);Uh.bindEventStatModule(this._moduleMap.get(dg)),n.setMessage("".concat(i," ").concat(function(){var e="";if(Wc)try{var t=zc.getSystemInfoSync(),n=t.model,o=t.version,r=t.system,a=t.platform,s=t.SDKVersion;e="model:".concat(n," version:").concat(o," system:").concat(r," platform:").concat(a," SDKVersion:").concat(s)}catch(kC){e=""}return e}())).end(),wl.info("SDK ".concat(i)),this._readyList=void 0,this._ssoLogForReady=null,this._initReadyList()}return i(e,[{key:"_startTimer",value:function(){var e=this._moduleMap.get(Ig),t=e.isWorkerEnabled();wl.log("".concat(this._className,".startTimer isWorkerEnabled:").concat(t," seed:").concat(this._checkTimer)),t?e.startWorkerTimer():this._startMainThreadTimer()}},{key:"_startMainThreadTimer",value:function(){wl.log("".concat(this._className,"._startMainThreadTimer")),this._checkTimer<0&&(this._checkTimer=setInterval(this.onCheckTimer.bind(this),1e3))}},{key:"stopTimer",value:function(){var e=this._moduleMap.get(Ig),t=e.isWorkerEnabled();wl.log("".concat(this._className,".stopTimer isWorkerEnabled:").concat(t," seed:").concat(this._checkTimer)),t?e.stopWorkerTimer():this._stopMainThreadTimer()}},{key:"_stopMainThreadTimer",value:function(){wl.log("".concat(this._className,"._stopMainThreadTimer")),this._checkTimer>0&&(clearInterval(this._checkTimer),this._checkTimer=-1,this._checkCount=0)}},{key:"_stopMainThreadSocket",value:function(){wl.log("".concat(this._className,"._stopMainThreadSocket"));var e=this._moduleMap.get(vg);e.setIsWorkerEnabled(!0),e.reConnect()}},{key:"_startMainThreadSocket",value:function(){wl.log("".concat(this._className,"._startMainThreadSocket"));var e=this._moduleMap.get(vg);e.setIsWorkerEnabled(!1),e.reConnect()}},{key:"onWorkerTimerEnabled",value:function(){wl.log("".concat(this._className,".onWorkerTimerEnabled, disable main thread timer and socket")),this._stopMainThreadTimer(),this._stopMainThreadSocket()}},{key:"onWorkerTimerDisabled",value:function(){wl.log("".concat(this._className,".onWorkerTimerDisabled, enable main thread timer and socket")),this._startMainThreadTimer(),this._startMainThreadSocket()}},{key:"onCheckTimer",value:function(){this._checkCount+=1;var e,t=A(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=M(e.value,2)[1];n.onCheckTimer&&n.onCheckTimer(this._checkCount)}}catch(r){t.e(r)}finally{t.f()}}},{key:"_initReadyList",value:function(){var e=this;this._readyList=[this._moduleMap.get(eg),this._moduleMap.get(ug)],this._readyList.forEach((function(t){t.ready((function(){return e._onModuleReady()}))}))}},{key:"_onModuleReady",value:function(){var e=!0;if(this._readyList.forEach((function(t){t.isReady()||(e=!1)})),e&&!this._isReady){this._isReady=!0,this._outerEmitter.emit(_r.SDK_READY);var t=Date.now()-this._startLoginTs;wl.warn("SDK is ready. cost ".concat(t," ms")),this._startLoginTs=Date.now();var n=this._moduleMap.get(pg).getNetworkType(),o=this._ssoLogForReady.getStartTs()+Rl;this._ssoLogForReady.setNetworkType(n).setMessage(t).start(o).end()}}},{key:"login",value:function(){0===this._startLoginTs&&(kl(),this._startLoginTs=Date.now(),this._startTimer(),this._moduleMap.get(pg).start(),this._ssoLogForReady=new Uh(bh.SDK_READY),this._reason=Mh.LOGGING_IN)}},{key:"onLoginFailed",value:function(){this._startLoginTs=0}},{key:"getOuterEmitterInstance",value:function(){return null===this._outerEmitter&&(this._outerEmitter=new Iy,zv(this._outerEmitter),this._outerEmitter._emit=this._outerEmitter.emit,this._outerEmitter.emit=function(e,t){var n=this;if(e===_r.CONVERSATION_LIST_UPDATED||e===_r.FRIEND_LIST_UPDATED||e===_r.GROUP_LIST_UPDATED)if(this._eventThrottleMap.has(e)){var o=Date.now(),r=this._eventThrottleMap.get(e);o-r.last<1e3?(r.timeoutID&&clearTimeout(r.timeoutID),r.timeoutID=setTimeout((function(){r.last=o,n._outerEmitter._emit.apply(n._outerEmitter,[e,{name:e,data:n._getEventData(e)}])}),500)):(r.last=o,this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]))}else this._eventThrottleMap.set(e,{last:Date.now(),timeoutID:-1}),this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]);else this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:arguments[1]}])}.bind(this)),this._outerEmitter}},{key:"_getEventData",value:function(e){return e===_r.CONVERSATION_LIST_UPDATED?this._moduleMap.get(ug).getLocalConversationList():e===_r.FRIEND_LIST_UPDATED?this._moduleMap.get(ag).getLocalFriendList(!1):e===_r.GROUP_LIST_UPDATED?this._moduleMap.get(rg).getLocalGroupList():void 0}},{key:"getInnerEmitterInstance",value:function(){return null===this._innerEmitter&&(this._innerEmitter=new Iy,this._innerEmitter._emit=this._innerEmitter.emit,this._innerEmitter.emit=function(e,t){var n;Zl(arguments[1])&&arguments[1].data?(wl.warn("inner eventData has data property, please check!"),n=[e,{name:arguments[0],data:arguments[1].data}]):n=[e,{name:arguments[0],data:arguments[1]}],this._innerEmitter._emit.apply(this._innerEmitter,n)}.bind(this)),this._innerEmitter}},{key:"hasModule",value:function(e){return this._moduleMap.has(e)}},{key:"getModule",value:function(e){return this._moduleMap.get(e)}},{key:"isReady",value:function(){return this._isReady}},{key:"getNotReadyReason",value:function(){return this._reason}},{key:"setNotReadyReason",value:function(e){this._reason=e}},{key:"onError",value:function(e){wl.warn("Oops! code:".concat(e.code," message:").concat(e.message)),new Uh(bh.ERROR).setMessage("code:".concat(e.code," message:").concat(e.message)).setNetworkType(this.getModule(pg).getNetworkType()).setLevel("error").end(),this.getOuterEmitterInstance().emit(_r.ERROR,e)}},{key:"reset",value:function(){wl.log("".concat(this._className,".reset")),kl();var e,t=A(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=M(e.value,2)[1];n.reset&&n.reset()}}catch(u){t.e(u)}finally{t.f()}this._startLoginTs=0,this._initReadyList(),this._isReady=!1,this.stopTimer(),this._outerEmitter.emit(_r.SDK_NOT_READY);var o,r=A(this._eventThrottleMap);try{for(r.s();!(o=r.n()).done;){var a=M(o.value,2)[1];a.timeoutID&&clearTimeout(a.timeoutID)}}catch(u){r.e(u)}finally{r.f()}this._eventThrottleMap.clear()}}]),e}(),AC=function(){function e(){r(this,e),this._funcMap=new Map}return i(e,[{key:"defense",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if("string"!=typeof e)return null;if(0===e.length)return null;if("function"!=typeof t)return null;if(this._funcMap.has(e)&&this._funcMap.get(e).has(t))return this._funcMap.get(e).get(t);this._funcMap.has(e)||this._funcMap.set(e,new Map);var o=null;return this._funcMap.get(e).has(t)?o=this._funcMap.get(e).get(t):(o=this._pack(e,t,n),this._funcMap.get(e).set(t,o)),o}},{key:"defenseOnce",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return"function"!=typeof t?null:this._pack(e,t,n)}},{key:"find",value:function(e,t){return"string"!=typeof e||0===e.length||"function"!=typeof t?null:this._funcMap.has(e)?this._funcMap.get(e).has(t)?this._funcMap.get(e).get(t):(wl.log("SafetyCallback.find: 找不到 func —— ".concat(e,"/").concat(""!==t.name?t.name:"[anonymous]")),null):(wl.log("SafetyCallback.find: 找不到 eventName-".concat(e," 对应的 func")),null)}},{key:"delete",value:function(e,t){return"function"==typeof t&&!!this._funcMap.has(e)&&!!this._funcMap.get(e).has(t)&&(this._funcMap.get(e).delete(t),0===this._funcMap.get(e).size&&this._funcMap.delete(e),!0)}},{key:"_pack",value:function(e,t,n){return function(){try{t.apply(n,Array.from(arguments))}catch(u){var o=Object.values(_r).indexOf(e);if(-1!==o){var r=Object.keys(_r)[o];wl.warn("接入侧事件 TIM.EVENT.".concat(r," 对应的回调函数逻辑存在问题,请检查!"),u)}var a=new Uh(bh.CALLBACK_FUNCTION_ERROR);a.setMessage("eventName:".concat(e)).setMoreMessage(u.message).end()}}}}]),e}(),DC=function(){function e(t){r(this,e);var n={SDKAppID:t.SDKAppID,unlimitedAVChatRoom:t.unlimitedAVChatRoom||!1,scene:t.scene||"",oversea:t.oversea||!1,instanceID:Nd(),devMode:t.devMode||!1,proxyServer:t.proxyServer||void 0};this._moduleManager=new SC(n),this._safetyCallbackFactory=new AC}return i(e,[{key:"onError",value:function(e){this._moduleManager.onError(e)}},{key:"login",value:function(e){return this._moduleManager.login(),this._moduleManager.getModule(eg).login(e)}},{key:"logout",value:function(){var e=this;return this._moduleManager.getModule(eg).logout().then((function(t){return e._moduleManager.reset(),t}))}},{key:"isReady",value:function(){return this._moduleManager.isReady()}},{key:"getNotReadyReason",value:function(){return this._moduleManager.getNotReadyReason()}},{key:"destroy",value:function(){var e=this;return this.logout().finally((function(){e._moduleManager.stopTimer(),e._moduleManager.getModule(Ig).terminate(),e._moduleManager.getModule(vg).dealloc();var t=e._moduleManager.getOuterEmitterInstance(),n=e._moduleManager.getModule(cg);t.emit(_r.SDK_DESTROY,{SDKAppID:n.getSDKAppID()})}))}},{key:"on",value:function(e,t,n){e===_r.GROUP_SYSTEM_NOTICE_RECEIVED&&wl.warn("TIM.EVENT.GROUP_SYSTEM_NOTICE_RECEIVED v2.6.0起弃用,为了更好的体验,请在 TIM.EVENT.MESSAGE_RECEIVED 事件回调内接收处理群系统通知详细请参考https://web.sdk.qcloud.com/im/doc/zh-cn/Message.html#.GroupSystemNoticePayload"),wl.debug("on","eventName:".concat(e)),this._moduleManager.getOuterEmitterInstance().on(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:"once",value:function(e,t,n){wl.debug("once","eventName:".concat(e)),this._moduleManager.getOuterEmitterInstance().once(e,this._safetyCallbackFactory.defenseOnce(e,t,n),n||this)}},{key:"off",value:function(e,t,n,o){wl.debug("off","eventName:".concat(e));var r=this._safetyCallbackFactory.find(e,t);null!==r&&(this._moduleManager.getOuterEmitterInstance().off(e,r,n,o),this._safetyCallbackFactory.delete(e,t))}},{key:"registerPlugin",value:function(e){ed(e["tim-offline-push-plugin"])?this._moduleManager.getModule(hg).registerPlugin(e):this._moduleManager.getModule(Sg).registerPlugin(e)}},{key:"setLogLevel",value:function(e){wl.setLevel(e)}},{key:"createTextMessage",value:function(e){return this._moduleManager.getModule(tg).createTextMessage(e)}},{key:"createTextAtMessage",value:function(e){return this._moduleManager.getModule(tg).createTextMessage(e)}},{key:"createImageMessage",value:function(e){return this._moduleManager.getModule(tg).createImageMessage(e)}},{key:"createAudioMessage",value:function(e){return this._moduleManager.getModule(tg).createAudioMessage(e)}},{key:"createVideoMessage",value:function(e){return this._moduleManager.getModule(tg).createVideoMessage(e)}},{key:"createCustomMessage",value:function(e){return this._moduleManager.getModule(tg).createCustomMessage(e)}},{key:"createFaceMessage",value:function(e){return this._moduleManager.getModule(tg).createFaceMessage(e)}},{key:"createFileMessage",value:function(e){return this._moduleManager.getModule(tg).createFileMessage(e)}},{key:"createLocationMessage",value:function(e){return this._moduleManager.getModule(tg).createLocationMessage(e)}},{key:"createMergerMessage",value:function(e){return this._moduleManager.getModule(tg).createMergerMessage(e)}},{key:"downloadMergerMessage",value:function(e){return e.type!==hr.MSG_MERGER?Xv(new Wv({code:Mh.MESSAGE_MERGER_TYPE_INVALID,message:yh.MESSAGE_MERGER_TYPE_INVALID})):Bd(e.payload.downloadKey)?Xv(new Wv({code:Mh.MESSAGE_MERGER_KEY_INVALID,message:yh.MESSAGE_MERGER_KEY_INVALID})):this._moduleManager.getModule(tg).downloadMergerMessage(e).catch((function(e){return Xv(new Wv({code:Mh.MESSAGE_MERGER_DOWNLOAD_FAIL,message:yh.MESSAGE_MERGER_DOWNLOAD_FAIL}))}))}},{key:"createForwardMessage",value:function(e){return this._moduleManager.getModule(tg).createForwardMessage(e)}},{key:"sendMessage",value:function(e,t){return e instanceof qv?this._moduleManager.getModule(tg).sendMessageInstance(e,t):Xv(new Wv({code:Mh.MESSAGE_SEND_NEED_MESSAGE_INSTANCE,message:yh.MESSAGE_SEND_NEED_MESSAGE_INSTANCE}))}},{key:"callExperimentalAPI",value:function(e,t){return"handleGroupInvitation"===e?this._moduleManager.getModule(rg).handleGroupInvitation(t):"isCommercialAbilityEnabled"===e?this._moduleManager.getModule(Cg).isFeatureEnabled(t):Xv(new Wv({code:Mh.INVALID_OPERATION,message:yh.INVALID_OPERATION}))}},{key:"revokeMessage",value:function(e){return this._moduleManager.getModule(tg).revokeMessage(e)}},{key:"resendMessage",value:function(e){return this._moduleManager.getModule(tg).resendMessage(e)}},{key:"deleteMessage",value:function(e){return this._moduleManager.getModule(tg).deleteMessage(e)}},{key:"modifyMessage",value:function(e){return this._moduleManager.getModule(tg).modifyRemoteMessage(e)}},{key:"getMessageList",value:function(e){return this._moduleManager.getModule(ug).getMessageList(e)}},{key:"getMessageListHopping",value:function(e){return this._moduleManager.getModule(ug).getMessageListHopping(e)}},{key:"sendMessageReadReceipt",value:function(e){return this._moduleManager.getModule(ug).sendReadReceipt(e)}},{key:"getMessageReadReceiptList",value:function(e){return this._moduleManager.getModule(ug).getReadReceiptList(e)}},{key:"getGroupMessageReadMemberList",value:function(e){return this._moduleManager.getModule(rg).getReadReceiptDetail(e)}},{key:"findMessage",value:function(e){return this._moduleManager.getModule(ug).findMessage(e)}},{key:"setMessageRead",value:function(e){return this._moduleManager.getModule(ug).setMessageRead(e)}},{key:"getConversationList",value:function(e){return this._moduleManager.getModule(ug).getConversationList(e)}},{key:"getConversationProfile",value:function(e){return this._moduleManager.getModule(ug).getConversationProfile(e)}},{key:"deleteConversation",value:function(e){return this._moduleManager.getModule(ug).deleteConversation(e)}},{key:"pinConversation",value:function(e){return this._moduleManager.getModule(ug).pinConversation(e)}},{key:"setAllMessageRead",value:function(e){return this._moduleManager.getModule(ug).setAllMessageRead(e)}},{key:"setMessageRemindType",value:function(e){return this._moduleManager.getModule(ug).setMessageRemindType(e)}},{key:"setConversationCustomData",value:function(e){return this._moduleManager.getModule(ug).setConversationCustomData(e)}},{key:"markConversation",value:function(e){return this._moduleManager.getModule(ug).markConversation(e)}},{key:"getConversationGroupList",value:function(){return this._moduleManager.getModule(ug).getConversationGroupList()}},{key:"createConversationGroup",value:function(e){return this._moduleManager.getModule(ug).createConversationGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._moduleManager.getModule(ug).deleteConversationGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._moduleManager.getModule(ug).renameConversationGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._moduleManager.getModule(ug).addConversationsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._moduleManager.getModule(ug).deleteConversationsFromGroup(e)}},{key:"getMyProfile",value:function(){return this._moduleManager.getModule(ng).getMyProfile()}},{key:"getUserProfile",value:function(e){return this._moduleManager.getModule(ng).getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._moduleManager.getModule(ng).updateMyProfile(e)}},{key:"getBlacklist",value:function(){return this._moduleManager.getModule(ng).getLocalBlacklist()}},{key:"addToBlacklist",value:function(e){return this._moduleManager.getModule(ng).addBlacklist(e)}},{key:"removeFromBlacklist",value:function(e){return this._moduleManager.getModule(ng).deleteBlacklist(e)}},{key:"setSelfStatus",value:function(e){return this._moduleManager.getModule(ng).setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._moduleManager.getModule(ng).getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._moduleManager.getModule(ng).subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._moduleManager.getModule(ng).unsubscribeUserStatus(e)}},{key:"getFriendList",value:function(){var e=this._moduleManager.getModule(ag);return e?e.getLocalFriendList():Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"addFriend",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.addFriend(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"deleteFriend",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.deleteFriend(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"checkFriend",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.checkFriend(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"getFriendProfile",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.getFriendProfile(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"updateFriend",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.updateFriend(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"getFriendApplicationList",value:function(){var e=this._moduleManager.getModule(ag);return e?e.getLocalFriendApplicationList():Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"acceptFriendApplication",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.acceptFriendApplication(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"refuseFriendApplication",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.refuseFriendApplication(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"deleteFriendApplication",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.deleteFriendApplication(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"setFriendApplicationRead",value:function(){var e=this._moduleManager.getModule(ag);return e?e.setFriendApplicationRead():Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"getFriendGroupList",value:function(){var e=this._moduleManager.getModule(ag);return e?e.getLocalFriendGroupList():Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"createFriendGroup",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.createFriendGroup(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"deleteFriendGroup",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.deleteFriendGroup(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"addToFriendGroup",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.addToFriendGroup(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"removeFromFriendGroup",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.removeFromFriendGroup(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"renameFriendGroup",value:function(e){var t=this._moduleManager.getModule(ag);return t?t.renameFriendGroup(e):Xv({code:Mh.CANNOT_FIND_MODULE,message:yh.CANNOT_FIND_MODULE})}},{key:"getGroupList",value:function(e){return this._moduleManager.getModule(rg).getGroupList(e)}},{key:"getGroupProfile",value:function(e){return this._moduleManager.getModule(rg).getGroupProfile(e)}},{key:"createGroup",value:function(e){return this._moduleManager.getModule(rg).createGroup(e)}},{key:"dismissGroup",value:function(e){return this._moduleManager.getModule(rg).dismissGroup(e)}},{key:"updateGroupProfile",value:function(e){return this._moduleManager.getModule(rg).updateGroupProfile(e)}},{key:"joinGroup",value:function(e){return this._moduleManager.getModule(rg).joinGroup(e)}},{key:"quitGroup",value:function(e){return this._moduleManager.getModule(rg).quitGroup(e)}},{key:"searchGroupByID",value:function(e){return this._moduleManager.getModule(rg).searchGroupByID(e)}},{key:"getGroupOnlineMemberCount",value:function(e){return this._moduleManager.getModule(rg).getGroupOnlineMemberCount(e)}},{key:"changeGroupOwner",value:function(e){return this._moduleManager.getModule(rg).changeGroupOwner(e)}},{key:"handleGroupApplication",value:function(e){return this._moduleManager.getModule(rg).handleGroupApplication(e)}},{key:"initGroupAttributes",value:function(e){return this._moduleManager.getModule(rg).initGroupAttributes(e)}},{key:"setGroupAttributes",value:function(e){return this._moduleManager.getModule(rg).setGroupAttributes(e)}},{key:"deleteGroupAttributes",value:function(e){return this._moduleManager.getModule(rg).deleteGroupAttributes(e)}},{key:"getGroupAttributes",value:function(e){return this._moduleManager.getModule(rg).getGroupAttributes(e)}},{key:"getGroupMemberList",value:function(e){return this._moduleManager.getModule(sg).getGroupMemberList(e)}},{key:"getGroupMemberProfile",value:function(e){return this._moduleManager.getModule(sg).getGroupMemberProfile(e)}},{key:"addGroupMember",value:function(e){return this._moduleManager.getModule(sg).addGroupMember(e)}},{key:"deleteGroupMember",value:function(e){return this._moduleManager.getModule(sg).deleteGroupMember(e)}},{key:"setGroupMemberMuteTime",value:function(e){return this._moduleManager.getModule(sg).setGroupMemberMuteTime(e)}},{key:"setGroupMemberRole",value:function(e){return this._moduleManager.getModule(sg).setGroupMemberRole(e)}},{key:"setGroupMemberNameCard",value:function(e){return this._moduleManager.getModule(sg).setGroupMemberNameCard(e)}},{key:"setGroupMemberCustomField",value:function(e){return this._moduleManager.getModule(sg).setGroupMemberCustomField(e)}},{key:"getJoinedCommunityList",value:function(){return this._moduleManager.getModule(ig).getJoinedCommunityList()}},{key:"createTopicInCommunity",value:function(e){return this._moduleManager.getModule(ig).createTopicInCommunity(e)}},{key:"deleteTopicFromCommunity",value:function(e){return this._moduleManager.getModule(ig).deleteTopicFromCommunity(e)}},{key:"updateTopicProfile",value:function(e){return this._moduleManager.getModule(ig).updateTopicProfile(e)}},{key:"getTopicList",value:function(e){return this._moduleManager.getModule(ig).getTopicList(e)}}]),e}(),NC={login:"login",logout:"logout",destroy:"destroy",on:"on",off:"off",ready:"ready",setLogLevel:"setLogLevel",joinGroup:"joinGroup",quitGroup:"quitGroup",registerPlugin:"registerPlugin",getGroupOnlineMemberCount:"getGroupOnlineMemberCount"};function OC(e,t){if(e.isReady()||void 0!==NC[t])return!0;var n=e.getNotReadyReason(),o="";Object.getOwnPropertyNames(Mh).forEach((function(e){Mh[e]===n&&(o=yh[e])}));var r={code:n,message:"".concat(o,"导致 sdk not ready。").concat(t," ").concat(yh.SDK_IS_NOT_READY,",请参考 https://web.sdk.qcloud.com/im/doc/zh-cn/module-EVENT.html#.SDK_READY")};return e.onError(r),r}var RC={},LC={create:function(e){var n=0;if(Jl(e.SDKAppID))n=e.SDKAppID;else if(wl.warn("TIM.create SDKAppID 的类型应该为 Number请修改"),n=parseInt(e.SDKAppID),isNaN(n))return wl.error("TIM.create failed. 解析 SDKAppID 失败,请检查传参!"),null;if(n&&RC[n])return RC[n];wl.log("TIM.create");var o=new DC(t(t({},e),{},{SDKAppID:n}));o.on(_r.SDK_DESTROY,(function(e){RC[e.data.SDKAppID]=null,delete RC[e.data.SDKAppID]}));var r=function(e){var t=Object.create(null);return Object.keys(jp).forEach((function(n){if(e[n]){var o=jp[n],r=new Dr;t[o]=function(){var t=Array.from(arguments);return r.use((function(t,o){var r=OC(e,n);return!0===r?o():Xv(r)})).use((function(e,t){if(!0===Kd(e,Hp[n],o))return t()})).use((function(t,o){return e[n].apply(e,t)})),r.run(t)}}})),t}(o);return RC[n]=r,wl.log("TIM.create ok"),r}};return LC.TYPES=hr,LC.EVENT=_r,LC.VERSION="2.22.0",wl.log("TIM.VERSION: ".concat(LC.VERSION)),LC}))}).call(this,n("c8ba"))}}]);