vendor: 5,468 bytes, line 1
1!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).RongIMLib={})}(this,(function(e){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(e){return e&&e.Math==Math&&e},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof t&&t)||function(){return this}()||Function("return this")(),i={},o=function(e){try{return!!e()}catch(e){return!0}},s=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a=!o((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),c=a,u=Function.prototype.call,d=c?u.bind(u):function(){return u.apply(u,arguments)},l={},h={}.propertyIsEnumerable,f=Object.getOwnPropertyDescriptor,p=f&&!h.call({1:2},1);l.f=p?function(e){var t=f(this,e);return!!t&&t.enumerable}:h;var v,_,E=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},m=a,I=Function.prototype,T=I.call,y=m&&I.bind.bind(T,T),R=m?y:function(e){return function(){return T.apply(e,arguments)}},C=R,S=C({}.toString),O=C("".slice),N=function(e){return O(S(e),8,-1)},A=o,M=N,U=Object,L=R("".split),w=A((function(){return!U("z").propertyIsEnumerable(0)}))?function(e){return"String"==M(e)?L(e,""):U(e)}:U,b=function(e){return null==e},P=b,D=TypeError,B=function(e){if(P(e))throw D("Can't call method on "+e);return e},V=w,G=B,x=function(e){return V(G(e))},k="object"==typeof document&&document.all,F={all:k,IS_HTMLDDA:void 0===k&&void 0!==k},H=F.all,q=F.IS_HTMLDDA?function(e){return"function"==typeof e||e===H}:function(e){return"function"==typeof e},K=q,j=F.all,Y=F.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:K(e)||e===j}:function(e){return"object"==typeof e?null!==e:K(e)},J=r,Q=q,W=function(e){return Q(e)?e:void 0},z=function(e,t){return arguments.length<2?W(J[e]):J[e]&&J[e][t]},Z=R({}.isPrototypeOf),X="undefined"!=typeof navigator&&String(navigator.userAgent)||"",$=r,ee=X,te=$.process,ne=$.Deno,re=te&&te.versions||ne&&ne.version,ie=re&&re.v8;ie&&(_=(v=ie.split("."))[0]>0&&v[0]<4?1:+(v[0]+v[1])),!_&&ee&&(!(v=ee.match(/Edge\/(\d+)/))||v[1]>=74)&&(v=ee.match(/Chrome\/(\d+)/))&&(_=+v[1]);var oe=_,se=oe,ae=o,ce=!!Object.getOwnPropertySymbols&&!ae((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&se&&se<41})),ue=ce&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,de=z,le=q,he=Z,fe=Object,ge=ue?function(e){return"symbol"==typeof e}:function(e){var t=de("Symbol");return le(t)&&he(t.prototype,fe(e))},pe=String,ve=function(e){try{return pe(e)}catch(e){return"Object"}},_e=q,Ee=ve,me=TypeError,Ie=function(e){if(_e(e))return e;throw me(Ee(e)+" is not a function")},Te=Ie,ye=b,Re=function(e,t){var n=e[t];return ye(n)?void 0:Te(n)},Ce=d,Se=q,Oe=Y,Ne=TypeError,Ae={exports:{}},Me=r,Ue=Object.defineProperty,Le=function(e,t){try{Ue(Me,e,{value:t,configurable:!0,writable:!0})}catch(n){Me[e]=t}return t},we=Le,be="__core-js_shared__",Pe=r[be]||we(be,{}),De=Pe;(Ae.exports=function(e,t){return De[e]||(De[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.27.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.27.2/LICENSE",source:"https://github.com/zloirock/core-js"});var Be=B,Ve=Object,Ge=function(e){return Ve(Be(e))},xe=Ge,ke=R({}.hasOwnProperty),Fe=Object.hasOwn||function(e,t){return ke(xe(e),t)},He=R,qe=0,Ke=Math.random(),je=He(1..toString),Ye=function(e){return"Symbol("+(void 0===e?"":e)+")_"+je(++qe+Ke,36)},Je=r,Qe=Ae.exports,We=Fe,ze=Ye,Ze=ce,Xe=ue,$e=Je.Symbol,et=Qe("wks"),nt=Xe?$e.for||$e:$e&&$e.withoutSetter||ze,rt=function(e){return We(et,e)||(et[e]=Ze&&We($e,e)?$e[e]:nt("Symbol."+e)),et[e]},it=d,ot=Y,st=ge,at=Re,ct=function(e,t){var n,r;if("string"===t&&Se(n=e.toString)&&!Oe(r=Ce(n,e)))return r;if(Se(n=e.valueOf)&&!Oe(r=Ce(n,e)))return r;if("string"!==t&&Se(n=e.toString)&&!Oe(r=Ce(n,e)))return r;throw Ne("Can't convert object to primitive value")},ut=TypeError,dt=rt("toPrimitive"),lt=function(e,t){if(!ot(e)||st(e))return e;var n,r=at(e,dt);if(r){if(void 0===t&&(t="default"),n=it(r,e,t),!ot(n)||st(n))return n;throw ut("Can't convert object to primitive value")}return void 0===t&&(t="number"),ct(e,t)},ht=lt,ft=ge,gt=function(e){var t=ht(e,"string");return ft(t)?t:t+""},pt=Y,vt=r.document,_t=pt(vt)&&pt(vt.createElement),Et=function(e){return _t?vt.createElement(e):{}},mt=Et,It=!s&&!o((function(){return 7!=Object.defineProperty(mt("div"),"a",{get:function(){return 7}}).a})),Tt=s,yt=d,Rt=l,Ct=E,St=x,Ot=gt,Nt=Fe,At=It,Mt=Object.getOwnPropertyDescriptor;i.f=Tt?Mt:function(e,t){if(e=St(e),t=Ot(t),At)try{return Mt(e,t)}catch(e){}if(Nt(e,t))return Ct(!yt(Rt.f,e,t),e[t])};var Ut={},Lt=s&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),wt=Y,bt=String,Pt=TypeError,Dt=function(e){if(wt(e))return e;throw Pt(bt(e)+" is not an object")},Bt=s,Vt=It,Gt=Lt,xt=Dt,kt=gt,Ft=TypeError,Ht=Object.defineProperty,qt=Object.getOwnPropertyDescriptor,Kt="enumerable",jt="configurable",Yt="writable";Ut.f=Bt?Gt?function(e,t,n){if(xt(e),t=kt(t),xt(n),"function"==typeof e&&"prototype"===t&&"value"in n&&Yt in n&&!n[Yt]){var r=qt(e,t);
vendor: 11,628 bytes, line 1
1r&&r[Yt]&&(e[t]=n.value,n={configurable:jt in n?n[jt]:r[jt],enumerable:Kt in n?n[Kt]:r[Kt],writable:!1})}return Ht(e,t,n)}:Ht:function(e,t,n){if(xt(e),t=kt(t),xt(n),Vt)try{return Ht(e,t,n)}catch(e){}if("get"in n||"set"in n)throw Ft("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Jt=Ut,Qt=E,Wt=s?function(e,t,n){return Jt.f(e,t,Qt(1,n))}:function(e,t,n){return e[t]=n,e},zt={exports:{}},Zt=s,Xt=Fe,$t=Function.prototype,en=Zt&&Object.getOwnPropertyDescriptor,tn=Xt($t,"name"),nn={EXISTS:tn,PROPER:tn&&"something"===function(){}.name,CONFIGURABLE:tn&&(!Zt||Zt&&en($t,"name").configurable)},rn=q,on=Pe,sn=R(Function.toString);rn(on.inspectSource)||(on.inspectSource=function(e){return sn(e)});var an,cn,un,dn=on.inspectSource,ln=q,hn=r.WeakMap,fn=ln(hn)&&/native code/.test(String(hn)),gn=Ae.exports,pn=Ye,vn=gn("keys"),_n=function(e){return vn[e]||(vn[e]=pn(e))},En={},mn=fn,In=r,Tn=Y,yn=Wt,Rn=Fe,Cn=Pe,Sn=_n,On=En,Nn="Object already initialized",An=In.TypeError,Mn=In.WeakMap;if(mn||Cn.state){var Un=Cn.state||(Cn.state=new Mn);Un.get=Un.get,Un.has=Un.has,Un.set=Un.set,an=function(e,t){if(Un.has(e))throw An(Nn);return t.facade=e,Un.set(e,t),t},cn=function(e){return Un.get(e)||{}},un=function(e){return Un.has(e)}}else{var Ln=Sn("state");On[Ln]=!0,an=function(e,t){if(Rn(e,Ln))throw An(Nn);return t.facade=e,yn(e,Ln,t),t},cn=function(e){return Rn(e,Ln)?e[Ln]:{}},un=function(e){return Rn(e,Ln)}}var wn={set:an,get:cn,has:un,enforce:function(e){return un(e)?cn(e):an(e,{})},getterFor:function(e){return function(t){var n;if(!Tn(t)||(n=cn(t)).type!==e)throw An("Incompatible receiver, "+e+" required");return n}}},bn=R,Pn=o,Dn=q,Bn=Fe,Vn=s,Gn=nn.CONFIGURABLE,xn=dn,kn=wn.enforce,Fn=wn.get,Hn=String,qn=Object.defineProperty,Kn=bn("".slice),jn=bn("".replace),Yn=bn([].join),Jn=Vn&&!Pn((function(){return 8!==qn((function(){}),"length",{value:8}).length})),Qn=String(String).split("String"),Wn=zt.exports=function(e,t,n){"Symbol("===Kn(Hn(t),0,7)&&(t="["+jn(Hn(t),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!Bn(e,"name")||Gn&&e.name!==t)&&(Vn?qn(e,"name",{value:t,configurable:!0}):e.name=t),Jn&&n&&Bn(n,"arity")&&e.length!==n.arity&&qn(e,"length",{value:n.arity});try{n&&Bn(n,"constructor")&&n.constructor?Vn&&qn(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=kn(e);return Bn(r,"source")||(r.source=Yn(Qn,"string"==typeof t?t:"")),e};Function.prototype.toString=Wn((function(){return Dn(this)&&Fn(this).source||xn(this)}),"toString");var zn=q,Zn=Ut,Xn=zt.exports,$n=Le,er=function(e,t,n,r){r||(r={});var i=r.enumerable,o=void 0!==r.name?r.name:t;if(zn(n)&&Xn(n,o,r),r.global)i?e[t]=n:$n(t,n);else{try{r.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=n:Zn.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},tr={},nr=Math.ceil,rr=Math.floor,ir=Math.trunc||function(e){var t=+e;return(t>0?rr:nr)(t)},or=function(e){var t=+e;return t!=t||0===t?0:ir(t)},sr=or,ar=Math.max,cr=Math.min,ur=function(e,t){var n=sr(e);return n<0?ar(n+t,0):cr(n,t)},dr=or,lr=Math.min,hr=function(e){return e>0?lr(dr(e),9007199254740991):0},fr=hr,gr=function(e){return fr(e.length)},pr=x,vr=ur,_r=gr,Er=function(e){return function(t,n,r){var i,o=pr(t),s=_r(o),a=vr(r,s);if(e&&n!=n){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===n)return e||a||0;return!e&&-1}},mr={includes:Er(!0),indexOf:Er(!1)},Ir=Fe,Tr=x,yr=mr.indexOf,Rr=En,Cr=R([].push),Sr=function(e,t){var n,r=Tr(e),i=0,o=[];for(n in r)!Ir(Rr,n)&&Ir(r,n)&&Cr(o,n);for(;t.length>i;)Ir(r,n=t[i++])&&(~yr(o,n)||Cr(o,n));return o},Or=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Nr=Sr,Ar=Or.concat("length","prototype");tr.f=Object.getOwnPropertyNames||function(e){return Nr(e,Ar)};var Mr={};Mr.f=Object.getOwnPropertySymbols;var Ur,Lr=z,wr=tr,br=Mr,Pr=Dt,Dr=R([].concat),Br=Lr("Reflect","ownKeys")||function(e){var t=wr.f(Pr(e)),n=br.f;return n?Dr(t,n(e)):t},Vr=Fe,Gr=Br,xr=i,kr=Ut,Fr=o,Hr=q,qr=/#|\.prototype\./,Kr=function(e,t){var n=Yr[jr(e)];return n==Qr||n!=Jr&&(Hr(t)?Fr(t):!!t)},jr=Kr.normalize=function(e){return String(e).replace(qr,".").toLowerCase()},Yr=Kr.data={},Jr=Kr.NATIVE="N",Qr=Kr.POLYFILL="P",Wr=Kr,zr=r,Zr=i.f,Xr=Wt,$r=er,ei=Le,ti=function(e,t,n){for(var r=Gr(t),i=kr.f,o=xr.f,s=0;s<r.length;s++){var a=r[s];Vr(e,a)||n&&Vr(n,a)||i(e,a,o(t,a))}},ni=Wr,ri=function(e,t){var n,r,i,o,s,a=e.target,c=e.global,u=e.stat;if(n=c?zr:u?zr[a]||ei(a,{}):(zr[a]||{}).prototype)for(r in t){if(o=t[r],i=e.dontCallGetSet?(s=Zr(n,r))&&s.value:n[r],!ni(c?r:a+(u?".":"#")+r,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;ti(o,i)}(e.sham||i&&i.sham)&&Xr(o,"sham",!0),$r(n,r,o,e)}},ii=r;ri({global:!0,forced:ii.globalThis!==ii},{globalThis:ii}),function(e){e[e.READ=1]="READ",e[e.LISTENED=2]="LISTENED",e[e.DOWNLOADED=4]="DOWNLOADED",e[e.RETRIEVED=8]="RETRIEVED",e[e.UNREAD=0]="UNREAD"}(Ur||(Ur={}));var oi=Ur;function si(e){return si="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},si(e)}var ai={};ai[rt("toStringTag")]="z";var ci="[object z]"===String(ai),ui=ci,di=q,li=N,hi=rt("toStringTag"),fi=Object,gi="Arguments"==li(function(){return arguments}()),pi=ui?li:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=fi(e),hi))?n:gi?li(t):"Object"==(r=li(t))&&di(t.callee)?"Arguments":r},vi=pi,_i=String,Ei=function(e){if("Symbol"===vi(e))throw TypeError("Cannot convert a Symbol value to a string");return _i(e)},mi=Dt,Ii=function(){var e=mi(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},Ti=o,yi=r.RegExp,Ri=Ti((function(){var e=yi("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),Ci=Ri||Ti((function(){return!yi("a","y").sticky})),Si={BROKEN_CARET:Ri||Ti((function(){var e=yi("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:Ci,UNSUPPORTED_Y:Ri},Oi={},Ni=Sr,Ai=Or,Mi=Object.keys||function(e){return Ni(e,Ai)},Ui=s,Li=Lt,wi=Ut,bi=Dt,Pi=x,Di=Mi;Oi.f=Ui&&!Li?Object.defineProperties:function(e,t){bi(e);for(var n,r=Pi(t),i=Di(t),o=i.length,s=0;o>s;)wi.f(e,n=i[s++],r[n]);return e};var Bi,Vi=z("document","documentElement"),Gi=Dt,xi=Oi,ki=Or,Fi=En,Hi=Vi,qi=Et,Ki="prototype",ji="script",Yi=_n("IE_PROTO"),Ji=function(){},Qi=function(e){return"<"+ji+">"+e+"</"+ji+">"},Wi=function(e){e.write(Qi("")),e.close();var t=e.parentWindow.Object;return e=null,t},zi=function(){try{Bi=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;zi="undefined"!=typeof document?document.domain&&Bi?Wi(Bi):(t=qi("iframe"),n="java"+ji+":",t.style.display="none",Hi.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(Qi("document.F=Object")),e.close(),e.F):Wi(Bi);for(var r=ki.length;r--;)delete zi[Ki][ki[r]];return zi()};Fi[Yi]=!0;var Zi=Object.create||function(e,t){var n;return null!==e?(Ji[Ki]=Gi(e),n=new Ji,Ji[Ki]=null,n[Yi]=e):n=zi(),void 0===t?n:xi.f(n,t)},Xi=o,$i=r.RegExp,eo=Xi((function(){var e=$i(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),to=o,no=r.RegExp,ro=to((function(){var e=no("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),io=d,oo=R,so=Ei,ao=Ii,co=Si,uo=Ae.exports,lo=Zi,ho=wn.get,fo=eo,go=ro,po=uo("native-string-replace",String.prototype.replace),vo=RegExp.prototype.exec,_o=vo,Eo=oo("".charAt),mo=oo("".indexOf),Io=oo("".replace),To=oo("".slice),yo=function(){var e=/a/,t=/b*/g;return io(vo,e,"a"),io(vo,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),Ro=co.BROKEN_CARET,Co=void 0!==/()??/.exec("")[1];(yo||Co||Ro||fo||go)&&(_o=function(e){var t,n,r,i,o,s,a,c=this,u=ho(c),d=so(e),l=u.raw;if(l)return l.lastIndex=c.lastIndex,t=io(_o,l,d),c.lastIndex=l.lastIndex,t;var h=u.groups,f=Ro&&c.sticky,g=io(ao,c),p=c.source,v=0,_=d;if(f&&(g=Io(g,"y",""),-1===mo(g,"g")&&(g+="g"),_=To(d,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Eo(d,c.lastIndex-1))&&(p="(?: "+p+")",_=" "+_,v++),n=new RegExp("^(?:"+p+")",g)),Co&&(n=new RegExp("^"+p+"$(?!\\s)",g)),yo&&(r=c.lastIndex),i=io(vo,f?n:c,_),f?i?(i.input=To(i.input,v),i[0]=To(i[0],v),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:yo&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),Co&&i&&i.length>1&&io(po,i[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&h)for(i.groups=s=lo(null),o=0;o<h.length;o++)s[(a=h[o])[0]]=i[a[1]];return i});var So=_o;ri({target:"RegExp",proto:!0,forced:/./.exec!==So},{exec:So});var Oo=N,No=R,Ao=function(e){if("Function"===Oo(e))return No(e)},Mo=Ao,Uo=er,Lo=So,wo=o,bo=rt,Po=Wt,Do=bo("species"),Bo=RegExp.prototype,Vo=function(e,t,n,r){var i=bo(e),o=!wo((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=o&&!wo((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Do]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!o||!s||n){var a=Mo(/./[i]),c=t(i,""[e],(function(e,t,n,r,i){var s=Mo(e),c=t.exec;return c===Lo||c===Bo.exec?o&&!i?{done:!0,value:a(t,n,r)}:{done:!0,value:s(n,t,r)}:{done:!1}}));Uo(String.prototype,e,c[0]),Uo(Bo,i,c[1])}r&&Po(Bo[i],"sham",!0)},Go=R,xo=or,ko=Ei,Fo=B,Ho=Go("".charAt),qo=Go("".charCodeAt),Ko=Go("".slice),jo=function(e){return function(t,n){var r,i,o=ko(Fo(t)),s=xo(n),a=o.length;return s<0||s>=a?e?"":void 0:(r=qo(o,s))<55296||r>56319||s+1===a||(i=qo(o,s+1))<56320||i>57343?e?Ho(o,s):r:e?Ko(o,s,s+2):i-56320+(r-55296<<10)+65536}},Yo={codeAt:jo(!1),charAt:jo(!0)},Jo=Yo.charAt,Qo=function(e,t,n){return t+(n?Jo(e,t).length:1)},Wo=d,zo=Dt,Zo=q,Xo=N,$o=So,es=TypeError,ts=function(e,t){var n=e.exec;if(Zo(n)){var r=Wo(n,e,t);return null!==r&&zo(r),r}if("RegExp"===Xo(e))return Wo($o,e,t);throw es("RegExp#exec called on incompatible receiver")},ns=d,rs=Dt,is=b,os=hr,ss=Ei,as=B,cs=Re,us=Qo,ds=ts;Vo("match",(function(e,t,n){return[function(t){var n=as(this),r=is(t)?void 0:cs(t,e);return r?ns(r,t,n):new RegExp(t)[e](ss(n))},function(e){var r=rs(this),i=ss(e),o=n(t,r,i);if(o.done)return o.value;if(!r.global)return ds(r,i);var s=r.unicode;r.lastIndex=0;for(var a,c=[],u=0;null!==(a=ds(r,i));){var d=ss(a[0]);c[u]=d,""===d&&(r.lastIndex=us(i,os(r.lastIndex),s)),u++}return 0===u?null:c}]}));var ls=N,hs=Array.isArray||function(e){return"Array"==ls(e)},fs=TypeError,gs=function(e){if(e>9007199254740991)throw fs("Maximum allowed index exceeded");return e},ps=gt,vs=Ut,_s=E,Es=function(e,t,n){var r=ps(t);r in e?vs.f(e,r,_s(0,n)):e[r]=n},ms=R,Is=o,Ts=q,ys=pi,Rs=dn,Cs=function(){},Ss=[],Os=z("Reflect","construct"),Ns=/^\s*(?:class|function)\b/,As=ms(Ns.exec),Ms=!Ns.exec(Cs),Us=function(e){if(!Ts(e))return!1;try{return Os(Cs,Ss,e),!0}catch(e){return!1}},Ls=function(e){if(!Ts(e))return!1;switch(ys(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ms||!!As(Ns,Rs(e))}catch(e){return!0}};Ls.sham=!0;var ws=!Os||Is((function(){var e;return Us(Us.call)||!Us(Object)||!Us((function(){e=!0}))||e}))?Ls:Us,bs=hs,Ps=ws,Ds=Y,Bs=rt("species"),Vs=Array,Gs=function(e){var t;return bs(e)&&(t=e.constructor,(Ps(t)&&(t===Vs||bs(t.prototype))||Ds(t)&&null===(t=t[Bs]))&&(t=void 0)),void 0===t?Vs:t},xs=function(e,t){return new(Gs(e))(0===t?0:t)},ks=o,Fs=oe,Hs=rt("species"),qs=function(e){return Fs>=51||!ks((function(){var t=[];return(t.constructor={})[Hs]=function(){return{foo:1}
1},1!==t[e](Boolean).foo}))},Ks=ri,js=o,Ys=hs,Js=Y,Qs=Ge,Ws=gr,zs=gs,Zs=Es,Xs=xs,$s=qs,ea=oe,ta=rt("isConcatSpreadable"),na=ea>=51||!js((function(){var e=[];return e[ta]=!1,e.concat()[0]!==e})),ra=function(e){if(!Js(e))return!1;var t=e[ta];return void 0!==t?!!t:Ys(e)};Ks({target:"Array",proto:!0,arity:1,forced:!na||!$s("concat")},{concat:function(e){var t,n,r,i,o,s=Qs(this),a=Xs(s,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(ra(o=-1===t?s:arguments[t]))for(i=Ws(o),zs(c+i),n=0;n<i;n++,c++)n in o&&Zs(a,c,o[n]);else zs(c+1),Zs(a,c++,o);return a.length=c,a}});var ia=a,oa=Function.prototype,sa=oa.apply,aa=oa.call,ca="object"==typeof Reflect&&Reflect.apply||(ia?aa.bind(sa):function(){return aa.apply(sa,arguments)}),ua=R,da=Ge,la=Math.floor,ha=ua("".charAt),fa=ua("".replace),ga=ua("".slice),pa=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,va=/\$([$&'`]|\d{1,2})/g,_a=ca,Ea=d,ma=R,Ia=Vo,Ta=o,ya=Dt,Ra=q,Ca=b,Sa=or,Oa=hr,Na=Ei,Aa=B,Ma=Qo,Ua=Re,La=function(e,t,n,r,i,o){var s=n+e.length,a=r.length,c=va;return void 0!==i&&(i=da(i),c=pa),fa(o,c,(function(o,c){var u;switch(ha(c,0)){case"$":return"$";case"&":return e;case"`":return ga(t,0,n);case"'":return ga(t,s);case"<":u=i[ga(c,1,-1)];break;default:var d=+c;if(0===d)return o;if(d>a){var l=la(d/10);return 0===l?o:l<=a?void 0===r[l-1]?ha(c,1):r[l-1]+ha(c,1):o}u=r[d-1]}return void 0===u?"":u}))},wa=ts,ba=rt("replace"),Pa=Math.max,Da=Math.min,Ba=ma([].concat),Va=ma([].push),Ga=ma("".indexOf),xa=ma("".slice),ka="$0"==="a".replace(/./,"$0"),Fa=!!/./[ba]&&""===/./[ba]("a","$0");Ia("replace",(function(e,t,n){var r=Fa?"$":"$0";return[function(e,n){var r=Aa(this),i=Ca(e)?void 0:Ua(e,ba);return i?Ea(i,e,r,n):Ea(t,Na(r),e,n)},function(e,i){var o=ya(this),s=Na(e);if("string"==typeof i&&-1===Ga(i,r)&&-1===Ga(i,"$<")){var a=n(t,o,s,i);if(a.done)return a.value}var c=Ra(i);c||(i=Na(i));var u=o.global;if(u){var d=o.unicode;o.lastIndex=0}for(var l=[];;){var h=wa(o,s);if(null===h)break;if(Va(l,h),!u)break;""===Na(h[0])&&(o.lastIndex=Ma(s,Oa(o.lastIndex),d))}for(var f,g="",p=0,v=0;v<l.length;v++){for(var _=Na((h=l[v])[0]),E=Pa(Da(Sa(h.index),s.length),0),m=[],I=1;I<h.length;I++)Va(m,void 0===(f=h[I])?f:String(f));var T=h.groups;if(c){var y=Ba([_],m,E,s);void 0!==T&&Va(y,T);var R=Na(_a(i,void 0,y))}else R=La(_,s,E,m,T,i);E>=p&&(g+=xa(s,p,E)+R,p=E+_.length)}return g+xa(s,p)}]}),!!Ta((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!ka||Fa);var Ha,qa=72e5,Ka=6e4,ja=["https://nav.cn.ronghub.com","https://nav2-cn.ronghub.com"],Ya=["wsproxy.cn.ronghub.com","wsap-cn.ronghub.com"],Ja="upload.qiniup.com",Qa="gz.bcebos.com",Wa=131072,za=18e4,Za="RCV4-",Xa={"RC:TxtMsg":{isCounted:!0,isPersited:!0},"RC:ImgMsg":{isCounted:!0,isPersited:!0},"RC:VcMsg":{isCounted:!0,isPersited:!0},"RC:ImgTextMsg":{isCounted:!0,isPersited:!0,searchProps:["content","title"]},"RC:FileMsg":{isCounted:!0,isPersited:!0},"RC:HQVCMsg":{isCounted:!0,isPersited:!0},"RC:LBSMsg":{isCounted:!0,isPersited:!0},"RC:PSImgTxtMsg":{isCounted:!0,isPersited:!0},"RC:PSMultiImgTxtMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpMsg":{isCounted:!0,isPersited:!0},"RCJrmf:RpOpendMsg":{isCounted:!0,isPersited:!0},"RC:CombineMsg":{isCounted:!0,isPersited:!0},"RC:ReferenceMsg":{isCounted:!0,isPersited:!0,searchProps:["content"]},"RC:SightMsg":{isCounted:!0,isPersited:!0},"RC:GIFMsg":{isCounted:!0,isPersited:!0},"RC:RLStart":{isCounted:!0,isPersited:!0},"RC:RLEnd":{isCounted:!0,isPersited:!0},"RC:InfoNtf":{isCounted:!1,isPersited:!0},"RC:ContactNtf":{isCounted:!1,isPersited:!0},"RC:ProfileNtf":{isCounted:!1,isPersited:!0},"RC:CmdNtf":{isCounted:!1,isPersited:!0},"RC:GrpNtf":{isCounted:!1,isPersited:!0},"RC:RcCmd":{isCounted:!1,isPersited:!0},"RC:CmdMsg":{isCounted:!1,isPersited:!1},"RC:TypSts":{isCounted:!1,isPersited:!1},"RC:PSCmd":{isCounted:!1,isPersited:!1},"RC:SRSMsg":{isCounted:!1,isPersited:!1},"RC:RRReqMsg":{isCounted:!1,isPersited:!1},"RC:RRRspMsg":{isCounted:!1,isPersited:!1},"RC:CsChaR":{isCounted:!1,isPersited:!1},"RC:CSCha":{isCounted:!1,isPersited:!1},"RC:CsEva":{isCounted:!1,isPersited:!1},"RC:CsContact":{isCounted:!1,isPersited:!1},"RC:CsHs":{isCounted:!1,isPersited:!1},"RC:CsHsR":{isCounted:!1,isPersited:!1},"RC:CsSp":{isCounted:!1,isPersited:!1},"RC:CsEnd":{isCounted:!1,isPersited:!1},"RC:CsUpdate":{isCounted:!1,isPersited:!1},"RC:ReadNtf":{isCounted:!1,isPersited:!1},"RC:chrmKVNotiMsg":{isCounted:!1,isPersited:!1},"RC:VCAccept":{isCounted:!1,isPersited:!1},"RC:VCRinging":{isCounted:!1,isPersited:!1},"RC:VCSummary":{isCounted:!1,isPersited:!1},"RC:VCHangup":{isCounted:!1,isPersited:!1},"RC:VCInvite":{isCounted:!1,isPersited:!1},"RC:VCModifyMedia":{isCounted:!1,isPersited:!1},"RC:VCModifyMem":{isCounted:!1,isPersited:!1},"RC:MsgExMsg":{isCounted:!1,isPersited:!1},"RC:Delivered":{isCounted:!1,isPersited:!1},"RC:RRMsg":{isCounted:!1,isPersited:!1},"RC:LogCmdMsg":{isCounted:!1,isPersited:!1},"RC:InterceptMsg":{isCounted:!1,isPersited:!1},"RC:RLJoin":{isCounted:!1,isPersited:!1},"RC:RLQuit":{isCounted:!1,isPersited:!1},"RC:RL":{isCounted:!1,isPersited:!1}},$a=["RC:TypSts","RC:InterceptMsg","RC:RL"],ec={url:"logcollection.ronghub.com",level:1,itv:6,times:5},tc="5.7.7",nc=tc.replace(/-.+$/,""),rc=function(e){return Ha||(Ha={set:function(t,n){e.localStorage.setItem(t,JSON.stringify(n))},get:function(t){var n;try{n=JSON.parse(e.localStorage.getItem(t))}catch(e){n=null}return n},remove:function(t){return e.localStorage.removeItem(t)},getKeys:function(){var t=[];for(var n in e.localStorage)t.push(n);return t}}),Ha},ic=function(){function e(e){this._caches={},e&&(this._caches=e)}return e.prototype.set=function(e,t){this._caches[e]=t},e.prototype.remove=function(e){var t=this.get(e);return delete this._caches[e],t},e.prototype.get=function(e){return this._caches[e]},e.prototype.getKeys=function(){var e=[];for(var t in this._caches)e.push(t);return e},e}(),oc=function(){function e(e,t){var n,r=t?"".concat(Za).concat(t):Za;this._rootStorage=rc(e);var i=this._rootStorage.get(r)||{};this._cache=new ic(((n={})[r]=i,n)),this._storageKey=r}return e.prototype._get=function(){var e=this._storageKey;return this._cache.get(e)||{}},e.prototype._set=function(e){var t=this._storageKey;e=e||{},this._cache.set(t,e),this._rootStorage.set(t,e)},e.prototype.set=function(e,t){var n=this._get();n[e]=t,this._set(n)},e.prototype.remove=function(e){var t=this._get();delete t[e],this._set(t)},e.prototype.clear=function(){var e=this._storageKey;this._rootStorage.remove(e),this._cache.remove(e)},e.prototype.get=function(e){return this._get()[e]},e.prototype.getKeys=function(){var e=this._get(),t=[];for(var n in e)t.push(n);return t},e.prototype.getValues=function(){return this._get()||{}},e}
1(),sc=function(e,t){return sc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},sc(e,t)};function ac(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}sc(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var cc=function(){return cc=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},cc.apply(this,arguments)};function uc(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function dc(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,r=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function lc(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var hc=function(e){function t(t){return e.call(this,"TODO => ".concat(t))||this}return ac(t,e),t}(Error),fc=R([].slice),gc=ri,pc=hs,vc=ws,_c=Y,Ec=ur,mc=gr,Ic=x,Tc=Es,yc=rt,Rc=fc,Cc=qs("slice"),Sc=yc("species"),Oc=Array,Nc=Math.max;gc({target:"Array",proto:!0,forced:!Cc},{slice:function(e,t){var n,r,i,o=Ic(this),s=mc(o),a=Ec(e,s),c=Ec(void 0===t?s:t,s);if(pc(o)&&(n=o.constructor,(vc(n)&&(n===Oc||pc(n.prototype))||_c(n)&&null===(n=n[Sc]))&&(n=void 0),n===Oc||void 0===n))return Rc(o,a,c);for(r=new(void 0===n?Oc:n)(Nc(c-a,0)),i=0;a<c;a++,i++)a in o&&Tc(r,i,o[a]);return r.length=i,r}});var Ac=Ie,Mc=a,Uc=Ao(Ao.bind),Lc=function(e,t){return Ac(e),void 0===t?e:Mc?Uc(e,t):function(){return e.apply(t,arguments)}},wc=Lc,bc=w,Pc=Ge,Dc=gr,Bc=xs,Vc=R([].push),Gc=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,s=7==e,a=5==e||o;return function(c,u,d,l){for(var h,f,g=Pc(c),p=bc(g),v=wc(u,d),_=Dc(p),E=0,m=l||Bc,I=t?m(c,_):n||s?m(c,0):void 0;_>E;E++)if((a||E in p)&&(f=v(h=p[E],E,g),e))if(t)I[E]=f;else if(f)switch(e){case 3:return!0;case 5:return h;case 6:return E;case 2:Vc(I,h)}else switch(e){case 4:return!1;case 7:Vc(I,h)}return o?-1:r||i?i:I}},xc={forEach:Gc(0),map:Gc(1),filter:Gc(2),some:Gc(3),every:Gc(4),find:Gc(5),findIndex:Gc(6),filterReject:Gc(7)},kc=xc.filter;ri({target:"Array",proto:!0,forced:!qs("filter")},{filter:function(e){return kc(this,e,arguments.length>1?arguments[1]:void 0)}});var Fc=pi,Hc=ci?{}.toString:function(){return"[object "+Fc(this)+"]"};ci||er(Object.prototype,"toString",Hc,{unsafe:!0});var qc=xc.map;ri({target:"Array",proto:!0,forced:!qs("map")},{map:function(e){return qc(this,e,arguments.length>1?arguments[1]:void 0)}});var Kc=Ge,jc=Mi;ri({target:"Object",stat:!0,forced:o((function(){jc(1)}))},{keys:function(e){return jc(Kc(e))}});var Yc=o,Jc=function(e,t){var n=[][e];return!!n&&Yc((function(){n.call(null,t||function(){return 1},1)}))},Qc=ri,Wc=w,zc=x,Zc=Jc,Xc=R([].join);Qc({target:"Array",proto:!0,forced:Wc!=Object||!Zc("join",",")},{join:function(e){return Xc(zc(this),void 0===e?",":e)}});var $c=function(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e.charCodeAt(n)<=65535?2:4;return t},eu=function(e){for(var t,n=0,r=0,i=e.length;r<i;
1r++)n+=(t=e.charCodeAt(r))<127?1:t<=2047?2:t<=65535?3:4;return n},tu=function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var n=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return n.length?[e,n.join("&")].join("?"):e};ri({target:"Number",stat:!0},{isNaN:function(e){return e!=e}});var nu=r,ru=q,iu=String,ou=TypeError,su=R,au=Dt,cu=function(e){if("object"==typeof e||ru(e))return e;throw ou("Can't set "+iu(e)+" as a prototype")},uu=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=su(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return au(n),cu(r),t?e(n,r):n.__proto__=r,n}}():void 0),du=q,lu=Y,hu=uu,fu=function(e,t,n){var r,i;return hu&&du(r=t.constructor)&&r!==n&&lu(i=r.prototype)&&i!==n.prototype&&hu(e,i),e},gu=R(1..valueOf),pu=B,vu=Ei,_u=R("".replace),Eu="[\t\n\v\f\r  áââââââ
ââââââ¯âã\u2028\u2029\ufeff]",mu=RegExp("^"+Eu+Eu+"*"),Iu=RegExp(Eu+Eu+"*$"),Tu=function(e){return function(t){var n=vu(pu(t));return 1&e&&(n=_u(n,mu,"")),2&e&&(n=_u(n,Iu,"")),n}},yu={start:Tu(1),end:Tu(2),trim:Tu(3)},Ru=ri,Cu=s,Su=r,Ou=nu,Nu=R,Au=Wr,Mu=Fe,Uu=fu,Lu=Z,wu=ge,bu=lt,Pu=o,Du=tr.f,Bu=i.f,Vu=Ut.f,Gu=gu,xu=yu.trim,ku="Number",Fu=Su[ku];Ou[ku];var Hu=Fu.prototype,qu=Su.TypeError,Ku=Nu("".slice),ju=Nu("".charCodeAt),Yu=function(e){var t=bu(e,"number");return"bigint"==typeof t?t:Ju(t)},Ju=function(e){var t,n,r,i,o,s,a,c,u=bu(e,"number");if(wu(u))throw qu("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=xu(u),43===(t=ju(u,0))||45===t){if(88===(n=ju(u,2))||120===n)return NaN}else if(48===t){switch(ju(u,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+u}for(s=(o=Ku(u,2)).length,a=0;a<s;a++)if((c=ju(o,a))<48||c>i)return NaN;return parseInt(o,r)}return+u},Qu=Au(ku,!Fu(" 0o1")||!Fu("0b1")||Fu("+0x1")),Wu=function(e){return Lu(Hu,e)&&Pu((function(){Gu(e)}))},zu=function(e){var t=arguments.length<1?0:Fu(Yu(e));return Wu(this)?Uu(Object(t),this,zu):t};zu.prototype=Hu,Qu&&(Hu.constructor=zu),Ru({global:!0,constructor:!0,wrap:!0,forced:Qu},{Number:zu});Qu&&function(e,t){for(var n,r=Cu?Du(t):"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(","),i=0;r.length>i;i++)Mu(t,n=r[i])&&!Mu(e,n)&&Vu(e,n,Bu(t,n))}(Ou[ku],Fu);var Zu=rt,Xu=Zi,$u=Ut.f,ed=Zu("unscopables"),td=Array.prototype;null==td[ed]&&$u(td,ed,{configurable:!0,value:Xu(null)});var nd=function(e){td[ed][e]=!0},rd=mr.includes,id=nd;ri({target:"Array",proto:!0,forced:o((function(){return!Array(1).includes()}))},{includes:function(e){return rd(this,e,arguments.length>1?arguments[1]:void 0)}}),id("includes");var od,sd=Y,ad=N,cd=rt("match"),ud=function(e){var t;return sd(e)&&(void 0!==(t=e[cd])?!!t:"RegExp"==ad(e))},dd=ud,ld=TypeError,hd=rt("match"),fd=ri,gd=function(e){if(dd(e))throw ld("The method doesn't accept regular expressions");return e},pd=B,vd=Ei,_d=function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[hd]=!1,"/./"[e](t)}catch(e){}}return!1},Ed=R("".indexOf);fd({target:"String",proto:!0,forced:!_d("includes")},{includes:function(e){return!!~Ed(vd(pd(this)),vd(gd(e)),arguments.length>1?arguments[1]:void 0)}}),function(e){e[e.IMAGE=1]="IMAGE",e[e.AUDIO=2]="AUDIO",e[e.VIDEO=3]="VIDEO",e[e.FILE=4]="FILE",e[e.SIGHT=5]="SIGHT",e[e.COMBINE_HTML=6]="COMBINE_HTML"}(od||(od={}));var md,Id=od;!function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(md||(md={}));var Td,yd=md;!function(e){e[e.TIMEOUT=-1]="TIMEOUT",e[e.UNKNOWN=-2]="UNKNOWN",e[e.PARAMETER_ERROR=-3]="PARAMETER_ERROR",e[e.EXTRA_METHOD_UNDEFINED=-4]="EXTRA_METHOD_UNDEFINED",e[e.MAIN_PROCESS_ERROR=-5]="MAIN_PROCESS_ERROR",e[e.PARAMETER_CHANGED=-6]="PARAMETER_CHANGED",e[e.SUCCESS=0]="SUCCESS",e[e.RC_DISCUSSION_GROUP_ID_INVALID=20407]="RC_DISCUSSION_GROUP_ID_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.JOIN_IN_DISCUSSION=21407]="JOIN_IN_DISCUSSION",e[e.CREATE_DISCUSSION=21408]="CREATE_DISCUSSION",e[e.INVITE_DICUSSION=21409]="INVITE_DICUSSION",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",e[e.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",e[e.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",e[e.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",e[e.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",e[e.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.RC_TCP_RESET=32054]="RC_TCP_RESET",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.CONVER_REMOVE_
1ERROR=34001]="CONVER_REMOVE_ERROR",e[e.CONVER_GETLIST_ERROR=34002]="CONVER_GETLIST_ERROR",e[e.CONVER_SETOP_ERROR=34003]="CONVER_SETOP_ERROR",e[e.CONVER_TOTAL_UNREAD_ERROR=34004]="CONVER_TOTAL_UNREAD_ERROR",e[e.CONVER_TYPE_UNREAD_ERROR=34005]="CONVER_TYPE_UNREAD_ERROR",e[e.CONVER_ID_TYPE_UNREAD_ERROR=34006]="CONVER_ID_TYPE_UNREAD_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.READ_RECEIPT_ERROR=35003]="READ_RECEIPT_ERROR",e[e.PACKAGE_ENVIRONMENT_ERROR=35006]="PACKAGE_ENVIRONMENT_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_NOT_SUPPORT=35012]="METHOD_NOT_SUPPORT",e[e.MSG_LIMIT_ERROR=35013]="MSG_LIMIT_ERROR",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.UPLOAD_FILE_FAILED=35020]="UPLOAD_FILE_FAILED",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.DRAF_SAVE_ERROR=38002]="DRAF_SAVE_ERROR",e[e.DRAF_REMOVE_ERROR=38003]="DRAF_REMOVE_ERROR",e[e.SUBSCRIBE_ERROR=39001]="SUBSCRIBE_ERROR",e[e.NOT_SUPPORT=39002]="NOT_SUPPORT",e[e.QNTKN_FILETYPE_ERROR=41001]="QNTKN_FILETYPE_ERROR",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.COOKIE_ENABLE=51001]="COOKIE_ENABLE",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.VOIPISNULL=24013]="VOIPISNULL",e[e.NOENGINETYPE=24010]="NOENGINETYPE",e[e.NULLCHANNELNAME=24011]="NULLCHANNELNAME",e[e.VOIPDYANMICERROR=24012]="VOIPDYANMICERROR",e[e.NOVOIP=24014]="NOVOIP",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.VOIPCLOSE=24016]="VOIPCLOSE",e[e.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",e[e.CANCEL=1]="CANCEL",e[e.REJECT=2]="REJECT",e[e.HANGUP=3]="HANGUP",e[e.BUSYLINE=4]="BUSYLINE",e[e.NO_RESPONSE=5]="NO_RESPONSE",e[e.ENGINE_UN_SUPPORTED=6]="ENGINE_UN_SUPPORTED",e[e.NETWORK_ERROR=7]="NETWORK_ERROR",e[e.REMOTE_CANCEL=11]="REMOTE_CANCEL",e[e.REMOTE_REJECT=12]="REMOTE_REJECT",e[e.REMOTE_HANGUP=13]="REMOTE_HANGUP",e[e.REMOTE_BUSYLINE=14]="REMOTE_BUSYLINE",e[e.REMOTE_NO_RESPONSE=15]="REMOTE_NO_RESPONSE",e[e.REMOTE_ENGINE_UN_SUPPORTED=16]="REMOTE_ENGINE_UN_SUPPORTED",e[e.REMOTE_NETWORK_ERROR=17]="REMOTE_NETWORK_ERROR",e[e.VOIP_NOT_AVALIABLE=18]="VOIP_NOT_AVALIABLE",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",e[e.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",e[e.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",e[e.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",e[e.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",e[e.RC_CONN_PROXY_UNAVAILABLE=35028]="RC_CONN_PROXY_UNAVAILABLE",e[e.PROXY_UNAVAILABLE=17]="PROXY_UNAVAILABLE"}(Td||(Td={}));var Rd,Cd=Td;!function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.ULTRA_GROUP=10]="ULTRA_GROUP",e[e.RTC_ROOM=12]="RTC_ROOM"}(Rd||(Rd={}));var Sd,Od=Rd;!function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.NETWORK_UNAVAILABLE=3]="NETWORK_UNAVAILABLE",e[e.CONNECTION_CLOSED=4]="CONNECTION_CLOSED",e[e.KICKED_OFFLINE_BY_OTHER_CLIENT=6]="KICKED_OFFLINE_BY_OTHER_CLIENT",e[e.WEBSOCKET_UNAVAILABLE=7]="WEBSOCKET_UNAVAILABLE",e[e.WEBSOCKET_ERROR=8]="WEBSOCKET_ERROR",e[e.BLOCKED=9]="BLOCKED",e[e.DOMAIN_INCORRECT=12]="DOMAIN_INCORRECT",e[e.DISCONNECT_BY_SERVER=13]="DISCONNECT_BY_SERVER",e[e.REDIRECT=14]="REDIRECT",e[e.USER_LOGOUT=19]="USER_LOGOUT",e[e.APPKEY_IS_FAKE=20]="APPKEY_IS_FAKE",e[e.FORBID_RECONNECT_BY_OTHER_SAME_CLIENT=31023]="FORBID_RECONNECT_BY_OTHER_SAME_CLIENT",e[e.ULTRALIMIT=1101]="ULTRALIMIT",e[e.REQUEST_NAVI=201]="REQUEST_NAVI",e[e.RESPONSE_NAVI=202]="RESPONSE_NAVI",e[e.RESPONSE_NAVI_ERROR=203]="RESPONSE_NAVI_ERROR",e[e.RESPONSE_NAVI_TIMEOUT=204]="RESPONSE_NAVI_TIMEOUT",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_CONN_USER_OR_PASSWD_
1ERROR=31004]="RC_CONN_USER_OR_PASSWD_ERROR"}(Sd||(Sd={}));var Nd,Ad=Sd;!function(e){e.TextMessage="RC:TxtMsg",e.VOICE="RC:VcMsg",e.HQ_VOICE="RC:HQVCMsg",e.IMAGE="RC:ImgMsg",e.GIF="RC:GIFMsg",e.RICH_CONTENT="RC:ImgTextMsg",e.LOCATION="RC:LBSMsg",e.FILE="RC:FileMsg",e.SIGHT="RC:SightMsg",e.COMBINE="RC:CombineMsg",e.CHRM_KV_NOTIFY="RC:chrmKVNotiMsg",e.LOG_COMMAND="RC:LogCmdMsg",e.EXPANSION_NOTIFY="RC:MsgExMsg",e.REFERENCE="RC:ReferenceMsg",e.RECALL="RC:RcCmd",e.RECALL_NOTIFICATION_MESSAGE="RC:RcNtf",e.READ_RECEIPT="RC:ReadNtf",e.READ_RECEIPT_REQUEST="RC:RRReqMsg",e.READ_RECEIPT_RESPONSE="RC:RRRspMsg",e.SYNC_READ_STATUS="RC:SRSMsg",e.GROUP_READ_RECEIPT_REQUEST="RC:RRMsg",e.DELIVERED="RC:Delivered",e.DELIVERED_MSG="RC:DRMsg",e.CHATROOM_JOIN="RC:ChrmJoinNtf",e.CHATROOM_LEFT="RC:ChrmQuitNtf",e.CHATROOM_MERGE_CHANGE="RC:ChrmMemChange",e.TYPING_STATUS="RC:TypSts",e.INTERCEPT="RC:InterceptMsg"}(Nd||(Nd={}));var Md,Ud=Nd;!function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(Md||(Md={}));var Ld,wd=Md;!function(e){e[e.ALL_MESSAGE=-1]="ALL_MESSAGE",e[e.NOT_SET=0]="NOT_SET",e[e.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",e[e.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",e[e.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",e[e.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(Ld||(Ld={}));var bd,Pd=Ld;!function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(bd||(bd={}));var Dd,Bd=bd;!function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC",e[e.MINIO=5]="MINIO"}(Dd||(Dd={}));var Vd,Gd=Dd;!function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(Vd||(Vd={}));var xd,kd,Fd,Hd,qd=Vd;e.LogLevel=void 0,(xd=e.LogLevel||(e.LogLevel={}))[xd.LOG=0]="LOG",xd[xd.DEBUG=0]="DEBUG",xd[xd.INFO=1]="INFO",xd[xd.WARN=2]="WARN",xd[xd.ERROR=3]="ERROR",xd[xd.FATAL=4]="FATAL",xd[xd.STATISTICS=6]="STATISTICS",xd[xd.NONE=1e3]="NONE",function(e){e.IM="IM",e.RTC="RTC"}(kd||(kd={})),function(e){e.L_IMSDK_VER_O="L-imsdk_ver-O",e.A_INIT_O="A-init-O",e.A_INIT_REPEAT_O="A_INIT_REPEAT_O",e.L_INIT_O="L-init-O",e.A_DESTROY_O="A_DESTROY_O",e.L_DESTROY_O="L_DESTROY_O",e.A_CONNECT_T="A-connect-T",e.A_CONNECT_R="A-connect-R",e.A_CONNECT_S="A-connect-S",e.A_DISCONNECT_O="A-disconnect-O",e.A_RECONNECT_T="A-reconnect-T",e.A_RECONNECT_R="A_RECONNECT_R",e.L_CONNECT_T="L-connect-T",e.L_CONNECT_R="L-connect-R",e.L_CONNECT_S="L-connect-S",e.L_NOTIFY_ULTRA_ONLINE_S="L-notify-ultra-online-S",e.L_ULTRA_SYNC_DONE_S="L-ultra-sync-done-S",e.L_BATCH_MESSAGE_O="L-BATCH_MESSAGE-O",e.A_MSG_LISTENER_E="A-MSG_LISTENER-E",e.O="L-original-O",e.T="L-TEST-O",e.L_INSTALL_PLUGIN_T="L-INSTALL_PLUGIN-T",e.L_INSTALL_PLUGIN_R="L-INSTALL_PLUGIN-R",e.L_NAVI_CONF_E="L-NAVI_CONF_ERROR-E",e.A_SEND_MSG_T="A-send_msg-T",e.A_SEND_MSG_R="A-send_msg-R",e.L_SEND_MSG_T="L-send_msg-T",e.L_SEND_MSG_R="L-send_msg-R",e.L_PULL_MSG_T="L-pull_msg-T",e.L_PULL_MSG_R="L-pull_msg-R",e.L_PULL_MSG_O="L-pull_msg-O",e.L_PULL_ULTRA_MSG_T="L-pull_ultra_msg-T",e.L_PULL_ULTRA_MSG_R="L-pull_ultra_msg-R",e.L_PULL_CHATROOM_KV_T="L-pull_chatroom_kv-T",e.L_PULL_CHATROOM_KV_R="L-pull_chatroom_kv-R",e.L_PULL_CHATROOM_MSG_T="L-pull_chatroom_msg-T",e.L_PULL_CHATROOM_MSG_R="L-pull_chatroom_msg-R",e.L_RECV_MULTI_SYNC_MSG_O="L-recv_multi_sync_msg-O",e.L_RECV_S_MSG_O="L-recv_s_msg-O",e.A_DELETE_MESSAGES_S="A-delete_messages-S",e.P_DELETE_MSG_S="P-delete_msg-S",e.L_PULL_CONVERSATION_S="L-pull_conversation-S",e.L_RECALL_ULTRA_MSG_S="L-recall_ultra_msg-S",e.A_REGTYP_O="A-regtyp-O",e.P_REGTYP_E="P-regtype-E",e.L_GET_NAVI_T="L-get_navi-T",e.L_GET_NAVI_R="L-get_navi-R",e.L_REQUEST_T="L-request-T",e.L_REQUEST_R="L-request-R",e.L_PARSE_NAVI_E="L-parse_navi-E",e.L_ENV_S="L-Env-S",e.L_GET_INDEX_NAVI_S="L-get_index_navi-S",e.A_JOIN_CHATROOM_T="A-join_chatroom-T",e.A_JOIN_CHATROOM_R="A-join_chatroom-R",e.L_JOIN_CHATROOM_T="L-join_chatroom-T",e.L_JOIN_CHATROOM_R="L-join_chatroom-R",e.A_QUIT_CHATROOM_T="A-quit_chatroom-T",e.A_QUIT_CHATROOM_R="A-quit_chatroom-R",e.L_REJOIN_CHATROOM_T="L-rejoin_chatroom-T",e.L_REJOIN_CHATROOM_R="L-rejoin_chatroom-R",e.L_REJOIN_CHATROOM_S="L-rejoin_chatroom-S",e.L_MEDIA_S="L-media-S",e.L_MEDIA_UPLOAD_T="L-media_upload-T",e.L_MEDIA_UPLOAD_R="L-media_upload-R",e.G_UPLOAD_LOG_S="G-upload_log-S",e.G_REPORT_LOG_S="G-report_log-S",e.G_UPLOAD_LOG_E="G-upload_log-E",e.G_GET_REAL_TIMELOG_COMMAND_S="G
1-get_real_timelog_command-S",e.L_CHECK_ALIVE_IM_T="L-check_alive_im-T",e.L_CHECK_ALIVE_IM_R="L-check_alive_im-R",e.L_CHECK_ALIVE_IM_S="L-check_alive_im-S",e.A_GET_HISTORY_MSG_T="A-get_history_msg-T",e.A_GET_HISTORY_MSG_R="A-get_history_msg-R",e.L_GET_HISTORY_MSG_T="L-get_history_msg-T",e.L_GET_HISTORY_MSG_R="L-get_history_msg-R",e.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E="A-get_privage_message_deliver_time-E",e.A_GET_GROUP_MESSAGE_DELIVER_LIST_E="A-get_group_message_deliver_list-E",e.A_CALLBACK_O="A-callback-O",e.A_CALLBACK_E="A-callback-E",e.L_CALLBACK_E="L-callback-E",e.A_GET_TOP_CONVERSATION_LIST_E="A-get_top_conversation_list-E",e.L_PB_ENCODE_E="L-pb-encode-E",e.L_PB_DECODE_E="L-pb-decode-E",e.L_NOTIFY_NAVI_CHANGE_E="L-notify_navi_change-E",e.L_REPORT_FULL_LOG_O="L-report_full_log-O",e.L_REPORT_FULL_LOG_T="L-report_full_log-T",e.L_REPORT_FULL_LOG_R="L-report_full_log-R",e.L_REPORT_LOG_POLICY_E="L-parse_navi_logpolicy-E",e.L_UNSUPPORT_INDEXDB_O="L-unsupport_IndexDB-O",e.L_LOGDB_OPEN_FAILED_E="L-logDB_open_failed-E",e.L_LOGDB_CLOSED_S="L-logDB_closed-S",e.L_LOGDB_ERROR_E="L-logDB_error-S",e.L_LOGDB_ABORT_S="L-logDB_abort-S",e.L_REALTIME_LOG_R="L_REALTIME_LOG_R",e.L_REALTIME_LOG_O="L_REALTIME_LOG_O",e.L_REALTIME_LOG_T="L_REALTIME_LOG_T",e.L_UNKNOWN_TOPIC_E="L_UNKNOWN_TOPIC_E",e.L_RECV_RMTP_O="L_RECV_RMTP_O",e.L_RECV_RMTP_E="L_RECV_RMTP_E",e.L_RECV_S_NTF_O="L-recv_s_ntf_O",e.L_VER_REPORT_T="L-VER_REPORT-T",e.L_VER_REPORT_R="L-VER_REPORT-R",e.L_CALL_MAIN_SYNC_O="L_CALL_MAIN_SYNC_O",e.L_UNSUPPORT_NTF_FROM_MAIN_E="L_UNSUPPORT_NTF_FROM_MAIN_E",e.A_SET_MSG_CONTENT_O="A_SET_MSG_CONTENT_O",e.A_REMOVE_PROXY_O="A-remove_proxy-O",e.A_SET_PROXY_O="A-set_proxy-O",e.A_TEST_PROXY_O="A-test_proxy-O",e.L_WEBSOCKET_DISACCORD_E="L-websocket_disaccord-e"}(Fd||(Fd={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(Hd||(Hd={}));var Kd,Yd,Jd=Hd;!function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(Kd||(Kd={})),e.MessageBlockSourceType=void 0,(Yd=e.MessageBlockSourceType||(e.MessageBlockSourceType={}))[Yd.MSG_ORIGINAL=0]="MSG_ORIGINAL",Yd[Yd.MSG_EXPANSION=1]="MSG_EXPANSION",Yd[Yd.MSG_MODIFY=2]="MSG_MODIFY";var Qd,Wd=Kd;!function(e){e[e.typing=0]="typing"}(Qd||(Qd={}));var zd,Zd,Xd,$d,el,tl,nl,rl,il,ol,sl=Qd;e.SentStatus=void 0,(zd=e.SentStatus||(e.SentStatus={}))[zd.SENDING=10]="SENDING",zd[zd.FAILED=20]="FAILED",zd[zd.SENT=30]="SENT",zd[zd.RECEIVED=40]="RECEIVED",zd[zd.READ=50]="READ",zd[zd.DESTROYED=60]="DESTROYED",function(e){e.NAVI="rc-navi",e.REALTIME_LOG_TIMESTAMP="rc-realtime-log-timestamp"}(Zd||(Zd={})),e.UltraGroupChannelType=void 0,(Xd=e.UltraGroupChannelType||(e.UltraGroupChannelType={}))[Xd.PUBLIC=0]="PUBLIC",Xd[Xd.PRIVATE=1]="PRIVATE",e.UltraGroupChannelChangeType=void 0,($d=e.UltraGroupChannelChangeType||(e.UltraGroupChannelChangeType={}))[$d.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",$d[$d.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",$d[$d.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN",function(e){e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY",e[e.MSG_RECALL=3]="MSG_RECALL",e[e.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",e[e.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE"}(el||(el={})),function(e){e[e.CHANNEL_DELETE=1]="CHANNEL_DELETE",e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PRIVATE_CHANNEL_USER_JOIN_PUBLIC=4]="PRIVATE_CHANNEL_USER_JOIN_PUBLIC",e[e.CHANNEL_USER_KICKED=5]="CHANNEL_USER_KICKED",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(tl||(tl={})),function(e){e[e.REMOVE_USER_GROUP=1]="REMOVE_USER_GROUP",e[e.JOIN_USER_GROUP=2]="JOIN_USER_GROUP",e[e.EXIT_USER_GROUP=3]="EXIT_USER_GROUP",e[e.CHANNEL_BIND_USER_GROUP=4]="CHANNEL_BIND_USER_GROUP",e[e.CHANNEL_UNBIND_USER_GROUP=5]="CHANNEL_UNBIND_USER_GROUP"}(nl||(nl={})),function(e){e[e.RTC=0]="RTC",e[e.LIVE=2]="LIVE",e[e.SIP=4]="SIP",e[e.CALL=5]="CALL",e[e.MEETING=6]="MEETING",e[e.CROSS_MUTI=7]="CROSS_MUTI",e[e.CROSS_LIVE=8]="CROSS_LIVE"}(rl||(rl={})),function(e){e[e.AUDIO_AND_VIDEO=0]="AUDIO_AND_VIDEO",e[e.AUDIO=1]="AUDIO"}(il||(il={})),function(e){e[e.ANCHOR=1]="ANCHOR",e[e.AUDIENCE=2]="AUDIENCE"}(ol||(ol={}));var al,cl,ul;!function(e){e[e.ROOM=1]="ROOM",e[e.PERSON=2]="PERSON"}(al||(al={})),function(e){e[e.AnchorToViewer=1]="AnchorToViewer",e[e.ViewerToAnchor=2]="ViewerToAnchor"}(cl||(cl={})),function(e){e[e.KICK=0]="KICK",e[e.REFUSE=1]="REFUSE",e[e.COEXIST=2]="COEXIST"}(ul||(ul={}));var dl=function(e){return"string"==typeof e},ll=function(e){return"number"==typeof e&&!Number.isNaN(e)},hl=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},fl=function(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)},gl=function(e){return dl(e)&&e.length>0},pl=function(e){return"[object Object]"===Object.prototype.toString.call(e)},vl=function(e){return"[object Function]"===Object.prototype.toString.call(e)}
1,_l=function(e){return void 0===e||"[object Undefined]"===Object.prototype.toString.call(e)},El=function(e){return dl(e)&&/https?:\/\//.test(e)},ml=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},Il=function(e){return ll(e)&&Object.prototype.hasOwnProperty.call(Od,e)},Tl=function(e){return ll(e)&&Object.prototype.hasOwnProperty.call(Pd,e)},yl=function(e){var t=!1;return dl(e)&&!/_/g.test(e)&&e.length<=20&&(t=!0),t},Rl=function(e){return[Od.PRIVATE,Od.GROUP,Od.SYSTEM,Od.PUBLIC_SERVICE,Od.APP_PUBLIC_SERVICE].includes(e)},Cl=function(e){return ll(e)&&Object.prototype.hasOwnProperty.call(Id,e)},Sl=function(e){var t=!1,n=!1,r=!1;if(pl(e)){var i=Object.keys(e).length;for(var o in t=i>20,e)if(n||(n=dl(o)&&!/^[A-Za-z0-9_=+-]+$/.test(o)),!r){var s=e[o];r=o.length>32||s.length>4096}}return{isExceedLimit:t,isIllgalEx:n,isExKeyOrValLengthExceedLimit:r}},Ol=s,Nl=hs,Al=TypeError,Ml=Object.getOwnPropertyDescriptor,Ul=Ol&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}(),Ll=ve,wl=TypeError,bl=function(e,t){if(!delete e[t])throw wl("Cannot delete property "+Ll(t)+" of "+Ll(e))},Pl=ri,Dl=Ge,Bl=ur,Vl=or,Gl=gr,xl=Ul?function(e,t){if(Nl(e)&&!Ml(e,"length").writable)throw Al("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t},kl=gs,Fl=xs,Hl=Es,ql=bl,Kl=qs("splice"),jl=Math.max,Yl=Math.min;Pl({target:"Array",proto:!0,forced:!Kl},{splice:function(e,t){var n,r,i,o,s,a,c=Dl(this),u=Gl(c),d=Bl(e,u),l=arguments.length;for(0===l?n=r=0:1===l?(n=0,r=u-d):(n=l-2,r=Yl(jl(Vl(t),0),u-d)),kl(u+n-r),i=Fl(c,r),o=0;o<r;o++)(s=d+o)in c&&Hl(i,o,c[s]);if(i.length=r,n<r){for(o=d;o<u-r;o++)a=o+n,(s=o+r)in c?c[a]=c[s]:ql(c,a);for(o=u;o>u-r+n;o--)ql(c,o-1)}else if(n>r)for(o=u-r;o>d;o--)a=o+n-1,(s=o+r-1)in c?c[a]=c[s]:ql(c,a);for(o=0;o<n;o++)c[o+d]=arguments[o+2];return xl(c,u-r+n),i}});var Jl={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},Ql=Et("span").classList,Wl=Ql&&Ql.constructor&&Ql.constructor.prototype,zl=Wl===Object.prototype?void 0:Wl,Zl=xc.forEach,Xl=Jc("forEach")?[].forEach:function(e){return Zl(this,e,arguments.length>1?arguments[1]:void 0)},$l=r,eh=Jl,th=zl,nh=Xl,rh=Wt,ih=function(e){if(e&&e.forEach!==nh)try{rh(e,"forEach",nh)}catch(t){e.forEach=nh}};for(var oh in eh)eh[oh]&&ih($l[oh]&&$l[oh].prototype);ih(th);var sh=function(){function e(){this._map={}}return e.prototype.on=function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n})},e.prototype.once=function(e,t,n){var r=this._map[e]||(this._map[e]=[]);r.some((function(e){return e.listener===t&&e.target===n}))||r.push({listener:t,target:n,once:!0})},e.prototype.off=function(e,t,n){var r=this._map[e];r&&((r=r.filter((function(e){return e.listener!==t||e.target!==n}))).length?this._map[e]=r:delete this._map[e])},e.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this._map[e];if(r)for(var i=r.length-1;i>=0;i-=1){var o=r[i],s=o.target,a=o.once,c=o.listener;a&&r.splice(i,1);try{c.call.apply(c,lc([s],t,!1))}catch(e){null===console||void 0===console||console.error(e)}}},e.prototype.removeAll=function(e){delete this._map[e]},e.prototype.clear=function(){Object.keys(this._map).forEach(this.removeAll,this)},e}(),ah=or,ch=Ei,uh=B,dh=RangeError,lh=R,hh=hr,fh=Ei,gh=B,ph=lh((function(e){var t=ch(uh(this)),n="",r=ah(e);if(r<0||r==1/0)throw dh("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n})),vh=lh("".slice),_h=Math.ceil,Eh=function(e){return function(t,n,r){var i,o,s=fh(gh(t)),a=hh(n),c=s.length,u=void 0===r?" ":fh(r);return a<=c||""==u?s:((o=ph(u,_h((i=a-c)/u.length))).length>i&&(o=vh(o,0,i)),e?s+o:o+s)}},mh={start:Eh(!1),end:Eh(!0)},Ih=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(X),Th=mh.start;ri({target:"String",proto:!0,forced:Ih},{padStart:function(e){return Th(this,e,arguments.length>1?arguments[1]:void 0)}});var yh="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{};yh.engine="5.7.7";var Rh=function(){function e(){}return e.add=function(e,t){yh[e]=t},e.validEngine=function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var n=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return yh.engine.match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=n},e.getInfo=function(){return yh},e}(),Ch=null;function Sh(e){Ch=e}function Oh(t,n,r,i){void 0===r&&(r={});var o=["error","warn","info","debug"][3-t];
1if(Ch&&t<e.LogLevel.FATAL)try{var s=JSON.stringify(r);Ch[o](n,s)}catch(e){console.error(e)}}var Nh=Oh.bind(null,e.LogLevel.DEBUG),Ah=Oh.bind(null,e.LogLevel.INFO),Mh=Oh.bind(null,e.LogLevel.WARN),Uh=Oh.bind(null,e.LogLevel.ERROR),Lh=Oh.bind(null,e.LogLevel.FATAL),wh=Object.freeze({__proto__:null,init:Sh,log:Oh,debug:Nh,info:Ah,warn:Mh,error:Uh,fatal:Lh}),bh=d,Ph=Fe,Dh=Z,Bh=Ii,Vh=RegExp.prototype,Gh=function(e){var t=e.flags;return void 0!==t||"flags"in Vh||Ph(e,"flags")||!Dh(Vh,e)?t:bh(Bh,e)},xh=nn.PROPER,kh=er,Fh=Dt,Hh=Ei,qh=o,Kh=Gh,jh="toString",Yh=RegExp.prototype[jh],Jh=qh((function(){return"/a/b"!=Yh.call({source:"a",flags:"b"})})),Qh=xh&&Yh.name!=jh;(Jh||Qh)&&kh(RegExp.prototype,jh,(function(){var e=Fh(this);return"/"+Hh(e.source)+"/"+Hh(Kh(e))}),{unsafe:!0});var Wh,zh,Zh=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},Xh=function(){var e=Zh();if(e="".concat(e.replace(/-/g,""),"a"),e=function(e){var t="0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZa0".split(""),n=t.length+1,r=+e,i=[];do{var o=r%n;r=(r-o)/n,i.unshift(t[o])}while(r);return i.join("")}(e=parseInt(e,16)),e.length>22&&(e=e.slice(0,22)),e.length<22)for(var t=22-e.length,n=0;n<t;n++)e+="0";return e},$h=s,ef=nn.EXISTS,tf=R,nf=Ut.f,rf=Function.prototype,of=tf(rf.toString),sf=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,af=tf(sf.exec);$h&&!ef&&nf(rf,"name",{configurable:!0,get:function(){try{return af(sf,of(this))[1]}catch(e){return""}}}),function(e){e[e.STRING=0]="STRING",e[e.ONLY_STRING=1]="ONLY_STRING",e[e.NUMBER=2]="NUMBER",e[e.BOOLEAN=3]="BOOLEAN",e[e.OBJECT=4]="OBJECT",e[e.ARRAY=5]="ARRAY",e[e.CALLBACK=6]="CALLBACK",e[e.CHANNEL_ID=7]="CHANNEL_ID",e[e.CONVERSATION=8]="CONVERSATION"}(zh||(zh={}));var cf,uf,df,lf,hf=((Wh={})[zh.STRING]=gl,Wh[zh.ONLY_STRING]=dl,Wh[zh.NUMBER]=ll,Wh[zh.BOOLEAN]=function(e){return"boolean"==typeof e},Wh[zh.OBJECT]=pl,Wh[zh.ARRAY]=hl,Wh[zh.CALLBACK]=function(e){var t=!0;return pl(e)||(t=!1),(e=e||{}).onSuccess&&!vl(e.onSuccess)&&(t=!1),e.onError&&!vl(e.onError)&&(t=!1),t},Wh[zh.CHANNEL_ID]=yl,Wh[zh.CONVERSATION]=function(e){var t=!0;return pl(e)||(t=!1),dl(e.targetId)||(t=!1),Il(e.conversationType)||(t=!1),_l(e.channelId)||yl(e.channelId)||(t=!1),t},Wh),ff=function(e){function t(t){var n=e.call(this,t)||this;return n.name="RCAssertError",n}return ac(t,e),t}(Error),gf=function(e,t,n,r){if(void 0===r&&(r=!1),!pf(e,t,n,r))throw new ff("'".concat(e,"' is invalid: ").concat(JSON.stringify(t)))},pf=function(e,t,n,r){void 0===r&&(r=!1),n=hf[n]||n;var i=r?n(t):_l(t)||null==t||n(t);return i||null===console||void 0===console||console.error("'".concat(e,"' is invalid: ").concat(JSON.stringify(t))),i},vf="undefined"!=typeof process&&"process"==N(process),_f=Ut.f,Ef=Fe,mf=rt("toStringTag"),If=function(e,t,n){e&&!n&&(e=e.prototype),e&&!Ef(e,mf)&&_f(e,mf,{configurable:!0,value:t})},Tf=z,yf=Ut,Rf=s,Cf=rt("species"),Sf=function(e){var t=Tf(e),n=yf.f;Rf&&t&&!t[Cf]&&n(t,Cf,{configurable:!0,get:function(){return this}})},Of=Z,Nf=TypeError,Af=function(e,t){if(Of(t,e))return e;throw Nf("Incorrect invocation")},Mf=ws,Uf=ve,Lf=TypeError,wf=function(e){if(Mf(e))return e;throw Lf(Uf(e)+" is not a constructor")},bf=Dt,Pf=wf,Df=b,Bf=rt("species"),Vf=function(e,t){var n,r=bf(e).constructor;return void 0===r||Df(n=bf(r)[Bf])?t:Pf(n)},Gf=TypeError,xf=function(e,t){if(e<t)throw Gf("Not enough arguments");return e},kf=/(?:ipad|iphone|ipod).*applewebkit/i.test(X),Ff=r,Hf=ca,qf=Lc,Kf=q,jf=Fe,Yf=o,Jf=Vi,Qf=fc,Wf=Et,zf=xf,Zf=kf,Xf=vf,$f=Ff.setImmediate,eg=Ff.clearImmediate,tg=Ff.process,ng=Ff.Dispatch,rg=Ff.Function,ig=Ff.MessageChannel,og=Ff.String,sg=0,ag={},cg="onreadystatechange";Yf((function(){cf=Ff.location}));var ug=function(e){if(jf(ag,e)){var t=ag[e];delete ag[e],t()}},dg=function(e){return function(){ug(e)}},lg=function(e){ug(e.data)},hg=function(e){Ff.postMessage(og(e),cf.protocol+"//"+cf.host)};$f&&eg||($f=function(e){zf(arguments.length,1);var t=Kf(e)?e:rg(e),n=Qf(arguments,1);return ag[++sg]=function(){Hf(t,void 0,n)},uf(sg),sg},eg=function(e){delete ag[e]},Xf?uf=function(e){tg.nextTick(dg(e))}:ng&&ng.now?uf=function(e){ng.now(dg(e))}:ig&&!Zf?(lf=(df=new ig).port2,df.port1.onmessage=lg,uf=qf(lf.postMessage,lf)):Ff.addEventListener&&Kf(Ff.postMessage)&&!Ff.importScripts&&cf&&"file:"!==cf.protocol&&!Yf(hg)?(uf=hg,Ff.addEventListener("message",lg,!1)):uf=cg in Wf("script")?function(e){Jf.appendChild(Wf("script"))[cg]=function(){Jf.removeChild(this),ug(e)}}:function(e){setTimeout(dg(e),0)});var fg={set:$f,clear:eg},gg=function(){this.head=null,this.tail=null};gg.prototype={add:function(e){var t={item:e,next:null},n=this.tail;n?n.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var pg,vg,_g,Eg,mg,Ig=gg,Tg=/ipad|iphone|ipod/i.test(X)&&"undefined"!=typeof Pebble,yg=/web0s(?!.*chrome)/i.test(X),Rg=r,Cg=Lc,Sg=i.f,Og=fg.set,Ng=Ig,Ag=kf,Mg=Tg,Ug=yg,Lg=vf,wg=Rg.MutationObserver||Rg.WebKitMutationObserver,bg=Rg.document,Pg=Rg.process,Dg=Rg.Promise,Bg=Sg(Rg,"queueMicrotask"),Vg=Bg&&Bg.value;if(!Vg){var Gg=new Ng,xg=function(){var e,t;for(Lg&&(e=Pg.domain)&&e.exit();t=Gg.get();)try{t()}catch(e){throw Gg.head&&pg(),e}e&&e.enter()};Ag||Lg||Ug||!wg||!bg?!Mg&&Dg&&Dg.resolve?((Eg=Dg.resolve(void 0)).constructor=Dg,mg=Cg(Eg.then,Eg),pg=function(){mg(xg)}):Lg?pg=function(){Pg.nextTick(xg)}:(Og=Cg(Og,Rg),pg=function(){Og(xg)}):(vg=!0,_g=bg.createTextNode(""),new wg(xg).observe(_g,{characterData:!0}
vendor: 4,348 bytes, line 1
1),pg=function(){_g.data=vg=!vg}),Vg=function(e){Gg.head||pg(),Gg.add(e)}}var kg=Vg,Fg=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Hg=r.Promise,qg="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,Kg=!qg&&!vf&&"object"==typeof window&&"object"==typeof document,jg=r,Yg=Hg,Jg=q,Qg=Wr,Wg=dn,zg=rt,Zg=Kg,Xg=qg,$g=oe;Yg&&Yg.prototype;var ep=zg("species"),tp=!1,np=Jg(jg.PromiseRejectionEvent),rp=Qg("Promise",(function(){var e=Wg(Yg),t=e!==String(Yg);if(!t&&66===$g)return!0;if(!$g||$g<51||!/native code/.test(e)){var n=new Yg((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};if((n.constructor={})[ep]=r,!(tp=n.then((function(){}))instanceof r))return!0}return!t&&(Zg||Xg)&&!np})),ip={CONSTRUCTOR:rp,REJECTION_EVENT:np,SUBCLASSING:tp},op={},sp=Ie,ap=TypeError,cp=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw ap("Bad Promise constructor");t=e,n=r})),this.resolve=sp(t),this.reject=sp(n)};op.f=function(e){return new cp(e)};var up,dp,lp,hp=ri,fp=vf,gp=r,pp=d,vp=er,_p=uu,Ep=If,mp=Sf,Ip=Ie,Tp=q,yp=Y,Rp=Af,Cp=Vf,Sp=fg.set,Op=kg,Np=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},Ap=Fg,Mp=Ig,Up=wn,Lp=Hg,wp=op,bp="Promise",Pp=ip.CONSTRUCTOR,Dp=ip.REJECTION_EVENT,Bp=ip.SUBCLASSING,Vp=Up.getterFor(bp),Gp=Up.set,xp=Lp&&Lp.prototype,kp=Lp,Fp=xp,Hp=gp.TypeError,qp=gp.document,Kp=gp.process,jp=wp.f,Yp=jp,Jp=!!(qp&&qp.createEvent&&gp.dispatchEvent),Qp="unhandledrejection",Wp=function(e){var t;return!(!yp(e)||!Tp(t=e.then))&&t},zp=function(e,t){var n,r,i,o=t.value,s=1==t.state,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,d=e.domain;try{a?(s||(2===t.rejection&&tv(t),t.rejection=1),!0===a?n=o:(d&&d.enter(),n=a(o),d&&(d.exit(),i=!0)),n===e.promise?u(Hp("Promise-chain cycle")):(r=Wp(n))?pp(r,n,c,u):c(n)):u(o)}catch(e){d&&!i&&d.exit(),u(e)}},Zp=function(e,t){e.notified||(e.notified=!0,Op((function(){for(var n,r=e.reactions;n=r.get();)zp(n,e);e.notified=!1,t&&!e.rejection&&$p(e)})))},Xp=function(e,t,n){var r,i;Jp?((r=qp.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),gp.dispatchEvent(r)):r={promise:t,reason:n},!Dp&&(i=gp["on"+e])?i(r):e===Qp&&Np("Unhandled promise rejection",n)},$p=function(e){pp(Sp,gp,(function(){var t,n=e.facade,r=e.value;if(ev(e)&&(t=Ap((function(){fp?Kp.emit("unhandledRejection",r,n):Xp(Qp,n,r)})),e.rejection=fp||ev(e)?2:1,t.error))throw t.value}))},ev=function(e){return 1!==e.rejection&&!e.parent},tv=function(e){pp(Sp,gp,(function(){var t=e.facade;fp?Kp.emit("rejectionHandled",t):Xp("rejectionhandled",t,e.value)}))},nv=function(e,t,n){return function(r){e(t,r,n)}},rv=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Zp(e,!0))},iv=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Hp("Promise can't be resolved itself");var r=Wp(t);r?Op((function(){var n={done:!1};try{pp(r,t,nv(iv,n,e),nv(rv,n,e))}catch(t){rv(n,t,e)}})):(e.value=t,e.state=1,Zp(e,!1))}catch(t){rv({done:!1},t,e)}}};if(Pp&&(kp=function(e){Rp(this,Fp),Ip(e),pp(up,this);var t=Vp(this);try{e(nv(iv,t),nv(rv,t))}catch(e){rv(t,e)}},Fp=kp.prototype,(up=function(e){Gp(this,{type:bp,done:!1,notified:!1,parent:!1,reactions:new Mp,rejection:!1,state:0,value:void 0})}).prototype=vp(Fp,"then",(function(e,t){var n=Vp(this),r=jp(Cp(this,kp));return n.parent=!0,r.ok=!Tp(e)||e,r.fail=Tp(t)&&t,r.domain=fp?Kp.domain:void 0,0==n.state?n.reactions.add(r):Op((function(){zp(r,n)})),r.promise})),dp=function(){var e=new up,t=Vp(e);this.promise=e,this.resolve=nv(iv,t),this.reject=nv(rv,t)},wp.f=jp=function(e){return e===kp||undefined===e?new dp(e):Yp(e)},Tp(Lp)&&xp!==Object.prototype)){lp=xp.then,Bp||vp(xp,"then",(function(e,t){var n=this;return new kp((function(e,t){pp(lp,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete xp.constructor}catch(Uh){}_p&&_p(xp,Fp)}hp({global:!0,constructor:!0,wrap:!0,forced:Pp},{Promise:kp}),Ep(kp,bp,!1),mp(bp);var ov={},sv=ov,av=rt("iterator"),cv=Array.prototype,uv=function(e){return void 0!==e&&(sv.Array===e||cv[av]===e)},dv=pi,lv=Re,hv=b,fv=ov,gv=rt("iterator"),pv=function(e){if(!hv(e))return lv(e,gv)||lv(e,"@@iterator")||fv[dv(e)]},vv=d,_v=Ie,Ev=Dt,mv=ve,Iv=pv,Tv=TypeError,yv=function(e,t){var n=arguments.length<2?Iv(e):t;if(_v(n))return Ev(vv(n,e));throw Tv(mv(e)+" is not iterable")},Rv=d,Cv=Dt,Sv=Re,Ov=function(e,t,n){var r,i;Cv(e);
1try{if(!(r=Sv(e,"return"))){if("throw"===t)throw n;return n}r=Rv(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return Cv(r),n},Nv=Lc,Av=d,Mv=Dt,Uv=ve,Lv=uv,wv=gr,bv=Z,Pv=yv,Dv=pv,Bv=Ov,Vv=TypeError,Gv=function(e,t){this.stopped=e,this.result=t},xv=Gv.prototype,kv=function(e,t,n){var r,i,o,s,a,c,u,d=n&&n.that,l=!(!n||!n.AS_ENTRIES),h=!(!n||!n.IS_RECORD),f=!(!n||!n.IS_ITERATOR),g=!(!n||!n.INTERRUPTED),p=Nv(t,d),v=function(e){return r&&Bv(r,"normal",e),new Gv(!0,e)},_=function(e){return l?(Mv(e),g?p(e[0],e[1],v):p(e[0],e[1])):g?p(e,v):p(e)};if(h)r=e.iterator;else if(f)r=e;else{if(!(i=Dv(e)))throw Vv(Uv(e)+" is not iterable");if(Lv(i)){for(o=0,s=wv(e);s>o;o++)if((a=_(e[o]))&&bv(xv,a))return a;return new Gv(!1)}r=Pv(e,i)}for(c=h?e.next:r.next;!(u=Av(c,r)).done;){try{a=_(u.value)}catch(e){Bv(r,"throw",e)}if("object"==typeof a&&a&&bv(xv,a))return a}return new Gv(!1)},Fv=rt("iterator"),Hv=!1;try{var qv=0,Kv={next:function(){return{done:!!qv++}},return:function(){Hv=!0}};Kv[Fv]=function(){return this},Array.from(Kv,(function(){throw 2}))}catch(Uh){}var jv=function(e,t){if(!t&&!Hv)return!1;var n=!1;try{var r={};r[Fv]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Yv=Hg,Jv=ip.CONSTRUCTOR||!jv((function(e){Yv.all(e).then(void 0,(function(){}))})),Qv=d,Wv=Ie,zv=op,Zv=Fg,Xv=kv;ri({target:"Promise",stat:!0,forced:Jv},{all:function(e){var t=this,n=zv.f(t),r=n.resolve,i=n.reject,o=Zv((function(){var n=Wv(t.resolve),o=[],s=0,a=1;Xv(e,(function(e){var c=s++,u=!1;a++,Qv(n,t,e).then((function(e){u||(u=!0,o[c]=e,--a||r(o))}),i)})),--a||r(o)}));return o.error&&i(o.value),n.promise}});var $v=ri,e_=ip.CONSTRUCTOR,t_=Hg,n_=z,r_=q,i_=er,o_=t_&&t_.prototype;if($v({target:"Promise",proto:!0,forced:e_,real:!0},{catch:function(e){return this.then(void 0,e)}}),r_(t_)){var s_=n_("Promise").prototype.catch;o_.catch!==s_&&i_(o_,"catch",s_,{unsafe:!0})}var a_=d,c_=Ie,u_=op,d_=Fg,l_=kv;ri({target:"Promise",stat:!0,forced:Jv},{race:function(e){var t=this,n=u_.f(t),r=n.reject,i=d_((function(){var i=c_(t.resolve);l_(e,(function(e){a_(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var h_=d,f_=op;ri({target:"Promise",stat:!0,forced:ip.CONSTRUCTOR},{reject:function(e){var t=f_.f(this);return h_(t.reject,void 0,e),t.promise}});var g_=Dt,p_=Y,v_=op,__=ri,E_=ip.CONSTRUCTOR,m_=function(e,t){if(g_(e),p_(t)&&t.constructor===e)return t;var n=v_.f(e);return(0,n.resolve)(t),n.promise};z("Promise"),__({target:"Promise",stat:!0,forced:E_},{resolve:function(e){return m_(this,e)}});var I_="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,T_=r,y_=ca,R_=q,C_=I_,S_=X,O_=fc,N_=xf,A_=T_.Function,M_=/MSIE .\./.test(S_)||C_&&function(){var e=T_.Bun.version.split(".");return e.length<3||0==e[0]&&(e[1]<3||3==e[1]&&0==e[2])}(),U_=function(e,t){var n=t?2:1;return M_?function(r,i){var o=N_(arguments.length,1)>n,s=R_(r)?r:A_(r),a=o?O_(arguments,n):[],c=o?function(){y_(s,this,a)}:s;return t?e(c,i):e(c)}:e},L_=ri,w_=r,b_=U_(w_.setInterval,!0);L_({global:!0,bind:!0,forced:w_.setInterval!==b_},{setInterval:b_});var P_=ri,D_=r,B_=U_(D_.setTimeout,!0);P_({global:!0,bind:!0,forced:D_.setTimeout!==B_},{setTimeout:B_});var V_=Ut.f,G_=s,x_=r,k_=R,F_=Wr,H_=fu,q_=Wt,K_=tr.f,j_=Z,Y_=ud,J_=Ei,Q_=Gh,W_=Si,z_=function(e,t,n){n in e||V_(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},Z_=er,X_=o,$_=Fe,eE=wn.enforce,tE=Sf,nE=eo,rE=ro,iE=rt("match"),oE=x_.RegExp,sE=oE.prototype,aE=x_.SyntaxError,cE=k_(sE.exec),uE=k_("".charAt),dE=k_("".replace),lE=k_("".indexOf),hE=k_("".slice),fE=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,gE=/a/g,pE=/a/g,vE=new oE(gE)!==gE,_E=W_.MISSED_STICKY,EE=W_.UNSUPPORTED_Y,mE=G_&&(!vE||_E||nE||rE||X_((function(){return pE[iE]=!1,oE(gE)!=gE||oE(pE)==pE||"/a/i"!=oE(gE,"i")})));if(F_("RegExp",mE)){for(var IE=function(e,t){var n,r,i,o,s,a,c=j_(sE,this),u=Y_(e),d=void 0===t,l=[],h=e;if(!c&&u&&d&&e.constructor===IE)return e;if((u||j_(sE,e))&&(e=e.source,d&&(t=Q_(h))),e=void 0===e?"":J_(e),t=void 0===t?"":J_(t),h=e,nE&&"dotAll"in gE&&(r=!!t&&lE(t,"s")>-1)&&(t=dE(t,/s/g,"")),n=t,_E&&"sticky"in gE&&(i=!!t&&lE(t,"y")>-1)&&EE&&(t=dE(t,/y/g,"")),rE&&(o=function(e){for(var t,n=e.length,r=0,i="",o=[],s={},a=!1,c=!1,u=0,d="";r<=n;r++){if("\\"===(t=uE(e,r)))t+=uE(e,++r);else if("]"===t)a=!1;else if(!a)switch(!0){case"["===t:a=!0;break;case"("===t:cE(fE,hE(e,r+1))&&(r+=2,c=!0),i+=t,u++;continue;case">"===t&&c:if(""===d||$_(s,d))throw new aE("Invalid capture group name");s[d]=!0,o[o.length]=[d,u],c=!1,d="";continue}c?d+=t:i+=t}return[i,o]}(e),e=o[0],l=o[1]),s=H_(oE(e,t),c?this:sE,IE),(r||i||l.length)&&(a=eE(s),r&&(a.dotAll=!0,a.raw=IE(function(e){for(var t,n=e.length,r=0,i="",o=!1;r<=n;r++)"\\"!==(t=uE(e,r))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),i+=t):i+="[\\s\\S]":i+=t+uE(e,++r);return i}(e),n)),i&&(a.sticky=!0),l.length&&(a.groups=l)),e!==h)try{q_(s,"source",""===h?"(?:)":h)}catch(e){}return s},TE=K_(oE),yE=0;TE.length>yE;)z_(IE,oE,TE[yE++]);sE.constructor=IE,IE.prototype=sE,Z_(x_,"RegExp",IE,{constructor:!0})}tE("RegExp");var RE,CE,SE,OE,NE=function(e){if(!pl(e)||void 0===e.low||void 0===e.high)return e;var t=e.low;return t<0&&(t+=4294967296),t=t.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(t.length,"}$")),t),16)},AE=function(e,t){var n=Math.floor(1e3*Math.random()%1e4),r=Zh(),i=function(e){e=e||"-";var t=new Date,n=t.getFullYear(),r=t.getMonth()+1,i=t.getDate();return"".concat(n).concat(e).concat(r).concat(e).concat(i)}(),o=(new Date).getTime(),s="";if(t){var a=t.split(".");s=".".concat(a[a.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(n,"_").concat(o).concat(r).concat(s)},ME=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.threadId,r=e.apnsCollapseId,i=e.category,o=e.richMediaUri,s=t.channelIdMi,a=t.channelIdHW,c=t.channelIdOPPO,u=t.typeVivo,d=t.googleConfig,l=t.miLargeIconUrl,h=t.importanceHW,f=t.categoryHW,g=t.imageUrlHW,p=t.categoryVivo,v={};v["thread-id"]=n||"",v["apns-collapse-id"]=r||"",v.category=i||"",v.richMediaUri=o||"";var _={};_.collapse_key=null==d?void 0:d.collapseKey,_.imageUrl=null==d?void 0:d.imageUrl;var E=null==d?void 0:d.priority;E&&!["high","normal"].includes(E)&&(E="normal"),_.priority=E;var m=[{HW:{channelId:a||"",importance:h||"NORMAL",image:g||"",category:f||""}},{MI:{channelId:s||"",large_icon_uri:l||""}},{OPPO:{channelId:c||""}},{VIVO:{classification:u||"",category:p||""}},{APNS:v},{FCM:_}];return JSON.stringify(m)},UE=function(e,t,n){var r={},i={notificationId:n||""};if(!t)return{iOSConfig:r,androidConfig:i};try{var o=JSON.parse(t);null==o||o.forEach((function(e){var t,n,o,s,a,c,u,d,l,h=Object.keys(e);if(0!==h.length){var f=h[0];switch(f){case"HW":return i.channelIdHW=null===(t=e[f])||void 0===t?void 0:t.channelId,i.importanceHW=null===(n=e[f])||void 0===n?void 0:n.importance,i.imageUrlHW=null===(o=e[f])||void 0===o?void 0:o.image,void(i.categoryHW=null===(s=e[f])||void 0===s?void 0:s.category);case"MI":return i.channelIdMi=null===(a=e[f])||void 0===a?void 0:a.channelId,void(i.miLargeIconUrl=null===(c=e[f])||void 0===c?void 0:c.large_icon_uri);case"OPPO":return void(i.channelIdOPPO=null===(u=e[f])||void 0===u?void 0:u.channelId);case"VIVO":return i.typeVivo=null===(d=e[f])||void 0===d?void 0:d.classification,void(i.categoryVivo=null===(l=e[f])||void 0===l?void 0:l.category);case"APNS":return r.threadId=e[f]["thread-id"],r.apnsCollapseId=e[f]["apns-collapse-id"],r.category=e[f].category,void(r.richMediaUri=e[f].r
1ichMediaUri);case"FCM":i.googleConfig={collapseKey:e[f].collapse_key||"",imageUrl:e[f].imageUrl||"",priority:e[f].priority||""}}}}))}catch(n){e.error(Fd.O,"Wrong format for pushConfigs field! content: ".concat(t))}return{iOSConfig:r,androidConfig:i}},LE=function(e){var t=/^[A-Za-z0-9_=+-]+$/.test(e),n=e.length;return t&&(n<=128&&n>=1)},wE=function(e){var t=e.length;return t<=4096&&t>=1},bE=(RE=0,function(){var e=((4294967295&Date.now())>>>0).toString(2),t=Math.floor(Math.random()*(Math.pow(2,20)-1)),n=e+RE.toString(2).padStart(11,"0")+t.toString(2).padStart(20,"0");return RE=2047&++RE,parseInt(n,2)}),PE=function(e,t,n){var r=null==n?void 0:n.isReverse;pl(e)&&function(){for(var n in e)t(e[n],n,e)}(),(hl(e)||dl(e))&&function(){if(r)for(var n=e.length-1;n>=0;n--)t(e[n],n);else for(var i=0,o=e.length;i<o;i++)t(e[i],i)}()},DE=function(e,t){return PE(e,(function(n,r){e[r]=t(n,r)})),e},BE=function(e,t){if(e.indexOf)return e.indexOf(t);var n=-1;return PE(e,(function(e,r){t===e&&(n=r)})),n},VE=function(e,t){var n=[];return PE(e,(function(e){n.push(e)})),-1!==BE(n,t)},GE=function(e){return JSON.parse(JSON.stringify(e))},xE=function(){return"undefined"!=typeof RCCppEngine},kE=function e(t){var n;if("object"===si(t)&&null!==t)if(Array.isArray(t))for(var r in n=[],t)n.push(e(t[r]));else for(var r in n={},t)n[r]=e(t[r]);else n=t;return n},FE=function(e){var t;try{t=kE(e)}catch(n){t=JSON.parse(JSON.stringify(e))}return t},HE={_delayTime:0,setTime:function(e){var t=(new Date).getTime();HE._delayTime=t-e},getTime:function(){var e=HE._delayTime;return(new Date).getTime()-e}},qE=function(e,t){var n=0;return e.isAutoDelete&&(n|=1),e.isOverwrite&&(n|=2),2===t&&(n|=4),n},KE=!o((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),jE=Fe,YE=q,JE=Ge,QE=KE,WE=_n("IE_PROTO"),zE=Object,ZE=zE.prototype,XE=QE?zE.getPrototypeOf:function(e){var t=JE(e);if(jE(t,WE))return t[WE];var n=t.constructor;return YE(n)&&t instanceof n?n.prototype:t instanceof zE?ZE:null},$E=o,em=q,tm=Y,nm=XE,rm=er,im=rt("iterator"),om=!1;[].keys&&("next"in(OE=[].keys())?(SE=nm(nm(OE)))!==Object.prototype&&(CE=SE):om=!0);var sm=!tm(CE)||$E((function(){var e={};return CE[im].call(e)!==e}));sm&&(CE={}),em(CE[im])||rm(CE,im,(function(){return this}));var am={IteratorPrototype:CE,BUGGY_SAFARI_ITERATORS:om},cm=am.IteratorPrototype,um=Zi,dm=E,lm=If,hm=ov,fm=function(){return this},gm=function(e,t,n,r){var i=t+" Iterator";return e.prototype=um(cm,{next:dm(+!r,n)}),lm(e,i,!1),hm[i]=fm,e},pm=ri,vm=d,_m=q,Em=gm,mm=XE,Im=uu,Tm=If,ym=Wt,Rm=er,Cm=ov,Sm=nn.PROPER,Om=nn.CONFIGURABLE,Nm=am.IteratorPrototype,Am=am.BUGGY_SAFARI_ITERATORS,Mm=rt("iterator"),Um="keys",Lm="values",wm="entries",bm=function(){return this},Pm=function(e,t,n,r,i,o,s){Em(n,t,r);var a,c,u,d=function(e){if(e===i&&p)return p;if(!Am&&e in f)return f[e];switch(e){case Um:case Lm:case wm:return function(){return new n(this,e)}}return function(){return new n(this)}},l=t+" Iterator",h=!1,f=e.prototype,g=f[Mm]||f["@@iterator"]||i&&f[i],p=!Am&&g||d(i),v="Array"==t&&f.entries||g;if(v&&(a=mm(v.call(new e)))!==Object.prototype&&a.next&&(mm(a)!==Nm&&(Im?Im(a,Nm):_m(a[Mm])||Rm(a,Mm,bm)),Tm(a,l,!0)),Sm&&i==Lm&&g&&g.name!==Lm&&(Om?ym(f,"name",Lm):(h=!0,p=function(){return vm(g,this)})),i)if(c={values:d(Lm),keys:o?p:d(Um),entries:d(wm)},s)for(u in c)(Am||h||!(u in f))&&Rm(f,u,c[u]);else pm({target:t,proto:!0,forced:Am||h},c);return f[Mm]!==p&&Rm(f,Mm,p,{name:i}),Cm[t]=p,c},Dm=function(e,t){return{value:e,done:t}},Bm=x,Vm=nd,Gm=ov,xm=wn,km=Ut.f,Fm=Pm,Hm=Dm,qm=s,Km="Array Iterator",jm=xm.set,Ym=xm.getterFor(Km),Jm=Fm(Array,"Array",(function(e,t){jm(this,{type:Km,target:Bm(e),index:0,kind:t})}),(function(){var e=Ym(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,Hm(void 0,!0)):Hm("keys"==n?r:"values"==n?t[r]:[r,t[r]],!1)}),"values"),Qm=Gm.Arguments=Gm.Array;if(Vm("keys"),Vm("values"),Vm("entries"),qm&&"values"!==Qm.name)try{km(Qm,"name",{value:"values"})}catch(Uh){}var Wm=r,zm=Jl,Zm=zl,Xm=Jm,$m=Wt,eI=rt,tI=eI("iterator"),nI=eI("toStringTag"),rI=Xm.values,iI=function(e,t){if(e){if(e[tI]!==rI)try{$m(e,tI,rI)}catch(t){e[tI]=rI}if(e[nI]||$m(e,nI,t),zm[t])for(var n in Xm)if(e[n]!==Xm[n])try{$m(e,n,Xm[n])}catch(t){e[n]=Xm[n]}}};for(var oI in zm)iI(Wm[oI]&&Wm[oI].prototype,oI);iI(Zm,"DOMTokenList");var sI,aI,cI=function(){function e(e){this._pullQueue=[],this._isPulling=!1,this._pullTime=0,this._engine=e}return e.prototype._startPull=function(){return uc(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.roomId,n=e.timestamp,(r=this._pullTime)>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullRTCRoomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,o===Cd.SUCCESS?(this._isPulling=!1,this._pullTime=s.syncTime||0,this._startPull()):this._startPull(),[2]}}))}))},e.prototype.pullEntry=function(e,t){this._pullQueue.push({roomId:e,timestamp:t}),this._startPull()},e.prototype.reset=function(){this._pullTime=0,this._isPulling=!1},e}(),uI="rtcRJoin_data",dI="rtcRExit",lI="rtcRInfo",hI="rtcUData",fI="rtcUPut",gI="rtcUDel",pI="rtcSetData",vI="userSetData",_I="rtcQryData",EI="rtcDelData",mI="rtcToken",II="rtcUserState",TI="rtcUList",yI="viewerJoinR",RI="viewerExitR",CI="rtcPullKv",SI="rtcIdentityChange",OI="rtcInvite",NI="rtcCancelInvite",AI="rtcInviteAnswer",MI="rtcEndInvite",UI="rtcQueryJoined";!function(e){e.RtcInput="RtcInput",e.RtcUserListOutput="RtcUserListOutput",e.SetUserStatusInput="SetUserStatusInput",e.RtcSetDataInput="RtcSetDataInput",e.RtcUserSetDataInput="RtcUserSetDataInput",e.RtcDataInput="RtcDataInput",e.RtcSetOutDataInput="RtcSetOutDataInput",e.MCFollowInput="MCFollowInput",e.RtcTokenOutput="RtcTokenOutput",e.RtcQryOutput="RtcQryOutput",e.RtcQryUserOutDataInput="RtcQryUserOutDataInput",e.RtcUserOutDataOutput="RtcUserOutDataOutput",e.RtcQueryListInput="RtcQueryListInput",e.RtcRoomInfoOutput="RtcRoomInfoOutput",e.RtcValueInfo="RtcValueInfo",e.RtcKeyDeleteInput="RtcKeyDeleteInput",e.RtcNotifyMsg="RtcNotifyMsg",e.RtcPullKV="RtcPullKV",e.RtcKVOutput="RtcKVOutput",e.RtcQueryUserJoinedInput="RtcQueryUserJoinedInput",e.RtcQueryUserJoinedOutput="RtcQueryUserJoinedOutput",e.RtcViewerJoinedOutput="RtcViewerJoinedOutput",e.RtcInviteInput="RtcInviteInput",e.RtcCancelInviteInput="RtcCancelInviteInput",e.RtcInviteAnswerInput="RtcInviteAnswerInput",e.RtcEndInviteInput="RtcEnd
1InviteInput",e.RtcOutput="RtcOutput"}(aI||(aI={}));var LI=((sI={})[aI.RtcInput]=["roomType","broadcastType","extraInnerData","needSysChatroom","identityChangeType","joinType","innerDatas","outerDatas"],sI[aI.RtcUserListOutput]=["users","token","sessionId","roomInfo"],sI[aI.SetUserStatusInput]=["status"],sI[aI.RtcSetDataInput]=["interior","target","key","value","objectName","content"],sI[aI.RtcUserSetDataInput]=["valueInfo","objectName","content"],sI[aI.RtcDataInput]=["interior","target","key","objectName","content"],sI[aI.RtcSetOutDataInput]=["target","valueInfo","objectName","content"],sI[aI.MCFollowInput]=["state"],sI[aI.RtcTokenOutput]=["rtcToken"],sI[aI.RtcQryOutput]=["outInfo"],sI[aI.RtcQryUserOutDataInput]=["userId"],sI[aI.RtcUserOutDataOutput]=["user"],sI[aI.RtcQueryListInput]=["order"],sI[aI.RtcRoomInfoOutput]=["roomId","roomData","userCount","list"],sI[aI.RtcValueInfo]=["key","value"],sI[aI.RtcKeyDeleteInput]=["key"],sI[aI.RtcNotifyMsg]=["type","time","roomId"],sI[aI.RtcPullKV]=["timestamp","roomId"],sI[aI.RtcKVOutput]=["entries","bFullUpdate","syncTime"],sI[aI.RtcQueryUserJoinedInput]=["userId"],sI[aI.RtcQueryUserJoinedOutput]=["info"],sI[aI.RtcInviteInput]=["invitedUserId","timeoutTime","invitedRoomId","inviteInfo","inviteSessionId"],sI[aI.RtcCancelInviteInput]=["invitedUserId","invitedRoomId","inviteInfo","inviteSessionId"],sI[aI.RtcInviteAnswerInput]=["inviteUserId","answerCode","inviteRoomId","inviteSessionId","content","key","value"],sI[aI.RtcEndInviteInput]=["inviteRoomId","inviteSessionId","inviteContent","inviteRoomKeys"],sI),wI="\npackage Modules;\nmessage probuf {\n enum JoinType {\n KICK = 0; //踢åä¸ä¸ªè®¾å¤\n REFUSE = 1; //å½åå å
¥æç»\n COEXIST = 2; //两个设å¤å
±å\n }\n enum targetType {\n ROOM =1 ;\n PERSON = 2;\n }\n message ".concat(aI.SetUserStatusInput,"\n {\n optional int32 status=1;\n }\n message ").concat(aI.MCFollowInput,"\n {\n required string state = 1;\n }\n message ").concat(aI.RtcQueryListInput,"{\n optional int32 order=1;\n }\n message ").concat(aI.RtcKeyDeleteInput,"{\n repeated string key=1;\n }\n message ").concat(aI.RtcValueInfo,"{\n required string key=1;\n required string value=2;\n }\n message RtcUserInfo{\n required string userId=1;\n repeated ").concat(aI.RtcValueInfo," userData=2; //ç¨æ·èµæºä¿¡æ¯\n }\n message ").concat(aI.RtcUserListOutput,"{\n repeated RtcUserInfo users=1;\n optional string token=2;\n optional string sessionId=3;\n repeated RtcValueInfo roomInfo = 4; //æ¿é´key value\n repeated RtcKVEntity entries = 5;//ç´æKV屿§å¯¹è±¡éå\n optional int64 syncTime = 6;//ææå±æ§çæå¤§æ¶é´æ³ï¼ä¸æ¬¡æåKVæ¶ç¨ï¼ã\n optional int32 offlineKickTime = 7;//serverè¶
æ¶è¸¢äººæ¶é´ï¼é»è®¤60s\n }\n message RtcRoomInfoOutput{\n optional string roomId = 1;\n repeated ").concat(aI.RtcValueInfo," roomData = 2;\n optional int32 userCount = 3;\n repeated RtcUserInfo list=4;\n }\n message ").concat(aI.RtcInput,"{\n required int32 roomType=1;\n optional int32 broadcastType=2;\n optional RtcValueInfo extraInnerData = 3;\n optional bool needSysChatroom = 4; //æ¯å¦éè¦åæ¥è天室\n optional IdentityChangeType identityChangeType = 5; //èº«ä»½åæ´ç±»å\n optional JoinType joinType = 6; // å å
¥æ¿é´ç±»å\n repeated ").concat(aI.RtcValueInfo," innerDatas = 7; //ç¨æ·å
é¨inneræ°æ®ï¼è§è²æè
è¿éº¦ä¿¡æ¯ç\n repeated ").concat(aI.RtcValueInfo," outerDatas = 8; //ç¨æ·å
é¨outeræ°æ®ï¼èªå®ä¹æ°æ®ç»æRtcInputã\n }\n message ").concat(aI.RtcQryOutput,"{\n repeated ").concat(aI.RtcValueInfo," outInfo=1;\n }\n message ").concat(aI.RtcDataInput,"{\n required bool interior=1;\n required targetType target=2;\n repeated string key=3;\n optional string objectName=4;\n optional string content=5;\n }\n message ").concat(aI.RtcSetDataInput,"{\n required bool interior=1;\n required targetType target=2;\n required string key=3;\n required string value=4;\n optional string objectName=5;\n optional string content=6;\n }\n message ").concat(aI.RtcUserSetDataInput," {\n repeated ").concat(aI.RtcValueInfo," valueInfo = 1;\n required string objectName = 2;\n repeated ").concat(aI.RtcValueInfo," content = 3;\n }\n message RtcQryInput{\n required bool isInterior=1;\n required targetType target=2;\n repeated string key=3;\n }\n message RtcDelDataInput{\n repeated string key=1;\n required bool isInterior=2;\n required targetType target=3;\n }\n message RtcOutput\n {\n optional int32 nothing=1;\n optional int64 version=2;\n }\n message ").concat(aI.RtcTokenOutput,"{\n required string rtcToken=1;\n }\n message ").concat(aI.RtcSetOutDataInput,"{\n required targetType target=1;\n repeated ").concat(aI.RtcValueInfo," valueInfo=2;\n optional string objectName=3;\n optional string content=4;\n }\n message ").concat(aI.RtcQryUserOutDataInput,"{\n repeated string userId = 1;\n }\n message ").concat(aI.RtcUserOutDataOutput,"{\n repeated RtcUserInfo user = 1;\n }\n message ").concat(aI.RtcNotifyMsg," \n {\n required int32 type= 1; //(éç¥ç±»å 1:rtcæ¿é´ç¶æKVåæ´éç¥)\n optional int64 time= 2; //æ¶æ¯äº§çæ¶é´\n optional string roomId=3; //ä¸»ææ¿é´id\n }\n message ").concat(aI.RtcPullKV,"\n {\n required int64 timestamp = 1;\n required string roomId = 2;\n }\n message RtcKVEntity \n {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;
1\n optional int64 timestamp = 4;\n optional string uid = 5;\n }\n message ").concat(aI.RtcKVOutput,"\n {\n repeated RtcKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3; \n }\n enum IdentityChangeType \n {\n AnchorToViewer = 1; //1为主æåè§ä¼\n ViewerToAnchor = 2; //2为è§ä¼å主æ\n }\n message ").concat(aI.RtcQueryUserJoinedInput,"\n {\n required string userId = 1;\n }\n message RtcJoinedInfo\n {\n required string deviceId = 1; //设å¤ID\n required string roomId = 2; //å å
¥çæ¿é´ID\n optional int64 joinTime = 3; //å å
¥çæ¶é´\n }\n message ").concat(aI.RtcQueryUserJoinedOutput,"\n {\n repeated RtcJoinedInfo info = 1;\n }\n message ").concat(aI.RtcViewerJoinedOutput,"\n {\n required string rtcToken=1;\n repeated RtcKVEntity entries = 2;//KV屿§å¯¹è±¡éå\n optional int64 syncTime = 3;//ææå±æ§çæå¤§æ¶é´æ³ï¼ä¸æ¬¡æåKVæ¶ç¨ï¼ã\n }\n message ").concat(aI.RtcInviteInput,"\n {\n required string invitedUserId=1; //被é请ç人çuid\n optional int32 timeoutTime=2; //é请è¶
æ¶æ¶é´(ç§),é»è®¤ä¸åç§\n required string invitedRoomId=3; //被éè¯·çæ¿é´\n required string inviteInfo=4; //é请çä¿¡æ¯(å
å«é请人,被é请人,åèªuserid)客æ·ç«¯å®ä¹å¥½.åè®®æ åserveréä¼ \n required string inviteSessionId= 5; //客æ·ç«¯ä¿è¯å¯ä¸æ§(建议roomid_userid_æ¶é´æ³_éæºæ°)\n }\n message ").concat(aI.RtcCancelInviteInput,"\n {\n required string invitedUserId=1; //被é请ç人çuid\n required string invitedRoomId=2; //被éè¯·çæ¿é´\n required string inviteInfo=3; //åæ¶é请çä¿¡æ¯(å
å«é请人,被é请人,åèªuserid)客æ·ç«¯å®ä¹å¥½.åè®®æ åserveréä¼ \n required string inviteSessionId=4; //é请çsessionId,客æ·ç«¯åèµ·é请æ¶äº§ç\n }\n message ").concat(aI.RtcInviteAnswerInput,"\n {\n required string inviteUserId=1; //é请ç人çuid\n required int32 answerCode=2; //æ¯å¦æ¥åè¿éº¦é请.0为æç»,1为æ¥å\n required string inviteRoomId=3; //éè¯·çæ¿é´\n required string inviteSessionId=4; //é请çsessionId\n required string content=5; //éè¦è½¬åçcontent\n optional string key=6; //妿æ¥åçè¯,éè¦å è¿ä¸ªå段,æ¾å¨room级å«çkåv,æ°å å
¥æ¿é´çè½æåå°\n optional string value=7; //妿æ¥åçè¯,éè¦å è¿ä¸ªå段,æ¾å¨room级å«çkåv,æ°å å
¥æ¿é´çè½æåå°\n }\n message ").concat(aI.RtcEndInviteInput,"\n {\n required string inviteRoomId=1; //éè¯·çæ¿é´\n required string inviteSessionId=2; //é请çsessionId\n required string inviteContent=3; //ç»æè¿éº¦çä¿¡æ¯(éè¦éä¼ ç»æ¿é´å
å
¶ä»äºº)\n repeated string inviteRoomKeys=4; //éè¦å é¤è¿éº¦çä¿¡æ¯çkey\n }\n}\n"),bI=function(){function e(e,t,n,r,i){this.runtime=e,this.rtcCodec=t,this._watcher=n,this._options=r,this.logger=i,this._appkey=this._options.appkey,this._rtcKVManager=new cI(this)}return e.prototype.registerRTCSignalingListener=function(e){this._rtcSignalingListener=e},e.prototype.getInnerLogger=function(){return this.logger},e.prototype.pullRTCRoomEntry=function(e,t){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return t=this.rtcCodec.encode(aI.RtcPullKV,{timestamp:0,roomId:e}),[4,this.rtcSignaling(e,CI,!0,t)];case 1:return n=c.sent(),r=n.code,i=n.buffer,r!==Cd.SUCCESS?[2,{code:r}]:(o=this.rtcCodec.decode(aI.RtcKVOutput,i),s=o.entries,a=o.syncTime,s=(s||[]).map((function(e){return cc(cc({},e),{timestamp:NE(e.timestamp)})})),this._watcher.onRTCDataChange(s,e),[2,{code:r,data:{kvEntries:s,syncTime:NE(a)}}])}}))}))},e.prototype._receiveRtcKv=function(e){if(this._rtcSignalingListener)this._rtcSignalingListener(e);else{var t=this.rtcCodec.decode(aI.RtcNotifyMsg,e),n=t.time,r=t.type,i=t.roomId;1===r&&this._rtcKVManager.pullEntry(i,NE(n))}},e.prototype.destroy=function(){},e}(),PI=B,DI=Ei,BI=/"/g,VI=R("".replace),GI=o,xI=function(e,t,n,r){var i=DI(PI(e)),o="<"+t;return""!==n&&(o+=" "+n+'="'+VI(DI(r),BI,""")+'"'),o+">"+i+"</"+t+">"},kI=function(e){return GI((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))};ri({target:"String",proto:!0,forced:kI("sub")},{sub:function(){return xI(this,"sub","","")}});var FI="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,HI=er,qI=function(e,t,n){for(var r in t)HI(e,r,t[r],n);return e},KI=or,jI=hr,YI=RangeError,JI=function(e){if(void 0===e)return 0;var t=KI(e),n=jI(t);if(t!==n)throw YI("Wrong length or index");return n},QI=Array,WI=Math.abs,zI=Math.pow,ZI=Math.floor,XI=Math.log,$I=Math.LN2,eT={pack:function(e,t,n){var r,i,o,s=QI(n),a=8*n-t-1,c=(1<<a)-1,u=c>>1,d=23===t?zI(2,-24)-zI(2,-77):0,l=e<0||0===e&&1/e<0?1:0,h=0;for((e=WI(e))!=e||e===1/0?(i=e!=e?1:0,r=c):(r=ZI(XI(e)/$I),e*(o=zI(2,-r))<1&&(r--,o*=2),(e+=r+u>=1?d/o:d*zI(2,1-u))*o>=2&&(r++,o/=2),r+u>=c?(i=0,r=c):r+u>=1?(i=(e*o-1)*zI(2,t),r+=u):(i=e*zI(2,u-1)*zI(2,t),r=0));t>=8;)s[h++]=255&i,i/=256,t-=8;for(r=r<<t|i,a+=t;a>0;)s[h++]=255&r,r/=256,a-=8;return s[--h]|=128*l,s},unpack:function(e,t){var n,r=e.length,i=8*r-t-1,o=(1<<i)-1,s=o>>1,a=i-7,c=r-1,u=e[c--],d=127&u;for(u>>=7;a>0;)d=256*d+e[c--],a-=8;for(n=d&(1<<-a)-1,d>>=-a,a+=t;a>0;)n=256*n+e[c--],a-=8;if(0===d)d=1-s;else{if(d===o)return n?NaN:u?-1/0:1/0;n+=zI(2,t),d-=s}return(u?-1:1)*n*zI(2,d-t)}},tT=Ge,nT=ur,rT=gr,iT=function(e){for(var t=tT(this),n=rT(t),r=arguments.length,i=nT(r>1?arguments[1]:void 0,n),o=r>2?arguments[2]:void 0,s=void 0===o?n:nT(o,n);s>i;)t[i++]=e;return t},oT=ur,sT=gr,aT=Es,cT=Array,uT=Math.max,dT=function(e,t,n){for(var r=sT(e),i=oT(t,r),o=oT(void 0===n?r:n,r),s=cT(uT(o-i,0)),a=0;i<o;i++,a++)aT(s,a,e[i]);return s.length=a,s},lT=r,hT=R,fT=s,gT=FI,pT=nn,vT=Wt,_T=qI,ET=o,mT=Af,IT=or,TT=hr,yT=JI,RT=eT,CT=XE,ST=uu,OT=tr.f,NT=Ut.f,AT=iT,MT=dT,UT=If,LT=pT.PROPER,wT=pT.CONFIGURABLE,bT=wn.get,PT=wn.set,DT="ArrayBuffer",BT="DataView",VT="prototype",GT="Wrong index",xT=lT[DT],kT=xT,FT=kT&&kT[VT],HT=lT[BT],qT=HT&&HT[VT],KT=Object.prototype,jT=lT.Array,YT=lT.RangeError,JT=hT(AT),QT=hT([].reverse),WT=RT.pack,zT=RT.unpack,ZT=function(e){return[255&e]},XT=function(e){return[255&e,e>>8&255]},$T=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},ey=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},ty=function(e){return WT(e,23,4)},ny=function(e){return WT(e,52,8)},ry=function(e,t){NT(e[VT],t,{get:function(){return bT(this)[t]}})},iy=function(e,t,n,r){var i=yT(n),o=bT(e);if(i+t>o.byteLength)throw YT(GT);var s=bT(o.buffer).bytes,a=i+o.byteOffset,c=MT(s,a,a+t);return r?c:QT(c)},oy=function(e,t,n,r,i,o){var s=yT(n),a=bT(e);if(s+t>a.byteLength)throw YT(GT);for(var c=bT(a.buffer).bytes,u=s+a.byteOffset,d=r(+i),l=0;l<t;l++)c[u+l]=d[o?l:t-l-1]};if(gT){var sy=LT&&xT.name!==DT;if(ET((function(){xT(1)}))&&ET((function(){new xT(-1)}))&&!ET((function(){return new xT,new xT(1.5),new xT(NaN),1!=xT.length||sy&&!wT})))sy&&wT&&vT(xT,"name",DT);else{(kT=function(e){return mT(this,FT),new xT(yT(e))})[VT]=FT;for(var ay,cy=OT(xT),uy=0;cy.length>uy;)(ay=cy[uy++])in kT||vT(kT,ay,xT[ay]);FT.constructor=kT}ST&&CT(qT)!==KT&&ST(qT,KT);var dy=new HT(new kT(2)),ly=hT(qT.setInt8);dy.setInt8(0,2147483648),dy.setInt8(1,2147483649),!dy.getInt8(0)&&dy.getInt8(1)||_T(qT,{setInt8:function(e,t){ly(this,e,t<<24>>24)},setUint8:function(e,t){ly(this,e,t<<24>>24)}},{unsafe:!0})}else FT=(kT=function(e){mT(this,FT);var t=yT(e);
1PT(this,{bytes:JT(jT(t),0),byteLength:t}),fT||(this.byteLength=t)})[VT],HT=function(e,t,n){mT(this,qT),mT(e,FT);var r=bT(e).byteLength,i=IT(t);if(i<0||i>r)throw YT("Wrong offset");if(i+(n=void 0===n?r-i:TT(n))>r)throw YT("Wrong length");PT(this,{buffer:e,byteLength:n,byteOffset:i}),fT||(this.buffer=e,this.byteLength=n,this.byteOffset=i)},qT=HT[VT],fT&&(ry(kT,"byteLength"),ry(HT,"buffer"),ry(HT,"byteLength"),ry(HT,"byteOffset")),_T(qT,{getInt8:function(e){return iy(this,1,e)[0]<<24>>24},getUint8:function(e){return iy(this,1,e)[0]},getInt16:function(e){var t=iy(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=iy(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return ey(iy(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return ey(iy(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return zT(iy(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return zT(iy(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){oy(this,1,e,ZT,t)},setUint8:function(e,t){oy(this,1,e,ZT,t)},setInt16:function(e,t){oy(this,2,e,XT,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){oy(this,2,e,XT,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){oy(this,4,e,$T,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){oy(this,4,e,$T,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){oy(this,4,e,ty,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){oy(this,8,e,ny,t,arguments.length>2?arguments[2]:void 0)}});UT(kT,DT),UT(HT,BT);var hy={ArrayBuffer:kT,DataView:HT},fy=Sf,gy="ArrayBuffer",py=hy[gy];ri({global:!0,constructor:!0,forced:r[gy]!==py},{ArrayBuffer:py}),fy(gy);var vy=ri,_y=Ao,Ey=o,Iy=Dt,Ty=ur,yy=hr,Ry=Vf,Cy=hy.ArrayBuffer,Sy=hy.DataView,Oy=Sy.prototype,Ny=_y(Cy.prototype.slice),Ay=_y(Oy.getUint8),My=_y(Oy.setUint8);vy({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Ey((function(){return!new Cy(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(Ny&&void 0===t)return Ny(Iy(this),e);for(var n=Iy(this).byteLength,r=Ty(e,n),i=Ty(void 0===t?n:t,n),o=new(Ry(this,Cy))(yy(i-r)),s=new Sy(this),a=new Sy(o),c=0;r<i;)My(a,c++,Ay(s,r++));return o}});var Uy,Ly,wy,by={exports:{}},Py=FI,Dy=s,By=r,Vy=q,Gy=Y,xy=Fe,ky=pi,Fy=ve,Hy=Wt,qy=er,Ky=Ut.f,jy=Z,Yy=XE,Jy=uu,Qy=rt,Wy=Ye,zy=wn.enforce,Zy=wn.get,Xy=By.Int8Array,$y=Xy&&Xy.prototype,eR=By.Uint8ClampedArray,tR=eR&&eR.prototype,nR=Xy&&Yy(Xy),rR=$y&&Yy($y),iR=Object.prototype,oR=By.TypeError,sR=Qy("toStringTag"),aR=Wy("TYPED_ARRAY_TAG"),cR="TypedArrayConstructor",uR=Py&&!!Jy&&"Opera"!==ky(By.opera),dR=!1,lR={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},hR={BigInt64Array:8,BigUint64Array:8},fR=function(e){var t=Yy(e);if(Gy(t)){var n=Zy(t);return n&&xy(n,cR)?n[cR]:fR(t)}},gR=function(e){if(!Gy(e))return!1;var t=ky(e);return xy(lR,t)||xy(hR,t)};for(Uy in lR)(wy=(Ly=By[Uy])&&Ly.prototype)?zy(wy)[cR]=Ly:uR=!1;for(Uy in hR)(wy=(Ly=By[Uy])&&Ly.prototype)&&(zy(wy)[cR]=Ly);if((!uR||!Vy(nR)||nR===Function.prototype)&&(nR=function(){throw oR("Incorrect invocation")},uR))for(Uy in lR)By[Uy]&&Jy(By[Uy],nR);if((!uR||!rR||rR===iR)&&(rR=nR.prototype,uR))for(Uy in lR)By[Uy]&&Jy(By[Uy].prototype,rR);if(uR&&Yy(tR)!==rR&&Jy(tR,rR),Dy&&!xy(rR,sR))for(Uy in dR=!0,Ky(rR,sR,{get:function(){return Gy(this)?this[aR]:void 0}}),lR)By[Uy]&&Hy(By[Uy],aR,Uy);var pR={NATIVE_ARRAY_BUFFER_VIEWS:uR,TYPED_ARRAY_TAG:dR&&aR,aTypedArray:function(e){if(gR(e))return e;throw oR("Target is not a typed array")},aTypedArrayConstructor:function(e){if(Vy(e)&&(!Jy||jy(nR,e)))return e;throw oR(Fy(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(Dy){if(n)for(var i in lR){var o=By[i];if(o&&xy(o.prototype,e))try{delete o.prototype[e]}catch(n){try{o.prototype[e]=t}catch(e){}}}rR[e]&&!n||qy(rR,e,n?t:uR&&$y[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(Dy){if(Jy){if(n)for(r in lR)if((i=By[r])&&xy(i,e))try{delete i[e]}catch(e){}if(nR[e]&&!n)return;try{return qy(nR,e,n?t:uR&&nR[e]||t)}catch(e){}}for(r in lR)!(i=By[r])||i[e]&&!n||qy(i,e,t)}},getTypedArrayConstructor:fR,isView:function(e){if(!Gy(e))return!1;var t=ky(e);return"DataView"===t||xy(lR,t)||xy(hR,t)},isTypedArray:gR,TypedArray:nR,TypedArrayPrototype:rR},vR=r,_R=o,ER=jv,mR=pR.NATIVE_ARRAY_BUFFER_VIEWS,IR=vR.ArrayBuffer,TR=vR.Int8Array,yR=!mR||!_R((function(){TR(1)}))||!_R((function(){new TR(-1)}))||!ER((function(e){new TR,new TR(null),new TR(1.5),new TR(e)}),!0)||_R((function(){return 1!==new TR(new IR(2),1,void 0).length})),RR=Y,CR=Math.floor,SR=Number.isInteger||function(e){return!RR(e)&&isFinite(e)&&CR(e)===e},OR=or,NR=RangeError,AR=function(e){var t=OR(e);if(t<0)throw NR("The argument can't be less than 0");return t},MR=RangeError,UR=function(e,t){var n=AR(e);if(n%t)throw MR("Wrong offset");return n},LR=pi,wR=lt,bR=TypeError,PR=function(e){var t=wR(e,"number");if("number"==typeof t)throw bR("Can't convert number to bigint");return BigInt(t)},DR=Lc,BR=d,VR=wf,GR=Ge,xR=gr,kR=yv,FR=pv,HR=uv,qR=function(e){var t=LR(e);return"BigInt64Array"==t||"BigUint64Array"==t}
vendor: 4,630 bytes, line 1
1,KR=pR.aTypedArrayConstructor,jR=PR,YR=ri,JR=r,QR=d,WR=s,zR=yR,ZR=pR,XR=hy,$R=Af,eC=E,tC=Wt,nC=SR,rC=hr,iC=JI,oC=UR,sC=gt,aC=Fe,cC=pi,uC=Y,dC=ge,lC=Zi,hC=Z,fC=uu,gC=tr.f,pC=function(e){var t,n,r,i,o,s,a,c,u=VR(this),d=GR(e),l=arguments.length,h=l>1?arguments[1]:void 0,f=void 0!==h,g=FR(d);if(g&&!HR(g))for(c=(a=kR(d,g)).next,d=[];!(s=BR(c,a)).done;)d.push(s.value);for(f&&l>2&&(h=DR(h,arguments[2])),n=xR(d),r=new(KR(u))(n),i=qR(r),t=0;n>t;t++)o=f?h(d[t],t):d[t],r[t]=i?jR(o):+o;return r},vC=xc.forEach,_C=Sf,EC=Ut,mC=i,IC=fu,TC=wn.get,yC=wn.set,RC=wn.enforce,CC=EC.f,SC=mC.f,OC=Math.round,NC=JR.RangeError,AC=XR.ArrayBuffer,MC=AC.prototype,UC=XR.DataView,LC=ZR.NATIVE_ARRAY_BUFFER_VIEWS,wC=ZR.TYPED_ARRAY_TAG,bC=ZR.TypedArray,PC=ZR.TypedArrayPrototype,DC=ZR.aTypedArrayConstructor,BC=ZR.isTypedArray,VC="BYTES_PER_ELEMENT",GC="Wrong length",xC=function(e,t){DC(e);for(var n=0,r=t.length,i=new e(r);r>n;)i[n]=t[n++];return i},kC=function(e,t){CC(e,t,{get:function(){return TC(this)[t]}})},FC=function(e){var t;return hC(MC,e)||"ArrayBuffer"==(t=cC(e))||"SharedArrayBuffer"==t},HC=function(e,t){return BC(e)&&!dC(t)&&t in e&&nC(+t)&&t>=0},qC=function(e,t){return t=sC(t),HC(e,t)?eC(2,e[t]):SC(e,t)},KC=function(e,t,n){return t=sC(t),!(HC(e,t)&&uC(n)&&aC(n,"value"))||aC(n,"get")||aC(n,"set")||n.configurable||aC(n,"writable")&&!n.writable||aC(n,"enumerable")&&!n.enumerable?CC(e,t,n):(e[t]=n.value,e)};WR?(LC||(mC.f=qC,EC.f=KC,kC(PC,"buffer"),kC(PC,"byteOffset"),kC(PC,"byteLength"),kC(PC,"length")),YR({target:"Object",stat:!0,forced:!LC},{getOwnPropertyDescriptor:qC,defineProperty:KC}),by.exports=function(e,t,n){var r=e.match(/\d+$/)[0]/8,i=e+(n?"Clamped":"")+"Array",o="get"+e,s="set"+e,a=JR[i],c=a,u=c&&c.prototype,d={},l=function(e,t){CC(e,t,{get:function(){return function(e,t){var n=TC(e);return n.view[o](t*r+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,i){var o=TC(e);n&&(i=(i=OC(i))<0?0:i>255?255:255&i),o.view[s](t*r+o.byteOffset,i,!0)}(this,t,e)},enumerable:!0})};LC?zR&&(c=t((function(e,t,n,i){return $R(e,u),IC(uC(t)?FC(t)?void 0!==i?new a(t,oC(n,r),i):void 0!==n?new a(t,oC(n,r)):new a(t):BC(t)?xC(c,t):QR(pC,c,t):new a(iC(t)),e,c)})),fC&&fC(c,bC),vC(gC(a),(function(e){e in c||tC(c,e,a[e])})),c.prototype=u):(c=t((function(e,t,n,i){$R(e,u);var o,s,a,d=0,h=0;if(uC(t)){if(!FC(t))return BC(t)?xC(c,t):QR(pC,c,t);o=t,h=oC(n,r);var f=t.byteLength;if(void 0===i){if(f%r)throw NC(GC);if((s=f-h)<0)throw NC(GC)}else if((s=rC(i)*r)+h>f)throw NC(GC);a=s/r}else a=iC(t),o=new AC(s=a*r);for(yC(e,{buffer:o,byteOffset:h,byteLength:s,length:a,view:new UC(o)});d<a;)l(e,d++)})),fC&&fC(c,bC),u=c.prototype=lC(PC)),u.constructor!==c&&tC(u,"constructor",c),RC(u).TypedArrayConstructor=c,wC&&tC(u,wC,i);var h=c!=a;d[i]=c,YR({global:!0,constructor:!0,forced:h,sham:!LC},d),VC in c||tC(c,VC,r),VC in u||tC(u,VC,r),_C(i)}):by.exports=function(){},(0,by.exports)("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var jC=Ge,YC=ur,JC=gr,QC=bl,WC=Math.min,zC=[].copyWithin||function(e,t){var n=jC(this),r=JC(n),i=YC(e,r),o=YC(t,r),s=arguments.length>2?arguments[2]:void 0,a=WC((void 0===s?r:YC(s,r))-o,r-i),c=1;for(o<i&&i<o+a&&(c=-1,o+=a-1,i+=a-1);a-- >0;)o in n?n[i]=n[o]:QC(n,i),i+=c,o+=c;return n},ZC=pR,XC=R(zC),$C=ZC.aTypedArray;(0,ZC.exportTypedArrayMethod)("copyWithin",(function(e,t){return XC($C(this),e,t,arguments.length>2?arguments[2]:void 0)}));var eS=xc.every,tS=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("every",(function(e){return eS(tS(this),e,arguments.length>1?arguments[1]:void 0)}));var nS=iT,rS=PR,iS=pi,oS=d,sS=o,aS=pR.aTypedArray,cS=pR.exportTypedArrayMethod,uS=R("".slice);cS("fill",(function(e){var t=arguments.length;aS(this);var n="Big"===uS(iS(this),0,3)?rS(e):+e;return oS(nS,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),sS((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})));var dS=gr,lS=Vf,hS=pR.aTypedArrayConstructor,fS=pR.getTypedArrayConstructor,gS=function(e){return hS(lS(e,fS(e)))},pS=function(e,t){for(var n=0,r=dS(t),i=new e(r);r>n;)i[n]=t[n++];return i},vS=gS,_S=xc.filter,ES=function(e,t){return pS(vS(e),t)},mS=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("filter",(function(e){var t=_S(mS(this),e,arguments.length>1?arguments[1]:void 0);return ES(this,t)}));var IS=xc.find,TS=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("find",(function(e){return IS(TS(this),e,arguments.length>1?arguments[1]:void 0)}));var yS=xc.findIndex,RS=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("findIndex",(function(e){return yS(RS(this),e,arguments.length>1?arguments[1]:void 0)}));var CS=xc.forEach,SS=pR.aTypedArray;
vendor: 4,327 bytes, line 1
1(0,pR.exportTypedArrayMethod)("forEach",(function(e){CS(SS(this),e,arguments.length>1?arguments[1]:void 0)}));var OS=mr.includes,NS=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("includes",(function(e){return OS(NS(this),e,arguments.length>1?arguments[1]:void 0)}));var AS=mr.indexOf,MS=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("indexOf",(function(e){return AS(MS(this),e,arguments.length>1?arguments[1]:void 0)}));var US=r,LS=o,wS=R,bS=pR,PS=Jm,DS=rt("iterator"),BS=US.Uint8Array,VS=wS(PS.values),GS=wS(PS.keys),xS=wS(PS.entries),kS=bS.aTypedArray,FS=bS.exportTypedArrayMethod,HS=BS&&BS.prototype,qS=!LS((function(){HS[DS].call([1])})),KS=!!HS&&HS.values&&HS[DS]===HS.values&&"values"===HS.values.name,jS=function(){return VS(kS(this))};FS("entries",(function(){return xS(kS(this))}),qS),FS("keys",(function(){return GS(kS(this))}),qS),FS("values",jS,qS||!KS,{name:"values"}),FS(DS,jS,qS||!KS,{name:"values"});var YS=pR.aTypedArray,JS=pR.exportTypedArrayMethod,QS=R([].join);JS("join",(function(e){return QS(YS(this),e)}));var WS=ca,zS=x,ZS=or,XS=gr,$S=Jc,eO=Math.min,tO=[].lastIndexOf,nO=!!tO&&1/[1].lastIndexOf(1,-0)<0,rO=$S("lastIndexOf"),iO=nO||!rO?function(e){if(nO)return WS(tO,this,arguments)||0;var t=zS(this),n=XS(t),r=n-1;for(arguments.length>1&&(r=eO(r,ZS(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:tO,oO=ca,sO=iO,aO=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return oO(sO,aO(this),t>1?[e,arguments[1]]:[e])}));var cO=xc.map,uO=gS,dO=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("map",(function(e){return cO(dO(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(uO(e))(t)}))}));var lO=Ie,hO=Ge,fO=w,gO=gr,pO=TypeError,vO=function(e){return function(t,n,r,i){lO(n);var o=hO(t),s=fO(o),a=gO(o),c=e?a-1:0,u=e?-1:1;if(r<2)for(;;){if(c in s){i=s[c],c+=u;break}if(c+=u,e?c<0:a<=c)throw pO("Reduce of empty array with no initial value")}for(;e?c>=0:a>c;c+=u)c in s&&(i=n(i,s[c],c,o));return i}},_O={left:vO(!1),right:vO(!0)},EO=_O.left,mO=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return EO(mO(this),e,t,t>1?arguments[1]:void 0)}));var IO=_O.right,TO=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return IO(TO(this),e,t,t>1?arguments[1]:void 0)}));var yO=pR.aTypedArray,RO=pR.exportTypedArrayMethod,CO=Math.floor;RO("reverse",(function(){for(var e,t=this,n=yO(t).length,r=CO(n/2),i=0;i<r;)e=t[i],t[i++]=t[--n],t[n]=e;return t}));var SO=r,OO=d,NO=pR,AO=gr,MO=UR,UO=Ge,LO=o,wO=SO.RangeError,bO=SO.Int8Array,PO=bO&&bO.prototype,DO=PO&&PO.set,BO=NO.aTypedArray,VO=NO.exportTypedArrayMethod,GO=!LO((function(){var e=new Uint8ClampedArray(2);return OO(DO,e,{length:1,0:3},1),3!==e[1]})),xO=GO&&NO.NATIVE_ARRAY_BUFFER_VIEWS&&LO((function(){var e=new bO(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));VO("set",(function(e){BO(this);var t=MO(arguments.length>1?arguments[1]:void 0,1),n=UO(e);if(GO)return OO(DO,this,n,t);var r=this.length,i=AO(n),o=0;if(i+t>r)throw wO("Wrong length");for(;o<i;)this[t+o]=n[o++]}),!GO||xO);var kO=gS,FO=fc,HO=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("slice",(function(e,t){for(var n=FO(HO(this),e,t),r=kO(this),i=0,o=n.length,s=new r(o);o>i;)s[i]=n[i++];return s}),o((function(){new Int8Array(1).slice()})));var qO=xc.some,KO=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("some",(function(e){return qO(KO(this),e,arguments.length>1?arguments[1]:void 0)}));var jO=dT,YO=Math.floor,JO=function(e,t){var n=e.length,r=YO(n/2);return n<8?QO(e,t):WO(e,JO(jO(e,0,r),t),JO(jO(e,r),t),t)},QO=function(e,t){for(var n,r,i=e.length,o=1;o<i;){for(r=o,n=e[o];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==o++&&(e[r]=n)}return e},WO=function(e,t,n,r){for(var i=t.length,o=n.length,s=0,a=0;s<i||a<o;)e[s+a]=s<i&&a<o?r(t[s],n[a])<=0?t[s++]:n[a++]:s<i?t[s++]:n[a++];return e},zO=JO,ZO=X.match(/firefox\/(\d+)/i),XO=!!ZO&&+ZO[1],$O=/MSIE|Trident/.test(X),eN=X.match(/AppleWebKit\/(\d+)\./),tN=!!eN&&+eN[1],nN=Ao,rN=o,iN=Ie,oN=zO,sN=XO,aN=$O,cN=oe,uN=tN,dN=pR.aTypedArray,lN=pR.exportTypedArrayMethod,hN=r.Uint16Array,fN=hN&&nN(hN.prototype.sort),gN=!(!fN||rN((function(){fN(new hN(2),null)}))&&rN((function(){fN(new hN(2),{})}))),pN=!!fN&&!rN((function(){if(cN)return cN<74;if(sN)return sN<67;if(aN)return!0;
1if(uN)return uN<602;var e,t,n=new hN(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(fN(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==r[e])return!0}));lN("sort",(function(e){return void 0!==e&&iN(e),pN?fN(this,e):oN(dN(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))}),!pN||gN);var vN=hr,_N=ur,EN=gS,mN=pR.aTypedArray;(0,pR.exportTypedArrayMethod)("subarray",(function(e,t){var n=mN(this),r=n.length,i=_N(e,r);return new(EN(n))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,vN((void 0===t?r:_N(t,r))-i))}));var IN=ca,TN=pR,yN=o,RN=fc,CN=r.Int8Array,SN=TN.aTypedArray,ON=TN.exportTypedArrayMethod,NN=[].toLocaleString,AN=!!CN&&yN((function(){NN.call(new CN(1))}));ON("toLocaleString",(function(){return IN(NN,AN?RN(SN(this)):SN(this),RN(arguments))}),yN((function(){return[1,2].toLocaleString()!=new CN([1,2]).toLocaleString()}))||!yN((function(){CN.prototype.toLocaleString.call([1,2])})));var MN=pR.exportTypedArrayMethod,UN=o,LN=R,wN=r.Uint8Array,bN=wN&&wN.prototype||{},PN=[].toString,DN=LN([].join);UN((function(){PN.call({})}))&&(PN=function(){return DN(this)});var BN=bN.toString!=PN;MN("toString",PN,BN);var VN=nd;function GN(e){var t=function(){function e(e,t,n){this.low=0|e,this.high=0|t,this.unsigned=!!n}function t(e){return!0===(e&&e.__isLong__)}function n(e,t){var n,r,o;return t?(o=(e>>>=0)>=0&&e<256)&&(r=c[e])?r:(n=i(e,(0|e)<0?-1:0,!0),o&&(c[e]=n),n):(o=(e|=0)>=-128&&e<128)&&(r=a[e])?r:(n=i(e,e<0?-1:0,!1),o&&(a[e]=n),n)}function r(e,t){if(isNaN(e)||!isFinite(e))return t?p:g;if(t){if(e<0)return p;if(e>=l)return I}else{if(-h>=e)return T;if(e+1>=h)return m}return e<0?r(-e,t).neg():i(0|e%d,0|e/d,t)}function i(t,n,r){return new e(t,n,r)}function o(e,t,n){var i,s,a,c,d,l,h;if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(n=t,t=!1):t=!!t,(n=n||10)<2||n>36)throw RangeError("radix");if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return o(e.substring(1),t,n).neg();for(s=r(u(n,8)),a=g,c=0;c<e.length;c+=8)d=Math.min(8,e.length-c),l=parseInt(e.substring(c,c+d),n),d<8?(h=r(u(n,d)),a=a.mul(h).add(r(l))):a=(a=a.mul(s)).add(r(l));return a.unsigned=t,a}function s(t){return t instanceof e?t:"number"==typeof t?r(t):"string"==typeof t?o(t):i(t.low,t.high,t.unsigned)}var a,c,u,d,l,h,f,g,p,v,_,E,m,I,T,y;return e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t,a={},c={},e.fromInt=n,e.fromNumber=r,e.fromBits=i,u=Math.pow,e.fromString=o,e.fromValue=s,65536,1<<24,h=(l=(d=4294967296)*d)/2,f=n(16777216),g=n(0),e.ZERO=g,p=n(0,!0),e.UZERO=p,v=n(1),e.ONE=v,_=n(1,!0),e.UONE=_,E=n(-1),e.NEG_ONE=E,m=i(-1,2147483647,!1),e.MAX_VALUE=m,I=i(-1,-1,!0),e.MAX_UNSIGNED_VALUE=I,T=i(0,-2147483648,!1),e.MIN_VALUE=T,(y=e.prototype).toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*d+(this.low>>>0):this.high*d+(this.low>>>0)},y.toString=function(e){var t,n,i,o,s,a,c,d;if((e=e||10)<2||e>36)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())return this.eq(T)?(t=r(e),i=(n=this.div(t)).mul(t).sub(this),n.toString(e)+i.toInt().toString(e)):"-"+this.neg().toString(e);for(o=r(u(e,6),this.unsigned),s=this,a="";;){if(c=s.div(o),d=(s.sub(c.mul(o)).toInt()>>>0).toString(e),(s=c).isZero())return d+a;for(;d.length<6;)d="0"+d;a=""+d+a}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){var e,t;if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},y.isZero=function(){return 0===this.high&&0===this.low},y.isNegative=function(){return!this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return 1==(1&this.low)},y.isEven=function(){return 0==(1&this.low)},y.equals=function(e){return t(e)||(e=s(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},y.eq=y.equals,y.notEquals=function(e){return!this.eq(e)},y.neq=y.notEquals,y.lessThan=function(e){return this.comp(e)<0}
1,y.lt=y.lessThan,y.lessThanOrEqual=function(e){return this.comp(e)<=0},y.lte=y.lessThanOrEqual,y.greaterThan=function(e){return this.comp(e)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(e){return this.comp(e)>=0},y.gte=y.greaterThanOrEqual,y.compare=function(e){if(t(e)||(e=s(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(v)},y.neg=y.negate,y.add=function(e){var n,r,o,a,c,u,d,l,h,f,g;return t(e)||(e=s(e)),n=this.high>>>16,r=65535&this.high,o=this.low>>>16,a=65535&this.low,c=e.high>>>16,u=65535&e.high,d=e.low>>>16,l=0,h=0,f=0,g=0,f+=(g+=a+(65535&e.low))>>>16,h+=(f+=o+d)>>>16,l+=(h+=r+u)>>>16,l+=n+c,i((f&=65535)<<16|(g&=65535),(l&=65535)<<16|(h&=65535),this.unsigned)},y.subtract=function(e){return t(e)||(e=s(e)),this.add(e.neg())},y.sub=y.subtract,y.multiply=function(e){var n,o,a,c,u,d,l,h,p,v,_,E;return this.isZero()?g:(t(e)||(e=s(e)),e.isZero()?g:this.eq(T)?e.isOdd()?T:g:e.eq(T)?this.isOdd()?T:g:this.isNegative()?e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg():e.isNegative()?this.mul(e.neg()).neg():this.lt(f)&&e.lt(f)?r(this.toNumber()*e.toNumber(),this.unsigned):(n=this.high>>>16,o=65535&this.high,a=this.low>>>16,c=65535&this.low,u=e.high>>>16,d=65535&e.high,l=e.low>>>16,p=0,v=0,_=0,E=0,_+=(E+=c*(h=65535&e.low))>>>16,v+=(_+=a*h)>>>16,_&=65535,v+=(_+=c*l)>>>16,p+=(v+=o*h)>>>16,v&=65535,p+=(v+=a*l)>>>16,v&=65535,p+=(v+=c*d)>>>16,p+=n*h+o*l+a*d+c*u,i((_&=65535)<<16|(E&=65535),(p&=65535)<<16|(v&=65535),this.unsigned)))},y.mul=y.multiply,y.divide=function(e){var n,i,o,a,c,d,l;if(t(e)||(e=s(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?p:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return p;if(e.gt(this.shru(1)))return _;o=p}else{if(this.eq(T))return e.eq(v)||e.eq(E)?T:e.eq(T)?v:(n=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?v:E:(i=this.sub(e.mul(n)),o=n.add(i.div(e)));if(e.eq(T))return this.unsigned?p:g;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=g}for(i=this;i.gte(e);){for(n=Math.max(1,Math.floor(i.toNumber()/e.toNumber())),c=(a=Math.ceil(Math.log(n)/Math.LN2))<=48?1:u(2,a-48),l=(d=r(n)).mul(e);l.isNegative()||l.gt(i);)l=(d=r(n-=c,this.unsigned)).mul(e);d.isZero()&&(d=v),o=o.add(d),i=i.sub(l)}return o},y.div=y.divide,y.modulo=function(e){return t(e)||(e=s(e)),this.sub(this.div(e).mul(e))},y.mod=y.modulo,y.not=function(){return i(~this.low,~this.high,this.unsigned)},y.and=function(e){return t(e)||(e=s(e)),i(this.low&e.low,this.high&e.high,this.unsigned)},y.or=function(e){return t(e)||(e=s(e)),i(this.low|e.low,this.high|e.high,this.unsigned)},y.xor=function(e){return t(e)||(e=s(e)),i(this.low^e.low,this.high^e.high,this.unsigned)},y.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):i(0,this.low<<e-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?i(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):i(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(e){var n;return t(e)&&(e=e.toInt()),0===(e&=63)?this:(n=this.high,e<32?i(this.low>>>e|n<<32-e,n>>>e,this.unsigned):i(32===e?n:n>>>e-32,0,this.unsigned))},y.shru=y.shiftRightUnsigned,y.toSigned=function(){return this.unsigned?i(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:i(this.low,this.high,!0)},y.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,255&t>>>8,255&t>>>16,255&t>>>24,255&e,255&e>>>8,255&e>>>16,255&e>>>24]},y.toBytesBE=function(){var e=this.high,t=this.low;return[255&e>>>24,255&e>>>16,255&e>>>8,255&e,255&t>>>24,255&t>>>16,255&t>>>8,255&t]},e}(),n=function(e){function t(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function n(){var e=[],t=[];return function(){return 0===arguments.length?t.join("")+a.apply(String,e):(e.length+arguments.length>1024&&(t.push(a.apply(String,e)),e.length=0),void Array.prototype.push.apply(e,arguments))}}function r(e,t,n,r,i){var o,s,a=8*i-r-1,c=(1<<a)-1,u=c>>1,d=-7,l=n?i-1:0,h=n?-1:1,f=e[t+l];for(l+=h,o=f&(1<<-d)-1,f>>=-d,d+=a;d>0;o=256*o+e[t+l],l+=h,d-=8);for(s=o&(1<<-d)-1,o>>=-d,d+=r;d>0;s=256*s+e[t+l],l+=h,d-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,r),o-=u}return(f?-1:1)*s*Math.pow(2,o-r)}function i(e,t,n,r,i,o){var s,a,c,u=8*o-i-1,d=(1<<u)-1,l=d>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,g=r?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=d):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(s++,c/=2),s+l>=d?(a=0,s=d):s+l>=1?(a=(t*c-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[n+f]=255&a,f+=g,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[n+f]=255&s,f+=g,s/=256,u-=8);e[n+f-g]|=128*p}var o,s,a,c,u,d=function e(t,n,r){if(void 0===t&&(t=e.DEFAULT_CAPACITY),void 0===n&&(n=e.DEFAULT_ENDIAN),void 0===r&&(r=e.DEFAULT_NOASSERT),!r){if((t|=0)<0)throw RangeError("Illegal capacity");n=!!n,r=!!r}this.buffer=0===t?s:new ArrayBuffer(t),this.view=0===t?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=t,this.littleEndian=n,this.noAssert=r};return d.VERSION="5.0.1",d.LITTLE_ENDIAN=!0,d.BIG_ENDIAN=!1,d.DEFAULT_CAPACITY=16,d.DEFAULT_ENDIAN=d.BIG_ENDIAN,d.DEFAULT_NOASSERT=!1,d.Long=e||null,(o=d.prototype).__isByteBuffer__,Object.defineProperty(o,"__isByteBuffer__",{value:!0,enumerable:!1,
1configurable:!1}),s=new ArrayBuffer(0),a=String.fromCharCode,d.accessor=function(){return Uint8Array},d.allocate=function(e,t,n){return new d(e,t,n)},d.concat=function(e,t,n,r){var i,o,s,a,c,u;for(("boolean"==typeof t||"string"!=typeof t)&&(r=n,n=t,t=void 0),i=0,s=0,a=e.length;a>s;++s)d.isByteBuffer(e[s])||(e[s]=d.wrap(e[s],t)),(o=e[s].limit-e[s].offset)>0&&(i+=o);if(0===i)return new d(0,n,r);for(u=new d(i,n,r),s=0;a>s;)(o=(c=e[s++]).limit-c.offset)<=0||(u.view.set(c.view.subarray(c.offset,c.limit),u.offset),u.offset+=o);return u.limit=u.offset,u.offset=0,u},d.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},d.type=function(){return ArrayBuffer},d.wrap=function(e,t,n,r){var i,s;if("string"!=typeof t&&(r=n,n=t,t=void 0),"string"==typeof e)switch(void 0===t&&(t="utf8"),t){case"base64":return d.fromBase64(e,n);case"hex":return d.fromHex(e,n);case"binary":return d.fromBinary(e,n);case"utf8":return d.fromUTF8(e,n);case"debug":return d.fromDebug(e,n);default:throw Error("Unsupported encoding: "+t)}if(null===e||"object"!==si(e))throw TypeError("Illegal buffer");if(d.isByteBuffer(e))return(i=o.clone.call(e)).markedOffset=-1,i;if(e instanceof Uint8Array)i=new d(0,n,r),e.length>0&&(i.buffer=e.buffer,i.offset=e.byteOffset,i.limit=e.byteOffset+e.byteLength,i.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)i=new d(0,n,r),e.byteLength>0&&(i.buffer=e,i.offset=0,i.limit=e.byteLength,i.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for((i=new d(e.length,n,r)).limit=e.length,s=0;s<e.length;++s)i.view[s]=e[s]}return i},o.writeBitSet=function(e,t){var n,r,i,o,s,a,c=void 0===t;if(c&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for(r=t,o=(i=e.length)>>3,s=0,t+=this.writeVarint32(i,t);o--;)n=1&!!e[s++]|(1&!!e[s++])<<1|(1&!!e[s++])<<2|(1&!!e[s++])<<3|(1&!!e[s++])<<4|(1&!!e[s++])<<5|(1&!!e[s++])<<6|(1&!!e[s++])<<7,this.writeByte(n,t++);if(i>s){for(a=0,n=0;i>s;)n|=(1&!!e[s++])<<a++;this.writeByte(n,t++)}return c?(this.offset=t,this):t-r},o.readBitSet=function(e){var t,n,r,i,o,s,a,c=void 0===e;for(c&&(e=this.offset),i=(r=(n=this.readVarint32(e)).value)>>3,o=0,s=[],e+=n.length;i--;)t=this.readByte(e++),s[o++]=!!(1&t),s[o++]=!!(2&t),s[o++]=!!(4&t),s[o++]=!!(8&t),s[o++]=!!(16&t),s[o++]=!!(32&t),s[o++]=!!(64&t),s[o++]=!!(128&t);if(r>o)for(a=0,t=this.readByte(e++);r>o;)s[o++]=!!(1&t>>a++);return c&&(this.offset=e),s},o.readBytes=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}return n=this.slice(t,t+e),r&&(this.offset+=e),n},o.writeBytes=o.append,o.writeInt8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},o.writeByte=o.writeInt8,o.readInt8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return 128==(128&(t=this.view[e]))&&(t=-(255-t+1)),n&&(this.offset+=1),t},o.readByte=o.readInt8,o.writeUint8=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=1)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},o.writeUInt8=o.writeUint8,o.readUint8=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=this.view[e],n&&(this.offset+=1),t},o.readUInt8=o.readUint8,o.writeInt16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},o.writeShort=o.writeInt16,o.readInt16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),32768==(32768&t)&&(t=-(65535-t+1)),n&&(this.offset+=2),t},o.readShort=o.readInt16,o.writeUint16=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=2)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},o.writeUInt16=o.writeUint16,o.readUint16=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e],t|=this.view[e+1]<<8):(t=this.view[e]<<8,t|=this.view[e+1]),n&&(this.offset+=2),t},o.readUInt16=o.readUint16,o.writeInt32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},o.writeInt=o.writeInt32,o.readInt32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),t|=0,n&&(this.offset+=4),t},o.readInt=o.readInt32,o.writeUint32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,this.littleEndian?(this.view[t+3]=255&e>>>24,this.view[t+2]=255&e>>>16,this.view[t+1]=255&e>>>8,this.view[t]=255&e):(this.view[t]=255&e>>>24,this.view[t+1]=255&e>>>16,this.view[t+2]=255&e>>>8,this.view[t+3]=255&e),r&&(this.offset+=4),this},o.writeUInt32=o.writeUint32,o.readUint32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=0,this.littleEndian?(t=this.view[e+2]<<16,t|=this.view[e+1]<<8,t|=this.view[e],t+=this.view[e+3]<<24>>>0):(t=this.view[e+1]<<16,t|=this.view[e+2]<<8,t|=this.view[e+3],t+=this.view[e]<<24>>>0),n&&(this.offset+=4),t},o.readUInt32=o.readUint32,e&&(o.writeInt64=function(t,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,o=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o):(this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),s&&(this.offset+=8),this},o.writeLong=o.writeInt64,o.readInt64=function(t){var n,r,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!1),o&&(this.offset+=8),i},o.readLong=o.readInt64,o.writeUint64=function(t,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),(n+=8)>(r=this.buffer.byteLength)&&this.resize((r*=2)>n?r:n),n-=8,i=t.low,o=t.high,this.littleEndian?(this.view[n+3]=255&i>>>24,this.view[n+2]=255&i>>>16,this.view[n+1]=255&i>>>8,this.view[n]=255&i,n+=4,this.view[n+3]=255&o>>>24,this.view[n+2]=255&o>>>16,this.view[n+1]=255&o>>>8,this.view[n]=255&o):(this.view[n]=255&o>>>24,this.view[n+1]=255&o>>>16,this.view[n+2]=255&o>>>8,this.view[n+3]=255&o,n+=4,this.view[n]=255&i>>>24,this.view[n+1]=255&i>>>16,this.view[n+2]=255&i>>>8,this.view[n+3]=255&i),s&&(this.offset+=8),this},o.writeUInt64=o.writeUint64,o.readUint64=function(t){var n,r,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}return n=0,r=0,this.littleEndian?(n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0,t+=4,r=this.view[t+2]<<16,r|=this.view[t+1]<<8,r|=this.view[t],r+=this.view[t+3]<<24>>>0):(r=this.view[t+1]<<16,r|=this.view[t+2]<<8,r|=this.view[t+3],r+=this.view[t]<<24>>>0,t+=4,n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0),i=new e(n,r,!0),o&&(this.offset+=8),i},o.readUInt64=o.readUint64),o.writeFloat32=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=4)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=4,i(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},o.writeFloat=o.writeFloat32,o.readFloat32=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,23,4),n&&(this.offset+=4),t},o.readFloat=o.readFloat32,o.writeFloat64=function(e,t){var n,r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}return(t+=8)>(n=this.buffer.byteLength)&&this.resize((n*=2)>t?n:t),t-=8,i(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},o.writeDouble=o.writeFloat64,o.readFloat64=function(e){var t,n=void 0===e;if(n&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}return t=r(this.view,e,this.littleEndian,52,8),n&&(this.offset+=8),t},o.readDouble=o.readFloat64,d.MAX_VARINT32_BYTES=5,d.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:1<<21>e?3:1<<28>e?4:5},d.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},d.zigZagDecode32=function(e){return 0|e>>>1^-(1&e)},o.writeVarint32=function(e,t){var n,r,i,o=void 0===t;if(o&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}for((t+=r=d.calculateVarint32(e))>(i=this.buffer.byteLength)&&this.resize((i*=2)>t?i:t),t-=r,e>>>=0;e>=128;)n=128|127&e,this.view[t++]=n,e>>>=7;return this.view[t++]=e,o?(this.offset=t,this):r},o.writeVarint32ZigZag=function(e,t){return this.writeVarint32(d.zigZagEncode32(e),t)},o.readVarint32=function(e){var t,n,r,i,o=void 0===e;
1if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}n=0,r=0;do{if(!this.noAssert&&e>this.limit)throw(i=Error("Truncated")).truncated=!0,i;t=this.view[e++],n<5&&(r|=(127&t)<<7*n),++n}while(0!=(128&t));return r|=0,o?(this.offset=e,r):{value:r,length:n}},o.readVarint32ZigZag=function(e){var t=this.readVarint32(e);return"object"===si(t)?t.value=d.zigZagDecode32(t.value):t=d.zigZagDecode32(t),t},e&&(d.MAX_VARINT64_BYTES=10,d.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var n=t.toInt()>>>0,r=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==r?n<16384?n<128?1:2:1<<21>n?3:4:r<16384?r<128?5:6:1<<21>r?7:8:i<128?9:10},d.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},d.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},o.writeVarint64=function(t,n){var r,i,o,s,a,c=void 0===n;if(c&&(n=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}switch("number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),r=d.calculateVarint64(t),i=t.toInt()>>>0,o=t.shiftRightUnsigned(28).toInt()>>>0,s=t.shiftRightUnsigned(56).toInt()>>>0,(n+=r)>(a=this.buffer.byteLength)&&this.resize((a*=2)>n?a:n),n-=r,r){case 10:this.view[n+9]=1&s>>>7;case 9:this.view[n+8]=9!==r?128|s:127&s;case 8:this.view[n+7]=8!==r?128|o>>>21:127&o>>>21;case 7:this.view[n+6]=7!==r?128|o>>>14:127&o>>>14;case 6:this.view[n+5]=6!==r?128|o>>>7:127&o>>>7;case 5:this.view[n+4]=5!==r?128|o:127&o;case 4:this.view[n+3]=4!==r?128|i>>>21:127&i>>>21;case 3:this.view[n+2]=3!==r?128|i>>>14:127&i>>>14;case 2:this.view[n+1]=2!==r?128|i>>>7:127&i>>>7;case 1:this.view[n]=1!==r?128|i:127&i}return c?(this.offset+=r,this):r},o.writeVarint64ZigZag=function(e,t){return this.writeVarint64(d.zigZagEncode64(e),t)},o.readVarint64=function(t){var n,r,i,o,s,a,c=void 0===t;if(c&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}if(n=t,r=0,i=0,o=0,s=0,r=127&(s=this.view[t++]),128&s&&(r|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(r|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(r|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(i=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<7,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<14,(128&s||this.noAssert&&void 0===s)&&(i|=(127&(s=this.view[t++]))<<21,(128&s||this.noAssert&&void 0===s)&&(o=127&(s=this.view[t++]),(128&s||this.noAssert&&void 0===s)&&(o|=(127&(s=this.view[t++]))<<7,128&s||this.noAssert&&void 0===s))))))))))throw Error("Buffer overrun");return a=e.fromBits(r|i<<28,i>>>4|o<<24,!1),c?(this.offset=t,a):{value:a,length:t-n}},o.readVarint64ZigZag=function(t){var n=this.readVarint64(t);return n&&n.value instanceof e?n.value=d.zigZagDecode64(n.value):n=d.zigZagDecode64(n),n}),o.writeCString=function(e,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),i=e.length,!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(r=0;i>r;++r)if(0===e.charCodeAt(r))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}
1return i=u.calculateUTF16asUTF8(t(e))[1],n+=i+1,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=i+1,u.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),this.view[n++]=0,s?(this.offset=n,this):i},o.readCString=function(e){var t,r,i,o=void 0===e;if(o&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,i=-1,u.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view[e++])?null:i}.bind(this),r=n(),!0),o?(this.offset=e,r()):{string:r(),length:e-t}},o.writeIString=function(e,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(i=n,r=u.calculateUTF16asUTF8(t(e),this.noAssert)[1],n+=4+r,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=4+r,this.littleEndian?(this.view[n+3]=255&r>>>24,this.view[n+2]=255&r>>>16,this.view[n+1]=255&r>>>8,this.view[n]=255&r):(this.view[n]=255&r>>>24,this.view[n+1]=255&r>>>16,this.view[n+2]=255&r>>>8,this.view[n+3]=255&r),n+=4,u.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==i+4+r)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+4+r));return s?(this.offset=n,this):n-i},o.readIString=function(e){var t,n,r,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}return t=e,n=this.readUint32(e),r=this.readUTF8String(n,d.METRICS_BYTES,e+=4),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},d.METRICS_CHARS="c",d.METRICS_BYTES="b",o.writeUTF8String=function(e,n){var r,i,o,s=void 0===n;if(s&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return i=n,r=u.calculateUTF16asUTF8(t(e))[1],n+=r,o=this.buffer.byteLength,n>o&&this.resize((o*=2)>n?o:n),n-=r,u.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),s?(this.offset=n,this):n-i},o.writeString=o.writeUTF8String,d.calculateUTF8Chars=function(e){return u.calculateUTF16asUTF8(t(e))[0]},d.calculateUTF8Bytes=function(e){return u.calculateUTF16asUTF8(t(e))[1]},d.calculateString=d.calculateUTF8Bytes,o.readUTF8String=function(e,t,r){var i,o,s,a,c;if("number"==typeof t&&(r=t,t=void 0),(i=void 0===r)&&(r=this.offset),void 0===t&&(t=d.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}
1if(s=0,a=r,t===d.METRICS_CHARS){if(o=n(),u.decodeUTF8(function(){return e>s&&r<this.limit?this.view[r++]:null}.bind(this),(function(e){++s,u.UTF8toUTF16(e,o)})),s!==e)throw RangeError("Illegal range: Truncated data, "+s+" == "+e);return i?(this.offset=r,o()):{string:o(),length:r-a}}if(t===d.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+"+e+") <= "+this.buffer.byteLength)}if(c=r+e,u.decodeUTF8toUTF16(function(){return c>r?this.view[r++]:null}.bind(this),o=n(),this.noAssert),r!==c)throw RangeError("Illegal range: Truncated data, "+r+" == "+c);return i?(this.offset=r,o()):{string:o(),length:r-a}}throw TypeError("Unsupported metrics: "+t)},o.readString=o.readUTF8String,o.writeVString=function(e,n){var r,i,o,s,a=void 0===n;if(a&&(n=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}if(o=n,r=u.calculateUTF16asUTF8(t(e),this.noAssert)[1],i=d.calculateVarint32(r),n+=i+r,s=this.buffer.byteLength,n>s&&this.resize((s*=2)>n?s:n),n-=i+r,n+=this.writeVarint32(r,n),u.encodeUTF16toUTF8(t(e),function(e){this.view[n++]=e}.bind(this)),n!==o+r+i)throw RangeError("Illegal range: Truncated data, "+n+" == "+(n+r+i));return a?(this.offset=n,this):n-o},o.readVString=function(e){var t,n,r,i=void 0===e;if(i&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}return t=e,n=this.readVarint32(e),r=this.readUTF8String(n.value,d.METRICS_BYTES,e+=n.length),e+=r.length,i?(this.offset=e,r.string):{string:r.string,length:e-t}},o.append=function(e,t,n){var r,i,o;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof d||(e=d.wrap(e,t)),(i=e.limit-e.offset)<=0||((n+=i)>(o=this.buffer.byteLength)&&this.resize((o*=2)>n?o:n),n-=i,this.view.set(e.view.subarray(e.offset,e.limit),n),e.offset+=i,r&&(this.offset+=i)),this},o.appendTo=function(e,t){return e.append(this,t),this},o.assert=function(e){return this.noAssert=!e,this},o.capacity=function(){return this.buffer.byteLength},o.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},o.clone=function(e){var t=new d(0,this.littleEndian,this.noAssert);return e?(t.buffer=new ArrayBuffer(this.buffer.byteLength),t.view=new Uint8Array(t.buffer)):(t.buffer=this.buffer,t.view=this.view),t.offset=this.offset,t.markedOffset=this.markedOffset,t.limit=this.limit,t},o.compact=function(e,t){var n,r,i;if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return 0===e&&t===this.buffer.byteLength?this:0===(n=t-e)?(this.buffer=s,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this):(r=new ArrayBuffer(n),(i=new Uint8Array(r)).set(this.view.subarray(e,t)),this.buffer=r,this.view=i,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=n,this)},o.copy=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return new d(0,this.littleEndian,this.noAssert);var n=t-e,r=new d(n,this.littleEndian,this.noAssert);return r.offset=0,r.limit=n,r.markedOffset>=0&&(r.markedOffset-=e),this.copyTo(r,0,e,t),r},o.copyTo=function(e,t,n,r){var i,o,s;if(!this.noAssert&&!d.isByteBuffer(e))throw TypeError("Illegal target:
1Not a ByteBuffer");if(t=(o=void 0===t)?e.offset:0|t,n=(i=void 0===n)?this.offset:0|n,r=void 0===r?this.limit:0|r,t<0||t>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+t+" <= "+e.buffer.byteLength);if(n<0||r>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);return 0===(s=r-n)?e:(e.ensureCapacity(t+s),e.view.set(this.view.subarray(n,r),t),i&&(this.offset+=s),o&&(e.offset+=s),this)},o.ensureCapacity=function(e){var t=this.buffer.byteLength;return e>t?this.resize((t*=2)>e?t:e):this},o.fill=function(e,t,n){var r=void 0===t;if(r&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===n&&(n=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal end: Not an integer");if(n>>>=0,t<0||t>n||n>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+n+" <= "+this.buffer.byteLength)}if(t>=n)return this;for(;n>t;)this.view[t++]=e;return r&&(this.offset=t),this},o.flip=function(){return this.limit=this.offset,this.offset=0,this},o.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},o.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},o.LE=function(e){return this.littleEndian=void 0===e||!!e,this},o.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},o.prepend=function(e,t,n){var r,i,o,s,a;if(("number"==typeof t||"string"!=typeof t)&&(n=t,t=void 0),(r=void 0===n)&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}return e instanceof d||(e=d.wrap(e,t)),(i=e.limit-e.offset)<=0||((o=i-n)>0?(s=new ArrayBuffer(this.buffer.byteLength+o),(a=new Uint8Array(s)).set(this.view.subarray(n,this.buffer.byteLength),i),this.buffer=s,this.view=a,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,n+=o):new Uint8Array(this.buffer),this.view.set(e.view.subarray(e.offset,e.limit),n-i),e.offset=e.limit,r&&(this.offset-=i)),this}
1,o.prependTo=function(e,t){return e.prepend(this,t),this},o.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},o.remaining=function(){return this.limit-this.offset},o.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},o.resize=function(e){var t,n;if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}return this.buffer.byteLength<e&&(t=new ArrayBuffer(e),(n=new Uint8Array(t)).set(this.view),this.buffer=t,this.view=n),this},o.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},o.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},o.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var n=this.clone();return n.offset=e,n.limit=t,n},o.toBuffer=function(e){var t,n=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: Not an integer");if(n>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,n<0||n>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+n+" <= "+r+" <= "+this.buffer.byteLength)}return e||0!==n||r!==this.buffer.byteLength?n===r?s:(t=new ArrayBuffer(r-n),new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(n,r),0),t):this.buffer},o.toArrayBuffer=o.toBuffer,o.toString=function(e,t,n){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(n=t=e="utf8"),e){case"utf8":return this.toUTF8(t,n);case"base64":return this.toBase64(t,n);case"hex":return this.toHex(t,n);case"binary":return this.toBinary(t,n);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}},c=function(){var e,t,n={},r=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],i=[];for(e=0,t=r.length;t>e;++e)i[r[e]]=e;return n.encode=function(e,t){for(var n,i;null!==(n=e());)t(r[63&n>>2]),i=(3&n)<<4,null!==(n=e())?(t(r[63&((i|=15&n>>4)|15&n>>4)]),i=(15&n)<<2,null!==(n=e())?(t(r[63&(i|3&n>>6)]),t(r[63&n])):(t(r[63&i]),t(61))):(t(r[63&i]),t(61),t(61))},n.decode=function(e,t){function n(e){throw Error("Illegal character code: "+e)}for(var r,o,s;null!==(r=e());)if(void 0===(o=i[r])&&n(r),null!==(r=e())&&(void 0===(s=i[r])&&n(r),t(o<<2>>
1>0|(48&s)>>4),null!==(r=e()))){if(void 0===(o=i[r])){if(61===r)break;n(r)}if(t((15&s)<<4>>>0|(60&o)>>2),null!==(r=e())){if(void 0===(s=i[r])){if(61===r)break;n(r)}t((3&o)<<6>>>0|s)}}},n.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},n}(),o.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return c.encode(function(){return t>e?this.view[e++]:null}.bind(this),r=n()),r()},d.fromBase64=function(e,n){if("string"!=typeof e)throw TypeError("str");var r=new d(e.length/4*3,n),i=0;return c.decode(t(e),(function(e){r.view[i++]=e})),r.limit=i,r},d.btoa=function(e){return d.fromBinary(e).toBase64()},d.atob=function(e){return d.fromBase64(e).toBinary()},o.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var n=[],r=[];t>e;)n.push(this.view[e++]),n.length>=1024&&(r.push(String.fromCharCode.apply(String,n)),n=[]);return r.join("")+String.fromCharCode.apply(String,n)},d.fromBinary=function(e,t){if("string"!=typeof e)throw TypeError("str");for(var n,r=0,i=e.length,o=new d(i,t);i>r;){if((n=e.charCodeAt(r))>255)throw RangeError("illegal char code: "+n);o.view[r++]=n}return o.limit=i,o},o.toDebug=function(e){for(var t,n=-1,r=this.buffer.byteLength,i="",o="",s="";r>n;){if(-1!==n&&(i+=(t=this.view[n])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(o+=t>32&&t<127?String.fromCharCode(t):".")),++n,e&&n>0&&n%16==0&&n!==r){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}i+=n===this.offset&&n===this.limit?n===this.markedOffset?"!":"|":n===this.offset?n===this.markedOffset?"[":"<":n===this.limit?n===this.markedOffset?"]":">":n===this.markedOffset?"'":e||0!==n&&n!==r?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";s+=i+o+"\n"}return e?s:i},d.fromDebug=function(e,t,n){for(var r,i,o=e.length,s=new d(0|(o+1)/3,t,n),a=0,c=0,u=!1,l=!1,h=!1,f=!1,g=!1;o>a;){switch(r=e.charAt(a++)){case"!":if(!n){if(l||h||f){g=!0;break}l=h=f=!0}s.offset=s.markedOffset=s.limit=c,u=!1;break;case"|":if(!n){if(l||f){g=!0;break}l=f=!0}s.offset=s.limit=c,u=!1;break;case"[":if(!n){if(l||h){g=!0;break}l=h=!0}s.offset=s.markedOffset=c,u=!1;break;case"<":if(!n){if(l){g=!0;break}l=!0}s.offset=c,u=!1;break;case"]":if(!n){if(f||h){g=!0;break}f=h=!0}s.limit=s.markedOffset=c,u=!1;break;case">":if(!n){if(f){g=!0;break}f=!0}s.limit=c,u=!1;break;case"'":if(!n){if(h){g=!0;break}h=!0}s.markedOffset=c,u=!1;break;case" ":u=!1;break;default:if(!n&&u){g=!0;break}if(i=parseInt(r+e.charAt(a++),16),!n&&(isNaN(i)||i<0||i>255))throw TypeError("Illegal str: Not a debug encoded string");s.view[c++]=i,u=!0}if(g)throw TypeError("Illegal str: Invalid symbol at "+a)}if(!n){if(!l||!f)throw TypeError("Illegal str: Missing offset or limit");if(c<s.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+c+" < "+o)}return s},o.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var n,r=new Array(t-e);t>e;)(n=this.view[e++])<16?r.push("0",n.toString(16)):r.push(n.toString(16));return r.join("")},d.fromHex=function(e,t,n){var r,i,o,s,a;if(!n){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(i=e.length,o=new d(0|i/2,t),s=0,a=0;i>s;s+=2){if(r=parseInt(e.substring(s,s+2),16),!n&&(!isFinite(r)||r<0||r>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[a++]=r}return o.limit=a,o},u=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):n<2048?(t(192|31&n>>6),t(128|63&n)):n<65536?(t(224|15&n>>12),t(128|63&n>>6),t(128|63&n)):(t(240|7&n>>18),t(128|63&n>>12),t(128|63&n>>6),t(128|63&n)),n=null},decodeUTF8:function(e,t){for(var n,r,i,o,s=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(n=e());)if(0==(128&n))t(n);else if(192==(224&n))null===(r=e())&&s([n,r]),t((31&n)<<6|63&r);else if(224==(240&n))(null===(r=e())||null===(i=e()))&&s([n,r,i]),t((15&n)<<12|(63&r)<<6|63&i);else{if(240!=(248&n))throw RangeError("Illegal starting byte: "+n);(null===(r=e())||null===(i=e())||null===(o=e()))&&s([n,r,i,o]),t((7&n)<<18|(63&r)<<12|(63&i)<<6|63&o)}},UTF16toUTF8:function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());)n>=55296&&n<=57343&&null!==(r=e())&&r>
1=56320&&r<=57343?(t(1024*(n-55296)+r-56320+65536),r=null):t(n);null!==r&&t(r)},UTF8toUTF16:function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<=65535?t(n):(t(55296+((n-=65536)>>10)),t(n%1024+56320)),n=null},encodeUTF16toUTF8:function(t,n){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,n)}))},decodeUTF8toUTF16:function(t,n){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,n)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,n=0;null!==(t=e());)n+=t<128?1:t<2048?2:t<65536?3:4;return n},calculateUTF16asUTF8:function(t){var n=0,r=0;return e.UTF16toUTF8(t,(function(e){++n,r+=e<128?1:e<2048?2:e<65536?3:4})),[n,r]}};return e}(),o.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{u.decodeUTF8toUTF16(function(){return t>e?this.view[e++]:null}.bind(this),r=n())}catch(n){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},d.fromUTF8=function(e,n,r){if(!r&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var i=new d(u.calculateUTF16asUTF8(t(e),!0)[1],n,r),o=0;return u.encodeUTF16toUTF8(t(e),(function(e){i.view[o++]=e})),i.limit=o,i},d}(t),r=function(t,n){var r,i,o={};return o.ByteBuffer=t,o.c=t,r=t,o.Long=n||null,o.VERSION="5.0.1",o.WIRE_TYPES={},o.WIRE_TYPES.VARINT=0,o.WIRE_TYPES.BITS64=1,o.WIRE_TYPES.LDELIM=2,o.WIRE_TYPES.STARTGROUP=3,o.WIRE_TYPES.ENDGROUP=4,o.WIRE_TYPES.BITS32=5,o.PACKABLE_WIRE_TYPES=[o.WIRE_TYPES.VARINT,o.WIRE_TYPES.BITS64,o.WIRE_TYPES.BITS32],o.TYPES={int32:{name:"int32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},uint32:{name:"uint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},sint32:{name:"sint32",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},int64:{name:"int64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},uint64:{name:"uint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.UZERO:void 0},sint64:{name:"sint64",wireType:o.WIRE_TYPES.VARINT,defaultValue:o.Long?o.Long.ZERO:void 0},bool:{name:"bool",wireType:o.WIRE_TYPES.VARINT,defaultValue:!1},double:{name:"double",wireType:o.WIRE_TYPES.BITS64,defaultValue:0},string:{name:"string",wireType:o.WIRE_TYPES.LDELIM,defaultValue:""},bytes:{name:"bytes",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},fixed32:{name:"fixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},sfixed32:{name:"sfixed32",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},fixed64:{name:"fixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.UZERO:void 0},sfixed64:{name:"sfixed64",wireType:o.WIRE_TYPES.BITS64,defaultValue:o.Long?o.Long.ZERO:void 0},float:{name:"float",wireType:o.WIRE_TYPES.BITS32,defaultValue:0},enum:{name:"enum",wireType:o.WIRE_TYPES.VARINT,defaultValue:0},message:{name:"message",wireType:o.WIRE_TYPES.LDELIM,defaultValue:null},group:{name:"group",wireType:o.WIRE_TYPES.STARTGROUP,defaultValue:null}},o.MAP_KEY_TYPES=[o.TYPES.int32,o.TYPES.sint32,o.TYPES.sfixed32,o.TYPES.uint32,o.TYPES.fixed32,o.TYPES.int64,o.TYPES.sint64,o.TYPES.sfixed64,o.TYPES.uint64,o.TYPES.fixed64,o.TYPES.bool,o.TYPES.string,o.TYPES.bytes],o.ID_MIN=1,o.ID_MAX=536870911,o.convertFieldsToCamelCase=!1,o.populateAccessors=!0,o.populateDefaults=!0,o.Util=function(){var e={};return e.IS_NODE=!("object"!==("undefined"==typeof process?"undefined":si(process))||process+""!="[object process]"||process.browser),e.XHR=function(){var e,t=[function(){return new XMLHttpRequest},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Msxml3.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],n=null;for(e=0;e<t.length;e++){try{n=t[e]()}catch(e){continue}break}if(!n)throw Error("XMLHttpRequest is not supported");return n},e.fetch=function(t,n){if(n&&"function"!=typeof n&&(n=null),e.IS_NODE)if(n)g.readFile(t,(function(e,t){n(e?null:""+t)}));else try{return g.readFileSync(t)}catch(e){return null}else{var r=e.XHR();if(r.open("GET",t,!!n),r.setRequestHeader("Accept","text/plain"),"function"==typeof r.overrideMimeType&&r.overrideMimeType("text/plain"),!n)return r.send(null),200==r.status||0==r.status&&"string"==typeof r.responseText?r.responseText:null;if(r.onreadystatechange=function(){4==r.readyState&&(200==r.status||0==r.status&&"string"==typeof r.responseText?n(r.responseText):n(null))},4==r.readyState)return;r.send(null)}},e.toCamelCase=function(e){return e.replace(/_([a-zA-Z])/g,(function(e,t){return t.toUpperCase()}))},e}(),o.Lang={DELIM:/[\s\{\}=;:\[\],'"\(\)<>]/g,RULE:/^(?:required|optional|repeated|map)$/,TYPE:/^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,NAME:/^[a-zA-Z_][a-zA-Z_0-9]*$/,TYPEDEF:/^[a-zA-Z][a-zA-Z_0-9]*$/,TYPEREF:/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,FQTYPEREF:/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,NUMBER:/^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,NUMBER_DEC:/^(?:[1-9][0-9]*|0)$/,NUMBER_HEX:/^0[xX][0-9a-fA-F]+$/,NUMBER_OCT:/^0[0-7]+$/,NUMBER_FLT:/^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,BOOL:/^(?:true|false)$/i,ID:/^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,NEGID:/^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,WHITESPACE:/\s/,STRING:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,STRING_DQ:/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,STRING_SQ:/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g},o.DotProto=function(e,t){function n(e,n){var r=-1,i=1;if("-"==e.charAt(0)&&(i=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))r=parseInt(e);else if(t.NUMBER_HEX.test(e))r=parseInt(e.substring(2),16);else{if(!t.NUMBER_OCT.test(e))throw Error("illegal id value: "+(i<0?"-":"")+e);r=parseInt(e.substring(1),8)}if(r=0|i*r,!n&&r<0)throw Error("illegal id value: "+(i<0?"-":"")+e);return r}function r(e){var n=1;if("-"==e.charAt(0)&&(n=-1,e=e.substring(1)),t.NUMBER_DEC.test(e))return n*parseInt(e,10);if(t.NUMBER_HEX.test(e))return n*parseInt(e.substring(2),16);if(t.NUMBER_OCT.test(e))return n*parseInt(e.substring(1),8);if("inf"===e)return 1/0*n;if("nan"===e)return NaN;if(t.NUMBER_FLT.test(e))return n*parseFloat(e);throw Error("illegal number value: "+(n<0?"-":"")+e)}function i(e,t,n){void 0===e[t]?e[t]=n:(Array.isArray(e[t])||(e[t]=[e[t]]),e[t].push(n))}var o,s,a={},c=function(e){this.source=e+"",this.index=0,this.line=1,this.stack=[],this._stringOpen=null},u=c.prototype;return u._readString=function(){var e,n='"'===this._stringOpen?t.STRING_DQ:t.STRING_SQ;if(n.lastIndex=this.index-1,!(e=n.exec(this.source)))throw Error("unterminated string");return this.index=n.lastIndex,this.stack.push(this._stringOpen),this._stringOpen=null,e[1]},u.next=function(){var e,n,r,i,o;if(this.stack.length>0)return this.stack.shift();if(this.index>=this.source.length)return null;if(null!==this._stringOpen)return this._readString();do{for(e=!1;t.WHITESPACE.test(r=this.source.charAt(this.index));)if("\n"===r&&++this.line,++this.index===this.source.length)return null;if("/"===this.source.charAt(this.index))if(++this.index,"/"===this.source.charAt(this.index)){for(;"\n"!==this.source.charAt(++this.index);)if(this.index==this.source.length)return null;++this.index,++this.line,e=!0}else{if("*"!==(r=this.source.charAt(this.index)))return"/";do{if("\n"===r&&++this.line,++this.index===this.source.length)return null;n=r,r=this.source.charAt(this.index)}while("*"!==n||"/"!==r);++this.index,e=!0}}while(e);
1if(this.index===this.source.length)return null;if(i=this.index,t.DELIM.lastIndex=0,!t.DELIM.test(this.source.charAt(i++)))for(;i<this.source.length&&!t.DELIM.test(this.source.charAt(i));)++i;return('"'===(o=this.source.substring(this.index,this.index=i))||"'"===o)&&(this._stringOpen=o),o},u.peek=function(){if(0===this.stack.length){var e=this.next();if(null===e)return null;this.stack.push(e)}return this.stack[0]},u.skip=function(e){var t=this.next();if(t!==e)throw Error("illegal '"+t+"', '"+e+"' expected")},u.omit=function(e){return this.peek()===e&&(this.next(),!0)},u.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},a.Tokenizer=c,o=function(e){this.tn=new c(e),this.proto3=!1},(s=o.prototype).parse=function(){var e,n={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},r=!0;try{for(;e=this.tn.next();)switch(e){case"package":if(!r||null!==n.package)throw Error("unexpected 'package'");if(e=this.tn.next(),!t.TYPEREF.test(e))throw Error("illegal package name: "+e);this.tn.skip(";"),n.package=e;break;case"import":if(!r)throw Error("unexpected 'import'");"public"===(e=this.tn.peek())&&this.tn.next(),e=this._readString(),this.tn.skip(";"),n.imports.push(e);break;case"syntax":if(!r)throw Error("unexpected 'syntax'");this.tn.skip("="),"proto3"===(n.syntax=this._readString())&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(n,null),r=!1;break;case"enum":this._parseEnum(n),r=!1;break;case"option":this._parseOption(n);break;case"service":this._parseService(n);break;case"extend":this._parseExtend(n);break;default:throw Error("unexpected '"+e+"'")}}catch(e){throw e.message="Parse error at line "+this.tn.line+": "+e.message,e}return delete n.name,n},o.parse=function(e){return new o(e).parse()},s._readString=function(){var e,t,n="";do{if("'"!==(t=this.tn.next())&&'"'!==t)throw Error("illegal string delimiter: "+t);n+=this.tn.next(),this.tn.skip(t),e=this.tn.peek()}while('"'===e||'"'===e);return n},s._readValue=function(e){var n=this.tn.peek();if('"'===n||"'"===n)return this._readString();if(this.tn.next(),t.NUMBER.test(n))return r(n);if(t.BOOL.test(n))return"true"===n.toLowerCase();if(e&&t.TYPEREF.test(n))return n;throw Error("illegal value: "+n)},s._parseOption=function(e,n){var r,i=this.tn.next(),o=!1;if("("===i&&(o=!0,i=this.tn.next()),!t.TYPEREF.test(i))throw Error("illegal option name: "+i);r=i,o&&(this.tn.skip(")"),r="("+r+")",i=this.tn.peek(),t.FQTYPEREF.test(i)&&(r+=i,this.tn.next())),this.tn.skip("="),this._parseOptionValue(e,r),n||this.tn.skip(";")},s._parseOptionValue=function(e,n){var r=this.tn.peek();if("{"!==r)i(e.options,n,this._readValue(!0));else for(this.tn.skip("{");"}"!==(r=this.tn.next());){if(!t.NAME.test(r))throw Error("illegal option name: "+n+"."+r);this.tn.omit(":")?i(e.options,n+"."+r,this._readValue(!0)):this._parseOptionValue(e,n+"."+r)}},s._parseService=function(e){var n,r=this.tn.next();if(!t.NAME.test(r))throw Error("illegal service name at line "+this.tn.line+": "+r);for(n={name:r,rpc:{},options:{}},this.tn.skip("{");"}"!==(r=this.tn.next());)if("option"===r)this._parseOption(n);else{if("rpc"!==r)throw Error("illegal service token: "+r);this._parseServiceRPC(n)}this.tn.omit(";"),e.services.push(n)},s._parseServiceRPC=function(e){var n,r,i="rpc",o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal rpc service method name: "+o);if(n=o,r={request:null,response:null,request_stream:!1,response_stream:!1,options:{}},this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(r.request_stream=!0,o=this.tn.next()),!t.TYPEREF.test(o))throw Error("illegal rpc service request type: "+o);if(r.request=o,this.tn.skip(")"),"returns"!==(o=this.tn.next()).toLowerCase())throw Error("illegal rpc service request type delimiter: "+o);if(this.tn.skip("("),"stream"===(o=this.tn.next()).toLowerCase()&&(r.response_stream=!0,o=this.tn.next()),r.response=o,this.tn.skip(")"),"{"===(o=this.tn.peek())){for(this.tn.next();"}"!==(o=this.tn.next());){if("option"!==o)throw Error("illegal rpc service token: "+o);this._parseOption(r)}this.tn.omit(";")}else this.tn.skip(";");void 0===e[i]&&(e[i]={}),e[i][n]=r},s._parseMessage=function(e,r){var i=!!r,o=this.tn.next(),s={name:"",fields:[],enums:[],messages:[],options:{},services:[],oneofs:{}};if(!t.NAME.test(o))throw Error("illegal "+(i?"group":"message")+" name: "+o);for(s.name=o,i&&(this.tn.skip("="),r.id=n(this.tn.next()),s.isGroup=!0),"["===(o=this.tn.peek())&&r&&this._parseFieldOptions(r),this.tn.skip("{");"}"!==(o=this.tn.next());)if(t.RULE.test(o))this._parseMessageField(s,o);else if("oneof"===o)this._parseMessageOneOf(s);else if("enum"===o)this._parseEnum(s);else if("message"===o)this._parseMessage(s);else if("option"===o)this._parseOption(s);else if("service"===o)this._parseService(s);else if("extensions"===o)s.extensions=this._parseExtensionRanges();else if("reserved"===o)this._parseIgnored();else if("extend"===o)this._parseExtend(s);else{if(!t.TYPEREF.test(o))throw Error("illegal message token: "+o);if(!this.proto3)throw Error("illegal field rule: "+o);this._parseMessageField(s,"optional",o)}return this.tn.omit(";"),e.messages.push(s),s},s._parseIgnored=function(){for(;";"!==this.tn.peek();)this.tn.next();this.tn.skip(";")},s._parseMessageField=function(e,r,i){var o,s,a;if(!t.RULE.test(r))throw Error("illegal message field rule: "+r);if(o={rule:r,type:"",name:"",options:{},id:0},"map"===r){if(i)throw Error("illegal type: "+i);if(this.tn.skip("<"),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field type: "+s);if(o.keytype=s,this.tn.skip(","),s=this.tn.next(),!t.TYPE.test(s)&&!t.TYPEREF.test(s))throw Error("illegal message field: "+s);if(o.type=s,this.tn.skip(">"),s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);o.name=s,this.tn.skip("="),o.id=n(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}else if("group"===(i=void 0!==i?i:this.tn.next())){if(a=this._parseMessage(e,o),!/^[A-Z]/.test(a.name))throw Error("illegal group name: "+a.name);o.type=a.name,o.name=a.name.toLowerCase(),this.tn.omit(";")}else{if(!t.TYPE.test(i)&&!t.TYPEREF.test(i))throw Error("illegal message field type: "+i);if(o.type=i,s=this.tn.next(),!t.NAME.test(s))throw Error("illegal message field name: "+s);o.name=s,this.tn.skip("="),o.id=n(this.tn.next()),"["===(s=this.tn.peek())&&this._parseFieldOptions(o),this.tn.skip(";")}return e.fields.push(o),o},s._parseMessageOneOf=function(e){var n,r,i,o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal oneof name: "+o);for(r=o,i=[],this.tn.skip("{");"}"!==(o=this.tn.next());)(n=this._parseMessageField(e,"optional",o)).oneof=r,i.push(n.id);this.tn.omit(";"),e.oneofs[r]=i},s._parseFieldOptions=function(e){this.tn.skip("[");for(var t=!0;"]"!==this.tn.peek();)t||this.tn.skip(","),this._parseOption(e,!0),t=!1;this.tn.next()},s._parseEnum=function(e){var r,i={name:"",values:[],options:{}},o=this.tn.next();if(!t.NAME.test(o))throw Error("illegal name: "+o);for(i.name=o,this.tn.skip("{");"}"!==(o=this.tn.next());)if("option"===o)this._parseOption(i);else{if(!t.NAME.test(o))throw Error("illegal name: "+o);this.tn.skip("="),r={name:o,id:n(this.tn.next(),!0)},"["===(o=this.tn.peek())&&this._parseFieldOptions({options:{}}),this.tn.skip(";"),i.values.push(r)}this.tn.omit(";"),e.enums.push(i)},s._parseExtensionRanges=function(){var t,n,i,o=[];do{for(n=[];;){switch(t=this.tn.next()){case"min":i=e.ID_MIN;break;case"max":i=e.ID_MAX;break;default:i=r(t)}if(n.push(i),2===n.length)break;if("to"!==this.tn.peek()){n.push(i);break}this.tn.next()}o.push(n)}while(this.tn.omit(","));return this.tn.skip(";"),o},s._parseExtend=function(e){var n,r=this.tn.next();if(!t.TYPEREF.test(r))throw Error("illegal extend reference: "+r);for(n={ref:r,fields:[]},this.tn.skip("{");"}"!==(r=this.tn.next());)if(t.RULE.test(r))this._parseMessageField(n,r);else{if(!t.TYPEREF.test(r))throw Error("illegal extend token: "+r);if(!this.proto3)throw Error("illegal field rule: "+r);this._parseMessageField(n,"optional",r)}return this.tn.omit(";"),e.messages.push(n),n},s.toString=function(){return"Parser at line "+this.tn.line},a.Parser=o,a}(o,o.Lang),o.Reflect=function(e){function n(t,n){if(t&&"number"==typeof t.low&&"number"==typeof t.high&&"boolean"==typeof t.unsigned&&t.low==t.low&&t.high==t.high)return new e.Long(t.low,t.high,void 0===n?t.unsigned:n);if("string"==typeof t)return e.Long.fromString(t,n||!1,10);if("number"==typeof t)return e.Long.fromNumber(t,n||!1);throw Error("not convertible to Long")}function i(t,n){var r=n.readVarint32(),o=7&r,s=r>>>3;switch(o){case e.WIRE_TYPES.VARINT:do{r=n.readUint8()}while(128==(128&r));break;case e.WIRE_TYPES.BITS64:n.offset+=8;break;case e.WIRE_TYPES.LDELIM:r=n.readVarint32(),n.offset+=r;break;case e.WIRE_TYPES.STARTGROUP:i(s,n);break;case e.WIRE_TYPES.ENDGROUP:if(s===t)return!1;throw Error("Illegal GROUPEND after unknown group: "+s+" ("+t+" expected)");case e.WIRE_TYPES.BITS32:n.offset+=4;break;default:throw Error("Illegal wire type in unknown group "+t+": "+o)}return!0}var o,s,a,c,u,d,l,h,f,g,p,v,_,E,m,I,T={},y=function(e,t,n){this.builder=e,this.parent=t,this.name=n,this.className},R=y.prototype;return R.fqn=function(){for(var e=this.name,t=this;null!=(t=t.parent);)e=t.name+"."+e;return e},R.toString=function(e){return(e?this.className+" ":"")+this.fqn()},R.build=function(){throw Error(this.toString(!0)+" cannot be built directly")},T.T=y,o=function(e,t,n,r,i){y.call(this,e,t,n),this.className="Namespace",this.children=[],this.options=r||{},this.syntax=i||"proto2"},(s=o.prototype=Object.create(y.prototype)).getChildren=function(e){var t,n,r;if(null==(e=e||null))return this.children.slice();for(t=[],n=0,r=this.children.length;r>n;++n)this.children[n]instanceof e&&t.push(this.children[n]);return t},s.addChild=function(e){var t;if(t=this.getChild(e.name))if(t instanceof u.Field&&t.name!==t.originalName&&null===this.getChild(t.originalName))t.name=t.originalName;else{if(!(e instanceof u.Field&&e.name!==e.originalName&&null===this.getChild(e.originalName)))throw Error("Duplicate name in namespace "+this.toString(!0)+": "+e.name);e.name=e.originalName}this.children.push(e)},s.getChild=function(e){var t,n,r="number"==typeof e?"id":"name";for(t=0,n=this.children.length;n>t;++t)if(this.children[t][r]===e)return this.children[t];return null},s.resolve=function(e,t){var n,r="string"==typeof e?e.split("."):e,i=this,o=0;if(""===r[o]){for(;null!==i.parent;)i=i.parent;o++}do{do{if(!(i instanceof T.Namespace)){i=null;break}if(!((n=i.getChild(r[o]))&&n instanceof T.T&&(!t||n instanceof T.Namespace))){i=null;break}i=n,o++}while(o<r.length);if(null!=i)break;if(null!==this.parent)return this.parent.resolve(e,t)}while(null!=i);return i},s.qn=function(e){var t,n,r=[],i=e;do{r.unshift(i.name),i=i.parent}while(null!==i);for(t=1;t<=r.length;t++)if(n=r.slice(r.length-t),e===this.resolve(n,e instanceof T.Namespace))return n.join(".");return e.fqn()},s.build=function(){var e,t,n,r={},i=this.children;for(t=0,n=i.length;n>t;++t)(e=i[t])instanceof o&&(r[e.name]=e.build());return Object.defineProperty&&Object.defineProperty(r,"$options",{value:this.buildOpt()}),r},s.buildOpt=function(){var e,t,n,r,i={},o=Object.keys(this.options);for(e=0,t=o.length;t>e;++e)n=o[e],r=this.options[o[e]],i[n]=r;return i},s.getOption=function(e){return void 0===e?this.options:void 0!==this.options[e]?this.options[e]:null}
1,T.Namespace=o,a=function(t,n,r,i){if(this.type=t,this.resolvedType=n,this.isMapKey=r,this.syntax=i,r&&e.MAP_KEY_TYPES.indexOf(t)<0)throw Error("Invalid map key type: "+t.name)},c=a.prototype,a.defaultFieldValue=function(t){if("string"==typeof t&&(t=e.TYPES[t]),void 0===t.defaultValue)throw Error("default value for type "+t.name+" is not supported");return t==e.TYPES.bytes?new r(0):t.defaultValue},c.verifyValue=function(r){var i,o,s,a=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this);switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:return("number"!=typeof r||r==r&&r%1!=0)&&a(si(r),"not an integer"),r>4294967295?0|r:r;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof r||r==r&&r%1!=0)&&a(si(r),"not an integer"),r<0?r>>>0:r;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return n(r,!1)}catch(e){a(si(r),e.message)}else a(si(r),"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return n(r,!0)}catch(e){a(si(r),e.message)}else a(si(r),"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof r&&a(si(r),"not a boolean"),r;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof r&&a(si(r),"not a number"),r;case e.TYPES.string:return"string"==typeof r||r&&r instanceof String||a(si(r),"not a string"),""+r;case e.TYPES.bytes:return t.isByteBuffer(r)?r:t.wrap(r);case e.TYPES.enum:for(i=this.resolvedType.getChildren(e.Reflect.Enum.Value),s=0;s<i.length;s++){if(i[s].name==r)return i[s].id;if(i[s].id==r)return i[s].id}if("proto3"===this.syntax)return("number"!=typeof r||r==r&&r%1!=0)&&a(si(r),"not an integer"),(r>4294967295||r<0)&&a(si(r),"not in range for uint32"),r;a(r,"not a valid enum value");case e.TYPES.group:case e.TYPES.message:if(r&&"object"===si(r)||a(si(r),"object expected"),r instanceof this.resolvedType.clazz)return r;if(r instanceof e.Builder.Message){for(s in o={},r)r.hasOwnProperty(s)&&(o[s]=r[s]);r=o}return new this.resolvedType.clazz(r)}throw Error("[INTERNAL] Illegal value for "+this.toString(!0)+": "+r+" (undefined type "+this.type+")")},c.calculateLength=function(t,n){if(null===n)return 0;var i;switch(this.type){case e.TYPES.int32:return n<0?r.calculateVarint64(n):r.calculateVarint32(n);case e.TYPES.uint32:return r.calculateVarint32(n);case e.TYPES.sint32:return r.calculateVarint32(r.zigZagEncode32(n));case e.TYPES.fixed32:case e.TYPES.sfixed32:case e.TYPES.float:return 4;case e.TYPES.int64:case e.TYPES.uint64:return r.calculateVarint64(n);case e.TYPES.sint64:return r.calculateVarint64(r.zigZagEncode64(n));case e.TYPES.fixed64:case e.TYPES.sfixed64:return 8;case e.TYPES.bool:return 1;case e.TYPES.enum:return r.calculateVarint32(n);case e.TYPES.double:return 8;case e.TYPES.string:return i=r.calculateUTF8Bytes(n),r.calculateVarint32(i)+i;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");return r.calculateVarint32(n.remaining())+n.remaining();case e.TYPES.message:return i=this.resolvedType.calculate(n),r.calculateVarint32(i)+i;case e.TYPES.group:return(i=this.resolvedType.calculate(n))+r.calculateVarint32(t<<3|e.WIRE_TYPES.ENDGROUP)}throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")},c.encodeValue=function(t,n,i){var o,s;if(null===n)return i;switch(this.type){case e.TYPES.int32:n<0?i.writeVarint64(n):i.writeVarint32(n);break;case e.TYPES.uint32:i.writeVarint32(n);break;case e.TYPES.sint32:i.writeVarint32ZigZag(n);break;case e.TYPES.fixed32:i.writeUint32(n);break;case e.TYPES.sfixed32:i.writeInt32(n);break;case e.TYPES.int64:case e.TYPES.uint64:i.writeVarint64(n);break;case e.TYPES.sint64:i.writeVarint64ZigZag(n);break;case e.TYPES.fixed64:i.writeUint64(n);break;case e.TYPES.sfixed64:i.writeInt64(n);break;case e.TYPES.bool:"string"==typeof n?i.writeVarint32("false"===n.toLowerCase()?0:!!n):i.writeVarint32(n?1:0);break;case e.TYPES.enum:i.writeVarint32(n);break;case e.TYPES.float:i.writeFloat32(n);break;case e.TYPES.double:i.writeFloat64(n);break;case e.TYPES.string:i.writeVString(n);break;case e.TYPES.bytes:if(n.remaining()<0)throw Error("Illegal value for "+this.toString(!0)+": "+n.remaining()+" bytes remaining");o=n.offset,i.writeVarint32(n.remaining()),i.append(n),n.offset=o;break;case e.TYPES.message:s=(new r).LE(),this.resolvedType.encode(n,s),i.writeVarint32(s.offset),i.append(s.flip());break;case e.TYPES.group:this.resolvedType.encode(n,i),i.writeVarint32(t<<3|e.WIRE_TYPES.ENDGROUP);break;default:throw Error("[INTERNAL] Illegal value to encode in "+this.toString(!0)+": "+n+" (unknown type)")}return i},c.decode=function(t,n,r){if(n!=this.type.wireType)throw Error("Unexpected wire type for element");var i,o;switch(this.type){case e.TYPES.int32:return 0|t.readVarint32();case e.TYPES.uint32:return t.readVarint32()>>>0;case e.TYPES.sint32:return 0|t.readVarint32ZigZag();case e.TYPES.fixed32:return t.readUint32()>>>0;case e.TYPES.sfixed32:return 0|t.readInt32();case e.TYPES.int64:return t.readVarint64();case e.TYPES.uint64:return t.readVarint64().toUnsigned();case e.TYPES.sint64:return t.readVarint64ZigZag();case e.TYPES.fixed64:return t.readUint64();case e.TYPES.sfixed64:return t.readInt64();case e.TYPES.bool:return!!t.readVarint32();case e.TYPES.enum:return t.readVarint32();case e.TYPES.float:return t.readFloat();case e.TYPES.double:return t.readDouble();case e.TYPES.string:return t.readVString();case e.TYPES.bytes:if(o=t.readVarint32(),t.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+t.remaining());return(i=t.clone()).limit=i.offset+o,t.offset+=o,i;case e.TYPES.message:return o=t.readVarint32(),this.resolvedType.decode(t,o);case e.TYPES.group:return this.resolvedType.decode(t,-1,r)}throw Error("[INTERNAL] Illegal decode type")},c.valueFromString=function(t){if(!this.isMapKey)throw Error("valueFromString() called on non-map-key element");switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return this.verifyValue(parseInt(t));case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return this.verifyValue(t);case e.TYPES.bool:return"true"===t;case e.TYPES.string:return this.verifyValue(t);case e.TYPES.bytes:return r.fromBinary(t)}},c.valueToString=function(t){if(!this.isMapKey)throw Error("valueToString() called on non-map-key element");return this.type===e.TYPES.bytes?t.toString("binary"):t.toString()}
1,T.Element=a,u=function(e,t,n,r,i,s){o.call(this,e,t,n,r,s),this.className="Message",this.extensions=void 0,this.clazz=null,this.isGroup=!!i,this._fields=null,this._fieldsById=null,this._fieldsByName=null},(d=u.prototype=Object.create(o.prototype)).build=function(n){var i,o,s,a;if(this.clazz&&!n)return this.clazz;for(i=function(e,n){function i(t,n,o,s){var a,c,u,d,l,h,f;if(null===t||"object"!==si(t))return s&&s instanceof e.Reflect.Enum&&null!==(a=e.Reflect.Enum.getName(s.object,t))?a:t;if(r.isByteBuffer(t))return n?t.toBase64():t.toBuffer();if(e.Long.isLong(t))return o?t.toString():e.Long.fromValue(t);if(Array.isArray(t))return c=[],t.forEach((function(e,t){c[t]=i(e,n,o,s)})),c;if(c={},t instanceof e.Map){for(d=(u=t.entries()).next();!d.done;d=u.next())c[t.keyElem.valueToString(d.value[0])]=i(d.value[1],n,o,t.valueElem.resolvedType);return c}for(f in l=t.$type,h=void 0,t)t.hasOwnProperty(f)&&(c[f]=l&&(h=l.getChild(f))?i(t[f],n,o,h.resolvedType):i(t[f],n,o));return c}var o,s,a=n.getChildren(e.Reflect.Message.Field),c=n.getChildren(e.Reflect.Message.OneOf),u=function t(i){var o,s,u,d;for(e.Builder.Message.call(this),o=0,s=c.length;s>o;++o)this[c[o].name]=null;for(o=0,s=a.length;s>o;++o)this[(u=a[o]).name]=u.repeated?[]:u.map?new e.Map(u):null,!u.required&&"proto3"!==n.syntax||null===u.defaultValue||(this[u.name]=u.defaultValue);if(arguments.length>0)if(1!==arguments.length||null===i||"object"!==si(i)||!("function"!=typeof i.encode||i instanceof t)||Array.isArray(i)||i instanceof e.Map||r.isByteBuffer(i)||i instanceof ArrayBuffer||e.Long&&i instanceof e.Long)for(o=0,s=arguments.length;s>o;++o)void 0!==(d=arguments[o])&&this.$set(a[o].name,d);else this.$set(i)},d=u.prototype=Object.create(e.Builder.Message.prototype);for(d.add=function(t,r,i){var o=n._fieldsByName[t];if(!i){if(!o)throw Error(this+"#"+t+" is undefined");if(!(o instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+o.toString(!0));if(!o.repeated)throw Error(this+"#"+t+" is not a repeated field");r=o.verifyValue(r,!0)}return null===this[t]&&(this[t]=[]),this[t].push(r),this},d.$add=d.add,d.set=function(t,r,i){var o,s,a;if(t&&"object"===si(t)){for(o in i=r,t)t.hasOwnProperty(o)&&void 0!==(r=t[o])&&this.$set(o,r,i);return this}if(s=n._fieldsByName[t],i)this[t]=r;else{if(!s)throw Error(this+"#"+t+" is not a field: undefined");if(!(s instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+s.toString(!0));this[s.name]=r=s.verifyValue(r)}return s&&s.oneof&&(a=this[s.oneof.name],null!==r?(null!==a&&a!==s.name&&(this[a]=null),this[s.oneof.name]=s.name):a===t&&(this[s.oneof.name]=null)),this},d.$set=d.set,d.get=function(t,r){if(r)return this[t];var i=n._fieldsByName[t];if(!(i&&i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: undefined");if(!(i instanceof e.Reflect.Message.Field))throw Error(this+"#"+t+" is not a field: "+i.toString(!0));return this[i.name]},d.$get=d.get,o=0;o<a.length;o++)(s=a[o])instanceof e.Reflect.Message.ExtensionField||n.builder.options.populateAccessors&&function(e){var t,r,i,o=e.originalName.replace(/(_[a-zA-Z])/g,(function(e){return e.toUpperCase().replace("_","")}));o=o.substring(0,1).toUpperCase()+o.substring(1),t=e.originalName.replace(/([A-Z])/g,(function(e){return"_"+e})),r=function(t,n){return this[e.name]=n?t:e.verifyValue(t),this},i=function(){return this[e.name]},null===n.getChild("set"+o)&&(d["set"+o]=r),null===n.getChild("set_"+t)&&(d["set_"+t]=r),null===n.getChild("get"+o)&&(d["get"+o]=i),null===n.getChild("get_"+t)&&(d["get_"+t]=i)}(s);return d.encode=function(e,r){var i,o;"boolean"==typeof e&&(r=e,e=void 0),i=!1,e||(e=new t,i=!0),o=e.littleEndian;try{return n.encode(this,e.LE(),r),(i?e.flip():e).LE(o)}catch(t){throw e.LE(o),t}},u.encode=function(e,t,n){return new u(e).encode(t,n)},d.calculate=function(){return n.calculate(this)},d.encodeDelimited=function(e){var t,i=!1;return e||(e=new r,i=!0),t=(new r).LE(),n.encode(this,t).flip(),e.writeVarint32(t.remaining()),e.append(t),i?e.flip():e},d.encodeAB=function(){try{return this.encode().toArrayBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toArrayBuffer()),e}},d.toArrayBuffer=d.encodeAB,d.encodeNB=function(){try{return this.encode().toBuffer()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBuffer()),e}},d.toBuffer=d.encodeNB,d.encode64=function(){try{return this.encode().toBase64()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toBase64()),e}},d.toBase64=d.encode64,d.encodeHex=function(){try{return this.encode().toHex()}catch(e){throw e.encoded&&(e.encoded=e.encoded.toHex()),e}}
1,d.toHex=d.encodeHex,d.toRaw=function(e,t){return i(this,!!e,!!t,this.$type)},d.encodeJSON=function(){return JSON.stringify(i(this,!0,!0,this.$type))},u.decode=function(e,t){var i,o;"string"==typeof e&&(e=r.wrap(e,t||"base64")),i=(e=r.isByteBuffer(e)?e:r.wrap(e)).littleEndian;try{return o=n.decode(e.LE()),e.LE(i),o}catch(t){throw e.LE(i),t}},u.decodeDelimited=function(e,t){var i,o,s;if("string"==typeof e&&(e=r.wrap(e,t||"base64")),(e=r.isByteBuffer(e)?e:r.wrap(e)).remaining()<1)return null;if(i=e.offset,o=e.readVarint32(),e.remaining()<o)return e.offset=i,null;try{return s=n.decode(e.slice(e.offset,e.offset+o).LE()),e.offset+=o,s}catch(t){throw e.offset+=o,t}},u.decode64=function(e){return u.decode(e,"base64")},u.decodeHex=function(e){return u.decode(e,"hex")},u.decodeJSON=function(e){return new u(JSON.parse(e))},d.toString=function(){return n.toString()},Object.defineProperty&&(Object.defineProperty(u,"$options",{value:n.buildOpt()}),Object.defineProperty(d,"$options",{value:u.$options}),Object.defineProperty(u,"$type",{value:n}),Object.defineProperty(d,"$type",{value:n})),u}(e,this),this._fields=[],this._fieldsById={},this._fieldsByName={},s=0,a=this.children.length;a>s;s++)if((o=this.children[s])instanceof p||o instanceof u||o instanceof E){if(i.hasOwnProperty(o.name))throw Error("Illegal reflect child of "+this.toString(!0)+": "+o.toString(!0)+" cannot override static property '"+o.name+"'");i[o.name]=o.build()}else if(o instanceof u.Field)o.build(),this._fields.push(o),this._fieldsById[o.id]=o,this._fieldsByName[o.name]=o;else if(!(o instanceof u.OneOf||o instanceof _))throw Error("Illegal reflect child of "+this.toString(!0)+": "+this.children[s].toString(!0));return this.clazz=i},d.encode=function(e,t,n){var r,i,o,s,a,c=null;for(o=0,s=this._fields.length;s>o;++o)i=e[(r=this._fields[o]).name],r.required&&null===i?null===c&&(c=r):r.encode(n?i:r.verifyValue(i),t,e);if(null!==c)throw(a=Error("Missing at least one required field for "+this.toString(!0)+": "+c)).encoded=t,a;return t},d.calculate=function(e){for(var t,n,r=0,i=0,o=this._fields.length;o>i;++i){if(n=e[(t=this._fields[i]).name],t.required&&null===n)throw Error("Missing at least one required field for "+this.toString(!0)+": "+t);r+=t.calculate(n,e)}return r},d.decode=function(t,n,r){var o,s,a,c,u,d,l,h,f,g,p,v;for(n="number"==typeof n?n:-1,u=t.offset,d=new this.clazz;t.offset<u+n||-1===n&&t.remaining()>0;){if(a=(o=t.readVarint32())>>>3,(s=7&o)===e.WIRE_TYPES.ENDGROUP){if(a!==r)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+a+" ("+(r?r+" expected":"not a group")+")");break}if(c=this._fieldsById[a])c.repeated&&!c.options.packed?d[c.name].push(c.decode(s,t)):c.map?(h=c.decode(s,t),d[c.name].set(h[0],h[1])):(d[c.name]=c.decode(s,t),c.oneof&&(null!==(f=d[c.oneof.name])&&f!==c.name&&(d[f]=null),d[c.oneof.name]=c.name));else switch(s){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:l=t.readVarint32(),t.offset+=l;break;case e.WIRE_TYPES.STARTGROUP:for(;i(a,t););break;default:throw Error("Illegal wire type for unknown field "+a+" in "+this.toString(!0)+"#decode: "+s)}}for(g=0,p=this._fields.length;p>g;++g)if(null===d[(c=this._fields[g]).name])if("proto3"===this.syntax)d[c.name]=c.defaultValue;else{if(c.required)throw(v=Error("Missing at least one required field for "+this.toString(!0)+": "+c.name)).decoded=d,v;e.populateDefaults&&null!==c.defaultValue&&(d[c.name]=c.defaultValue)}return d},T.Message=u,l=function(t,n,r,i,o,s,a,c,d,l){y.call(this,t,n,s),this.className="Message.Field",this.required="required"===r,this.repeated="repeated"===r,this.map="map"===r,this.keyType=i||null,this.type=o,this.resolvedType=null,this.id=a,this.options=c||{},this.defaultValue=null,this.oneof=d||null,this.syntax=l||"proto2",this.originalName=this.name,this.element=null,this.keyElement=null,!this.builder.options.convertFieldsToCamelCase||this instanceof u.ExtensionField||(this.name=e.Util.toCamelCase(this.name))},(h=l.prototype=Object.create(y.prototype)).build=function(){this.element=new a(this.type,this.resolvedType,!1,this.syntax),this.map&&(this.keyElement=new a(this.keyType,void 0,!0,this.syntax)),"proto3"!==this.syntax||this.repeated||this.map?void 0!==this.options.default&&(this.defaultValue=this.verifyValue(this.options.default)):this.defaultValue=a.defaultFieldValue(this.t
1ype)},h.verifyValue=function(t,n){var r,i,o;if(n=n||!1,r=function(e,t){throw Error("Illegal value for "+this.toString(!0)+" of type "+this.type.name+": "+e+" ("+t+")")}.bind(this),null===t)return this.required&&r(si(t),"required"),"proto3"===this.syntax&&this.type!==e.TYPES.message&&r(si(t),"proto3 field without field presence cannot be null"),null;if(this.repeated&&!n){for(Array.isArray(t)||(t=[t]),o=[],i=0;i<t.length;i++)o.push(this.element.verifyValue(t[i]));return o}return this.map&&!n?t instanceof e.Map?t:(t instanceof Object||r(si(t),"expected ProtoBuf.Map or raw object for map field"),new e.Map(this,t)):(!this.repeated&&Array.isArray(t)&&r(si(t),"no array expected"),this.element.verifyValue(t))},h.hasWirePresence=function(t,n){if("proto3"!==this.syntax)return null!==t;if(this.oneof&&n[this.oneof.name]===this.name)return!0;switch(this.type){case e.TYPES.int32:case e.TYPES.sint32:case e.TYPES.sfixed32:case e.TYPES.uint32:case e.TYPES.fixed32:return 0!==t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:case e.TYPES.uint64:case e.TYPES.fixed64:return 0!==t.low||0!==t.high;case e.TYPES.bool:return t;case e.TYPES.float:case e.TYPES.double:return 0!==t;case e.TYPES.string:return t.length>0;case e.TYPES.bytes:return t.remaining()>0;case e.TYPES.enum:return 0!==t;case e.TYPES.message:return null!==t;default:return!0}},h.encode=function(t,n,i){var o,s,a,c,u;if(null===this.type||"object"!==si(this.type))throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return n;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.ensureCapacity(n.offset+=1),s=n.offset,o=0;o<t.length;o++)this.element.encodeValue(this.id,t[o],n);a=n.offset-s,(c=r.calculateVarint32(a))>1&&(u=n.slice(s,n.offset),s+=c-1,n.offset=s,n.append(u)),n.writeVarint32(a,s-c)}else for(o=0;o<t.length;o++)n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t[o],n);else this.map?t.forEach((function(t,i){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,i)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);n.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),n.writeVarint32(o),n.writeVarint32(8|this.keyType.wireType),this.keyElement.encodeValue(1,i,n),n.writeVarint32(16|this.type.wireType),this.element.encodeValue(2,t,n)}),this):this.hasWirePresence(t,i)&&(n.writeVarint32(this.id<<3|this.type.wireType),this.element.encodeValue(this.id,t,n))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return n},h.calculate=function(t,n){var i,o,s;if(t=this.verifyValue(t),null===this.type||"object"!==si(this.type))throw Error("[INTERNAL] Unresolved type in "+this.toString(!0)+": "+this.type);if(null===t||this.repeated&&0==t.length)return 0;i=0;try{if(this.repeated)if(this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0){for(i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),s=0,o=0;o<t.length;o++)s+=this.element.calculateLength(this.id,t[o]);i+=r.calculateVarint32(s),i+=s}else for(o=0;o<t.length;o++)i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t[o]);else this.map?t.forEach((function(t,n){var o=r.calculateVarint32(8|this.keyType.wireType)+this.keyElement.calculateLength(1,n)+r.calculateVarint32(16|this.type.wireType)+this.element.calculateLength(2,t);i+=r.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),i+=r.calculateVarint32(o),i+=o}),this):this.hasWirePresence(t,n)&&(i+=r.calculateVarint32(this.id<<3|this.type.wireType),i+=this.element.calculateLength(this.id,t))}catch(e){throw Error("Illegal value for "+this.toString(!0)+": "+t+" ("+e+")")}return i},h.decode=function(t,n,r){var i,o,s,c,u,d,l;if(!(!this.map&&t==this.type.wireType||!r&&this.repeated&&this.options.packed&&t==e.WIRE_TYPES.LDELIM||this.map&&t==e.WIRE_TYPES.LDELIM))throw Error("Illegal wire type for field "+this.toString(!0)+": "+t+" ("+this.type.wireType+" expected)");if(t==e.WIRE_TYPES.LDELIM&&this.repeated&&this.options.packed&&e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType)>=0&&!r){for(o=n.readVarint32(),o=n.offset+o,s=[];n.offset<o;)s.push(this.decode(this.type.wireType,n,!0));return s}if(this.map){if(c=a.defaultFieldValue(this.keyType),i=a.defaultFieldValue(this.t
1ype),o=n.readVarint32(),n.remaining()<o)throw Error("Illegal number of bytes for "+this.toString(!0)+": "+o+" required but got only "+n.remaining());for((u=n.clone()).limit=u.offset+o,n.offset+=o;u.remaining()>0;)if(t=7&(d=u.readVarint32()),1===(l=d>>>3))c=this.keyElement.decode(u,t,l);else{if(2!==l)throw Error("Unexpected tag in map field key/value submessage");i=this.element.decode(u,t,l)}return[c,i]}return this.element.decode(n,t,this.id)},T.Message.Field=l,f=function(e,t,n,r,i,o,s){l.call(this,e,t,n,null,r,i,o,s),this.extension},f.prototype=Object.create(l.prototype),T.Message.ExtensionField=f,g=function(e,t,n){y.call(this,e,t,n),this.fields=[]},T.Message.OneOf=g,p=function(e,t,n,r,i){o.call(this,e,t,n,r,i),this.className="Enum",this.object=null},p.getName=function(e,t){var n,r,i=Object.keys(e);for(r=0;r<i.length;++r)if(e[n=i[r]]===t)return n;return null},(p.prototype=Object.create(o.prototype)).build=function(t){var n,r,i,o;if(this.object&&!t)return this.object;for(n=new e.Builder.Enum,i=0,o=(r=this.getChildren(p.Value)).length;o>i;++i)n[r[i].name]=r[i].id;return Object.defineProperty&&Object.defineProperty(n,"$options",{value:this.buildOpt(),enumerable:!1}),this.object=n},T.Enum=p,v=function(e,t,n,r){y.call(this,e,t,n),this.className="Enum.Value",this.id=r},v.prototype=Object.create(y.prototype),T.Enum.Value=v,_=function(e,t,n,r){y.call(this,e,t,n),this.field=r},_.prototype=Object.create(y.prototype),T.Extension=_,E=function(e,t,n,r){o.call(this,e,t,n,r),this.className="Service",this.clazz=null},(E.prototype=Object.create(o.prototype)).build=function(t){return this.clazz&&!t?this.clazz:this.clazz=function(e,t){var n,i=function(t){e.Builder.Service.call(this),this.rpcImpl=t||function(e,t,n){setTimeout(n.bind(this,Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")),0)}},o=i.prototype=Object.create(e.Builder.Service.prototype),s=t.getChildren(e.Reflect.Service.RPCMethod);for(n=0;n<s.length;n++)!function(e){o[e.name]=function(n,i){try{try{n=e.resolvedRequestType.clazz.decode(r.wrap(n))}catch(e){if(!(e instanceof TypeError))throw e}if(null===n||"object"!==si(n))throw Error("Illegal arguments");n instanceof e.resolvedRequestType.clazz||(n=new e.resolvedRequestType.clazz(n)),this.rpcImpl(e.fqn(),n,(function(n,r){if(!n){try{r=e.resolvedResponseType.clazz.decode(r)}catch(e){}return r&&r instanceof e.resolvedResponseType.clazz?void i(null,r):void i(Error("Illegal response type received in service method "+t.name+"#"+e.name))}i(n)}))}catch(e){setTimeout(i.bind(this,e),0)}},i[e.name]=function(t,n,r){new i(t)[e.name](n,r)},Object.defineProperty&&(Object.defineProperty(i[e.name],"$options",{value:e.buildOpt()}),Object.defineProperty(o[e.name],"$options",{value:i[e.name].$options}))}(s[n]);return Object.defineProperty&&(Object.defineProperty(i,"$options",{value:t.buildOpt()}),Object.defineProperty(o,"$options",{value:i.$options}),Object.defineProperty(i,"$type",{value:t}),Object.defineProperty(o,"$type",{value:t})),i}(e,this)},T.Service=E,m=function(e,t,n,r){y.call(this,e,t,n),this.className="Service.Method",this.options=r||{}},(m.prototype=Object.create(y.prototype)).buildOpt=s.buildOpt,T.Service.Method=m,I=function(e,t,n,r,i,o,s,a){m.call(this,e,t,n,a),this.className="Service.RPCMethod",this.requestName=r,this.responseName=i,this.requestStream=o,this.responseStream=s,this.resolvedRequestType=null,this.resolvedResponseType=null},I.prototype=Object.create(m.prototype),T.Service.RPCMethod=I,T}(o),o.Builder=function(e,t,n){function r(e){e.messages&&e.messages.forEach((function(t){t.syntax=e.syntax,r(t)})),e.enums&&e.enums.forEach((function(t){t.syntax=e.syntax}))}var i=function(e){this.ns=new n.Namespace(this,null,""),this.ptr=this.ns,this.resolved=!1,this.result=null,this.files={},this.importRoot=null,this.options=e||{}},o=i.prototype;return i.isMessage=function(e){return"string"==typeof e.name&&(void 0===e.values&&void 0===e.rpc)},i.isMessageField=function(e){return"string"==typeof e.rule&&"string"==typeof e.name&&"string"==typeof e.type&&void 0!==e.id},i.isEnum=function(e){return"string"==typeof e.name&&!(void 0===e.values||!Array.isArray(e.values)||0===e.values.length)},i.isService=function(e){return!("string"!=typeof e.name||"object"!==si(e.rpc)||!e.rpc)},i.isExtend=function(e){return"string"==typeof e.ref},o.reset=function(){return this.ptr=this.ns,this},o.define=function(e){if("string"!=typeof e||!t.TYPEREF.test(e))throw Error("illegal namespace: "+e);return e.split(".").forEach((function(e){var t=this.ptr.getChild(e);null===t&&this.ptr.addChild(t=new n.Namespace(this,this.ptr,e)),this.ptr=t}),this),this},o.create=function(t){var r,o,s,a,c;if(!t)return this;if(Array.isArray(t)){if(0===t.length)return this;t=t.slice()}else t=[t];for(r=[t];r.length>0;){if(t=r.pop(),!Array.isArray(t))throw Error("not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){if(o=t.shift(),i.isMessage(o)){if(s=new n.Message(this,this.ptr,o.name,o.options,o.isGroup,o.syntax),a={}
1,o.oneofs&&Object.keys(o.oneofs).forEach((function(e){s.addChild(a[e]=new n.Message.OneOf(this,s,e))}),this),o.fields&&o.fields.forEach((function(e){if(null!==s.getChild(0|e.id))throw Error("duplicate or invalid field id in "+s.name+": "+e.id);if(e.options&&"object"!==si(e.options))throw Error("illegal field options in "+s.name+"#"+e.name);var t=null;if("string"==typeof e.oneof&&!(t=a[e.oneof]))throw Error("illegal oneof in "+s.name+"#"+e.name+": "+e.oneof);e=new n.Message.Field(this,s,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,o.syntax),t&&t.fields.push(e),s.addChild(e)}),this),c=[],o.enums&&o.enums.forEach((function(e){c.push(e)})),o.messages&&o.messages.forEach((function(e){c.push(e)})),o.services&&o.services.forEach((function(e){c.push(e)})),o.extensions&&(s.extensions="number"==typeof o.extensions[0]?[o.extensions]:o.extensions),this.ptr.addChild(s),c.length>0){r.push(t),t=c,c=null,this.ptr=s,s=null;continue}c=null}else if(i.isEnum(o))s=new n.Enum(this,this.ptr,o.name,o.options,o.syntax),o.values.forEach((function(e){s.addChild(new n.Enum.Value(this,s,e.name,e.id))}),this),this.ptr.addChild(s);else if(i.isService(o))s=new n.Service(this,this.ptr,o.name,o.options),Object.keys(o.rpc).forEach((function(e){var t=o.rpc[e];s.addChild(new n.Service.RPCMethod(this,s,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))}),this),this.ptr.addChild(s);else{if(!i.isExtend(o))throw Error("not a valid definition: "+JSON.stringify(o));if(s=this.ptr.resolve(o.ref,!0))o.fields.forEach((function(t){var r,i,o,a;if(null!==s.getChild(0|t.id))throw Error("duplicate extended field id in "+s.name+": "+t.id);if(s.extensions&&(r=!1,s.extensions.forEach((function(e){t.id>=e[0]&&t.id<=e[1]&&(r=!0)})),!r))throw Error("illegal extended field id in "+s.name+": "+t.id+" (not within valid ranges)");i=t.name,this.options.convertFieldsToCamelCase&&(i=e.Util.toCamelCase(i)),o=new n.Message.ExtensionField(this,s,t.rule,t.type,this.ptr.fqn()+"."+i,t.id,t.options),a=new n.Extension(this,this.ptr,t.name,o),o.extension=a,this.ptr.addChild(a),s.addChild(o)}),this);else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("extended message "+o.ref+" is not defined")}o=null,s=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},o.import=function(t,n){var i,o,s,a,c,u,d,l,h="/";if("string"==typeof n){if(e.Util.IS_NODE,!0===this.files[n])return this.reset();this.files[n]=!0}else if("object"===si(n)){if(i=n.root,e.Util.IS_NODE,(i.indexOf("\\")>=0||n.file.indexOf("\\")>=0)&&(h="\\"),o=i+h+n.file,!0===this.files[o])return this.reset();this.files[o]=!0}if(t.imports&&t.imports.length>0){for(a=!1,"object"===si(n)?(this.importRoot=n.root,a=!0,s=this.importRoot,n=n.file,(s.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(h="\\")):"string"==typeof n?this.importRoot?s=this.importRoot:n.indexOf("/")>=0?""===(s=n.replace(/\/[^\/]*$/,""))&&(s="/"):n.indexOf("\\")>=0?(s=n.replace(/\\[^\\]*$/,""),h="\\"):s=".":s=null,c=0;c<t.imports.length;c++)if("string"==typeof t.imports[c]){if(!s)throw Error("cannot determine import root");if("google/protobuf/descriptor.proto"===(u=t.imports[c]))continue;if(u=s+h+u,!0===this.files[u])continue;if(/\.proto$/i.test(u)&&!e.DotProto&&(u=u.replace(/\.proto$/,".json")),null===(d=e.Util.fetch(u)))throw Error("failed to import '"+u+"' in '"+n+"': file not found");/\.json$/i.test(u)?this.import(JSON.parse(d+""),u):this.import(e.DotProto.Parser.parse(d),u)}else n?/\.(\w+)$/.test(n)?this.import(t.imports[c],n.replace(/^(.+)\.(\w+)$/,(function(e,t,n){return t+"_import"+c+"."+n}))):this.import(t.imports[c],n+"_import"+c):this.import(t.imports[c]);a&&(this.importRoot=null)}return t.package&&this.define(t.package),t.syntax&&r(t),l=this.ptr,t.options&&Object.keys(t.options).forEach((function(e){l.options[e]=t.options[e]})),t.messages&&(this.create(t.messages),this.ptr=l),t.enums&&(this.create(t.enums),this.ptr=l),t.services&&(this.create(t.services),this.ptr=l),t.extends&&this.create(t.extends),this.reset()},o.resolveAll=function(){var r;if(null==this.ptr||"object"===si(this.ptr.type))return this;
1if(this.ptr instanceof n.Namespace)this.ptr.children.forEach((function(e){this.ptr=e,this.resolveAll()}),this);else if(this.ptr instanceof n.Message.Field){if(t.TYPE.test(this.ptr.type))this.ptr.type=e.TYPES[this.ptr.type];else{if(!t.TYPEREF.test(this.ptr.type))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(!(r=(this.ptr instanceof n.Message.ExtensionField?this.ptr.extension.parent:this.ptr.parent).resolve(this.ptr.type,!0)))throw Error("unresolvable type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);if(this.ptr.resolvedType=r,r instanceof n.Enum){if(this.ptr.type=e.TYPES.enum,"proto3"===this.ptr.syntax&&"proto3"!==r.syntax)throw Error("proto3 message cannot reference proto2 enum")}else{if(!(r instanceof n.Message))throw Error("illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.type);this.ptr.type=r.isGroup?e.TYPES.group:e.TYPES.message}}if(this.ptr.map){if(!t.TYPE.test(this.ptr.keyType))throw Error("illegal key type for map field in "+this.ptr.toString(!0)+": "+this.ptr.keyType);this.ptr.keyType=e.TYPES[this.ptr.keyType]}}else if(this.ptr instanceof e.Reflect.Service.Method){if(!(this.ptr instanceof e.Reflect.Service.RPCMethod))throw Error("illegal service type in "+this.ptr.toString(!0));if(!((r=this.ptr.parent.resolve(this.ptr.requestName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.requestName);if(this.ptr.resolvedRequestType=r,!((r=this.ptr.parent.resolve(this.ptr.responseName,!0))&&r instanceof e.Reflect.Message))throw Error("Illegal type reference in "+this.ptr.toString(!0)+": "+this.ptr.responseName);this.ptr.resolvedResponseType=r}else if(!(this.ptr instanceof e.Reflect.Message.OneOf||this.ptr instanceof e.Reflect.Extension||this.ptr instanceof e.Reflect.Enum.Value))throw Error("illegal object in namespace: "+si(this.ptr)+": "+this.ptr);return this.reset()},o.build=function(e){var t,n,r;if(this.reset(),this.resolved||(this.resolveAll(),this.resolved=!0,this.result=null),null===this.result&&(this.result=this.ns.build()),!e)return this.result;for(t="string"==typeof e?e.split("."):e,n=this.result,r=0;r<t.length;r++){if(!n[t[r]]){n=null;break}n=n[t[r]]}return n},o.lookup=function(e,t){return e?this.ns.resolve(e,t):this.ns},o.toString=function(){return"Builder"},i.Message=function(){},i.Enum=function(){},i.Service=function(){},i}(o,o.Lang,o.Reflect),o.Map=function(e,t){function n(e){var t=0;return{next:function(){return t<e.length?{done:!1,value:e[t++]}:{done:!0}}}}var r=function(e,n){var r,i,o,s;if(!e.map)throw Error("field is not a map");if(this.field=e,this.keyElem=new t.Element(e.keyType,null,!0,e.syntax),this.valueElem=new t.Element(e.type,e.resolvedType,!1,e.syntax),this.map={},Object.defineProperty(this,"size",{get:function(){return Object.keys(this.map).length}}),n)for(r=Object.keys(n),i=0;i<r.length;i++)o=this.keyElem.valueFromString(r[i]),s=this.valueElem.verifyValue(n[r[i]]),this.map[this.keyElem.valueToString(o)]={key:o,value:s}},i=r.prototype;return i.clear=function(){this.map={}},i.delete=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e)),n=t in this.map;return delete this.map[t],n},i.entries=function(){var e,t,r=[],i=Object.keys(this.map);for(t=0;t<i.length;t++)r.push([(e=this.map[i[t]]).key,e.value]);return n(r)},i.keys=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].key);return n(t)},i.values=function(){var e,t=[],r=Object.keys(this.map);for(e=0;e<r.length;e++)t.push(this.map[r[e]].value);return n(t)},i.forEach=function(e,t){var n,r,i=Object.keys(this.map);for(r=0;r<i.length;r++)e.call(t,(n=this.map[i[r]]).value,n.key,this)},i.set=function(e,t){var n=this.keyElem.verifyValue(e),r=this.valueElem.verifyValue(t);return this.map[this.keyElem.valueToString(n)]={key:n,value:r},this},i.get=function(e){var t=this.keyElem.valueToString(this.keyElem.verifyValue(e));return t in this.map?this.map[t].value:void 0},i.has=function(e){return this.keyElem.valueToString(this.keyElem.verifyValue(e))in this.map},r}(0,o.Reflect),o.loadProto=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=void 0),o.loadJson(o.DotProto.Parser.parse(e),t,n)},o.protoFromString=o.loadProto,o.loadProtoFile=function(e,t,n){if(t&&"object"===si(t)?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,o.loadProto(r,n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=o.Util.fetch("object"===si(e)?e.root+"/"+e.file:e);return null===r?null:o.loadProto(r,n,e)},o.protoFromFile=o.loadProtoFile,o.newBuilder=function(e){return void 0===(e=e||{}).convertFieldsToCamelCase&&(e.convertFieldsToCamelCase=o.convertFieldsToCamelCase),void 0===e.populateAccessors&&(e.populateAccessors=o.populateAccessors),new o.Builder(e)},o.loadJson=function(e,t,n){return("string"==typeof t||t&&"string"==typeof t.file&&"string"==typeof t.root)&&(n=t,t=null),t&&"object"===si(t)||(t=o.newBuilder()),"string"==typeof e&&(e=JSON.parse(e)),t.import(e,n),t.resolveAll(),t},o.loadJsonFile=function(e,t,n){if(t&&"object"===si(t)?(n=t,t=null):t&&"function"==typeof t||(t=null),t)return o.Util.fetch("string"==typeof e?e:e.root+"/"+e.file,(function(r){if(null!==r)try{t(null,o.loadJson(JSON.parse(r),n,e))}catch(e){t(e)}else t(Error("Failed to fetch file"))}));var r=o.Util.fetch("object"===si(e)?e.root+"/"+e.file:e);return null===r?null:o.loadJson(JSON.parse(r),n,e)},i=e,o.loadProto(i,void 0,"").build("Modules").probuf}(n,t);return r}ri({target:"Array",proto:!0},{fill:iT}),VN("fill");var xN=function(){function e(e,t,n){this.pbmaps=e,this.logger=n,this.pbModules=GN(t)}return e.prototype.getModule=function(e){return new this.pbModules[e]},e.prototype.encode=function(e,t,n){var r=new this.pbModules[e];if(t)try{this.pbmaps[e].forEach((function(e){var n=t[e];void 0!==n&&r["set".concat(function(e,t,n){if(void 0===t||void 0===n)return e.toUpperCase();var r=e.slice(t,n);return e.replace(r,(function(e){return e.toUpperCase()}))}(e,0,1))](n)}))}catch(t){var i="pbname: ".concat(e,", stack: ").concat(t.stack);this.logger?this.logger.error(Fd.L_PB_ENCODE_E,i):null===console||void 0===console||console.error(Fd.L_PB_ENCODE_E,i)}return n?r:r.toArrayBuffer()},e.prototype.decode=function(e,t){var n=this.pbModules[e].decode(t);return this.fixInt64Values(n)},e.prototype.fixInt64Values=function(e){var t=this;if(e instanceof Array)return e.map((function(e){return t.fixInt64Values(e)}));if(!pl(e))return e;if(void 0!==e.low&&void 0!==e.high&&Object.prototype.hasOwnProperty.call(e,"unsigned")){var n=e.low;return n<0&&(n+=4294967296),n=n.toString(16),parseInt(e.high.toString(16)+"00000000".replace(new RegExp("0{".concat(n.length,"}$")),n),16)}for(var r in e)e[r]=this.fixInt64Values(e[r]);return e},e}(),kN=ri,FN=xc.findIndex,HN=nd,qN="findIndex",KN=!0;qN in[]&&Array(1)[qN]((function(){KN=!1})),kN({target:"Array",proto:!0,forced:KN},{findIndex:function(e){return FN(this,e,arguments.length>1?arguments[1]:void 0)}}),HN(qN),ri({target:"Number",stat:!0},{isInteger:SR});var jN=s,YN=R,JN=d,QN=o,WN=Mi,zN=Mr,ZN=l,XN=Ge,$N=w,eA=Object.assign,tA=Object.defineProperty,nA=YN([].concat),rA=!eA||QN((function(){if(jN&&1!==eA({b:1},eA(tA({},"a",{enumerable:!0,get:function(){tA(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";return e[n]=7,r.split("").forEach((function(e){t[e]=e})),7!=eA({},e)[n]||WN(eA({},t)).join("")!=r}))?function(e,t){for(var n=XN(e),r=arguments.length,i=1,o=zN.f,s=ZN.f;r>i;)for(var a,c=$N(arguments[i++]),u=o?nA(WN(c),o(c)):WN(c),d=u.length,l=0;d>l;)a=u[l++],jN&&!JN(s,c,a)||(n[a]=c[a]);return n}:eA,iA=rA;ri({target:"Object",stat:!0,arity:2,forced:Object.assign!==iA},{assign:iA});var oA=function(){function e(e){this._context=e}return e.prototype.__getContext=function(){return this._context},e.prototype.createCodec=function(e,t){return this._context.createCodec(e,t)},e.prototype.refetchNaviInfo=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,this._context.refetchNaviInfo()]}))}))},e.prototype.getNaviInfo=function(){return this._context.getNaviInfoFromCac
1he()},e.prototype.getCoreVersion=function(){return"5.7.7"},e.prototype.getAPIVersion=function(){return"5.7.7"},e.prototype.getAppkey=function(){return this._context.appkey},e.prototype.getCurrentId=function(){return this._context.getCurrentUserId()},e.prototype.getConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.sendMessage=function(e,t,n){return this._context.sendMessage(e,t,n)},e.prototype.registerMessageType=function(e,t,n,r){void 0===r&&(r=[]),this._context.registerMessageType(e,t,n,r)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getOSInfo=function(){return this._context.getOSInfo()},e.prototype.getProcessInfo=function(){return this._context.getProcessInfo()},e.prototype.getMainProcessInfo=function(){return this._context.getMainProcessInfo()},e.prototype.setCallInfo=function(e,t,n){return this._context.setCallInfo(e,t,n)},e.prototype.createLogger=function(e,t){return this._context.createLogger(e,t)},e}(),sA=ri,aA=R,cA=Ie,uA=Ge,dA=gr,lA=bl,hA=Ei,fA=o,gA=zO,pA=Jc,vA=XO,_A=$O,EA=oe,mA=tN,IA=[],TA=aA(IA.sort),yA=aA(IA.push),RA=fA((function(){IA.sort(void 0)})),CA=fA((function(){IA.sort(null)})),SA=pA("sort"),OA=!fA((function(){if(EA)return EA<70;if(!(vA&&vA>3)){if(_A)return!0;if(mA)return mA<603;var e,t,n,r,i="";for(e=65;e<76;
1e++){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(r=0;r<47;r++)IA.push({k:t+r,v:n})}for(IA.sort((function(e,t){return t.v-e.v})),r=0;r<IA.length;r++)t=IA[r].k.charAt(0),i.charAt(i.length-1)!==t&&(i+=t);return"DGBEFHACIJK"!==i}}));sA({target:"Array",proto:!0,forced:RA||!CA||!SA||!OA},{sort:function(e){void 0!==e&&cA(e);var t=uA(this);if(OA)return void 0===e?TA(t):TA(t,e);var n,r,i=[],o=dA(t);for(r=0;r<o;r++)r in t&&yA(i,t[r]);for(gA(i,function(e){return function(t,n){return void 0===n?-1:void 0===t?1:void 0!==e?+e(t,n)||0:hA(t)>hA(n)?1:-1}}(e)),n=dA(i),r=0;r<n;)t[r]=i[r++];for(;r<o;)lA(t,r++);return t}});var NA=ri,AA=xc.find,MA=nd,UA="find",LA=!0;UA in[]&&Array(1)[UA]((function(){LA=!1})),NA({target:"Array",proto:!0,forced:LA},{find:function(e){return AA(this,e,arguments.length>1?arguments[1]:void 0)}}),MA(UA);var wA,bA,PA,DA=s,BA=R,VA=Mi,GA=x,xA=BA(l.f),kA=BA([].push),FA=function(e){return function(t){for(var n,r=GA(t),i=VA(r),o=i.length,s=0,a=[];o>s;)n=i[s++],DA&&!xA(r,n)||kA(a,e?[n,r[n]]:r[n]);return a}},HA={entries:FA(!0),values:FA(!1)}.values;ri({target:"Object",stat:!0},{values:function(e){return HA(e)}}),(0,by.exports)("Int8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var qA,KA,jA,YA,JA="pgMsgP",QA="chatMsg",WA="pcMsgP",zA={PRIVATE:"ppMsgS",GROUP:"pgMsgS",CHATROOM:"chatMsgS"},ZA="delMsg",XA="joinChrm",$A="joinChrmR",eM="exitChrm",tM="setKV",nM="delKV",rM="setKVS",iM="delKVS",oM="qryRelationR",sM="delRelation",aM="setSeAtt",cM={PRIVATE:"cleanPMsg",GROUP:"cleanGMsg",ULTRA_GROUP:"cleanGMsg",CUSTOMER_SERVICE:"cleanCMsg",SYSTEM:"cleanSMsg"},uM="qryPMsg",dM="qryGMsg",lM="qryCHMsg",hM="qryCMsg",fM="qrySMsg",gM=((wA={})["ppMsgP"]=Od.PRIVATE,wA[JA]=Od.GROUP,wA[QA]=Od.CHATROOM,wA[WA]=Od.CUSTOMER_SERVICE,wA),pM=((bA={})[Od.PRIVATE]=uM,bA[Od.GROUP]=dM,bA[Od.CHATROOM]=lM,bA[Od.CUSTOMER_SERVICE]=hM,bA[Od.SYSTEM]=fM,bA),vM=((PA={})[Od.PRIVATE]=cM.PRIVATE,PA[Od.GROUP]=cM.GROUP,PA[Od.ULTRA_GROUP]=cM.ULTRA_GROUP,PA[Od.CUSTOMER_SERVICE]=cM.CUSTOMER_SERVICE,PA[Od.SYSTEM]=cM.SYSTEM,PA),_M="1",EM="0",mM=1,IM=2,TM=3,yM=r.isFinite;ri({target:"Number",stat:!0},{isFinite:Number.isFinite||function(e){return"number"==typeof e&&yM(e)}}),function(e){e[e.AT_MOST_ONCE=0]="AT_MOST_ONCE",e[e.AT_LEAST_ONCE=1]="AT_LEAST_ONCE",e[e.EXACTLY_ONCE=2]="EXACTLY_ONCE",e[e.DEFAULT=3]="DEFAULT"}(qA||(qA={})),function(e){e[e.SYMMETRIC=0]="SYMMETRIC",e[e.CONNECT=1]="CONNECT",e[e.CONN_ACK=2]="CONN_ACK",e[e.PUBLISH=3]="PUBLISH",e[e.PUB_ACK=4]="PUB_ACK",e[e.QUERY=5]="QUERY",e[e.QUERY_ACK=6]="QUERY_ACK",e[e.QUERY_CONFIRM=7]="QUERY_CONFIRM",e[e.SUBSCRIBE=8]="SUBSCRIBE",e[e.SUB_ACK=9]="SUB_ACK",e[e.UNSUBSCRIBE=10]="UNSUBSCRIBE",e[e.UNSUB_ACK=11]="UNSUB_ACK",e[e.PING_REQ=12]="PING_REQ",e[e.PING_RESP=13]="PING_RESP",e[e.DISCONNECT=14]="DISCONNECT",e[e.RESERVER2=15]="RESERVER2"}(KA||(KA={})),function(e){e.PUB="pub",e.QUERY="qry"}(jA||(jA={})),function(e){e[e.V4=4]="V4",e[e.V3=3]="V3"}(YA||(YA={}));var RM,CM=function(){function e(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=qA.AT_LEAST_ONCE),void 0===r&&(r=!1),this._retain=!1,this.qos=qA.AT_LEAST_ONCE,this._dup=!1,this.syncMsg=!1,e&&e>0&&1===arguments.length?(this._retain=(1&e)>0,this.qos=(6&e)>>1,this._dup=(8&e)>0,this.type=e>>4&15,this.syncMsg=8==(8&e)):(this.type=e,this._retain=t,this.qos=n,this._dup=r)}return e.prototype.encode=function(){var e=this.type<<4;return e|=this._retain?1:0,e|=this.qos<<1,e|=this._dup?8:0},e}(),SM=function(){function e(){}return e.writeUTF=function(e,t){for(var n=this._getBackAndByteSize(e),r=n.back,i=n.byteSize,o=0,s=r.length;o<s;o++)r[o]>255&&(r[o]&=255);return t?r:i<=255?[0,i].concat(r):[i>>8,255&i].concat(r)},e._getBackAndByteSize=function(e){var t=[],n=0;if(dl(e))for(var r=0,i=e.length;r<i;r++){var o=e.charCodeAt(r);o>=0&&o<=127?(n+=1,t.push(o)):o>=128&&o<=2047?(n+=2,t.push(192|31&o>>6),t.push(128|63&o)):o>=2048&&o<=65535&&(n+=3,t.push(224|15&o>>12),t.push(128|63&o>>6),t.push(128|63&o))}return{byteSize:n,back:t}},e.readUTF=function(e){for(var t,n,r=[],i=-1,o=e,s="";++i<o.length;){var a=Number(o[i]);if(a===(127&a)||(240==(240&a)?a=(a=(a=(a^=240)<<6|128^o[++i])<<6|128^o[++i])<<6|128^o[++i]:224==(224&a)?a=(a=(a^=224)<<6|128^o[++i])<<6|128^o[++i]:192==(192&a)&&(a=(a^=192)<<6|128^o[++i])),!Number.isFinite(a)||a<0||a>1114111||Math.floor(a)!==a)throw RangeError("Invalid code point: ".concat(a));a<=65535?r.push(a):(t=(a-=65536)>>10|55296,n=a%1024|56320,r.push(t,n)),(i+1===o.length||r.length>16384)&&(s+=String.fromCharCode.apply(null,r),r.length=0)}return s},e}(),OM=function(){function e(e){this._position=0,this._poolLen=0,this._pool=e,this._poolLen=e.length}return e.prototype.check=function(){return this._position>=this._pool.length},e.prototype.read2Byte=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<2;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r.toString()}return parseInt(t,16)},e.prototype.readInt=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<4;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r.toString()}return parseInt(t,16)},e.prototype.readLong=function(){var e=this;if(e.check())return-1;for(var t="",n=0;n<8;n++){var r=e._pool[e._position++].toString(16);1===r.length&&(r="0".concat(r)),t+=r}return parseInt(t,16)},e.prototype.readByte=function(){if(this.check())return-1;var e=this._pool[this._position++];return e>255&&(e&=255),e},e.prototype.readUTF=function(){if(this.check())return"";var e=this.readByte()<<8|this.readByte(),t=this._position;this._position+=e;var n=this._pool.subarray(t,this._position);return SM.readUTF(n)},e.prototype.readAll=function(){return this._pool.subarray(this._position,this._poolLen
1)},e}(),NM=function(){function e(){this._pool=[],this._position=0,this._writen=0}return e.prototype.write=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")?this._pool=this._pool.concat(e):e>=0&&(e>255&&(e&=255),this._pool.push(e),this._writen++),e},e.prototype.writeArr=function(e){return this._pool=this._pool.concat(e),e},e.prototype.writeUTF=function(e){var t=SM.writeUTF(e);this._pool=this._pool.concat(t),this._writen+=t.length},e.prototype.getBytesArray=function(){return this._pool},e}(),AM=function(e,t){return e&&t?"".concat(t,"_").concat(e):e||Date.now()},MM=function(){function e(e){this.header=e,this.messageId=0,this.timestamp=0,this.syncMsg=!1,this.identifier=""}return e.prototype.getIdentifier=function(){var e=this.messageId,t=this.identifier;return AM(e,t)},e.prototype.read=function(e,t,n,r){this.readMessage(e,t,n,r)},e.prototype.readMessage=function(e,t,n,r){return{stream:t,length:n}},e}(),UM=function(){function e(e){this.lengthSize=0,this.messageId=0,this.topic="",this.targetId="",this.identifier="",this._header=new CM(e,!1,qA.AT_MOST_ONCE,!1)}return e.prototype.getIdentifier=function(){var e=this.messageId,t=this.identifier;return AM(e,t)},e.prototype.write=function(e){var t=this.getHeaderFlag();e.write(t),this.writeMessage(e)},e.prototype.setHeaderQos=function(e){this._header.qos=e},e.prototype.getHeaderFlag=function(){return this._header.encode()},e.prototype.getLengthSize=function(){return this.lengthSize},e.prototype.getBufferData=function(){var e=new NM;this.write(e);var t=e.getBytesArray();return new Int8Array(t)},e}(),LM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=null,t.userId=null,t.timestamp=0,t}return ac(t,e),t.prototype.readMessage=function(e,n,r,i){if(n.readByte(),this.status=+n.readByte(),r<=t.MESSAGE_LENGTH)return{stream:n,length:r};if(i===YA.V4){var o=n.readByte();1&o&&(this.userId=n.readUTF()),2&o&&n.readUTF(),4&o&&(this.timestamp=n.readLong()),8&o&&(this.messageId=n.read2Byte())}else{this.userId=n.readUTF();var s=n.readUTF();e.debug(Fd.O,"server sessionId -> ".concat(s)),this.timestamp=n.readLong()}return{stream:n,length:r}},t.MESSAGE_LENGTH=2,t}(MM),wM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t}return ac(t,e),t.prototype.readMessage=function(e,t,n){return t.readByte(),this.status=+t.readByte(),{stream:t,length:n}},t.MESSAGE_LENGTH=2,t}(MM),bM=function(e){function t(){return e.call(this,KA.PING_REQ)||this}return ac(t,e),t.prototype.writeMessage=function(e){},t}(UM),PM=function(e){function t(t){return e.call(this,t)||this}return ac(t,e),t}(MM),DM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.messageId=0,t}return ac(t,e),t.prototype.readMessage=function(e,t,n){var r=256*t.readByte()+t.readByte();return this.messageId=parseInt(r.toString(),10),{stream:t,length:n}},t}(MM),BM=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ac(t,e),t.prototype.writeMessage=function(e){var t=this.messageId,n=255&t,r=(65280&t)>>8;e.write(r),e.write(n)},t}(UM),VM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.topic="",t.targetId="",t.syncMsg=!1,t.identifier=jA.PUB,t}return ac(t,e),t.prototype.readMessage=function(t,n,r){return this.date=n.readInt(),this.topic=n.readUTF(),this.targetId=n.readUTF(),e.prototype.readMessage.call(this,t,n,r),this.data=n.readAll(),{stream:n,length:r}},t}(DM),GM=function(e){function t(t,n,r){var i=e.call(this,KA.PUBLISH)||this;return i.syncMsg=!1,i.identifier=jA.PUB,i.topic=t,i.data=dl(n)?SM.writeUTF(n):n,i.targetId=r,i}return ac(t,e),t.prototype.writeMessage=function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.write(this.data)},t}(BM),xM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t.date=0,t.millisecond=0,t.messageUId="",t.timestamp=0,t.identifier=jA.PUB,t.topic="",t.targetId="",t}return ac(t,e),t.prototype.readMessage=function(t,n,r){return e.prototype.readMessage.call(this,t,n,r),this.date=n.readInt(),this.status=256*n.readByte()+n.readByte(),this.millisecond=256*n.readByte()+n.readByte(),this.timestamp=1e3*this.date+this.millisecond,this.messageUId=n.readUTF(),{stream:n,length:r}},t}(DM),kM=function(e){function t(t){var n=e.call(this,KA.PUB_ACK)||this;return n.status=0,n.date=0,n.millisecond=0,n.messageUId="",n.timestamp=0,n.messageId=t,n}return ac(t,e),t.prototype.writeMessage=function(t){e.prototype.writeMessage.call(this,t)},t}(BM),FM=function(e){function t(t,n,r){var i=e.call(this,KA.QUERY)||this;return i.identifier=jA.QUERY,i.topic=t,i.data=dl(n)?SM.writeUTF(n):n,i.targetId=r,i}return ac(t,e),t.prototype.writeMessage=function(t){t.writeUTF(this.topic),t.writeUTF(this.targetId),e.prototype.writeMessage.call(this,t),t.write(this.data)},t}(BM),HM=function(e){function t(t){var n=e.call(this,KA.QUERY_CONFIRM
1)||this;return n.messageId=t,n}return ac(t,e),t}(BM),qM=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.status=0,t.identifier=jA.QUERY,t.topic="",t.targetId="",t}return ac(t,e),t.prototype.readMessage=function(t,n,r){return e.prototype.readMessage.call(this,t,n,r),this.date=n.readInt(),this.status=256*n.readByte()+n.readByte(),this.data=n.readAll(),{stream:n,length:r}},t}(DM),KM=function(e,t,n){var r=new Uint8Array(t),i=new OM(r),o=i.readByte(),s=function(e,t){var n,r=e.type;switch(r){case KA.CONN_ACK:n=new LM(e);break;case KA.PUBLISH:(n=new VM(e)).syncMsg=e.syncMsg;break;case KA.PUB_ACK:n=new xM(e);break;case KA.QUERY_ACK:n=new qM(e);break;case KA.SUB_ACK:case KA.UNSUB_ACK:case KA.PING_RESP:n=new PM(e);break;case KA.DISCONNECT:n=new wM(e);break;default:n=new MM(e),t.error(Fd.O,"No support for deserializing ".concat(r," messages"))}return n}(new CM(o),e);return s.read(e,i,r.length-1,n),s};!function(e){e[e.ppMsgP=1]="ppMsgP",e[e.ppMsgN=2]="ppMsgN",e[e.ppMsgS=3]="ppMsgS",e[e.pgMsgP=4]="pgMsgP",e[e.chatMsg=5]="chatMsg",e[e.pcMsgP=6]="pcMsgP",e[e.qryPMsg=7]="qryPMsg",e[e.qryGMsg=8]="qryGMsg",e[e.qryCHMsg=9]="qryCHMsg",e[e.qryCMsg=10]="qryCMsg",e[e.qrySMsg=11]="qrySMsg",e[e.recallMsg=12]="recallMsg",e[e.prMsgS=13]="prMsgS",e[e.rrMsg=14]="rrMsg",e[e.rrList=15]="rrList",e[e.s_ntf=16]="s_ntf",e[e.s_msg=17]="s_msg",e[e.s_stat=18]="s_stat",e[e.s_cmd=19]="s_cmd",e[e.s_us=20]="s_us",e[e.pullUS=21]="pullUS",e[e.pgMsgS=22]="pgMsgS",e[e.chatMsgS=23]="chatMsgS",e[e.qrySessionsAtt=24]="qrySessionsAtt",e[e.pullMsg=25]="pullMsg",e[e.qrySessions=26]="qrySessions",e[e.delSessions=27]="delSessions",e[e.delMsg=28]="delMsg",e[e.updRRTime=29]="updRRTime",e[e.chrmPull=30]="chrmPull",e[e.joinChrm=31]="joinChrm",e[e.joinChrmR=32]="joinChrmR",e[e.exitChrm=33]="exitChrm",e[e.queryChrmI=34]="queryChrmI",e[e.setKV=35]="setKV",e[e.delKV=36]="delKV",e[e.pullKV=37]="pullKV",e[e.qryRelation=38]="qryRelation",e[e.delRelation=39]="delRelation",e[e.pullSeAtts=40]="pullSeAtts",e[e.setSeAtt=41]="setSeAtt",e[e.qnTkn=42]="qnTkn",e[e.qnUrl=43]="qnUrl",e[e.aliUrl=44]="aliUrl",e[e.s3Url=45]="s3Url",e[e.stcUrl=46]="stcUrl",e[e.minioUrl=47]="minioUrl",e[e.cleanPMsg=48]="cleanPMsg",e[e.cleanGMsg=49]="cleanGMsg",e[e.cleanCMsg=50]="cleanCMsg",e[e.cleanSMsg=51]="cleanSMsg",e[e.rtcPing=52]="rtcPing",e[e.rtc_ntf=53]="rtc_ntf",e[e.rtcSetOutData=54]="rtcSetOutData",e[e.rtcQryUserOutData=55]="rtcQryUserOutData",e[e.addSeTag=56]="addSeTag",e[e.delSeTag=57]="delSeTag",e[e.addTag=58]="addTag",e[e.delTag=59]="delTag",e[e.disTag=60]="disTag",e[e.reportsdk=61]="reportsdk",e[e.pullUgSes=62]="pullUgSes",e[e.pullUgMsg=63]="pullUgMsg",e[e.ugMsg=64]="ugMsg",e[e.qryUgMsg=65]="qryUgMsg",e[e.updUgRTime=66]="updUgRTime",e[e.upMsgEx=67]="upMsgEx",e[e.modifyMsg=68]="modifyMsg",e[e.qryMsgChange=69]="qryMsgChange",e[e.qryMsg=70]="qryMsg",e[e.operate=71]="operate",e[e.s_opNtf=72]="s_opNtf",e[e.ugUnpushQuery=73]="ugUnpushQuery",e[e.ugUnpushSet=74]="ugUnpushSet",e[e.setRtcRoomId=75]="setRtcRoomId",e[e.qryUgUal=76]="qryUgUal"}(RM||(RM={}));var jM=RM,YM="outbox",JM="inbox",QM="broadcastbox",WM=function(e,t,n){return[e,t,n].join("_")},zM=function(){function e(e,t){this._runtime=e,this._appkey=t,this._users={}}return e.prototype._getMemData=function(e){return this._users[e]=this._users[e]||{inboxTime:0,outboxTime:0,broadcastSyncTime:0},this._users[e]},e.prototype.setInboxTime=function(e,t){var n=this._getMemData(t);if(!(n.inboxTime>e)){n.inboxTime=e;var r=WM(JM,this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}},e.prototype.getInboxTime=function(e){var t=this._getMemData(e);if(0===t.inboxTime){var n=WM(JM,this._appkey,e);t.inboxTime=parseInt(this._runtime.localStorage.getItem(n),10)||0}return t.inboxTime},e.prototype.setBroadcastSyncTime=function(e,t){var n=this._getMemData(t);if(!(n.broadcastSyncTime>=e||_l(e))){n.broadcastSyncTime=e;var r=WM(QM,this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}},e.prototype.getBroadcastSyncTime=function(e){var t=this._getMemData(e);if(!t||0===t.broadcastSyncTime){var n=WM(QM,this._appkey,e);t.broadcastSyncTime=parseInt(this._runtime.localStorage.getItem(n),10)||1}return t.broadcastSyncTime},e.prototype.setOutboxTime=function(e,t){var n=this._getMemData(t);
1if(!(n.outboxTime>=e)){n.outboxTime=e;var r=WM(YM,this._appkey,t);this._runtime.localStorage.setItem(r,e.toString())}},e.prototype.getOutboxTime=function(e){var t=this._getMemData(e);if(0===t.outboxTime){var n=WM(YM,this._appkey,e);t.outboxTime=parseInt(this._runtime.localStorage.getItem(n),10)||0}return t.outboxTime},e}(),ZM={_caches:{},set:function(e,t){this._caches[e]=t},get:function(e){return this._caches[e]||0},clear:function(e){this._caches[e]=0}},XM=function(){function e(e,t,n){this.logger=e,this._kvCaches={},this._chatroomId=t,this._currentUserId=n}return e.prototype._add=function(e){var t=e.key;e.isDeleted=!1,this._kvCaches[t]=e},e.prototype._remove=function(e){var t=e.key,n=this._kvCaches[t];n&&(n.isDeleted=!0,this._kvCaches[t]=n)},e.prototype._setEntry=function(e,t){var n=e.key,r=e.type,i=e.isOverwrite,o=e.userId,s=this._getSetUserId(n),a=r===qd.DELETE,c=s===o,u=!this._isExisted(n),d=a?this._remove:this._add;(t||i||c||u)&&d.call(this,e)},e.prototype.getValue=function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.value},e.prototype.getVersion=function(e){var t=this._kvCaches[e]||{};return t.isDeleted?null:t.version},e.prototype.getAllValue=function(){var e={};for(var t in this._kvCaches)this._kvCaches[t].isDeleted||(e[t]=this._kvCaches[t].value);return e},e.prototype._getSetUserId=function(e){return(this._kvCaches[e]||{}).userId},e.prototype._isExisted=function(e){var t=this._kvCaches[e]||{},n=t.value,r=t.isDeleted;return n&&!r},e.prototype.setEntries=function(e){var t=this,n=e.kvEntries,r=e.isFullUpdate;n=n||[],(r=r||!1)&&this.clear(),n.forEach((function(e){t._setEntry(e,r)}))},e.prototype.clear=function(){this._kvCaches={}},e}(),$M=function(){function e(e){this._pullQueue=[],this._isPulling=!1,this._storeCaches={},this._engine=e}return e.prototype._startPull=function(){return uc(this,void 0,void 0,(function(){var e,t,n,r,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],t=e.chrmId,n=e.timestamp,(r=ZM.get(t))>n?(this._isPulling=!1,this._startPull(),[2]):[4,this._engine.pullChatroomEntry(t,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,this._isPulling=!1,o===Cd.SUCCESS?(ZM.set(t,s.syncTime||0),this._startPull()):this._startPull(),[2]}}))}))},e.prototype.reset=function(e){ZM.clear(e);var t=this._storeCaches[e];null==t||t.clear()},e.prototype.pullEntry=function(e,t){this._pullQueue.push({chrmId:e,timestamp:t}),this._startPull()},e.prototype.setLocal=function(e,t,n){var r=this._storeCaches[e];ml(r)||(r=new XM(this._engine.getInnerLogger(),e,n)),r.setEntries(t),this._storeCaches[e]=r},e.prototype.getValue=function(e,t){var n=this._storeCaches[e];return n?n.getValue(t):null},e.prototype.getVersion=function(e,t){var n=this._storeCaches[e];return n?n.getVersion(t):null},e.prototype.getAll=function(e){var t=this._storeCaches[e],n={};return t&&(n=t.getAllValue()),n},e}(),eU=function(){function e(e,t,n,r,i){this._runtime=e,this._appkey=t,this._userId=n,this._canJoinMulipleChrm=r,this.logger=i,this._sessionKey="",this._joinedChrmsInfo={},this._sessionKey="sync-chrm-".concat(this._appkey,"-").concat(this._userId)}return e.prototype.set=function(e,t){void 0===t&&(t=10),this._canJoinMulipleChrm||(this._joinedChrmsInfo={}),this._joinedChrmsInfo[e]=t,this._runtime.sessionStorage.setItem(this._sessionKey,JSON.stringify(this._joinedChrmsInfo))},e.prototype.get=function(){var e,t;try{t=this._runtime.sessionStorage.getItem(this._sessionKey),e=JSON.parse(t||"{}")}catch(n){this.logger.error(Fd.O,"parse rejoined chrm infos error -> ".concat(t)),e={}}return e},e.prototype.remove=function(e){delete this._joinedChrmsInfo[e],ml(this._joinedChrmsInfo)?this._runtime.sessionStorage.setItem(this._sessionKey,JSON.stringify(this._joinedChrmsInfo)):this.clear()},e.prototype.clear=function(){this._joinedChrmsInfo={},this._runtime.sessionStorage.removeItem(this._sessionKey)},e}(),tU="converStatusChanged",nU=function(){function e(e,t,n){this._eventEmitter=new sh,this._pullQueue=[],this._isPulling=!1,this._storagePullTimeKey="con-s-".concat(t,"-").concat(n),this._oldStorage=rc(e.runtime),this._storage=new oc(e.runtime,this._storagePullTimeKey),this._appkey=t,this._currentUserId=n,this._engine=e,this.adaptOldStatus()}return e.prototype.adaptOldStatus=function(){try{if(this._storage.get(this._storagePullTimeKey)||0)return;var e=this._oldStorage.get(this._storagePullTimeKey)||0;if(!e)return;this._storage.set(this._storagePullTimeKey,e),this._oldStorage.remove(this._storagePullTimeKey)}catch(e){this._engine.getInnerLogger().error(Fd.A_CALLBACK_E,"adaptOldStatus error: ".concat(e.message))}},e.prototype._set=function(e){var t=this;if(!_l(e)&&Array.isArray(e)){var n=this._storage.get(this._storagePullTimeKey)||0,r=e.length;e.forEach((function(e,i){var o=e.updatedTime||0;n=o>n?o:n,e.conversationType=e.type,t._eventEmitter.emit(tU,{statusItem:e,isLastPull:i===r-1})})),this._storage.set(this._storagePullTimeKey,n)}},e.prototype._startPull=function(){return uc(this,void 0,void 0,(function(){var e,t,n,r;return dc(this,(function(i){switch(i.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],[4,this._engine.pullConversationStatus(e)]);case 1:return t=i.sent(),n=t.code,r=t.data,n===Cd.SUCCESS?(this._isPulling=!1,this._set(r),this._startPull()):this._startPull(),[2]}}))}))},e.prototype.pull=function(e){var t=this._storage.get(this._storagePullTimeKey)||0;(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())},e.prototype.watch=function(e){this._eventEmitter.on(tU,(function(t){e(t)}))},e.prototype.setConversationUpdatedTime=function(e){var t=this._storage.get(this._storagePullTimeKey)||0;return e&&e>t?(this._storage.set(this._storagePullTimeKey,e),e):t},e.prototype.getConversationUpdatedTime=function(){return this._storage.get(this._storagePullTimeKey)||0},e}(),rU={c:{keyName:"unreadMessageCount",defaultVal:0},hm:{keyName:"hasMentioned",defaultVal:!1},m:{keyName:"mentionedInfo",defaultVal:null},t:{keyName:"lastUnreadTime",defaultVal:0},lt:{keyName:"lastReadTime",defaultVal:0},nc:{keyName:"notificationStatus",defaultVal:2},nl:{keyName:"notificationLevel",defaultVal:0},to:{keyName:"isTop",defaultVal:!1},tg:{keyName:"tags",defaultVal:{}},mc:{keyName:"unreadMentionedCount",defaultVal:0},st:{keyName:"lastMessageSentTime",defaultVal:0}},iU={};for(var oU in rU){var sU=rU[oU].keyName;iU[sU]=oU}var aU,cU=function(){function e(e,t,n,r){this._appkey=t,this._currentUserId=n,this.logger=r;var i="con-".concat(t,"-").concat(n);this.storage=new oc(e,i),this._localStore=new oc(e,"CONVER-".concat(t,"-").concat(n))}return e.prototype._getStoreKey=function(e,t,n){return"".concat(n,"_").concat(e,"_").concat(t)},e.prototype._getConOptionByKey=function(e){var t=(e=e||"").split("_");if(t.length>=2){var n=t.shift(),r=t.shift(),i=t.join("_");return{conversationType:Number(r),targetId:i,channelId:n}}return{conversationType:Od.PRIVATE,targetId:"",channelId:""}},e.prototype._updateMentionedUserList=function(e,t,n){var r=this,i=e.conversationType,o=e.messageType,s=e.isMentioned,a=e.senderUserId;
1s&&i===Od.GROUP&&((n.userIdList||[]).forEach((function(e){e===r._currentUserId&&t.indexOf(a)<0&&t.push(a)})),n.type===Bd.ALL&&t.indexOf(a)<0&&t.push(a));if(o===Ud.RECALL&&i===Od.GROUP){var c=t.indexOf(a);c>=0&&t.splice(c,1)}return t},e.prototype.updateMentionedData=function(e){var t=e.conversationType,n=e.targetId,r=e.content,i=e.channelId,o=r.mentionedInfo;if(o){var s=this._getStoreKey(t,n,i),a=this._localStore.get(s)||{},c=iU.mentionedInfo,u=iU.hasMentioned,d=a[c]||{},l=d.userIdList||[];o={userIdList:l=this._updateMentionedUserList(e,l,o),type:(null==o?void 0:o.type)||d.type},0!==l.length?(a[c]=o,a[u]=!0):(delete a[c],delete a[u]),ml(a)?this._localStore.set(s,a):this._localStore.remove(s)}},e.prototype._setLocal=function(e,t){if("tags"===e)for(var n in t)t[n].isTop||delete t[n].isTop;return t},e.prototype.set=function(e,t,n,r){var i=this._getStoreKey(e,t,r),o=this._localStore.get(i)||{};for(var s in n){var a=iU[s],c=n[s];if(!_l(a)&&!_l(c)&&"hasMentioned"!==s&&"MentionedInfo"!==s)c===rU[a].defaultVal||"tags"===s&&!ml(c)?delete o[a]:o[a]=this._setLocal(s,c),o.c||(delete o.t,delete o.hm,delete o.m,delete o.mc)}var u=Object.keys(o);1===u.length&&u.includes("st")&&delete o.st,ml(o)?this._localStore.set(i,o):this._localStore.remove(i)},e.prototype.get=function(e,t,n){void 0===n&&(n="");var r=this._getStoreKey(e,t,n),i=this._localStore.get(r)||{},o={};for(var s in rU){var a=rU[s],c=a.keyName,u=a.defaultVal;o[c]=i[s]||GE(u)}return o},e.prototype.getValue=function(e){var t=this._localStore.getValues()||{},n=[];for(var r in t){var i=this._getConOptionByKey(r),o={conversationType:i.conversationType,targetId:i.targetId,channelId:i.channelId},s=t[r];for(var a in s)if(rU[a]){var c=rU[a],u=c.keyName,d=c.defaultVal;o[u]=s[a]||GE(d)}o=e?e(o):o,n.push(o)}return n},e.prototype.getValueForTag=function(){var e=this._localStore.getValues()||{},t={};for(var n in e){var r=this._getConOptionByKey(n),i=r.conversationType,o=r.targetId,s={},a=e[n];for(var c in a){var u=rU[c],d=u.keyName,l=u.defaultVal;s[d]=a[c]||GE(l)}for(var h in s.tags){_l(t[h])&&(t[h]=[]);var f=cc(cc({},s),{conversationType:i,targetId:o});delete f.tags,t[h].push(f)}}return t},e.prototype.adaptOldStore=function(){try{var e=this.storage.getValues();if(0===Object.keys(e).length)return;for(var t in e){var n="_".concat(t);this._localStore.set(n,e[t])}this.storage.clear()}catch(e){this.logger.error(Fd.O,"adaptOldStore error: ".concat(e.message))}},e.prototype.remove=function(e,t,n){var r=this._getStoreKey(e,t,n);this._localStore.remove(r)},e}(),uU=[Od.PRIVATE,Od.GROUP,Od.SYSTEM,Od.PUBLIC_SERVICE,Od.APP_PUBLIC_SERVICE],dU={CHANGED:"conversationChanged",CON_TAG_STATUS_CHANGED:"conTagStatusChanged"},lU=1200,hU=function(){function e(e,t,n,r,i){var o=this;this._updatedConversations={},this._conTagStatusChanged=!1,this._eventEmitter=new sh,this._draftMap={},this._recallMsgTimeMap={},this._appkey=t,this._loginUserId=n,this._store=new cU(e.runtime,t,n,e.getInnerLogger()),this._statusManager=new nU(e,t,n),this._statusManager.watch((function(e){var t=e.statusItem,n=e.isLastPull;o.addStatus(t,n)})),this._eventEmitter.on(dU.CHANGED,(function(e){r(e)})),this._eventEmitter.on(dU.CON_TAG_STATUS_CHANGED,(function(){i()}));var s=this._store.getValue();s.length>lU&&(s=s.sort((function(e,t){var n=e.lastMessageSentTime,r=void 0===n?0:n,i=t.lastMessageSentTime;return(void 0===i?0:i)-r})),s.splice(lU,s.length).forEach((function(e){o._store.remove(e.conversationType,e.targetId,e.channelId)})))}return e.prototype._calcMsg=function(e,t,n,r){var i=!this._recallMsgTimeMap[e]||this._recallMsgTimeMap[e]&&!this._recallMsgTimeMap[e].find((function(e){return e===r.sentTime})),o=t>=r.sentTime;return n&&(o=n<r.sentTime),{isNotRead:o,isNotRepeadRecallSendTime:i}},e.prototype._calcUnreadCount=function(e,t){var n=e.content,r=e.messageType,i=e.sentTime,o=e.isCounted,s=e.messageDirection,a=e.senderUserId,c=s===yd.SEND&&a===this._loginUserId,u=r===Ud.RECALL,d=pl(n),l=!1,h={},f=t.lastUnreadTime,g=t.lastReadTime,p=t.unreadMessageCount;if(f>i||c)return{hasChanged:l,localConversation:t,updateItems:h};if(o&&(t.unreadMessageCount=p+1,t.lastUnreadTime=i,l=!0),u&&d){var v="".concat(e.conversationType,"_").concat(e.channelId,"_").concat(e.targetId),_=this._calcMsg(v,f,g,n),E=_.isNotRead,m=_.isNotRepeadRecallSendTime;E&&p&&m&&(this._recallMsgTimeMap[v]||(this._recallMsgTimeMap[v]=[]),this._recallMsgTimeMap[v].push(n.sentTime),t.unreadMessageCount=p-1,l=!0)}return l&&(h.unreadMessageCount={val:t.unreadMessageCount,time:i}),{hasChanged:l,localConversation:t,updateItems:h}},e.prototype._calcMentionedInfo=function(e,t){var n=e.content,r=e.messageDirection,i=e.isMentioned,o=e.sentTime,s=r===yd.SEND,a=pl(n),c=!1,u={};return!s&&i&&a&&n.mentionedInfo&&(t.hasMentioned=!0,c=!0,u.hasMentioned={val:!0,time:o},u.mentionedInfo={val:n.mentionedInfo,time:o}),{hasChanged:c,localConversation:t,updateItems:u}},e.prototype._calcMentionedCount=function(e,t){var n=e.content,r=e.messageDirection,i=!1;if(e.isMentioned&&r===yd.RECEIVE&&(null==n?void 0:n.mentionedInfo)){var o=n.mentionedInfo,s=o.type,a=o.userIdList;if(s===Bd.ALL||(a||[]).includes(this._loginUserId)){i=!0;var c=t.unreadMentionedCount||0;t.unreadMentionedCount=c+1}}return{hasChanged:i,localConversation:t}},e.prototype._setUpdatedConversation=function(e){if(pl(e)){var t=e.conversationType,n=e.targetId,r=e.channelId,i="".concat(t,"_").concat(n),o=this._store.get(t,n,r)||{};this._updatedConversations[i]=Object.assign(o,e)}},e.prototype._setConTagStatusChanged=function(e,t,n,r){var i=(this._store.get(e,t,r)||{}).tags||{};if(Object.keys(i).length===Object.keys(n).length){for(var o in i)if(!n[o]||!!i[o].isTop!=!!n[o].isTop)return void(this._conTagStatusChanged=!0)}else this._conTagStatusChanged=!0},e.prototype.addStatus=function(e,t){var n=e.conversationType,r=e.targetId,i=e.updatedTime,o=e.notificationStatus,s=e.notificationLevel,a=e.isTop,c=e.tags,u=e.channelId,d={},l={};if(n!==Od.ULTRA_GROUP){_l(o)||(l.notificationStatus={time:i,val:o}),_l(s)||(l.notificationLevel={time:i,val:s}),_l(a)||(l.isTop={time:i,val:a}),_l(c)||(l.tags={time:i,val:c}
1,null==c||c.forEach((function(e){d[e.tagId]={isTop:e.isTop}}))),this._setConTagStatusChanged(n,r,d,u);var h=this._store.get(n,r,u).lastMessageSentTime||(new Date).getTime();this._store.set(n,r,{notificationStatus:o,notificationLevel:s,isTop:a,tags:d,lastMessageSentTime:h},u),this._setUpdatedConversation({conversationType:n,targetId:r,updatedItems:l,channelId:u}),t&&this._notifyConversationChanged()}},e.prototype._notifyConversationChanged=function(){var e=[];for(var t in this._updatedConversations)e.push(this._updatedConversations[t]);0!==e.length&&(this._eventEmitter.emit(dU.CHANGED,e),this._updatedConversations={},this._conTagStatusChanged&&(this._eventEmitter.emit(dU.CON_TAG_STATUS_CHANGED),this._conTagStatusChanged=!1))},e.prototype.setConversationCacheByMessage=function(e,t){var n=this,r=e.conversationType,i=e.isPersited,o=e.targetId,s=e.channelId,a=e.sentTime;if(uU.indexOf(r)>=0){var c=!1,u=this._store.get(r,o,s),d={};if(u.lastMessageSentTime=a,[this._calcUnreadCount,this._calcMentionedInfo,this._calcMentionedCount].forEach((function(t){var r=t.call(n,e,u),i=r.hasChanged,o=r.localConversation,s=r.updateItems;c=c||i,d=cc(cc({},d),s),u=GE(o)})),this._store.set(r,o,u,s),this._store.updateMentionedData(e),i){var l=this._store.get(r,o,s);l.updatedItems=cc({latestMessage:{time:e.sentTime,val:e}},d),l.latestMessage=e;var h=Object.assign(l,{conversationType:r,targetId:o,channelId:s});this._setUpdatedConversation(h)}(c||i)&&this._notifyConversationChanged()}},e.prototype.get=function(e,t,n){return void 0===n&&(n=""),this._store.get(e,t,n)},e.prototype.getAllUnreadCount=function(e,t,n){var r=this._store.getValue(),i=0;return r.forEach((function(e){var r=e.unreadMessageCount,o=e.notificationStatus,s=e.notificationLevel,a=e.conversationType;r=r||0,(n||void 0!==s&&s<=0||void 0===s&&o!==wd.OPEN)&&(t.length>0?t.includes(Number(a))&&(i+=Number(r)):i+=Number(r))})),i},e.prototype.getTotalUnreadCountByLevels=function(e,t,n){var r=this._store.getValue(),i=0;return r.forEach((function(r){var o=r.unreadMessageCount,s=r.notificationLevel,a=void 0===s?0:s,c=r.conversationType,u=r.unreadMentionedCount;e.includes(c)&&(0===t.length||t.includes(a))&&(i+=(n?u:o)||0)})),i},e.prototype.getUnreadCountByTag=function(e,t){var n=this._store.getValueForTag()[e]||[],r=0;return n.forEach((function(e){var n=e.unreadMessageCount,i=e.notificationStatus,o=e.notificationLevel;(t||1!==i||-1===o||0===o)&&(n=n||0,r+=Number(n))})),r},e.prototype.getUnreadCount=function(e,t,n){return this._store.get(e,t,n).unreadMessageCount||0},e.prototype.clearUnreadCount=function(e,t,n,r){void 0===r&&(r=!0);var i=this._store.get(e,t,n);i.lastReadTime=i.lastUnreadTime,this._recallMsgTimeMap["".concat(e,"_").concat(n,"_").concat(t)]=[];var o=i.unreadMessageCount,s=i.hasMentioned,a={};if(o&&(i.unreadMessageCount=0,a.unreadMessageCount={val:0,time:Date.now()}),s&&(i.hasMentioned=!1,i.unreadMentionedCount=0,i.mentionedInfo=void 0,a.hasMentioned={val:!1,time:Date.now()},a.mentionedInfo={val:void 0,time:Date.now()}),this._store.set(e,t,i,n),r&&0!==Object.keys(a).length){var c=Object.assign(i,{conversationType:e,targetId:t,channelId:n,updatedItems:a});this._setUpdatedConversation(c),this._notifyConversationChanged()}},e.prototype.clearAllUnreadCount=function(){var e=this;this._store.getValue().forEach((function(t){t.unreadMessageCount&&(t.unreadMessageCount=0,t.lastReadTime=t.lastUnreadTime,e._recallMsgTimeMap={},e._store.set(t.conversationType,t.targetId,t,t.channelId))}))},e.prototype.startPullConversationStatus=function(e){this._statusManager.pull(e)},e.prototype.setDraft=function(e,t,n,r){var i="".concat(e,"_").concat(t,"_").concat(r);this._draftMap[i]=n},e.prototype.getDraft=function(e,t,n){var r="".concat(e,"_").concat(t,"_").concat(n);return this._draftMap[r]},e.prototype.clearDraft=function(e,t,n){var r="".concat(e,"_").concat(t,"_").concat(n);delete this._draftMap[r]},e.prototype.addTagStatus=function(e,t,n,r){void 0===r&&(r="");var i=this._store.get(e,t,r),o=i.tags;o=Object.assign(o,n);var s=i.lastMessageSentTime||(new Date).getTime();this._store.set(e,t,{tags:o,lastMessageSentTime:s},r)},e.prototype.deleteTagStatus=function(e,t,n,r){void 0===r&&(r="");var i=this._store.get(e,t,r).tags;
1n.forEach((function(e){delete i[e]})),this._store.set(e,t,{tags:i},r)},e.prototype.getConversationListForTag=function(){return this._store.getValueForTag()},e.prototype.getBlockConversationList=function(){return this._store.getValue().filter((function(e){return e.notificationStatus===wd.OPEN||e.notificationLevel&&e.notificationLevel>0})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,notificationLevel:e.notificationLevel||0,notificationStatus:e.notificationStatus||2}}))},e.prototype.getTopConversationList=function(e,t){return(this._store.getValue()||{}).filter((function(n){return e.includes(n.conversationType)&&(_l(t)||t===n.channelId)&&n.isTop})).map((function(e){return{channelId:e.channelId,conversationType:e.conversationType,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount||0,latestMessage:null,hasMentioned:e.hasMentioned||!1,mentionedInfo:e.mentionedInfo,notificationStatus:e.notificationStatus||0,notificationLevel:e.notificationLevel,isTop:e.isTop||!1,lastUnreadTime:e.lastUnreadTime||0,unreadMentionedCount:e.unreadMentionedCount||0}}))},e.prototype.adaptOldStore=function(){this._store.adaptOldStore()},e.prototype.getUnreadMentionedCount=function(e,t,n){return void 0===n&&(n=""),this.get(e,t,n).unreadMentionedCount||0},e.prototype.getAllUnreadMentionedCount=function(){var e=this._store.getValue(),t=0;return e.forEach((function(e){var n=e.unreadMentionedCount;n=n||0,t+=Number(n)})),t},e.prototype.getAllConversationState=function(){return this._store.getValue().filter((function(e){return e.unreadMessageCount||e.unreadMentionedCount})).map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,unreadCount:e.unreadMessageCount||0,unreadMentionedCount:e.unreadMentionedCount||0}}))},e.prototype.getUnreadConversationList=function(e){return(this._store.getValue()||{}).filter((function(t){return e.includes(t.conversationType)&&t.unreadMessageCount&&t.unreadMessageCount>0})).map((function(e){return{channelId:e.channelId,conversationType:e.conversationType,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount||0,latestMessage:null,hasMentioned:e.hasMentioned||!1,mentionedInfo:e.mentionedInfo,notificationStatus:e.notificationStatus||0,notificationLevel:e.notificationLevel,isTop:e.isTop||!1,lastUnreadTime:e.lastUnreadTime||0,unreadMentionedCount:e.unreadMentionedCount||0}}))},e.prototype.setConversationUpdatedTime=function(e){return this._statusManager.setConversationUpdatedTime(e)},e.prototype.getConversationUpdatedTime=function(){return this._statusManager.getConversationUpdatedTime()},e}(),fU=function(){function e(e,t,n,r){this._pullQueue=[],this._isPulling=!1,this._storageTagKey="tag-".concat(t,"-").concat(n),this._storagePullTimeKey="us-s-".concat(t,"-").concat(n),this._storage=rc(e.runtime),this._engine=e,this._tagWatcherFunc=r}return e.prototype._updateTag=function(e){var t=e.tags,n={};t.forEach((function(e){n[e.tagId]={tagName:e.tagName,createdTime:e.createdTime}})),this._storage.set(this._storageTagKey,n),this._tagWatcherFunc()},e.prototype.addTag=function(e,t){var n=this._storage.get(this._storageTagKey)||{};e.forEach((function(e){var t,r=(null===(t=n[e.tagId])||void 0===t?void 0:t.createdTime)||e.createdTime||0;n[e.tagId]={tagName:e.tagName,createdTime:r}})),this._storage.set(this._storageTagKey,n),this._storage.set(this._storagePullTimeKey,t)},e.prototype.deleteTag=function(e,t){var n=this._storage.get(this._storageTagKey)||{};e.forEach((function(e){delete n[e]})),this._storage.set(this._storageTagKey,n),this._storage.set(this._storagePullTimeKey,t)},e.prototype.getTagsInfo=function(){return this._storage.get(this._storageTagKey)||{}},e.prototype.getTags=function(){var e=this._storage.get(this._storageTagKey)||{},t=[];for(var n in e)t.push({tagId:n,tagName:e[n].tagName,createdTime:e[n].createdTime,conversationCount:0});return t.sort((function(e,t){return(e.createdTime||0)-(t.createdTime||0)}))},e.prototype.getTagById=function(e){var t=this._storage.get(this._storageTagKey)||{};
1return t[e]?{tagId:e,tagName:t[e].tagName,createdTime:t[e].createdTime,conversationCount:0}:null},e.prototype._startPull=function(){return uc(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return this._isPulling||0===this._pullQueue.length?[2]:(this._isPulling=!0,e=this._pullQueue.splice(0,1)[0],[4,this._engine.pullUserSettings(e)]);case 1:return t=c.sent(),n=t.code,r=t.data,n!==Cd.SUCCESS||_l(r)?(this._isPulling=!1,this._startPull()):(o=(i=r).settings,s=i.version,a=o.Tag,_l(a)||this._updateTag(a),this._storage.set(this._storagePullTimeKey,s),this._isPulling=!1,this._startPull()),[2]}}))}))},e.prototype.pullUserSettings=function(e){var t=this._storage.get(this._storagePullTimeKey)||0;(e>t||0===e)&&(this._pullQueue.push(t),this._startPull())},e.prototype.getVersion=function(){return this._storage.get(this._storagePullTimeKey)||0},e}(),gU=function(e){return e.replace(/@.+$/,"@")},pU=function(){function e(e,t,n){this.appkey=e,this.logger=t,this.navigators=n,this.crtRequest=null}return e.prototype.request=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s;return dc(this,(function(a){switch(a.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,n,r),[4,this.crtRequest]);case 1:return i=a.sent(),o=i.code,s=i.data,this.crtRequest=null,[2,{code:o,data:s}]}}))}))},e.prototype.sendRequest=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s,a,c,u,d,l,h,f,g,p,v,_;return dc(this,(function(E){switch(E.label){case 0:return i=gU(e),!t&&(o=this.getNaviCache(i))&&(s=o.timestamp,a=o.naviInfo,n||Date.now()-s<qa)?(this.logger.info(Fd.L_REQUEST_T,JSON.stringify({fromCache:!0,naviInfo:a}),r),[2,{code:Cd.SUCCESS,data:a}]):(c=e.split("@"),u=c[1],d=u?u.split(";").map((function(e){return/^https?:/.test(e)?e:"https://".concat(e)})):[],l=this.navigators&&this.navigators.length>0?this.navigators.filter((function(e){return/^https?:\/\//.test(e)})):[],h=ja,this.logger.info(Fd.L_GET_NAVI_T,JSON.stringify({token:e,customUris:l,defaultUris:h,dynamicUris:d}),r),f=lc(lc(lc([],l,!0),d,!0),h,!0),[4,this.requestHandler(f,e,r)]);case 1:return g=E.sent(),p=g.code,v=g.data,p!==Cd.SUCCESS?(this.logger.warn(Fd.L_GET_NAVI_R,p,r),[2,{code:p}]):(_=v,this.logger.info(Fd.L_GET_NAVI_R,JSON.stringify({naviInfo:_}),r),this.setNaviCache(i,_),[2,{code:p,data:_}])}}))}))},e.prototype.requestHandler=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:r=0,i=e.length,u.label=1;case 1:return r<i?(o=r===e.length-1,[4,this.httpRequest(e[r],this.appkey,t,nc,1e4,n,o)]):[3,4];case 2:if(s=u.sent(),a=s.code,c=s.data,a===Cd.SUCCESS)return[2,{code:a,data:c}];u.label=3;case 3:return r+=1,[3,1];case 4:return[2,{code:Cd.RC_NAVI_REQ_FAILED}]}}))}))},e.prototype.transHttpCode=function(e){switch(e){case 401:case 403:return Cd.RC_CONN_TOKEN_INCORRECT;case 416:return Cd.RC_LICENSE_EXPIRED;default:return Cd.RC_NAVI_REQ_FAILED}},e.prototype.getNaviInfoFromCache=function(e){var t=this.getNaviCache(gU(e));return t?t.naviInfo:null},e.prototype.updateVoipCallInfo=function(e,t){var n=this.getNaviInfoFromCache(e);n&&this.setNaviCache(gU(e),cc(cc({},n),{voipCallInfo:t}))},e}(),vU=function(e){return["navi",e].join("_")},_U={},EU=function(e){function t(t,n,r,i,o){var s=e.call(this,t,n,o||[])||this;return s.runtime=r,s.miniCmpUris=i,s.miniCmpUris||(s.miniCmpUris=Ya.join(",")),s}return ac(t,e),t.prototype.httpRequest=function(e,t,n,r,i,o,s){return uc(this,void 0,void 0,(function(){var a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return a="".concat(e,"/navi.js?appId=").concat(t,"&token=").concat(encodeURIComponent(n),"&callBack=x&v=").concat(r,"&r=").concat(Date.now()),this.logger.debug(Fd.L_REQUEST_T,"req navi => ".concat(a),o),[4,this.runtime.httpReq({url:a,timeout:i,dataType:"text"})];case 1:if(200!==(c=l.sent()).status)return this.logger.debug(Fd.L_REQUEST_R,"request navi failed: ".concat(c.status),o),!this.runtime.useNavi&&s?(d={code:200,protocol:"https",server:"",voipCallInfo:"",kvStorage:0,openHttpDNS:!1,historyMsg:!1,chatroomMsg:!1,uploadServer:"https:// + ".concat(Ja),bosAddr:"https:// + ".concat(Qa
1),location:"",monitor:0,joinMChrm:!1,openMp:0,openUS:0,grpMsgLimit:0,isFormatted:0,gifSize:2048,logSwitch:0,logPolicy:"",compDays:0,msgAck:"",activeServer:"",qnAddr:"",extkitSwitch:0,alone:!1,voipServer:"",offlinelogserver:"",backupServer:this.miniCmpUris},[2,{code:Cd.SUCCESS,data:d}]):[2,{code:this.transHttpCode(c.status)}];try{return 0===(u=c.data.match(/{[\d\D]+}/)[0]).indexOf('{\\"code\\":')&&(u=JSON.parse('"'.concat(u,'"'))),(d=JSON.parse(u)).protocol=/^https/.test(a)?"https":"http",this.runtime.useNavi||(d.server="",d.backupServer=this.miniCmpUris,d.logSwitch=0),[2,{code:Cd.SUCCESS,data:d}]}catch(e){this.logger.error(Fd.L_PARSE_NAVI_E,c.data,o)}return[2,{code:Cd.RC_NAVI_REQ_FAILED}]}}))}))},t.prototype.getNaviCache=function(e){if(_U[e])return _U[e];var t,n=vU(this.appkey),r=this.runtime.localStorage;try{var i=r.getItem(n);t=i?JSON.parse(i):[]}catch(e){t=[]}if(0===t.length)return null;var o=t.find((function(t){return t.token===e}))||null;return _U[e]=o,o},t.prototype.setNaviCache=function(e,t){var n,r=vU(this.appkey),i=this.runtime.localStorage;try{var o=i.getItem(r);n=o?JSON.parse(o):[]}catch(e){n=[]}var s=Date.now();n.length>0&&(n=n.filter((function(t){return s-t.timestamp<qa&&e!==t.token})));var a={timestamp:s,naviInfo:t,token:e};n.push(a),i.setItem(r,JSON.stringify(n)),_U[e]=a},t}(pU),mU=function(e,t){return["send_msg",e,t].join("_")},IU=function(){function e(e,t){this._runtime=e,this._appkey=t,this._sendMessageMap={},this._userId=""}return e.prototype.init=function(e){this._userId=e;var t=mU(this._appkey,e);this._sendMessageMap=this._getLocalInfo(t)},e.prototype._getLocalInfo=function(e){var t=this._runtime.localStorage.getItem(e);try{return t?JSON.parse(t):{}}catch(e){return{}}},e.prototype.setMessage=function(e,t){this._sendMessageMap[e]=t;var n=mU(this._appkey,this._userId),r=this._getLocalInfo(n);r[e]=t,this._runtime.localStorage.setItem(n,JSON.stringify(r))},e.prototype.getSendMessageMap=function(){return this._sendMessageMap},e.prototype.removeByUID=function(e){delete this._sendMessageMap[e]},e.prototype.removeByTimestamp=function(e){var t=mU(this._appkey,this._userId),n=this._getLocalInfo(t);Object.keys(n).forEach((function(t){n[t]<e&&delete n[t]})),this._runtime.localStorage.setItem(t,JSON.stringify(n))},e}(),TU=function(e){var t="RCDeviceId",n=rc(e),r="",i=n.get(t);return i?r=i:(r=Xh(),n.set(t,r)),r};(aU={})[Od.PRIVATE]=jM.qryPMsg,aU[Od.GROUP]=jM.qryGMsg,aU[Od.CHATROOM]=jM.qryCHMsg,aU[Od.CUSTOMER_SERVICE]=jM.qryCMsg,aU[Od.SYSTEM]=jM.qrySMsg;var yU=[jM[jM.recallMsg],jM[jM.ppMsgS],jM[jM.pgMsgS],jM[jM.ppMsgP],jM[jM.pgMsgP],jM[jM.chatMsg],jM[jM.pcMsgP],jM[jM.prMsgS],jM[jM.updUgRTime]],RU=function(){function e(e,t,n){this.ULTRA_GROUP_CONVERSATION="ultragroupconversation";var r="".concat(this.ULTRA_GROUP_CONVERSATION,"-").concat(t,"-").concat(n);this._localStore=new oc(e,r)}return e.prototype.set=function(e,t,n,r){var i=this._getStoreKey(e,t,r),o=this._localStore.get(i)||{};for(var s in n){var a=SU[s],c=n[s];if(!_l(a)&&!_l(c))c===CU[a].defaultVal?delete o[a]:o[a]=c}ml(o)?this._localStore.set(i,o):this._localStore.remove(i)},e.prototype.get=function(e,t,n){void 0===n&&(n="");var r=this._getStoreKey(e,t,n),i=this._localStore.get(r)||{},o={};for(var s in CU){var a=CU[s],c=a.keyName,u=a.defaultVal;o[c]=i[s]||GE(u)}return o},e.prototype._getStoreKey=function(e,t,n){return"".concat(n,"_").concat(e,"_").concat(t)},e}(),CU={nc:{keyName:"notificationStatus",defaultVal:2},nl:{keyName:"notificationLevel",defaultVal:0}},SU={};for(var OU in CU){var NU=CU[OU].keyName;SU[NU]=OU}var AU,MU=function(){function e(e,t,n){this._store=new RU(e.runtime,t,n)}return e.prototype.addUltraGroupStatus=function(e){var t=e.conversationType,n=e.targetId,r=e.notificationStatus,i=e.notificationLevel,o=e.channelId;t===Od.ULTRA_GROUP&&this._store.set(t,n,{notificationStatus:r,notificationLevel:i},o)},e.prototype.get=function(e,t,n){return void 0===n&&(n=""),this._store.get(e,t,n)},e}(),UU="UpStreamMessage",LU="PushExtra",wU="DownStreamMessage",bU="DownStreamMessages",PU="SessionsAttQryInput",DU="SessionsAttOutput",BU="SyncRequestMsg",VU="ChrmPullMsg",GU="NotifyMsg",xU="HistoryMsgInput",kU="HistoryMsgOuput",FU="RelationQryInput",HU="RelationsOutput",qU="UnreadMsgInfo",KU="DeleteSessionsInput",jU="SessionInfo",YU="DeleteSessionsOutput",JU="RelationsInput",QU="DeleteMsgInput",WU="CleanHisMsgInput",zU="SessionMsgReadInput",ZU="ChrmInput",XU="ChrmOutput",$U="QueryChatRoomInfoInput",eL="QueryChatRoomInfoOutput",tL="GetQNupTokenInput",nL="GetQNupTokenOutput",rL="GetQNdownloadUrlInput",iL="GetDownloadUrlInput",oL="GetQNdownloadUrlOutput",sL="GetDownloadUrlOutput",aL="ChrmKVEntity",cL="SetChrmKV",uL="SetChrmKVS",dL="DeleteChrmKVS",lL="ChrmKVOutput",hL="ChrmKVSOutput",fL="ChrmKVSVersionEntity",gL="ChrmKVSOutputEntity",pL="QueryChrmKV",vL="SetUserSettingInput",_L="SetUserSettingOutput",EL="PullUserSettingInput",mL="PullUserSettingOutput",IL="UserSettingNotification",TL="SessionReq",yL="SessionStates",RL="SessionState",CL="SessionStateItem",SL="SessionStateModifyReq",OL="SessionStateModifyResp",NL="GroupUnpushQuery",AL="GroupUnpushSet",ML="QryRemindListReq",UL="QryRemindListResp",LL="GroupUnpushResult",wL="GrpReadReceiptMsg",bL="GrpReadReceiptQryReq",PL="GrpReadReceiptQryResp",DL="GrpMsgReadUser",BL="SessionTagAddInput",VL="SessionTagItem",GL="SessionTagDelInput",xL="SessionDisTagReq",kL="ReportSDKInput",FL="ReportSDKOutput",HL="UltraGrpPullSes",qL="UltraGrpPullMsg",KL="MsgChangeReq",jL="QueryMsgChange",YL="MsgChange",JL="MsgChangeList",QL="MsgQuery",WL="MessageQueryInfo",zL="MsgQueryAck",ZL="OperateStatus",XL="OperateStatusNotify",$L="OperateInfo",ew="OperateSummary",tw="SetRtcRoomIdInput",nw="SetRtcRoomIdOutput";(AU={})[UU]=["sessionId","classname","content","pushText","userId","configFlag","clientUniqueId","appData","extraContent","pushExt","busChannel"],AU[b
1U]=["list","syncTime","finished","broadcastSyncTime"],AU[wU]=["fromUserId","type","groupId","classname","content","dataTime","status","msgId","extraContent","pushContent","configFlag","pushExt","busChannel","extStatus","toUserId","groupUnpush"],AU[LU]=["title","templateIdNoUse","pushId","pushConfigs","templateId"],AU[PU]=["nothing"],AU[DU]=["inboxTime","sendboxTime","totalUnreadCount"],AU[BU]=["syncTime","ispolling","isweb","isPullSend","isKeeping","sendBoxSyncTime","broadcastSyncTime"],AU[VU]=["syncTime","count"],AU[GU]=["type","time","chrmId"],AU[xU]=["targetId","time","count","order","busChannel"],AU[kU]=["list","syncTime","hasMsg"],AU[FU]=["type","count","startTime","order"],AU[HU]=["info","isFinished"],AU[qU]=["msgId","msgTime","remindType"],AU[KU]=["sessions"],AU[jU]=["type","channelId","busChannel"],AU[YU]=["nothing"],AU[JU]=["type","msg","count","busChannel","startTime","endTime"],AU[QU]=["type","conversationId","msgs","busChannel"],AU[WU]=["targetId","dataTime","conversationType","busChannel"],AU[zU]=["type","msgTime","channelId","busChannel"],AU[ZU]=["nothing"],AU[XU]=["nothing","sessionId","joinTime"],AU[$U]=["count","order"],AU[eL]=["userTotalNums","userInfos"],AU[tL]=["type","key","httpMethod","queryString"],AU[rL]=["type","key","fileName"],AU[iL]=["type","key","fileName"],AU[nL]=["deadline","token","bosToken","bosDate","path","osskeyId","ossPolicy","ossSign","ossBucketName"],AU[oL]=["downloadUrl"],AU[sL]=["downloadUrl"],AU[aL]=["key","value","status","timestamp","uid","version"],AU[cL]=["entry","bNotify","notification","type"],AU[uL]=["entry","bNotify","notification","type"],AU[dL]=["entry","bNotify","notification","type"],AU[lL]=["entries","bFullUpdate","syncTime"],AU[hL]=["timestamp","errorKeys","keysVersion"],AU[fL]=["version","key"],AU[gL]=["key","errorCode"],AU[pL]=["timestamp"],AU[vL]=["version","value"],AU[_L]=["version","reserve"],AU[EL]=["version","reserve"],AU[mL]=["items","version"],AU.UserSettingItem=["targetId","type","key","value","version","status","tags"],AU[TL]=["time"],AU[yL]=["version","state"],AU[RL]=["type","channelId","time","stateItem","busChannel"],AU[CL]=["sessionStateType","value","tags"],AU[SL]=["version","state"],AU[OL]=["version"],AU[AL]=["busChannel","unpushLevel"],AU[ML]=["groupId","busChannel","msgTime","size"],AU[NL]=["busChannel"],AU[LL]=["groupId","busChannel","unpushLevel"],AU[wL]=["msgId","busChannel"],AU[bL]=["msgId","busChannel"],AU[PL]=["totalMemberNum","list"],AU[DL]=["readTime","userId"],AU[BL]=["version","tags"],AU[VL]=["tagId","name","createdTime","isTop"],AU[GL]=["version","tags"],AU[xL]=["tagId"],AU[IL]=["version","reserve"],AU[kL]=["sdkInfo"],AU[FL]=["nothing"],AU[HL]=["syncTime","isEraseMsgContent"],AU[qL]=["syncTime"],AU[KL]=["fromUserId","targetId","type","busChannel","msgUID","msgTime","content"],AU[jL]=["syncTime"],AU[JL]=["list","syncTime","hasNext"],AU[YL]=["targetId","type","time","changeType","msgUID","msgTime","busChannel","isAdmin","isDel","operatorId","subChangeType","busChannelType","isRemindMe","userGroupIds"],AU[QL]=["targetId","type","query"],AU[WL]=["msgTime","msgUID","busChannel"],AU[zL]=["list"],AU[ZL]=["targetId","type","opType","busChannel"],AU[XL]=["type","notifyType","info","summary"],AU[$L]=["targetId","busChannel","userId","opType","optime"],AU[ew]=["targetId","busChannel","count","opType"],AU[tw]=["rtcRoomId"],AU[nw]=["nothing"];var rw,iw="\npackage Modules;\nmessage probuf {\n message SetUserStatusOutput\n {\n optional int32 nothing=1;\n }\n\n message GetUserStatusInput\n {\n optional int32 nothing=1;\n }\n\n message GetUserStatusOutput\n {\n optional string status=1;\n optional string subUserId=2;\n }\n\n message SubUserStatusInput\n {\n repeated string userid =1;\n }\n\n message SubUserStatusOutput\n {\n optional int32 nothing=1;\n }\n message VoipDynamicInput\n {\n required int32 engineType = 1;\n required string channelName = 2;\n optional string channelExtra = 3;\n }\n\n message VoipDynamicOutput\n {\n required string dynamicKey=1;\n }\n message ".concat(GU," {\n required int32 type = 1;\n optional int64 time = 2;\n optional string chrmId=3;\n }\n message ").concat(BU," {\n required int64 syncTime = 1;\n required bool ispolling = 2;\n optional bool isweb=3;\n optional bool isPullSend=4;\n optional bool isKeeping=5;\n optional int64 sendBoxSyncTime=6;\n optional int64 broadcastSyncTime=7;\n }\n message ").concat(UU," {\n required int32 sessionId = 1;\n required string classname = 2;\n required bytes content = 3;\n optional string pushText = 4;\n optional string appData = 5;\n repeated string userId = 6;\n optional int64 delMsgTime = 7;\n optional string delMsgId = 8;\n optional int32 configFlag = 9;\n optional int64 clientUniqueId = 10;\n optional string extraContent = 11;\n optional PushExtra pushExt = 12;\n optional string busChannel = 13; // è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯\n }\n message ").concat(LU," {\n optional string title = 1;\n optional int32 templateIdNoUse= 2;\n optional string pushId = 3;\n optional string pushConfigs = 4;\n optional string templateId = 5;\n }\n message ").concat(bU," {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n optional bool finished = 3;\n optional int64 broadcastSyncTime = 4;\n }\n message ").concat(wU," {\n required string fromUserId = 1;\n required ChannelType type = 2;\n optional string groupId = 3;\n required string classname = 4;\n required bytes content = 5;\n required int64 dataTime = 6;\n required int64 status = 7;\n optional int64 extra = 8;\n optional string msgId = 9;\n optional int32 direction = 10;\n optional int32 plantform =11;\n optional int32 isRemoved = 12;\n optional string source = 13;\n optional int64 clientUniqueId = 14;\n optional string extraContent = 15;\n optional string pushContent = 16;\n optional int32 configFlag = 17;\n optional PushExtra pushExt = 18;\n optional string busChannel = 19; // è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯ï¼éå¶20å符以å
\n // æ¶æ¯çæ©å±æ è®°\n // 第0ä½,表示éè¾¾ç¶æ: 0x01 表示已éè¾¾;\n // ææ¡£: 0x02 表示æ¯å¦éè¦æ§è¡ææ¡£çç¥;\n // æ¶æ¯ä¿®æ¹: 0x04 æåå岿¶æ¯æ¶è¡¨ç¤ºè¯¥æ¶æ¯æ¯å¦ä¿®æ¹è¿\n // 0x08 æ¯æ¡æ¶æ¯æºå¸¦çé¢éç±»å\n optional int64 extStatus = 20;\n repeated string toUserId = 21; //æå®æ¥æ¶è
ï¼éå®ç¾¤å讨论ç»ï¼//å¢å è天室å®åæå\n optional int32 groupUnpush = 22; //群èé»è®¤å
ææ°çº§å«\n }\n enum ChannelType {\n PERSON = 1;\n PERSONS = 2;\n GROUP = 3;\n TEMPGROUP = 4;\n CUSTOMERSERVICE = 5;\n NOTIFY = 6;\n MC=7;\n MP=8;\n ULTRAGROUP = 10;\n }\n message CreateDiscussionInput {\n optional string name = 1;\n }\n message CreateDiscussionOutput {\n required string id = 1;\n }\n message ChannelInvitationInput {\n repeated string users = 1;\n }\n message LeaveChannelInput {\n required int32 nothing = 1;\n }\n message ChannelEvictionInput {\n required string user = 1;\n }\n message RenameChannelInput {\n required string name = 1;\n }\n message ChannelInfoInput {\n required int32 nothing = 1;\n }\n message ChannelInfoOutput {\n required ChannelType type = 1;\n required string channelId = 2;\n required string channelName = 3;\n required string adminUserId = 4;\n repeated string firstTenUserIds = 5;\n required int32 openStatus = 6;\n }\n message ChannelInfosInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message ChannelInfosOutput {\n repeated ChannelInfoOutput channels = 1;\n required int32 total = 2;\n }\n message MemberInfo {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n required string extension = 4;\n }\n message GroupMembersInput {\n required int32 page = 1;\n optional int32 number = 2;\n }\n message GroupMembersOutput {\n repeated MemberInfo members = 1;\n required int32 total = 2;\n }\n message GetUserInfoInput {\n required int32 nothing = 1;\n }\n message GetUserInfoOutput {\n required string userId = 1;\n required string userName = 2;\n required string userPortrait = 3;\n }\n message GetSessionIdInput {\n required int32 nothing = 1;\n }\n message GetSessionIdOutput {\n required int32 sessionId = 1;\n }\n enum FileType {\n image = ").concat(Id.IMAGE,";\n audio = ").concat(Id.AUDIO,";\n video = ").concat(Id.VIDEO,";\n file = ").concat(Id.FILE,";\n }\n message ").concat(tL," {\n required FileType type = 1;\n optional string key = 2;\n optional string httpMethod = 3;\n optional string queryString = 4;\n }\n message ").concat(rL," {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message ").concat(iL," {\n required FileType type = 1;\n required string key = 2;\n optional string fileName = 3;\n }\n message ").concat(nL," {\n required int64 deadline = 1;\n required string token = 2;\n optional string bosToken = 3;\n optional string bosDate = 4;\n optional string path = 5;\n optional string osskeyId = 6;\n optional string ossPolicy = 7;\n optional string ossSign = 8;\n optional string ossBucketName = 9;\n optional string s3Credential = 10;\n optional string s3Algorithm = 11;\n optional string s3Date = 12;\n optional string s3Policy = 13;\n optional string s3Signature = 14;\n optional string s3BucketName = 15;\n optional string stcAuthorization = 16;\n optional string stcContentSha256 = 17;\n optional string stcDate = 18;\n optional string stcBucketName = 19;\n\n // å
¼å®¹ minio åè®®\n optional string minioAuthorization = 20;\n optional string minioContentSha256 = 21;\n optional string minioDate = 22;\n optional string minioBucketName = 23;\n }\n message ").concat(oL," {\n required string downloadUrl = 1;\n }\n message ").concat(sL," {\n required string downloadUrl = 1;\n }\n message Add2BlackListInput {\n required string userId = 1;\n }\n message RemoveFromBlackListInput {\n required string userId = 1;\n }\n message QueryBlackListInput {\n required int32 nothing = 1;\n }\n message QueryBlackListOutput {\n repeated string userIds = 1;\n }\n message BlackListStatusInput {\n required string userId = 1;\n }\n message BlockPushInput {\n required string blockeeId = 1;\n }\n message ModifyPermissionInput {\n required int32 openStatus = 1;\n }\n message GroupInput {\n repeated GroupInfo groupInfo = 1;\n }\n message GroupOutput {\n required int32 nothing = 1;\n }\n message GroupInfo {\n required string id = 1;\n required string name = 2;\n }\n message GroupHashInput {\n required string userId = 1;\n required string groupHashCode = 2;\n }
1\n message GroupHashOutput {\n required GroupHashType result = 1;\n }\n enum GroupHashType {\n group_success = 0x00;\n group_failure = 0x01;\n }\n message ").concat(ZU," {\n required int32 nothing = 1;\n }\n message ").concat(XU," {\n required int32 nothing = 1;\n optional string sessionId = 2;\n optional int64 joinTime = 3;\n }\n message ").concat(VU," {\n required int64 syncTime = 1;\n required int32 count = 2;\n }\n\n message ChrmPullMsgNew\n {\n required int32 count = 1;\n required int64 syncTime = 2;\n optional string chrmId=3;\n }\n message ").concat(FU,"\n {\n optional ChannelType type = 1;\n optional int32 count = 2;\n optional int64 startTime = 3;\n optional int32 order = 4;\n }\n message ").concat(JU,"\n {\n required ChannelType type = 1;\n optional DownStreamMessage msg =2;\n optional int32 count = 3;\n repeated string busChannel = 4;\n optional int64 startTime = 5;\n optional int64 endTime = 6;\n }\n message ").concat(HU,"\n {\n repeated RelationInfo info = 1;\n optional bool isFinished = 2;//æ¯å¦ç»æ\n }\n message RelationInfo\n {\n required ChannelType type = 1;\n required string userId = 2;\n optional DownStreamMessage msg =3;\n optional int64 readMsgTime= 4;\n optional int64 unreadCount= 5;\n optional string busChannel = 6;//è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯\n optional int64 versionTime = 7;//ä¼è¯é¡¹åæ´æ¶é´æ³ï¼æ³¨æ:éæåºæ¶é´æ³\n optional int64 remindCount = 8;//被@çæªè¯»æ°\n optional int32 busChannelType = 9; // 0: å
¬æé¢é; 1: ç§æé¢é;\n optional ").concat(qU," msgInfo = 10;// æ°å¢ 馿¡æªè¯»æ¶æ¯ä¿¡æ¯ï¼å¯ä¸ºç©º\n }\n message ").concat(qU," //æªè¯»æ¶æ¯æè¦ä¿¡æ¯\n {\n required string msgId = 1; //æ¶æ¯å¯ä¸æ 示\n required int64 msgTime= 2;//æ¶æ¯æ¶é´\n optional int32 remindType= 3;//@ç±»åãæ¥è¯¢ä¼è¯æ¶æ æ¤åæ®µãæ¥è¯¢æªè¯»@å表æ¶è¿å\n }\n message ").concat(ML," // æ°å¢ æ¥è¯¢æªè¯»@å表å
¥å\n {\n required string groupId = 1; // 群 ID\n optional string busChannel = 2; // é¢é(channelId,å¯ä»¥ä¸ºç©º)\n optional int64 msgTime = 3; // æ¶æ¯æ¶é´æ³\n optional int32 size = 4; // å页é¿åº¦ï¼é»è®¤20ï¼æå¤§20\n }\n message ").concat(UL," //æ¥è¯¢æªè¯»@å表åºå\n {\n repeated ").concat(qU," msgInfo = 1; //æªè¯»@æ¶æ¯æè¦å表\n }\n message RelationInfoReadTime\n {\n required ChannelType type = 1;\n required int64 readMsgTime= 2;\n required string targetId = 3;\n }\n message ").concat(WU,"\n {\n required string targetId = 1;\n required int64 dataTime = 2;\n optional int32 conversationType= 3;\n optional string busChannel = 4; //è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯ï¼éå¶20å符以å
\n }\n message HistoryMessageInput\n {\n required string targetId = 1;\n required int64 dataTime =2;\n required int32 size = 3;\n }\n\n message HistoryMessagesOuput\n {\n repeated DownStreamMessage list = 1;\n required int64 syncTime = 2;\n required int32 hasMsg = 3;\n }\n message ").concat($U,"\n {\n required int32 count= 1;\n optional int32 order= 2;\n }\n\n message ").concat(eL,"\n {\n optional int32 userTotalNums = 1;\n repeated ChrmMember userInfos = 2;\n }\n message ChrmMember\n {\n required int64 time = 1;\n required string id = 2;\n }\n message MPFollowInput\n {\n required string id = 1;\n }\n\n message MPFollowOutput\n {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MCFollowOutput\n {\n required int32 nothing = 1;\n optional MpInfo info =2;\n }\n\n message MpInfo\n {\n required string mpid=1;\n required string name = 2;\n required string type = 3;\n required int64 time=4;\n optional string portraitUrl=5;\n optional string extra =6;\n }\n\n message SearchMpInput\n {\n required int32 type=1;\n required string id=2;\n }\n\n message SearchMpOutput\n {\n required int32 nothing=1;\n repeated MpInfo info = 2;\n }\n\n message PullMpInput\n {\n required int64 time=1;\n required string mpid=2;\n }\n\n message PullMpOutput\n {\n required int32 status=1;\n repeated MpInfo info = 2;\n }\n message ").concat(xU,"\n {\n optional string targetId = 1;\n optional int64 time = 2;\n optional int32 count = 3;\n optional int32 order = 4;\n optional string busChannel = 5; //è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯ï¼éå¶20å符以å
\n }\n\n message ").concat(kU,"\n {\n repeated DownStreamMessage list=1;\n required int64 syncTime=2;\n required int32 hasMsg=3;\n }\n message ").concat(PU,"{\n required int32 nothing = 1;\n }\n message ").concat(DU,"{\n required int64 inboxTime = 1;\n required int64 sendboxTime = 2;\n required int64 totalUnreadCount = 3;\n }\n message ").concat(zU,"\n {\n required ChannelType type = 1;\n required int64 msgTime = 2;\n required string channelId = 3;
1\n optional string busChannel = 4;//è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯\n }\n message SessionMsgReadOutput\n {\n optional int32 nothing=1;\n }\n message ").concat(KU,"\n {\n repeated SessionInfo sessions = 1;\n }\n message ").concat(jU,"\n {\n required ChannelType type = 1;\n required string channelId = 2;\n optional string busChannel = 3;//æå±ä¼è¯ä¸å¡æ è¯\n }\n message ").concat(YU,"\n {\n optional int32 nothing=1;\n }\n message ").concat(QU,"\n {\n optional ChannelType type = 1;\n optional string conversationId = 2;\n repeated DeleteMsg msgs = 3;\n optional string busChannel = 4; //è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯ï¼éå¶20å符以å
\n }\n message DeleteMsg\n {\n optional string msgId = 1;\n optional int64 msgDataTime = 2;\n optional int32 direct = 3;\n }\n message ChrmKVEntity {\n required string key = 1;\n required string value = 2;\n optional int32 status = 3;\n optional int64 timestamp = 4;\n optional string uid = 5;\n optional int64 version = 6;\n }\n message ").concat(cL," {\n required ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ").concat(uL," {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ").concat(dL," {\n repeated ChrmKVEntity entry = 1;\n optional bool bNotify = 2;\n optional UpStreamMessage notification = 3;\n optional ChannelType type = 4;\n }\n message ").concat(lL," {\n repeated ChrmKVEntity entries = 1;\n optional bool bFullUpdate = 2;\n optional int64 syncTime = 3;\n }\n message ChrmKVSVersionEntity {\n optional int64 version = 1;\n optional string key = 2;\n }\n\n message ").concat(hL," {\n repeated ChrmKVSOutputEntity errorKeys = 1;\n repeated ChrmKVSVersionEntity keysVersion = 2;\n }\n message ").concat(gL,"\n {\n optional string key = 1;\n optional int32 errorCode = 2;\n }\n message ").concat(pL," {\n required int64 timestamp = 1;\n }\n message ").concat(vL," {\n required int64 version=1;\n required string value=2;\n }\n message ").concat(_L," {\n required int64 version=1;\n required bool reserve=2;\n }\n message ").concat(EL," {\n required int64 version=1;\n optional bool reserve=2;\n }\n message ").concat(mL," {\n repeated UserSettingItem items = 1;\n required int64 version=2;\n }\n message UserSettingItem {\n required string targetId= 1;\n required ChannelType type = 2;\n required string key = 4;\n required bytes value = 5;\n required int64 version=6;\n required int32 status=7;\n repeated SessionTagItem tags= 8;\n }\n message ").concat(TL," {\n required int64 time = 1;\n }\n message ").concat(yL," {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message ").concat(RL," {\n required ChannelType type = 1;\n required string channelId = 2;\n optional int64 time = 3;\n repeated SessionStateItem stateItem = 4;\n optional string busChannel = 5;//è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯\n }\n message ").concat(CL," {\n required SessionStateType sessionStateType = 1;\n required string value = 2;\n repeated SessionTagItem tags = 3;\n }\n enum SessionStateType {\n IsSilent = 1;\n IsTop = 2;\n Tags = 3;\n }\n message ").concat(SL," {\n required int64 version=1;\n repeated SessionState state= 2;\n }\n message ").concat(NL," {\n optional string busChannel = 1;\n }\n message ").concat(AL,"{\n optional string busChannel = 1;\n required int32 unpushLevel = 2;\n }\n message ").concat(LL," {\n required string groupId = 1;\n optional string busChannel = 2;\n required int32 unpushLevel = 3;\n }\n message ").concat(OL," {\n required int64 version=1;\n }\n message ").concat(wL," {\n repeated string msgId=1; //å·²è¯»æ¶æ¯ID\n optional string channelId = 2; // è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯\n }\n message ").concat(bL," {\n repeated string msgId=1; //å·²è¯»æ¶æ¯ID\n optional string channelId = 2; // è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯\n }\n message ").concat(PL," {\n required int32 totalMemberNum = 1;//群å
æ»äººæ°\n repeated GrpMsgReadUser list = 2;//å·²è¯»ç¨æ·å表ï¼listå¤ç±»åï¼\n }\n message ").concat(DL," {\n required int64 readTime = 1;//已读æ¶é´\n required string userId = 2;//å·²è¯»ç¨æ·id\n }\n message ").concat(BL," {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message ").concat(VL," {\n required string tagId=1;\n optional string name=2;\n optional int64 createdTime=3;\n optional bool isTop=4;\n }\n message ").concat(GL," {\n required int64 version=1;\n repeated SessionTagItem tags=2;\n }\n message ").concat(xL," {\n repeated string tagId=1;\n }\n message ").concat(IL," {\n required int64 version=1;\n required bool reserve=2;\n }\n message ").concat(kL,' {\n required string sdkInfo=1; // ç¨æ·éæç sdk ä¿¡æ¯,json æ ¼å¼ {"web-rtc": "4.0.3.7"}\n }\n message ').concat(FL,"\n {\n optional int32 nothing=1; //å ä½\n }\n message ").concat(HL,"\n {\n required int64 syncTime = 1;//忥æ¶é´æ³\n optional bool isEraseMsgContent = 2;//æåä¼è¯æ¶ï¼æ¯å¦å±è½ææ¶æ¯å
容\n }\n message ").concat(qL,"\n {\n required int64 syncTime = 1;//忥æ¶é´æ³\n }\n message ").concat(KL,"\n {\n required string fromUserId = 1;//ï¼è°åçï¼\n required string targetId = 2;
1// ç®æ Id(è¶
级群Id)\n required ChannelType type = 3;//åéç±»åå¦ï¼ï¼P2P,GROUP,ULTRAGROUPï¼\n required string msgUID = 4; // æ©å±æ¶æ¯çå
容ä½\n required int64 msgTime = 5; //åå§æ¶æ¯æ¶é´\n optional string busChannel = 6; // è¯¥æ¶æ¯æå±ä¼è¯çä¸å¡æ è¯ï¼éå¶20å符以å
\n optional string content = 7; // å³extraContentæ¶æ¯æ©å±å
容,ä¸è¡¨æ ¼è¯´æ\n }\n message ").concat(jL," //æ¥è¯¢å
¥å\n {\n required int64 syncTime = 1;//忥æ¶é´æ³\n }\n message ").concat(JL," //åºçç»æ\n {\n repeated MsgChange list = 1; //åæ´\n required int64 syncTime = 2; //忥æ¶é´(ç¨äºä¸æ¬¡åæ¥å
¥å)\n optional bool hasNext = 3 ;\n }\n message ").concat(YL," //åæ´è¯¦æ
\n {\n required string targetId = 1; // ç®æ Id(è¶
级群Id)\n required ChannelType type = 2; // ä¼è¯ç±»å\n required int64 time = 3; // åæ´æ¶é´\n required int32 changeType = 4; // æ¶æ¯åæ´ç±»å(1:æ©å±,2:ä¿®æ¹,3:æ¤å,4:é¢éåæ´,5:ç¨æ·ç»åæ´)\n required string msgUID = 5; // æ¶æ¯ID\n required int64 msgTime = 6; // æ¶æ¯æ¶é´\n optional string busChannel = 7; // é¢éID\n optional bool isAdmin = 8; //æ¯å¦ä¸ºç®¡çåï¼é»è®¤ä¸º 0, 设为 1 æ¶, IMKit æ¶å°æ¤æ¡æ¶æ¯åï¼å°ç°æ¡é»è®¤æ¾ç¤ºä¸ºâ管çå æ¤åäºä¸æ¡æ¶æ¯âã\n optional bool isDel = 9; //é»è®¤ä¸º 0 æ¤åè¯¥æ¡æ¶æ¯åæ¶ï¼ç¨æ·ç«¯å°è¯¥æ¡æ¶æ¯å é¤å¹¶æ¿æ¢ä¸ºä¸æ¡å°ç°æ¡æ¤åæç¤ºæ¶æ¯ï¼ä¸º 1 æ¶ï¼è¯¥æ¡æ¶æ¯å é¤åï¼ä¸æ¿æ¢ä¸ºå°ç°æ¡æç¤ºæ¶æ¯ã\n optional string operatorId = 10; // æ¶æ¯åæ´çæä½äºº Id; subChangeType 为 5 æ¶ï¼operatorId 表示被踢åºè¶
çº§ç¾¤ç§æé¢éç½ååçç¨æ·\n // subChangeType çæä¹ç± changeType ç弿¥å³å®\n // å½ changeType 为 4 æ¶;\n // 1: å é¤é¢é;\n // 2: å
¬æé¢éåä¸ºç§æé¢é;\n // 3: ç§æé¢éå为å
¬æé¢é;\n // 4: ç§æé¢éæååæ´-å å
¥, SDK ä¸éç¥ä¸å¡å±;\n // 5: ç§æé¢éæååæ´-éåº;\n // 6: å
¬æé¢éåä¸ºç§æé¢éï¼å½åç¨æ·ä¸å¨ç½ååä¸;\n // å½ changeType 为 5 æ¶;\n // 1: å é¤ç¨æ·ç» (éç¥å° ç¨æ·ç»ä¸ææç¨æ·)\n // 2: ç¨æ·ç»å¢å ç¨æ· (ä»
éç¥å°è¯¥ç¨æ·)\n // 3: ç¨æ·ç»å é¤ç¨æ· (ä»
éç¥å°è¯¥ç¨æ·)\n // 4: é¢éç»å®ç¨æ·ç» (éç¥å° ç¨æ·ç»ä¸ææç¨æ·)\n // 5: é¢éè§£ç»ç¨æ·ç» (éç¥å° ç¨æ·ç»ä¸ææç¨æ·)\n optional int32 subChangeType = 11;\n optional int32 busChannelType = 12; // 0:å
¬æé¢é; 1:ç§æé¢é\n optional bool isRemindMe = 13;// æ¯å¦ä¸º@æçæ¶æ¯, æ¶æ¯æ¤åæ¶, è¯¥åæ®µææä¹, ç¨äºå®¢æ·ç«¯è®¡ç®æ¯å¦æªè¯»æ°æ»æ°-1,æªè¯»@æ¶æ¯æ°-1 -- server ææªæ¯æ\n repeated string userGroupIds = 14; //ç¨æ·ç»idå表,ç¨äºç¨æ·ç»å¢å æåæé¢éç»å®è§£ç»ç¨æ·ç»çéç¥ä¸\n }\n message ").concat(QL," //请æ±\n {\n required string targetId = 1; // ç®æ Id(è¶
级群Id)\n required ChannelType type = 2; // ä¼è¯ç±»å\n repeated MessageQueryInfo query = 3; //\n }\n message MessageQueryInfo\n {\n required int64 msgTime = 1; // æ¶æ¯æ¶é´\n required string msgUID = 2; // æ¶æ¯ID\n optional string busChannel = 3; // é¢éID\n }\n message ").concat(zL," //åºç\n {\n repeated DownStreamMessage list = 1;//æ¶æ¯\n }\n message ").concat(ZL," //客æ·ç«¯åé\n {\n optional string targetId = 1;// targetId\n optional ChannelType type = 2;//åéä¼è¯ç±»åå¦ï¼ï¼P2P,GROUPï¼ \n optional int32 opT
1ype = 3; //0 , æ£å¨è¾å
¥, 1 æ£å¨XXX \n optional string busChannel = 4; // é¢é(channelId,å¯ä»¥ä¸ºç©º)\n }\n message ").concat(XL," //æå¡ç«¯åé\n {\n optional ChannelType type = 1;//åéä¼è¯ç±»åå¦ï¼P2P,GROUPï¼ \n optional int64 notifyType = 2; //0x1 表示æç», 0x2 è¡¨ç¤ºæ±æ» 0x3 表示æç»+æ±æ»\n repeated OperateInfo info = 3 ; //æç»å表 å½notifyType 为 1å3æ¶,ææ\n repeated OperateSummary summary = 4 ; //æ±æ»å表, å½notifyType 为2å3 æ¶,ææ\n }\n message ").concat($L," {\n // XX æ£å¨åä»ä¹\n optional string targetId = 1; // è¶
级群Id ä¼è¯id\n optional string busChannel = 2; // é¢é(channelId,å¯ä»¥ä¸ºç©º)\n optional string userId = 3; // userId\n optional int32 opType = 4; //0 , æ£å¨è¾å
¥, 1 æ£å¨XX \n optional int64 optime = 5; //æå¡ç«¯æ¶å°ç¨æ·æä½çä¸è¡æ¶é´. \n }\n \n message ").concat(ew," {\n // å 个人 æ£å¨å¹²ä»ä¹\n optional string targetId = 1; // è¶
级群Id ä¼è¯id\n optional string busChannel = 2; // é¢é(channelId,å¯ä»¥ä¸ºç©º)\n optional int32 count = 3;
1 // æä½äººæ°\n optional int32 opType = 4; //0, æ£å¨è¾å
¥, 1 æ£å¨XX \n }\n\n message ").concat(tw,"\n {\n required string rtcRoomId= 1; //rtcæ¿é´ID;\n }\n message ").concat(nw,"\n {\n required int32 nothing = 1; //ç¨äºå ä½\n }\n}\n"),ow=function(e,t,n,r,i,o){var s=i?Object.keys(i).map((function(t){return e.encode(aI.RtcValueInfo,{key:t,value:i[t]},!0)})):void 0,a=o?Object.keys(o).map((function(t){return e.encode(aI.RtcValueInfo,{key:t,value:o[t]},!0)})):void 0;return e.encode(aI.RtcInput,{roomType:t,broadcastType:n,joinType:r,innerDatas:s,outerDatas:a})},sw=function(e,t){var n=e.decode(aI.RtcUserListOutput,t),r=n.users,i=n.token,o=n.sessionId,s=n.roomInfo,a=n.entries,c=n.offlineKickTime,u={};return PE(r,(function(e){var t=e.userId,n=e.userData,r={};PE(n,(function(e){var t=e.key,n=e.value;r[t]=n})),u[t]=r})),{users:u,token:i,sessionId:o,roomInfo:s,kvEntries:a,offlineKickTime:c}};e.LogL=void 0,(rw=e.LogL||(e.LogL={}))[rw.STATISTICS=-2]="STATISTICS",rw[rw.RECORD=-1]="RECORD",rw[rw.FATAL=0]="FATAL",rw[rw.ERROR=1]="ERROR",rw[rw.WARN=2]="WARN",rw[rw.INFO=3]="INFO",rw[rw.DEBUG=4]="DEBUG";var aw=function(t){return[e.LogL.DEBUG,e.LogL.INFO,e.LogL.WARN,e.LogL.ERROR].some((function(e){return e===t}))},cw=Xh(),uw=Date.now(),dw=0,lw=function(){function t(t,n,r){this._appkey=t,this._id=n,this._type=r,this.outputLevel=e.LogL.WARN,this.debug=this._log.bind(this,e.LogL.DEBUG),this.info=this._log.bind(this,e.LogL.INFO),this.warn=this._log.bind(this,e.LogL.WARN),this.error=this._log.bind(this,e.LogL.ERROR),this.__statistics=this._log.bind(this,e.LogL.STATISTICS)}return t.prototype._stdout=function(t,n,r,i,o){if(!(t<=e.LogL.FATAL)&&console&&!(t>this.outputLevel)){var s=["error","warn","info","debug"][t-1];null===console||void 0===console||console[s]("".concat(r,"[").concat(this._id,"][").concat(s.toUpperCase(),"]: ").concat(n," | ").concat(i," | ").concat(o))}},t.prototype.setOutputLevel=function(e){aw(e)&&(this.outputLevel=e)},t.prototype._log=function(t,n,r,i){var o=new Date;/^[\w-]+$/.test(n)?(this._stdout(t,n,o.toISOString(),r,i),t!==e.LogL.DEBUG&&this.flush({time:+o,sessionId:cw,type:this._type,loggerId:this._id,tag:n,level:t,content:r,traceId:i})):this._stdout(e.LogL.ERROR,"L_LOG_TAG_INVALID_E",o.toISOString(),n,i)},t.prototype.createTraceId=function(){return"".concat(cw,"-").concat(++dw)},t.prototype.getSessionId=function(){return cw},t}(),hw=null,fw="RC_LOGS",gw="RC_CONF",pw=null,vw=function e(t){return uc(void 0,void 0,void 0,(function(){var n;return dc(this,(function(r){switch(r.label){case 0:return[4,hw];case 1:return(n=r.sent())?[4,new Promise((function(e){var r=n.db.transaction(fw,"readwrite").objectStore(fw),i=IDBKeyRange.lowerBound(Date.now()-t),o=r.getAllKeys(i);o.onsuccess=function(){var t=o.result,n=t.length;if(n>0){var i=r.delete(IDBKeyRange.bound(t[0],t[n-1]));i.onsuccess=e,i.onerror=e}},o.onerror=e}))]:[2];case 2:return r.sent(),pw=setTimeout((function(){return e(t)}),6e5),[2]}}))}))},_w=function(e,t,n){void 0===n&&(n=168),hw||("undefined"!=typeof window&&window&&window.indexedDB?hw=new Promise((function(r){var i=window.indexedDB;i.databases&&i.databases().then((function(e){e.some((function(e){return"RC_ENGINE_DB"===e.name}))&&i.deleteDatabase("RC_ENGINE_DB")}));var o="RC_LOGS_".concat(e),s=i.open(o,1);s.onerror=function(e){t.error(Fd.L_LOGDB_OPEN_FAILED_E,e.target.error),r(null)},s.onsuccess=function(i){var o=i.target.result;o?(o.onclose=function(e){t.warn(Fd.L_LOGDB_CLOSED_S)},o.onerror=function(e){t.error(Fd.L_LOGDB_ERROR_E,e.target.error)},o.onabort=function(e){t.info(Fd.L_LOGDB_ABORT_S,e.target.error)},vw(3600*Math.max(24,Math.min(168,n))*1e3),r({appkey:e,db:o})):r(null)},s.onupgradeneeded=function(e){var t=e.target.result;t.objectStoreNames.contains(fw)&&t.deleteObjectStore(fw);var n=t.createObjectStore(fw,{autoIncrement:!0});n.createIndex("level","level",{unique:!1}),n.createIndex("time","time",{unique:!1}),(n=t.createObjectStore(gw,{keyPath:"key"})).createIndex("key","key",{unique:!0})}})):t.warn(Fd.L_UNSUPPORT_INDEXDB_O))},Ew=function(){return uc(void 0,void 0,void 0,(function(){var e;return dc(this,(function(t){switch(t.label){case 0:return hw?(pw&&(clearTimeout(pw),pw=null),[4,hw]):[2];case 1:return(e=t.sent())&&e.db.close(),hw=null,[2]}}))}))},mw=[],Iw=!1,Tw=function e(t){return uc(void 0,void 0,void 0,(function(){var n;return dc(this,(function(r){switch(r.label){case 0:return Iw||0===mw.length?[2]:(Iw=!0,n=mw.splice(0),[4,new Promise((function(e){var r=t.transaction(fw,"readwrite");r.oncomplete=e,r.onabort=e;var i=r.objectStore(fw);
1n.forEach((function(e){try{i.add(e)}catch(t){null===console||void 0===console||console.error("write log failed ->",e)}}))}))]);case 1:return r.sent(),Iw=!1,setTimeout((function(){return e(t)})),[2]}}))}))},yw=function(e){return uc(void 0,void 0,void 0,(function(){var t;return dc(this,(function(n){switch(n.label){case 0:return[4,hw];case 1:return(t=n.sent())?(mw.push(e),Tw(t.db),[2]):[2]}}))}))};function Rw(e){return uc(this,void 0,void 0,(function(){var t;return dc(this,(function(n){switch(n.label){case 0:return[4,hw];case 1:return(t=n.sent())?[2,new Promise((function(n){var r=t.db.transaction(gw,"readonly").objectStore(gw).get(e);r.onsuccess=function(e){var t;n({value:null===(t=r.result)||void 0===t?void 0:t.value,success:!0})},r.onerror=function(e){n({success:!1})}}))]:[2,{success:!1}]}}))}))}var Cw,Sw,Ow,Nw,Aw=0,Mw=function(){return{setTimestamp4RealtimeLog:function(e){Aw=e},getTimestamp4RealtimeLog:function(){return Aw},getLogs:function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i;return dc(this,(function(o){switch(o.label){case 0:return[4,hw];case 1:return(i=o.sent())?[2,new Promise((function(o){var s=i.db.transaction(fw,"readonly").objectStore(fw),a=[],c=IDBKeyRange.bound(e,t),u=s.index("time").openCursor(c);u.onsuccess=function(e){var t=e.target.result;if(t){var i=t.value;i.level<=n&&(r?i.sessionId===cw:i.level>=0)&&a.push(i),t.continue()}else o({dbReady:!0,logs:a})},u.onerror=function(e){o({dbReady:!1,logs:[]})}}))]:[2,{dbReady:!1,logs:[]}]}}))}))}}},Uw="REPORT_SESSION",Lw=function(e,t){return uc(void 0,void 0,void 0,(function(){var n,r,i,o;return dc(this,(function(s){switch(s.label){case 0:return n="".concat(Uw,"_").concat(e),[4,Rw("".concat(Uw,"_").concat(e))];case 1:return r=s.sent(),i=r.success,o=r.value,i?(t===(null==o?void 0:o.sessionId)||function(e,t){uc(this,void 0,void 0,(function(){var n,r;return dc(this,(function(i){switch(i.label){case 0:return[4,hw];case 1:return(n=i.sent())?(r=n.db,r.transaction(gw,"readwrite").objectStore(gw).put({key:e,value:t}),[2,!0]):[2,!1]}}))}))}(n,{sessionId:t}),[2]):[2]}}))}))},ww=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ac(t,e),t.prototype.flush=function(e){yw(e)},t}(lw),bw=function(){function t(e,t,n,r,i){this.appkey=e,this.deviceId=t,this.deviceInfo=n,this.logDB=r,this.logger=i,this.userId="",this.timer=null,this.started=!1}return t.prototype.checkStart=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i;return dc(this,(function(o){if(this.started)return[2];if(this.userId=e.userId,!e.logSwitch)return[2];t=ec;try{t=JSON.parse(e.logPolicy)}catch(t){this.logger.warn(Fd.L_REPORT_LOG_POLICY_E,JSON.stringify({policy:e.logPolicy}))}return this.started=!0,n=t.url,r=t.level,i=t.itv,this.realtimeReport(n,r,i),[2]}))}))},t.prototype.realtimeReport=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s,a,c,u,d,l,h,f,g,p=this;return dc(this,(function(v){switch(v.label){case 0:return r=Date.now(),i=this.logDB.getTimestamp4RealtimeLog()||uw,o=Math.max(r-5e3,i),s=this.logger.createTraceId(),this.logger.info(Fd.L_REALTIME_LOG_T,JSON.stringify({startTime:i,endTime:o,level:t}),s),[4,this.logDB.getLogs(i,o,t,!0)];case 1:return a=v.sent(),c=a.dbReady,u=a.logs,c?[3,2]:(this.logger.warn(Fd.L_REALTIME_LOG_R,"db error",s),[3,6]);case 2:return 0!==u.length?[3,3]:(this.logger.info(Fd.L_REALTIME_LOG_R,"no logs",s),[3,6]);case 3:return this.logger.info(Fd.L_REALTIME_LOG_O,JSON.stringify({count:u.length}),s),[4,this.compressLogs(u)];case 4:return d=v.sent(),l=d.success,h=d.data,l||this.logger.warn(Fd.L_REALTIME_LOG_O,"compress failed",s),this.logger.info(Fd.L_REALTIME_LOG_O,"compress done",s),f=El(e)?e:"https://".concat(e),f+="?version=".concat("5.7.7","&appkey=").concat(this.appkey,"&userId=").concat(this.userId,"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:f,body:h,method:"POST"})];case 5:g=v.sent().status,this.logger.info(Fd.L_REALTIME_LOG_R,JSON.stringify({status:g}),s),200===g&&this.logDB.setTimestamp4RealtimeLog(u[u.length-1].time+1),v.label=6;case 6:return this.started&&!this.timer&&(this.timer=setTimeout((function(){return p.realtimeReport(e,t,n)}),1e3*n)),[2]}}))}))},t.prototype.report=function(t,n,r,i,o,s){return uc(this,void 0,void 0,(function(){var a,c,u,d,l,h,f,g,p,v;return dc(this,(function(_){switch(_.label){case 0:return"web"!==r.toLowerCase()?[2]:(a=this.logger.createTraceId(),this.logger.info(Fd.L_REPORT_FULL_
1LOG_T,JSON.stringify({startTime:t,endTime:n,logId:o,messageUId:s}),a),[4,this.logDB.getLogs(t,n,e.LogL.DEBUG,!1)]);case 1:return c=_.sent(),u=c.dbReady,d=c.logs,this.logger.info(Fd.L_REPORT_FULL_LOG_O,JSON.stringify({count:d.length}),a),l=El(i)?i:"https://".concat(i),l+="?version=".concat("5.7.7","&appkey=").concat(this.appkey,"&userId=").concat(this.userId,"&deviceId=").concat(this.deviceId,"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(o),u?d.length>0?[4,this.compressLogs(d)]:[3,3]:[3,5];case 2:return f=_.sent(),g=f.success,p=f.data,h=g?p:"compress failed",[3,4];case 3:h="no data",_.label=4;case 4:return[3,6];case 5:h="no database",_.label=6;case 6:return this.logger.debug(Fd.L_REPORT_FULL_LOG_O,"compress done",a),[4,this.send({url:l,body:h,method:"POST"})];case 7:return v=_.sent().status,this.logger.info(Fd.L_REPORT_FULL_LOG_R,JSON.stringify({status:v}),a),[2]}}))}))},t.prototype.stop=function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1},t}(),Pw=48,Dw=64,Bw=80,Vw=96,Gw="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",xw=Gw.length,kw=function(e){for(var t={},n=0;n<e.length-1;n++){var r=e.charAt(n)+e.charAt(n+1);t.hasOwnProperty(r)?t[r].push(n):t[r]=[n]}for(var i=[],o=[],s=function(){if(o.length>0){var e=o.join("");if(o=[],e.length>26){var t=Hw(e.length),n=String.fromCharCode(Bw|t.length);i.push(n+t)}else{var r=String.fromCharCode(Vw|e.length);i.push(r)}i.push(e)}},a=0;a<e.length;){var c=Fw(t,e,a);if(c.length<2)o.push(e.charAt(a++));else if(c.length<4)o.push(e.substr(a,c.length)),a+=c.length;else{var u=Hw(a-c.offset),d=Hw(c.length);if(u.length+d.length>=c.length)o.push(e.substr(a,c.length)),a+=c.length;else{s();var l=String.fromCharCode(Dw|u.length<<2|d.length);i.push(l+u+d),a+=c.length}}}s();var h=Hw(e.length),f=String.fromCharCode(Pw|h.length);return i.push(f+h),i.join("")},Fw=function(e,t,n){var r={length:0,offset:-1};if(t.length,n>=t.length-1)return r;var i=e[t.charAt(n)+t.charAt(n+1)];if(i[0]===n)return r;for(var o=t.length-n,s=0,a=i.length;s<a;s++){var c=i[s],u=n-c;
1if(!(u>238327)){var d=Math.min(o,u);if(d<=r.length)break;if(!(r.length>2&&t.charAt(c+r.length-1)!==t.charAt(n+r.length-1))){for(var l=2,h=l;h<d&&t.charAt(c+h)===t.charAt(n+h);h++)l++;l>=r.length&&(r.length=l,r.offset=c)}}}return r},Hw=function(e){var t=[],n=0;do{n=e%xw,t.push(Gw.charAt(n)),e=(e-n)/xw}while(e>0);return t.join("")},qw=function(e){if("browser"!==e.tag)return{type:e.tag,version:"UnKonw"};var t,n,r=navigator.userAgent,i={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var o in i)if(i.hasOwnProperty(o)){var s=r.match(i[o]);if(s){n=o,t=s[1]||s[2];break}}return{type:n||"UnKonw",version:t||"UnKonw"}},Kw=function(e){var t=e.sessionId,n=e.level,r=e.loggerId,i=e.traceId,o=e.time,s=e.tag,a=e.type,c=e.content,u=n<0?c||"":JSON.stringify({content:c,traceId:i,from:r});return u='"'.concat(u.replace(/"/g,'""'),'"'),"".concat(t,",").concat(o,",").concat(a,",").concat(n,",").concat(s,",").concat(u,"\n")},jw=function(e){function t(t,n,r,i){var o=this,s=TU(n),a=qw(n),c="".concat(a.type,"|").concat(a.version,"|").concat(r.getSessionId());return(o=e.call(this,t,s,c,Mw(),r)||this).runtime=n,o.clientReportLevel=i,aw(o.clientReportLevel)||(o.clientReportLevel=void 0),o}return ac(t,e),t.prototype.send=function(e){return this.runtime.httpReq(e)},t.prototype.checkStart=function(t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){switch(n.label){case 0:return[4,Lw(t.userId,this.logger.getSessionId())];case 1:return n.sent(),[2,e.prototype.checkStart.call(this,t)]}}))}))},t.prototype.compressLogs=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,{success:!0,data:kw(e.map(Kw).join(""))}]}))}))},t.prototype.isReporter=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){switch(e.label){case 0:return[4,(t=this.userId,n=this.logger.getSessionId(),uc(void 0,void 0,void 0,(function(){var e,r,i;return dc(this,(function(o){switch(o.label){case 0:return[4,Rw("".concat(Uw,"_").concat(t))];case 1:return e=o.sent(),r=e.success,i=e.value,[2,r&&(null==i?void 0:i.sessionId)===n]}}))})))];case 1:return[2,e.sent()]}var t,n}))}))},t.prototype.report=function(t,n,r,i,o,s){return uc(this,void 0,void 0,(function(){return dc(this,(function(a){switch(a.label){case 0:return[4,this.isReporter()];case 1:return a.sent()?[2,e.prototype.report.call(this,t,n,r,i,o,s)]:[2]}}))}))},t.prototype.realtimeReport=function(t,n,r){return uc(this,void 0,void 0,(function(){return dc(this,(function(i){return[2,e.prototype.realtimeReport.call(this,t,n,r)]}))}))},t}(bw);!function(e){e[e.ACCEPTED=0]="ACCEPTED",e[e.UNACCEPTABLE_PROTOCOL_VERSION=1]="UNACCEPTABLE_PROTOCOL_VERSION",e[e.IDENTIFIER_REJECTED=2]="IDENTIFIER_REJECTED",e[e.SERVER_UNAVAILABLE=3]="SERVER_UNAVAILABLE",e[e.TOKEN_INCORRECT=4]="TOKEN_INCORRECT",e[e.NOT_AUTHORIZED=5]="NOT_AUTHORIZED",e[e.REDIRECT=6]="REDIRECT",e[e.PACKAGE_ERROR=7]="PACKAGE_ERROR",e[e.APP_BLOCK_OR_DELETE=8]="APP_BLOCK_OR_DELETE",e[e.BLOCK=9]="BLOCK",e[e.TOKEN_EXPIRE=10]="TOKEN_EXPIRE",e[e.DEVICE_ERROR=11]="DEVICE_ERROR",e[e.HOSTNAME_ERROR=12]="HOSTNAME_ERROR",e[e.HASOHTERSAMECLIENTONLINE=13]="HASOHTERSAMECLIENTONLINE",e[e.OUT_OF_LIMIT=14]="OUT_OF_LIMIT",e[e.IN_OTHER_CLUSTER=15]="IN_OTHER_CLUSTER",e[e.APP_AUTH_NOT_PASS=16]="APP_AUTH_NOT_PASS",e[e.OTP_USED=17]="OTP_USED",e[e.PLATFORM_ERROR=18]="PLATFORM_ERROR",e[e.ACCOUNT_CANCELLATION=19]="ACCOUNT_CANCELLATION",e[e.LICENSE_EXPIRED=20]="LICENSE_EXPIRED"}(Cw||(Cw={})),function(e){e[e.OTHER_DEVICE_LOGIN=1]="OTHER_DEVICE_LOGIN",e[e.BLOCK=2]="BLOCK",e[e.BLOCK_NEW=5]="BLOCK_NEW",e[e.REDIRECT_NEW=6]="REDIRECT_NEW",e[e.TOKEN_EXPIRED=7]="TOKEN_EXPIRED",e[e.ILLEGAL_PROTOCOL_VERSION=8]="ILLEGAL_PROTOCOL_VERSION",e[e.ACCOUNT_CANCELLATION=9]="ACCOUNT_CANCELLATION"}(Sw||(Sw={}));var Yw,Jw=((Ow={})[Sw.OTHER_DEVICE_LOGIN]=Cd.RC_DISCONN_KICK,Ow[Sw.BLOCK]=Cd.RC_DISCONN_EXCEPTION,Ow[Sw.BLOCK_NEW]=Cd.RC_DISCONN_EXCEPTION,Ow[Sw.REDIRECT_NEW]=Cd.RC_CONN_REDIRECTED,Ow[Sw.TOKEN_EXPIRED]=Cd.RC_CONN_TOKEN_EXPIRED,Ow[Sw.ILLEGAL_PROTOCOL_VERSION]=Cd.RC_CONN_PROTO_VERSION_ERROR,Ow[Sw.ACCOUNT_CANCELLATION]=Cd.RC_ACCOUNT_CANCELLATION,Ow),Qw=((Nw={})[Cw.ACCEPTED]=Cd.SUCCESS,Nw[Cw.UNACCEPTABLE_PROTOCOL_VERSION]=Cd.RC_CONN_PROTO_VERSION_ERROR,Nw[Cw.IDENTIFIER_REJECTED]=Cd.RC_CONN_IDENTIFIER_REJECTED,Nw[Cw.SERVER_UNAVAILABLE]=Cd.RC_CONN_SERVER_UNAVAILABLE,Nw[Cw.TOKEN_INCORRECT]=Cd.RC_CONN_TOKEN_INCORRECT,Nw[Cw.NOT_AUTHORIZED]=Cd.RC_CONN_NOT_AUTHRORIZED,Nw[Cw.REDIRECT]=Cd.RC_CONN_REDIRECTED,Nw[Cw.PACKAGE_ERROR]=Cd.RC_CONN_PACKAGE_NAME_INVALID,Nw[Cw.APP_BLOCK_OR_DELETE]=Cd.RC_CONN_APP_BLOCKED_OR_DELETED,Nw[Cw.BLOCK]=Cd.RC_CONN_USER_BLOCKED,Nw[Cw.TOKEN_EXPIRE]=Cd.RC_CONN_TOKEN_EXPIRED,Nw[Cw.DEVICE_ERROR]=Cd.RC_CONN_DEVICE_ERROR,Nw[Cw.HOSTNAME_ERROR]=Cd.RC_CONN_HOSTNAME_ERROR,Nw[Cw.HASOHTERSAMECLIENTONLINE]=Cd.RC_DISCONN_SAME_CLIENT_ON_LINE,Nw[Cw.OUT_OF_LIMIT]=Cd.RC_LISCENSE_COUNT_OUT_OF_LIMIT,Nw[Cw.IN_OTHER_CLUSTER]=Cd.RC_CONN_WRONG_CLUSTER,Nw[Cw.APP_AUTH_NOT_PASS]=Cd.RC_APP_AUTH_NOT_PASS,Nw[Cw.OTP_USED]=Cd.RC_OTP_USED,Nw[Cw.PLATFORM_ERROR]=Cd.RC_PLATFORM_ERROR,Nw[Cw.ACCOUNT_CANCELLATION]=Cd.RC_ACCOUNT_CANCELLATION,Nw[Cw.LICENSE_EXPIRED]=Cd.RC_LICENSE_EXPIRED,Nw),Ww=function(e){return e===Cd.RC_CONN_REDIRECTED};e.RCConnectionStatus=void 0,(Yw=e.RCConnectionStatus||(e.RCConnectionStatus={}))[Yw.CONNECTED=0]="CONNECTED",Yw[Yw.CONNECTING=1]="CONNECTING",Yw[Yw.DISCONNECTED=2]="DISCONNECTED",Yw[Yw.SUSPENDED=3]="SUSPENDED";var zw=function(){function t(t,n,r,i){this.appkey=t,this.navi=n,this.logger=r,this.listener=i,this.token="",this.reconnectKick=!1,this._crtConnectionStatus=e.RCConnectionStatus.DISCONNECTED,this._crtUserId="",this._crtConnectionTask=null,this.reconnectTimer=null,this._failedCount=0,this.ALLOW_FAILED_TIMES=2}return t.prototype.getToken=function(){return this.token},t.prototype.getCurrentUserId=function(){return this._crtUserId},t.prototype.setConnectionStatus=function(t,n){if(this._crtConnectionStatus!==t)switch(this._crtConnectionStatus=t,t){case e.RCConnectionStatus.CONNECTED:this.logger.info(Fd.L_CONNECT_S,t),this.checkAlive(),this.listener.onConnected();break;case e.RCConnectionStatus.CONNECTING:this.logger.warn(Fd.L_CONNECT_S,"status: ".concat(t,", code: ").concat(n)),this.listener.onConnecting();break;case e.RCConnectionStatus.SUSPENDED:this.logger.warn(Fd.L_CONNECT_S,"status: ".concat(t,", code: ").concat(n)),this.listener.onSuspend(n);break;default:this.logger.warn(Fd.L_CONNECT_S,"status: ".concat(t,", code: ").concat(n)),this.listener.onDisconnected(n)}},t.prototype.getConnectionStatus=function(){return this._crtConnectionStatus},t.prototype.connect=function(t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s;return dc(this,(function(a){switch(a.label){case 0:return this._crtConnectionStatus===e.RCConnectionStatus.CONNECTED?[2,{code:Cd.SUCCESS,data:this._crtUserId}]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this.token=t,this.reconnectKick=n,this.setConnectionStatus(e.RCConnectionStatus.CONNECTING),[4,this.try2Connect(t,n,!1,r)]);case 1:return i=a.sent(),o=i.code,s=i.data,o!==Cd.SUCCESS?(this.setConnectionStatus(e.RCConnectionStatus.DISCONNECTED,o),[2,{c
1ode:o}]):(this.setConnectionStatus(e.RCConnectionStatus.CONNECTED),[2,{code:o,data:s}])}}))}))},t.prototype.try2Connect=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s;return dc(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,n,r),[4,this._crtConnectionTask]);case 1:return i=a.sent(),o=i.code,s=i.data,this._crtConnectionTask=null,[2,{code:o,data:s}]}}))}))},t.prototype.createConnectionTask=function(t,n,r,i){return uc(this,void 0,void 0,(function(){var o,s,a,c,u,d,l;return dc(this,(function(h){switch(h.label){case 0:return[4,this.navi.request(t,r,!1,i)];case 1:return o=h.sent(),s=o.code,a=o.data,s!==Cd.SUCCESS?[2,{code:s}]:1===(c=a).type?[2,{code:Cd.PACKAGE_ENVIRONMENT_ERROR}]:(this.logger.info(Fd.L_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:n}),i),[4,this.connectWithToken(t.replace(/@.+$/,"@"),c,n,i)]);case 2:return u=h.sent(),d=u.code,l=u.data,Ww(d)?(this.logger.warn(Fd.L_CONNECT_R,"redirect code: ".concat(d),i),[2,this.createConnectionTask(t,n,!0,i)]):d===Cd.RC_CONN_ACK_TIMEOUT?(this.logger.warn(Fd.L_CONNECT_R,"cmp ack timeout, code: ".concat(d),i),this.setConnectionStatus(e.RCConnectionStatus.SUSPENDED,d),this.setConnectionStatus(e.RCConnectionStatus.CONNECTING),[2,this.createConnectionTask(t,n,!1,i)]):d!==Cd.SUCCESS?(this.logger.warn(Fd.L_CONNECT_R,"code: ".concat(d),i),[2,{code:d}]):(this.logger.info(Fd.L_CONNECT_R,"userId: ".concat(l),i),this._crtUserId=l,[2,{code:d,data:l}])}}))}))},t.prototype.try2Reconnect=function(t,n){return uc(this,void 0,void 0,(function(){var r,i,o=this;return dc(this,(function(s){return r=this.logger.createTraceId(),this.logger.debug(Fd.T,"try2Reconnect -> ignoreNaviCache: ".concat(t,", reason: ").concat(n),r),this.stopReconnectTimer(),i=function(){return uc(o,void 0,void 0,(function(){var o;return dc(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==e.RCConnectionStatus.SUSPENDED?[2]:(this.setConnectionStatus(e.RCConnectionStatus.CONNECTING,n),[4,this.try2Connect(this.token,!0,t,r)]);case 1:return o=s.sent().code,this.reconnectTimer=null,o===Cd.SUCCESS?(this.setConnectionStatus(e.RCConnectionStatus.CONNECTED),[2]):[Cd.SERVER_UNAVAILABLE,Cd.TIMEOUT,Cd.RC_SOCKET_DISCONNECTED,Cd.RC_SOCKET_NOT_CREATED,Cd.RC_CONN_ACK_TIMEOUT,Cd.RC_TCP_RESET,Cd.RC_NAVI_REQ_FAILED].includes(o)?(this._crtConnectionStatus!==e.RCConnectionStatus.CONNECTING||(this.setConnectionStatus(e.RCConnectionStatus.SUSPENDED,o),this.reconnectTimer=setTimeout(i,5e3)),[2]):(this.setConnectionStatus(e.RCConnectionStatus.DISCONNECTED,o),[2])}}))}))},i(),[2]}))}
1))},t.prototype.onDisconnectByServer=function(t){if(Ww(t))return this.setConnectionStatus(e.RCConnectionStatus.SUSPENDED,t),void this.try2Reconnect(!0,t);this.setConnectionStatus(e.RCConnectionStatus.DISCONNECTED,t)},t.prototype.onDisconenctUnusual=function(t){this.setConnectionStatus(e.RCConnectionStatus.SUSPENDED,t),this.try2Reconnect(!1,t)},t.prototype.checkAlive=function(){return uc(this,void 0,void 0,(function(){var t,n,r=this;return dc(this,(function(i){switch(i.label){case 0:return this._crtConnectionStatus!==e.RCConnectionStatus.CONNECTED?(this._failedCount=0,this.logger.debug(Fd.L_CHECK_ALIVE_IM_S,"stop ping because of no connection"),[2]):(t=this.logger.createTraceId(),this.logger.info(Fd.L_CHECK_ALIVE_IM_T,null,t),[4,this.sendPing(15e3)]);case 1:return(n=i.sent())===Cd.SUCCESS?(this.logger.info(Fd.L_CHECK_ALIVE_IM_R,n,t),this._failedCount=0,setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==e.RCConnectionStatus.CONNECTED?[2]:(this._failedCount+=1,this.logger.info(Fd.L_CHECK_ALIVE_IM_R,"code: ".concat(n,", count: ").concat(this._failedCount),t),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(Fd.L_CHECK_ALIVE_IM_S,"ping timeout, close connection to reconnect!"),this.close(!0,!1),this.setConnectionStatus(e.RCConnectionStatus.SUSPENDED,Cd.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,Cd.RC_PING_EXCEED_LIMIT),[2]))}}))}))},t.prototype.disconnect=function(t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){switch(n.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:n.sent(),n.label=2;case 2:return this.setConnectionStatus(e.RCConnectionStatus.DISCONNECTED,2),this.close(!1,t),[2]}}))}))},t.prototype.stopReconnectTimer=function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)},t}(),Zw=function(){function t(e){this.logger=e,this._codec=t.createPBCodec()}return t.createPBCodec=function(){var e=GN(iw);return e.getModule=function(t){var n=new e[t];return n.getArrayData=function(){var e=n.toArrayBuffer();return e=fl(e)?[].slice.call(new Int8Array(e)):e},n},e},t.prototype.decodeByPBName=function(e,t,n){var r,i=this,o=e,s=((r={})[bU]=i._formatSyncMessages,r[wU]=i._formatReceivedMessage,r[UU]=i._formatSentMessage,r[kU]=i._formatHistoryMessages,r[HU]=i._formatConversationList,r[eL]=i._formatChatRoomInfos,r[lL]=i._formatChatRoomKVList,r[mL]=i._formatUserSetting,r[yL]=i._formatConversationStatus,r[PL]=i._formatGrpReadReceiptQryResp,r[_L]=i._formatSetUserSettingOutput,r[IL]=i._formatUserSettingNotification,r[JL]=i._formatUltraMsgChangeList,r[XL]=i._formatUltraOperateStatusNotifyList,r[zL]=i._formatUltraMsgList,r[UL]=i._formatUltraGroupUnreadMentionedList,r[XU]=i._formatChrmKVVersion,r)[t];try{o=e.length>0&&i._codec[t].decode(e),pl(o)&&(o=function(e){for(var t in e)pl(e[t])&&(e[t]=NE(e[t]));return e}(o)),vl(s)&&(o=s.call(this,o,n))}catch(e){this.logger.error(Fd.L_PB_DECODE_E,t)}return o},t.prototype._readBytes=function(e){var t=e.offset,n=e.buffer,r=e.limit;if(t)try{var i=fl(n)?new Uint8Array(n):n;return SM.readUTF(i.subarray(t,r))}catch(e){this.logger.error(Fd.O,null==e?void 0:e.stack)}return e},t.prototype._formatBytes=function(e){if(!e)return e;var t=this._readBytes(e);try{t=t?JSON.parse(t):t}catch(e){this.logger.error(Fd.O,null==e?void 0:e.stack)}return t||e},t.prototype._formatSyncMessages=function(e,t){t=t||{};var n=this,r=e.list,i=e.syncTime,o=e.finished;return(_l(o)||null===o)&&(e.finished=!0),e.syncTime=NE(i),e.list=DE(r,(function(e){return n._formatReceivedMessage(e,t)})),e},t.prototype._getUtfContent=function(e){if(e.user){var t=e.user,n=t.portrait,r=t.portraitUri,i=n||r;i&&(e.user.portrait=e.user.portraitUri=i)}return e},t.prototype._setExpansion=function(e){var t;return e&&(t=function(e){var t={},n=JSON.parse(e);return PE(n,(function(e,n){t[n]=e.v})),t}(e)),t},t.prototype._setPushConfig=function(e,t){var n=e.pushContent,r=e.pushExt,i=e.configFlag,o={};return r&&(o=UE(t,r.pushConfigs,r.pushId)),cc(cc({},o),{pushTitle:null==r?void 0:r.title,pushContent:n,pushData:n,disablePushTitle:!!i&&Boolean(4&i),forceShowDetailContent:!!i&&Boolean(8&i),templateId:null==r?void 0:r.templateId})},t.prototype._formatReceivedMessage=function(t,n){if(!t)return t;var r=this,i=n||{}
1,o=i.currentUserId,s=i.connectedTime,a=t.content,c=t.fromUserId,u=t.type,d=t.groupId,l=t.status,h=t.dataTime,f=t.extraContent,g=t.configFlag,p=t.extStatus,v=t.clientUniqueId,_=t.busChannel,E=t.msgId,m=t.classname,I=t.direction||yd.RECEIVE,T=function(e){var t=oi.READ;return{isPersited:!!(16&e),isCounted:!!(32&e),isMentioned:!!(64&e),disableNotification:!!(512&e),receivedStatus:t=2&e?oi.RETRIEVED:t,canIncludeExpansion:!!(1024&e)}}(l),y=T.isPersited,R=T.isCounted,C=T.isMentioned,S=T.disableNotification,O=T.receivedStatus,N=T.canIncludeExpansion,A=!!(2&(p||0)),M=!!(4&(p||0)),U=!!(8&(p||0))?e.UltraGroupChannelType.PRIVATE:e.UltraGroupChannelType.PUBLIC,L=[Od.GROUP,Od.CHATROOM,Od.RTC_ROOM,Od.ULTRA_GROUP].indexOf(u)>-1?d:c,w=c,b=yd.RECEIVE;I===yd.SEND&&(w=o,b=yd.SEND);var P=NE(h),D=P<s,B=u===Od.CHATROOM,V=r._setExpansion(f),G=r._formatBytes(a);G=r._getUtfContent(G);var x=r._setPushConfig(t,this.logger);B&&c===o&&(b=yd.SEND);var k={conversationType:u,targetId:L,senderUserId:w,messageType:m,messageUId:E,isPersited:y,isCounted:R,isMentioned:C,sentTime:P,messageDirection:b,receivedTime:HE.getTime(),disableNotification:S,receivedStatus:O,canIncludeExpansion:N,content:G,expansion:V,configFlag:g,pushConfig:x,channelId:_||"",isInterrupt:A,isModifyMessage:M,messageId:NE(v)||0,sentStatus:e.SentStatus.SENT};return u!==Od.ULTRA_GROUP?(k.isOffLineMessage=D,k):(k.channelType=U,k)},t.prototype._formatSentMessage=function(e,t){var n=this,r=e.content,i=e.classname,o=e.sessionId,s=e.msgId,a=e.extraContent,c=e.pushExt,u=e.pushContent,d=e.configFlag,l=e.extStatus,h=e.clientUniqueId,f=t.signal,g=t.currentUserId,p=f.date,v=f.topic,_=f.targetId,E=!!(2&(l||0)),m=function(e){return{isPersited:!!(1&e),isCounted:!!(2&e),disableNotification:!!(32&e),canIncludeExpansion:!!(64&e)}}(o),I=m.isPersited,T=m.isCounted,y=m.disableNotification,R=m.canIncludeExpansion,C=gM[v]||Od.PRIVATE,S=VE(zA,v),O=n._formatBytes(r),N=_;i===Ud.RECALL&&(C=O.conversationType||C,N=O.targetId||_);var A=n._setExpansion(a),M=n._setPushConfig(e,this.logger),U=cc(cc({},M),{pushTitle:null==c?void 0:c.title,pushContent:u,pushData:u,disablePushTitle:!!d&&Boolean(4&d),forceShowDetailContent:!!d&&Boolean(8&d),templateId:null==c?void 0:c.templateId});return{conversationType:C,targetId:N,messageType:i,messageUId:s,isPersited:I,isCounted:T,isStatusMessage:S,senderUserId:g,content:n._formatBytes(r),sentTime:1e3*p,receivedTime:HE.getTime(),messageDirection:yd.SEND,isOffLineMessage:!1,disableNotification:y,canIncludeExpansion:R,expansion:A,pushConfig:U,channelId:e.busChannel||"",isInterrupt:E,messageId:NE(h)||0}},t.prototype._formatHistoryMessages=function(e,t){var n=this,r=t.conversation||{},i=e.list,o=e.hasMsg,s=r.targetId,a=NE(e.syncTime),c=[];return PE(i,(function(e){var i=n._formatReceivedMessage(e,t);r.conversationType===Od.ULTRA_GROUP?i.targetId=e.groupId||r.targetId:i.targetId=s,c.push(i)}),{isReverse:!0}),{syncTime:a,list:c,hasMore:!!o}},t.prototype._formatUltraMsgChangeList=function(e){var t=e.list,n=e.syncTime,r=e.hasNext;return{syncTime:n,list:t&&t.map((function(e){var t=e.targetId,n=e.type,r=e.time,i=e.changeType,o=e.msgUID,s=e.msgTime,a=e.busChannel,c=e.isAdmin,u=e.isDel,d=e.operatorId,l=e.subChangeType,h=e.userGroupIds,f=e.busChannelType;return{targetId:t,conversationType:n,changeType:i,messageUId:o,changeTime:NE(r),sendTime:NE(s),channelId:a||"",isAdmin:c,isDel:u,operatorId:d,subChangeType:l,userGroupIds:h,busChannelType:f}})),hasNext:r}},t.prototype._formatUltraOperateStatusNotifyList=function(e){var t=e.type,n=e.notifyType,r=e.info,i=e.summary,o=[],s=[],a=2==(2&n),c=1==(1&n);return c&&Array.isArray(r)&&r.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.userId,i=e.opType,s=e.optime,a=NE(s);o.push({targetId:t,channelId:n,userId:r,operationType:i,operationTime:a})})),a&&Array.isArray(i)&&i.forEach((function(e){var t=e.targetId,n=e.busChannel,r=e.count,i=e.opType;s.push({targetId:t,channelId:n,count:r,operationType:i})})),{conversationType:t,info:o,summary:s,hasInfo:c,hasSummary:a}},t.prototype._formatUltraMsgList=function(e,t){var n=this,r=e.list;return{list:r&&r.map((function(e){return n._formatReceivedMessage(e,t)}))}},t.prototype._formatUltraGroupUnreadMentionedList=function(e){var t=e.msgInfo;return(void 0===t?[]:t).map((function(e){return{messageUId:e.msgId,senTtime:NE(e.msgTime),mentionedType:e.remindType}}))},t.prototype._getUltraGroupConversationInfo=function(t,n){var r=n.versionTime,i=n.remindCount,o=n.busChannelType,s=n.msgInfo;return t.versionTime=NE(r)||0,t.unreadMentionedCount=NE(i)||0,t.channelType=
1o||e.UltraGroupChannelType.PUBLIC,t.lastReadTime=0,s&&(t.firstUnreadMessage={sentTime:NE(s.msgTime)},t.lastReadTime=NE(s.msgTime)-1),t},t.prototype._formatConversationList=function(e,t){var n=this,r=this,i=e.info,o=t.afterDecode,s={list:(i=DE(i,(function(e){var i=e.msg,s=e.userId,a=e.type,c=e.unreadCount,u=e.busChannel,d=null;i&&((d=r._formatReceivedMessage(i,t)).targetId=s);var l={targetId:s,conversationType:a,unreadMessageCount:NE(c)||0,latestMessage:d||{},channelId:u||""};return a===Od.ULTRA_GROUP&&(l=n._getUltraGroupConversationInfo(l,e)),(null==o?void 0:o(l))||l})))||[]};return((null==t?void 0:t.conversationType)||Od.NONE)===Od.ULTRA_GROUP&&(s.isFinished=e.isFinished),s},t.prototype._formatSetUserSettingOutput=function(e){return e},t.prototype._formatChatRoomInfos=function(e){var t=e.userTotalNums,n=e.userInfos,r=DE(n,(function(e){var t=e.id,n=e.time;return{id:t,time:NE(n)}}));return{userCount:t,userInfos:r}},t.prototype._formatChatRoomKVList=function(e){var t=e.entries,n=e.bFullUpdate,r=e.syncTime;return t=DE(t=t||[],(function(e){var t=e.key,n=e.value,r=e.status,i=e.timestamp,o=e.uid,s=e.version,a=function(e){return{isAutoDelete:!!(1&e),isOverwrite:!!(2&e),type:4&e?qd.DELETE:qd.UPDATE}}(r);return{key:t,value:n,isAutoDelete:a.isAutoDelete,isOverwrite:a.isOverwrite,type:a.type,userId:o,timestamp:NE(i),version:NE(s)}})),{kvEntries:t,isFullUpdate:n,syncTime:r}},t.prototype._formatUserSetting=function(e){var t=this,n=e.items,r=e.version,i={};return PE(n||[],(function(e){var n=e.key,r=e.version,o=e.value;e.version=NE(r),e.value=t._readBytes(o),"Tag"===n&&e.tags.forEach((function(e){e.createdTime=NE(e.createdTime),e.tagName=e.name})),i[n]=e})),{settings:i,version:r}},t.prototype._formatConversationStatus=function(e){var t=e.state,n=[];return PE(t,(function(e){var t=e.type,r=e.channelId,i=e.time,o=e.stateItem,s=e.busChannel,a=wd.CLOSE,c=Pd.NOT_SET,u=!1,d=[];PE(o,(function(e){var t=e.sessionStateType,n=e.value,r=e.tags;switch(t){case mM:a=n===_M?wd.OPEN:wd.CLOSE,c=Number(n)||Pd.NOT_SET;break;case IM:u=n===_M;break;case TM:d=r}})),n.push({conversationType:t,type:t,targetId:r,notificationStatus:a,notificationLevel:c,isTop:u,updatedTime:NE(i),tags:d,channelId:s||""})})),n},t.prototype._formatGrpReadReceiptQryResp=function(e){var t=e.totalMemberNum,n=e.list;return n.forEach((function(e){e.readTime=NE(e.readTime)})),{totalMemberCount:t,list:n}},t.prototype._formatUserSettingNotification=function(e){return e},t.prototype._formatChrmKVVersion=function(e){return e},t.prototype._formatRTCJoinedUserInfo=function(e){return(e.info||[]).map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:NE(e.joinTime)}}))},t.prototype.encodeServerConfParams=function(){var e=this._codec.getModule(PU);return e.setNothing(1),e.getArrayData()},t.prototype._updateMentionedInfo=function(e,t,n){var r,i,o;return{userIdList:(null===(r=e.mentionedInfo)||void 0===r?void 0:r.userIdList)||t,type:(null===(i=e.mentionedInfo)||void 0===i?void 0:i.type)||n||Bd.ALL,mentionedContent:(null===(o=e.mentionedInfo)||void 0===o?void 0:o.mentionedContent)||""}},t.prototype._calculateFlag=function(e){var t=e.isFilerWhiteBlacklist,n=e.isVoipPush,r=e.pushConfig||{},i=0;return i|=n?1:0,i|=t?2:0,i|=r.disablePushTitle?4:0,i|=r.forceShowDetailContent?8:0},t.prototype._getPushExtraModule=function(e){var t=e.pushTitle,n=e.iOSConfig,r=e.androidConfig,i=e.templateId,o=void 0===i?"":i,s=this._codec.getModule(LU);if(t&&s.setTitle(t),n||r){var a=ME(n,r);s.setPushConfigs(a)}return(null==r?void 0:r.notificationId)&&s.setPushId(null==r?void 0:r.notificationId),s.setTemplateId(o),s},t.prototype._getUpMsgModule=function(e,t){var n=t.messageType,r=t.isMentioned,i=t.mentionedType,o=t.content,s=t.directionalUserIdList,a=t.canIncludeExpansion,c=t.expansion,u=t.pushConfig,d=t.channelId,l=t.pushData,h=void 0===l?"":l,f=t.mentionedUserIdList,g=void 0===f?[]:f,p=t.pushContent,v=void 0===p?"":p,_=t.messageId,E=void 0===_?0:_,m=this._codec.getModule(UU),I=function(e){var t=e.isStatusMessage,n=e.isPersited,r=e.isCounted;t&&(n=r=!1);var i=0;return n&&(i|=1),r&&(i|=2),e.isMentioned&&(i|=4),e.disableNotification&&(i|=32),e.canIncludeExpansion&&(i|=64),i}(t),T=u||{},y=T.pushContent,R=void 0===y?v:y,C=T.pushData,S=void 0===C?h:C;m.setSessionId(I),r&&o&&(o.mentionedInfo=this._updateMentionedInfo(o,g,i)),R&&m.setPushText(R),S&&m.setAppData(S),s&&m.setUserId(s);var O=this._calculateFlag(t);if(m.setConfigFlag(O),m.setClassname(n),o.user&&o.user.portraitUri&&(o.user.portrait=o.user.portraitUri),m.setContent(JSON.stringify(o)),a&&c){var N={};PE(c,(function(e,t){N[t]={v:e}})),m.setExtraContent(JSON.stringify(N))}if(u){var A=this._getPushExtraModule(u);
1m.setPushExt(A)}return m.setClientUniqueId(E),_l(d)||m.setBusChannel(d),m},t.prototype.encodeUpMsg=function(e,t){return this._getUpMsgModule(e,t).getArrayData()},t.prototype.encodeSyncMsg=function(e){var t=e.sendboxTime,n=e.inboxTime,r=e.broadcastSyncTime,i=this._codec.getModule(BU);return i.setIspolling(!1),i.setIsPullSend(!0),i.setSendBoxSyncTime(t),i.setSyncTime(n),i.setBroadcastSyncTime(r),i.getArrayData()},t.prototype.encodeChrmSyncMsg=function(e,t){e=e||0,t=t||0;var n=this._codec.getModule(VU);return n.setCount(t),n.setSyncTime(e),n.getArrayData()},t.prototype.encodeGetHistoryMsg=function(e,t){var n=t.count,r=t.order,i=t.timestamp,o=t.channelId,s=this._codec.getModule(xU);return s.setTargetId(e),s.setTime(i),s.setCount(n),s.setOrder(r),s.setBusChannel(o||""),s.getArrayData()},t.prototype.encodeSuperSyncMsg=function(e){var t=this._codec.getModule(qL);return t.setSyncTime(e),t.getArrayData()},t.prototype.encodeGetConversationList=function(e){var t=(e=e||{}).count,n=e.startTime,r=this._codec.getModule(FU);return r.setType(1),r.setCount(t),r.setStartTime(n),r.getArrayData()},t.prototype.encodeOldConversationList=function(e){var t=(e=e||{}).count,n=e.type,r=e.startTime,i=e.order;t=t||0,r=r||0,i=i||0;var o=this._codec.getModule(FU);return o.setType(n),o.setCount(t),o.setStartTime(r),o.setOrder(i),o.getArrayData()},t.prototype.encodeRemoveOldConversationList=function(e){var t=(e=e||{}).conversationType,n=e.channelId,r=this._codec.getModule(JU);return r.setType(t),n&&r.setBusChannel([n]),r.getArrayData()},t.prototype.encodeRemoveConversationList=function(e){var t=this,n=this._codec.getModule(KU),r=[];return PE(e,(function(e){var n=e.conversationType,i=e.targetId,o=t._codec.getModule(jU);o.setType(n),o.setChannelId(i),r.push(o)})),n.setSessions(r),n.getArrayData()},t.prototype.encodeDeleteMessages=function(e,t,n,r){var i=this._codec.getModule(QU),o=[];return PE(n,(function(e){o.push({msgId:e.messageUId,msgDataTime:e.sentTime,direct:e.messageDirection})})),i.setType(e),i.setConversationId(t),i.setMsgs(o),i.setBusChannel(r),i.getArrayData()},t.prototype.encodeClearMessages=function(e,t,n,r){var i=this._codec.getModule(WU);return t=t||(new Date).getTime(),i.setDataTime(t),i.setTargetId(e),i.setBusChannel(n),i.setConversationType(r),i.getArrayData()},t.prototype.encodeClearUnreadCount=function(e,t){var n=e.conversationType,r=e.targetId,i=e.channelId,o=t.timestamp,s=this._codec.getModule(zU);return o=o||+new Date,s.setType(n),s.setChannelId(r),s.setMsgTime(o),s.setBusChannel(i),s.getArrayData()},t.prototype.encodeExpandUltraMessage=function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.keys,c={mid:o,put:e.expansion,del:a,clear:e.removeAll?1:0},u=this._codec.getModule(KL);return u.setFromUserId(t),u.setTargetId(n),u.setType(r),u.setBusChannel(i||""),u.setMsgUID(o),u.setMsgTime(s),u.setContent(JSON.stringify(c)),u.getArrayData()},t.prototype.encodemodifyMessage=function(e,t){var n=e.targetId,r=e.conversationType,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.content,c=this._codec.getModule(KL);return c.setFromUserId(t),c.setTargetId(n),c.setType(r),c.setBusChannel(i||""),c.setMsgUID(o),c.setMsgTime(s),c.setContent(JSON.stringify(a)),c.getArrayData()},t.prototype.encodeQueryMsgChange=function(e){var t=this._codec.getModule(jL);return t.setSyncTime(e),t.getArrayData()},t.prototype.encodeMsgQuery=function(e){var t=e.targetId,n=e.conversationType,r=e.messages,i=this._codec.getModule(QL),o=r.map((function(e){return{msgTime:e.sendTime,msgUID:e.messageUId,busChannel:e.channelId}}));return i.setTargetId(t),i.setType(n),i.setQuery(o),i.getArrayData()},t.prototype.encodeUnreadMentionedMsgQuery=function(e){var t=e.targetId,n=e.channelId,r=e.sentTime,i=e.count,o=this._codec.getModule(ML);return o.setGroupId(t),o.setBusChannel(n),o.setMsgTime(r),o.setSize(i),o.getArrayData()},t.prototype.encodeOperateStatus=function(e,t,n,r){var i=this._codec.getModule(ZL);return i.setTargetId(e),i.setType(t),i.setBusChannel(n),i.setOpType(r),i.getArrayData()},t.prototype.encodeJoinOrQuitChatRoom=function(){var e=this._codec.getModule(ZU);return e.setNothing(1),e.getArrayData()},t.prototype.encodeGetChatRoomInfo=function(e,t){var n=this._codec.getModule($U);return n.setCount(e),n.setOrder(t),n.getArrayData()},t.prototype.encodeSetUltraGroupDefaultNotificationLevel=function(e,t){var n=this._codec.getModule(AL);return n.setUnpushLevel(e),n.setBusChannel(t),n.getArrayData()},t.prototype.encodeGetUltraGroupDefaultNotificationLevel=function(e){var t=this._codec.getModule(NL);return t.setBusChannel(e),t.getArrayData()},t.prototype.encodeGetFileToken=function(e,t,n,r){var i=this._codec.getModule(tL);return i.setType(e),i.setKey(t),i.setHttpMethod(n),i.setQueryString(r),i.getArrayData()},t.prototype.encodeGetFileUrl=function(e,t,n,r){var i=this._codec.getModule(e);return i.setType(t),i.setKey(n),r&&i.setFileName(r),i.getArrayData()},t.prototype.encodeModifyChatRoomKV=function(e,t,n){var r=this._codec.getModule(cL),i=t.key,o=t.value,s=t.notificationExtra,a=t.isSendNotification,c=t.type,u=t.timestamp,d=c||qd.UPDATE,l=qE(t,d),h={key:i,value:o||"",uid:n,version:u};if(_l(l)||(h.status=l),r.setEntry(h),a){var f={conversationType:Od.CHATROOM,targetId:e},g={key:i,value:o,extra:s,type:d},p=this._getUpMsgModule(f,{messageType:Ud.CHRM_KV_NOTIFY,content:g,isPersited:!1,isCounted:!1});
1r.setNotification(p),r.setBNotify(!0),r.setType(Od.CHATROOM)}return r.getArrayData()},t.prototype.encodeModifyChatRoomKVS=function(e,t,n){var r=this._codec.getModule(uL),i=t.entries,o=t.type||qd.UPDATE,s=qE(t,o),a=[];return i.forEach((function(e){var t={key:e.key,value:e.value||"",uid:n,version:e.timestamp};_l(s)||(t.status=s),a.push(t)})),r.setEntry(a),r.getArrayData()},t.prototype.encodePullChatRoomKV=function(e){var t=this._codec.getModule(pL);return t.setTimestamp(e),t.getArrayData()},t.prototype.encodePullUserSetting=function(e){var t=this._codec.getModule(EL);return t.setVersion(e),t.getArrayData()},t.prototype.encodeGetConversationStatus=function(e){var t=this._codec.getModule(TL);return t.setTime(e),t.getArrayData()},t.prototype.encodeSetConversationStatus=function(e,t){var n=this,r=this._codec.getModule(SL),i=HE.getTime(),o=[];return PE(e,(function(e){var t=n._codec.getModule(RL),r=e.conversationType,s=e.targetId,a=e.notificationStatus,c=e.isTop,u=e.channelId,d=e.notificationLevel,l=[];t.setType(r),t.setChannelId(s),t.setTime(i),t.setBusChannel(u);var h=a===wd.OPEN,f={};_l(a)||(f[mM]=h),_l(d)||(f[mM]=d),_l(c)||(f[IM]=c),PE(f,(function(e,t){if(!_l(e)){var r=n._codec.getModule(CL);e=e?_M:EM,_l(d)||Number(t)!==mM||(e=String(d)),r.setSessionStateType(Number(t)),r.setValue(e),l.push(r)}})),t.setStateItem(l),o.push(t)})),r.setVersion(t||i),r.setState(o),r.getArrayData()},t.prototype.encodeReadReceipt=function(e,t){var n=this._codec.getModule(wL);return n.setMsgId(e),t&&n.setChannelId(t),n.getArrayData()},t.prototype.encodeCreateTag=function(e,t){var n=this,r=this._codec.getModule(BL),i=[];return e.forEach((function(e){var t=n._codec.getModule(VL);t.setTagId(e.tagId),t.setName(e.tagName),i.push(t)})),r.setTags(i),r.setVersion(t),r.getArrayData()},t.prototype.encodeMessageReader=function(e,t){var n=this._codec.getModule(wL);return n.setMsgId(e),t&&n.setChannelId(t),n.getArrayData()},t.prototype.encodeRemoveTag=function(e,t){var n=this,r=this._codec.getModule(GL),i=[];return e.forEach((function(e){var t=n._codec.getModule(VL);t.setTagId(e),i.push(t)})),r.setTags(i),r.setVersion(t),r.getArrayData()},t.prototype.encodeDisConversationTag=function(e){var t=this._codec.getModule(xL);return t.setTagId(e),t.getArrayData()},t.prototype.encodeUpdateConversationTag=function(e,t){var n=this,r=this._codec.getModule(SL),i=[];return t.forEach((function(t){var r=n._codec.getModule(RL),o=n._codec.getModule(CL),s=[];e.forEach((function(e){var t=n._codec.getModule(VL);t.setTagId(e.tagId),_l(e.isTop)||t.setIsTop(e.isTop),s.push(t)})),o.setSessionStateType(TM),o.setValue(JSON.stringify(s)),o.setTags(s),r.setType(t.conversationType),r.setChannelId(t.targetId),r.setTime(Date.now()),r.setStateItem([o]),i.push(r)})),r.setState(i),r.setVersion(HE.getTime()),r.getArrayData()},t.prototype.encodeReportSDKInfo=function(e){var t=this._codec.getModule(kL);return t.setSdkInfo(e),t.getArrayData()},t.prototype.encodeUltraGroup=function(e,t){var n=this._codec.getModule(HL);return n.setSyncTime(e),n.setIsEraseMsgContent(t),n.getArrayData()},t.prototype.encodebindRTCRoomForChatroom=function(e){var t=this._codec.getModule(tw);return t.setRtcRoomId(e.rtcRoomId),t.getArrayData()},t}(),Xw=function(e){function t(t,n,r,i,o){var s=e.call(this,t,n,r,o)||this;return s.runtime=i,s.wsListener=o,s._socket=null,s._connectedTime=0,s._socketIndex=0,s._localConnectedTime=0,s._idCount=0,s._generateMessageId=function(){return s._idCount>=65535&&(s._idCount=0),++s._idCount},s._messageIds={},s._syncMessageIds={},s.codec=new Zw(s.logger),s}return ac(t,e),t.prototype.getConnectedTime=function(){return this._connectedTime},t.prototype.getLocalConnectedTime=function(){return this._localConnectedTime},t.prototype.getCrtServerTime=function(){return Date.now()-this._localConnectedTime+this._connectedTime},t.prototype.connectWithToken=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var n,i,o,s,a,c,u,d,l,h,f,g,p,v;return dc(this,(function(_){switch(_.label){case 0:if(n=[],i=t.server,o=t.backupServer,s=t.protocol,a=t.openAnti,i?n.push(i):this.logger.warn(Fd.L_NAVI_CONF_E,"`navi.server` invalid",r),null==o||o.split(",").forEach((function(e){n.indexOf(e)<0&&n.push(e)})),0===n.length)return this.logger.error(Fd.L_NAVI_CONF_E,"no service available",r),[2,{code:Cd.SERVER_UNAVAILABLE}];c=s.replace("http","ws"),u=1===a?YA.V4:YA.V3,d=0,_.label=1;case 1:return d<n.length?(l=n[d],h=function(e,t,n,r,i,o,s){var a=qw(i),c=a.type,u=a.version,d="browser"===i.tag?"|".concat(c,"|").concat(u):"||",l=s?"&protocolVer=".concat(s):"";return"".concat(e,"://").concat(t,"/websocket?appId=").concat(n,"&token=").concat(encodeURIComponent(r),"&sdkVer=").concat(nc,"&pid=").concat(o,"&apiVer=").concat(i.isFromUniapp?"uniapp":i.tag+encodeURIComponent(d)).concat(i.connectPlatform?"&platform=".concat(i.connectPlatform):"").concat(l)}(c,l,this.appkey,e,this.runtime,"",u),f=Date.now(),[4,this.connectWebSocket(h,u,r)]):[3,4];case 2:return g=_.sent(),p=g.code,v=g.data,p===Cd.RC_SOCKET_DISCONNECTED||p===Cd.TIMEOUT?[3,3]:p!==Cd.SUCCESS?[2,{code:p}]:(this._localConnectedTime=Math.floor((Date.now()+f)/2),this._socket=v.socket,[2,{code:p,data:v.userId}]);case 3:return d+=1,[3,1];case 4:return[2,{code:Cd.SERVER_UNAVAILABLE}]}}))}))},t.prototype.connectWebSocket=function(e,t,n){return uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return this.logger.info(Fd.T,"connect start: ".concat(e),n),[2,new Promise((function(i){var o=r.runtime.createWebSocket(e);r._socketIndex=o.id;var s=setTimeout((function(){r.logger.info(Fd.T,"connect timeout: ".concat(e),n),i({code:Cd.TIMEOUT}),o&&o.close()}),5e3);o.onOpen((function(){!function(e){clearTimeout(e)}(s),r.logger.info(Fd.T,"socket open",n)}
1)),o.onMessage((function(e){if(r._socketIndex===o.id){if("[object ArrayBuffer]"===Object.prototype.toString.call(e)){var s,a=KM(r.logger,e,t);if(a instanceof LM){var c=a.status;if(c!==Cw.ACCEPTED)return r.logger.info(Fd.T,"connect failed: ".concat(c),n),void i({code:(s=c,Qw[s])});r.logger.info(Fd.T,"connect success",n);var u=a.timestamp,d=a.userId,l=a.messageId;return r._connectedTime=u,r._idCount=l,void i({code:Cd.SUCCESS,data:{userId:d,socket:o}})}if(a instanceof wM){var h=a.status;return r.logger.info(Fd.T,"recv disconnect signal -> status: ".concat(h)),void r.onRecvDisconnect(h,o)}if(a instanceof PM&&r._pingResolve)return r._pingResolve(Cd.SUCCESS),void(r._pingResolve=void 0);r._onReceiveSignal(a)}}else r.logger.warn(Fd.L_WEBSOCKET_DISACCORD_E,JSON.stringify({msg:"WebSocket id disaccord",_socketIndex:r._socketIndex,curSocketId:o.id}))})),o.onClose((function(){r.logger.info(Fd.T,"socket close",n);var e=Cd.RC_SOCKET_DISCONNECTED;i({code:e}),r.onSocketEnd(o,e)})),o.onError((function(e){r.logger.info(Fd.T,"socket error",n);var t=Cd.RC_SOCKET_DISCONNECTED;i({code:t}),r.onSocketEnd(o,t)}))}))]}))}))},t.prototype._qosNeedAck=function(e,t){e.header&&e.header.qos!==qA.AT_MOST_ONCE&&(e instanceof VM&&!e.syncMsg&&(this.logger.debug(Fd.O,"send pubAck -> ".concat(t," ").concat(e.topic)),this.sendOnly(new kM(t))),e instanceof qM&&(this.logger.debug(Fd.O,"send queryCon -> ".concat(t," ").concat(e.topic)),this.sendOnly(new HM(t))))},t.prototype._publishReader=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o=this;return dc(this,(function(s){switch(s.label){case 0:return n=e.syncMsg,r=e.topic,this.logger.debug(Fd.O,"recv PublishReader -> messageId: ".concat(t," ").concat(r)),r===vI?[2]:!n||function(e){return[jM.ppMsgS,jM.pgMsgS,jM.chatMsgS].map((function(e){return jM[e]})).indexOf(e)>=0}(r)?(this.wsListener.signal(e),[2]):[4,new Promise((function(e){o._syncMessageIds[t]=e}))];case 1:return i=s.sent(),delete this._syncMessageIds[t],this.wsListener.signal(e,i),[2]}}))}))},t.prototype._onReceiveSignal=function(e){return uc(this,void 0,void 0,(function(){var t,n,r;return dc(this,(function(i){switch(i.label){case 0:return t=e.messageId,this._qosNeedAck(e,t),t>0&&(e instanceof xM||e instanceof qM)&&(this.logger.debug(Fd.O,"recv ack -> messageId: ".concat(t," ").concat(e.topic)),(n=this._messageIds[t])&&(n(e),delete this._messageIds[t]),(r=this._syncMessageIds[t])&&(delete this._syncMessageIds[t],r(e))),e instanceof VM?[4,this._publishReader(e,t)]:[3,2];case 1:i.sent(),i.label=2;case 2:return[2]}}
1))}))},t.prototype.onRecvDisconnect=function(e,t){this._socket&&this._socket===t&&(this._socket=null,this.clearResolves(),this.onDisconnectByServer(function(e){return Jw[e]}(e)))},t.prototype.onSocketEnd=function(e,t){this._socket&&this._socket===e&&(this._socket=null,this.clearResolves(),this.onDisconenctUnusual(t))},t.prototype.clearResolves=function(){for(var e in this._messageIds){var t=this._messageIds[e];delete this._messageIds[e],t(Cd.RC_SOCKET_DISCONNECTED)}},t.prototype.sendPing=function(e){var t=this;return new Promise((function(n){t._pingResolve=n,setTimeout((function(){return n(Cd.TIMEOUT)}),e),t.sendOnly(new bM)}))},t.prototype.sendOnly=function(e){this._socket&&((e instanceof GM||e instanceof FM)&&(e.messageId=this._generateMessageId()),this._socket.send(e.getBufferData().buffer))},t.prototype.send=function(e,t,n,r){return void 0===r&&(r=3e4),uc(this,void 0,void 0,(function(){var i,o,s,a,c=this;return dc(this,(function(u){switch(u.label){case 0:return this._socket?(i=this._generateMessageId(),e.messageId=i,this._socket.send(e.getBufferData().buffer),[4,new Promise((function(e){c._messageIds[i]=e,setTimeout((function(){c._messageIds[i]&&delete c._messageIds[i],e()}),r)}))]):[2,{code:Cd.RC_NET_CHANNEL_INVALID}];case 1:return(o=u.sent())?o instanceof qM||o instanceof xM?(s=t&&o.data&&[Cd.SUCCESS,Cd.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(o.status)>=0,a=s?this.codec.decodeByPBName(o.data,t,n):o,0!==o.status?(this.logger.warn(Fd.O,"send failed -> message: ".concat(i,", respPBName: ").concat(t,", status: ").concat(o.status)),[2,{code:o.status,data:t&&o.data?a:null}]):[2,{code:Cd.SUCCESS,data:a}]):[2,{code:o}]:(this.logger.warn(Fd.O,"send timeout -> message: ".concat(i,", respPBName: ").concat(t,", timeout: ").concat(r)),[2,{code:Cd.TIMEOUT}])}}))}))},t.prototype.close=function(e){this._socket&&(this._socket.close(),this._socket=null),this.clearResolves()},t}(zw),$w=function(t,n,r,i,o,s,a){return{conversationType:t,targetId:n,senderUserId:s,messageDirection:yd.SEND,isCounted:!!r.isCounted,isMentioned:!!r.isMentioned,content:r.content,messageType:r.messageType,isOffLineMessage:!1,isPersited:!!r.isPersited,messageUId:i,sentTime:o,receivedTime:0,disableNotification:!!r.disableNotification,isStatusMessage:!!r.isStatusMessage,canIncludeExpansion:!!r.canIncludeExpansion,expansion:r.canIncludeExpansion?r.expansion:null,receivedStatus:oi.UNREAD,pushConfig:r.pushConfig,channelId:r.channelId,isInterrupt:r.isInterrupt,messageId:a||0,sentStatus:e.SentStatus.SENT}},eb=function(e){return e.sort((function(e,t){var n,r,i=(null===(n=e.latestMessage)||void 0===n?void 0:n.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-i})),e},tb=function(t){function n(e,n,r,i){var o=t.call(this,e,n,r,i,new ww(i.appkey,"RC-E","IM"))||this;o._customMessageType={},o._reconnectTimer=-1,o._pullOfflineFinished=!1,o.currentUserId="",o._pullingMsg=!1,o._pullQueue=[],o._chrmsQueue={},o._latestSyncTimestamp=0,o._intervalTimer=-1,o._intervalTimerForChrmPull=-1,o._lastSyncUltraMsgTimeStamp=0,o._lastSyncUltraMsgLocalTimeStamp=0,o._ultraGroupTimer=-1,o._isUltraPulling=!1,o._ultraGroupTimeQue=[],o._isUltraGroupListExist=!1,o._ultraGroupMap={},o._ultraMsgMap={},o._pullUltraChangeMessageQue=[],o._isPullingUltraChangeMessage=!1,o._lastPullingUltraChangeMessageTime=0;var s=i.appkey,a=i.logOutputLevel,c=i.logExpireTime,u=i.miniCMPProxy,d=i.navigators;return o.logger.setOutputLevel(a),_w(s,o.logger,c),o.reporter=new jw(s,o.runtime,o.logger,o._options.__reportLogLevel),o.navi=new EU(s,o.logger,e,u.join(","),d),o._letterbox=new zM(e,s),o._sendMessageStore=new IU(e,s),o._chrmEntryHandler=new $M(o),o._connMgr=new Xw(s,o.navi,o.logger,o.runtime,{signal:o._signalHandler.bind(o),onConnected:o.onConnected.bind(o),onDisconnected:o.onDisconnected.bind(o),onConnecting:o._watcher.onConnecting,onSuspend:o._watcher.onSuspend}),o}return ac(n,t),n.prototype.onConnected=function(){var e=this.navi.getNaviInfoFromCache(this._connMgr.getToken()),t=this._connMgr.getCurrentUserId();this.currentUserId=t,this._pullOfflineFinished=!1,this._joinedChrmManager||(this._joinedChrmManager=new eU(this.runtime,this._appkey,this.currentUserId,e.joinMChrm,this.logger)),this._conversationManager||(this._conversationManager=new hU(this,this._appkey,this.currentUserId,this._watcher.conversation,this._watcher.conversationTag)),this._ultraGroupManager||(this._ultraGroupManager=new MU(this,this._appkey,this.currentUserId)),this._userSettingManager||(this._userSettingManager=new fU(this,this._appkey,this.currentUserId,this._watcher.tag)),this._watcher.onConnected(),this._conversationManager.startPullConversationStatus(0),this._conversationManager.adaptOldStore(),this._userSettingManager.pullUserSettings(0),this._sendMessageStore.init(this.currentUserId),this._rejoinChrm(),this._startSyncInterval(),1===e.ugMsg&&this._notificationOnline(),this.reporter.checkStart(e)},n.prototype.onDisconnected=function(e){this._resetMemoryState(),this._watcher.onDisconnected(e)},n.prototype.createLogger=function(e,t){return new ww(this._appkey,e,t)},n.prototype.refetchNaviInfo=function(){return this.navi.request(this._connMgr.getToken(),!0,!0,this.logger.createTraceId())}
1,n.prototype.getNaviInfoFromCache=function(){return this.navi.getNaviInfoFromCache(this._connMgr.getToken())},n.prototype.getConnectedTime=function(){return this._connMgr.getConnectedTime()},n.prototype.getConnectionStatus=function(){return this._connMgr.getConnectionStatus()},n.prototype.connect=function(e,t,n){return uc(this,void 0,void 0,(function(){return dc(this,(function(r){return[2,this._connMgr.connect(e,t,n)]}))}))},n.prototype._signalHandler=function(e,t){var n=e.syncMsg,r=e.topic;if(n)this._receiveSyncMsg(e,t);else{var i=this.logger.createTraceId();this.logger.debug(Fd.L_RECV_RMTP_O,r,i);var o=jM[r];if(o)switch(o){case jM.s_ntf:this._pullMsg(e);break;case jM.s_msg:this._receiveMsg(e);break;case jM.s_cmd:this._receiveStateNotify(e);break;case jM.s_us:this._receiveSettingNotify(e);break;case jM.rtc_ntf:this._receiveRtcKv(e.data);break;case jM.s_opNtf:this._pullOperateStatusNotify(e)}else this.logger.error(Fd.L_RECV_RMTP_E,r,i)}},n.prototype._receiveStateNotify=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,GU),n=t.time,r=t.type,i=t.chrmId;switch(r){case 2:this._chrmEntryHandler.pullEntry(i,n);break;case 3:this._conversationManager.startPullConversationStatus(n);break;case 4:this._chrmEntryHandler.reset(i),this._watcher.chatroom({chatroomDestroyed:e.targetId});break;case 6:this._ultraGroupTimeQue.push(n),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp);break;case 7:this._pullUltraChangeMessageQue.push(n),this._pullUltraChangeMessageList(this._lastPullingUltraChangeMessageTime)}},n.prototype._receiveSettingNotify=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,IL).version;this._userSettingManager.pullUserSettings(t)},n.prototype._receiveMessageExpansion=function(e){var t=e.content,n=t.put,r=t.del,i=t.mid;n&&this._watcher.expansion({updatedExpansion:{messageUId:i,expansion:n}}),r&&this._watcher.expansion({deletedExpansion:{messageUId:i,deletedKeys:r}})},n.prototype._clearUltraGroupUnreadCount=function(e,t){var n=this._connMgr.codec.decodeByPBName(e.data,zU),r=n.channelId,i=n.busChannel,o=n.msgTime,s=this._ultraGroupMap["".concat(i,"_").concat(r)];s&&(s.unreadMessageCount=0,s.unreadMentionedCount=0,s.firstUnreadMessage&&(s.firstUnreadMessage=null),s.lastReadTime=o,this._watcher.conversation(FE([s]))),t&&(this._ultraMsgMap[t.messageUId]=t.timestamp)},n.prototype._receiveSyncMsg=function(e,t){if(yU.includes(e.topic))if(e.topic!==jM[jM.updUgRTime]){var n=this._connMgr.codec.decodeByPBName(e.data,UU,{currentUserId:this.currentUserId,signal:e});((n=this._handleMsgProperties(n)).conversationType!==Od.CHATROOM||this._chrmsQueue[n.targetId])&&(this._pullingMsg?this._pullQueue.push((null==t?void 0:t.timestamp)||n.sentTime):(t&&(n.sentTime=t.timestamp,n.messageUId=t.messageUId,this._sendMessageStore.setMessage(t.messageUId,t.timestamp)),this.logger.info(Fd.L_RECV_MULTI_SYNC_MSG_O,JSON.stringify({messageUId:n.messageUId,messgeId:n.messageId,sentTime:n.sentTime})),n.messageType!==Ud.EXPANSION_NOTIFY?((n.messageType===Ud.SYNC_READ_STATUS||n.messageType===Ud.READ_RECEIPT&&n.senderUserId===this.currentUserId)&&this._conversationManager.clearUnreadCount(n.conversationType,n.targetId,n.channelId),this._conversationManager.setConversationCacheByMessage(n,!0),this._batchMessage([n])):this._receiveMessageExpansion(n)))}else this._clearUltraGroupUnreadCount(e,t)},n.prototype._batchMessage=function(e){for(var t=this,n=[],r=[],i=e.length-1;i>=0;i-=1){var o=e[i];o.messageType!==Ud.LOG_COMMAND||"rongcloudsystem"!==o.senderUserId?n.unshift(o):r.unshift(o)}this._watcher.batchMessage(n),0!==r.length&&r.forEach((function(e){var n=e.content,r=n.startTime,i=n.endTime,o=n.platform,s=n.logId,a=n.uri;t.reporter.report(parseInt(r,10),parseInt(i,10),o,a,s,e.messageUId)}))},n.prototype._pullMsg=function(e){var t=this._connMgr.codec.decodeByPBName(e.data,GU),n=t.type,r=t.chrmId,i=t.time;if(this.logger.info(Fd.L_RECV_S_NTF_O,"type: ".concat(n,", chrmId: ").concat(n,", time: ").concat(i)),2===n){var o=this._chrmsQueue[r];if(!o)return;o.queue.push(i),this._pullChrmMsg(r)}
1else this._pullQueue.push(i),this._syncMsg()},n.prototype._startSyncInterval=function(){var e=this;this._stopSyncInterval();this._intervalTimer=setInterval((function(){Date.now()-e._latestSyncTimestamp>=18e4&&e._syncMsg()}),3e4),this._latestSyncTimestamp=Date.now(),this._syncMsg()},n.prototype._stopSyncInterval=function(){-1!==this._intervalTimer&&(clearInterval(this._intervalTimer),this._intervalTimer=-1)},Object.defineProperty(n.prototype,"_isConnected",{get:function(){return this._connMgr.getConnectionStatus()===e.RCConnectionStatus.CONNECTED},enumerable:!1,configurable:!0}),n.prototype._messageProcessor=function(e){var t=this,n=0,r=[],i=[];return e.forEach((function(e){if((r.push(e.messageUId),e.messageDirection===yd.SEND)&&(n=Math.max(e.sentTime,n),t._sendMessageStore.getSendMessageMap()[e.messageUId]))return void t._sendMessageStore.removeByUID(e.messageUId);if(e.messageType!==Ud.DELIVERED&&e.messageType!==Ud.DELIVERED_MSG)if(e.messageType!==Ud.EXPANSION_NOTIFY){if(e.messageType===Ud.SYNC_READ_STATUS){if(e.senderUserId!==t.currentUserId)return;t._conversationManager.clearUnreadCount(e.conversationType,e.targetId,e.channelId)}var o=t._handleMsgProperties(e);t._conversationManager.setConversationCacheByMessage(o,!0),i.push(o)}else t._receiveMessageExpansion(e)})),{newOutboxTime:n,messageUIds:r,messages:i}},n.prototype._syncMsg=function(){return uc(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,c,u,d,l,h,f,g,p,v,_,E,m;return dc(this,(function(I){switch(I.label){case 0:return this._pullingMsg?[2]:this._isConnected?(this._pullingMsg=!0,e=this._letterbox.getOutboxTime(this.currentUserId),t=this._letterbox.getInboxTime(this.currentUserId),n=this._letterbox.getBroadcastSyncTime(this.currentUserId),r=this._connMgr.codec.encodeSyncMsg({sendboxTime:e,inboxTime:t,broadcastSyncTime:n}),i=new FM(jM[jM.pullMsg],r,this.currentUserId),o=this.logger.createTraceId(),this.logger.info(Fd.L_PULL_MSG_T,JSON.stringify({outboxTime:e,inboxTime:t,broadcastSyncTime:n}),o),[4,this._connMgr.send(i,bU,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):(this._pullingMsg=!1,[2]);case 1:return s=I.sent(),a=s.code,c=s.data,this._latestSyncTimestamp=Date.now(),a!==Cd.SUCCESS||!c||_l(c.finished)||_l(c.list)||_l(c.syncTime)?(this.logger.warn(Fd.L_PULL_MSG_R,JSON.stringify({code:a,timestamp:this._latestSyncTimestamp}),o),this._pullingMsg=!1,[2]):(u=c.list,d=c.finished,l=c.syncTime,h=c.broadcastSyncTime,f=void 0===h?1:h,this.logger.info(Fd.L_PULL_MSG_R,JSON.stringify({syncTime:l,finished:d,messages:u.map((function(e){return{messageUId:e.messageUId,messageId:e.messageId,sentTime:e.sentTime}}))}),o),g=this._messageProcessor(u),p=g.newOutboxTime,v=g.messageUIds,_=g.messages,this._batchMessage(_),this._letterbox.setInboxTime(l,this.currentUserId),this._letterbox.setOutboxTime(p,this.currentUserId),this._letterbox.setBroadcastSyncTime(f,this.currentUserId),this._sendMessageStore.removeByTimestamp(p),this._pullingMsg=!1,E=this._pullQueue.filter((function(e){return e>l})),this._pullQueue.length=0,(m=this._pullQueue).push.apply(m,E),d&&!this._pullOfflineFinished&&(this._pullOfflineFinished=!0,this._watcher.pullFinished()),this.logger.info(Fd.L_PULL_MSG_R,JSON.stringify({code:a,messageUIds:v.join(","),timestamp:this._latestSyncTimestamp,hasmore:!d,tmpPullQueue:E}),o),d?(this._pullQueue.length>
10&&(this._pullQueue.length=0,this._syncMsg()),[2]):(this._syncMsg(),[2]))}}))}))},n.prototype._receiveMsg=function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.data,wU,{currentUserId:this.currentUserId,connectedTime:this._connMgr.getConnectedTime()});if(t=this._handleMsgProperties(t),this.logger.info(Fd.L_RECV_S_MSG_O,JSON.stringify({messageUId:t.messageUId,messgeId:t.messageId,sentTime:t.sentTime})),t.messageType!==Ud.DELIVERED&&t.messageType!==Ud.DELIVERED_MSG){if(t.conversationType!==Od.RTC_ROOM){if(this._pullingMsg)return;if(this._pullQueue.length>0)return void this._syncMsg()}t.senderUserId===this.currentUserId&&this._sendMessageStore.setMessage(t.messageUId,t.sentTime),t.isStatusMessage||t.senderUserId===this.currentUserId||this._letterbox.setInboxTime(t.sentTime,this.currentUserId),t.messageType!==Ud.EXPANSION_NOTIFY?t.messageType===Ud.SYNC_READ_STATUS&&t.senderUserId!==this.currentUserId||(this._conversationManager.setConversationCacheByMessage(t,!0),this._batchMessage([t])):this._receiveMessageExpansion(t)}}},n.prototype._handleMsgProperties=function(e,t){void 0===t&&(t=!1);var n,r=e.messageType,i=e.isStatusMessage,o=e.isCounted,s=void 0!==o&&o,a=e.isPersited,c=void 0!==a&&a,u=r in Xa,d=r in this._customMessageType;if(n=u?cc(cc({},Xa[r]),{isStatusMessage:$a.includes(r)}):d?this._customMessageType[r]:{isCounted:s,isPersited:c,isStatusMessage:!1},Object.assign(e,n),t&&!_l(i)&&(e.isStatusMessage=i),!t){var l=e.content.user;if(l){var h=l.portrait,f=l.portraitUri,g=h||f;g&&(l.portrait=l.portraitUri=g)}}return e},n.prototype._fixDownstreamData=function(e,t,n){return e&&2===t.list.length&&(t.hasMore=!0,0===n?t.list.shift():t.list.pop()),t},n.prototype.getHistoryMessage=function(e,t,n,r,i,o,s,a){var c;return void 0===o&&(o=""),uc(this,void 0,void 0,(function(){var s,u,d,l,h,f,g,p,v,_;return dc(this,(function(E){switch(E.label){case 0:return u=(s=this).currentUserId,d=s._connMgr,l=pM[e]||uM,h=1===r&&0===n,d?(f=d.codec.encodeGetHistoryMsg(t,{timestamp:n,count:h?2:r,order:i,channelId:o}),this.logger.info(Fd.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:t,conversationType:e,channelId:o,timestamp:n,count:r,order:i}),a),[4,d.send(new FM(l,f,u),kU,{currentUserId:u,connectedTime:d.getConnectedTime(),conversation:{targetId:t}})]):[3,2];case 1:return g=E.sent(),(p=g.code)===Cd.SUCCESS&&f?(v=g.data,v=this._fixDownstreamData(h,v,i),_=[],null===(c=v.list)||void 0===c||c.forEach((function(e){e&&_.push(e.messageUId)})),this.logger.info(Fd.L_GET_HISTORY_MSG_R,JSON.stringify({code:p,messageUIds:_.join(",")}),a),[2,{code:p,data:{list:v.list,hasMore:v.hasMore}}]):(this.logger.warn(Fd.L_GET_HISTORY_MSG_R,JSON.stringify({code:p,messageUIds:""}),a),[2,{code:p}]);case 2:return[2,{code:Cd.RC_NET_CHANNEL_INVALID}]}}))}))},n.prototype.reportSDKInfo=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,i=this.logger.createTraceId(),o=JSON.stringify(e),this.logger.debug(Fd.L_VER_REPORT_T,o,i),s=r.codec.encodeReportSDKInfo(o),a=new FM(jM[jM.reportsdk],s,n),[4,r.send(a)]):[2];case 1:return(c=u.sent().code)!==Cd.SUCCESS&&this.logger.warn(Fd.L_VER_REPORT_R,c,i),[2]}}))}))},n.prototype.deleteRemoteMessage=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s,a,c,u;return dc(this,(function(d){switch(d.label){case 0:return this._isConnected?(o=(i=this).currentUserId,s=i._connMgr,a=s.codec.encodeDeleteMessages(e,t,n,r),c=new FM(ZA,a,o),[4,s.send(c)]):[2,Cd.RC_NET_UNAVAILABLE];case 1:return u=d.sent(),[2,u.code]}}))}))},n.prototype.deleteRemoteMessageByTimestamp=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return this._isConnected?(o=(i=this).currentUserId,s=i._connMgr,a=s.codec.encodeClearMessages(t,n,r,e),c=vM[e],u=new FM(c,a,o),[4,s.send(u)]):[2,Cd.RC_NET_UNAVAILABLE];case 1:return d=l.sent(),[2,d.code]}}))}))},n.prototype.getConversationList=function(e,t,n,r,i){return void 0===e&&(e=300),uc(this,void 0,void 0,(function(){var i,o,s,a,c,u,d,l,h=this;return dc(this,(function(f){switch(f.label){case 0:return this._isConnected?(o=(i=this).currentUserId,s=i._connMgr,t=t||Od.PRIVATE,a=s.co
1dec.encodeOldConversationList({count:e,type:t,startTime:n,order:r}),c=new FM(oM,a,o),[4,s.send(c,HU,{currentUserId:o,connectedTime:s.getConnectedTime(),afterDecode:function(e){var t=e.conversationType,n=e.targetId,r=e.channelId,i=h._conversationManager.get(t,n,r);return Object.assign(e,i),e}})]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return u=f.sent(),d=u.code,l=u.data,d!==Cd.SUCCESS?[2,{code:d}]:[2,{code:d,data:null==l?void 0:l.list}]}}))}))},n.prototype.removeConversation=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return this._isConnected?(r=this._connMgr,i=r.codec.encodeRemoveOldConversationList({conversationType:e,channelId:n,targetId:t}),o=new FM(sM,i,t),[4,r.send(o)]):[2,Cd.RC_NET_UNAVAILABLE];case 1:return s=a.sent(),[2,s.code]}}))}))},n.prototype.getConversation=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return e!==Od.ULTRA_GROUP?[3,1]:(r=this._ultraGroupMap["".concat(n,"_").concat(t)])?[3,3]:[2,{code:Cd.CONVER_GET_ERROR}];case 1:return(i=this._conversationManager.get(e,t,n))?[4,this.getHistoryMessage(e,t,0,1,0)]:[2,{code:Cd.CONVER_GET_ERROR}];case 2:if(o=u.sent(),s=o.code,a=o.data,s!==Cd.SUCCESS)return[2,{code:Cd.CONVER_GET_ERROR}];c=(null==a?void 0:a.list[0])||null,r={conversationType:e,targetId:t,channelId:n,unreadMessageCount:i.unreadMessageCount||0,latestMessage:c,notificationStatus:i.notificationStatus||wd.CLOSE,notificationLevel:i.notificationLevel||Pd.NOT_SET,isTop:i.isTop||!1,lastUnreadTime:i.lastUnreadTime||0,unreadMentionedCount:i.unreadMentionedCount||0},u.label=3;case 3:return[2,{code:Cd.SUCCESS,data:r}]}}))}))},n.prototype.getAllConversationUnreadCount=function(e,t,n){var r=this._conversationManager.getAllUnreadCount(e,t,n);return Promise.resolve({code:Cd.SUCCESS,data:r})},n.prototype.getTotalUnreadCountByLevels=function(e,t,n){void 0===n&&(n=!1);var r=0;if(e.includes(Od.ULTRA_GROUP)){if(!this._isUltraGroupListExist)return Promise.resolve({code:Cd.METHOD_NOT_AVAILABLE});for(var i in this._ultraGroupMap){var o=this._ultraGroupMap[i];(0===t.length||t.includes(o.notificationLevel))&&(r+=n?o.unreadMentionedCount:o.unreadMessageCount)}}return r+=this._conversationManager.getTotalUnreadCountByLevels(e,t,n),Promise.resolve({code:Cd.SUCCESS,data:r})},n.prototype.getConversationUnreadCount=function(e,t,n){var r,i;return i=e===Od.ULTRA_GROUP?(null===(r=this._ultraGroupMap["".concat(n,"_").concat(t)])||void 0===r?void 0:r.unreadMessageCount)||0:this._conversationManager.getUnreadCount(e,t,n),Promise.resolve({code:Cd.SUCCESS,data:i})},n.prototype.clearConversationUnreadCount=function(e,t,n){return this._conversationManager.clearUnreadCount(e,t,n,!1),Promise.resolve(Cd.SUCCESS)},n.prototype.clearAllUnreadCount=function(){return this._conversationManager.clearAllUnreadCount(),Promise.resolve(Cd.SUCCESS)},n.prototype.getFirstUnreadMessage=function(e,t){throw new Error("Method not implemented.")},n.prototype.saveConversationMessageDraft=function(e,t,n,r){return this._conversationManager.setDraft(e,t,n,r),Promise.resolve(Cd.SUCCESS)},n.prototype.getConversationMessageDraft=function(e,t,n){var r=this._conversationManager.getDraft(e,t,n);return Promise.resolve({code:Cd.SUCCESS,data:r})},n.prototype.clearConversationMessageDraft=function(e,t,n){return this._conversationManager.clearDraft(e,t,n),Promise.resolve(Cd.SUCCESS)},n.prototype.pullConversationStatus=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,d=this;return dc(this,(function(l){switch(l.label){case 0:return this._isConnected?(n=(t=this)._connMgr,r=t.currentUserId,i=n.codec.encodeGetConversationStatus(e),o=new FM(jM[jM.pullSeAtts],i,r),[4,n.send(o,yL)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return s=l.sent(),a=s.code,c=s.data,this.logger.info(Fd.L_PULL_CONVERSATION_S,JSON.stringify({timestamp:e,userId:r})),a!==Cd.SUCCESS?[2,{code:a}]:(u=[],Array.isArray(c)&&c.forEach((function(e){var t=e.conversationType,n=e.updatedTime;n&&d._conversationManager.setConversationUpdatedTime(n),t===Od.ULTRA_GROUP?d._setUltraConversationStatus(e):u.push(e)})),[2,{code:a,data:u}
1])}}))}))},n.prototype._setUltraConversationStatus=function(e){var t=e.targetId,n=e.notificationStatus,r=e.notificationLevel,i=e.channelId,o=e.isTop,s=this._ultraGroupMap["".concat(i,"_").concat(t)];return s&&void 0!==r&&(s.notificationLevel=r,this._ultraGroupManager.addUltraGroupStatus(s)),s&&void 0!==n&&(s.notificationStatus=n,this._ultraGroupManager.addUltraGroupStatus(s)),s&&void 0!==o&&(s.isTop=o),s},n.prototype.batchSetConversationStatus=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,d,l,h,f=this;return dc(this,(function(g){switch(g.label){case 0:return this._isConnected?(n=(t=this).currentUserId,r=t._connMgr,i=this._conversationManager.getConversationUpdatedTime(),o=r.codec.encodeSetConversationStatus(e,i),s=new FM(aM,o,n),[4,r.send(s,OL)]):[2,Cd.RC_NET_UNAVAILABLE];case 1:return a=g.sent(),c=a.code,u=a.data,c!==Cd.SUCCESS?[2,c]:(d=u,this._conversationManager.setConversationUpdatedTime(d.version),l=[],e.forEach((function(e){if(e.conversationType!==Od.ULTRA_GROUP)f._conversationManager.addStatus(cc(cc({},e),{updatedTime:d.version}),!0);else{var t=f._setUltraConversationStatus(e);t&&l.push(t)}})),l.length>0&&(h=FE(l),h=eb(h),this._watcher.conversation(h)),[2,c])}}))}))},n.prototype._joinChrm=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s,a,c,u,d,l,h;return dc(this,(function(f){switch(f.label){case 0:return this._isConnected?(i=this._connMgr,o=i.codec.encodeJoinOrQuitChatRoom(),a=new FM(s=n?$A:XA,o,e),this.logger.info(Fd.L_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t,topic:s}),r),[4,i.send(a,XU)]):[2,Cd.RC_NET_UNAVAILABLE];case 1:return c=f.sent(),u=c.code,d=c.data,l=u===Cd.SUCCESS?"info":"warn",this.logger[l](Fd.L_JOIN_CHATROOM_R,JSON.stringify({code:u,timestamp:(new Date).getTime()}),r),u===Cd.SUCCESS&&(h=d.joinTime,this._chrmsQueue[e]||(this._chrmsQueue[e]={pulling:!1,queue:[],timestamp:0}),this._pullChrmMsg(e,t,h),this.getNaviInfoFromCache().kvStorage&&this._chrmEntryHandler.pullEntry(e,0),this._joinedChrmManager.set(e,t),this._startSyncIntervalForChrmPull()),[2,u]}}))}))},n.prototype._rejoinChrm=function(){return uc(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:for(n in e=this._joinedChrmManager.get(),t=[],e)t.push(n);r=0,c.label=1;case 1:return r<t.length?(i=t[r],this.logger.info(Fd.L_REJOIN_CHATROOM_T,JSON.stringify({chatroomId:i,count:e[i]||10,topic:$A})),o=this.logger.createTraceId(),[4,this._joinChrm(i,e[i]||10,!0,o)]):[3,4];case 2:if(s=c.sent(),a=s===Cd.SUCCESS?"info":"warn",this.logger[a](Fd.L_REJOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),o),s===Cd.SUCCESS)return this._watcher.chatroom({rejoinedRoom:{chatroomId:i,count:e[i]}}),[2];s===Cd.RC_CHATROOM_USER_KICKED&&(this._joinedChrmManager.remove(i),delete this._chrmsQueue[i]),this._watcher.chatroom({rejoinedRoom:{chatroomId:i,errorCode:s}}),c.label=3;case 3:return r++,[3,1];case 4:return[2]}}
1))}))},n.prototype._pullChrmMsg=function(e,t,n){return void 0===t&&(t=10),void 0===n&&(n=0),uc(this,void 0,void 0,(function(){var r,i,o,s,a,c,u,d,l,h,f,g,p;return dc(this,(function(v){switch(v.label){case 0:return this._isConnected?(r=this._chrmsQueue[e],i=r.pulling,o=r.timestamp,i?[2]:(r.pulling=!0,s=this._connMgr.codec.encodeChrmSyncMsg(n?0:o,t),a=new FM(jM[jM.chrmPull],s,e),this.logger.info(Fd.L_PULL_CHATROOM_MSG_T,JSON.stringify({chatroomId:e,timestamp:o})),[4,this._connMgr.send(a,bU,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})])):[2];case 1:return c=v.sent(),u=c.code,d=c.data,r.pulling=!1,u===Cd.SUCCESS&&d?(l=d.list,h=d.syncTime,f=d.finished,r.timestamp=n?Math.max(h,n):h,r.queue=r.queue.filter((function(e){return e>h})),g=[],p=[],l.forEach((function(e){e.sentTime<o||(g.push(e.messageUId),p.push(e))})),this._batchMessage(p),this.logger.info(Fd.L_PULL_CHATROOM_MSG_R,JSON.stringify({code:u,timestamp:o,messageUIds:g.join(",")})),(!f||r.queue.length>0)&&this._pullChrmMsg(e),[2]):(this.logger.warn(Fd.L_PULL_CHATROOM_MSG_R,JSON.stringify({code:u,timestamp:o,messageUIds:""})),[2])}}))}))},n.prototype.joinChatroom=function(e,t,n){return uc(this,void 0,void 0,(function(){return dc(this,(function(r){return[2,this._joinChrm(e,t,!1,n)]}))}))},n.prototype.joinExistChatroom=function(e,t,n){return uc(this,void 0,void 0,(function(){return dc(this,(function(r){return[2,this._joinChrm(e,t,!0,n)]}))}))},n.prototype.quitChatroom=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o;return dc(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr,n=t.codec.encodeJoinOrQuitChatRoom(),r=new FM(eM,n,e),[4,t.send(r)]):[2,Cd.RC_NET_UNAVAILABLE];case 1:return i=s.sent(),(o=i.code)===Cd.SUCCESS&&(delete this._chrmsQueue[e],this._chrmEntryHandler.reset(e),this._joinedChrmManager.remove(e)),[2,o]}}))}))},n.prototype.getChatroomInfo=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return this._isConnected?(r=this._connMgr,i=r.codec.encodeGetChatRoomInfo(t,n),o=new FM(jM[jM.queryChrmI],i,e),[4,r.send(o,eL)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return s=u.sent(),a=s.code,c=s.data,a!==Cd.SUCCESS?[2,{code:a}]:[2,{code:a,data:c}]}}))}))},n.prototype.getChatroomHistoryMessages=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s,a,c,u;return dc(this,(function(d){switch(d.label){case 0:return this._isConnected?(i=this._connMgr,o=i.codec.encodeGetHistoryMsg(e,{timestamp:t,count:n,order:r}),s=new FM(lM,o,e),[4,i.send(s,kU,{conversation:{targetId:e}})]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return a=d.sent(),c=a.code,u=a.data,c!==Cd.SUCCESS?[2,{code:c}]:[2,{code:c,data:{list:u.list,hasMore:u.hasMore}}]}}))}))},n.prototype._modifyChatroomKV=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,o=this._chrmEntryHandler.getVersion(e,t.key),t.version=null==o?this.getServerTime():o,s=r.codec.encodeModifyChatRoomKV(e,t,i),a=t.type===qd.UPDATE?tM:nM,c=new FM(a,s,e),[4,r.send(c,XU)]):[2,Cd.RC_NET_UNAVAILABLE];case 1:return u=l.sent(),(d=u.code)===Cd.SUCCESS?(this._chrmEntryHandler.setLocal(e,{kvEntries:[t],syncTime:this.getServerTime()},i),[2,d]):[2,d]}}))}))},n.prototype._chatroomKVStoreNotAllSuccess=function(e,t){var n=t.data,r=e;return n&&Array.isArray(n.errorKeys)&&n.errorKeys.forEach((function(e){var t=r.findIndex((function(t){return e.key===t.key}));-1!==t&&r.splice(t,1)})),r},n.prototype._modifyChatroomKVS=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,u,d,l,h,f,g=this;return dc(this,(function(p){switch(p.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,t.entries.forEach((function(t){var n=g._chrmEntryHandler.getVersion(e,t.key);t.version=null==n?g.getServerTime():n})),o=r.codec.encodeModifyChatRoomKVS(e,t,i),s=t.type===qd.UPDATE?rM:iM,a=new FM(s,o,e),[4,r.send(a,hL)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];
1case 1:return c=p.sent(),u=c.code,-1!==[Cd.SUCCESS,Cd.CHATROOM_KV_STORE_NOT_ALL_SUCCESS].indexOf(u)&&(l=[],delete(h=cc({},t)).entries,t.entries.forEach((function(e){l.push(cc(cc({},e),h))})),u===Cd.CHATROOM_KV_STORE_NOT_ALL_SUCCESS&&(f=c.data,d=f.errorKeys,l=this._chatroomKVStoreNotAllSuccess(l,c)),this._chrmEntryHandler.setLocal(e,{kvEntries:l,syncTime:(new Date).getTime()},i)),[2,{code:u,data:d}]}}))}))},n.prototype.setChatroomEntry=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return t.type=qd.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.setChatroomEntries=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return t.type=qd.UPDATE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))},n.prototype.forceSetChatroomEntry=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return t.type=qd.UPDATE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.removeChatroomEntry=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return t.type=qd.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.removeChatroomEntries=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return t.type=qd.DELETE,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKVS(e,t)]}))}))},n.prototype.forceRemoveChatroomEntry=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return t.type=qd.DELETE,t.isOverwrite=!0,t.userId=t.userId||this.currentUserId,[2,this._modifyChatroomKV(e,t)]}))}))},n.prototype.getChatroomEntry=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return(n=this._chrmEntryHandler.getValue(e,t))?[2,{code:Cd.SUCCESS,data:n}]:this._isConnected?(r=this._connMgr,i=r.codec.encodePullChatRoomKV(0),o=new FM(jM[jM.pullKV],i,e),[4,r.send(o,lL)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return s=u.sent(),(a=s.data)&&a.kvEntries&&a.kvEntries.length&&(c=a.kvEntries.find((function(e){return e.key===t})),void 0!==c)?[2,{code:Cd.SUCCESS,data:null==c?void 0:c.value}]:[2,{code:Cd.CHATROOM_KEY_NOT_EXIST}]}}))}))},n.prototype.getAllChatroomEntry=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return(t=this._chrmEntryHandler.getAll(e))&&Object.keys(t).length?[2,{code:Cd.SUCCESS,data:t}]:this._isConnected?(n=this._connMgr,t={},r=n.codec.encodePullChatRoomKV(0),i=new FM(jM[jM.pullKV],r,e),[4,n.send(i,lL)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return o=a.sent(),(s=o.data)&&s.kvEntries&&s.kvEntries.length&&s.kvEntries.forEach((function(e){e.key&&(t[e.key]=e.value||"")})),[2,{code:Cd.SUCCESS,data:t}]}}))}))},n.prototype.pullChatroomEntry=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,u,d,l,h,f=this;return dc(this,(function(g){switch(g.label){case 0:return this._isConnected?(r=(n=this)._connMgr,i=n.currentUserId,o=r.codec.encodePullChatRoomKV(t),s=new FM(jM[jM.pullKV],o,e),this.logger.info(Fd.L_PULL_CHATROOM_KV_T,JSON.stringify({chatroomId:e,timestamp:t})),[4,r.send(s,lL)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return a=g.sent(),c=a.code,u=a.data,d=c===Cd.SUCCESS?"info":"warn",this.logger[d](Fd.L_PULL_CHATROOM_KV_R,JSON.stringify({code:c,timestamp:t})),c===Cd.SUCCESS&&u?(l=u.kvEntries,h=[],l.length>0&&(l.forEach((function(t){var n=t.key,r=t.value,i=t.type,o=t.timestamp,s=t.userId;f._chrmEntryHandler.getValue(e,n)===r&&s===f.getCurrentUserId()||h.push({key:n,value:r,type:i,timestamp:o,chatroomId:e})})),this._chrmEntryHandler.setLocal(e,u,i),h.length>0&&this._watcher.chatroom({updatedEntries:h})),[2,{code:c,data:u}]):[2,{code:c}]}}))}))},n.prototype._startSyncIntervalForChrmPull=function(){var e=this;this._stopSyncIntervalForChrmPull(),this._intervalTimerForChrmPull=setInterval((function(){var t=Object.keys(e._chrmsQueue);0!==t.length&&e._isConnected?t.forEach((function(t){e._pullChrmMsg(t),e.getNaviInfoFromCac
1he().kvStorage&&e._chrmEntryHandler.pullEntry(t,0)})):e._stopSyncIntervalForChrmPull()}),za)},n.prototype._stopSyncIntervalForChrmPull=function(){"number"!=typeof this._intervalTimerForChrmPull&&(clearInterval(this._intervalTimerForChrmPull),this._intervalTimerForChrmPull=-1)},n.prototype.sendMessage=function(t,n,r,i,o){return uc(this,void 0,void 0,(function(){var s,a,c,u,d,l,h,f,g,p,v;return dc(this,(function(_){switch(_.label){case 0:return this._isConnected?(r=function(e,t){return"RC:SRSMsg"===e.messageType&&Object.assign(e,{directionalUserIdList:[t]}),e}(r,this.currentUserId),r=this._handleMsgProperties(r,!0),s=!![Od.PRIVATE,Od.GROUP].includes(t)&&r.isStatusMessage,a=s?function(e){var t;return(t={},t[Od.PRIVATE]=jM.ppMsgS,t[Od.GROUP]=jM.pgMsgS,t)[e]}(t):function(e){var t;return(t={},t[Od.PRIVATE]=jM.ppMsgP,t[Od.GROUP]=jM.pgMsgP,t[Od.CHATROOM]=jM.chatMsg,t[Od.CUSTOMER_SERVICE]=jM.pcMsgP,t[Od.RTC_ROOM]=jM.prMsgS,t)[e]}(t)||jM.ppMsgP,s&&(r.isPersited=!1,r.isCounted=!1),c=r.messageId?r.messageId:bE(),r.messageId=c,u=this._connMgr.codec.encodeUpMsg({conversationType:t,targetId:n},r),(d=new GM(jM[a],u,n)).setHeaderQos(qA.AT_LEAST_ONCE),s?(this._connMgr.sendOnly(d),[2,{code:Cd.SUCCESS,data:$w(t,n,cc({},r),"",0,this.currentUserId,c)}]):(l=this._connMgr.getCrtServerTime(),h=$w(t,n,cc({},r),"",l,this.currentUserId,c),null==i||i(c),this.logger.info(Fd.L_SEND_MSG_T,JSON.stringify({messageType:r.messageType,conversationType:t,targetId:n,channelId:r.channelId}),o),[4,this._connMgr.send(d)])):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return f=_.sent(),g=f.code,p=f.data,g!==Cd.SUCCESS?(this.logger.warn(Fd.L_SEND_MSG_R,JSON.stringify({code:g,messageUId:h.messageUId,messageId:h.messageId}
1),o),h.sentStatus=e.SentStatus.FAILED,[2,{code:g,data:h}]):(this.logger.info(Fd.L_SEND_MSG_R,JSON.stringify({code:g,messageUId:null==p?void 0:p.messageUId,messageId:null==p?void 0:p.messageId}),o),v=p,this._sendMessageStore.setMessage(v.messageUId,v.timestamp),h.sentTime=v.timestamp,h.messageUId=v.messageUId,this._conversationManager.setConversationCacheByMessage(h,!0),[2,{code:Cd.SUCCESS,data:h}])}}))}))},n.prototype.recallMsg=function(e,t,n,r,i){var o;return uc(this,void 0,void 0,(function(){var s,a,c,u,d,l,h,f,g,p,v,_,E;return dc(this,(function(m){switch(m.label){case 0:return this._isConnected?(s=i.user,a=i.extra,c=i.isDelete,u={conversationType:e,targetId:t,messageUId:n,sentTime:r,channelId:i.channelId||"",isDelete:c||!1},s&&(u.user=s),a&&(u.extra=a),d={content:u,messageType:"RC:RcCmd",disableNotification:null==i?void 0:i.disableNotification,pushConfig:null==i?void 0:i.pushConfig,pushContent:(null===(o=i.pushConfig)||void 0===o?void 0:o.pushContent)||i.pushContent||"",channelId:i.channelId},l=jM[jM.recallMsg],h=this._connMgr.codec.encodeUpMsg({conversationType:e,targetId:t},d),(f=new GM(l,h,this.currentUserId)).setHeaderQos(qA.AT_LEAST_ONCE),[4,this._connMgr.send(f)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return g=m.sent(),p=g.code,v=g.data,e===Od.ULTRA_GROUP&&this.logger.debug(Fd.L_RECALL_ULTRA_MSG_S,JSON.stringify({code:p,conversationType:e,targetId:t,channelId:i.channelId})),p!==Cd.SUCCESS?[2,{code:p}]:(_=v,e===Od.ULTRA_GROUP?(this._ultraMsgMap[_.messageUId]=_.timestamp,this._updateUltraGroupWhenRecallMsg(t,i.channelId||"",n),[2,{code:Cd.SUCCESS}]):(this._sendMessageStore.setMessage(_.messageUId,_.timestamp),E=$w(e,t,cc(cc({},d),{isPersited:!0}),_.messageUId,_.timestamp,this.currentUserId),this._conversationManager.setConversationCacheByMessage(E,!0),[2,{code:Cd.SUCCESS,data:E}]))}}))}))},n.prototype.sendReadReceiptMessage=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i;return dc(this,(function(o){return this._isConnected?(r=this._connMgr.codec.encodeReadReceipt(t,n),i=new FM(jM[jM.rrMsg],r,e),[2,this._connMgr.send(i)]):[2,{code:Cd.RC_NET_UNAVAILABLE}]}))}))},n.prototype.getMessageReader=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i;return dc(this,(function(o){return this._isConnected?(r=this._connMgr.codec.encodeMessageReader(t,n),i=new FM(jM[jM.rrList],r,e),[2,this._connMgr.send(i,PL)]):[2,{code:Cd.RC_NET_UNAVAILABLE}]}))}))},n.prototype.pullUserSettings=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o;return dc(this,(function(s){switch(s.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodePullUserSetting(e),n=new FM(jM[jM.pullUS],t,this.currentUserId),[4,this._connMgr.send(n,mL)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return r=s.sent(),i=r.code,o=r.data,i===Cd.SUCCESS&&this._naviChangeHandler(o),[2,{code:i,data:o}]}}))}))},n.prototype._naviChangeHandler=function(e){var t;if(e){var n=e.settings,r=null===(t=null==n?void 0:n.VoipInfo)||void 0===t?void 0:t.value;if(r){var i=this._connMgr.getToken();this.navi.updateVoipCallInfo(i,r);var o=this.navi.getNaviInfoFromCache(i);this._watcher.onNaviDataChange(cc({},o))}}else this.logger.warn(Fd.L_NOTIFY_NAVI_CHANGE_E,JSON.stringify({data:e}))},n.prototype.getFileToken=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s,a,c,u;return dc(this,(function(d){switch(d.label){case 0:return this._isConnected?(i=r&&"uploads"!==r?t||"":AE(e,t),o=this._connMgr.codec.encodeGetFileToken(e,i,n||"",r||""),s=new FM(jM[jM.qnTkn],o,this.currentUserId),[4,this._connMgr.send(s,nL)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return a=d.sent(),c=a.code,u=a.data,u=Object.assign(u,{fileName:i}),c===Cd.SUCCESS?[2,{code:c,data:u}]:[2,{code:c}]}}))}))},n.prototype.getFileUrl=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s,a,c,u,d,l,h;return dc(this,(function(f){switch(f.label){case 0:return this._isConnected?(i="",o="",s="",t===Gd.QINIU?(o=rL,s=oL):(o=iL,s=sL),i=t===Gd.QINIU?jM[jM.qnUrl]:t===Gd.AWS?jM[jM.s3Url]:t===Gd.STC?jM[jM.stcUrl]:t===Gd.MINIO?jM[jM.minioUrl]:jM[jM.aliUrl],a=this._connMgr.codec.encodeGetFileUrl(o,e,n,r),c=new FM(i,a,this.currentUserId),[4,this._connMgr.send(c,s)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return u=f.sent(),d=u.code,l=u.data,h=l,d===Cd.SUCCESS?[2,{code:d,data:h}]:[2,{code:d}]}}))}))},n.prototype.disconnect=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){switch(e.label){case 0:return this.reporter.stop(),[4,this._connMgr.disconnect()];case 1:return e.sent(),this._resetMemoryState(),[2]}}))}))},n.prototype._resetMemoryState=function(){-1!==this._reconnectTimer&&(clearTimeout(this._reconnectTimer),this._reconnectTimer=-1),this._pullQueue.length=0,this._stopSyncInterval(),this.resetUltraGroupData(),this._joinedChrmManager&&(this._joinedChrmManager.clear(),delete this._joinedChrmManager),this._conversationManager&&delete this._conversationManager,this._ultraGroupManager&&delete this._ultraGroupManager,this._userSettingManager&&delete this._userSettingManager,this._chrmsQueue={}},n.prototype.resetUltraGroupData=function(){this._stopUltraSyncInterval(),this._lastSyncUltraMsgTimeStamp=0,this._lastSyncUltraMsgLocalTimeStamp=0,this._isUltraPulling=!1,this._ultraGroupTimeQue=[],this._isUltraGroupListExist=!1,this._ultraGroupMap={}},n.prototype.registerMessageType=function(e,t,n,r,i){this._customMessageType[e]={isPersited:t,isCounted:n,isStatusMessage:i}},n.prototype.getServerTime=function(){return this._connMgr.getCrtServerTime()},n.prototype.getCurrentUserId=function(){return this.currentUserId},n.prototype.createTag=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return this._isConnected?(t=this._userSettingManager.getVersion(),n=this._connMgr.codec.encodeCreateTag([e],t),r=new FM(jM[jM.addSeTag],n,this.currentUserId),[4,this._connMgr.send(r,_L)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return i=c.sent(),o=i.code,s=i.data,o!==Cd.SUCCESS?[2,{code:o}]:(a=s.version,this._userSettingManager.addTag([cc(cc({},e),{createdTime:a}
1)],a),[2,{code:Cd.SUCCESS}])}}))}))},n.prototype.removeTag=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return this._isConnected?(t=this._userSettingManager.getVersion(),n=this._connMgr.codec.encodeRemoveTag([e],t),r=new FM(jM[jM.delSeTag],n,this.currentUserId),[4,this._connMgr.send(r,_L)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return i=c.sent(),o=i.code,s=i.data,o!==Cd.SUCCESS?[2,{code:o}]:(a=s.version,this._userSettingManager.deleteTag([e],a),[2,{code:Cd.SUCCESS}])}}))}))},n.prototype.updateTag=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return this._isConnected?(t=this._userSettingManager.getVersion(),n=this._connMgr.codec.encodeCreateTag([e],t),r=new FM(jM[jM.addSeTag],n,this.currentUserId),[4,this._connMgr.send(r,_L)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return i=c.sent(),o=i.code,s=i.data,o!==Cd.SUCCESS?[2,{code:o}]:(a=s.version,this._userSettingManager.addTag([e],a),[2,{code:Cd.SUCCESS}])}}))}))},n.prototype.getTagList=function(){return uc(this,void 0,void 0,(function(){var e,t;return dc(this,(function(n){return e=this._userSettingManager.getTags(),t=this._conversationManager.getConversationListForTag(),e.forEach((function(e){e.conversationCount=t[e.tagId]?t[e.tagId].length:0})),[2,{code:Cd.SUCCESS,data:e}]}))}))},n.prototype.addTagForConversations=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o,s=this;return dc(this,(function(a){switch(a.label){case 0:return this._isConnected?this._userSettingManager.getTagById(e)?(n=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t),r=new FM(jM[jM.addTag],n,this.currentUserId),[4,this._connMgr.send(r)]):[2,{code:Cd.TAG_NOT_EXIST}]:[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return(i=a.sent().code)!==Cd.SUCCESS?[2,{code:i}]:((o={})[e]={},t.forEach((function(e){s._conversationManager.addTagStatus(e.conversationType,e.targetId,o,e.channelId)})),[2,{code:Cd.SUCCESS}])}}))}))},n.prototype.removeTagForConversations=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o=this;return dc(this,(function(s){switch(s.label){case 0:return this._isConnected?(n=this._connMgr.codec.encodeUpdateConversationTag([{tagId:e}],t),r=new FM(jM[jM.delTag],n,this.currentUserId),[4,this._connMgr.send(r)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return(i=s.sent().code)!==Cd.SUCCESS?[2,{code:i}]:(t.forEach((function(t){o._conversationManager.deleteTagStatus(t.conversationType,t.targetId,[e],t.channelId)})),[2,{code:Cd.SUCCESS}])}}))}))},n.prototype.removeTagsForConversation=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return this._isConnected?(n=e.conversationType,r=e.targetId,i=e.channelId,o=t.map((function(e){return{tagId:e}})),s=this._connMgr.codec.encodeUpdateConversationTag(o,[e]),a=new FM(jM[jM.delTag],s,this.currentUserId),[4,this._connMgr.send(a)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return(c=u.sent().code)!==Cd.SUCCESS?[2,{code:c}]:(this._conversationManager.deleteTagStatus(n,r,t,i),[2,{code:Cd.SUCCESS}])}}))}))},n.prototype.getConversationListByTag=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s,a,c,u,d,l;return dc(this,(function(h){switch(h.label){case 0:return this._isConnected?(i=(r=this).currentUserId,o=r._connMgr,s=o.codec.encodeOldConversationList({count:n,type:Od.PRIVATE,startTime:t}),a=new FM(oM,s,i),[4,o.send(a,HU,{currentUserId:i,connectedTime:o.getConnectedTime()})]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return c=h.sent(),u=c.code,d=c.data,u!==Cd.SUCCESS?[2,{code:u}]:(l=this._conversationHasTagFilter(e,null==d?void 0:d.list),[2,{code:u,data:l}])}}))}))},n.prototype._conversationHasTagFilter=function(e,t){var n=this,r=[],i=[];function o(e,t){return e.latestMessage&&t.latestMessage?e.latestMessage.sentTime-t.latestMessage.sentTime:0}return t.forEach((function(t){var o=t.conversationType,s=t.targetId,a=t.channelId,c=n._conversationManager.get(o,s,a),u=c.hasMentioned,d=c.mentionedInfo,l=c.lastUnreadTime,h=c.notificationStatus,f=c.isTop,g=c.tags,p=c.unreadMessageCount,v=g&&g[e];if(v){var _=cc(cc({},t),{hasMentioned:u,mentionedInfo:d,lastUnreadTime:l,notificationStatus:h,isTop:f,unreadMessageCount:p});v.isTop?r.push(cc(cc({},_),{isTopInTag:!0})):i.push(cc(cc({},_),{isTopInTag:!1}))}})),r.sort(o),i.sort(o),lc(lc([],r,!0),i,!0)},n.prototype.getUnreadCountByTag=function(e,t){return uc(this,void 0,void 0,(function(){var n;return dc(this,(function(r){return this._isConnected?(n=this._conversationManager.getUnreadCountByTag(e,t),[2,{code:Cd.SUCCESS,data:n}]):[2,{code:Cd.RC_NET_UNAVAILABLE}]}))}))},n.prototype.setConversationStatusInTag=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s,a,c,u,d,l,h;return dc(this,(function(f){switch(f.label){case 0:return this._isConnected?(r=t.targetId,i=t.conversationType,o=t.channelId,s=n.isTop,a=[{tagId:e,isTop:s}],(c=this._conversationManager.get(i,r,o)).tags&&Object.hasOwnProperty.call(c.tags,e)?(u=this._connMgr.codec.encodeUpdateConversationTag(a,[t]),d=new FM(jM[jM.addTag],u,this.currentUserId),[4,this._connMgr.send(d)]):[2,{code:Cd.NO_TAG_IN_CONVER}]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return(l=f.sent().code)!==Cd.SUCCESS?[2,{code:l}]:((h={})[e]={},s&&(h[e].isTop=!0),this._conversationManager.addTagStatus(i,r,h,o),[2,{c
1ode:Cd.SUCCESS}])}}))}))},n.prototype.getTagsForConversation=function(e){var t;return uc(this,void 0,void 0,(function(){var n,r,i,o;return dc(this,(function(s){if(!this._isConnected)return[2,{code:Cd.RC_NET_UNAVAILABLE}];if(n=this._conversationManager.get(e.conversationType,e.targetId,e.channelId),r=this._userSettingManager.getTagsInfo(),i=[],n.tags)for(o in n.tags)i.push({tagId:o,tagName:null===(t=r[o])||void 0===t?void 0:t.tagName});return[2,{code:Cd.SUCCESS,data:i}]}))}))},n.prototype.getBlockConversationList=function(){var e=this._conversationManager.getBlockConversationList();return Promise.resolve({code:Cd.SUCCESS,data:e})},n.prototype.getTopConversationList=function(e,t){var n=this._conversationManager.getTopConversationList(e,t);return Promise.resolve({code:Cd.SUCCESS,data:n})},n.prototype.getUnreadConversationList=function(e){return uc(this,void 0,void 0,(function(){var t;return dc(this,(function(n){return t=this._conversationManager.getUnreadConversationList(e),[2,Promise.resolve({code:Cd.SUCCESS,data:t})]}))}))},n.prototype.getUnreadMentionedCount=function(e){var t,n;return n=e.conversationType===Od.ULTRA_GROUP?(null===(t=this._ultraGroupMap["".concat(e.channelId,"_").concat(e.targetId)])||void 0===t?void 0:t.unreadMentionedCount)||0:this._conversationManager.getUnreadMentionedCount(e.conversationType,e.targetId,e.channelId),Promise.resolve({code:Cd.SUCCESS,data:n})},n.prototype.getAllUnreadMentionedCount=function(){var e=this._conversationManager.getAllUnreadMentionedCount();return Promise.resolve({code:Cd.SUCCESS,data:e})},n.prototype.getConversationNotificationLevel=function(e,t,n){if(!this._isUltraGroupListExist&&e===Od.ULTRA_GROUP)return Promise.resolve({code:Cd.METHOD_NOT_AVAILABLE});var r;if(!(r=e===Od.ULTRA_GROUP?this._ultraGroupManager.get(Od.ULTRA_GROUP,t,n):this._conversationManager.get(e,t,n)))return Promise.resolve({code:Cd.SUCCESS,data:Pd.NOT_SET});var i=r.notificationLevel;return _l(r.notificationLevel)&&!_l(r.notificationStatus)&&(i=wd.OPEN===r.notificationStatus?1:0),Promise.resolve({code:Cd.SUCCESS,data:i})},n.prototype.getConversationNotificationStatus=function(e,t,n){var r;return(r=e===Od.ULTRA_GROUP?this._ultraGroupManager.get(Od.ULTRA_GROUP,t,n):this._conversationManager.get(e,t,n))?Promise.resolve({code:Cd.SUCCESS,data:r.notificationStatus}):Promise.resolve({code:Cd.SUCCESS,data:wd.CLOSE})},n.prototype.getRemoteHistoryMessages=function(e,t,n,r,i,o){return this.getHistoryMessage(e,t,n,r,i,o)},n.prototype.getUltraGroupList=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i;return dc(this,(function(o){return t=e.targetId,n=e.channelType,this._isUltraGroupListExist?(r=Object.values(this._ultraGroupMap).filter((function(e){return!(e.targetId!==t&&t||e.channelType!==n&&ll(n))})),r=eb(r),i=FE(r),[2,{code:Cd.SUCCESS,data:i}]):[2,{code:Cd.METHOD_NOT_AVAILABLE}]}))}))},n.prototype.getBlockUltraGroupList=function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:Cd.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){(e.notificationStatus===wd.OPEN||e.notificationLevel>0)&&t.push({conversationType:Od.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:Cd.SUCCESS,data:t})},n.prototype.getTopUltraGroupList=function(){if(!this._isUltraGroupListExist)return Promise.resolve({code:Cd.METHOD_NOT_AVAILABLE});var e=Object.values(this._ultraGroupMap),t=[];return e.forEach((function(e){!0===e.isTop&&t.push({conversationType:Od.ULTRA_GROUP,targetId:e.targetId,channelId:e.channelId})})),Promise.resolve({code:Cd.SUCCESS,data:t})},n.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){if(!this._isUltraGroupListExist)return Promise.resolve({code:Cd.METHOD_NOT_AVAILABLE});var n=0;for(var r in this._ultraGroupMap){r.match(/_.*/g)[0].substring(1)!==e||t&&0!==t.length&&!t.includes(this._ultraGroupMap[r].notificationLevel)||(n+=this._ultraGroupMap[r].unreadMentionedCount)}return Promise.resolve({code:Cd.SUCCESS,data:n})},n.prototype.getUltraGroupUnreadCountByTargetId=function(e,t){var n=0;for(var r in this._ultraGroupMap){var i=this._ultraGroupMap[r];i.targetId!==e||t&&0!==t.length&&!t.includes(this._ultraGroupMap[r].notificationLevel)||(n+=i.unreadMessageCount||0)}return Promise.resolve({code:Cd.SUCCESS,data:n})},n.prototype.getAllUltraGroupUnreadCount=function(e){if(void 0===e&&(e=!1),!this._isUltraGroupListExist)return Promise.resolve({code:Cd.METHOD_NOT_AVAILABLE});var t=0;for(var n in this._ultraGroupMap)t+=e?this._ultraGroupMap[n].unreadMentionedCount||0:this._ultraGroupMap[n].unreadMessageCount||0;return Promise.resolve({code:Cd.SUCCESS,data:t})},n.prototype.clearUltraUnreadcount=function(e,t){return void 0===t&&(t=""),uc(this,void 0,void 0,(function(){var n,r,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this.getServerTime(),r=this._connMgr.codec.encodeClearUnreadCount({conversationType:Od.ULTRA_GROUP,targetId:e,channelId:t},{timestamp:n}),(i=new GM(jM[jM.updUgRTime],r,this.currentUserId)).setHeaderQos(qA.AT_LEAST_ONCE),[4,this._connMgr.send(i)]):[2,Cd.RC_NET_UNAVAILABLE]:[2,Promise.resolve(Cd.METHOD_NOT_AVAILABLE)];case 1:return(o=a.sent().code)===Cd.SUCCESS&&((s=this._ultraGroupMap["".concat(t,"_").concat(e)
1])&&(s.unreadMessageCount=0,s.unreadMentionedCount=0,s.lastReadTime=n),s.firstUnreadMessage&&(s.firstUnreadMessage=null)),[2,o]}}))}))},n.prototype._getUltraGroupList=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,d,l,h,f,g=this;return dc(this,(function(p){switch(p.label){case 0:return this._isConnected?(!1,t=this._connMgr.codec.encodeUltraGroup(e,false),n=new FM(jM[jM.pullUgSes],t,this.currentUserId),[4,this._connMgr.send(n,HU,{currentUserId:this.currentUserId,conversationType:Od.ULTRA_GROUP})]):[2];case 1:return r=p.sent(),i=r.code,o=r.data,i===Cd.SUCCESS&&o?(a=o.list,c=o.isFinished,a.forEach((function(e){e.notificationStatus=wd.CLOSE,e.notificationLevel=Pd.NOT_SET,e.isTop=!1,g._ultraGroupMap["".concat(e.channelId,"_").concat(e.targetId)]=e,g._ultraGroupManager.addUltraGroupStatus(e)})),!1!==c?[3,2]:(u=a.length>0&&a[a.length-1].versionTime||0,this._getUltraGroupList(u),[3,4])):(this.logger.warn(Fd.L_ULTRA_SYNC_DONE_S,"Pull ultra group conversation failured, code: ".concat(i,", try again")),s=setTimeout((function(){g._getUltraGroupList(e),clearTimeout(s)}),3e3),[2]);case 2:return this.logger.info(Fd.L_ULTRA_SYNC_DONE_S,"Pull ultra group conversation success"),[4,this.pullConversationStatus(0)];case 3:d=p.sent(),l=d.code,h=d.data,l!==Cd.SUCCESS&&this.logger.warn(Fd.O,"pullConversationStatus fail code: ".concat(l,", data: ").concat(h)),f=Object.values(this._ultraGroupMap),f=eb(f),this._isUltraGroupListExist=!0,this._watcher.ultraGroupEnable(FE(f)),this._syncUltraMsg(this._lastSyncUltraMsgTimeStamp),p.label=4;case 4:return[2]}}
1))}))},n.prototype._startUltraSyncInterval=function(){var e=this;this._lastSyncUltraMsgLocalTimeStamp=Date.now(),function t(){e._ultraGroupTimer=setTimeout((function(){Date.now()-e._lastSyncUltraMsgLocalTimeStamp>=18e4&&e._syncUltraMsg(e._lastSyncUltraMsgTimeStamp),e._stopUltraSyncInterval(),t()}),3e4)}()},n.prototype._stopUltraSyncInterval=function(){-1!==this._ultraGroupTimer&&(clearTimeout(this._ultraGroupTimer),this._ultraGroupTimer=-1)},n.prototype._notificationOnline=function(){return uc(this,void 0,void 0,(function(){var e,t,n,r=this;return dc(this,(function(i){switch(i.label){case 0:return this._isConnected?[4,this._fetchUltraMsg(0)]:[2];case 1:return e=i.sent(),t=e.code,n=e.data,t===Cd.SUCCESS&&n?(this.logger.info(Fd.L_NOTIFY_ULTRA_ONLINE_S,"Notify ultra group online success."),this._getUltraGroupList(0),-1===this._ultraGroupTimer&&this._startUltraSyncInterval(),[2]):(this.logger.warn(Fd.L_NOTIFY_ULTRA_ONLINE_S,"Notify ultra group online failured, try again."),setTimeout((function(){r._notificationOnline()}),3e3),[2])}}))}))},n.prototype._fetchUltraMsg=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u;return dc(this,(function(d){switch(d.label){case 0:return t=this._connMgr.codec.encodeSuperSyncMsg(e),n=new FM(jM[jM.pullUgMsg],t,this.currentUserId),r=this.logger.createTraceId(),this.logger.info(Fd.L_PULL_ULTRA_MSG_T,JSON.stringify({timestamp:e}),r),[4,this._connMgr.send(n,bU,{currentUserId:this.currentUserId,conversation:{conversationType:Od.ULTRA_GROUP}})];case 1:return i=d.sent(),o=i.code,s=i.data,o===Cd.SUCCESS&&s?(a=s.list,c=s.syncTime,u=a.map((function(e){return e.messageUId})).join(","),this.logger.info(Fd.L_PULL_ULTRA_MSG_R,JSON.stringify({code:o,messageUIds:u,timestamp:e,syncTime:c}),r)):this.logger.warn(Fd.L_PULL_ULTRA_MSG_R,JSON.stringify({code:o,timestamp:e}),r),[2,{code:o,data:s}]}}))}))},n.prototype._getUltraGroup=function(e,t,n){var r=e.targetId,i=e.messageType,o=e.channelId,s=e.isCounted,a=e.channelType,c=e.sentTime,u=e.senderUserId,d=this._ultraGroupMap["".concat(o,"_").concat(r)],l=d||{conversationType:Od.ULTRA_GROUP,targetId:r,channelId:o,unreadMessageCount:0,unreadMentionedCount:0,notificationStatus:wd.CLOSE,notificationLevel:Pd.NOT_SET,isTop:!1};return s&&u!==this.currentUserId&&(l.unreadMessageCount>0&&i===Ud.RECALL&&(l.unreadMessageCount-=1),i!==Ud.RECALL&&(l.unreadMessageCount+=1,l.unreadMentionedCount+=t,l.firstUnreadMessage||(l.firstUnreadMessage={sentTime:c}))),l.versionTime=n,l.latestMessage=e,l.channelType=a,d||(this._ultraGroupMap["".concat(o,"_").concat(r)]=l),l},n.prototype._syncUltraMsg=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,d=this;return dc(this,(function(l){switch(l.label){case 0:return!this._isConnected||this._isUltraPulling?[2]:(this._isUltraPulling=!0,[4,this._fetchUltraMsg(e)]);case 1:return t=l.sent(),n=t.code,r=t.data,this._lastSyncUltraMsgLocalTimeStamp=Date.now(),this._isUltraPulling=!1,n===Cd.SUCCESS&&r?(i=r.list,o=r.syncTime,s=r.finished,a={},c=[],i.forEach((function(e){var t,n,r,i=e.targetId,s=e.content,u=e.messageUId,l=e.channelId;if(d._ultraMsgMap[u])delete d._ultraMsgMap[u];else{var h=0;((null===(t=null==s?void 0:s.mentionedInfo)||void 0===t?void 0:t.type)===Bd.ALL||(null===(r=null===(n=null==s?void 0:s.mentionedInfo)||void 0===n?void 0:n.userIdList)||void 0===r?void 0:r.includes(d.currentUserId)))&&(h=1);var f=d._getUltraGroup(e,h,o);a["".concat(l,"_").concat(i)]=f,d._ultraGroupManager.addUltraGroupStatus(f),c.push(e)}})),Object.keys(a).length>0&&(this.logger.debug(Fd.O,"notice ultragroups"),u=Object.values(a),u=eb(u),this._watcher.conversation(FE(u))),this.logger.debug(Fd.O,"notice ultragroup message"),this._batchMessage(c),this._ultraGroupTimeQue=this._ultraGroupTimeQue.filter((function(e){return e>o})),this._lastSyncUltraMsgTimeStamp=o,(!s||this._ultraGroupTimeQue.length>0)&&this._syncUltraMsg(o),[2]):[2]}}))}))},n.prototype.sendUltraMessage=function(t,n,r,i){return uc(this,void 0,void 0,(function(){var o,s,a,c,u,d,l,h,f,g,p;return dc(this,(function(v){switch(v.label){case 0:return this._isConnected?("RC:SRSMsg"===n.messageType&&this.logger.warn(Fd.O,"ultra group -> direction message convert to message"),n=this._handleMsgProperties(n,!0),o=n.messageId?n.messageId:bE(),n.messageId=o,s=this._connMgr.codec.encodeUpMsg({conversationType:Od.ULTRA_GROUP,targetId:t},n),(a=new GM(jM[jM.ugMsg],s,t)).setHeaderQos(qA.AT_LEAST_ONCE),c=this._connMgr.getCrtServerTime(),u=$w(Od.ULTRA_GROUP,t,cc({},n),"",c,this.currentUserId,o),r&&r(o),this.logger.info(Fd.L_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:Od.ULTRA_GROUP,targetId:t,channelId:n.channelId}),i),[4,this._connMgr.send(a)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return d=v.sent(),l=d.code,h=d.data,l!==Cd.SUCCESS?(this.logger.warn(Fd.L_SEND_MSG_R,JSON.stringify({code:l,messageUId:u.messageUId,messageId:u.messageId}
1),i),u.sentStatus=e.SentStatus.FAILED,[2,{code:l,data:u}]):(this.logger.info(Fd.L_SEND_MSG_R,JSON.stringify({code:l,messageUId:null==h?void 0:h.messageUId,messageId:null==h?void 0:h.messageId}),i),f=h,u.sentTime=f.timestamp,u.messageUId=f.messageUId,this._ultraMsgMap[f.messageUId]=f.timestamp,g=n.channelId||"",(p=this._ultraGroupMap["".concat(g,"_").concat(t)])?(p.latestMessage=u,ll(p.channelType)&&(u.channelType=p.channelType)):(p={conversationType:Od.ULTRA_GROUP,targetId:t,channelId:g,unreadMessageCount:0,unreadMentionedCount:0,versionTime:u.sentTime,latestMessage:u,notificationStatus:wd.CLOSE,notificationLevel:Pd.NOT_SET,isTop:!1},this._ultraGroupMap["".concat(g,"_").concat(t)]=p,this._ultraGroupManager.addUltraGroupStatus(p)),this._watcher.conversation(FE([p])),[2,{code:l,data:u}])}}))}))},n.prototype.sendUltraGroupTypingStatus=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return this._isConnected?(n=e.conversationType,r=e.channelId,i=e.targetId,o=this._connMgr.codec.encodeOperateStatus(i,n,r||"",t||0),(s=new GM(jM[jM.operate],o,i)).setHeaderQos(qA.AT_LEAST_ONCE),[4,this._connMgr.send(s)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return(a=c.sent().code)!==Cd.SUCCESS?[2,{code:a,msg:Cd[a]}]:[2,{code:a}]}}))}))},n.prototype.getUltraGroupMessageListByMessageUId=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return this._isConnected?e.messages&&e.messages.length<1||e.messages&&e.messages.length>20?[2,{code:Cd.MSG_LIMIT_ERROR}]:(t={},e.messages.forEach((function(e){t[e.messageUId]=void 0})),n=this._connMgr.codec.encodeMsgQuery(e),(r=new FM(jM[jM.qryMsg],n,this.currentUserId)).setHeaderQos(qA.AT_LEAST_ONCE),[4,this._connMgr.send(r,zL,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return i=c.sent(),o=i.code,s=i.data,o!==Cd.SUCCESS?[2,{code:o,msg:Cd[o]}]:(a=(s||{}).list,Array.isArray(a)&&a.forEach((function(e){var n=e.messageUId;t[n]=e})),[2,{code:0,data:t}])}}))}))},n.prototype._pullOperateStatusNotify=function(e){if(this._isConnected){var t=this._connMgr.codec.decodeByPBName(e.data,XL),n=t.conversationType,r=t.info,i=t.summary;this.logger.debug(Fd.O,"s_opNtf -> type: ".concat(n,", info: ").concat(r,", summary: ").concat(i)),this._watcher.operateStatus(t)}},n.prototype.expandUltraMessage=function(e){return uc(this,void 0,void 0,(function(){var t,n,r;return dc(this,(function(i){switch(i.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodeExpandUltraMessage(e,this.currentUserId),(n=new FM(jM[jM.upMsgEx],t,e.targetId)).setHeaderQos(qA.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return(r=i.sent().code)!==Cd.SUCCESS?[2,{code:r,msg:Cd[r]}]:[2,{code:r}]}}))}))},n.prototype.modifyMessage=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return this._isConnected?(t=this._connMgr.codec.encodemodifyMessage(e,this.currentUserId),(n=new FM(jM[jM.modifyMsg],t,e.targetId)).setHeaderQos(qA.AT_LEAST_ONCE),[4,this._connMgr.send(n)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return r=a.sent(),i=r.code,o=r.data,i!==Cd.SUCCESS?[2,{code:i,msg:Cd[i]}]:(s=o,this._ultraMsgMap[s.messageUId]=s.timestamp,[2,{code:i}])}}))}))},n.prototype._pullUltraChangeMessageList=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return this._isConnected?this._isPullingUltraChangeMessage?[2]:(this._isPullingUltraChangeMessage=!0,t=this._connMgr.codec.encodeQueryMsgChange(e),(n=new FM(jM[jM.qryMsgChange],t,this.currentUserId)).setHeaderQos(qA.AT_LEAST_ONCE),[4,this._connMgr.send(n,JL)]):[2];case 1:return r=l.sent(),i=r.code,o=r.data,this._isPullingUltraChangeMessage=!1,i===Cd.SUCCESS&&o?(s=o.hasNext,a=o.list,c=(null==o?void 0:o.syncTime)||0,this._handleUltraChangeList(a),u=this._pullUltraChangeMessageQue.filter((function(e){return e>c})),this._pullUltraChangeMessageQue.length=0,(d=this._pullUltraChangeMessageQue).push.apply(d,u),s?this._pullUltraChangeMessageList(c):this._lastPullingUltraChangeMessageTime=c,[2]):[2]}}))}))},n.prototype._handleUltraChangeList=function(e){var t={};e.forEach((function(e){var n=e.changeType;t[n]||(t[n]=[]),t[n].push(e)}));var n=el.CHANNEL_CHANGE,r=el.MSG_RECALL,i=el.MSG_EXPANSION,o=el.MSG_MODIFY,s=el.USER_GROUP_CHANGE;t[n]&&this._handleUltraChannelChange(t[n]),t[r]&&this._handleMsgRecall(t[r]),t[i]&&this._handleMsgUpdate(t[i]),t[o]&&this._handleMsgUpdate(t[o]),t[s]&&this._handleUserGroupStatus(t[s])},n.prototype._handleUltraChannelChange=function(t){var n=this,r=[],i=[],o=[];t.forEach((function(t){var s=t.subChangeType,a=t.targetId,c=t.channelId,u=t.sendTime,d=t.operatorId,l="".concat(c,"_").concat(a),h=n._ultraGroupMap[l];if(h){var f=tl.PUBLIC_TO_PRIVATE,g=tl.PRIVATE_TO_PUBLIC,p=tl.PUBLIC_TO_PRIVATE_USER_NOT_IN,v=tl.CHANNEL_DELETE,_=tl.CHANNEL_USER_KICKED;switch(s){case g:h.channelType=e.UltraGroupChannelType.PUBLIC,r.push({targetId:a,channelId:c,changeType:e.UltraGroupChannelChangeType.PRIVATE_TO_PUBLIC,channelType:h.channelType});break;case f:h.channelType=e.UltraGroupChannelType.PRIVATE,r.push({targetId:a,channelId:c,changeType:e.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE,channelType:h.channelType});break;case p:r.push({targetId:a,channelId:c,changeType:e.UltraGroupChannelChangeType.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:h.channelType}),delete n._ultraGroupMap[l];break;case v:i.push({targetId:a,channelId:c,channelType:h.channelType,deleteTime:u}),delete n._ultraGroupMap[l];break;case _:o.push({targetId:a,channelId:c,userId:d,channelType:e.UltraGroupChannelType.PRIVATE}),d===n.currentUserId&&delete n._ultraGroupMap[l]}}})),r.length>0&&this._watcher.ultraGroupChannelChangeType(r),i.length>0&&this._watcher.ultraGroupChannelDelete(i),o.length>0&&this._watcher.ultraGroupChannelUserKicked(o)},n.prototype._handleMsgRecall=function(e){var t=this,n=[];e.forEach((function(e){var r=e.targetId,i=e.channelId,o=e.messageUId,s=e.sendTime,a=e.conversationType,c=e.operatorId;t._updateUltraGroupWhenRecallMsg(r,i,o,s),n.push({targetId:r,conversationType:a,sentTime:s,messageUId:o,senderUserId:c,channelId:i,content:{conversationType:a,targetId:r,messageUId:o,channelId:i},messageDirection:1,messageType:Ud.RECALL,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:0})})),this._watcher.ultraGroupMessageRecalled(n)},n.prototype._handleMsgUpdate=function(e){var t={};for(var n in e.forEach((function(e){var n=e.targetId,r=e.conversationType,i=e.sendTime,o=e.messageUId,s=e.channelId,a="".concat(r,"_").concat(n);t[a]||(t[a]=[]),t[a].push({messageUId:o,channelId:s,sendTime:i})}
1)),t){var r=n.split("_"),i=r.shift(),o=r.join("_");this._pullUltraMessageList(e[0].changeType,{targetId:o,conversationType:Number(i),messages:lc([],t[n],!0)})}},n.prototype._pullUltraMessageList=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o,s,a,c,u=this;return dc(this,(function(d){switch(d.label){case 0:return this._isConnected?(n=this._connMgr.codec.encodeMsgQuery(t),(r=new FM(jM[jM.qryMsg],n,this.currentUserId)).setHeaderQos(qA.AT_LEAST_ONCE),[4,this._connMgr.send(r,zL,{connectedTime:this._connMgr.getConnectedTime(),currentUserId:this.currentUserId})]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return i=d.sent(),o=i.code,s=i.data,o!==Cd.SUCCESS?[2,{code:o,msg:Cd[o]}]:(a=(s||{}).list,c=[],Array.isArray(a)&&a.forEach((function(e){var t=e.targetId,n=e.channelId,r=e.messageUId,i=u._ultraGroupMap["".concat(n,"_").concat(t)];i&&i.latestMessage.messageUId===r&&(i.latestMessage=e),c.push(e)})),e===el.MSG_EXPANSION&&this._watcher.ultraGroupMessageExpansionUpdated(c),e===el.MSG_MODIFY&&this._watcher.ultraGroupMessageModified(c),[2])}}))}))},n.prototype._handleUserGroupStatus=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,d,l;return dc(this,(function(h){return t=nl.REMOVE_USER_GROUP,n=nl.JOIN_USER_GROUP,r=nl.EXIT_USER_GROUP,i=nl.CHANNEL_BIND_USER_GROUP,o=nl.CHANNEL_UNBIND_USER_GROUP,s=[],a=[],c=[],u=[],d=[],e.forEach((function(e){var l=e.conversationType,h=e.targetId,f=e.userGroupIds,g=e.busChannelType,p=e.channelId;switch(e.subChangeType){case t:s.push({conversation:{conversationType:l,targetId:h},userGroupIds:f});break;case n:a.push({conversation:{conversationType:l,targetId:h},userGroupIds:f});break;case r:c.push({conversation:{conversationType:l,targetId:h},userGroupIds:f});break;case i:u.push({conversation:{conversationType:l,targetId:h,channelId:p},channelType:g,userGroupIds:f});break;case o:d.push({conversation:{conversationType:l,targetId:h,channelId:p},channelType:g,userGroupIds:f})}})),l={},s.length>0&&(l.userGroupDisband=s),a.length>0&&(l.userAdded=a),c.length>0&&(l.userRemoved=c),u.length>0&&(l.userGroupBindChannel=u),d.length>0&&(l.userGroupUnBindChannel=d),this._watcher.userGroupStatus(l),[2]}))}))},n.prototype.getUltraHistoryMsg=function(e,t,n){var r;return uc(this,void 0,void 0,(function(){var i,o,s,a,c,u;return dc(this,(function(d){switch(d.label){case 0:return this._isConnected?(i=this._connMgr.codec.encodeGetHistoryMsg(e,t),o=new FM(jM[jM.qryUgMsg],i,this.currentUserId),this.logger.info(Fd.L_GET_HISTORY_MSG_T,JSON.stringify({targetId:e,conversationType:Od.ULTRA_GROUP,channelId:t.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,this._connMgr.send(o,kU,{currentUserId:this.currentUserId,conversation:{conversationType:Od.ULTRA_GROUP,targetId:e}})]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return s=d.sent(),a=s.code,c=s.data,a===Cd.SUCCESS&&c?(u=[],null===(r=c.list)||void 0===r||r.forEach((function(e){e&&u.push(e.messageUId)})),this.logger.info(Fd.L_GET_HISTORY_MSG_R,JSON.stringify({code:a,messageUIds:u.join(",")}),n),[2,{code:a,data:c}]):(this.logger.warn(Fd.L_GET_HISTORY_MSG_R,JSON.stringify({code:a,messageUIds:""}),n),[2,{code:a}])}}))}))},n.prototype.setUltraGroupDefaultNotificationLevel=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return this._isUltraGroupListExist?this._isConnected?(r=this._connMgr.codec.encodeSetUltraGroupDefaultNotificationLevel(t,n),i=new FM(jM[jM.ugUnpushSet],r,e),[4,this._connMgr.send(i)]):[2,{code:Cd.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:Cd.METHOD_NOT_AVAILABLE})];case 1:return o=a.sent(),s=o.code,Cd.SUCCESS,[2,{code:s}]}}))}))},n.prototype.getUltraGroupDefaultNotificationLevel=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return this._isUltraGroupListExist?this._isConnected?(n=this._connMgr,r=n.codec.encodeGetUltraGroupDefaultNotificationLevel(t),i=new FM(jM[jM.ugUnpushQuery],r,e),[4,n.send(i,LL)]):[2,{code:Cd.RC_NET_UNAVAILABLE}]:[2,Promise.resolve({code:Cd.METHOD_NOT_AVAILABLE})];case 1:return o=u.sent(),s=o.code,a=o.data,s===Cd.SUCCESS&&a?(c=a.unpushLevel,[2,{code:s,data:c}]):[2,{code:s}]}}))}))},n.prototype._updateUltraGroupWhenRecallMsg=function(e,t,n,r){var i="".concat(t,"_").concat(e);
1if(this._ultraGroupMap[i]){var o=this._ultraGroupMap[i],s=o.latestMessage;s&&s.messageUId===n&&(o.latestMessage=null)}},n.prototype.getAllConversationState=function(){return Promise.resolve({code:Cd.SUCCESS,data:this._conversationManager.getAllConversationState()})},n.prototype.getUltraGroupUnreadMentionedMessages=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o;return dc(this,(function(s){switch(s.label){case 0:return this._isConnected?this._isUltraGroupListExist?(t=this._connMgr.codec.encodeUnreadMentionedMsgQuery(e),n=new FM(jM[jM.qryUgUal],t,this.currentUserId),[4,this._connMgr.send(n,UL)]):[2,Promise.resolve({code:Cd.METHOD_NOT_AVAILABLE})]:[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return r=s.sent(),i=r.code,o=r.data,i===Cd.SUCCESS&&o?[2,{code:i,data:o}]:[2,{code:i}]}}))}))},n.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i;return dc(this,(function(o){return this._isConnected?this._isUltraGroupListExist?(t=e.targetId,n=e.channelId,r=this._ultraGroupMap["".concat(n,"_").concat(t)]||{},i=r.firstUnreadMessage||null,[2,{code:Cd.SUCCESS,data:i}]):[2,Promise.resolve({code:Cd.METHOD_NOT_AVAILABLE})]:[2,{code:Cd.RC_NET_UNAVAILABLE}]}))}))},n.prototype.bindRTCRoomForChatroom=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i;return dc(this,(function(o){switch(o.label){case 0:return this._isConnected?(t=e.chatRoomId,n=this._connMgr.codec.encodebindRTCRoomForChatroom(e),r=new FM(jM[jM.setRtcRoomId],n,t),[4,this._connMgr.send(r)]):[2,Cd.RC_NET_UNAVAILABLE];case 1:return i=o.sent(),[2,i.code]}}))}))},n.prototype.rtcSignaling=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return this._isConnected?(i=r instanceof ArrayBuffer?Array.prototype.slice.call(new Int8Array(r)):r,o=n?new FM(t,i,e):new GM(t,i,e),[4,this._connMgr.send(o)]):[2,{code:Cd.RC_NET_UNAVAILABLE}];case 1:return s=u.sent(),a=s.code,c=s.data,[2,{code:a,buffer:null==c?void 0:c.data}]}}))}))},n.prototype.rtcPing=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return r=ow(this.rtcCodec,t,n),[4,this.rtcSignaling(e,jM[jM.rtcPing],!0,r)];case 1:return i=c.sent(),o=i.code,s=i.buffer,(a=s?this.rtcCodec.decode(aI.RtcOutput,s):null).version=NE(a.version),[2,{code:o,data:a}]}}))}))},n.prototype.getDeviceId=function(){return TU(this.runtime)},n.prototype.getOSInfo=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,{code:Cd.NOT_SUPPORT}]}))}))},n.prototype.getProcessInfo=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,{code:Cd.NOT_SUPPORT}]}))}))},n.prototype.getMainProcessInfo=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,{code:Cd.NOT_SUPPORT}]}))}))},n.prototype.destroy=function(){Ew()},n.prototype.callExtra=function(e){return Promise.resolve({code:Cd.EXTRA_METHOD_UNDEFINED})},n.prototype.getConversationListWithAllChannel=function(){throw new Error("Method not implemented.")},n.prototype.getConversationListWithAllChannelByPage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getConversationsByPage=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.getHistoryMessagesByObjectNames=function(e,t,n,r,i,o,s){throw new Error("Method not implemented.")},n.prototype.clearConversations=function(){throw new Error("Method not implemented.")},n.prototype.setUserStatusListener=function(e,t){throw new Error("Method not implemented.")},n.prototype.setUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.subscribeUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.getUserStatus=function(e){throw new Error("Method not implemented.")},n.prototype.addToBlacklist=function(e){throw new Error("Method not implemented.")},n.prototype.removeFromBlacklist=function(e){throw new Error("Method not implemented.")},n.prototype.getBlacklist=function(){throw new Error("Method not implemented.")},n.prototype.getBlacklistStatus=function(e){throw new Error("Method not implemented.")},n.prototype.insertMessage=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.batchInsertMessage=function(e,t){throw new Error("Method not implemented.")},n.prototype.getMessageCount=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.deleteMessages=function(e){throw new Error("Method not implemented.")},n.prototype.deleteMessagesByTimestamp=function(e,t,n,r,i){throw new Error("Method not implemented.")},n.prototype.clearMessages=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.getMessage=function(e){throw new Error("Method not implemented.")},n.prototype.setMessageContent=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.setMessageSearchField=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.searchConversationByContent=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.searchConversationByContentWithAllChannel=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.searchMessageByContent=function(e,t,n,r,i,o){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentWithAllChannel=function(e,t,n,r,i){throw new Error("Method not implemented.")},n.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,r,i,o,s){throw new Error("Method not implemented.")},n.prototype.getUnreadMentionedMessages=function(e,t){throw new Error("Method not implemented.")},n.prototype.setMessageSentStatus=function(e,t){throw new Error("Method not implemented.")},n.prototype.updateMessageReceiptStatus=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.setMessageReceivedStatus=function(e,t){throw new Error("Method not implemented.")},n.prototype.clearData=function(){throw new Error("Method not implemented.")},n.prototype.clearUnreadCountByTimestamp=function(e,t,n,r){throw new Error("Method not implemented.")},n.prototype.setCallInfo=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.getGroupMessageDeliverList=function(e,t,n){throw new Error("Method not implemented.")},n.prototype.getPrivateMessageDeliverTime=function(e,t){throw new Error("Method not implemented.")},n.prototype.setCheckDuplicateMessage=function(e){throw new Error("Method not implemented.")},n.prototype.setProxy=function(e){return Promise.resolve({code:Cd.NOT_SUPPORT})},n.prototype.getProxy=function(){return Promise.resolve({code:Cd.NOT_SUPPORT})},n.prototype.testProxy=function(e,t){return Promise.resolve({status:Cd.NOT_SUPPORT})},n}(bI),nb=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ac(t,e),t.prototype.joinRTCRoom=function(e,t,n,r,i,o){return uc(this,void 0,void 0,(function(){var s,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return s=ow(this._context.rtcCodec,t,n,r,i,o),[4,this.rtcSignaling(e,uI,!0,s)];case 1:return a=l.sent(),c=a.code,u=a.buffer,c===Cd.SUCCESS&&u&&(d=sw(this._context.rtcCodec,u)),[2,{c
1ode:c,data:d}]}}))}))},t.prototype.quitRTCRoom=function(e){return uc(this,void 0,void 0,(function(){var t;return dc(this,(function(n){switch(n.label){case 0:return t=this._context.rtcCodec.encode(aI.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,dI,!0,t)];case 1:return[2,n.sent().code]}}))}))},t.prototype.rtcPing=function(e,t,n){return uc(this,void 0,void 0,(function(){return dc(this,(function(r){switch(r.label){case 0:return[4,this._context.rtcPing(e,t,n)];case 1:return[2,r.sent().code]}}))}))},t.prototype.rtcPingResVersion=function(e,t,n){return this._context.rtcPing(e,t,n)},t.prototype.getRTCRoomInfo=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o;return dc(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(aI.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,lI,!0,t)];case 1:return n=s.sent(),r=n.code,i=n.buffer,r===Cd.SUCCESS&&i&&(o=this._context.rtcCodec.decode(aI.RtcRoomInfoOutput,i)),[2,{code:r,data:o}]}}))}))},t.prototype.getRTCUserInfoList=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return t=this._context.rtcCodec.encode(aI.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,hI,!0,t)];case 1:return n=a.sent(),r=n.code,i=n.buffer,r===Cd.SUCCESS&&i&&(s=sw(this._context.rtcCodec,i),o={users:s.users}),[2,{code:r,data:o}]}}))}))},t.prototype.getRTCUserInfo=function(e){throw new Error("Method not implemented.")},t.prototype.setRTCUserInfo=function(e,t,n){return uc(this,void 0,void 0,(function(){var r;return dc(this,(function(i){switch(i.label){case 0:return r=this._context.rtcCodec.encode(aI.RtcValueInfo,{key:t,value:n}),[4,this.rtcSignaling(e,fI,!0,r)];case 1:return[2,i.sent().code]}}))}))},t.prototype.removeRTCUserInfo=function(e,t){return uc(this,void 0,void 0,(function(){var n;return dc(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(aI.RtcKeyDeleteInput,{key:t}),[4,this.rtcSignaling(e,gI,!1,n)];case 1:return[2,r.sent().code]}}))}))},t.prototype.setRTCData=function(e,t,n,r,i,o){return uc(this,void 0,void 0,(function(){var s;return dc(this,(function(a){switch(a.label){case 0:return s=this._context.rtcCodec.encode(aI.RtcSetDataInput,{interior:r,target:i,key:t,value:n,objectName:null==o?void 0:o.name,content:null==o?void 0:o.content}),[4,this.rtcSignaling(e,pI,!1,s)];case 1:return[2,a.sent().code]}}))}))},t.prototype.setRTCTotalRes=function(e,t,n,r,i){return void 0===i&&(i=""),uc(this,void 0,void 0,(function(){var o,s;return dc(this,(function(a){switch(a.label){case 0:return o={objectName:r,content:this._context.rtcCodec.encode(aI.RtcValueInfo,{key:t.name,value:t.content},!0),valueInfo:[this._context.rtcCodec.encode(aI.RtcValueInfo,{key:"uris",value:n},!0),this._context.rtcCodec.encode(aI.RtcValueInfo,{key:"mcu_uris",value:i},!0)]},s=this._context.rtcCodec.encode(aI.RtcUserSetDataInput,o),[4,this.rtcSignaling(e,vI,!0,s)];case 1:return[2,a.sent().code]}}))}))},t.prototype.setRTCCDNUris=function(e,t,n){return uc(this,void 0,void 0,(function(){var r;return dc(this,(function(i){switch(i.label){case 0:return r=this._context.rtcCodec.encode(aI.RtcUserSetDataInput,{objectName:t,valueInfo:this._context.rtcCodec.encode(aI.RtcValueInfo,{key:"cdn_uris",value:n},!0)}),[4,this.rtcSignaling(e,vI,!0,r)];case 1:return[2,i.sent().code]}}))}))},t.prototype.getRTCData=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s,a,c,u;return dc(this,(function(d){switch(d.label){case 0:return i=this._context.rtcCodec.encode(aI.RtcDataInput,{interior:n,target:r,key:t}),[4,this.rtcSignaling(e,_I,!0,i)];case 1:return o=d.sent(),s=o.code,a=o.buffer,s===Cd.SUCCESS&&a?(c=this._context.rtcCodec.decode(aI.RtcQryOutput,a).outInfo,u={},c.forEach((function(e){u[e.key]=e.value})),[2,{code:s,data:u}]):[2,{code:s}]}}))}))},t.prototype.removeRTCData=function(e,t,n,r,i){return uc(this,void 0,void 0,(function(){var o;return dc(this,(function(s){switch(s.label){case 0:return o=this._context.rtcCodec.encode(aI.RtcDataInput,{interior:n,target:r,key:t,objectName:null==i?void 0:i.name,content:null==i?void 0:i.content}),[4,this.rtcSignaling(e,EI,!1,o)];case 1:return[2,s.sent().code]}}))}))},t.prototype.setRTCOutData=function(e,t,n,r){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))},t.prototype.getRTCOutData=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){throw new Error("JSEngine's method not implemented.")}))}))},t.prototype.getRTCToken=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return r=ow(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,mI,!0,r)];case 1:return i=c.sent(),o=i.code,s=i.buffer,o===Cd.SUCCESS&&s?(a=this._context.rtcCodec.decode(aI.RtcTokenOutput,s).rtcToken,[2,{code:o,data:{rtcToken:a}}]):[2,{code:o}]}}))}))},t.prototype.setRTCState=function(e,t){return uc(this,void 0,void 0,(function(){var n;return dc(this,(function(r){switch(r.label){case 0:return n=this._context.rtcCodec.encode(aI.MCFollowInput,{state:t}),[4,this.rtcSignaling(e,II,!0,n)];case 1:return[2,r.sent().code]}}))}))},t.prototype.getRTCUserList=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o;return dc(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(aI.RtcQueryListInput,{order:2}),[4,this.rtcSignaling(e,TI,!0,t)];case 1:return n=s.sent(),r=n.code,i=n.buffer,r===Cd.SUCCESS&&i?(o=sw(this._context.rtcCodec,i),[2,{code:r,data:o}]):[2,{code:r}]}}))}))},t.prototype.joinLivingRoomAsAudience=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s,a,c,u;return dc(this,(function(d){switch(d.label){case 0:return r=ow(this._context.rtcCodec,t,n),[4,this.rtcSignaling(e,yI,!0,r)];case 1:return i=d.sent(),o=i.code,s=i.buffer,o===Cd.SUCCESS&&s?(a=this._context.rtcCodec.decode(aI.RtcViewerJoinedOutput,s),c=a.rtcToken,u=a.entries,[2,{code:o,data:{token:c,kvEntries:u}}]):[2,{code:o}]}}))}))},t.prototype.quitLivingRoomAsAudience=function(e){return uc(this,void 0,void 0,(function(){var t,n;return dc(this,(function(r){switch(r.label){case 0:return t=this._context.rtcCodec.encode(aI.SetUserStatusInput,{status:0}),[4,this.rtcSignaling(e,RI,!0,t)];case 1:return n=r.sent().code,this._context.rtcKVManager.reset(),[2,n]}}))}))},t.prototype.rtcIdentityChange=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return r=this._context.rtcCodec.encode(aI.RtcInput,{roomType:rl.LIVE,broadcastType:n,identityChangeType:t,needSysChatroom:!1}),[4,this.rtcSignaling(e,SI,!0,r)];case 1:return i=c.sent(),o=i.code,s=i.buffer,o===Cd.SUCCESS&&s?(a=sw(this._context.rtcCodec,s),[2,{code:o,data:a}]):[2,{code:o}]}}))}))},t.prototype.requestRoomPK=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteTimeout,o=e.inviteInfo,s=e.roomId,a=this._context.rtcCodec.encode(aI.RtcInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,timeoutTime:i,inviteInfo:o}),[4,this.rtcSignaling(s,OI,!0,a)];case 1:return c=u.sent().code,this._context.rtcKVManager.reset(),[2,c]}}))}))},t.prototype.cancelRoomPK=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return t=e.invitedRoomId,n=e.invitedUserId,r=e.inviteSessionId,i=e.inviteInfo,o=e.roomId,s=this._context.rtcCodec.encode(aI.RtcCancelInviteInput,{invitedRoomId:t,invitedUserId:n,inviteSessionId:r,inviteInfo:i}),[4,this.rtcSignaling(o,NI,!0,s)];case 1:return a=c.sent().code,this._context.rtcKVManager.reset(),[2,a]}}))}))},t.prototype.responseRoomPK=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return t=e.inviteUserId,n=e.inviteRoomId,r=e.inviteSessionId,i=e.content,o=e.ke
1y,s=e.value,a=e.agree,c=e.roomId,u=this._context.rtcCodec.encode(aI.RtcInviteAnswerInput,{inviteUserId:t,inviteRoomId:n,inviteSessionId:r,content:i,key:o,value:s,answerCode:a?1:0}),[4,this.rtcSignaling(c,AI,!0,u)];case 1:return d=l.sent().code,this._context.rtcKVManager.reset(),[2,d]}}))}))},t.prototype.endRoomPK=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return t=e.endRoomId,n=e.sessionId,r=e.content,i=e.keys,o=e.roomId,s=this._context.rtcCodec.encode(aI.RtcEndInviteInput,{inviteRoomId:t,inviteSessionId:n,inviteContent:r,inviteRoomKeys:i}),[4,this.rtcSignaling(o,MI,!0,s)];case 1:return a=c.sent().code,this._context.rtcKVManager.reset(),[2,a]}}))}))},t.prototype.registerRTCSignalListener=function(e){this._context.registerRTCSignalingListener(e)},t.prototype.rtcSignaling=function(e,t,n,r){return this._context.rtcSignaling(e,t,n,r)},t.prototype.getRTCJoinedUserInfo=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o;return dc(this,(function(s){switch(s.label){case 0:return t=this._context.rtcCodec.encode(aI.RtcQueryUserJoinedInput,{userId:e}),[4,this.rtcSignaling("",UI,!0,t)];case 1:return n=s.sent(),r=n.code,i=n.buffer,r===Cd.SUCCESS&&i?(o=this._context.rtcCodec.decode(aI.RtcQueryUserJoinedOutput,i).info||[],[2,{code:r,data:o.map((function(e){return{deviceId:e.deviceId,roomId:e.roomId,joinTime:NE(e.joinTime)}}))}]):[2,{code:r}]}}))}))},t}(oA);function rb(e){return cc({},e)}var ib,ob,sb,ab=function(){function t(t,n){var r,i,o;this._runtime=t,this._token="",this._pluginContextQueue=[],this._pluginInstanseMap={},this._versionInfo={},this._typingInfo={},this._compatibleMessageProccessor=((r={})[Ud.CHATROOM_JOIN]=this._processChatrormMessage.bind(this),r[Ud.CHATROOM_LEFT]=this._processChatrormMessage.bind(this),r[Ud.CHATROOM_MERGE_CHANGE]=this._processChrmMemChangeMessage.bind(this),r[Ud.TYPING_STATUS]=this._processTypingStatusMessage.bind(this),r[Ud.INTERCEPT]=this._processInterceptMessage.bind(this),r),this._messageProccessor=((i={})[Ud.READ_RECEIPT]=this._processReadReceiptMessage.bind(this),i[Ud.READ_RECEIPT_REQUEST]=this._processReadReceiptRequestMessage.bind(this),i[Ud.READ_RECEIPT_RESPONSE]=this._processReadReceiptResponseMessage.bind(this),i),this._watcher={message:void 0,batchMessage:void 0,conversationState:void 0,chatroomState:void 0,connection:void 0,expansion:void 0,tag:void 0,conversationTagChanged:void 0,pullFinished:void 0,readReceiptReceived:void 0,messageReceiptRequest:void 0,messageReceiptResponse:void 0,typingState:void 0,messageBlocked:void 0,ultraGroupEnable:void 0,operateStatus:void 0,ultraGroupMessageExpansionUpdated:void 0,ultraGroupMessageModified:void 0,ultraGroupMessageRecalled:void 0,messageDelivered:void 0,groupMessageDeliveredStatus:void 0,ultraGroupChannelChangeType:void 0,ultraGroupChannelUserKicked:void 0,ultraGroupChannelDelete:void 0,userGroupStatus:void 0},this._typingInternalTimer=-1,this._typingExpireTime=2e3,this._typingChangedList=[],this._registerMessageSearchPropsMapping={},this.getChatRoomHistoryMessages=this.getChatroomHistoryMessages,this._options=cc({},n),this.appkey=this._options.appkey,this._options.typingExpireTime&&(this._options.typingExpireTime<2e3?this._typingExpireTime=2e3:this._options.typingExpireTime>6e3?this._typingExpireTime=6e3:this._typingExpireTime=this._options.typingExpireTime),this._options.navigators=this._options.navigators.filter((function(e){return/^https?:\/\//.test(e)})),this._options.navigators=this._options.navigators.map((function(e){return e.replace(/\/$/g,"")})),0===this._options.navigators.length&&(o=this._options.navigators).push.apply(o,ja);var s={onConnected:this._onConnectionStatusChange.bind(this,e.RCConnectionStatus.CONNECTED),onConnecting:this._onConnectionStatusChange.bind(this,e.RCConnectionStatus.CONNECTING),onSuspend:this._onConnectionStatusChange.bind(this,e.RCConnectionStatus.SUSPENDED),onDisconnected:this._onConnectionStatusChange.bind(this,e.RCConnectionStatus.DISCONNECTED),batchMessage:this._batchMessageReceiver.bind(this),chatroom:this._chatroomInfoListener.bind(this),conversation:this._conversationInfoListener.bind(this),expansion:this._expansionInfoListener.bind(this),tag:this._tagListener.bind(this),conversationTag:this._conversationTagListener.bind(this),onRTCDataChange:this._rtcDataChange.bind(this),pullFinished:this._pullFinishedListener.bind(this),ultraGroupEnable:this._ultraGroupEnableListener.bind(this),operateStatus:this._operateStatusListener.bind(this),ultraGroupMessageExpansionUpdated:this._ultraGroupMessageExpansionUpdatedListener.bind(this),ultraGroupMessageModified:this._ultraGroupMessageModifiedListener.bind(this),ultraGroupMessageRecalled:this._ultraGroupMessageRecalledListener.bind(this),messageDelivered:this._messageDeliveredListerer.bind(this),groupMessageDeliveredStatus:this._groupMessageDeliveredStatusListerer.bind(this),callInfo:this._callInfoListener.bind(this),ultraGroupChannelChangeType:this._ultraGroupChannelChangeTypeListener.bind(this),ultraGroupChannelUserKicked:this._ultraGroupChannelUserKickedListener.bind(this),ultraGroupChannelDelete:this._ultraGroupChannelDeleteListener.bind(this),onNaviDataChange:this._naviDataChange.bind(this),userGroupStatus:this._userGroupStatusListener.bind(this)};this.rtcCodec=this.createCodec(LI,wI),this._engine=xE()?new RCCppEngine(t,this.rtcCodec,s,this._options):new tb(t,this.rtcCodec,s,this._options),this.logger=this._engine.getInnerLogger(),this.rtcKVManager=new cI(this._engine)}return t.init=function(e,n){return this._context?(this._context.logger.warn(Fd.A_INIT_REPEAT_O),this._context):(this._context=new t(e,n),this._context.logger.info(Fd.L_INIT_O,JSON.stringify({appkey:n.appkey,navigators:n.navigators,typingExpireTime:n.typingExpireTime})),this._context.logger.warn(Fd.L_IMSDK_VER_O,JSON.stringify({commitId:"b3c8dfd27d7bceefb4db934e16d30701f2c9195b",version:"5.7.7"})),this._context)},t.destroy=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){switch(e.label){case 0:return this._context?(this._context.logger.info(Fd.L_DESTROY_O),[4,this._context._destroy()]):[2];case 1:return e.sent(),this._context=void 0,[2]}}))}))},t.prototype.createCodec=function(e,t){return new xN(e,t)},t.prototype.install=function(e,t){var n=this.logger.createTraceId();if(this.logger.info(Fd.L_INSTALL_PLUGIN_T,JSON.stringify({tag:e.tag}),n),this._pluginInstanseMap[e.tag])return this.logger.warn(Fd.L_INSTALL_PLUGIN_R,"repeat install",n),this._pluginInstanseMap[e.tag];var r="RCRTC"===e.tag?new nb(this):new oA(this),i=null;try{if(!e.verify(this._runtime))return null;i=e.setup(r,this._runtime,t)}catch(e){this.logger.error(Fd.L_INSTALL_PLUGIN_R,null==e?void 0:e.stack,n)}return["RCRTC","RCCall"].includes(e.tag)&&e.version&&e.name&&(this._versionInfo[e.name]=e.version),i&&(this._pluginContextQueue.push(r),this._pluginInstanseMap[e.tag]=i),i},t.prototype._onConnectionStatusChange=function(e,t){var n,r;this.logger.warn(Fd.A_CONNECT_S,"status: ".concat(e,", code: ").concat(t)),null===(r=(n=this._watcher).connection)||void 0===r||r.call(n,e,t),this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onconnectionstatechange)||void 0===r||r.call(n,e,t)}))},t.prototype._processChatrormMessage=function(e){var t;if("function"==typeof this._watcher.chatroomState)return this._watcher.chatroomState({userChange:{users:(t={},t[e.senderUserId]="RC:ChrmQuitNtf"===e.messageType?Jd.QUIT:Jd.JOIN,t),chatroomId:e.targetId}}),!0},t.prototype._processChrmMemChangeMessage=function(e){if("function"==typeof this._watcher.chatroomState){var t={};Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status})),this._watcher.chatroomState({userChange:{users:t,chatroomId:e.targetId}})}return!0},t.prototype._processTypingStatusMessage=function(e){if(this._addTypingInfo(rb(e)),this._watcher.typingState)return!0},t.prototype._processInterceptMessage=function(t){var n={conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId||"",blockType:t.content.interceptType,blockedMessageUId:t.content.msgUId,extra:t.content.extra};if(t.conversationType===Od.ULTRA_GROUP){var r=t.content.sourceType;if(n.sourceType=r,(r===e.MessageBlockSourceType.MSG_EXPANSION||r===e.MessageBlockSourceType.MSG_MODIFY)&&t.content.sourceContent)try{n.sourceContent=JSON.parse(t.content.sourceContent)}catch(e){this.logger.warn(Fd.L_CALLBACK_E,JSON.stringify({source:"message.content.sourceContent",msg:e.message}))}}return this._MessageBlockedListener(n),!0},t.prototype._processReadReceiptMessage=function(e){"function"==typeof this._watcher.readReceiptReceived&&this._watcher.readReceiptReceived({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.content.lastMessageSendTime)},t.prototype._processReadReceiptRequestMessage=function(e){"function"==typeof this._watcher.messageReceiptRequest&&this._watcher.messageReceiptRequest({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.content.messageUId,e.senderUserId)},t.prototype._processReadReceiptResponseMessage=function(e){var t,n=null===(t=e.content)||void 0===t?void 0:t.receiptMessageDic,r=this._engine.getCurrentUserId();n&&Array.isArray(n[r])&&"function"==typeof this._watcher.messageReceiptResponse&&this._watcher.messageReceiptResponse({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId},e.senderUserId,n[r])},t.prototype._messageReceiver=function(e,t,n){var r,i,o,s,a=this;if(!(null===(i=(r=this._compatibleMessageProccessor)[e.messageType])||void 0===i?void 0:i.call(r,e))&&!this._pluginContextQueue.some((function(t){if(!t.onmessage)return!1;try{return t.onmessage(rb(e))}catch(e){return a.logger.error(Fd.A_MSG_LISTENER_E,null==e?void 0:e.stack),!1}}))){if(null===(s=(o=this._watcher).message)||void 0===s||s.call(o,rb(e),t,n),!this._messageProccessor[e.messageType])return e;this._messageProccessor[e.messageType](e)}},t.prototype._batchMessageReceiver=function(e,t,n){var r=this,i=[];e.forEach((function(e){var o=r._messageReceiver(e,t,n);o&&i.push(o)})),i.length&&this._watcher.batchMessage&&(this.logger.debug(Fd.L_BATCH_MESSAGE_O,i.map((function(e){return e.messageUId})).join(",")),this._watcher.batchMessage(i))},t.prototype._chatroomInfoListener=function(e){var t,n;null===(n=(t=this._watcher).chatroomState)||void 0===n||n.call(t,e)},t.prototype._conversationInfoListener=function(e){var t,n;null===(n=(t=this._watcher).conversationState)||void 0===n||n.call(t,e)},t.prototype._expansionInfoListener=function(e){var t,n;null===(n=(t=this._watcher).expansion)||void 0===n||n.call(t,e)},t.prototype._tagListener=function(){var e,t;null===(t=(e=this._watcher).tag)||void 0===t||t.call(e)},t.prototype._conversationTagListener=function(){var e,t;null===(t=(e=this._watcher).conversationTagChanged)||void 0===t||t.call(e)},t.prototype._typingStatusListener=function(e){var t,n;null===(n=(t=this._watcher).typingState)||void 0===n||n.call(t,e)},t.prototype._pullFinishedListener=function(){var e,t;null===(t=(e=this._watcher).pullFinished)||void 0===t||t.call(e)},t.prototype._MessageBlockedListener=function(e){var t,n;null===(n=(t=this._watcher).messageBlocked)||void 0===n||n.call(t,e)},t.prototype._messageDeliveredListerer=function(e){var t,n;null===(n=(t=this._watcher).messageDelivered)||void 0===n||n.call(t,e)},t.prototype._groupMessageDeliveredStatusListerer=function(e){var t,n;null===(n=(t=this._watcher).groupMessageDeliveredStatus)||void 0===n||n.call(t,e)},t.prototype._callInfoListener=function(e){var t=this;this._pluginContextQueue.forEach((function(n){try{n.onCallInfo&&n.onCallInfo(e)}catch(e){t.logger.warn(Fd.L_CALLBACK_E,null==e?void 0:e.stack)}}))},t.prototype._ultraGroupEnableListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupEnable)||void 0===n||n.call(t,e)},t.prototype._operateStatusListener=function(e){var t,n;null===(n=(t=this._watcher).operateStatus)||void 0===n||n.call(t,e)},t.prototype._ultraGroupMessageExpansionUpdatedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageExpansionUpdated)||void 0===n||n.call(t,e)},t.prototype._ultraGroupMessageModifiedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageModified)||void 0===n||n.call(t,e)},t.prototype._ultraGroupMessageRecalledListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupMessageRecalled)||void 0===n||n.call(t,e)},t.prototype._ultraGroupChannelChangeTypeListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelChangeType)||void 0===n||n.call(t,e)},t.prototype._ultraGroupChannelUserKickedListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelUserKicked)||void 0===n||n.call(t,e)},t.prototype._ultraGroupChannelDeleteListener=function(e){var t,n;null===(n=(t=this._watcher).ultraGroupChannelDelete)||void 0===n||n.call(t,e)},t.prototype._userGroupStatusListener=function(e){var t,n;null===(n=(t=this._watcher).userGroupStatus)||void 0===n||n.call(t,e)},t.prototype._rtcDataChange=function(e,t){this._pluginContextQueue.forEach((function(n){var r;null===(r=n.onrtcdatachange)||void 0===r||r.call(n,e,t)}))},t.prototype._naviDataChange=function(e){this._pluginContextQueue.forEach((function(t){var n;null===(n=t.onnavidatachange)||void 0===n||n.call(t,e)}))},t.prototype.assignWatcher=function(e){var t=this;Object.keys(this._watcher).forEach((function(n){if(Object.prototype.hasOwnProperty.call(e,n)){var r=e[n];t._watcher[n]=vl(r)||pl(r)?r:void 0}}))},t.prototype._resetWatcher=function(){var e=this;Object.keys(this._watcher).forEach((function(t){e._watcher[t]=void 0}))},t.prototype._addTypingInfo=function(e){var t=e.senderUserId,n=e.conversationType,r=e.targetId,i=e.content,o=e.channelId,s=i.typingContentType,a=o||"",c="".concat(n,"#").concat(r,"#").concat(a);this._typingInfo[c]||(this._typingInfo[c]=[]);var u=this._typingInfo[c].findIndex((function(e){return e.userId===t}));u>=0&&this._typingInfo[c][u].messageType===s?this._typingInfo[c][u].timestamp=Date.now():(u>=0&&this._typingInfo[c].splice(u,1),this._typingInfo[c].push({userId:t,messageType:s,timestamp:Date.now()}),this._typingChangedList.includes(c)||this._typingChangedList.push(c),this._startCheckTypingInfo())},t.prototype._startCheckTypingInfo=function(){var e=this;-1===this._typingInternalTimer&&0!==Object.keys(this._typingInfo).length&&(this._typingInternalTimer=setInterval((function(){for(var t in e._typingInfo){var n=e._typingInfo[t].length;e._typingInfo[t]=e._typingInfo[t].filter((function(t){return Date.now()-t.timestamp<e._t
1ypingExpireTime})),e._typingInfo[t].length===n||e._typingChangedList.includes(t)||e._typingChangedList.push(t),0===e._typingInfo[t].length&&delete e._typingInfo[t]}e._notifyTypingChanged()}),500))},t.prototype._notifyTypingChanged=function(){var e=this;if(this._typingChangedList.length>0){var t=this._typingChangedList.map((function(t){return{conversationType:Number(t.split("#")[0]),targetId:t.split("#")[1],channelId:t.split("#")[2],list:e._typingInfo[t]||[]}}));this._typingStatusListener(t),this._typingChangedList=[]}0===Object.keys(this._typingInfo).length&&(clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1)},t.prototype.getConnectedTime=function(){return this._engine.getConnectedTime()},t.prototype.getServerTime=function(){return this._engine.getServerTime()},t.prototype.getDeviceId=function(){return this._engine.getDeviceId()},t.prototype.getCurrentUserId=function(){return this._engine.getCurrentUserId()},t.prototype.getConnectionStatus=function(){return this._engine.getConnectionStatus()},Object.defineProperty(t.prototype,"token",{get:function(){return this._token},enumerable:!1,configurable:!0}),t.prototype.refetchNaviInfo=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,this._engine.refetchNaviInfo()]}))}))},t.prototype.connect=function(e,t,n){var r,i;return uc(this,void 0,void 0,(function(){var o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return this._token=e,[4,this._engine.connect(e,t,n)];case 1:return o=u.sent(),s=o.code,a=o.data,s!==Cd.SUCCESS?[2,{code:s}]:(1!==this._engine.getNaviInfoFromCache().type&&(c=Rh.getInfo(),null===(i=(r=this._engine).reportSDKInfo)||void 0===i||i.call(r,c)),[2,{code:s,userId:a}])}}))}))},t.prototype.disconnect=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){switch(n.label){case 0:return clearInterval(this._typingInternalTimer),this._typingInternalTimer=-1,this._typingInfo={},[4,this._engine.disconnect(e)];case 1:return n.sent(),this._pluginContextQueue.forEach((function(e){if(e.ondisconnect)try{e.ondisconnect()}catch(e){t.logger.error(Fd.L_CALLBACK_E,null==e?void 0:e.stack)}})),[2,Promise.resolve()]}}))}))},t.prototype.reconnect=function(e){return this.connect(this.token,!!e,this.logger.createTraceId())},t.prototype._getTokenWithoutNavi=function(){return this._token.replace(/@.+$/,"@")},t.prototype.getNaviInfoFromCache=function(){return this._engine.getNaviInfoFromCache()},t.prototype.registerMessageType=function(e,t,n,r,i){void 0===r&&(r=[]),void 0===i&&(i=!1),hl(r)&&r.length>0&&(this._registerMessageSearchPropsMapping[e]=r),this._engine.registerMessageType(e,t,n,r,i)},t.prototype.registerRTCSignalingListener=function(e){this._engine.registerRTCSignalingListener(e)},t.prototype.checkSearchPropsMsg=function(e,t){var n=this._registerMessageSearchPropsMapping[e],r={};return n&&pl(t)&&Object.keys(t).forEach((function(e){if(n.includes(e)){var i=t[e];ll(i)&&(i>-Math.pow(2,64)&&i<Math.pow(2,64)&&Number.isInteger(i)||(r[e]=i))}})),Object.keys(r).length>0?{msg:JSON.stringify(r),code:Cd.SEARCH_PROPS_LIMIT_ERROR}:{code:Cd.SUCCESS}},t.prototype.sendMessage=function(e,t,n,r,i){var o=this.checkSearchPropsMsg(n.messageType,n.content),s=o.code,a=o.msg;if(s!==Cd.SUCCESS)return Promise.resolve({code:s,msg:a});if(e!==Od.ULTRA_GROUP){var c=this.getNaviInfoFromCache();if(1===((null==c?void 0:c.grpRRVer)||0)&&n.messageType===Ud.READ_RECEIPT_RESPONSE)return Promise.resolve({code:Cd.READ_RECEIPT_ERROR})}var u=n.canIncludeExpansion,d=void 0!==u&&u,l=n.expansion;if(d){var h=Sl(l),f=h.isIllgalEx,g=h.isExKeyOrValLengthExceedLimit;if(h.isExceedLimit||g)return Promise.resolve({code:Cd.EXPANSION_LIMIT_EXCEET});if(f)return Promise.resolve({code:Cd.BIZ_ERROR_INVALID_PARAMETER})}var p,v,_=JSON.stringify(n.content);return p=_,void 0===v&&(v="utf-8"),("utf-16"===v?$c(p):eu(p))>Wa?Promise.resolve({code:Cd.RC_MSG_CONTENT_EXCEED_LIMIT}):e===Od.ULTRA_GROUP?this._engine.sendUltraMessage(t,n,r,i):this._engine.sendMessage(e,t,n,r,i)},t.prototype.sendExpansionMessage=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,d,l;return dc(this,(function(h){switch(h.label){case 0:return t=e.channelId,n=e.conversationType,r=e.targetId,i=e.messageUId,o=e.keys,s=e.expansion,a=e.removeAll,e.canIncludeExpansion?(c=Sl(s),u=c.isIllgalEx,d=c.isExKeyOrValLengthExceedLimit,c.isExceedLimit||d?[2,Promise.resolve({code:Cd.EXPANSION_LIMIT_EXCEET})]:u?[2,Promise.resolve({code:Cd.BIZ_ERROR_INVALID_PARAMETER})]:(l={mid:i},s&&(l.put=s),o&&(l.del=o),a&&(l.removeAll=1),[4,this._engine.sendMessage(n,r,{content:l,messageType:Ud.EXPANSION_NOTIFY,channelId:t})])):[2,{code:Cd.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:h.sent().code}]}}))}))},t.prototype.sendReadReceiptMessage=function(e,t,n){return uc(this,void 0,void 0,(function(){var r;
1return dc(this,(function(i){return r=this.getNaviInfoFromCache(),0===((null==r?void 0:r.grpRRVer)||0)?[2,{code:Cd.READ_RECEIPT_ERROR,msg:"The read receipt switch is not on, please call the sendMessage method!"}]:[2,this._engine.sendReadReceiptMessage(e,t,n)]}))}))},t.prototype.getMessageReader=function(e,t,n){return uc(this,void 0,void 0,(function(){var r;return dc(this,(function(i){return r=this.getNaviInfoFromCache(),0===((null==r?void 0:r.grpRRVer)||0)?[2,{code:Cd.READ_RECEIPT_ERROR}]:[2,this._engine.getMessageReader(e,t,n)]}))}))},t.prototype._destroy=function(){return uc(this,void 0,void 0,(function(){var e=this;return dc(this,(function(t){switch(t.label){case 0:return this._resetWatcher(),this._engine.destroy(),[4,this.disconnect()];case 1:return t.sent(),this._pluginContextQueue.forEach((function(t){if(t.ondestroy)try{t.ondestroy()}catch(t){e.logger.error(Fd.L_CALLBACK_E,null==t?void 0:t.stack)}})),this._pluginContextQueue.length=0,this._pluginInstanseMap={},[2]}}))}))},t.prototype.getHistoryMessage=function(e,t,n,r,i,o,s,a){if(void 0===n&&(n=0),void 0===r&&(r=20),void 0===i&&(i=0),void 0===o&&(o=""),void 0===s&&(s=""),e===Od.ULTRA_GROUP){var c={timestamp:n,count:r,order:i,channelId:o};return this._engine.getUltraHistoryMsg(t,c,a)}return this._engine.getHistoryMessage(e,t,n,r,i,o,s||"",a)},t.prototype.getHistoryMessagesByObjectNames=function(e,t,n,r,i,o,s){return this._engine.getHistoryMessagesByObjectNames(e,t,n,r,i,o,s)},t.prototype.getConversationList=function(e,t,n,r,i){if(void 0===e&&(e=300),void 0===i&&(i=""),t===Od.ULTRA_GROUP){var o=Cd.METHOD_NOT_SUPPORT;return Promise.resolve({code:o,msg:Cd[o]})}return this._engine.getConversationList(e,t,n,r,i)},t.prototype.getConversationsByPage=function(e,t,n,r){return this._engine.getConversationsByPage(e,t,n,r)},t.prototype.getConversation=function(e,t,n){return this._engine.getConversation(e,t,n)},t.prototype.removeConversation=function(e,t,n){return void 0===n&&(n=""),e===Od.ULTRA_GROUP?Promise.resolve(Cd.METHOD_NOT_SUPPORT):this._engine.removeConversation(e,t,n)},t.prototype.getUltraGroupList=function(e){return this._engine.getUltraGroupList(e)},t.prototype.getBlockUltraGroupList=function(){return this._engine.getBlockUltraGroupList()},t.prototype.getTopUltraGroupList=function(){return this._engine.getTopUltraGroupList()},t.prototype.clearUnreadCount=function(e,t,n){return void 0===n&&(n=""),e===Od.ULTRA_GROUP?this._engine.clearUltraUnreadcount(t,n):this._engine.clearConversationUnreadCount(e,t,n)},t.prototype.clearAllUnreadCount=function(){return this._engine.clearAllUnreadCount()},t.prototype.getUnreadCount=function(e,t,n){return void 0===n&&(n=""),this._engine.getConversationUnreadCount(e,t,n)},t.prototype.getTotalUnreadCount=function(e,t,n){if(t&&t.includes(Od.ULTRA_GROUP)){var r=Cd.METHOD_NOT_SUPPORT;return Promise.resolve({code:r,msg:Cd[r]})}return this._engine.getAllConversationUnreadCount(e,t&&t.length>0?t:[Od.PRIVATE,Od.GROUP,Od.SYSTEM,Od.PUBLIC_SERVICE],!!n)},t.prototype.getTotalUnreadCountByLevels=function(e,t,n){return this._engine.getTotalUnreadCountByLevels(e,t,n)},t.prototype.getFirstUnreadMessage=function(e,t,n){return void 0===n&&(n=""),this._engine.getFirstUnreadMessage(e,t,n)},t.prototype.setConversationNotificationLevel=function(e,t,n,r){return void 0===r&&(r=""),uc(this,void 0,void 0,(function(){var i;return dc(this,(function(o){return i=[{conversationType:e,targetId:t,notificationLevel:n,channelId:r}],[2,this._engine.batchSetConversationStatus(i)]}))}))},t.prototype.setConversationStatus=function(e,t,n,r,i){if(void 0===i&&(i=""),e===Od.ULTRA_GROUP&&void 0!==n)return Promise.resolve(Cd.METHOD_NOT_SUPPORT);var o=[{conversationType:e,targetId:t,isTop:n,notificationStatus:r,channelId:i}];return this._engine.batchSetConversationStatus(o)},t.prototype.saveConversationMessageDraft=function(e,t,n,r){return void 0===r&&(r=""),this._engine.saveConversationMessageDraft(e,t,n,r)},t.prototype.getConversationMessageDraft=function(e,t,n){return void 0===n&&(n=""),this._engine.getConversationMessageDraft(e,t,n)},t.prototype.clearConversationMessageDraft=function(e,t,n){return void 0===n&&(n=""),this._engine.clearConversationMessageDraft(e,t,n)},t.prototype.recallMessage=function(e,t,n,r,i){return this._engine.recallMsg(e,t,n,r,i)},t.prototype.deleteRemoteMessage=function(e,t,n,r){return void 0===r&&(r=""),e===Od.ULTRA_GROUP?Promise.resolve(Cd.METHOD_NOT_SUPPORT):this._engine.deleteRemoteMessage(e,t,n,r)},t.prototype.deleteRemoteMessageByTimestamp=function(e,t,n,r){return void 0===r&&(r=""),this._engine.deleteRemoteMessageByTimestamp(e,t,n,r)},t.prototype.joinChatroom=function(e,t,n){return void 0===t&&(t=10),this._engine.joinChatroom(e,t,n)},t.prototype.joinExistChatroom=function(e,t,n){return void 0===t&&(t=10),this._engine.joinExistChatroom(e,t,n)},t.prototype.quitChatroom=function(e){return this._engine.quitChatroom(e)},t.prototype.getChatroomInfo=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=0),this._engine.getChatroomInfo(e,t,n)},t.prototype.setChatroomEntry=function(e,t){var n=t.key,r=t.value;return LE(n)&&wE(r)?this._engine.setChatroomEntry(e,t):Promise.resolve(Cd.BIZ_ERROR_INVALID_PARAMETER)},t.prototype.setChatroomEntries=function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n],i=r.key,o=r.value;if(!LE(i)||!wE(o))return Promise.resolve({code:Cd.BIZ_ERROR_INVALID_PARAMETER})}var s=cc(cc({},t),{isOverwrite:t.isForce});return this._engine.setChatroomEntries(e,s)},t.prototype.forceSetChatroomEntry=function(e,t){var n=t.key,r=t.value;return LE(n)&&wE(r)?this._engine.forceSetChatroomEntry(e,t):Promise.resolve(Cd.BIZ_ERROR_INVALID_PARAMETER)},t.prototype.removeChatroomEntry=function(e,t){var n=t.key;return LE(n)?this._engine.removeChatroomEntry(e,t):Promise.resolve(Cd.BIZ_ERROR_INVALID_PARAMETER)},t.prototype.removeChatroomEntries=function(e,t){for(var n=0;n<t.entries.length;n++){var r=t.entries[n].key;if(!LE(r))return Promise.resolve({code:Cd.BIZ_ERROR_INVALID_PARAMETER})}return this._engine.removeChatroomEntries(e,t)},t.prototype.forceRemoveChatroomEntry=function(e,t){var n=t.key;return LE(n)?this._engine.forceRemoveChatroomEntry(e,t):Promise.resolve(Cd.BIZ_ERROR_INVALID_PARAMETER)},t.prototype.getChatroomEntry=function(e,t){return this._engine.getChatroomEntry(e,t)},t.prototype.getAllChatroomEntries=function(e){return this._engine.getAllChatroomEntry(e)},t.prototype.getChatroomHistoryMessages=function(e,t,n,r){return void 0===t&&(t=20),void 0===n&&(n=0),void 0===r&&(r=0),this._engine.getChatroomHistoryMessages(e,r,t,n)},t.prototype.getFileToken=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i,o,s,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return i=this.getNaviInfoFromCac
1he(),o=(null==i?void 0:i.bosAddr)||"",s=(null==i?void 0:i.uploadServer)||"",a=(null==i?void 0:i.ossConfig)||"",[4,this._engine.getFileToken(e,t,n,r)];case 1:return c=l.sent(),u=c.code,d=c.data,u===Cd.SUCCESS&&d?[2,Promise.resolve(Object.assign(d,{bos:o,qiniu:s,ossConfig:a}))]:[2,Promise.reject(u)]}}))}))},t.prototype.getFileUrl=function(e,t,n,r,i){return void 0===i&&(i=Gd.QINIU),uc(this,void 0,void 0,(function(){var o,s,a;return dc(this,(function(c){switch(c.label){case 0:return(null==r?void 0:r.isBosRes)?[2,Promise.resolve(r)]:[4,this._engine.getFileUrl(e,i,t,n)];case 1:return o=c.sent(),s=o.code,a=o.data,s===Cd.SUCCESS?[2,Promise.resolve(a)]:[2,Promise.reject(s)]}}))}))},t.prototype.createTag=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.createTag(e)]}))}))},t.prototype.removeTag=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.removeTag(e)]}))}))},t.prototype.updateTag=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.updateTag(e)]}))}))},t.prototype.getTagList=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,this._engine.getTagList()]}))}))},t.prototype.addTagForConversations=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return t.length>1e3?[2,Promise.reject(Cd.CONVER_OUT_LIMIT_ERROR)]:[2,this._engine.addTagForConversations(e,t)]}))}))},t.prototype.removeTagForConversations=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return[2,this._engine.removeTagForConversations(e,t)]}))}))},t.prototype.removeTagsForConversation=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return[2,this._engine.removeTagsForConversation(e,t)]}))}))},t.prototype.getConversationListByTag=function(e,t,n,r){return uc(this,void 0,void 0,(function(){return dc(this,(function(i){return[2,this._engine.getConversationListByTag(e,t,n,r)]}))}))},t.prototype.getUnreadCountByTag=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return[2,this._engine.getUnreadCountByTag(e,t)]}))}))},t.prototype.setConversationStatusInTag=function(e,t,n){return uc(this,void 0,void 0,(function(){return dc(this,(function(r){return[2,this._engine.setConversationStatusInTag(e,t,n)]}))}))},t.prototype.getTagsForConversation=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.getTagsForConversation(e)]}))}))},t.prototype.getBlockConversationList=function(){return this._engine.getBlockConversationList()},t.prototype.getTopConversationList=function(e,t){return e&&0!==e.length||(e=[Od.PRIVATE,Od.CHATROOM,Od.GROUP,Od.SYSTEM,Od.APP_PUBLIC_SERVICE,Od.PUBLIC_SERVICE]),this._engine.getTopConversationList(e,t)},t.prototype.getUnreadConversationList=function(e){return e&&0!==e.length||(e=[Od.PRIVATE,Od.CHATROOM,Od.GROUP,Od.SYSTEM,Od.APP_PUBLIC_SERVICE,Od.PUBLIC_SERVICE]),this._engine.getUnreadConversationList(e)},t.prototype.getUnreadMentionedCount=function(e){return this._engine.getUnreadMentionedCount(e)},t.prototype.getAllUnreadMentionedCount=function(){return this._engine.getAllUnreadMentionedCount()},t.prototype.sendUltraGroupTypingStatus=function(e){if(e.conversationType!==Od.ULTRA_GROUP){var t=Cd.METHOD_ONLY_SUPPORT_ULTRA_GROUP;return Promise.resolve({code:t,msg:Cd[t]})}return this._engine.sendUltraGroupTypingStatus(e)},t.prototype.getUltraGroupMessageListByMessageUId=function(e){return this._engine.getUltraGroupMessageListByMessageUId(e)},t.prototype.expandUltraMessage=function(e){return uc(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return t=e.conversationType,n=e.expansion,r=e.canIncludeExpansion,t!==Od.ULTRA_GROUP?[2,{code:i=Cd.METHOD_ONLY_SUPPORT_ULTRA_GROUP,msg:Cd[i]}]:r?(o=Sl(n),s=o.isIllgalEx,a=o.isExKeyOrValLengthExceedLimit,o.isExceedLimit||a?[2,{code:Cd.EXPANSION_LIMIT_EXCEET}]:s?[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[4,this._engine.expandUltraMessage(e)]):[2,{code:Cd.MESSAGE_KV_NOT_SUPPORT}];case 1:return[2,{code:c.sent().code}]}}))}))},t.prototype.modifyMessage=function(e){return uc(this,void 0,void 0,(function(){var t;return dc(this,(function(n){switch(n.label){case 0:return e.conversationType!==Od.ULTRA_GROUP?[2,{code:t=Cd.METHOD_ONLY_SUPPORT_ULTRA_GROUP,msg:Cd[t]}]:[4,this._engine.modifyMessage(e)];case 1:return[2,{code:n.sent().code}]}}))}))},t.prototype.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){return this._engine.getUltraGroupUnreadMentionedCountByTargetId(e,t)},t.prototype.getUltraGroupUnreadCountByTargetId=function(e,t){return this._engine.getUltraGroupUnreadCountByTargetId(e,t)},t.prototype.getAllUltraGroupUnreadCount=function(e){return void 0===e&&(e=!1),this._engine.getAllUltraGroupUnreadCount(e)},t.prototype.getAllConversationState=function(){return this._engine.getAllConversationState()},t.prototype.getUltraGroupUnreadMentionedMessages=function(e){return this._engine.getUltraGroupUnreadMentionedMessages(e)},t.prototype.getUltraGroupFirstUnreadMessageTimestamp=function(e){return this._engine.getUltraGroupFirstUnreadMessageTimestamp(e)},t.prototype.callExtra=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(t=this._engine).callExtra.apply(t,lc([e],n,!1))},t.prototype.getOSInfo=function(){return this._engine.getOSInfo()},t.prototype.getProcessInfo=function(){return this._engine.getProcessInfo()},t.prototype.getMainProcessInfo=function(){return this._engine.getMainProcessInfo()},t.prototype.setCallInfo=function(e,t,n){return this._engine.setCallInfo(e,t,n)},t.prototype.getGroupMessageDeliverList=function(e,t,n){return void 0===n&&(n=""),this._engine.getGroupMessageDeliverList(e,t,n)},t.prototype.getPrivateMessageDeliverTime=function(e,t){return void 0===t&&(t=""),this._engine.getPrivateMessageDeliverTime(e,t)},t.prototype.clearConversations=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return[2,this._engine.clearConversations(e,t)]}))}))},t.prototype.setUserStatusListener=function(e,t){var n=this;return this._engine.setUserStatusListener(e,(function(e){try{t(e)}catch(e){n.logger.error(Fd.L_CALLBACK_E,null==e?void 0:e.stack)}}))},t.prototype.addToBlacklist=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.addToBlacklist(e)]}))}))},t.prototype.removeFromBlacklist=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.removeFromBlacklist(e)]}))}))},t.prototype.getBlacklist=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,this._engine.getBlacklist()]}))}))},t.prototype.getBlacklistStatus=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.getBlacklistStatus(e)]}))}))},t.prototype.insertMessage=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o;return dc(this,(function(s){return r=this.checkSearchPropsMsg(n.messageType,n.content),i=r.code,o=r.msg,i!==Cd.SUCCESS?[2,Promise.resolve({code:i,msg:o})]:[2,this._engine.insertMessage(e,t,n)]}))}))},t.prototype.batchInsertMessage=function(e,t){return this._engine.batchInsertMessage(e,t)},t.prototype.getMessageCount=function(e,t,n){return void 0===n&&(n=""),uc(this,void 0,void 0,(function(){return dc(this,(function(r){return[2,this._engine.getMessageCount(e,t,n)]}))}))},t.prototype.deleteMessages=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.deleteMessages(e)]}))}))},t.prototype.deleteMessagesByTimestamp=function(e,t,n,r,i){return void 0===i&&(i=""),uc(this,void 0,void 0,(function(){return dc(this,(function(o){return[2,this._engine.deleteMessagesByTimestamp(e,t,n,r,i)]}))}))},t.prototype.clearMessages=function(e,t,n){return void 0===n&&(n=""),uc(this,void 0,void 0,(function(){return dc(this,(function(r){return[2,this._engine.clearMessages(e,t,n
1)]}))}))},t.prototype.getMessage=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.getMessage(e)]}))}))},t.prototype.setMessageContent=function(e,t,n){return uc(this,void 0,void 0,(function(){return dc(this,(function(r){return[2,this._engine.setMessageContent(e,t,n)]}))}))},t.prototype.setMessageSearchField=function(e,t,n){return uc(this,void 0,void 0,(function(){return dc(this,(function(r){return[2,this._engine.setMessageSearchField(e,t,n)]}))}))},t.prototype.setMessageSentStatus=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return[2,this._engine.setMessageSentStatus(e,t)]}))}))},t.prototype.setMessageReceivedStatus=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return[2,this._engine.setMessageReceivedStatus(e,t)]}))}))},t.prototype.setMessageStatusToRead=function(e,t,n,r){return uc(this,void 0,void 0,(function(){return dc(this,(function(i){return[2,this._engine.updateMessageReceiptStatus(e,t,n,r)]}))}))},t.prototype.setUserStatus=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.setUserStatus(e)]}))}))},t.prototype.subscribeUserStatus=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.subscribeUserStatus(e)]}))}))},t.prototype.getUserStatus=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return[2,this._engine.getUserStatus(e)]}))}))},t.prototype.searchConversationByContent=function(e,t,n,r){return void 0===t&&(t=[]),void 0===n&&(n=""),uc(this,void 0,void 0,(function(){return dc(this,(function(i){return[2,this._engine.searchConversationByContent(e,t,n,r)]}))}))},t.prototype.searchConversationByContentWithAllChannel=function(e,t,n){return void 0===t&&(t=[]),uc(this,void 0,void 0,(function(){return dc(this,(function(r){return[2,this._engine.searchConversationByContentWithAllChannel(e,t,n)]}))}))},t.prototype.searchMessageByContent=function(e,t,n,r,i,o,s){return void 0===s&&(s=""),uc(this,void 0,void 0,(function(){return dc(this,(function(a){return[2,this._engine.searchMessageByContent(e,t,n,r,i,o,s)]}))}))},t.prototype.searchMessageByContentWithAllChannel=function(e,t,n,r,i){return uc(this,void 0,void 0,(function(){return dc(this,(function(o){return[2,this._engine.searchMessageByContentWithAllChannel(e,t,n,r,i)]}))}))},t.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,t,n,r,i,o,s){return uc(this,void 0,void 0,(function(){return dc(this,(function(a){return[2,this._engine.searchMessageByContentInTimeRangeWithAllChannel(e,t,n,r,i,o,s)]}))}))},t.prototype.getUnreadMentionedMessages=function(e,t,n){return void 0===n&&(n=""),this._engine.getUnreadMentionedMessages(e,t,n)},t.prototype.clearUnreadCountByTimestamp=function(e,t,n,r){return void 0===r&&(r=""),this._engine.clearUnreadCountByTimestamp(e,t,n,r)},t.prototype.getUltraGroupDefaultNotificationLevel=function(e,t){return void 0===t&&(t=""),this._engine.getUltraGroupDefaultNotificationLevel(e,t)},t.prototype.setUltraGroupDefaultNotificationLevel=function(e,t,n){return void 0===n&&(n=""),this._engine.setUltraGroupDefaultNotificationLevel(e,t,n)},t.prototype.getConversationNotificationLevel=function(e,t,n){return void 0===n&&(n=""),this._engine.getConversationNotificationLevel(e,t,n)},t.prototype.getConversationNotificationStatus=function(e,t,n){return void 0===n&&(n=""),this._engine.getConversationNotificationStatus(e,t,n)},t.prototype.getRemoteHistoryMessages=function(e,t,n,r,i,o){return this._engine.getRemoteHistoryMessages(e,t,n,r,i,o)},t.prototype.getConversationListWithAllChannel=function(){return this._engine.getConversationListWithAllChannel()},t.prototype.getConversationListWithAllChannelByPage=function(e,t){return this._engine.getConversationListWithAllChannelByPage(e,t)},t.prototype.clearData=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,this._engine.clearData()]}))}))},t.prototype.createLogger=function(e,t){return this._engine.createLogger(e,t)},t.prototype.setCheckDuplicateMessage=function(e){return this._engine.setCheckDuplicateMessage(e)},t.prototype.rtcSignaling=function(e,t,n,r){return this._engine.rtcSignaling(e,t,n,r)},t.prototype.rtcPing=function(e,t,n){return this._engine.rtcPing(e,t,n)},t.prototype.bindRTCRoomForChatroom=function(e){return this._engine.b
1indRTCRoomForChatroom(e)},t.prototype.setProxy=function(e){return this._engine.setProxy(e)},t.prototype.getProxy=function(){return this._engine.getProxy()},t.prototype.testProxy=function(e,t){return this._engine.testProxy(e,t)},t}();!function(e){e.GET="GET",e.POST="POST"}(ib||(ib={})),function(e){e.WIFI="wifi",e.FOUR_G="4g",e.THREE_G="3g",e.TWO_G="2g",e.FIVE_G="2g",e.THREE_GENT="3gnet",e.UNKONWN="unknown"}(ob||(ob={})),function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(sb||(sb={}));var cb=tc,ub=Object.freeze({__proto__:null,DelayTimer:HE,AEngine:bI,Codec:xN,version:cb,APIContext:ab,PluginContext:oA,RTCPluginContext:nb,get StoreKeys(){return Zd},get UltraGroupChannelType(){return e.UltraGroupChannelType},get UltraGroupChannelChangeType(){return e.UltraGroupChannelChangeType},get UltraMsgChangeType(){return el},get UltraMsgSubChangeType(){return tl},get UserGroupChangeType(){return nl},get RTCMode(){return rl},get LiveType(){return il},get LiveRole(){return ol},CallLibMsgType:{"RC:VCAccept":"RC:VCAccept","RC:VCRinging":"RC:VCRinging","RC:VCSummary":"RC:VCSummary","RC:VCHangup":"RC:VCHangup","RC:VCInvite":"RC:VCInvite","RC:VCModifyMedia":"RC:VCModifyMedia","RC:VCModifyMem":"RC:VCModifyMem"},get RTCApiType(){return al},get RTCIdentityChangeType(){return cl},get RTCJoinType(){return ul},FileType:Id,MessageDirection:yd,ErrorCode:Cd,ConversationType:Od,ConnectionStatus:Ad,ReceivedStatus:oi,MessageType:Ud,NotificationStatus:wd,NotificationLevel:Pd,MentionedType:Bd,UploadMethod:Gd,ChatroomEntryType:qd,get LogLevel(){return e.LogLevel},get LogSource(){return kd},get LogTagId(){return Fd},ChatroomUserChangeType:Jd,MessageBlockType:Wd,get MessageBlockSourceType(){return e.MessageBlockSourceType},OperateStatus:sl,get SentStatus(){return e.SentStatus},get HttpMethod(){return ib},get NetworkType(){return ob},get TagChangeType(){return sb},isString:dl,isBoolean:function(e){return"boolean"==typeof e},isNumber:ll,isArray:hl,isArrayBuffer:fl,notEmptyString:gl,notEmptyArray:function(e){return hl(e)&&e.length>0},isObject:pl,isFunction:vl,isUndefined:_l,isNull:function(e){return"[object Null]"===Object.prototype.toString.call(e)},isHttpUrl:El,notEmptyObject:ml,isValidConversationType:Il,isValidNotificationLevel:Tl,isValidChannelId:yl,isTypeInConversationList:Rl,isValidFileType:Cl,isValidExpansion:Sl,logger:wh,getUUID:Zh,getUUID22:Xh,get AssertRules(){return zh},RCAssertError:ff,assert:gf,validate:pf,getUploadFileName:AE,getMimeKey:function(e){var t="application/octet-stream";switch(e){case Id.IMAGE:t="image/jpeg";break;case Id.AUDIO:t="audio/amr";break;case Id.VIDEO:t="video/3gpp";break;case Id.SIGHT:t="video/mpeg4";break;case Id.COMBINE_HTML:t="text/html"}return t},pushConfigsToJSON:ME,pushJSONToConfigs:UE,isValidChrmEntryKey:LE,isValidChrmEntryValue:wE,getClientMessageId:bE,AppStorage:oc,todo:function(e){return new hc(e)},appendUrl:tu,EventEmitter:sh,VersionManage:Rh,forEach:PE,map:DE,indexOf:BE,isInclude:function(e,t){return-1!==BE(e,t)},isInObject:VE,cloneByJSON:GE,usingCppEngine:xE,getBrowser:function(e){if("browser"!==e.tag)return{type:e.tag,version:"UnKonw"};var t,n,r=navigator.userAgent,i={IE:/rv:([\d.]+)\) like Gecko|MSIE ([\d.]+)/,Edge:/Edge\/([\d.]+)/,Firefox:/Firefox\/([\d.]+)/,Opera:/(?:OPERA|OPR).([\d.]+)/,WeChat:/MicroMessenger\/([\d.]+)/,QQBrowser:/QQBrowser\/([\d.]+)/,Chrome:/Chrome\/([\d.]+)/,Safari:/Version\/([\d.]+).*Safari/,iOSChrome:/Mobile\/([\d.]+).*Safari/};for(var o in i)if(i.hasOwnProperty(o)){var s=r.match(i[o]);if(s){n=o,t=s[1]||s[2];break}}return{type:n||"UnKonw",version:t||"UnKonw"}},clone:FE,NAVI_CACHE_DURATION:qa,HTTP_TIMEOUT:Ka,NAVI_REQ_TIMEOUT:1e4,WEB_SOCKET_TIMEOUT:5e3,PUBLIC_CLOUD_NAVI_URIS:ja,MINI_SOCKET_CONNECT_URIS:Ya,QINIU_STORAGE_SERVER_URI:Ja,BAIDU_STORAGE_SERVER_URI:Qa,IM_SIGNAL_TIMEOUT:3e4,IM_PING_INTERVAL_TIME:15e3,IM_PING_TIMEOUT:15e3,IM_PING_MIN_TIMEOUT:2e3,MAX_MESSAGE_CONTENT_BYTES:Wa,IM_CHATROOM_PULL_INTERVAL_TIME:za,STORAGE_ROOT_KEY:Za,MAX_MESSAGE_EXPANSION_KEY_LENGTH:32,MAX_MESSAGE_EXPANSION_VAL_LENGTH:4096,SEND_MESSAGE_TYPE_OPTION:Xa,CPP_PROTOCAL_MSGTYPE_OPTION:{"RC:DizNtf":{isCounted:!1,isPersited:!1}}
1,STATUS_MESSAGE:$a,REAT_TIME_LOG_SIZE:20971520,DB_LOG_MAX_SIZE:1e5,DB_LOG_FLUSH_FREQUENCY:3e3,ONE_LOG_SIZE_MAX:1e3,DEFAULT_LOG_POLICY:ec,VERSION:tc,FORMATED_VERSION:nc,BasicLogger:lw,IndexDBLogger:ww,BasicReporter:bw,IndexDBReporter:jw,get LogL(){return e.LogL},initLogDB:_w,deInitLogDB:Ew,transcsv:Kw,BasicNavi:pU,WebSocketNavi:EU,AConnectionMgr:zw,get RCConnectionStatus(){return e.RCConnectionStatus},isConnnectAck:function(e){return Object.keys(Qw).some((function(t){return Qw[t]===e}))},isDisconnectedByServer:function(e){return Object.keys(Jw).some((function(t){return Jw[t]===e}))}});("undefined"!=typeof globalThis?globalThis:global||self).RCEngine=ub;var db=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,r=t.length;n<r;n++)if(!e[t[n]])return!1;return!0}(uni))},lb=db(),hb=function(){var e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return"undefined"!=typeof XMLHttpRequest&&e?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")};var fb,gb={tag:"browser",httpReq:function(e){var t=e.method||ib.GET,n=e.timeout||Ka,r=e.headers,i=e.query,o=e.body,s=tu(e.url,i);return new Promise((function(e){var i=hb(),a="[object XDomainRequest]"===Object.prototype.toString.call(i);if(i.open(t,s),r&&i.setRequestHeader)for(var c in r)i.setRequestHeader(c,r[c]);if(a){i.timeout=n,i.onload=function(){e({data:i.responseText,status:i.status||200})},i.onerror=function(){e({status:i.status})},i.ontimeout=function(){e({status:i.status})};var u="object"===si(o)?JSON.stringify(o):o;i.send(u)}else i.onreadystatechange=function(){4===i.readyState&&e({data:i.responseText,status:i.status})},i.onerror=function(){e({status:i.status})},setTimeout((function(){i.abort(),e({status:i.status})}),n),i.send(o)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:lb,createWebSocket:function(e,t){var n=new WebSocket(window.location.href.indexOf('ryproxy=t') !== -1 ? ("wss://"+"ryclient.tg9web.com"+e.substring(e.indexOf("/websocket?"))) : e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,r=t.reason;e(n,r)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t=e.type,n=e.effectiveType,r=t||n||ob.UNKONWN;return Promise.resolve(r)}},pb=db(),vb=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},_b={setItem:vb("setStorageSync"),getItem:vb("getStorageSync"),removeItem:vb("removeStorageSync"),clear:vb("clearStorageSync")},Eb={tag:"wechat",httpReq:function(e){var t=e.method||ib.GET,n=e.timeout||Ka,r=e.headers,i=e.query,o=e.body,s=tu(e.url,i);return new Promise((function(e){wx.request({url:s,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:Cd.RC_HTTP_REQ_FAIL})}})}))},localStorage:_b,sessionStorage:_b,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:pb,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(ob.UNKONWN)}})}))}}
1,mb=db(),Ib=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var r=my[e]({key:t[0]}).data;return r?JSON.stringify(r):r}catch(e){}}},Tb={setItem:Ib("setStorageSync"),getItem:Ib("getStorageSync"),removeItem:Ib("removeStorageSync"),clear:Ib("clearStorageSync")},yb={tag:"alipay",httpReq:function(e){var t=e.method||ib.GET,n=e.timeout||Ka,r=e.headers,i=e.query,o=e.body,s=tu(e.url,i),a=e.dataType||"json";return new Promise((function(e){my.request({url:s,method:t,headers:r,timeout:n,data:o,dataType:a,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:Cd.RC_HTTP_REQ_FAIL})}})}))},localStorage:Tb,sessionStorage:Tb,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:mb,createWebSocket:function(e){return my.connectSocket({url:e}),{id:Date.now(),onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(ob.UNKONWN)}})}))}},Rb=db(),Cb=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},Sb={setItem:Cb("setStorageSync"),getItem:Cb("getStorageSync"),removeItem:Cb("removeStorageSync"),clear:Cb("clearStorageSync")},Ob={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Rb,localStorage:Sb,sessionStorage:Sb,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:Cd.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(ob.UNKONWN)}})}))}},Nb=db(),Ab=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},Mb={setItem:Ab("setStorageSync"),getItem:Ab("getStorageSync"),removeItem:Ab("removeStorageSync"),clear:Ab("clearStorageSync")},Ub={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Nb,localStorage:Mb,sessionStorage:Mb,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},r={data:JSON.stringify(n),status:e.statusCode};t(r)},fail:function(e){t({status:Cd.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(ob.UNKONWN)}})}))]}))}))}},Lb=db(),wb=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},bb={setItem:wb("setStorageSync"),getItem:wb("getStorageSync"),removeItem:wb("removeStorageSync"),clear:wb("clearStorageSync")},Pb={tag:"jingdong",httpReq:function(e){var t=e.method||ib.GET,n=e.timeout||Ka,r
1=e.headers,i=e.query,o=e.body,s=tu(e.url,i);return new Promise((function(e){jd.request({url:s,method:t,headers:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:Cd.RC_HTTP_REQ_FAIL})}})}))},localStorage:bb,sessionStorage:bb,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Lb,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(ob.UNKONWN)}})}))}},Db=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},Bb={setItem:Db("setStorageSync"),getItem:Db("getStorageSync"),removeItem:Db("removeStorageSync"),clear:Db("clearStorageSync")},Vb={tag:"uniapp",httpReq:function(e){var t=e.method||ib.GET,n=e.timeout||Ka,r=e.headers,i=e.query,o=e.body,s=tu(e.url,i);return new Promise((function(e){uni.request({url:s,method:t,header:r,timeout:n,data:o,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:Cd.RC_HTTP_REQ_FAIL})}})}))},localStorage:Bb,sessionStorage:Bb,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={url:e,protocols:t},r=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){r.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){r.onError((function(t){e(t.errMsg)}))},onMessage:function(e){r.onMessage((function(t){e(t.data)}))},onOpen:function(e){r.onOpen(e)},send:function(e){r.send({data:e})},close:function(e,t){r.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(ob.UNKONWN)}})}))}},Gb=function(e){return e&&e.request&&e.getSystemInfo},xb="undefined"!=typeof uni&&Gb(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Vb;case"mp-jd":return Pb;case"mp-baidu":return Ub;case"mp-toutiao":return Ob;case"mp-alipay":return yb;case"mp-weixin":return Eb;default:return gb}}():"undefined"!=typeof jd&&Gb(jd)?Pb:"undefined"!=typeof my&&Gb(my)?yb:"undefined"!=typeof tt&&Gb(tt)?Ob:"undefined"!=typeof swan&&Gb(swan)?Ub:"undefined"!=typeof wx&&Gb(wx)?Eb:gb;function kb(e){var t=e.conversationType,n=e.channelId,r=e.messageType,i=e.content,o=e.senderUserId,s=e.targetId,a=e.sentTime,c=e.receivedTime,u=e.messageUId,d=e.messageDirection,l=e.isPersited,h=e.isCounted,f=e.isOffLineMessage,g=e.canIncludeExpansion,p=e.expansion,v=e.receivedStatus,_=e.disableNotification,E=e.isMentioned,m=e.isStatusMessage,I=e.readReceiptInfo,T=e.pushConfig,y=e.messageId,R=e.isInterrupt,C=e.isModifyMessage,S=e.channelType,O=e.sentStatus;v||(v=oi.UNREAD);var N={messageType:r,channelId:n||"",content:i,senderUserId:o,targetId:s,conversationType:t,sentTime:a,receivedTime:c,messageUId:u,messageDirection:d,isPersited:l,isCounted:h,isMentioned:E,disableNotification:_,isStatusMessage:m,canIncludeExpansion:g,expansion:p,receivedStatus:v,readReceiptInfo:I,pushConfig:T,messageId:y,isInterrupt:R,isModifyMessage:C,sentStatus:O};return t!==Od.ULTRA_GROUP&&(N.isOffLineMessage=f),t===Od.ULTRA_GROUP&&ll(S)&&(N.channelType=S),N}function Fb(e){var t=e.conversationType,n=e.targetId,r=e.latestMessage,i=e.unreadMessageCount,o=e.hasMentioned,s=e.mentionedInfo,a=e.lastUnreadTime,c=e.notificationStatus,u=e.notificationLevel,d=e.isTop,l=e.channelId,h=e.unreadMentionedCount,f=e.matchCount,g={conversationType:t,targetId:n,latestMessage:r&&kb(r),unreadMessageCount:i,hasMentioned:o,mentionedInfo:o?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:a,notificationStatus:c,notificationLevel:u,isTop:d,channelId:l,unreadMentionedCount:h,matchCount:f};return g.conversationType===Od.ULTRA_GROUP&&(g.firstUnreadMessage=e.firstUnreadMessage,g.channelType=e.channelType),g}function Hb(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}e.Events=void 0,(fb=e.Events||(e.Events={})).CONNECTING="CONNECTING",fb.CONNECTED="CONNECTED",fb.DISCONNECT="DISCONNECT",fb.SUSPEND="SUSPEND",fb.MESSAGES="MESSAGES",fb.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",fb.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",fb.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",fb.CONVERSATION="CONVERSATION",fb.CHATROOM="CHATROOM",fb.EXPANSION="EXPANSION",fb.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",fb.TAG="TAG",fb.CONVERSATION_TAG="CONVERSATION_TAG",fb.TYPING_STATUS="TYPING_STATUS",fb.MESSAGE_BLOCKED="MESSAGE_BLOCKED",fb.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",fb.OPERATE_STATUS="OPERATE_STATUS",fb.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",fb.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",fb.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",fb.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",fb.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",fb.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",fb.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",fb.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",fb.USER_GROUP_STATUS="USER_GROUP_STATUS";var qb=new sh,Kb={connection:function(t,n){switch(t){case e.RCConnectionStatus.CONNECTED:qb.emit(e.Events.CONNECTED);break;case e.RCConnectionStatus.CONNECTING:qb.emit(e.Events.CONNECTING);break;case e.RCConnectionStatus.SUSPENDED:qb.emit(e.Events.SUSPEND,n);break;case e.RCConnectionStatus.DISCONNECTED:qb.emit(e.Events.DISCONNECT,n
1)}},batchMessage:function(t){qb.emit(e.Events.MESSAGES,{messages:t.map((function(e){return kb(e)}))})},typingState:function(t){qb.emit(e.Events.TYPING_STATUS,{status:t})},readReceiptReceived:function(t,n,r){qb.emit(e.Events.READ_RECEIPT_RECEIVED,{conversation:t,messageUId:n,sentTime:r})},messageReceiptRequest:function(t,n,r){qb.emit(e.Events.MESSAGE_RECEIPT_REQUEST,{conversation:t,messageUId:n,senderUserId:r})},messageReceiptResponse:function(t,n,r){qb.emit(e.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:t,receivedUserId:n,messageUIdList:r})},conversationState:function(t){var n=t.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?kb(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===Od.ULTRA_GROUP?(n.versionTime=e.versionTime,{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));qb.emit(e.Events.CONVERSATION,{conversationList:n})},chatroomState:function(t){qb.emit(e.Events.CHATROOM,t)},expansion:function(t){qb.emit(e.Events.EXPANSION,t)},pullFinished:function(){qb.emit(e.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){qb.emit(e.Events.TAG)},conversationTagChanged:function(){qb.emit(e.Events.CONVERSATION_TAG)},messageBlocked:function(t){qb.emit(e.Events.MESSAGE_BLOCKED,t)},messageDelivered:function(t){qb.emit(e.Events.PRIVATE_MESSAGE_DELIVERED,t)},groupMessageDeliveredStatus:function(t){qb.emit(e.Events.GROUP_MESSAGE_DELIVERED,t)},ultraGroupEnable:function(t){qb.emit(e.Events.ULTRA_GROUP_ENABLE,t.map((function(e){return Fb(e)})))},operateStatus:function(t){qb.emit(e.Events.OPERATE_STATUS,t)},ultraGroupMessageExpansionUpdated:function(t){qb.emit(e.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,t.map((function(e){return kb(e)})))},ultraGroupMessageModified:function(t){qb.emit(e.Events.ULTRA_GROUP_MESSAGE_MODIFIED,t.map((function(e){return kb(e)})))},ultraGroupMessageRecalled:function(t){qb.emit(e.Events.ULTRA_GROUP_MESSAGE_RECALLED,t.map((function(e){return kb(e)})))},ultraGroupChannelChangeType:function(t){qb.emit(e.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,t)},ultraGroupChannelUserKicked:function(t){qb.emit(e.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,t)},ultraGroupChannelDelete:function(t){qb.emit(e.Events.ULTRA_GROUP_CHANNEL_DELETE,t)},userGroupStatus:function(t){qb.emit(e.Events.USER_GROUP_STATUS,t)}};Rh.add("imlib-next","5.7.7");var jb=null,Yb=null,Jb=null;function Qb(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){switch(e.label){case 0:return jb?(Jb.info(Fd.A_DESTROY_O),[4,ab.destroy()]):[2];case 1:return e.sent(),Yb=null,jb=null,Jb=null,[2]}}))}))}function Wb(e){if(!jb)throw new Error("Not initialized yet!");return e(jb,Jb,Yb)}function zb(e){return jb?e(jb,Jb,Yb):Promise.resolve({code:Cd.BIZ_ERROR_CLIENT_NOT_INIT})}function Zb(){qb.clear()}var Xb={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:Cd.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this
1service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:Cd.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},$b={};for(var eP in Xb){var tP=Xb[eP].code;$b[tP]=eP}Xb.ROAMING_SERVICE_UNAVAILABLE.code;var nP=function(e,t,n){void 0===n&&(n="");var r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(Fd.O,"".concat(n," -> ").concat(r)),r},rP=function(e,t,n,r){return void 0===r&&(r=""),uc(void 0,void 0,void 0,(function(){var i,o;return dc(this,(function(s){switch(s.label){case 0:return i=nP(e,t,r),[4,n()];case 1:return(o=s.sent())!==Cd.SUCCESS?(e.warn(Fd.O,"".concat(r," fail -> ").concat(o," : ").concat($b[o]," , ").concat(i)),[2,{code:o,msg:$b[o]}]):[2,{code:o}]}}))}))};var iP=function(e){return!!(pf("options.key",e.key,zh.STRING,!0)&&pf("options.value",e.value,zh.STRING,!0)&&pf("options.isAutoDelete",e.isAutoDelete,zh.BOOLEAN)&&pf("options.isSendNotification",e.isSendNotification,zh.BOOLEAN)&&pf("options.notificationExtra",e.notificationExtra,zh.STRING))},oP=function(e){return e.entries.every((function(e){return pf("entry.key",e.key,zh.STRING,!0)&&pf("entry.value",e.value,zh.STRING,!0)}))&&pf("options.isAutoDelete",e.isAutoDelete,zh.BOOLEAN)&&pf("options.notificationExtra",e.notificationExtra,zh.STRING)&&pf("options.isForce",e.isForce,zh.BOOLEAN)},sP=function(e){return pf("options.key",e.key,zh.STRING,!0)&&pf("options.isSendNotification",e.isSendNotification,zh.BOOLEAN)&&pf("options.notificationExtra",e.notificationExtra,zh.STRING)},aP=function(e){return e.entries.every((function(e){return pf("key",e,zh.STRING,!0)}))&&pf("options.notificationExtra",e.notificationExtra,zh.STRING)};var cP=function(e,t,n,r){void 0===n&&(n=!0),void 0===r&&(r=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=r};function uP(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(r){return new cP(e,r,t,n)}}var dP=uP("RC:ImgMsg"),lP=uP("RC:HQVCMsg"),hP=uP("RC:SightMsg"),fP=uP("RC:TxtMsg"),gP=uP("RC:CombineMsg"),pP=uP("RC:FileMsg"),vP=uP("RC:GIFMsg"),_P=uP("RC:VcMsg"),EP=uP("RC:LBSMsg"),mP=uP("RC:ReferenceMsg"),IP=uP("RC:ImgTextMsg"),TP=Yo.charAt,yP=Ei,RP=wn,CP=Pm,SP=Dm,OP="String Iterator",NP=RP.set,AP=RP.getterFor(OP);CP(String,"String",(function(e){NP(this,{type:OP,string:yP(e),index:0})}),(function(){var e,t=AP(this),n=t.string,r=t.index;return r>=n.length?SP(void 0,!0):(e=TP(n,r),t.index+=e.length,SP(e,!1))}));var MP=o,UP=rt("iterator"),LP=!MP((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,r){t.delete("b"),n+=r+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[UP]||"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}
vendor: 2,469 bytes, line 1
1)),wP=zt.exports,bP=Ut,PP=Dt,DP=Ov,BP=Lc,VP=d,GP=Ge,xP=function(e,t,n,r){try{return r?t(PP(n)[0],n[1]):t(n)}catch(t){DP(e,"throw",t)}},kP=uv,FP=ws,HP=gr,qP=Es,KP=yv,jP=pv,YP=Array,JP=function(e){var t=GP(e),n=FP(this),r=arguments.length,i=r>1?arguments[1]:void 0,o=void 0!==i;o&&(i=BP(i,r>2?arguments[2]:void 0));var s,a,c,u,d,l,h=jP(t),f=0;if(!h||this===YP&&kP(h))for(s=HP(t),a=n?new this(s):YP(s);s>f;f++)l=o?i(t[f],f):t[f],qP(a,f,l);else for(d=(u=KP(t,h)).next,a=n?new this:[];!(c=VP(d,u)).done;f++)l=o?xP(u,i,[c.value,f],!0):c.value,qP(a,f,l);return a.length=f,a},QP=R,WP=2147483647,zP=/[^\0-\u007E]/,ZP=/[.\u3002\uFF0E\uFF61]/g,XP="Overflow: input needs wider integers to process",$P=RangeError,eD=QP(ZP.exec),tD=Math.floor,nD=String.fromCharCode,rD=QP("".charCodeAt),iD=QP([].join),oD=QP([].push),sD=QP("".replace),aD=QP("".split),cD=QP("".toLowerCase),uD=function(e){return e+22+75*(e<26)},dD=function(e,t,n){var r=0;for(e=n?tD(e/700):e>>1,e+=tD(e/t);e>455;)e=tD(e/35),r+=36;return tD(r+36*e/(e+38))},lD=function(e){var t=[];e=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=rD(e,n++);if(i>=55296&&i<=56319&&n<r){var o=rD(e,n++);56320==(64512&o)?oD(t,((1023&i)<<10)+(1023&o)+65536):(oD(t,i),n--)}else oD(t,i)}return t}(e);var n,r,i=e.length,o=128,s=0,a=72;for(n=0;n<e.length;n++)(r=e[n])<128&&oD(t,nD(r));var c=t.length,u=c;for(c&&oD(t,"-");u<i;){var d=WP;for(n=0;n<e.length;n++)(r=e[n])>=o&&r<d&&(d=r);var l=u+1;if(d-o>tD((WP-s)/l))throw $P(XP);for(s+=(d-o)*l,o=d,n=0;n<e.length;n++){if((r=e[n])<o&&++s>WP)throw $P(XP);if(r==o){for(var h=s,f=36;;){var g=f<=a?1:f>=a+26?26:f-a;if(h<g)break;var p=h-g,v=36-g;oD(t,nD(uD(g+p%v))),h=tD(p/v),f+=36}oD(t,nD(uD(h))),a=dD(s,l,u==c),s=0,u++}}s++,o++}return iD(t,"")},hD=ri,fD=r,gD=d,pD=R,vD=s,_D=LP,ED=er,mD=qI,ID=If,TD=gm,yD=wn,RD=Af,CD=q,SD=Fe,OD=Lc,ND=pi,AD=Dt,MD=Y,UD=Ei,LD=Zi,wD=E,bD=yv,PD=pv,DD=xf,BD=zO,VD=rt("iterator"),GD="URLSearchParams",xD=GD+"Iterator",kD=yD.set,FD=yD.getterFor(GD),HD=yD.getterFor(xD),qD=Object.getOwnPropertyDescriptor,KD=function(e){if(!vD)return fD[e];var t=qD(fD,e);return t&&t.value},jD=KD("fetch"),YD=KD("Request"),JD=KD("Headers"),QD=YD&&YD.prototype,WD=JD&&JD.prototype,zD=fD.RegExp,ZD=fD.TypeError,XD=fD.decodeURIComponent,$D=fD.encodeURIComponent,eB=pD("".charAt),tB=pD([].join),nB=pD([].push),rB=pD("".replace),iB=pD([].shift),oB=pD([].splice),sB=pD("".split),aB=pD("".slice),cB=/\+/g,uB=Array(4),dB=function(e){return uB[e-1]||(uB[e-1]=zD("((?:%[\\da-f]{2}){"+e+"})","gi"))}
vendor: 18,145 bytes, line 1
1,lB=function(e){try{return XD(e)}catch(t){return e}},hB=function(e){var t=rB(e,cB," "),n=4;try{return XD(t)}catch(e){for(;n;)t=rB(t,dB(n--),lB);return t}},fB=/[!'()~]|%20/g,gB={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},pB=function(e){return gB[e]},vB=function(e){return rB($D(e),fB,pB)},_B=TD((function(e,t){kD(this,{type:xD,iterator:bD(FD(e).entries),kind:t})}),"Iterator",(function(){var e=HD(this),t=e.kind,n=e.iterator.next(),r=n.value;return n.done||(n.value="keys"===t?r.key:"values"===t?r.value:[r.key,r.value]),n}),!0),EB=function(e){this.entries=[],this.url=null,void 0!==e&&(MD(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===eB(e,0)?aB(e,1):e:UD(e)))};EB.prototype={type:GD,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,n,r,i,o,s,a,c=PD(e);if(c)for(n=(t=bD(e,c)).next;!(r=gD(n,t)).done;){if(o=(i=bD(AD(r.value))).next,(s=gD(o,i)).done||(a=gD(o,i)).done||!gD(o,i).done)throw ZD("Expected sequence with length 2");nB(this.entries,{key:UD(s.value),value:UD(a.value)})}else for(var u in e)SD(e,u)&&nB(this.entries,{key:u,value:UD(e[u])})},parseQuery:function(e){if(e)for(var t,n,r=sB(e,"&"),i=0;i<r.length;)(t=r[i++]).length&&(n=sB(t,"="),nB(this.entries,{key:hB(iB(n)),value:hB(tB(n,"="))}))},serialize:function(){for(var e,t=this.entries,n=[],r=0;r<t.length;)e=t[r++],nB(n,vB(e.key)+"="+vB(e.value));return tB(n,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var mB=function(){RD(this,IB),kD(this,new EB(arguments.length>0?arguments[0]:void 0))},IB=mB.prototype;if(mD(IB,{append:function(e,t){DD(arguments.length,2);var n=FD(this);nB(n.entries,{key:UD(e),value:UD(t)}),n.updateURL()},delete:function(e){DD(arguments.length,1);for(var t=FD(this),n=t.entries,r=UD(e),i=0;i<n.length;)n[i].key===r?oB(n,i,1):i++;t.updateURL()},get:function(e){DD(arguments.length,1);for(var t=FD(this).entries,n=UD(e),r=0;r<t.length;r++)if(t[r].key===n)return t[r].value;return null},getAll:function(e){DD(arguments.length,1);for(var t=FD(this).entries,n=UD(e),r=[],i=0;i<t.length;i++)t[i].key===n&&nB(r,t[i].value);return r},has:function(e){DD(arguments.length,1);for(var t=FD(this).entries,n=UD(e),r=0;r<t.length;)if(t[r++].key===n)return!0;return!1},set:function(e,t){DD(arguments.length,1);for(var n,r=FD(this),i=r.entries,o=!1,s=UD(e),a=UD(t),c=0;c<i.length;c++)(n=i[c]).key===s&&(o?oB(i,c--,1):(o=!0,n.value=a));o||nB(i,{key:s,value:a}),r.updateURL()},sort:function(){var e=FD(this);BD(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,n=FD(this).entries,r=OD(e,arguments.length>1?arguments[1]:void 0),i=0;i<n.length;)r((t=n[i++]).value,t.key,this)},keys:function(){return new _B(this,"keys")},values:function(){return new _B(this,"values")},entries:function(){return new _B(this,"entries")}},{enumerable:!0}),ED(IB,VD,IB.entries,{name:"entries"}),ED(IB,"toString",(function(){return FD(this).serialize()}),{enumerable:!0}),ID(mB,GD),hD({global:!0,constructor:!0,forced:!_D},{URLSearchParams:mB}),!_D&&CD(JD)){var TB=pD(WD.has),yB=pD(WD.set),RB=function(e){if(MD(e)){var t,n=e.body;if(ND(n)===GD)return t=e.headers?new JD(e.headers):new JD,TB(t,"content-type")||yB(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),LD(e,{body:wD(0,UD(n)),headers:wD(0,t)})}return e};if(CD(jD)&&hD({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return jD(e,arguments.length>1?RB(arguments[1]):{})}}),CD(YD)){var CB=function(e){return RD(this,QD),new YD(e,arguments.length>1?RB(arguments[1]):{})};QD.constructor=CB,CB.prototype=QD,hD({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:CB})}}var SB,OB=ri,NB=s,AB=LP,MB=r,UB=Lc,LB=R,wB=er,bB=function(e,t,n){return n.get&&wP(n.get,t,{getter:!0}),n.set&&wP(n.set,t,{setter:!0}),bP.f(e,t,n)},PB=Af,DB=Fe,BB=rA,VB=JP,GB=dT,xB=Yo.codeAt,kB=function(e){var t,n,r=[],i=aD(sD(cD(e),ZP,"."),".");for(t=0;t<i.length;t++)n=i[t],oD(r,eD(zP,n)?"xn--"+lD(n):n);return iD(r,".")},FB=Ei,HB=If,qB=xf,KB={URLSearchParams:mB,getState:FD},jB=wn,YB=jB.set,JB=jB.getterFor("URL"),QB=KB.URLSearchParams,WB=KB.getState,zB=MB.URL,ZB=MB.TypeError,XB=MB.parseInt,$B=Math.floor,eV=Math.pow,tV=LB("".charAt),nV=LB(/./.exec),rV=LB([].join),iV=LB(1..toString),oV=LB([].pop),sV=LB([].push),aV=LB("".replace),cV=LB([].shift),uV=LB("".split),dV=LB("".slice),lV=LB("".toLowerCase),hV=LB([].unshift),fV="Invalid scheme",gV="Invalid host",pV="Invalid port",vV=/[a-z]/i,_V=/[\d+-.a-z]/i,EV=/\d/,mV=/^0x/i,IV=/^[0-7]+$/,TV=/^\d+$/,yV=/^[\da-f]+$/i,RV=/[\0\t\n\r #%/:<>?@[\\\]^|]/,CV=/[\0\t\n\r #/:<>?@[\\\]^|]/,SV=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,OV=/[\t\n\r]/g,NV=function(e){var t,n,r,i;if("number"==typeof e){for(t=[],n=0;n<4;n++)hV(t,e%256),e=$B(e/256);return rV(t,".")}if("object"==typeof e){for(t="",r=function(e){for(var t=null,n=1,r=null,i=0,o=0;o<8;o++)0!==e[o]?(i>n&&(t=r,n=i),r=null,i=0):(null===r&&(r=o),++i);return i>n&&(t=r,n=i),t}(e),n=0;n<8;n++)i&&0===e[n]||(i&&(i=!1),r===n?(t+=n?":":"::",i=!0):(t+=iV(e[n],16),n<7&&(t+=":")));return"["+t+"]"}return e},AV={},MV=BB({},AV,{" ":1,'"':1,"<":1,">":1,"`":1}),UV=BB({},MV,{"#":1,"?":1,"{":1,"}":1}),LV=BB({},UV,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),wV=function(e,t){var n=xB(e,0);return n>32&&n<127&&!DB(t,e)?e:encodeURIComponent(e)},bV={ftp:21,file:null,http:80,https:443,ws:80,wss:443},PV=function(e,t){var n;return 2==e.length&&nV(vV,tV(e,0))&&(":"==(n=tV(e,1))||!t&&"|"==n)},DV=function(e){var t;return e.length>1&&PV(dV(e,0,2))&&(2==e.length||"/"===(t=tV(e,2))||"\\"===t||"?"===t||"#"===t)},BV=function(e){return"."===e||"%2e"===lV(e)},VV={},GV={},xV={},kV={},FV={},HV={},qV={},KV={},jV={},YV={},JV={},QV={},WV={},zV={},ZV={},XV={},$V={},eG={},tG={},nG={},rG={},iG=function(e,t,n){var r,i,o,s=FB(e);if(t){if(i=this.parse(s))throw ZB(i);this.searchParams=null}else{if(void 0!==n&&(r=new iG(n,!0)),i=this.parse(s,null,r))throw ZB(i);(o=WB(new QB)).bindURL(this),this.searchParams=o}};iG.prototype={type:"URL",parse:function(e,t,n){var r,i,o,s,a,c=this,u=t||VV,d=0,l="",h=!1,f=!1,g=!1;for(e=FB(e),t||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,e=aV(e,SV,"")),e=aV(e,OV,""),r=VB(e);d<=r.length;){switch(i=r[d],u){case VV:if(!i||!nV(vV,i)){if(t)return fV;u=xV;continue}l+=lV(i),u=GV;break;case GV:if(i&&(nV(_V,i)||"+"==i||"-"==i||"."==i))l+=lV(i);else{if(":"!=i){if(t)return fV;l="",u=xV,d=0;continue}if(t&&(c.isSpecial()!=DB(bV,l)||"file"==l&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=l,t)return void(c.isSpecial()&&bV[c.scheme]==c.port&&(c.port=null));l="","file"==c.scheme?u=zV:c.isSpecial()&&n&&n.scheme==c.scheme?u=kV:c.isSpecial()?u=KV:"/"==r[d+1]?(u=FV,d++):(c.cannotBeABaseURL=!0,sV(c.path,""),u=tG)}break;case xV:if(!n||n.cannotBeABaseURL&&"#"!=i)return fV;if(n.cannotBeABaseURL&&"#"==i){c.scheme=n.scheme,c.path=GB(n.path),c.query=n.query,c.fragment="",c.cannotBeABaseURL=!0,u=rG;break}u="file"==n.scheme?zV:HV;continue;case kV:if("/"!=i||"/"!=r[d+1]){u=HV;continue}u=jV,d++;break;case FV:if("/"==i){u=YV;break}u=eG;continue;case HV:if(c.scheme=n.scheme,i==SB)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=GB(n.path),c.query=n.query;else if("/"==i||"\\"==i&&c.isSpecial())u=qV;else if("?"==i)c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=GB(n.path),c.query="",u=nG;else{if("#"!=i){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=GB(n.path),c.path.length--,u=eG;continue}c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,c.path=GB(n.path),c.query=n.query,c.fragment="",u=rG}break;case qV:if(!c.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){c.username=n.username,c.password=n.password,c.host=n.host,c.port=n.port,u=eG;continue}u=YV}else u=jV;break;case KV:if(u=jV,"/"!=i||"/"!=tV(l,d+1))continue;d++;break;case jV:if("/"!=i&&"\\"!=i){u=YV;continue}break;case YV:if("@"==i){h&&(l="%40"+l),h=!0,o=VB(l);for(var p=0;p<o.length;p++){var v=o[p];if(":"!=v||g){var _=wV(v,LV);g?c.password+=_:c.username+=_}else g=!0}l=""}else if(i==SB||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(h&&""==l)return"Invalid authority";d-=VB(l).length+1,l="",u=JV}else l+=i;break;case JV:case QV:if(t&&"file"==c.scheme){u=XV;continue}if(":"!=i||f){if(i==SB||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(c.isSpecial()&&""==l)return gV;if(t&&""==l&&(c.includesCredentials()||null!==c.port))return;if(s=c.parseHost(l))return s;if(l="",u=$V,t)return;continue}"["==i?f=!0:"]"==i&&(f=!1),l+=i}else{if(""==l)return gV;if(s=c.parseHost(l))return s;if(l="",u=WV,t==QV)return}break;case WV:if(!nV(EV,i)){if(i==SB||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()||t){if(""!=l){var E=XB(l,10);if(E>65535)return pV;c.port=c.isSpecial()&&E===bV[c.scheme]?null:E,l=""}if(t)return;u=$V;continue}return pV}l+=i;break;case zV:if(c.scheme="file","/"==i||"\\"==i)u=ZV;else{if(!n||"file"!=n.scheme){u=eG;continue}if(i==SB)c.host=n.host,c.path=GB(n.path),c.query=n.query;else if("?"==i)c.host=n.host,c.path=GB(n.path),c.query="",u=nG;else{if("#"!=i){DV(rV(GB(r,d),""))||(c.host=n.host,c.path=GB(n.path),c.shortenPath()),u=eG;continue}c.host=n.host,c.path=GB(n.path),c.query=n.query,c.fragment="",u=rG}}break;case ZV:if("/"==i||"\\"==i){u=XV;break}n&&"file"==n.scheme&&!DV(rV(GB(r,d),""))&&(PV(n.path[0],!0)?sV(c.path,n.path[0]):c.host=n.host),u=eG;continue;case XV:if(i==SB||"/"==i||"\\"==i||"?"==i||"#"==i){if(!t&&PV(l))u=eG;else if(""==l){if(c.host="",t)return;u=$V}else{if(s=c.parseHost(l))return s;if("localhost"==c.host&&(c.host=""),t)return;l="",u=$V}continue}l+=i;break;case $V:if(c.isSpecial()){if(u=eG,"/"!=i&&"\\"!=i)continue}else if(t||"?"!=i)if(t||"#"!=i){if(i!=SB&&(u=eG,"/"!=i))continue}else c.fragment="",u=rG;else c.query="",u=nG;break;case eG:if(i==SB||"/"==i||"\\"==i&&c.isSpecial()||!t&&("?"==i||"#"==i)){if(".."===(a=lV(a=l))||"%2e."===a||".%2e"===a||"%2e%2e"===a?(c.shortenPath(),"/"==i||"\\"==i&&c.isSpecial()||sV(c.path,"")):BV(l)?"/"==i||"\\"==i&&c.isSpecial()||sV(c.path,""):("file"==c.scheme&&!c.path.length&&PV(l)&&(c.host&&(c.host=""),l=tV(l,0)+":"),sV(c.path,l)),l="","file"==c.scheme&&(i==SB||"?"==i||"#"==i))for(;c.path.length>1&&""===c.path[0];)cV(c.path);"?"==i?(c.query="",u=nG):"#"==i&&(c.fragment="",u=rG)}else l+=wV(i,UV);break;case tG:"?"==i?(c.query="",u=nG):"#"==i?(c.fragment="",u=rG):i!=SB&&(c.path[0]+=wV(i,AV));break;case nG:t||"#"!=i?i!=SB&&("'"==i&&c.isSpecial()?c.query+="%27":c.query+="#"==i?"%23":wV(i,AV)):(c.fragment="",u=rG);break;case rG:i!=SB&&(c.fragment+=wV(i,MV))}d++}},parseHost:function(e){var t,n,r;if("["==tV(e,0)){if("]"!=tV(e,e.length-1))return gV;if(t=function(e){var t,n,r,i,o,s,a,c=[0,0,0,0,0,0,0,0],u=0,d=null,l=0,h=function(){return tV(e,l)};if(":"==h()){if(":"!=tV(e,1))return;l+=2,d=++u}for(;h();){if(8==u)return;if(":"!=h()){for(t=n=0;n<4&&nV(yV,h());)t=16*t+XB(h(),16),l++,n++;if("."==h()){if(0==n)return;if(l-=n,u>6)return;for(r=0;h();){if(i=null,r>0){if(!("."==h()&&r<4))return;l++}if(!nV(EV,h()))return;for(;nV(EV,h());){if(o=XB(h(),10),null===i)i=o;else{if(0==i)return;i=10*i+o}if(i>255)return;l++}c[u]=256*c[u]+i,2!=++r&&4!=r||u++}if(4!=r)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;c[u++]=t}else{if(null!==d)return;l++,d=++u}}if(null!==d)for(s=u-d,u=7;0!=u&&s>0;)a=c[u],c[u--]=c[d+s-1],c[d+--s]=a;else if(8!=u)return;return c}(dV(e,1,-1)),!t)return gV;this.host=t}else if(this.isSpecial()){if(e=kB(e),nV(RV,e))return gV;if(t=function(e){var t,n,r,i,o,s,a,c=uV(e,".");if(c.length&&""==c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(n=[],r=0;r<t;r++){if(""==(i=c[r]))return e;if(o=10,i.length>1&&"0"==tV(i,0)&&(o=nV(mV,i)?16:8,i=dV(i,8==o?1:2)),""===i)s=0;else{if(!nV(10==o?TV:8==o?IV:yV,i))return e;s=XB(i,o)}sV(n,s)}for(r=0;r<t;r++)if(s=n[r],r==t-1){if(s>=eV(256,5-t))return null}else if(s>255)return null;for(a=oV(n),r=0;r<n.length;r++)a+=n[r]*eV(256,3-r);return a}(e),null===t)return gV;this.host=t}else{if(nV(CV,e))return gV;for(t="",n=VB(e),r=0;r<n.length;r++)t+=wV(n[r],AV);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return DB(bV,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"==this.scheme&&1==t&&PV(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,n=e.username,r=e.password,i=e.host,o=e.port,s=e.path,a=e.query,c=e.fragment,u=t+":";return null!==i?(u+="//",e.includesCredentials()&&(u+=n+(r?":"+r:"")+"@"),u+=NV(i),null!==o&&(u+=":"+o)):"file"==t&&(u+="//"),u+=e.cannotBeABaseURL?s[0]:s.length?"/"+rV(s,"/"):"",null!==a&&(u+="?"+a),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw ZB(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"==e)try{return new oG(e.path[0]).origin}catch(e){return"null"}return"file"!=e&&this.isSpecial()?e+"://"+NV(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(FB(e)+":",VV)},getUsername:function(){return this.username},setUsername:function(e){var t=VB(FB(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var n=0;n<t.length;n++)this.username+=wV(t[n],LV)}},getPassword:function(){return this.password},setPassword:function(e){var t=VB(FB(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var n=0;n<t.length;n++)this.password+=wV(t[n],LV)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?NV(e):NV(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,JV)},getHostname:function(){var e=this.host;return null===e?"":NV(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,QV)},getPort:function(){var e=this.port;return null===e?"":FB(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""==(e=FB(e))?this.port=null:this.parse(e,WV))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+rV(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,$V))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""==(e=FB(e))?this.query=null:("?"==tV(e,0)&&(e=dV(e,1)),this.query="",this.parse(e,nG)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!=(e=FB(e))?("#"==tV(e,0)&&(e=dV(e,1)),this.fragment="",this.parse(e,rG)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var oG=function(e){var t=PB(this,sG),n=qB(arguments.length,1)>1?arguments[1]:void 0,r=YB(t,new iG(e,!1,n));NB||(t.href=r.serialize(),t.origin=r.getOrigin(),t.protocol=r.getProtocol(),t.username=r.getUsername(),t.password=r.getPassword(),t.host=r.getHost(),t.hostname=r.getHostname(),t.port=r.getPort(),t.pathname=r.getPathname(),t.search=r.getSearch(),t.searchParams=r.getSearchParams(),t.hash=r.getHash())},sG=oG.prototype,aG=function(e,t){return{get:function(){return JB(this)[e]()},set:t&&function(e){return JB(this)[t](e)},configurable:!0,enumerable:!0}};if(NB&&(bB(sG,"href",aG("serialize","setHref")),bB(sG,"origin",aG("getOrigin")),bB(sG,"protocol",aG("getProtocol","setProtocol")),bB(sG,"username",aG("getUsername","setUsername")),bB(sG,"password",aG("getPassword","setPassword")),bB(sG,"host",aG("getHost","setHost")),bB(sG,"hostname",aG("getHostname","setHostname")),bB(sG,"port",aG("getPort","setPort")),bB(sG,"pathname",aG("getPathname","setPathname")),bB(sG,"search",aG("getSearch","setSearch")),bB(sG,"searchParams",aG("getSearchParams")),bB(sG,"hash",aG("getHash","setHash"))),wB(sG,"toJSON",(function(){return JB(this).serialize()}),{enumerable:!0}),wB(sG,"toString",(function(){return JB(this).serialize()}),{enumerable:!0}),zB){var cG=zB.createObjectURL,uG=zB.revokeObjectURL;cG&&wB(oG,"createObjectURL",UB(cG,zB)),uG&&wB(oG,"revokeObjectURL",UB(uG,zB))}HB(oG,"URL"),OB({global:!0,constructor:!0,forced:!AB,sham:!NB},{URL:oG});var dG={exports:{}},lG={},hG=N,fG=x,gG=tr.f,pG=dT,vG="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];lG.f=function(e){return vG&&"Window"==hG(e)?function(e){try{return gG(e)}catch(e){return pG(vG)}}(e):gG(fG(e))};var _G=o((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),EG=o,mG=Y,IG=N,TG=_G,yG=Object.isExtensible,RG=EG((function(){yG(1)}))||TG?function(e){return!!mG(e)&&((!TG||"ArrayBuffer"!=IG(e))&&(!yG||yG(e)))}:yG,CG=!o((function(){return Object.isExtensible(Object.preventExtensions({}))})),SG=ri,OG=R,NG=En,AG=Y,MG=Fe,UG=Ut.f,LG=tr,wG=lG,bG=RG,PG=CG,DG=!1,BG=Ye("meta"),VG=0,GG=function(e){UG(e,BG,{value:{objectID:"O"+VG++,weakData:{}}})},xG=dG.exports={enable:function(){xG.enable=function(){},DG=!0;var e=LG.f,t=OG([].splice),n={};n[BG]=1,e(n).length&&(LG.f=function(n){for(var r=e(n),i=0,o=r.length;i<o;i++)if(r[i]===BG){t(r,i,1);break}return r},SG({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:wG.f}))},fastKey:function(e,t){if(!AG(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!MG(e,BG)){if(!bG(e))return"F";if(!t)return"E";GG(e)}return e[BG].objectID},getWeakData:function(e,t){if(!MG(e,BG)){if(!bG(e))return!0;if(!t)return!1;GG(e)}return e[BG].weakData},onFreeze:function(e){return PG&&DG&&bG(e)&&!MG(e,BG)&&GG(e),e}};NG[BG]=!0;var kG=ri,FG=r,HG=R,qG=Wr,KG=er,jG=dG.exports,YG=kv,JG=Af,QG=q,WG=b,zG=Y,ZG=o,XG=jv,$G=If,ex=fu,tx=Ut.f,nx=Zi,rx=qI,ix=Lc,ox=Af,sx=b,ax=kv,cx=Pm,ux=Dm,dx=Sf,lx=s,hx=dG.exports.fastKey,fx=wn.set,gx=wn.getterFor,px={getConstructor:function(e,t,n,r){var i=e((function(e,i){ox(e,o),fx(e,{type:t,index:nx(null),first:void 0,last:void 0,size:0}),lx||(e.size=0),sx(i)||ax(i,e[r],{that:e,AS_ENTRIES:n})})),o=i.prototype,s=gx(t),a=function(e,t,n){var r,i,o=s(e),a=c(e,t);return a?a.value=n:(o.last=a={index:i=hx(t,!0),key:t,value:n,previous:r=o.last,
1next:void 0,removed:!1},o.first||(o.first=a),r&&(r.next=a),lx?o.size++:e.size++,"F"!==i&&(o.index[i]=a)),e},c=function(e,t){var n,r=s(e),i=hx(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return rx(o,{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,lx?e.size=0:this.size=0},delete:function(e){var t=this,n=s(t),r=c(t,e);if(r){var i=r.next,o=r.previous;delete n.index[r.index],r.removed=!0,o&&(o.next=i),i&&(i.previous=o),n.first==r&&(n.first=i),n.last==r&&(n.last=o),lx?n.size--:t.size--}return!!r},forEach:function(e){for(var t,n=s(this),r=ix(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),rx(o,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),lx&&tx(o,"size",{get:function(){return s(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=gx(t),o=gx(r);cx(e,t,(function(e,t){fx(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?ux("keys"==t?n.key:"values"==t?n.value:[n.key,n.value],!1):(e.target=void 0,ux(void 0,!0))}),n?"entries":"values",!n,!0),dx(t)}},vx=function(e,t,n){var r=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=r?"set":"add",s=FG[e],a=s&&s.prototype,c=s,u={},d=function(e){var t=HG(a[e]);KG(a,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!zG(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return i&&!zG(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!zG(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(qG(e,!QG(s)||!(i||a.forEach&&!ZG((function(){(new s).entries().next()})))))c=n.getConstructor(t,e,r,o),jG.enable();else if(qG(e,!0)){var l=new c,h=l[o](i?{}:-0,1)!=l,f=ZG((function(){l.has(1)})),g=XG((function(e){new s(e)})),p=!i&&ZG((function(){for(var e=new s,t=5;t--;)e[o](t,t);return!e.has(-0)}));g||((c=t((function(e,t){JG(e,a);var n=ex(new s,e,c);return WG(t)||YG(t,n[o],{that:n,AS_ENTRIES:r}),n}))).prototype=a,a.constructor=c),(f||p)&&(d("delete"),d("has"),r&&d("get")),(p||h)&&d(o),i&&a.clear&&delete a.clear}return u[e]=c,kG({global:!0,constructor:!0,forced:c!=s},u),$G(c,e),i||n.setStrong(c,e,r),c};vx("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),px);var _x,Ex,mx=JP;ri({target:"Array",stat:!0,forced:!jv((function(e){Array.from(e)}))},{from:mx});var Ix={qiniu:function(e,t,n,r){Wb((function(i){var o=i.getNaviInfoFromCache();if(1===(null==o?void 0:o.type)&&t.chunk_size&&r.size>t.chunk_size){var s=Zh();s+=r.name.substr(r.name.lastIndexOf(".")),r.uniqueName=s,Mx(r,t,n)}else Ax(e,t,n,r)}))},baidu:function(e,t,n,r){if(r.size>yx.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var i=t||{};t=t||Ex;var o=new XMLHttpRequest,s=Sx();if(!i.uploadHost.bos&&!i.bosUploadPath)return;var a=s+Tx[0][1]+i.bosUploadPath;Tx.shift();var c=i.bosHeader||{},u={filename:t.uniqueValue||r.uniqueName,name:r.name,downloadUrl:a,isBosRes:!0};o.upload&&t.support_options&&(o.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});o.onreadystatechange=function(){if(4===o.readyState)if(JSON.parse(o.responseText||"{}").filename=t.uniqueValue,200===o.status){n.onCompleted(u,!0)}else Tx.length?Ix[Tx[0][0]](e,t,n,r):n.onError("upload fail")},o.open(t.method,a,!0),o.setRequestHeader("authorization",c.bosToken),o.setRequestHeader("x-bce-date",c.bosDate),o.send(r)},aliyun:function(e,t,n,r){if(r.size>yx.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token"));var o=Tx[0][1];Tx.shift(),e=e||_x,t=(t=t||{})||Ex;var s=new XMLHttpRequest,a=Sx(),c="".concat(a+t.ossBucketName,".").concat(o);s.upload&&t.support_options&&(s.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});s.onreadystatechange=function(){if(4===s.readyState){var e=JSON.parse(s.responseText||"{}");e.name=t.uniqueValue,e.filename=t.uploadFileName,e.uploadMethod=Gd?Gd.ALI:"",200===s.status?n.onCompleted(e):Tx.length?Ix[Tx[0][0]](i,t,n,r):n.onError("upload fail")}},s.open(t.method,c,!0),console.log("ali:url",c);var u=t.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",t.uploadFileName),e.delete("file"),e.append("file",r),s.send(e)},s3:function(e,t,n,r){var i=new FormData,o=new XMLHttpRequest,s=Sx(),a=t.contentDisposition,c=Tx[0][1],u="".concat(s+t.s3BucketName,".").concat(c);console.log("uploadS3:url",u),Tx.shift(),o.upload&&t.support_options&&(o.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});o.onreadystatechange=function(){if(4===o.readyState){var i=JSON.parse(o.responseText||"{}");
1if(i.name=t.uniqueValue,i.filename=t.uploadFileName,i.uploadMethod=Gd.AWS,200===o.status||204===o.status)n.onCompleted(i);else if(Tx.length){var s=new FormData;s.set("file",e.get("file")),s.set("key",e.get("key")),s.set("token",e.get("token")),Ix[Tx[0][0]](s,t,n,r)}else n.onError("upload fail")}},o.open(t.method,u,!0);var d=t?t.s3Header:{},l=r&&r.type;a?i.set("Content-Disposition","".concat(a,";")):i.set("Content-Disposition","text/html"===l?"inline;":"attachment;");i.set("Content-Type",l),i.set("x-amz-credential",d.s3Credential),i.set("x-amz-algorithm",d.s3Algorithm),i.set("x-amz-date",d.s3Date),i.set("policy",d.s3Policy),i.set("x-amz-signature",d.s3Signature),i.set("key",t.uploadFileName),i.set("file",r),o.send(i)},stc:Ux,minio:Ux},Tx=[],yx={BOS_CHUNCK_SIZE:5368709120},Rx="http://",Cx="https://";function Sx(){var e=Cx;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=Rx),e}var Ox,Nx=(Ox="RC-upload-",{get:function(e){e=Ox+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=Ox+e,t={data:t,type:si(t),updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=Ox+e,localStorage.removeItem(e)}});function Ax(e,t,n,r){var i=Cx+t.uploadHost.qiniu,o=(/http/.test(Tx[0][1])?"":Sx())+Tx[0][1]||i;t.isChunk||Tx.shift();var s=new XMLHttpRequest;s.upload&&t.support_options&&(s.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),s.onreadystatechange=function(){if(4===s.readyState){var i=JSON.parse(s.responseText||"{}");i.filename=t.uniqueValue,i.uploadMethod=Gd?Gd.QINIU:"",200===s.status||204===s.status?n.onCompleted(i):Tx.length?Ix[Tx[0][0]](e,t,n,r):n.onError("upload fail")}},s.open(t.method,o,!0),n.onOpen(s),t.stream&&s.setRequestHeader("authorization","UpToken ".concat(t.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(t.headers,(function(e,t){s.setRequestHeader(e,t)})),s.send(e)}function Mx(e,t,n,r){var i=0,o=r||Zh(),s=Nx.get(o);s&&(e.uniqueName=s.sessionId,i=s.offset);var a=Math.min(t.chunk_size,e.size-i),c=e.slice(i,i+a),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(i,"-").concat(i+a);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,c.name=e.name,c=function(e,t,n){var r=new FormData;for(var i in t.unique_key&&r.append(t.unique_key,n),r.append(t.file_data_name,e,e.name),t.multi_parmas){var o=t.multi_parmas[i];r.append(i,o)}return r}(c,t,e.uniqueName),Ax(c,t,{onCompleted:function(r){i+=a;var s=e.uniqueName;Nx.set(o,{offset:i,sessionId:s}),i<e.size?Mx(e,t,n,o):(i=0,Nx.remove(o),n.onCompleted(r))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,r){var o=e+i;n.onProgress(o,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function Ux(e,t,n,r,i){var o=new XMLHttpRequest,s=t.contentDisposition,a=Tx[0][1],c=i===Gd.STC?t.stcBucketName:t.minioBucketName,u="https://".concat(a,"/").concat(c,"/").concat(t.uploadFileName);Tx.shift(),o.upload&&t.support_options&&(o.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),o.onreadystatechange=function(){if(4===o.readyState){var s=JSON.parse(o.responseText||"{}");if(s.name=t.uniqueValue,s.filename=t.uploadFileName,s.uploadMethod=i,200===o.status||204===o.status)n.onCompleted(s);else if(Tx.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),Ix[Tx[0][0]](a,t,n,r)}else n.onError("upload fail")}},o.open("PUT",u,!0);var d=t.stcHeader.stcAuthorization,l=t.stcHeader.stcContentSha256,h=t.stcHeader.stcDate;i===Gd.MINIO&&(d=t.minioHeader.minioAuthorization,l=t.minioHeader.minioContentSha256,h=t.minioHeader.minioDate),o.setRequestHeader("Content-Type",r.type),s?o.setRequestHeader("Content-Disposition","".concat(s,";")):o.setRequestHeader("Content-Disposition","text/html"===r.type?"inline;":"attachment;"),o.setRequestHeader("Authorization",d),o.setRequestHeader("x-amz-content-sha256",l),o.setRequestHeader("x-amz-date",h),o.send(r)}function Lx(e,t,n,r,i,o){var s,a,c=t&&t.type||"text/plain",u=c.indexOf("image")>-1?1:4,d=n.contentDisposition,l=Math.ceil(t.size/n.stc_chunk_size),h=i===Gd.STC?n.stcBucketName:n.minioBucketName,f="uploads";e.getFileToken(u,t.name,"POST",f).then((function(e){s=e.fileName,a="https://".concat(o,"/").concat(h,"/").concat(s),console.log("uploadStcMultipart:url",a);var n=new XMLHttpRequest;n.open("POST","".concat(a,"?").concat(f),!0),d?n.setRequestHeader("Content-Disposition","".concat(d,";")):n.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;");var u=e.stcAuthorization,g=e.stcContentSha256,p=e.stcDate;i===Gd.MINIO&&(u=e.minioAuthorization,g=e.minioContentSha256,p=e.minioDate),n.setRequestHeader("Authorization",u),n.setRequestHeader("x-amz-content-sha256",g),n.setRequestHeader("x-amz-date",p),n.setRequestHeader("Content-Type",c),n.send(),n.onreadystatechange=function(){if(4===n.readyState){var e=n.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===n.status||204===n.status?function(e){for(var t=[],n=1;n<=l;n++)t.push(_(e,n));v(e,t)}(Array.isArray(e)&&e[1]):r.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));var g=[],p=new Map;function v(n,o){o&&Array.isArray(o)&&0!==o.length&&Promise.all(o).then((function(){var o="uploadId=".concat(n);if(p.size===l)e.getFileToken(u,s,"POST",o).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",n);var u=e.stcAuthorization,d=e.stcContentSha256,l=e.stcDate;i===Gd.MINIO&&(u=e.minioAuthorization,d=e.minioContentSha256,l=e.minioDate);var h=new XMLHttpRequest;h.open("POST","".concat(a,"?").concat(o),!0),h.setRequestHeader("Authorization",u),h.setRequestHeader("x-amz-content-sha256",d),h.setRequestHeader("x-amz-date",l),h.setRequestHeader("Content-Type",c);var f="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",g=Array.from(p.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",g),g.forEach((function(e){f+="<Part><ETag>".concat(p.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),f+="</CompleteMultipartUpload>",h.send(f),console.log("xml",f),h.onreadystatechange=function(){if(4===h.readyState)if(200===h.status||204===h.status){var e={name:t.name,filename:s,uploadMethod:i};r.onCompleted(e)}else r.onError("uploadStcMultipart:upload does not end")}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));else{for(var d=[],h=0,f=g;h<f.length;h++){var E=f[h];d.push(_(n,E))}v(n,d)}}),(function(e){console.error(e),r.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],i=0,o=g;i<o.length;i++){var s=o[i];t.push(_(n,s))}v(n,t)}))}function _(r,o){return new Promise((function(d,l){var h="partNumber=".concat(o,"&uploadId=").concat(r);e.getFileToken(u,s,"PUT",h).then((function(e){console.log("signature ".concat(o," onSuccess"),e);var r=t&&t.slice((o-1)*n.stc_chunk_size,o*n.stc_chunk_size);console.log("fileChunk:size",r.size);var s=e.stcAuthorization,u=e.stcContentSha256,f=e.stcDate;i===Gd.MINIO&&(s=e.minioAuthorization,u=e.minioContentSha256,f=e.minioDate);var v=new XMLHttpRequest;v.open("PUT","".concat(a,"?").concat(h),!0),v.setRequestHeader("Authorization",s),v.setRequestHeader("x-amz-content-sha256",u),v.setRequestHeader("x-amz-date",f),v.setRequestHeader("Content-Type",c),v.send(r),v.onreadystatechange=function(){if(4===v.readyState)if(200===v.status||204===v.status){var e=v.getResponseHeader("etag");console.log("etag:".concat(o),e),p.set(o,e),d(e)}else g.includes(o)||g.push(o),l(o)}}),(function(e){console.log("getETags:ç¾åéªè¯å¤±è´¥"),g.includes(o)||g.push(o),l(o)}))}))}}var bx={form:function(e,t){var n=new FormData;if(t.unique_key){var r=e.name.substr(e.name.lastIndexOf(".")),i=Px()+r;n.append(t.unique_key,i),t.uniqueValue=i}return n.append(t.file_data_name,e),Dx(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var r=e.name.substr(e.name.lastIndexOf(".")),i=Px()+r;n[t.unique_key]=i,t.uniqueValue=i}return n[t.file_data_name]=e,Dx(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Px(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function Dx(e,t){for(var n in e)t(n,e[n])}var Bx,Vx=0,Gx=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:bx.form,genUId:Px};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;Dx(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,r){if(n){var i=this;!function(e,t,n,r,i){_x=n,Ex=r,Tx=[];
1var o,s,a=e.getNaviInfoFromCache();if(1===(null==a?void 0:a.type)&&t.uploadDomain&&!r.ossConfig)Tx=[["qiniu",t.uploadDomain]];else if(r.ossConfig){var c,u,d,l=JSON.parse(r.ossConfig),h="",f=[];l.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(h=e[n]),"s3"===n&&(c=e[n]),"stc"===n&&(u=e[n]),"minio"===n&&(d=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&Tx.push(e)})),l.length!==Tx.length&&(Tx=[["qiniu",r.domain],["baidu",r.uploadHost.bos],["aliyun",h],["s3",c],["stc",u],["minio",d]])}else Tx=[["qiniu",r.domain],["baidu",r.uploadHost.bos]];if(r.ossConfig){var g=r&&JSON.parse(r.ossConfig);Array.isArray(g)||(g=[]),o=g.find((function(e){return Object.keys(e).includes("stc")})),s=g.find((function(e){return Object.keys(e).includes("minio")}))}if(o&&1===parseInt(o.p,10)&&n.size>=4194304)Lx(e,n,r,i,Gd.STC,o.stc);else if(s&&1===parseInt(s.p,10)&&n.size>=4194304)Lx(e,n,r,i,Gd.MINIO,s.minio);else{var p=r.data(n,r);Ix[Tx[0][0]](p,r,i,n,Gd.MINIO)}}(e,t,n,this.options,{onProgress:function(e,t,n){(Bx=e,n)?Bx=Vx+e/t*(t-Vx):Vx=Bx;r.onProgress(Bx,t)},onCompleted:function(e){r.onCompleted(e)},onError:function(e){r.onError(e)},onOpen:function(e){i.xhr=e}})}else r.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var xx,kx,Fx={init:function(e){return new Gx(e)},dataType:bx,resize:function(e,t,n){var r=document.createElement("canvas"),i=new FileReader;i.readAsDataURL(e),i.onload=function(e){var i=e.target.result,o=new Image;o.src=i;var s=o.width,a=o.height,c=function(e,t){var n=1,r=e.width,i=t.maxWidth||0;i>0&&r>i&&(n=i/r);var o=e.height,s=t.maxHeight||0;if(s>0&&o>s){var a=s/o;n=Math.min(n,a)}var c=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;n=Math.min(n,d)}return n}({width:s,height:a,size:e.total},t),u=i;c<1&&(u=function(e,t,n){r.width=t,r.height=n;var i=r.getContext("2d");return i.drawImage(e,0,0,t,n),r.toDataURL("image/jpg")}(o,s*c,a*c)),n(u)}},Upload:Gx},Hx=function(e,t,n){var r=document.createElement("canvas"),i=r.getContext("2d"),o=new Image,s="string"==typeof e;o.onload=function(s){var a=function(e,t,n){var r,i,o,s=e<t,a=0,c=0;return(s?t/e:e/t)>n.scale?(s?(i=100,c=((o=t/(r=e/100))-n.maxHeight)/2):(o=100,a=((i=e/(r=t/100))-n.maxWidth)/2),{w:i,h:o,x:-a,y:-c}):(s?(r=t/n.maxHeight,o=n.maxHeight,i=e/r):(r=e/n.maxWidth,i=n.maxWidth,o=t/r),{w:i,h:o,x:-a,y:-c})}(o.width,o.height,t);r.width=a.w>t.maxWidth?t.maxWidth:a.w,r.height=a.h>t.maxHeight?t.maxHeight:a.h,i.drawImage(o,a.x,a.y,a.w,a.h);var c=r.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},o.src=s?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},qx=function(e,t){var n=e.file,r=e.compress;Hx(n,r,t)},Kx=function(e,t){if(e.getToken)e.getToken((function(n,r){r=r||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=r.bos,e.ossConfig=r.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=r.bosDate,e.bosHeader.bosToken=r.bosToken,e.bosUploadPath=r.path,e.aliHeader={},e.aliHeader.osskeyId=r.osskeyId,e.aliHeader.ossPolicy=r.ossPolicy,e.aliHeader.ossSign=r.ossSign,e.ossBucketName=r.ossBucketName,e.uploadFileName=r.fileName,e.s3Header={},e.s3Header.s3Credential=r.s3Credential,e.s3Header.s3Algorithm=r.s3Algorithm,e.s3Header.s3Date=r.s3Date,e.s3Header.s3Policy=r.s3Policy,e.s3Header.s3Signature=r.s3Signature,e.s3BucketName=r.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=r.stcAuthorization,e.stcHeader.stcContentSha256=r.stcContentSha256,e.stcHeader.stcDate=r.stcDate,e.stcBucketName=r.stcBucketName,e.minioHeader={},e.minioHeader.minioAuthorization=r.minioAuthorization,e.minioHeader.minioContentSha256=r.minioContentSha256,e.minioHeader.minioDate=r.minioDate,e.minioBucketName=r.minioBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var i=Fx.init(e);t(i)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Fx.init(e);t(n)}},jx=function(e,t,n,r,i){r.upload(e,t,n.file,{onError:function(e){i.onError(e)},onProgress:function(e,t){i.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||qx;n.compress?t(n,(function(t){e.thumbnail=t,i.onCompleted(e)})):i.onCompleted(e)}})},Yx=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,r){jx(e,t,{file:n},this.instance,r)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Jx=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,r){var i={file:n,compress:this.cfg};jx(e,t,i,this.instance,r)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Qx={initFile:function(e,t){Kx(e,(function(e){var n=new Yx(e);t(n)}))},initImage:function(e,t){Kx(e,(function(n){var r,i,o,s,a={maxHeight:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxHeight)||160,maxWidth:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.maxWidth)||160,quality:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.quality)||.5,scale:(null===(s=e.thumbnailConfig)||void 0===s?void 0:s.scale)||2.4},c=new Jx(n,a);t(c)}))},dataType:Fx.dataType};function Wx(e,t,n,r,i,o,s){var a=this;void 0===s&&(s=Id.FILE);var c=Id.FILE;s===Id.IMAGE&&(c=Id.IMAGE);
1var u=e.getNaviInfoFromCache();if(!kx&&(kx="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(kx=d.qiniu)}catch(e){}var l=cc({domain:kx,getToken:function(t){e.getFileToken(c,r.name).then((function(e){t(e.token,e)})).catch((function(e){i.onFail(e)}))}},o),h=Qx.initFile;c===Id.IMAGE&&(h=Qx.initImage),h(l,(function(t){t.upload(e,n,r,{onProgress:function(e,t){var n,r=Math.floor(e/t*100);null===(n=i.onProgress)||void 0===n||n.call(i,r)},onCompleted:function(e){return uc(a,void 0,void 0,(function(){return dc(this,(function(t){return 1!==(null==u?void 0:u.type)||(null==u?void 0:u.ossConfig)?(function(e,t,n,r,i){Xx(t,r.filename,r.name,r,r.uploadMethod).then((function(o){if(0===o.code){var s=o.data;s.type=n.type,s.name=r.name||r.filename,e!==Id.AUDIO?(t===Id.IMAGE&&(s.thumbnail=r.thumbnail,s.width=r.w,s.height=r.h,s.size=r.size),i.onSuccess(s)):zx(n).then((function(e){i.onSuccess(cc(cc({},s),e))}))}else i.onFail(o)})).catch((function(e){i.onFail(e)}))}(s,c,r,e,i),[2]):(function(e,t,n,r,i,o){var s={type:r.type,name:i.rc_url.file_name,downloadUrl:e.uploadDomain+i.rc_url.path};if(t===Id.AUDIO)return void zx(r).then((function(e){o.onSuccess(cc(cc({},s),e))}));t===Id.IMAGE&&(s.thumbnail=i.thumbnail,s.width=i.w,s.height=i.h,s.size=i.size);o.onSuccess(s)}(n,s,0,r,e,i),[2])}))}))},onError:function(e){i.onFail(e)}})}))}function zx(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?Zx(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(Zx).then((function(e){t(e)}))}))}function Zx(e){return xx=xx||new AudioContext,new Promise((function(t,n){xx.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function Xx(e,t,n,r,i){return pf("fileType",e,Cl,!0)&&pf("filename",t,zh.STRING)&&pf("saveName",n,zh.STRING)&&pf("serverType",i,zh.NUMBER)?zb((function(o){return new Promise((function(s){o.getFileUrl(e,t,n,r,i).then((function(e){s({code:Cd.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:Cd.BIZ_ERROR_INVALID_PARAMETER})}function $x(t,n,r){return uc(this,void 0,void 0,(function(){var i=this;return dc(this,(function(o){return[2,zb((function(o,s){return uc(i,void 0,void 0,(function(){var i,a,c,u,d,l,h,f,g,p,v,_;return dc(this,(function(E){switch(E.label){case 0:return r=r||{},n instanceof cP==!1?(s.warn(Fd.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,Xb.ILLGAL_PARAMS]):pf("conversation",t,zh.OBJECT,!0)?(i=t.conversationType,a=t.targetId,c=t.channelId,pf("conversation.targetId",a,zh.STRING,!0)&&pf("conversation.conversationType",i,zh.NUMBER,!0)&&pf("conversation.channelId",c,zh.CHANNEL_ID)&&pf("options.isStatusMessage",null==r?void 0:r.isStatusMessage,zh.BOOLEAN)&&pf("options.disableNotification",null==r?void 0:r.disableNotification,zh.BOOLEAN)&&pf("options.pushContent",null==r?void 0:r.pushContent,zh.STRING)&&pf("options.pushData",null==r?void 0:r.pushData,zh.STRING)&&pf("options.isMentioned",null==r?void 0:r.isMentioned,zh.BOOLEAN)&&pf("options.mentionedType",null==r?void 0:r.mentionedType,zh.NUMBER)&&pf("options.mentionedUserIdList",null==r?void 0:r.mentionedUserIdList,zh.ARRAY)&&pf("options.directionalUserIdList",null==r?void 0:r.directionalUserIdList,zh.ARRAY)&&pf("options.isVoipPush",null==r?void 0:r.isVoipPush,zh.BOOLEAN)&&pf("options.canIncludeExpansion",null==r?void 0:r.canIncludeExpansion,zh.BOOLEAN)&&pf("options.expansion",null==r?void 0:r.expansion,zh.OBJECT)&&pf("options.pushConfig",null==r?void 0:r.pushConfig,zh.OBJECT)&&pf("options.messageId",null==r?void 0:r.messageId,zh.NUMBER)?(u="conversationType:".concat(i,",targetId:").concat(a),s.debug(Fd.O,"send message ->".concat(u)),d=function(e,t,n){var r=e.isStatusMessage,i=e.disableNotification,o=e.pushContent,s=e.pushData,a=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,l=e.isVoipPush,h=e.canIncludeExpansion,f=e.expansion,g=e.isFilerWhiteBlacklist,p=e.pushConfig,v=e.messageId,_=n.channelId;return cc({isStatusMessage:r,disableNotification:i,pushContent:o,pushData:s,isMentioned:a,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:l,canIncludeExpansion:h,expansion:f,isFilerWhiteBlacklist:g,pushConfig:p,channelId:_||"",messageId:v},t)}(r,n,t),l={isMentioned:!!r.isMentioned,content:n.content,messageType:n.messageType,isPersited:!!n.isPersited,isCounted:!!n.isCounted,disableNotification:!!(null==r?void 0:r.disableNotification),canIncludeExpansion:!!(null==r?void 0:r.canIncludeExpansion),expansion:(null==r?void 0:r.expansion)||null,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId,senderUserId:o.getCurrentUserId(),messageUId:"",messageDirection:yd.SEND,receivedTime:0,isStatusMessage:!!r.isStatusMessage,receivedStatus:oi.UNREAD,isOffLineMessage:!1,pushConfig:null==r?void 0:r.pushConfig,sentStatus:e.SentStatus.SENDING},i!==Od.ULTRA_GROUP&&(l.isOffLineMessage=!1),h=s.createTraceId(),f=function(e){l.messageId=e;try{(null==r?void 0:r.onSendBefore)&&r.onSendBefore(kb(l))}catch(e){s.error(Fd.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),h)}},s.info(Fd.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:i,targetId:a,channelId:c}),h),[4,o.sendMessage(i,a,d,f,h)]):[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}];case 1:return g=E.sent(),p=g.code,v=g.data,p===Cd.SUCCESS?(s.info(Fd.A_SEND_MSG_R,JSON.stringify({code:p,messageUId:v.messageUId,messageId:v.messageId}),h),_=kb(v),[2,{code:p,data:_}]):(s.warn(Fd.A_SEND_MSG_R,"send message fail ->".concat(p,":").concat($b[p],",").concat(u)),l.sentTime=(null==v?void 0:v.sentTime)||0,l.sentStatus=null==v?void 0:v.sentStatus,[2,{c
1ode:p,msg:$b[p],data:kb(l)}])}}))}))}))]}))}))}function ek(e,t){return function(n,r,i,o){if(!pf("sendOptions.contentDisposition",null==o?void 0:o.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:Cd.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==o?void 0:o.contentDisposition};if(o&&"thumbnailConfig"in o){var a=null==o?void 0:o.thumbnailConfig;if(!(pf("sendOptions.maxHeight",null==a?void 0:a.maxHeight,zh.NUMBER)&&pf("sendOptions.maxWidth",null==a?void 0:a.maxWidth,zh.NUMBER)&&pf("sendOptions.quality",null==a?void 0:a.quality,zh.NUMBER)&&pf("sendOptions.scale",null==a?void 0:a.scale,zh.NUMBER)))return Promise.resolve({code:Cd.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=a}return zb((function(a,c,u){return new Promise((function(d){var l=c.createTraceId();c.info(Fd.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:r.file.size,type:e}),l),Wx(a,0,u,r.file,{onProgress:null==i?void 0:i.onProgress,onSuccess:function(e){var s,a=(null===(s=null==i?void 0:i.onComplete)||void 0===s?void 0:s.call(i,cc({url:e.downloadUrl},e)))||t(e,r);e&&e.downloadUrl&&c.info(Fd.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:Cd.SUCCESS}),l),$x(n,a,o).then(d)},onFail:function(e){c.warn(Fd.L_MEDIA_UPLOAD_R,JSON.stringify({code:Cd.UPLOAD_FILE_FAILED}),l),d({code:Cd.UPLOAD_FILE_FAILED,msg:e||Cd[Cd.UPLOAD_FILE_FAILED]})}},s,e)}))}))}}var tk=ek(Id.FILE,(function(e,t){return new pP({name:e.name,size:t.file.size,type:(n=e.name,r=n.match(/\.(\w+)$/),r?r[1]:"bin"),fileUrl:e.downloadUrl,user:t.user,extra:t.extra});var n,r})),nk=ek(Id.IMAGE,(function(e,t){return new dP({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),rk=ek(Id.IMAGE,(function(e,t){return new vP({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),ik=ek(Id.AUDIO,(function(e,t){return new lP({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),ok=ek(Id.SIGHT,(function(e,t){return new hP({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));ek(Id.COMBINE_HTML,(function(e,t){return new gP({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var sk=Object.freeze({__proto__:null,getAllConversationList:function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return xE()?pf("channelId",e,zh.CHANNEL_ID)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return r.info(Fd.O,"getAllConversationList -> channelId: ".concat(e)),_l(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=a.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=a.sent(),a.label=4;case 4:return i=t.code,o=t.data,i===Cd.SUCCESS&&o?(s=o.map((function(e){return Fb(e)})),[2,{code:i,data:s}]):(r.warn(Fd.O,"getAllConversationList fail -> code: ".concat(i," channelId: ").concat(e)),[2,{code:i,msg:$b[i]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return xE()?pf("startTime",e,zh.NUMBER,!0)&&pf("count",t,zh.NUMBER,!0)&&pf("channelId",n,zh.CHANNEL_ID)?[2,zb((function(i,o){return uc(r,void 0,void 0,(function(){var r,s,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return r="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),o.info(Fd.O,"getConversationList -> ".concat(r)),_l(n)?[4,i.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return a=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(a,e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,u=s.data,c===Cd.SUCCESS&&u?(d=u.map((function(e){return Fb(e)})),[2,{code:c,data:d}]):(o.warn(Fd.O,"getConversationList fail ->
1 code: ".concat(c," ").concat(r)),[2,{code:c,msg:$b[c]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,r){return uc(this,void 0,void 0,(function(){var i=this;return dc(this,(function(o){return xE()?pf("keyword",t,zh.STRING,!0)&&pf("messageTypes",n,zh.ARRAY,!0)&&pf("channelId",r,zh.CHANNEL_ID)&&!n.some((function(e){return!pf("messageType",e,zh.STRING,!0)}))?[2,zb((function(o,s){return uc(i,void 0,void 0,(function(){var i,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return i="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(r),s.info(Fd.O,"searchConversationByContent -> ".concat(e)),_l(r)?[4,o.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return a=l.sent(),[3,4];case 2:return[4,o.searchConversationByContent(t,n,r)];case 3:a=l.sent(),l.label=4;case 4:return c=a.code,u=a.data,c===Cd.SUCCESS&&u?(d=u.map((function(e){return Fb(e)})),[2,{code:c,data:d}]):(s.warn(Fd.O,"searchConversationByContent fail -> code: ".concat(c," ").concat(i)),[2,{code:c,msg:$b[c]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i=this;return dc(this,(function(o){return xE()?pf("conversation",e,zh.CONVERSATION,!0)&&pf("keyword",t,zh.STRING,!0)&&pf("startTime",n,zh.NUMBER,!0)&&pf("count",r,zh.NUMBER,!0)?[2,zb((function(o,s){return uc(i,void 0,void 0,(function(){var i,a,c,u,d,l,h,f,g,p;return dc(this,(function(v){switch(v.label){case 0:return i="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(r),s.info(Fd.O,"searchMessages -> ".concat(i)),a=e.targetId,c=e.conversationType,u=e.channelId,_l(u)?[4,o.searchMessageByContentWithAllChannel(c,a,t,n,r)]:[3,2];case 1:return d=v.sent(),[3,4];case 2:return 0,[4,o.searchMessageByContent(c,a,t,n,r,0,u)];case 3:d=v.sent(),v.label=4;case 4:return l=d.code,h=d.data,l===Cd.SUCCESS&&h?(f=h.messages,g=h.count,p=f.map((function(e){return kb(e)})),[2,{code:l,data:{messages:p,count:g}}]):(s.warn(Fd.O,"searchMessages fail -> code: ".concat(l," ").concat(i)),[2,{code:l,msg:$b[l]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return xE()?pf("conversation",e,zh.CONVERSATION,!0)&&pf("option",t,zh.OBJECT,!0)&&pf("option.keyword",t.keyword,zh.STRING,!0)&&pf("option.startTime",t.startTime,zh.NUMBER,!0)&&pf("option.endTime",t.endTime,zh.NUMBER,!0)&&pf("option.offset",t.offset,zh.NUMBER)&&pf("option.limit",t.limit,zh.NUMBER)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c,u,d,l,h,f,g;return dc(this,(function(p){switch(p.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(Fd.O,"searchMessageInTimeRange -> ".concat(n)),o=e.conversationType,s=e.targetId,a=t.keyword,c=t.startTime,u=t.endTime,d=t.offset,l=t.limit,d=d||0,l=l||5,[4,r.searchMessageByContentInTimeRangeWithAllChannel(o,s,a,c,u,d,l)];case 1:return h=p.sent(),f=h.code,g=h.data,f===Cd.SUCCESS&&g?[2,{code:f,data:{messages:g.messages.map((function(e){return kb(e)}))}}]:(i.warn(Fd.O,"searchMessageInTimeRange fail -> code: ".concat(f,", ").concat(n)),[2,{code:f}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return xE()?pf("conversation",e,zh.CONVERSATION,!0)&&pf("option",t,zh.OBJECT,!0)&&pf("option.count",t.count,zh.NUMBER)&&pf("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&pf("option.timestamp",t.timestamp,zh.NUMBER)&&pf("option.order",t.order,(function(e){return[0,1].includes(e)}))&&pf("option.messageTypes",t.messageTypes,zh.ARRAY,!0)&&!t.messageTypes.some((function(e){return!pf("option.messageType",e,zh.STRING,!0)}))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c,u,d,l,h,f,g,p,v,_,E;return dc(this,(function(m){switch(m.label){case 0:return n=t.count,o=t.timestamp,s=t.order,a=t.messageTypes,c="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(Fd.O,"getHistoryMessagesByMessageTypes
1-> ".concat(c)),u=e.conversationType,d=e.targetId,l=e.channelId,n||(n=20),o||(o=0),s||(s=0),l||(l=""),[4,r.getHistoryMessagesByObjectNames(u,d,o,n,a,s,l)];case 1:return h=m.sent(),f=h.code,g=h.data,f===Cd.SUCCESS?(v=(p=g).list,_=p.hasMore,E=v.map((function(e){return kb(e)})),[2,{code:f,data:{messages:E,hasMore:_,list:E}}]):(i.warn(Fd.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(f," ").concat(c)),[2,{code:f,msg:$b[f]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return xE()?pf("conversation",e,zh.CONVERSATION,!0)&&pf("timestamp",t,zh.NUMBER,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),i.info(Fd.O,"updateSentMsgReceiptStatus -> ".concat(n)),o=e.conversationType,s=e.targetId,a=e.channelId,[4,r.setMessageStatusToRead(o,s,t,a)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return xE()?pf("messageId",e,zh.NUMBER,!0)&&pf("receivedStatus",t,(function(e){return!_l(oi[e])}),!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){return dc(this,(function(n){switch(n.label){case 0:return i.info(Fd.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,r.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,n){return uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return xE()?pf("messageId",t,zh.NUMBER,!0)&&pf("sentStatus",n,(function(t){return!_l(e.SentStatus[t])}),!0)?[2,zb((function(e,i){return uc(r,void 0,void 0,(function(){return dc(this,(function(r){switch(r.label){case 0:return i.info(Fd.O,"setMessageSentStatus ->messageId: ".concat(t,", sentStatus: ").concat(n)),[4,e.setMessageSentStatus(t,n)];case 1:return[2,{code:r.sent()}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return xE()?pf("messageId",e,zh.NUMBER,!0)&&pf("content",t,zh.OBJECT,!0)&&pf("messageType",n,zh.ONLY_STRING,!0)?[2,zb((function(i,o){return uc(r,void 0,void 0,(function(){return dc(this,(function(r){switch(r.label){case 0:return o.info(Fd.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,i.setMessageContent(e,t,n)];case 1:return[2,{code:r.sent()}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return xE()?!pf("messageIds",e,zh.ARRAY,!0)||e.some((function(e){return!pf("messageId",e,zh.NUMBER,!0)}))?[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){return dc(this,(function(t){switch(t.label){case 0:return r.info(Fd.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return xE()?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return t=e.conversationType,i=e.targetId,o=e.channelId,r.info(Fd.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(t)),[4,n.clearMessages(t,i,o)];case 1:return(s=a.sent())===Cd.SUCCESS?[2,{code:s}]:(r.warn(Fd.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s=this;return dc(this,(function(a){return xE()?(r=e.conversationType,i=e.targetId,o=e.channelId,pf("conversationType",r,zh.NUMBER,!0)&&pf("targetId",i,zh.STRING,!0)&&pf("timestamp",t,zh.NUMBER,!0)&&pf("cleanSpace",n,zh.BOOLEAN)?[2,zb((function(e,a){return uc(s,void 0,void 0,(function(){var s;return dc(this,(function(c){switch(c.label){case 0:return[4,e.deleteMessagesByTimestamp(r,i,t,n,o)];case 1:return(s=c.sent())===Cd.SUCCESS?[2,{code:s}]:(a.warn(Fd.O,"deleteMessagesByTimestamp ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return xE()?pf("conversation",e,zh.CONVERSATION,!0)&&pf("message",t,zh.OBJECT,!0)&&pf("options",n,zh.OBJ
1ECT)&&pf("options.isUnread",null==n?void 0:n.isUnread,zh.BOOLEAN)&&pf("options.searchContent",null==n?void 0:n.searchContent,zh.STRING)&&(t instanceof cP||pf("message.senderUserId",t.senderUserId,zh.STRING,!0)&&pf("message.messageType",t.messageType,zh.STRING,!0)&&pf("message.content",t.content,zh.OBJECT,!0)&&pf("message.messageDirection",t.messageDirection,zh.NUMBER,!0)&&pf("message.canIncludeExpansion",t.canIncludeExpansion,zh.BOOLEAN)&&pf("message.expansion",t.expansion,zh.OBJECT)&&pf("message.disableNotification",t.disableNotification,zh.BOOLEAN)&&pf("message.sentTime",t.sentTime,zh.NUMBER)&&pf("message.sentStatus",t.sentStatus,zh.NUMBER))?[2,zb((function(i,o){return uc(r,void 0,void 0,(function(){var r,s,a,c,u,d,l,h,f,g,p,v,_,E,m;return dc(this,(function(I){switch(I.label){case 0:return r="",s=1,d=!1,h=t.messageType,f=t.content,t instanceof cP||(r=t.senderUserId,s=t.messageDirection,d=t.canIncludeExpansion,l=t.expansion,u=t.disableNotification,a=t.sentTime,c=t.sentStatus),o.info(Fd.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),g=n.isUnread,p=n.searchContent,v={senderUserId:r,messageType:h,content:f,messageDirection:s,sentTime:a,sentStatus:c,searchContent:p,isUnread:g,messageUId:"",disableNotification:u,canIncludeExpansion:d,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,v)];case 1:return _=I.sent(),E=_.code,m=_.data,E===Cd.SUCCESS?[2,{code:E,data:kb(m)}]:(o.warn(Fd.O,"insertMessage ->code:".concat(E,",targetId:").concat(e.targetId)),[2,{code:E,msg:$b[E]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,r;return uc(this,void 0,void 0,(function(){var i,o=this;return dc(this,(function(s){if(!xE())return[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}];if(!pf("messages",e,(function(e){return hl(e)&&!(e.length<=0||e.length>=500)}),!0)||!pf("checkDuplicate",t,zh.BOOLEAN))return[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}];for(i in e)if(!(pf("message",e[i],zh.OBJECT,!0)&&pf("message.conversationType",e[i].conversationType,(function(e){return[Od.PRIVATE,Od.DISCUSSION,Od.GROUP,Od.CUSTOMER_SERVICE,Od.SYSTEM,Od.APP_PUBLIC_SERVICE,Od.PUBLIC_SERVICE].includes(e)}),!0)&&pf("message.targetId",e[i].targetId,zh.STRING,!0)&&pf("message.senderUserId",e[i].senderUserId,zh.STRING,!0)&&pf("message.messageType",e[i].messageType,zh.STRING,!0)&&pf("message.content",e[i].content,zh.OBJECT,!0)&&pf("message.messageDirection",e[i].messageDirection,zh.NUMBER,!0)&&pf("message.canIncludeExpansion",e[i].canIncludeExpansion,zh.BOOLEAN)&&pf("message.expansion",e[i].expansion,zh.OBJECT)&&pf("message.disableNotification",e[i].disableNotification,zh.BOOLEAN)&&pf("message.sentTime",e[i].sentTime,zh.NUMBER)&&pf("message.sentStatus",e[i].sentStatus,zh.NUMBER)&&pf("options.isUnread",null===(n=e[i])||void 0===n?void 0:n.isUnread,zh.BOOLEAN)&&pf("options.searchContent",null===(r=e[i])||void 0===r?void 0:r.searchContent,zh.STRING)))return[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER,msg:String(i)}];return[2,zb((function(n){return uc(o,void 0,void 0,(function(){var r,i,o;return dc(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return r=s.sent(),i=r.code,o=r.data,i===Cd.SUCCESS?[2,{code:i,data:o}]:[2,{code:i,msg:$b[i]}]}}))}))}))]}))}))},getMessageCount:function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return xE()?[2,zb((function(n){return uc(t,void 0,void 0,(function(){var t,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,[4,n.getMessageCount(t,r,i)];case 1:return o=c.sent(),s=o.code,a=o.data,s===Cd.SUCCESS?[2,{code:s,data:a}]:[2,{code:s,msg:$b[s]}]}}))}))}))]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return xE()?pf("messageUId",e,zh.STRING,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o;return dc(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),i=t.code,o=t.data,i===Cd.SUCCESS?[2,{code:i,data:o}]:(r.warn(Fd.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(i,",messageUId:").concat(e)),[2,{c
1ode:i,msg:$b[i]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return xE()?pf("targetId",e,zh.STRING,!0)&&pf("messageUId",t,zh.STRING,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return[4,r.getGroupMessageDeliverList(e,t)];case 1:return n=a.sent(),o=n.code,s=n.data,o===Cd.SUCCESS?[2,{code:o,data:s}]:(i.warn(Fd.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(o,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:o,msg:$b[o]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return xE()?pf("enableCheck",e,zh.BOOLEAN)?[2,zb((function(n){return uc(t,void 0,void 0,(function(){return dc(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return uc(this,void 0,void 0,(function(){var e=this;return dc(this,(function(t){return xE()?[2,zb((function(t,n){return uc(e,void 0,void 0,(function(){var e,r,i;return dc(this,(function(o){switch(o.label){case 0:return n.info(Fd.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=o.sent(),r=e.code,i=e.data,[2,{code:r,data:i}]}}))}))}))]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))}}),ak=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};e.BaseMessage=cP,e.ChatroomEntryType=qd,e.ChatroomUserChangeType=Jd,e.CombineMessage=gP,e.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},e.ConnectionStatus=Ad,e.ConversationType=Od,e.ErrorCode=Cd,e.FileMessage=pP,e.FileType=Id,e.GIFMessage=vP,e.HQVoiceMessage=lP,e.ImageMessage=dP,e.LocationMessage=EP,e.MentionedInfoBody=ak,e.MentionedType=Bd,e.MessageBlockType=Wd,e.MessageDirection=yd,e.MessageType={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"},e.NotificationLevel=Pd,e.NotificationStatus=wd,e.OperateStatus=sl,e.ReceivedStatus=oi,e.ReferenceMessage=mP,e.RichContentMessage=IP,e.SightMessage=hP,e.TextMessage=fP,e.UploadMethod=Gd,e.VoiceMessage=_P,e.__addSDKVersion=function(e,t){Rh.add(e,t)},e.addConversationsToTag=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("tagId",e,zh.STRING,!0)&&pf("conversations",t,zh.ARRAY,!0)&&!t.some((function(e){return!pf("conversation",e,zh.CONVERSATION,!0)}))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n;return dc(this,(function(o){switch(o.label){case 0:return i.info(Fd.O,"addTagForConversations ->tagId:".concat(e)),[4,r.addTagForConversations(e,t)];case 1:return(n=o.sent().code)===Cd.SUCCESS?[2,{code:n}]:(i.warn(Fd.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:$b[n]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.addEventListener=function(e,t,n){qb.on(e,t,n)},e.addTag=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("tag.tagId",e.tagId,zh.STRING,!0)&&pf("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&pf("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&pf("tag.tagName",e.tagName,zh.STRING,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t;return dc(this,(function(i){switch(i.label){case 0:return r.info(Fd.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=i.sent().code)===Cd.SUCCESS?[2,{code:t}]:(r.warn(Fd.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:$b[t]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.addToBlacklist=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("userId",e,zh.STRING,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){return dc(this,(function(t){switch(t.label){case 0:return r.info(Fd.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.bindRTCRoomForChatroom=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("option.chatRoomId",e.chatRoomId,zh.STRING,!0)&&pf("option.rtcRoomId",e.rtcRoomId,zh.STRING,!0)?[2,zb((function(n){return uc(t,void 0,void 0,(function(){var t;return dc(this,(function(r){switch(r.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=r.sent(),msg:$b[t]}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.clearAllMessagesUnreadStatus=function(){return uc(this,void 0,void 0,(function(){var e=this;return dc(this,(function(t){return[2,zb((function(t,n){return uc(e,void 0,void 0,(function(){return dc(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))},e.clearEventListeners=Zb,e.clearHistoryMessages=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("conversation",e,zh.CONVERSATION,!0)&&pf("timestamp",t,zh.NUMBER,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o;return dc(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(Fd.O,"clear message ->".concat(n)),[4,r.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(o=s.sent())!==Cd.SUCCESS?(i.warn(Fd.O,"clear message ->".concat(o,":").concat($b[o],",").concat(n)),[2,{code:o,msg:$b[o]}]):[2,{code:Cd.SUCCESS}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.clearMessages=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return Hb("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),xE()?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return t=e.conversationType,i=e.targetId,o=e.channelId,r.info(Fd.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(t)),[4,n.clearMessages(t,i,o)];case 1:return(s=a.sent())===Cd.SUCCESS?[2,{code:s}]:(r.warn(Fd.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},e.clearMessagesUnreadStatus=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i;return dc(this,(function(o){switch(o.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=o.sent(),i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(Fd.O,"clear unreadMsgNum ->".concat(i)),t!==Cd.SUCCESS?(r.warn(Fd.O,"clear unreadMsgNum fail ->".concat(t,":").concat($b[t],",").concat(i)),[2,{code:t,msg:$b[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.clearTextMessageDraft=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i;return dc(this,(function(o){switch(o.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(Fd.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(i=o.sent())===Cd.SUCCESS?[2,{code:i}
1]:(r.warn(Fd.O,"delete draft fail ->".concat(i,":").concat($b[i],",").concat(t)),[2,{code:i,msg:$b[i]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.clearUnreadCountByTimestamp=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return xE()?pf("conversation",e,zh.CONVERSATION,!0)&&pf("timestamp",t,zh.NUMBER)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return n=e.conversationType,o=e.targetId,s=e.channelId,i.info(Fd.O,"clearUnreadCountByTimestamp ->targetId:".concat(o,",conversationType:").concat(n)),[4,r.clearUnreadCountByTimestamp(n,o,t,s)];case 1:return(a=c.sent())===Cd.SUCCESS?[2,{code:a}]:(i.warn(Fd.O,"clearUnreadCountByTimestamp ->code:".concat(a,",targetId:").concat(o)),[2,{code:a,msg:$b[a]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},e.connect=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return pf("token",e,zh.STRING,!0)&&pf("reconnectKickEnable",t,zh.BOOLEAN)?(n=i.createTraceId(),i.info(Fd.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,r.connect(e,!!t,n)]):[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=a.sent(),s=o.code===Cd.SUCCESS?"info":"warn",i[s](Fd.A_CONNECT_R,JSON.stringify({code:o.code,userId:o.userId}),n),o.code===Cd.SUCCESS?[2,{code:o.code,data:{userId:o.userId}}]:[2,{code:o.code,msg:$b[o.code]}]}}))}))}))]}))}))},e.deleteLocalMessagesByTimestamp=function(e,t,n){return uc(this,void 0,void 0,(function(){var r,i,o,s=this;return dc(this,(function(a){return Hb("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),xE()?(r=e.conversationType,i=e.targetId,o=e.channelId,pf("conversationType",r,zh.NUMBER,!0)&&pf("targetId",i,zh.STRING,!0)&&pf("timestamp",t,zh.NUMBER,!0)&&pf("cleanSpace",n,zh.BOOLEAN)?[2,zb((function(a,c){return uc(s,void 0,void 0,(function(){var s;return dc(this,(function(u){switch(u.label){case 0:return[4,a.deleteMessagesByTimestamp(r,i,t,n,o)];case 1:return s=u.sent(),c.debug(Fd.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:r,targetId:i,channelId:o,timestamp:t})),s===Cd.SUCCESS?[2,{code:s}]:(c.warn(Fd.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},e.deleteMessages=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("conversation",e,zh.CONVERSATION,!0)&&pf("options",t,(function(e){return hl(e)&&e.length}),!0)&&!t.some((function(e){return!pf("options.messageUId",e.messageUId,zh.STRING,!0)||!pf("options.sentTime",e.sentTime,zh.NUMBER,!0)||!pf("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o;return dc(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(Fd.O,"delete messages ->".concat(n)),[4,r.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(o=s.sent())!==Cd.SUCCESS?(i.warn(Fd.O,"delete message fail ->".concat(o,":").concat($b[o],",").concat(n)),[2,{code:o,msg:$b[o]}]):[2,{code:Cd.SUCCESS}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.destroy=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return jb?(Zb(),[2,Qb()]):[2]}))}))},e.disconnect=function(e){return Ah(Fd.A_DISCONNECT_O,{}),Wb((function(t){return t.disconnect(e)}))},e.electronExtension=sk,e.forceRemoveChatRoomEntry=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&sP(t)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o;return dc(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.info(Fd.O,"force remove chatroom entry ->".concat(n)),[4,r.forceRemoveChatroomEntry(e,t)];case 1:return(o=s.sent())!==Cd.SUCCESS?(i.warn(Fd.O,"force remove chatroom entry fail ->code+:".concat($b[o],",").concat(n)),[2,{code:o,msg:$b[o]}]):[2,{code:o}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.forceSetChatRoomEntry=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&iP(t)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o;return dc(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(Fd.O,"force set chatroom entry ->".concat(n)),[4,r.forceSetChatroomEntry(e,t)];case 1:return(o=s.sent())!==Cd.SUCCESS?(i.warn(Fd.O,"force set chatroom entry fail ->code+:".concat($b[o],",").concat(n)),[2,{code:o,msg:$b[o]}]):[2,{code:o}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getAllChatRoomEntries=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("targetId",e,zh.STRING,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return t="id:".concat(e),r.debug(Fd.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return i=a.sent(),o=i.code,s=i.data,o===Cd.SUCCESS&&s?[2,{code:o,data:s}]:(r.warn(Fd.O,"get all chatroom entries fail ->
1code+:".concat($b[o],",").concat(t)),[2,{code:o,msg:$b[o]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getAllConversationState=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,zb((function(e){return e.getAllConversationState()}))]}))}))},e.getAllUltraGroupUnreadCount=function(){return uc(this,void 0,void 0,(function(){var e=this;return dc(this,(function(t){return[2,zb((function(t,n){return uc(e,void 0,void 0,(function(){var e,r,i,o;return dc(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return r=s.sent(),i=r.code,o=r.data,n.debug(Fd.O,e),i===Cd.SUCCESS?[2,{code:i,data:o}]:(n.warn(Fd.O,"".concat(e," fail ->").concat(i,": ").concat($b[i])),[2,{code:i,msg:$b[i]}])}}))}))}))]}))}))},e.getAllUltraGroupUnreadMentionedCount=function(){return uc(this,void 0,void 0,(function(){var e=this;return dc(this,(function(t){return[2,zb((function(t,n){return uc(e,void 0,void 0,(function(){var e,r,i,o;return dc(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return r=s.sent(),i=r.code,o=r.data,n.debug(Fd.O,e),i===Cd.SUCCESS?[2,{code:i,data:o}]:(n.warn(Fd.O,"".concat(e," fail ->").concat(i,": ").concat($b[i])),[2,{code:i,msg:$b[i]}])}}))}))}))]}))}))},e.getAllUnreadMentionedCount=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,zb((function(e,t){return t.debug(Fd.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))},e.getBlacklist=function(){return uc(this,void 0,void 0,(function(){var e=this;return dc(this,(function(t){return[2,zb((function(t,n){return uc(e,void 0,void 0,(function(){var e,r,i;return dc(this,(function(o){switch(o.label){case 0:return n.info(Fd.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=o.sent(),r=e.code,i=e.data,r===Cd.SUCCESS&&i?[2,{code:r,data:i}]:(n.warn(Fd.O,"getBlacklist fail -> code: ".concat(r)),[2,{code:r}])}}))}))}))]}))}))},e.getBlacklistStatus=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("userId",e,zh.STRING,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o;return dc(this,(function(s){switch(s.label){case 0:return r.info(Fd.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),i=t.code,o=t.data,i===Cd.SUCCESS?[2,{code:i,data:0===o}]:(r.warn(Fd.O,"getBlacklistStatus fail -> code: ".concat(i,", userId: ").concat(e)),[2,{code:i}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getBlockUltraGroupList=function(){return uc(this,void 0,void 0,(function(){var e=this;return dc(this,(function(t){return[2,zb((function(t,n){return uc(e,void 0,void 0,(function(){var e,r,i;return dc(this,(function(o){switch(o.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=o.sent(),r=e.code,i=e.data,r===Cd.SUCCESS?[2,{code:Cd.SUCCESS,data:i}]:(n.warn(Fd.O,"get block ultragroup ->".concat(r,":").concat($b[r])),[2,{code:r,msg:$b[r]}])}}))}))}))]}))}))},e.getBlockedConversationList=function(){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){return[2,zb((function(e){return e.getBlockConversationList()}))]}))}))},e.getChatRoomEntry=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&pf("key",t,(function(e){return dl(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return n="id:".concat(e),i.debug(Fd.O,"get chatroom entry->".concat(n)),[4,r.getChatroomEntry(e,t)];case 1:return o=c.sent(),s=o.code,a=o.data,s===Cd.SUCCESS&&a?[2,{code:s,data:a}]:(i.warn(Fd.O,"get chatroom entry fail ->code+:".concat($b[s],",").concat(n)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getChatRoomInfo=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&pf("options.count",t.count,zh.NUMBER)&&pf("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return n="id:".concat(e),i.debug(Fd.O,"get chatroom info ->".concat(n)),[4,r.getChatroomInfo(e,t.count,t.order)];case 1:return o=c.sent(),s=o.code,a=o.data,s===Cd.SUCCESS&&a?[2,{code:s,data:a}]:(i.warn(Fd.O,"get chatroom info fail ->code+:".concat($b[s],",").concat(n)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getChatroomHistoryMessages=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&pf("options.timestamp",t.timestamp,zh.NUMBER)&&pf("options.count",t.count,zh.NUMBER)&&pf("options.count",t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invali
1d, It should be greater than 0 and less than 100'),t}))&&pf("options.order",t.order,(function(e){return 0===e||1===e}))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(Fd.O,"get chatroom history message->".concat(n)),[4,r.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return o=u.sent(),s=o.code,a=o.data,s===Cd.SUCCESS&&a?(c=a.list.map((function(e){return kb(e)})),[2,{code:s,data:{list:c,hasMore:!!a.hasMore}}]):(i.warn(Fd.O,"get chatroom history message fail ->code+:".concat($b[s],",").concat(n)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getConnectionStatus=function(){return Wb((function(e){return e.getConnectionStatus()}))},e.getConversation=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o;return dc(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),i=t.code,o=t.data,i!==Cd.SUCCESS?(r.warn(Fd.O,"getConversation ->code:".concat(i,", targetId:").concat(e.targetId)),[2,{code:i,msg:$b[i]}]):[2,{code:i,data:o?Fb(o):null}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getConversationList=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("options.count",null==e?void 0:e.count,zh.NUMBER)&&pf("options.startTime",null==e?void 0:e.startTime,zh.NUMBER)&&pf("options.order",null==e?void 0:e.order,zh.NUMBER)&&pf("channelId",t,zh.CHANNEL_ID)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return[4,r.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=a.sent(),o=n.code,s=n.data,o===Cd.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Fb(e)}))}]:(i.warn(Fd.O,"get conversation list fail ->".concat(o,":").concat($b[o])),[2,{code:o,msg:$b[o]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getConversationNotificationLevel=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return t=nP(r,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return i=a.sent(),o=i.code,s=i.data,o===Cd.SUCCESS?[2,{code:o,data:s}]:(r.warn(Fd.O,"getConversationNotificationLevel fail -> ".concat(o," : ").concat($b[o]," , ").concat(t)),[2,{code:o,msg:$b[o]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getConversationNotificationStatus=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o;return dc(this,(function(s){switch(s.label){case 0:return r.info(Fd.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),i=t.code,o=t.data,i===Cd.SUCCESS?[2,{code:i,data:o}]:(r.warn(Fd.O,"getConversationNotificationStatus ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:$b[i]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getConversationsFromTagByPage=function(e,t,n){return uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return pf("tagId",e,zh.STRING,!0)&&pf("count",t,zh.NUMBER,!0)&&pf("startTime",n,zh.NUMBER,!0)?[2,zb((function(i,o){return uc(r,void 0,void 0,(function(){var r,s,a;return dc(this,(function(c){switch(c.label){case 0:return o.info(Fd.O,"getConversationListByTag ->tagId:".concat(e)),[4,i.getConversationListByTag(e,n,t)];case 1:return r=c.sent(),s=r.code,a=r.data,s===Cd.SUCCESS?[2,{code:s,data:null==a?void 0:a.map((function(e){return function(e){return cc(cc({},Fb(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(o.warn(Fd.O,"getConversationListByTag ->
1code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getCurrentUserId=function(){return Wb((function(e){return e.getCurrentUserId()}))},e.getDeviceId=function(){return Wb((function(e){return e.getDeviceId()}))},e.getFileToken=function(e,t,n,r){return zb((function(i){return new Promise((function(o){i.getFileToken(e,t,n,r).then((function(e){o({code:Cd.SUCCESS,data:e})})).catch((function(e){o({code:e,msg:$b[e]})}))}))}))},e.getFileUrl=Xx,e.getFirstUnreadMessage=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return xE()?pf("conversation",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i=t.code,o=t.data,i===Cd.SUCCESS?(s=o&&kb(o)||null,[2,{code:i,data:s}]):(r.warn(Fd.O,"insertMessage ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:$b[i]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},e.getHistoryMessages=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("options.timestamp",null==t?void 0:t.timestamp,zh.NUMBER)&&pf("options.count",null==t?void 0:t.count,zh.NUMBER)&&(xE()||pf("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&pf("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&pf("conversation",e,zh.CONVERSATION,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return n=i.createTraceId(),i.info(Fd.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,r.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return o=u.sent(),s=o.code,a=o.data,s===Cd.SUCCESS&&a?(c=a.list.map((function(e){return kb(e)})),i.info(Fd.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:c.length}),n),[2,{code:s,data:{list:c,hasMore:a.hasMore}}]):(i.warn(Fd.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getMessage=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return xE()?pf("messageId",e,(function(e){return ll(e)||dl(e)}),!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o;return dc(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),i=t.code,o=t.data,i===Cd.SUCCESS?[2,{code:i,data:kb(o)}
1]:(r.warn(Fd.O,"getMessage ->code:".concat(i,",messageId:").concat(e)),[2,{code:i,msg:$b[i]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},e.getMessageReader=function(e,t,n){return uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return pf("messageUId",t,zh.STRING,!0)&&pf("targetId",e,zh.STRING,!0)&&pf("channelId",n,zh.CHANNEL_ID)?[2,zb((function(i,o){return uc(r,void 0,void 0,(function(){var r,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return r="messageUId:".concat(t,",targetId:").concat(e),o.debug(Fd.O,"get message reader ->".concat(r)),[4,i.getMessageReader(e,t,n)];case 1:return s=u.sent(),a=s.code,c=s.data,a===Cd.SUCCESS?[2,{code:a,data:c}]:(o.warn(Fd.O,"get message reader fail ->".concat(a,":").concat($b[a],",").concat(r)),[2,{code:a,msg:$b[a]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getProxy=function(){return uc(this,void 0,void 0,(function(){var e=this;return dc(this,(function(t){return[2,zb((function(t,n){return uc(e,void 0,void 0,(function(){var e,r,i;return dc(this,(function(o){switch(o.label){case 0:return[4,t.getProxy()];case 1:return e=o.sent(),r=e.code,i=e.data,r===Cd.SUCCESS?[2,{code:r,data:i}]:(n.warn(Fd.O,"getProxy ->code:".concat(r)),[2,{code:r,msg:$b[r]}])}}))}))}))]}))}))},e.getRemoteHistoryMessages=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("options.timestamp",null==t?void 0:t.timestamp,zh.NUMBER)&&pf("options.count",null==t?void 0:t.count,zh.NUMBER)&&pf("options.count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&pf("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&pf("conversation",e,zh.CONVERSATION,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(Fd.O,"get history message ->".concat(n)),[4,r.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return o=u.sent(),s=o.code,a=o.data,s===Cd.SUCCESS&&a?(c=a.list.map((function(e){return kb(e)})),[2,{code:s,data:{list:c,hasMore:a.hasMore}}]):(i.warn(Fd.O,"get history message fail ->".concat(s,":").concat($b[s],",").concat(n)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getServerTime=function(){return Wb((function(e){return e.getServerTime()}))},e.getTags=function(){return uc(this,void 0,void 0,(function(){var e=this;return dc(this,(function(t){return[2,zb((function(t,n){return uc(e,void 0,void 0,(function(){var e,r,i;return dc(this,(function(o){switch(o.label){case 0:return[4,t.getTagList()];case 1:return e=o.sent(),r=e.code,i=e.data,r===Cd.SUCCESS?[2,{code:Cd.SUCCESS,data:i}]:(n.warn(Fd.O,"getTagList ->code:".concat(r)),[2,{code:r,msg:$b[r]}])}}))}))}))]}))}))},e.getTagsFromConversation=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("conversation",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o;return dc(this,(function(s){switch(s.label){case 0:return r.info(Fd.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),i=t.code,o=t.data,i===Cd.SUCCESS?[2,{code:i,data:o}]:[2,{code:i,msg:$b[i]}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getTextMessageDraft=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i=t.code,o=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(Fd.O,"get draft ->".concat(s)),i===Cd.SUCCESS?[2,{code:i,data:o||""}]:(r.warn(Fd.O,"get draft fail ->".concat(i,":").concat($b[i],",").concat(s)),[2,{code:i,msg:$b[i]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getTopConversationList=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("conversationTypes",e,zh.ARRAY)&&!(null==e?void 0:e.some((function(e){return!pf("conversationType",e,Il)})))&&pf("channelId",t,zh.CHANNEL_ID)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return[4,r.getTopConversationList(e,t)];
1case 1:return n=a.sent(),o=n.code,s=n.data,o===Cd.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Fb(e)}))}]:(i.warn(Fd.A_GET_TOP_CONVERSATION_LIST_E,"".concat(o,":").concat($b[o])),[2,{code:o,msg:$b[o]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getTotalUnreadCount=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("includeMuted",e,zh.BOOLEAN,!1)&&pf("conversationTypes",t,zh.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!pf("conversationType",e,Il)})))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return i.debug(Fd.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,r.getTotalUnreadCount("",t,e)];case 1:return n=a.sent(),o=n.code,s=n.data,o===Cd.SUCCESS?[2,{code:o,data:s}]:(i.warn(Fd.O,"getTotalUnreadCount fail ->".concat(o,":").concat($b[o])),[2,{code:o,msg:$b[o]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getTotalUnreadCountByLevels=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return!pf("conversationTypes",e,zh.ARRAY,!0)||!pf("levels",t,zh.ARRAY,!0)||e.some((function(e){return!pf("conversationType",e,Il)}))||t.some((function(e){return!pf("level",e,Tl)}))?[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return[4,r.getTotalUnreadCountByLevels(e,t)];case 1:return n=a.sent(),o=n.code,s=n.data,o===Cd.SUCCESS?[2,{code:o,data:s}]:(i.warn(Fd.O,"getTotalUnreadCountByLevels fail ->".concat(o,":").concat($b[o])),[2,{code:o,msg:$b[o]}])}}))}))}))]}))}))},e.getTotalUnreadMentionedCountByLevels=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return!pf("conversationTypes",e,zh.ARRAY,!0)||!pf("levels",t,zh.ARRAY,!0)||e.some((function(e){return!pf("conversationType",e,Il)}))||t.some((function(e){return!pf("level",e,Tl)}))?[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return[4,r.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=a.sent(),o=n.code,s=n.data,o===Cd.SUCCESS?[2,{code:o,data:s}]:(i.warn(Fd.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(o,":").concat($b[o])),[2,{code:o,msg:$b[o]}])}}))}))}))]}))}))},e.getUltraGroupDefaultNotificationLevel=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("options.targetId",e.targetId,zh.STRING,!0)&&pf("options.channelId",e.channelId,zh.CHANNEL_ID)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return t="getUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(Fd.O,"".concat(t," -> ").concat(i)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return o=c.sent(),s=o.code,a=o.data,s===Cd.SUCCESS?[2,{code:s,data:a}]:(r.warn(Fd.O,"".concat(t," fail -> ").concat(s," : ").concat($b[s]," , ").concat(i)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getUltraGroupFirstUnreadMessageTimestamp=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("conversation.targetId",e.targetId,zh.STRING,!0)&&pf("conversation.channelId",e.channelId,zh.CHANNEL_ID,!0)?[2,zb((function(n){return uc(t,void 0,void 0,(function(){var t,r,i,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return t=e.targetId,r=e.channelId,i={targetId:t,channelId:r},[4,n.getUltraGroupFirstUnreadMessageTimestamp(i)];case 1:return o=c.sent(),s=o.code,a=o.data,s===Cd.SUCCESS?[2,{code:s,data:a}]:[2,{code:s,msg:$b[s]}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getUltraGroupList=function(t){return void 0===t&&(t={}),uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("options.targetId",t.targetId,zh.STRING,!1)&&pf("options.channelType",t.channelType,(function(t){return void 0!==e.UltraGroupChannelType[t]}),!1)?[2,zb((function(e,r){return uc(n,void 0,void 0,(function(){var n,i,o;return dc(this,(function(s){switch(s.label){case 0:return[4,e.getUltraGroupList(t)];case 1:return n=s.sent(),i=n.code,o=n.data,i===Cd.SUCCESS?[2,{code:Cd.SUCCESS,data:o}]:(r.warn(Fd.O,"get ultragroup ->".concat(i,":").concat($b[i])),[2,{code:i,msg:$b[i]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getUltraGroupMessageListByMessageUId=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("options",e,zh.CONVERSATION,!0)&&pf("msgs",t,zh.ARRAY,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c,u,d,l,h,f;return dc(this,(function(g){switch(g.label){case 0:return n=e.targetId,o=e.conversationType,s=e.channelId,a=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;a.push({sendTime:t,messageUId:n,channelId:s})})),c={targetId:n,conversationType:o,messages:a},[4,r.getUltraGroupMessageListByMessageUId(c)];case 1:if(u=g.sent(),d=u.code,l=u.data,d===Cd.SUCCESS){for(f in h={},l)h[f]=l[f]?kb(l[f]):void 0;return[2,{code:Cd.SUCCESS,data:h}]}return i.warn(Fd.O,"get UltraGroup MessageList by messageUId ->".concat(d,":").concat($b[d])),[2,{code:d,msg:$b[d]}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getUltraGroupUnreadCountByTargetId=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&pf("notificationLevels",t,zh.ARRAY)&&!(null==t?void 0:t.some((function(e){return!pf("notificationLevel",e,Tl)})))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,r.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return o=u.sent(),s=o.code,a=o.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),i.debug(Fd.O,"".concat(n," -> ").concat(c)),s===Cd.SUCCESS?[2,{code:s,data:a}]:(i.warn(Fd.O,"".concat(n," fail -> ").concat(s,": ").concat($b[s],", ").concat(c)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getUltraGroupUnreadMentionedCountByTargetId=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&pf("notificationLevels",t,zh.ARRAY)&&!(null==t?void 0:t.some((function(e){return!pf("notificationLevel",e,Tl)})))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return i.debug(Fd.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,r.getUltraGroupUnreadMentionedCountByTargetId(e,t)];
1case 1:return n=a.sent(),o=n.code,s=n.data,o===Cd.SUCCESS?[2,{code:Cd.SUCCESS,data:s}]:(i.warn(Fd.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(o,":").concat($b[o])),[2,{code:o,msg:$b[o]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getUltraGroupUnreadMentionedMessages=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return e.channelId=e.channelId||"",pf("options.targetId",e.targetId,zh.STRING,!0)&&pf("options.channelId",e.channelId,zh.CHANNEL_ID,!0)&&pf("options.sentTime",e.sentTime,zh.NUMBER,!0)&&pf("options.count",e.count,(function(e){return ll(e)&&e>0&&e<=50}),!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return t=e.targetId,i=e.channelId,o=e.sentTime,s=e.count,a={targetId:t,channelId:i,sentTime:o,count:s},[4,n.getUltraGroupUnreadMentionedMessages(a)];case 1:return c=l.sent(),u=c.code,d=c.data,u===Cd.SUCCESS?[2,{code:u,data:d}]:(r.warn(Fd.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(u,": ").concat($b[u])),[2,{code:u,msg:$b[u]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getUnreadConversationList=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return!pf("conversationTypes",e,zh.ARRAY)||(null==e?void 0:e.some((function(e){return!pf("conversationType",e,Rl)})))?[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,r,i;return dc(this,(function(o){switch(o.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=o.sent(),r=t.code,i=t.data,r===Cd.SUCCESS&&i?[2,{code:0,data:i.map((function(e){return Fb(e)}))}]:[2,{code:r,msg:$b[r]}]}}))}))}))]}))}))},e.getUnreadCount=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s;return dc(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i=t.code,o=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(Fd.O,"get unreadCount ->".concat(s)),i===Cd.SUCCESS?[2,{code:i,data:o}]:(r.warn(Fd.O,"get unreadCount fail ->".concat(i,":").concat($b[i],",").concat(s)),[2,{code:i,msg:$b[i]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getUnreadCountByTag=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("tagId",e,zh.STRING,!0)&&pf("containMuted",t,zh.BOOLEAN,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return i.info(Fd.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,r.getUnreadCountByTag(e,t)];case 1:return n=a.sent(),o=n.code,s=n.data,o===Cd.SUCCESS?[2,{code:o,data:s}]:(i.warn(Fd.O,"getUnreadCountByTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:$b[o]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getUnreadMentionedCount=function(e){return uc(this,void 0,void 0,(function(){return dc(this,(function(t){return pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(t,n){return n.debug(Fd.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.getUnreadMentionedMessages=function(e){if(!xE())return{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]};var t,n=e.conversationType,r=e.targetId,i=e.channelId;return pf("conversation",e,zh.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,r,i),o=[];return t&&t.length&&t.forEach((function(e){return o.push(kb(e))})),{code:Cd.SUCCESS,data:o}},jb?t(jb,Jb,Yb):{code:Cd.BIZ_ERROR_CLIENT_NOT_INIT}):{code:Cd.BIZ_ERROR_INVALID_PARAMETER}},e.init=function(e){!function(e){var t,n=e.appkey,r=e.navigators;jb?Jb.warn(Fd.A_INIT_REPEAT_O):(gf("options.appkey",e.appkey,zh.STRING,!0),gf("options.navigators",e.navigators,(function(e){return hl(e)&&(0===e.length||e.every(El))})),Yb=e,jb=ab.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||xb,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(Jb=jb.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Jb.info(Fd.A_INIT_O,JSON.stringify({appkey:n,navigators:r,version:"5.7.7",commit:"b3c8dfd27d7bceefb4db934e16d30701f2c9195b"})),jb.assignWatcher(Kb),Sh(Jb))}(e)},e.insertMessage=function(e,t,n){return void 0===n&&(n={}),uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return Hb("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),xE()?pf("conversation",e,zh.CONVERSATION,!0)&&pf("message",t,zh.OBJECT,!0)&&pf("options",n,zh.OBJ
1ECT)&&pf("options.isUnread",null==n?void 0:n.isUnread,zh.BOOLEAN)&&pf("options.searchContent",null==n?void 0:n.searchContent,zh.STRING)&&pf("content.senderUserId",t.senderUserId,zh.STRING,!0)&&pf("content.messageType",t.messageType,zh.STRING,!0)&&pf("content.content",t.content,zh.OBJECT,!0)&&pf("content.messageDirection",t.messageDirection,zh.NUMBER,!0)&&pf("content.canIncludeExpansion",t.canIncludeExpansion,zh.BOOLEAN)&&pf("content.expansion",t.expansion,zh.OBJECT)&&pf("content.disableNotification",t.disableNotification,zh.BOOLEAN)&&pf("content.sentTime",t.sentTime,zh.NUMBER)&&pf("content.sentStatus",t.sentStatus,zh.NUMBER)?[2,zb((function(i,o){return uc(r,void 0,void 0,(function(){var r,s,a,c,u,d,l,h,f,g,p,v,_,E,m,I;return dc(this,(function(T){switch(T.label){case 0:return r=t.senderUserId,s=t.messageType,a=t.content,c=t.messageDirection,u=t.messageUId,d=t.canIncludeExpansion,l=t.expansion,h=t.disableNotification,f=t.sentTime,g=t.sentStatus,o.info(Fd.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),p=n.isUnread,v=n.searchContent,_={senderUserId:r,messageType:s,content:a,messageDirection:c,sentTime:f,sentStatus:g,searchContent:v,isUnread:p,messageUId:u,disableNotification:h,canIncludeExpansion:d,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,_)];case 1:return E=T.sent(),m=E.code,I=E.data,m===Cd.SUCCESS?[2,{code:m,data:kb(I)}]:(o.warn(Fd.O,"insertMessage ->code:".concat(m,",targetId:").concat(e.targetId)),[2,{code:m,msg:$b[m]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},e.installPlugin=function(e,t){return Wb((function(n){return n.install(e,t)}))},e.joinChatRoom=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&pf("options.count",t.count,zh.NUMBER,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return n=i.createTraceId(),i.info(Fd.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,r.joinChatroom(e,t.count,n)];case 1:return o=a.sent(),s=o===Cd.SUCCESS?"info":"warn",i[s](Fd.A_JOIN_CHATROOM_R,JSON.stringify({code:o,timestamp:(new Date).getTime()}),n),o!==Cd.SUCCESS?[2,{code:o,msg:$b[o]}]:[2,{code:o}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.joinExistChatRoom=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&pf("options.count",t.count,zh.NUMBER,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return n=i.createTraceId(),i.info(Fd.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,r.joinExistChatroom(e,t.count,n)];case 1:return o=a.sent(),s=o===Cd.SUCCESS?"info":"warn",i[s](Fd.A_JOIN_CHATROOM_R,JSON.stringify({code:o,timestamp:(new Date).getTime()}),n),o!==Cd.SUCCESS?[2,{code:o,msg:$b[o]}]:[2,{code:o}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.modifyMessage=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("content",e,zh.OBJECT,!0)&&pf("message",t,zh.OBJECT,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c,u,d,l,h,f;return dc(this,(function(g){switch(g.label){case 0:return n=t.conversationType,o=t.targetId,s=t.messageUId,a=t.senderUserId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(o,",channelId:").concat(d,",messageUId:").concat(s),i.debug(Fd.O,"update ultragroup message expansion ->".concat(l)),h={targetId:o,channelId:d,conversationType:n,fromUserId:a,sendTime:c,canIncludeExpansion:u,messageUId:s,content:e},[4,r.modifyMessage(h)];case 1:return(f=g.sent().code)===Cd.SUCCESS?[2,{code:Cd.SUCCESS}]:(i.warn(Fd.O,"modify ultraGroup message ->".concat(f,":").concat($b[f])),[2,{code:f,msg:$b[f]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.onceEventListener=function(e,t,n){qb.once(e,t,n)},e.quitChatRoom=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("targetId",e,zh.STRING,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o;return dc(this,(function(s){switch(s.label){case 0:return t=r.createTraceId(),r.info(Fd.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return i=s.sent(),o=i===Cd.SUCCESS?"info":"warn",r[o](Fd.A_QUIT_CHATROOM_R,JSON.stringify({code:i}),t),i!==Cd.SUCCESS?[2,{code:i,msg:$b[i]}]:[2,{code:i}
1]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.recallMessage=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("conversation",e,zh.CONVERSATION,!0)&&pf("options.messageUId",t.messageUId,zh.STRING,!0)&&pf("options.sentTime",t.sentTime,zh.NUMBER,!0)&&pf("options.disableNotification",null==t?void 0:t.disableNotification,zh.BOOLEAN)&&pf("options.pushConfig",null==t?void 0:t.pushConfig,zh.OBJECT)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},o="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),i.debug(Fd.O,"recall message ->".concat(o)),[4,r.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=u.sent(),a=s.code,c=s.data,a===Cd.SUCCESS&&c?[2,{code:a,data:kb(c)}]:a===Cd.SUCCESS?[2,{code:a}]:(i.warn(Fd.O,"recall message fail ->".concat(a,":").concat($b[a],",").concat(o)),[2,{code:a,msg:$b[a]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.registerMessageType=function(e,t,n,r,i){return Wb((function(o,s){return gf("messageType",e,zh.STRING,!0),gf("isPersited",t,zh.BOOLEAN,!0),gf("isCounted",n,zh.BOOLEAN,!0),gf("isStatusMessage",i,zh.BOOLEAN,!1),gf("searchProps",r,zh.ARRAY),s.info(Fd.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:i,isPersited:t})),o.registerMessageType(e,t,n,r,i),uP(e,t,n)}))},e.removeAllExpansionForUltraGroupMessage=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("message",e,zh.OBJECT,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i,o,s,a,c,u,d,l;return dc(this,(function(h){switch(h.label){case 0:return t=e.conversationType,i=e.targetId,o=e.messageUId,s=e.sentTime,a=e.canIncludeExpansion,c=e.channelId,u="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(c,",messageUId:").concat(o),r.debug(Fd.O,"remove all expansion for ultraGroup message ->".concat(u)),d={targetId:i,channelId:c,conversationType:t,sendTime:s,canIncludeExpansion:a,messageUId:o,removeAll:!0},[4,n.expandUltraMessage(d)];case 1:return(l=h.sent().code)===Cd.SUCCESS?[2,{code:Cd.SUCCESS}]:(r.warn(Fd.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat($b[l])),[2,{code:l,msg:$b[l]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.removeChatRoomEntries=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&aP(t)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.info(Fd.O,"remove chatroom entry->".concat(n)),(o=cc({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,r.removeChatroomEntries(e,o)];case 1:return s=u.sent(),a=s.code,c=s.data,a!==Cd.SUCCESS?(i.warn(Fd.O,"remove chatroom entry fail ->code+:".concat($b[a],",").concat(n)),[2,{code:a,msg:$b[a],data:c}]):[2,{code:a}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.removeChatRoomEntry=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&sP(t)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o;return dc(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(Fd.O,"remove chatroom entry->".concat(n)),[4,r.removeChatroomEntry(e,t)];case 1:return(o=s.sent())!==Cd.SUCCESS?(i.warn(Fd.O,"remove chatroom entry fail ->code+:".concat($b[o],",").concat(n)),[2,{code:o,msg:$b[o]}]):[2,{code:o}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.removeConversation=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t,i;return dc(this,(function(o){switch(o.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=o.sent(),i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(Fd.O,"destroy conversation ->".concat(i)),t!==Cd.SUCCESS?(r.warn(Fd.O,"destroy conversation fail ->".concat(t,":").concat($b[t],",").concat(i)),[2,{code:t,msg:$b[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.removeConversationsFromTag=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("tagId",e,zh.STRING,!0)&&pf("conversations",t,zh.ARRAY,!0)&&!t.some((function(e){return!pf("conversation",e,zh.CONVERSATION,!0)}))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n;return dc(this,(function(o){switch(o.label){case 0:return i.info(Fd.O,"removeTagForConversations ->tagId:".concat(e)),[4,r.removeTagForConversations(e,t)];case 1:return(n=o.sent().code)===Cd.SUCCESS?[2,{code:n}]:(i.warn(Fd.O,"removeTagForConversations ->
1code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:$b[n]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.removeEventListener=function(e,t,n){qb.off(e,t,n)},e.removeEventListeners=function(e){qb.removeAll(e)},e.removeExpansionForUltraGroupMessage=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("expansion",e,zh.ARRAY,!0)&&pf("message",t,zh.OBJECT,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c,u,d,l,h;return dc(this,(function(f){switch(f.label){case 0:return n=t.conversationType,o=t.targetId,s=t.messageUId,a=t.sentTime,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(o,",channelId:").concat(u,",messageUId:").concat(s),i.debug(Fd.O,"remove expansion for ultragroup message ->".concat(d)),l={targetId:o,channelId:u,conversationType:n,sendTime:a,canIncludeExpansion:c,messageUId:s,keys:e},[4,r.expandUltraMessage(l)];case 1:return(h=f.sent().code)===Cd.SUCCESS?[2,{code:Cd.SUCCESS}]:(i.warn(Fd.O,"remove expansion for ultraGroup message ->".concat(h,":").concat($b[h])),[2,{code:h,msg:$b[h]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.removeFromBlacklist=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("userId",e,zh.STRING,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){return dc(this,(function(t){switch(t.label){case 0:return r.info(Fd.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.removeMessageExpansionForKey=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("keys",e,zh.ARRAY,!0)&&pf("message",t,zh.OBJECT,!0)&&pf("message.conversationType",t.conversationType,zh.NUMBER,!0)&&pf("message.targetId",t.targetId,zh.STRING,!0)&&pf("message.channelId",t.channelId,zh.CHANNEL_ID)&&pf("message.messageUId",t.messageUId,zh.STRING,!0)&&pf("message.canIncludeExpansion",t.canIncludeExpansion,zh.BOOLEAN,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return n=t.conversationType,o=t.targetId,s=t.messageUId,a=t.canIncludeExpansion,c=t.channelId,u="conversationType:".concat(n,",targetId:").concat(o,",messageUId:").concat(s),i.debug(Fd.O,"remove message expansion ->".concat(u)),[4,r.sendExpansionMessage({conversationType:n,targetId:o,messageUId:s,canIncludeExpansion:a,keys:e,channelId:c})];case 1:return(d=l.sent().code)!==Cd.SUCCESS?(i.warn(Fd.O,"remove message expansion fail ->".concat(d,":").concat($b[d],",").concat(u)),[2,{code:d,msg:$b[d]}]):[2,{code:d}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.removeTag=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("tagId",e,zh.STRING,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t;return dc(this,(function(i){switch(i.label){case 0:return r.info(Fd.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=i.sent().code)===Cd.SUCCESS?[2,{code:t}]:(r.warn(Fd.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:$b[t]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.removeTagFromConversations=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("tagId",e,zh.STRING,!0)&&pf("conversations",t,zh.ARRAY,!0)&&!t.some((function(e){return!pf("conversation",e,zh.CONVERSATION,!0)}))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n;return dc(this,(function(o){switch(o.label){case 0:return i.info(Fd.O,"removeTagForConversations ->tagId:".concat(e)),[4,r.removeTagForConversations(e,t)];case 1:return(n=o.sent().code)===Cd.SUCCESS?[2,{code:n}]:(i.warn(Fd.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:$b[n]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.removeTagsFromConversation=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("conversation",e,zh.CONVERSATION,!0)&&pf("tagIds",t,zh.ARRAY,!0)&&!t.some((function(e){return!pf("tagId",e,zh.STRING,!0)}))?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n;return dc(this,(function(o){switch(o.label){case 0:return i.info(Fd.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,r.removeTagsForConversation(e,t)];case 1:return(n=o.sent().code)===Cd.SUCCESS?[2,{code:n}]:(i.warn(Fd.O,"removeTagsForConversation ->
1code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:$b[n]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.saveTextMessageDraft=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("options",e,zh.CONVERSATION,!0)&&pf("draft",t,zh.STRING,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o;return dc(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(Fd.O,"set draft ->".concat(n)),[4,r.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(o=s.sent())===Cd.SUCCESS?[2,{code:o}]:(i.warn(Fd.O,"set draft fail ->".concat(o,":").concat($b[o],",").concat(n)),[2,{code:o,msg:$b[o]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.searchConversationByContent=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i=this;return dc(this,(function(o){return Hb("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),xE()?[2,zb((function(o,s){return uc(i,void 0,void 0,(function(){var i,a,c;return dc(this,(function(u){switch(u.label){case 0:return s.info(Fd.O,"searchConversationByContent ->keyword:".concat(e)),[4,o.searchConversationByContent(e,n,r,t)];case 1:return i=u.sent(),a=i.code,c=i.data,a===Cd.SUCCESS?[2,{code:a,data:c}]:(s.warn(Fd.O,"searchConversationByContent ->code:".concat(a,",keyword:").concat(e)),[2,{code:a,msg:$b[a]}])}}))}))}))]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},e.searchMessages=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i=this;return dc(this,(function(o){return Hb("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),xE()?pf("conversation",e,zh.CONVERSATION,!0)&&pf("keyword",t,zh.STRING,!0)&&pf("timestamp",n,zh.NUMBER)&&pf("count",r,zh.NUMBER)?[2,zb((function(o,s){return uc(i,void 0,void 0,(function(){var i,a,c,u;return dc(this,(function(d){switch(d.label){case 0:return 1,[4,o.searchMessageByContent(e.conversationType,e.targetId,t,n,r,1,e.channelId)];case 1:return i=d.sent(),a=i.code,c=i.data,a===Cd.SUCCESS?(u=[],(null==c?void 0:c.messages)&&c.messages.length&&c.messages.forEach((function(e){return u.push(kb(e))})),[2,{code:a,data:{messages:u,count:null==c?void 0:c.count}}]):(s.warn(Fd.O,"searchMessages ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:$b[a]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},e.sendFileMessage=tk,e.sendGIFMessage=rk,e.sendHQVoiceMessage=ik,e.sendImageMessage=nk,e.sendMessage=$x,e.sendReadReceiptMessage=function(e,t,n,r){return uc(this,void 0,void 0,(function(){var i=this;return dc(this,(function(o){return pf("targetId",e,zh.STRING,!0)&&pf("messageUId",t,zh.STRING,!0)&&pf("timestamp",n,zh.NUMBER,!0)&&pf("channelId",r,zh.CHANNEL_ID)?[2,zb((function(o){return uc(i,void 0,void 0,(function(){var i,o,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return i={targetId:e,conversationType:Od.PRIVATE,channelId:r},o=new cP("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,$x(i,o)];case 1:return s=u.sent(),a=s.code,c=s.msg,0===a?[2,{code:a}]:[2,{code:a,msg:c}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.sendReadReceiptRequest=function(e,t,n){return uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return pf("messageUId",t,zh.STRING,!0)&&pf("targetId",e,zh.STRING,!0)&&pf("channelId",n,zh.CHANNEL_ID)?[2,zb((function(i,o){return uc(r,void 0,void 0,(function(){var r,i,s,a,c;return dc(this,(function(u){switch(u.label){case 0:return r="messageUId:".concat(t,",targetId:").concat(e),o.debug(Fd.O,"send read receipt message ->".concat(r)),i=new cP("RC:RRReqMsg",{messageUId:t}),[4,$x({targetId:e,conversationType:Od.GROUP,channelId:n},i)];case 1:return s=u.sent(),a=s.code,c=s.msg,0===a?[2,{code:a}]:[2,{code:a,msg:c}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.sendReadReceiptResponse=function(e,t,n){return uc(this,void 0,void 0,(function(){return dc(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))},e.sendReadReceiptResponseV2=function(e,t,n){return uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return pf("targetId",e,zh.STRING,!0)&&pf("messageList",t,zh.OBJECT,!0)&&pf("channelId",n,zh.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!pf(e,t[e],zh.ARRAY)}))?[2,zb((function(i,o){return uc(r,void 0,void 0,(function(){var r,s,a,c,u,d;return dc(this,(function(l){switch(l.label){case 0:return r={targetId:e,conversationType:Od.GROUP,channelId:n}
1,a=i.getNaviInfoFromCache(),1!==(null==a?void 0:a.grpRRVer)?[3,2]:(c=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===c.indexOf(e)&&c.push(e)}))})),c.length?[4,i.sendReadReceiptMessage(e,c,n)]:(o.warn(Fd.O,"Error in parameter messageList."),[2,{code:Cd.PARAMETER_ERROR}]));case 1:return s=l.sent(),[3,4];case 2:return u=new cP("RC:RRRspMsg",{receiptMessageDic:t}),[4,$x(r,u)];case 3:s=l.sent(),l.label=4;case 4:return(d=s.code)===Cd.SUCCESS?[2,{code:d}]:(o.warn(Fd.O,"send read receipt message fail ->".concat(d,":").concat($b[d])),[2,{code:d,msg:$b[d]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.sendSightMessage=ok,e.sendSyncReadStatusMessage=function(e,t){return uc(this,void 0,void 0,(function(){var n,r,i,o;return dc(this,(function(s){switch(s.label){case 0:return pf("conversation",e,zh.CONVERSATION,!0)&&pf("lastMessageSendTime",t,zh.NUMBER,!0)?(n=new cP("RC:SRSMsg",{lastMessageSendTime:t}),[4,$x(e,n)]):[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}];case 1:return r=s.sent(),i=r.code,o=r.msg,0===i?[2,{code:i}]:[2,{code:i,msg:o}]}}))}))},e.sendTextMessage=function(e,t,n){return $x(e,new fP(t),n)},e.sendTypingStatusMessage=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("conversation",e,zh.CONVERSATION,!0)&&pf("typingContentType",t,zh.STRING,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c,u;return dc(this,(function(d){switch(d.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},o=i.createTraceId(),i.info(Fd.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),o),[4,r.sendMessage(e.conversationType,e.targetId,n,void 0,o)];case 1:return s=d.sent(),a=s.code,c=s.data,u=a===Cd.SUCCESS?"info":"warn",i[u](Fd.A_SEND_MSG_R,JSON.stringify({code:a,messageUId:c?c.messageUId:"",messageId:c?c.messageId:""}),o),a===Cd.SUCCESS?[2,{code:a,data:kb(c)}]:[2,{code:a,msg:$b[a]}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.sendUltraGroupTypingStatus=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t;return dc(this,(function(i){switch(i.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=i.sent().code)===Cd.SUCCESS?[2,{code:Cd.SUCCESS}]:(r.warn(Fd.O,"send ultraGroup OperateStatus ->".concat(t,":").concat($b[t])),[2,{code:t,msg:$b[t]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.setChatRoomEntries=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&oP(t)?t.entries.length>10?[2,Xb.CHATROOM_KV_STORE_OUT_LIMIT]:[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a;return dc(this,(function(c){switch(c.label){case 0:return n="id:".concat(e),i.debug(Fd.O,"set chatroom entry->".concat(n)),[4,r.setChatroomEntries(e,t)];case 1:return o=c.sent(),s=o.code,a=o.data,s!==Cd.SUCCESS?(i.warn(Fd.O,"set chatroom entry fail ->code+:".concat($b[s],",").concat(n)),[2,{code:s,msg:$b[s],data:a}]):[2,{code:s}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.setChatRoomEntry=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("targetId",e,zh.STRING,!0)&&iP(t)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o;return dc(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(Fd.O,"set chatroom entry->".concat(n)),[4,r.setChatroomEntry(e,t)];case 1:return(o=s.sent())!==Cd.SUCCESS?(i.warn(Fd.O,"set chatroom entry fail ->code+:".concat($b[o],",").concat(n)),[2,{code:o,msg:$b[o]}]):[2,{code:o}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.setConversationNotificationLevel=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return pf("notificationLevel",t,(function(e){return void 0!==Pd[e]}),!0)&&pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return rP(r,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.setConversationNotificationStatus=function(e,t){return uc(this,void 0,void 0,(function(){return dc(this,(function(n){return pf("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&pf("options",e,zh.CONVERSATION,!0)?[2,zb((function(n,r){return rP(r,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.setConversationToTop=function(e,t){return void 0===t&&(t=!0),uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("options",e,zh.CONVERSATION,!0)&&pf("isTop",t,zh.BOOLEAN)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o;return dc(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(Fd.O,"set conversation status ->".concat(n)),[4,r.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(o=s.sent())!==Cd.SUCCESS?(i.warn(Fd.O,"set conversation status fail ->".concat(o,":").concat($b[o],",").concat(n)),[2,{code:o,msg:$b[o]}]):[2,{code:o}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.setConversationToTopInTag=function(e,t,n){return uc(this,void 0,void 0,(function(){var r=this;return dc(this,(function(i){return pf("tagId",e,zh.STRING,!0)&&pf("conversation",t,zh.CONVERSATION,!0)&&pf("status.isTop",n,zh.BOOLEAN,!0)?[2,zb((function(i,o){return uc(r,void 0,void 0,(function(){var r;return dc(this,(function(s){switch(s.label){case 0:return o.info(Fd.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,i.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(r=s.sent().code)===Cd.SUCCESS?[2,{code:r}]:(o.warn(Fd.O,"setConversationStatusInTag ->
1code:".concat(r,",tagId:").concat(e)),[2,{code:r,msg:$b[r]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.setMessageReceivedStatus=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return Hb("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),xE()?pf("messageId",e,zh.NUMBER,!0)&&pf("receivedStatus",t,zh.NUMBER,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n;return dc(this,(function(o){switch(o.label){case 0:return i.info(Fd.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,r.setMessageReceivedStatus(e,t)];case 1:return(n=o.sent())===Cd.SUCCESS?[2,{code:n}]:(i.warn(Fd.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:$b[n]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:Cd.NOT_SUPPORT,msg:$b[Cd.NOT_SUPPORT]}]}))}))},e.setProxy=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return!e||pf("proxy.socksHost",e.socksHost,zh.STRING,!0)&&pf("proxy.socksPort",e.socksPort,zh.NUMBER,!0)?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t;return dc(this,(function(i){switch(i.label){case 0:return r.info(Fd.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=i.sent().code)===Cd.SUCCESS?[2,{code:t}]:(r.warn(Fd.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:$b[t]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.setUltraGroupDefaultNotificationLevel=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return e.channelId=e.channelId||"",pf("options.targetId",e.targetId,zh.STRING,!0)&&pf("options.channelId",e.channelId,zh.CHANNEL_ID,!0)&&pf("notificationLevel",t,(function(e){return void 0!==Pd[e]}),!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return n="setUltraGroupDefaultNotificationLevel",o="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),i.debug(Fd.O,"".concat(n," -> ").concat(o)),[4,r.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=a.sent().code)===Cd.SUCCESS?[2,{code:s}]:(i.warn(Fd.O,"".concat(n," fail -> ").concat(s," : ").concat($b[s]," , ").concat(o)),[2,{code:s,msg:$b[s]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.testProxy=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return!e||pf("proxy.socksHost",e.socksHost,zh.STRING,!0)&&pf("proxy.socksPort",e.socksPort,zh.NUMBER,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s;return dc(this,(function(a){switch(a.label){case 0:return i.info(Fd.O,"testProxy: ->".concat(e)),[4,r.testProxy(e,t)];case 1:return n=a.sent(),o=n.status,s=n.data,o===Cd.SUCCESS?[2,{code:o,msg:s}]:(i.warn(Fd.O,"testProxy ->code:".concat(o)),[2,{code:o,msg:$b[o]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.updateExpansionForUltraGroupMessage=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("expansion",e,zh.OBJECT,!0)&&pf("message",t,zh.OBJECT,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c,u,d,l,h;return dc(this,(function(f){switch(f.label){case 0:return n=t.conversationType,o=t.targetId,s=t.messageUId,a=t.sentTime,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(o,",channelId:").concat(u,",messageUId:").concat(s),i.debug(Fd.O,"update expansion for ultragroup message ->".concat(d)),l={targetId:o,channelId:u,conversationType:n,sendTime:a,canIncludeExpansion:c,messageUId:s,expansion:e},[4,r.expandUltraMessage(l)];case 1:return(h=f.sent().code)===Cd.SUCCESS?[2,{code:Cd.SUCCESS}]:(i.warn(Fd.O,"update expansion for ultragroup message ->".concat(h,":").concat($b[h])),[2,{code:h,msg:$b[h]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.updateMessageExpansion=function(e,t){return uc(this,void 0,void 0,(function(){var n=this;return dc(this,(function(r){return pf("expansion",e,zh.OBJECT,!0)&&pf("message",t,zh.OBJECT,!0)&&pf("message.conversationType",t.conversationType,zh.NUMBER,!0)&&pf("message.targetId",t.targetId,zh.STRING,!0)&&pf("message.channelId",t.channelId,zh.CHANNEL_ID)&&pf("message.messageUId",t.messageUId,zh.STRING,!0)&&pf("message.expansion",t.expansion,zh.OBJECT)&&pf("message.canIncludeExpansion",t.canIncludeExpansion,zh.BOOLEAN,!0)?[2,zb((function(r,i){return uc(n,void 0,void 0,(function(){var n,o,s,a,c,u,d,l;return dc(this,(function(h){switch(h.label){case 0:return n=t.conversationType,o=t.targetId,s=t.messageUId,a=t.canIncludeExpansion,c=t.expansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(o,",messageUId:").concat(s),i.debug(Fd.O,"update message expansion ->".concat(d)),[4,r.sendExpansionMessage({conversationType:n,targetId:o,messageUId:s,expansion:e,canIncludeExpansion:a,originExpansion:c,channelId:u})];case 1:return(l=h.sent().code)!==Cd.SUCCESS?(i.warn(Fd.O,"update message expansion fail ->".concat(l,":").concat($b[l],",").concat(d)),[2,{code:l,msg:$b[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))}))},e.updateTag=function(e){return uc(this,void 0,void 0,(function(){var t=this;return dc(this,(function(n){return pf("tag.tagId",e.tagId,zh.STRING,!0)&&pf("tag.tagName",e.tagName,zh.STRING,!0)&&pf("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,zb((function(n,r){return uc(t,void 0,void 0,(function(){var t;return dc(this,(function(i){switch(i.label){case 0:return r.info(Fd.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=i.sent().code)===Cd.SUCCESS?[2,{code:t}]:(r.warn(Fd.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:$b[t]}])}}))}))}))]:[2,{code:Cd.BIZ_ERROR_INVALID_PARAMETER}]}))})
vendor: 56 bytes, line 1
1)},Object.defineProperty(e,"__esModule",{value:!0})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.