12 |
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.websdk=t():e.websdk=t()}(this,(function(){return(()=>{var e={4188:(e,t,r)=>{var o,n,i;!function(s){"use strict";if(null!=t&&"number"!=typeof t.nodeType)e.exports=s();else if(null!=r.amdO)n=[],void 0===(i="function"==typeof(o=s)?o.apply(t,n):o)||(e.exports=i);else{var a=s(),u="undefined"!=typeof self?self:$.global;"function"!=typeof u.btoa&&(u.btoa=a.btoa),"function"!=typeof u.atob&&(u.atob=a.atob)}}((function(){"use strict";var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function t(e){this.message=e}return t.prototype=new Error,t.prototype.name="InvalidCharacterError",{btoa:function(r){for(var o,n,i=String(r),s=0,a=e,u="";i.charAt(0|s)||(a="=",s%1);u+=a.charAt(63&o>>8-s%1*8)){if((n=i.charCodeAt(s+=3/4))>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return u},atob:function(r){var o=String(r).replace(/[=]+$/,"");if(o.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,i,s=0,a=0,u="";i=o.charAt(a++);~i&&(n=s%4?64*n+i:i,s++%4)?u+=String.fromCharCode(255&n>>(-2*s&6)):0)i=e.indexOf(i);return u}}}))},3720:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function o(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=o;var n={},i={};function s(e,t){var r,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=i[e])?o:(r=u(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(o=n[e])?o:(r=u(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=d)return I}else{if(e<=-f)return N;if(e+1>=f)return _}return e<0?a(-e,t).neg():u(e%h|0,e/h|0,t)}function u(e,t,o){return new r(e,t,o)}r.fromInt=s,r.fromNumber=a,r.fromBits=u;var c=Math.pow;function p(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return p(e.substring(1),t,r).neg();for(var n=a(c(r,8)),i=g,s=0;s<e.length;s+=8){var u=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+u),r);if(u<8){var h=a(c(r,u));i=i.mul(h).add(a(l))}else i=(i=i.mul(n)).add(a(l))}return i.unsigned=t,i}function l(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?p(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=p,r.fromValue=l;var h=4294967296,d=h*h,f=d/2,m=s(1<<24),g=s(0);r.ZERO=g;var y=s(0,!0);r.UZERO=y;var v=s(1);r.ONE=v;var E=s(1,!0);r.UONE=E;var T=s(-1);r.NEG_ONE=T;var _=u(-1,2147483647,!1);r.MAX_VALUE=_;var I=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=I;var N=u(0,-2147483648,!1);r.MIN_VALUE=N;var O=r.prototype;O.toInt=function(){return this.unsigned?this.low>>>0:this.low},O.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},O.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(N)){var t=a(e),r=this.div(t),o=r.mul(t).sub(this);return r.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=a(c(e,6),this.unsigned),i=this,s="";;){var u=i.div(n),p=(i.sub(u.mul(n)).toInt()>>>0).toString(e);if((i=u).isZero())return p+s;for(;p.length<6;)p="0"+p;s=""+p+s}},O.getHighBits=function(){return this.high},O.getHighBitsUnsigned=function(){return this.high>>>0},O.getLowBits=function(){return this.low},O.getLowBitsUnsigned=function(){return this.low>>>0},O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(N)?64:this.neg().getNumBitsAbs();for(var 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},O.isZero=function(){return 0===this.high&&0===this.low},O.eqz=O.isZero,O.isNegative=function(){return!this.unsigned&&this.high<0},O.isPositive=function(){return this.unsigned||this.high>=0},O.isOdd=function(){return 1==(1&this.low)},O.isEven=function(){return 0==(1&this.low)},O.equals=function(e){return o(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},O.eq=O.equals,O.notEquals=function(e){return!this.eq(e)},O.neq=O.notEquals,O.ne=O.notEquals,O.lessThan=function(e){return this.comp(e)<0},O.lt=O.lessThan,O.lessThanOrEqual=function(e){return this.comp(e)<=0},O.lte=O.lessThanOrEqual,O.le=O.lessThanOrEqual,O.greaterThan=function(e){return this.comp(e)>0},O.gt=O.greaterThan,O.greaterThanOrEqual=function(e){return this.comp(e)>=0},O.gte=O.greaterThanOrEqual,O.ge=O.greaterThanOrEqual,O.compare=function(e){if(o(e)||(e=l(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&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},O.comp=O.compare,O.negate=function(){return!this.unsigned&&this.eq(N)?N:this.not().add(v)},O.neg=O.negate,O.add=function(e){o(e)||(e=l(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,c=e.low>>>16,p=0,h=0,d=0,f=0;return d+=(f+=i+(65535&e.low))>>>16,h+=(d+=n+c)>>>16,p+=(h+=r+a)>>>16,p+=t+s,u((d&=65535)<<16|(f&=65535),(p&=65535)<<16|(h&=65535),this.unsigned)},O.subtract=function(e){return o(e)||(e=l(e)),this.add(e.neg())},O.sub=O.subtract,O.multiply=function(e){if(this.isZero())return g;if(o(e)||(e=l(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(N))return e.isOdd()?N:g;if(e.eq(N))return this.isOdd()?N:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,c=e.high>>>16,p=65535&e.high,h=e.low>>>16,d=65535&e.low,f=0,y=0,v=0,E=0;return v+=(E+=s*d)>>>16,y+=(v+=i*d)>>>16,v&=65535,y+=(v+=s*h)>>>16,f+=(y+=n*d)>>>16,y&=65535,f+=(y+=i*h)>>>16,y&=65535,f+=(y+=s*p)>>>16,f+=r*d+n*h+i*p+s*c,u((v&=65535)<<16|(E&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},O.mul=O.multiply,O.divide=function(e){if(o(e)||(e=l(e)),e.isZero())throw Error("division by zero");var r,n,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return E;i=y}else{if(this.eq(N))return e.eq(v)||e.eq(T)?N:e.eq(N)?v:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?v:T:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(N))return this.unsigned?y: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();i=g}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),p=s<=48?1:c(2,s-48),h=a(r),d=h.mul(e);d.isNegative()||d.gt(n);)d=(h=a(r-=p,this.unsigned)).mul(e);h.isZero()&&(h=v),i=i.add(h),n=n.sub(d)}return i},O.div=O.divide,O.modulo=function(e){return o(e)||(e=l(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},O.mod=O.modulo,O.rem=O.modulo,O.not=function(){return u(~this.low,~this.high,this.unsigned)},O.and=function(e){return o(e)||(e=l(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},O.or=function(e){return o(e)||(e=l(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},O.xor=function(e){return o(e)||(e=l(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},O.shiftLeft=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},O.shl=O.shiftLeft,O.shiftRight=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},O.shr=O.shiftRight,O.shiftRightUnsigned=function(e){if(o(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},O.shru=O.shiftRightUnsigned,O.shr_u=O.shiftRightUnsigned,O.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},O.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},O.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},O.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},O.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,o){return o?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},7969:e=>{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],o=0;o<r.length;)r[o].fn===t?r.splice(o,1):++o;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],o=1;o<arguments.length;)r.push(arguments[o++]);for(o=0;o<t.length;)t[o].fn.apply(t[o++].ctx,r)}return this}},6728:e=>{"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),o=0,n=2,i=!0;n<arguments.length;)r[o++]=arguments[n++];return new Promise((function(n,s){r[o]=function(e){if(i)if(i=!1,e)s(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];n.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,s(e))}}))}},5889:e=>{"use strict";var t=e.exports;t.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var r=new Array(64),o=new Array(123),n=0;n<64;)o[r[n]=n<26?n+65:n<52?n+71:n<62?n-4:n-59|43]=n++;t.encode=function(e,t,o){for(var n,i=null,s=[],a=0,u=0;t<o;){var c=e[t++];switch(u){case 0:s[a++]=r[c>>2],n=(3&c)<<4,u=1;break;case 1:s[a++]=r[n|c>>4],n=(15&c)<<2,u=2;break;case 2:s[a++]=r[n|c>>6],s[a++]=r[63&c],u=0}a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),a=0)}return u&&(s[a++]=r[n],s[a++]=61,1===u&&(s[a++]=61)),i?(a&&i.push(String.fromCharCode.apply(String,s.slice(0,a))),i.join("")):String.fromCharCode.apply(String,s.slice(0,a))};var i="invalid encoding";t.decode=function(e,t,r){for(var n,s=r,a=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&a>1)break;if(void 0===(c=o[c]))throw Error(i);switch(a){case 0:n=c,a=1;break;case 1:t[r++]=n<<2|(48&c)>>4,n=c,a=2;break;case 2:t[r++]=(15&n)<<4|(60&c)>>2,n=c,a=3;break;case 3:t[r++]=(3&n)<<6|c,a=0}}if(1===a)throw Error(i);return r-s},t.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},3072:e=>{e.exports=o;var t,r=/\/|\./;function o(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),o[e]=t}o("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),o("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),o("timestamp",{Timestamp:t}),o("empty",{Empty:{fields:{}}}),o("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),o("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),o("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),o.get=function(e){return o[e]||null}},525:(e,t,r)=>{var o,n,i=e.exports;function s(e,t,r,i){var s=i.m,a=i.d,u=i.types,c=i.ksi,p=void 0!==c;if(e.resolvedType)if(e.resolvedType instanceof o){for(var l=p?a[r][c]:a[r],h=e.resolvedType.values,d=Object.keys(h),f=0;f<d.length;f++)if(!(e.repeated&&h[d[f]]===e.typeDefault||d[f]!=l&&h[d[f]]!=l)){p?s[r][c]=h[d[f]]:s[r]=h[d[f]];break}}else{if("object"!=typeof(p?a[r][c]:a[r]))throw TypeError(e.fullName+": object expected");p?s[r][c]=u[t].fromObject(a[r][c]):s[r]=u[t].fromObject(a[r])}else{var m=!1;switch(e.type){case"double":case"float":p?s[r][c]=Number(a[r][c]):s[r]=Number(a[r]);break;case"uint32":case"fixed32":p?s[r][c]=a[r][c]>>>0:s[r]=a[r]>>>0;break;case"int32":case"sint32":case"sfixed32":p?s[r][c]=0|a[r][c]:s[r]=0|a[r];break;case"uint64":m=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":n.Long?p?s[r][c]=n.Long.fromValue(a[r][c]).unsigned=m:s[r]=n.Long.fromValue(a[r]).unsigned=m:"string"==typeof(p?a[r][c]:a[r])?p?s[r][c]=parseInt(a[r][c],10):s[r]=parseInt(a[r],10):"number"==typeof(p?a[r][c]:a[r])?p?s[r][c]=a[r][c]:s[r]=a[r]:"object"==typeof(p?a[r][c]:a[r])&&(p?s[r][c]=new n.LongBits(a[r][c].low>>>0,a[r][c].high>>>0).toNumber(m):s[r]=new n.LongBits(a[r].low>>>0,a[r].high>>>0).toNumber(m));break;case"bytes":"string"==typeof(p?a[r][c]:a[r])?p?n.base64.decode(a[r][c],s[r][c]=n.newBuffer(n.base64.length(a[r][c])),0):n.base64.decode(a[r],s[r]=n.newBuffer(n.base64.length(a[r])),0):(p?a[r][c]:a[r]).length&&(p?s[r][c]=a[r][c]:s[r]=a[r]);break;case"string":p?s[r][c]=String(a[r][c]):s[r]=String(a[r]);break;case"bool":p?s[r][c]=Boolean(a[r][c]):s[r]=Boolean(a[r])}}}function a(e,t,r,i){var s=i.m,a=i.d,u=i.types,c=i.ksi,p=i.o,l=void 0!==c;if(e.resolvedType)e.resolvedType instanceof o?l?a[r][c]=p.enums===String?u[t].values[s[r][c]]:s[r][c]:a[r]=p.enums===String?u[t].values[s[r]]:s[r]:l?a[r][c]=u[t].toObject(s[r][c],p):a[r]=u[t].toObject(s[r],p);else{var h=!1;switch(e.type){case"double":case"float":l?a[r][c]=p.json&&!isFinite(s[r][c])?String(s[r][c]):s[r][c]:a[r]=p.json&&!isFinite(s[r])?String(s[r]):s[r];break;case"uint64":h=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":"number"==typeof s[r][c]?l?a[r][c]=p.longs===String?String(s[r][c]):s[r][c]:a[r]=p.longs===String?String(s[r]):s[r]:l?a[r][c]=p.longs===String?n.Long.prototype.toString.call(s[r][c]):p.longs===Number?new n.LongBits(s[r][c].low>>>0,s[r][c].high>>>0).toNumber(h):s[r][c]:a[r]=p.longs===String?n.Long.prototype.toString.call(s[r]):p.longs===Number?new n.LongBits(s[r].low>>>0,s[r].high>>>0).toNumber(h):s[r];break;case"bytes":l?a[r][c]=p.bytes===String?n.base64.encode(s[r][c],0,s[r][c].length):p.bytes===Array?Array.prototype.slice.call(s[r][c]):s[r][c]:a[r]=p.bytes===String?n.base64.encode(s[r],0,s[r].length):p.bytes===Array?Array.prototype.slice.call(s[r]):s[r];break;default:l?a[r][c]=s[r][c]:a[r]=s[r]}}}i._configure=function(){o=r(582),n=r(8278)},i.fromObject=function(e){var t=e.fieldsArray;return function(e){return function(r){if(r instanceof this.ctor)return r;if(!t.length)return new this.ctor;for(var i=new this.ctor,a=0;a<t.length;++a){var u,c=t[a].resolve(),p=c.name;if(c.map){if(r[p]){if("object"!=typeof r[p])throw TypeError(c.fullName+": object expected");i[p]={}}var l=Object.keys(r[p]);for(u=0;u<l.length;++u)s(c,a,p,n.merge(n.copy(e),{m:i,d:r,ksi:l[u]}))}else if(c.repeated){if(r[p]){if(!Array.isArray(r[p]))throw TypeError(c.fullName+": array expected");for(i[p]=[],u=0;u<r[p].length;++u)s(c,a,p,n.merge(n.copy(e),{m:i,d:r,ksi:u}))}}else(c.resolvedType instanceof o||null!=r[p])&&s(c,a,p,n.merge(n.copy(e),{m:i,d:r}))}return i}}},i.toObject=function(e){var t=e.fieldsArray.slice().sort(n.compareFieldsById);return function(r){return t.length?function(i,s){s=s||{};for(var u,c,p={},l=[],h=[],d=[],f=0;f<t.length;++f)t[f].partOf||(t[f].resolve().repeated?l:t[f].map?h:d).push(t[f]);if(l.length&&(s.arrays||s.defaults))for(f=0;f<l.length;++f)p[l[f].name]=[];if(h.length&&(s.objects||s.defaults))for(f=0;f<h.length;++f)p[h[f].name]={};if(d.length&&s.defaults)for(f=0;f<d.length;++f)if(c=(u=d[f]).name,u.resolvedType instanceof o)p[c]=s.enums=String?u.resolvedType.valuesById[u.typeDefault]:u.typeDefault;else if(u.long)if(n.Long){var m=new n.Long(u.typeDefault.low,u.typeDefault.high,u.typeDefault.unsigned);p[c]=s.longs===String?m.toString():s.longs===Number?m.toNumber():m}else p[c]=s.longs===String?u.typeDefault.toString():u.typeDefault.toNumber();else u.bytes?p[c]=s.bytes===String?String.fromCharCode.apply(String,u.typeDefault):Array.prototype.slice.call(u.typeDefault).join("*..*").split("*..*"):p[c]=u.typeDefault;var g=!1;for(f=0;f<t.length;++f){c=(u=t[f]).name;var y,v,E=e._fieldsArray.indexOf(u);if(u.map){if(g||(g=!0),i[c]&&(y=Object.keys(i[c]).length))for(p[c]={},v=0;v<y.length;++v)a(u,E,c,n.merge(n.copy(r),{m:i,d:p,ksi:y[v],o:s}))}else if(u.repeated){if(i[c]&&i[c].length)for(p[c]=[],v=0;v<i[c].length;++v)a(u,E,c,n.merge(n.copy(r),{m:i,d:p,ksi:v,o:s}))}else null!=i[c]&&i.hasOwnProperty(c)&&a(u,E,c,n.merge(n.copy(r),{m:i,d:p,o:s})),u.partOf&&s.oneofs&&(p[u.partOf.name]=c)}return p}:function(){return{}}}}},3888:(e,t,r)=>{var o,n,i;function s(e){return"missing required '"+e.name+"'"}function a(e){return function(t){var r=t.Reader,a=t.types,u=t.util;return function(t,c){t instanceof r||(t=r.create(t));for(var p,l=void 0===c?t.len:t.pos+c,h=new this.ctor;t.pos<l;){var d=t.uint32();if(e.group&&4==(7&d))break;for(var f=d>>>3,m=0,g=!1;m<e.fieldsArray.length;++m){var y=e._fieldsArray[m].resolve(),v=y.name,E=y.resolvedType instanceof o?"int32":y.type;if(f==y.id){if(g=!0,y.map)t.skip().pos++,h[v]===u.emptyObject&&(h[v]={}),p=t[y.keyType](),t.pos++,null!=n.long[y.keyType]?null==n.basic[E]?h[v]["object"==typeof p?u.longToHash(p):p]=a[m].decode(t,t.uint32()):h[v]["object"==typeof p?u.longToHash(p):p]=t[E]():null==n.basic[E]?h[v]=a[m].decode(t,t.uint32()):h[v]=t[E]();else if(y.repeated)if(h[v]&&h[v].length||(h[v]=[]),null!=n.packed[E]&&2==(7&d))for(var T=t.uint32()+t.pos;t.pos<T;)h[v].push(t[E]());else null==n.basic[E]?y.resolvedType.group?h[v].push(a[m].decode(t)):h[v].push(a[m].decode(t,t.uint32())):h[v].push(t[E]());else null==n.basic[E]?y.resolvedType.group?h[v]=a[m].decode(t):h[v]=a[m].decode(t,t.uint32()):h[v]=t[E]();break}}g||(console.log("t",d),t.skipType(7&d))}for(m=0;m<e._fieldsArray.length;++m){var _=e._fieldsArray[m];if(_.required&&!h.hasOwnProperty(_.name))throw i.ProtocolError(s(_),{instance:h})}return h}}}e.exports=a,a._configure=function(){o=r(582),n=r(4696),i=r(8278)}},9929:(e,t,r)=>{var o,n;function i(e){return function(t){var r=t.Writer,i=t.types,s=t.util;return function(t,a){a=a||r.create();for(var u=e.fieldsArray.slice().sort(s.compareFieldsById),c=0;c<u.length;c++){var p=u[c],l=e._fieldsArray.indexOf(p),h=p.resolvedType instanceof o?"uint32":p.type,d=n.basic[h],f=t[p.name];if(p.resolvedType instanceof o&&"string"==typeof f&&(f=i[l].values[f]),p.map){if(null!=f&&t.hasOwnProperty(p.name))for(var m=Object.keys(f),g=0;g<m.length;++g)a.uint32((p.id<<3|2)>>>0).fork().uint32(8|n.mapKey[p.keyType])[p.keyType](m[g]),void 0===d?i[l].encode(f[m[g]],a.uint32(18).fork()).ldelim().ldelim():a.uint32(16|d)[h](f[m[g]]).ldelim()}else if(p.repeated){if(f&&f.length)if(p.packed&&void 0!==n.packed[h]){a.uint32((p.id<<3|2)>>>0).fork();for(var y=0;y<f.length;y++)a[h](f[y]);a.ldelim()}else for(var v=0;v<f.length;v++)void 0===d?p.resolvedType.group?i[l].encode(f[v],a.uint32((p.id<<3|3)>>>0)).uint32((p.id<<3|4)>>>0):i[l].encode(f[v],a.uint32((p.id<<3|2)>>>0).fork()).ldelim():a.uint32((p.id<<3|d)>>>0)[h](f[v])}else(!p.optional||null!=f&&t.hasOwnProperty(p.name))&&(p.optional||null!=f&&t.hasOwnProperty(p.name)||console.warn("注意啦!!!很大概率会报错 类型:",t.$type?t.$type.name:"不晓得","没有设置对应的属性:",p.name,"检查是不是proto文件属性设置为了required"),void 0===d?p.resolvedType.group?i[l].encode(f,a.uint32((p.id<<3|3)>>>0)).uint32((p.id<<3|4)>>>0):i[l].encode(f,a.uint32((p.id<<3|2)>>>0).fork()).ldelim():a.uint32((p.id<<3|d)>>>0)[h](f))}return a}}}e.exports=i,i._configure=function(){o=r(582),n=r(4696)}},582:(e,t,r)=>{e.exports=i;var o=r(5998);((i.prototype=Object.create(o.prototype)).constructor=i).className="Enum";var n=r(2476);function i(e,t,r,n,i){if(o.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.reserved=void 0,t)for(var s=Object.keys(t),a=0;a<s.length;++a)"number"==typeof t[s[a]]&&(this.valuesById[this.values[s[a]]=t[s[a]]]=s[a])}i.fromJSON=function(e,t){var r=new i(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return util.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},i.prototype.add=function(e,t,r){if(!util.isString(e))throw TypeError("name must be a string");if(!util.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},i.prototype.remove=function(e){if(!util.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},i.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},i.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)}},9286:(e,t,r)=>{e.exports=c;var o,n,i,s,a=r(5998);((c.prototype=Object.create(a.prototype)).constructor=c).className="Field";var u=/^required|optional|repeated$/;function c(e,t,r,o,s,c,p){if(i.isObject(o)?(p=s,c=o,o=s=void 0):i.isObject(s)&&(p=c,c=s,s=void 0),a.call(this,e,c),!i.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!i.isString(r))throw TypeError("type must be a string");if(void 0!==o&&!u.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==s&&!i.isString(s))throw TypeError("extend must be a string");this.rule=o&&"optional"!==o?o:void 0,this.type=r,this.id=t,this.extend=s||void 0,this.required="required"===o,this.optional=!this.required,this.repeated="repeated"===o,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!i.Long&&void 0!==n.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=p}c.fromJSON=function(e,t){return new c(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(c.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),c.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),a.prototype.setOption.call(this,e,t,r)},c.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},c.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=n.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof s?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=i.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;i.utf8.write(this.typeDefault,e=i.newBuffer(i.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=i.emptyObject:this.repeated?this.defaultValue=i.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof s&&(this.parent.ctor.prototype[this.name]=this.defaultValue),a.prototype.resolve.call(this)},c.d=function(e,t,r,o){return"function"==typeof t?t=i.decorateType(t).name:t&&"object"==typeof t&&(t=i.decorateEnum(t).name),function(n,s){i.decorateType(n.constructor).add(new c(s,e,t,r,{default:o}))}},c._configure=function(){s=r(192),o=r(582),n=r(4696),i=r(8278)}},1283:e=>{function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),o=128===r[3];function n(e,o,n){t[0]=e,o[n]=r[0],o[n+1]=r[1],o[n+2]=r[2],o[n+3]=r[3]}function i(e,o,n){t[0]=e,o[n]=r[3],o[n+1]=r[2],o[n+2]=r[1],o[n+3]=r[0]}function s(e,o){return r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],t[0]}function a(e,o){return r[3]=e[o],r[2]=e[o+1],r[1]=e[o+2],r[0]=e[o+3],t[0]}e.writeFloatLE=o?n:i,e.writeFloatBE=o?i:n,e.readFloatLE=o?s:a,e.readFloatBE=o?a:s}():function(){function t(e,t,r,o){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,o);else if(isNaN(t))e(2143289344,r,o);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,o);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,o);else{var i=Math.floor(Math.log(t)/Math.LN2);e((n<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,o)}}function s(e,t,r){var o=e(t,r),n=2*(o>>31)+1,i=o>>>23&255,s=8388607&o;return 255===i?s?NaN:n*(1/0):0===i?1401298464324817e-60*n*s:n*Math.pow(2,i-150)*(s+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,o),e.readFloatLE=s.bind(null,n),e.readFloatBE=s.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),o=128===r[7];function n(e,o,n){t[0]=e,o[n]=r[0],o[n+1]=r[1],o[n+2]=r[2],o[n+3]=r[3],o[n+4]=r[4],o[n+5]=r[5],o[n+6]=r[6],o[n+7]=r[7]}function i(e,o,n){t[0]=e,o[n]=r[7],o[n+1]=r[6],o[n+2]=r[5],o[n+3]=r[4],o[n+4]=r[3],o[n+5]=r[2],o[n+6]=r[1],o[n+7]=r[0]}function s(e,o){return r[0]=e[o],r[1]=e[o+1],r[2]=e[o+2],r[3]=e[o+3],r[4]=e[o+4],r[5]=e[o+5],r[6]=e[o+6],r[7]=e[o+7],t[0]}function a(e,o){return r[7]=e[o],r[6]=e[o+1],r[5]=e[o+2],r[4]=e[o+3],r[3]=e[o+4],r[2]=e[o+5],r[1]=e[o+6],r[0]=e[o+7],t[0]}e.writeDoubleLE=o?n:i,e.writeDoubleBE=o?i:n,e.readDoubleLE=o?s:a,e.readDoubleBE=o?a:s}():function(){function t(e,t,r,o,n,i){var s=o<0?1:0;if(s&&(o=-o),0===o)e(0,n,i+t),e(1/o>0?0:2147483648,n,i+r);else if(isNaN(o))e(0,n,i+t),e(2146959360,n,i+r);else if(o>17976931348623157e292)e(0,n,i+t),e((s<<31|2146435072)>>>0,n,i+r);else{var a;if(o<22250738585072014e-324)e((a=o/5e-324)>>>0,n,i+t),e((s<<31|a/4294967296)>>>0,n,i+r);else{var u=Math.floor(Math.log(o)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(a=o*Math.pow(2,-u))>>>0,n,i+t),e((s<<31|u+1023<<20|1048576*a&1048575)>>>0,n,i+r)}}}function s(e,t,r,o,n){var i=e(o,n+t),s=e(o,n+r),a=2*(s>>31)+1,u=s>>>20&2047,c=4294967296*(1048575&s)+i;return 2047===u?c?NaN:a*(1/0):0===u?5e-324*a*c:a*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,o,4,0),e.readDoubleLE=s.bind(null,n,0,4),e.readDoubleBE=s.bind(null,i,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function o(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function i(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},4939:e=>{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function o(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=o;var n={},i={};function s(e,t){var r,o,s;return t?(s=0<=(e>>>=0)&&e<256)&&(o=i[e])?o:(r=u(e,(0|e)<0?-1:0,!0),s&&(i[e]=r),r):(s=-128<=(e|=0)&&e<128)&&(o=n[e])?o:(r=u(e,e<0?-1:0,!1),s&&(n[e]=r),r)}function a(e,t){if(isNaN(e))return t?y:g;if(t){if(e<0)return y;if(e>=d)return I}else{if(e<=-f)return N;if(e+1>=f)return _}return e<0?a(-e,t).neg():u(e%h|0,e/h|0,t)}function u(e,t,o){return new r(e,t,o)}r.fromInt=s,r.fromNumber=a,r.fromBits=u;var c=Math.pow;function p(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===o)return p(e.substring(1),t,r).neg();for(var n=a(c(r,8)),i=g,s=0;s<e.length;s+=8){var u=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+u),r);if(u<8){var h=a(c(r,u));i=i.mul(h).add(a(l))}else i=(i=i.mul(n)).add(a(l))}return i.unsigned=t,i}function l(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?p(e,t):u(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=p,r.fromValue=l;var h=4294967296,d=h*h,f=d/2,m=s(1<<24),g=s(0);r.ZERO=g;var y=s(0,!0);r.UZERO=y;var v=s(1);r.ONE=v;var E=s(1,!0);r.UONE=E;var T=s(-1);r.NEG_ONE=T;var _=u(-1,2147483647,!1);r.MAX_VALUE=_;var I=u(-1,-1,!0);r.MAX_UNSIGNED_VALUE=I;var N=u(0,-2147483648,!1);r.MIN_VALUE=N;var O=r.prototype;O.toInt=function(){return this.unsigned?this.low>>>0:this.low},O.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},O.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(N)){var t=a(e),r=this.div(t),o=r.mul(t).sub(this);return r.toString(e)+o.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=a(c(e,6),this.unsigned),i=this,s="";;){var u=i.div(n),p=(i.sub(u.mul(n)).toInt()>>>0).toString(e);if((i=u).isZero())return p+s;for(;p.length<6;)p="0"+p;s=""+p+s}},O.getHighBits=function(){return this.high},O.getHighBitsUnsigned=function(){return this.high>>>0},O.getLowBits=function(){return this.low},O.getLowBitsUnsigned=function(){return this.low>>>0},O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(N)?64:this.neg().getNumBitsAbs();for(var 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},O.isZero=function(){return 0===this.high&&0===this.low},O.eqz=O.isZero,O.isNegative=function(){return!this.unsigned&&this.high<0},O.isPositive=function(){return this.unsigned||this.high>=0},O.isOdd=function(){return 1==(1&this.low)},O.isEven=function(){return 0==(1&this.low)},O.equals=function(e){return o(e)||(e=l(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},O.eq=O.equals,O.notEquals=function(e){return!this.eq(e)},O.neq=O.notEquals,O.ne=O.notEquals,O.lessThan=function(e){return this.comp(e)<0},O.lt=O.lessThan,O.lessThanOrEqual=function(e){return this.comp(e)<=0},O.lte=O.lessThanOrEqual,O.le=O.lessThanOrEqual,O.greaterThan=function(e){return this.comp(e)>0},O.gt=O.greaterThan,O.greaterThanOrEqual=function(e){return this.comp(e)>=0},O.gte=O.greaterThanOrEqual,O.ge=O.greaterThanOrEqual,O.compare=function(e){if(o(e)||(e=l(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&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},O.comp=O.compare,O.negate=function(){return!this.unsigned&&this.eq(N)?N:this.not().add(v)},O.neg=O.negate,O.add=function(e){o(e)||(e=l(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,i=65535&this.low,s=e.high>>>16,a=65535&e.high,c=e.low>>>16,p=0,h=0,d=0,f=0;return d+=(f+=i+(65535&e.low))>>>16,h+=(d+=n+c)>>>16,p+=(h+=r+a)>>>16,p+=t+s,u((d&=65535)<<16|(f&=65535),(p&=65535)<<16|(h&=65535),this.unsigned)},O.subtract=function(e){return o(e)||(e=l(e)),this.add(e.neg())},O.sub=O.subtract,O.multiply=function(e){if(this.isZero())return g;if(o(e)||(e=l(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(N))return e.isOdd()?N:g;if(e.eq(N))return this.isOdd()?N:g;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(m)&&e.lt(m))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,s=65535&this.low,c=e.high>>>16,p=65535&e.high,h=e.low>>>16,d=65535&e.low,f=0,y=0,v=0,E=0;return v+=(E+=s*d)>>>16,y+=(v+=i*d)>>>16,v&=65535,y+=(v+=s*h)>>>16,f+=(y+=n*d)>>>16,y&=65535,f+=(y+=i*h)>>>16,y&=65535,f+=(y+=s*p)>>>16,f+=r*d+n*h+i*p+s*c,u((v&=65535)<<16|(E&=65535),(f&=65535)<<16|(y&=65535),this.unsigned)},O.mul=O.multiply,O.divide=function(e){if(o(e)||(e=l(e)),e.isZero())throw Error("division by zero");var r,n,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?y:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return y;if(e.gt(this.shru(1)))return E;i=y}else{if(this.eq(N))return e.eq(v)||e.eq(T)?N:e.eq(N)?v:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?v:T:(n=this.sub(e.mul(r)),i=r.add(n.div(e)));if(e.eq(N))return this.unsigned?y: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();i=g}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(r)/Math.LN2),p=s<=48?1:c(2,s-48),h=a(r),d=h.mul(e);d.isNegative()||d.gt(n);)d=(h=a(r-=p,this.unsigned)).mul(e);h.isZero()&&(h=v),i=i.add(h),n=n.sub(d)}return i},O.div=O.divide,O.modulo=function(e){return o(e)||(e=l(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},O.mod=O.modulo,O.rem=O.modulo,O.not=function(){return u(~this.low,~this.high,this.unsigned)},O.and=function(e){return o(e)||(e=l(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},O.or=function(e){return o(e)||(e=l(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},O.xor=function(e){return o(e)||(e=l(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},O.shiftLeft=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):u(0,this.low<<e-32,this.unsigned)},O.shl=O.shiftLeft,O.shiftRight=function(e){return o(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?u(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},O.shr=O.shiftRight,O.shiftRightUnsigned=function(e){if(o(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},O.shru=O.shiftRightUnsigned,O.shr_u=O.shiftRightUnsigned,O.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},O.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},O.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},O.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},O.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,o){return o?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},8365:(e,t,r)=>{e.exports=n;var o=r(8278);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=n.zero=new n(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var s=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,o=(e-r)/4294967296>>>0;return t&&(o=~o>>>0,r=~r>>>0,++r>4294967295&&(r=0,++o>4294967295&&(o=0))),new n(r,o)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if("string"==typeof e||e instanceof String){if(!o.Long)return n.fromNumber(parseInt(e,10));e=o.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):i},n.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},n.prototype.toLong=function(e){return o.Long?new o.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===s?i:new n((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},n.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},n.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},n.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},n.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},1435:(e,t,r)=>{e.exports=s;var o,n,i=r(9286);function s(e,t,r,o,s,a){if(i.call(this,e,t,o,void 0,void 0,s,a),!n.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}((s.prototype=Object.create(i.prototype)).constructor=s).className="MapField",s.fromJSON=function(e,t){return new s(e,t.id,t.keyType,t.type,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},s.prototype.resolve=function(){if(this.resolved)return this;if(void 0===o.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return i.prototype.resolve.call(this)},s.d=function(e,t,r){return"function"==typeof r?r=n.decorateType(r).name:r&&"object"==typeof r&&(r=n.decorateEnum(r).name),function(o,i){n.decorateType(o.constructor).add(new s(i,e,t,r))}},s._configure=function(){o=r(4696),n=r(8278)}},339:(e,t,r)=>{"use strict";var o;function n(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}e.exports=n,n.create=function(e){return this.$type.create(e)},n.encode=function(e,t){return arguments.length?1==arguments.length?this.$type.encode(arguments[0]):this.$type.encode(arguments[0],arguments[1]):this.$type.encode(this)},n.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},n.decode=function(e){return this.$type.decode(e)},n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},n.verify=function(e){return this.$type.verify(e)},n.fromObject=function(e){return this.$type.fromObject(e)},n.toObject=function(e,t){return e=e||this,this.$type.toObject(e,t)},n.prototype.toJSON=function(){return this.$type.toObject(this,o.toJSONOptions)},n.set=function(e,t){n[e]=t},n.get=function(e){return n[e]},n._configure=function(){o=r(8278)}},484:(e,t,r)=>{"use strict";e.exports=i;var o,n=r(5998);function i(e,t,r,i,s,a,u,c){if(o.isObject(s)?(u=s,s=a=void 0):o.isObject(a)&&(u=a,a=void 0),void 0!==t&&!o.isString(t))throw TypeError("type must be a string");if(!o.isString(r))throw TypeError("requestType must be a string");if(!o.isString(i))throw TypeError("responseType must be a string");n.call(this,e,u),this.type=t||"rpc",this.requestType=r,this.requestStream=!!s||void 0,this.responseType=i,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=c}((i.prototype=Object.create(n.prototype)).constructor=i).className="Method",i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment)},i.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0])},i.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))},i._configure=function(){o=r(8278)}},2476:(e,t,r)=>{e.exports=p;var o,n,i,s,a,u=r(5998);function c(e,t){if(e&&e.length){for(var r={},o=0;o<e.length;++o)r[e[o].name]=e[o].toJSON(t);return r}}function p(e,t){u.call(this,e,t),this.nested=void 0,this._nestedArray=null}function l(e){return e._nestedArray=null,e}((p.prototype=Object.create(u.prototype)).constructor=p).className="Namespace",p.fromJSON=function(e,t){return new p(e,t.options).addJSON(t.nested)},p.arrayToJSON=c,p.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>=t)return!0;return!1},p.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(p.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=i.toArray(this.nested))}}),p.prototype.toJSON=function(e){return i.toObject(["options",this.options,"nested",c(this.nestedArray,e)])},p.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),i=0;i<r.length;++i)t=e[r[i]],this.add((void 0!==t.fields?s.fromJSON:void 0!==t.values?o.fromJSON:void 0!==t.methods?a.fromJSON:void 0!==t.id?n.fromJSON:p.fromJSON)(r[i],t));return this},p.prototype.get=function(e){return this.nested&&this.nested[e]||null},p.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof o)return this.nested[e].values;throw Error("no such enum: "+e)},p.prototype.add=function(e){if(!(e instanceof n&&void 0!==e.extend||e instanceof s||e instanceof o||e instanceof a||e instanceof p))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof p&&e instanceof p)||t instanceof s||t instanceof a)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,i=0;i<r.length;++i)e.add(r[i]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),l(this)},p.prototype.remove=function(e){if(!(e instanceof u))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),l(this)},p.prototype.define=function(e,t){if(i.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var o=e.shift();if(r.nested&&r.nested[o]){if(!((r=r.nested[o])instanceof p))throw Error("path conflicts with non-namespace objects")}else r.add(r=new p(o))}return t&&r.addJSON(t),r},p.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof p?e[t++].resolveAll():e[t++].resolve();return this.resolve()},p.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),i.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var o=this.get(e[0]);if(o){if(1===e.length){if(!t||t.indexOf(o.constructor)>-1)return o}else if(o instanceof p&&(o=o.lookup(e.slice(1),t,!0)))return o}else for(var n=0;n<this.nestedArray.length;++n)if(this._nestedArray[n]instanceof p&&(o=this._nestedArray[n].lookup(e,t,!0)))return o;return null===this.parent||r?null:this.parent.lookup(e,t)},p.prototype.lookupType=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such type: "+e);return t},p.prototype.lookupEnum=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},p.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[s,o]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},p.prototype.lookupService=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},p._configure=function(){o=r(582),n=r(9286),i=r(8278),s=r(192),a=r(9447)}},5998:(e,t,r)=>{"use strict";var o,n;function i(e,t){if(!o.isString(e))throw TypeError("name must be a string");if(t&&!o.isObject(t))throw TypeError("options must be an object");this.options=t,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}e.exports=i,i.className="ReflectionObject",Object.defineProperties(i.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),i.prototype.toJSON=function(){throw Error()},i.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},i.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},i.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},i.prototype.getOption=function(e){if(this.options)return this.options[e]},i.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},i.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),o=0;o<r.length;++o)this.setOption(r[o],e[r[o]],t);return this},i.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},i._configure=function(e){n=r(4685),o=r(8278)}},9735:(e,t,r)=>{e.exports=s;var o,n,i=r(5998);function s(e,t,r,o){if(Array.isArray(t)||(r=t,t=void 0),i.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=o}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}((s.prototype=Object.create(i.prototype)).constructor=s).className="OneOf",s.fromJSON=function(e,t){return new s(e,t.oneof,t.options,t.comment)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},s.prototype.add=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},s.prototype.remove=function(e){if(!(e instanceof o))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},s.prototype.onAdd=function(e){i.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},s.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);i.prototype.onRemove.call(this,e)},s.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){n.decorateType(t.constructor).add(new s(r,e)),Object.defineProperty(t,r,{get:n.oneOfGetter(e),set:n.oneOfSetter(e)})}},s._configure=function(){o=r(9286),n=r(8278)}},7845:(e,t,r)=>{"use strict";var o,n,i,s,a,u,c,p,l,h,d;e.exports=O,O.filename=null,O.defaults={keepCase:!1};var f=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,y=/^-?0[x][0-9a-fA-F]+$/,v=/^0[0-7]+$/,E=/^-?0[0-7]+$/,T=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,_=/^[a-zA-Z_][a-zA-Z_0-9]*$/,I=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,N=/^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/;function O(e,t,r){t instanceof n||(r=t,t=new n),r||(r=O.defaults);var R,C,S,b,A,k=o(e,r.alternateCommentMode||!1),w=k.next,M=k.push,x=k.peek,U=k.skip,j=k.cmnt,P=!0,B=!1,L=t,D=r.keepCase?function(e){return e}:d.camelCase;function G(e,t,r){var o=O.filename;return r||(O.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(o?o+", ":"")+"line "+k.line+")")}function F(){var e,t=[];do{if('"'!==(e=w())&&"'"!==e)throw G(e);t.push(w()),U(e),e=x()}while('"'===e||"'"===e);return t.join("")}function W(e){var t=w();switch(t){case"'":case'"':return M(t),F();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;switch("-"===e.charAt(0)&&(r=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return r*parseInt(e,10);if(g.test(e))return r*parseInt(e,16);if(v.test(e))return r*parseInt(e,8);if(T.test(e))return r*parseFloat(e);throw G(e,"number",!0)}(t)}catch(r){if(e&&I.test(t))return t;throw G(t,"value")}}function H(e,t){var r,o;do{!t||'"'!==(r=x())&&"'"!==r?e.push([o=q(w()),U("to",!0)?q(w()):o]):e.push(F())}while(U(",",!0));U(";")}function q(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw G(e,"id");if(m.test(e))return parseInt(e,10);if(y.test(e))return parseInt(e,16);if(E.test(e))return parseInt(e,8);throw G(e,"id")}function z(){if(void 0!==R)throw G("package");if(R=w(),!I.test(R))throw G(R,"name");L=L.define(R),U(";")}function J(){var e,t=x();switch(t){case"weak":e=S||(S=[]),w();break;case"public":w();default:e=C||(C=[])}t=F(),U(";"),e.push(t)}function V(){if(U("="),b=F(),!(B="proto3"===b)&&"proto2"!==b)throw G(b,"syntax");U(";")}function K(e,t){switch(t){case"option":return $(e,t),U(";"),!0;case"message":return function(e,t){if(!_.test(t=w()))throw G(t,"type name");var r=new i(t);X(r,(function(e){if(!K(r,e))switch(e){case"map":!function(e){U("<");var t=w();if(void 0===h.mapKey[t])throw G(t,"type");U(",");var r=w();if(!I.test(r))throw G(r,"type");U(">");var o=w();if(!_.test(o))throw G(o,"name");U("=");var n=new a(D(o),q(w()),t,r);X(n,(function(e){if("option"!==e)throw G(e);$(n,e),U(";")}),(function(){ee(n)})),e.add(n)}(r);break;case"required":case"optional":case"repeated":Y(r,e);break;case"oneof":!function(e,t){if(!_.test(t=w()))throw G(t,"name");var r=new u(D(t));X(r,(function(e){"option"===e?($(r,e),U(";")):(M(e),Y(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":H(r.extensions||(r.extensions=[]));break;case"reserved":H(r.reserved||(r.reserved=[]),!0);break;default:if(!B||!I.test(e))throw G(e);M(e),Y(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!_.test(t=w()))throw G(t,"name");var r=new c(t);X(r,(function(e){switch(e){case"option":$(r,e),U(";");break;case"reserved":H(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!_.test(t))throw G(t,"name");U("=");var r=q(w(),!0),o={};X(o,(function(e){if("option"!==e)throw G(e);$(o,e),U(";")}),(function(){ee(o)})),e.add(t,r,o.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!_.test(t=w()))throw G(t,"service name");var r=new p(t);X(r,(function(e){if(!K(r,e)){if("rpc"!==e)throw G(e);!function(e,t){var r=t;if(!_.test(t=w()))throw G(t,"name");var o,n,i,s,a=t;if(U("("),U("stream",!0)&&(n=!0),!I.test(t=w()))throw G(t);if(o=t,U(")"),U("returns"),U("("),U("stream",!0)&&(s=!0),!I.test(t=w()))throw G(t);i=t,U(")");var u=new l(a,r,o,i,n,s);X(u,(function(e){if("option"!==e)throw G(e);$(u,e),U(";")})),e.add(u)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!I.test(t=w()))throw G(t,"reference");var r=t;X(null,(function(t){switch(t){case"required":case"repeated":case"optional":Y(e,t,r);break;default:if(!B||!I.test(t))throw G(t);M(t),Y(e,"optional",r)}}))}(e,t),!0}return!1}function X(e,t,r){var o=k.line;if(e&&(e.comment=j(),e.filename=O.filename),U("{",!0)){for(var n;"}"!==(n=w());)t(n);U(";",!0)}else r&&r(),U(";"),e&&"string"!=typeof e.comment&&(e.comment=j(o))}function Y(e,t,r){var o=w();if("group"!==o){if(!I.test(o))throw G(o,"type");var n=w();if(!_.test(n))throw G(n,"name");n=D(n),U("=");var a=new s(n,q(w()),o,t,r);X(a,(function(e){if("option"!==e)throw G(e);$(a,e),U(";")}),(function(){ee(a)})),e.add(a),B||!a.repeated||void 0===h.packed[o]&&void 0!==h.basic[o]||a.setOption("packed",!1,!0)}else!function(e,t){var r=w();if(!_.test(r))throw G(r,"name");var o=d.lcFirst(r);r===o&&(r=d.ucFirst(r)),U("=");var n=q(w()),a=new i(r);a.group=!0;var u=new s(o,n,r,t);u.filename=O.filename,X(a,(function(e){switch(e){case"option":$(a,e),U(";");break;case"required":case"optional":case"repeated":Y(a,e);break;default:throw G(e)}})),e.add(a).add(u)}(e,t)}function $(e,t){var r=U("(",!0);if(!I.test(t=w()))throw G(t,"name");var o=t;r&&(U(")"),o="("+o+")",t=x(),N.test(t)&&(o+=t,w())),U("="),Z(e,o)}function Z(e,t){if(U("{",!0))do{if(!_.test(A=w()))throw G(A,"name");"{"===x()?Z(e,t+"."+A):(U(":"),"{"===x()?Z(e,t+"."+A):Q(e,t+"."+A,W(!0)))}while(!U("}",!0));else Q(e,t,W(!0))}function Q(e,t,r){e.setOption&&e.setOption(t,r)}function ee(e){if(U("[",!0)){do{$(e,"option")}while(U(",",!0));U("]")}return e}for(;null!==(A=w());)switch(A){case"package":if(!P)throw G(A);z();break;case"import":if(!P)throw G(A);J();break;case"syntax":if(!P)throw G(A);V();break;case"option":if(!P)throw G(A);$(L,A),U(";");break;default:if(K(L,A)){P=!1;continue}throw G(A)}return O.filename=null,{package:R,imports:C,weakImports:S,syntax:b,root:t}}O._configure=function(){o=r(8869),n=r(4685),i=r(192),s=r(9286),a=r(1435),u=r(9735),c=r(582),p=r(9447),l=r(484),h=r(4696),d=r(8278)}},1444:e=>{var t=e.exports,r=t.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=t.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),o=r(e),n="";o&&(n=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):o?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return n+t.join("/")};t.resolve=function(e,t,n){return n||(t=o(t)),r(t)?t:(n||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},8997:e=>{e.exports=function(e,t,r){var o=r||8192,n=o>>>1,i=null,s=o;return function(r){if(r<1||r>n)return e(r);s+r>o&&(i=e(o),s=0);var a=t.call(i,s,s+=r);return 7&s&&(s=1+(7|s)),a}}},8494:(e,t,r)=>{e.exports=a;var o,n,i=r(8278);function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function a(e){this.buf=e,this.pos=0,this.len=e.length}var u,c="undefined"!=typeof Uint8Array?function(e){return e instanceof Uint8Array||Array.isArray(e)?new a(e):("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer&&console.warn(""),new a(new Uint8Array(e)))}:function(e){if(Array.isArray(e))return new a(e)};function p(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function l(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw s(this,8);return new o(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}a.create=i.Buffer?function(e){return(a.create=function(e){return i.Buffer.isBuffer(e)?new(void 0)(e):c(e)})(e)}:c,a.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,a.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),a.prototype.int32=function(){return 0|this.uint32()},a.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},a.prototype.bool=function(){return 0!==this.uint32()},a.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return l(this.buf,this.pos+=4)},a.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|l(this.buf,this.pos+=4)},a.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},a.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},a.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},a.prototype.string=function(){var e=this.bytes();return n.read(e,0,e.length)},a.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},a.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},a._configure=function(){o=r(8365),n=r(1498);var e=i.Long?"toLong":"toNumber";i.merge(a.prototype,{int64:function(){return p.call(this)[e](!1)},uint64:function(){return p.call(this)[e](!0)},sint64:function(){return p.call(this).zzDecode()[e](!1)},fixed64:function(){return h.call(this)[e](!0)},sfixed64:function(){return h.call(this)[e](!1)}})}},4685:(e,t,r)=>{e.exports=l;var o=r(2476);((l.prototype=Object.create(o.prototype)).constructor=l).className="Root";var n,i,s,a=r(9286),u=r(582),c=r(9735),p=r(8278);function l(e){o.call(this,"",e),this.deferred=[],this.files=[],this.names=[]}function h(){}l.fromJSON=function(e,t){return e="string"==typeof e?JSON.parse(e):e,t||(t=new l),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},l.prototype.resolvePath=p.path.resolve,l.prototype.parseFromPbString=function e(t,r,o){"function"==typeof r&&(o=r,r=void 0);var n=this;if(!o)return p.asPromise(e,n,t,r);var a=null;if("string"==typeof t)a=JSON.parse(t);else{if("object"!=typeof t)return void console.log("pb格式转化失败");a=t}function u(e,t){if(o){var r=o;o=null,r(e,t)}}function c(e,t){try{if(p.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),p.isString(t)){i.filename=e;var o,s=i(t,n,r),a=0;if(s.imports)for(;a<s.imports.length;++a)l(o=s.imports[a]);if(s.weakImports){for(a=0;a<s.weakImports.length;++a)o=s.weakImports[a];l(o)}}else n.setOptions(t.options).addJSON(t.nested)}catch(e){u(e)}u(null,n)}function l(e){n.names.indexOf(e)>-1||(n.names.push(e),e in s&&c(e,s[e]))}c(a.name,a.pbJsonStr)},l.prototype.load=function e(t,r,o){"function"==typeof r&&(o=r,r=void 0);var n=this;if(!o)return p.asPromise(e,n,t,r);var a=o===h;function u(e,t){if(o){var r=o;if(o=null,a)throw e;r(e,t)}}function c(e,t){try{if(p.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),p.isString(t)){i.filename=e;var o,s=i(t,n,r),c=0;if(s.imports)for(;c<s.imports.length;++c)(o=n.resolvePath(e,s.imports[c]))&&l(o);if(s.weakImports)for(c=0;c<s.weakImports.length;++c)(o=n.resolvePath(e,s.weakImports[c]))&&l(o,!0)}else n.setOptions(t.options).addJSON(t.nested)}catch(e){u(e)}a||d||u(null,n)}function l(e,t){var r=e.lastIndexOf("google/protobuf/");if(r>-1){var i=e.substring(r);i in s&&(e=i)}if(!(n.files.indexOf(e)>-1))if(n.files.push(e),e in s)a?c(e,s[e]):(++d,setTimeout((function(){--d,c(e,s[e])})));else if(a){var l;try{l=p.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||u(e))}c(e,l)}else++d,p.fetch(e,(function(r,i){--d,o&&(r?t?d||u(null,n):u(r):c(e,i))}))}var d=0;p.isString(t)&&(t=[t]);for(var f,m=0;m<t.length;++m)(f=n.resolvePath("",t[m]))&&l(f);if(a)return n;d||u(null,n)},l.prototype.loadSync=function(e,t){if(!p.isNode)throw Error("not supported");return this.load(e,t,h)},l.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return o.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var o=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return o.declaringField=t,t.extensionField=o,r.add(o),!0}return!1}l.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof u)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof c)){if(e instanceof n)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);d.test(e.name)&&(e.parent[e.name]=e)}},l.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof u)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof o){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);d.test(e.name)&&delete e.parent[e.name]}},l._configure=function(){n=r(192),i=r(7845),s=r(3072),a=r(9286),u=r(582),c=r(9735),p=r(8278)}},889:e=>{e.exports={}},7325:(e,t,r)=>{"use strict";e.exports=n;var o=r(8278);function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");o.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(o.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,i,s){if(!i)throw TypeError("request must be specified");var a=this;if(!s)return o.asPromise(e,a,t,r,n,i);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return a.emit("error",e,t),s(e);if(null!==r){if(!(r instanceof n))try{r=n[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),s(e)}return a.emit("data",r,t),s(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){s(e)}),0)}else setTimeout((function(){s(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},9447:(e,t,r)=>{"use strict";e.exports=a;var o,n,i,s=r(2476);function a(e,t){s.call(this,e,t),this.methods={},this._methodsArray=null}function u(e){return e._methodsArray=null,e}((a.prototype=Object.create(s.prototype)).constructor=a).className="Service",a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),i=0;i<n.length;++i)r.add(o.fromJSON(n[i],t.methods[n[i]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=s.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return n.toObject(["options",t&&t.options||void 0,"methods",s.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=n.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||s.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return s.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof o?(this.methods[e.name]=e,e.parent=this,u(this)):s.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof o){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,u(this)}return s.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var o,s=new i.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var u=n.lcFirst((o=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");s[u]=n.codegen(["r","c"],n.isReserved(u)?u+"_":u)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return s},a._configure=function(){o=r(484),n=r(8278),i=r(7325)}},8869:e=>{e.exports=l;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,o=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,n=/^ *[*/]+ */,i=/^\s*\*?\/*/,s=/\n/g,a=/\s/,u=/\\(.?)/g,c={0:"\0",r:"\r",n:"\n",t:"\t"};function p(e){return e.replace(u,(function(e,t){switch(t){case"\\":case"":return t;default:return c[t]||""}}))}function l(e,u){e=e.toString();var c=0,l=e.length,h=1,d=null,f=null,m=0,g=!1,y=[],v=null;function E(e){return Error("illegal "+e+" (line "+h+")")}function T(t){return e.charAt(t)}function _(t,r){d=e.charAt(t++),m=h,g=!1;var o,a=t-(u?2:3);do{if(--a<0||"\n"===(o=e.charAt(a))){g=!0;break}}while(" "===o||"\t"===o);for(var c=e.substring(t,r).split(s),p=0;p<c.length;++p)c[p]=c[p].replace(u?i:n,"").trim();f=c.join("\n").trim()}function I(t){var r=N(t),o=e.substring(t,r);return/^\s*\/{1,2}/.test(o)}function N(e){for(var t=e;t<l&&"\n"!==T(t);)t++;return t}function O(){if(y.length>0)return y.shift();if(v)return function(){var t="'"===v?o:r;t.lastIndex=c-1;var n=t.exec(e);if(!n)throw E("string");return c=t.lastIndex,R(v),v=null,p(n[1])}();var n,i,s,d,f;do{if(c===l)return null;for(n=!1;a.test(s=T(c));)if("\n"===s&&++h,++c===l)return null;if("/"===T(c)){if(++c===l)throw E("comment");if("/"===T(c))if(u){if(d=c,f=!1,I(c)){f=!0;do{if((c=N(c))===l)break;c++}while(I(c))}else c=Math.min(l,N(c)+1);f&&_(d,c),h++,n=!0}else{for(f="/"===T(d=c+1);"\n"!==T(++c);)if(c===l)return null;++c,f&&_(d,c-1),++h,n=!0}else{if("*"!==(s=T(c)))return"/";d=c+1,f=u||"*"===T(d);do{if("\n"===s&&++h,++c===l)throw E("comment");i=s,s=T(c)}while("*"!==i||"/"!==s);++c,f&&_(d,c-2),n=!0}}}while(n);var m=c;if(t.lastIndex=0,!t.test(T(m++)))for(;m<l&&!t.test(T(m));)++m;var g=e.substring(c,c=m);return'"'!==g&&"'"!==g||(v=g),g}function R(e){y.push(e)}function C(){if(!y.length){var e=O();if(null===e)return null;R(e)}return y[0]}return Object.defineProperty({next:O,peek:C,push:R,skip:function(e,t){var r=C();if(r===e)return O(),!0;if(!t)throw E("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t=null;return void 0===e?m===h-1&&(u||"*"===d||g)&&(t=f):(m<e&&C(),m!==e||g||!u&&"/"!==d||(t=f)),t}},"line",{get:function(){return h}})}l.unescape=p},192:(e,t,r)=>{e.exports=v;var o,n,i,s,a,u,c,p,l,h,d,f,m,g,y=r(2476);function v(e,t){y.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function E(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}((v.prototype=Object.create(y.prototype)).constructor=v).className="Type",Object.defineProperties(v.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],o=r.id;if(this._fieldsById[o])throw Error("duplicate id "+o+" in "+this);this._fieldsById[o]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=c.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=c.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=v.generateConstructor(this))},set:function(e){var t=e.prototype;t instanceof i||((e.prototype=new i).constructor=e,c.merge(e.prototype,t)),e.$type=e.prototype.$type=this,c.merge(e,i,!0),c.merge(e.prototype,i,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var o={};for(r=0;r<this.oneofsArray.length;++r){var n=this._oneofsArray[r].resolve().name,s=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=0;return{setter:function(r){if(!(e.indexOf(r)<0)){t[r]=1;for(var o=0;o<e.length;++o)e[o]!==r&&delete this[e[o]]}},getter:function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}}}(this._oneofsArray[r].oneof);o[n]={get:s.getter,set:s.setter}}r&&Object.defineProperties(e.prototype,o)}}}),v.generateConstructor=function(e){return function(t){for(var r,o=0;o<e.fieldsArray.length;o++)(r=e._fieldsArray[o]).map?this[r.name]={}:r.repeated&&(this[r.name]=[]);if(t)for(var n=Object.keys(t),i=0;i<n.length;++i)null!=t[n[i]]&&(this[n[i]]=t[n[i]])}},v.fromJSON=function(e,t){var r=new v(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var i=Object.keys(t.fields),a=0;a<i.length;++a)r.add((void 0!==t.fields[i[a]].keyType?g.fromJSON:n.fromJSON)(i[a],t.fields[i[a]]));if(t.oneofs)for(i=Object.keys(t.oneofs),a=0;a<i.length;++a)r.add(s.fromJSON(i[a],t.oneofs[i[a]]));if(t.nested)for(i=Object.keys(t.nested),a=0;a<i.length;++a){var u=t.nested[i[a]];r.add((void 0!==u.id?n.fromJSON:void 0!==u.fields?v.fromJSON:void 0!==u.values?o.fromJSON:void 0!==u.methods?d.fromJSON:y.fromJSON)(i[a],u))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},v.prototype.toJSON=function(e){var t=y.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return{options:t&&t.options||void 0,oneofs:y.arrayToJSON(this.oneofsArray,e),fields:y.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},extensions:this.extensions&&this.extensions.length?this.extensions:void 0,reserved:this.reserved&&this.reserved.length?this.reserved:void 0,group:this.group||void 0,nested:t&&t.nested||void 0,comment:r?this.comment:void 0}},v.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return y.prototype.resolveAll.call(this)},v.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},v.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof n&&void 0===e.extend){if(this._fieldsById&&this._fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),E(this)}return e instanceof s?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),E(this)):y.prototype.add.call(this,e)},v.prototype.remove=function(e){if(e instanceof n&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),E(this)}if(e instanceof s){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),E(this)}return y.prototype.remove.call(this,e)},v.prototype.isReservedId=function(e){return y.isReservedId(this.reserved,e)},v.prototype.isReservedName=function(e){return y.isReservedName(this.reserved,e)},v.prototype.create=function(e){return new this.ctor(e)},v.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=l(this)({Writer:a,types:t,util:c}),this.decode=h(this)({Reader:u,types:t,util:c}),this.verify=p(this)({types:t,util:c}),this.fromObject=m.fromObject(this)({types:t,util:c}),this.toObject=m.toObject(this)({types:t,util:c});var o=f[e];if(o){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=o.fromObject.bind(n),n.toObject=this.toObject,this.toObject=o.toObject.bind(n)}return this},v.prototype.encode=function(e,t){return this.setup().encode(e,t)},v.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},v.prototype.decode=function(e,t){return this.setup().decode(e,t)},v.prototype.decodeDelimited=function(e){return e instanceof u||(e=u.create(e)),this.decode(e,e.uint32())},v.prototype.verify=function(e){return this.setup().verify(e)},v.prototype.fromObject=function(e){return this.setup().fromObject(e)},v.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},v.d=function(e){return function(t){c.decorateType(t,e)}},v._configure=function(){o=r(582),n=r(9286),i=r(339),s=r(9735),a=r(5244),u=r(8494),c=r(8278),p=r(5484),l=r(9929),h=r(3888),d=r(9447),f=r(7834),m=r(525),g=r(1435)}},4696:(e,t,r)=>{"use strict";var o=e.exports,n=r(8278),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function s(e,t){var r=0,o={};for(t|=0;r<e.length;)o[i[r+t]]=e[r++];return o}o.basic=s([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),o.defaults=s([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",n.emptyArray,null]),o.long=s([0,0,0,1,1],7),o.mapKey=s([0,0,0,5,5,0,0,0,1,1,0,2],2),o.packed=s([1,5,0,0,0,5,5,0,0,0,1,1,0]),o._configure=function(){n=r(8278)}},1498:e=>{"use strict";var t=e.exports;t.length=function(e){for(var t=0,r=0,o=0;o<e.length;++o)(r=e.charCodeAt(o))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(o+1))?(++o,t+=4):t+=3;return t},t.read=function(e,t,r){if(r-t<1)return"";for(var o,n=null,i=[],s=0;t<r;)(o=e[t++])<128?i[s++]=o:o>191&&o<224?i[s++]=(31&o)<<6|63&e[t++]:o>239&&o<365?(o=((7&o)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[s++]=55296+(o>>10),i[s++]=56320+(1023&o)):i[s++]=(15&o)<<12|(63&e[t++])<<6|63&e[t++],s>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,i)),s=0);return n?(s&&n.push(String.fromCharCode.apply(String,i.slice(0,s))),n.join("")):String.fromCharCode.apply(String,i.slice(0,s))},t.write=function(e,t,r){for(var o,n,i=r,s=0;s<e.length;++s)(o=e.charCodeAt(s))<128?t[r++]=o:o<2048?(t[r++]=o>>6|192,t[r++]=63&o|128):55296==(64512&o)&&56320==(64512&(n=e.charCodeAt(s+1)))?(o=65536+((1023&o)<<10)+(1023&n),++s,t[r++]=o>>18|240,t[r++]=o>>12&63|128,t[r++]=o>>6&63|128,t[r++]=63&o|128):(t[r++]=o>>12|224,t[r++]=o>>6&63|128,t[r++]=63&o|128);return r-i}},8278:(e,t,r)=>{var o=e.exports,n=r(889);o.LongBits=r(8365),o.Long=r(4939),o.pool=r(8997),o.float=r(1283),o.asPromise=r(6728),o.EventEmitter=r(7969),o.path=r(1444),o.base64=r(5889),o.utf8=r(1498),o.compareFieldsById=function(e,t){return e.id-t.id},o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),o=0;o<t.length;)r[o]=e[t[o++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var o=e[r++],n=e[r++];void 0!==n&&(t[o]=n)}return t},o.isString=function(e){return"string"==typeof e||e instanceof String},o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.isObject=function(e){return e&&"object"==typeof e},o.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,o.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},o.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},o.merge=function(e,t,r){for(var o=Object.keys(t),n=0;n<o.length;++n)void 0!==e[o[n]]&&r||(e[o[n]]=t[o[n]]);return e},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;Type||(Type=r(192));var n=new Type(t||e.name);return o.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n},o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.longToHash=function(e){return e?o.LongBits.from(e).toHash():o.LongBits.zeroHash},o.copy=function(e){if("object"!=typeof e)return e;var t={};for(var r in e)t[r]=e[r];return t},o.deepCopy=function e(t){if("object"!=typeof t)return t;var r={};for(var o in t)r[o]=e(t[o]);return r},o.ProtocolError=function(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&merge(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t},o.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},o.Buffer=null,o.newBuffer=function(e){return"number"==typeof e?new o.Array(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},o.stringToBytes=function(e){var t,r,o=[];t=e.length;for(var n=0;n<t;n++)(r=e.charCodeAt(n))>=65536&&r<=1114111?(o.push(r>>18&7|240),o.push(r>>12&63|128),o.push(r>>6&63|128),o.push(63&r|128)):r>=2048&&r<=65535?(o.push(r>>12&15|224),o.push(r>>6&63|128),o.push(63&r|128)):r>=128&&r<=2047?(o.push(r>>6&31|192),o.push(63&r|128)):o.push(255&r);return o},o.byteToString=function(e){if("string"==typeof e)return e;for(var t="",r=e,o=0;o<r.length;o++){var n=r[o].toString(2),i=n.match(/^1+?(?=0)/);if(i&&8==n.length){for(var s=i[0].length,a=r[o].toString(2).slice(7-s),u=1;u<s;u++)a+=r[u+o].toString(2).slice(2);t+=String.fromCharCode(parseInt(a,2)),o+=s-1}else t+=String.fromCharCode(r[o])}return t},o.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},Object.defineProperty(o,"decorateRoot",{get:function(){return n.decorated||(n.decorated=new(r(4685)))}})},5484:(e,t,r)=>{var o,n;function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function s(e,t,r,s){var a=s.types;if(e.resolvedType)if(e.resolvedType instanceof o){if(Object.keys(e.resolvedType.values).indexOf(r)<0)return i(e,"enum value")}else{var u=a[t].verify(r);if(u)return e.name+"."+u}else switch(e.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!n.isInteger(r))return i(e,"integer");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!(n.isInteger(r)||r&&n.isInteger(r.low)&&n.isInteger(r.high)))return i(e,"integer|Long");break;case"float":case"double":if("number"!=typeof r)return i(e,"number");break;case"bool":if("boolean"!=typeof r)return i(e,"boolean");break;case"string":if(!n.isString(r))return i(e,"string");break;case"bytes":if(!(r&&"number"==typeof r.length||n.isString(r)))return i(e,"buffer")}}function a(e,t){switch(e.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":if(!n.key32Re.test(t))return i(e,"integer key");break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":if(!n.key64Re.test(t))return i(e,"integer|Long key");break;case"bool":if(!n.key2Re.test(t))return i(e,"boolean key")}}function u(e){return function(t){return function(r){var o;if("object"!=typeof r||null===r)return"object expected";var u,c={};e.oneofsArray.length&&(u={});for(var p=0;p<e.fieldsArray.length;++p){var l,h=e._fieldsArray[p].resolve(),d=r[h.name];if(!h.optional||null!=d&&r.hasOwnProperty(h.name))if(h.map){if(!n.isObject(d))return i(h,"object");var f=Object.keys(d);for(l=0;l<f.length;++l){if(o=a(h,f[l]))return o;if(o=s(h,p,d[f[l]],t))return o}}else if(h.repeated){if(!Array.isArray(d))return i(h,"array");for(l=0;l<d.length;++l)if(o=s(h,p,d[l],t))return o}else{if(h.partOf){var m=h.partOf.name;if(1===c[h.partOf.name]&&1===u[m])return h.partOf.name+": multiple values";u[m]=1}if(o=s(h,p,d,t))return o}}}}}e.exports=u,u._configure=function(){o=r(582),n=r(8278)}},7834:(e,t,r)=>{var o,n=t;n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=this.lookup(e["@type"]);if(t){var r="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return this.create({type_url:"/"+r,value:t.encode(t.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){if(t&&t.json&&e.type_url&&e.value){var r=e.type_url.substring(e.type_url.lastIndexOf("/")+1),n=this.lookup(r);n&&(e=n.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof o){var i=e.$type.toObject(e,t);return i["@type"]=e.$type.fullName,i}return this.toObject(e,t)}},n._configure=function(){o=r(339)}},5244:(e,t,r)=>{e.exports=c;var o,n=r(8278),i=r(1498);function s(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function a(){}function u(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function c(){this.len=0,this.head=new s(a,0,0),this.tail=this.head,this.states=null}function p(e,t,r){t[r]=255&e}function l(e,t){this.len=e,this.next=void 0,this.val=t}function h(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function d(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}c.create=n.Buffer?function(){return(c.create=function(){return new(void 0)})()}:function(){return new c},c.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(c.alloc=n.pool(c.alloc,n.Array.prototype.subarray)),c.prototype._push=function(e,t,r){return this.tail=this.tail.next=new s(e,t,r),this.len+=t,this},l.prototype=Object.create(s.prototype),l.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},c.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new l((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},c.prototype.int32=function(e){return e<0?this._push(h,10,o.fromNumber(e)):this.uint32(e)},c.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},c.prototype.uint64=function(e){var t=o.from(e);return this._push(h,t.length(),t)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(h,t.length(),t)},c.prototype.bool=function(e){return this._push(p,1,e?1:0)},c.prototype.fixed32=function(e){return this._push(d,4,e>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(e){var t=o.from(e);return this._push(d,4,t.lo)._push(d,4,t.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},c.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var f=n.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var o=0;o<e.length;++o)t[r+o]=e[o]};c.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(p,1,0);if(n.isString(e)){var r=c.alloc(t=i.length(e));i.write(e,r,0),e=r}return this.uint32(t)._push(f,t,e)},c.prototype.string=function(e){var t=i.length(e);return t?this.uint32(t)._push(i.write,t,e):this._push(p,1,0)},c.prototype.fork=function(){return this.states=new u(this),this.head=this.tail=new s(a,0,0),this.len=0,this},c.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new s(a,0,0),this.len=0),this},c.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},c.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},c._configure=function(){o=r(8365),r(5889),i=r(1498)}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={exports:{}};return e[o](i,i.exports,r),i.exports}r.amdO={},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{default:()=>Yo});var e={};r.r(e),r.d(e,{acceptContactInvite:()=>st,acceptInvitation:()=>it,addContact:()=>ot,addReaction:()=>vt,addToBlackList:()=>ct,addUsersToBlacklist:()=>pt,declineContactInvite:()=>ut,declineInvitation:()=>at,deleteContact:()=>nt,deleteReaction:()=>Et,deleteSession:()=>Xe,fetchHistoryMessages:()=>et,fetchUserInfoById:()=>$e,getBlacklist:()=>He,getChatToken:()=>Qe,getContacts:()=>ze,getReactionDetail:()=>_t,getReactionList:()=>Tt,getRoster:()=>qe,getSessionList:()=>Ke,recallMessage:()=>yt,removeFromBlackList:()=>lt,removeRoster:()=>gt,removeUserFromBlackList:()=>ht,subscribe:()=>dt,subscribed:()=>ft,unsubscribed:()=>mt,updateCurrentUserNick:()=>Ze,updateOwnUserInfo:()=>Ye,uploadPushToken:()=>Ve,uploadToken:()=>Je});var t={};r.r(t),r.d(t,{acceptGroupInvite:()=>Xt,acceptGroupJoinRequest:()=>zt,addUsersToGroupWhitelist:()=>Tr,agreeInviteIntoGroup:()=>Kt,agreeJoinGroup:()=>qt,blockGroup:()=>Ot,blockGroupMember:()=>cr,blockGroupMembers:()=>lr,blockGroupMessages:()=>Rt,changeGroupOwner:()=>At,changeOwner:()=>bt,createGroup:()=>Nt,createGroupNew:()=>It,deleteGroupSharedFile:()=>kr,destroyGroup:()=>Dt,disableSendGroupMsg:()=>vr,dissolveGroup:()=>Lt,downloadGroupSharedFile:()=>Mr,enableSendGroupMsg:()=>Er,fetchGroupAnnouncement:()=>Sr,fetchGroupSharedFileList:()=>wr,getGroup:()=>St,getGroupAdmin:()=>Ut,getGroupBlacklist:()=>yr,getGroupBlacklistNew:()=>gr,getGroupInfo:()=>kt,getGroupMsgReadUser:()=>Cr,getGroupMuteList:()=>ar,getGroupWhitelist:()=>Nr,getMuted:()=>sr,groupBlockMulti:()=>pr,groupBlockSingle:()=>ur,inviteToGroup:()=>Ft,inviteUsersToGroup:()=>Wt,isGroupWhiteUser:()=>Or,isInGroupWhiteList:()=>Rr,joinGroup:()=>Ht,listGroupMember:()=>Mt,listGroupMembers:()=>xt,listGroups:()=>Ct,modifyGroup:()=>wt,mute:()=>rr,muteGroupMember:()=>or,quitGroup:()=>Gt,rejectGroupInvite:()=>$t,rejectGroupJoinRequest:()=>Vt,rejectInviteIntoGroup:()=>Yt,rejectJoinGroup:()=>Jt,removeAdmin:()=>Bt,removeGroupBlockMulti:()=>fr,removeGroupBlockSingle:()=>hr,removeGroupMember:()=>Qt,removeGroupMembers:()=>tr,removeGroupWhitelistMember:()=>Ir,removeMultiGroupMember:()=>er,removeMute:()=>nr,removeSingleGroupMember:()=>Zt,rmUsersFromGroupWhitelist:()=>_r,setAdmin:()=>jt,setGroupAdmin:()=>Pt,unblockGroupMember:()=>dr,unblockGroupMembers:()=>mr,unmuteGroupMember:()=>ir,updateGroupAnnouncement:()=>br,uploadGroupSharedFile:()=>Ar});var n={};r.r(n),r.d(n,{addUsersToChatRoom:()=>Wr,addUsersToChatRoomWhitelist:()=>fo,blockChatRoomMember:()=>ro,blockChatRoomMembers:()=>no,chatRoomBlockMulti:()=>oo,chatRoomBlockSingle:()=>to,createChatRoom:()=>Ur,deleteChatRoomSharedFile:()=>Io,destroyChatRoom:()=>jr,disableSendChatRoomMsg:()=>lo,enableSendChatRoomMsg:()=>ho,fetchChatRoomAnnouncement:()=>Eo,fetchChatRoomSharedFileList:()=>No,getChatRoomAdmin:()=>Vr,getChatRoomBlacklist:()=>po,getChatRoomBlacklistNew:()=>co,getChatRoomDetails:()=>Pr,getChatRoomMuteList:()=>eo,getChatRoomMuted:()=>Qr,getChatRoomWhitelist:()=>yo,getChatRooms:()=>xr,isChatRoomWhiteUser:()=>vo,joinChatRoom:()=>Hr,listChatRoomMember:()=>zr,listChatRoomMembers:()=>Jr,modifyChatRoom:()=>Br,muteChatRoomMember:()=>Yr,quitChatRoom:()=>qr,removeChatRoomAdmin:()=>Xr,removeChatRoomBlockMulti:()=>ao,removeChatRoomBlockSingle:()=>io,removeChatRoomMember:()=>Dr,removeChatRoomMembers:()=>Fr,removeChatRoomWhitelistMember:()=>go,removeMultiChatRoomMember:()=>Gr,removeMuteChatRoomMember:()=>$r,removeSingleChatRoomMember:()=>Lr,rmUsersFromChatRoomWhitelist:()=>mo,setChatRoomAdmin:()=>Kr,unblockChatRoomMember:()=>so,unblockChatRoomMembers:()=>uo,unmuteChatRoomMember:()=>Zr,updateChatRoomAnnouncement:()=>To,uploadChatRoomSharedFile:()=>_o});var i={};r.r(i),r.d(i,{getPresenceStatus:()=>bo,getSubscribedPresenceList:()=>So,publishPresence:()=>Oo,subscribePresence:()=>Ro,unsubscribePresence:()=>Co});var s={};r.r(s),r.d(s,{getSupportedLanguages:()=>Ao,translateMessage:()=>ko});var a={};function u(){a.converter._configure(),a.decoder._configure(),a.encoder._configure(),a.Field._configure(),a.MapField._configure(),a.Message._configure(),a.Namespace._configure(),a.Method._configure(),a.ReflectionObject._configure(),a.OneOf._configure(),a.parse._configure(),a.Reader._configure(),a.Root._configure(),a.Service._configure(),a.verifier._configure(),a.Type._configure(),a.types._configure(),a.wrappers._configure(),a.Writer._configure()}a.build="minimal",a.Writer=r(5244),a.encoder=r(9929),a.Reader=r(8494),a.util=r(8278),a.rpc=r(7325),a.roots=r(889),a.verifier=r(5484),a.tokenize=r(8869),a.parse=r(7845),a.common=r(3072),a.ReflectionObject=r(5998),a.Namespace=r(2476),a.Root=r(4685),a.Enum=r(582),a.Type=r(192),a.Field=r(9286),a.OneOf=r(9735),a.MapField=r(1435),a.Service=r(9447),a.Method=r(484),a.converter=r(525),a.decoder=r(3888),a.Message=r(339),a.wrappers=r(7834),a.types=r(4696),a.util=r(8278),a.configure=u,a.load=function(e,t,r){return"function"==typeof t?(r=t,t=new a.Root):t||(t=new a.Root),t.load(e,r)},a.loadSync=function(e,t){return t||(t=new a.Root),t.loadSync(e)},a.parseFromPbString=function(e,t,r){return"function"==typeof t?(r=t,t=new a.Root):t||(t=new a.Root),t.parseFromPbString(e,r)},u();const c=a;var p=r(3720),l=r.n(p);const h=function(){function e(e){this.type=e.type,this.message=e.message,this.data=e.data}return e.create=function(t){return new e(t)},e}();var d;!function(e){e[e.REQUEST_SUCCESS=0]="REQUEST_SUCCESS",e[e.REQUEST_TIMEOUT=-1]="REQUEST_TIMEOUT",e[e.REQUEST_UNKNOWN=-2]="REQUEST_UNKNOWN",e[e.REQUEST_PARAMETER_ERROR=-3]="REQUEST_PARAMETER_ERROR",e[e.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR=0]="WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_OPEN_ERROR=1]="WEBIM_CONNCTION_OPEN_ERROR",e[e.WEBIM_CONNCTION_AUTH_ERROR=2]="WEBIM_CONNCTION_AUTH_ERROR",e[e.WEBIM_CONNCTION_OPEN_USERGRID_ERROR=3]="WEBIM_CONNCTION_OPEN_USERGRID_ERROR",e[e.WEBIM_CONNCTION_ATTACH_ERROR=4]="WEBIM_CONNCTION_ATTACH_ERROR",e[e.WEBIM_CONNCTION_ATTACH_USERGRID_ERROR=5]="WEBIM_CONNCTION_ATTACH_USERGRID_ERROR",e[e.WEBIM_CONNCTION_REOPEN_ERROR=6]="WEBIM_CONNCTION_REOPEN_ERROR",e[e.WEBIM_CONNCTION_SERVER_CLOSE_ERROR=7]="WEBIM_CONNCTION_SERVER_CLOSE_ERROR",e[e.WEBIM_CONNCTION_SERVER_ERROR=8]="WEBIM_CONNCTION_SERVER_ERROR",e[e.WEBIM_CONNCTION_IQ_ERROR=9]="WEBIM_CONNCTION_IQ_ERROR",e[e.WEBIM_CONNCTION_USER_REMOVED=207]="WEBIM_CONNCTION_USER_REMOVED",e[e.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE=206]="WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE",e[e.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD=216]="WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD",e[e.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE=217]="WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE",e[e.WEBIM_CONNCTION_PING_ERROR=10]="WEBIM_CONNCTION_PING_ERROR",e[e.WEBIM_CONNCTION_NOTIFYVERSION_ERROR=11]="WEBIM_CONNCTION_NOTIFYVERSION_ERROR",e[e.WEBIM_CONNCTION_GETROSTER_ERROR=12]="WEBIM_CONNCTION_GETROSTER_ERROR",e[e.WEBIM_CONNCTION_CROSSDOMAIN_ERROR=13]="WEBIM_CONNCTION_CROSSDOMAIN_ERROR",e[e.WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES=14]="WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES",e[e.WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR=15]="WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR",e[e.WEBIM_CONNCTION_DISCONNECTED=16]="WEBIM_CONNCTION_DISCONNECTED",e[e.WEBIM_CONNCTION_AJAX_ERROR=17]="WEBIM_CONNCTION_AJAX_ERROR",e[e.WEBIM_CONNCTION_JOINROOM_ERROR=18]="WEBIM_CONNCTION_JOINROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOM_ERROR=19]="WEBIM_CONNCTION_GETROOM_ERROR",e[e.WEBIM_CONNCTION_GETROOMINFO_ERROR=20]="WEBIM_CONNCTION_GETROOMINFO_ERROR",e[e.WEBIM_CONNCTION_GETROOMMEMBER_ERROR=21]="WEBIM_CONNCTION_GETROOMMEMBER_ERROR",e[e.WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR=22]="WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR",e[e.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR=23]="WEBIM_CONNCTION_LOAD_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR=24]="WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR",e[e.WEBIM_CONNCTION_JOINCHATROOM_ERROR=25]="WEBIM_CONNCTION_JOINCHATROOM_ERROR",e[e.WEBIM_CONNCTION_QUITCHATROOM_ERROR=26]="WEBIM_CONNCTION_QUITCHATROOM_ERROR",e[e.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR=27]="WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR=28]="WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR=29]="WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR=30]="WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR",e[e.WEBIM_CONNCTION_CALLBACK_INNER_ERROR=31]="WEBIM_CONNCTION_CALLBACK_INNER_ERROR",e[e.WEBIM_CONNCTION_CLIENT_OFFLINE=32]="WEBIM_CONNCTION_CLIENT_OFFLINE",e[e.WEBIM_CONNCTION_CLIENT_LOGOUT=33]="WEBIM_CONNCTION_CLIENT_LOGOUT",e[e.WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR=34]="WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR",e[e.WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP=35]="WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP=36]="WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP",e[e.WEBIM_CONNECTION_ACCEPT_JOIN_GROUP=37]="WEBIM_CONNECTION_ACCEPT_JOIN_GROUP",e[e.WEBIM_CONNECTION_DECLINE_JOIN_GROUP=38]="WEBIM_CONNECTION_DECLINE_JOIN_GROUP",e[e.WEBIM_CONNECTION_CLOSED=39]="WEBIM_CONNECTION_CLOSED",e[e.WEBIM_CONNECTION_ERROR=40]="WEBIM_CONNECTION_ERROR",e[e.WEBIM_UPLOADFILE_BROWSER_ERROR=100]="WEBIM_UPLOADFILE_BROWSER_ERROR",e[e.WEBIM_UPLOADFILE_ERROR=101]="WEBIM_UPLOADFILE_ERROR",e[e.WEBIM_UPLOADFILE_NO_LOGIN=102]="WEBIM_UPLOADFILE_NO_LOGIN",e[e.WEBIM_UPLOADFILE_NO_FILE=103]="WEBIM_UPLOADFILE_NO_FILE",e[e.WEBIM_DOWNLOADFILE_ERROR=200]="WEBIM_DOWNLOADFILE_ERROR",e[e.WEBIM_DOWNLOADFILE_NO_LOGIN=201]="WEBIM_DOWNLOADFILE_NO_LOGIN",e[e.WEBIM_DOWNLOADFILE_BROWSER_ERROR=202]="WEBIM_DOWNLOADFILE_BROWSER_ERROR",e[e.USER_NOT_FOUND=204]="USER_NOT_FOUND",e[e.USER_MUTED_BY_ADMIN=219]="USER_MUTED_BY_ADMIN",e[e.USER_NOT_FRIEND=221]="USER_NOT_FRIEND",e[e.WEBIM_MESSAGE_REC_TEXT=300]="WEBIM_MESSAGE_REC_TEXT",e[e.WEBIM_MESSAGE_REC_TEXT_ERROR=301]="WEBIM_MESSAGE_REC_TEXT_ERROR",e[e.WEBIM_MESSAGE_REC_EMOTION=302]="WEBIM_MESSAGE_REC_EMOTION",e[e.WEBIM_MESSAGE_REC_PHOTO=303]="WEBIM_MESSAGE_REC_PHOTO",e[e.WEBIM_MESSAGE_REC_AUDIO=304]="WEBIM_MESSAGE_REC_AUDIO",e[e.WEBIM_MESSAGE_REC_AUDIO_FILE=305]="WEBIM_MESSAGE_REC_AUDIO_FILE",e[e.WEBIM_MESSAGE_REC_VEDIO=306]="WEBIM_MESSAGE_REC_VEDIO",e[e.WEBIM_MESSAGE_REC_VEDIO_FILE=307]="WEBIM_MESSAGE_REC_VEDIO_FILE",e[e.WEBIM_MESSAGE_REC_FILE=308]="WEBIM_MESSAGE_REC_FILE",e[e.WEBIM_MESSAGE_SED_TEXT=309]="WEBIM_MESSAGE_SED_TEXT",e[e.WEBIM_MESSAGE_SED_EMOTION=310]="WEBIM_MESSAGE_SED_EMOTION",e[e.WEBIM_MESSAGE_SED_PHOTO=311]="WEBIM_MESSAGE_SED_PHOTO",e[e.WEBIM_MESSAGE_SED_AUDIO=312]="WEBIM_MESSAGE_SED_AUDIO",e[e.WEBIM_MESSAGE_SED_AUDIO_FILE=313]="WEBIM_MESSAGE_SED_AUDIO_FILE",e[e.WEBIM_MESSAGE_SED_VEDIO=314]="WEBIM_MESSAGE_SED_VEDIO",e[e.WEBIM_MESSAGE_SED_VEDIO_FILE=315]="WEBIM_MESSAGE_SED_VEDIO_FILE",e[e.WEBIM_MESSAGE_SED_FILE=316]="WEBIM_MESSAGE_SED_FILE",e[e.WEBIM_MESSAGE_SED_ERROR=317]="WEBIM_MESSAGE_SED_ERROR",e[e.STATUS_INIT=400]="STATUS_INIT",e[e.STATUS_DOLOGIN_USERGRID=401]="STATUS_DOLOGIN_USERGRID",e[e.STATUS_DOLOGIN_IM=402]="STATUS_DOLOGIN_IM",e[e.STATUS_OPENED=403]="STATUS_OPENED",e[e.STATUS_CLOSING=404]="STATUS_CLOSING",e[e.STATUS_CLOSED=405]="STATUS_CLOSED",e[e.STATUS_ERROR=406]="STATUS_ERROR",e[e.SERVER_BUSY=500]="SERVER_BUSY",e[e.GROUP_NOT_EXIST=605]="GROUP_NOT_EXIST",e[e.GROUP_NOT_JOINED=602]="GROUP_NOT_JOINED",e[e.GROUP_MEMBERS_FULL=606]="GROUP_MEMBERS_FULL",e[e.MESSAGE_RECALL_TIME_LIMIT=504]="MESSAGE_RECALL_TIME_LIMIT",e[e.SERVICE_NOT_ENABLED=505]="SERVICE_NOT_ENABLED",e[e.SERVICE_NOT_ALLOW_MESSAGING=506]="SERVICE_NOT_ALLOW_MESSAGING",e[e.SERVICE_NOT_ALLOW_MESSAGING_MUTE=507]="SERVICE_NOT_ALLOW_MESSAGING_MUTE",e[e.SERVER_UNKNOWN_ERROR=503]="SERVER_UNKNOWN_ERROR",e[e.MESSAGE_INCLUDE_ILLEGAL_CONTENT=501]="MESSAGE_INCLUDE_ILLEGAL_CONTENT",e[e.MESSAGE_EXTERNAL_LOGIC_BLOCKED=502]="MESSAGE_EXTERNAL_LOGIC_BLOCKED",e[e.PERMISSION_DENIED=603]="PERMISSION_DENIED",e[e.WEBIM_LOAD_MSG_ERROR=604]="WEBIM_LOAD_MSG_ERROR",e[e.GROUP_ALREADY_JOINED=601]="GROUP_ALREADY_JOINED",e[e.REST_PARAMS_STATUS=700]="REST_PARAMS_STATUS",e[e.CHATROOM_MEMBERS_FULL=704]="CHATROOM_MEMBERS_FULL",e[e.CHATROOM_NOT_EXIST=705]="CHATROOM_NOT_EXIST",e[e.SDK_RUNTIME_ERROR=999]="SDK_RUNTIME_ERROR",e[e.REACTION_REACH_LIMIT=1100]="REACTION_REACH_LIMIT",e[e.REACTION_ALREADY_ADDED=1101]="REACTION_ALREADY_ADDED",e[e.REACTION_NOT_IN_GROUP=1102]="REACTION_NOT_IN_GROUP",e[e.REACTION_OPERATION_IS_ILLEGAL=1103]="REACTION_OPERATION_IS_ILLEGAL",e[e.REACTION_APPKEY_NOT_OPEN_SERVICE=1104]="REACTION_APPKEY_NOT_OPEN_SERVICE",e[e.REACTION_GROUP_ID_CAN_NOT_BE_NULL=1105]="REACTION_GROUP_ID_CAN_NOT_BE_NULL"}(d||(d={}));const f=d;var m,g=function(){return g=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},g.apply(this,arguments)},y=function(){};function v(){return"undefined"!=typeof swan&&E(swan)?{platform:m.BAIDU,global:swan}:"undefined"!=typeof tt&&E(tt)?{platform:m.TT,global:tt}:"undefined"!=typeof dd&&E(dd)?{platform:m.DD,global:dd}:"undefined"!=typeof my&&E(my)?{platform:m.ZFB,global:my}:"undefined"!=typeof wx&&E(wx)?{platform:m.WX,global:wx}:"undefined"!=typeof uni&&E(uni)?{platform:m.UNI,global:uni}:"undefined"!=typeof window&&window.WebSocket?{platform:m.WEB,global:window}:{platform:m.NODE,global:r.g||{}}}function E(e){for(var t=["canIUse","getSystemInfo"],r=0,o=t.length;r<o;r++)if(!e[t[r]])return!1;return!0}!function(e){e.WEB="web",e.WX="wx",e.ZFB="zfb",e.DD="dd",e.TT="tt",e.BAIDU="baidu",e.QUICK_APP="quick_app",e.UNI="uni",e.NODE="node"}(m||(m={}));var T={autoIncrement:0,ajax:function(e){return new Promise((function(t,r){var o=e.dataType||"text",n=e.success||y,i=e.error||y,s=new XMLHttpRequest;s.ontimeout=function(){r({errorType:"timeout_error",xhr:s})},s.onerror=function(){r({errorType:"onerror",xhr:s})},s.onabort=function(){r({errorType:"onabort",xhr:s})},s.onreadystatechange=function(){if(4===s.readyState){if(200===(s.status||0)){try{switch(o){case"text":return n(s.responseText),void t(s.responseText);case"json":var e=JSON.parse(s.responseText);return n(e),void t(e);case"xml":return s.responseXML&&s.responseXML.documentElement?(n(s.responseXML.documentElement),void t(s.responseXML.documentElement)):(i({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),void r({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}));default:i({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),r({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText})}return t(s.response||s.responseText),void n(s.response||s.responseText,s)}catch(e){r(e)}return}!function(e,t,r){var o,n,i,s,a,u,c,p,l,h=e.response;h&&"string"==typeof h&&(h=JSON.parse(h));var d=e.status;if(400===d)switch(null==h?void 0:h.error_description){case"the user is already operation this message":t({type:f.REACTION_ALREADY_ADDED,message:null==h?void 0:h.error_description});break;case"The quantity has exceeded the limit!":t({type:f.REACTION_REACH_LIMIT,message:null==h?void 0:h.error_description});break;case"The user not in this group!":t({type:f.REACTION_NOT_IN_GROUP,message:null==h?void 0:h.error_description});break;case"the user operation is illegal!":t({type:f.REACTION_OPERATION_IS_ILLEGAL,message:null==h?void 0:h.error_description});break;case"this appKey is not open reaction service!":t({type:f.REACTION_APPKEY_NOT_OPEN_SERVICE,message:null==h?void 0:h.error_description});break;case"groupId can not be null!":t({type:f.REACTION_GROUP_ID_CAN_NOT_BE_NULL,message:null==h?void 0:h.error_description});break;default:t({type:f.WEBIM_CONNCTION_AJAX_ERROR,message:e.responseText}),r({type:f.WEBIM_CONNCTION_AJAX_ERROR,message:e.responseText})}else 403===d?("group member list is full!"===h.error_description?(null===(o=e.responseURL)||void 0===o?void 0:o.includes("chatgroups"))?t({type:f.GROUP_MEMBERS_FULL,data:e.response||e.responseText,message:h.error_description}):t({type:f.CHATROOM_MEMBERS_FULL,data:e.response||e.responseText,message:h.error_description}):h.error_description.includes(h.error_description.includes("already in group"))?(null===(n=e.responseURL)||void 0===n?void 0:n.includes("chatgroups"))&&t({type:f.GROUP_ALREADY_JOINED,data:e.response||e.responseText,message:h.error_description}):h.error_description.includes("are not members of this group")?(null===(i=e.responseURL)||void 0===i?void 0:i.includes("chatgroups"))&&t({type:f.GROUP_NOT_JOINED,data:e.response||e.responseText,message:h.error_description}):t({type:f.PERMISSION_DENIED,data:e.response||e.responseText,message:"permission denied"}),r({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText})):404===d?((null===(s=h.error_description)||void 0===s?void 0:s.includes("do not find this group"))||(null===(a=h.error_description)||void 0===a?void 0:a.includes("does not exist"))?(null===(u=e.responseURL)||void 0===u?void 0:u.includes("chatgroups"))?t({type:f.GROUP_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist."}):t({type:f.CHATROOM_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist."}):(null===(c=h.error_description)||void 0===c?void 0:c.includes("username"))&&(null===(p=h.error_description)||void 0===p?void 0:p.includes("doesn't exist!'"))||(null===(l=h.error_description)||void 0===l?void 0:l.includes("user not found"))?t({type:f.USER_NOT_FOUND,data:e.response||e.responseText,message:h.error_description}):t({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText}),r({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText})):429===d||503===d?(t({type:f.SERVER_BUSY,data:e.response||e.responseText,message:"Server is busy."}),r({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"Server is busy."})):(t({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:""}),r({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:""}))}(s,r,i)}0===s.readyState&&(i({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}),r({type:f.WEBIM_CONNCTION_AJAX_ERROR,data:s.responseText}))},e.responseType&&s.responseType&&(s.responseType=e.responseType),e.mimeType&&s.overrideMimeType(e.mimeType);var a=e.type||"POST",u=e.data||null,c="";if("get"===a.toLowerCase()&&u){for(var p in u)u.hasOwnProperty(p)&&(c+=p+"="+u[p]+"&");c=c?c.slice(0,-1):c,e.url+=(e.url.indexOf("?")>0?"&":"?")+(c?c+"&":c)+"_v="+(new Date).getTime(),u=null,c=""}s.open(a,e.url);var l=e.headers||{};for(var h in l["Content-Type"]||(l["Content-Type"]="application/json"),l)l.hasOwnProperty(h)&&s.setRequestHeader(h,l[h]);s.send(u)})).then((function(e){return"Object"===(t=e,Object.prototype.toString.call(t).slice(8,-1))?g(g({},e),{type:f.REQUEST_SUCCESS}):{data:e,type:f.REQUEST_SUCCESS};var t}))},getUniqueId:function(){this.autoIncrement?this.autoIncrement++:this.autoIncrement=1;var e=new Date,t=new Date(2010,1,1);return(e.getTime()-t.getTime()+this.autoIncrement).toString()},getFileUrl:function(e){var t={url:"",filename:"",filetype:"",data:null},r="string"==typeof e?document.getElementById(e):e;if(window.URL.createObjectURL){if(!r.files)throw Error("this is not HTMLInputElement");var o=r.files;if(o.length>0){var n=o.item(0);t.data=n,t.url=window.URL.createObjectURL(n),t.filename=(null==n?void 0:n.name)||""}}else{if("string"!=typeof e)throw Error("in IE fileInputId must be string");n=document.getElementById(e).value,t.url=n;var i=n.lastIndexOf("/"),s=n.lastIndexOf("\\"),a=Math.max(i,s);t.filename=a<0?n:n.substring(a+1)}var u=t.filename.lastIndexOf(".");return-1!==u&&(t.filetype=t.filename.substring(u+1).toLowerCase()),t},uploadFile:function(e){var t,r,o=e.accessToken;if(o){var n=e.appKey,i=[],s="",a="";if(n&&(s=(i=n.split("#"))[0],a=i[1]),s||a){var u=e.apiUrl,c=e.uploadUrl||u+"/"+s+"/"+a+"/chatfiles";if((null===(r=null===(t=null==e?void 0:e.file)||void 0===t?void 0:t.data)||void 0===r?void 0:r.size)<=0)e.onFileUploadError&&e.onFileUploadError({type:f.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else{var p=new XMLHttpRequest;p.upload&&p.upload.addEventListener("progress",e.onFileUploadProgress||y,!1),p.addEventListener("abort",e.onFileUploadCanceled||y,!1),p.addEventListener("error",(function(t){e.onFileUploadError&&e.onFileUploadError({type:f.WEBIM_UPLOADFILE_ERROR,data:p})}),!1),p.addEventListener("load",(function(t){try{var r=JSON.parse(p.responseText);if(400===p.status&&"content improper"===r.error)return e.onFileUploadError&&e.onFileUploadError({type:f.WEBIM_UPLOADFILE_ERROR,data:r}),!1;try{e.onFileUploadComplete&&e.onFileUploadComplete(r)}catch(t){e.onFileUploadError&&e.onFileUploadError({type:f.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){e.onFileUploadError&&e.onFileUploadError({type:f.WEBIM_UPLOADFILE_ERROR,data:p.responseText})}}),!1),p.open("POST",c),p.setRequestHeader("restrict-access","true"),p.setRequestHeader("Accept","*/*"),p.setRequestHeader("Authorization","Bearer "+o);var l=new FormData;l.append("file",e.file.data),p.send(l)}}else e.onFileUploadError&&e.onFileUploadError({type:f.WEBIM_UPLOADFILE_ERROR,message:"AppKey illegal"})}else e.onFileUploadError&&e.onFileUploadError({type:f.WEBIM_UPLOADFILE_NO_LOGIN,message:"AccessToken cannot be empty"})},flow:function(e){for(var t=e.length,r=t;r--;)if("function"!=typeof e[r])throw new TypeError("Expected a function");return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];for(var n=0,i=t?e[n].apply(this,r):r[0];++n<t;)i=e[n].call(this,i);return i}},listenNetwork:function(e,t){var r=v();if(r.platform!==m.WEB){var o=r.global,n=function(r){r.isConnected?e():t()};o.offNetworkStatusChange&&o.offNetworkStatusChange(n),o.onNetworkStatusChange&&o.onNetworkStatusChange(n)}else window.addEventListener&&(window.addEventListener("online",e),window.addEventListener("offline",t))},getEnvInfo:v,wxRequest:function(e){return new Promise((function(t,r){var o=e.success||y,n=e.error||y,i=e.type||"POST",s=e.data||null,a="",u=T.getEnvInfo();if("get"===i.toLowerCase()&&s){for(var c in s)s.hasOwnProperty(c)&&(a+=c+"="+s[c]+"&");a=a?a.slice(0,-1):a,e.url+=(e.url.indexOf("?")>0?"&":"?")+(a?a+"&":a)+"_v="+(new Date).getTime(),s=null,a=""}var p={url:e.url,data:e.data,method:i,headers:{},success:function(e){var i,s;"200"===(null===(i=e.statusCode)||void 0===i?void 0:i.toString())||"200"===(null===(s=e.status)||void 0===s?void 0:s.toString())?(o(e.data),t(e.data)):(n(e),r(e))},complete:function(){},fail:function(e){n(e),r(e)}};if("zfb"===u.platform||"dd"===u.platform?p.headers=e.headers:p.header=e.headers,"dd"===u.platform)return dd.httpRequest(p);u.global.request(p)}))},parseDownloadResponse:function(e){if(!window||!window.URL)throw Error("parseDownloadResponse can be used in broswer only");return e&&e.type&&"application/json"===e.type||0>Object.prototype.toString.call(e).indexOf("Blob")?this.url+"?token=":window.URL.createObjectURL(e)},download:function(e){e.onFileDownloadComplete=e.onFileDownloadComplete||y,e.onFileDownloadError=e.onFileDownloadError||y;var t=new XMLHttpRequest;t.addEventListener("load",(function(r){e.onFileDownloadComplete&&e.onFileDownloadComplete(t.response)}),!1),t.addEventListener("error",(function(r){e.onFileDownloadError&&e.onFileDownloadError({type:f.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:t})}),!1);var r=e.method||"GET",o=e.responseType||"blob",n=e.mimeType||"text/plain; charset=x-user-defined";t.open(r,e.url),"undefined"!=typeof Blob?t.responseType=o:t.overrideMimeType(n);var i={"X-Requested-With":"XMLHttpRequest",Accept:"application/octet-stream","share-secret":e.secret,Authorization:"Bearer "+this.context.accessToken},s=e.headers||{};for(var a in s)i[a]=s[a];for(var a in i)i[a]&&t.setRequestHeader(a,i[a]);t.send(null)},parseNotify:function(e){for(var t="",r=0;r<e.length;r++)t+="%"+e[r].toString(16);return JSON.parse(decodeURIComponent(t))}};const _=T;var I=r(4188),N=r.n(I);function O(){console.log&&(console.log.apply?console.log.apply(console,Array.prototype.slice.call(arguments)):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}var R,C="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent),S=function(e,t,r){if(r||2===arguments.length)for(var o,n=0,i=t.length;n<i;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},b=function(){},A={};!function(e){e[e.TRACE=0]="TRACE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"}(R||(R={}));var k=function(){function e(e,t,r){this.name=e||"defaultLogger",this.currentLevel=0,this.useCookiePersist=!1,this.storageLogLevelKey="loglevel",this.levels=R,this.logMethods=["trace","debug","info","warn","error"],this.methodFactory=r||this.defaultMethodFactory;var o=this._getPersistedLevel();null==o&&(o=null===t?"WARN":t),this.logs=[],this.config={useCache:!1,maxCache:3145728,color:"",background:""},this.logBytes=0,this.setLevel(o,!1,"")}return e.prototype.setConfig=function(e){this.config=e},e.prototype.getLevel=function(){return this.currentLevel},e.prototype.setLevel=function(e,t,r){if("string"==typeof e&&(e=R[e]),void 0===e&&(e=0),!("number"==typeof e&&e>=0&&e<=this.levels.SILENT))throw Error("log.setLevel() called with invalid level: "+e);if(this.currentLevel=e,!1!==t&&this._persistLevel(e),this.replaceLoggingMethods(e,r),"undefined"==typeof console&&e<R.SILENT)return"No console available for logging"},e.prototype.setDefaultLevel=function(e){this._getPersistedLevel()||this.setLevel(e,!1,"")},e.prototype.enableAll=function(e){this.setLevel(this.levels.TRACE,!0,"")},e.prototype.disableAll=function(e){this.setLevel(this.levels.SILENT,!0,"")},e.prototype.getLogs=function(){return this.logs},e.prototype.download=function(){if("undefined"!=typeof window&&"undefined"!=typeof document){var e=this.getLogs().join("\n"),t=new Blob([e],{type:"text/plain;charset=UTF-8"}),r=window.URL.createObjectURL(t),o=document.createElement("a");o.style.display="none",o.href=r,o.setAttribute("download","sdklog"),document.body.appendChild(o),o.click()}},e.prototype._bindMethod=function(e,t,r){var o=this,n=e[t],i=this.getTime();if(r)return this._cacheLog;if("function"==typeof n.bind)return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var s=o.getTime();n.call.apply(n,S([e,s+" IM SDK ["+("log"===t?"debug":t)+"]: "],r,!1))};try{return Function.prototype.bind.call(n,e,i+" IM SDK ["+("log"===t?"debug":t)+"]: ")}catch(t){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}},e.prototype.getTime=function(){var e=new Date;return e.toTimeString().split(" ")[0]+":"+e.getMilliseconds()},e.prototype._cacheLog=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=(new Date).toLocaleString()+": ",o="";e.forEach((function(e){o+="object"==typeof e?JSON.stringify(e)+" ":e+" "})),this._cacheLogCall(r+o)},e.prototype._cacheLogCall=function(e){var t=w(e),r=this.logBytes+t,o=this.config.maxCache;if(!(t>=o)){if(r<o)this.logBytes+=t;else for(var n=r-o,i=0;i<n;){var s=this.logs.shift();void 0!==s&&(i+=w(s))}this.logs.push(e)}},e.prototype._getPersistedLevel=function(){var e;if("undefined"==typeof window)return 5;if("undefined"===(e=window&&window.localStorage&&window.localStorage[this.storageLogLevelKey])){var t=window.document.cookie,r=t.indexOf(encodeURIComponent(this.storageLogLevelKey));-1!==r&&(e=/^([^;]+)/.exec(t.slice(r))[1])}return e||5},e.prototype._persistLevel=function(e){var t=this.logMethods[e]||"SILENT";"undefined"!=typeof window&&(window.localStorage&&(window.localStorage[this.storageLogLevelKey]=t),this.useCookiePersist&&(window.document.cookie=encodeURIComponent(this.storageLogLevelKey)+"="+t+";"))},e.prototype.replaceLoggingMethods=function(e,t){for(var r=0;r<this.logMethods.length;r++){var o=this.logMethods[r];this[o]=r<e?b:this.methodFactory(o,e,t)}this.log=this.debug},e.prototype.defaultMethodFactory=function(e,t,r){return this.realMethod(e)||this.enableLoggingWhenConsoleArrives.apply(this,[e,t,r])},e.prototype.realMethod=function(e){return"debug"===e&&(e="log"),"undefined"!=typeof console&&("trace"===e&&C?O:void 0!==console[e]?this._bindMethod(console,e,this.config.useCache):void 0!==console.log?this._bindMethod(console,"log",this.config.useCache):b)},e.prototype.enableLoggingWhenConsoleArrives=function(e,t,r){return function(){"undefined"!=typeof console&&(this.replaceLoggingMethods.call(this,t,r),this[e].apply(this,arguments))}.bind(this)},e}();function w(e){for(var t=e.length,r=0;r<e.length;r++)e.charCodeAt(r)>255&&t++;return t}var M=new k;M.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=A[e];return t||(t=A[e]=new k(e,M.getLevel(),M.methodFactory)),t};var x="undefined"!=typeof window?window.log:void 0;M.noConflict=function(){return"undefined"!=typeof window&&window.log===M&&(window.log=x),M},M.getLoggers=function(){return A};const U=M,j=function(){function e(e){var t=e.id;this.id=t,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.id,type:"read",to:e.to,from:e.from||"",chatType:e.chatType}},e.create=function(e){return{id:_.getUniqueId(),chatType:e.chatType,ackId:e.id,type:"read",to:e.to,from:e.from||"",ackContent:e.ackContent}},e}(),P=function(){function e(e){this.id=e.id,this.type=e.type}return e.prototype.set=function(e){this.body={id:this.id,ackId:e.ackId,type:"delivery",to:e.to,from:e.from||""}},e.create=function(e){return{id:_.getUniqueId(),ackId:e.ackId,type:"delivery",to:e.to,from:e.from||""}},e}(),B=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"channel",to:e.to,from:e.from||"",time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:_.getUniqueId(),type:"channel",chatType:e.chatType||"singleChat",to:e.to,from:e.from||"",time:Date.now()}},e}(),L=function(){function e(e){var t=e.type,r=e.id||_.getUniqueId();this.id=r,this.type=t,this.value=""}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"txt",to:e.to,msg:e.msg,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()},this.value=e.msg},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){var t,r;return(null===(t=e.msgConfig)||void 0===t?void 0:t.languages)&&Array.isArray(null===(r=e.msgConfig)||void 0===r?void 0:r.languages),{type:"txt",id:_.getUniqueId(),msg:e.msg,to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig}},e}(),D=function(){function e(e){var t=e.type,r=e.id;this.id=r||_.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"cmd",to:e.to,action:e.action,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:_.getUniqueId(),type:"cmd",to:e.to,from:e.from||"",chatType:e.chatType||"singleChat",action:e.action,time:Date.now(),msgConfig:e.msgConfig}},e}(),G=function(){function e(e){var t=e.type,r=e.id||_.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:_.getUniqueId(),chatType:e.chatType||"singleChat",type:"custom",to:e.to,customEvent:e.customEvent,customExts:e.customExts,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig}},e}(),F=function(){function e(e){var t=e.type,r=e.id;this.id=r||_.getUniqueId(),this.type=t}return e.prototype.set=function(e){this.body={id:this.id,chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now()}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:_.getUniqueId(),chatType:e.chatType||"singleChat",type:"loc",to:e.to,addr:e.addr,buildingName:e.buildingName,lat:e.lat,lng:e.lng,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig}},e}(),W=function(){function e(e){var t=e.type,r=e.id||_.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&_.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"img",file:e.file,width:e.width,height:e.height,to:e.to,from:e.from||"",roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:_.getUniqueId(),chatType:e.chatType,type:"img",url:e.url,width:e.width,height:e.height,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress}},e}(),H=function(){function e(e){var t=e.type,r=e.id||_.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&_.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"audio",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:_.getUniqueId(),chatType:e.chatType,type:"audio",filename:e.filename,length:e.length,file:e.file,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,file_length:e.file_length,msgConfig:e.msgConfig}},e}(),q=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&_.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),apiUrl:e.apiUrl,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:_.getUniqueId(),chatType:e.chatType||"singleChat",type:"video",file:e.file,filename:e.filename,length:e.length,file_length:e.file_length,fileInputId:e.fileInputId,to:e.to,from:e.from||"",ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,msgConfig:e.msgConfig}},e}(),z=function(){function e(e){var t=e.type,r=e.id;this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&_.getFileUrl(e.fileInputId),this.body={id:this.id,chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,to:e.to,from:e.from,roomType:e.roomType,success:e.success,fail:e.fail,ext:e.ext,time:Date.now(),onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body}},e.prototype.setChatType=function(e){return!!this.body&&(this.body.chatType=e,!0)},e.prototype.setGroup=function(e){return!!this.body&&(this.body.group=e,!0)},e.create=function(e){return{id:_.getUniqueId(),chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,to:e.to,from:e.from||"",ext:e.ext,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,body:e.body,time:Date.now(),msgConfig:e.msgConfig}},e}();var J=function(){function e(t,r){return this.type=t,this.id=r||_.getUniqueId(),e.createOldMsg({type:t,id:this.id})}return e.createOldMsg=function(e){switch(e.type){case"read":return new j({type:"read",id:e.id});case"delivery":return new P({type:"delivery",id:e.id});case"channel":return new B({type:"channel",id:e.id});case"txt":return new L({type:"txt",id:e.id});case"cmd":return new D({type:"cmd",id:e.id});case"custom":return new G({type:"custom",id:e.id});case"loc":return new F({type:"loc",id:e.id});case"img":return new W({type:"img",id:e.id});case"audio":return new H({type:"audio",id:e.id});case"video":return new q({type:"video",id:e.id});case"file":return new z({type:"file",id:e.id})}},e.create=function(e){return"txt"!==(t=e).type||"version"in t?function(e){return"img"===e.type&&!("version"in e)}(e)?W.create(e):function(e){return"cmd"===e.type&&!("version"in e)}(e)?D.create(e):function(e){return"file"===e.type&&!("version"in e)}(e)?z.create(e):function(e){return"audio"===e.type&&!("version"in e)}(e)?H.create(e):function(e){return"video"===e.type&&!("version"in e)}(e)?q.create(e):function(e){return"custom"===e.type&&!("version"in e)}(e)?G.create(e):function(e){return"loc"===e.type&&!("version"in e)}(e)?F.create(e):function(e){return"channel"===e.type&&!("version"in e)}(e)?B.create(e):function(e){return"delivery"===e.type&&!("version"in e)}(e)?P.create(e):function(e){return"read"===e.type&&!("version"in e)}(e)?j.create(e):{}:L.create(e);var t},e.prototype.set=function(e){},e}(),V={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM"};function K(e){for(var t={},r=0;r<e.length;r++)if(8===e[r].type)t[e[r].key]=JSON.parse(e[r].stringValue);else if(7===e[r].type)t[e[r].key]=e[r].stringValue;else if(6===e[r].type)t[e[r].key]=e[r].doubleValue;else if(5===e[r].type)t[e[r].key]=e[r].floatValue;else if(1===e[r].type){var o=e[r].varintValue,n=new(l())(o.low,o.high,o.unsigned).toString();t[e[r].key]=0!==Number(n)}else 2!==e[r].type&&3!==e[r].type&&4!==e[r].type||(o=e[r].varintValue,n=new(l())(o.low,o.high,o.unsigned).toString(),t[e[r].key]=Number(n));return t}function X(e,t,r){if(this.delivery&&e!==t){var o=this.getUniqueId(),n=new J("delivery",o);n.set({ackId:r,to:e}),U.debug("send delivery ack"),this.send(n.body)}}const Y=function(e,t,r,o){var n,i,s,a,u,c,p,h,d=new(l())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),f=this.root.lookup("easemob.pb.MessageBody").decode(e.payload),m=new(l())(e.id.low,e.id.high,e.id.unsigned).toString(),g=f.ackMessageId?new(l())(f.ackMessageId.low,f.ackMessageId.high,f.ackMessageId.unsigned).toString():"",y="",v=f.from&&f.from.name,E=f.to&&f.to.name;switch(U.debug("thirdMessage:",f),f.type){case 1:y="chat","agoraToken"===this.grantType&&(y="singleChat"),this.delivery&&X.call(this,v,E,m);break;case 2:y="groupchat","agoraToken"===this.grantType&&(y="groupChat");break;case 3:y="chatroom","agoraToken"===this.grantType&&(y="chatRoom");break;case 4:y="read_ack";var T=void 0;return f.ext[0]&&JSON.parse(f.ext[0].stringValue)?(T={id:m,type:"read",from:v,to:E,mid:g,groupReadCount:f.ext[0]&&JSON.parse(f.ext[0].stringValue),ackContent:f.ackContent},this.onReadMessage&&this.onReadMessage(T),void(null===(n=this.eventHandler)||void 0===n||n.dispatch("onReadMessage",T))):(T={id:m,type:"read",from:v,to:E,mid:g},this.onReadMessage&&this.onReadMessage(T),void(null===(i=this.eventHandler)||void 0===i||i.dispatch("onReadMessage",T)));case 5:y="deliver_ack",this.onDeliveredMessage&&this.onDeliveredMessage({id:m,type:"delivery",from:v,to:E,mid:g});var _={id:m,type:"delivery",from:v,to:E,mid:g};return void(null===(s=this.eventHandler)||void 0===s||s.dispatch("onDeliveredMessage",_));case 6:y="recall";var I={id:m,from:v||"admin",to:E,mid:g};return this.onRecallMessage&&this.onRecallMessage(I),void(null===(a=this.eventHandler)||void 0===a||a.dispatch("onRecallMessage",I));case 7:this.onChannelMessage&&this.onChannelMessage({id:m,type:"channel",chatType:"singleChat",from:v,to:E,time:Number(d)});var N={id:m,type:"channel",chatType:"singleChat",from:v,to:E,time:Number(d)};return void(null===(u=this.eventHandler)||void 0===u||u.dispatch("onChannelMessage",N));default:return void U.error("unexpected message type: "+f.type)}h="chat"===y.toLowerCase()||"singleChat"===y?"singleChat":"groupchat"===y.toLowerCase()||"groupChat"===y?"groupChat":"chatRoom";for(var O=0;O<f.contents.length;O++){var R={},C={},S=t.errorCode>0,b=t.errorCode,A=t.reason,k=f.contents[O],w={},M=[],x=[],j=void 0;if(f.ext&&(w=K(f.ext)),f.meta&&"string"==typeof f.meta){var P=JSON.parse(f.meta);P.reaction&&(M=P.reaction).forEach((function(e){e.isAddedBySelf=e.state,delete e.state})),P.translations&&(x=P.translations)}switch(k.type){case 0:!(R={id:m,type:y,contentsType:V[k.type],from:v,to:E,data:k.text,ext:w,sourceMsg:k.text,time:d,msgConfig:f.msgConfig}).msgConfig&&delete f.msgConfig,R.error=S,R.errorText=A,R.errorCode=b,!r&&this.onTextMessage&&this.onTextMessage(R);var B={id:m,type:"txt",chatType:h,msg:k.text,to:E,from:v,ext:w,time:Number(d)};R.msgConfig&&(B.msgConfig=R.msgConfig),M.length>0&&(B.reactions=M),x.length>0&&(B.translations=x),C=B,!r&&this.eventHandler&&this.eventHandler.dispatch("onTextMessage",B);break;case 1:var L=(null===(c=null==k?void 0:k.size)||void 0===c?void 0:c.width)||0,D=(null===(p=null==k?void 0:k.size)||void 0===p?void 0:p.height)||0;j=this.useOwnUploadFun?k.remotePath:(k.remotePath&&this.apiUrl+k.remotePath.substr(k.remotePath.indexOf("/",9)))+"?em-redirect=true",k.secretKey&&!this.useOwnUploadFun&&(j=j+"&share-secret="+k.secretKey),!(R={id:m,type:y,contentsType:V[k.type],from:v,to:E,url:j,secret:k.secretKey,filename:k.displayName,thumb:k.thumbnailRemotePath,thumb_secret:k.thumbnailSecretKey,file_length:k.fileLength||"",width:L,height:D,filetype:k.filetype||"",accessToken:this.token,ext:w,time:d,msgConfig:f.msgConfig}).delay&&delete R.delay,!R.msgConfig&&delete f.msgConfig,R.error=S,R.errorText=A,R.errorCode=b,!r&&this.onPictureMessage&&this.onPictureMessage(R);var G={id:m,type:"img",chatType:h,from:v,to:E,url:j||"",file:{},width:L,height:D,secret:k.secretKey||"",thumb:k.thumbnailRemotePath||"",thumb_secret:k.thumbnailSecretKey||"",ext:w,time:Number(d)};R.msgConfig&&(G.msgConfig=R.msgConfig),M.length>0&&(G.reactions=M),C=G,!r&&this.eventHandler&&this.eventHandler.dispatch("onImageMessage",G);break;case 2:j=this.useOwnUploadFun?k.remotePath:(k.remotePath&&this.apiUrl+k.remotePath.substr(k.remotePath.indexOf("/",9)))+"?em-redirect=true",k.secretKey&&!this.useOwnUploadFun&&(j=j+"&share-secret="+k.secretKey),!(R={id:m,type:y,contentsType:V[k.type],from:v,to:E,url:j,secret:k.secretKey,filename:k.displayName,length:k.duration||"",file_length:k.fileLength||"",filetype:k.filetype||"",accessToken:this.token||"",ext:w,time:d,msgConfig:f.msgConfig}).delay&&delete R.delay,!R.msgConfig&&delete f.msgConfig,R.error=S,R.errorText=A,R.errorCode=b,!r&&this.onVideoMessage&&this.onVideoMessage(R);var F={id:m,type:"video",chatType:h,from:v,to:E,url:j,secret:k.secretKey,filename:k.displayName,length:k.duration||0,file:{},file_length:k.fileLength||0,filetype:k.filetype||"",accessToken:this.token||"",ext:w,time:Number(d)};R.msgConfig&&(F.msgConfig=R.msgConfig),M.length>0&&(F.reactions=M),C=F,!r&&this.eventHandler&&this.eventHandler.dispatch("onVideoMessage",F);break;case 3:!(R={id:m,type:y,contentsType:V[k.type],from:v,to:E,addr:k.address,buildingName:k.buildingName,lat:k.latitude,lng:k.longitude,ext:w,time:d,msgConfig:f.msgConfig}).delay&&delete R.delay,!R.msgConfig&&delete f.msgConfig,R.error=S,R.errorText=A,R.errorCode=b,!r&&this.onLocationMessage&&this.onLocationMessage(R);var W={id:m,type:"loc",chatType:h,from:v,to:E,buildingName:k.buildingName,addr:k.address,lat:k.latitude,lng:k.longitude,ext:w,time:Number(d)};R.msgConfig&&(W.msgConfig=R.msgConfig),M.length>0&&(W.reactions=M),C=W,!r&&this.eventHandler&&this.eventHandler.dispatch("onLocationMessage",W);break;case 4:j=this.useOwnUploadFun?k.remotePath:(k.remotePath&&this.apiUrl+k.remotePath.substr(k.remotePath.indexOf("/",9)))+"?em-redirect=true",k.secretKey&&!this.useOwnUploadFun&&(j=j+"&share-secret="+k.secretKey),!(R={id:m,type:y,contentsType:V[k.type],from:v,to:E,url:j,secret:k.secretKey,filename:k.displayName,file_length:k.fileLength||"",accessToken:this.token||"",ext:w,length:k.duration,time:d,msgConfig:f.msgConfig}).delay&&delete R.delay,!R.msgConfig&&delete f.msgConfig,R.error=S,R.errorText=A,R.errorCode=b,!r&&this.onAudioMessage&&this.onAudioMessage(R);var H={id:m,type:"audio",chatType:h,from:v,to:E,url:j,secret:k.secretKey,file:{},filename:k.displayName,length:k.duration||0,file_length:k.fileLength||0,filetype:k.filetype||"",accessToken:this.token||"",ext:w,time:Number(d)};R.msgConfig&&(H.msgConfig=R.msgConfig),M.length>0&&(H.reactions=M),C=H,!r&&this.eventHandler&&this.eventHandler.dispatch("onAudioMessage",H);break;case 5:j=this.useOwnUploadFun?k.remotePath:(k.remotePath&&this.apiUrl+k.remotePath.substr(k.remotePath.indexOf("/",9)))+"?em-redirect=true",k.secretKey&&!this.useOwnUploadFun&&(j=j+"&share-secret="+k.secretKey),!(R={id:m,type:y,contentsType:V[k.type],from:v,to:E,url:j,secret:k.secretKey,filename:k.displayName,file_length:k.fileLength,accessToken:this.token||"",ext:w,time:d,msgConfig:f.msgConfig}).delay&&delete R.delay,!R.msgConfig&&delete f.msgConfig,R.error=S,R.errorText=A,R.errorCode=b,!r&&this.onFileMessage&&this.onFileMessage(R);var q={id:m,type:"file",chatType:h,from:v,to:E,url:j,secret:k.secretKey,file:{},filename:k.displayName,length:k.duration||0,file_length:k.fileLength||0,filetype:k.filetype||"",accessToken:this.token||"",ext:w,time:Number(d)};R.msgConfig&&(q.msgConfig=R.msgConfig),M.length>0&&(q.reactions=M),C=q,!r&&this.eventHandler&&this.eventHandler.dispatch("onFileMessage",q);break;case 6:!(R={id:m,type:y,contentsType:V[k.type],from:v,to:E,action:k.action,ext:w,time:d,msgConfig:f.msgConfig}).msgConfig&&delete f.msgConfig,R.error=S,R.errorText=A,R.errorCode=b,!r&&this.onCmdMessage&&this.onCmdMessage(R);var z={id:m,type:"cmd",chatType:h,from:v,to:E,action:k.action,ext:w,time:Number(d)};R.msgConfig&&(z.msgConfig=R.msgConfig),M.length>0&&(z.reactions=M),C=z,!r&&this.eventHandler&&this.eventHandler.dispatch("onCmdMessage",z);break;case 7:var J={},Y={};f.contents[0].customExts&&(J=K(f.contents[0].customExts)),f.contents[0].params&&(Y=K(f.contents[0].params)),R={id:m,type:y,contentsType:V[k.type],from:v,to:E,customEvent:k.customEvent,params:Y,customExts:J,ext:w,time:d},!r&&this.onCustomMessage&&this.onCustomMessage(R);var $={id:m,type:"custom",chatType:h,from:v,to:E,customEvent:k.customEvent,params:Y,customExts:J,ext:w,time:Number(d)};R.msgConfig&&($.msgConfig=R.msgConfig),M.length>0&&($.reactions=M),C=$,!r&&this.eventHandler&&this.eventHandler.dispatch("onCustomMessage",$);break;default:U.error("Unknow message type, message:",k)}return o?C:R}},$=function(e){var t=this.root.lookup("easemob.pb.MUCBody").decode(e.payload),r=t.operation;(function(e){var r=this,o={type:"",owner:t.from.name,gid:t.mucId.name,from:t.from.name,fromJid:t.from,to:t.to.length?t.to[0].name:"",toJid:t.to,chatroom:t.isChatroom,status:t.status};return({32:function(){var e,n;o.type=t.isChatroom?"rmChatRoomMute":"rmGroupMute",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},31:function(){var e,n;o.type=t.isChatroom?"muteChatRoom":"muteGroup",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},30:function(){var e,n;o.type=t.isChatroom?"rmUserFromChatRoomWhiteList":"rmUserFromGroupWhiteList",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},29:function(){var e,n;o.type=t.isChatroom?"addUserToChatRoomWhiteList":"addUserToGroupWhiteList",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},28:function(){var e,n;o.type="deleteFile",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},27:function(){var e,n;o.type="uploadFile",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},26:function(){var e,n;o.type="deleteAnnouncement",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},25:function(){var e,n;o.type="updateAnnouncement",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},24:function(){var e,n;o.type="removeMute",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},23:function(){var e,n;o.type="addMute",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},22:function(){var e,n;o.type="removeAdmin",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},21:function(){var e,n;o.type="addAdmin",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},20:function(){var e,n;o.type="changeOwner",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},19:function(){var e,n;o.type="direct_joined",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},18:function(){var e,n;o.type=t.isChatroom?"leaveChatRoom":"leaveGroup",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},17:function(){var e,n;o.type=t.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},16:function(){var e,n;o.type="unblock",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},15:function(){var e,n;o.type="block",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},14:function(){var e,n;o.type="update",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},13:function(){var e,n;o.type="allow",o.reason=t.reason,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},12:function(){var e,n;o.type="ban",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},11:function(){var e,n;o.type="getBlackList",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},10:function(){var e,n;o.type="removedFromGroup",o.kicked=o.to,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},9:function(){var e,n;o.type="invite_decline",o.kicked=o.to,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},8:function(){var e,n;o.type="invite_accept",o.kicked=o.to,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},7:function(){var e,n;o.type="invite",o.kicked=o.to,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},6:function(){var e,n;o.type="joinPublicGroupDeclined",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},5:function(){var e,n;o.type="joinPublicGroupSuccess",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},4:function(){var e,n;o.type="joinGroupNotifications",o.reason=t.reason,r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},3:function(){var e,n;o.type="leave",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},2:function(){var e,n;o.type="join",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)},1:function(){var e,n;o.type="deleteGroupChat",r.onPresence&&r.onPresence(o),t.isChatroom?null===(e=r.eventHandler)||void 0===e||e.dispatch("onChatroomChange",o):null===(n=r.eventHandler)||void 0===n||n.dispatch("onGroupChange",o)}}[e]||function(){console.error("No match operation "+e)})()}).call(this,r)};var Z;!function(e){e[e.Add=2]="Add",e[e.Remove=3]="Remove",e[e.Accept=4]="Accept",e[e.Decline=5]="Decline",e[e.Ban=6]="Ban",e[e.Allow=7]="Allow"}(Z||(Z={}));const Q={operatRoster:function(e,t){var r=[],o=this.root.lookup("easemob.pb.RosterBody"),n=o.decode(r);switch(t){case"add":n.operation=Z.Add;break;case"remove":n.operation=Z.Remove;break;case"accept":n.operation=Z.Accept;break;case"decline":n.operation=Z.Decline;break;case"ban":n.operation=Z.Ban;break;case"allow":n.operation=Z.Allow;break;default:U.error("operatRoster:",t)}n.from=this.context.jid;var i=[];if("string"==typeof e.to)i.push({appKey:this.appKey||this.context.appKey,name:e.to,domain:"easemob.com"});else if(e.to instanceof Array)for(var s=0;s<e.to.length;s++)i.push({appKey:this.appKey,name:e.to[s],domain:"easemob.com"});n.to=i,n.reason=e.message||"",n=o.encode(n).finish();var a=this.root.lookup("easemob.pb.Meta").decode(r);a.id=e.id||this.getUniqueId(),a.from=this.context.jid,a.to={domain:"@easemob.com"},a.ns=3,a.payload=n;var u=this.root.lookup("easemob.pb.CommSyncUL"),c=u.decode(r);c.meta=a,c=u.encode(c).finish();var p=this.root.lookup("easemob.pb.MSync"),l=p.decode(r);l.version=this.version,l.encryptType=[0],l.command=0,l.guid=this.jid,l.payload=c,l=p.encode(l).finish();var h=this.mSync.base64transform(l);this.sock.send(h)},handleRosterMsg:function(e){var t,r,o,n,i,s,a=this.root.lookup("easemob.pb.RosterBody").decode(e.payload),u={type:"",to:a.to[0].name,from:a.from.name,status:a.reason};switch(a.operation){case 2:u.type="subscribe",this.onContactInvited&&this.onContactInvited(u),null===(t=this.eventHandler)||void 0===t||t.dispatch("onContactInvited",u);break;case 3:u.type="unsubscribed",this.onContactDeleted&&this.onContactDeleted(u),null===(r=this.eventHandler)||void 0===r||r.dispatch("onContactDeleted",u);break;case 4:u.type="subscribed",this.onContactAdded&&this.onContactAdded(u),null===(o=this.eventHandler)||void 0===o||o.dispatch("onContactAdded",u);break;case 5:u.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(u),null===(n=this.eventHandler)||void 0===n||n.dispatch("onContactRefuse",u);break;case 6:case 7:this.getBlacklist();break;case 8:u.type="subscribed",this.onContactAgreed&&this.onContactAgreed(u),null===(i=this.eventHandler)||void 0===i||i.dispatch("onContactAgreed",u);break;case 9:u.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(u),null===(s=this.eventHandler)||void 0===s||s.dispatch("onContactRefuse",u);break;default:U.error("handleRosterMsg:",a)}this.onPresence&&u.type&&this.onPresence(u)}},ee=function(e){var t,r,o,n,i,s,a=this.root.lookup("easemob.pb.StatisticsBody").decode(e.payload);switch(a.operation){case 0:this.onStatisticMessage&&this.onStatisticMessage(a),null===(t=this.eventHandler)||void 0===t||t.dispatch("onStatisticMessage",a);break;case 1:s=h.create({type:f.WEBIM_CONNCTION_USER_REMOVED,message:"user has been removed"}),this.logOut=!0,this.onError&&this.onError(s),null===(r=this.eventHandler)||void 0===r||r.dispatch("onError",s);break;case 2:s=h.create({type:f.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE,message:"the user is already logged on another device"}),this.logOut=!0,this.onError&&this.onError(s),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",s);break;case 3:s=h.create({type:f.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD,message:"the user was kicked by changing password"}),this.logOut=!0,this.onError&&this.onError(s),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",s);break;case 4:s=h.create({type:f.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE,message:"the user was kicked by other device"}),this.logOut=!0,this.onError&&this.onError(s),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",s);break;default:U.error("handleStatisticsMsg:",a)}};function te(e){var t,r=[],o=[];e.data&&e.data.values&&e.data.values.forEach((function(e){Object.entries(e.status).forEach((function(e){o.push({device:e[0],status:Number(e[1])})})),r.push({userId:e.uid,lastTime:Number(e.last_time),expire:Number(e.expiry),ext:e.ext,statusDetails:o})})),this.onPresenceStatusChange&&this.onPresenceStatusChange(r),null===(t=this.eventHandler)||void 0===t||t.dispatch("onPresenceStatusChange",r)}function re(e,t){var r=this,o=t.from,n=t.to;e.data.forEach((function(e){var t,i={from:o,to:n,chatType:"chat"===e.channel_type?"singleChat":"groupChat",messageId:e.messageId,reactions:e.reactions};null===(t=r.eventHandler)||void 0===t||t.dispatch("onReactionUpdate",i)}))}const oe=function(e){var t=_.parseNotify(e.payload),r=e.from.name,o=e.to.name;switch(t.type){case"presence":te.call(this,t);break;case"reaction":re.call(this,t,{from:r,to:o});break;default:U.error("unexpected notify type: "+t.type)}};var ne=function(){return ne=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ne.apply(this,arguments)};function ie(){var e="webim",t="",r="",o=[],n=(new Date).valueOf();"webim"===this.deviceId?(r="random_"+n.toString(),e=this.deviceId+"_"+r,t=this.deviceId):e=t=r="webim_"+this.deviceId,this.context.jid&&(this.context.jid.clientResource=e);var i=this.root.lookup("easemob.pb.Provision"),s=i.decode(o);s.compressType=this.compressType,s.encryptType=this.encryptType,s.osType=this.osType,s.version=this.version,s.deviceName=t,s.resource=e,s.deviceUuid=r,s.auth="$t$"+this.token,s.actionVersion="v1.0",s=i.encode(s).finish();var a=this.root.lookup("easemob.pb.MSync"),u=a.decode(o);return u.version=this.version,u.guid=this.context.jid,u.auth="$t$"+this.token,u.command=3,u.deviceId=t,u.encryptType=this.encryptType,u.payload=s,a.encode(u).finish()}function se(e,t){var r=this,o=_.getEnvInfo();if("web"===o.platform||"zfb"===o.platform||"dd"===o.platform){for(var n="",i=0;i<e.length;i++)n+=String.fromCharCode(e[i]);return n=N().btoa(n),"web"===o.platform?n:{data:n,isBuffer:!1,complete:function(){},fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||(U.debug("发送失败重联"),r.reconnect()),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}var s=e;return{data:s.buffer.slice(s.byteOffset,s.byteOffset+s.byteLength),fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||r.reconnect(),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}function ae(e,t){switch(e.ns){case 0:ee.call(this,e);break;case 1:Y.call(this,e,t);break;case 2:$.call(this,e);break;case 3:Q.handleRosterMsg.call(this,e);break;case 4:this.registerConfrIQHandler&&this.registerConfrIQHandler(e,t,this);break;case 5:oe.call(this,e);break;default:U.error("distributeMeta",e)}}function ue(e,t){for(var r=function(r){var n=new(l())(e[r].id.low,e[r].id.high,e[r].id.unsigned).toString();if(o._load_msg_cache.some((function(e){return e.msgId===n})))return"continue";var i=e[r].from.name,s=e[r].to?e[r].to.name:"",a=!!e[r].to&&-1!==e[r].to.domain.indexOf("conference");o._load_msg_cache.length<=qo.max_cache_length||o._load_msg_cache.shift(),o._load_msg_cache.push({msgId:n,from:i,to:s,isGroup:a}),ae.call(o,e[r],t)},o=this,n=0;n<e.length;n++)r(n)}function ce(e){var t=this.root.lookup("easemob.pb.CommUnreadDL");if(t=t.decode(e.payload),"agoraToken"===this.grantType){var r=new(l())(t.timestamp.low,t.timestamp.high,t.timestamp.unsigned).toString();this.compareTokenExpireTime(Number(r),this.expirationTime)}if(0===t.unread.length)ye.call(this);else for(var o=0;o<t.unread.length;o++)he.call(this,t.unread[o].queue)}function pe(){var e=[],t=this.root.lookup("easemob.pb.StatisticsBody"),r=t.decode(e);r.operation=0,r=t.encode(r).finish();var o=this.root.lookup("easemob.pb.Meta").decode(e);o.id=(new Date).valueOf(),o.ns=0,o.payload=r;var n=this.root.lookup("easemob.pb.CommSyncUL"),i=n.decode(e);i.meta=o,i=n.encode(i).finish();var s=this.root.lookup("easemob.pb.MSync"),a=s.decode(e);return a.version=this.version,a.encryptType=[0],a.command=0,a.payload=i,s.encode(a).finish()}function le(e){var t=[],r=this.root.lookup("easemob.pb.CommSyncUL"),o=r.decode(t);o.queue=e,o=r.encode(o).finish();var n=this.root.lookup("easemob.pb.MSync"),i=n.decode(t);return i.version=this.version,i.encryptType=this.encryptType,i.command=0,i.payload=o,n.encode(i).finish()}function he(e){U.debug("sendBackqueue");var t=le.call(this,e);we.call(this,t)}function de(e,t){var r=[],o=this.root.lookup("easemob.pb.CommSyncUL"),n=o.decode(r);n.queue=t,n.key=new(l())(e.low,e.high,e.unsigned).toString(),n=o.encode(n).finish();var i=this.root.lookup("easemob.pb.MSync"),s=i.decode(r);return s.version=this.version,s.encryptType=this.encryptType,s.command=0,s.payload=n,i.encode(s).finish()}function fe(e,t){U.debug("sendLastSession");var r=de.call(this,e,t);we.call(this,r)}function me(e){var t,r=this.root.lookup("easemob.pb.Provision").decode(e.payload);if(this.context.jid&&(this.context.jid.clientResource=r.resource),this.clientResource=r.resource,0===r.status.errorCode){if(this.onOpened&&this.onOpened(),null===(t=this.eventHandler)||void 0===t||t.dispatch("onConnected"),"agoraToken"===this.grantType){var o=Date.now();this.expiresIn=this.expirationTime-o,this.tokenExpireTimeCountDown(this.expiresIn)}ge.call(this),Ee.call(this),ve.call(this),ye.call(this)}else this.onError&&this.onError({type:f.WEBIM_CONNECTION_ERROR,message:"provision error",data:r})}function ge(){if(this.unSendMsgArr.length>0){for(var e=0;e<this.unSendMsgArr.length;e++){var t=this.unSendMsgArr[e];ke.call(this,t)}this.unSendMsgArr=[]}}function ye(){var e=pe.call(this);we.call(this,e)}function ve(){var e=_e.call(this);we.call(this,e)}function Ee(){var e=this;Te.call(this),this.heartBeatID=setInterval((function(){ve.call(e)}),this.heartBeatWait)}function Te(){clearInterval(this.heartBeatID)}function _e(){var e=this.root.lookup("easemob.pb.MSync"),t=e.decode([]);return t.version=this.version,t.encryptType=this.encryptType,t.command=1,e.encode(t).finish()}function Ie(e,t){return e.some((function(e){return e.name===t.name}))}function Ne(e){var t=this,r=this.root.lookup("easemob.pb.CommNotice").decode(e.payload);Ie(this._queues,r.queue)||this.clientResource===r.queue.clientResource&&r.queue.name===this.context.userId||(this._queues.push(r.queue),this.qTimer&&clearTimeout(this.qTimer),this.qTimer=setTimeout((function(){var e=r.queue;Ie(t._queues,e)&&(he.call(t,r.queue),U.debug("⬇q:",e))}),1e4),1===this._queues.length&&he.call(this,r.queue))}function Oe(e){var t=_.getEnvInfo();if("web"===t.platform||"zfb"===t.platform||"dd"===t.platform){for(var r=N().atob(e.data),o=[],n=0,i=r.length;n<i;++n)o.push(r.charCodeAt(n));return this.root.lookup("easemob.pb.MSync").decode(o)}return this.root.lookup("easemob.pb.MSync").decode(e.data)}function Re(e){switch(e.command){case 0:Ce.call(this,e);break;case 1:ce.call(this,e);break;case 2:Ne.call(this,e);break;case 3:me.call(this,e)}}function Ce(e){var t,r,o,n,i=this.root.lookup("easemob.pb.CommSyncDL");i=i.decode(e.payload);var s=new(l())(i.serverId.low,i.serverId.high,i.serverId.unsigned).toString(),a=new(l())(i.metaId.low,i.metaId.high,i.metaId.unsigned).toString();if(0!==i.metas.length)try{ue.call(this,i.metas,i.status)}catch(e){this.onError&&this.onError({type:f.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e})}finally{if(i.isLast){var u=-1;this._queues.some((function(e,t){return e.name===i.name&&(u=t,!0)}))&&u>0&&this._queues.splice(u,1),this._queues.length>0&&(he.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer))}else fe.call(this,i.nextKey,i.queue)}else if(i.isLast){var c=-1;this._queues.some((function(e,t){return e.name===i.queue.name&&(c=t,!0)}))&&this._queues.splice(c,1),this._queues.length>0&&(he.call(this,this._queues[0]),this.qTimer&&clearTimeout(this.qTimer))}else if(i.status&&0===i.status.errorCode){if(this._msgHash[a]){try{(null===(t=this._msgHash[a])||void 0===t?void 0:t.resolve)instanceof Function&&this._msgHash[a].resolve({localMsgId:a,serverMsgId:s}),(null===(r=this._msgHash[a])||void 0===r?void 0:r.success)instanceof Function&&this._msgHash[a].success(a,s)}catch(e){this.onError&&this.onError({type:f.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e})}this.onReceivedMessage&&this.onReceivedMessage({id:a,mid:s,to:this._msgHash[a].to,time:0}),null===(o=this.eventHandler)||void 0===o||o.dispatch("onReceivedMessage",{id:a,mid:s,to:this._msgHash[a].to}),delete this._msgHash[a]}}else if(i.status&&15===i.status.errorCode)this.onMutedMessage&&this.onMutedMessage({mid:s}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject({type:f.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"});else if(i.status&&1===i.status.errorCode){var p=void 0;switch(i.status.reason){case"blocked":p=f.PERMISSION_DENIED;break;case"group not found":p=f.GROUP_NOT_EXIST;break;case"not in group or chatroom":p=f.GROUP_NOT_JOINED;break;case"exceed recall time limit":p=f.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":p=f.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":p=f.SERVICE_NOT_ALLOW_MESSAGING;break;case"nonroster":p=f.USER_NOT_FRIEND,i.status.reason="not contact";break;default:p=f.SERVER_UNKNOWN_ERROR}if(this._msgHash[a]){var d=h.create({type:p,message:i.status.reason||"",data:{id:a,mid:s}});this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(d),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:p,reason:i.status.reason?i.status.reason:"",data:{id:a,mid:s}})}}else if(i.status&&7===i.status.errorCode)"sensitive words"===i.status.reason&&this._msgHash[a]?(d=h.create({type:f.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(d),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:f.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:a,mid:s,reason:"sensitive words"}})):"blocked by mod_antispam"===i.status.reason&&this._msgHash[a]?(d=h.create({type:f.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(d),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:f.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:a,mid:s,reason:"blocked by mod_antispam"}})):"user is mute"===i.status.reason&&this._msgHash[a]&&(d=h.create({type:f.USER_MUTED_BY_ADMIN,message:"user is mute",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(d),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail(d));else if(i.status&&19===i.status.errorCode)this._msgHash[a]&&(d=h.create({type:f.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:i.status.reason||"",data:{id:a,mid:s}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(d),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:f.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:a,mid:s,reason:i.status.reason}}));else if(this._msgHash[a]){try{d=h.create({type:f.WEBIM_LOAD_MSG_ERROR,message:(null===(n=i.status)||void 0===n?void 0:n.reason)||"",data:{id:a,mid:s,reason:i.status&&i.status.reason}}),this._msgHash[a].reject instanceof Function&&this._msgHash[a].reject(d),this._msgHash[a].fail instanceof Function&&this._msgHash[a].fail({type:f.WEBIM_LOAD_MSG_ERROR,data:{errorCode:i.status&&i.status.errorCode,reason:i.status&&i.status.reason}})}catch(e){this.onError&&this.onError({type:f.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e})}delete this._msgHash[a]}else this.onError&&this.onError({type:f.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"on message error"})}function Se(e){var t=[],r=this.root.lookup("easemob.pb.KeyValue"),o=[];for(var n in e){var i=r.decode(t);i.key=n,"object"==typeof e[n]?(i.type=8,i.stringValue=JSON.stringify(e[n])):"string"==typeof e[n]?(i.type=7,i.stringValue=e[n]):"boolean"==typeof e[n]?(i.type=1,i.varintValue=!0===e[n]?1:0):Number.isInteger(e[n])?(i.type=2,i.varintValue=e[n]):(i.type=6,i.doubleValue=e[n]),o.push(i)}return o}function be(e){var t,r,o=[];if(this.root){var n,i=this.root.lookup("easemob.pb.MessageBody.Content").decode(o);switch(n=!e.group&&"groupchat"!==(null===(t=null==e?void 0:e.chatType)||void 0===t?void 0:t.toLowerCase())||e.roomType?e.group&&e.roomType||"chatroom"===(null===(r=null==e?void 0:e.chatType)||void 0===r?void 0:r.toLowerCase())?"chatRoom":"singleChat":"groupChat",e.type){case"txt":i.type=0,i.text=e.msg;break;case"img":i.type=1,e.body?(i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.size=e.body.size,i.thumbnailDisplayName=e.body.filename):e.file?(i.displayName=e.file.filename,i.remotePath=e.file.url,i.secretKey=e.file.secret,i.fileLength=e.file.file_length,i.size=e.file.size,i.thumbnailDisplayName=e.file.filename):(i.displayName=e.filename,i.remotePath=e.url,i.secretKey=e.secret,i.fileLength=e.file_length,i.size=e.size,i.thumbnailDisplayName=e.filename);break;case"video":i.type=2,i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.duration=e.body.length,i.thumbnailDisplayName=e.body.filename;break;case"loc":i.type=3,i.latitude=e.lat,i.longitude=e.lng,i.address=e.addr,i.buildingName=e.buildingName,i.latitude=e.lat;break;case"audio":i.type=4,i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.duration=e.body.length,i.thumbnailDisplayName=e.body.filename;break;case"file":i.type=5,i.displayName=e.body.filename,i.remotePath=e.body.url,i.secretKey=e.body.secret,i.fileLength=e.body.file_length,i.size=e.body.size,i.thumbnailDisplayName=e.body.filename;break;case"cmd":i.type=6,i.action=e.action;break;case"custom":i.type=7,i.customEvent=e.customEvent,i.customExts=Se.call(this,e.customExts)}var s=[];e.ext&&(s=Se.call(this,e.ext));var a=this.root.lookup("easemob.pb.MessageBody"),u=a.decode(o);u.from={name:this.context.jid.name},u.to={name:e.to},"channel"===e.type?u.type=7:"recall"===e.type?(u.type=6,u.ackMessageId=e.ackId):"delivery"===e.type?(u.type=5,u.ackMessageId=e.ackId):"read"===e.type?(u.type=4,u.ackMessageId=e.ackId,"groupChat"===n&&(u.msgConfig={allowGroupAck:!0},u.ackContent=e.ackContent)):"chatRoom"===n?u.type=3:"groupChat"===n?(u.type=2,e.msgConfig&&(u.msgConfig={allowGroupAck:!0})):"singleChat"===n&&(u.type=1),u.contents=[i],u.ext=s;var c=function(e){var t={};return"translations"in e&&(t.translations=e.translations),Object.keys(t).length>0?JSON.stringify(t):""}(e);c&&(u.meta=c),u=a.encode(u).finish();var p=this.root.lookup("easemob.pb.Meta").decode(o);p.id=e.id;var l="easemob.com";"chatRoom"!==n&&"groupChat"!==n||(l="conference.easemob.com"),p.from=this.context.jid,p.to={appKey:this.appKey,name:e.to,domain:l},p.ns=1,p.payload=u;var h=this.root.lookup("easemob.pb.CommSyncUL"),d=h.decode(o);d.meta=p,d=h.encode(d).finish();var m=this.root.lookup("easemob.pb.MSync"),g=m.decode(o);return g.version=this.version,g.encryptType=this.encryptType,g.command=0,g.guid=this.context.jid,g.payload=d,m.encode(g).finish()}e.fail&&e.fail({type:f.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function Ae(e){var t=this;if(!e.file)return e;var r=ne({},e);return r.accessToken=this.token,r.appKey=this.appKey,r.apiUrl=this.apiUrl,r.body&&r.body.url?be.call(this,r):new Promise((function(o,n){var i=r.onFileUploadComplete;r.onFileUploadComplete=function(o){var n;if(o.entities[0]["file-metadata"]){var s=o.entities[0]["file-metadata"]["content-length"];r.file_length=s,r.filetype=o.entities[0]["file-metadata"]["content-type"],s>204800&&(r.thumbnail=!0)}r.body={type:r.type||"file",secret:o.entities[0]["share-secret"],filename:r.file.filename||r.filename,url:(t.isHttpDNS?t.apiUrl+o.uri.substr(o.uri.indexOf("/",9)):o.uri)+"/"+o.entities[0].uuid,length:r.length||0,filetype:r.filetype||r.file.filetype,file_length:(null===(n=null==r?void 0:r.ext)||void 0===n?void 0:n.file_length)||0,size:{width:r.width||0,height:r.height||0}},r.file.url=o.uri,e.secret=o.entities[0]["share-secret"],e.url=(t.isHttpDNS?t.apiUrl+o.uri.substr(o.uri.indexOf("/",9)):o.uri)+"/"+o.entities[0].uuid,i instanceof Function&&i(o,r.id);var a=be.call(t,r);we.call(t,a)},_.uploadFile.call(t,r)}))}function ke(e){var t=this;return new Promise((function(r,o){var n,i;if(t.logOut)return o({type:f.WEBIM_CONNECTION_CLOSED,message:"not login"});if(e.id&&(t._msgHash[e.id]=ne(ne({},e),{resolve:r,reject:o})),("file"===e.type||"img"===e.type||"audio"===e.type||"video"===e.type)&&e.file)return Ae.call(t,e);if("txt"===e.type&&(null===(n=e.msgConfig)||void 0===n?void 0:n.languages)&&Array.isArray(null===(i=e.msgConfig)||void 0===i?void 0:i.languages)&&e.msgConfig.languages.length>0)t.translateMessage({text:e.msg,languages:e.msgConfig.languages}).then((function(r){var o;console.log("res --",r);var n=null===(o=r.data[0])||void 0===o?void 0:o.translations;n=n.map((function(e){return{code:e.to,text:e.text}})),e.translations=n;var i=be.call(t,e);we.call(t,i,e.id)})).catch((function(e){o(e)}));else{var s=be.call(t,e);we.call(t,s,e.id)}}))}function we(e,t){if(!this.isOpened())return this.unSendMsgArr.push(e),!this.logOut&&this.autoReconnectNumTotal<this.autoReconnectNumMax&&(this.autoReconnectNumTotal<=this.socketHost.length&&this.isHttpDNS||!this.isHttpDNS)&&(U.debug("need to reconnect",this.autoReconnectNumTotal,this.autoReconnectNumMax),this.offLineSendConnecting=!0,this.reconnect()),void(this.onError&&this.onError({type:f.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}));var r=se.call(this,e,t);this.sock.send(r)}const Me=function(e,t){return e.send=ke,e.sendMsg=ke,{generateProvision:ie.bind(e),base64transform:se.bind(e),distributeMeta:ae.bind(e),decodeMeta:ue.bind(e),decodeUnreadDL:ce.bind(e),_rebuild:pe.bind(e),_lastsession:de.bind(e),receiveProvision:me.bind(e),isInQueue:Ie.bind(e),decodeNotice:Ne.bind(e),decodeMSync:Oe.bind(e),distributeMSync:Re.bind(e),encodeChatMsg:be.bind(e),upLoadFile:Ae.bind(e),send:ke.bind(e),stopHeartBeat:Te.bind(e)}};var xe=function(){function e(e,t,r){this.handlerData={},this.handlerData={},e.addEventHandler=this.addEventHandler.bind(this),e.removeEventHandler=this.removeEventHandler.bind(this)}return e.prototype.addEventHandler=function(e,t){this.handlerData[e]=t},e.prototype.removeEventHandler=function(e){delete this.handlerData[e]},e.prototype.dispatch=function(e,t){for(var r in U.debug("dispatch event: "+e,t||""),this.handlerData){var o=this.handlerData[r][e];o&&o(t)}},e}();const Ue=xe;var je=function(){};function Pe(e){this.onOpened=e.onOpened||je,this.onPresence=e.onPresence||je,this.onTextMessage=e.onTextMessage||je,this.onPictureMessage=e.onPictureMessage||je,this.onAudioMessage=e.onAudioMessage||je,this.onVideoMessage=e.onVideoMessage||je,this.onFileMessage=e.onFileMessage||je,this.onLocationMessage=e.onLocationMessage||je,this.onCmdMessage=e.onCmdMessage||je,this.onCustomMessage=e.onCustomMessage||je,this.onReceivedMessage=e.onReceivedMessage||je,this.onDeliveredMessage=e.onDeliveredMessage||je,this.onReadMessage=e.onReadMessage||je,this.onRecallMessage=e.onRecallMessage||je,this.onMutedMessage=e.onMutedMessage||je,this.onChannelMessage=e.onChannelMessage||je,this.onError=e.onError||je,this.onOffline=e.onOffline||je,this.onOnline=e.onOnline||je,this.onRoster=e.onRoster||je,this.onStatisticMessage=e.onStatisticMessage||je,this.onCreateGroup=e.onCreateGroup||je,this.onBlacklistUpdate=e.onBlacklistUpdate||je,this.onContactInvited=e.onContactInvited||je,this.onContactAgreed=e.onContactAgreed||je,this.onContactRefuse=e.onContactRefuse||je,this.onContactDeleted=e.onContactDeleted||je,this.onContactAdded=e.onContactAdded||je,this.onTokenWillExpire=e.onTokenWillExpire||je,this.onTokenExpired=e.onTokenExpired||je,this.onClosed=e.onClosed||je,this.onPresenceStatusChange=e.onPresenceStatusChange||je}function Be(){var e=this.context.appName,t=this.context.orgName;return!(!e||!t)||(this.onError&&this.onError({type:f.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function Le(){var e;if(!this.context.accessToken){var t=h.create({type:f.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return this.onError&&this.onError(t),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",t),!1}return!0}function De(){return Le.call(this)&&Be.call(this)}var Ge=function(){return Ge=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ge.apply(this,arguments)},Fe=function(e,t,r,o){return new(r||(r=Promise))((function(n,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function a(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((o=o.apply(e,t||[])).next())}))},We=function(e,t){var r,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(i){return function(a){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,o&&(n=2&i[0]?o.return:i[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,i[1])).done)return n;switch(o=0,n&&(i=[2&i[0],n.value]),i[0]){case 0:case 1:n=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!((n=(n=s.trys).length>0&&n[n.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!n||i[1]>n[0]&&i[1]<n[3])){s.label=i[1];break}if(6===i[0]&&s.label<n[1]){s.label=n[1],n=i;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(i);break}n[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],o=0}finally{r=n=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,a])}}};function He(e){var t=this;if(!De.call(this)){var r=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},success:function(r){var o={};r.data.forEach((function(e){o[e]={name:e}})),t.onBlacklistUpdate&&t.onBlacklistUpdate(o),"function"==typeof(null==e?void 0:e.success)&&e.success(r)},error:function(r){t.onBlacklistUpdate&&t.onBlacklistUpdate({}),"function"==typeof(null==e?void 0:e.error)&&e.error(r)}};return U.debug("Call getBlacklist"),_.ajax(a)}function qe(e){var t=this;if(!De.call(this)){var r=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+s},success:function(r){var o=[];r.data.forEach((function(e){o.push({name:e,subscription:"both",jid:t.context.jid})})),"function"==typeof(null==e?void 0:e.success)&&e.success(o),t.onRoster&&t.onRoster(o)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return U.debug("Call getContacts"),_.ajax(a)}var ze=qe;function Je(e){if("string"!=typeof e.deviceId||""===e.deviceId)throw Error('Invalid parameter: "deviceId"');if("string"!=typeof e.deviceToken||""===e.deviceToken)throw Error('Invalid parameter: "deviceToken"');if("string"!=typeof e.notifierName||""===e.notifierName)throw Error('Invalid parameter: "notifierName"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user,type:"PUT",data:JSON.stringify({device_id:e.deviceId,device_token:e.deviceToken,notifier_name:e.notifierName}),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call uploadPushToken",e),_.ajax(s)}var Ve=Je;function Ke(e){if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/user_channels",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return U.debug("Call getSessionList"),_.ajax(s)}function Xe(e){if(e&&"string"!=typeof e.channel)throw Error("Invalid parameter channel: "+e.channel);if(e&&"singleChat"!==e.chatType&&"groupChat"!==e.chatType)throw Error("Invalid parameter chatType: "+e.chatType);if(e&&"boolean"!=typeof e.deleteRoam)throw Error("Invalid parameter deleteRoam: "+e.deleteRoam);if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r,o=this.context,n=o.orgName,i=o.appName,s=o.accessToken;r="singleChat"===e.chatType?"chat":"groupChat";var a={url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user+"/user_channel",dataType:"json",type:"DELETE",data:JSON.stringify({channel:e.channel,type:r,delete_roam:e.deleteRoam}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call deleteSession",e),_.ajax(a)}function Ye(e,t){if(!De.call(this)){var r=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a=["nickname","avatarurl","mail","phone","gender","sign","birth","ext"],u={};if("undefined"!=typeof wx||"undefined"!=typeof qq)if("string"==typeof e&&void 0!==t){if(!a.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");u[e]=t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");a.forEach((function(t){a.includes(t)&&void 0!==e[t]&&(u[t]=e[t])}))}else if("string"==typeof e){if(!a.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");u=e+"="+t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");var c=[];a.forEach((function(t){if(a.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),o=encodeURIComponent(e[t]);c.push(r+"="+o)}})),u=c.join("&")}var p={url:this.apiUrl+"/"+n+"/"+i+"/metadata/user/"+this.user,type:"PUT",data:u,dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/x-www-form-urlencoded"}};return U.debug("Call updateOwnUserInfo",e),_.ajax(p)}function $e(e,t){if(!De.call(this)){var r=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o,n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u=[];if("string"==typeof e)u=[e];else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error("illegal params");u=e}o="string"==typeof t?[t]:"[object Array]"===Object.prototype.toString.call(t)?t:["nickname","avatarurl","mail","phone","gender","sign","birth","ext"];var c={url:this.apiUrl+"/"+i+"/"+s+"/metadata/user/get",type:"POST",data:JSON.stringify({targets:u,properties:o}),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return U.debug("Call fetchUserInfoById",e),_.ajax(c)}function Ze(e){if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user,type:"PUT",dataType:"json",data:JSON.stringify({nickname:e}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return U.debug("Call updateCurrentUserNick",e),_.ajax(s)}function Qe(e){if("string"!=typeof e||""===e)throw Error('Invalid parameter: "agoraToken"');var t=this.context,r=t.orgName,o=t.appName,n={url:this.apiUrl+"/"+r+"/"+o+"/token",dataType:"json",type:"POST",data:JSON.stringify({grant_type:"agora"}),headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return U.debug("Call getChatToken",e),_.ajax(n)}function et(e){var t=this;return new Promise((function(r,o){if(!e.queue)throw Error('Invalid parameter: "specified"');if(!De.call(t)){var n=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(n)}(function e(t){var n=this,i=t.count||20;rt.call(this,{count:i,isGroup:!!t.isGroup,queue:t.queue,start:t.start,format:t.format,success:function(o){if(o.msgs.length>=i||o.is_last){var s=o.msgs.splice(0,i).reverse();t.success&&t.success(s),r(s)}else e.call(n,Ge(Ge({},t),{start:null}))},fail:function(e){o(e),t.fail&&t.fail(e)}})}).call(t,e),U.debug("Call fetchHistoryMessages",e)}))}function rt(e){var t=this,r=e.queue,o=this.mr_cache[r]||(this.mr_cache[r]={msgs:[]}),n=this.context.userId,i=e.start||-1,s=e.count||20;if(o.msgs.length>=s||o.is_last)"function"==typeof e.success&&e.success(o);else{o&&o.next_key&&(i=o.next_key),e.start&&(i=e.start);var a={queue:r+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:i,end:-1},u=this.context,c=u.orgName,p=u.appName,l=function(r){if(r.error&&r.error_description){var o=h.create({type:f.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:"fetch history messages error",data:r});t.onError&&t.onError(o)}"function"==typeof e.fail&&e.fail(l)},d={url:this.apiUrl+"/"+c+"/"+p+"/users/"+n+"/messageroaming",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(a),success:function(r){var n=null==r?void 0:r.data;if(!r.data.msgs)return"function"==typeof e.success&&e.success(o),o.is_last=!0,void(o.next_key="");var i=n.msgs,s=i.length;o.is_last=n.is_last,o.next_key=n.next_key;for(var a=function(r){for(var o=[],n=0,i=(r=N().atob(r)).length;n<i;++n)o.push(r.charCodeAt(n));var s=t.context.root.lookup("easemob.pb.Meta");if(1===(s=s.decode(o)).ns)return Y.call(t,s,{errorCode:0,reason:""},!0,e.format)},u=0;u<s;u++){var c=a(i[u].msg);c&&o.msgs.push(c)}"function"==typeof e.success&&e.success(o)},error:l};_.ajax(d)}}function ot(e,t){var r={id:this.getUniqueId(),to:e,message:t};Q.operatRoster.call(this,r,"add"),U.debug("Call addContact",r)}function nt(e){var t={id:this.getUniqueId(),to:e};Q.operatRoster.call(this,t,"remove"),U.debug("Call deleteContact",t)}function it(e){var t={id:this.getUniqueId(),to:e};Q.operatRoster.call(this,t,"accept"),U.debug("Call acceptInvitation",t)}var st=it;function at(e){var t={id:this.getUniqueId(),to:e};Q.operatRoster.call(this,t,"decline"),U.debug("Call declineContactInvite",t)}var ut=at;function ct(e){Q.operatRoster.call(this,{to:e.name},"ban"),U.debug("Call addUsersToBlacklist",e)}var pt=ct;function lt(e){Q.operatRoster.call(this,{to:e.name},"allow"),U.debug("Call removeFromBlackList",e)}var ht=lt;function dt(e){Q.operatRoster.call(this,e,"add")}function ft(e){Q.operatRoster.call(this,e,"accept")}function mt(e){Q.operatRoster.call(this,e,"decline")}function gt(e){Q.operatRoster.call(this,e,"remove"),U.debug("Call removeRoster",e)}function yt(e){var t=this.getUniqueId(),r={id:t,to:e.to};this._msgHash[t]=Ge({},r);var o="";void 0!==e.chatType?o=e.chatType:void 0!==e.type&&(o="chat"===e.type?"singleChat":e.type);var n={id:t,type:"recall",chatType:o,ackId:e.mid,to:e.to,success:e.success,fail:e.fail};return U.debug("Call recallMessage",e),this.mSync.send(n,this)}function vt(e){return Fe(this,void 0,void 0,(function(){var t,r,o,n,i,s,a,u,c;return We(this,(function(p){switch(p.label){case 0:if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: "+e.reaction);return De.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.reaction,a=e.messageId,u={msgId:a,message:s},c={url:this.apiUrl+"/"+o+"/"+n+"/user/"+this.user+"/reaction",type:"POST",data:JSON.stringify(u),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,_.ajax(c)]):(t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return p.sent(),[2]}}))}))}function Et(e){return Fe(this,void 0,void 0,(function(){var t,r,o,n,i,s,a,u;return We(this,(function(c){switch(c.label){case 0:if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reactionId: "+e.reaction);return De.call(this)?(r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.messageId,a=e.reaction,u={url:this.apiUrl+"/"+o+"/"+n+"/user/"+this.user+"/reaction?msgId="+s+"&message="+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,_.ajax(u)]):(t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"}),[2,Promise.reject(t)]);case 1:return c.sent(),[2]}}))}))}function Tt(e){if("string"!=typeof e.chatType||!e.chatType)throw Error("Invalid parameter chatType: "+e.chatType);if(!e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatType,a=e.messageId,u={msgIdList:"string"==typeof a?[a]:a,msgType:"singleChat"===s?"chat":"groupchat",groupId:e.groupId||null},c={url:this.apiUrl+"/"+o+"/"+n+"/user/"+this.user+"/reaction",type:"GET",data:u,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return _.ajax(c)}function _t(e){if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: "+e.reaction);if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: "+e.messageId);if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.cursor,a=e.pageSize,u={msgId:e.messageId,message:e.reaction,currentPage:s||null,pageSize:a||20},c={url:this.apiUrl+"/"+o+"/"+n+"/user/"+this.user+"/reaction/detail",type:"GET",data:u,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return _.ajax(c)}function It(e){var t=this;if(!e||!e.data)throw Error("Invalid parameter");if(!De.call(this)){var r=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups",dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:e.data.groupname,desc:e.data.desc,members:e.data.members,public:e.data.public,approval:e.data.approval,allowinvites:e.data.allowinvites,invite_need_confirm:e.data.inviteNeedConfirm}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:function(r){e.success&&e.success(r),t.onCreateGroup&&t.onCreateGroup(r)},error:e.error};return U.debug("Call createGroup:",e),_.ajax(a)}var Nt=It;function Ot(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!De.call(this)){var r=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={entities:[(t={},t["notification_ignore_"+e.groupId]=!0,t)]},u={type:"PUT",url:this.apiUrl+"/"+n+"/"+i+"/users/"+this.user,data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call blockGroupMessages",e),_.ajax(u)}var Rt=Ot;function Ct(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={limit:e.limit,cursor:e.cursor};e.cursor||delete s.cursor;var a={url:this.apiUrl+"/"+o+"/"+n+"/publicchatgroups",type:"GET",dataType:"json",data:s,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call listGroups",e),_.ajax(a)}function St(e){if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/joined_chatgroups",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return U.debug("Call getGroup",e),_.ajax(s)}function bt(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={newowner:e.newOwner},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups/"+e.groupId,type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},data:JSON.stringify(r),success:e.success,error:e.error};return U.debug("Call changeOwner",e),_.ajax(a)}var At=bt;function kt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"?joined_time=true",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getGroupInfo",e),_.ajax(s)}function wt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={groupname:e.groupName,description:e.description},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s,type:"PUT",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call modifyGroup",e),_.ajax(u)}function Mt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatgroups/"+e.groupId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call listGroupMember",e),_.ajax(a)}var xt=Mt;function Ut(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getGroupAdmin",e),_.ajax(a)}function jt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={newadmin:e.username},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call setGroupAdmin",e),_.ajax(u)}var Pt=jt;function Bt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/admin/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call removeAdmin",e),_.ajax(u)}function Lt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"?version=v3",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call destroyGroup",e),_.ajax(a)}var Dt=Lt;function Gt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/quit",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call quitGroup",e),_.ajax(a)}function Ft(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o={usernames:e.users},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/chatgroups/"+r+"/invite",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call inviteUsersToGroup",e),_.ajax(u)}var Wt=Ft;function Ht(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"/apply",type:"POST",dataType:"json",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call joinGroup",e),_.ajax(s)}function qt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={applicant:e.applicant,verifyResult:!0,reason:"no clue"},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call agreeJoinGroup",e),_.ajax(u)}var zt=qt;function Jt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.applicant||""===e.applicant)throw Error('Invalid parameter: "applicant"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={applicant:e.applicant,verifyResult:!1,reason:e.reason||""},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/apply_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call rejectGroupJoinRequest",e),_.ajax(u)}var Vt=Jt;function Kt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={invitee:e.invitee,verifyResult:!0},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call acceptGroupInvite",e),_.ajax(u)}var Xt=Kt;function Yt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.invitee||""===e.invitee)throw Error('Invalid parameter: "invitee"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={invitee:e.invitee,verifyResult:!1},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/invite_verify",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call rejectGroupInvite",e),_.ajax(u)}var $t=Yt;function Zt(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.groupId,o=e.username,n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/chatgroups/"+r+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call removeGroupMember",e),_.ajax(u)}var Qt=Zt;function er(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.users.join(","),u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call removeGroupMembers",e),_.ajax(u)}var tr=er;function rr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:[e.username],mute_duration:e.muteDuration},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(a),success:e.success,error:e.error};return U.debug("Call muteGroupMember",e),_.ajax(u)}var or=rr;function nr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute/"+a,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call unmuteGroupMember",e),_.ajax(u)}var ir=nr;function sr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getGroupMuteList",e),_.ajax(a)}var ar=sr;function ur(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call blockGroupMember",e),_.ajax(u)}var cr=ur;function pr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:e.usernames},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users",data:JSON.stringify(a),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call blockGroupMembers",e),_.ajax(u)}var lr=pr;function hr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call unblockGroupMember",e),_.ajax(u)}var dr=hr;function fr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.usernames.join(","),u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call unblockGroupMembers",e),_.ajax(u)}var mr=fr;function gr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getGroupBlacklist",e),_.ajax(a)}var yr=gr;function vr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call disableSendGroupMsg",e),_.ajax(a)}function Er(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call enableSendGroupMsg",e),_.ajax(a)}function Tr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={usernames:e.users},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users",type:"POST",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call addUsersToGroupWhitelist",e),_.ajax(u)}function _r(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users/"+e.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call removeGroupWhitelistMember",e),_.ajax(a)}var Ir=_r;function Nr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getGroupWhitelist",e),_.ajax(a)}function Or(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call isGroupWhiteUser",e),_.ajax(a)}var Rr=Or;function Cr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.msgId||""===e.msgId)throw Error('Invalid parameter: "msgId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+e.groupId+"/acks/"+e.msgId,dataType:"json",type:"GET",data:{limit:500,key:void 0},headers:{Authorization:"Bearer "+i},success:e.success,error:e.error};return U.debug("Call getGroupMsgReadUser",e),_.ajax(s)}function Sr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/announcement",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call fetchGroupAnnouncement",e),_.ajax(a)}function br(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a={announcement:e.announcement},u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/announcement",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call updateGroupAnnouncement",e),_.ajax(u)}function Ar(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(De.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=e.groupId;_.uploadFile({uploadUrl:this.apiUrl+"/"+r+"/"+o+"/chatgroups/"+i+"/share_files",onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:n,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey}),U.debug("Call uploadGroupSharedFile",e)}}function kr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "file"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.groupId,a=e.fileId,u={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+s+"/share_files/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call deleteGroupSharedFile",e),_.ajax(u)}function wr(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.pageNum||1,a=e.pageSize||10,u=e.groupId,c={url:this.apiUrl+"/"+o+"/"+n+"/chatgroups/"+u+"/share_files?pagenum="+s+"&pagesize="+a,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call fetchGroupSharedFileList",e),_.ajax(c)}function Mr(e){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=this.apiUrl,s=e.groupId,a=e.fileId;_.download.call(this,{url:i+"/"+r+"/"+o+"/chatgroups/"+s+"/share_files/"+a,onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:n,id:a,secret:e.secret}),U.debug("Call downloadGroupSharedFile",e)}function xr(e){var t=this;if("number"!=typeof e.pagenum||"number"!=typeof e.pagesize)throw Error("Invalid parameter");if(!De.call(this)){var r=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o={pagenum:e.pagenum||1,pagesize:e.pagesize||20},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+a},data:o,success:function(t){"function"==typeof e.success&&e.success(t)},error:function(r){r.error&&r.error_description&&t.onError&&t.onError({type:f.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return U.debug("Call getChatRooms",e),_.ajax(u)}function Ur(e){if("string"!=typeof e.name)throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={name:e.name,description:e.description,maxusers:e.maxusers,owner:this.user,members:e.members},o=this.context,n=o.orgName,i=o.appName,s=(o.accessToken,{url:this.apiUrl+"/"+n+"/"+i+"/chatrooms",dataType:"json",type:"POST",data:JSON.stringify(r),headers:{Authorization:"Bearer "+e.token||0,"Content-Type":"application/json"},success:e.success,error:e.error});return U.debug("Call createChatRoom",e),_.ajax(s)}function jr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=(r.accessToken,{url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+e.token||0},success:e.success,error:e.error});return U.debug("Call destroyChatRoom",e),_.ajax(i)}function Pr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getChatRoomDetails",e),_.ajax(s)}function Br(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={groupname:e.chatRoomName,description:e.description,maxusers:e.maxusers},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s,type:"PUT",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call modifyChatRoom",e),_.ajax(u)}function Lr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||"string"!=typeof e.username)throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call removeChatRoomMember",e),_.ajax(u)}var Dr=Lr;function Gr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o=e.users.join(","),n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms/"+r+"/users/"+o,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call removeChatRoomMembers",e),_.ajax(u)}var Fr=Gr;function Wr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=e.chatRoomId,o={usernames:e.users},n=this.context,i=n.orgName,s=n.appName,a=n.accessToken,u={url:this.apiUrl+"/"+i+"/"+s+"/chatrooms/"+r+"/users",type:"POST",data:JSON.stringify(o),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call addUsersToChatRoom",e),_.ajax(u)}function Hr(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+e.roomId+"/apply",dataType:"json",type:"POST",data:JSON.stringify({message:e.message||""}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call joinChatRoom",e),_.ajax(s)}function qr(e){var t=this;if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");if(!De.call(this)){var r=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(r)}var o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatrooms/"+e.roomId+"/quit",dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+s},success:function(r){t._load_msg_cache=t._load_msg_cache.filter((function(t){return(!t.isGroup||t.to!==e.roomId)&&t})),"function"==typeof e.success&&e.success(r)},error:e.error};return U.debug("Call quitChatRoom",e),_.ajax(a)}function zr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(isNaN(e.pageNum)||e.pageNum<=0)throw Error('The parameter "pageNum" should be a positive number');if(isNaN(e.pageSize)||e.pageSize<=0)throw Error('The parameter "pageSize" should be a positive number');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={pagenum:e.pageNum,pagesize:e.pageSize},o=this.context,n=o.orgName,i=o.appName,s=o.accessToken,a={url:this.apiUrl+"/"+n+"/"+i+"/chatrooms/"+e.chatRoomId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call listChatRoomMembers",e),_.ajax(a)}var Jr=zr;function Vr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getChatRoomAdmin",e),_.ajax(a)}function Kr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={newadmin:e.username},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call setChatRoomAdmin",e),_.ajax(u)}function Xr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/admin/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call removeChatRoomAdmin",e),_.ajax(u)}function Yr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:[e.username],mute_duration:e.muteDuration},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute",dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(a),success:e.success,error:e.error};return U.debug("Call muteChatRoomMember",e),_.ajax(u)}function $r(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute/"+a,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call unmuteChatRoomMember",e),_.ajax(u)}var Zr=$r;function Qr(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/mute",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getChatRoomMuteList",e),_.ajax(a)}var eo=Qr;function to(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call blockChatRoomMember",e),_.ajax(u)}var ro=to;function oo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:e.usernames},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users",data:JSON.stringify(a),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Chat RoomBlock Multi Api:",u),_.ajax(u)}var no=oo;function io(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.username||""===e.username)throw Error('Invalid parameter: "username"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.username,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call unblockChatRoomMember",e),_.ajax(u)}var so=io;function ao(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a=e.usernames.join(","),u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call unblockChatRoomMembers",e),_.ajax(u)}var uo=ao;function co(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getChatRoomBlacklist",e),_.ajax(a)}var po=co;function lo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/ban",type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call disableSendChatRoomMsg",e),_.ajax(a)}function ho(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/ban",type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call enableSendChatRoomMsg",e),_.ajax(a)}function fo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={usernames:e.users},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users",type:"POST",data:JSON.stringify(a),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call addUsersToChatRoomWhitelist",e),_.ajax(u)}function mo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users/"+e.userName,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call removeChatRoomWhitelistMember",e),_.ajax(a)}var go=mo;function yo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getChatRoomWhitelist",e),_.ajax(a)}function vo(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if("string"!=typeof e.userName||""===e.userName)throw Error('Invalid parameter: "userName"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.chatRoomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call isChatRoomWhiteUser",e),_.ajax(a)}function Eo(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/announcement",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call fetchChatRoomAnnouncement",e),_.ajax(a)}function To(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={announcement:e.announcement},u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/announcement",type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call updateChatRoomAnnouncement:",e),_.ajax(u)}function _o(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("object"!=typeof e.file)throw Error('Invalid parameter: "file"');if(De.call(this)){var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i=e.roomId;_.uploadFile({uploadUrl:this.apiUrl+"/"+r+"/"+o+"/chatrooms/"+i+"/share_files",onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:n,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey}),U.debug("Call uploadChatRoomSharedFile",e)}}function Io(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.fileId||""===e.fileId)throw Error('Invalid parameter: "fileId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a=e.fileId,u={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/share_files/"+a,type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call deleteChatRoomSharedFile",e),_.ajax(u)}function No(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=e.roomId,a={url:this.apiUrl+"/"+o+"/"+n+"/chatrooms/"+s+"/share_files",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json",accept:"application/json"},success:e.success,error:e.error};return U.debug("Call fetchChatRoomSharedFileList",e),_.ajax(a)}function Oo(e){if("string"!=typeof e.description)throw Error('Invalid parameter: "description"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.accessToken,n=r.orgName,i=r.appName,s=r.userId,a=this.context.jid.clientResource,u={ext:e.description},c={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/presence/"+a+"/1",type:"POST",dataType:"json",data:JSON.stringify(u),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call publishPresence:",e),_.ajax(c)}function Ro(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if("number"!=typeof e.expiry)throw Error('Invalid parameter: "expiry"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,s=r.accessToken,a={usernames:e.usernames},u={url:this.apiUrl+"/"+o+"/"+n+"/users/"+i+"/presence/"+e.expiry,type:"POST",dataType:"json",data:JSON.stringify(a),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call subscribePresence:",e),_.ajax(u)}function Co(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,s=r.accessToken,a=(e.usernames,{url:this.apiUrl+"/"+o+"/"+n+"/users/"+i+"/presence",type:"DELETE",dataType:"json",data:JSON.stringify(e.usernames),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error});return U.debug("Call unsubscribePresence:",e),_.ajax(a)}function So(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "page or pagesize"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.userId,s=r.accessToken,a={url:this.apiUrl+"/"+o+"/"+n+"/users/"+i+"/presence/sublist?pageNum="+e.pageNum+"&pageSize="+e.pageSize,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getSubscribedPresenceList:",e),_.ajax(a)}function bo(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r={usernames:e.usernames},o=this.context,n=o.orgName,i=o.appName,s=o.userId,a=o.accessToken,u={url:this.apiUrl+"/"+n+"/"+i+"/users/"+s+"/presence",type:"POST",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return U.debug("Call getPresenceStatus:",e),_.ajax(u)}function Ao(){if(!De.call(this)){var e=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(e)}var t=this.context,r=t.orgName,o=t.appName,n=t.accessToken,i={url:this.apiUrl+"/"+r+"/"+o+"/users/"+this.user+"/translate/support/language",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+n}};return U.debug("Call getSupportedLanguages"),_.ajax(i)}function ko(e){if("string"!=typeof e.text||""===e.text)throw Error('Invalid parameter: "text"');if(!Array.isArray(e.languages))throw Error('Invalid parameter: "language"');if(!De.call(this)){var t=h.create({type:f.REST_PARAMS_STATUS,message:"appkey or token error"});return Promise.reject(t)}var r=this.context,o=r.orgName,n=r.appName,i=r.accessToken,s=this.apiUrl+"/"+o+"/"+n+"/users/"+this.user+"/translate",a={text:e.text,to:e.languages},u={url:s,dataType:"json",type:"POST",data:JSON.stringify(a),headers:{Authorization:"Bearer "+i}};return U.debug("Call translateMessage"),_.ajax(u)}var wo=function(){return wo=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},wo.apply(this,arguments)},Mo=_.getEnvInfo(),xo="web"===Mo.platform,Uo=function(){};function jo(e){var t=this,r=e.promise,o=e.error||Uo;if(!this.orgName&&!this.appName){var n=h.create({type:f.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"signup error"});o(n)}var i={headers:{"Content-type":"application/json"},url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users",dataType:"json",data:JSON.stringify({username:e.username,password:e.password,nickname:e.nickname||""}),success:function(t){e.success&&e.success(t);var o=wo(wo({},t),{type:f.REQUEST_SUCCESS});r.resolve&&r.resolve(o)},error:function(n){return t.isHttpDNS&&t.restIndex+1<t.restTotal&&(t.restIndex++,Ho.call(t,"signup"),jo.call(t,e)),t.clear(),r.reject&&r.reject(n),o(n)}};return _.ajax(i).catch((function(e){r.reject&&r.reject(e)}))}function Po(e){var t=this;if(Go.call(this,e)&&!this.isOpened()){Fo.call(this,e),this.user=e.user;var r=e.promise;if(e.agoraToken)this.grantType="agoraToken",this.getChatToken(e.agoraToken).then((function(o){U.info("getChatToken result:",o),Date.now(),t.expirationTime=o.expire_timestamp,t.token=o.access_token,t.context.accessToken=o.access_token,t.context.restTokenData=o.access_token,r.resolve({accessToken:o.access_token,expireTimestamp:o.expire_timestamp}),Do.call(t,wo(wo({},e),{access_token:o.access_token}))})).catch((function(e){var o,n=h.create({type:f.WEBIM_CONNCTION_GETROSTER_ERROR,message:"get chat token fail",data:e});r.reject(n),t.onError&&t.onError(n),null===(o=t.eventHandler)||void 0===o||o.dispatch("onError",n)}));else if(e.accessToken)this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,r.resolve({accessToken:e.accessToken}),Do.call(this,e);else{this.grantType="password";var o={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},n=JSON.stringify(o),i={headers:{"Content-type":"application/json"},url:this.apiUrl+"/"+this.orgName+"/"+this.appName+"/token",dataType:"json",data:n,success:function(o){"function"==typeof e.success&&e.success(o),t.token=o.access_token,t.context.restTokenData=o.access_token,t.context.accessToken=o.access_token,r.resolve({accessToken:o.access_token,duration:o.expires_in}),Do.call(t,o)}||Uo,error:function(o){if(t.isHttpDNS&&t.restIndex+1<t.restTotal)return t.restIndex++,Ho.call(t,"login"),void Po.call(t,e);var n;t.clear(),o.error&&o.error_description?(n=h.create({type:f.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:o.error_description,data:o}),t.onError&&t.onError(n)):(n=h.create({type:f.WEBIM_CONNCTION_OPEN_ERROR,message:"login failed",data:o}),t.onError&&t.onError(n)),"function"==typeof e.error&&e.error(n),r.reject(n)}||Uo,version:"4.0.4"};_.ajax(i).catch((function(e){console.warn(e)}))}_.listenNetwork(Bo.bind(this),Lo.bind(this))}}function Bo(){var e;U.debug("online"),this.onOnline&&this.onOnline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOnline"),this.sock&&1!==this.sock.readyState&&(U.debug("sock.readyState:",this.sock.readyState),this.reconnect())}function Lo(){var e;U.debug("offline"),this.onOffline&&this.onOffline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOffline")}function Do(e){var t=this,r=((new Date).getTime(),this._getSock());this.sock=r;var o=function(){U.debug("websockt onOpen"),t.logOut=!1,"zfb"!==Mo.platform&&"dd"!==Mo.platform||(t.sock.readyState=1);var e=_.flow([t.mSync.generateProvision,t.mSync.base64transform])();try{r.send(e)}catch(e){var o=h.create({type:f.SDK_RUNTIME_ERROR,message:"send message error",data:e});t.onError&&t.onError(o)}},n=function(){var e,r;if(U.debug("websockt onClose"),"zfb"!==Mo.platform&&"dd"!==Mo.platform||(t.sock.readyState=3),!t.logOut&&t.autoReconnectNumTotal<t.autoReconnectNumMax){(new Date).getTime(),t.reconnect();var o={type:f.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.onError&&t.onError(o)}else t.logOut?(t.clear(),t.onClosed&&t.onClosed(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onDisconnected"),t.mSync.stopHeartBeat(),t.autoReconnectInterval=0,t.times=1,t.autoReconnectNumTotal=0,t.hostIndex=0):(o={type:f.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"},t.onError&&t.onError(o),t.onClosed&&t.onClosed(),null===(r=t.eventHandler)||void 0===r||r.dispatch("onDisconnected"),t.mSync.stopHeartBeat(),U.debug("reconnect fail"),t.autoReconnectInterval=0,t.times=1,t.autoReconnectNumTotal=0,t.hostIndex=0)},i=function(e){var r=t.mSync,o=r.decodeMSync,n=r.distributeMSync;_.flow([o,n])(e)};"web"===Mo.platform?(r.onopen=o,r.onclose=n,r.onmessage=i):(r.onOpen(o),r.onMessage(i),r.onClose(n),r.onError((function(e){U.debug("小程序 sock on error",e),t.isOnCloseReconnet=!1,t.onError&&t.onError({type:f.WEBIM_CONNECTION_ERROR,message:"on socket error",data:e}),!t.logOut&&t.autoReconnectNumTotal<t.autoReconnectNumMax&&(U.debug("----- sock.onError reconnect -----",t.autoReconnectNumTotal,t.autoReconnectNumMax),t.reconnect())})))}function Go(e){if(""===e.user){var t=h.create({type:f.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR,message:"the user cannot be empty"});return this.onError&&this.onError(t),!1}var r=this.appKey.split("#");return!(2!==r.length||!r[0]||!r[1])||(t=h.create({type:f.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:"the appKey is illegal"}),this.onError&&this.onError(t),!1)}function Fo(e){this.context.jid={appKey:this.appKey,name:e.user,domain:this.domain,clientResource:this.clientResource};var t=this.appKey.split("#"),r=t[0],o=t[1];this.context.root=this.root,this.context.userId=e.user,this.context.appKey=this.appKey,this.context.appName=o,this.context.orgName=r}function Wo(e,t){var r=this,o={url:this.dnsArr[this.dnsIndex]+"/easemob/server.json",dataType:"json",type:"GET",data:{app_key:encodeURIComponent(this.appKey)},success:function(o){var n=o.rest.hosts,i=r.https?"https":"http";if(U.info("httpType: "+i),!n)return Promise.reject(!1);for(var s=n.filter((function(e){if(e.protocol===i)return e})),a=0;a<s.length;a++)if(s[a].protocol===i){var u=s[a];s.splice(a,1),s.unshift(u)}r.restHosts=s,r.restTotal=s.length;var c=o["msync-ws"].hosts;if(!c)return Promise.reject(!1);var p=c.filter((function(e){return e.protocol===i&&e}));r.socketHost=p,r.hostTotal=p.length;var l=(o["mserver-im"]?o["mserver-im"].hosts:[]).filter((function(e){if(e.protocol===i)return e}));for(a=0;a<l.length;a++){var h=l[a];l.splice(a,1),l.unshift(h)}if(r.mserverHosts=l,r.mserverTotal=l.length,l&&l.length>0){var d=l[r.mserverIndex],f={url:d.protocol+"://"+d.domain+"/api/v1/sdk/config",dataType:"json",type:"GET",data:{appkey:encodeURIComponent(r.appKey),version:encodeURIComponent(r.version)},success:function(e){},error:function(){console.warn("The service configuration request failed")}};_.ajax(f)}if(Ho.call(r,e),"login"!==e)return jo.call(r,t);Po.call(r,t)}||Uo,error:function(t){U.debug("getHttpDNS fail: "+r.dnsIndex),r.dnsIndex++,r.dnsIndex<r.dnsTotal&&Wo.call(r,e)}||Uo};return _.ajax(o).catch((function(e){console.warn(e)}))}function Ho(e){var t,r;if(this.restIndex>this.restTotal)return"";var o="",n=this.restHosts[this.restIndex],i=n.domain,s=n.ip,a=n.port,u=this.https?"https:":"http:";return s&&"undefined"!=typeof window&&"http:"===(null===(t=null===window||void 0===window?void 0:window.location)||void 0===t?void 0:t.protocol)?o=u+"//"+s+":"+a:(o=u+"//"+i,a&&"80"!==a&&"443"!==a&&(o+=":"+a),"undefined"==typeof window||window.location||(o="https://"+i),"undefined"!=typeof window&&window.location&&"file:"===(null===(r=window.location)||void 0===r?void 0:r.protocol)&&(o="https://"+i)),"undefined"==typeof window&&(o=u+"//"+i),this.apiUrl=o,o}const qo=function(){function r(o){var a;this.isDebug=o.isDebug||!1,this.isHttpDNS=void 0===o.isHttpDNS?xo:o.isHttpDNS,this.heartBeatWait=o.heartBeatWait||3e4,this.autoReconnectNumMax=o.autoReconnectNumMax||5,this.delivery=o.delivery||!1,this.dnsArr=["https://rs.easemob.com","http://59.110.89.59","http://39.97.193.190","http://39.97.193.187"],this.dnsIndex=0,this.dnsTotal=this.dnsArr.length,this.restHosts=[],this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.socketHost=[],this.hostTotal=0,this.times=1,this.autoReconnectNumTotal=0,this.domain="easemob.com",this.appKey=o.appKey,this.appName="",this.orgName="",this.token="",this.grantType="",this.apiUrl=o.apiUrl||"",this.url=o.url||"",this.https=o.https||"undefined"!=typeof window&&"https:"===(null===(a=window.location)||void 0===a?void 0:a.protocol),this.mserverIndex=0,this.version="4.0.4",this.deviceId=o.deviceId||"webim",this.osType=16,this.useOwnUploadFun=o.useOwnUploadFun||!1,this.compressType=[0],this.encryptType=[0],this.clientResource="",this.expiresIn=0,this.expirationTime=0,this.logOut=!0,this.context={jid:{appKey:"",clientResource:"",domain:"easemob.com",name:""},userId:"",appKey:"",status:0,restTokenData:"",appName:"",orgName:"",root:{},accessToken:""},this._msgHash={},this._msgPromiseHash={},this._queues=[],this._load_msg_cache=[],this.unSendMsgArr=[],this.mr_cache={};var u=this.appKey.split("#");if(2!==u.length&&u[0]&&u[1])throw Error("Illegal appkey: "+this.appKey);this.orgName=u[0],this.appName=u[1],this.listen=Pe.bind(this),this.mSync=this.usePlugin(Me),this.eventHandler=this.usePlugin(Ue),Object.assign(r.prototype,e),Object.assign(r.prototype,t),Object.assign(r.prototype,n),Object.assign(r.prototype,i),Object.assign(r.prototype,s)}return r.prototype.usePlugin=function(e,t){if(!t)return new e(this);this[t]=new e(this)},r.prototype.listen=function(e){},r.prototype.addEventHandler=function(e,t){},r.prototype.removeEventHandler=function(e){},r.prototype.registerUser=function(e){var t=this;return new Promise((function(r,o){if(t.isHttpDNS){t.dnsIndex=0;var n=wo(wo({},e),{user:e.username,pwd:e.password,promise:{resolve:r,reject:o}});return Wo.call(t,"signup",n)}return n=wo(wo({},e),{promise:{resolve:r,reject:o}}),jo.call(t,n)}))},r.prototype.open=function(e){var t=this;return U.debug("open"),new Promise((function(r,o){e.accessToken&&(t.token=e.accessToken);var n=wo(wo({},e),{promise:{resolve:r,reject:o}});t.isHttpDNS?Wo.call(t,"login",n):Po.call(t,n)}))},r.prototype.isOpened=function(){return this.sock&&1===this.sock.readyState||!1},r.prototype.close=function(){this.logOut=!0,this.context.status=f.STATUS_CLOSING,this.sock&&this.sock.close(),this.stopHeartBeat(),this.context.status=f.STATUS_CLOSED},r.prototype.stopHeartBeat=function(){clearInterval(this.heartBeatID)},r.prototype._checkOpenParams=function(e){return Go.call(this,e)},r.prototype.clear=function(){this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.hostTotal=0},r.prototype.heartBeat=function(){},r.prototype.getChatToken=function(e){var t=this.context.appName,r=this.context.orgName,o={url:this.apiUrl+"/"+r+"/"+t+"/token",dataType:"json",type:"POST",data:JSON.stringify({grant_type:"agora"}),headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return _.ajax(o)},r.prototype.renewToken=function(e){var t=this;return this.isOpened()?this.getChatToken(e).then((function(e){var r=Date.now();return t.expirationTime=e.expire_timestamp,t.expiresIn=e.expire_timestamp-r,t.token=e.access_token,t.context.accessToken=e.access_token,t.clearTokenTimeout(),t.tokenExpireTimeCountDown(t.expiresIn),{status:!0,token:e.access_token,expire:e.expire_timestamp}})):Promise.reject({status:!1})},r.prototype.clearTokenTimeout=function(){U.debug("clearTokenTimeout"),this.tokenWillExpireTimer&&clearTimeout(this.tokenWillExpireTimer),this.tokenExpiredTimer&&clearTimeout(this.tokenExpiredTimer)},r.prototype.tokenExpireTimeCountDown=function(e){var t=this;this.tokenWillExpireTimer=setTimeout((function(){var e;t.onTokenWillexpire&&t.onTokenWillexpire(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenWillExpire"),U.info("onTokenWillExpire")}),e/2),this.tokenExpiredTimer=setTimeout((function(){var e;U.info("onTokenExpired"),t.onTokenExpired&&t.onTokenExpired(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),t.close()}),e)},r.prototype.compareTokenExpireTime=function(e,t){var r,o=Number(t)-Number(e);U.debug("compareTokenExpireTime",o),o<=this.expiresIn/2&&o>0?(this.onTokenWillExpire&&this.onTokenWillExpire(),null===(r=this.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),U.info("onTokenWillExpire")):o<=0&&(this.closeByTokenExpired(),U.info("closeByTokenExpired"))},r.prototype.closeByTokenExpired=function(){var e;U.info("closed By TokenExpired"),this.onTokenExpired&&this.onTokenExpired(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),this.close()},r.prototype.reconnect=function(){var e=this;U.info("reconnect: time",this.times),U.info("reconnect sock.readyState: ",this.sock.readyState),0!==this.sock.readyState&&1!==this.sock.readyState&&(this.isHttpDNS&&(this.hostIndex,this.socketHost.length),this.hostIndex++,this.hostIndex>=this.socketHost.length-1&&(this.hostIndex=this.socketHost.length-1),setTimeout((function(){U.info("login sock.readyState: ",e.sock.readyState),e.sock.close(),1!==e.sock.readyState&&(Do.call(e,{access_token:e.context.accessToken}),e.autoReconnectInterval+=e.times*e.times,e.times++)}),500*this.times),this.autoReconnectNumTotal++)},r.prototype.send=function(e){return Promise.resolve(null)},r.max_cache_length=100,r._getSock=function(){},r}();var zo=_.getEnvInfo(),Jo=zo.global;c.util.Long=l(),c.configure();var Vo=c.Root.fromJSON({nested:{easemob:{nested:{pb:{nested:{MessageBody:{fields:{type:{type:"Type",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},contents:{rule:"repeated",type:"Content",id:4},ext:{rule:"repeated",type:"KeyValue",id:5},ackMessageId:{type:"uint64",id:6},msgConfig:{type:"MessageConfig",id:7},ackContent:{type:"string",id:8},meta:{type:"string",id:9}},nested:{Content:{fields:{type:{type:"Type",id:1},text:{type:"string",id:2},latitude:{type:"double",id:3},longitude:{type:"double",id:4},address:{type:"string",id:5},displayName:{type:"string",id:6},remotePath:{type:"string",id:7},secretKey:{type:"string",id:8},fileLength:{type:"int32",id:9},action:{type:"string",id:10},params:{rule:"repeated",type:"KeyValue",id:11},duration:{type:"int32",id:12},size:{type:"Size",id:13},thumbnailRemotePath:{type:"string",id:14},thumbnailSecretKey:{type:"string",id:15},thumbnailDisplayName:{type:"string",id:16},thumbnailFileLength:{type:"int32",id:17},thumbnailSize:{type:"Size",id:18},customEvent:{type:"string",id:19},customExts:{rule:"repeated",type:"KeyValue",id:20},buildingName:{type:"string",id:21}},nested:{Type:{values:{TEXT:0,IMAGE:1,VIDEO:2,LOCATION:3,VOICE:4,FILE:5,COMMAND:6,CUSTOM:7}},Size:{fields:{width:{type:"double",id:1},height:{type:"double",id:2}}}}},Type:{values:{NORMAL:0,CHAT:1,GROUPCHAT:2,CHATROOM:3,READ_ACK:4,DELIVER_ACK:5,RECALL:6,CHANNEL_ACK:7}},MessageConfig:{fields:{allowGroupAck:{type:"bool",id:1}}}}},KeyValue:{oneofs:{value:{oneof:["varintValue","floatValue","doubleValue","stringValue"]}},fields:{key:{type:"string",id:1},type:{type:"ValueType",id:2},varintValue:{type:"int64",id:3},floatValue:{type:"float",id:4},doubleValue:{type:"double",id:5},stringValue:{type:"string",id:6}},nested:{ValueType:{values:{BOOL:1,INT:2,UINT:3,LLINT:4,FLOAT:5,DOUBLE:6,STRING:7,JSON_STRING:8}}}},JID:{fields:{appKey:{type:"string",id:1},name:{type:"string",id:2},domain:{type:"string",id:3},clientResource:{type:"string",id:4}}},ConferenceBody:{fields:{sessionId:{type:"string",id:1},operation:{type:"Operation",id:2},conferenceId:{type:"string",id:3},type:{type:"Type",id:4},content:{type:"string",id:5},network:{type:"string",id:6},version:{type:"string",id:7},identity:{type:"Identity",id:8},duration:{type:"string",id:9},peerName:{type:"string",id:10},endReason:{type:"EndReason",id:11},status:{type:"Status",id:12},isDirect:{type:"bool",id:13},controlType:{type:"StreamControlType",id:14},routeFlag:{type:"int32",id:15},routeKey:{type:"string",id:16}},nested:{Status:{fields:{errorCode:{type:"int32",id:1}}},Operation:{values:{JOIN:0,INITIATE:1,ACCEPT_INITIATE:2,ANSWER:3,TERMINATE:4,REMOVE:5,STREAM_CONTROL:6,MEDIA_REQUEST:7}},Type:{values:{VOICE:0,VIDEO:1}},Identity:{values:{CALLER:0,CALLEE:1}},EndReason:{values:{HANGUP:0,NORESPONSE:1,REJECT:2,BUSY:3,FAIL:4,UNSUPPORTED:5,OFFLINE:6}},StreamControlType:{values:{PAUSE_VOICE:0,RESUME_VOICE:1,PAUSE_VIDEO:2,RESUME_VIDEO:3}}}},MSync:{fields:{version:{type:"Version",id:1,options:{default:"MSYNC_V1"}},guid:{type:"JID",id:2},auth:{type:"string",id:3},compressAlgorimth:{type:"uint32",id:4},crypto:{type:"uint32",id:5},userAgent:{type:"string",id:6},pov:{type:"uint64",id:7},command:{type:"Command",id:8},deviceId:{type:"uint32",id:10},encryptType:{rule:"repeated",type:"EncryptType",id:11,options:{packed:!1}},encryptKey:{type:"string",id:12},payload:{type:"bytes",id:9}},nested:{Version:{values:{MSYNC_V1:0,MSYNC_V2:1}},Command:{values:{SYNC:0,UNREAD:1,NOTICE:2,PROVISION:3}}}},EncryptType:{values:{ENCRYPT_NONE:0,ENCRYPT_AES_128_CBC:1,ENCRYPT_AES_256_CBC:2}},CommSyncUL:{fields:{meta:{type:"Meta",id:1},key:{type:"uint64",id:2},queue:{type:"JID",id:3},isRoam:{type:"bool",id:4},lastFullRoamKey:{type:"uint64",id:5}}},CommSyncDL:{fields:{status:{type:"Status",id:1},metaId:{type:"uint64",id:2},serverId:{type:"uint64",id:3},metas:{rule:"repeated",type:"Meta",id:4},nextKey:{type:"uint64",id:5},queue:{type:"JID",id:6},isLast:{type:"bool",id:7},timestamp:{type:"uint64",id:8},isRoam:{type:"bool",id:9}}},CommNotice:{fields:{queue:{type:"JID",id:1}}},CommUnreadUL:{fields:{}},CommUnreadDL:{fields:{status:{type:"Status",id:1},unread:{rule:"repeated",type:"MetaQueue",id:2},timestamp:{type:"uint64",id:3}}},MetaQueue:{fields:{queue:{type:"JID",id:1},n:{type:"uint32",id:2}}},Meta:{fields:{id:{type:"uint64",id:1},from:{type:"JID",id:2},to:{type:"JID",id:3},timestamp:{type:"uint64",id:4},ns:{type:"NameSpace",id:5},payload:{type:"bytes",id:6},routetype:{type:"RouteType",id:7}},nested:{NameSpace:{values:{STATISTIC:0,CHAT:1,MUC:2,ROSTER:3,CONFERENCE:4,NOTIFY:5,QUERY:6}},RouteType:{values:{ROUTE_ALL:0,ROUTE_ONLINE:1}}}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},reason:{type:"string",id:2},redirectInfo:{rule:"repeated",type:"RedirectInfo",id:3}},nested:{ErrorCode:{values:{OK:0,FAIL:1,UNAUTHORIZED:2,MISSING_PARAMETER:3,WRONG_PARAMETER:4,REDIRECT:5,TOKEN_EXPIRED:6,PERMISSION_DENIED:7,NO_ROUTE:8,UNKNOWN_COMMAND:9,PB_PARSER_ERROR:10,BIND_ANOTHER_DEVICE:11,IM_FORBIDDEN:12,TOO_MANY_DEVICES:13,PLATFORM_LIMIT:14,USER_MUTED:15,ENCRYPT_DISABLE:16,ENCRYPT_ENABLE:17,DECRYPT_FAILURE:18,PERMISSION_DENIED_EXTERNAL:19}}}},RedirectInfo:{fields:{host:{type:"string",id:1},port:{type:"uint32",id:2}}},Provision:{fields:{osType:{type:"OsType",id:1},version:{type:"string",id:2},networkType:{type:"NetworkType",id:3},appSign:{type:"string",id:4},compressType:{rule:"repeated",type:"CompressType",id:5,options:{packed:!1}},encryptType:{rule:"repeated",type:"EncryptType",id:6,options:{packed:!1}},encryptKey:{type:"string",id:7},status:{type:"Status",id:8},deviceUuid:{type:"string",id:9},isManualLogin:{type:"bool",id:10},password:{type:"string",id:11},deviceName:{type:"string",id:12},resource:{type:"string",id:13},auth:{type:"string",id:14},actionVersion:{type:"string",id:16}},nested:{OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}},CompressType:{values:{COMPRESS_NONE:0,COMPRESS_ZLIB:1}}}},MUCBody:{fields:{mucId:{type:"JID",id:1},operation:{type:"Operation",id:2},from:{type:"JID",id:3},to:{rule:"repeated",type:"JID",id:4},setting:{type:"Setting",id:5},reason:{type:"string",id:6},isChatroom:{type:"bool",id:7},status:{type:"Status",id:8}},nested:{Operation:{values:{CREATE:0,DESTROY:1,JOIN:2,LEAVE:3,APPLY:4,APPLY_ACCEPT:5,APPLY_DECLINE:6,INVITE:7,INVITE_ACCEPT:8,INVITE_DECLINE:9,KICK:10,GET_BLACKLIST:11,BAN:12,ALLOW:13,UPDATE:14,BLOCK:15,UNBLOCK:16,PRESENCE:17,ABSENCE:18,DIRECT_JOINED:19,ASSIGN_OWNER:20,ADD_ADMIN:21,REMOVE_ADMIN:22,ADD_MUTE:23,REMOVE_MUTE:24,UPDATE_ANNOUNCEMENT:25,DELETE_ANNOUNCEMENT:26,UPLOAD_FILE:27,DELETE_FILE:28,ADD_USER_WHITE_LIST:29,REMOVE_USER_WHITE_LIST:30,BAN_GROUP:31,REMOVE_BAN_GROUP:32}},Setting:{fields:{name:{type:"string",id:1},desc:{type:"string",id:2},type:{type:"Type",id:3},maxUsers:{type:"int32",id:4},owner:{type:"string",id:5}},nested:{Type:{values:{PRIVATE_OWNER_INVITE:0,PRIVATE_MEMBER_INVITE:1,PUBLIC_JOIN_APPROVAL:2,PUBLIC_JOIN_OPEN:3,PUBLIC_ANONYMOUS:4}}}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},description:{type:"string",id:2}},nested:{ErrorCode:{values:{OK:0,PERMISSION_DENIED:1,WRONG_PARAMETER:2,MUC_NOT_EXIST:3,USER_NOT_EXIST:4,UNKNOWN:5}}}}}},RosterBody:{fields:{operation:{type:"Operation",id:1},status:{type:"Status",id:2},from:{type:"JID",id:3},to:{rule:"repeated",type:"JID",id:4},reason:{type:"string",id:5},rosterVer:{type:"string",id:6},biDirection:{type:"bool",id:7}},nested:{Operation:{values:{GET_ROSTER:0,GET_BLACKLIST:1,ADD:2,REMOVE:3,ACCEPT:4,DECLINE:5,BAN:6,ALLOW:7,REMOTE_ACCEPT:8,REMOTE_DECLINE:9}},Status:{fields:{errorCode:{type:"ErrorCode",id:1},description:{type:"string",id:2}},nested:{ErrorCode:{values:{OK:0,USER_NOT_EXIST:1,USER_ALREADY_FRIEND:2,USER_ALREADY_BLACKLIST:3}}}}}},StatisticsBody:{fields:{operation:{type:"Operation",id:1},os:{type:"OsType",id:2},version:{type:"string",id:3},network:{type:"NetworkType",id:4},imTime:{type:"uint32",id:5},chatTime:{type:"uint32",id:6},location:{type:"string",id:7}},nested:{Operation:{values:{INFORMATION:0,USER_REMOVED:1,USER_LOGIN_ANOTHER_DEVICE:2,USER_KICKED_BY_CHANGE_PASSWORD:3,USER_KICKED_BY_OTHER_DEVICE:4}},OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}}}}}}}}}});qo.prototype.root=Vo;var Ko=function(e){this.onOpen=Jo.onSocketOpen,this.onClose=Jo.onSocketClose,this.onMessage=Jo.onSocketMessage,this.onError=Jo.onSocketError,this.close=Jo.closeSocket,this.send=Jo.sendSocketMessage,this.connectSocket=Jo.connectSocket,this.readyState=0,this.connect=function(){Jo.connectSocket({url:e.url,header:{"content-type":"application/json"},success:function(e){},fail:function(){}})}};qo.prototype._getSock=function(){var e;return this.sock&&this.sock.close&&this.sock.close(),(e="zfb"===zo.platform||"dd"===zo.platform?new Ko(this):Jo.connectSocket({url:this.url,header:{"content-type":"application/json"},success:function(e){},fail:function(e){e.errMsg.indexOf("suspend")},complete:function(){}})).connect&&e.connect(),e},qo.prototype.getUniqueId=_.getUniqueId,qo.prototype.deviceId="miniProgram_"+zo.platform;var Xo=U.getLogger("IM-SDK-LOG");Xo.setConfig({useCache:!1,maxCache:3145728}),Xo.enableAll(),_.ajax=_.wxRequest;const Yo={connection:qo,message:J,utils:_,logger:k,statusCode:f}})(),o})()}));
- //# sourceMappingURL=Easemob-chat.js.map
|