easemob-websdk 4.24.0 → 4.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Easemob-chat.js +1 -1
- package/contact/contact.js +1 -1
- package/miniCore/miniCore.js +1 -1
- package/miniProgram/Easemob-chat.js +1 -1
- package/miniProgram/miniProgram.zip +0 -0
- package/package.json +1 -1
- package/uniApp/Easemob-chat.js +1 -1
- package/uniApp/uniApp.zip +0 -0
- package/websdk.zip +0 -0
package/Easemob-chat.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see Easemob-chat.js.LICENSE.txt */
|
|
2
|
-
!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()}(self,(function(){return function(){var __webpack_modules__={34:function(e,t,r){"use strict";var n=r(4901);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},81:function(e,t,r){"use strict";var n=r(9565),o=r(9306),i=r(8551),a=r(6823),s=r(851),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?s(e):t;if(o(r))return i(n(r,e));throw new c(a(e)+" is not iterable")}},113:function(e,t,r){"use strict";var n=r(6518),o=r(9213).find,i=r(6469),a="find",s=!0;a in[]&&Array(1)[a]((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i(a)},150:function(e,t,r){"use strict";r(6518)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},235:function(e,t,r){"use strict";var n=r(9213).forEach,o=r(4598)("forEach");e.exports=o?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},280:function(e,t,r){"use strict";var n=r(6518),o=r(7751),i=r(6395),a=r(550),s=r(916).CONSTRUCTOR,c=r(3438),u=o("Promise"),l=i&&!s;n({target:"Promise",stat:!0,forced:i||s},{resolve:function(e){return c(l&&this===u?a:this,e)}})},283:function(e,t,r){"use strict";var n=r(9504),o=r(9039),i=r(4901),a=r(9297),s=r(3724),c=r(350).CONFIGURABLE,u=r(3706),l=r(1181),d=l.enforce,p=l.get,h=String,f=Object.defineProperty,m=n("".slice),v=n("".replace),g=n([].join),y=s&&!o((function(){return 8!==f((function(){}),"length",{value:8}).length})),E=String(String).split("String"),_=e.exports=function(e,t,r){"Symbol("===m(h(t),0,7)&&(t="["+v(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(s?f(e,"name",{value:t,configurable:!0}):e.name=t),y&&r&&a(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=d(e);return a(n,"source")||(n.source=g(E,"string"==typeof t?t:"")),e};Function.prototype.toString=_((function(){return i(this)&&p(this).source||u(this)}),"toString")},298:function(e,t,r){"use strict";var n=r(2195),o=r(5397),i=r(8480).f,a=r(7680),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===n(e)?function(e){try{return i(e)}catch(e){return a(s)}}(e):i(o(e))}},350:function(e,t,r){"use strict";var n=r(3724),o=r(9297),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,u=s&&(!n||n&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},361:function(e,t,r){"use strict";var n=t,o=r(3262),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var r=0,n={};for(t|=0;r<e.length;)n[i[r+t]]=e[r++];return n}n.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",o.emptyArray,null]),n.long=a([0,0,0,1,1],7),n.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=a([1,5,0,0,0,5,5,0,0,0,1,1,0])},373:function(e,t,r){"use strict";var n=r(4576),o=r(7476),i=r(9039),a=r(9306),s=r(4488),c=r(4644),u=r(3709),l=r(3763),d=r(9519),p=r(3607),h=c.aTypedArray,f=c.exportTypedArrayMethod,m=n.Uint16Array,v=m&&o(m.prototype.sort),g=!(!v||i((function(){v(new m(2),null)}))&&i((function(){v(new m(2),{})}))),y=!!v&&!i((function(){if(d)return d<74;if(u)return u<67;if(l)return!0;if(p)return p<602;var e,t,r=new m(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(v(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));f("sort",(function(e){return void 0!==e&&a(e),y?v(this,e):s(h(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!y||g)},397:function(e,t,r){"use strict";var n=r(7751);e.exports=n("document","documentElement")},420:function(e,t,r){"use strict";e.exports=function(e){var t=o.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var c=e._fieldsArray[n].resolve(),u="m"+o.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",i(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),s(t,c,"k[i]"),a(t,c,n,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",i(c,"array"))("for(var i=0;i<%s.length;++i){",u),a(t,c,n,u+"[i]")("}");else{if(c.partOf){var l=o.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",l)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",l)}a(t,c,n,u)}c.optional&&t("}")}return t("return null")};var n=r(5643),o=r(3262);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,r,o){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",o)("default:")("return%j",i(t,"enum value"));for(var a=Object.keys(t.resolvedType.values),s=0;s<a.length;++s)e("case %i:",t.resolvedType.values[a[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,o)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",o)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',o)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',o)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",o)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",i(t,"buffer"))}return e}function s(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",i(t,"boolean key"))}return e}},421:function(e){"use strict";e.exports={}},436:function(e,t,r){"use strict";var n,o,i,a=r(6518),s=r(6395),c=r(6193),u=r(4576),l=r(9565),d=r(6840),p=r(2967),h=r(687),f=r(7633),m=r(9306),v=r(4901),g=r(34),y=r(679),E=r(2293),_=r(9225).set,T=r(1955),I=r(3138),O=r(1103),R=r(8265),S=r(1181),b=r(550),C=r(916),N=r(6043),A="Promise",M=C.CONSTRUCTOR,w=C.REJECTION_EVENT,U=C.SUBCLASSING,L=S.getterFor(A),P=S.set,x=b&&b.prototype,k=b,D=x,B=u.TypeError,j=u.document,G=u.process,H=N.f,F=H,q=!!(j&&j.createEvent&&u.dispatchEvent),W="unhandledrejection",z=function(e){var t;return!(!g(e)||!v(t=e.then))&&t},K=function(e,t){var r,n,o,i=t.value,a=1===t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,d=e.domain;try{s?(a||(2===t.rejection&&Q(t),t.rejection=1),!0===s?r=i:(d&&d.enter(),r=s(i),d&&(d.exit(),o=!0)),r===e.promise?u(new B("Promise-chain cycle")):(n=z(r))?l(n,r,c,u):c(r)):u(i)}catch(e){d&&!o&&d.exit(),u(e)}},V=function(e,t){e.notified||(e.notified=!0,T((function(){for(var r,n=e.reactions;r=n.get();)K(r,e);e.notified=!1,t&&!e.rejection&&Y(e)})))},J=function(e,t,r){var n,o;q?((n=j.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),u.dispatchEvent(n)):n={promise:t,reason:r},!w&&(o=u["on"+e])?o(n):e===W&&I("Unhandled promise rejection",r)},Y=function(e){l(_,u,(function(){var t,r=e.facade,n=e.value;if(X(e)&&(t=O((function(){c?G.emit("unhandledRejection",n,r):J(W,r,n)})),e.rejection=c||X(e)?2:1,t.error))throw t.value}))},X=function(e){return 1!==e.rejection&&!e.parent},Q=function(e){l(_,u,(function(){var t=e.facade;c?G.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)}))},$=function(e,t,r){return function(n){e(t,n,r)}},Z=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,V(e,!0))},ee=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new B("Promise can't be resolved itself");var n=z(t);n?T((function(){var r={done:!1};try{l(n,t,$(ee,r,e),$(Z,r,e))}catch(t){Z(r,t,e)}})):(e.value=t,e.state=1,V(e,!1))}catch(t){Z({done:!1},t,e)}}};if(M&&(D=(k=function(e){y(this,D),m(e),l(n,this);var t=L(this);try{e($(ee,t),$(Z,t))}catch(e){Z(t,e)}}).prototype,(n=function(e){P(this,{type:A,done:!1,notified:!1,parent:!1,reactions:new R,rejection:!1,state:0,value:null})}).prototype=d(D,"then",(function(e,t){var r=L(this),n=H(E(this,k));return r.parent=!0,n.ok=!v(e)||e,n.fail=v(t)&&t,n.domain=c?G.domain:void 0,0===r.state?r.reactions.add(n):T((function(){K(n,r)})),n.promise})),o=function(){var e=new n,t=L(e);this.promise=e,this.resolve=$(ee,t),this.reject=$(Z,t)},N.f=H=function(e){return e===k||void 0===e?new o(e):F(e)},!s&&v(b)&&x!==Object.prototype)){i=x.then,U||d(x,"then",(function(e,t){var r=this;return new k((function(e,t){l(i,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete x.constructor}catch(e){}p&&p(x,D)}a({global:!0,constructor:!0,wrap:!0,forced:M},{Promise:k}),h(k,A,!1,!0),f(A)},511:function(e,t,r){"use strict";var n=r(9167),o=r(9297),i=r(1951),a=r(4913).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},527:function(e){"use strict";e.exports=d;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,n=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,o=/^ *[*/]+ */,i=/^\s*\*?\/*/,a=/\n/g,s=/\s/,c=/\\(.?)/g,u={0:"\0",r:"\r",n:"\n",t:"\t"};function l(e){return e.replace(c,(function(e,t){switch(t){case"\\":case"":return t;default:return u[t]||""}}))}function d(e,c){e=e.toString();var u=0,d=e.length,p=1,h=null,f=null,m=0,v=!1,g=!1,y=[],E=null;function _(e){return Error("illegal "+e+" (line "+p+")")}function T(t){return e.charAt(t)}function I(t,r,n){h=e.charAt(t++),m=p,v=!1,g=n;var s,u=t-(c?2:3);do{if(--u<0||"\n"===(s=e.charAt(u))){v=!0;break}}while(" "===s||"\t"===s);for(var l=e.substring(t,r).split(a),d=0;d<l.length;++d)l[d]=l[d].replace(c?i:o,"").trim();f=l.join("\n").trim()}function O(t){var r=R(t),n=e.substring(t,r);return/^\s*\/{1,2}/.test(n)}function R(e){for(var t=e;t<d&&"\n"!==T(t);)t++;return t}function S(){if(y.length>0)return y.shift();if(E)return function(){var t="'"===E?n:r;t.lastIndex=u-1;var o=t.exec(e);if(!o)throw _("string");return u=t.lastIndex,b(E),E=null,l(o[1])}();var o,i,a,h,f,m=0===u;do{if(u===d)return null;for(o=!1;s.test(a=T(u));)if("\n"===a&&(m=!0,++p),++u===d)return null;if("/"===T(u)){if(++u===d)throw _("comment");if("/"===T(u))if(c){if(h=u,f=!1,O(u)){f=!0;do{if((u=R(u))===d)break;u++}while(O(u))}else u=Math.min(d,R(u)+1);f&&I(h,u,m),p++,o=!0}else{for(f="/"===T(h=u+1);"\n"!==T(++u);)if(u===d)return null;++u,f&&I(h,u-1,m),++p,o=!0}else{if("*"!==(a=T(u)))return"/";h=u+1,f=c||"*"===T(h);do{if("\n"===a&&++p,++u===d)throw _("comment");i=a,a=T(u)}while("*"!==i||"/"!==a);++u,f&&I(h,u-2,m),o=!0}}}while(o);var v=u;if(t.lastIndex=0,!t.test(T(v++)))for(;v<d&&!t.test(T(v));)++v;var g=e.substring(u,u=v);return'"'!==g&&"'"!==g||(E=g),g}function b(e){y.push(e)}function C(){if(!y.length){var e=S();if(null===e)return null;b(e)}return y[0]}return Object.defineProperty({next:S,peek:C,push:b,skip:function(e,t){var r=C();if(r===e)return S(),!0;if(!t)throw _("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t=null;return void 0===e?m===p-1&&(c||"*"===h||v)&&(t=g?f:null):(m<e&&C(),m!==e||v||!c&&"/"!==h||(t=g?null:f)),t}},"line",{get:function(){return p}})}d.unescape=l},537:function(e,t,r){"use strict";var n=r(550),o=r(4428),i=r(916).CONSTRUCTOR;e.exports=i||!o((function(e){n.all(e).then(void 0,(function(){}))}))},550:function(e,t,r){"use strict";var n=r(4576);e.exports=n.Promise},566:function(e,t,r){"use strict";var n=r(9504),o=r(9306),i=r(34),a=r(9297),s=r(7680),c=r(616),u=Function,l=n([].concat),d=n([].join),p={};e.exports=c?u.bind:function(e){var t=o(this),r=t.prototype,n=s(arguments,1),c=function(){var r=l(n,s(arguments));return this instanceof c?function(e,t,r){if(!a(p,t)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";p[t]=u("C,a","return new C("+d(n,",")+")")}return p[t](e,r)}(t,r.length,r):t.apply(e,r)};return i(r)&&(c.prototype=r),c}},597:function(e,t,r){"use strict";var n=r(9039),o=r(8227),i=r(9519),a=o("species");e.exports=function(e){return i>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},616:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},655:function(e,t,r){"use strict";var n=r(6955),o=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return o(e)}},679:function(e,t,r){"use strict";var n=r(1625),o=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new o("Incorrect invocation")}},687:function(e,t,r){"use strict";var n=r(4913).f,o=r(9297),i=r(8227)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!o(e,i)&&n(e,i,{configurable:!0,value:t})}},706:function(e,t,r){"use strict";var n=r(350).PROPER,o=r(9039),i=r(7452);e.exports=function(e){return o((function(){return!!i[e]()||"
"!=="
"[e]()||n&&i[e].name!==e}))}},739:function(e,t,r){"use strict";var n=r(6518),o=r(9039),i=r(8981),a=r(2777);n({target:"Date",proto:!0,arity:1,forced:o((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=i(this),r=a(t,"number");return"number"!=typeof r||isFinite(r)?t.toISOString():null}})},741:function(e){"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},744:function(e,t,r){"use strict";var n=t,o=r(5643),i=r(3262);function a(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof o){e("switch(d%s){",n);for(var i=t.resolvedType.values,a=Object.keys(i),s=0;s<a.length;++s)t.repeated&&i[a[s]]===t.typeDefault&&e("default:"),e("case%j:",a[s])("case %i:",i[a[s]])("m%s=%j",n,i[a[s]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof o?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var s=t[n].resolve(),c=i.safeProp(s.name);s.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),a(r,s,n,c+"[ks[i]]")("}")("}")):s.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),a(r,s,n,c+"[i]")("}")("}")):(s.resolvedType instanceof o||r("if(d%s!=null){",c),a(r,s,n,c),s.resolvedType instanceof o||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var r=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],a=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?n:t[u].map?a:c).push(t[u]);if(n.length){for(r("if(o.arrays||o.defaults){"),u=0;u<n.length;++u)r("d%s=[]",i.safeProp(n[u].name));r("}")}if(a.length){for(r("if(o.objects||o.defaults){"),u=0;u<a.length;++u)r("d%s={}",i.safeProp(a[u].name));r("}")}if(c.length){for(r("if(o.defaults){"),u=0;u<c.length;++u){var l=c[u],d=i.safeProp(l.name);if(l.resolvedType instanceof o)r("d%s=o.enums===String?%j:%j",d,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",d)("}else")("d%s=o.longs===String?%j:%i",d,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var p="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",d,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",d,p)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",d,d)("}")}else r("d%s=%j",d,l.typeDefault)}r("}")}var h=!1;for(u=0;u<t.length;++u){l=t[u];var f=e._fieldsArray.indexOf(l);d=i.safeProp(l.name),l.map?(h||(h=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",d,d)("d%s={}",d)("for(var j=0;j<ks2.length;++j){"),s(r,l,f,d+"[ks2[j]]")("}")):l.repeated?(r("if(m%s&&m%s.length){",d,d)("d%s=[]",d)("for(var j=0;j<m%s.length;++j){",d),s(r,l,f,d+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",d,l.name),s(r,l,f,d),l.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(l.partOf.name),l.name)),r("}")}return r("return d")}},757:function(e,t,r){"use strict";var n=r(7751),o=r(4901),i=r(1625),a=r(7040),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return o(t)&&i(t.prototype,s(e))}},788:function(e,t,r){"use strict";var n=r(34),o=r(2195),i=r(8227)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[i])?!!t:"RegExp"===o(e))}},818:function(e,t,r){"use strict";e.exports=i;var n=r(3449);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(3610);function i(){n.call(this)}function a(e,t,r){e.length<40?o.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}i._configure=function(){i.alloc=o._Buffer_allocUnsafe,i.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},i.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()},851:function(e,t,r){"use strict";var n=r(6955),o=r(5966),i=r(4117),a=r(6269),s=r(8227)("iterator");e.exports=function(e){if(!i(e))return o(e,s)||o(e,"@@iterator")||a[n(e)]}},916:function(e,t,r){"use strict";var n=r(4576),o=r(550),i=r(4901),a=r(2796),s=r(3706),c=r(8227),u=r(4215),l=r(6395),d=r(9519),p=o&&o.prototype,h=c("species"),f=!1,m=i(n.PromiseRejectionEvent),v=a("Promise",(function(){var e=s(o),t=e!==String(o);if(!t&&66===d)return!0;if(l&&(!p.catch||!p.finally))return!0;if(!d||d<51||!/native code/.test(e)){var r=new o((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[h]=n,!(f=r.then((function(){}))instanceof n))return!0}return!(t||"BROWSER"!==u&&"DENO"!==u||m)}));e.exports={CONSTRUCTOR:v,REJECTION_EVENT:m,SUBCLASSING:f}},926:function(e,t,r){"use strict";var n=r(9306),o=r(8981),i=r(7055),a=r(6198),s=TypeError,c="Reduce of empty array with no initial value",u=function(e){return function(t,r,u,l){var d=o(t),p=i(d),h=a(d);if(n(r),0===h&&u<2)throw new s(c);var f=e?h-1:0,m=e?-1:1;if(u<2)for(;;){if(f in p){l=p[f],f+=m;break}if(f+=m,e?f<0:h<=f)throw new s(c)}for(;e?f>=0:h>f;f+=m)f in p&&(l=r(l,p[f],f,d));return l}};e.exports={left:u(!1),right:u(!0)}},1034:function(e,t,r){"use strict";var n=r(9565),o=r(9297),i=r(1625),a=r(7979),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||o(e,"flags")||!i(s,e)?t:n(a,e)}},1072:function(e,t,r){"use strict";var n=r(1828),o=r(8727);e.exports=Object.keys||function(e){return n(e,o)}},1080:function(e,t,r){"use strict";e.exports=function(e){for(var t,r=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(i.compareFieldsById),c=0;c<s.length;++c){var u=s[c].resolve(),l=e._fieldsArray.indexOf(u),d=u.resolvedType instanceof n?"int32":u.type,p=o.basic[d];t="m"+i.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|o.mapKey[u.keyType],u.keyType),void 0===p?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|p,d,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==o.packed[d]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",d,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===p?a(r,u,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|p)>>>0,d,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===p?a(r,u,l,t):r("w.uint32(%i).%s(%s)",(u.id<<3|p)>>>0,d,t))}return r("return w")};var n=r(5643),o=r(361),i=r(3262);function a(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},1088:function(e,t,r){"use strict";var n=r(6518),o=r(9565),i=r(6395),a=r(350),s=r(4901),c=r(3994),u=r(2787),l=r(2967),d=r(687),p=r(6699),h=r(6840),f=r(8227),m=r(6269),v=r(7657),g=a.PROPER,y=a.CONFIGURABLE,E=v.IteratorPrototype,_=v.BUGGY_SAFARI_ITERATORS,T=f("iterator"),I="keys",O="values",R="entries",S=function(){return this};e.exports=function(e,t,r,a,f,v,b){c(r,t,a);var C,N,A,M=function(e){if(e===f&&x)return x;if(!_&&e&&e in L)return L[e];switch(e){case I:case O:case R:return function(){return new r(this,e)}}return function(){return new r(this)}},w=t+" Iterator",U=!1,L=e.prototype,P=L[T]||L["@@iterator"]||f&&L[f],x=!_&&P||M(f),k="Array"===t&&L.entries||P;if(k&&(C=u(k.call(new e)))!==Object.prototype&&C.next&&(i||u(C)===E||(l?l(C,E):s(C[T])||h(C,T,S)),d(C,w,!0,!0),i&&(m[w]=S)),g&&f===O&&P&&P.name!==O&&(!i&&y?p(L,"name",O):(U=!0,x=function(){return o(P,this)})),f)if(N={values:M(O),keys:v?x:M(I),entries:M(R)},b)for(A in N)(_||U||!(A in L))&&h(L,A,N[A]);else n({target:t,proto:!0,forced:_||U},N);return i&&!b||L[T]===x||h(L,T,x,{name:f}),m[t]=x,N}},1103:function(e){"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},1108:function(e,t,r){"use strict";var n=r(6955);e.exports=function(e){var t=n(e);return"BigInt64Array"===t||"BigUint64Array"===t}},1181:function(e,t,r){"use strict";var n,o,i,a=r(8622),s=r(4576),c=r(34),u=r(6699),l=r(9297),d=r(7629),p=r(6119),h=r(421),f="Object already initialized",m=s.TypeError,v=s.WeakMap;if(a||d.state){var g=d.state||(d.state=new v);g.get=g.get,g.has=g.has,g.set=g.set,n=function(e,t){if(g.has(e))throw new m(f);return t.facade=e,g.set(e,t),t},o=function(e){return g.get(e)||{}},i=function(e){return g.has(e)}}else{var y=p("state");h[y]=!0,n=function(e,t){if(l(e,y))throw new m(f);return t.facade=e,u(e,y,t),t},o=function(e){return l(e,y)?e[y]:{}},i=function(e){return l(e,y)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=o(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return r}}}},1240:function(e,t,r){"use strict";var n=r(9504);e.exports=n(1..valueOf)},1291:function(e,t,r){"use strict";var n=r(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},1296:function(e,t,r){"use strict";var n=r(4495);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},1344:function(e,t,r){"use strict";e.exports=u;var n=r(7209);((u.prototype=Object.create(n.prototype)).constructor=u).className="Field";var o,i=r(5643),a=r(361),s=r(3262),c=/^required|optional|repeated$/;function u(e,t,r,o,i,u,l){if(s.isObject(o)?(l=i,u=o,o=i=void 0):s.isObject(i)&&(l=u,u=i,i=void 0),n.call(this,e,u),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(r))throw TypeError("type must be a string");if(void 0!==o&&!c.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!s.isString(i))throw TypeError("extend must be a string");"proto3_optional"===o&&(o="optional"),this.rule=o&&"optional"!==o?o:void 0,this.type=r,this.id=t,this.extend=i||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=!!s.Long&&void 0!==a.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=l}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.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])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=a.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof o?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 i&&"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 i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.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;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof o&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},u.d=function(e,t,r,n){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(o,i){s.decorateType(o.constructor).add(new u(i,e,t,r,{default:n}))}},u._configure=function(e){o=e}},1392:function(e,t,r){"use strict";var n,o=r(6518),i=r(7476),a=r(7347).f,s=r(8014),c=r(655),u=r(5749),l=r(7750),d=r(1436),p=r(6395),h=i("".slice),f=Math.min,m=d("startsWith");o({target:"String",proto:!0,forced:!(!p&&!m&&(n=a(String.prototype,"startsWith"),n&&!n.writable)||m)},{startsWith:function(e){var t=c(l(this));u(e);var r=s(f(arguments.length>1?arguments[1]:void 0,t.length)),n=c(e);return h(t,r,r+n.length)===n}})},1405:function(e,t,r){"use strict";var n=r(4576),o=r(8745),i=r(4644),a=r(9039),s=r(7680),c=n.Int8Array,u=i.aTypedArray,l=i.exportTypedArrayMethod,d=[].toLocaleString,p=!!c&&a((function(){d.call(new c(1))}));l("toLocaleString",(function(){return o(d,p?s(u(this)):u(this),s(arguments))}),a((function(){return[1,2].toLocaleString()!==new c([1,2]).toLocaleString()}))||!a((function(){c.prototype.toLocaleString.call([1,2])})))},1415:function(e,t,r){"use strict";r(2405)},1436:function(e,t,r){"use strict";var n=r(8227)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},1447:function(e,t){"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,o=null,i=[],a=0;t<r;)(n=e[t++])<128?i[a++]=n:n>191&&n<224?i[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(n>>10),i[a++]=56320+(1023&n)):i[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},r.write=function(e,t,r){for(var n,o,i=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(o=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&o),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-i}},1457:function(e,t,r){"use strict";e.exports=a;var n=r(7209);((a.prototype=Object.create(n.prototype)).constructor=a).className="OneOf";var o=r(1344),i=r(3262);function a(e,t,r,o){if(Array.isArray(t)||(r=t,t=void 0),n.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 s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},a.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,s(this),this},a.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},a.prototype.onAdd=function(e){n.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))}s(this)},a.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},a.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){i.decorateType(t.constructor).add(new a(r,e)),Object.defineProperty(t,r,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},1469:function(e,t,r){"use strict";var n=r(7433);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},1481:function(e,t,r){"use strict";var n=r(6518),o=r(6043);n({target:"Promise",stat:!0,forced:r(916).CONSTRUCTOR},{reject:function(e){var t=o.f(this);return(0,t.reject)(e),t.promise}})},1489:function(e,t,r){"use strict";r(5823)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},1510:function(e,t,r){"use strict";var n=r(6518),o=r(7751),i=r(9297),a=r(655),s=r(5745),c=r(1296),u=s("string-to-symbol-registry"),l=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{for:function(e){var t=a(e);if(i(u,t))return u[t];var r=o("Symbol")(t);return u[t]=r,l[r]=t,r}})},1575:function(e,t,r){"use strict";var n=r(4644),o=r(926).left,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},1625:function(e,t,r){"use strict";var n=r(9504);e.exports=n({}.isPrototypeOf)},1629:function(e,t,r){"use strict";var n=r(6518),o=r(235);n({target:"Array",proto:!0,forced:[].forEach!==o},{forEach:o})},1630:function(e,t,r){"use strict";var n=r(9504),o=r(4644),i=n(r(7029)),a=o.aTypedArray;(0,o.exportTypedArrayMethod)("copyWithin",(function(e,t){return i(a(this),e,t,arguments.length>2?arguments[2]:void 0)}))},1694:function(e,t,r){"use strict";var n=r(4644),o=r(9213).find,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},1699:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(5749),a=r(7750),s=r(655),c=r(1436),u=o("".indexOf);n({target:"String",proto:!0,forced:!c("includes")},{includes:function(e){return!!~u(s(a(this)),s(i(e)),arguments.length>1?arguments[1]:void 0)}})},1745:function(e,t,r){"use strict";var n=r(6518),o=r(7476),i=r(9039),a=r(6346),s=r(8551),c=r(5610),u=r(8014),l=a.ArrayBuffer,d=a.DataView,p=d.prototype,h=o(l.prototype.slice),f=o(p.getUint8),m=o(p.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:i((function(){return!new l(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(h&&void 0===t)return h(s(this),e);for(var r=s(this).byteLength,n=c(e,r),o=c(void 0===t?r:t,r),i=new l(u(o-n)),a=new d(this),p=new d(i),v=0;n<o;)m(p,v++,f(a,n++));return i}})},1761:function(e,t,r){"use strict";var n=r(9565),o=r(9228),i=r(8551),a=r(34),s=r(8014),c=r(655),u=r(7750),l=r(5966),d=r(7829),p=r(6682);o("match",(function(e,t,r){return[function(t){var r=u(this),o=a(t)?l(t,e):void 0;return o?n(o,t,r):new RegExp(t)[e](c(r))},function(e){var n=i(this),o=c(e),a=r(t,n,o);if(a.done)return a.value;if(!n.global)return p(n,o);var u=n.unicode;n.lastIndex=0;for(var l,h=[],f=0;null!==(l=p(n,o));){var m=c(l[0]);h[f]=m,""===m&&(n.lastIndex=d(o,s(n.lastIndex),u)),f++}return 0===f?null:h}]}))},1828:function(e,t,r){"use strict";var n=r(9504),o=r(9297),i=r(5397),a=r(9617).indexOf,s=r(421),c=n([].push);e.exports=function(e,t){var r,n=i(e),u=0,l=[];for(r in n)!o(s,r)&&o(n,r)&&c(l,r);for(;t.length>u;)o(n,r=t[u++])&&(~a(l,r)||c(l,r));return l}},1920:function(e,t,r){"use strict";var n=r(4644),o=r(9213).filter,i=r(9948),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(e){var t=o(a(this),e,arguments.length>1?arguments[1]:void 0);return i(this,t)}))},1951:function(e,t,r){"use strict";var n=r(8227);t.f=n},1955:function(e,t,r){"use strict";var n,o,i,a,s,c=r(4576),u=r(3389),l=r(6080),d=r(9225).set,p=r(8265),h=r(9544),f=r(4265),m=r(7860),v=r(6193),g=c.MutationObserver||c.WebKitMutationObserver,y=c.document,E=c.process,_=c.Promise,T=u("queueMicrotask");if(!T){var I=new p,O=function(){var e,t;for(v&&(e=E.domain)&&e.exit();t=I.get();)try{t()}catch(e){throw I.head&&n(),e}e&&e.enter()};h||v||m||!g||!y?!f&&_&&_.resolve?((a=_.resolve(void 0)).constructor=_,s=l(a.then,a),n=function(){s(O)}):v?n=function(){E.nextTick(O)}:(d=l(d,c),n=function(){d(O)}):(o=!0,i=y.createTextNode(""),new g(O).observe(i,{characterData:!0}),n=function(){i.data=o=!o}),T=function(e){I.head||n(),I.add(e)}}e.exports=T},2003:function(e,t,r){"use strict";var n=r(6518),o=r(6395),i=r(916).CONSTRUCTOR,a=r(550),s=r(7751),c=r(4901),u=r(6840),l=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!o&&c(a)){var d=s("Promise").prototype.catch;l.catch!==d&&u(l,"catch",d,{unsafe:!0})}},2008:function(e,t,r){"use strict";var n=r(6518),o=r(9213).filter;n({target:"Array",proto:!0,forced:!r(597)("filter")},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},2010:function(e,t,r){"use strict";var n=r(3724),o=r(350).EXISTS,i=r(9504),a=r(2106),s=Function.prototype,c=i(s.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=i(u.exec);n&&!o&&a(s,"name",{configurable:!0,get:function(){try{return l(u,c(this))[1]}catch(e){return""}}})},2062:function(e,t,r){"use strict";var n=r(6518),o=r(9213).map;n({target:"Array",proto:!0,forced:!r(597)("map")},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},2087:function(e,t,r){"use strict";var n=r(34),o=Math.floor;e.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&o(e)===e}},2106:function(e,t,r){"use strict";var n=r(283),o=r(4913);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),o.f(e,t,r)}},2140:function(e,t,r){"use strict";var n={};n[r(8227)("toStringTag")]="z",e.exports="[object z]"===String(n)},2170:function(e,t,r){"use strict";var n=r(4644),o=r(9213).every,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},2195:function(e,t,r){"use strict";var n=r(9504),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},2211:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},2239:function(e,t,r){"use strict";e.exports=o;var n=r(3610);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new o(r,n)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(n.isString(e)){if(!n.Long)return o.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):i},o.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},o.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;o.fromHash=function(e){return e===a?i:new o((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},o.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)},o.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},o.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},o.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}},2259:function(e,t,r){"use strict";r(511)("iterator")},2293:function(e,t,r){"use strict";var n=r(8551),o=r(5548),i=r(4117),a=r(8227)("species");e.exports=function(e,t){var r,s=n(e).constructor;return void 0===s||i(r=n(s)[a])?t:o(r)}},2333:function(e,t,r){"use strict";var n=r(1291),o=r(655),i=r(7750),a=RangeError;e.exports=function(e){var t=o(i(this)),r="",s=n(e);if(s<0||s===1/0)throw new a("Wrong number of repetitions");for(;s>0;(s>>>=1)&&(t+=t))1&s&&(r+=t);return r}},2357:function(e,t,r){"use strict";var n=r(3724),o=r(9039),i=r(9504),a=r(2787),s=r(1072),c=r(5397),u=i(r(8773).f),l=i([].push),d=n&&o((function(){var e=Object.create(null);return e[2]=2,!u(e,2)})),p=function(e){return function(t){for(var r,o=c(t),i=s(o),p=d&&null===a(o),h=i.length,f=0,m=[];h>f;)r=i[f++],n&&!(p?r in o:u(o,r))||l(m,e?[r,o[r]]:o[r]);return m}};e.exports={entries:p(!0),values:p(!1)}},2360:function(e,t,r){"use strict";var n,o=r(8551),i=r(6801),a=r(8727),s=r(421),c=r(397),u=r(4055),l=r(6119),d="prototype",p="script",h=l("IE_PROTO"),f=function(){},m=function(e){return"<"+p+">"+e+"</"+p+">"},v=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;g="undefined"!=typeof document?document.domain&&n?v(n):(t=u("iframe"),r="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):v(n);for(var o=a.length;o--;)delete g[d][a[o]];return g()};s[h]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[d]=o(e),r=new f,f[d]=null,r[h]=e):r=g(),void 0===t?r:i.f(r,t)}},2405:function(e,t,r){"use strict";r(6468)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(6938))},2480:function(e,t,r){"use strict";r(5081)},2529:function(e){"use strict";e.exports=function(e,t){return{value:e,done:t}}},2549:function(e,t,r){"use strict";e.exports=r(9100)},2551:function(e,t,r){"use strict";e.exports=o;var n=r(3610);function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.create=function(e){return this.$type.create(e)},o.encode=function(e,t){return this.$type.encode(e,t)},o.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},o.decode=function(e){return this.$type.decode(e)},o.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},o.verify=function(e){return this.$type.verify(e)},o.fromObject=function(e){return this.$type.fromObject(e)},o.toObject=function(e,t){return this.$type.toObject(e,t)},o.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},2566:function(e,t){var r;r=function(e){e.version="1.2.2";var t=function(){for(var e=0,t=new Array(256),r=0;256!=r;++r)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=r)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[r]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),r=function(e){var t=0,r=0,n=0,o="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(n=0;256!=n;++n)o[n]=e[n];for(n=0;256!=n;++n)for(r=e[n],t=256+n;t<4096;t+=256)r=o[t]=r>>>8^e[255&r];var i=[];for(n=1;16!=n;++n)i[n-1]="undefined"!=typeof Int32Array?o.subarray(256*n,256*n+256):o.slice(256*n,256*n+256);return i}(t),n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],c=r[5],u=r[6],l=r[7],d=r[8],p=r[9],h=r[10],f=r[11],m=r[12],v=r[13],g=r[14];e.table=t,e.bstr=function(e,r){for(var n=-1^r,o=0,i=e.length;o<i;)n=n>>>8^t[255&(n^e.charCodeAt(o++))];return~n},e.buf=function(e,r){for(var y=-1^r,E=e.length-15,_=0;_<E;)y=g[e[_++]^255&y]^v[e[_++]^y>>8&255]^m[e[_++]^y>>16&255]^f[e[_++]^y>>>24]^h[e[_++]]^p[e[_++]]^d[e[_++]]^l[e[_++]]^u[e[_++]]^c[e[_++]]^s[e[_++]]^a[e[_++]]^i[e[_++]]^o[e[_++]]^n[e[_++]]^t[e[_++]];for(E+=15;_<E;)y=y>>>8^t[255&(y^e[_++])];return~y},e.str=function(e,r){for(var n=-1^r,o=0,i=e.length,a=0,s=0;o<i;)(a=e.charCodeAt(o++))<128?n=n>>>8^t[255&(n^a)]:a<2048?n=(n=n>>>8^t[255&(n^(192|a>>6&31))])>>>8^t[255&(n^(128|63&a))]:a>=55296&&a<57344?(a=64+(1023&a),s=1023&e.charCodeAt(o++),n=(n=(n=(n=n>>>8^t[255&(n^(240|a>>8&7))])>>>8^t[255&(n^(128|a>>2&63))])>>>8^t[255&(n^(128|s>>6&15|(3&a)<<4))])>>>8^t[255&(n^(128|63&s))]):n=(n=(n=n>>>8^t[255&(n^(224|a>>12&15))])>>>8^t[255&(n^(128|a>>6&63))])>>>8^t[255&(n^(128|63&a))];return~n}},"undefined"==typeof DO_NOT_EXPORT_CRC?r(t):r({})},2637:function(e,t,r){"use strict";r(6518)({target:"Number",stat:!0},{isInteger:r(2087)})},2652:function(e,t,r){"use strict";var n=r(6080),o=r(9565),i=r(8551),a=r(6823),s=r(4209),c=r(6198),u=r(1625),l=r(81),d=r(851),p=r(9539),h=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,r){var v,g,y,E,_,T,I,O=r&&r.that,R=!(!r||!r.AS_ENTRIES),S=!(!r||!r.IS_RECORD),b=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),N=n(t,O),A=function(e){return v&&p(v,"normal",e),new f(!0,e)},M=function(e){return R?(i(e),C?N(e[0],e[1],A):N(e[0],e[1])):C?N(e,A):N(e)};if(S)v=e.iterator;else if(b)v=e;else{if(!(g=d(e)))throw new h(a(e)+" is not iterable");if(s(g)){for(y=0,E=c(e);E>y;y++)if((_=M(e[y]))&&u(m,_))return _;return new f(!1)}v=l(e,g)}for(T=S?e.next:v.next;!(I=o(T,v)).done;){try{_=M(I.value)}catch(e){p(v,"throw",e)}if("object"==typeof _&&_&&u(m,_))return _}return new f(!1)}},2675:function(e,t,r){"use strict";r(6761),r(1510),r(7812),r(3110),r(9773)},2703:function(e,t,r){"use strict";var n=r(4576),o=r(9039),i=r(9504),a=r(655),s=r(3802).trim,c=r(7452),u=n.parseInt,l=n.Symbol,d=l&&l.iterator,p=/^[+-]?0x/i,h=i(p.exec),f=8!==u(c+"08")||22!==u(c+"0x16")||d&&!o((function(){u(Object(d))}));e.exports=f?function(e,t){var r=s(a(e));return u(r,t>>>0||(h(p,r)?16:10))}:u},2712:function(e,t,r){"use strict";var n=r(6518),o=r(926).left,i=r(4598),a=r(9519);n({target:"Array",proto:!0,forced:!r(6193)&&a>79&&a<83||!i("reduce")},{reduce:function(e){var t=arguments.length;return o(this,e,t,t>1?arguments[1]:void 0)}})},2744:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},2762:function(e,t,r){"use strict";var n=r(6518),o=r(3802).trim;n({target:"String",proto:!0,forced:r(706)("trim")},{trim:function(){return o(this)}})},2777:function(e,t,r){"use strict";var n=r(9565),o=r(34),i=r(757),a=r(5966),s=r(4270),c=r(8227),u=TypeError,l=c("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var r,c=a(e,l);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!o(r)||i(r))return r;throw new u("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},2787:function(e,t,r){"use strict";var n=r(9297),o=r(4901),i=r(8981),a=r(6119),s=r(2211),c=a("IE_PROTO"),u=Object,l=u.prototype;e.exports=s?u.getPrototypeOf:function(e){var t=i(e);if(n(t,c))return t[c];var r=t.constructor;return o(r)&&t instanceof r?r.prototype:t instanceof u?l:null}},2796:function(e,t,r){"use strict";var n=r(9039),o=r(4901),i=/#|\.prototype\./,a=function(e,t){var r=c[s(e)];return r===l||r!==u&&(o(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},2805:function(e,t,r){"use strict";var n=r(4576),o=r(9039),i=r(4428),a=r(4644).NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,c=n.Int8Array;e.exports=!a||!o((function(){c(1)}))||!o((function(){new c(-1)}))||!i((function(e){new c,new c(null),new c(1.5),new c(e)}),!0)||o((function(){return 1!==new c(new s(2),1,void 0).length}))},2812:function(e){"use strict";var t=TypeError;e.exports=function(e,r){if(e<r)throw new t("Not enough arguments");return e}},2839:function(e,t,r){"use strict";var n=r(4576).navigator,o=n&&n.userAgent;e.exports=o?String(o):""},2887:function(e,t,r){"use strict";var n=r(4576),o=r(9039),i=r(9504),a=r(4644),s=r(3792),c=r(8227)("iterator"),u=n.Uint8Array,l=i(s.values),d=i(s.keys),p=i(s.entries),h=a.aTypedArray,f=a.exportTypedArrayMethod,m=u&&u.prototype,v=!o((function(){m[c].call([1])})),g=!!m&&m.values&&m[c]===m.values&&"values"===m.values.name,y=function(){return l(h(this))};f("entries",(function(){return p(h(this))}),v),f("keys",(function(){return d(h(this))}),v),f("values",y,v||!g,{name:"values"}),f(c,y,v||!g,{name:"values"})},2892:function(e,t,r){"use strict";var n=r(6518),o=r(6395),i=r(3724),a=r(4576),s=r(9167),c=r(9504),u=r(2796),l=r(9297),d=r(3167),p=r(1625),h=r(757),f=r(2777),m=r(9039),v=r(8480).f,g=r(7347).f,y=r(4913).f,E=r(1240),_=r(3802).trim,T="Number",I=a[T],O=s[T],R=I.prototype,S=a.TypeError,b=c("".slice),C=c("".charCodeAt),N=u(T,!I(" 0o1")||!I("0b1")||I("+0x1")),A=function(e){var t,r=arguments.length<1?0:I(function(e){var t=f(e,"number");return"bigint"==typeof t?t:function(e){var t,r,n,o,i,a,s,c,u=f(e,"number");if(h(u))throw new S("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=_(u),43===(t=C(u,0))||45===t){if(88===(r=C(u,2))||120===r)return NaN}else if(48===t){switch(C(u,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+u}for(a=(i=b(u,2)).length,s=0;s<a;s++)if((c=C(i,s))<48||c>o)return NaN;return parseInt(i,n)}return+u}(t)}(e));return p(R,t=this)&&m((function(){E(t)}))?d(Object(r),this,A):r};A.prototype=R,N&&!o&&(R.constructor=A),n({global:!0,constructor:!0,wrap:!0,forced:N},{Number:A});var M=function(e,t){for(var r,n=i?v(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)l(t,r=n[o])&&!l(e,r)&&y(e,r,g(t,r))};o&&O&&M(s[T],O),(N||o)&&M(s[T],I)},2953:function(e,t,r){"use strict";var n=r(4576),o=r(7400),i=r(9296),a=r(3792),s=r(6699),c=r(687),u=r(8227)("iterator"),l=a.values,d=function(e,t){if(e){if(e[u]!==l)try{s(e,u,l)}catch(t){e[u]=l}if(c(e,t,!0),o[t])for(var r in a)if(e[r]!==a[r])try{s(e,r,a[r])}catch(t){e[r]=a[r]}}};for(var p in o)d(n[p]&&n[p].prototype,p);d(i,"DOMTokenList")},2967:function(e,t,r){"use strict";var n=r(6706),o=r(34),i=r(7750),a=r(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return i(r),a(n),o(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},3110:function(e,t,r){"use strict";var n=r(6518),o=r(7751),i=r(8745),a=r(9565),s=r(9504),c=r(9039),u=r(4901),l=r(757),d=r(7680),p=r(6933),h=r(4495),f=String,m=o("JSON","stringify"),v=s(/./.exec),g=s("".charAt),y=s("".charCodeAt),E=s("".replace),_=s(1..toString),T=/[\uD800-\uDFFF]/g,I=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,R=!h||c((function(){var e=o("Symbol")("stringify detection");return"[null]"!==m([e])||"{}"!==m({a:e})||"{}"!==m(Object(e))})),S=c((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),b=function(e,t){var r=d(arguments),n=p(t);if(u(n)||void 0!==e&&!l(e))return r[1]=function(e,t){if(u(n)&&(t=a(n,this,f(e),t)),!l(t))return t},i(m,null,r)},C=function(e,t,r){var n=g(r,t-1),o=g(r,t+1);return v(I,e)&&!v(O,o)||v(O,e)&&!v(I,n)?"\\u"+_(y(e,0),16):e};m&&n({target:"JSON",stat:!0,arity:3,forced:R||S},{stringify:function(e,t,r){var n=d(arguments),o=i(R?b:m,null,n);return S&&"string"==typeof o?E(o,T,C):o}})},3138:function(e){"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},3158:function(e,t,r){"use strict";e.exports=i;var n=r(6237);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(3610);function i(e){n.call(this,e)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},3164:function(e,t,r){"use strict";var n=r(7782),o=r(3602),i=Math.abs;e.exports=function(e,t,r,a){var s=+e,c=i(s),u=n(s);if(c<a)return u*o(c/a/t)*a*t;var l=(1+t/2220446049250313e-31)*c,d=l-(l-c);return d>r||d!=d?u*(1/0):u*d}},3167:function(e,t,r){"use strict";var n=r(4901),o=r(34),i=r(2967);e.exports=function(e,t,r){var a,s;return i&&n(a=t.constructor)&&a!==r&&o(s=a.prototype)&&s!==r.prototype&&i(e,s),e}},3179:function(e,t,r){"use strict";var n=r(2140),o=r(6955);e.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},3206:function(e,t,r){"use strict";var n=r(4644),o=r(9213).forEach,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(e){o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},3251:function(e,t,r){"use strict";var n=r(6080),o=r(9565),i=r(5548),a=r(8981),s=r(6198),c=r(81),u=r(851),l=r(4209),d=r(1108),p=r(4644).aTypedArrayConstructor,h=r(5854);e.exports=function(e){var t,r,f,m,v,g,y,E,_=i(this),T=a(e),I=arguments.length,O=I>1?arguments[1]:void 0,R=void 0!==O,S=u(T);if(S&&!l(S))for(E=(y=c(T,S)).next,T=[];!(g=o(E,y)).done;)T.push(g.value);for(R&&I>2&&(O=n(O,arguments[2])),r=s(T),f=new(p(_))(r),m=d(f),t=0;r>t;t++)v=R?O(T[t],t):T[t],f[t]=m?h(v):+v;return f}},3262:function(e,t,r){"use strict";var n,o,i=e.exports=r(3610),a=r(4529);i.codegen=r(8561),i.fetch=r(5212),i.path=r(9207),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},i.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var s=/\\/g,c=/"/g;i.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)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(s,"\\\\").replace(c,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;n||(n=r(7882));var o=new n(t||e.name);return i.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,"$type",{value:o,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:o,enumerable:!1}),o};var l=0;i.decorateEnum=function(e){if(e.$type)return e.$type;o||(o=r(5643));var t=new o("Enum"+l++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var o=r.shift();if("__proto__"===o||"prototype"===o)return t;if(r.length>0)t[o]=e(t[o]||{},r,n);else{var i=t[o];i&&(n=[].concat(i).concat(n)),t[o]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(i,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(r(5330)))}})},3288:function(e,t,r){"use strict";var n=r(9504),o=r(6840),i=Date.prototype,a="Invalid Date",s="toString",c=n(i[s]),u=n(i.getTime);String(new Date(NaN))!==a&&o(i,s,(function(){var e=u(this);return e==e?c(this):a}))},3296:function(e,t,r){"use strict";r(5806)},3362:function(e,t,r){"use strict";r(436),r(6499),r(2003),r(7743),r(1481),r(280)},3389:function(e,t,r){"use strict";var n=r(4576),o=r(3724),i=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!o)return n[e];var t=i(n,e);return t&&t.value}},3392:function(e,t,r){"use strict";var n=r(9504),o=0,i=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},3418:function(e,t,r){"use strict";var n=r(6518),o=r(7916);n({target:"Array",stat:!0,forced:!r(4428)((function(e){Array.from(e)}))},{from:o})},3438:function(e,t,r){"use strict";var n=r(8551),o=r(34),i=r(6043);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},3449:function(e,t,r){"use strict";e.exports=d;var n,o=r(3610),i=o.LongBits,a=o.base64,s=o.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(d.create=function(){return new n})()}:function(){return new d}};function h(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(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 v(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}d.create=p(),d.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(d.alloc=o.pool(d.alloc,o.Array.prototype.subarray)),d.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,i.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=i.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(h,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(v,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=i.from(e);return this._push(v,4,t.lo)._push(v,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var g=o.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var r=d.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(h,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.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 c(u,0,0),this.len=0),this},d.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},d.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},d._configure=function(e){n=e,d.create=p(),n._configure()}},3451:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(421),a=r(34),s=r(9297),c=r(4913).f,u=r(8480),l=r(298),d=r(4124),p=r(3392),h=r(2744),f=!1,m=p("meta"),v=0,g=function(e){c(e,m,{value:{objectID:"O"+v++,weakData:{}}})},y=e.exports={enable:function(){y.enable=function(){},f=!0;var e=u.f,t=o([].splice),r={};r[m]=1,e(r).length&&(u.f=function(r){for(var n=e(r),o=0,i=n.length;o<i;o++)if(n[o]===m){t(n,o,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,m)){if(!d(e))return"F";if(!t)return"E";g(e)}return e[m].objectID},getWeakData:function(e,t){if(!s(e,m)){if(!d(e))return!0;if(!t)return!1;g(e)}return e[m].weakData},onFreeze:function(e){return h&&f&&d(e)&&!s(e,m)&&g(e),e}};i[m]=!0},3500:function(e,t,r){"use strict";var n=r(4576),o=r(7400),i=r(9296),a=r(235),s=r(6699),c=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var u in o)o[u]&&c(n[u]&&n[u].prototype);c(i)},3506:function(e,t,r){"use strict";var n=r(3925),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i("Can't set "+o(e)+" as a prototype")}},3517:function(e,t,r){"use strict";var n=r(9504),o=r(9039),i=r(4901),a=r(6955),s=r(7751),c=r(3706),u=function(){},l=s("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=n(d.exec),h=!d.test(u),f=function(e){if(!i(e))return!1;try{return l(u,[],e),!0}catch(e){return!1}},m=function(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!p(d,c(e))}catch(e){return!0}};m.sham=!0,e.exports=!l||o((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?m:f},3602:function(e){"use strict";var t=4503599627370496;e.exports=function(e){return e+t-t}},3607:function(e,t,r){"use strict";var n=r(2839).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},3610:function(e,t,r){"use strict";var n=t;function o(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);return e}function i(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&&o(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}n.asPromise=r(8045),n.base64=r(8839),n.EventEmitter=r(4358),n.float=r(9410),n.inquire=r(4153),n.utf8=r(1447),n.pool=r(9390),n.LongBits=r(2239),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=o,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=i,n.ProtocolError=i("ProtocolError"),n.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]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},3635:function(e,t,r){"use strict";var n=r(9039),o=r(4576).RegExp;e.exports=n((function(){var e=o(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},3684:function(e,t,r){"use strict";var n=r(4644).exportTypedArrayMethod,o=r(9039),i=r(4576),a=r(9504),s=i.Uint8Array,c=s&&s.prototype||{},u=[].toString,l=a([].join);o((function(){u.call({})}))&&(u=function(){return l(this)});var d=c.toString!==u;n("toString",u,d)},3706:function(e,t,r){"use strict";var n=r(9504),o=r(4901),i=r(7629),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},3709:function(e,t,r){"use strict";var n=r(2839).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},3717:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},3724:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},3763:function(e,t,r){"use strict";var n=r(2839);e.exports=/MSIE|Trident/.test(n)},3792:function(e,t,r){"use strict";var n=r(5397),o=r(6469),i=r(6269),a=r(1181),s=r(4913).f,c=r(1088),u=r(2529),l=r(6395),d=r(3724),p="Array Iterator",h=a.set,f=a.getterFor(p);e.exports=c(Array,"Array",(function(e,t){h(this,{type:p,target:n(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,u(void 0,!0);switch(e.kind){case"keys":return u(r,!1);case"values":return u(t[r],!1)}return u([r,t[r]],!1)}),"values");var m=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&d&&"values"!==m.name)try{s(m,"name",{value:"values"})}catch(e){}},3802:function(e,t,r){"use strict";var n=r(9504),o=r(7750),i=r(655),a=r(7452),s=n("".replace),c=RegExp("^["+a+"]+"),u=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(e){return function(t){var r=i(o(t));return 1&e&&(r=s(r,c,"")),2&e&&(r=s(r,u,"$1")),r}};e.exports={start:l(1),end:l(2),trim:l(3)}},3887:function(e,t,r){var n,o,i;!function(a){"use strict";if(null!=t&&"number"!=typeof t.nodeType)e.exports=a();else if(null!=r.amdO)o=[],void 0===(i="function"==typeof(n=a)?n.apply(t,o):n)||(e.exports=i);else{var s=a(),c="undefined"!=typeof self?self:$.global;"function"!=typeof c.btoa&&(c.btoa=s.btoa),"function"!=typeof c.atob&&(c.atob=s.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 n,o,i=String(r),a=0,s=e,c="";i.charAt(0|a)||(s="=",a%1);c+=s.charAt(63&n>>8-a%1*8)){if((o=i.charCodeAt(a+=3/4))>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|o}return c},atob:function(r){var n=String(r).replace(/[=]+$/,"");if(n.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,i,a=0,s=0,c="";i=n.charAt(s++);~i&&(o=a%4?64*o+i:i,a++%4)?c+=String.fromCharCode(255&o>>(-2*a&6)):0)i=e.indexOf(i);return c}}}))},3925:function(e,t,r){"use strict";var n=r(34);e.exports=function(e){return n(e)||null===e}},3994:function(e,t,r){"use strict";var n=r(7657).IteratorPrototype,o=r(2360),i=r(6980),a=r(687),s=r(6269),c=function(){return this};e.exports=function(e,t,r,u){var l=t+" Iterator";return e.prototype=o(n,{next:i(+!u,r)}),a(e,l,!1,!0),s[l]=c,e}},4055:function(e,t,r){"use strict";var n=r(4576),o=r(34),i=n.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},4117:function(e){"use strict";e.exports=function(e){return null==e}},4124:function(e,t,r){"use strict";var n=r(9039),o=r(34),i=r(2195),a=r(5652),s=Object.isExtensible,c=n((function(){s(1)}));e.exports=c||a?function(e){return!!o(e)&&(!a||"ArrayBuffer"!==i(e))&&(!s||s(e))}:s},4153:function(module){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},4170:function(e,t,r){"use strict";var n=r(6518),o=r(566);n({target:"Function",proto:!0,forced:Function.bind!==o},{bind:o})},4185:function(e,t,r){"use strict";var n=r(6518),o=r(3724),i=r(4913).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!o},{defineProperty:i})},4209:function(e,t,r){"use strict";var n=r(8227),o=r(6269),i=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},4213:function(e,t,r){"use strict";var n=r(3724),o=r(9504),i=r(9565),a=r(9039),s=r(1072),c=r(3717),u=r(8773),l=r(8981),d=r(7055),p=Object.assign,h=Object.defineProperty,f=o([].concat);e.exports=!p||a((function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),o="abcdefghijklmnopqrst";return e[r]=7,o.split("").forEach((function(e){t[e]=e})),7!==p({},e)[r]||s(p({},t)).join("")!==o}))?function(e,t){for(var r=l(e),o=arguments.length,a=1,p=c.f,h=u.f;o>a;)for(var m,v=d(arguments[a++]),g=p?f(s(v),p(v)):s(v),y=g.length,E=0;y>E;)m=g[E++],n&&!i(h,v,m)||(r[m]=v[m]);return r}:p},4215:function(e,t,r){"use strict";var n=r(4576),o=r(2839),i=r(2195),a=function(e){return o.slice(0,e.length)===e};e.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},4265:function(e,t,r){"use strict";var n=r(2839);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},4270:function(e,t,r){"use strict";var n=r(9565),o=r(4901),i=r(34),a=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&o(r=e.toString)&&!i(s=n(r,e)))return s;if(o(r=e.valueOf)&&!i(s=n(r,e)))return s;if("string"!==t&&o(r=e.toString)&&!i(s=n(r,e)))return s;throw new a("Can't convert object to primitive value")}},4346:function(e,t,r){"use strict";r(6518)({target:"Array",stat:!0},{isArray:r(4376)})},4358:function(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],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},4359:function(e,t,r){"use strict";var n=r(6518),o=r(6346);n({global:!0,constructor:!0,forced:!r(7811)},{DataView:o.DataView})},4373:function(e,t,r){"use strict";var n=r(8981),o=r(5610),i=r(6198);e.exports=function(e){for(var t=n(this),r=i(t),a=arguments.length,s=o(a>1?arguments[1]:void 0,r),c=a>2?arguments[2]:void 0,u=void 0===c?r:o(c,r);u>s;)t[s++]=e;return t}},4376:function(e,t,r){"use strict";var n=r(2195);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4394:function(e,t,r){"use strict";var n=t;function o(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(3449),n.BufferWriter=r(818),n.Reader=r(6237),n.BufferReader=r(3158),n.util=r(3610),n.rpc=r(5047),n.roots=r(4529),n.configure=o,o()},4423:function(e,t,r){"use strict";var n=r(6518),o=r(9617).includes,i=r(9039),a=r(6469);n({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},4428:function(e,t,r){"use strict";var n=r(8227)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!o)return!1}catch(e){return!1}var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},4488:function(e,t,r){"use strict";var n=r(7680),o=Math.floor,i=function(e,t){var r=e.length;if(r<8)for(var a,s,c=1;c<r;){for(s=c,a=e[c];s&&t(e[s-1],a)>0;)e[s]=e[--s];s!==c++&&(e[s]=a)}else for(var u=o(r/2),l=i(n(e,0,u),t),d=i(n(e,u),t),p=l.length,h=d.length,f=0,m=0;f<p||m<h;)e[f+m]=f<p&&m<h?t(l[f],d[m])<=0?l[f++]:d[m++]:f<p?l[f++]:d[m++];return e};e.exports=i},4490:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(4376),a=o([].reverse),s=[1,2];n({target:"Array",proto:!0,forced:String(s)===String(s.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},4495:function(e,t,r){"use strict";var n=r(9519),o=r(9039),i=r(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},4496:function(e,t,r){"use strict";var n=r(4644),o=r(9617).includes,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},4527:function(e,t,r){"use strict";var n=r(3724),o=r(4376),i=TypeError,a=Object.getOwnPropertyDescriptor,s=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(o(e)&&!a(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},4529:function(e){"use strict";e.exports={}},4554:function(e,t,r){"use strict";var n=r(6518),o=r(8981),i=r(5610),a=r(1291),s=r(6198),c=r(4527),u=r(6837),l=r(1469),d=r(4659),p=r(4606),h=r(597)("splice"),f=Math.max,m=Math.min;n({target:"Array",proto:!0,forced:!h},{splice:function(e,t){var r,n,h,v,g,y,E=o(this),_=s(E),T=i(e,_),I=arguments.length;for(0===I?r=n=0:1===I?(r=0,n=_-T):(r=I-2,n=m(f(a(t),0),_-T)),u(_+r-n),h=l(E,n),v=0;v<n;v++)(g=T+v)in E&&d(h,v,E[g]);if(h.length=n,r<n){for(v=T;v<_-n;v++)y=v+r,(g=v+n)in E?E[y]=E[g]:p(E,y);for(v=_;v>_-n+r;v--)p(E,v-1)}else if(r>n)for(v=_-n;v>T;v--)y=v+r-1,(g=v+n-1)in E?E[y]=E[g]:p(E,y);for(v=0;v<r;v++)E[v+T]=arguments[v+2];return c(E,_-n+r),h}})},4576:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4598:function(e,t,r){"use strict";var n=r(9039);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){return 1},1)}))}},4599:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(9472)(o.setTimeout,!0);n({global:!0,bind:!0,forced:o.setTimeout!==i},{setTimeout:i})},4606:function(e,t,r){"use strict";var n=r(6823),o=TypeError;e.exports=function(e,t){if(!delete e[t])throw new o("Cannot delete property "+n(t)+" of "+n(e))}},4644:function(e,t,r){"use strict";var n,o,i,a=r(7811),s=r(3724),c=r(4576),u=r(4901),l=r(34),d=r(9297),p=r(6955),h=r(6823),f=r(6699),m=r(6840),v=r(2106),g=r(1625),y=r(2787),E=r(2967),_=r(8227),T=r(3392),I=r(1181),O=I.enforce,R=I.get,S=c.Int8Array,b=S&&S.prototype,C=c.Uint8ClampedArray,N=C&&C.prototype,A=S&&y(S),M=b&&y(b),w=Object.prototype,U=c.TypeError,L=_("toStringTag"),P=T("TYPED_ARRAY_TAG"),x="TypedArrayConstructor",k=a&&!!E&&"Opera"!==p(c.opera),D=!1,B={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},j={BigInt64Array:8,BigUint64Array:8},G=function(e){var t=y(e);if(l(t)){var r=R(t);return r&&d(r,x)?r[x]:G(t)}},H=function(e){if(!l(e))return!1;var t=p(e);return d(B,t)||d(j,t)};for(n in B)(i=(o=c[n])&&o.prototype)?O(i)[x]=o:k=!1;for(n in j)(i=(o=c[n])&&o.prototype)&&(O(i)[x]=o);if((!k||!u(A)||A===Function.prototype)&&(A=function(){throw new U("Incorrect invocation")},k))for(n in B)c[n]&&E(c[n],A);if((!k||!M||M===w)&&(M=A.prototype,k))for(n in B)c[n]&&E(c[n].prototype,M);if(k&&y(N)!==M&&E(N,M),s&&!d(M,L))for(n in D=!0,v(M,L,{configurable:!0,get:function(){return l(this)?this[P]:void 0}}),B)c[n]&&f(c[n],P,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:k,TYPED_ARRAY_TAG:D&&P,aTypedArray:function(e){if(H(e))return e;throw new U("Target is not a typed array")},aTypedArrayConstructor:function(e){if(u(e)&&(!E||g(A,e)))return e;throw new U(h(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(s){if(r)for(var o in B){var i=c[o];if(i&&d(i.prototype,e))try{delete i.prototype[e]}catch(r){try{i.prototype[e]=t}catch(e){}}}M[e]&&!r||m(M,e,r?t:k&&b[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,o;if(s){if(E){if(r)for(n in B)if((o=c[n])&&d(o,e))try{delete o[e]}catch(e){}if(A[e]&&!r)return;try{return m(A,e,r?t:k&&A[e]||t)}catch(e){}}for(n in B)!(o=c[n])||o[e]&&!r||m(o,e,t)}},getTypedArrayConstructor:G,isView:function(e){if(!l(e))return!1;var t=p(e);return"DataView"===t||d(B,t)||d(j,t)},isTypedArray:H,TypedArray:A,TypedArrayPrototype:M}},4659:function(e,t,r){"use strict";var n=r(3724),o=r(4913),i=r(6980);e.exports=function(e,t,r){n?o.f(e,t,i(0,r)):e[t]=r}},4743:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(6346),a=r(7633),s="ArrayBuffer",c=i[s];n({global:!0,constructor:!0,forced:o[s]!==c},{ArrayBuffer:c}),a(s)},4782:function(e,t,r){"use strict";var n=r(6518),o=r(4376),i=r(3517),a=r(34),s=r(5610),c=r(6198),u=r(5397),l=r(4659),d=r(8227),p=r(597),h=r(7680),f=p("slice"),m=d("species"),v=Array,g=Math.max;n({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var r,n,d,p=u(this),f=c(p),y=s(e,f),E=s(void 0===t?f:t,f);if(o(p)&&(r=p.constructor,(i(r)&&(r===v||o(r.prototype))||a(r)&&null===(r=r[m]))&&(r=void 0),r===v||void 0===r))return h(p,y,E);for(n=new(void 0===r?v:r)(g(E-y,0)),d=0;y<E;y++,d++)y in p&&l(n,d,p[y]);return n.length=d,n}})},4863:function(e,t,r){"use strict";e.exports=R,R.filename=null,R.defaults={keepCase:!1};var n=r(527),o=r(5330),i=r(7882),a=r(1344),s=r(8252),c=r(1457),u=r(5643),l=r(9687),d=r(8811),p=r(361),h=r(3262),f=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,v=/^0[x][0-9a-fA-F]+$/,g=/^-?0[x][0-9a-fA-F]+$/,y=/^0[0-7]+$/,E=/^-?0[0-7]+$/,_=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,T=/^[a-zA-Z_][a-zA-Z_0-9]*$/,I=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,O=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function R(e,t,r){t instanceof o||(r=t,t=new o),r||(r=R.defaults);var S,b,C,N,A,M=r.preferTrailingComment||!1,w=n(e,r.alternateCommentMode||!1),U=w.next,L=w.push,P=w.peek,x=w.skip,k=w.cmnt,D=!0,B=!1,j=t,G=r.keepCase?function(e){return e}:h.camelCase;function H(e,t,r){var n=R.filename;return r||(R.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+w.line+")")}function F(){var e,t=[];do{if('"'!==(e=U())&&"'"!==e)throw H(e);t.push(U()),x(e),e=P()}while('"'===e||"'"===e);return t.join("")}function q(e){var t=U();switch(t){case"'":case'"':return L(t),F();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e){var t=1;switch("-"===e.charAt(0)&&(t=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return t*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return t*parseInt(e,10);if(v.test(e))return t*parseInt(e,16);if(y.test(e))return t*parseInt(e,8);if(_.test(e))return t*parseFloat(e);throw H(e,"number",!0)}(t)}catch(r){if(e&&I.test(t))return t;throw H(t,"value")}}function W(e,t){var r,n;do{!t||'"'!==(r=P())&&"'"!==r?e.push([n=z(U()),x("to",!0)?z(U()):n]):e.push(F())}while(x(",",!0));x(";")}function z(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw H(e,"id");if(m.test(e))return parseInt(e,10);if(g.test(e))return parseInt(e,16);if(E.test(e))return parseInt(e,8);throw H(e,"id")}function K(){if(void 0!==S)throw H("package");if(S=U(),!I.test(S))throw H(S,"name");j=j.define(S),x(";")}function V(){var e,t=P();switch(t){case"weak":e=C||(C=[]),U();break;case"public":U();default:e=b||(b=[])}t=F(),x(";"),e.push(t)}function J(){if(x("="),N=F(),!(B="proto3"===N)&&"proto2"!==N)throw H(N,"syntax");x(";")}function Y(e,t){switch(t){case"option":return $(e,t),x(";"),!0;case"message":return function(e,t){if(!T.test(t=U()))throw H(t,"type name");var r=new i(t);X(r,(function(e){if(!Y(r,e))switch(e){case"map":!function(e){x("<");var t=U();if(void 0===p.mapKey[t])throw H(t,"type");x(",");var r=U();if(!I.test(r))throw H(r,"type");x(">");var n=U();if(!T.test(n))throw H(n,"name");x("=");var o=new s(G(n),z(U()),t,r);X(o,(function(e){if("option"!==e)throw H(e);$(o,e),x(";")}),(function(){te(o)})),e.add(o)}(r);break;case"required":case"repeated":Q(r,e);break;case"optional":Q(r,B?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!T.test(t=U()))throw H(t,"name");var r=new c(G(t));X(r,(function(e){"option"===e?($(r,e),x(";")):(L(e),Q(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":W(r.extensions||(r.extensions=[]));break;case"reserved":W(r.reserved||(r.reserved=[]),!0);break;default:if(!B||!I.test(e))throw H(e);L(e),Q(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!T.test(t=U()))throw H(t,"name");var r=new u(t);X(r,(function(e){switch(e){case"option":$(r,e),x(";");break;case"reserved":W(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!T.test(t))throw H(t,"name");x("=");var r=z(U(),!0),n={};X(n,(function(e){if("option"!==e)throw H(e);$(n,e),x(";")}),(function(){te(n)})),e.add(t,r,n.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!T.test(t=U()))throw H(t,"service name");var r=new l(t);X(r,(function(e){if(!Y(r,e)){if("rpc"!==e)throw H(e);!function(e,t){var r=k(),n=t;if(!T.test(t=U()))throw H(t,"name");var o,i,a,s,c=t;if(x("("),x("stream",!0)&&(i=!0),!I.test(t=U()))throw H(t);if(o=t,x(")"),x("returns"),x("("),x("stream",!0)&&(s=!0),!I.test(t=U()))throw H(t);a=t,x(")");var u=new d(c,n,o,a,i,s);u.comment=r,X(u,(function(e){if("option"!==e)throw H(e);$(u,e),x(";")})),e.add(u)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!I.test(t=U()))throw H(t,"reference");var r=t;X(null,(function(t){switch(t){case"required":case"repeated":Q(e,t,r);break;case"optional":Q(e,B?"proto3_optional":"optional",r);break;default:if(!B||!I.test(t))throw H(t);L(t),Q(e,"optional",r)}}))}(e,t),!0}return!1}function X(e,t,r){var n=w.line;if(e&&("string"!=typeof e.comment&&(e.comment=k()),e.filename=R.filename),x("{",!0)){for(var o;"}"!==(o=U());)t(o);x(";",!0)}else r&&r(),x(";"),e&&("string"!=typeof e.comment||M)&&(e.comment=k(n)||e.comment)}function Q(e,t,r){var n=U();if("group"!==n){if(!I.test(n))throw H(n,"type");var o=U();if(!T.test(o))throw H(o,"name");o=G(o),x("=");var s=new a(o,z(U()),n,t,r);if(X(s,(function(e){if("option"!==e)throw H(e);$(s,e),x(";")}),(function(){te(s)})),"proto3_optional"===t){var u=new c("_"+o);s.setOption("proto3_optional",!0),u.add(s),e.add(u)}else e.add(s);B||!s.repeated||void 0===p.packed[n]&&void 0!==p.basic[n]||s.setOption("packed",!1,!0)}else!function(e,t){var r=U();if(!T.test(r))throw H(r,"name");var n=h.lcFirst(r);r===n&&(r=h.ucFirst(r)),x("=");var o=z(U()),s=new i(r);s.group=!0;var c=new a(n,o,r,t);c.filename=R.filename,X(s,(function(e){switch(e){case"option":$(s,e),x(";");break;case"required":case"repeated":Q(s,e);break;case"optional":Q(s,B?"proto3_optional":"optional");break;default:throw H(e)}})),e.add(s).add(c)}(e,t)}function $(e,t){var r=x("(",!0);if(!I.test(t=U()))throw H(t,"name");var n,o=t,i=o;r&&(x(")"),i=o="("+o+")",t=P(),O.test(t)&&(n=t.substr(1),o+=t,U())),x("="),function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,i,Z(e,o),n)}function Z(e,t){if(x("{",!0)){for(var r={};!x("}",!0);){if(!T.test(A=U()))throw H(A,"name");var n,o=A;"{"===P()?n=Z(e,t+"."+A):(x(":"),"{"===P()?n=Z(e,t+"."+A):(n=q(!0),ee(e,t+"."+A,n)));var i=r[o];i&&(n=[].concat(i).concat(n)),r[o]=n,x(",",!0)}return r}var a=q(!0);return ee(e,t,a),a}function ee(e,t,r){e.setOption&&e.setOption(t,r)}function te(e){if(x("[",!0)){do{$(e,"option")}while(x(",",!0));x("]")}return e}for(;null!==(A=U());)switch(A){case"package":if(!D)throw H(A);K();break;case"import":if(!D)throw H(A);V();break;case"syntax":if(!D)throw H(A);J();break;case"option":$(j,A),x(";");break;default:if(Y(j,A)){D=!1;continue}throw H(A)}return R.filename=null,{package:S,imports:b,weakImports:C,syntax:N,root:t}}},4901:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},4913:function(e,t,r){"use strict";var n=r(3724),o=r(5917),i=r(8686),a=r(8551),s=r(6969),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",h="writable";t.f=n?i?function(e,t,r){if(a(e),t=s(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&h in r&&!r[h]){var n=l(e,t);n&&n[h]&&(e[t]=r.value,r={configurable:p in r?r[p]:n[p],enumerable:d in r?r[d]:n[d],writable:!1})}return u(e,t,r)}:u:function(e,t,r){if(a(e),t=s(t),a(r),o)try{return u(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},5031:function(e,t,r){"use strict";var n=r(7751),o=r(9504),i=r(8480),a=r(3717),s=r(8551),c=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),r=a.f;return r?c(t,r(e)):t}},5044:function(e,t,r){"use strict";var n=r(4644),o=r(4373),i=r(5854),a=r(6955),s=r(9565),c=r(9504),u=r(9039),l=n.aTypedArray,d=n.exportTypedArrayMethod,p=c("".slice);d("fill",(function(e){var t=arguments.length;l(this);var r="Big"===p(a(this),0,3)?i(e):+e;return s(o,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),u((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},5047:function(e,t,r){"use strict";t.Service=r(7595)},5081:function(e,t,r){"use strict";var n=r(6518),o=r(4576);n({global:!0,forced:o.globalThis!==o},{globalThis:o})},5086:function(e,t,r){"use strict";var n=r(6518),o=r(9213).some;n({target:"Array",proto:!0,forced:!r(4598)("some")},{some:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},5095:function(e){"use strict";e.exports=n;var t,r=/\/|\./;function n(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),n[e]=t}n("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),n("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),n("timestamp",{Timestamp:t}),n("empty",{Empty:{fields:{}}}),n("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}}}}),n("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}}}}),n("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),n.get=function(e){return n[e]||null}},5212:function(e,t,r){"use strict";e.exports=i;var n=r(8045),o=r(4153)("fs");function i(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&o&&o.readFile?o.readFile(e,(function(n,o){return n&&"undefined"!=typeof XMLHttpRequest?i.xhr(e,t,r):n?r(n):r(null,t.binary?o:o.toString("utf8"))})):i.xhr(e,t,r):n(i,this,e,t)}i.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},5276:function(e,t,r){"use strict";var n=r(6518),o=r(7476),i=r(9617).indexOf,a=r(4598),s=o([].indexOf),c=!!s&&1/s([1],1,-0)<0;n({target:"Array",proto:!0,forced:c||!a("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return c?s(this,e,t)||0:i(this,e,t)}})},5325:function(e,t,r){"use strict";var n=e.exports=r(4394);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(1080),n.decoder=r(7728),n.verifier=r(420),n.converter=r(744),n.ReflectionObject=r(7209),n.Namespace=r(8923),n.Root=r(5330),n.Enum=r(5643),n.Type=r(7882),n.Field=r(1344),n.OneOf=r(1457),n.MapField=r(8252),n.Service=r(9687),n.Method=r(8811),n.Message=r(2551),n.wrappers=r(6434),n.types=r(361),n.util=r(3262),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},5330:function(e,t,r){"use strict";e.exports=d;var n=r(8923);((d.prototype=Object.create(n.prototype)).constructor=d).className="Root";var o,i,a,s=r(1344),c=r(5643),u=r(1457),l=r(3262);function d(e){n.call(this,"",e),this.deferred=[],this.files=[]}function p(){}d.fromJSON=function(e,t){return t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=l.path.resolve,d.prototype.fetch=l.fetch,d.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var o=this;if(!n)return l.asPromise(e,o,t,r);var s=n===p;function c(e,t){if(n){var r=n;if(n=null,s)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in a)return r}return null}function d(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){i.filename=e;var n,a=i(t,o,r),d=0;if(a.imports)for(;d<a.imports.length;++d)(n=u(a.imports[d])||o.resolvePath(e,a.imports[d]))&&h(n);if(a.weakImports)for(d=0;d<a.weakImports.length;++d)(n=u(a.weakImports[d])||o.resolvePath(e,a.weakImports[d]))&&h(n,!0)}else o.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}s||f||c(null,o)}function h(e,t){if(!(o.files.indexOf(e)>-1))if(o.files.push(e),e in a)s?d(e,a[e]):(++f,setTimeout((function(){--f,d(e,a[e])})));else if(s){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}d(e,r)}else++f,o.fetch(e,(function(r,i){--f,n&&(r?t?f||c(null,o):c(r):d(e,i))}))}var f=0;l.isString(t)&&(t=[t]);for(var m,v=0;v<t.length;++v)(m=o.resolvePath("",t[v]))&&h(m);if(s)return o;f||c(null,o)},d.prototype.loadSync=function(e,t){if(!l.isNode)throw Error("not supported");return this.load(e,t,p)},d.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 n.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}d.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof c)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof o)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]);h.test(e.name)&&(e.parent[e.name]=e)}},d.prototype._handleRemove=function(e){if(e instanceof s){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 c)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);h.test(e.name)&&delete e.parent[e.name]}},d._configure=function(e,t,r){o=e,i=t,a=r}},5370:function(e,t,r){"use strict";var n=r(6198);e.exports=function(e,t,r){for(var o=0,i=arguments.length>2?r:n(t),a=new e(i);i>o;)a[o]=t[o++];return a}},5397:function(e,t,r){"use strict";var n=r(7055),o=r(7750);e.exports=function(e){return n(o(e))}},5506:function(e,t,r){"use strict";var n=r(6518),o=r(2357).entries;n({target:"Object",stat:!0},{entries:function(e){return o(e)}})},5548:function(e,t,r){"use strict";var n=r(3517),o=r(6823),i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not a constructor")}},5575:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(9472)(o.setInterval,!0);n({global:!0,bind:!0,forced:o.setInterval!==i},{setInterval:i})},5610:function(e,t,r){"use strict";var n=r(1291),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},5617:function(e,t,r){"use strict";var n=r(3164);e.exports=Math.fround||function(e){return n(e,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},5643:function(e,t,r){"use strict";e.exports=a;var n=r(7209);((a.prototype=Object.create(n.prototype)).constructor=a).className="Enum";var o=r(8923),i=r(3262);function a(e,t,r,o,i){if(n.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=o,this.comments=i||{},this.reserved=void 0,t)for(var a=Object.keys(t),s=0;s<a.length;++s)"number"==typeof t[a[s]]&&(this.valuesById[this.values[a[s]]=t[a[s]]]=a[s])}a.fromJSON=function(e,t){var r=new a(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.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])},a.prototype.add=function(e,t,r){if(!i.isString(e))throw TypeError("name must be a string");if(!i.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},a.prototype.remove=function(e){if(!i.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},a.prototype.isReservedId=function(e){return o.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return o.isReservedName(this.reserved,e)}},5652:function(e,t,r){"use strict";var n=r(9039);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},5745:function(e,t,r){"use strict";var n=r(7629);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},5749:function(e,t,r){"use strict";var n=r(788),o=TypeError;e.exports=function(e){if(n(e))throw new o("The method doesn't accept regular expressions");return e}},5806:function(e,t,r){"use strict";r(7764);var n,o=r(6518),i=r(3724),a=r(7416),s=r(4576),c=r(6080),u=r(9504),l=r(6840),d=r(2106),p=r(679),h=r(9297),f=r(4213),m=r(7916),v=r(7680),g=r(8183).codeAt,y=r(6098),E=r(655),_=r(687),T=r(2812),I=r(8406),O=r(1181),R=O.set,S=O.getterFor("URL"),b=I.URLSearchParams,C=I.getState,N=s.URL,A=s.TypeError,M=s.parseInt,w=Math.floor,U=Math.pow,L=u("".charAt),P=u(/./.exec),x=u([].join),k=u(1..toString),D=u([].pop),B=u([].push),j=u("".replace),G=u([].shift),H=u("".split),F=u("".slice),q=u("".toLowerCase),W=u([].unshift),z="Invalid scheme",K="Invalid host",V="Invalid port",J=/[a-z]/i,Y=/[\d+-.a-z]/i,X=/\d/,Q=/^0x/i,$=/^[0-7]+$/,Z=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,oe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ie=/[\t\n\r]/g,ae=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)W(t,e%256),e=w(e/256);return x(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r?n:t}(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=k(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},se={},ce=f({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),ue=f({},ce,{"#":1,"?":1,"{":1,"}":1}),le=f({},ue,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),de=function(e,t){var r=g(e,0);return r>32&&r<127&&!h(t,e)?e:encodeURIComponent(e)},pe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},he=function(e,t){var r;return 2===e.length&&P(J,L(e,0))&&(":"===(r=L(e,1))||!t&&"|"===r)},fe=function(e){var t;return e.length>1&&he(F(e,0,2))&&(2===e.length||"/"===(t=L(e,2))||"\\"===t||"?"===t||"#"===t)},me=function(e){return"."===e||"%2e"===q(e)},ve={},ge={},ye={},Ee={},_e={},Te={},Ie={},Oe={},Re={},Se={},be={},Ce={},Ne={},Ae={},Me={},we={},Ue={},Le={},Pe={},xe={},ke={},De=function(e,t,r){var n,o,i,a=E(e);if(t){if(o=this.parse(a))throw new A(o);this.searchParams=null}else{if(void 0!==r&&(n=new De(r,!0)),o=this.parse(a,null,n))throw new A(o);(i=C(new b)).bindURL(this),this.searchParams=i}};De.prototype={type:"URL",parse:function(e,t,r){var o,i,a,s,c,u=this,l=t||ve,d=0,p="",f=!1,g=!1,y=!1;for(e=E(e),t||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,e=j(e,ne,""),e=j(e,oe,"$1")),e=j(e,ie,""),o=m(e);d<=o.length;){switch(i=o[d],l){case ve:if(!i||!P(J,i)){if(t)return z;l=ye;continue}p+=q(i),l=ge;break;case ge:if(i&&(P(Y,i)||"+"===i||"-"===i||"."===i))p+=q(i);else{if(":"!==i){if(t)return z;p="",l=ye,d=0;continue}if(t&&(u.isSpecial()!==h(pe,p)||"file"===p&&(u.includesCredentials()||null!==u.port)||"file"===u.scheme&&!u.host))return;if(u.scheme=p,t)return void(u.isSpecial()&&pe[u.scheme]===u.port&&(u.port=null));p="","file"===u.scheme?l=Ae:u.isSpecial()&&r&&r.scheme===u.scheme?l=Ee:u.isSpecial()?l=Oe:"/"===o[d+1]?(l=_e,d++):(u.cannotBeABaseURL=!0,B(u.path,""),l=Pe)}break;case ye:if(!r||r.cannotBeABaseURL&&"#"!==i)return z;if(r.cannotBeABaseURL&&"#"===i){u.scheme=r.scheme,u.path=v(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,l=ke;break}l="file"===r.scheme?Ae:Te;continue;case Ee:if("/"!==i||"/"!==o[d+1]){l=Te;continue}l=Re,d++;break;case _e:if("/"===i){l=Se;break}l=Le;continue;case Te:if(u.scheme=r.scheme,i===n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query;else if("/"===i||"\\"===i&&u.isSpecial())l=Ie;else if("?"===i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query="",l=xe;else{if("#"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.path.length--,l=Le;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query,u.fragment="",l=ke}break;case Ie:if(!u.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,l=Le;continue}l=Se}else l=Re;break;case Oe:if(l=Re,"/"!==i||"/"!==L(p,d+1))continue;d++;break;case Re:if("/"!==i&&"\\"!==i){l=Se;continue}break;case Se:if("@"===i){f&&(p="%40"+p),f=!0,a=m(p);for(var _=0;_<a.length;_++){var T=a[_];if(":"!==T||y){var I=de(T,le);y?u.password+=I:u.username+=I}else y=!0}p=""}else if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(f&&""===p)return"Invalid authority";d-=m(p).length+1,p="",l=be}else p+=i;break;case be:case Ce:if(t&&"file"===u.scheme){l=we;continue}if(":"!==i||g){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(u.isSpecial()&&""===p)return K;if(t&&""===p&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(p))return s;if(p="",l=Ue,t)return;continue}"["===i?g=!0:"]"===i&&(g=!1),p+=i}else{if(""===p)return K;if(s=u.parseHost(p))return s;if(p="",l=Ne,t===Ce)return}break;case Ne:if(!P(X,i)){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()||t){if(""!==p){var O=M(p,10);if(O>65535)return V;u.port=u.isSpecial()&&O===pe[u.scheme]?null:O,p=""}if(t)return;l=Ue;continue}return V}p+=i;break;case Ae:if(u.scheme="file","/"===i||"\\"===i)l=Me;else{if(!r||"file"!==r.scheme){l=Le;continue}switch(i){case n:u.host=r.host,u.path=v(r.path),u.query=r.query;break;case"?":u.host=r.host,u.path=v(r.path),u.query="",l=xe;break;case"#":u.host=r.host,u.path=v(r.path),u.query=r.query,u.fragment="",l=ke;break;default:fe(x(v(o,d),""))||(u.host=r.host,u.path=v(r.path),u.shortenPath()),l=Le;continue}}break;case Me:if("/"===i||"\\"===i){l=we;break}r&&"file"===r.scheme&&!fe(x(v(o,d),""))&&(he(r.path[0],!0)?B(u.path,r.path[0]):u.host=r.host),l=Le;continue;case we:if(i===n||"/"===i||"\\"===i||"?"===i||"#"===i){if(!t&&he(p))l=Le;else if(""===p){if(u.host="",t)return;l=Ue}else{if(s=u.parseHost(p))return s;if("localhost"===u.host&&(u.host=""),t)return;p="",l=Ue}continue}p+=i;break;case Ue:if(u.isSpecial()){if(l=Le,"/"!==i&&"\\"!==i)continue}else if(t||"?"!==i)if(t||"#"!==i){if(i!==n&&(l=Le,"/"!==i))continue}else u.fragment="",l=ke;else u.query="",l=xe;break;case Le:if(i===n||"/"===i||"\\"===i&&u.isSpecial()||!t&&("?"===i||"#"===i)){if(".."===(c=q(c=p))||"%2e."===c||".%2e"===c||"%2e%2e"===c?(u.shortenPath(),"/"===i||"\\"===i&&u.isSpecial()||B(u.path,"")):me(p)?"/"===i||"\\"===i&&u.isSpecial()||B(u.path,""):("file"===u.scheme&&!u.path.length&&he(p)&&(u.host&&(u.host=""),p=L(p,0)+":"),B(u.path,p)),p="","file"===u.scheme&&(i===n||"?"===i||"#"===i))for(;u.path.length>1&&""===u.path[0];)G(u.path);"?"===i?(u.query="",l=xe):"#"===i&&(u.fragment="",l=ke)}else p+=de(i,ue);break;case Pe:"?"===i?(u.query="",l=xe):"#"===i?(u.fragment="",l=ke):i!==n&&(u.path[0]+=de(i,se));break;case xe:t||"#"!==i?i!==n&&("'"===i&&u.isSpecial()?u.query+="%27":u.query+="#"===i?"%23":de(i,se)):(u.fragment="",l=ke);break;case ke:i!==n&&(u.fragment+=de(i,ce))}d++}},parseHost:function(e){var t,r,n;if("["===L(e,0)){if("]"!==L(e,e.length-1))return K;if(t=function(e){var t,r,n,o,i,a,s,c=[0,0,0,0,0,0,0,0],u=0,l=null,d=0,p=function(){return L(e,d)};if(":"===p()){if(":"!==L(e,1))return;d+=2,l=++u}for(;p();){if(8===u)return;if(":"!==p()){for(t=r=0;r<4&&P(ee,p());)t=16*t+M(p(),16),d++,r++;if("."===p()){if(0===r)return;if(d-=r,u>6)return;for(n=0;p();){if(o=null,n>0){if(!("."===p()&&n<4))return;d++}if(!P(X,p()))return;for(;P(X,p());){if(i=M(p(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;d++}c[u]=256*c[u]+o,2!==++n&&4!==n||u++}if(4!==n)return;break}if(":"===p()){if(d++,!p())return}else if(p())return;c[u++]=t}else{if(null!==l)return;d++,l=++u}}if(null!==l)for(a=u-l,u=7;0!==u&&a>0;)s=c[u],c[u--]=c[l+a-1],c[l+--a]=s;else if(8!==u)return;return c}(F(e,1,-1)),!t)return K;this.host=t}else if(this.isSpecial()){if(e=y(e),P(te,e))return K;if(t=function(e){var t,r,n,o,i,a,s,c=H(e,".");if(c.length&&""===c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""===(o=c[n]))return e;if(i=10,o.length>1&&"0"===L(o,0)&&(i=P(Q,o)?16:8,o=F(o,8===i?1:2)),""===o)a=0;else{if(!P(10===i?Z:8===i?$:ee,o))return e;a=M(o,i)}B(r,a)}for(n=0;n<t;n++)if(a=r[n],n===t-1){if(a>=U(256,5-t))return null}else if(a>255)return null;for(s=D(r),n=0;n<r.length;n++)s+=r[n]*U(256,3-n);return s}(e),null===t)return K;this.host=t}else{if(P(re,e))return K;for(t="",r=m(e),n=0;n<r.length;n++)t+=de(r[n],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return h(pe,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&he(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,a=e.path,s=e.query,c=e.fragment,u=t+":";return null!==o?(u+="//",e.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=ae(o),null!==i&&(u+=":"+i)):"file"===t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+x(a,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw new A(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Be(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(E(e)+":",ve)},getUsername:function(){return this.username},setUsername:function(e){var t=m(E(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=de(t[r],le)}},getPassword:function(){return this.password},setPassword:function(e){var t=m(E(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=de(t[r],le)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,be)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ce)},getPort:function(){var e=this.port;return null===e?"":E(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=E(e))?this.port=null:this.parse(e,Ne))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+x(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Ue))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=E(e))?this.query=null:("?"===L(e,0)&&(e=F(e,1)),this.query="",this.parse(e,xe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=E(e))?("#"===L(e,0)&&(e=F(e,1)),this.fragment="",this.parse(e,ke)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Be=function(e){var t=p(this,je),r=T(arguments.length,1)>1?arguments[1]:void 0,n=R(t,new De(e,!1,r));i||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},je=Be.prototype,Ge=function(e,t){return{get:function(){return S(this)[e]()},set:t&&function(e){return S(this)[t](e)},configurable:!0,enumerable:!0}};if(i&&(d(je,"href",Ge("serialize","setHref")),d(je,"origin",Ge("getOrigin")),d(je,"protocol",Ge("getProtocol","setProtocol")),d(je,"username",Ge("getUsername","setUsername")),d(je,"password",Ge("getPassword","setPassword")),d(je,"host",Ge("getHost","setHost")),d(je,"hostname",Ge("getHostname","setHostname")),d(je,"port",Ge("getPort","setPort")),d(je,"pathname",Ge("getPathname","setPathname")),d(je,"search",Ge("getSearch","setSearch")),d(je,"searchParams",Ge("getSearchParams")),d(je,"hash",Ge("getHash","setHash"))),l(je,"toJSON",(function(){return S(this).serialize()}),{enumerable:!0}),l(je,"toString",(function(){return S(this).serialize()}),{enumerable:!0}),N){var He=N.createObjectURL,Fe=N.revokeObjectURL;He&&l(Be,"createObjectURL",c(He,N)),Fe&&l(Be,"revokeObjectURL",c(Fe,N))}_(Be,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:Be})},5823:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(9565),a=r(3724),s=r(2805),c=r(4644),u=r(6346),l=r(679),d=r(6980),p=r(6699),h=r(2087),f=r(8014),m=r(7696),v=r(8229),g=r(8319),y=r(6969),E=r(9297),_=r(6955),T=r(34),I=r(757),O=r(2360),R=r(1625),S=r(2967),b=r(8480).f,C=r(3251),N=r(9213).forEach,A=r(7633),M=r(2106),w=r(4913),U=r(7347),L=r(5370),P=r(1181),x=r(3167),k=P.get,D=P.set,B=P.enforce,j=w.f,G=U.f,H=o.RangeError,F=u.ArrayBuffer,q=F.prototype,W=u.DataView,z=c.NATIVE_ARRAY_BUFFER_VIEWS,K=c.TYPED_ARRAY_TAG,V=c.TypedArray,J=c.TypedArrayPrototype,Y=c.isTypedArray,X="BYTES_PER_ELEMENT",Q="Wrong length",$=function(e,t){M(e,t,{configurable:!0,get:function(){return k(this)[t]}})},Z=function(e){var t;return R(q,e)||"ArrayBuffer"===(t=_(e))||"SharedArrayBuffer"===t},ee=function(e,t){return Y(e)&&!I(t)&&t in e&&h(+t)&&t>=0},te=function(e,t){return t=y(t),ee(e,t)?d(2,e[t]):G(e,t)},re=function(e,t,r){return t=y(t),!(ee(e,t)&&T(r)&&E(r,"value"))||E(r,"get")||E(r,"set")||r.configurable||E(r,"writable")&&!r.writable||E(r,"enumerable")&&!r.enumerable?j(e,t,r):(e[t]=r.value,e)};a?(z||(U.f=te,w.f=re,$(J,"buffer"),$(J,"byteOffset"),$(J,"byteLength"),$(J,"length")),n({target:"Object",stat:!0,forced:!z},{getOwnPropertyDescriptor:te,defineProperty:re}),e.exports=function(e,t,r){var a=e.match(/\d+/)[0]/8,c=e+(r?"Clamped":"")+"Array",u="get"+e,d="set"+e,h=o[c],y=h,E=y&&y.prototype,_={},I=function(e,t){j(e,t,{get:function(){return function(e,t){var r=k(e);return r.view[u](t*a+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var o=k(e);o.view[d](t*a+o.byteOffset,r?g(n):n,!0)}(this,t,e)},enumerable:!0})};z?s&&(y=t((function(e,t,r,n){return l(e,E),x(T(t)?Z(t)?void 0!==n?new h(t,v(r,a),n):void 0!==r?new h(t,v(r,a)):new h(t):Y(t)?L(y,t):i(C,y,t):new h(m(t)),e,y)})),S&&S(y,V),N(b(h),(function(e){e in y||p(y,e,h[e])})),y.prototype=E):(y=t((function(e,t,r,n){l(e,E);var o,s,c,u=0,d=0;if(T(t)){if(!Z(t))return Y(t)?L(y,t):i(C,y,t);o=t,d=v(r,a);var p=t.byteLength;if(void 0===n){if(p%a)throw new H(Q);if((s=p-d)<0)throw new H(Q)}else if((s=f(n)*a)+d>p)throw new H(Q);c=s/a}else c=m(t),o=new F(s=c*a);for(D(e,{buffer:o,byteOffset:d,byteLength:s,length:c,view:new W(o)});u<c;)I(e,u++)})),S&&S(y,V),E=y.prototype=O(J)),E.constructor!==y&&p(E,"constructor",y),B(E).TypedArrayConstructor=y,K&&p(E,K,c);var R=y!==h;_[c]=y,n({global:!0,constructor:!0,forced:R,sham:!z},_),X in y||p(y,X,a),X in E||p(E,X,a),A(c)}):e.exports=function(){}},5854:function(e,t,r){"use strict";var n=r(2777),o=TypeError;e.exports=function(e){var t=n(e,"number");if("number"==typeof t)throw new o("Can't convert number to bigint");return BigInt(t)}},5917:function(e,t,r){"use strict";var n=r(3724),o=r(9039),i=r(4055);e.exports=!n&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},5966:function(e,t,r){"use strict";var n=r(9306),o=r(4117);e.exports=function(e,t){var r=e[t];return o(r)?void 0:n(r)}},6031:function(e,t,r){"use strict";r(5575),r(4599)},6033:function(e,t,r){"use strict";r(8523)},6034:function(e,t,r){"use strict";var n=r(6518),o=r(2357).values;n({target:"Object",stat:!0},{values:function(e){return o(e)}})},6043:function(e,t,r){"use strict";var n=r(9306),o=TypeError,i=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw new o("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new i(e)}},6072:function(e,t,r){"use strict";var n=r(4644),o=r(926).right,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},6080:function(e,t,r){"use strict";var n=r(7476),o=r(9306),i=r(616),a=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},6098:function(e,t,r){"use strict";var n=r(9504),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",c=RangeError,u=n(a.exec),l=Math.floor,d=String.fromCharCode,p=n("".charCodeAt),h=n([].join),f=n([].push),m=n("".replace),v=n("".split),g=n("".toLowerCase),y=function(e){return e+22+75*(e<26)},E=function(e,t,r){var n=0;for(e=r?l(e/700):e>>1,e+=l(e/t);e>455;)e=l(e/35),n+=36;return l(n+36*e/(e+38))},_=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=p(e,r++);if(o>=55296&&o<=56319&&r<n){var i=p(e,r++);56320==(64512&i)?f(t,((1023&o)<<10)+(1023&i)+65536):(f(t,o),r--)}else f(t,o)}return t}(e);var r,n,i=e.length,a=128,u=0,m=72;for(r=0;r<e.length;r++)(n=e[r])<128&&f(t,d(n));var v=t.length,g=v;for(v&&f(t,"-");g<i;){var _=o;for(r=0;r<e.length;r++)(n=e[r])>=a&&n<_&&(_=n);var T=g+1;if(_-a>l((o-u)/T))throw new c(s);for(u+=(_-a)*T,a=_,r=0;r<e.length;r++){if((n=e[r])<a&&++u>o)throw new c(s);if(n===a){for(var I=u,O=36;;){var R=O<=m?1:O>=m+26?26:O-m;if(I<R)break;var S=I-R,b=36-R;f(t,d(y(R+S%b))),I=l(S/b),O+=36}f(t,d(y(I))),m=E(u,T,g===v),u=0,g++}}u++,a++}return h(t,"")};e.exports=function(e){var t,r,n=[],o=v(m(g(e),a,"."),".");for(t=0;t<o.length;t++)r=o[t],f(n,u(i,r)?"xn--"+_(r):r);return h(n,".")}},6099:function(e,t,r){"use strict";var n=r(2140),o=r(6840),i=r(3179);n||o(Object.prototype,"toString",i,{unsafe:!0})},6119:function(e,t,r){"use strict";var n=r(5745),o=r(3392),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},6193:function(e,t,r){"use strict";var n=r(4215);e.exports="NODE"===n},6198:function(e,t,r){"use strict";var n=r(8014);e.exports=function(e){return n(e.length)}},6237:function(e,t,r){"use strict";e.exports=c;var n,o=r(3610),i=o.LongBits,a=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},d=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l};function p(){var e=new i(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 h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw s(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=d(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.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}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.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)},c.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},c.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},c.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},c._configure=function(e){n=e,c.create=d(),n._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},6269:function(e){"use strict";e.exports={}},6279:function(e,t,r){"use strict";var n=r(6840);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},6319:function(e,t,r){"use strict";var n=r(8551),o=r(9539);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){o(e,"throw",t)}}},6346:function(e,t,r){"use strict";var n=r(4576),o=r(9504),i=r(3724),a=r(7811),s=r(350),c=r(6699),u=r(2106),l=r(6279),d=r(9039),p=r(679),h=r(1291),f=r(8014),m=r(7696),v=r(5617),g=r(8490),y=r(2787),E=r(2967),_=r(4373),T=r(7680),I=r(3167),O=r(7740),R=r(687),S=r(1181),b=s.PROPER,C=s.CONFIGURABLE,N="ArrayBuffer",A="DataView",M="prototype",w="Wrong index",U=S.getterFor(N),L=S.getterFor(A),P=S.set,x=n[N],k=x,D=k&&k[M],B=n[A],j=B&&B[M],G=Object.prototype,H=n.Array,F=n.RangeError,q=o(_),W=o([].reverse),z=g.pack,K=g.unpack,V=function(e){return[255&e]},J=function(e){return[255&e,e>>8&255]},Y=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},X=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Q=function(e){return z(v(e),23,4)},$=function(e){return z(e,52,8)},Z=function(e,t,r){u(e[M],t,{configurable:!0,get:function(){return r(this)[t]}})},ee=function(e,t,r,n){var o=L(e),i=m(r),a=!!n;if(i+t>o.byteLength)throw new F(w);var s=o.bytes,c=i+o.byteOffset,u=T(s,c,c+t);return a?u:W(u)},te=function(e,t,r,n,o,i){var a=L(e),s=m(r),c=n(+o),u=!!i;if(s+t>a.byteLength)throw new F(w);for(var l=a.bytes,d=s+a.byteOffset,p=0;p<t;p++)l[d+p]=c[u?p:t-p-1]};if(a){var re=b&&x.name!==N;d((function(){x(1)}))&&d((function(){new x(-1)}))&&!d((function(){return new x,new x(1.5),new x(NaN),1!==x.length||re&&!C}))?re&&C&&c(x,"name",N):((k=function(e){return p(this,D),I(new x(m(e)),this,k)})[M]=D,D.constructor=k,O(k,x)),E&&y(j)!==G&&E(j,G);var ne=new B(new k(2)),oe=o(j.setInt8);ne.setInt8(0,2147483648),ne.setInt8(1,2147483649),!ne.getInt8(0)&&ne.getInt8(1)||l(j,{setInt8:function(e,t){oe(this,e,t<<24>>24)},setUint8:function(e,t){oe(this,e,t<<24>>24)}},{unsafe:!0})}else D=(k=function(e){p(this,D);var t=m(e);P(this,{type:N,bytes:q(H(t),0),byteLength:t}),i||(this.byteLength=t,this.detached=!1)})[M],j=(B=function(e,t,r){p(this,j),p(e,D);var n=U(e),o=n.byteLength,a=h(t);if(a<0||a>o)throw new F("Wrong offset");if(a+(r=void 0===r?o-a:f(r))>o)throw new F("Wrong length");P(this,{type:A,buffer:e,byteLength:r,byteOffset:a,bytes:n.bytes}),i||(this.buffer=e,this.byteLength=r,this.byteOffset=a)})[M],i&&(Z(k,"byteLength",U),Z(B,"buffer",L),Z(B,"byteLength",L),Z(B,"byteOffset",L)),l(j,{getInt8:function(e){return ee(this,1,e)[0]<<24>>24},getUint8:function(e){return ee(this,1,e)[0]},getInt16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return X(ee(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return X(ee(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return K(ee(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return K(ee(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){te(this,1,e,V,t)},setUint8:function(e,t){te(this,1,e,V,t)},setInt16:function(e,t){te(this,2,e,J,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){te(this,2,e,J,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){te(this,4,e,Y,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){te(this,4,e,Y,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){te(this,4,e,Q,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){te(this,8,e,$,t,arguments.length>2&&arguments[2])}});R(k,N),R(B,A),e.exports={ArrayBuffer:k,DataView:B}},6395:function(e){"use strict";e.exports=!1},6434:function(e,t,r){"use strict";var n=t,o=r(2551);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(n);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof o){var a=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),a["@type"]=n,a}return this.toObject(e,t)}}},6468:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(9504),a=r(2796),s=r(6840),c=r(3451),u=r(2652),l=r(679),d=r(4901),p=r(4117),h=r(34),f=r(9039),m=r(4428),v=r(687),g=r(3167);e.exports=function(e,t,r){var y=-1!==e.indexOf("Map"),E=-1!==e.indexOf("Weak"),_=y?"set":"add",T=o[e],I=T&&T.prototype,O=T,R={},S=function(e){var t=i(I[e]);s(I,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(E&&!h(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return E&&!h(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(E&&!h(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(a(e,!d(T)||!(E||I.forEach&&!f((function(){(new T).entries().next()})))))O=r.getConstructor(t,e,y,_),c.enable();else if(a(e,!0)){var b=new O,C=b[_](E?{}:-0,1)!==b,N=f((function(){b.has(1)})),A=m((function(e){new T(e)})),M=!E&&f((function(){for(var e=new T,t=5;t--;)e[_](t,t);return!e.has(-0)}));A||((O=t((function(e,t){l(e,I);var r=g(new T,e,O);return p(t)||u(t,r[_],{that:r,AS_ENTRIES:y}),r}))).prototype=I,I.constructor=O),(N||M)&&(S("delete"),S("has"),y&&S("get")),(M||C)&&S(_),E&&I.clear&&delete I.clear}return R[e]=O,n({global:!0,constructor:!0,forced:O!==T},R),v(O,e),E||r.setStrong(O,e,y),O}},6469:function(e,t,r){"use strict";var n=r(8227),o=r(2360),i=r(4913).f,a=n("unscopables"),s=Array.prototype;void 0===s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},6499:function(e,t,r){"use strict";var n=r(6518),o=r(9565),i=r(9306),a=r(6043),s=r(1103),c=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{all:function(e){var t=this,r=a.f(t),n=r.resolve,u=r.reject,l=s((function(){var r=i(t.resolve),a=[],s=0,l=1;c(e,(function(e){var i=s++,c=!1;l++,o(r,t,e).then((function(e){c||(c=!0,a[i]=e,--l||n(a))}),u)})),--l||n(a)}));return l.error&&u(l.value),r.promise}})},6518:function(e,t,r){"use strict";var n=r(4576),o=r(7347).f,i=r(6699),a=r(6840),s=r(9433),c=r(7740),u=r(2796);e.exports=function(e,t){var r,l,d,p,h,f=e.target,m=e.global,v=e.stat;if(r=m?n:v?n[f]||s(f,{}):n[f]&&n[f].prototype)for(l in t){if(p=t[l],d=e.dontCallGetSet?(h=o(r,l))&&h.value:r[l],!u(m?l:f+(v?".":"#")+l,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),a(r,l,p,e)}}},6614:function(e,t,r){"use strict";var n=r(4644),o=r(8014),i=r(5610),a=n.aTypedArray,s=n.getTypedArrayConstructor;(0,n.exportTypedArrayMethod)("subarray",(function(e,t){var r=a(this),n=r.length,c=i(e,n);return new(s(r))(r.buffer,r.byteOffset+c*r.BYTES_PER_ELEMENT,o((void 0===t?n:i(t,n))-c))}))},6651:function(e,t,r){"use strict";var n=r(4644),o=r(9617).indexOf,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},6682:function(e,t,r){"use strict";var n=r(9565),o=r(8551),i=r(4901),a=r(2195),s=r(7323),c=TypeError;e.exports=function(e,t){var r=e.exec;if(i(r)){var u=n(r,e,t);return null!==u&&o(u),u}if("RegExp"===a(e))return n(s,e,t);throw new c("RegExp#exec called on incompatible receiver")}},6699:function(e,t,r){"use strict";var n=r(3724),o=r(4913),i=r(6980);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},6706:function(e,t,r){"use strict";var n=r(9504),o=r(9306);e.exports=function(e,t,r){try{return n(o(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},6761:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(9565),a=r(9504),s=r(6395),c=r(3724),u=r(4495),l=r(9039),d=r(9297),p=r(1625),h=r(8551),f=r(5397),m=r(6969),v=r(655),g=r(6980),y=r(2360),E=r(1072),_=r(8480),T=r(298),I=r(3717),O=r(7347),R=r(4913),S=r(6801),b=r(8773),C=r(6840),N=r(2106),A=r(5745),M=r(6119),w=r(421),U=r(3392),L=r(8227),P=r(1951),x=r(511),k=r(8242),D=r(687),B=r(1181),j=r(9213).forEach,G=M("hidden"),H="Symbol",F="prototype",q=B.set,W=B.getterFor(H),z=Object[F],K=o.Symbol,V=K&&K[F],J=o.RangeError,Y=o.TypeError,X=o.QObject,Q=O.f,$=R.f,Z=T.f,ee=b.f,te=a([].push),re=A("symbols"),ne=A("op-symbols"),oe=A("wks"),ie=!X||!X[F]||!X[F].findChild,ae=function(e,t,r){var n=Q(z,t);n&&delete z[t],$(e,t,r),n&&e!==z&&$(z,t,n)},se=c&&l((function(){return 7!==y($({},"a",{get:function(){return $(this,"a",{value:7}).a}})).a}))?ae:$,ce=function(e,t){var r=re[e]=y(V);return q(r,{type:H,tag:e,description:t}),c||(r.description=t),r},ue=function(e,t,r){e===z&&ue(ne,t,r),h(e);var n=m(t);return h(r),d(re,n)?(r.enumerable?(d(e,G)&&e[G][n]&&(e[G][n]=!1),r=y(r,{enumerable:g(0,!1)})):(d(e,G)||$(e,G,g(1,y(null))),e[G][n]=!0),se(e,n,r)):$(e,n,r)},le=function(e,t){h(e);var r=f(t),n=E(r).concat(fe(r));return j(n,(function(t){c&&!i(de,r,t)||ue(e,t,r[t])})),e},de=function(e){var t=m(e),r=i(ee,this,t);return!(this===z&&d(re,t)&&!d(ne,t))&&(!(r||!d(this,t)||!d(re,t)||d(this,G)&&this[G][t])||r)},pe=function(e,t){var r=f(e),n=m(t);if(r!==z||!d(re,n)||d(ne,n)){var o=Q(r,n);return!o||!d(re,n)||d(r,G)&&r[G][n]||(o.enumerable=!0),o}},he=function(e){var t=Z(f(e)),r=[];return j(t,(function(e){d(re,e)||d(w,e)||te(r,e)})),r},fe=function(e){var t=e===z,r=Z(t?ne:f(e)),n=[];return j(r,(function(e){!d(re,e)||t&&!d(z,e)||te(n,re[e])})),n};u||(K=function(){if(p(V,this))throw new Y("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,t=U(e),r=function(e){var n=void 0===this?o:this;n===z&&i(r,ne,e),d(n,G)&&d(n[G],t)&&(n[G][t]=!1);var a=g(1,e);try{se(n,t,a)}catch(e){if(!(e instanceof J))throw e;ae(n,t,a)}};return c&&ie&&se(z,t,{configurable:!0,set:r}),ce(t,e)},C(V=K[F],"toString",(function(){return W(this).tag})),C(K,"withoutSetter",(function(e){return ce(U(e),e)})),b.f=de,R.f=ue,S.f=le,O.f=pe,_.f=T.f=he,I.f=fe,P.f=function(e){return ce(L(e),e)},c&&(N(V,"description",{configurable:!0,get:function(){return W(this).description}}),s||C(z,"propertyIsEnumerable",de,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!u,sham:!u},{Symbol:K}),j(E(oe),(function(e){x(e)})),n({target:H,stat:!0,forced:!u},{useSetter:function(){ie=!0},useSimple:function(){ie=!1}}),n({target:"Object",stat:!0,forced:!u,sham:!c},{create:function(e,t){return void 0===t?y(e):le(y(e),t)},defineProperty:ue,defineProperties:le,getOwnPropertyDescriptor:pe}),n({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:he}),k(),D(K,H),w[G]=!0},6801:function(e,t,r){"use strict";var n=r(3724),o=r(8686),i=r(4913),a=r(8551),s=r(5397),c=r(1072);t.f=n&&!o?Object.defineProperties:function(e,t){a(e);for(var r,n=s(t),o=c(t),u=o.length,l=0;u>l;)i.f(e,r=o[l++],n[r]);return e}},6812:function(e,t,r){"use strict";var n=r(4644),o=r(8745),i=r(8379),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return o(i,a(this),t>1?[e,arguments[1]]:[e])}))},6823:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6837:function(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},6840:function(e,t,r){"use strict";var n=r(4901),o=r(4913),i=r(283),a=r(9433);e.exports=function(e,t,r,s){s||(s={});var c=s.enumerable,u=void 0!==s.name?s.name:t;if(n(r)&&i(r,u,s),s.global)c?e[t]=r:a(t,r);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=r:o.f(e,t,{value:r,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},6910:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(9306),a=r(8981),s=r(6198),c=r(4606),u=r(655),l=r(9039),d=r(4488),p=r(4598),h=r(3709),f=r(3763),m=r(9519),v=r(3607),g=[],y=o(g.sort),E=o(g.push),_=l((function(){g.sort(void 0)})),T=l((function(){g.sort(null)})),I=p("sort"),O=!l((function(){if(m)return m<70;if(!(h&&h>3)){if(f)return!0;if(v)return v<603;var e,t,r,n,o="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)g.push({k:t+n,v:r})}for(g.sort((function(e,t){return t.v-e.v})),n=0;n<g.length;n++)t=g[n].k.charAt(0),o.charAt(o.length-1)!==t&&(o+=t);return"DGBEFHACIJK"!==o}}));n({target:"Array",proto:!0,forced:_||!T||!I||!O},{sort:function(e){void 0!==e&&i(e);var t=a(this);if(O)return void 0===e?y(t):y(t,e);var r,n,o=[],l=s(t);for(n=0;n<l;n++)n in t&&E(o,t[n]);for(d(o,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:u(t)>u(r)?1:-1}}(e)),r=s(o),n=0;n<r;)t[n]=o[n++];for(;n<l;)c(t,n++);return t}})},6933:function(e,t,r){"use strict";var n=r(9504),o=r(4376),i=r(4901),a=r(2195),s=r(655),c=n([].push);e.exports=function(e){if(i(e))return e;if(o(e)){for(var t=e.length,r=[],n=0;n<t;n++){var u=e[n];"string"==typeof u?c(r,u):"number"!=typeof u&&"Number"!==a(u)&&"String"!==a(u)||c(r,s(u))}var l=r.length,d=!0;return function(e,t){if(d)return d=!1,t;if(o(this))return t;for(var n=0;n<l;n++)if(r[n]===e)return t}}}},6938:function(e,t,r){"use strict";var n=r(2360),o=r(2106),i=r(6279),a=r(6080),s=r(679),c=r(4117),u=r(2652),l=r(1088),d=r(2529),p=r(7633),h=r(3724),f=r(3451).fastKey,m=r(1181),v=m.set,g=m.getterFor;e.exports={getConstructor:function(e,t,r,l){var d=e((function(e,o){s(e,p),v(e,{type:t,index:n(null),first:null,last:null,size:0}),h||(e.size=0),c(o)||u(o,e[l],{that:e,AS_ENTRIES:r})})),p=d.prototype,m=g(t),y=function(e,t,r){var n,o,i=m(e),a=E(e,t);return a?a.value=r:(i.last=a={index:o=f(t,!0),key:t,value:r,previous:n=i.last,next:null,removed:!1},i.first||(i.first=a),n&&(n.next=a),h?i.size++:e.size++,"F"!==o&&(i.index[o]=a)),e},E=function(e,t){var r,n=m(e),o=f(t);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key===t)return r};return i(p,{clear:function(){for(var e=m(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=null),t=t.next;e.first=e.last=null,e.index=n(null),h?e.size=0:this.size=0},delete:function(e){var t=this,r=m(t),n=E(t,e);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first===n&&(r.first=o),r.last===n&&(r.last=i),h?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=m(this),n=a(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!E(this,e)}}),i(p,r?{get:function(e){var t=E(this,e);return t&&t.value},set:function(e,t){return y(this,0===e?0:e,t)}}:{add:function(e){return y(this,e=0===e?0:e,e)}}),h&&o(p,"size",{configurable:!0,get:function(){return m(this).size}}),d},setStrong:function(e,t,r){var n=t+" Iterator",o=g(t),i=g(n);l(e,t,(function(e,t){v(this,{type:n,target:e,state:o(e),kind:t,last:null})}),(function(){for(var e=i(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?d("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=null,d(void 0,!0))}),r?"entries":"values",!r,!0),p(t)}}},6955:function(e,t,r){"use strict";var n=r(2140),o=r(4901),i=r(2195),a=r(8227)("toStringTag"),s=Object,c="Arguments"===i(function(){return arguments}());e.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?r:c?i(t):"Object"===(n=i(t))&&o(t.callee)?"Arguments":n}},6969:function(e,t,r){"use strict";var n=r(2777),o=r(757);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},6980:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7029:function(e,t,r){"use strict";var n=r(8981),o=r(5610),i=r(6198),a=r(4606),s=Math.min;e.exports=[].copyWithin||function(e,t){var r=n(this),c=i(r),u=o(e,c),l=o(t,c),d=arguments.length>2?arguments[2]:void 0,p=s((void 0===d?c:o(d,c))-l,c-u),h=1;for(l<u&&u<l+p&&(h=-1,l+=p-1,u+=p-1);p-- >0;)l in r?r[u]=r[l]:a(r,u),u+=h,l+=h;return r}},7040:function(e,t,r){"use strict";var n=r(4495);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:function(e,t,r){"use strict";var n=r(9504),o=r(9039),i=r(2195),a=Object,s=n("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?s(e,""):a(e)}:a},7208:function(e,t,r){"use strict";var n=r(6518),o=r(9565);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return o(URL.prototype.toString,this)}})},7209:function(e,t,r){"use strict";e.exports=i,i.className="ReflectionObject";var n,o=r(3262);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.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}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.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var i=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var a=i[e];o.setProperty(a,r,t)}else(i={})[e]=o.setProperty({},r,t),n.push(i)}else{var s={};s[e]=t,n.push(s)}return this},i.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],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=e}},7301:function(e,t,r){"use strict";var n=r(4644),o=r(9213).some,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},7323:function(e,t,r){"use strict";var n,o,i=r(9565),a=r(9504),s=r(655),c=r(7979),u=r(8429),l=r(5745),d=r(2360),p=r(1181).get,h=r(3635),f=r(8814),m=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,g=v,y=a("".charAt),E=a("".indexOf),_=a("".replace),T=a("".slice),I=(o=/b*/g,i(v,n=/a/,"a"),i(v,o,"a"),0!==n.lastIndex||0!==o.lastIndex),O=u.BROKEN_CARET,R=void 0!==/()??/.exec("")[1];(I||R||O||h||f)&&(g=function(e){var t,r,n,o,a,u,l,h=this,f=p(h),S=s(e),b=f.raw;if(b)return b.lastIndex=h.lastIndex,t=i(g,b,S),h.lastIndex=b.lastIndex,t;var C=f.groups,N=O&&h.sticky,A=i(c,h),M=h.source,w=0,U=S;if(N&&(A=_(A,"y",""),-1===E(A,"g")&&(A+="g"),U=T(S,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==y(S,h.lastIndex-1))&&(M="(?: "+M+")",U=" "+U,w++),r=new RegExp("^(?:"+M+")",A)),R&&(r=new RegExp("^"+M+"$(?!\\s)",A)),I&&(n=h.lastIndex),o=i(v,N?r:h,U),N?o?(o.input=T(o.input,w),o[0]=T(o[0],w),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:I&&o&&(h.lastIndex=h.global?o.index+o[0].length:n),R&&o&&o.length>1&&i(m,o[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)})),o&&C)for(o.groups=u=d(null),a=0;a<C.length;a++)u[(l=C[a])[0]]=o[l[1]];return o}),e.exports=g},7337:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(5610),a=RangeError,s=String.fromCharCode,c=String.fromCodePoint,u=o([].join);n({target:"String",stat:!0,arity:1,forced:!!c&&1!==c.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,o=0;n>o;){if(t=+arguments[o++],i(t,1114111)!==t)throw new a(t+" is not a valid code point");r[o]=t<65536?s(t):s(55296+((t-=65536)>>10),t%1024+56320)}return u(r,"")}})},7347:function(e,t,r){"use strict";var n=r(3724),o=r(9565),i=r(8773),a=r(6980),s=r(5397),c=r(6969),u=r(9297),l=r(5917),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=s(e),t=c(t),l)try{return d(e,t)}catch(e){}if(u(e,t))return a(!o(i.f,e,t),e[t])}},7400:function(e){"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},7416:function(e,t,r){"use strict";var n=r(9039),o=r(8227),i=r(3724),a=r(6395),s=o("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),r.delete("a",2),r.delete("b",void 0),a&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(a||!i)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host}))},7433:function(e,t,r){"use strict";var n=r(4376),o=r(3517),i=r(34),a=r(8227)("species"),s=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(o(t)&&(t===s||n(t.prototype))||i(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?s:t}},7452:function(e){"use strict";e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},7476:function(e,t,r){"use strict";var n=r(2195),o=r(9504);e.exports=function(e){if("Function"===n(e))return o(e)}},7495:function(e,t,r){"use strict";var n=r(6518),o=r(7323);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},7595:function(e,t,r){"use strict";e.exports=o;var n=r(3610);function o(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(o.prototype=Object.create(n.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,r,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,o,i);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e);if(null!==r){if(!(r instanceof o))try{r=o[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7629:function(e,t,r){"use strict";var n=r(6395),o=r(4576),i=r(9433),a="__core-js_shared__",s=e.exports=o[a]||i(a,{});(s.versions||(s.versions=[])).push({version:"3.42.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7633:function(e,t,r){"use strict";var n=r(7751),o=r(2106),i=r(8227),a=r(3724),s=i("species");e.exports=function(e){var t=n(e);a&&t&&!t[s]&&o(t,s,{configurable:!0,get:function(){return this}})}},7657:function(e,t,r){"use strict";var n,o,i,a=r(9039),s=r(4901),c=r(34),u=r(2360),l=r(2787),d=r(6840),p=r(8227),h=r(6395),f=p("iterator"),m=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(n=o):m=!0),!c(n)||a((function(){var e={};return n[f].call(e)!==e}))?n={}:h&&(n=u(n)),s(n[f])||d(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},7680:function(e,t,r){"use strict";var n=r(9504);e.exports=n([].slice)},7696:function(e,t,r){"use strict";var n=r(1291),o=r(8014),i=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=o(t);if(t!==r)throw new i("Wrong length or index");return r}},7728:function(e,t,r){"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var s=e._fieldsArray[r].resolve(),c=s.resolvedType instanceof n?"int32":s.type,u="m"+i.safeProp(s.name);t("case %i:",s.id),s.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==o.defaults[s.keyType]?t("k=%j",o.defaults[s.keyType]):t("k=null"),void 0!==o.defaults[c]?t("value=%j",o.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===o.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==o.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):s.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==o.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===o.basic[c]?t(s.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,c)):void 0===o.basic[c]?t(s.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var l=e._fieldsArray[r];l.required&&t("if(!m.hasOwnProperty(%j))",l.name)("throw util.ProtocolError(%j,{instance:m})",a(l))}return t("return m")};var n=r(5643),o=r(361),i=r(3262);function a(e){return"missing required '"+e.name+"'"}},7740:function(e,t,r){"use strict";var n=r(9297),o=r(5031),i=r(7347),a=r(4913);e.exports=function(e,t,r){for(var s=o(t),c=a.f,u=i.f,l=0;l<s.length;l++){var d=s[l];n(e,d)||r&&n(r,d)||c(e,d,u(t,d))}}},7743:function(e,t,r){"use strict";var n=r(6518),o=r(9565),i=r(9306),a=r(6043),s=r(1103),c=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{race:function(e){var t=this,r=a.f(t),n=r.reject,u=s((function(){var a=i(t.resolve);c(e,(function(e){o(a,t,e).then(r.resolve,n)}))}));return u.error&&n(u.value),r.promise}})},7750:function(e,t,r){"use strict";var n=r(4117),o=TypeError;e.exports=function(e){if(n(e))throw new o("Can't call method on "+e);return e}},7751:function(e,t,r){"use strict";var n=r(4576),o=r(4901);e.exports=function(e,t){return arguments.length<2?(r=n[e],o(r)?r:void 0):n[e]&&n[e][t];var r}},7764:function(e,t,r){"use strict";var n=r(8183).charAt,o=r(655),i=r(1181),a=r(1088),s=r(2529),c="String Iterator",u=i.set,l=i.getterFor(c);a(String,"String",(function(e){u(this,{type:c,string:o(e),index:0})}),(function(){var e,t=l(this),r=t.string,o=t.index;return o>=r.length?s(void 0,!0):(e=n(r,o),t.index+=e.length,s(e,!1))}))},7782:function(e){"use strict";e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},7811:function(e){"use strict";e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7812:function(e,t,r){"use strict";var n=r(6518),o=r(9297),i=r(757),a=r(6823),s=r(5745),c=r(1296),u=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{keyFor:function(e){if(!i(e))throw new TypeError(a(e)+" is not a symbol");if(o(u,e))return u[e]}})},7829:function(e,t,r){"use strict";var n=r(8183).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},7860:function(e,t,r){"use strict";var n=r(2839);e.exports=/web0s(?!.*chrome)/i.test(n)},7882:function(e,t,r){"use strict";e.exports=y;var n=r(8923);((y.prototype=Object.create(n.prototype)).constructor=y).className="Type";var o=r(5643),i=r(1457),a=r(1344),s=r(8252),c=r(9687),u=r(2551),l=r(6237),d=r(3449),p=r(3262),h=r(1080),f=r(7728),m=r(420),v=r(744),g=r(6434);function y(e,t){n.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}Object.defineProperties(y.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]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=p.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=p.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=y.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,p.merge(e.prototype,t)),e.$type=e.prototype.$type=this,p.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:p.oneOfGetter(this._oneofsArray[r].oneof),set:p.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),y.generateConstructor=function(e){for(var t,r=p.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",p.safeProp(t.name)):t.repeated&&r("this%s=[]",p.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},y.fromJSON=function(e,t){var r=new y(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),l=0;l<u.length;++l)r.add((void 0!==t.fields[u[l]].keyType?s.fromJSON:a.fromJSON)(u[l],t.fields[u[l]]));if(t.oneofs)for(u=Object.keys(t.oneofs),l=0;l<u.length;++l)r.add(i.fromJSON(u[l],t.oneofs[u[l]]));if(t.nested)for(u=Object.keys(t.nested),l=0;l<u.length;++l){var d=t.nested[u[l]];r.add((void 0!==d.id?a.fromJSON:void 0!==d.fields?y.fromJSON:void 0!==d.values?o.fromJSON:void 0!==d.methods?c.fromJSON:n.fromJSON)(u[l],d))}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},y.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return p.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.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])},y.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 n.prototype.resolveAll.call(this)},y.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},y.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]: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 i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),E(this)):n.prototype.add.call(this,e)},y.prototype.remove=function(e){if(e instanceof a&&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 i){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 n.prototype.remove.call(this,e)},y.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},y.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},y.prototype.create=function(e){return new this.ctor(e)},y.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=h(this)({Writer:d,types:t,util:p}),this.decode=f(this)({Reader:l,types:t,util:p}),this.verify=m(this)({types:t,util:p}),this.fromObject=v.fromObject(this)({types:t,util:p}),this.toObject=v.toObject(this)({types:t,util:p});var n=g[e];if(n){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(o),o.toObject=this.toObject,this.toObject=n.toObject.bind(o)}return this},y.prototype.encode=function(e,t){return this.setup().encode(e,t)},y.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},y.prototype.decode=function(e,t){return this.setup().decode(e,t)},y.prototype.decodeDelimited=function(e){return e instanceof l||(e=l.create(e)),this.decode(e,e.uint32())},y.prototype.verify=function(e){return this.setup().verify(e)},y.prototype.fromObject=function(e){return this.setup().fromObject(e)},y.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},y.d=function(e){return function(t){p.decorateType(t,e)}}},7916:function(e,t,r){"use strict";var n=r(6080),o=r(9565),i=r(8981),a=r(6319),s=r(4209),c=r(3517),u=r(6198),l=r(4659),d=r(81),p=r(851),h=Array;e.exports=function(e){var t=i(e),r=c(this),f=arguments.length,m=f>1?arguments[1]:void 0,v=void 0!==m;v&&(m=n(m,f>2?arguments[2]:void 0));var g,y,E,_,T,I,O=p(t),R=0;if(!O||this===h&&s(O))for(g=u(t),y=r?new this(g):h(g);g>R;R++)I=v?m(t[R],R):t[R],l(y,R,I);else for(y=r?new this:[],T=(_=d(t,O)).next;!(E=o(T,_)).done;R++)I=v?a(_,m,[E.value,R],!0):E.value,l(y,R,I);return y.length=R,y}},7979:function(e,t,r){"use strict";var n=r(8551);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},8014:function(e,t,r){"use strict";var n=r(1291),o=Math.min;e.exports=function(e){var t=n(e);return t>0?o(t,9007199254740991):0}},8045:function(e){"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,o=2,i=!0;o<arguments.length;)r[n++]=arguments[o++];return new Promise((function(o,a){r[n]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,a(e))}}))}},8183:function(e,t,r){"use strict";var n=r(9504),o=r(1291),i=r(655),a=r(7750),s=n("".charAt),c=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,r){var n,l,d=i(a(t)),p=o(r),h=d.length;return p<0||p>=h?e?"":void 0:(n=c(d,p))<55296||n>56319||p+1===h||(l=c(d,p+1))<56320||l>57343?e?s(d,p):n:e?u(d,p,p+2):l-56320+(n-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},8227:function(e,t,r){"use strict";var n=r(4576),o=r(5745),i=r(9297),a=r(3392),s=r(4495),c=r(7040),u=n.Symbol,l=o("wks"),d=c?u.for||u:u&&u.withoutSetter||a;e.exports=function(e){return i(l,e)||(l[e]=s&&i(u,e)?u[e]:d("Symbol."+e)),l[e]}},8229:function(e,t,r){"use strict";var n=r(9590),o=RangeError;e.exports=function(e,t){var r=n(e);if(r%t)throw new o("Wrong offset");return r}},8242:function(e,t,r){"use strict";var n=r(9565),o=r(7751),i=r(8227),a=r(6840);e.exports=function(){var e=o("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,s=i("toPrimitive");t&&!t[s]&&a(t,s,(function(e){return n(r,this)}),{arity:1})}},8252:function(e,t,r){"use strict";e.exports=a;var n=r(1344);((a.prototype=Object.create(n.prototype)).constructor=a).className="MapField";var o=r(361),i=r(3262);function a(e,t,r,o,a,s){if(n.call(this,e,t,o,void 0,void 0,a,s),!i.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===o.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"==typeof r?r=i.decorateType(r).name:r&&"object"==typeof r&&(r=i.decorateEnum(r).name),function(n,o){i.decorateType(n.constructor).add(new a(o,e,t,r))}}},8265:function(e){"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},8309:function(e,t,r){"use strict";r(4359)},8319:function(e){"use strict";var t=Math.round;e.exports=function(e){var r=t(e);return r<0?0:r>255?255:255&r}},8345:function(e,t,r){"use strict";var n=r(2805);(0,r(4644).exportTypedArrayStaticMethod)("from",r(3251),n)},8363:function(e,t,r){"use strict";var n=r(9565),o=r(9504),i=r(9228),a=r(8551),s=r(34),c=r(7750),u=r(2293),l=r(7829),d=r(8014),p=r(655),h=r(5966),f=r(6682),m=r(8429),v=r(9039),g=m.UNSUPPORTED_Y,y=Math.min,E=o([].push),_=o("".slice),T=!v((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),I="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;i("split",(function(e,t,r){var o="0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:n(t,this,e,r)}:t;return[function(t,r){var i=c(this),a=s(t)?h(t,e):void 0;return a?n(a,t,i,r):n(o,p(i),t,r)},function(e,n){var i=a(this),s=p(e);if(!I){var c=r(o,i,s,n,o!==t);if(c.done)return c.value}var h=u(i,RegExp),m=i.unicode,v=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(g?"g":"y"),T=new h(g?"^(?:"+i.source+")":i,v),O=void 0===n?4294967295:n>>>0;if(0===O)return[];if(0===s.length)return null===f(T,s)?[s]:[];for(var R=0,S=0,b=[];S<s.length;){T.lastIndex=g?0:S;var C,N=f(T,g?_(s,S):s);if(null===N||(C=y(d(T.lastIndex+(g?S:0)),s.length))===R)S=l(s,S,m);else{if(E(b,_(s,R,S)),b.length===O)return b;for(var A=1;A<=N.length-1;A++)if(E(b,N[A]),b.length===O)return b;S=R=C}}return E(b,_(s,R)),b}]}),I||!T,g)},8379:function(e,t,r){"use strict";var n=r(8745),o=r(5397),i=r(1291),a=r(6198),s=r(4598),c=Math.min,u=[].lastIndexOf,l=!!u&&1/[1].lastIndexOf(1,-0)<0,d=s("lastIndexOf"),p=l||!d;e.exports=p?function(e){if(l)return n(u,this,arguments)||0;var t=o(this),r=a(t);if(0===r)return-1;var s=r-1;for(arguments.length>1&&(s=c(s,i(arguments[1]))),s<0&&(s=r+s);s>=0;s--)if(s in t&&t[s]===e)return s||0;return-1}:u},8406:function(e,t,r){"use strict";r(3792),r(7337);var n=r(6518),o=r(4576),i=r(3389),a=r(7751),s=r(9565),c=r(9504),u=r(3724),l=r(7416),d=r(6840),p=r(2106),h=r(6279),f=r(687),m=r(3994),v=r(1181),g=r(679),y=r(4901),E=r(9297),_=r(6080),T=r(6955),I=r(8551),O=r(34),R=r(655),S=r(2360),b=r(6980),C=r(81),N=r(851),A=r(2529),M=r(2812),w=r(8227),U=r(4488),L=w("iterator"),P="URLSearchParams",x=P+"Iterator",k=v.set,D=v.getterFor(P),B=v.getterFor(x),j=i("fetch"),G=i("Request"),H=i("Headers"),F=G&&G.prototype,q=H&&H.prototype,W=o.TypeError,z=o.encodeURIComponent,K=String.fromCharCode,V=a("String","fromCodePoint"),J=parseInt,Y=c("".charAt),X=c([].join),Q=c([].push),$=c("".replace),Z=c([].shift),ee=c([].splice),te=c("".split),re=c("".slice),ne=c(/./.exec),oe=/\+/g,ie=/^[0-9a-f]+$/i,ae=function(e,t){var r=re(e,t,t+2);return ne(ie,r)?J(r,16):NaN},se=function(e){for(var t=0,r=128;r>0&&0!==(e&r);r>>=1)t++;return t},ce=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ue=function(e){for(var t=(e=$(e,oe," ")).length,r="",n=0;n<t;){var o=Y(e,n);if("%"===o){if("%"===Y(e,n+1)||n+3>t){r+="%",n++;continue}var i=ae(e,n+1);if(i!=i){r+=o,n++;continue}n+=2;var a=se(i);if(0===a)o=K(i);else{if(1===a||a>4){r+="�",n++;continue}for(var s=[i],c=1;c<a&&!(3+ ++n>t||"%"!==Y(e,n));){var u=ae(e,n+1);if(u!=u){n+=3;break}if(u>191||u<128)break;Q(s,u),n+=2,c++}if(s.length!==a){r+="�";continue}var l=ce(s);null===l?r+="�":o=V(l)}}r+=o,n++}return r},le=/[!'()~]|%20/g,de={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},pe=function(e){return de[e]},he=function(e){return $(z(e),le,pe)},fe=m((function(e,t){k(this,{type:x,target:D(e).entries,index:0,kind:t})}),P,(function(){var e=B(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,A(void 0,!0);var n=t[r];switch(e.kind){case"keys":return A(n.key,!1);case"values":return A(n.value,!1)}return A([n.key,n.value],!1)}),!0),me=function(e){this.entries=[],this.url=null,void 0!==e&&(O(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Y(e,0)?re(e,1):e:R(e)))};me.prototype={type:P,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,i,a,c,u=this.entries,l=N(e);if(l)for(r=(t=C(e,l)).next;!(n=s(r,t)).done;){if(i=(o=C(I(n.value))).next,(a=s(i,o)).done||(c=s(i,o)).done||!s(i,o).done)throw new W("Expected sequence with length 2");Q(u,{key:R(a.value),value:R(c.value)})}else for(var d in e)E(e,d)&&Q(u,{key:d,value:R(e[d])})},parseQuery:function(e){if(e)for(var t,r,n=this.entries,o=te(e,"&"),i=0;i<o.length;)(t=o[i++]).length&&(r=te(t,"="),Q(n,{key:ue(Z(r)),value:ue(X(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],Q(r,he(e.key)+"="+he(e.value));return X(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ve=function(){g(this,ge);var e=k(this,new me(arguments.length>0?arguments[0]:void 0));u||(this.size=e.entries.length)},ge=ve.prototype;if(h(ge,{append:function(e,t){var r=D(this);M(arguments.length,2),Q(r.entries,{key:R(e),value:R(t)}),u||this.length++,r.updateURL()},delete:function(e){for(var t=D(this),r=M(arguments.length,1),n=t.entries,o=R(e),i=r<2?void 0:arguments[1],a=void 0===i?i:R(i),s=0;s<n.length;){var c=n[s];if(c.key!==o||void 0!==a&&c.value!==a)s++;else if(ee(n,s,1),void 0!==a)break}u||(this.size=n.length),t.updateURL()},get:function(e){var t=D(this).entries;M(arguments.length,1);for(var r=R(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){var t=D(this).entries;M(arguments.length,1);for(var r=R(e),n=[],o=0;o<t.length;o++)t[o].key===r&&Q(n,t[o].value);return n},has:function(e){for(var t=D(this).entries,r=M(arguments.length,1),n=R(e),o=r<2?void 0:arguments[1],i=void 0===o?o:R(o),a=0;a<t.length;){var s=t[a++];if(s.key===n&&(void 0===i||s.value===i))return!0}return!1},set:function(e,t){var r=D(this);M(arguments.length,1);for(var n,o=r.entries,i=!1,a=R(e),s=R(t),c=0;c<o.length;c++)(n=o[c]).key===a&&(i?ee(o,c--,1):(i=!0,n.value=s));i||Q(o,{key:a,value:s}),u||(this.size=o.length),r.updateURL()},sort:function(){var e=D(this);U(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=D(this).entries,n=_(e,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new fe(this,"keys")},values:function(){return new fe(this,"values")},entries:function(){return new fe(this,"entries")}},{enumerable:!0}),d(ge,L,ge.entries,{name:"entries"}),d(ge,"toString",(function(){return D(this).serialize()}),{enumerable:!0}),u&&p(ge,"size",{get:function(){return D(this).entries.length},configurable:!0,enumerable:!0}),f(ve,P),n({global:!0,constructor:!0,forced:!l},{URLSearchParams:ve}),!l&&y(H)){var ye=c(q.has),Ee=c(q.set),_e=function(e){if(O(e)){var t,r=e.body;if(T(r)===P)return t=e.headers?new H(e.headers):new H,ye(t,"content-type")||Ee(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),S(e,{body:b(0,R(r)),headers:b(0,t)})}return e};if(y(j)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return j(e,arguments.length>1?_e(arguments[1]):{})}}),y(G)){var Te=function(e){return g(this,F),new G(e,arguments.length>1?_e(arguments[1]):{})};F.constructor=Te,Te.prototype=F,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Te})}}e.exports={URLSearchParams:ve,getState:D}},8408:function(e,t,r){"use strict";r(8406)},8429:function(e,t,r){"use strict";var n=r(9039),o=r(4576).RegExp,i=n((function(){var e=o("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=i||n((function(){return!o("a","y").sticky})),s=i||n((function(){var e=o("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:i}},8480:function(e,t,r){"use strict";var n=r(1828),o=r(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},8490:function(e){"use strict";var t=Array,r=Math.abs,n=Math.pow,o=Math.floor,i=Math.log,a=Math.LN2;e.exports={pack:function(e,s,c){var u,l,d,p=t(c),h=8*c-s-1,f=(1<<h)-1,m=f>>1,v=23===s?n(2,-24)-n(2,-77):0,g=e<0||0===e&&1/e<0?1:0,y=0;for((e=r(e))!=e||e===1/0?(l=e!=e?1:0,u=f):(u=o(i(e)/a),e*(d=n(2,-u))<1&&(u--,d*=2),(e+=u+m>=1?v/d:v*n(2,1-m))*d>=2&&(u++,d/=2),u+m>=f?(l=0,u=f):u+m>=1?(l=(e*d-1)*n(2,s),u+=m):(l=e*n(2,m-1)*n(2,s),u=0));s>=8;)p[y++]=255&l,l/=256,s-=8;for(u=u<<s|l,h+=s;h>0;)p[y++]=255&u,u/=256,h-=8;return p[y-1]|=128*g,p},unpack:function(e,t){var r,o=e.length,i=8*o-t-1,a=(1<<i)-1,s=a>>1,c=i-7,u=o-1,l=e[u--],d=127&l;for(l>>=7;c>0;)d=256*d+e[u--],c-=8;for(r=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)r=256*r+e[u--],c-=8;if(0===d)d=1-s;else{if(d===a)return r?NaN:l?-1/0:1/0;r+=n(2,t),d-=s}return(l?-1:1)*r*n(2,d-t)}}},8523:function(e,t,r){"use strict";r(6468)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(6938))},8551:function(e,t,r){"use strict";var n=r(34),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not an object")}},8561:function(e){"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function o(e){if("string"!=typeof e){var r=i();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var a=Object.keys(e),s=new Array(a.length+1),c=new Array(a.length),u=0;u<a.length;)s[u]=a[u],c[u]=e[a[u++]];return s[u]=r,Function.apply(null,s).apply(null,c)}return Function(r)()}for(var l=new Array(arguments.length-1),d=0;d<l.length;)l[d]=arguments[++d];if(d=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=l[d++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),d!==l.length)throw Error("parameter count mismatch");return n.push(e),o}function i(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return o.toString=i,o}e.exports=t,t.verbose=!1},8570:function(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 n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var o={},i={};function a(e,t){var r,n,a;return t?(a=0<=(e>>>=0)&&e<256)&&(n=i[e])?n:(r=c(e,(0|e)<0?-1:0,!0),a&&(i[e]=r),r):(a=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=c(e,e<0?-1:0,!1),a&&(o[e]=r),r)}function s(e,t){if(isNaN(e))return t?g:v;if(t){if(e<0)return g;if(e>=h)return I}else{if(e<=-f)return O;if(e+1>=f)return T}return e<0?s(-e,t).neg():c(e%p|0,e/p|0,t)}function c(e,t,n){return new r(e,t,n)}r.fromInt=a,r.fromNumber=s,r.fromBits=c;var u=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var o=s(u(r,8)),i=v,a=0;a<e.length;a+=8){var c=Math.min(8,e.length-a),d=parseInt(e.substring(a,a+c),r);if(c<8){var p=s(u(r,c));i=i.mul(p).add(s(d))}else i=(i=i.mul(o)).add(s(d))}return i.unsigned=t,i}function d(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?l(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=d;var p=4294967296,h=p*p,f=h/2,m=a(1<<24),v=a(0);r.ZERO=v;var g=a(0,!0);r.UZERO=g;var y=a(1);r.ONE=y;var E=a(1,!0);r.UONE=E;var _=a(-1);r.NEG_ONE=_;var T=c(-1,2147483647,!1);r.MAX_VALUE=T;var I=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=I;var O=c(0,-2147483648,!1);r.MIN_VALUE=O;var R=r.prototype;R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){var t=s(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=s(u(e,6),this.unsigned),i=this,a="";;){var c=i.div(o),l=(i.sub(c.mul(o)).toInt()>>>0).toString(e);if((i=c).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},R.isZero=function(){return 0===this.high&&0===this.low},R.eqz=R.isZero,R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return!(1&~this.low)},R.isEven=function(){return!(1&this.low)},R.equals=function(e){return n(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(e){if(n(e)||(e=d(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},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(y)},R.neg=R.negate,R.add=function(e){n(e)||(e=d(e));var t=this.high>>>16,r=65535&this.high,o=this.low>>>16,i=65535&this.low,a=e.high>>>16,s=65535&e.high,u=e.low>>>16,l=0,p=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,p+=(h+=o+u)>>>16,l+=(p+=r+s)>>>16,l+=t+a,c((h&=65535)<<16|(f&=65535),(l&=65535)<<16|(p&=65535),this.unsigned)},R.subtract=function(e){return n(e)||(e=d(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return v;if(n(e)||(e=d(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(O))return e.isOdd()?O:v;if(e.eq(O))return this.isOdd()?O:v;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 s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,p=e.low>>>16,h=65535&e.low,f=0,g=0,y=0,E=0;return y+=(E+=a*h)>>>16,g+=(y+=i*h)>>>16,y&=65535,g+=(y+=a*p)>>>16,f+=(g+=o*h)>>>16,g&=65535,f+=(g+=i*p)>>>16,g&=65535,f+=(g+=a*l)>>>16,f+=r*h+o*p+i*l+a*u,c((y&=65535)<<16|(E&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(n(e)||(e=d(e)),e.isZero())throw Error("division by zero");var r,o,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((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?g:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;i=g}else{if(this.eq(O))return e.eq(y)||e.eq(_)?O:e.eq(O)?y:(r=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?y:_:(o=this.sub(e.mul(r)),i=r.add(o.div(e)));if(e.eq(O))return this.unsigned?g:v;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=v}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),l=a<=48?1:u(2,a-48),p=s(r),h=p.mul(e);h.isNegative()||h.gt(o);)h=(p=s(r-=l,this.unsigned)).mul(e);p.isZero()&&(p=y),i=i.add(p),o=o.sub(h)}return i},R.div=R.divide,R.modulo=function(e){return n(e)||(e=d(e)),t?c((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))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return c(~this.low,~this.high,this.unsigned)},R.and=function(e){return n(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return n(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return n(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},R.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,n){return n?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)}},8598:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(7055),a=r(5397),s=r(4598),c=o([].join);n({target:"Array",proto:!0,forced:i!==Object||!s("join",",")},{join:function(e){return c(a(this),void 0===e?",":e)}})},8622:function(e,t,r){"use strict";var n=r(4576),o=r(4901),i=n.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},8686:function(e,t,r){"use strict";var n=r(3724),o=r(9039);e.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8706:function(e,t,r){"use strict";var n=r(6518),o=r(9039),i=r(4376),a=r(34),s=r(8981),c=r(6198),u=r(6837),l=r(4659),d=r(1469),p=r(597),h=r(8227),f=r(9519),m=h("isConcatSpreadable"),v=f>=51||!o((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),g=function(e){if(!a(e))return!1;var t=e[m];return void 0!==t?!!t:i(e)};n({target:"Array",proto:!0,arity:1,forced:!v||!p("concat")},{concat:function(e){var t,r,n,o,i,a=s(this),p=d(a,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(g(i=-1===t?a:arguments[t]))for(o=c(i),u(h+o),r=0;r<o;r++,h++)r in i&&l(p,h,i[r]);else u(h+1),l(p,h++,i);return p.length=h,p}})},8727:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:function(e,t,r){"use strict";var n=r(616),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},8747:function(e,t,r){"use strict";var n=r(4644),o=n.aTypedArray,i=n.exportTypedArrayMethod,a=Math.floor;i("reverse",(function(){for(var e,t=this,r=o(t).length,n=a(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}))},8773:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},8781:function(e,t,r){"use strict";var n=r(350).PROPER,o=r(6840),i=r(8551),a=r(655),s=r(9039),c=r(1034),u="toString",l=RegExp.prototype,d=l[u],p=s((function(){return"/a/b"!==d.call({source:"a",flags:"b"})})),h=n&&d.name!==u;(p||h)&&o(l,u,(function(){var e=i(this);return"/"+a(e.source)+"/"+a(c(e))}),{unsafe:!0})},8811:function(e,t,r){"use strict";e.exports=i;var n=r(7209);((i.prototype=Object.create(n.prototype)).constructor=i).className="Method";var o=r(3262);function i(e,t,r,i,a,s,c,u,l){if(o.isObject(a)?(c=a,a=s=void 0):o.isObject(s)&&(c=s,s=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,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||void 0,this.responseType=i,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=l}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},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,"parsedOptions",this.parsedOptions])},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))}},8814:function(e,t,r){"use strict";var n=r(9039),o=r(4576).RegExp;e.exports=n((function(){var e=o("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},8839:function(e,t){"use strict";var r=t;r.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 n=new Array(64),o=new Array(123),i=0;i<64;)o[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r.encode=function(e,t,r){for(var o,i=null,a=[],s=0,c=0;t<r;){var u=e[t++];switch(c){case 0:a[s++]=n[u>>2],o=(3&u)<<4,c=1;break;case 1:a[s++]=n[o|u>>4],o=(15&u)<<2,c=2;break;case 2:a[s++]=n[o|u>>6],a[s++]=n[63&u],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=n[o],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";r.decode=function(e,t,r){for(var n,i=r,s=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&s>1)break;if(void 0===(u=o[u]))throw Error(a);switch(s){case 0:n=u,s=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,s=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,s=3;break;case 3:t[r++]=(3&n)<<6|u,s=0}}if(1===s)throw Error(a);return r-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},8845:function(e,t,r){"use strict";var n=r(4576),o=r(9565),i=r(4644),a=r(6198),s=r(8229),c=r(8981),u=r(9039),l=n.RangeError,d=n.Int8Array,p=d&&d.prototype,h=p&&p.set,f=i.aTypedArray,m=i.exportTypedArrayMethod,v=!u((function(){var e=new Uint8ClampedArray(2);return o(h,e,{length:1,0:3},1),3!==e[1]})),g=v&&i.NATIVE_ARRAY_BUFFER_VIEWS&&u((function(){var e=new d(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));m("set",(function(e){f(this);var t=s(arguments.length>1?arguments[1]:void 0,1),r=c(e);if(v)return o(h,this,r,t);var n=this.length,i=a(r),u=0;if(i+t>n)throw new l("Wrong length");for(;u<i;)this[t+u]=r[u++]}),!v||g)},8921:function(e,t,r){"use strict";var n=r(6518),o=r(8379);n({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},8923:function(e,t,r){"use strict";e.exports=d;var n=r(7209);((d.prototype=Object.create(n.prototype)).constructor=d).className="Namespace";var o,i,a,s=r(1344),c=r(1457),u=r(3262);function l(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function d(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function p(e){return e._nestedArray=null,e}d.fromJSON=function(e,t){return new d(e,t.options).addJSON(t.nested)},d.arrayToJSON=l,d.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},d.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(d.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),d.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},d.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?o.fromJSON:void 0!==t.values?a.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?s.fromJSON:d.fromJSON)(r[n],t));return this},d.prototype.get=function(e){return this.nested&&this.nested[e]||null},d.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof a)return this.nested[e].values;throw Error("no such enum: "+e)},d.prototype.add=function(e){if(!(e instanceof s&&void 0!==e.extend||e instanceof o||e instanceof a||e instanceof i||e instanceof d||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof d&&e instanceof d)||t instanceof o||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),p(this)},d.prototype.remove=function(e){if(!(e instanceof n))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),p(this)},d.prototype.define=function(e,t){if(u.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 n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof d))throw Error("path conflicts with non-namespace objects")}else r.add(r=new d(n))}return t&&r.addJSON(t),r},d.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof d?e[t++].resolveAll():e[t++].resolve();return this.resolve()},d.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.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 n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof d&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof d&&(n=this._nestedArray[o].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},d.prototype.lookupType=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such type: "+e);return t},d.prototype.lookupEnum=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},d.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[o,a]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},d.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},d._configure=function(e,t,r){o=e,i=t,a=r}},8940:function(e,t,r){"use strict";var n=r(6518),o=r(2703);n({global:!0,forced:parseInt!==o},{parseInt:o})},8980:function(e,t,r){"use strict";var n=r(6518),o=r(9213).findIndex,i=r(6469),a="findIndex",s=!0;a in[]&&Array(1)[a]((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i(a)},8981:function(e,t,r){"use strict";var n=r(7750),o=Object;e.exports=function(e){return o(n(e))}},8995:function(e,t,r){"use strict";var n=r(4644),o=r(9213).map,i=n.aTypedArray,a=n.getTypedArrayConstructor;(0,n.exportTypedArrayMethod)("map",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(a(e))(t)}))}))},9039:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},9085:function(e,t,r){"use strict";var n=r(6518),o=r(4213);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},9089:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=Date,a=o(i.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return a(new i)}})},9100:function(e,t,r){"use strict";var n=e.exports=r(5325);n.build="full",n.tokenize=r(527),n.parse=r(4863),n.common=r(5095),n.Root._configure(n.Type,n.parse,n.common)},9167:function(e,t,r){"use strict";var n=r(4576);e.exports=n},9207:function(e,t){"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),o="";r&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):r?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};r.resolve=function(e,t,r){return r||(t=o(t)),n(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},9213:function(e,t,r){"use strict";var n=r(6080),o=r(9504),i=r(7055),a=r(8981),s=r(6198),c=r(1469),u=o([].push),l=function(e){var t=1===e,r=2===e,o=3===e,l=4===e,d=6===e,p=7===e,h=5===e||d;return function(f,m,v,g){for(var y,E,_=a(f),T=i(_),I=s(T),O=n(m,v),R=0,S=g||c,b=t?S(f,I):r||p?S(f,0):void 0;I>R;R++)if((h||R in T)&&(E=O(y=T[R],R,_),e))if(t)b[R]=E;else if(E)switch(e){case 3:return!0;case 5:return y;case 6:return R;case 2:u(b,y)}else switch(e){case 4:return!1;case 7:u(b,y)}return d?-1:o||l?l:b}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},9225:function(e,t,r){"use strict";var n,o,i,a,s=r(4576),c=r(8745),u=r(6080),l=r(4901),d=r(9297),p=r(9039),h=r(397),f=r(7680),m=r(4055),v=r(2812),g=r(9544),y=r(6193),E=s.setImmediate,_=s.clearImmediate,T=s.process,I=s.Dispatch,O=s.Function,R=s.MessageChannel,S=s.String,b=0,C={},N="onreadystatechange";p((function(){n=s.location}));var A=function(e){if(d(C,e)){var t=C[e];delete C[e],t()}},M=function(e){return function(){A(e)}},w=function(e){A(e.data)},U=function(e){s.postMessage(S(e),n.protocol+"//"+n.host)};E&&_||(E=function(e){v(arguments.length,1);var t=l(e)?e:O(e),r=f(arguments,1);return C[++b]=function(){c(t,void 0,r)},o(b),b},_=function(e){delete C[e]},y?o=function(e){T.nextTick(M(e))}:I&&I.now?o=function(e){I.now(M(e))}:R&&!g?(a=(i=new R).port2,i.port1.onmessage=w,o=u(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!p(U)?(o=U,s.addEventListener("message",w,!1)):o=N in m("script")?function(e){h.appendChild(m("script"))[N]=function(){h.removeChild(this),A(e)}}:function(e){setTimeout(M(e),0)}),e.exports={set:E,clear:_}},9228:function(e,t,r){"use strict";r(7495);var n=r(9565),o=r(6840),i=r(7323),a=r(9039),s=r(8227),c=r(6699),u=s("species"),l=RegExp.prototype;e.exports=function(e,t,r,d){var p=s(e),h=!a((function(){var t={};return t[p]=function(){return 7},7!==""[e](t)})),f=h&&!a((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[u]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return t=!0,null},r[p](""),!t}));if(!h||!f||r){var m=/./[p],v=t(p,""[e],(function(e,t,r,o,a){var s=t.exec;return s===i||s===l.exec?h&&!a?{done:!0,value:n(m,t,r,o)}:{done:!0,value:n(e,r,t,o)}:{done:!1}}));o(String.prototype,e,v[0]),o(l,p,v[1])}d&&c(l[p],"sham",!0)}},9296:function(e,t,r){"use strict";var n=r(4055)("span").classList,o=n&&n.constructor&&n.constructor.prototype;e.exports=o===Object.prototype?void 0:o},9297:function(e,t,r){"use strict";var n=r(9504),o=r(8981),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},9306:function(e,t,r){"use strict";var n=r(4901),o=r(6823),i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not a function")}},9369:function(e,t,r){"use strict";var n=r(4644),o=r(9504),i=n.aTypedArray,a=n.exportTypedArrayMethod,s=o([].join);a("join",(function(e){return s(i(this),e)}))},9390:function(e){"use strict";e.exports=function(e,t,r){var n=r||8192,o=n>>>1,i=null,a=n;return function(r){if(r<1||r>o)return e(r);a+r>n&&(i=e(n),a=0);var s=t.call(i,a,a+=r);return 7&a&&(a=1+(7|a)),s}}},9410:function(e){"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function t(e,t,r,n){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,a=8388607&n;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=a.bind(null,o),e.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function t(e,t,r,n,o,i){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=n*Math.pow(2,-c))>>>0,o,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,o,i+r)}}}function a(e,t,r,n,o){var i=e(n,o+t),a=e(n,o+r),s=2*(a>>31)+1,c=a>>>20&2047,u=4294967296*(1048575&a)+i;return 2047===c?u?NaN:s*(1/0):0===c?5e-324*s*u:s*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=a.bind(null,o,0,4),e.readDoubleBE=a.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 n(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 o(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)},9423:function(e,t,r){"use strict";var n=r(4644),o=r(9039),i=r(7680),a=n.aTypedArray,s=n.getTypedArrayConstructor;(0,n.exportTypedArrayMethod)("slice",(function(e,t){for(var r=i(a(this),e,t),n=s(this),o=0,c=r.length,u=new n(c);c>o;)u[o]=r[o++];return u}),o((function(){new Int8Array(1).slice()})))},9432:function(e,t,r){"use strict";var n=r(6518),o=r(8981),i=r(1072);n({target:"Object",stat:!0,forced:r(9039)((function(){i(1)}))},{keys:function(e){return i(o(e))}})},9433:function(e,t,r){"use strict";var n=r(4576),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},9449:function(e,t,r){"use strict";var n,o=r(6518),i=r(7476),a=r(7347).f,s=r(8014),c=r(655),u=r(5749),l=r(7750),d=r(1436),p=r(6395),h=i("".slice),f=Math.min,m=d("endsWith");o({target:"String",proto:!0,forced:!(!p&&!m&&(n=a(String.prototype,"endsWith"),n&&!n.writable)||m)},{endsWith:function(e){var t=c(l(this));u(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,o=void 0===r?n:f(s(r),n),i=c(e);return h(t,o-i.length,o)===i}})},9463:function(e,t,r){"use strict";var n=r(6518),o=r(3724),i=r(4576),a=r(9504),s=r(9297),c=r(4901),u=r(1625),l=r(655),d=r(2106),p=r(7740),h=i.Symbol,f=h&&h.prototype;if(o&&c(h)&&(!("description"in f)||void 0!==h().description)){var m={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=u(f,this)?new h(e):void 0===e?h():h(e);return""===e&&(m[t]=!0),t};p(v,h),v.prototype=f,f.constructor=v;var g="Symbol(description detection)"===String(h("description detection")),y=a(f.valueOf),E=a(f.toString),_=/^Symbol\((.*)\)[^)]+$/,T=a("".replace),I=a("".slice);d(f,"description",{configurable:!0,get:function(){var e=y(this);if(s(m,e))return"";var t=E(e),r=g?I(t,7,-1):T(t,_,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:v})}},9472:function(e,t,r){"use strict";var n,o=r(4576),i=r(8745),a=r(4901),s=r(4215),c=r(2839),u=r(7680),l=r(2812),d=o.Function,p=/MSIE .\./.test(c)||"BUN"===s&&((n=o.Bun.version.split(".")).length<3||"0"===n[0]&&(n[1]<3||"3"===n[1]&&"0"===n[2]));e.exports=function(e,t){var r=t?2:1;return p?function(n,o){var s=l(arguments.length,1)>r,c=a(n)?n:d(n),p=s?u(arguments,r):[],h=s?function(){i(c,this,p)}:c;return t?e(h,o):e(h)}:e}},9504:function(e,t,r){"use strict";var n=r(616),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);e.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}},9519:function(e,t,r){"use strict";var n,o,i=r(4576),a=r(2839),s=i.process,c=i.Deno,u=s&&s.versions||c&&c.version,l=u&&u.v8;l&&(o=(n=l.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},9539:function(e,t,r){"use strict";var n=r(9565),o=r(8551),i=r(5966);e.exports=function(e,t,r){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw r;if(s)throw a;return o(a),r}},9544:function(e,t,r){"use strict";var n=r(2839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},9565:function(e,t,r){"use strict";var n=r(616),o=Function.prototype.call;e.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},9590:function(e,t,r){"use strict";var n=r(1291),o=RangeError;e.exports=function(e){var t=n(e);if(t<0)throw new o("The argument can't be less than 0");return t}},9617:function(e,t,r){"use strict";var n=r(5397),o=r(5610),i=r(6198),a=function(e){return function(t,r,a){var s=n(t),c=i(s);if(0===c)return!e&&-1;var u,l=o(a,c);if(e&&r!=r){for(;c>l;)if((u=s[l++])!=u)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},9638:function(e){"use strict";var t=4096,r=65547,n=15,o=2113929216,i=65536,a=65536,s=10485760,c={MANUAL:0,AUTO_IMMEDIATE:1,AUTO_THRESHOLD:2},u={SUCCESS:0,FAILED:-1,NOT_INITIALIZED:-2,INITIALIZED_FAILED:-3,COMPRESS_FAILED:-4,DECOMPRESS_FAILED:-5,PARAM_ERROR:-6,BUFFER_RESIZE_FAILED:-7};function l(e){if(!(e>0))return a;if(e<=a)return a;if(e>1073741823)return e;for(var t=a;t<e;)t*=2;return t}var d={byU16:0,byU32:1};function p(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}var h="fast";function f(e){return 2654435761*(e>>>0)>>>20&4095}function m(e){return 2654435761*(e>>>0)>>>19&8191}function v(e,t,r){if("fast"===h){var n=p(e,t);return r===d.byU16?m(n):f(n)}throw new Error("Unsupported hash strategy: "+h)}function g(e,t,r,n,o){r[t]=e-o}function y(e,t,r,n,o){g(t,v(e,t,n),r,0,o)}function E(e,t,r,n){return t[e]+n}function _(e,t,r,n,o){return E(v(e,t,n),r,0,o)}function T(e,t,r,n){for(var o=t;t<n-3;){if(p(e,t)!==p(e,r)){for(;t<n&&e[t]===e[r];)t++,r++;return t-o}t+=4,r+=4}for(;t<n&&e[t]===e[r];)t++,r++;return t-o}function I(e,t,i,a,s,c,u,l,p,h){var f,m,I,b,C,N,A=e.hashTable,M=a,w=M-e.dictSize,U=e.dictionary,L=e.dictionaryStart,P=L+e.dictSize,x=e.dictSize>0?P-a:0,k=a,D=a+s,B=D-12,j=D-5,G=0,H=c>0?c:i.length,F=0;if(s>o)return 0;switch(p){case 0:default:f=a,m=a;break;case 1:f=a-e.currentOffset,m=a-e.dictSize;break;case 2:f=a-e.currentOffset,m=a}if(l===d.byU16&&s>=r)return 0;if(s<13)return S(t,i,k,D,G,H,u);y(t,M,A,l,f),I=v(t,++M,l);e:for(;;){var q,W,z=M,K=1,V=64;do{var J=I;if(M=z,z+=K,K=V++>>>6,z>B)return S(t,i,k,D,G,H,u);q=E(J,A,0,f),2===p&&(q<a?(F=x,m=L):(F=0,m=a)),I=v(t,z,l),g(M,J,A,0,f)}while(1===h&&q<w||l!==d.byU16&&q+65535<M||!O(t,U,M,q,F,p,a));for(;M>k&&q+F>m;){var Y=q+F-1;if(t[M-1]!==(2===p&&q<a?U[Y-L+e.dictionaryStart]:t[Y]))break;M--,q--}var X=M-k;if(W=G++,u&&G+X+8+Math.floor(X/255)>H)return 0;if(X>=n){var Q=X-n;for(i[W]=240;Q>=255;)i[G++]=255,Q-=255;i[G++]=Q}else i[W]=X<<4;if(X>=16&&i.set&&t.subarray)i.set(t.subarray(k,k+X),G),G+=X;else for(var $=0;$<X;$++)i[G++]=t[k+$];t:for(;;){var Z;if(N=M-q,(b=i)[C=G]=255&N,b[C+1]=N>>>8&255,G+=2,2===p&&q<a){var ee=M+(P-(q+F));if(ee>j&&(ee=j),(M+=4+(Z=R(t,U,M+4,q+F+4-L+e.dictionaryStart,ee,P-L)))===ee&&ee<j){var te=T(t,M,a,j);Z+=te,M+=te}}else M+=4+(Z=T(t,M+4,q+4,j));if(u&&G+6+(Z>>>8)>H)return 0;if(Z>=15){for(i[W]+=15,Z-=15;Z>=510;)i[G++]=255,i[G++]=255,Z-=510;Z>=255&&(Z-=255,i[G++]=255),i[G++]=Z}else i[W]+=Z;if(k=M,M>B)break e;if(y(t,M-2,A,l,f),q=_(t,M,A,l,f),2===p&&(q<a?(F=x,m=L):(F=0,m=a)),y(t,M,A,l,f),!((1!==h||q>=w)&&q+65535>=M&&O(t,U,M,q,F,p,a)))break t;i[W=G++]=0}I=v(t,++M,l)}return S(t,i,k,D,G,H,u)}function O(e,t,r,n,o,i,a){return p(e,r)===p(2===i&&n+o<a?t:e,n+o)}function R(e,t,r,n,o,i,a){for(var s=r;n<i&&r<o&&t[n]===e[r];)n++,r++;return r-s}function S(e,t,r,o,i,a,s){var c=o-r;if(s&&i+c+1+Math.floor((c+255-n)/255)>a)return 0;if(c>=n){for(t[i++]=240,c-=n;c>=255;)t[i++]=255,c-=255;t[i++]=c}else t[i++]=c<<4;var u=r,l=o,d=l-u;if(d>=16&&t.set&&e.subarray)t.set(e.subarray(u,l),i),i+=d;else for(var p=u;p<l;p++)t[i++]=e[p];return i}function b(e,t,r,n){var o,i=0;if(n&&t.ip>=r)return-1;do{if(i+=o=e[t.ip++],t.ip>r)return-1;if(i>2147483647)return-1}while(255===o);return i}function C(e,t,r,o,i,a,s,c,u,l,d,p,h){if(null==e)return-1;if(a<0)return-1;var f,m,v=r,g=r+o,y=i,E=i+a,_=i+u,T=d-h,I=p+h,O=h<65536;if(c&&_>E-12&&(_=E-12),0===a)return c||1===o&&0===e[v]?0:-1;if(0===o)return-1;for(;;){var R,S,C,N;if(v>=g)return-(v-r)-1;if((S=(R=e[v++])>>>4)===n){var A=b(e,U={ip:v},g-n,!0);if(v=U.ip,-1===A)return-(v-r)-1;if(y+(S+=A)<y)return-(v-r)-1;if(v+S<v)return-(v-r)-1}if(C=y+S,s&&(C>(c?_:E-12)||v+S>g-8)||!s&&C>E-8){if(c)v+S>g&&(C=y+(S=g-v)),C>E&&(C=E,S=E-y);else{if(!s&&C!==E)return-(v-r)-1;if(s&&(v+S!==g||C>E))return-(v-r)-1}if(S>=16&&t.set&&e.subarray)t.set(e.subarray(v,v+S),y);else for(var M=0;M<S;M++)t[y+M]=e[v+M];if(v+=S,y+=S,!c||C===E||v>=g-2)break;if(!c)break}if(S>=16&&t.set&&e.subarray)t.set(e.subarray(v,v+S),y);else for(M=0;M<S;M++)t[y+M]=e[v+M];if(y=C,(v+=S)+2>g)return-(v-r)-1;var w=(f=e)[m=v]|f[m+1]<<8;if(v+=2,N=C-w,O&&N+h<d)return-(v-r)-1;if(0===w)return-(v-r)-1;if(15==(S=15&R)){var U;if(A=b(e,U={ip:v},g-5+1,!1),v=U.ip,-1===A)return-(v-r)-1;if(y+(S+=A)<y)return-(v-r)-1}if(S+=4,2===l&&N<d){if(y+S>E-5){if(!c)return-(v-r)-1;S=Math.min(S,E-y)}if(S<=d-N){var L=I-(d-N);for(M=0;M<S;M++)t[y+M]=t[L+M];y+=S}else{var P=d-N;for(L=I-P,M=0;M<P;M++)t[y+M]=t[L+M];var x=S-P;if(x>(y+=P)-d)for(var k=d,D=y+x;y<D;)t[y++]=t[k++];else{for(M=0;M<x;M++)t[y+M]=t[d+M];y+=x}}}else{if(N<T)return-(v-r)-1;if(C=y+S,c&&C>E-12){var B=Math.min(S,E-y),j=y+B;if(N+B>y)for(;y<j;)t[y++]=t[N++];else{for(M=0;M<B;M++)t[y+M]=t[N+M];y=j}if(y===E)break}else if(y-N<8)for(t[y]=t[N],t[y+1]=t[N+1],t[y+2]=t[N+2],t[y+3]=t[N+3],y+=4,N+=4;y<C;)t[y++]=t[N++];else for(;y<C;)t[y++]=t[N++]}}return s?y-i:v-r}function N(){return{hashTable:new Uint32Array(t),currentOffset:0,initCheck:0,dictionary:null,dictionaryStart:0,dictSize:0,bufferStart:null}}function A(e){e.hashTable.fill(0),e.currentOffset=0,e.initCheck=0,e.dictionary=null,e.dictionaryStart=0,e.dictSize=0,e.bufferStart=null}function M(e,t,r,n,o,i,a,s){n=n||0,i=i||0;var c=e.dictionaryStart+e.dictSize,u=n;if(e.initCheck)return 0;e.dictSize>0&&u>c&&(u=c),function(e){if(e.currentOffset>2147483648){for(var t=e.currentOffset-65536,r=e.dictionaryStart+e.dictSize,n=0;n<e.hashTable.length;n++)e.hashTable[n]<t?e.hashTable[n]=0:e.hashTable[n]-=t;e.currentOffset=65536,e.dictSize>65536&&(e.dictSize=65536),e.dictionaryStart=r-e.dictSize}}(e);var l,p=n+o;e.dictionary&&p>e.dictionaryStart&&p<c&&(e.dictSize=c-p,e.dictSize>65536&&(e.dictSize=65536),e.dictSize<4&&(e.dictSize=0),e.dictionaryStart=c-e.dictSize);var h=e.dictSize<65536&&e.dictSize<e.currentOffset?1:0;return e.dictionary&&c===n?(l=I(e,t,r,n,o,a||0,s||!1,d.byU32,1,h),e.dictSize+=o,e.currentOffset+=o,l):(l=I(e,t,r,n,o,a||0,s||!1,d.byU32,2,h),e.dictionary=t,e.dictionaryStart=n,e.dictSize=o,e.currentOffset+=o,l)}function w(e,t,r,n){var o=e.dictionaryStart+e.dictSize;n>65536&&(n=65536),n>e.dictSize&&(n=e.dictSize);var i=o-n;if(t.set&&e.dictionary.subarray)t.set(e.dictionary.subarray(i,i+n),r);else for(var a=0;a<n;a++)t[r+a]=e.dictionary[i+a];return e.dictionary=t,e.dictionaryStart=r,e.dictSize=n,n}function U(e,t,r,n){return e.prefixSize=n,e.prefixEnd=r+n,e.externalDict=null,e.extDictStart=0,e.extDictSize=0,1}function L(e,t,r,n,o,i,a){var s;if(e.prefixEnd===i){if((s=C(t,r,n,o,i,a,!0,!1,0,2,e.prefixEnd-e.prefixSize,e.extDictStart,e.extDictSize))<=0)return s;e.prefixSize+=s,e.prefixEnd+=s}else{if(e.extDictSize=e.prefixSize,e.extDictStart=e.prefixEnd-e.extDictSize,(s=C(t,r,n,o,i,a,!0,!1,0,2,i,e.extDictStart,e.extDictSize))<=0)return s;e.prefixSize=s,e.prefixEnd=i+s}return s}function P(e){var t=(e=e||{}).minWorkArea||a,r=e.maxWorkArea||s,n=e.shrinkThreshold||t;t<a&&(t=a),r<t&&(r=t),n<t&&(n=t),n>r&&(n=r),this.minBufferSize=i+t,this.maxBufferSize=i+r,this.shrinkThreshold=i+n,this.ringBufferSize=this.minBufferSize,this.shrinkMode=void 0!==e.shrinkMode?e.shrinkMode:c.MANUAL,this.ringBuffer=new Uint8Array(this.ringBufferSize),this.offset=0,this.stream=N()}function x(e){var t=(e=e||{}).minWorkArea||a,r=e.maxWorkArea||s,n=e.shrinkThreshold||t;t<a&&(t=a),r<t&&(r=t),n<t&&(n=t),n>r&&(n=r),this.minBufferSize=i+t,this.maxBufferSize=i+r,this.shrinkThreshold=i+n,this.ringBufferSize=this.minBufferSize,this.shrinkMode=void 0!==e.shrinkMode?e.shrinkMode:c.MANUAL,this.ringBuffer=new Uint8Array(this.ringBufferSize),this.offset=0,this.streamDecode={externalDict:null,extDictStart:0,extDictSize:0,prefixEnd:0,prefixSize:0}}P.prototype._resizeBuffer=function(e){var t=new Uint8Array(e),r=0;if(this.offset>0){var n=this.offset<i?this.offset:i,o=this.offset>i?this.offset-i:0;t.set(this.ringBuffer.subarray(o,o+n),0),w(this.stream,t,0,n),r=n}return this.ringBuffer=t,this.ringBufferSize=e,this.offset=r,!0},P.prototype.compress=function(e,t){var r=e.length;if(r<=0)return u.PARAM_ERROR;if(r>this.maxBufferSize-i)return u.PARAM_ERROR;if(r>this.ringBufferSize-i){var n=l(r),o=i+n;if(o>this.maxBufferSize&&(o=this.maxBufferSize),!this._resizeBuffer(o))return u.BUFFER_RESIZE_FAILED}this.offset+r>this.ringBufferSize&&(w(this.stream,this.ringBuffer,0,i),this.offset=i);var a=this.offset;this.ringBuffer.set(e,a);var s=M(this.stream,this.ringBuffer,t,a,r,0,t.length,!0);return s<=0?u.COMPRESS_FAILED:(this.offset+=r,this._tryAutoShrink(),s)},P.prototype.reset=function(){this.offset=0,A(this.stream)},P.prototype.shrink=function(){this.ringBufferSize>this.minBufferSize&&this._resizeBuffer(this.minBufferSize)},P.prototype._tryAutoShrink=function(){this.shrinkMode!==c.MANUAL&&(this.ringBufferSize<=this.minBufferSize||(this.shrinkMode===c.AUTO_IMMEDIATE||this.shrinkMode===c.AUTO_THRESHOLD&&this.ringBufferSize>this.shrinkThreshold)&&this.shrink())},P.prototype.getWorkArea=function(){return this.ringBufferSize-i},P.prototype.getRingBufferSize=function(){return this.ringBufferSize},P.prototype.getBaseBufferSize=function(){return this.minBufferSize},P.prototype.getMaxBufferSize=function(){return this.maxBufferSize},P.prototype.getCurrentOffset=function(){return this.offset},P.prototype.getShrinkMode=function(){return this.shrinkMode},P.prototype.setShrinkMode=function(e){this.shrinkMode=e},P.prototype.getShrinkThreshold=function(){return this.shrinkThreshold},P.prototype.setShrinkThreshold=function(e){var t=this.minBufferSize-i,r=this.maxBufferSize-i;if(e<t||e>r)return u.PARAM_ERROR;this.shrinkThreshold=i+e},x.prototype._resizeBuffer=function(e){var t=new Uint8Array(e),r=0;if(this.offset>0){var n=this.offset<i?this.offset:i,o=this.offset>i?this.offset-i:0;t.set(this.ringBuffer.subarray(o,o+n),0),r=n,U(this.streamDecode,0,0,n)}return this.ringBuffer=t,this.ringBufferSize=e,this.offset=r,!0},x.prototype.decompress=function(e,t,r){var n=e.length;if(n<=0||r<=0)return u.PARAM_ERROR;if(r>this.maxBufferSize-i)return u.PARAM_ERROR;if(r>this.ringBufferSize-i){var o=l(r),a=i+o;if(a>this.maxBufferSize&&(a=this.maxBufferSize),!this._resizeBuffer(a))return u.BUFFER_RESIZE_FAILED}if(this.offset+r>this.ringBufferSize){var s=this.offset-i;s>0&&this.ringBuffer.set(this.ringBuffer.subarray(s,s+i),0),U(this.streamDecode,this.ringBuffer,0,i),this.offset=i}var c=L(this.streamDecode,e,this.ringBuffer,0,n,this.offset,r);return c<=0?u.DECOMPRESS_FAILED:(t.set(this.ringBuffer.subarray(this.offset,this.offset+c),0),this.offset+=c,this._tryAutoShrink(),c)},x.prototype.reset=function(){this.offset=0,this.streamDecode={externalDict:null,extDictStart:0,extDictSize:0,prefixEnd:0,prefixSize:0}},x.prototype.shrink=function(){this.ringBufferSize>this.minBufferSize&&this._resizeBuffer(this.minBufferSize)},x.prototype._tryAutoShrink=function(){this.shrinkMode!==c.MANUAL&&(this.ringBufferSize<=this.minBufferSize||(this.shrinkMode===c.AUTO_IMMEDIATE||this.shrinkMode===c.AUTO_THRESHOLD&&this.ringBufferSize>this.shrinkThreshold)&&this.shrink())},x.prototype.getWorkArea=function(){return this.ringBufferSize-i},x.prototype.getRingBufferSize=function(){return this.ringBufferSize},x.prototype.getBaseBufferSize=function(){return this.minBufferSize},x.prototype.getMaxBufferSize=function(){return this.maxBufferSize},x.prototype.getCurrentOffset=function(){return this.offset},x.prototype.getShrinkMode=function(){return this.shrinkMode},x.prototype.setShrinkMode=function(e){this.shrinkMode=e},x.prototype.getShrinkThreshold=function(){return this.shrinkThreshold},x.prototype.setShrinkThreshold=function(e){var t=this.minBufferSize-i,r=this.maxBufferSize-i;if(e<t||e>r)return u.PARAM_ERROR;this.shrinkThreshold=i+e},e.exports={LZ4_MAX_INPUT_SIZE:o,BLOCK_MAX_SIZE:65536,DICT_SIZE:i,DEFAULT_WORK_AREA:a,DEFAULT_MAX_WORK:s,SHRINK_MODE:c,LZ4_ERROR:u,alignToPowerOf2:l,calcDefaultBufferSize:function(){return 131072},calcDefaultMaxBufferSize:function(){return 10551296},setHashStrategy:function(e){if("fast"!==e&&"compatible"!==e)throw new Error("Invalid hash strategy: "+e+'. Use "fast" or "compatible".');h=e},getHashStrategy:function(){return h},compress:function(e,n,i,a,s){if(null==e)return 0;if(null==n)return 0;if(i=i||0,a=void 0===a?e.length:a,s=s||0,i<0||s<0)return 0;if(a<0)return 0;if(i+a>e.length)return 0;if(a>o)return 0;if(0===a)return n.length>s?(n[s]=0,1):0;var c=a<r?d.byU16:d.byU32;return I({hashTable:new Uint32Array(c===d.byU16?8192:t),currentOffset:0,dictSize:0,dictionary:null,dictionaryStart:0},e,n,i,a,0,!1,c,0,0)},compressLimited:function(e,n,i,a,s,c){if(null==e)return 0;if(null==n)return 0;if(i=i||0,a=void 0===a?e.length:a,s=s||0,i<0||s<0)return 0;if(a<0||c<0)return 0;if(i+a>e.length)return 0;if(a>o)return 0;if(c<1)return 0;if(0===a)return n[s]=0,1;var u=a<r?d.byU16:d.byU32;return I({hashTable:new Uint32Array(u===d.byU16?8192:t),currentOffset:0,dictSize:0,dictionary:null,dictionaryStart:0},e,n,i,a,c,!0,u,0,0)},compressBound:function(e){return e<0||e>o?0:e+Math.floor(e/255)+16},decompressSafe:function(e,t,r,n,o,i){return null==e||null==t?-1:(o=o||0,(r=r||0)<0||o<0||n<0||i<0||r+n>e.length||o+i>t.length?-1:C(e,t,r,n,o,i,!0,!1,0,0,o,null,0))},decompressFast:function(e,t,r,n,o){return C(e,t,r=r||0,0,n=n||0,o,!1,!1,0,1,n-65536,0,65536)},createStream:N,resetStream:A,loadDict:function(e,t,r,n){if(e.initCheck&&A(e),n<4)return e.dictionary=null,e.dictSize=0,0;n>65536&&(r=r+n-65536,n=65536);var o=r-e.currentOffset;e.dictionary=t,e.dictionaryStart=r,e.dictSize=n,e.currentOffset+=n;for(var i=r,a=r+n;i<=a-4;)y(t,i,e.hashTable,d.byU32,o),i+=3;return n},compressContinue:M,saveDict:w,createStreamDecode:function(){return{externalDict:null,extDictStart:0,extDictSize:0,prefixEnd:0,prefixSize:0}},setStreamDecode:U,decompressSafeContinue:L,RingBufferEncoder:P,RingBufferDecoder:x,_hashU16:m,_hashU32:f,_TABLE_TYPE:d}},9687:function(e,t,r){"use strict";e.exports=s;var n=r(8923);((s.prototype=Object.create(n.prototype)).constructor=s).className="Service";var o=r(8811),i=r(3262),a=r(5047);function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var r=new s(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},s.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},s.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},s.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,c(this)):n.prototype.add.call(this,e)},s.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,c(this)}return n.prototype.remove.call(this,e)},s.prototype.create=function(e,t,r){for(var n,o=new a.Service(e,t,r),s=0;s<this.methodsArray.length;++s){var c=i.lcFirst((n=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");o[c]=i.codegen(["r","c"],i.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return o}},9773:function(e,t,r){"use strict";var n=r(6518),o=r(4495),i=r(9039),a=r(3717),s=r(8981);n({target:"Object",stat:!0,forced:!o||i((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(s(e)):[]}})},9868:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(1291),a=r(1240),s=r(2333),c=r(9039),u=RangeError,l=String,d=Math.floor,p=o(s),h=o("".slice),f=o(1..toFixed),m=function(e,t,r){return 0===t?r:t%2==1?m(e,t-1,r*e):m(e*e,t/2,r)},v=function(e,t,r){for(var n=-1,o=r;++n<6;)o+=t*e[n],e[n]=o%1e7,o=d(o/1e7)},g=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=d(n/t),n=n%t*1e7},y=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=l(e[t]);r=""===r?n:r+p("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:c((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!c((function(){f({})}))},{toFixed:function(e){var t,r,n,o,s=a(this),c=i(e),d=[0,0,0,0,0,0],f="",E="0";if(c<0||c>20)throw new u("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return l(s);if(s<0&&(f="-",s=-s),s>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(s*m(2,69,1))-69)<0?s*m(2,-t,1):s/m(2,t,1),r*=4503599627370496,(t=52-t)>0){for(v(d,0,r),n=c;n>=7;)v(d,1e7,0),n-=7;for(v(d,m(10,n,1),0),n=t-1;n>=23;)g(d,1<<23),n-=23;g(d,1<<n),v(d,1,1),g(d,2),E=y(d)}else v(d,0,r),v(d,1<<-t,0),E=y(d)+p("0",c);return c>0?f+((o=E.length)<=c?"0."+p("0",c-o)+E:h(E,0,o-c)+"."+h(E,o-c)):f+E}})},9948:function(e,t,r){"use strict";var n=r(5370),o=r(4644).getTypedArrayConstructor;e.exports=function(e,t){return n(o(e),t)}},9955:function(e,t,r){"use strict";var n=r(4644),o=r(9213).findIndex,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.amdO={},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return function(){"use strict";__webpack_require__.d(__webpack_exports__,{default:function(){return ru}});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{acceptContactInvite:function(){return ao},acceptInvitation:function(){return io},addContact:function(){return ro},addConversationMark:function(){return Lo},addReaction:function(){return yo},addToBlackList:function(){return uo},addUsersToBlacklist:function(){return lo},addUsersToBlocklist:function(){return po},declineContactInvite:function(){return co},declineInvitation:function(){return so},deleteAllMessagesAndConversations:function(){return Do},deleteContact:function(){return oo},deleteConversation:function(){return Kn},deleteReaction:function(){return Eo},deleteSession:function(){return zn},fetchHistoryMessages:function(){return $n},fetchUserInfoById:function(){return Yn},getAllContacts:function(){return Mo},getBlacklist:function(){return kn},getBlocklist:function(){return Dn},getContacts:function(){return jn},getContactsWithCursor:function(){return wo},getConversationlist:function(){return qn},getHistoryMessages:function(){return eo},getRTCToken:function(){return ti},getReactionDetail:function(){return Io},getReactionList:function(){return _o},getReactionlist:function(){return To},getRoster:function(){return Bn},getSelfIdsOnOtherPlatform:function(){return ko},getServerConversations:function(){return So},getServerConversationsByFilter:function(){return xo},getServerPinnedConversations:function(){return Co},getServerPinnedMessages:function(){return Ho},getSessionList:function(){return Fn},getTokenExpireTimestamp:function(){return Qn},getUserIdByRTCUIds:function(){return ri},modifyMessage:function(){return go},pinConversation:function(){return No},pinMessage:function(){return jo},recallMessage:function(){return vo},removeConversationMark:function(){return Po},removeFromBlackList:function(){return ho},removeHistoryMessages:function(){return Ro},removeRoster:function(){return no},removeUserFromBlackList:function(){return fo},removeUserFromBlocklist:function(){return mo},reportMessage:function(){return Oo},searchMessages:function(){return to},setContactRemark:function(){return Ao},unbindPushToken:function(){return Fo},unpinMessage:function(){return Go},updateCurrentUserNick:function(){return Xn},updateOwnUserInfo:function(){return Vn},updateUserInfo:function(){return Jn},uploadPushToken:function(){return Hn},uploadToken:function(){return Gn},voiceFileToText:function(){return ei},voiceMessageToText:function(){return Zo}});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{acceptGroupInvite:function(){return Gi},acceptGroupJoinRequest:function(){return ki},addUsersToGroupAllowlist:function(){return fa},addUsersToGroupWhitelist:function(){return ha},agreeInviteIntoGroup:function(){return ji},agreeJoinGroup:function(){return xi},blockGroup:function(){return li},blockGroupMember:function(){return ta},blockGroupMembers:function(){return na},blockGroupMessage:function(){return ka},blockGroupMessages:function(){return di},changeGroupOwner:function(){return gi},changeOwner:function(){return vi},createGroup:function(){return ci},createGroupNew:function(){return si},createGroupVNext:function(){return ui},deleteGroupSharedFile:function(){return Na},destroyGroup:function(){return Ai},disableSendGroupMsg:function(){return da},dissolveGroup:function(){return Ni},downloadGroupSharedFile:function(){return wa},enableSendGroupMsg:function(){return pa},fetchGroupAnnouncement:function(){return Sa},fetchGroupSharedFileList:function(){return Aa},getGroup:function(){return fi},getGroupAdmin:function(){return Oi},getGroupAllowlist:function(){return Ea},getGroupBlacklist:function(){return ua},getGroupBlacklistNew:function(){return ca},getGroupBlocklist:function(){return la},getGroupInfo:function(){return yi},getGroupMemberAttributes:function(){return La},getGroupMembers:function(){return Ii},getGroupMembersAttributes:function(){return Pa},getGroupMsgReadUser:function(){return Ra},getGroupMuteList:function(){return $i},getGroupMutelist:function(){return Zi},getGroupSharedFilelist:function(){return Ma},getGroupWhitelist:function(){return ya},getJoinedGroups:function(){return mi},getJoinedGroupsCount:function(){return xa},getMuted:function(){return Qi},getPublicGroups:function(){return hi},groupBlockMulti:function(){return ra},groupBlockSingle:function(){return ea},inviteToGroup:function(){return Ui},inviteUsersToGroup:function(){return Li},isGroupWhiteUser:function(){return _a},isInGroupAllowlist:function(){return Ia},isInGroupMutelist:function(){return Oa},isInGroupWhiteList:function(){return Ta},joinGroup:function(){return Pi},leaveGroup:function(){return wi},listGroupMember:function(){return _i},listGroupMembers:function(){return Ti},listGroups:function(){return pi},modifyGroup:function(){return Ei},mute:function(){return Vi},muteGroupMember:function(){return Ji},quitGroup:function(){return Mi},rejectGroupInvite:function(){return Fi},rejectGroupJoinRequest:function(){return Bi},rejectInviteIntoGroup:function(){return Hi},rejectJoinGroup:function(){return Di},removeAdmin:function(){return bi},removeGroupAdmin:function(){return Ci},removeGroupAllowlistMember:function(){return ga},removeGroupBlockMulti:function(){return aa},removeGroupBlockSingle:function(){return oa},removeGroupMember:function(){return Wi},removeGroupMembers:function(){return Ki},removeGroupWhitelistMember:function(){return va},removeMultiGroupMember:function(){return zi},removeMute:function(){return Yi},removeSingleGroupMember:function(){return qi},rmUsersFromGroupWhitelist:function(){return ma},setAdmin:function(){return Ri},setGroupAdmin:function(){return Si},setGroupMemberAttributes:function(){return Ua},unblockGroupMember:function(){return ia},unblockGroupMembers:function(){return sa},unblockGroupMessage:function(){return Da},unmuteGroupMember:function(){return Xi},updateGroupAnnouncement:function(){return ba},uploadGroupSharedFile:function(){return Ca}});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{addUsersToChatRoom:function(){return Ya},addUsersToChatRoomAllowlist:function(){return Ss},addUsersToChatRoomWhitelist:function(){return Rs},blockChatRoomMember:function(){return ps},blockChatRoomMembers:function(){return fs},chatRoomBlockMulti:function(){return hs},chatRoomBlockSingle:function(){return ds},createChatRoom:function(){return Ha},deleteChatRoomSharedFile:function(){return Ds},destroyChatRoom:function(){return Fa},disableSendChatRoomMsg:function(){return Is},enableSendChatRoomMsg:function(){return Os},fetchChatRoomAnnouncement:function(){return Ps},fetchChatRoomSharedFileList:function(){return Bs},getChatRoomAdmin:function(){return rs},getChatRoomAllowlist:function(){return Ms},getChatRoomAttributes:function(){return Gs},getChatRoomBlacklist:function(){return _s},getChatRoomBlacklistNew:function(){return Es},getChatRoomBlocklist:function(){return Ts},getChatRoomDetails:function(){return qa},getChatRoomMembers:function(){return ts},getChatRoomMuteList:function(){return us},getChatRoomMuted:function(){return cs},getChatRoomMutelist:function(){return ls},getChatRoomSharedFilelist:function(){return js},getChatRoomWhitelist:function(){return As},getChatRooms:function(){return Ga},getJoinedChatRooms:function(){return zs},isChatRoomWhiteUser:function(){return ws},isInChatRoomAllowlist:function(){return Us},isInChatRoomMutelist:function(){return Ls},joinChatRoom:function(){return Xa},leaveChatRoom:function(){return $a},listChatRoomMember:function(){return Za},listChatRoomMembers:function(){return es},modifyChatRoom:function(){return Wa},muteChatRoomMember:function(){return is},quitChatRoom:function(){return Qa},removeChatRoomAdmin:function(){return os},removeChatRoomAllowlistMember:function(){return Ns},removeChatRoomAttribute:function(){return Ws},removeChatRoomAttributes:function(){return qs},removeChatRoomBlockMulti:function(){return gs},removeChatRoomBlockSingle:function(){return ms},removeChatRoomMember:function(){return Ka},removeChatRoomMembers:function(){return Ja},removeChatRoomWhitelistMember:function(){return Cs},removeMultiChatRoomMember:function(){return Va},removeMuteChatRoomMember:function(){return as},removeSingleChatRoomMember:function(){return za},rmUsersFromChatRoomWhitelist:function(){return bs},setChatRoomAdmin:function(){return ns},setChatRoomAttribute:function(){return Fs},setChatRoomAttributes:function(){return Hs},unblockChatRoomMember:function(){return vs},unblockChatRoomMembers:function(){return ys},unmuteChatRoomMember:function(){return ss},updateChatRoomAnnouncement:function(){return xs},uploadChatRoomSharedFile:function(){return ks}});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{getPresenceStatus:function(){return Zs},getSubscribedPresenceList:function(){return Qs},getSubscribedPresencelist:function(){return $s},publishPresence:function(){return Js},subscribePresence:function(){return Ys},unsubscribePresence:function(){return Xs}});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{clearRemindTypeForConversation:function(){return nc},getPushPerformLanguage:function(){return sc},getSilentModeForAll:function(){return tc},getSilentModeForConversation:function(){return oc},getSilentModeForConversations:function(){return ic},getSilentModeRemindTypeConversations:function(){return cc},setPushPerformLanguage:function(){return ac},setSilentModeForAll:function(){return ec},setSilentModeForConversation:function(){return rc}});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{changeChatThreadName:function(){return mc},createChatThread:function(){return dc},destroyChatThread:function(){return fc},getChatThreadDetail:function(){return Ic},getChatThreadLastMessage:function(){return _c},getChatThreadMembers:function(){return vc},getChatThreads:function(){return Ec},getJoinedChatThreads:function(){return yc},joinChatThread:function(){return pc},leaveChatThread:function(){return hc},removeChatThreadMember:function(){return gc}});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{getSupportedLanguages:function(){return Oc},translateMessage:function(){return Rc}});var s,c=__webpack_require__(2549),u=__webpack_require__.n(c),l=__webpack_require__(8570),d=__webpack_require__.n(l),p=(__webpack_require__(2675),__webpack_require__(9463),__webpack_require__(2259),__webpack_require__(8706),__webpack_require__(2008),__webpack_require__(1629),__webpack_require__(4423),__webpack_require__(3792),__webpack_require__(2712),__webpack_require__(4743),__webpack_require__(1745),__webpack_require__(8309),__webpack_require__(9089),__webpack_require__(739),__webpack_require__(3288),__webpack_require__(4170),__webpack_require__(2010),__webpack_require__(6033),__webpack_require__(2892),__webpack_require__(9085),__webpack_require__(4185),__webpack_require__(9432),__webpack_require__(6099),__webpack_require__(3362),__webpack_require__(1699),__webpack_require__(7764),__webpack_require__(1392),__webpack_require__(1489),__webpack_require__(1630),__webpack_require__(2170),__webpack_require__(5044),__webpack_require__(1920),__webpack_require__(1694),__webpack_require__(9955),__webpack_require__(3206),__webpack_require__(4496),__webpack_require__(6651),__webpack_require__(2887),__webpack_require__(9369),__webpack_require__(6812),__webpack_require__(8995),__webpack_require__(1575),__webpack_require__(6072),__webpack_require__(8747),__webpack_require__(8845),__webpack_require__(9423),__webpack_require__(7301),__webpack_require__(373),__webpack_require__(6614),__webpack_require__(1405),__webpack_require__(3684),__webpack_require__(3500),__webpack_require__(2953),__webpack_require__(6031),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}());__webpack_require__(5276),__webpack_require__(8921),__webpack_require__(4782),__webpack_require__(9868),__webpack_require__(7495),__webpack_require__(8781),__webpack_require__(3296),__webpack_require__(7208),__webpack_require__(8408),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.REQUEST_ABORT=-4]="REQUEST_ABORT",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_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.MAX_LIMIT=50]="MAX_LIMIT",e[e.MESSAGE_NOT_FOUND=51]="MESSAGE_NOT_FOUND",e[e.NO_PERMISSION=52]="NO_PERMISSION",e[e.OPERATION_UNSUPPORTED=53]="OPERATION_UNSUPPORTED",e[e.OPERATION_NOT_ALLOWED=54]="OPERATION_NOT_ALLOWED",e[e.WEBIM_TOKEN_EXPIRED=56]="WEBIM_TOKEN_EXPIRED",e[e.WEBIM_SERVER_SERVING_DISABLED=57]="WEBIM_SERVER_SERVING_DISABLED",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.PARSE_FILE_ERROR=203]="PARSE_FILE_ERROR",e[e.USER_NOT_FOUND=204]="USER_NOT_FOUND",e[e.MESSAGE_PARAMETER_ERROR=205]="MESSAGE_PARAMETER_ERROR",e[e.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE=206]="WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE",e[e.WEBIM_CONNCTION_USER_REMOVED=207]="WEBIM_CONNCTION_USER_REMOVED",e[e.WEBIM_USER_ALREADY_LOGIN=208]="WEBIM_USER_ALREADY_LOGIN",e[e.USER_LOGIN_TOO_MANY_DEVICES=214]="USER_LOGIN_TOO_MANY_DEVICES",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.USER_MUTED_BY_ADMIN=219]="USER_MUTED_BY_ADMIN",e[e.USER_DEVICE_CHANGED=220]="USER_DEVICE_CHANGED",e[e.USER_NOT_FRIEND=221]="USER_NOT_FRIEND",e[e.WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION=222]="WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION",e[e.WEBIM_DOWNLOADFILE_ERROR_EXPIRED=223]="WEBIM_DOWNLOADFILE_ERROR_EXPIRED",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.SERVER_GET_DNSLIST_FAILED=304]="SERVER_GET_DNSLIST_FAILED",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.FILE_INVALID=407]="FILE_INVALID",e[e.FILE_DURATION_TOO_LONG=408]="FILE_DURATION_TOO_LONG",e[e.FILE_VOICE_TO_TEXT_FAILED=409]="FILE_VOICE_TO_TEXT_FAILED",e[e.FILE_NOT_FOUND=410]="FILE_NOT_FOUND",e[e.FILE_TOO_LARGE=411]="FILE_TOO_LARGE",e[e.SERVER_BUSY=500]="SERVER_BUSY",e[e.MESSAGE_INCLUDE_ILLEGAL_CONTENT=501]="MESSAGE_INCLUDE_ILLEGAL_CONTENT",e[e.MESSAGE_EXTERNAL_LOGIC_BLOCKED=502]="MESSAGE_EXTERNAL_LOGIC_BLOCKED",e[e.SERVER_UNKNOWN_ERROR=503]="SERVER_UNKNOWN_ERROR",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.MESSAGE_MODERATION_BLOCKED=508]="MESSAGE_MODERATION_BLOCKED",e[e.MESSAGE_CURRENT_LIMITING=509]="MESSAGE_CURRENT_LIMITING",e[e.MESSAGE_WEBSOCKET_DISCONNECTED=510]="MESSAGE_WEBSOCKET_DISCONNECTED",e[e.MESSAGE_SIZE_LIMIT=511]="MESSAGE_SIZE_LIMIT",e[e.MESSAGE_SEND_TIMEOUT=512]="MESSAGE_SEND_TIMEOUT",e[e.MESSAGE_STREAM_INTERVAL_TIMEOUT=513]="MESSAGE_STREAM_INTERVAL_TIMEOUT",e[e.MESSAGE_STREAM_TIMEOUT=514]="MESSAGE_STREAM_TIMEOUT",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.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.GROUP_MEMBERS_LIMIT=607]="GROUP_MEMBERS_LIMIT",e[e.GROUP_IS_DISABLED=608]="GROUP_IS_DISABLED",e[e.GROUP_MEMBER_ATTRIBUTES_SET_FAILED=609]="GROUP_MEMBER_ATTRIBUTES_SET_FAILED",e[e.REST_PARAMS_STATUS=700]="REST_PARAMS_STATUS",e[e.CHATROOM_NOT_JOINED=702]="CHATROOM_NOT_JOINED",e[e.CHATROOM_MEMBERS_FULL=704]="CHATROOM_MEMBERS_FULL",e[e.CHATROOM_NOT_EXIST=705]="CHATROOM_NOT_EXIST",e[e.LOCAL_DB_OPERATION_FAILED=800]="LOCAL_DB_OPERATION_FAILED",e[e.SDK_RUNTIME_ERROR=999]="SDK_RUNTIME_ERROR",e[e.PRESENCE_PARAM_EXCEED=1100]="PRESENCE_PARAM_EXCEED",e[e.REACTION_ALREADY_ADDED=1101]="REACTION_ALREADY_ADDED",e[e.REACTION_CREATING=1102]="REACTION_CREATING",e[e.REACTION_OPERATION_IS_ILLEGAL=1103]="REACTION_OPERATION_IS_ILLEGAL",e[e.TRANSLATION_NOT_VALID=1200]="TRANSLATION_NOT_VALID",e[e.TRANSLATION_TEXT_TOO_LONG=1201]="TRANSLATION_TEXT_TOO_LONG",e[e.TRANSLATION_FAILED=1204]="TRANSLATION_FAILED",e[e.THREAD_NOT_EXIST=1300]="THREAD_NOT_EXIST",e[e.THREAD_ALREADY_EXIST=1301]="THREAD_ALREADY_EXIST",e[e.MODIFY_MESSAGE_NOT_EXIST=1302]="MODIFY_MESSAGE_NOT_EXIST",e[e.MODIFY_MESSAGE_FORMAT_ERROR=1303]="MODIFY_MESSAGE_FORMAT_ERROR",e[e.MODIFY_MESSAGE_FAILED=1304]="MODIFY_MESSAGE_FAILED",e[e.CONVERSATION_NOT_EXIST=1400]="CONVERSATION_NOT_EXIST"}(s||(s={}));var h,f,m,v,g,y,E,_=function(){return _=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_.apply(this,arguments)},T=function(e,t,r,n){var o,i,a,c,u,l,d,p,h,f,m,v,g,y,E,T,I,O,R,S,b,C,N,A,M,w,U,L,P=e.response;P&&"string"==typeof P&&(P=JSON.parse(P));var x=e.status,k={elapse:n,httpCode:x,errDesc:null==P?void 0:P.error_description};if(400===x){if(4000005===P.error_code||4000006===P.error_code)return void t({type:s.REQUEST_PARAMETER_ERROR,message:null==P?void 0:P.error_description,extraInfo:k});if(40002===P.error_code)return void t({type:s.THREAD_ALREADY_EXIST,message:null==P?void 0:P.error_description,extraInfo:k});if(40009===P.error_code)return void t({type:s.OPERATION_UNSUPPORTED,message:null==P?void 0:P.error_description,extraInfo:k});if(60005===P.error_code)return void t({type:s.GROUP_MEMBER_ATTRIBUTES_SET_FAILED,message:(null==P?void 0:P.desc)||(null==P?void 0:P.error_description),extraInfo:k});if(60010===P.error_code)return void((null===(o=null==P?void 0:P.error_description)||void 0===o?void 0:o.includes("exceeds chatgroup user metadata single value limit"))?t({type:s.MAX_LIMIT,message:(null==P?void 0:P.desc)||P.error_description,extraInfo:k}):t({type:s.NO_PERMISSION,message:(null==P?void 0:P.desc)||P.error_description,extraInfo:k}));if(60011===P.error_code)return void t({type:s.CHATROOM_NOT_JOINED,message:null==P?void 0:P.desc,extraInfo:k});if(14403===P.error_code)return void t({type:s.WEBIM_UPLOADFILE_ERROR,message:null==P?void 0:P.error_description,data:P,extraInfo:k});if(60006===P.error_code||60007===P.error_code||60009===P.error_code||60012===P.error_code)return void t({type:s.MAX_LIMIT,message:(null==P?void 0:P.desc)||(null==P?void 0:P.error_description),extraInfo:k});if(91104===P.error_code)return void t({type:s.NO_PERMISSION,message:null==P?void 0:P.error_description,extraInfo:k});if(null===(i=P.error_description)||void 0===i?void 0:i.includes("are not members of this group"))return(null===(a=e.responseURL)||void 0===a?void 0:a.includes("chatgroups"))?t({type:s.GROUP_NOT_JOINED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):t({type:s.CHATROOM_NOT_JOINED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}),void r({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:null==P?void 0:P.error_description,data:e.responseText,extraInfo:k});if("the app not open presence"===(null==P?void 0:P.result))return void t({type:s.SERVICE_NOT_ENABLED,message:null==P?void 0:P.result,extraInfo:k});if(null===(c=null==P?void 0:P.error_description)||void 0===c?void 0:c.includes("remark length must less"))return void t({type:s.MAX_LIMIT,message:null==P?void 0:P.error_description,extraInfo:k});switch(null==P?void 0:P.error_description){case"the user is already operation this message":t({type:s.REACTION_ALREADY_ADDED,message:null==P?void 0:P.error_description,extraInfo:k});break;case"The quantity has exceeded the limit!":t({type:s.MAX_LIMIT,message:null==P?void 0:P.error_description,extraInfo:k});break;case"The user not in this group!":t({type:s.GROUP_NOT_JOINED,message:null==P?void 0:P.error_description,extraInfo:k});break;case"the user operation is illegal!":t({type:s.REACTION_OPERATION_IS_ILLEGAL,message:null==P?void 0:P.error_description,extraInfo:k});break;case"this appKey is not open reaction service!":case"this appKey not open message roaming":t({type:s.SERVICE_NOT_ENABLED,message:null==P?void 0:P.error_description,extraInfo:k});break;case"this message is creating reaction, please try again.":t({type:s.REACTION_CREATING,message:null==P?void 0:P.error_description,extraInfo:k});break;case"groupId can not be null!":t({type:s.GROUP_NOT_EXIST,message:null==P?void 0:P.error_description,extraInfo:k});break;case"The input text is too long.":t({type:s.TRANSLATION_TEXT_TOO_LONG,message:null==P?void 0:P.error_description,extraInfo:k});break;case"The target language is not valid.":t({type:s.TRANSLATION_NOT_VALID,message:null==P?void 0:P.error_description,extraInfo:k});break;case"report failed, get message by id failed":t({type:s.MESSAGE_NOT_FOUND,message:null==P?void 0:P.error_description,extraInfo:k});break;case"ext is too big ":t({type:s.PRESENCE_PARAM_EXCEED,message:null==P?void 0:P.error_description,extraInfo:k});break;case"Request body not readable.Please check content type is correct!":case"param mark must be not empty, please check!":case"param mark illegal, please check it!":case"param pin_msg_id illegal, please check it!":t({type:s.REQUEST_PARAMETER_ERROR,message:null==P?void 0:P.error_description,extraInfo:k});break;case"updateRemark | they are not friends, please add as a friend first.":t({type:s.USER_NOT_FRIEND,message:null==P?void 0:P.error_description,extraInfo:k});break;default:t({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:null==P?void 0:P.error_description,data:e.responseText,extraInfo:k}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:null==P?void 0:P.error_description,data:e.responseText,extraInfo:k})}}else if(401===x)4010101===P.error_code?t({type:s.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:null==P?void 0:P.error_description,extraInfo:k}):40001===P.error_code||60001===P.error_code||"Unable to authenticate (OAuth)"===P.error_description?t({type:s.NO_PERMISSION,message:null==P?void 0:P.error_description,extraInfo:k}):(r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:k}),t({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:k}));else if(403===x)4e4===P.error_code||60004===P.error_code||15002===P.error_code||4030204===P.error_code?t({type:s.SERVICE_NOT_ENABLED,message:null==P?void 0:P.error_description,extraInfo:k}):40003===P.error_code||40004===P.error_code?t({type:s.THREAD_ALREADY_EXIST,message:null==P?void 0:P.error_description,extraInfo:k}):40005===P.error_code||40007===P.error_code||91002===P.error_code?t({type:s.MAX_LIMIT,message:null==P?void 0:P.error_description,extraInfo:k}):60002===P.error_code?t({type:s.PERMISSION_DENIED,message:null==P?void 0:P.error_description,extraInfo:k}):91101===P.error_code?t({type:s.MAX_LIMIT,message:null==P?void 0:P.error_description,extraInfo:k}):91102===P.error_code&&t({type:s.REQUEST_PARAMETER_ERROR,message:P.error_description,extraInfo:k}),"group member list is full!"===P.error_description?(null===(u=e.responseURL)||void 0===u?void 0:u.includes("chatgroups"))?t({type:s.GROUP_MEMBERS_FULL,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):t({type:s.CHATROOM_MEMBERS_FULL,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(l=P.error_description)||void 0===l?void 0:l.includes("invite users to join group failed"))&&(null===(d=P.error_description)||void 0===d?void 0:d.includes("already in group"))?(null===(p=e.responseURL)||void 0===p?void 0:p.includes("chatgroups"))&&t({type:s.GROUP_ALREADY_JOINED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(h=P.error_description)||void 0===h?void 0:h.includes("are not members of this group"))?(null===(f=e.responseURL)||void 0===f?void 0:f.includes("chatgroups"))?t({type:s.GROUP_NOT_JOINED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):t({type:s.CHATROOM_NOT_JOINED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(m=P.error_description)||void 0===m?void 0:m.includes("service not open!"))||(null===(v=P.error_description)||void 0===v?void 0:v.includes("message report not open"))||(null===(g=P.error_description)||void 0===g?void 0:g.includes("messageroaming function not open"))?t({type:s.SERVICE_NOT_ENABLED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(y=P.error_description)||void 0===y?void 0:y.includes("members size is greater than max user size !"))?t({type:s.GROUP_MEMBERS_LIMIT,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(E=P.error_description)||void 0===E?void 0:E.includes("can not operate this group, reason: group is disabled"))?t({type:s.GROUP_IS_DISABLED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(T=P.error_description)||void 0===T?void 0:T.includes("Invitee's contact max count"))||(null===(I=P.error_description)||void 0===I?void 0:I.includes("Inviter's contact max count"))?t({type:s.MAX_LIMIT,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):t({type:s.PERMISSION_DENIED,data:e.response||e.responseText,message:"permission denied",extraInfo:_(_({},k),{errDesc:"permission denied"})}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:k});else if(404===x){if(4040302===P.error_code)return void t({type:s.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:null==P?void 0:P.error_description,extraInfo:k});40011===P.error_code?t({type:s.THREAD_NOT_EXIST,message:null==P?void 0:P.error_description,extraInfo:k}):40012===P.error_code?t({type:s.NO_PERMISSION,message:null==P?void 0:P.error_description,extraInfo:k}):60003===P.error_code||20004===P.error_code?t({type:s.GROUP_NOT_JOINED,message:null==P?void 0:P.error_description,extraInfo:k}):91001===P.error_code&&t({type:s.CONVERSATION_NOT_EXIST,message:null==P?void 0:P.error_description,extraInfo:k}),(null===(O=P.error_description)||void 0===O?void 0:O.includes("do not find this group"))||(null===(R=P.error_description)||void 0===R?void 0:R.includes("does not exist"))?(null===(S=e.responseURL)||void 0===S?void 0:S.includes("chatgroups"))?t({type:s.GROUP_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:_(_({},k),{errDesc:"The chat room dose not exist."})}):t({type:s.CHATROOM_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:_(_({},k),{errDesc:"The chat room dose not exist."})}):(null===(b=P.error_description)||void 0===b?void 0:b.includes("username"))&&(null===(C=P.error_description)||void 0===C?void 0:C.includes("doesn't exist!'"))||(null===(N=P.error_description)||void 0===N?void 0:N.includes("user not found"))||(null===(A=P.error_description)||void 0===A?void 0:A.includes("Service resource not found"))&&"UserNotFoundException"===(null==P?void 0:P.exception)?t({type:s.USER_NOT_FOUND,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(M=P.error_description)||void 0===M?void 0:M.includes("user session pin message not exist"))?t({type:s.MESSAGE_NOT_FOUND,message:P.error_description,extraInfo:k}):t({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:k}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:k})}else if(406===x)90004===P.error_code&&t({type:s.OPERATION_NOT_ALLOWED,message:null==P?void 0:P.error_description,extraInfo:k});else if(429===x||503===x){if(null===(w=P.error_description)||void 0===w?void 0:w.includes("The request has reached the maximum limit"))return void t({type:s.MAX_LIMIT,message:e.responseText,extraInfo:k});if(null===(U=P.error_description)||void 0===U?void 0:U.includes("upload client logs reached limit"))return void t({type:s.MAX_LIMIT,message:e.responseText});t({type:s.SERVER_BUSY,data:e.response||e.responseText,message:"Server is busy.",extraInfo:_(_({},k),{errDesc:"Server is busy."})}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"Server is busy.",extraInfo:_(_({},k),{errDesc:"Server is busy."})})}else if(500===x){if(40006===P.error_code||40008===P.error_code||40010===P.error_code||5000701===P.error_code)return void t({type:s.SERVER_UNKNOWN_ERROR,message:null==P?void 0:P.error_description,extraInfo:k});if(90005===P.error_code||99999===P.error_code)return void t({type:s.REQUEST_UNKNOWN,message:null==P?void 0:P.error_description,extraInfo:k});if(null===(L=P.error_description)||void 0===L?void 0:L.includes("translte failed!"))return void t({type:s.TRANSLATION_FAILED,message:e.responseText,extraInfo:k});t({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:k}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:k})}else if(502===x){if(5020801===P.error_code)return void t({type:s.SERVER_UNKNOWN_ERROR,message:null==P?void 0:P.error_description,extraInfo:k});t({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:_(_({},k),{errDesc:"ajax error"})}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:_(_({},k),{errDesc:"ajax error"})})}else t({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:_(_({},k),{errDesc:"ajax error"})}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:_(_({},k),{errDesc:"ajax error"})})};!function(e){e[e.UNKNOWOPERATION=-1]="UNKNOWOPERATION",e[e.REST_GET_SESSION_LIST=1]="REST_GET_SESSION_LIST",e[e.REST_DEL_SESSION=2]="REST_DEL_SESSION",e[e.REST_GET_HISTORY_MESSAGE=3]="REST_GET_HISTORY_MESSAGE",e[e.REST_PIN_CONVERSATION=4]="REST_PIN_CONVERSATION",e[e.REST_MARK_CONVERSATION=5]="REST_MARK_CONVERSATION",e[e.REST_UPLOAD_FILE_IN_PARTS=6]="REST_UPLOAD_FILE_IN_PARTS",e[e.REST_DELETE_MESSAGES_CONVERSATIONS=7]="REST_DELETE_MESSAGES_CONVERSATIONS",e[e.REST_PIN_MESSAGE=8]="REST_PIN_MESSAGE",e[e.REST_FETCH_PINMESSAGES=9]="REST_FETCH_PINMESSAGES",e[e.REST_FETCH_CONVERSATIONS=10]="REST_FETCH_CONVERSATIONS",e[e.REST_OPERATE=100]="REST_OPERATE",e[e.MSYNC_SENDMESSAGE=101]="MSYNC_SENDMESSAGE",e[e.MSYNC_RECALLMESSAGE=102]="MSYNC_RECALLMESSAGE",e[e.MSYNC_MODIFYMESSAGE=103]="MSYNC_MODIFYMESSAGE",e[e.MSYNC_OPERATE=200]="MSYNC_OPERATE",e[e.ROSTER_ADD=201]="ROSTER_ADD",e[e.ROSTER_REMOVE=202]="ROSTER_REMOVE",e[e.ROSTER_ACCEPT=203]="ROSTER_ACCEPT",e[e.ROSTER_DECLINE=204]="ROSTER_DECLINE",e[e.ROSTER_BAN=205]="ROSTER_BAN",e[e.ROSTER_ALLOW=206]="ROSTER_ALLOW",e[e.ROSTER_BLACKLIST=207]="ROSTER_BLACKLIST",e[e.ROSTER_CONTACTS=208]="ROSTER_CONTACTS",e[e.ROSTER_GET_ALL_CONTACTS_REMARKS=209]="ROSTER_GET_ALL_CONTACTS_REMARKS",e[e.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE=210]="ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE",e[e.ROSTER_SET_CONTACT_REMARK=211]="ROSTER_SET_CONTACT_REMARK",e[e.ROSTER_OPERATE=300]="ROSTER_OPERATE",e[e.USER_LOGIN=301]="USER_LOGIN",e[e.USER_CREATE=302]="USER_CREATE",e[e.USER_UPDATE_USERINFO=303]="USER_UPDATE_USERINFO",e[e.USER_FETCH_USERINFO=304]="USER_FETCH_USERINFO",e[e.USER_UPDATE_NICK=305]="USER_UPDATE_NICK",e[e.USER_UPLOAD_PUSH_TOKEN=306]="USER_UPLOAD_PUSH_TOKEN",e[e.USER_LOGGEDIN_OTHER_PLATFORM=307]="USER_LOGGEDIN_OTHER_PLATFORM",e[e.USER_OPERATE=400]="USER_OPERATE",e[e.GROUP_CREATEGROUP=401]="GROUP_CREATEGROUP",e[e.GROUP_BLOCK_MESSAGE=402]="GROUP_BLOCK_MESSAGE",e[e.GROUP_FETCH_PUBLICGROUPS_WITHCURSOR=403]="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e[e.GROUP_FETCH_USERS_GROUP=404]="GROUP_FETCH_USERS_GROUP",e[e.GROUP_CHANGE_OWNER=405]="GROUP_CHANGE_OWNER",e[e.GROUP_FETCH_SPECIFICATION=406]="GROUP_FETCH_SPECIFICATION",e[e.GROUP_CHANGE_GROUPATTRIBUTE=407]="GROUP_CHANGE_GROUPATTRIBUTE",e[e.GROUP_FETCH_MEMEBERS=408]="GROUP_FETCH_MEMEBERS",e[e.GROUP_GET_ADMIN=409]="GROUP_GET_ADMIN",e[e.GROUP_SET_ADMIN=410]="GROUP_SET_ADMIN",e[e.GROUP_REMOVE_ADMIN=411]="GROUP_REMOVE_ADMIN",e[e.GROUP_DESTOTYGROUP=412]="GROUP_DESTOTYGROUP",e[e.GROUP_LEAVEGROUP=413]="GROUP_LEAVEGROUP",e[e.GROUP_INVITE_TO_GROUP=414]="GROUP_INVITE_TO_GROUP",e[e.GROUP_JOIN_PUBLICGROUP=415]="GROUP_JOIN_PUBLICGROUP",e[e.GROUP_ACCEPT_JOINPUBLICGROUPAPPL=416]="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e[e.GROUP_DECLINE_JOINPUBLICGROUPAPPL=417]="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e[e.GROUP_ACCEPT_INVITATION=418]="GROUP_ACCEPT_INVITATION",e[e.GROUP_DECLINE_INVITATION=419]="GROUP_DECLINE_INVITATION",e[e.GROUP_REMOVE_MEMBER=420]="GROUP_REMOVE_MEMBER",e[e.GROUP_REMOVE_MEMBERS=421]="GROUP_REMOVE_MEMBERS",e[e.GROUP_MUTE_MEMBERS=422]="GROUP_MUTE_MEMBERS",e[e.GROUP_UNMUTE_MEMBERS=423]="GROUP_UNMUTE_MEMBERS",e[e.GROUP_FETCH_MUTES=424]="GROUP_FETCH_MUTES",e[e.GROUP_BLOCK_MEMBER=425]="GROUP_BLOCK_MEMBER",e[e.GROUP_BLOCK_MEMBERS=426]="GROUP_BLOCK_MEMBERS",e[e.GROUP_UNBLOCK_MEMBER=427]="GROUP_UNBLOCK_MEMBER",e[e.GROUP_UNBLOCK_MEMBERS=428]="GROUP_UNBLOCK_MEMBERS",e[e.GROUP_GET_BLOCK_LIST=429]="GROUP_GET_BLOCK_LIST",e[e.GROUP_MUTE_ALLMEMBERS=430]="GROUP_MUTE_ALLMEMBERS",e[e.GROUP_UNMUTE_ALLMEMBERS=431]="GROUP_UNMUTE_ALLMEMBERS",e[e.GROUP_ADD_WHITELIST=432]="GROUP_ADD_WHITELIST",e[e.GROUP_REMOVE_WHITELIST=433]="GROUP_REMOVE_WHITELIST",e[e.GROUP_FETCH_WHITELIST=434]="GROUP_FETCH_WHITELIST",e[e.GROUP_IS_IN_WHITELIST=435]="GROUP_IS_IN_WHITELIST",e[e.GROUP_GET_READ_USERS=436]="GROUP_GET_READ_USERS",e[e.GROUP_FETCH_ANNOUNCEMENT=437]="GROUP_FETCH_ANNOUNCEMENT",e[e.GROUP_UPDATE_ANNOUNCEMENT=438]="GROUP_UPDATE_ANNOUNCEMENT",e[e.GROUP_UPLOAD_SHAREDFILE=439]="GROUP_UPLOAD_SHAREDFILE",e[e.GROUP_DELETE_SHAREDFILE=440]="GROUP_DELETE_SHAREDFILE",e[e.GROUP_FETCH_SHAREDFILE=441]="GROUP_FETCH_SHAREDFILE",e[e.GROUP_DOWNLOAD_SHAREDFILE=442]="GROUP_DOWNLOAD_SHAREDFILE",e[e.GROUP_MEMBER_SET_META_DATA=443]="GROUP_MEMBER_SET_META_DATA",e[e.GROUP_MEMBER_FETCH_META_DATA=444]="GROUP_MEMBER_FETCH_META_DATA",e[e.GROUP_OPERATE=500]="GROUP_OPERATE",e[e.CHATROOM_FETCH_CHATROOMSWITHPAGE=501]="CHATROOM_FETCH_CHATROOMSWITHPAGE",e[e.CHATROOM_CREATECHATROOM=502]="CHATROOM_CREATECHATROOM",e[e.CHATROOM_DESTORYCHATROOM=503]="CHATROOM_DESTORYCHATROOM",e[e.CHATROOM_FETCH_SPECIFICATION=504]="CHATROOM_FETCH_SPECIFICATION",e[e.CHATROOM_CHANGE_ATTRIBUTE=505]="CHATROOM_CHANGE_ATTRIBUTE",e[e.CHATROOM_REMOVE_MEMBER=506]="CHATROOM_REMOVE_MEMBER",e[e.CHATROOM_REMOVE_MEMBERS=507]="CHATROOM_REMOVE_MEMBERS",e[e.CHATROOM_ADD_MEMBERS=508]="CHATROOM_ADD_MEMBERS",e[e.CHATROOM_JOINCAHTROOM=509]="CHATROOM_JOINCAHTROOM",e[e.CHATROOM_LEAVECAHTROOM=510]="CHATROOM_LEAVECAHTROOM",e[e.CHATROOM_FETCH_MEMBERS=511]="CHATROOM_FETCH_MEMBERS",e[e.CHATROOM_GET_ADMIN=512]="CHATROOM_GET_ADMIN",e[e.CHATROOM_SET_ADMIN=513]="CHATROOM_SET_ADMIN",e[e.CHATROOM_REMOVE_ADMIN=514]="CHATROOM_REMOVE_ADMIN",e[e.CHATROOM_MUTE_USER=515]="CHATROOM_MUTE_USER",e[e.CHATROOM_UNMUTE_USER=516]="CHATROOM_UNMUTE_USER",e[e.CHATROOM_FETCH_MUTES=517]="CHATROOM_FETCH_MUTES",e[e.CHATROOM_BLOCK_USER=518]="CHATROOM_BLOCK_USER",e[e.CHATROOM_BLOCK_USERS=519]="CHATROOM_BLOCK_USERS",e[e.CHATROOM_UNBLOCK_USER=520]="CHATROOM_UNBLOCK_USER",e[e.CHATROOM_UNBLOCK_USERS=521]="CHATROOM_UNBLOCK_USERS",e[e.CHATROOM_FETCH_BANS=522]="CHATROOM_FETCH_BANS",e[e.CHATROOM_MUTE_ALLMEMEBERS=523]="CHATROOM_MUTE_ALLMEMEBERS",e[e.CHATROOM_UNMUTE_ALLMEMEBERS=524]="CHATROOM_UNMUTE_ALLMEMEBERS",e[e.CHATROOM_ADD_WHITELIST=525]="CHATROOM_ADD_WHITELIST",e[e.CHATROOM_REMOVE_WHITELIST=526]="CHATROOM_REMOVE_WHITELIST",e[e.CHATROOM_FETCH_WHITELIST=527]="CHATROOM_FETCH_WHITELIST",e[e.CHATROOM_FETCH_MEMBERIN_WHITELIST=528]="CHATROOM_FETCH_MEMBERIN_WHITELIST",e[e.CHATROOM_FETCH_ANNOUNCEMENT=529]="CHATROOM_FETCH_ANNOUNCEMENT",e[e.CHATROOM_UPDATE_ANNOUNCEMENT=530]="CHATROOM_UPDATE_ANNOUNCEMENT",e[e.CHATROOM_REMOVE_SHARE_FILE=531]="CHATROOM_REMOVE_SHARE_FILE",e[e.CHATROOM_GET_SHARE_FILE_LIST=532]="CHATROOM_GET_SHARE_FILE_LIST",e[e.CHATROOM_UPLOAD_FILE=533]="CHATROOM_UPLOAD_FILE",e[e.CHATROOM_SET_META_DATA=534]="CHATROOM_SET_META_DATA",e[e.CHATROOM_DELETE_META_DATA=535]="CHATROOM_DELETE_META_DATA",e[e.CHATROOM_FETCH_META_DATA=536]="CHATROOM_FETCH_META_DATA",e[e.CHATROOM_FETCH_USER_JOINED_CHATROOM=537]="CHATROOM_FETCH_USER_JOINED_CHATROOM",e[e.CHATROOM_OPERATE=600]="CHATROOM_OPERATE"}(h||(h={})),function(e){e.SDK_INTERNAL="SDK_INTERNAL",e.LOGIN="USER_LOGIN",e.REGISTER="USER_CREATE",e.GET_CHATROOM_LIST="CHATROOM_FETCH_CHATROOMSWITHPAGE",e.CREATE_CHATROOM="CHATROOM_CREATECHATROOM",e.DESTROY_CHATROOM="CHATROOM_DESTORYCHATROOM",e.GET_CHATROOM_DETAIL="CHATROOM_FETCH_SPECIFICATION",e.MODIFY_CHATROOM="CHATROOM_CHANGE_ATTRIBUTE",e.REMOVE_CHATROOM_MEMBER="CHATROOM_REMOVE_MEMBER",e.MULTI_REMOVE_CHATROOM_MEMBER="CHATROOM_REMOVE_MEMBERS",e.ADD_USERS_TO_CHATROOM="CHATROOM_ADD_MEMBERS",e.JOIN_CHATROOM="CHATROOM_JOINCAHTROOM",e.QUIT_CHATROOM="CHATROOM_LEAVECAHTROOM",e.LIST_CHATROOM_MEMBERS="CHATROOM_FETCH_MEMBERS",e.GET_CHATROOM_ADMIN="CHATROOM_GET_ADMIN",e.SET_CHATROOM_ADMIN="CHATROOM_SET_ADMIN",e.REMOVE_CHATROOM_ADMIN="CHATROOM_REMOVE_ADMIN",e.MUTE_CHATROOM_MEMBER="CHATROOM_MUTE_USER",e.REMOVE_MUTE_CHATROOM_MEMBER="CHATROOM_UNMUTE_USER",e.GET_MUTE_CHATROOM_MEMBERS="CHATROOM_FETCH_MUTES",e.SET_CHATROOM_MEMBER_TO_BLACK="CHATROOM_BLOCK_USER",e.MULTI_SET_CHATROOM_MEMBER_TO_BLACK="CHATROOM_BLOCK_USERS",e.REMOVE_CHATROOM_MEMBER_BLACK="CHATROOM_UNBLOCK_USER",e.MULTI_REMOVE_CHATROOM_MEMBER_BLACK="CHATROOM_UNBLOCK_USERS",e.GET_CHATROOM_BLOCK_MEMBERS="CHATROOM_FETCH_BANS",e.DISABLED_CHATROOM_SEND_MSG="CHATROOM_MUTE_ALLMEMEBERS",e.ENABLE_CHATROOM_SEND_MSG="CHATROOM_UNMUTE_ALLMEMEBERS",e.ADD_CHATROOM_WHITE_USERS="CHATROOM_ADD_WHITELIST",e.REMOVE_CHATROOM_WHITE_USERS="CHATROOM_REMOVE_WHITELIST",e.GET_CHATROOM_WHITE_USERS="CHATROOM_FETCH_WHITELIST",e.CHECK_CHATROOM_WHITE_USER="CHATROOM_FETCH_MEMBERIN_WHITELIST",e.GET_CHATROOM_ANN="CHATROOM_FETCH_ANNOUNCEMENT",e.UPDATE_CHATROOM_ANN="CHATROOM_UPDATE_ANNOUNCEMENT",e.DELETE_CHATROOM_FILE="CHATROOM_REMOVE_SHARE_FILE",e.GET_CHATROOM_FILES="CHATROOM_GET_SHARE_FILE_LIST",e.UPLOAD_CHATROOM_FILE="CHATROOM_UPLOAD_FILE",e.SET_CHATROOM_ATTR="CHATROOM_SET_META_DATA",e.DELETE_CHATROOM_ATTR="CHATROOM_DELETE_META_DATA",e.GET_CHATROOM_ATTR="CHATROOM_FETCH_META_DATA",e.GET_USER_JOINED_CHATROOM="CHATROOM_FETCH_USER_JOINED_CHATROOM",e.CREATE_GROUP="GROUP_CREATEGROUP",e.BLOCK_GROUP="GROUP_BLOCK_MESSAGE",e.LIST_GROUP="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e.GET_USER_GROUP="GROUP_FETCH_USERS_GROUP",e.CHANGE_OWNER="GROUP_CHANGE_OWNER",e.GET_GROUP_INFO="GROUP_FETCH_SPECIFICATION",e.MODIFY_GROUP="GROUP_CHANGE_GROUPATTRIBUTE",e.LIST_GROUP_MEMBER="GROUP_FETCH_MEMEBERS",e.GET_GROUP_ADMIN="GROUP_GET_ADMIN",e.SET_GROUP_ADMIN="GROUP_SET_ADMIN",e.REMOVE_GROUP_ADMIN="GROUP_REMOVE_ADMIN",e.DISSOLVE_GROUP="GROUP_DESTOTYGROUP",e.QUIT_GROUP="GROUP_LEAVEGROUP",e.INVITE_TO_GROUP="GROUP_INVITE_TO_GROUP",e.JOIN_GROUP="GROUP_JOIN_PUBLICGROUP",e.AGREE_JOIN_GROUP="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e.REJECT_JOIN_GROUP="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e.AGREE_INVITE_GROUP="GROUP_ACCEPT_INVITATION",e.REJECT_INVITE_GROUP="GROUP_DECLINE_INVITATION",e.REMOVE_GROUP_MEMBER="GROUP_REMOVE_MEMBER",e.MULTI_REMOVE_GROUP_MEMBER="GROUP_REMOVE_MEMBERS",e.MUTE_GROUP_MEMBER="GROUP_MUTE_MEMBERS",e.UNMUTE_GROUP_MEMBER="GROUP_UNMUTE_MEMBERS",e.GET_GROUP_MUTE_LIST="GROUP_FETCH_MUTES",e.BLOCK_GROUP_MEMBER="GROUP_BLOCK_MEMBER",e.BLOCK_GROUP_MEMBERS="GROUP_BLOCK_MEMBERS",e.UNBLOCK_GROUP_MEMBER="GROUP_UNBLOCK_MEMBER",e.UNBLOCK_GROUP_MEMBERS="GROUP_UNBLOCK_MEMBERS",e.GET_GROUP_BLACK_LIST="GROUP_GET_BLOCK_LIST",e.DISABLED_SEND_GROUP_MSG="GROUP_MUTE_ALLMEMBERS",e.ENABLE_SEND_GROUP_MSG="GROUP_UNMUTE_ALLMEMBERS",e.ADD_USERS_TO_GROUP_WHITE="GROUP_ADD_WHITELIST",e.REMOVE_GROUP_WHITE_MEMBER="GROUP_REMOVE_WHITELIST",e.GET_GROUP_WHITE_LIST="GROUP_FETCH_WHITELIST",e.IS_IN_GROUP_WHITE_LIST="GROUP_IS_IN_WHITELIST",e.GET_GROUP_MSG_READ_USER="GROUP_GET_READ_USERS",e.GET_GROUP_ANN="GROUP_FETCH_ANNOUNCEMENT",e.UPDATE_GROUP_ANN="GROUP_UPDATE_ANNOUNCEMENT",e.UPLOAD_GROUP_FILE="GROUP_UPLOAD_SHAREDFILE",e.DELETE_GROUP_FILE="GROUP_DELETE_SHAREDFILE",e.GET_GROUP_FILE_LIST="GROUP_FETCH_SHAREDFILE",e.DOWN_GROUP_FILE="GROUP_DOWNLOAD_SHAREDFILE",e.SET_GROUP_MEMBER_ATTRS="GROUP_MEMBER_SET_META_DATA",e.GET_GROUP_MEMBER_ATTR="GROUP_MEMBER_FETCH_META_DATA",e.GET_SESSION_LIST="REST_GET_SESSION_LIST",e.REST_FETCH_CONVERSATIONS="REST_FETCH_CONVERSATIONS",e.DELETE_SESSION="REST_DEL_SESSION",e.GET_HISTORY_MSG="REST_GET_HISTORY_MESSAGE",e.PIN_CONVERSATION="REST_PIN_CONVERSATION",e.REST_UPLOAD_FILE_IN_PARTS="REST_UPLOAD_FILE_IN_PARTS",e.REST_DELETE_MESSAGES_CONVERSATIONS="REST_DELETE_MESSAGES_CONVERSATIONS",e.MARK_CONVERSATION="REST_MARK_CONVERSATION",e.REST_FETCH_PINMESSAGES="REST_FETCH_PINMESSAGES",e.REST_PIN_MESSAGE="REST_PIN_MESSAGE",e.UPDATE_USER_INFO="USER_UPDATE_USERINFO",e.GET_USER_INFO="USER_FETCH_USERINFO",e.UPDATE_USER_NICK="USER_UPDATE_NICK",e.UPLOAD_PUSH_TOKEN="USER_UPLOAD_PUSH_TOKEN",e.USER_LOGGEDIN_OTHER_PLATFORM="USER_LOGGEDIN_OTHER_PLATFORM",e.GET_BLACK_LIST="ROSTER_BLACKLIST",e.GET_CONTACTS="ROSTER_CONTACTS",e.ROSTER_GET_ALL_CONTACTS_REMARKS="ROSTER_GET_ALL_CONTACTS_REMARKS",e.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE="ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE",e.ROSTER_SET_CONTACT_REMARK="ROSTER_SET_CONTACT_REMARK",e.ROSTER_ADD="ROSTER_ADD",e.ROSTER_REMOVE="ROSTER_REMOVE",e.ROSTER_ACCEPT="ROSTER_ACCEPT",e.ROSTER_DECLINE="ROSTER_DECLINE",e.ROSTER_BAN="ROSTER_BAN",e.ROSTER_ALLOW="ROSTER_ALLOW",e.SEND_MSG="MSYNC_SENDMESSAGE",e.UPLOAD_MSG_ATTACH="UPLOAD_MSG_ATTACH",e.SEND_RECALL_MSG="MSYNC_RECALLMESSAGE",e.MODIFY_MESSAGE="MSYNC_MODIFYMESSAGE",e.REST_FETCHHISTORYMESSAGE="REST_FETCHHISTORYMESSAGE",e.REST_SEARCH_MESSAGES="REST_SEARCH_MESSAGES",e.MSYNC_SYNCOFFLINEMESSAGE="MSYNC_SYNCOFFLINEMESSAGE"}(f||(f={})),function(e){e.GET_DNS="REST_DNSLIST",e.LOGIN_BY_AGORA_TOKEN="LOGIN_BY_AGORA_TOKEN",e.LOGIN_BY_PWD="LOGIN_BY_PWD",e.RESISTER="REGISTER",e.REST_INIT_UPLOAD_TASK_IN_PARTS="REST_INIT_UPLOAD_TASK_IN_PARTS",e.REST_UPLOAD_PART="REST_UPLOAD_PART",e.REST_COMPLETE_UPLOAD_PART="REST_COMPLETE_UPLOAD_PART",e.REST_ABORT_UPLOAD_PART="REST_ABORT_UPLOAD_PART",e.CONNECT_WEBSOCKET="CONNECT_WEBSOCKET"}(m||(m={})),function(e){e[e["5G"]=7]="5G",e[e["4G"]=7]="4G",e[e["3G"]=7]="3G",e[e["2G"]=7]="2G",e[e["SLOW-2G"]=7]="SLOW-2G",e[e.WIFI=2]="WIFI",e[e.LAN=1]="LAN",e[e.DISCONNECTED=0]="DISCONNECTED",e[e.NONE=0]="NONE",e[e.UNKNOWN=-1]="UNKNOWN",e[e["WEBIM UNABLE TO GET"]=-2]="WEBIM UNABLE TO GET"}(v||(v={})),function(e){e[e.success=200]="success",e[e.failed=500]="failed",e[e.disconnect=-1]="disconnect",e[e.closed=401]="closed",e[e.notFound=404]="notFound",e[e.reachLimit=429]="reachLimit"}(g||(g={})),function(e){e[e.web=0]="web",e[e.native=1]="native"}(y||(y={})),function(e){e[e.singleChat=0]="singleChat",e[e.groupChat=1]="groupChat",e[e.chatRoom=2]="chatRoom"}(E||(E={}));var I=new Map,O=new Map,R=1e3,S=9675,b=-1;function C(){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()}__webpack_require__(8598);var N="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent);function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}var M,w=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},U=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},L=function(){},P={};!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"}(M||(M={}));var x=function(){function e(e,t,r){this.name=e||"defaultLogger",this.currentLevel=0,this.useCookiePersist=!1,this.storageLogLevelKey="loglevel",this.levels=M,this.consoleLogVisibility=!0,this.logMethods=["trace","debug","info","warn","error"],this.methodFactory=r||this.defaultMethodFactory,this.report=!1;var n=this._getPersistedLevel();null==n&&(n=null===t?"WARN":t),this.logs=[],this.reportLogs=[],this.reportInterval=3e5,this.timer=null,this.config={useCache:!1,maxCache:3145728,color:"",background:""},this.logBytes=0,this.setLevel(n,!1,"")}return e.prototype.reportLog=function(){var e,t,r;return w(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,l;return U(this,(function(d){switch(d.label){case 0:if(0===(null===(e=this.reportLogs)||void 0===e?void 0:e.length))return[2];for(n=2097152,o=this.reportLogs.join("\n")+"\n",i=o.length,a=[];i>n;)a.push(o.substring(0,n)),i-=n,o=o.substring(n);a.push(o),s=0,c=a,d.label=1;case 1:if(!(s<c.length))return[3,8];if(u=c[s],this.reportLogs=[],!(null===(r=null===(t=this.connection)||void 0===t?void 0:t.context)||void 0===r?void 0:r.accessToken))return[2];d.label=2;case 2:return d.trys.push([2,4,,5]),[4,this.reportData(u)];case 3:return"ok"!==(null==(l=d.sent())?void 0:l.status)&&this.reportLogs.unshift(u),[3,5];case 4:return d.sent(),this.reportLogs.unshift(u),[3,5];case 5:return[4,ye.delay(3e3)];case 6:d.sent(),d.label=7;case 7:return s++,[3,1];case 8:return[2]}}))}))},e.prototype.reportData=function(e){var t,r=this;if(this.connection){var n=this.connection.context||{},o=n.orgName,i=n.appName,a=n.accessToken,s=n.userId;if(o&&i){var c={url:"".concat(null===(t=this.connection)||void 0===t?void 0:t.apiUrl,"/").concat(o,"/").concat(i,"/sdk/users/").concat(s,"/client/logs"),type:"POST",data:JSON.stringify({resource:this.connection.clientResource||"random_".concat(Date.now()),logContent:e}),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return oe.call(this.connection,c).then((function(e){return r.log("report log success",e),e})).catch((function(e){r.error("report log error",e)}))}}else this.error("report log error","connection is null")},e.prototype._regularlyReportLogs=function(){var e,t=this;this.timer&&clearInterval(this.timer),(null!==(e=this.reportInterval)&&void 0!==e?e:0)<6e4&&(this.reportInterval=6e4),this.timer=setInterval((function(){t.reportLog()}),this.reportInterval||3e5)},e.prototype._stopReportLogs=function(){return w(this,void 0,void 0,(function(){return U(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.reportLog()];case 1:return e.sent(),[3,3];case 2:return e.sent(),this.error("report log error when stopping upload"),[3,3];case 3:return this.reportLogs=[],clearInterval(this.timer),[2]}}))}))},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=M[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<M.SILENT)throw Error("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),n=document.createElement("a");n.style.display="none",n.href=r,n.setAttribute("download","sdklog"),document.body.appendChild(n),n.click()}},e.prototype.setConsoleLogVisibility=function(e){this.consoleLogVisibility=e},e.prototype._bindMethod=function(e,t,r){var n=this,o=e[t],i=this.getTime();if(r)return this._cacheLog;if("function"==typeof o.bind)return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=n.getTime();n.consoleLogVisibility&&o.call.apply(o,function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([e,"".concat(a," IM SDK [").concat("log"===t?"debug":t,"]: ")],r,!1)),n.onLog&&n.onLog({time:a,level:"log"===t?"debug":t,logs:r}),n._cacheReportLogs.apply(n,r)};try{return Function.prototype.bind.call(o,e,"".concat(i," IM SDK [").concat("log"===t?"debug":t,"]: "))}catch(t){return function(){return Function.prototype.apply.apply(o,[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()+": ",n="";e.forEach((function(e){"object"===A(e)?n+=JSON.stringify(e)+" ":n+=e+" "})),this._cacheLogCall(r+n),this._cacheReportLogs.apply(this,e)},e.prototype._cacheLogCall=function(e){var t=e.length,r=this.logBytes+t,n=this.config.maxCache;if(!(t>=n)){if(r<n)this.logBytes+=t;else for(var o=r-n,i=0;i<o;){var a=this.logs.shift();void 0!==a&&(i+=a.length)}this.logs.push(e)}},e.prototype._cacheReportLogs=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.report){var r=(new Date).toLocaleString()+": ",n="";e.forEach((function(e){"object"===A(e)?n+=JSON.stringify(e)+" ":n+=e+" "})),this.reportLogs.push(r+n)}},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";if("undefined"!=typeof window){if(window.localStorage)try{window.localStorage[this.storageLogLevelKey]=t}catch(e){console.log(e)}this.useCookiePersist&&(window.document.cookie=encodeURIComponent(this.storageLogLevelKey)+"="+t+";")}},e.prototype.replaceLoggingMethods=function(e,t){for(var r=this,n=0;n<this.logMethods.length;n++){var o=this.logMethods[n];this[o]=n<e?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.report&&r._cacheReportLogs.apply(r,e)}: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&&N?C:void 0!==console[e]?this._bindMethod(console,e,this.config.useCache):void 0!==console.log?this._bindMethod(console,"log",this.config.useCache):L)},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}(),k=new x;k.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");return this};var D="undefined"!=typeof window?window.log:void 0;k.noConflict=function(){return"undefined"!=typeof window&&window.log===k&&(window.log=D),k},k.getLoggers=function(){return P},k.initReport=function(e){var t=e.report,r=e.reportInterval,n=e.connection;k.report=t,k.reportInterval=r,k.connection=n,t&&k._regularlyReportLogs()};var B=k,j=5242880,G=5242880,H={size:0},F={singleChat:"CHAT",groupChat:"GROUP",chatRoom:"ROOM"},q=(__webpack_require__(8980),__webpack_require__(4554),15e3),W=3e5,z=3e5,K=[s.MAX_LIMIT,s.WEBIM_TOKEN_EXPIRED,s.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,s.USER_NOT_FOUND,s.WEBIM_CONNCTION_AUTH_ERROR,s.REQUEST_PARAMETER_ERROR,s.WEBIM_CONNCTION_AUTH_ERROR,s.WEBIM_SERVER_SERVING_DISABLED,s.USER_LOGIN_TOO_MANY_DEVICES,s.USER_DEVICE_CHANGED],V=function(){return V=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},V.apply(this,arguments)};function J(){var e=this.context,t=e.orgName,r=e.appName,n=e.accessToken,o={url:"".concat(this.apiUrl,"/").concat(t,"/").concat(r,"/sdk/chatfiles/part-upload"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+n}};return B.debug("Call multipartInit"),oe.call(this,o,f.SDK_INTERNAL).then((function(e){var t=e.entities[0];return{data:{fileMaxSize:t.file_upper_limit,partMinSize:t.part_lower_limit,uuid:t.uuid},extraInfo:e.extraInfo,type:e.type}}))}function Y(e){var t=this;return new Promise((function(r,n){var o,i,a=(new Date).getTime(),c=t.context,u=c.orgName,l=c.appName,d=c.accessToken,p=e.uuid,h=e.partNumber,f=e.part,m=e.onProgress,v="".concat(t.apiUrl,"/").concat(u,"/").concat(l,"/sdk/chatfiles/part-upload/").concat(p),g=new XMLHttpRequest;B.debug("Call multipartUpload"),g.upload&&(null===(i=(o=g.upload).addEventListener)||void 0===i||i.call(o,"progress",(function(e){null==m||m(e)}),!1)),g.addEventListener("abort",(function(){n({type:s.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:g,extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"Request Abort",url:v}})}),!1),g.addEventListener("error",(function(){n({type:s.WEBIM_UPLOADFILE_ERROR,data:g,extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"request error",url:v}})}),!1),g.addEventListener("load",(function(){try{var e=JSON.parse(g.responseText);if(200!==g.status)return n({type:s.WEBIM_UPLOADFILE_ERROR,data:e,extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"part upload failed",url:v}}),!1;try{r(V(V({},e),{extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,url:v}}))}catch(e){n({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e,extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"part upload failed",url:v}})}}catch(e){n({type:s.WEBIM_UPLOADFILE_ERROR,data:g.responseText,extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"part upload failed",url:v}})}}),!1),g.addEventListener("timeout",(function(){n({type:s.REQUEST_TIMEOUT,message:"request timeout",extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"request timeout",url:v}})}),!1);var y=new FormData;y.append("part_file",f),y.append("part_number",h),g.timeout=W,g.open("PUT",v),g.setRequestHeader("restrict-access","true"),g.setRequestHeader("Accept","*/*"),g.setRequestHeader("Authorization","Bearer "+d),g.send(y)}))}function X(e){var t=e.uuid,r=e.thumbnailHeight,n=e.thumbnailWidth,o=e.conversationInfo,i=e.uploadImageType,a=o.conversationId,s=o.conversationType,c=F[s],u=this.context,l=u.orgName,d=u.appName,p=u.accessToken,h="".concat(this.apiUrl,"/").concat(l,"/").concat(d,"/sdk/chatfiles/part-upload/").concat(t,"?restrict-access=true&chat-type=").concat(c,"&chat-target=").concat(a);n&&(h+="&thumbnail-width=".concat(n)),r&&(h+="&thumbnail-height=".concat(r)),i&&(h+="&imagetype=".concat(i));var m={url:h,dataType:"json",type:"POST",headers:{Authorization:"Bearer "+p}};return B.debug("Call multipartComplete"),oe.call(this,m,f.SDK_INTERNAL)}function Q(e){var t=e.uuid,r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/sdk/chatfiles/part-upload/").concat(t),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i}};return B.debug("Call multipartAbort"),oe.call(this,a,f.SDK_INTERNAL)}var $=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},Z=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ee=function(){function e(e,t){var r=this;this.handleUploadProgress=function(e,t){var n,o;if(e.total){r.progressArr[t]=e.loaded;var i=r.progressArr.reduce((function(e,t){return e+t}),0);null===(o=(n=r.options).onFileUploadProgress)||void 0===o||o.call(n,{isTrusted:e.isTrusted,type:e.type,loaded:i>r.file.size?r.file.size:i,total:r.file.size,lengthComputable:e.lengthComputable})}},this.uuid="",this.pool=[],this.progressArr=[],this.connection=e,this.options=t,this.partSize=j,this.file=t.file,this.init(),this.rpt=this.connection.dataReport.geOperateFun({operationName:f.REST_UPLOAD_FILE_IN_PARTS})}return e.prototype.init=function(){var e,t,r,n;return $(this,void 0,void 0,(function(){var o,i,a,c,u,l,d,p,h,f,v,g,y,E,_;return Z(this,(function(T){switch(T.label){case 0:return T.trys.push([0,4,,6]),[4,J.call(this.connection)];case 1:return o=T.sent(),i=o.data||{},a=i.fileMaxSize,c=void 0===a?0:a,u=i.partMinSize,l=void 0===u?j:u,d=i.uuid,p=void 0===d?"":d,h=o.extraInfo,g=h.elapse,y=h.httpCode,_=h.url,this.partSize=l,this.uuid=p,H.size=l,B.debug("multipartInit success","uuid: ".concat(p),"fileMaxSize: ".concat(c),"partMinSize: ".concat(l)),this.file.size>c?[4,this.multipartAbort()]:[3,3];case 2:return T.sent(),null===(t=(e=this.options).onFileUploadError)||void 0===t||t.call(e,{code:s.WEBIM_UPLOADFILE_ERROR,message:"The file size exceeds the maximum limit"}),[2];case 3:return this.rpt({data:{requestUrl:_,requestName:m.REST_INIT_UPLOAD_TASK_IN_PARTS,requestElapse:g,requestMethod:"POST",isSuccess:1,code:y}}),this.upload(),[3,6];case 4:return f=T.sent(),v=(null==f?void 0:f.extraInfo)||{},g=v.elapse,y=v.httpCode,E=v.errDesc,_=v.url,this.rpt({data:{requestUrl:_,requestName:m.REST_INIT_UPLOAD_TASK_IN_PARTS,requestElapse:g,requestMethod:"POST",isSuccess:0,codeDesc:E,code:y}}),[4,this.multipartAbort()];case 5:return T.sent(),null===(n=null===(r=this.options)||void 0===r?void 0:r.onInitFail)||void 0===n||n.call(r),[3,6];case 6:return[2]}}))}))},e.prototype.upload=function(){var e,t,r;return $(this,void 0,void 0,(function(){var n,o,i,a,s,c,u=this;return Z(this,(function(l){switch(l.label){case 0:(new FileReader).readAsArrayBuffer(this.file),n=this.file.size,o=Math.ceil(n/this.partSize),l.label=1;case 1:l.trys.push([1,7,,9]),i=function(t){var r,o,i,s;return Z(this,(function(c){switch(c.label){case 0:return r=t*a.partSize,o=Math.min(n,r+a.partSize),i=null===(e=a.file)||void 0===e?void 0:e.slice(r,o),(s=Y.call(a.connection,{uuid:a.uuid,partNumber:"".concat(t+1),part:i,onProgress:function(e){u.handleUploadProgress(e,t)}})).then((function(e){var t=(null==e?void 0:e.extraInfo)||{},r=t.elapse,n=t.httpCode,o=t.url;u.rpt({data:{requestUrl:o,requestName:m.REST_UPLOAD_PART,requestElapse:r,isSuccess:1,requestMethod:"PUT",code:n}}),u.handleTask(s)})),s.catch((function(e){var t=(null==e?void 0:e.extraInfo)||{},r=t.elapse,n=t.httpCode,o=t.url,i=t.errDesc;u.rpt({data:{requestUrl:o,requestName:m.REST_UPLOAD_PART,requestElapse:r,isSuccess:0,requestMethod:"PUT",code:n,codeDesc:i}}),delete e.extraInfo})),a.pool.push(s),4!==a.pool.length?[3,2]:[4,Promise.race(a.pool)];case 1:c.sent(),c.label=2;case 2:return[2]}}))},a=this,s=0,l.label=2;case 2:return s<o?[5,i(s)]:[3,5];case 3:l.sent(),l.label=4;case 4:return s++,[3,2];case 5:return[4,Promise.all(this.pool)];case 6:return l.sent(),this.multipartComplete(),[3,9];case 7:return c=l.sent(),[4,this.multipartAbort()];case 8:return l.sent(),this.rpt({data:{isLastApi:1,isSuccess:0}}),null===(r=(t=this.options).onFileUploadError)||void 0===r||r.call(t,c),[3,9];case 9:return[2]}}))}))},e.prototype.multipartComplete=function(){var e,t,r,n;return $(this,void 0,void 0,(function(){var o,i,a,s,c,u,l,d,p,h,f;return Z(this,(function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),o=this.options.thumbnailInfo||{},i=o.width,a=o.height,[4,X.call(this.connection,{uuid:this.uuid,thumbnailHeight:a,thumbnailWidth:i,conversationInfo:this.options.conversationInfo,uploadImageType:this.options.uploadImageType})];case 1:return s=v.sent(),c=(null==s?void 0:s.extraInfo)||{},d=c.elapse,p=c.httpCode,f=c.url,this.rpt({data:{requestUrl:f,requestName:m.REST_COMPLETE_UPLOAD_PART,requestElapse:d,requestMethod:"POST",isSuccess:1,code:p}}),this.rpt({data:{isLastApi:1,isSuccess:1}}),null===(t=(e=this.options).onFileUploadComplete)||void 0===t||t.call(e,s),[3,3];case 2:return u=v.sent(),l=(null==u?void 0:u.extraInfo)||{},d=l.elapse,p=l.httpCode,h=l.errDesc,f=l.url,this.rpt({data:{requestUrl:f,requestName:m.REST_COMPLETE_UPLOAD_PART,requestElapse:d,requestMethod:"POST",isSuccess:0,codeDesc:h,code:p}}),this.rpt({data:{isLastApi:1,isSuccess:0}}),null===(n=(r=this.options).onFileUploadError)||void 0===n||n.call(r,u),[3,3];case 3:return[2]}}))}))},e.prototype.multipartAbort=function(){return $(this,void 0,void 0,(function(){var e,t,r,n,o,i,a,s;return Z(this,(function(c){switch(c.label){case 0:if(!this.uuid)return[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Q.call(this.connection,{uuid:this.uuid})];case 2:return e=c.sent(),t=(null==e?void 0:e.extraInfo)||{},o=t.elapse,i=t.httpCode,s=t.url,this.rpt({data:{requestUrl:s,requestName:m.REST_ABORT_UPLOAD_PART,requestElapse:o,requestMethod:"DELETE",isSuccess:1,code:i}}),[3,4];case 3:return r=c.sent(),n=(null==r?void 0:r.extraInfo)||{},o=n.elapse,i=n.httpCode,a=n.errDesc,s=n.url,this.rpt({data:{requestUrl:s,requestName:m.REST_ABORT_UPLOAD_PART,requestElapse:o,requestMethod:"DELETE",isSuccess:0,codeDesc:a,code:i}}),[3,4];case 4:return[2]}}))}))},e.prototype.handleTask=function(e){var t=this.pool.findIndex((function(t){return t===e}));this.pool.splice(t,1)},e}(),te=function(e){var t,r,n=this,o=(new Date).getTime(),i=e.apiUrl,a=e.orgName,c=e.appName,u=e.operateName,l=e.accessToken,d=e.conversationInfo,p=d.conversationType,h=d.conversationId,m=F[p],v=e.uploadUrl||"".concat(i,"/").concat(a,"/").concat(c,"/chatfiles?chat-type=").concat(m,"&chat-target=").concat(h).concat(e._uploadImageType?"&imagetype=".concat(e._uploadImageType):""),g=function(t){var r=(new Date).getTime()-o;n.dataReport&&u&&[f.UPLOAD_MSG_ATTACH,f.UPLOAD_CHATROOM_FILE,f.UPLOAD_GROUP_FILE].includes(u)&&n.dataReport.geOperateFun({operationName:u})({isEndApi:!0,data:{isSuccess:0,requestMethod:"POST",requestName:u,requestElapse:r,requestUrl:v,code:(null==E?void 0:E.status)||0,codeDesc:"upload file error"}}),e.onFileUploadError&&e.onFileUploadError(t)};function y(e){g({type:s.WEBIM_UPLOADFILE_ERROR,data:E})}var E=new XMLHttpRequest;E.upload&&(null===(r=(t=E.upload).addEventListener)||void 0===r||r.call(t,"progress",e.onFileUploadProgress||ne,!1)),E.addEventListener("abort",e.onFileUploadCanceled||ne,!1),E.addEventListener("error",y,!1),E.addEventListener("load",(function(t){try{var r=JSON.parse(E.responseText);if(400===E.status)return g({type:s.WEBIM_UPLOADFILE_ERROR,data:r}),!1;try{!function(t){var r=(new Date).getTime()-o;n.dataReport&&u&&[f.UPLOAD_MSG_ATTACH,f.UPLOAD_CHATROOM_FILE,f.UPLOAD_GROUP_FILE].includes(u)&&n.dataReport.geOperateFun({operationName:u})({isEndApi:!0,data:{isSuccess:(null==t?void 0:t.error)?0:1,requestMethod:"POST",requestName:u,requestElapse:r,requestUrl:v,code:E.status,codeDesc:(null==t?void 0:t.error_description)||""}}),e.onFileUploadComplete&&e.onFileUploadComplete(t)}(r)}catch(t){g({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){g({type:s.WEBIM_UPLOADFILE_ERROR,data:E.responseText})}}),!1),E.addEventListener("timeout",y,!1),E.timeout=W,E.open("POST",v),E.setRequestHeader("restrict-access","true"),E.setRequestHeader("Accept","*/*"),E.setRequestHeader("Authorization","Bearer "+l);var _=new FormData;_.append("file",e.file.data),e.thumbnailWidth&&_.append("thumbnail-width",e.thumbnailWidth+""),e.thumbnailHeight&&_.append("thumbnail-height",e.thumbnailHeight+""),E.send(_)},re=function(){return re=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},re.apply(this,arguments)},ne=function(){};function oe(e,t){var r,n=this;return de().platform===ce.WEB?new Promise((function(t,n){var o=e.dataType||"text",i=e.success||ne,a=e.error||ne,c=new XMLHttpRequest;c.timeout=q;var u=!1;c.ontimeout=function(){B.warn("request timeout"),u=!0;var e={type:s.REQUEST_TIMEOUT,message:"Request Timeout",errorType:"timeout_error",xhr:c};a(e),n(e)},c.onerror=function(){n({type:s.REQUEST_UNKNOWN,message:"Request Unknow Error",errorType:"onerror",xhr:c})},c.onabort=function(){n({type:s.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:c})},c.onreadystatechange=function(){if(4===c.readyState){var e=(new Date).getTime()-r,l=c.status||0,d={elapse:e,httpCode:l};if(200===l){ye.ajaxUnconventionalErrorTimes=0;try{switch(o){case"text":return i(c.responseText),void t(c.responseText);case"json":var p=JSON.parse(c.responseText);return p.extraInfo=d,i(p),void t(p);case"xml":return c.responseXML&&c.responseXML.documentElement?(i(c.responseXML.documentElement),void t(c.responseXML.documentElement)):(a({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}),void n({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}));default:a({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"Invalid dataType"}),n({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"Invalid dataType"})}return t(c.response||c.responseText),void i(c.response||c.responseText,c)}catch(e){n(e)}return}0===l?setTimeout((function(){B.error("request timeout:",u),!u&&T(c,n,a,e)}),0):([400,401,403,404,429,500,503].includes(l)||(B.warn("rest api request fail status:",l),ye.ajaxUnconventionalErrorTimes++),T(c,n,a,e))}0===c.readyState&&(a({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"Request not initialized"}),n({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"Request not initialized"}))},e.responseType&&c.responseType&&(c.responseType=e.responseType),e.mimeType&&c.overrideMimeType(e.mimeType);var l=e.type||"POST",d=e.data||null,p="";if("get"===l.toLowerCase()&&d){for(var h in d)d.hasOwnProperty(h)&&(p+=h+"="+d[h]+"&");p=p?p.slice(0,-1):p,e.url+=(e.url.indexOf("?")>0?"&":"?")+(p?p+"&":p)+"_v="+(new Date).getTime(),d=null,p=""}r=(new Date).getTime(),c.open(l,e.url);var f=e.headers||{};for(var m in f["Content-Type"]||(f["Content-Type"]="application/json"),f)f.hasOwnProperty(m)&&c.setRequestHeader(m,f[m]);c.send(d)})).then((function(r){var o,i;if(n.dataReport&&t&&t!==f.SDK_INTERNAL){var a=n.dataReport.geOperateFun({operationName:t}),c=re({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},me(r.extraInfo));t===f.REST_FETCH_CONVERSATIONS?c.resultCount=null===(o=r.data.channel_infos)||void 0===o?void 0:o.length:t===f.REST_FETCHHISTORYMESSAGE&&(c.resultCount=null===(i=r.data.msgs)||void 0===i?void 0:i.length),a({isEndApi:!0,data:c})}return t===f.SDK_INTERNAL&&(r.extraInfo.url=e.url),t!==f.SDK_INTERNAL&&delete r.extraInfo,"Object"===ie(r)?re(re({},r),{type:s.REQUEST_SUCCESS}):{data:r,type:s.REQUEST_SUCCESS}})).catch((function(o){var i,a;if(n.dataReport&&t&&t!==f.SDK_INTERNAL&&n.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:re({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},me(o.extraInfo))}),t===f.SDK_INTERNAL)if(o.extraInfo)o.extraInfo.url=e.url;else{var s={elapse:(new Date).getTime()-r,httpCode:null!==(a=null===(i=o.xhr)||void 0===i?void 0:i.status)&&void 0!==a?a:0,url:e.url};o.extraInfo=s}throw t!==f.SDK_INTERNAL&&delete o.extraInfo,o})):ae.call(this,e,t)}function ie(e){return Object.prototype.toString.call(e).slice(8,-1)}function ae(e,t){var r=this;return new Promise((function(r,n){var o=e.success||ne,i=e.error||ne,a=e.type||"POST",c=e.data||null,u="",l=(new Date).getTime(),d=ye.getEnvInfo();if("get"===a.toLowerCase()&&c){for(var p in c)c.hasOwnProperty(p)&&(u+=p+"="+c[p]+"&");u=u?u.slice(0,-1):u,e.url+=(e.url.indexOf("?")>0?"&":"?")+(u?u+"&":u)+"_v="+(new Date).getTime(),c=null,u=""}var h={url:e.url,data:e.data,method:a,headers:{},timeout:q,success:function(e){var a,s,c,u,d,p={elapse:(new Date).getTime()-l,httpCode:Number((null===(a=e.statusCode)||void 0===a?void 0:a.toString())||(null===(s=e.status)||void 0===s?void 0:s.toString())),errDesc:(null===(c=null==e?void 0:e.data)||void 0===c?void 0:c.error_description)||""};if("200"===(null===(u=e.statusCode)||void 0===u?void 0:u.toString())||"200"===(null===(d=e.status)||void 0===d?void 0:d.toString())){e.data.extraInfo=p;var h=e.data;o(h),r(h)}else e.extraInfo=p,i(h=e),n(h),B.warn(t,"reject reason: ",h)},complete:function(){},fail:function(e){var r={elapse:(new Date).getTime()-l,httpCode:b,errDesc:"request:fail"};if(e.extraInfo=r,e.data={error:"request:fail",error_description:"request:fail"},"request:fail timeout"===e.errMsg)return n({type:s.REQUEST_TIMEOUT,message:"Request Timeout",extraInfo:r}),void i({type:s.REQUEST_TIMEOUT,message:"Request Timeout",extraInfo:r});i(e),n(e),B.error(t,"fail reason:",e)}};if("zfb"===d.platform||"dd"===d.platform?h.headers=e.headers:h.header=e.headers,"dd"===d.platform)return dd.httpRequest(h);d.global.request(h)})).then((function(n){var o,i;if(r.dataReport&&t&&t!==f.SDK_INTERNAL){var a=r.dataReport.geOperateFun({operationName:t}),c=re({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},me(n.extraInfo));t===f.REST_FETCH_CONVERSATIONS?c.resultCount=null===(o=n.data.channel_infos)||void 0===o?void 0:o.length:t===f.REST_FETCHHISTORYMESSAGE&&(c.resultCount=null===(i=n.data.msgs)||void 0===i?void 0:i.length),a({isEndApi:!0,data:c})}return t!==f.SDK_INTERNAL&&delete n.extraInfo,"Object"===ie(n)?re(re({},n),{type:s.REQUEST_SUCCESS}):{data:n,type:s.REQUEST_SUCCESS}})).catch((function(n){r.dataReport&&t&&t!==f.SDK_INTERNAL&&r.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:re({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},me(n.extraInfo))}),t!==f.SDK_INTERNAL&&delete n.extraInfo;var o=JSON.stringify(n.data||{}),i=re(re({},n),{status:n.statusCode||n.status||0,response:o,responseText:o});T(i,(function(e){throw re(re({},n),{message:e.message,type:e.type})}),ne,0)}))}function se(e,t){var r;return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(!e)return r;r=t?e.apply(t,n):e.apply(void 0,n),e=null}}var ce,ue=se((function(e,t){var r=de();if(r.platform!==ce.WEB){var n=r.global,o=function(r){r.isConnected?e():t()};n.offNetworkStatusChange&&n.offNetworkStatusChange(o),n.onNetworkStatusChange&&n.onNetworkStatusChange(o)}else"undefined"!=typeof addEventListener&&(window.addEventListener("online",e),window.addEventListener("offline",t))})),le=se((function(e,t){var r,n,o=de();if(o.platform===ce.WEB)"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){document.hidden?null==t||t():null==e||e()}),!1);else{var i=o.global;i.onAppShow&&(null===(r=i.onAppShow)||void 0===r||r.call(i,e)),i.onAppHide&&(null===(n=i.onAppHide)||void 0===n||n.call(i,t))}}));function de(){return"undefined"!=typeof swan&&pe(swan)?{platform:ce.BAIDU,global:swan}:"undefined"!=typeof tt&&pe(tt)?{platform:ce.TT,global:tt}:"undefined"!=typeof dd&&pe(dd)?{platform:ce.DD,global:dd}:"undefined"!=typeof my&&pe(my)?{platform:ce.ZFB,global:my}:"undefined"!=typeof wx&&pe(wx)||"undefined"!=typeof wx&&"function"==typeof wx.createCanvas?{platform:ce.WX,global:wx}:"undefined"!=typeof qq&&pe(qq)?{platform:ce.QQ,global:qq}:"undefined"!=typeof uni&&pe(uni)?{platform:ce.UNI,global:uni}:"undefined"!=typeof window&&window.WebSocket?{platform:ce.WEB,global:window}:{platform:ce.NODE,global:__webpack_require__.g||{}}}function pe(e){for(var t=["canIUse","getSystemInfo"],r=0,n=t.length;r<n;r++)if(!e[t[r]])return!1;return!0}function he(e,t){var r,n,o,i,a=this,c=e.accessToken,u=e.appKey,l=null===(n=null===(r=null==e?void 0:e.file)||void 0===r?void 0:r.data)||void 0===n?void 0:n.size,d=[],p="",h="";if(c)if(u&&(d=u.split("#"),p=d[0],h=d[1]),p||h){var f=e._filePath;if(f&&"string"==typeof f){var m=de(),v=null===(o=m.global)||void 0===o?void 0:o.uploadFile;if(m.platform!==ce.WEB&&"function"==typeof v){var g=F[e.chatType]||"CHAT",y="".concat(e.apiUrl,"/").concat(p,"/").concat(h,"/chatfiles?chat-type=").concat(g,"&chat-target=").concat(e.to);return e._uploadImageType&&(y+="&imagetype=".concat(e._uploadImageType)),void v({url:y,filePath:f,name:"file",header:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+c,"restrict-access":"true"},success:function(t){if(200===t.statusCode)try{var r="string"==typeof t.data?JSON.parse(t.data):t.data;e.onFileUploadComplete&&e.onFileUploadComplete(r)}catch(r){e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,data:re(re({},t),{rawData:t.data,error:r})})}else e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,data:t})},fail:function(t){e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,data:t})}})}e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,message:"Current platform does not support path-based upload"})}else if(l<=0)e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else if(e.uploadUrl)te.call(this,re(re({},e),{orgName:p,appName:h,operateName:t,conversationInfo:{conversationId:e.to,conversationType:e.chatType}}));else{var E=H.size||G;this.uploadPartEnable&&l>1.5*E?new ee(this,{file:null===(i=null==e?void 0:e.file)||void 0===i?void 0:i.data,onFileUploadProgress:e.onFileUploadProgress||ne,onFileUploadComplete:e.onFileUploadComplete||ne,onFileUploadError:e.onFileUploadError||ne,onFileUploadCanceled:e.onFileUploadCanceled||ne,conversationInfo:{conversationId:e.to,conversationType:e.chatType},onInitFail:function(){te.call(a,re(re({},e),{orgName:p,appName:h,operateName:t,conversationInfo:{conversationId:e.to,conversationType:e.chatType}}))},thumbnailInfo:{width:e.thumbnailWidth,height:e.thumbnailHeight},uploadImageType:e._uploadImageType}):te.call(this,re(re({},e),{orgName:p,appName:h,operateName:t,conversationInfo:{conversationId:e.to,conversationType:e.chatType}}))}}else e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,message:this._initWithAppId?"appId illegal":"AppKey illegal"});else e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_NO_LOGIN,message:"AccessToken cannot be empty"})}function fe(e,t){var r;e.onFileDownloadComplete=e.onFileDownloadComplete||ne,e.onFileDownloadError=e.onFileDownloadError||ne;var n=(new Date).getTime(),o=new XMLHttpRequest,i=this;o.addEventListener("load",(function(){var r,a=(new Date).getTime()-n;i.dataReport&&t&&t===f.DOWN_GROUP_FILE&&i.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:200===o.status?1:0,requestMethod:e.method||"GET",requestName:t,requestElapse:a,requestUrl:null==e?void 0:e.url,code:o.status,codeDesc:200===o.status?"":"download file error"}}),200===o.status?e.onFileDownloadComplete&&e.onFileDownloadComplete(o.response):403===o.status||404===o.status?((r=new FileReader).addEventListener("loadend",(function(t){var r;try{var n=JSON.parse(null===(r=t.target)||void 0===r?void 0:r.result);B.error("download file failed","status:".concat(o.status),n),403===o.status?"chatfile no permission"===n.error_description?e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION,id:e.id,xhr:o}):e.onFileDownloadError&&e.onFileDownloadError({type:s.PERMISSION_DENIED,id:e.id,xhr:o}):404===o.status&&("file_expired"===n.error?e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR_EXPIRED,id:e.id,xhr:o}):e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o}))}catch(t){B.error("Error parsing download error response:",t),e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o})}})),r.readAsText(o.response)):500===o.status?(B.error("download file failed","status:".concat(o.status),"type:".concat(s.SERVER_UNKNOWN_ERROR)),e.onFileDownloadError&&e.onFileDownloadError({type:s.SERVER_UNKNOWN_ERROR,id:e.id,xhr:o})):(B.error("download file failed","status:".concat(o.status),"type:".concat(s.WEBIM_DOWNLOADFILE_ERROR)),e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o}))}),!1),o.addEventListener("error",(function(r){var a=(new Date).getTime()-n;i.dataReport&&t&&t===f.DOWN_GROUP_FILE&&i.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:0,requestMethod:e.method||"GET",requestName:t,requestElapse:a,requestUrl:null==e?void 0:e.url,code:(null==o?void 0:o.status)||0,codeDesc:"download file error"}}),e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o})}),!1);var a=e.method||"GET",c=e.responseType||"blob",u=e.mimeType||"text/plain; charset=x-user-defined";o.open(a,e.url),"undefined"!=typeof Blob?o.responseType=c:o.overrideMimeType(u);var l={"X-Requested-With":"XMLHttpRequest","share-secret":e.secret,Authorization:"Bearer "+(null===(r=null==this?void 0:this.context)||void 0===r?void 0:r.accessToken)},d=e.headers||{};for(var p in d)l[p]=d[p];for(var p in l)l[p]&&o.setRequestHeader(p,l[p]);o.send(null)}function me(e){void 0===e&&(e={});var t=e.elapse,r=void 0===t?0:t,n=e.httpCode,o=void 0===n?0:n,i=e.errDesc;return{requestElapse:r,code:o,codeDesc:void 0===i?"":i}}!function(e){e.WEB="web",e.WX="wx",e.QQ="qq",e.ZFB="zfb",e.DD="dd",e.TT="tt",e.BAIDU="baidu",e.QUICK_APP="quick_app",e.UNI="uni",e.NODE="node"}(ce||(ce={}));var ve,ge="localDeviceInfo",ye={autoIncrement:0,ajaxUnconventionalErrorTimes:0,isUseHttps:function(e){var t;return"boolean"==typeof e?e:!("undefined"!=typeof window)||"https:"===(null===(t=window.location)||void 0===t?void 0:t.protocol)},getRetryDelay:function(e){return e<=5?Number((Math.random()+1).toFixed(2)):e>5&&e<20?Math.floor(4*Math.random())+3:Math.floor(6*Math.random())+5},ajax:oe,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:{}},r="string"==typeof e?document.getElementById(e):e;if(window.URL.createObjectURL){if(!r.files)throw Error("this is not HTMLInputElement");var n=r.files;if(n.length>0){var o=n.item(0);t.data=o,t.url=window.URL.createObjectURL(o),t.filename=(null==o?void 0:o.name)||""}}else{if("string"!=typeof e)throw Error("in IE fileInputId must be string");o=document.getElementById(e).value,t.url=o;var i=o.lastIndexOf("/"),a=o.lastIndexOf("\\"),s=Math.max(i,a);t.filename=s<0?o:o.substring(s+1)}var c=t.filename.lastIndexOf(".");return-1!==c&&(t.filetype=t.filename.substring(c+1).toLowerCase()),t},uploadFile:he,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=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var o=0,i=t?e[o].apply(this,r):r[0];++o<t;)i=e[o].call(this,i);return i}},listenNetwork:ue,listenBrowserVisibility:le,getEnvInfo:de,wxRequest:ae,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:fe,parseNotify:function(e){for(var t="",r=0;r<e.length;r++)t+="%"+e[r].toString(16);return JSON.parse(decodeURIComponent(t))},getExtraData:me,retryPromise:function(e,t,r){return new Promise((function(n,o){var i=function(t){e().then(n).catch((function(e){t>0?setTimeout((function(){i(t-1)}),r||1e3):o(e)}))};i(t||3)}))},formatAttachUrl:function(e){return e&&"string"==typeof e?"".concat(this.apiUrl).concat(e.slice(e.indexOf("/",9))):""},Uint8ArrayToString:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},getLocalDeviceInfo:function(){return function(e){var t,r=ye.getEnvInfo(),n=r.platform,o="";n!==ce.NODE&&n!==ce.QUICK_APP||(o="");try{n===ce.WEB?window.localStorage?o=localStorage.getItem(e)||"":B.error("localStorage is not supported"):n===ce.WX||n===ce.QQ||n===ce.TT||n===ce.BAIDU||n===ce.UNI?o=r.global.getStorageSync(e)||"":n!==ce.ZFB&&n!==ce.DD||(o=(null===(t=r.global.getStorageSync({key:e}))||void 0===t?void 0:t.data)||"")}catch(t){B.info("get local ".concat(e," failed: "),t)}return B.info("".concat(e," "),o),o}(ge)},setLocalDeviceInfo:function(e){!function(e,t){var r=ye.getEnvInfo(),n=r.platform;if(n!==ce.NODE&&n!==ce.QUICK_APP)if(n===ce.WEB)try{window.localStorage?localStorage.setItem(e,t):B.error("localStorage is not supported")}catch(t){B.error("set local ".concat(e," failed: "),t)}else r.global.setStorage({key:e,data:t,success:function(t){B.debug("set local ".concat(e," success: "),t)},fail:function(t){B.error("set local ".concat(e," failed: "),t)}})}(ge,e)},detectBrowser:function(){if("undefined"==typeof navigator)return"unknown";var e=navigator.userAgent;return/MicroMessenger/i.test(e)?"WeChat":/QQBrowser/i.test(e)?"QQ":!/Chrome/i.test(e)||/Edg/i.test(e)||/OPR/i.test(e)?!/Safari/i.test(e)||/Chrome/i.test(e)||/CriOS/i.test(e)?/Firefox/i.test(e)?"Firefox":/MSIE/i.test(e)||/Trident/i.test(e)?"IE":/Edg/i.test(e)?"Edge":"unknown":"Safari":"Chrome"},getDevicePlatform:function(e){return e.platform===ce.WX&&"undefined"!=typeof uni&&pe(uni)?ce.UNI:e.platform},delay:function(e){return new Promise((function(t){return setTimeout(t,e)}))}};!function(e){e[e.SYNC_INIT=0]="SYNC_INIT",e[e.SYNC_START=1]="SYNC_START",e[e.SYNC_FINISH=2]="SYNC_FINISH"}(ve||(ve={})),__webpack_require__(113),__webpack_require__(3418),__webpack_require__(4346),__webpack_require__(2062),__webpack_require__(5086),__webpack_require__(2637),__webpack_require__(150),__webpack_require__(8345);var Ee,_e,Te=__webpack_require__(3887),Ie=__webpack_require__.n(Te);!function(e){e[e.OFFLINE=0]="OFFLINE",e[e.ONLINE=1]="ONLINE",e[e.UNKNOWN=2]="UNKNOWN",e[e.NONE=3]="NONE"}(Ee||(Ee={})),function(e){e[e.START=0]="START",e[e.START_AND_COMPLETED=1]="START_AND_COMPLETED",e[e.IN_PROGRESS=2]="IN_PROGRESS",e[e.COMPLETED=3]="COMPLETED",e[e.ERROR=4]="ERROR"}(_e||(_e={}));var Oe=function(){return Oe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Oe.apply(this,arguments)},Re={chat:"singleChat",chatroom:"chatRoom",groupchat:"groupChat",singleChat:"singleChat",chatRoom:"chatRoom",groupChat:"groupChat"};function Se(e,t){var r,n,o,i=t||{},a=i.formatCustomExts,c=void 0===a||a,u=i.formatChatType,l=void 0!==u&&u,d=e.id,p=e.payload,h=e.timestamp,f=e.to,m=p.bodies&&p.bodies.length>0?p.bodies[0]:{},v={},g={},y=p.type?p.type:f.indexOf("@conference.easemob.com")>-1?"groupChat":"singleChat";y="chat"===y?"singleChat":y,l&&p.type&&(y=Re[p.type]);var E="";switch(m.type){case"txt":if(Object.prototype.hasOwnProperty.call(m,"subType")&&"sub_combine"===m.subType)E=rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"combine",chatType:y,to:p.to,from:p.from,ext:p.ext,time:h,title:m.title||"",summary:m.summary||"",url:E||"",secret:m.secret||"",file_length:m.file_length||0,filename:m.filename||"",compatibleText:m.msg,combineLevel:m.combineLevel||0};else if(v={id:d,type:"txt",chatType:y,msg:m.msg||"",to:p.to||"",from:p.from,time:h,ext:p.ext},Object.prototype.hasOwnProperty.call(m,"subType")&&"sub_stream"===m.subType&&p.stream){var _=0;switch(p.stream.stream_status){case"stream_start":_=_e.START;break;case"stream_start_completed":_=_e.START_AND_COMPLETED;break;case"stream_in_progress":_=_e.IN_PROGRESS;break;case"stream_completed":case"stream_full":_=_e.COMPLETED;break;default:_=0}var T=0;512===p.stream.stream_error?T=s.MESSAGE_STREAM_INTERVAL_TIMEOUT:513===p.stream.stream_error&&(T=s.MESSAGE_STREAM_TIMEOUT),v.stream={customType:p.stream.stream_type,status:_,errorType:T,text:m.msg,finishReason:p.stream.stream_finish_reason}}break;case"img":E=this.useOwnUploadFun?null==m?void 0:m.url:rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"img",chatType:y,to:p.to,from:p.from,time:h,ext:p.ext,width:(null===(r=m.size)||void 0===r?void 0:r.width)||0,height:(null===(n=m.size)||void 0===n?void 0:n.height)||0,thumb:this.useOwnUploadFun?"":"".concat(E,"&thumbnail=true"),thumb_secret:m.secret,secret:m.secret||"",url:E||"",file_length:m.file_length||0,file:{},isGif:"sub_gif"===m.subType};break;case"video":E=this.useOwnUploadFun?null==m?void 0:m.url:rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"video",chatType:y,from:p.from,to:p.to,thumb:ye.formatAttachUrl.call(this,m.thumb),thumb_secret:m.thumb_secret||"",url:E||"",secret:m.secret||"",filename:m.filename,length:m.length||0,file:{},file_length:m.file_length||0,filetype:p.ext.file_type||"",ext:p.ext,time:h};break;case"loc":v={id:d,type:"loc",chatType:y,from:p.from,to:p.to,buildingName:m.buildingName||"",addr:m.addr,lat:m.lat,lng:m.lng,ext:p.ext,time:h};break;case"audio":E=this.useOwnUploadFun?null==m?void 0:m.url:rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"audio",chatType:y,from:p.from,to:p.to,secret:m.secret||"",ext:p.ext,time:h,url:E||"",file:{},filename:m.filename,length:m.length||0,file_length:m.file_length||0,filetype:p.ext.file_type||""};break;case"file":E=this.useOwnUploadFun?null==m?void 0:m.url:rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"file",chatType:y,from:p.from,to:p.to,ext:p.ext,time:h,url:E||"",secret:m.secret||"",file:{},filename:m.filename||"",file_length:m.file_length||0,filetype:p.ext.file_type||""};break;case"cmd":v={id:d,type:"cmd",chatType:y,from:p.from,to:p.to,ext:p.ext,time:h,action:m.action||""};break;case"custom":var I=m.customExts||{};c&&m.customExts&&(I={},m.customExts.map((function(e){I=Oe(Oe({},I),e)}))),v={id:d,type:"custom",chatType:y,from:p.from,to:p.to,ext:p.ext,time:h,customEvent:m.customEvent||"",customExts:I};break;case"combine":E=rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"combine",chatType:y,msg:m.msg||"",to:p.to||"",from:p.from,time:h,ext:p.ext,title:m.title||"",summary:m.summary||"",url:E||"",compatibleText:m.text,combineLevel:m.combineLevel||0,secret:m.secret||"",filename:m.filename||"",file_length:m.file_length||0};break;default:B.error("unexpected message: ".concat(e))}if(p.msgConfig&&(g.msgConfig=p.msgConfig),null==p?void 0:p.meta){var O=p.meta;O.thread&&(g.chatThread={messageId:O.thread.msg_parent_id,parentId:O.thread.muc_parent_id,chatThreadName:O.thread.thread_name}),O.reaction&&(g.reactions=O.reaction),O.translations&&(g.translations=O.translations)}var R=null===(o=null==p?void 0:p.meta)||void 0===o?void 0:o.edit_msg;if(R){var S=R.edit_time,b=R.operator,C=R.count;v.modifiedInfo={operationTime:S,operatorId:b,operationCount:C}}return Oe(Oe({},v),g)}var be=function(e){return"".concat(e.conversationType,"-").concat(e.conversationId)},Ce=function(e){var t=e.isRecallSelfMsg,r=e.conversation,n=e.recalledMsgTime,o=r.unReadCount,i=void 0===o?0:o,a=r.unreadCountClearTimestamp;return t||(void 0===a?0:a)>n?i:i&&i>0?i-1:0},Ne=function(e){var t,r=0;if(0===e.length)return r;for(t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return r};function Ae(e){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(e)}__webpack_require__(6910),__webpack_require__(1415);var Me,we=function(){return we=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},we.apply(this,arguments)};!function(e){e[e.STREAM_START=0]="STREAM_START",e[e.STREAM_START_COMPLETED=1]="STREAM_START_COMPLETED",e[e.STREAM_IN_PROGRESS=2]="STREAM_IN_PROGRESS",e[e.STREAM_COMPLETED=3]="STREAM_COMPLETED",e[e.STREAM_FULL=4]="STREAM_FULL"}(Me||(Me={}));var Ue=new(function(){function e(){this.cache=new Map,this.mergedContent=new Map,this.lastDispatchedSeq=new Map,this.hasCompleted=new Map,this.msgExt=new Map}return e.prototype.addChunk=function(e,t){this.cache.has(e)||(this.cache.set(e,[]),this.mergedContent.set(e,""),this.lastDispatchedSeq.set(e,-1),this.hasCompleted.set(e,!1)),t.streamInfo.status===_e.COMPLETED&&this.hasCompleted.set(e,!0);var r=this.cache.get(e);-1===r.findIndex((function(e){return e.seq===t.seq}))?(r.push(t),r.sort((function(e,t){return e.seq-t.seq}))):B.warn("Stream message chunk already exists",t.seq)},e.prototype.getMergedContent=function(e){return this.mergedContent.get(e)||""},e.prototype.appendToMergedContent=function(e,t){var r=this.mergedContent.get(e)||"";this.mergedContent.set(e,r+t)},e.prototype.getChunks=function(e){return this.cache.get(e)||[]},e.prototype.getSequentialChunks=function(e){var t=this.cache.get(e);if(!t||0===t.length)return[];for(var r=this.lastDispatchedSeq.get(e),n=[],o=0,i=t;o<i.length;o++){var a=i[o];if(0!==n.length){var s=n[n.length-1];if(a.seq!==s.seq+1)break;n.push(a)}else{if(void 0!==r&&-1!==r&&a.seq!==r+1)continue;n.push(a)}}return n},e.prototype.markDispatched=function(e,t){var r;t>(null!==(r=this.lastDispatchedSeq.get(e))&&void 0!==r?r:-1)&&this.lastDispatchedSeq.set(e,t)},e.prototype.getLastDispatchedSeq=function(e){var t;return null!==(t=this.lastDispatchedSeq.get(e))&&void 0!==t?t:-1},e.prototype.isCompleted=function(e){var t=this.cache.get(e);return!(!t||0===t.length)&&t[t.length-1].streamInfo.status===_e.COMPLETED},e.prototype.hasMissingSeqs=function(e){var t=this.cache.get(e);if(!t||0===t.length)return!1;var r=t.find((function(e){return e.streamInfo.status===_e.START||e.streamInfo.status===_e.START_AND_COMPLETED}));if(!r)return!0;for(var n=r.seq,o=Math.max.apply(Math,t.map((function(e){return e.seq}))),i=new Set(t.map((function(e){return e.seq}))),a=n;a<=o;a++)if(!i.has(a))return!0;return!1},e.prototype.setMergedContent=function(e,t){this.mergedContent.set(e,t)},e.prototype.hasReceivedCompleted=function(e){return this.hasCompleted.get(e)||!1},e.prototype.hasReceivedFull=function(e){var t=this.cache.get(e);return!!t&&t.some((function(e){return e.streamInfo.status===Me.STREAM_FULL}))},e.prototype.setMsgExt=function(e,t){this.msgExt.set(e,t)},e.prototype.getMsgExt=function(e){return this.msgExt.get(e)},e.prototype.clear=function(e){this.cache.delete(e),this.mergedContent.delete(e),this.lastDispatchedSeq.delete(e),this.hasCompleted.delete(e),this.msgExt.delete(e)},e.prototype.clearAll=function(){this.cache.clear(),this.mergedContent.clear(),this.lastDispatchedSeq.clear(),this.hasCompleted.clear(),this.msgExt.clear()},e}());function Le(e,t,r,n,o,i,a,s,c,u,l,d,p,h,f,m,v){var g={id:e,chatType:t,type:"txt",to:r,msg:n,from:o,time:i,stream:a,onlineState:s};return function(e,t,r,n,o,i,a,s,c,u){t&&Object.keys(t).length>0&&(e.ext=t),r&&r.length>0&&(e.reactions=r),n&&n.length>0&&(e.translations=n),o&&o.operationCount>0&&(e.modifiedInfo=o),i&&(e.chatThread=i),a&&(e.chatThreadOverview=a),s&&(e.isContentReplaced=s),c&&(e.isRead=c),u&&(e.isDelivered=u)}(g,c,u,l,d,p,h,f,m,v),g}var Pe,xe=function(e,t,r,n,o,i,a,c,u,l,p,h,f,m,v,g,y,E,_){var T,I,O,R,S,b;try{var C=function(e,t){var r,n=null!==(r=e.streamError)&&void 0!==r?r:0;512===n?n=s.MESSAGE_STREAM_INTERVAL_TIMEOUT:513===n&&(n=s.MESSAGE_STREAM_TIMEOUT);var o={customType:e.streamType,seq:Number(e.streamSeq.toString()),status:e.streamStatus,errorType:n,text:t,finishReason:e.streamFinishReason};return void 0!==e.streamSeq&&(e.streamSeq&&"object"===Ae(e.streamSeq)?o.seq=Number(new(d())(e.streamSeq.low,e.streamSeq.high,e.streamSeq.unsigned).toString()):o.seq=Number(e.streamSeq)),o}(t.stream,e.text),N=C.seq,A=C.text,M=(C.finishReason,t.stream.streamStatus),w={msgId:n,seq:N,text:A,streamInfo:C,timestamp:Number(a)};if(Ue.addChunk(n,w),M===Me.STREAM_FULL){var U=Ue.getChunks(n);if(0===U.length){var L=A,P=Ue.getMergedContent(n),x=L.slice(P.length),k=we(we({},C),{status:_e.START_AND_COMPLETED,text:x}),D=Le(n,c,i,L,o,Number(a),k,u,l,p,h,f,m,v,g,y,E);return!_&&(null===(I=null===(T=this.eventHandler)||void 0===T?void 0:T.dispatch)||void 0===I||I.call(T,"onStreamMessage",D)),Ue.setMergedContent(n,L),Ue.clear(n),D}var j=U[U.length-2];if(j&&j.streamInfo.status===_e.START_AND_COMPLETED)return void B.debug("Stream message FULL ignored (already dispatched)");var G=Ue.hasMissingSeqs(n),H=Ue.hasReceivedCompleted(n);if(G||!H){B.debug("Stream message has missing (FULL)",{msgId:n,seq:N}),L=A,P=Ue.getMergedContent(n),x=L.slice(P.length),"seq"in(k=we(we({},C),{status:0===C.errorType?_e.COMPLETED:_e.ERROR,text:x}))&&delete k.seq;var F=U[0].timestamp;return D=Le(n,c,i,L,o,Number(F)||Number(a),k,u,l,p,h,f,m,v,g,y,E),!_&&(null===(R=null===(O=this.eventHandler)||void 0===O?void 0:O.dispatch)||void 0===R||R.call(O,"onStreamMessage",D)),Ue.setMergedContent(n,L),B.debug("Stream message dispatched (FULL with missing)",{msgId:n,seq:N,status:"STREAM_COMPLETED",incrementalLength:x.length,fullLength:L.length}),Ue.clear(n),D}return B.debug("Stream message FULL ignored (no missing)",{msgId:n,seq:N}),void Ue.clear(n)}if(Ue.hasMissingSeqs(n))return void B.debug("Stream message has missing",{msgId:n,seq:N});for(var q=Ue.getSequentialChunks(n),W=0,z=q;W<z.length;W++){var K=z[W],V=Ue.getMergedContent(n)+K.text,J=(x=K.text,K.streamInfo.status);J===Me.STREAM_FULL&&(J=_e.COMPLETED),0!==K.streamInfo.errorType&&(J=_e.ERROR),"seq"in(k=we(we({},K.streamInfo),{status:J,text:x}))&&delete k.seq,D=Le(n,c,i,V,o,(F=Ue.getChunks(n)[0].timestamp)||K.timestamp,k,u,l,p,h,f,m,v,g,y,E),!_&&(null===(b=null===(S=this.eventHandler)||void 0===S?void 0:S.dispatch)||void 0===b||b.call(S,"onStreamMessage",D)),Ue.markDispatched(n,K.seq),Ue.appendToMergedContent(n,K.text),B.debug("Stream message dispatched",{msgId:n,seq:K.seq,status:J,incrementalLength:x.length,mergedLength:V.length})}var Y=Ue.getMergedContent(n);B.debug("Stream message processed",{msgId:n,seq:N,status:M,textLength:A.length,mergedLength:Y.length,dispatchedChunks:q.length})}catch(t){B.error("Error handling stream message",t,{msgId:n,msgBody:e})}},ke=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:ye.getUniqueId(),chatType:e.chatType,ackId:e.id,type:"read",to:e.to,from:e.from||"",ackContent:e.ackContent,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),De=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:ye.getUniqueId(),ackId:e.ackId,type:"delivery",to:e.to,from:e.from||"",isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),Be=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:ye.getUniqueId(),type:"channel",chatType:e.chatType||"singleChat",to:e.to,from:e.from||"",time:Date.now(),isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),je=function(){function e(e){var t=e.type,r=e.id||ye.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(),isChatThread:e.isChatThread},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:ye.getUniqueId(),msg:e.msg,to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),Ge=function(){function e(e){var t=e.type,r=e.id;this.id=r||ye.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:ye.getUniqueId(),type:"cmd",to:e.to,from:e.from||"",chatType:e.chatType||"singleChat",action:e.action,time:Date.now(),ext:e.ext,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),He=function(){function e(e){var t=e.type,r=e.id||ye.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:ye.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,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),Fe=function(){function e(e){var t=e.type,r=e.id;this.id=r||ye.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:ye.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,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),qe=(__webpack_require__(9449),function(){function e(e){var t=e.type,r=e.id||ye.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&ye.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,isChatThread:e.isChatThread}},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,n,o,i,a,s,c=e.imageType,u=null===(n=null===(r=null===(t=e.file)||void 0===t?void 0:t.data)||void 0===r?void 0:r.type)||void 0===n?void 0:n.toLowerCase(),l=null===(i=null===(o=e.file)||void 0===o?void 0:o.filetype)||void 0===i?void 0:i.toLowerCase(),d=null===(s=null===(a=e.file)||void 0===a?void 0:a.filename)||void 0===s?void 0:s.toLowerCase(),p="image/gif"===u||"gif"===l||"image/gif"===l||!0===(null==d?void 0:d.endsWith(".gif")),h=e.isGif||p,f=h||!0===e.isOriginalImage||"original"===c;return{id:ye.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,file_length:e.file_length,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv,thumbnailWidth:e.thumbnailWidth,thumbnailHeight:e.thumbnailHeight,isGif:h,isOriginalImage:f}},e}()),We=function(){function e(e){var t=e.type,r=e.id||ye.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&ye.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,isChatThread:e.isChatThread}},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:ye.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,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),ze=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&&ye.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,isChatThread:e.isChatThread}},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:ye.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,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),Ke=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&&ye.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,isChatThread:e.isChatThread}},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:ye.getUniqueId(),chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,file_length:e.file_length,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,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),Ve=function(){function e(e){var t=e.type,r=e.id||ye.getUniqueId();this.id=r,this.type=t,this.value=""}return e.create=function(e){return{type:"combine",id:ye.getUniqueId(),to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv,compatibleText:e.compatibleText,title:e.title,summary:e.summary,messageList:e.messageList,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete}},e}(),Je=function(){function e(t,r){return this.type=t,this.id=r||ye.getUniqueId(),e.createOldMsg({type:t,id:this.id})}return e.createOldMsg=function(e){switch(e.type){case"read":return new ke({type:"read",id:e.id});case"delivery":return new De({type:"delivery",id:e.id});case"channel":return new Be({type:"channel",id:e.id});case"txt":return new je({type:"txt",id:e.id});case"cmd":return new Ge({type:"cmd",id:e.id});case"custom":return new He({type:"custom",id:e.id});case"loc":return new Fe({type:"loc",id:e.id});case"img":return new qe({type:"img",id:e.id});case"audio":return new We({type:"audio",id:e.id});case"video":return new ze({type:"video",id:e.id});case"file":return new Ke({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)?qe.create(e):function(e){return"cmd"===e.type&&!("version"in e)}(e)?Ge.create(e):function(e){return"file"===e.type&&!("version"in e)}(e)?Ke.create(e):function(e){return"audio"===e.type&&!("version"in e)}(e)?We.create(e):function(e){return"video"===e.type&&!("version"in e)}(e)?ze.create(e):function(e){return"custom"===e.type&&!("version"in e)}(e)?He.create(e):function(e){return"loc"===e.type&&!("version"in e)}(e)?Fe.create(e):function(e){return"channel"===e.type&&!("version"in e)}(e)?Be.create(e):function(e){return"delivery"===e.type&&!("version"in e)}(e)?De.create(e):function(e){return"read"===e.type&&!("version"in e)}(e)?ke.create(e):function(e){return"combine"===e.type&&!("version"in e)}(e)?Ve.create(e):{}:je.create(e);var t},e.prototype.set=function(e){},e.getFileUrl=ye.getFileUrl,e.createImageMessage=function(e){return function(e){var t,r="image/gif"===e.file.filetype||(null===(t=e.file.filename)||void 0===t?void 0:t.toLowerCase().endsWith(".gif")),n=r||!!e.isOriginalImage;return{id:ye.getUniqueId(),chatType:e.chatType,type:"img",to:e.to,from:e.from||"",file:{url:"",filename:e.file.filename,filetype:e.file.filetype||"",data:e.file.data||void 0},filename:e.file.filename,filetype:e.file.filetype||"",width:e.width,height:e.height,file_length:e.file.size,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,isGif:r,isOriginalImage:n,_useInternalUpload:!!e.file.path||void 0,_filePath:e.file.path}}(e)},e.download=ye.download,e.parseDownloadResponse=ye.parseDownloadResponse,e}();!function(e){e[e.CREATE=0]="CREATE",e[e.FAIL=1]="FAIL",e[e.INPROGRESS=2]="INPROGRESS",e[e.SUCCESS=3]="SUCCESS"}(Pe||(Pe={}));var Ye,Xe=function(){return Xe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Xe.apply(this,arguments)},Qe=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},$e=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e["chat:user"]="singleChat",e["chat:group"]="groupChat",e["chat:room"]="chatRoom"}(Ye||(Ye={}));var Ze={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM",8:"COMBINE"};function et(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 n=e[r].varintValue,o=new(d())(n.low,n.high,n.unsigned).toString();t[e[r].key]=0!==Number(o)}else 2!==e[r].type&&3!==e[r].type&&4!==e[r].type||(n=e[r].varintValue,o=new(d())(n.low,n.high,n.unsigned).toString(),t[e[r].key]=Number(o));return t}function rt(e){var t="";return e.remotePath&&(t=ye.formatAttachUrl.call(this,e.remotePath),e.remotePath.includes("?em-redirect")||(t="".concat(t,"?em-redirect=true"),e.secretKey&&(t="".concat(t,"&share-secret=").concat(e.secretKey)))),t}function nt(e,t,r){var n=ye.formatAttachUrl.call(this,e),o=n.indexOf("#"),i=o>=0?n.slice(0,o):n,a=o>=0?n.slice(o):"",s=i.indexOf("?"),c=s>=0?i.slice(0,s):i,u=s>=0?i.slice(s+1):"",l=u?u.split("&"):[],d=function(e){return l.some((function(t){return t.split("=")[0]===e}))};return r&&!d("size")&&l.push("size=".concat(r)),d("em-redirect")||l.push("em-redirect=true"),t&&!d("share-secret")&&l.push("share-secret=".concat(t)),"".concat(c).concat(l.length?"?".concat(l.join("&")):"").concat(a)}function ot(e,t){var r,n,o=t.from&&t.from.name;if(o===this.context.userId){var i=null===(r=null==e?void 0:e.from)||void 0===r?void 0:r.clientResource;o===(null===(n=null==t?void 0:t.to)||void 0===n?void 0:n.name)&&i&&i!==this.clientResource&&(o="".concat(o,"/").concat(i))}return o}function it(e,t){var r,n=t.to&&t.to.name;return(null===(r=null==e?void 0:e.to)||void 0===r?void 0:r.clientResource)&&(n="".concat(n,"/").concat(e.to.clientResource)),n}function at(e){var t,r,n,o,i,a,s,c,u,l,d,p,h,f,m,v,g,y,E,_,T,I,O,R,S,b,C;return Qe(this,void 0,void 0,(function(){var N,A,M,w,U,L,P,x,k,D,j,G,H,F,q,W,z,K,V,J,Y,X,Q,$,Z,ee,te,re,ne,oe,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ve,ge,Ee,_e,Te,Ie,Oe,Re,be,Ce,Ne;return $e(this,(function(Ae){switch(Ae.label){case 0:switch(N=e.status,A=e.thirdMessage,M=e.msgBody,w=e.msgId,U=e.type,L=e.from,P=e.to,x=e.time,k=e.onlineState,D=e.chatType,j=e.ignoreCallback,G=e.priority,H=e.format,F=e.broadcast,q=void 0!==F&&F,W=e.isContentReplaced,z=void 0!==W&&W,K=e.meta,V={},J={},Y=N.errorCode>0,X=N.errorCode,Q=N.reason,$={},Z=[],ee=[],te={},re=null,ne=null,ie=!1,ae=!1,A.ext&&($=et(A.ext)),A.meta&&"string"==typeof A.meta&&((se=JSON.parse(A.meta)).reaction&&(Z=se.reaction).forEach((function(e){e.isAddedBySelf=e.state,delete e.state})),se.translations&&(ee=se.translations),se.edit_msg&&(ce=se.edit_msg,ue=ce.count,le=ce.operator,de=ce.edit_time,te={operationTime:de,operatorId:le,operationCount:ue}),se.thread&&"{}"!==JSON.stringify(se.thread)&&(re={messageId:se.thread.msg_parent_id,parentId:se.thread.muc_parent_id,chatThreadName:se.thread.thread_name}),se.thread_overview&&"{}"!==JSON.stringify(se.thread_overview)&&(ne={id:se.thread_overview.id,parentId:se.thread_overview.muc_parent_id,name:se.thread_overview.name,lastMessage:se.thread_overview.last_message&&"{}"!==JSON.stringify(se.thread_overview.last_message)?Se.call(this,se.thread_overview.last_message):null,createTimestamp:se.thread_overview.create_timestamp,updateTimestamp:se.thread_overview.update_timestamp,messageCount:se.thread_overview.message_count||0}),se.isDelivered&&(ie=!0),se.isRead&&(ae=!0)),M.type){case 0:return[3,1];case 1:return[3,8];case 2:return[3,11];case 3:return[3,14];case 4:return[3,17];case 5:return[3,20];case 6:return[3,23];case 7:return[3,24];case 8:return[3,27]}return[3,28];case 1:return Object.prototype.hasOwnProperty.call(M,"subType")&&0===M.subType?(oe=rt.call(this,M),pe={id:w,type:"combine",chatType:D,to:P,from:L,ext:$,time:Number(x),onlineState:k,title:M.title||"",summary:M.summary||"",url:oe||"",secret:M.secretKey||"",file_length:M.fileLength||0,filename:M.displayName||"",compatibleText:M.text,combineLevel:M.combineLevel||0},V.msgConfig&&(pe.msgConfig=V.msgConfig),Z.length>0&&(pe.reactions=Z),re&&(pe.chatThread=re),ne&&(pe.chatThreadOverview=ne),"chatRoom"===D&&(pe.priority=G,pe.broadcast=q),te.operationCount>0&&(pe.modifiedInfo=te),z&&(pe.isContentReplaced=z),ae&&(pe.isRead=!0),ie&&(pe.isDelivered=!0),J=pe,j?[3,3]:[4,null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r?void 0:r.storeMessage(pe,Pe.SUCCESS)]):[3,4];case 2:Ae.sent(),null===(n=this.eventHandler)||void 0===n||n.dispatch("onCombineMessage",pe),Ae.label=3;case 3:return[3,29];case 4:return Object.prototype.hasOwnProperty.call(M,"subType")&&10===M.subType&&A.stream?(he=xe.call(this,M,A,K,w,L,P,x,D,k,$,Z,ee,te,re,ne,z,ae,ie,null!=j&&j),J=he,[3,29]):[3,5];case 5:return!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,data:M.text,ext:$,sourceMsg:M.text,time:x,msgConfig:A.msgConfig,onlineState:k}).msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onTextMessage&&this.onTextMessage(V),fe={id:w,type:"txt",chatType:D,msg:M.text,to:P,from:L,ext:$,time:Number(x),onlineState:k},V.msgConfig&&(fe.msgConfig=V.msgConfig),Z.length>0&&(fe.reactions=Z),re&&(fe.chatThread=re),ne&&(fe.chatThreadOverview=ne),ee.length>0&&(fe.translations=ee),te.operationCount>0&&(fe.modifiedInfo=te),"chatRoom"===D&&(fe.priority=G,fe.broadcast=q),z&&(fe.isContentReplaced=z),ae&&(fe.isRead=!0),ie&&(fe.isDelivered=!0),J=fe,j?[3,7]:[4,null===(i=null===(o=this._localCache)||void 0===o?void 0:o.getInstance())||void 0===i?void 0:i.storeMessage(fe,Pe.SUCCESS)];case 6:Ae.sent(),null===(a=this.eventHandler)||void 0===a||a.dispatch("onTextMessage",fe),Ae.label=7;case 7:return[3,29];case 8:return me=(null===(s=null==M?void 0:M.size)||void 0===s?void 0:s.width)||0,ve=(null===(c=null==M?void 0:M.size)||void 0===c?void 0:c.height)||0,oe=this.useOwnUploadFun?M.remotePath:rt.call(this,M),!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,url:oe,secret:M.secretKey,filename:M.displayName,thumb:this.useOwnUploadFun?"":"".concat(oe,"&thumbnail=true"),thumb_secret:M.secretKey,file_length:M.fileLength||"",width:me,height:ve,filetype:M.filetype||"",accessToken:this.token,ext:$,time:x,msgConfig:A.msgConfig,onlineState:k}).delay&&delete V.delay,!V.msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onPictureMessage&&this.onPictureMessage(V),ge={id:w,type:"img",chatType:D,from:L,to:P,url:oe||"",width:me,height:ve,secret:M.secretKey||"",thumb:this.useOwnUploadFun?"":"".concat(oe,"&thumbnail=true"),thumb_secret:M.secretKey,file_length:M.fileLength||0,ext:$,time:Number(x),onlineState:k},V.msgConfig&&(ge.msgConfig=V.msgConfig),Z.length>0&&(ge.reactions=Z),re&&(ge.chatThread=re),ne&&(ge.chatThreadOverview=ne),"chatRoom"===D&&(ge.priority=G,ge.broadcast=q),te.operationCount>0&&(ge.modifiedInfo=te),z&&(ge.isContentReplaced=z),ae&&(ge.isRead=!0),ie&&(ge.isDelivered=!0),Object.prototype.hasOwnProperty.call(M,"subType")&&1===M.subType&&(ge.isGif=!0),ge.isOriginalImage=!(2===M.imageType&&!ge.isGif),M.remotePath&&!this.useOwnUploadFun?(ge.originalImageUrl=nt.call(this,M.remotePath,M.secretKey),ge.bigImageUrl=nt.call(this,M.remotePath,M.secretKey,"large"),ge.thumb="".concat(oe,"&thumbnail=true")):M.remotePath&&this.useOwnUploadFun&&(ge.originalImageUrl=M.remotePath),J=ge,j?[3,10]:[4,null===(l=null===(u=this._localCache)||void 0===u?void 0:u.getInstance())||void 0===l?void 0:l.storeMessage(ge,Pe.SUCCESS)];case 9:Ae.sent(),null===(d=this.eventHandler)||void 0===d||d.dispatch("onImageMessage",ge),Ae.label=10;case 10:return[3,29];case 11:return oe=this.useOwnUploadFun?M.remotePath:rt.call(this,M),!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,url:oe,secret:M.secretKey,filename:M.displayName,length:M.duration||"",file_length:M.fileLength||"",filetype:M.filetype||"",accessToken:this.token||"",ext:$,time:x,msgConfig:A.msgConfig,onlineState:k}).delay&&delete V.delay,!V.msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onVideoMessage&&this.onVideoMessage(V),Ee={id:w,type:"video",chatType:D,from:L,to:P,url:oe,secret:M.secretKey,thumb:ye.formatAttachUrl.call(this,M.thumbnailRemotePath),thumb_secret:M.thumbnailSecretKey,filename:M.displayName,length:M.duration||0,file:{},file_length:M.fileLength||0,filetype:M.filetype||"",accessToken:this.token||"",ext:$,time:Number(x),onlineState:k},V.msgConfig&&(Ee.msgConfig=V.msgConfig),Z.length>0&&(Ee.reactions=Z),re&&(Ee.chatThread=re),ne&&(Ee.chatThreadOverview=ne),"chatRoom"===D&&(Ee.priority=G,Ee.broadcast=q),te.operationCount>0&&(Ee.modifiedInfo=te),z&&(Ee.isContentReplaced=z),ae&&(Ee.isRead=!0),ie&&(Ee.isDelivered=!0),J=Ee,j?[3,13]:[4,null===(h=null===(p=this._localCache)||void 0===p?void 0:p.getInstance())||void 0===h?void 0:h.storeMessage(Ee,Pe.SUCCESS)];case 12:Ae.sent(),null===(f=this.eventHandler)||void 0===f||f.dispatch("onVideoMessage",Ee),Ae.label=13;case 13:return[3,29];case 14:return!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,addr:M.address,buildingName:M.buildingName,lat:M.latitude,lng:M.longitude,ext:$,time:x,msgConfig:A.msgConfig,onlineState:k}).delay&&delete V.delay,!V.msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onLocationMessage&&this.onLocationMessage(V),_e={id:w,type:"loc",chatType:D,from:L,to:P,buildingName:M.buildingName,addr:M.address,lat:M.latitude,lng:M.longitude,ext:$,time:Number(x),onlineState:k},V.msgConfig&&(_e.msgConfig=V.msgConfig),Z.length>0&&(_e.reactions=Z),re&&(_e.chatThread=re),ne&&(_e.chatThreadOverview=ne),"chatRoom"===D&&(_e.priority=G,_e.broadcast=q),te.operationCount>0&&(_e.modifiedInfo=te),z&&(_e.isContentReplaced=z),ae&&(_e.isRead=!0),ie&&(_e.isDelivered=!0),J=_e,j?[3,16]:[4,null===(v=null===(m=this._localCache)||void 0===m?void 0:m.getInstance())||void 0===v?void 0:v.storeMessage(_e,Pe.SUCCESS)];case 15:Ae.sent(),null===(g=this.eventHandler)||void 0===g||g.dispatch("onLocationMessage",_e),Ae.label=16;case 16:return[3,29];case 17:return oe=this.useOwnUploadFun?M.remotePath:rt.call(this,M),!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,url:oe,secret:M.secretKey,filename:M.displayName,file_length:M.fileLength||"",accessToken:this.token||"",ext:$,length:M.duration,time:x,msgConfig:A.msgConfig,onlineState:k}).delay&&delete V.delay,!V.msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onAudioMessage&&this.onAudioMessage(V),Te={id:w,type:"audio",chatType:D,from:L,to:P,url:oe,secret:M.secretKey,file:{},filename:M.displayName,length:M.duration||0,file_length:M.fileLength||0,filetype:M.filetype||"",accessToken:this.token||"",ext:$,time:Number(x),onlineState:k},V.msgConfig&&(Te.msgConfig=V.msgConfig),Z.length>0&&(Te.reactions=Z),re&&(Te.chatThread=re),ne&&(Te.chatThreadOverview=ne),"chatRoom"===D&&(Te.priority=G,Te.broadcast=q),te.operationCount>0&&(Te.modifiedInfo=te),z&&(Te.isContentReplaced=z),ae&&(Te.isRead=!0),ie&&(Te.isDelivered=!0),J=Te,j?[3,19]:[4,null===(E=null===(y=this._localCache)||void 0===y?void 0:y.getInstance())||void 0===E?void 0:E.storeMessage(Te,Pe.SUCCESS)];case 18:Ae.sent(),null===(_=this.eventHandler)||void 0===_||_.dispatch("onAudioMessage",Te),Ae.label=19;case 19:return[3,29];case 20:return oe=this.useOwnUploadFun?M.remotePath:rt.call(this,M),!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,url:oe,secret:M.secretKey,filename:M.displayName,file_length:M.fileLength,accessToken:this.token||"",ext:$,time:x,msgConfig:A.msgConfig,onlineState:k}).delay&&delete V.delay,!V.msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onFileMessage&&this.onFileMessage(V),Ie={id:w,type:"file",chatType:D,from:L,to:P,url:oe,secret:M.secretKey,file:{},filename:M.displayName,length:M.duration||0,file_length:M.fileLength||0,filetype:M.filetype||"",accessToken:this.token||"",ext:$,time:Number(x),onlineState:k},V.msgConfig&&(Ie.msgConfig=V.msgConfig),Z.length>0&&(Ie.reactions=Z),re&&(Ie.chatThread=re),ne&&(Ie.chatThreadOverview=ne),"chatRoom"===D&&(Ie.priority=G,Ie.broadcast=q),te.operationCount>0&&(Ie.modifiedInfo=te),z&&(Ie.isContentReplaced=z),ae&&(Ie.isRead=!0),ie&&(Ie.isDelivered=!0),J=Ie,j?[3,22]:[4,null===(I=null===(T=this._localCache)||void 0===T?void 0:T.getInstance())||void 0===I?void 0:I.storeMessage(Ie,Pe.SUCCESS)];case 21:Ae.sent(),null===(O=this.eventHandler)||void 0===O||O.dispatch("onFileMessage",Ie),Ae.label=22;case 22:return[3,29];case 23:return!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,action:M.action,ext:$,time:x,msgConfig:A.msgConfig,onlineState:k}).msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onCmdMessage&&this.onCmdMessage(V),Oe={id:w,type:"cmd",chatType:D,from:L,to:P,action:M.action,ext:$,time:Number(x),onlineState:k},V.msgConfig&&(Oe.msgConfig=V.msgConfig),Z.length>0&&(Oe.reactions=Z),re&&(Oe.chatThread=re),ne&&(Oe.chatThreadOverview=ne),"chatRoom"===D&&(Oe.priority=G,Oe.broadcast=q),te.operationCount>0&&(Oe.modifiedInfo=te),z&&(Oe.isContentReplaced=z),ae&&(Oe.isRead=!0),ie&&(Oe.isDelivered=!0),J=Oe,j||null===(R=this.eventHandler)||void 0===R||R.dispatch("onCmdMessage",Oe),[3,29];case 24:return Re={},be={},A.contents[0].customExts&&(Re=et(A.contents[0].customExts)),A.contents[0].params&&(be=et(A.contents[0].params)),V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,customEvent:M.customEvent,params:be,customExts:Re,ext:$,time:x,onlineState:k},!j&&this.onCustomMessage&&this.onCustomMessage(V),Ce={id:w,type:"custom",chatType:D,from:L,to:P,customEvent:M.customEvent,params:be,customExts:Re,ext:$,time:Number(x),onlineState:k},V.msgConfig&&(Ce.msgConfig=V.msgConfig),Z.length>0&&(Ce.reactions=Z),re&&(Ce.chatThread=re),ne&&(Ce.chatThreadOverview=ne),te.operationCount>0&&(Ce.modifiedInfo=te),"chatRoom"===D&&(Ce.priority=G,Ce.broadcast=q),z&&(Ce.isContentReplaced=z),ae&&(Ce.isRead=!0),ie&&(Ce.isDelivered=!0),J=Ce,j?[3,26]:[4,null===(b=null===(S=this._localCache)||void 0===S?void 0:S.getInstance())||void 0===b?void 0:b.storeMessage(Ce,Pe.SUCCESS)];case 25:Ae.sent(),null===(C=this.eventHandler)||void 0===C||C.dispatch("onCustomMessage",Ce),Ae.label=26;case 26:return[3,29];case 27:return oe=rt.call(this,M),Ne={id:w,type:"combine",chatType:D,to:P,from:L,ext:$,time:Number(x),onlineState:k,title:M.title||"",summary:M.summary||"",url:oe||"",secret:M.secretKey||"",file_length:M.fileLength||0,filename:M.displayName||"",compatibleText:M.text,combineLevel:M.combineLevel||0},V.msgConfig&&(Ne.msgConfig=V.msgConfig),Z.length>0&&(Ne.reactions=Z),re&&(Ne.chatThread=re),ne&&(Ne.chatThreadOverview=ne),"chatRoom"===D&&(Ne.priority=G,Ne.broadcast=q),te.operationCount>0&&(Ne.modifiedInfo=te),z&&(Ne.isContentReplaced=z),ae&&(Ne.isRead=!0),ie&&(Ne.isDelivered=!0),J=Ne,!j&&this.eventHandler&&this.eventHandler.dispatch("onCombineMessage",Ne),[3,29];case 28:return B.error("Unknow message type, message:",M),[3,29];case 29:return H?[2,J]:[2,V]}}))}))}function st(e,t,r){if(this.delivery&&e!==t){var n=this.getUniqueId(),o=new Je("delivery",n);o.set({ackId:r,to:e}),B.debug("send delivery ack"),this.send(o.body)}}var ct=function(e,t,r,n,o){var i,a,s,c,u,l,p,h,f,m,v,g,y,E,_,T,I,O,R,S,b,C,N,A,M,w,U,L,P,x;return Qe(this,void 0,void 0,(function(){var k,D,j,G,H,F,q,W,z,K,V,J,Y,X,Q,$,Z,ee,te,re,ne,oe,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ve,ge,Ee,_e,Te,Ie,Oe,Re,Se,Ne,Ae,Me;return $e(this,(function(we){switch(we.label){case 0:if(k=new(d())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),D=this.root.lookup("easemob.pb.MessageBody"),j=D.decode(e.payload),G=3,H=!1,F=new(d())(e.id.low,e.id.high,e.id.unsigned).toString(),o&&e.from&&e.from.name===this.context.userId&&e.from.clientResource===this.clientResource&&j.type===sr.CHATROOM)return[2,B.debug("Discard your own chat room message:",F)];if(q=(null===(i=e.from)||void 0===i?void 0:i.name)||"",W=e.to?e.to.name:"",z=!!e.to&&-1!==e.to.domain.indexOf("conference"),this._load_msg_cache.some((function(e){return e.msgId===F}))&&10!==j.contents[0].subType&&!r)return[2,B.debug("Discard message in cache:",F)];if(this._load_msg_cache.length<=this.max_cache_length||this._load_msg_cache.shift(),this._load_msg_cache.push({msgId:F,from:q,to:W,isGroup:z}),e.meta&&e.meta.length){if(K=ye.parseNotify(e.meta),V=K.is_online,J=K.callback_replace,this.useReplacedMessageContents&&J&&(H=!0),V||0===V)switch(V){case 0:G=0;break;case 1:G=1;break;default:G=2}}else G=3;switch(Y=j.ackMessageId?new(d())(j.ackMessageId.low,j.ackMessageId.high,j.ackMessageId.unsigned).toString():"",X="",Q=ot.call(this,e,j),$=it.call(this,e,j),B.debug("received message:",{metaId:F,metaNs:e.ns,type:j.type,from:Q,to:$,contentType:null===(s=null===(a=j.contents)||void 0===a?void 0:a[0])||void 0===s?void 0:s.type,contentLen:null===(c=j.contents)||void 0===c?void 0:c.length}),j.type){case sr.SINGLECHAT:return[3,1];case sr.GROUPCHAT:return[3,2];case sr.CHATROOM:return[3,3];case sr.READ_ACK:return[3,4];case sr.DELIVER_ACK:return[3,5];case sr.RECALL:return[3,6];case sr.CHANNEL_ACK:return[3,15];case sr.EDIT:return[3,16]}return[3,20];case 1:return X="chat","agoraToken"===this.grantType&&(X="singleChat"),this.delivery&&!r&&Q!==this.context.userId&&10!==(null===(u=j.contents[0])||void 0===u?void 0:u.subType)&&st.call(this,Q,$,F),[3,21];case 2:return X="groupchat","agoraToken"===this.grantType&&(X="groupChat"),[3,21];case 3:return X="chatroom","agoraToken"===this.grantType&&(X="chatRoom"),G=1,[3,21];case 4:return X="read_ack",Z=void 0,j.ext[0]&&JSON.parse(j.ext[0].stringValue)?(Z={id:F,type:"read",from:Q,to:$,mid:Y,groupReadCount:j.ext[0]&&JSON.parse(j.ext[0].stringValue),ackContent:j.ackContent,onlineState:G},this.onReadMessage&&this.onReadMessage(Z),null===(l=this.eventHandler)||void 0===l||l.dispatch("onReadMessage",Z),[2]):(Z={id:F,type:"read",from:Q,to:$,mid:Y,onlineState:G},this.onReadMessage&&this.onReadMessage(Z),null===(p=this.eventHandler)||void 0===p||p.dispatch("onReadMessage",Z),[2]);case 5:return X="deliver_ack",this.onDeliveredMessage&&this.onDeliveredMessage({id:F,type:"delivery",from:Q,to:$,mid:Y,onlineState:G}),ee={id:F,type:"delivery",from:Q,to:$,mid:Y,onlineState:G},null===(h=this.eventHandler)||void 0===h||h.dispatch("onDeliveredMessage",ee),[2];case 6:return X="recall",te="",e.ext&&(te=(null===(f=et(e.ext))||void 0===f?void 0:f.recallMessageExtensionInfo)||""),re={id:F,from:Q||"admin",to:$,mid:Y,ext:te,onlineState:G},ne=$===this.user?Q:$,[4,null===(v=null===(m=this._localCache)||void 0===m?void 0:m.getInstance())||void 0===v?void 0:v.getMessageByServerMsgId(re.mid)];case 7:return(oe=we.sent())?[4,null===(y=null===(g=this._localCache)||void 0===g?void 0:g.getInstance())||void 0===y?void 0:y.removeMsgByServerMsgId(re.mid)]:[3,9];case 8:we.sent(),we.label=9;case 9:return"singleChat"!==(null==oe?void 0:oe.chatType)&&"groupChat"!==(null==oe?void 0:oe.chatType)?[3,14]:(ie=(null==oe?void 0:oe.from)===this.user||""===(null==oe?void 0:oe.from),[4,null===(_=null===(E=this._localCache)||void 0===E?void 0:E.getInstance())||void 0===_?void 0:_.getConversationLastMessage(ne,oe.chatType)]);case 10:return ae=we.sent(),[4,null===(I=null===(T=this._localCache)||void 0===T?void 0:T.getInstance())||void 0===I?void 0:I.getConversationBySessionId(be({conversationId:ne,conversationType:oe.chatType}))];case 11:return(se=we.sent())?[4,null===(R=null===(O=this._localCache)||void 0===O?void 0:O.getInstance())||void 0===R?void 0:R.updateLocalConversation(be({conversationId:ne,conversationType:oe.chatType}),{lastMessageId:null==ae?void 0:ae.serverMsgId,unReadCount:Ce({conversation:se,isRecallSelfMsg:ie,recalledMsgTime:oe.time})})]:[3,13];case 12:we.sent(),we.label=13;case 13:we.label=14;case 14:return this.onRecallMessage&&this.onRecallMessage(re),null===(S=this.eventHandler)||void 0===S||S.dispatch("onRecallMessage",re),[2];case 15:return this.onChannelMessage&&this.onChannelMessage({id:F,type:"channel",chatType:"singleChat",from:Q,to:$,time:Number(k),onlineState:G}),ce={id:F,type:"channel",chatType:"singleChat",from:Q,to:$,time:Number(k),onlineState:G},null===(b=this.eventHandler)||void 0===b||b.dispatch("onChannelMessage",ce),[2];case 16:return ue={errorCode:0,reason:""},le="",de=0,pe="",j.meta&&"string"==typeof j.meta&&(he=JSON.parse(j.meta)).edit_msg&&(fe=he.edit_msg,me=fe.sender,ve=fe.send_time,ge=fe.chat_type,le=me,de=ve,pe=Ye[ge]),Ee=j.editMessageId&&new(d())(j.editMessageId.low,j.editMessageId.high,j.editMessageId.unsigned).toString(),_e=j.editScope,[4,at.call(this,{status:ue,thirdMessage:j,msgBody:j.contents[0],msgId:Ee,type:X,from:le,to:$,time:de,onlineState:G,ignoreCallback:!0,format:!0,isContentReplaced:H})];case 17:return(Te=we.sent()).chatType=pe,e.ignoreCallback?[2,Te]:Te?[4,null===(N=null===(C=this._localCache)||void 0===C?void 0:C.getInstance())||void 0===N?void 0:N.getMessageByServerMsgId(Te.id)]:[3,19];case 18:(Ie=we.sent())&&(Oe=Ie.ext||{},(_e===cr.BODY_AND_EXT||Object.keys(Te.ext||{}).length>0)&&(Oe=Te.ext),"txt"===Te.type&&"txt"===Ie.type?null===(M=null===(A=this._localCache)||void 0===A?void 0:A.getInstance())||void 0===M||M.putMessageToDB(Xe(Xe({},Ie),{msg:Te.msg,modifiedInfo:Te.modifiedInfo,translations:Te.translations,ext:Oe})):"custom"===Te.type&&"custom"===Ie.type?null===(U=null===(w=this._localCache)||void 0===w?void 0:w.getInstance())||void 0===U||U.putMessageToDB(Xe(Xe({},Ie),{ext:Oe,customExts:Te.customExts,customEvent:Te.customEvent,modifiedInfo:Te.modifiedInfo})):null===(P=null===(L=this._localCache)||void 0===L?void 0:L.getInstance())||void 0===P||P.putMessageToDB(Xe(Xe({},Ie),{ext:Oe,modifiedInfo:Te.modifiedInfo}))),we.label=19;case 19:return null===(x=this.eventHandler)||void 0===x||x.dispatch("onModifiedMessage",Te),[2];case 20:return B.error("unexpected message type: ".concat(j.type)),[2];case 21:Re="normal",Ne=!1,"chat"===X.toLowerCase()||"singleChat"===X?Se="singleChat":"groupchat"===X.toLowerCase()||"groupChat"===X?Se="groupChat":(Se="chatRoom",G=1,e.ext&&(Ae=et(e.ext),Ne=!!(null==Ae?void 0:Ae.is_broadcast),Re=0===Ae.chatroom_msg_tag?"high":2===Ae.chatroom_msg_tag?"low":"normal")),Me=0,we.label=22;case 22:return Me<j.contents.length?[4,at.call(this,{status:t,thirdMessage:j,msgBody:j.contents[Me],msgId:F,type:X,from:Q,to:$,time:k,onlineState:G,chatType:Se,ignoreCallback:r,priority:Re,format:n,broadcast:Ne,isContentReplaced:H,meta:e})]:[3,25];case 23:return[2,we.sent()];case 24:return Me++,[3,22];case 25:return[2]}}))}))},ut=function(){return ut=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ut.apply(this,arguments)},lt=["public","members_only","allow_user_invites","invite_need_confirm"],dt={name:"name",title:"name",description:"description",public:"public",members_only:"approval",allow_user_invites:"allowInvites",max_users:"maxUsers",invite_need_confirm:"inviteNeedConfirm",custom:"ext",last_modified:"lastModified",avatar:"avatar"};function pt(e,t){var r,n,o,i,a,s,c=this,u=this.context,l=u.userId,d=u.jid,p=t.from.name===l&&d.clientResource!==t.from.clientResource;return t.isThread?(o={id:t.mucId.name,name:t.mucName,operation:"",parentId:t.mucParentId.name,operator:t.from.name,userName:t.to.length?t.to[0].name:""},i={chatThreadId:t.mucId.name,chatThreadName:t.mucName,operation:"",parentId:t.mucParentId.name}):(n={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},a={operation:"",id:t.mucId.name,from:t.from.name},t.isChatroom&&(null===(r=null==t?void 0:t.eventInfo)||void 0===r?void 0:r.ext)&&(s=JSON.parse(t.eventInfo.ext))),({45:function(){var e,r,n;a.operation="memberAttributesUpdate";var o=JSON.parse(null===(e=null==t?void 0:t.eventInfo)||void 0===e?void 0:e.ext)||{};a.attributes=o.properties||{},a.userId=o.username||"",p?null===(r=c.eventHandler)||void 0===r||r.dispatch("onMultiDeviceEvent",a):null===(n=c.eventHandler)||void 0===n||n.dispatch("onGroupEvent",a)},44:function(){var e;a.operation="removeChatRoomAttributes",a.attributes=s.result.successKeys,s.result.successKeys.length>0&&(null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a))},43:function(){var e;a.operation="updateChatRoomAttributes";var t={};s.result.successKeys.forEach((function(e){t[e]=s.properties[e]})),a.attributes=t,s.result.successKeys.length>0&&(null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a))},42:function(){},41:function(){},40:function(){},39:function(){},38:function(){var e;i.operation="chatThreadNameUpdate",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},37:function(){var e;o.operation="userRemove",null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatThreadChange",o)},36:function(){var e;i.operation="chatThreadLeave",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},35:function(){var e;i.operation="chatThreadJoin",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},34:function(){var e;i.operation="chatThreadDestroy",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},33:function(){var e;i.operation="chatThreadCreate",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},32:function(){var e,r,o,i;n.type=t.isChatroom?"rmChatRoomMute":"rmGroupMute",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="unmuteAllMembers",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},31:function(){var e,r,o,i;n.type=t.isChatroom?"muteChatRoom":"muteGroup",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="muteAllMembers",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},30:function(){var e,r,o,i;n.type=t.isChatroom?"rmUserFromChatRoomWhiteList":"rmUserFromGroupWhiteList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeAllowlistMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},29:function(){var e,r,o,i;n.type=t.isChatroom?"addUserToChatRoomWhiteList":"addUserToGroupWhiteList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="addUserToAllowlist",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},28:function(){var e,r,o,i;n.type="deleteFile",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="deleteFile",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},27:function(){var e,r,o,i;n.type="uploadFile",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="uploadFile",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},26:function(){var e,r,o,i;n.type="deleteAnnouncement",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="deleteAnnouncement",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},25:function(){var e,r,o,i;n.type="updateAnnouncement",n.announcement=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="updateAnnouncement",a.announcement=t.reason,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},24:function(){var e,r,o,i;n.type="removeMute",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="unmuteMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},23:function(){var e,r,o,i;if(n.type="addMute",c.onPresence&&c.onPresence(n),t.ext&&"string"==typeof t.ext){var s=JSON.parse(t.ext);s.user_mute_time&&(n.muteTimestamp=s.user_mute_time,a.muteTimestamp=s.user_mute_time)}t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="muteMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},22:function(){var e,r,o,i;n.type="removeAdmin",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeAdmin",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},21:function(){var e,r,o,i;n.type="addAdmin",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="setAdmin",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},20:function(){var e,r,o,i;n.type="changeOwner",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="changeOwner",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},19:function(){var e,r,o,i;n.type="direct_joined",n.groupName=t.mucName,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="directJoined",a.name=t.mucName,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},18:function(){var e,r,o,i,s;n.type=t.isChatroom?"leaveChatRoom":"leaveGroup",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n);var u=t.mucMemberCount;if(u&&(a.memberCount=u),a.operation="memberAbsence",t.members&&t.members.length>0){var l=ut({},a);l.members=t.members,l.operation="membersAbsence",delete l.from,t.isChatroom?t.members.forEach((function(e){var t;null===(t=c.eventHandler)||void 0===t||t.dispatch("onChatroomEvent",ut(ut({},a),{from:e}))})):null===(o=c.eventHandler)||void 0===o||o.dispatch("onGroupEvent",l)}else t.isChatroom?null===(i=c.eventHandler)||void 0===i||i.dispatch("onChatroomEvent",a):null===(s=c.eventHandler)||void 0===s||s.dispatch("onGroupEvent",a)},17:function(){var e,r,o,i,s;t.isChatroom&&t.ext&&(a.ext=t.ext,n.ext=t.ext),n.type=t.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n);var u=t.mucMemberCount;if(a.operation="memberPresence",u&&(a.memberCount=u),t.members&&t.members.length>0){var l=ut({},a);l.members=t.members,l.operation="membersPresence",delete l.from,t.isChatroom?t.members.forEach((function(e){var t;null===(t=c.eventHandler)||void 0===t||t.dispatch("onChatroomEvent",ut(ut({},a),{from:e}))})):null===(o=c.eventHandler)||void 0===o||o.dispatch("onGroupEvent",l)}else t.isChatroom?null===(i=c.eventHandler)||void 0===i||i.dispatch("onChatroomEvent",a):null===(s=c.eventHandler)||void 0===s||s.dispatch("onGroupEvent",a)},16:function(){var e,r;n.type="unblock",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},15:function(){var e,r;n.type="block",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},14:function(){var e,r,o,i,s,u=t.isChatroom;if(!u){var l=JSON.parse((null===(e=null==t?void 0:t.eventInfo)||void 0===e?void 0:e.ext)||"{}",(function(e,t){return"last_modified"===e?Number(t):lt.includes(e)?"true"===t||!0===t:t}));a.detail=n.detail={},Object.keys(l).forEach((function(e){var t=dt[e];if(t){var r=l[e];a.detail&&(a.detail[t]=r),n.detail&&(n.detail[t]=r)}}))}n.type="update",c.onPresence&&c.onPresence(n),u?null===(r=c.eventHandler)||void 0===r||r.dispatch("onChatroomChange",n):null===(o=c.eventHandler)||void 0===o||o.dispatch("onGroupChange",n),a.operation="updateInfo",u?null===(i=c.eventHandler)||void 0===i||i.dispatch("onChatroomEvent",a):null===(s=c.eventHandler)||void 0===s||s.dispatch("onGroupEvent",a)},13:function(){var e,r,o,i;n.type="allow",n.reason=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),t.reason&&(a.reason=t.reason),a.operation="unblockMember",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},12:function(){var e,r;n.type="ban",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},11:function(){var e,r;n.type="getBlackList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},10:function(){var e,r,o,i;n.type="removedFromGroup",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeMember",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},9:function(){var e,r,o,i;n.type="invite_decline",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="rejectInvite",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},8:function(){var e,r,o,i;n.type="invite_accept",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="acceptInvite",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},7:function(){var e,r,o,i;n.type="invite",n.kicked=n.to,n.groupName=t.mucName,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="inviteToJoin",a.name=t.mucName,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},6:function(){var e,r,o,i;n.type="joinPublicGroupDeclined",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="joinPublicGroupDeclined",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):(a.userId=t.to.length?t.to[0].name:"",null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a))},5:function(){var e,r,o,i;n.type="joinPublicGroupSuccess",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="acceptRequest",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},4:function(){var e,r,o,i;n.type="joinGroupNotifications",n.reason=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),t.reason&&(a.reason=t.reason),a.operation="requestToJoin",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},3:function(){var e,r;n.type="leave",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},2:function(){var e,r;n.type="join",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},1:function(){var e,r,o,i;n.type="deleteGroupChat",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="destroy",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},0:function(){var e,r;a.operation="create",t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupEvent",a)}}[e]||function(){console.error("No match operation ".concat(e))})()}var ht,ft=function(e){var t=this.root.lookup("easemob.pb.MUCBody").decode(e.payload),r=t.operation;B.debug("onMucMessage",t),pt.call(this,r,t)},mt={handleRosterMsg:function(e){var t,r,n,o,i,a,s=this.root.lookup("easemob.pb.RosterBody").decode(e.payload),c={type:"",to:s.to[0].name,from:s.from.name,status:s.reason};switch(s.operation){case 2:c.type="subscribe",this.onContactInvited&&this.onContactInvited(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onContactInvited",c);break;case 3:c.type="unsubscribed",this.onContactDeleted&&this.onContactDeleted(c),null===(r=this.eventHandler)||void 0===r||r.dispatch("onContactDeleted",c);break;case 4:c.type="subscribed",this.onContactAdded&&this.onContactAdded(c),null===(n=this.eventHandler)||void 0===n||n.dispatch("onContactAdded",c);break;case 5:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(o=this.eventHandler)||void 0===o||o.dispatch("onContactRefuse",c);break;case 6:case 7:break;case 8:c.type="subscribed",this.onContactAgreed&&this.onContactAgreed(c),null===(i=this.eventHandler)||void 0===i||i.dispatch("onContactAgreed",c);break;case 9:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(a=this.eventHandler)||void 0===a||a.dispatch("onContactRefuse",c);break;default:B.error("handleRosterMsg:",s)}this.onPresence&&c.type&&this.onPresence(c)}},vt=function(e){var t,r,n,o,i,a,c=this.root.lookup("easemob.pb.StatisticsBody").decode(e.payload),u=c.operation,l=c.reason;switch(u){case 0:this.onStatisticMessage&&this.onStatisticMessage(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onStatisticMessage",c);break;case 1:a=p.create({type:s.WEBIM_CONNCTION_USER_REMOVED,message:"user has been removed"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(r=this.eventHandler)||void 0===r||r.dispatch("onError",a),Ue.clearAll();break;case 2:a=p.create({type:s.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE,message:"the user is already logged on another device"}),l&&(a.data={loginInfoCustomExt:c.reason}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",a),Ue.clearAll();break;case 3:a=p.create({type:s.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD,message:"the user was kicked by changing password"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",a),Ue.clearAll();break;case 4:a=p.create({type:s.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE,message:"the user was kicked by other device"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",a),Ue.clearAll();break;default:B.error("handleStatisticsMsg:",c)}};function gt(e){var t,r=[],n=[],o=e.data;o&&o.values&&o.values.forEach((function(e){Object.entries(e.status).forEach((function(e){n.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:n})})),this.onPresenceStatusChange&&this.onPresenceStatusChange(r),null===(t=this.eventHandler)||void 0===t||t.dispatch("onPresenceStatusChange",r)}function yt(e){var t=this;e.data.forEach((function(e){var r,n={from:e.from,to:e.to,chatType:"chat"===e.channel_type?"singleChat":"groupChat",messageId:e.messageId,reactions:e.reactions,ts:e.ts};null===(r=t.eventHandler)||void 0===r||r.dispatch("onReactionChange",n)}))}function Et(e){var t,r,n,o;if(e.data){var i=e.data,a={id:i.id||"",name:i.name||"",parentId:i.muc_parent_id||"",messageId:i.msg_parent_id||"",timestamp:i.timestamp||0,operator:i.from||"",operation:""};switch(i.operation){case"create":a.operation="create",a.createTimestamp=a.timestamp,a.messageCount=0,null===(t=this.eventHandler)||void 0===t||t.dispatch("onChatThreadChange",a);break;case"update_msg":a.operation="update",a.messageCount=i.message_count,i.last_message&&"{}"!==JSON.stringify(i.last_message)?a.lastMessage=Se.call(this,i.last_message):"{}"===JSON.stringify(i.last_message)&&(a.lastMessage={}),null===(r=this.eventHandler)||void 0===r||r.dispatch("onChatThreadChange",a);break;case"update":a.operation="update",a.messageCount=i.message_count,null===(n=this.eventHandler)||void 0===n||n.dispatch("onChatThreadChange",a);break;case"delete":a.operation="destroy",null===(o=this.eventHandler)||void 0===o||o.dispatch("onChatThreadChange",a)}}}function _t(e){var t,r=e.data;if(r.resource!==this.clientResource){var n={operation:"deleteRoaming",conversationId:r.to,chatType:"chat"===r.chatType?"singleChat":"groupChat",resource:r.resource};null===(t=this.eventHandler)||void 0===t||t.dispatch("onMultiDeviceEvent",n)}}function Tt(e){var t,r,n=e.data,o="";if(this.clientResource!==n.res||n.from!==this.user){switch(n.op){case"del":o="deleteConversation";break;case"top":o="pinnedConversation";break;case"not_top":o="unpinnedConversation";break;case"mark":o="markConversation";break;case"mark_delete":o="unMarkConversation";break;case"pin":o="pin";break;case"pin_delete":o="unpin";break;default:return void B.error("unexpected conversation op:",n.op)}if("pin"!==o&&"unpin"!==o){var i={operation:o,conversationId:n.id,conversationType:"chat"===n.type?"singleChat":"groupChat",timestamp:n.ts};"markConversation"!==i.operation&&"unMarkConversation"!==i.operation||n.ext&&(i.conversationMark=ht[n.ext]),null===(r=this.eventHandler)||void 0===r||r.dispatch("onMultiDeviceEvent",i)}else{var a=n.ext,s=n.from,c=n.id,u=n.type,l=n.ts,d={messageId:a||"",conversationId:"chat"===u?s:c,conversationType:Re[u],operation:o,operatorId:s,time:l};null===(t=this.eventHandler)||void 0===t||t.dispatch("onMessagePinEvent",d)}}}function It(e){var t,r=this;null===(t=e.values)||void 0===t||t.forEach((function(e){var t,n,o,i,a;if(e.operator_resource!==r.clientResource)if("ignoreInterval"in e.data){var s={operation:"setSilentModeForUser",resource:e.operator_resource,data:e.data};null===(t=r.eventHandler)||void 0===t||t.dispatch("onMultiDeviceEvent",s)}else"group"in e?(s={operation:0===Object.keys(null!==(n=e.data)&&void 0!==n?n:{}).length?"removeSilentModeForConversation":"setSilentModeForConversation",resource:e.operator_resource,conversationId:e.group,type:"groupChat",data:e.data},null===(o=r.eventHandler)||void 0===o||o.dispatch("onMultiDeviceEvent",s)):(s={operation:0===Object.keys(null!==(i=e.data)&&void 0!==i?i:{}).length?"removeSilentModeForConversation":"setSilentModeForConversation",resource:e.operator_resource,conversationId:e.user,type:"singleChat",data:e.data},null===(a=r.eventHandler)||void 0===a||a.dispatch("onMultiDeviceEvent",s))}))}__webpack_require__(5506),function(e){e[e.mark_0=0]="mark_0",e[e.mark_1=1]="mark_1",e[e.mark_2=2]="mark_2",e[e.mark_3=3]="mark_3",e[e.mark_4=4]="mark_4",e[e.mark_5=5]="mark_5",e[e.mark_6=6]="mark_6",e[e.mark_7=7]="mark_7",e[e.mark_8=8]="mark_8",e[e.mark_9=9]="mark_9",e[e.mark_10=10]="mark_10",e[e.mark_11=11]="mark_11",e[e.mark_12=12]="mark_12",e[e.mark_13=13]="mark_13",e[e.mark_14=14]="mark_14",e[e.mark_15=15]="mark_15",e[e.mark_16=16]="mark_16",e[e.mark_17=17]="mark_17",e[e.mark_18=18]="mark_18",e[e.mark_19=19]="mark_19"}(ht||(ht={}));var Ot=function(e){var t=ye.parseNotify(e.payload);switch(t.type){case"presence":gt.call(this,t);break;case"reaction":yt.call(this,t);break;case"thread":Et.call(this,t);break;case"roaming_delete":_t.call(this,t);break;case"conv":Tt.call(this,t);break;case"user_notification_mute":It.call(this,t);break;default:B.error("unexpected notify type: ".concat(t.type))}};function Rt(){var e=this.context.appName,t=this.context.orgName;return!(!e||!t)||(this.onError&&this.onError({type:s.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function St(){var e,t=this.context.accessToken;if(!t){var r=p.create({type:s.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return B.debug("token not assign error",t),this.onError&&this.onError(r),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",r),!1}return!0}function bt(){if(this._initWithAppId){if(!Rt.call(this))return{error:p.create({type:s.WEBIM_CONNECTION_CLOSED,message:"not login"})};if(!St.call(this))return{error:p.create({type:s.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}}else if(!Rt.call(this)||!St.call(this))return{error:p.create({type:s.REST_PARAMS_STATUS,message:"appkey or token error"})};return{}}function Ct(e){var t=e.data,r=e.type;return{data:{status:Object.keys(t.errorKeys).length>0?"fail":"success",errorKeys:t.errorKeys,successKeys:t.successKeys},type:r}}function Nt(e){var t=e.data,r=void 0;return Object.keys(t.errorKeys).length>0&&Object.keys(t.errorKeys).forEach((function(e){var n=t.errorKeys[e];r=n.includes("is not part of you")?p.create({type:s.NO_PERMISSION,message:n}):n.includes("size of metadata for this single chatroom exceeds the user defined limit")||n.includes("total size of chatroom metadata for this app exceeds the user defined limit")||n.includes("is exceeding maximum limit")?p.create({type:s.MAX_LIMIT,message:n}):n.includes("is not Legal")?p.create({type:s.REQUEST_PARAMETER_ERROR,message:n}):n.includes("Failed to update userMetadata. Concurrent updates not allowed")?p.create({type:s.OPERATION_NOT_ALLOWED,message:n}):p.create({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:n})})),r}function At(e){if("string"!=typeof e.deviceId||""===e.deviceId)throw Error('Invalid parameter: "deviceId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(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};B.debug("Call uploadPushTokenToServer",e);var s=oe.bind(this,a,f.UPLOAD_PUSH_TOKEN);return ye.retryPromise(s).then((function(e){var t=e.entities[0]||{};return{type:e.type,data:t}}))}var Mt,wt,Ut=__webpack_require__(9638),Lt=__webpack_require__.n(Ut),Pt=__webpack_require__(2566),xt=__webpack_require__.n(Pt),kt=268435455;function Dt(e){var t=e;return xt().buf(t)>>>0}!function(e){e[e.COMPRESS_NONE=0]="COMPRESS_NONE",e[e.COMPRESS_ZLIB=1]="COMPRESS_ZLIB",e[e.COMPRESS_LZ4=2]="COMPRESS_LZ4"}(Mt||(Mt={})),function(e){e[e.NONE=-1]="NONE",e[e.UPLINK_ONLY=0]="UPLINK_ONLY",e[e.DOWNLINK_ONLY=1]="DOWNLINK_ONLY",e[e.BIDIRECTIONAL=2]="BIDIRECTIONAL"}(wt||(wt={}));var Bt=268435455,jt=function(){function e(){this.mode=wt.NONE,this.enableUplinkCompression=!1,this.enableDownlinkCompression=!1;var e={minWorkArea:Lt().DEFAULT_WORK_AREA,maxWorkArea:Lt().DEFAULT_MAX_WORK,shrinkMode:Lt().SHRINK_MODE.MANUAL};this.encoder=new(Lt().RingBufferEncoder)(e),this.decoder=new(Lt().RingBufferDecoder)(e)}return e.prototype.compress=function(e){var t=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!t||0===t.length)return new Uint8Array(0);if(t.length>Bt)throw new Error("Data size exceeds maximum allowed: ".concat(t.length));var r=Lt().compressBound(t.length),n=new Uint8Array(r),o=this.encoder.compress(t,n);if(o<0)throw new Error("LZ4 compression failed with error code: ".concat(o));var i=n.subarray(0,o),a=function(e){if(e<0)throw new Error("encodeLength: Length must be non-negative");if(e>kt)throw new Error("encodeLength: Length exceeds maximum: ".concat(kt));if(0===e)return new Uint8Array([0]);for(var t=[],r=e;r>0;){var n=127&r;(r>>>=7)>0&&(n|=128),t.push(n)}return new Uint8Array(t)}(t.length),s=Dt(t),c=new Uint8Array(a.length+4+o),u=0;return c.set(a,u),u+=a.length,new DataView(c.buffer).setUint32(u,s,!1),u+=4,c.set(i,u),c},e.prototype.decompress=function(e){var t=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!t||0===t.length)return new Uint8Array(0);if(t.length<5)throw new Error("Compressed data is too short: must contain at least length and CRC32");var r={offset:0},n=function(e,t){if(t.offset>=e.length)throw new Error("decodeLength: No data to decode: offset beyond data length");for(var r=0,n=0;t.offset<e.length;){var o=e[t.offset];if(t.offset++,r|=(127&o)<<n,!(128&o))return r>>>0;if((n+=7)>=28)throw new Error("decodeLength: Invalid length encoding: exceeds 4 bytes")}throw new Error("decodeLength: Incomplete length encoding: missing terminator byte")}(t,r);if(n>Bt)throw new Error("Original size exceeds maximum allowed: ".concat(n));if(t.length<r.offset+4)throw new Error("Compressed data is too short: missing CRC32 checksum");var o=new DataView(t.buffer,t.byteOffset+r.offset,4).getUint32(0,!1);r.offset+=4;var i=t.subarray(r.offset),a=new Uint8Array(n),s=this.decoder.decompress(i,a,n);if(s<0||s!==n)throw new Error("LZ4 decompression failed: expected ".concat(n,", got ").concat(s));var c=Dt(a);if(c!==o)throw new Error("CRC32 checksum mismatch: expected ".concat(o,", got ").concat(c));return a},e.prototype.resetEncoder=function(){this.encoder.reset()},e.prototype.resetDecoder=function(){this.decoder.reset()},e.prototype.reset=function(){this.resetEncoder(),this.resetDecoder()},e.prototype.shrinkEncoder=function(){this.encoder.shrink()},e.prototype.shrinkDecoder=function(){this.decoder.shrink()},e.prototype.shrink=function(){this.shrinkEncoder(),this.shrinkDecoder()},e}();function Gt(e){switch(e){case wt.UPLINK_ONLY:return{mode:wt.UPLINK_ONLY,enableUplinkCompression:!0,enableDownlinkCompression:!1};case wt.DOWNLINK_ONLY:return{mode:wt.DOWNLINK_ONLY,enableUplinkCompression:!1,enableDownlinkCompression:!0};case wt.BIDIRECTIONAL:return{mode:wt.BIDIRECTIONAL,enableUplinkCompression:!0,enableDownlinkCompression:!0};case wt.NONE:default:return{mode:wt.NONE,enableUplinkCompression:!1,enableDownlinkCompression:!1}}}function Ht(e,t){var r=Gt(t),n=r.mode,o=r.enableUplinkCompression,i=r.enableDownlinkCompression;e.reset(),e.mode=n,e.enableUplinkCompression=o,e.enableDownlinkCompression=i}function Ft(e,t,r){for(var n=[],o=Math.max(e.length,t.length),i=0,a=0;a<o||i;){var s=i+(a<e.length?e[a]:0)+(a<t.length?t[a]:0);n.push(s%r),i=Math.floor(s/r),a++}return n}function qt(e,t,r){if(e<0)return null;if(0==e)return[];for(var n=[],o=t;1&e&&(n=Ft(n,o,r)),0!=(e>>=1);)o=Ft(o,o,r);return n}__webpack_require__(8940);var Wt=function(){function e(e){e=e||{},this.seq=0,this.mid=(e.mid||1)%1023,this.timeOffset=e.timeOffset||0,this.lastTime=0}return e.prototype.gen=function(){var e=Date.now();if(this.lastTime==e){if(this.seq++,this.seq>4095){for(this.seq=0;Date.now()<=e;);e=Date.now()}}else this.seq=0;this.lastTime=e;for(var t=(e-this.timeOffset).toString(2),r=this.seq.toString(2),n=this.mid.toString(2);r.length<12;)r="0"+r;for(;n.length<10;)n="0"+n;for(var o,i=t+n+r,a="",s=i.length;s>0;s-=4)a=parseInt(i.substring(s-4,s),2).toString(16)+a;return"0x"===(o=a).substring(0,2)&&(o=o.substring(2)),function(e,t,r){var n=function(e,t){for(var r=e.split(""),n=[],o=r.length-1;o>=0;o--){var i=parseInt(r[o],t);if(isNaN(i))return null;n.push(i)}return n}(e,t);if(null===n)return null;for(var o=[],i=[1],a=0;a<n.length;a++)n[a]&&(o=Ft(o,qt(n[a],i,r),r)),i=qt(t,i,r);var s="";for(a=o.length-1;a>=0;a--)s+=o[a].toString(r);return s}(o=o.toLowerCase(),16,10)},e}(),zt=function(){return zt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},zt.apply(this,arguments)};function Kt(e){try{var t=this._compressor;return t&&t.enableDownlinkCompression&&"string"!=typeof e.data?[zt(zt({},e),{data:t.decompress(e.data)}),!0]:[e,!0]}catch(t){return this._compressorFailureCount++,B.error("decompress message error",t),B.error("decompress failure times:",this._compressorFailureCount),this.sock.close(),[e,!1]}}function Vt(e){try{var t=this._compressor;return t&&t.enableUplinkCompression?[t.compress(e),!0]:[e,!0]}catch(t){return this._compressorFailureCount++,B.error("compress message error",t),B.error("compress failure times:",this._compressorFailureCount),this.sock.close(),[e,!1]}}function Jt(e,t,r){var n=Math.min(e,t);if(n<=r)return{width:e,height:t};var o=r/n;return{width:Math.round(e*o),height:Math.round(t*o)}}function Yt(e,t){return e+t|0}function Xt(e){for(var t="",r=0;r<4;r++)t+="0".concat((e>>>8*r&255).toString(16)).slice(-2);return t}function Qt(e){var t=new Uint8Array(e),r=t.length,n=64*((r+8>>>6)+1),o=new Uint8Array(n);o.set(t),o[r]=128;for(var i=8*r,a=i>>>0,s=Math.floor(i/4294967296)>>>0,c=0;c<4;c++)o[n-8+c]=a>>>8*c&255,o[n-4+c]=s>>>8*c&255;var u=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],l=new Array(64);for(c=0;c<64;c++)l[c]=Math.floor(4294967296*Math.abs(Math.sin(c+1)));for(var d,p,h=1732584193,f=4023233417,m=2562383102,v=271733878,g=new Array(16),y=0;y<n;y+=64){for(c=0;c<16;c++){var E=y+4*c;g[c]=o[E]|o[E+1]<<8|o[E+2]<<16|o[E+3]<<24}var _=h,T=f,I=m,O=v;for(c=0;c<64;c++){var R=0,S=0;c<16?(R=T&I|~T&O,S=c):c<32?(R=O&T|~O&I,S=(5*c+1)%16):c<48?(R=T^I^O,S=(3*c+5)%16):(R=I^(T|~O),S=7*c%16);var b=I,C=T,N=(d=Yt(Yt(_,R),Yt(l[c],g[S])))<<(p=u[c])|d>>>32-p;T=Yt(T,N),_=O,I=C,O=b}h=Yt(h,_),f=Yt(f,T),m=Yt(m,I),v=Yt(v,O)}return"".concat(Xt(h)).concat(Xt(f)).concat(Xt(m)).concat(Xt(v))}var $t=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},Zt=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},er=1048576;function tr(e){return new Promise((function(t,r){if("undefined"!=typeof FileReader){var n=new FileReader;n.onload=function(){return t(n.result)},n.onerror=function(){return r(n.error||new Error("Failed to read file"))},n.readAsArrayBuffer(e)}else r(new Error("FileReader is not available"))}))}function rr(e,t,r){return"img"===t?e>("original"===r?204800:er):e>er}function nr(e){return $t(this,void 0,void 0,(function(){return Zt(this,(function(t){switch(t.label){case 0:return[4,tr(e)];case 1:return[2,Qt(t.sent())]}}))}))}function or(e){return"original"===e?"origin":"large"}function ir(e,t,r,n){var o,i;return $t(this,void 0,void 0,(function(){var a,s,c,u,l,d,p,h,m,v,g,y,E,_;return Zt(this,(function(T){switch(T.label){case 0:a=e.context,s=a.orgName,c=a.appName,u=a.accessToken,l="".concat(e.apiUrl,"/").concat(s,"/").concat(c,"/chatfiles/exists?md5=").concat(t),"img"===r&&n&&(l+="&imageType=".concat(or(n))),T.label=1;case 1:return T.trys.push([1,3,,4]),[4,oe.call(e,{url:l,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u}},f.SDK_INTERNAL)];case 2:return d=T.sent(),(p=null===(o=null==d?void 0:d.entities)||void 0===o?void 0:o[0])?(h=!0===p.exists,m=p.uuid||"",v=p["share-secret"]||"",I=null!==(i=p["exists-type"])&&void 0!==i?i:p.existsType,g="origin"===I||"original"===I?"original":"large"===I?"large":void 0,y=h&&!!m,E=n,"img"===r&&y&&("original"===g?E="original":"large"===g&&("original"===n?y=!1:E="large")),B.debug("precheck result","exists: ".concat(h),"uuid: ".concat(m),"existsType: ".concat(g||""),"effectiveImageType: ".concat(E||""),"hit: ".concat(y)),[2,{exists:h,uuid:m,shareSecret:v,existsType:g,effectiveImageType:E,hit:y}]):[2,{exists:!1,hit:!1}];case 3:return _=T.sent(),B.warn("precheck failed, proceeding with upload",_),[2,{exists:!1,hit:!1}];case 4:return[2]}var I}))}))}function ar(e){return ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ar(e)}var sr,cr,ur,lr,dr=function(){return dr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},dr.apply(this,arguments)},pr=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},hr=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},fr=new Wt;!function(e){e[e.NORMAL=0]="NORMAL",e[e.SINGLECHAT=1]="SINGLECHAT",e[e.GROUPCHAT=2]="GROUPCHAT",e[e.CHATROOM=3]="CHATROOM",e[e.READ_ACK=4]="READ_ACK",e[e.DELIVER_ACK=5]="DELIVER_ACK",e[e.RECALL=6]="RECALL",e[e.CHANNEL_ACK=7]="CHANNEL_ACK",e[e.EDIT=8]="EDIT"}(sr||(sr={})),function(e){e[e.BODY=1]="BODY",e[e.BODY_AND_EXT=2]="BODY_AND_EXT"}(cr||(cr={})),function(e){e[e.APNs=0]="APNs",e[e.FCM=1]="FCM",e[e.HMSPUSH=2]="HMSPUSH",e[e.MIPUSH=3]="MIPUSH",e[e.MEIZUPUSH=4]="MEIZUPUSH",e[e.VIVOPUSH=5]="VIVOPUSH",e[e.OPPOPUSH=6]="OPPOPUSH",e[e.HONORPUSH=7]="HONORPUSH"}(ur||(ur={})),function(e){e[e.OK=0]="OK",e[e.FAIL=1]="FAIL",e[e.UNAUTHORIZED=2]="UNAUTHORIZED",e[e.MISSING_PARAMETER=3]="MISSING_PARAMETER",e[e.WRONG_PARAMETER=4]="WRONG_PARAMETER",e[e.REDIRECT=5]="REDIRECT",e[e.TOKEN_EXPIRED=6]="TOKEN_EXPIRED",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.NO_ROUTE=8]="NO_ROUTE",e[e.UNKNOWN_COMMAND=9]="UNKNOWN_COMMAND",e[e.PB_PARSER_ERROR=10]="PB_PARSER_ERROR",e[e.BIND_ANOTHER_DEVICE=11]="BIND_ANOTHER_DEVICE",e[e.IM_FORBIDDEN=12]="IM_FORBIDDEN",e[e.TOO_MANY_DEVICES=13]="TOO_MANY_DEVICES",e[e.PLATFORM_LIMIT=14]="PLATFORM_LIMIT",e[e.USER_MUTED=15]="USER_MUTED",e[e.ENCRYPT_DISABLE=16]="ENCRYPT_DISABLE",e[e.ENCRYPT_ENABLE=17]="ENCRYPT_ENABLE",e[e.DECRYPT_FAILURE=18]="DECRYPT_FAILURE",e[e.PERMISSION_DENIED_EXTERNAL=19]="PERMISSION_DENIED_EXTERNAL",e[e.RESOURCE_CHANGED=20]="RESOURCE_CHANGED"}(lr||(lr={}));var mr=["txt","img","video","audio","file","loc","custom","cmd","combine"],vr=ye.getEnvInfo();function gr(){var e="webim",t="",r="",n=(new Date).valueOf(),o=ye.getDevicePlatform(vr);if(this.isFixedDeviceId){var i=ye.getLocalDeviceInfo();if(i){var a=JSON.parse(i);e=a.deviceId,t=a.deviceName,r=a.deviceUuid,void 0!==this.customOSPlatform&&(t=this.deviceId,e="custom".concat(this.customOSPlatform,"_").concat(r))}else"webim"===this.deviceId?(r="".concat(o,"_").concat(n.toString()),e="".concat(this.deviceId,"_").concat(r),t=this.deviceId,void 0!==this.customOSPlatform&&(e="custom".concat(this.customOSPlatform,"_").concat(r))):(e=t=r="webim_".concat(o,"_").concat(this.deviceId),void 0!==this.customOSPlatform&&(r="".concat(o,"_").concat(n.toString()),t=this.deviceId,e="custom".concat(this.customOSPlatform,"_").concat(r))),ye.setLocalDeviceInfo(JSON.stringify({deviceId:e,deviceName:t,deviceUuid:r}))}else"webim"===this.deviceId?(r="random_".concat(o,"_").concat(n.toString()),e="".concat(this.deviceId,"_").concat(r),t=this.deviceId):e=t=r="webim_".concat(o,"_").concat(this.deviceId),void 0!==this.customOSPlatform&&(r="random_".concat(o,"_").concat(n.toString()),t=this.deviceId,e="custom".concat(this.customOSPlatform,"_").concat(r));return{deviceId:e,deviceName:t,deviceUuid:r,devicePlatform:o}}function yr(){var e,t,r,n,o=gr.call(this),i=o.deviceId,a=o.deviceName,s=o.deviceUuid,c=o.devicePlatform,u=[];this.context.jid&&(this.context.jid.clientResource=i),this._compressor&&Ht(this._compressor,wt.NONE);var l=this.root.lookup("easemob.pb.Provision"),d=c===ce.UNI,p=!this.logOut,h=l.decode(u);if(void 0!==this.customOSPlatform&&(h.osCustomValue=this.customOSPlatform,this.osType=5),h.compressType=this.compressType,h.encryptType=this.encryptType,h.osType=this.osType,h.version=this.version,h.deviceName=a,h.resource=i,h.deviceUuid=s,h.authToken='{"token":"$t$'+this.token+'"}',h.sessionId=Date.now().toString()+":",d){var f=!this.isAutoLogin;p&&(f=!1),B.debug("isManualLogin",f),h.isManualLogin=f}var m=this._compressorFailureCount>=1?[]:[Mt.COMPRESS_LZ4];h.protocolCompressType=m,this.sessionId=h.sessionId,this.loginInfoCustomExt&&(h.reason=this.loginInfoCustomExt),B.info("provision info",{version:this.version,resource:i,isFixedDeviceId:this.isFixedDeviceId,loginInfoCustomExt:!!this.loginInfoCustomExt,token:(null===(t=null===(e=this.token)||void 0===e?void 0:e.slice)||void 0===t?void 0:t.call(e,0,10))+"...",userId:null===(n=null===(r=this.context)||void 0===r?void 0:r.jid)||void 0===n?void 0:n.name}),h.actionVersion="v5.2",h=l.encode(h).finish();var v=this.root.lookup("easemob.pb.MSync"),g=v.decode(u);return g.version=this.version,g.guid=this.context.jid,g.auth="$t$"+this.token,g.command=3,g.deviceId=a,g.serviceId=this.dataReport.getServiceId(),g.encryptType=this.encryptType,g.payload=h,g.traceId=fr.gen(),v.encode(g).finish()}function Er(e){var t=[],r=this.root.lookup("easemob.pb.Logout"),n=r.decode(t);n.sessionId=this.sessionId,n.reason=e,n=r.encode(n).finish();var o=this.root.lookup("easemob.pb.MSync"),i=o.decode(t);return i.version=this.version,i.guid=this.context.jid,i.auth="$t$"+this.token,i.command=4,i.deviceId=this.deviceId||"webim",i.serviceId=this.dataReport.getServiceId(),i.encryptType=this.encryptType,i.payload=n,i.traceId=fr.gen(),B.debug("traceId",i.traceId),o.encode(i).finish()}function _r(e,t){var r=this,n=ye.getEnvInfo();if("zfb"===n.platform||"dd"===n.platform){for(var o="",i=0;i<e.length;i++)o+=String.fromCharCode(e[i]);return{data:o=Ie().btoa(o),isBuffer:!1,complete:function(){},fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||(B.error("send message fail and reconnect"),r.reconnecting||r.reconnect()),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}var a=e;return{data:a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength),fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||r.reconnecting||r.reconnect(),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}function Tr(e,t){var r;return pr(this,void 0,void 0,(function(){var n,o,i,a,s;return hr(this,(function(c){switch(c.label){case 0:for(B.debug("metas length: ",e.length),n=[],o=0;o<e.length;o++)switch(i=e[o],new(d())(i.id.low,i.id.high,i.id.unsigned).toString(),i.ns){case 0:vt.call(this,i);break;case 1:n.push(ct.call(this,i,t,!1,!0,!0));break;case 2:ft.call(this,i);break;case 3:mt.handleRosterMsg.call(this,i);break;case 4:this.registerConfrIQHandler&&this.registerConfrIQHandler(i,t,this);break;case 5:Ot.call(this,i);break;default:B.error("distributeMeta",i)}return[4,Promise.all(n)];case 1:return a=c.sent(),(s=a.filter((function(e){return e&&"cmd"!==e.type}))).length>0&&(null===(r=this.eventHandler)||void 0===r||r.dispatch("onMessage",s)),[2]}}))}))}function Ir(e,t){Tr.call(this,e,t)}function Or(e){var t,r=this;zr.clear(),this._offlineMessagePullState===ve.SYNC_INIT&&(this._offlineMessagePullState=ve.SYNC_START,this._offlineMessagePullQueue=e.unread.reduce((function(e,t,n){return e.find((function(e){return e.name===t.queue.name}))||e.push(t),r.pullOfflineMessageInfo.pullCount+=t.n,e}),[]),this.pullOfflineMessageInfo.startTime=Date.now(),this._offlineMessageRpt=this.dataReport.geOperateFun({operationName:f.MSYNC_SYNCOFFLINEMESSAGE}),null===(t=this.eventHandler)||void 0===t||t.dispatch("onOfflineMessageSyncStart"))}function Rr(e){var t;if(this._offlineMessagePullState===ve.SYNC_START){var r=this._offlineMessagePullQueue.findIndex((function(t){return t.queue.name===e.queue.name}));if(r>-1){this._offlineMessagePullQueue.splice(r,1);var n=zr.get(e.queue.name)||0;n>0&&this._offlineMessageRpt({isEndApi:!1,data:{isSuccess:1,requestName:f.MSYNC_SYNCOFFLINEMESSAGE,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.success,resultCount:n,requestElapse:Date.now()-this.pullOfflineMessageInfo.startTime}})}0===this._offlineMessagePullQueue.length&&(this._offlineMessagePullState=ve.SYNC_FINISH,null===(t=this.eventHandler)||void 0===t||t.dispatch("onOfflineMessageSyncFinish"),this._offlineMessageRpt({data:{isLastApi:1,isSuccess:1,requestName:f.MSYNC_SYNCOFFLINEMESSAGE,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.success,resultCount:this.pullOfflineMessageInfo.pullCount}}),zr.clear())}}function Sr(e){var t=this.root.lookup("easemob.pb.CommUnreadDL");t=t.decode(e.payload);var r=new(d())(t.timestamp.low,t.timestamp.high,t.timestamp.unsigned).toString();if(this.expirationTime&&this.compareTokenExpireTime(Number(r),this.expirationTime),0===t.unread.length)kr.call(this);else{Or.call(this,t),B.debug("pull unread message",t.unread);for(var n=0;n<t.unread.length;n++)Nr.call(this,t.unread[n].queue)}kr.call(this)}function br(){var e=[],t=this.root.lookup("easemob.pb.StatisticsBody"),r=t.decode(e);r.operation=0,r=t.encode(r).finish();var n=this.root.lookup("easemob.pb.Meta").decode(e);n.id=(new Date).valueOf(),n.ns=0,n.payload=r;var o=this.root.lookup("easemob.pb.CommSyncUL"),i=o.decode(e);i.meta=n,i=o.encode(i).finish();var a=this.root.lookup("easemob.pb.MSync"),s=a.decode(e);return s.version=this.version,s.encryptType=[0],s.command=0,s.payload=i,s.traceId=fr.gen(),B.debug("traceId",s.traceId),a.encode(s).finish()}function Cr(e){var t=[],r=this.root.lookup("easemob.pb.CommSyncUL"),n=r.decode(t);n.queue=e,n=r.encode(n).finish();var o=this.root.lookup("easemob.pb.MSync"),i=o.decode(t);return i.version=this.version,i.encryptType=this.encryptType,i.command=0,i.payload=n,i.traceId=fr.gen(),B.debug("traceId",i.traceId),o.encode(i).finish()}function Nr(e){B.debug("sendBackqueue",e);var t=Cr.call(this,e);tn.call(this,t)}function Ar(e,t){var r=[],n=this.root.lookup("easemob.pb.CommSyncUL"),o=n.decode(r);o.queue=t,o.key=new(d())(e.low,e.high,e.unsigned).toString(),o=n.encode(o).finish();var i=this.root.lookup("easemob.pb.MSync"),a=i.decode(r);return a.version=this.version,a.encryptType=this.encryptType,a.command=0,a.payload=o,a.traceId=fr.gen(),B.debug("traceId",a.traceId),i.encode(a).finish()}function Mr(){var e=this;this.uniPush&&!1===this.isRegisterPush&&(this.isRegisterPush=!0,this.uniPush.onRegister((function(t){B.debug("push token onRegister");var r=e.uniPushConfig||{},n=r.APNsCertificateName,o=void 0===n?"":n,i=r.HMSCertificateName,a=void 0===i?"":i,s=r.HONORCertificateName,c=void 0===s?"":s,u=r.MEIZUCertificateName,l=void 0===u?"":u,d=r.MICertificateName,p=void 0===d?"":d,h=r.OPPOCertificateName,f=void 0===h?"":h,m=r.VIVOCertificateName,v=void 0===m?"":m,g=r.FCMCertificateName,y=void 0===g?"":g;switch(t.push_type){case ur.APNs:e.pushCertificateName=o;break;case ur.FCM:e.pushCertificateName=y;break;case ur.HMSPUSH:e.pushCertificateName=a;break;case ur.HONORPUSH:e.pushCertificateName=c;break;case ur.MEIZUPUSH:e.pushCertificateName=l;break;case ur.MIPUSH:e.pushCertificateName=p;break;case ur.OPPOPUSH:e.pushCertificateName=f;break;case ur.VIVOPUSH:e.pushCertificateName=v;break;default:B.error("unexpected push type",t.push_type)}e.pushCertificateName&&t.push_token&&At.call(e,{deviceId:e.clientResource,deviceToken:t.push_token,notifierName:e.pushCertificateName}).then((function(){B.debug("uploadPushToken success")})).catch((function(e){B.debug("uploadPushToken failed",e)}))})))}function wr(){var e;this._offlineMessagePullState=ve.SYNC_INIT,this._offlineMessagePullQueue=[],this.times=1,this.autoReconnectNumTotal=0,this.onOpened&&this.onOpened(),Mr.call(this),null===(e=this.eventHandler)||void 0===e||e.dispatch("onConnected"),xr.call(this),Br.call(this),Dr.call(this),kr.call(this),this.pullOfflineMessageInfo={pullCount:0,startTime:0}}function Ur(e,t){B.debug("sendLastSession",e);var r=Ar.call(this,e,t);tn.call(this,r)}function Lr(e){var t,r,n,o,i,a,c,u,l,d,h,f,m,v,g,y,E,_,T=this,I=this.root.lookup("easemob.pb.Provision").decode(e.payload);if(this.context.jid&&(this.context.jid.clientResource=I.resource),this.clientResource=I.resource,this.provisionTimer&&clearTimeout(this.provisionTimer),B.debug("provision status",I.status),this._isLogging=!1,I.status.errorCode===lr.OK){if(this.disconnectedReason=void 0,I.authToken){var O=JSON.parse(I.authToken).expires_in;if(!this.tokenExpiredTimer&&!this.tokenWillExpireTimer){var R=Date.now();this.expirationTime=O;var S=this.expirationTime-R;this.expiresIn=S<0?0:S,this.tokenExpireTimeCountDown(this.expiresIn)}}var b=I.protocolCompressType,C=I.protocolCompressDirection;if(B.debug("protocol compress types",b),B.debug("protocol compress direction",C),b.length>0&&b[0]===Mt.COMPRESS_LZ4){var N=null!=C?C:wt.NONE;this._compressor?Ht(this._compressor,N):this._compressor=function(e){var t=Gt(e),r=t.mode,n=t.enableUplinkCompression,o=t.enableDownlinkCompression;if(r===wt.NONE)return null;var i=new jt;return i.mode=r,i.enableUplinkCompression=n,i.enableDownlinkCompression=o,i}(N)}this.reconnecting=!1,this.logOut=!1,this.needSetReadyState&&(this.sock=dr(dr({},this.sock),{close:this.sock.close,send:this.sock.send,readyState:1})),this._localCache?(null===(t=this._localCache)||void 0===t?void 0:t.getInstance())?wr.call(this):this._localCache&&new this._localCache({user:this.user,dbName:"cache_".concat(Math.abs(Ne(this.appKey||this.appId)),"_").concat(this.user),version:2,onInit:function(){return pr(T,void 0,void 0,(function(){return hr(this,(function(e){return B.debug("localCache init success"),wr.call(this),[2]}))}))}}):wr.call(this),null===(r=this.connectionResolve)||void 0===r||r.call(this)}else{var A=void 0,M=I.status,w=M.reason,U=M.errorCode;switch(B.error("provision errorCode: ",U),B.error("provision reason: ",w),U){case lr.FAIL:A="Sorry, user register limit"===w?p.create({type:s.MAX_LIMIT,message:"Sorry, the number of user registrations limit has been reached"}):"Sorry, user register rate limit"===w?p.create({type:s.MAX_LIMIT,message:"Sorry, user register rate limit"}):"Sorry, token expired"===w?p.create({type:s.WEBIM_TOKEN_EXPIRED,message:"Sorry, token expired"}):"Sorry, token or password does not match login info"===w?p.create({type:s.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"INVALID_TOKEN"}):"Sorry, user not found"===w?p.create({type:s.USER_NOT_FOUND,message:"User not found"}):p.create({type:s.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(n=this.connectionReject)||void 0===n||n.call(this,A),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",A);break;case lr.WRONG_PARAMETER:A=p.create({type:s.REQUEST_PARAMETER_ERROR,message:"Invalid parameter"}),null===(i=this.connectionReject)||void 0===i||i.call(this,A),null===(a=this.eventHandler)||void 0===a||a.dispatch("onError",A);break;case lr.UNAUTHORIZED:A=p.create({type:s.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(c=this.connectionReject)||void 0===c||c.call(this,A),null===(u=this.eventHandler)||void 0===u||u.dispatch("onError",A);break;case lr.IM_FORBIDDEN:A=p.create({type:s.WEBIM_SERVER_SERVING_DISABLED,message:"Server serving disabled."}),null===(l=this.connectionReject)||void 0===l||l.call(this,A),null===(d=this.eventHandler)||void 0===d||d.dispatch("onError",A);break;case lr.PERMISSION_DENIED:A="Sorry, the app month live count limit"===w?p.create({type:s.MAX_LIMIT,message:"Sorry, the monthly active user limit for this app has been reached"}):"Sorry, the app day live count limit"===w?p.create({type:s.MAX_LIMIT,message:"Sorry, the daily active user limit for this app has been reached"}):"Sorry, the app online count limit"===w?p.create({type:s.MAX_LIMIT,message:"Sorry, the maximum number limit of online users for this app has been reached"}):p.create({type:s.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(h=this.connectionReject)||void 0===h||h.call(this,A),null===(f=this.eventHandler)||void 0===f||f.dispatch("onError",A);break;case lr.TOO_MANY_DEVICES:A=p.create({type:s.USER_LOGIN_TOO_MANY_DEVICES,message:"the number of devices the user is logged in to exceeds the limit"}),null===(m=this.connectionReject)||void 0===m||m.call(this,A),null===(v=this.eventHandler)||void 0===v||v.dispatch("onError",A);break;case lr.RESOURCE_CHANGED:A=p.create({type:s.USER_DEVICE_CHANGED,message:"user device is changed"}),null===(g=this.connectionReject)||void 0===g||g.call(this,A),null===(y=this.eventHandler)||void 0===y||y.dispatch("onError",A);break;default:A=p.create({type:s.WEBIM_CONNCTION_AUTH_ERROR,message:w}),null===(E=this.connectionReject)||void 0===E||E.call(this,A),null===(_=this.eventHandler)||void 0===_||_.dispatch("onError",A)}this.disconnectedReason=A}}function Pr(e){var t=this.root.lookup("easemob.pb.Logout").decode(e.payload);B.debug("receiveLogoutResult",t)}function xr(){var e,t;if((null===(e=this.unMSyncSendMsgMap)||void 0===e?void 0:e.size)>0){for(var r=Array.from(this.unMSyncSendMsgMap.keys()),n=0;n<r.length;n++){var o=this.unMSyncSendMsgMap.get(r[n]);tn.call(this,o,r[n])}null===(t=this.unMSyncSendMsgMap)||void 0===t||t.clear()}}function kr(){var e=br.call(this);tn.call(this,e)}function Dr(){B.debug("sendUnreadDeal");var e=Gr.call(this);tn.call(this,e)}function Br(){var e=this;jr.call(this),this.heartBeatID=setInterval((function(){(Date.now()-e.lastHeartbeat)/1e3>=30&&(B.debug("send heart beat"),Dr.call(e),e.lastHeartbeat=Date.now())}),this.heartBeatWait)}function jr(){clearInterval(this.heartBeatID)}function Gr(){var e=this.root.lookup("easemob.pb.MSync"),t=e.decode([]);return t.version=this.version,t.encryptType=this.encryptType,t.command=1,t.traceId=fr.gen(),B.debug("traceId",t.traceId),e.encode(t).finish()}function Hr(e,t){return e.some((function(e){return e.name===t.name}))}function Fr(e){var t=this.root.lookup("easemob.pb.CommNotice").decode(e.payload),r=Hr(this._queues,t.queue);B.debug("receive notice",t.queue,r),r||this.clientResource===t.queue.clientResource&&t.queue.name===this.context.userId||(this._queues.push(t.queue),1===this._queues.length&&Nr.call(this,t.queue))}function qr(e){return pr(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u;return hr(this,(function(l){t=ye.getEnvInfo(),r=this.root.lookup("easemob.pb.MSync"),n=e,"zfb"!==t.platform&&"dd"!==t.platform||(o=Ie().atob(e.data),i=Array.from(o,(function(e,t){return o.charCodeAt(t)})),n=dr(dr({},e),{data:new Uint8Array(i)}));try{return a=Kt.call(this,n),s=a[0],a[1]?(c="miniCore"===this.name||"web"===t.platform,u=c?new Uint8Array(s.data):s.data,[2,r.decode(u)]):[2,void 0]}catch(e){throw new Error("decode message fail.")}}))}))}function Wr(e){var t=this;this.lastHeartbeat=Date.now(),this.probingTimer&&clearTimeout(this.probingTimer),e.then((function(e){if(e)switch(e.command){case 0:Kr.call(t,e);break;case 1:Sr.call(t,e);break;case 2:Fr.call(t,e);break;case 3:Lr.call(t,e);break;case 4:Pr.call(t,e);break;default:B.error("unexpected msync command: ".concat(e.command))}else B.error("unexpected msync result: ".concat(e))}))}var zr=new Map;function Kr(e){var t,r,n,o,i,a,c,u,l,h,f,m,v,y,_,T,R,S,b,C,N,A,M,w,U,L,P,x,k,D,j,G,H,F,q,W,z,K,V,J,Y,X,Q,$,Z,ee,te,re,ne,oe,ie,ae,se,ce,ue,le,de;return pr(this,void 0,void 0,(function(){var pe,he,fe,me,ge,Ee,_e,Te,Ie,Oe,Re,Se,be,Ce,Ne,Ae,Me,we,Ue,Le,xe,ke,De,Be,je,Ge,He,Fe,qe,We,ze,Ke,Ve,Je,Xe,Qe,$e,Ze,et,tt,rt,nt,ot,it,at,st,ut,lt=this;return hr(this,(function(dt){switch(dt.label){case 0:if(pe=(pe=this.root.lookup("easemob.pb.CommSyncDL")).decode(e.payload),he=new(d())(pe.serverId.low,pe.serverId.high,pe.serverId.unsigned).toString(),fe=new(d())(pe.metaId.low,pe.metaId.high,pe.metaId.unsigned).toString(),!(Number(fe)>0))return[3,23];if(clearTimeout(null===(t=this._msgHash[fe])||void 0===t?void 0:t.messageTimer),!pe.status)return[3,22];if(0!==pe.status.errorCode)return[3,21];if(null==(me=this._msgHash[fe])?void 0:me.isHandleChatroom){try{if(ge="join"===(null===(r=this._msgHash[fe])||void 0===r?void 0:r.operation)){Ee={};try{pe.metas.length>0&&(_e=this.root.lookup("easemob.pb.MUCBody"),Te=_e.decode(pe.metas[0].payload),(Ie=JSON.parse(Te.status.chatroomInfo||"{}")[this.user])&&(Ee={isAllMembersMuted:Ie.is_all_mute,createTimestamp:Ie.create_timestamp,isInAllowlist:Ie.is_in_white_list,memberCount:Ie.member_count,muteExpireTimestamp:Ie.mute_duration?Ie.mute_duration:-1}))}catch(e){B.error("decode chat room info error",e)}(null===(n=this._msgHash[fe])||void 0===n?void 0:n.resolve)instanceof Function&&this._msgHash[fe].resolve({type:0,data:{action:"apply",id:this._msgHash[fe].roomId,result:!0,user:this.context.userId,info:Ee}}),(null===(o=this._msgHash[fe])||void 0===o?void 0:o.success)instanceof Function&&this._msgHash[fe].success({type:0,data:{action:"apply",id:this._msgHash[fe].roomId,result:!0,user:this.context.userId,info:Ee}})}(null===(i=this._msgHash[fe])||void 0===i?void 0:i.resolve)instanceof Function&&!ge&&this._msgHash[fe].resolve({type:0,data:{result:!0}}),(null===(a=this._msgHash[fe])||void 0===a?void 0:a.success)instanceof Function&&!ge&&this._msgHash[fe].success({type:0,data:{result:!0}}),O.has(fe)&&(Oe=O.get(fe),et=Oe.rpt,tt=Oe.requestName,et({isEndApi:!0,data:{isSuccess:1,requestName:tt,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.success}}),O.delete(fe))}catch(e){O.has(fe)&&(Re=O.get(fe),et=Re.rpt,tt=Re.requestName,et({isEndApi:!0,data:{isSuccess:0,requestName:tt,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.failed,codeDesc:"when executing success function error"}}),O.delete(fe)),nt=p.create({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e}),this.onError&&this.onError(nt),null===(c=this.eventHandler)||void 0===c||c.dispatch("onError",nt)}delete this._msgHash[fe]}return!me||me.isHandleChatroom?[3,20]:(Se=null,be="",Ce=0,Ne="",Ae=null,this._msgHash[fe].thirdMessage?(this._msgHash[fe].thirdMessage.id=pe.serverId,this._msgHash[fe].thirdMessage.timestamp=pe.timestamp,[4,ct.call(this,this._msgHash[fe].thirdMessage,pe.status,!0,!0)]):[3,2]);case 1:Ae=dt.sent(),dt.label=2;case 2:if(0===pe.metas.length)return[3,13];dt.label=3;case 3:switch(dt.trys.push([3,12,,13]),Me=pe.metas[0],we=pe.status,Me.ns){case 1:return[3,4];case 5:return[3,9]}return[3,10];case 4:return this.useReplacedMessageContents?[4,ct.call(this,Me,we,!0,!0)]:[3,8];case 5:return Ae=dt.sent(),[4,null===(l=null===(u=this._localCache)||void 0===u?void 0:u.getInstance())||void 0===l?void 0:l.getMessageByServerMsgId(fe)];case 6:return(Ue=dt.sent())?[4,null===(f=null===(h=this._localCache)||void 0===h?void 0:h.getInstance())||void 0===f?void 0:f.putMessageToDB(dr(dr(dr({},Ue),Ae),{id:fe}))]:[3,8];case 7:dt.sent(),dt.label=8;case 8:return[3,11];case 9:return(Le=ye.parseNotify(pe.metas[0].payload)).edit_msg&&(xe=Le.edit_msg,ke=xe.count,De=xe.operator,Be=xe.edit_time,je=xe.sender,Ge=xe.send_time,He=xe.chat_type,Se={operationTime:Be,operatorId:De,operationCount:ke},be=je,Ce=Number(Ge),Ne=Ye[He]),[3,11];case 10:return B.error("decode local meta error",Me),[3,11];case 11:return[3,13];case 12:return Fe=dt.sent(),nt=p.create({type:s.WEBIM_LOAD_MSG_ERROR,message:"decode local meta message error",data:Fe}),this.onError&&this.onError(nt),null===(m=this.eventHandler)||void 0===m||m.dispatch("onError",nt),[3,13];case 13:I.has(fe)&&(I.get(fe).rpt({isEndApi:!0,data:{isSuccess:1,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.success,msgId:he,messageType:null!==(v=E[null==Ae?void 0:Ae.chatType])&&void 0!==v?v:E.singleChat}}),I.delete(fe)),dt.label=14;case 14:return dt.trys.push([14,18,,19]),qe={localMsgId:fe,serverMsgId:he},Se&&(We=this._msgHash[fe],ze=We.editMessageId,Ke=We.ext,Ve=We.customExts,Je=We.customEvent,Ae.modifiedInfo=Se,Ae.from=be,Ae.time=Number(Ce),Ae.chatType=Ne,Ae.id=ze,null===(T=null===(_=null===(y=this._localCache)||void 0===y?void 0:y.getInstance())||void 0===_?void 0:_.getMessageByServerMsgId(ze))||void 0===T||T.then((function(e){var t,r,n,o,i,a;e&&("txt"===e.type?null===(r=null===(t=lt._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.putMessageToDB(dr(dr({},e),{msg:Ae.msg,modifiedInfo:Ae.modifiedInfo,translations:Ae.translations,ext:Ke?Ae.ext:e.ext})):"custom"===e.type?null===(o=null===(n=lt._localCache)||void 0===n?void 0:n.getInstance())||void 0===o||o.putMessageToDB(dr(dr({},e),{ext:Ke?Ae.ext:e.ext,customExts:Ve,customEvent:Je,modifiedInfo:Ae.modifiedInfo})):null===(a=null===(i=lt._localCache)||void 0===i?void 0:i.getInstance())||void 0===a||a.putMessageToDB(dr(dr({},e),{ext:Ke?Ae.ext:e.ext,modifiedInfo:Ae.modifiedInfo})))}))),Ae&&(Se?("txt"===Ae.type&&(qe.message=Ae),qe.modifiedInfo=Se):qe.message=Ae),[4,null===(S=null===(R=this._localCache)||void 0===R?void 0:R.getInstance())||void 0===S?void 0:S.updateLocalMessage(fe,{serverMsgId:he,status:Pe.SUCCESS})];case 15:return dt.sent(),(null===(b=this._msgHash[fe])||void 0===b?void 0:b.success)instanceof Function?[4,this._msgHash[fe].success(fe,he)]:[3,17];case 16:dt.sent(),dt.label=17;case 17:return(null===(C=this._msgHash[fe])||void 0===C?void 0:C.resolve)instanceof Function&&this._msgHash[fe].resolve(qe),[3,19];case 18:return Xe=dt.sent(),nt=p.create({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:Xe}),this.onError&&this.onError(nt),null===(N=this.eventHandler)||void 0===N||N.dispatch("onError",nt),[3,19];case 19:this.onReceivedMessage&&this.onReceivedMessage({id:fe,mid:he,to:this._msgHash[fe].to,time:0}),null===(A=this.eventHandler)||void 0===A||A.dispatch("onReceivedMessage",{id:fe,mid:he,to:this._msgHash[fe].to}),delete this._msgHash[fe],dt.label=20;case 20:return[3,22];case 21:if(15===pe.status.errorCode)(null===(M=this._msgHash[fe])||void 0===M?void 0:M.fail)instanceof Function&&this._msgHash[fe].fail({type:s.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject({type:s.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"}),null===(U=null===(w=this._localCache)||void 0===w?void 0:w.getInstance())||void 0===U||U.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL});else if(1===pe.status.errorCode){switch(Qe=void 0,pe.status.reason){case"blocked":Qe=s.PERMISSION_DENIED;break;case"group not found":Qe=s.GROUP_NOT_EXIST;break;case"not in group or chatroom":Qe=s.GROUP_NOT_JOINED;break;case"exceed recall time limit":Qe=s.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":Qe=s.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":Qe=s.SERVICE_NOT_ALLOW_MESSAGING;break;case"nonroster":Qe=s.USER_NOT_FRIEND,pe.status.reason="not contact";break;case"group is disabled":Qe=s.GROUP_IS_DISABLED,pe.status.reason="group is disabled";break;case"limit directed users":Qe=s.MAX_LIMIT;break;case"Sorry, edit limit reached":Qe=s.MAX_LIMIT,pe.status.reason="Modify message limit reached";break;case"Sorry, message does not exist":Qe=s.MODIFY_MESSAGE_NOT_EXIST,pe.status.reason="The message does not exist.";break;case"Sorry, You do not have permission":Qe=s.PERMISSION_DENIED,pe.status.reason="You do not have the modified permission.";break;case"Sorry, format is incorrect":Qe=s.MODIFY_MESSAGE_FORMAT_ERROR,pe.status.reason="The modify messaged format error.";break;case"Sorry, edit is not available":Qe=s.SERVICE_NOT_ENABLED,pe.status.reason="The message modify function is not activated.";break;case"Sorry, edit fail":Qe=s.MODIFY_MESSAGE_FAILED,pe.status.reason="Modify message failed.";break;default:pe.status.reason.includes("grpID")&&pe.status.reason.includes("does not exist!")?(Qe=s.CHATROOM_NOT_EXIST,pe.status.reason="The chat room dose not exist."):pe.status.reason.includes("username")&&pe.status.reason.includes("doesn't exist!")?Qe=s.USER_NOT_FOUND:"group member list is full!"===pe.status.reason?Qe=s.CHATROOM_MEMBERS_FULL:pe.status.reason.includes("can not join this group")&&pe.status.reason.includes("is in the blacklist")?(Qe=s.PERMISSION_DENIED,pe.status.reason="permission denied"):"can not operate this group, reason: group is disabled"===pe.status.reason?Qe=s.GROUP_IS_DISABLED:pe.status.reason.includes("moderation")?Qe=s.MESSAGE_MODERATION_BLOCKED:pe.status.reason.includes("group ID illegal, please check it")?(Qe=s.REQUEST_PARAMETER_ERROR,pe.status.reason="Invalid parameter"):Qe=pe.status.reason.includes("has create too many chatrooms")||pe.status.reason.includes("has joined too many chatrooms")?s.MAX_LIMIT:pe.status.reason.includes("auto create failed")?s.SERVER_BUSY:s.SERVER_UNKNOWN_ERROR}this._msgHash[fe]&&((null===(L=this._msgHash[fe])||void 0===L?void 0:L.isHandleChatroom)?(rt=p.create({type:Qe,message:pe.status.reason||"",data:""}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].error instanceof Function&&this._msgHash[fe].error(rt),O.has(fe)&&($e=g.failed,Qe===s.CHATROOM_NOT_EXIST?$e=g.notFound:Qe===s.CHATROOM_MEMBERS_FULL&&($e=g.reachLimit),Ze=O.get(fe),et=Ze.rpt,tt=Ze.requestName,et({isEndApi:!0,data:{isSuccess:0,requestName:tt,requestMethod:"WEBSOCKET",requestUrl:this.url,code:$e,codeDesc:pe.status.reason}}),O.delete(fe))):(rt=p.create({type:Qe,message:pe.status.reason||"",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail({type:Qe,reason:pe.status.reason?pe.status.reason:"",data:{id:fe,mid:he}}),null===(x=null===(P=this._localCache)||void 0===P?void 0:P.getInstance())||void 0===x||x.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL})),delete this._msgHash[fe])}else if(7===pe.status.errorCode)"sensitive words"===pe.status.reason&&this._msgHash[fe]?(rt=p.create({type:s.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail({type:s.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:fe,mid:he,reason:"sensitive words"}}),null===(D=null===(k=this._localCache)||void 0===k?void 0:k.getInstance())||void 0===D||D.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL})):"blocked by mod_antispam"===pe.status.reason&&this._msgHash[fe]?(rt=p.create({type:s.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail({type:s.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:fe,mid:he,reason:"blocked by mod_antispam"}}),null===(G=null===(j=this._localCache)||void 0===j?void 0:j.getInstance())||void 0===G||G.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL})):"user is mute"===pe.status.reason&&this._msgHash[fe]?(rt=p.create({type:s.USER_MUTED_BY_ADMIN,message:"user is mute",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail(rt),null===(F=null===(H=this._localCache)||void 0===H?void 0:H.getInstance())||void 0===F||F.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL})):"traffic limit"===pe.status.reason&&this._msgHash[fe]?(rt=p.create({type:s.MESSAGE_CURRENT_LIMITING,message:"traffic limit",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail(rt),null===(W=null===(q=this._localCache)||void 0===q?void 0:q.getInstance())||void 0===W||W.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL})):"Sorry, data is too large"===pe.status.reason&&this._msgHash[fe]&&(rt=p.create({type:s.MESSAGE_SIZE_LIMIT,message:"Sorry, data is too large",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail(rt),null===(K=null===(z=this._localCache)||void 0===z?void 0:z.getInstance())||void 0===K||K.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL}));else if(19===pe.status.errorCode)this._msgHash[fe]&&(I.has(fe)&&(I.get(fe).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.MESSAGE_EXTERNAL_LOGIC_BLOCKED,codeDesc:pe.status.reason||"",msgId:he,messageType:null!==(J=E[null===(V=this._msgHash[fe])||void 0===V?void 0:V.chatType])&&void 0!==J?J:E.singleChat}}),I.delete(fe)),rt=p.create({type:s.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:pe.status.reason||"",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail({type:s.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:fe,mid:he,reason:pe.status.reason}}),null===(X=null===(Y=this._localCache)||void 0===Y?void 0:Y.getInstance())||void 0===X||X.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL}));else if(this._msgHash[fe]){I.has(fe)&&(I.get(fe).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.WEBIM_LOAD_MSG_ERROR,codeDesc:(null===(Q=pe.status)||void 0===Q?void 0:Q.reason)||"",msgId:he,messageType:null!==(Z=E[null===($=this._msgHash[fe])||void 0===$?void 0:$.chatType])&&void 0!==Z?Z:E.singleChat}}),I.delete(fe));try{rt=p.create({type:s.WEBIM_LOAD_MSG_ERROR,message:(null===(ee=pe.status)||void 0===ee?void 0:ee.reason)||"",data:{id:fe,mid:he,reason:pe.status&&pe.status.reason}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),null===(re=null===(te=this._localCache)||void 0===te?void 0:te.getInstance())||void 0===re||re.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL}),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail({type:s.WEBIM_LOAD_MSG_ERROR,data:{errorCode:pe.status&&pe.status.errorCode,reason:pe.status&&pe.status.reason}})}catch(e){nt=p.create({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e}),this.onError&&this.onError(nt),null===(ne=this.eventHandler)||void 0===ne||ne.dispatch("onError",nt)}delete this._msgHash[fe]}else I.has(fe)&&(I.get(fe).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,codeDesc:"on message error",msgId:he,messageType:null!==(ie=E[null===(oe=this._msgHash[fe])||void 0===oe?void 0:oe.chatType])&&void 0!==ie?ie:E.singleChat}}),I.delete(fe)),nt=p.create({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"on message error"}),this.onError&&this.onError(nt),null===(ae=this.eventHandler)||void 0===ae||ae.dispatch("onError",nt);dt.label=22;case 22:return[2];case 23:if(pe.metas&&0!==pe.metas.length){this._offlineMessagePullState!==ve.SYNC_FINISH&&zr.set(pe.queue.name,pe.metas.length);try{Ir.call(this,pe.metas,pe.status)}catch(e){nt=p.create({type:s.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e}),B.error("decode message error",e),this.onError&&this.onError(nt),null===(se=this.eventHandler)||void 0===se||se.dispatch("onError",nt)}finally{pe.isLast?(B.debug("DLMessage isLast",pe.isLast),ot=-1,this._queues.some((function(e,t){return e.name===pe.name&&(ot=t,!0)}))&&ot>0&&this._queues.splice(ot,1),this._queues.length>0&&Nr.call(this,this._queues[0]),Rr.call(this,pe)):pe.nextKey&&(st=new(d())(pe.nextKey.low,pe.nextKey.high,pe.nextKey.unsigned).toString(),B.debug("nexKey:",st,"this.nextKey:",this.nexKey),st!==this.nexKey||(null===(ce=pe.queue)||void 0===ce?void 0:ce.name)!==this.currentQueue?(this.nexKey=st,this.currentQueue=null===(ue=pe.queue)||void 0===ue?void 0:ue.name,Ur.call(this,pe.nextKey,pe.queue)):(B.debug("nexKey and queue are same, delete it"),it=-1,this._queues.some((function(e,t){return e.name===pe.queue.name&&(it=t,!0)}))&&this._queues.splice(it,1),this._queues.length>0&&Nr.call(this,this._queues[0])))}}else pe.isLast?(B.debug("isLast",pe.isLast),at=-1,this._queues.some((function(e,t){return e.name===pe.queue.name&&(at=t,!0)}))&&this._queues.splice(at,1),this._queues.length>0&&Nr.call(this,this._queues[0]),Rr.call(this,pe)):pe.nextKey&&(st=new(d())(pe.nextKey.low,pe.nextKey.high,pe.nextKey.unsigned).toString(),B.debug("nexKey:",st,"this.nextKey:",this.nexKey),st!==this.nexKey||(null===(le=pe.queue)||void 0===le?void 0:le.name)!==this.currentQueue?(this.nexKey=st,this.currentQueue=null===(de=pe.queue)||void 0===de?void 0:de.name,Ur.call(this,pe.nextKey,pe.queue)):(B.debug("nexKey and queue are same, delete it"),ut=-1,this._queues.some((function(e,t){return e.name===pe.queue.name&&(ut=t,!0)}))&&this._queues.splice(ut,1),this._queues.length>0&&Nr.call(this,this._queues[0])));return[2]}}))}))}function Vr(e){var t=[],r=this.root.lookup("easemob.pb.KeyValue"),n=[];for(var o in e){var i=r.decode(t);if(i.key=o,void 0!==e[o]){if("object"===ar(e[o]))i.type=8,i.stringValue=JSON.stringify(e[o]);else if("string"==typeof e[o])i.type=7,i.stringValue=e[o];else if("boolean"==typeof e[o])i.type=1,i.varintValue=!0===e[o]?1:0;else if(Number.isInteger(e[o]))i.type=2,i.varintValue=e[o];else if("bigint"==typeof e[o]||"symbol"===ar(e[o])||"function"==typeof e[o]||Number.isNaN(e[o]))i.type=7,i.stringValue=e[o].toString();else{if("number"!=typeof e[o]||Number.isInteger(e[o]))continue;i.type=6,i.doubleValue=e[o]}n.push(i)}}return n}function Jr(e){var t,r,n,o=[];if(this.root){var i,a=this.root.lookup("easemob.pb.MessageBody.Content").decode(o);switch(i=!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":a.type=0,a.text=e.msg;break;case"img":a.type=1,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.size=e.body.size,a.thumbnailDisplayName=e.body.filename):e.file?(a.displayName=e.file.filename,a.remotePath=e.file.url,a.secretKey=e.file.secret,a.fileLength=e.file.file_length,a.size=e.file.size,a.thumbnailDisplayName=e.file.filename):(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.size=e.size,a.thumbnailDisplayName=e.filename),e.isBuildCombinedMsg&&(a.remotePath=e.url,a.secretKey=e.secret,a.size={height:e.height,width:e.width}),e.isGif&&(a.subType=1);var c=e.imageType,u=e.isGif||!0===e.isOriginalImage||"original"===c;a.imageType=u?1:2;break;case"video":a.type=2,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.duration=e.body.length,a.thumbnailDisplayName=e.body.filename,a.thumbnailRemotePath=this.useOwnUploadFun?"":"".concat(e.body.url,"?vframe=true"),a.thumbnailSecretKey=this.useOwnUploadFun?"":e.body.secret):e.isBuildCombinedMsg&&(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.duration=e.length,a.thumbnailDisplayName=e.filename,a.thumbnailRemotePath=e.thumb,a.thumbnailSecretKey=e.thumb_secret);break;case"loc":a.type=3,a.latitude=e.lat,a.longitude=e.lng,a.address=e.addr,a.buildingName=e.buildingName,a.latitude=e.lat;break;case"audio":a.type=4,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.duration=e.body.length,a.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.duration=e.length,a.thumbnailDisplayName=e.filename);break;case"file":a.type=5,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.thumbnailDisplayName=e.filename);break;case"cmd":a.type=6,a.action=e.action;break;case"custom":a.type=7,a.customEvent=e.customEvent,a.customExts=Vr.call(this,e.customExts);break;case"combine":a.type=0,a.subType=0,a.text=e.compatibleText,a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.title=e.title,a.summary=e.summary,a.combineLevel=e.combineLevel}var l=[];e.ext&&(l=Vr.call(this,e.ext));var p=this.root.lookup("easemob.pb.MessageBody"),h=p.decode(o),f=e.from||this.context.jid.name;h.from={name:e.isBuildCombinedMsg?f:this.context.jid.name};var m=e.to.indexOf("/"),v=m>-1?e.to.substring(0,m):e.to;if(h.to={name:v},"channel"===e.type)h.type=sr.CHANNEL_ACK;else if("recall"===e.type)h.type=sr.RECALL,h.ackMessageId=e.ackId;else if("delivery"===e.type)h.type=sr.DELIVER_ACK,h.ackMessageId=e.ackId;else if("read"===e.type)h.type=sr.READ_ACK,h.ackMessageId=e.ackId,"groupChat"===i&&(h.msgConfig={allowGroupAck:!0},h.ackContent=e.ackContent);else if("chatRoom"===i)h.type=sr.CHATROOM;else if("groupChat"===i){if(h.type=sr.GROUPCHAT,e.msgConfig){var g=e.msgConfig.allowGroupAck;h.msgConfig={allowGroupAck:!!g}}}else"singleChat"===i&&(h.type=sr.SINGLECHAT);e.editMessageId&&(h.type=sr.EDIT,h.editMessageId=e.editMessageId,h.editScope=cr.BODY,e.ext&&(h.editScope=cr.BODY_AND_EXT)),h.contents=[a],h.ext=l;var y=function(e){var t={};return"translations"in e&&(t.translations=e.translations),"isChatThread"in e&&e.isChatThread&&(t.thread={}),Object.keys(t).length>0?JSON.stringify(t):""}(e);y&&(h.meta=y),h=p.encode(h).finish();var E=this.root.lookup("easemob.pb.Meta"),_=E.decode(o);_.id=e.id;var T="easemob.com";if("chatRoom"!==i&&"groupChat"!==i||(T="conference.easemob.com"),_.to={appKey:this.appKey,name:v,domain:T},m>-1&&(_.to.clientResource=e.to.substring(m+1,e.to.length)),"chatRoom"===i&&(_.ext=Vr.call(this,function(e){return{chatroom_msg_tag:"high"===e.priority?0:"low"===e.priority?2:1}}(e))),"recall"===e.type&&e.metaExt&&(_.ext=Vr.call(this,{recallMessageExtensionInfo:e.metaExt})),_.ns=1,_.payload=h,_.routetype=e.deliverOnlineOnly?1:0,"singleChat"!==i&&Array.isArray(e.receiverList)&&(null===(n=e.receiverList)||void 0===n?void 0:n.length)>0&&(_.directedUsers=e.receiverList,_.routetype=2),"delivery"!==e.type&&void 0!==e.webhookEnv){if("string"!=typeof e.webhookEnv)throw Error('Invalid parameter: "webhookEnv"');_.env=e.webhookEnv}if(e.isBuildCombinedMsg)return _.timestamp=d().fromValue(e.time),E.encode(_).finish();var I=this.root.lookup("easemob.pb.CommSyncUL"),O=I.decode(o);O.meta=_,!e.isPing&&Xr.call(this,e,_),O=I.encode(O).finish();var R=this.root.lookup("easemob.pb.MSync"),S=R.decode(o);return S.version=this.version,S.encryptType=this.encryptType,S.command=0,S.payload=O,S.traceId=fr.gen(),B.debug("traceId",S.traceId),R.encode(S).finish()}e.fail&&e.fail({type:s.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function Yr(e){var t,r,n,o,i,a,c,u,l,d=this,p=dr({},e);if(p.editMessageId){var h=Jr.call(this,p);tn.call(this,h)}else{if(e.file||"img"===e.type&&e._filePath){if(p.accessToken=this.token,p.appKey=this.appKey,p.apiUrl=this.apiUrl,p.body&&p.body.url)return Jr.call(this,p);var m=(null===(r=null===(t=p.file)||void 0===t?void 0:t.data)||void 0===r?void 0:r.type)||(null===(n=p.file)||void 0===n?void 0:n.filetype)||p.filetype||"";if(p.isGif&&m&&"image/gif"!==m)return void this._msgHash[p.id].reject({type:s.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"The file type is not gif."});var v=null!==(a=null===(i=null===(o=p.file)||void 0===o?void 0:o.data)||void 0===i?void 0:i.size)&&void 0!==a?a:p.file_length;if("number"==typeof v&&v<=0){var g={type:s.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"};return p.onFileUploadError instanceof Function&&p.onFileUploadError(g),void(null===(c=this._msgHash[p.id])||void 0===c||c.reject(g))}return new Promise((function(t,r){var n=p.onFileUploadComplete,o=p.onFileUploadError,i=function(e,t){var r,n={type:s.WEBIM_UPLOADFILE_ERROR,message:e,data:t};o instanceof Function&&o(n),null===(r=d._msgHash[p.id])||void 0===r||r.reject(n)},a=function(e){var t=(null==e?void 0:e.message)||"";return/missing .*capability|requires file path string/i.test(t)},c=function(t){var r,o,i,a,c,u,l,h,m,v,g,y,E;if(t.entities){if(t.entities[0]["file-metadata"]){var _=t.entities[0]["file-metadata"]["content-length"];p.file_length=_,p.filetype=t.entities[0]["file-metadata"]["content-type"],_>204800&&(p.thumbnail=!0)}var T,O,S,b=(null===(o=p.file)||void 0===o?void 0:o.filename)||p.filename||(null===(i=p.body)||void 0===i?void 0:i.filename)||"image",C=p.filetype||(null===(a=p.file)||void 0===a?void 0:a.filetype)||(null===(c=t.entities[0]["file-metadata"])||void 0===c?void 0:c["content-type"])||"",N=null!==(g=null!==(m=null!==(h=null===(l=null===(u=p.file)||void 0===u?void 0:u.data)||void 0===l?void 0:l.size)&&void 0!==h?h:p.file_length)&&void 0!==m?m:null===(v=t.entities[0]["file-metadata"])||void 0===v?void 0:v["content-length"])&&void 0!==g?g:0,A="".concat(d.getChatFilesUrl(),"/").concat(t.entities[0].uuid);if(p.body={type:p.type||"file",secret:t.entities[0]["share-secret"],filename:b,url:A,length:p.length||0,filetype:C,file_length:N,size:{width:p.width||0,height:p.height||0}},p.file&&(p.file.url=t.uri),e.secret=t.entities[0]["share-secret"],t.url=e.url="".concat(A,"?em-redirect=true&share-secret=").concat(t.entities[0]["share-secret"]),e.file_length=p.file_length=N,"img"===p.type){var M=(T=A,O=t.entities[0]["share-secret"],S="em-redirect=true".concat(O?"&share-secret=".concat(O):""),{originalImageUrl:"".concat(T,"?").concat(S),bigImageUrl:"".concat(T,"?size=large&").concat(S)}),w="".concat(e.url,"&thumbnail=true");e.thumb=w,t.thumb="".concat(t.url,"&thumbnail=true"),e.originalImageUrl=M.originalImageUrl,e.bigImageUrl=M.bigImageUrl,t.originalImageUrl=M.originalImageUrl,t.bigImageUrl=M.bigImageUrl}"video"===p.type&&(e.thumb="".concat(e.url,"&vframe=true"),e.thumb_secret=t.entities[0]["share-secret"],t.thumb="".concat(t.url,"&vframe=true")),n instanceof Function&&n(t,p.id);var U=Jr.call(d,p);I.size<=R&&I.set(p.id,{rpt:d.dataReport.geOperateFun({operationName:f.SEND_MSG})}),null===(E=null===(y=d._localCache)||void 0===y?void 0:y.getInstance())||void 0===E||E.storeMessage(e,Pe.INPROGRESS),tn.call(d,U)}else null===(r=d._msgHash[p.id])||void 0===r||r.reject({type:s.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the file",data:t})};p.onFileUploadComplete=c,p.onFileUploadError=function(e){var t;o instanceof Function&&o(e),null===(t=d._msgHash[p.id])||void 0===t||t.reject({type:s.WEBIM_UPLOADFILE_ERROR,message:e.message||"Failed to upload the file",data:e})},pr(d,void 0,void 0,(function(){var e,t,r,n,o,s,u,l,d,h,m,v,g,y,E,_,T,I,O,R,S,b,C,N,A,M,w,U,L,P,x,k,D,j,G,H,F,q,W,z,K,V,J;return hr(this,(function(Y){switch(Y.label){case 0:if(Y.trys.push([0,24,,25]),"img"!==p.type)return[3,23];if(e=this._imageProcessor,t=null===(P=p.file)||void 0===P?void 0:P.data,r=p._filePath,n=null!==(k=null!==(x=null==t?void 0:t.size)&&void 0!==x?x:p.file_length)&&void 0!==k?k:0,o=(null==t?void 0:t.type)||(null===(D=p.file)||void 0===D?void 0:D.filetype)||p.filetype||"",s=p.imageType,u=p.isGif||!0===p.isOriginalImage||"original"===s,l=void 0,!r||!e)return[3,4];Y.label=1;case 1:return Y.trys.push([1,3,,4]),[4,e.getImageInfo(r)];case 2:return(l=Y.sent()).path&&l.path!==r&&(B.debug("Miniapp image message file path normalized",r,l.path),r=l.path,p._filePath=l.path),[3,4];case 3:return d=Y.sent(),B.warn("Failed to normalize miniapp image path",d),[3,4];case 4:if(p.width&&p.height||!t&&!r)return[3,12];Y.label=5;case 5:return Y.trys.push([5,11,,12]),e?(m=l)?[3,7]:[4,e.getImageInfo(r||t)]:[3,8];case 6:m=Y.sent(),Y.label=7;case 7:return h=m,r&&h.path&&h.path!==r&&(r=h.path,p._filePath=h.path),p.width||(p.width=h.width),p.height||(p.height=h.height),[3,10];case 8:return"undefined"==typeof Image||"undefined"==typeof URL?[3,10]:[4,new Promise((function(e,r){var n=new Image,o=URL.createObjectURL(t);n.onload=function(){URL.revokeObjectURL(o),e({w:n.width,h:n.height})},n.onerror=function(){URL.revokeObjectURL(o),r(new Error("load failed"))},n.src=o}))];case 9:v=Y.sent(),p.width||(p.width=v.w),p.height||(p.height=v.h),Y.label=10;case 10:return[3,12];case 11:return g=Y.sent(),r&&a(g)?(i("Failed to read image info on mini program platform",g),[2]):(B.warn("Failed to read image info",g),[3,12]);case 12:if(r&&(!p.width||!p.height)&&!e)return i("Mini program platform is missing image info capability"),[2];if(y=p.width,E=p.height,!u&&!p.isGif&&r&&!e)return i("Mini program platform is missing image compression capability"),[2];if(u||p.isGif||!e)return[3,16];if(!(O=r||t))return[3,16];Y.label=13;case 13:return Y.trys.push([13,15,,16]),[4,e.generateBigImage(O,{maxShortEdge:720,quality:.85})];case 14:return(_=Y.sent())&&(_.file&&(p.file=dr(dr({},p.file),{data:_.file})),_.path&&(p._filePath=_.path,r=_.path),p.file_length=_.size,p.filetype=_.type,p.file&&(p.file.filetype=_.type),p.width=_.width,p.height=_.height,B.debug("Image compressed for large send","".concat(_.width,"x").concat(_.height,", size: ").concat(_.size))),[3,16];case 15:return T=Y.sent(),r&&a(T)?(i("Mini program platform is missing image compression capability",T),[2]):(B.warn("Big image generation failed, falling back to original",T),p.isOriginalImage=!0,u=!0,[3,16]);case 16:if(w=null!==(F=null!==(H=null===(G=null===(j=p.file)||void 0===j?void 0:j.data)||void 0===G?void 0:G.size)&&void 0!==H?H:p.file_length)&&void 0!==F?F:0,I=u?"original":"large",r&&rr(w,"img",I)&&!e)return i("Mini program platform is missing image MD5 capability"),[2];if(!rr(w,"img",I)||!e)return[3,22];Y.label=17;case 17:return Y.trys.push([17,21,,22]),(O=r||t)?[4,e.computeMd5(O)]:[3,20];case 18:return[4,ir(this,Y.sent(),"img",I)];case 19:if((U=Y.sent()).hit&&U.uuid)return"original"===(R=U.effectiveImageType||I)&&(p.isOriginalImage=!0,u=!0,p.width=y,p.height=E),B.debug("Precheck hit, skipping upload","uuid: ".concat(U.uuid),"effectiveImageType: ".concat(R)),S="original"===R?n:w,b="original"===R?o||(null===(q=p.file)||void 0===q?void 0:q.filetype)||"image/jpeg":(null===(W=p.file)||void 0===W?void 0:W.filetype)||p.filetype||"image/jpeg",C={entities:[{uuid:U.uuid,"share-secret":U.shareSecret||"","file-metadata":{"content-length":S,"content-type":b}}],uri:"".concat(this.getChatFilesUrl(),"/").concat(U.uuid)},c(C),[2];Y.label=20;case 20:return[3,22];case 21:return N=Y.sent(),r&&a(N)?(i("Mini program platform is missing image MD5 capability",N),[2]):(B.warn("Precheck error, proceeding with upload",N),[3,22]);case 22:p._uploadImageType=or(I),Y.label=23;case 23:return[3,25];case 24:return A=Y.sent(),B.warn("Image preprocessing failed, proceeding with normal upload",A),[3,25];case 25:if("img"===p.type)return[3,30];if(M=null===(z=p.file)||void 0===z?void 0:z.data,w=null!==(V=null!==(K=null==M?void 0:M.size)&&void 0!==K?K:p.file_length)&&void 0!==V?V:0,!M||!rr(w,p.type))return[3,30];Y.label=26;case 26:return Y.trys.push([26,29,,30]),[4,nr(M)];case 27:return[4,ir(this,Y.sent(),p.type)];case 28:return(U=Y.sent()).hit&&U.uuid?(B.debug("Attachment precheck hit, skipping upload","uuid: ".concat(U.uuid),"type: ".concat(p.type)),c({entities:[{uuid:U.uuid,"share-secret":U.shareSecret||"","file-metadata":{"content-length":w,"content-type":M.type||p.filetype||(null===(J=p.file)||void 0===J?void 0:J.filetype)||""}}],uri:"".concat(this.getChatFilesUrl(),"/").concat(U.uuid)}),[2]):[3,30];case 29:return L=Y.sent(),B.warn("Attachment precheck failed, proceeding with upload",L),[3,30];case 30:return ye.uploadFile.call(this,p,f.UPLOAD_MSG_ATTACH),[2]}}))}))}))}if("combine"===e.type){p.accessToken=this.token,p.appKey=this.appKey,p.apiUrl=this.apiUrl;var y=p.onFileUploadComplete,E=p.onFileUploadError;return new Promise((function(t,r){var n,o,i,a;if((null===(n=e.messageList)||void 0===n?void 0:n.length)>300||0===(null===(o=e.messageList)||void 0===o?void 0:o.length))return d._msgHash[p.id].reject({type:s.MAX_LIMIT,message:"The number of combined messages exceeded the limit."});var c=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([],e.messageList,!0),u=0;if(c.forEach((function(e){(null==e?void 0:e.combineLevel)>u&&(u=null==e?void 0:e.combineLevel)})),p.combineLevel=u+1,p.combineLevel>10)return d._msgHash[p.id].reject({type:s.MAX_LIMIT,message:"The level of the merged message exceeded the limit."});var l=Qr.call(d,c),h=function(t,r){var n,o,i,a,s,c,u="".concat(d.getChatFilesUrl(),"/").concat(t.entities[0].uuid),l=null===(n=t.entities[0])||void 0===n?void 0:n["share-secret"],h="".concat(u,"?em-redirect=true");l&&(h="".concat(h,"&share-secret=").concat(l)),y instanceof Function&&y({url:h,secret:l}),e.url=h,e.secret=l,p.url=h,p.secret=t.entities[0]["share-secret"],p.filename=(null===(o=p.file)||void 0===o?void 0:o.filename)||(null==r?void 0:r.fileName),p.file_length=(null===(a=null===(i=p.file)||void 0===i?void 0:i.data)||void 0===a?void 0:a.size)||(null==r?void 0:r.fileLength)||0,null===(c=null===(s=d._localCache)||void 0===s?void 0:s.getInstance())||void 0===c||c.storeMessage(e,Pe.INPROGRESS);var f=Jr.call(d,p);tn.call(d,f)},m=ye.getEnvInfo();if("web"!==m.platform&&"node"!==m.platform&&"quick_app"!==m.platform&&(null===(a=null===(i=m.global)||void 0===i?void 0:i.canIUse)||void 0===a?void 0:a.call(i,"getFileSystemManager"))){var v=m.global.getFileSystemManager(),g=d.getChatFilesUrl();v.writeFile({filePath:"".concat(m.global.env.USER_DATA_PATH,"/combine"),data:l.buffer,encoding:"binary",success:function(e){m.global.uploadFile({url:g,filePath:"".concat(m.global.env.USER_DATA_PATH,"/combine"),name:"file",header:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+p.accessToken},success:function(e){if(200===e.statusCode){B.debug("upload success");var t=JSON.parse(e.data);h(t,{fileName:"combine",fileLength:l.length})}else B.error("upload fail"),p.onFileUploadError instanceof Function&&p.onFileUploadError(e),this._msgHash[p.id].reject({type:s.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})},fail:function(t){B.error("upload fail"),p.onFileUploadError instanceof Function&&p.onFileUploadError(e),this._msgHash[p.id].reject({type:s.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:t})}})},fail:function(e){B.error("write file fail",e),this._msgHash[p.id].reject({type:s.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})}})}else{var _=new File([l],"combine",{type:"application/octet-stream"}),T={url:URL.createObjectURL(_),filename:p.id,data:_};p.file=T,p.onFileUploadComplete=function(e){h(e)},p.onFileUploadError=function(e){E instanceof Function&&E(e),d._msgHash[p.id].reject({type:s.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})},ye.uploadFile.call(d,p,f.UPLOAD_MSG_ATTACH)}}))}"img"===e.type&&(p.body||(p.body=dr(dr({},p),{size:{width:p.width||0,height:p.height||0}}))),null===(l=null===(u=this._localCache)||void 0===u?void 0:u.getInstance())||void 0===l||l.storeMessage(e,Pe.INPROGRESS),h=Jr.call(this,p),tn.call(this,h)}}function Xr(e,t){if(e.editMessageId)return t.ignoreCallback=!0,void(this._msgHash[e.id].thirdMessage=t);mr.includes(e.type)&&(this._msgHash[e.id].thirdMessage=t)}function Qr(e){for(var t=Uint8Array.from("cm",(function(e){return e.charCodeAt(0)})),r=0;r<e.length;r++){for(var n=e[r],o=dr(dr({},n),{isBuildCombinedMsg:!0}),i=this.mSync.encodeChatMsg.call(this,o),a=i.length,s=new Uint8Array(4),c=0;c<4;c++)s[c]=a>>8*(3-c)&255;var u=new Uint8Array(t.length+s.length+i.length);u.set(t),u.set(s,t.length),u.set(i,t.length+s.length),t=u}var l=new Uint8Array(t.length+1),d=0;for(r=2;r<t.length;r++)r%2==1&&(d^=t[r]);return l.set(t),B.debug("checkResult:",d),l[t.length]=d,l}function $r(e,t,r){var n=[],o=this.root.lookup("easemob.pb.MUCBody"),i=e.roomId,a=e.ext,s=void 0===a?"":a,c=e.leaveOtherRooms,u=void 0!==c&&c,l=o.decode(n);l.mucId={appKey:this.appKey,name:i,domain:"conference.easemob.com"},l.operation="join"===r?2:3,l.from={name:this.context.userId},l.isChatroom=!0,"join"===r&&(l.ext=s,l.leaveOtherRooms=u),l=o.encode(l).finish();var d=this.root.lookup("easemob.pb.Meta").decode(n);d.id=t,d.from={appKey:this.appKey,name:this.context.userId,domain:"easemob.com",client_resource:this.context.jid.clientResource},d.to={domain:"easemob.com"},d.ns=2,d.payload=l;var p=this.root.lookup("easemob.pb.CommSyncUL"),h=p.decode(n);h.meta=d,h=p.encode(h).finish();var f=this.root.lookup("easemob.pb.MSync"),m=f.decode(n);return m.version=this.version,m.encryptType=this.encryptType,m.command=0,m.payload=h,m.traceId=fr.gen(),B.debug("traceId",m.traceId),f.encode(m).finish()}function Zr(e,t){var r=ye.getUniqueId(),n=$r.call(this,e,r,t),o="join"===t?f.JOIN_CHATROOM:f.QUIT_CHATROOM,i=this.dataReport.geOperateFun({operationName:o});return O.size<=R&&O.set(r,{rpt:i,requestName:o}),tn.call(this,dr(dr({},e),{isHandleChatroom:!0,joinMsg:n,id:r,operation:t}),r)}function en(e){var t=this;return new Promise((function(r,n){var o,i,a,c,u,l;if(B.debug("call send"),t.logOut)return B.error("send message failed",s.WEBIM_CONNECTION_CLOSED),n({type:s.WEBIM_CONNECTION_CLOSED,message:"not login"});if(!e.id||"string"!=typeof e.id||""===e.id)return n({type:s.MESSAGE_PARAMETER_ERROR,message:'Missing required parameter: "id"'});if(!e.to||"string"!=typeof e.to||""===e.to)return n({type:s.MESSAGE_PARAMETER_ERROR,message:'Missing required parameter: "to"'});var d="file"===e.type||"img"===e.type||"audio"===e.type||"video"===e.type,p="delivery"===e.type||"read"===e.type||"channel"===e.type,h="cmd"===e.type,m="recall"===e.type,v=null==e?void 0:e.editMessageId,g=!(p||m||h||v);if(e.id){if(!d&&!p||d&&t.useOwnUploadFun){var y="recall"===e.type?f.SEND_RECALL_MSG:f.SEND_MSG;v&&(y=f.MODIFY_MESSAGE),I.size<=R&&I.set(e.id,{rpt:t.dataReport.geOperateFun({operationName:y})})}g&&(null===(i=null===(o=t._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.storeMessage(e,Pe.CREATE)),t._msgHash[e.id]=dr(dr({},e),{resolve:r,reject:n})}if(d||"combine"===e.type)return Yr.call(t,e);if("txt"===e.type&&(null===(a=e.msgConfig)||void 0===a?void 0:a.languages)&&Array.isArray(null===(c=e.msgConfig)||void 0===c?void 0:c.languages)&&e.msgConfig.languages.length>0){var E=t.translateMessage||t.translation.translateMessage;if(!E)throw new Error("there is no method to translate message");E.call(t,{text:e.msg,languages:e.msgConfig.languages}).then((function(r){var n,o,i,a=null===(n=r.data[0])||void 0===n?void 0:n.translations;a=a.map((function(e){return{code:e.to,text:e.text}})),e.translations=a,t._msgHash[e.id].translations=a,null===(i=null===(o=t._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.storeMessage(e,Pe.INPROGRESS);var s=Jr.call(t,e);tn.call(t,s,e.id)})).catch((function(e){n(e)}))}else{g&&(null===(l=null===(u=t._localCache)||void 0===u?void 0:u.getInstance())||void 0===l||l.storeMessage(e,Pe.INPROGRESS));var _=Jr.call(t,e);tn.call(t,_,e.id)}}))}function tn(e,t){var r,n,o,i,a=this;if(e.isHandleChatroom){if(!this.isOpened()){var c={data:"",type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};if(O.has(e.id)){var u=O.get(e.id);(0,u.rpt)({isEndApi:!0,data:{isSuccess:0,requestName:u.requestName,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.disconnect,codeDesc:"websocket has been disconnected"}}),O.delete(e.id)}return Promise.reject(c)}return new Promise((function(r,n){var o,i;a._msgHash[e.id]=dr(dr({},e),{resolve:r,reject:n});var c=Vt.call(a,e.joinMsg),u=c[0];if(!c[1]){var l={type:s.SDK_RUNTIME_ERROR,message:"compress message failed"};return null===(i=null===(o=a._msgHash[e.id])||void 0===o?void 0:o.reject)||void 0===i||i.call(o,l),void delete a._msgHash[e.id]}var d=a._getSock?_r.call(a,u,t):u;if(t){var p=setTimeout((function(){var t,r=a._msgHash[e.id];if(r){var n={type:s.REQUEST_TIMEOUT,message:"request timeout"};null===(t=r.reject)||void 0===t||t.call(r,n),clearTimeout(r.messageTimer),delete a._msgHash[e.id],a.reconnecting||a.reconnect(!0)}}),15e3);a._msgHash[e.id].messageTimer=p}a.sock.send(d)}))}if(!this.isOpened())return null===(r=this.unMSyncSendMsgMap)||void 0===r||r.set(t,e),!this.logOut&&this.autoReconnectNumTotal<this.autoReconnectNumMax&&(B.info("need to reconnect",this.autoReconnectNumTotal,this.autoReconnectNumMax),this.offLineSendConnecting=!0,this.reconnecting||this.reconnect()),void(this.onError&&this.onError({type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}));var l=t&&setTimeout((function(){var e,r,n;if(a._msgHash[null!=t?t:""]){var o={type:s.MESSAGE_SEND_TIMEOUT,message:"send message timeout"};null===(r=(e=a._msgHash[null!=t?t:""]).reject)||void 0===r||r.call(e,o),clearTimeout(null===(n=a._msgHash[null!=t?t:""])||void 0===n?void 0:n.messageTimer),delete a._msgHash[null!=t?t:""],a.reconnecting||a.reconnect(!0)}}),15e3);this._msgHash[null!=t?t:""]&&(this._msgHash[null!=t?t:""].messageTimer=l);var d=Vt.call(this,e),p=d[0];if(!d[1])return c={type:s.SDK_RUNTIME_ERROR,message:"compress message failed"},null===(o=null===(n=this._msgHash[null!=t?t:""])||void 0===n?void 0:n.reject)||void 0===o||o.call(n,c),clearTimeout(null===(i=this._msgHash[null!=t?t:""])||void 0===i?void 0:i.messageTimer),void delete this._msgHash[null!=t?t:""];var h=this._getSock?_r.call(this,p,t):p;this.sock.send(h)}var rn=function(e,t){return e.send=en,e.sendMsg=en,B.info("init Msync by ".concat(e.name)),{generateProvision:yr.bind(e),generateLogout:Er.bind(e),base64transform:_r.bind(e),distributeMeta:Tr.bind(e),decodeMeta:Ir.bind(e),decodeUnreadDL:Sr.bind(e),_rebuild:br.bind(e),_lastsession:Ar.bind(e),receiveProvision:Lr.bind(e),isInQueue:Hr.bind(e),decodeNotice:Fr.bind(e),decodeMSync:qr.bind(e),distributeMSync:Wr.bind(e),encodeChatMsg:Jr.bind(e),upLoadFile:Yr.bind(e),send:en.bind(e),stopHeartBeat:jr.bind(e),handleChatRoom:Zr.bind(e),sendUnreadDeal:Dr.bind(e)}},nn=["onTextMessage","onFileMessage","onAudioMessage","onVideoMessage","onImageMessage","onLocationMessage","onCustomMessage","onCMDMessage","onStreamMessage"],on=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 nn.includes(e)&&t?B.debug("dispatch event: "+e,{id:t.id,type:t.type,time:t.time,from:t.from,to:t.to,chatType:t.chatType}):"onMessage"===e?B.debug("dispatch event: "+e,null==t?void 0:t.length):B.debug("dispatch event: "+e,t||""),this.handlerData){var n=this.handlerData[r][e];n&&n(t)}},e}(),an=function(){};function sn(e){this.onOpened=e.onOpened||an,this.onPresence=e.onPresence||an,this.onTextMessage=e.onTextMessage||an,this.onPictureMessage=e.onPictureMessage||an,this.onAudioMessage=e.onAudioMessage||an,this.onVideoMessage=e.onVideoMessage||an,this.onFileMessage=e.onFileMessage||an,this.onLocationMessage=e.onLocationMessage||an,this.onCmdMessage=e.onCmdMessage||an,this.onCustomMessage=e.onCustomMessage||an,this.onReceivedMessage=e.onReceivedMessage||an,this.onDeliveredMessage=e.onDeliveredMessage||an,this.onReadMessage=e.onReadMessage||an,this.onRecallMessage=e.onRecallMessage||an,this.onChannelMessage=e.onChannelMessage||an,this.onError=e.onError||an,this.onOffline=e.onOffline||an,this.onOnline=e.onOnline||an,this.onStatisticMessage=e.onStatisticMessage||an,this.onContactInvited=e.onContactInvited||an,this.onContactAgreed=e.onContactAgreed||an,this.onContactRefuse=e.onContactRefuse||an,this.onContactDeleted=e.onContactDeleted||an,this.onContactAdded=e.onContactAdded||an,this.onTokenWillExpire=e.onTokenWillExpire||an,this.onTokenExpired=e.onTokenExpired||an,this.onClosed=e.onClosed||an,this.onPresenceStatusChange=e.onPresenceStatusChange||an}var cn={biz:"",debug:!1,token:""},un="https://data-reporting.agora.io/report",ln="https://data-reporting.sh.agoralab.co/report",dn=function(e){var t=Number(h[e]);return t===h.USER_LOGIN?"MANUALLOGIN":t===h.MSYNC_SENDMESSAGE?"SENDMESSAGE":t>h.UNKNOWOPERATION&&t<h.REST_OPERATE?"REST":t>h.REST_OPERATE&&t<h.MSYNC_OPERATE?"MESSAGE":t>h.MSYNC_OPERATE&&t<h.ROSTER_OPERATE?"ROSTER":t>h.ROSTER_OPERATE&&t<h.USER_OPERATE?"USER":t>h.USER_OPERATE&&t<h.GROUP_OPERATE?"GROUP":t>h.GROUP_OPERATE&&t<h.CHATROOM_OPERATE?"CHATROOM":"OPERATION"},pn=function(){return(new Date).getTime()},hn=function(e){return[ce.BAIDU,ce.WX,ce.DD,ce.ZFB,ce.TT,ce.QUICK_APP,ce.UNI].includes(e.platform)},fn=function(){return e=1,t=99999,e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e;var e,t},mn={},vn=1e3,gn=function(){function e(e){this.eventQueue=[],this.stock=vn,this.config=e,this.governor()}return e.prototype.add=function(e){this.stock<=0?console.warn("Event Report limit ".concat(vn," per minute")):(this.eventQueue.push(e),this.consume(),this.stock-=1)},e.prototype.consume=function(){var e=this;0!==this.eventQueue.length&&(this.timer&&this.eventQueue.length<=10&&clearTimeout(this.timer),this.timer=setTimeout((function(){var t,r=e.eventQueue.splice(0,10),n=r.filter((function(e){return e.appId===r[0].appId})),o=r.filter((function(e){return e.appId!==r[0].appId}));(t=e.eventQueue).unshift.apply(t,o),e.batchSend(n)}),1e3))},e.prototype.governor=function(){var e=this,t=setInterval((function(){e.stock=vn}),6e4);"undefined"!=typeof addEventListener&&addEventListener("beforeunload",(function(){clearInterval(t)}))},e.prototype.batchSend=function(e){var t,r;if(void 0===e&&(e=[]),0!==e.length)try{var n=e.map((function(e){e.biz,e.appId;var t=e.eventId,r=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["biz","appId","eventId"]);return{eventId:Number(t),body:r}}));!function(e,t){try{var r=t.biz,n=t.appId,o=t.data,i=t.debug,a=t.onSuccess;if(!r)throw new Error("biz is not defined");mn.global||(mn=ye.getEnvInfo());var s=mn;if(hn(s)){var c={url:i?ln:un,data:o,method:"POST",timeout:W,success:function(){null==a||a()},fail:function(){},complete:function(){}},u={token:e,appid:null!=n?n:"",sendts:"".concat(Math.floor((new Date).getTime()/1e3)),biz:r,debug:"".concat(i)};if("zfb"===s.platform||"dd"===s.platform?c.headers=u:c.header=u,"dd"===s.platform)return s.global.httpRequest(c);s.global.request(c)}else{var l=new XMLHttpRequest;l.onreadystatechange=function(){2===l.readyState&&(null==a||a())},l.open("POST",i?ln:un),l.setRequestHeader("Content-Type","application/json"),l.setRequestHeader("token",e),l.setRequestHeader("appid",null!=n?n:""),l.setRequestHeader("sendts","".concat(Math.floor((new Date).getTime()/1e3))),l.setRequestHeader("biz",r),l.setRequestHeader("debug","".concat(i)),l.send(JSON.stringify(o))}}catch(e){console.error(e)}}(this.config.token,{biz:null===(t=e[0])||void 0===t?void 0:t.biz,appId:null===(r=e[0])||void 0===r?void 0:r.appId,data:n,debug:this.config.debug,onSuccess:this.consume.bind(this)})}catch(e){console.error(e)}},e}(),yn=function(){return yn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},yn.apply(this,arguments)},En=new(function(){function e(e){this.inited=!1,this.appId="",this.biz="",this.eventQueue={},this.config=cn,e&&this.init(e)}return e.prototype.init=function(e){var t;if(void 0===e&&(e={}),!e.biz||!e.token)throw new Error("Event Report: biz or token is not defined");try{this.appId=null!==(t=e.appId)&&void 0!==t?t:"",this.biz=e.biz,this.config=yn(yn({},cn),e),this.eventQueue=new gn(this.config),this.log(e),this.inited=!0}catch(e){console.error(e)}},e.prototype.updateAppId=function(e){this.appId=e},e.prototype.send=function(e,t,r){var n;if(void 0===t&&(t={}),this.inited){var o=yn(yn({},t),{eventId:Number(e),biz:this.biz,appId:null!==(n=null==r?void 0:r.appId)&&void 0!==n?n:this.appId});this.eventQueue.add(o),this.log(o)}else console.error("Event Report: init is not called")},e.prototype.log=function(e){try{if(this.config.debug){var t=e.payload,r=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["payload"]);console.log("%c Event Report: ".concat(this.config.biz," "),"background: #8A97FC; color: #fff"),console.table(r),t&&(console.info("payload:"),console.table(t))}}catch(e){console.error(e)}},e}()),_n=function(){return _n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_n.apply(this,arguments)},Tn={requestName:"",subrequestid:"1",requestMethod:"GET",requestUrl:"",requestElapse:0,code:0,codeDesc:"",isLastApi:0,isSuccess:1},In=function(){function e(e){this.platform=ye.getEnvInfo(),this.isReportDt=e.isReport||!1,this.isCollectDt=!0,hn(this.platform)&&!this.isReportDt&&(this.isCollectDt=!1),this.eventQueue=[],this.accessChannel="direct",this.options=function(e,t){t.platform||(t=ye.getEnvInfo());var r=e.org,n=e.appkey,o=e.deviceId,i=e.sdkVersion,a=e.uikitVersion,s="undefined"!=typeof navigator?null===navigator||void 0===navigator?void 0:navigator.userAgent:"".concat(t.platform,"_mini_program");return{org:r,appkey:n,deviceId:o,sdkServiceId:"sid_".concat(ye.getUniqueId(),"_").concat(fn()),did:s,sdkVersion:i,os:7,sdkProduct:y.web,uikitVersion:a}}(e,this.platform),this.sid=this.options.sdkServiceId,this.init(e)}return e.getInstance=function(t){return e.instance||(e.instance=new e(t)),e.instance},e.prototype.getServiceId=function(){return this.sid||"sid_0"},e.prototype.setIsReportDt=function(e){this.isReportDt=e,e&&this.rptEventQueue()},e.prototype.setIsCollectDt=function(e){this.isCollectDt=e,e||(this.eventQueue=[])},e.prototype.rptEventQueue=function(){var e=this;this.eventQueue.length&&this.eventQueue.forEach((function(t,r){En.send(t.eventId,t.dt),r>=e.eventQueue.length-1&&(e.eventQueue=[])}))},e.prototype.init=function(t){e.instance||(e.instance=this,En.init({biz:"im",token:"32f24ab2ddb74f508aa9286c356cec84",appId:t.appkey,debug:!1}),this.reportInit())},e.prototype.updateAppKey=function(e){this.options.appkey=e,this.eventQueue.forEach((function(t){"default#appkey"===t.dt.appkey&&(t.dt.appkey=e)}))},e.prototype.reportInit=function(){if(this.isCollectDt){var e=this.options,t=e.did,r=e.os,n=e.sdkVersion,o=e.deviceId;this.reportData(9674,{did:t,os:r,sdkVersion:n,deviceId:o})}},e.prototype.geOperateFun=function(e){var t=this;if(!this.isCollectDt)return function(){};var r=1,n=0,o="",i=pn(),a=e.uid,s=e.operationName;a&&(this.uid=a);var c={uid:this.uid,operationId:"opr_".concat(ye.getUniqueId(),"_").concat(fn()),requestid:"req_".concat(ye.getUniqueId(),"_").concat(fn()),operationName:s};return function(e){var a,u,l,d;if(e.data.isSuccess?(n=0,o=""):(0===e.data.code&&(e.data.code=b),n=null!==(a=e.data.code)&&void 0!==a?a:n,o=null!==(u=e.data.codeDesc)&&void 0!==u?u:o),(null===(l=e.data)||void 0===l?void 0:l.accessChannel)&&(t.accessChannel=null===(d=e.data)||void 0===d?void 0:d.accessChannel),e.isRetry?(r++,e.data.subrequestid="".concat(r)):(c.requestid="req_".concat(ye.getUniqueId(),"_").concat(fn()),r=1),e.data.isLastApi){var p=pn();e.data.requestElapse=p-i,e.data.requestMethod="",e.data.subrequestid="0",e.data.code=200===n?0:n,e.data.codeDesc=o}else e.data.requestName||(e.data.requestName=s);e.data.requestElapse||(e.data.requestElapse=pn()-i),t.reportData.call(t,S,_n(_n(_n(_n({},Tn),c),e.data),{accessChannel:t.accessChannel,operationType:dn(s)})),e.isEndApi&&t.reportData.call(t,S,_n(_n(_n({},c),Tn),{isSuccess:e.data.isSuccess,isLastApi:1,subrequestid:"0",requestMethod:"",code:200===n?0:n,codeDesc:o,requestElapse:e.data.requestElapse,accessChannel:t.accessChannel,operationType:dn(s)}))}},e.prototype.reportData=function(e,t){return r=this,n=void 0,i=function(){var r,n,o,i,a,s,c,u,l;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),r=pn(),n=0,e!==S?[3,2]:[4,(p=this.platform,new Promise((function(e){var t;p.platform||(p=ye.getEnvInfo());var r="";if(p.platform===ce.WEB){var n=navigator.connection;(null==n?void 0:n.type)?(null==n||n.type,r=v.WIFI):(null==n?void 0:n.effectiveType)&&(r=v[n.effectiveType.toLocaleUpperCase()]),e(r)}else p.platform===ce.NODE?(r=v.UNKNOWN,e(r)):null===(t=p.global)||void 0===t||t.getNetworkType({success:function(t){r=v[t.networkType.toLocaleUpperCase()],e(r)}})})))];case 1:n=d.sent(),d.label=2;case 2:return o=this.options,i=o.appkey,a=o.sdkServiceId,s=o.sdkProduct,c=o.uikitVersion,u=_n({lts:r,net:n,appkey:i,sdkServiceId:a,sdkProduct:s,uikitVersion:c},t),this.isReportDt?En.send(e,u):this.isCollectDt&&this.eventQueue.push({eventId:e,dt:u}),[3,4];case 3:return l=d.sent(),console.warn(l),[3,4];case 4:return[2]}var p}))},new((o=void 0)||(o=Promise))((function(e,t){function a(e){try{c(i.next(e))}catch(e){t(e)}}function s(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(a,s)}c((i=i.apply(r,n||[])).next())}));var r,n,o,i},e}();function On(e){return On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},On(e)}__webpack_require__(4490),__webpack_require__(6034),__webpack_require__(2762);var Rn=function(){return Rn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Rn.apply(this,arguments)},Sn=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},bn=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Cn={txt:"text",img:"image",video:"video",file:"file",loc:"location",custom:"custom"},Nn={text:"txt",image:"img",video:"video",file:"file",location:"loc",custom:"custom"},An=5,Mn=150,wn=new Set(["audio","cmd"]);function Un(e){return p.create({type:s.REQUEST_PARAMETER_ERROR,message:e})}function Ln(e,t){B.error(e,t)}function Pn(e){var t,r,n,o=Re[e.conversationType],i=Nn[e.contentType]||e.contentType,a=function(e,t){return"groupchat"===t.conversationType||"chatroom"===t.conversationType?t.receiverId:t.senderId!==e?t.senderId:t.receiverId}(this.context.userId,e),s={id:"".concat(e.messageId),conversationId:a,chatType:o,from:e.senderId,to:e.receiverId,ext:e.ext||{},time:new Date(e.sentTime).getTime()},c=e.content||{},u="string"==typeof e.text?e.text:void 0;switch(i){case"txt":n=Rn(Rn({},s),{type:"txt",msg:c.message||e.text||""}),Array.isArray(e.translations)&&e.translations.length>0&&(n.translations={translations:e.translations.map((function(e){return{text:e.text,to:e.code}}))});break;case"img":var l=c.url||c.remotePath||"",d=c.secret||c.secretKey||"",p=this.useOwnUploadFun?l:rt.call(this,{remotePath:l,secretKey:d});n=Rn(Rn({},s),{type:"img",url:p||"",width:(null===(t=c.size)||void 0===t?void 0:t.width)||c.width||0,height:(null===(r=c.size)||void 0===r?void 0:r.height)||c.height||0,secret:d,thumb:this.useOwnUploadFun?c.thumb||"":c.thumb?ye.formatAttachUrl.call(this,c.thumb):p?"".concat(p,"&thumbnail=true"):"",thumb_secret:c.thumb_secret||c.thumbnailSecretKey||d||"",file_length:c.file_length||c.fileLength||0,filetype:c.filetype||"",file:{},isGif:"sub_gif"===c.subType||1===c.subType});break;case"video":l=c.url||c.remotePath||"",d=c.secret||c.secretKey||"",p=this.useOwnUploadFun?l:rt.call(this,{remotePath:l,secretKey:d}),n=Rn(Rn({},s),{type:"video",url:p||"",secret:d||"",thumb:c.thumb?ye.formatAttachUrl.call(this,c.thumb):ye.formatAttachUrl.call(this,c.thumbnailRemotePath||""),thumb_secret:c.thumb_secret||c.thumbnailSecretKey||"",filename:c.filename||c.displayName||"",length:c.length||c.duration||0,file:{},file_length:c.file_length||c.fileLength||0,filetype:c.filetype||""});break;case"file":l=c.url||c.remotePath||"",d=c.secret||c.secretKey||"",p=this.useOwnUploadFun?l:rt.call(this,{remotePath:l,secretKey:d}),n=Rn(Rn({},s),{type:"file",url:p||"",secret:d||"",file:{},filename:c.filename||c.displayName||"",length:c.length||c.duration||0,file_length:c.file_length||c.fileLength||0,filetype:c.filetype||""});break;case"loc":n=Rn(Rn({},s),{type:"loc",buildingName:c.buildingName||"",addr:c.addr||c.address||"",lat:c.lat||c.latitude||0,lng:c.lng||c.longitude||0});break;case"custom":n=Rn(Rn({},s),{type:"custom",customEvent:c.customEvent||"",customExts:c.customExts||{},params:c.params||{}});break;default:n=Rn(Rn({},s),{type:i})}if(void 0!==u&&(n.text=u),e.highlight&&"object"===On(e.highlight)){for(var h=[],f=0,m=Object.values(e.highlight);f<m.length;f++){var v=m[f];Array.isArray(v)&&h.push.apply(h,v)}h.length>0&&(n.highlight=h)}return n}var xn={singleChat:"chat",chatRoom:"chatroom",groupChat:"groupchat"};function kn(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+n+"/"+o+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i},success:function(t){var r={};t.data.forEach((function(e){r[e]={name:e}})),"function"==typeof(null==e?void 0:e.success)&&e.success(t)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return B.debug("Call getBlocklist"),oe.call(this,a,f.GET_BLACK_LIST)}var Dn=kn,Bn=jn;function jn(e){var t=this,r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={url:this.apiUrl+"/"+o+"/"+i+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+a},success:function(r){var n=[];r.data.forEach((function(e){n.push({name:e,subscription:"both",jid:t.context.jid})})),"function"==typeof(null==e?void 0:e.success)&&e.success(n)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return B.debug("Call getContacts"),oe.call(this,s,f.GET_CONTACTS)}function Gn(e){return B.debug("Call uploadPushToken"),At.call(this,e)}var Hn=Gn;function Fn(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(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 B.debug("Call getSessionList"),oe.call(this,a)}function qn(e){var t=this,r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=!!(e&&"number"==typeof e.pageNum&&"number"==typeof e.pageSize&&e.pageNum>0&&e.pageSize>0),c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/user_channels").concat(s?"/page":""),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return s&&(c.data={pageNum:e.pageNum,pageSize:e.pageSize}),B.debug("Call getConversationlist"),oe.call(this,c,f.GET_SESSION_LIST).then((function(e){return Wn.call(t,e)}))}function Wn(e){var t=this,r=e.data.channel_infos;return null==r||r.forEach((function(e){e.meta&&"{}"!==JSON.stringify(e.meta)?(e.meta.payload=JSON.parse(e.meta.payload),e.lastMessage=Se.call(t,e.meta,{formatCustomExts:!1})):e.lastMessage=e.meta,delete e.meta})),e}function zn(e){if(e&&"string"!=typeof e.channel)throw Error("Invalid parameter channel: ".concat(e.channel));if(e&&"singleChat"!==e.chatType&&"groupChat"!==e.chatType)throw Error("Invalid parameter chatType: ".concat(e.chatType));if(e&&"boolean"!=typeof e.deleteRoam)throw Error("Invalid parameter deleteRoam: ".concat(e.deleteRoam));var t=bt.call(this).error;if(t)return Promise.reject(t);var r,n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid;r="singleChat"===e.chatType?"chat":"groupChat";var c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/user/").concat(this.user,"/user_channel?resource=").concat(s.clientResource),dataType:"json",type:"DELETE",data:JSON.stringify({channel:e.channel,type:r,delete_roam:e.deleteRoam}),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call deleteSession",e),oe.call(this,c,f.DELETE_SESSION)}var Kn=zn;function Vn(e,t){var r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=["nickname","avatarurl","mail","phone","gender","sign","birth","ext"],c={},u=ye.getEnvInfo();if("wx"===u.platform||"qq"===u.platform)if("string"==typeof e&&void 0!==t){if(!s.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");c[e]=t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");s.forEach((function(t){s.includes(t)&&void 0!==e[t]&&(c[t]=e[t])}))}else if("string"==typeof e){if(!s.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");c=e+"="+t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");var l=[];s.forEach((function(t){if(s.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),n=encodeURIComponent(e[t]);l.push(r+"="+n)}})),c=l.join("&")}var d={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/metadata/user/").concat(this.user),type:"PUT",data:c,dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/x-www-form-urlencoded"}};return B.debug("Call updateOwnUserInfo",e),oe.call(this,d,f.UPDATE_USER_INFO)}var Jn=Vn;function Yn(e,t){var r=bt.call(this).error;if(r)return Promise.reject(r);var n,o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=[];if("string"==typeof e)c=[e];else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error("illegal params");c=e}n="string"==typeof t?[t]:t&&"[object Array]"===Object.prototype.toString.call(t)?t:["nickname","avatarurl","mail","phone","gender","sign","birth","ext"];var u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/metadata/user/get"),type:"POST",data:JSON.stringify({targets:c,properties:n}),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return B.debug("Call fetchUserInfoById",e),oe.call(this,u,f.GET_USER_INFO)}function Xn(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(this.user),type:"PUT",dataType:"json",data:JSON.stringify({nickname:e}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return B.debug("Call updateCurrentUserNick",e),oe.call(this,a)}function Qn(e){if("string"!=typeof e||""===e)throw Error('Invalid parameter: "token"');var t=this.context,r=t.orgName,n=t.appName,o={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/sdk/users/").concat(this.user,"/token/expires"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return B.debug("Call getTokenExpireTimestamp",e),oe.call(this,o,f.SDK_INTERNAL)}function $n(e){var t=this;return new Promise((function(r,n){if(!e.queue)throw Error('Invalid parameter: "specified"');var o=bt.call(t).error;if(o)return Promise.reject(o);(function e(t){var o=this,i=t.count||20;Zn.call(this,{count:i,isGroup:!!t.isGroup,queue:t.queue,start:t.start,format:t.format,success:function(n){if(n.msgs.length>=i||n.is_last){var a=n.msgs.splice(0,i).reverse();t.success&&t.success(a),r(a)}else e.call(o,Rn(Rn({},t),{start:null}))},fail:function(e){n(e),t.fail&&t.fail(e)}})}).call(t,e),B.debug("Call fetchHistoryMessages",e)}))}function Zn(e){var t=this,r=e.queue,n=this.mr_cache[r]||(this.mr_cache[r]={msgs:[]}),o=this.context.userId,i=e.start||-1,a=e.count||20;if(n.msgs.length>=a||n.is_last)"function"==typeof e.success&&e.success(n);else{n&&n.next_key&&(i=n.next_key),e.start&&(i=e.start);var c={queue:r+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:i,end:-1},u=this.context,l=u.orgName,d=u.appName,h={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(d,"/users/").concat(o,"/messageroaming"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(c),success:function(r){return Sn(t,void 0,void 0,(function(){var t,o,i,a,s,c,u=this;return bn(this,(function(l){switch(l.label){case 0:if(t=null==r?void 0:r.data,!r.data.msgs)return"function"==typeof e.success&&e.success(n),n.is_last=!0,n.next_key="",[2];o=t.msgs,i=o.length,n.is_last=t.is_last,n.next_key=t.next_key,a=function(t){return Sn(u,void 0,void 0,(function(){var r,n,o,i,a;return bn(this,(function(s){switch(s.label){case 0:for(r=[],t=Ie().atob(t),n=0,o=t.length;n<o;++n)r.push(t.charCodeAt(n));return i=(i=this.context.root.lookup("easemob.pb.Meta")).decode(r),a={errorCode:0,reason:""},1!==i.ns?[3,2]:[4,ct.call(this,i,a,!0,e.format)];case 1:return[2,s.sent()];case 2:return[2]}}))}))},s=0,l.label=1;case 1:return s<i?[4,a(o[s].msg)]:[3,4];case 2:(c=l.sent())&&n.msgs.push(c),l.label=3;case 3:return s++,[3,1];case 4:return"function"==typeof e.success&&e.success(n),[2]}}))}))},error:function(e){if(e.error&&e.error_description){var r=p.create({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:"fetch history messages error",data:e});t.onError&&t.onError(r)}}};oe.call(this,h,f.GET_HISTORY_MSG).catch((function(t){"function"==typeof e.fail&&e.fail(t)}))}}function eo(e){var t=this;return new Promise((function(r,n){var o=e.targetId,i=e.cursor,a=void 0===i?-1:i,s=e.pageSize,c=void 0===s?20:s,u=e.chatType,l=e.searchDirection,d=e.searchOptions,p=void 0===d?{}:d,h=p.msgTypes,m=void 0===h?[]:h,v=p.startTime,g=void 0===v?null:v,y=p.endTime,E=void 0===y?null:y,_=p.from,T=void 0===_?null:_;if("string"!=typeof o||""===o)return n(Un('"Invalid parameter": "targetId"'));if(T&&"string"!=typeof T)return n(Un('"Invalid parameter": "searchOptions.from"'));if(m&&!Array.isArray(m))return n(Un('"Invalid parameter": "searchOptions.msgTypes"'));if(g&&"number"!=typeof g)return n(Un('"Invalid parameter": "searchOptions.startTime"'));if(E&&"number"!=typeof E)return n(Un('"Invalid parameter": "searchOptions.endTime"'));var I=bt.call(t).error;if(I)return n(I);var O=t.context,R=O.orgName,S=O.appName,b=O.userId,C="singleChat"===e.chatType?"@easemob.com":"@conference.easemob.com",N={queue:"".concat(o).concat(C),start:a,pull_number:c,is_positive:"down"===l,msgType:m.join(",")||"",end:-1,startTime:g,endTime:E,userId:"singleChat"===u?null:T},A={url:"".concat(t.apiUrl,"/").concat(R,"/").concat(S,"/users/").concat(b,"/messageroaming"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+t.token,"Content-Type":"application/json"},data:JSON.stringify(N),success:function(n){return Sn(t,void 0,void 0,(function(){var t,o,i,a,s,c,u,l,d=this;return bn(this,(function(p){switch(p.label){case 0:t=null==n?void 0:n.data,o=t.msgs||[],i=function(e){return Sn(d,void 0,void 0,(function(){var t,r,n,o,i;return bn(this,(function(a){switch(a.label){case 0:for(t=[],e=Ie().atob(e),r=0,n=e.length;r<n;++r)t.push(e.charCodeAt(r));return o=(o=this.context.root.lookup("easemob.pb.Meta")).decode(t),i={errorCode:0,reason:""},1!==o.ns?[3,2]:[4,ct.call(this,o,i,!0,!0)];case 1:return[2,a.sent()];case 2:return[2]}}))}))},a=[],s=0,p.label=1;case 1:return s<o.length?[4,i(o[s].msg)]:[3,4];case 2:(c=p.sent())&&a.push(c),p.label=3;case 3:return s++,[3,1];case 4:return t.msgs=a,u={cursor:t.next_key,messages:a,isLast:t.is_last},null===(l=e.success)||void 0===l||l.call(e,u),r(u),[2]}}))}))},error:e.fail};oe.call(t,A,f.REST_FETCHHISTORYMESSAGE).catch((function(e){n(e)})),B.debug("Call getHistoryMessages",e)}))}function to(e){var t,r,n=this,o=bt.call(this).error;if(o)return Promise.reject(o);var i=null==e?void 0:e.option,a=null!==(t=null==e?void 0:e.pageNum)&&void 0!==t?t:1,c=null!==(r=null==e?void 0:e.pageSize)&&void 0!==r?r:20,u=[];try{u=function(e,t,r){var n;if(!e||"object"!==On(e))throw Un('"Invalid parameter": "option"');if(!Array.isArray(e.keywordList))throw Un('"Invalid parameter": "keywordList"');var o=e.keywordList.map((function(e){return"".concat(null!=e?e:"").trim()})).filter((function(e){return e.length>0}));if(0===o.length)throw Un('"Invalid parameter": "keywordList"');if(o.length>An)throw Un('"Invalid parameter": "keywordList exceeds max count 5"');if(o.some((function(e){return e.length<1||e.length>Mn})))throw Un('"Invalid parameter": "keywordList item length exceeds 150"');if(void 0!==e.conversationId&&("string"!=typeof e.conversationId||""===e.conversationId.trim()))throw Un('"Invalid parameter": "conversationId"');if(void 0!==e.conversationType&&!["singleChat","groupChat","chatRoom"].includes(e.conversationType))throw Un('"Invalid parameter": "conversationType"');if(void 0===e.conversationId!=(void 0===e.conversationType))throw Un('"Invalid parameter": "conversationId and conversationType must be used together"');if(void 0!==e.startTime&&void 0===e.endTime||void 0===e.startTime&&void 0!==e.endTime)throw Un('"Invalid parameter": "startTime/endTime"');if(void 0!==e.startTime&&("number"!=typeof e.startTime||"number"!=typeof e.endTime||e.endTime<e.startTime))throw Un('"Invalid parameter": "startTime/endTime"');if("number"!=typeof t||t<1)throw Un('"Invalid parameter": "pageNum"');if("number"!=typeof r||r<1||r>100)throw Un('"Invalid parameter": "pageSize"');if(e.msgTypes&&!Array.isArray(e.msgTypes))throw Un('"Invalid parameter": "msgTypes"');if(null===(n=e.msgTypes)||void 0===n?void 0:n.some((function(e){return wn.has(e)})))throw Un('"Invalid parameter": "msgTypes contains unsupported type"');return o}(i,a,c)}catch(t){return B.error("searchMessages parameter validation failed",{params:e,error:t}),Promise.reject(t)}var l=this.context,d=l.orgName,h=l.appName,m=l.accessToken,v=function(e,t,r,n,o){var i=function(e,t){var r,n=null!==(r=e.keywordListMatchType)&&void 0!==r?r:"or",o={searchMode:"default"};return 1===t.length?o.keyword=t[0]:(o.keywords=t,o.keywordMatch="and"===n?"all":"any"),{data:o,normalizedKeywordList:t}}(e,t).data;return e.conversationId&&("singleChat"===e.conversationType?i.participantPairs=[{userId1:o,userId2:e.conversationId}]:"groupChat"===e.conversationType?i.groupIds=[e.conversationId]:"chatRoom"===e.conversationType?i.chatroomIds=[e.conversationId]:i.conversationId=e.conversationId),e.msgTypes&&e.msgTypes.length>0&&(i.contentType=e.msgTypes.filter((function(e){return e in Cn})).map((function(e){return Cn[e]})).join(",")),"number"==typeof e.startTime&&"number"==typeof e.endTime&&(i.startTime=e.startTime,i.endTime=e.endTime),e.searchScope&&(i.searchExt=e.searchScope),i.sort="relevance:desc",i.highlightEnable=!0,i.page=r,i.size=n,i}(i,u,a,c,this.user),g={url:"".concat(this.apiUrl,"/").concat(d,"/").concat(h,"/users/").concat(this.user,"/messages/search/get"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+m,"Content-Type":"application/json",Accept:"application/json; charset=utf-8"},data:JSON.stringify({data:v})};return B.debug("Call searchMessages",e),oe.call(this,g,f.REST_SEARCH_MESSAGES).then((function(t){var r,o,i=(null==t?void 0:t.data)||{},u=(null==i?void 0:i.data)&&"object"===On(i.data)?i.data:i,l=u.pagination||{},d=Array.isArray(u.items)?u.items:Array.isArray(u.list)?u.list:[];Array.isArray(u.items)||Array.isArray(u.list)||Ln("searchMessages response items/list is invalid",{params:e,responseData:u,rawResponse:t});var h=[];d.forEach((function(t,r){try{h.push(Pn.call(n,t))}catch(n){throw Ln("searchMessages failed to map response item",{params:e,index:r,item:t,error:n}),p.create({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:"Failed to parse search result item",data:{index:r,item:t,error:n}})}}));var f={messages:h,pageNum:l.page||u.page||a,pageSize:c,totalPages:"number"==typeof l.totalPages?l.totalPages:-1,isLast:"number"!=typeof l.isFinished||1===l.isFinished,requestId:null===(r=null==i?void 0:i.meta)||void 0===r?void 0:r.requestId,timestamp:(null===(o=null==i?void 0:i.meta)||void 0===o?void 0:o.timestamp)||Date.now()};return"number"!=typeof l.page&&void 0!==l.page&&Ln("searchMessages pagination.page is invalid",{params:e,pagination:l,rawResponse:t}),f}))}function ro(e,t){return Sn(this,void 0,void 0,(function(){var r,n,o,i,a,s,c;return bn(this,(function(u){switch(u.label){case 0:if(r=bt.call(this).error)return[2,Promise.reject(r)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return B.debug("Call addContact",e,t),n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/contacts/apply?resource=").concat(s.clientResource),type:"POST",dataType:"json",data:JSON.stringify({usernames:[e],reason:t}),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}},[4,oe.call(this,c,f.ROSTER_ADD)];case 1:return u.sent(),[2]}}))}))}var no=oo;function oo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return bn(this,(function(c){switch(c.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return B.debug("Call deleteContact",e),r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(this.user,"/contacts/users/").concat(e,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,s,f.ROSTER_REMOVE)];case 1:return c.sent(),[2]}}))}))}function io(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return bn(this,(function(c){switch(c.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return B.debug("Call acceptInvitation",e),r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(this.user,"/contacts/accept/users/").concat(e,"?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,s,f.ROSTER_ACCEPT)];case 1:return c.sent(),[2]}}))}))}var ao=io;function so(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return bn(this,(function(c){switch(c.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return B.debug("Call declineInvitation",e),r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(this.user,"/contacts/decline/users/").concat(e,"?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,s,f.ROSTER_DECLINE)];case 1:return c.sent(),[2]}}))}))}var co=so;function uo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u;return bn(this,(function(l){switch(l.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if(r=e.name,n=[],"string"==typeof r){if(""===r)throw Error('"Invalid parameter": "name"');n=[r]}else{if(!Array.isArray(r))throw Error('"Invalid parameter": "name"');n=r}return B.debug("Call addToBlockList",e),o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/sdk/user/").concat(this.user,"/blocks?resource=").concat(c.clientResource),type:"POST",dataType:"json",data:JSON.stringify({usernames:n}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,oe.call(this,u,f.ROSTER_BAN).then((function(e){return{type:e.type,data:{userIds:(null==e?void 0:e.data)||[]}}}))];case 1:return[2,l.sent()]}}))}))}var lo=uo,po=uo;function ho(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u;return bn(this,(function(l){switch(l.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if(r=e.name,n=[],"string"==typeof r){if(""===r)throw Error('"Invalid parameter": "name"');n=[r]}else{if(!Array.isArray(r))throw Error('"Invalid parameter": "name"');n=r}return B.debug("Call removeFromBlockList",e),o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/sdk/user/").concat(this.user,"/blocks?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",data:JSON.stringify({usernames:n}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,oe.call(this,u,f.ROSTER_ALLOW)];case 1:return l.sent(),[2]}}))}))}var fo=ho,mo=ho;function vo(e){var t=this,r=(null==e?void 0:e.ext)||"";if("string"!=typeof r)throw Error('"Invalid parameter": "ext"',r);var n=this.getUniqueId(),o={id:n,to:e.to};this._msgHash[n]=Rn({},o);var i="";void 0!==e.chatType?i=e.chatType:void 0!==e.type&&(i="chat"===e.type?"singleChat":e.type);var a={id:n,type:"recall",chatType:i,ackId:e.mid,to:e.to,isChatThread:e.isChatThread||!1,metaExt:r,success:function(r){return Sn(t,void 0,void 0,(function(){var t,n,o,a,s,c,u,l,d;return bn(this,(function(p){switch(p.label){case 0:return p.trys.push([0,5,,6]),"singleChat"!==i&&"groupChat"!==i?[3,4]:[4,null===(o=null===(n=this._localCache)||void 0===n?void 0:n.getInstance())||void 0===o?void 0:o.removeMsgByServerMsgId(e.mid)];case 1:return p.sent(),[4,null===(s=null===(a=this._localCache)||void 0===a?void 0:a.getInstance())||void 0===s?void 0:s.getConversationLastMessage(e.to,i)];case 2:return t=p.sent(),[4,null===(u=null===(c=this._localCache)||void 0===c?void 0:c.getInstance())||void 0===u?void 0:u.updateLocalConversation(be({conversationId:e.to,conversationType:i}),{lastMessageId:null==t?void 0:t.serverMsgId})];case 3:p.sent(),p.label=4;case 4:return null===(l=null==e?void 0:e.success)||void 0===l||l.call(e,r),[3,6];case 5:return p.sent(),null===(d=null==e?void 0:e.success)||void 0===d||d.call(e,r),[3,6];case 6:return[2]}}))}))},fail:e.fail};return B.debug("Call recallMessage",e),this.mSync.send(a,this)}function go(e){var t=e||{},r=t.messageId,n=t.modifiedMessage;if(B.debug("Call modifyMessage",r,n),""===r)throw Error('Invalid parameter: "messageId"');return this.mSync.send(Rn({editMessageId:r},n))}function yo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u;return bn(this,(function(l){switch(l.label){case 0:if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: ".concat(e.reaction));return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.reaction,s=e.messageId,c={msgId:s,message:a},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/reaction/user/").concat(this.user),type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,u)]);case 1:return l.sent(),[2]}}))}))}function Eo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c;return bn(this,(function(u){switch(u.label){case 0:if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reactionId: ".concat(e.reaction));return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.messageId,s=e.reaction,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/reaction/user/").concat(this.user,"?msgId=").concat(a,"&message=").concat(s),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,c)]);case 1:return u.sent(),[2]}}))}))}function _o(e){if("string"!=typeof e.chatType||!e.chatType)throw Error("Invalid parameter chatType: ".concat(e.chatType));if(!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatType,s=e.messageId,c={msgIdList:"string"==typeof s?[s]:s,msgType:"singleChat"===a?"chat":"groupchat",groupId:e.groupId||null},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/reaction/user/").concat(this.user),type:"GET",data:c,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,u).then((function(e){var t=e.data;return null==t||t.forEach((function(e){null==e||e.reactionList.forEach((function(e){e.isAddedBySelf=e.state,delete e.state,delete e.reactionId}))})),e}))}var To=_o;function Io(e){if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: ".concat(e.reaction));if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.cursor,s=e.pageSize,c={msgId:e.messageId,message:e.reaction,currentPage:a||null,pageSize:s||20},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/reaction/user/").concat(this.user,"/detail"),type:"GET",data:c,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,u).then((function(e){return e.data.isAddedBySelf=e.data.state,delete e.data.state,delete e.data.reactionId,e}))}function Oo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d;return bn(this,(function(p){switch(p.label){case 0:if("string"!=typeof e.reportType||!e.reportType)throw Error("Invalid parameter reportType: ".concat(e.reportType));if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.reportReason||!e.reportReason)throw Error("Invalid parameter messageId: ".concat(e.reportReason));return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.reportType,s=e.reportReason,c=e.messageId,u={username:this.user,reportType:a,reportReason:s},l="".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/user/").concat(this.user,"/moderation/report/message/").concat(c),d={url:l,type:"POST",data:JSON.stringify(u),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,d)]);case 1:return p.sent(),[2]}}))}))}function Ro(e){var t;return Sn(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u,l;return bn(this,(function(d){switch(d.label){case 0:if("string"!=typeof e.targetId||""===e.targetId)throw Error('"Invalid parameter targetId": '+e.targetId);if(!["singleChat","groupChat","chatRoom"].includes(e.chatType))throw Error('"Invalid parameter chatType": '+e.chatType);if(e.beforeTimeStamp&&("number"!=typeof e.beforeTimeStamp||e.beforeTimeStamp<0||(null===(t=e.beforeTimeStamp)||void 0===t?void 0:t.toString().length)>18))throw Error('"Invalid parameter beforeTimeStamp": '+e.beforeTimeStamp);if(e.messageIds&&!(Array.isArray(e.messageIds)&&e.messageIds.length>0&&e.messageIds.length<=20))throw Error('"Invalid parameter messageIds": '+e.messageIds);if(!e.messageIds&&!e.beforeTimeStamp)throw Error("messageIds or beforeTimeStamp field is required.");return(r=bt.call(this).error)?[2,Promise.reject(r)]:(n=this.context,o=n.orgName,i=n.appName,a=n.userId,s="singleChat"===e.chatType?"userId":"groupId",c="singleChat"===e.chatType?"chat":"group",u=e.messageIds?"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/sdk/message/roaming/").concat(c,"/user/").concat(a,"?").concat(s,"=").concat(e.targetId,"&msgIdList=").concat(e.messageIds,"&resource=").concat(this.clientResource):"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/sdk/message/roaming/").concat(c,"/user/").concat(a,"/time?").concat(s,"=").concat(e.targetId,"&delTime=").concat(e.beforeTimeStamp,"&&resource=").concat(this.clientResource),l={url:u,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}},B.debug("Call removeHistoryMessages",e),[4,oe.call(this,l)]);case 1:return d.sent(),[2]}}))}))}function So(e){var t=this,r=bt.call(this).error;if(r)return Promise.reject(r);if((null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));if((null==e?void 0:e.includeEmptyConversations)&&"boolean"!=typeof e.includeEmptyConversations)throw Error("Invalid parameter includeEmptyConversations: ".concat(e.includeEmptyConversations));var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/sdk/user/").concat(this.user,"/user_channels/list?"),type:"GET",dataType:"json",data:{limit:(null==e?void 0:e.pageSize)||20,cursor:(null==e?void 0:e.cursor)||"",need_mark:!0,needEmptySession:(null==e?void 0:e.includeEmptyConversations)||!1},headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return B.debug("Call getServerConversations",e),new Promise((function(e,r){oe.call(t,s,f.REST_FETCH_CONVERSATIONS).then((function(r){return Sn(t,void 0,void 0,(function(){var t,n,o=this;return bn(this,(function(i){switch(i.label){case 0:return t=bo.call(this,r),this._localCache?(n=t.data.conversations.map((function(e){return Sn(o,void 0,void 0,(function(){var t,r,n,o;return bn(this,(function(i){switch(i.label){case 0:return[4,null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r?void 0:r.storeMessage(e.lastMessage,Pe.SUCCESS,!0)];case 1:return i.sent(),[4,null===(o=null===(n=this._localCache)||void 0===n?void 0:n.getInstance())||void 0===o?void 0:o.updateLocalConversation(be({conversationId:e.conversationId,conversationType:e.conversationType}),{unReadCount:e.unReadCount})];case 2:return i.sent(),[2]}}))}))})),[4,Promise.all(n)]):[3,2];case 1:i.sent(),i.label=2;case 2:return e(t),[2]}}))}))})).catch((function(e){r(e)}))}))}function bo(e){var t=this,r=e.data,n=r.cursor,o=r.channel_infos,i=[];null==o||o.forEach((function(e){var r=null;(null==e?void 0:e.meta)&&"{}"!==JSON.stringify(e.meta)&&(e.meta.payload=JSON.parse(e.meta.payload),"delivery"!==(r=Se.call(t,e.meta)).type&&"read"!==r.type&&"channel"!==r.type&&(r.chatType=Re[r.chatType]));var n={conversationId:e.session_to,conversationType:"chat"===e.session_type?"singleChat":"groupChat",isPinned:e.is_top,pinnedTime:e.is_top?e.update_top_status_time:0,unReadCount:e.unread_num,lastMessage:r};e.marks&&(n.marks=e.marks.map((function(e){return ht[e]}))),i.push(n)}));var a={conversations:i,cursor:n||""};return{type:e.type,data:a}}function Co(e){var t=this,r=bt.call(this).error;if(r)return Promise.reject(r);if((null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));if((null==e?void 0:e.includeEmptyConversations)&&"boolean"!=typeof e.includeEmptyConversations)throw Error("Invalid parameter includeEmptyConversations: ".concat(e.includeEmptyConversations));var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/sdk/user/").concat(this.user,"/user_channels/list?"),type:"GET",dataType:"json",data:{limit:(null==e?void 0:e.pageSize)||20,cursor:(null==e?void 0:e.cursor)||"",is_top:!0,need_mark:!0,needEmptySession:(null==e?void 0:e.includeEmptyConversations)||!1},headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return B.debug("Call getServerPinnedConversations",e),oe.call(this,s,f.GET_SESSION_LIST).then((function(e){return bo.call(t,e)}))}function No(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d,p,h,m;return bn(this,(function(v){if(t=bt.call(this).error)return[2,Promise.reject(t)];if(r=e.conversationId,n=e.conversationType,o=e.isPinned,i="singleChat"===n?"chat":"groupChat","string"!=typeof r||""===r)throw Error("Invalid parameter conversationId: ".concat(r));if(!["singleChat","groupChat"].includes(n))throw Error("Invalid parameter conversationType: ".concat(n));if("boolean"!=typeof o)throw Error("Invalid parameter isPinned: ".concat(o));return a=this.context,s=a.orgName,c=a.appName,u=a.accessToken,l=a.jid,d={type:i,to:r},p=o?"":"type=".concat(i,"&to=").concat(r,"&"),h="".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/sdk/user/").concat(this.user,"/user_channel/top?").concat(p,"resource=").concat(l.clientResource),m={url:h,type:o?"POST":"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}},o&&(m.data=JSON.stringify(d)),B.debug("Call pinConversation",e),[2,oe.call(this,m,f.PIN_CONVERSATION).then((function(e){var t=e.type,r=e.data;return{type:t,data:{isPinned:r.is_top||!1,pinnedTime:r.is_top?r.update_top_status_time:0}}}))]}))}))}function Ao(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l;return bn(this,(function(d){switch(d.label){case 0:if(t=e.userId,r=e.remark,n=bt.call(this).error)return[2,Promise.reject(n)];if("string"!=typeof t||""===t)throw Error('Invalid parameter: "userId"');if("string"!=typeof r)throw Error('Invalid parameter: "remark"');return B.debug("Call setContactRemark",e),o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u="".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/users/").concat(this.context.userId,"/contacts/users/").concat(t,"?resource=").concat(c.clientResource),l={url:u,type:"PUT",data:JSON.stringify({remark:r}),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,oe.call(this,l,f.ROSTER_SET_CONTACT_REMARK)];case 1:return d.sent(),[2]}}))}))}function Mo(){var e=bt.call(this).error;if(e)return Promise.reject(e);var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/users/").concat(this.user,"/contacts/users?needReturnRemark=true"),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+o}};return B.debug("Call getAllContacts"),oe.call(this,i,f.ROSTER_GET_ALL_CONTACTS_REMARKS).then((function(e){var t=((null==e?void 0:e.entities)||[]).map((function(e){return{userId:e.username,remark:e.remark}}));return{type:e.type,data:t}}))}function wo(e){var t=bt.call(this).error;if(t)return Promise.reject(t);B.debug("Call getContactsWithCursor",e);var r=e||{},n=r.pageSize,o=void 0===n?20:n,i=r.cursor,a=void 0===i?"":i;if(o&&"number"!=typeof o)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));var s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(this.user,"/contacts?needReturnRemark=true&limit=").concat(o,"&cursor=").concat(a),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+l}};return oe.call(this,d,f.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE).then((function(e){var t,r,n=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.contacts)||[],o=(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.cursor)||"",i=n.map((function(e){return{userId:e.username,remark:e.remark}}));return{type:e.type,data:{cursor:o,contacts:i}}}))}function Uo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d,p,h,m,v;return bn(this,(function(g){switch(g.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if(B.debug("Call markConversation",e),n=(r=e||{}).conversations,o=void 0===n?[]:n,i=r.mark,a=r.isMarked,!Array.isArray(o))throw Error("Invalid parameter conversations");if(s=o.map((function(e){if(!e.conversationId||!["singleChat","groupChat"].includes(e.conversationType))throw Error("Invalid parameter conversations");return{to:e.conversationId,type:xn[e.conversationType]}})),"boolean"!=typeof a)throw Error("Invalid parameter isMarked: ".concat(a));if("number"!=typeof i)throw Error("Invalid parameter mark: ".concat(i));return c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.userId,h=c.jid,m={mark:ht[i],targets:s},v={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/sdk/user/").concat(p,"/user_channels/mark?resource=").concat(h.clientResource),dataType:"json",data:JSON.stringify(m),type:a?"Post":"Delete",headers:{Authorization:"Bearer "+d}},[4,oe.call(this,v,f.MARK_CONVERSATION).then((function(e){var t,r=(null===(t=e.data)||void 0===t?void 0:t.ignore)||[];r&&Array.isArray(r)&&r.length>0&&B.debug("markConversation has ignored conversations",r.map((function(e){return{conversationId:e.to,conversationType:Re[e.type]}})))}))];case 1:return g.sent(),[2]}}))}))}function Lo(e){return Sn(this,void 0,void 0,(function(){var t,r;return bn(this,(function(n){return B.debug("Call addConversationMark",e),t=e.conversations,r=e.mark,[2,Uo.call(this,{conversations:t,mark:r,isMarked:!0})]}))}))}function Po(e){return Sn(this,void 0,void 0,(function(){var t,r;return bn(this,(function(n){return B.debug("Call removeConversationMark",e),t=e.conversations,r=e.mark,[2,Uo.call(this,{conversations:t,mark:r,isMarked:!1})]}))}))}function xo(e){var t,r,n=this,o=bt.call(this).error;if(o)return Promise.reject(o);if(B.debug("Call getServerConversationsByFilter",e),(null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));if("number"!=typeof(null===(t=null==e?void 0:e.filter)||void 0===t?void 0:t.mark))throw Error("Invalid parameter mark: ".concat(null===(r=null==e?void 0:e.filter)||void 0===r?void 0:r.mark));var i=this.context,a=i.orgName,s=i.appName,c=i.accessToken,u="".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/sdk/user/").concat(this.user,"/user_channels/mark/search?"),l=e.pageSize,d=e.cursor,p=((null==e?void 0:e.filter)||{}).mark,h={url:u,type:"GET",dataType:"json",data:{limit:l||10,cursor:d||"",need_mark:!0,mark:ht[p]},headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}};return oe.call(this,h,f.GET_SESSION_LIST).then((function(e){return bo.call(n,e)}))}function ko(){var e=bt.call(this).error;if(e)return Promise.reject(e);B.debug("Call getSelfIdsOnOtherPlatform");var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i=t.userId,a=t.jid,s={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/users/").concat(i,"/resources"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"}};return oe.call(this,s,f.USER_LOGGEDIN_OTHER_PLATFORM).then((function(e){var t,r=null===(t=e.data)||void 0===t?void 0:t.filter((function(e){return e.res!==a.clientResource})),n=null==r?void 0:r.map((function(e){return"".concat(i,"/").concat(e.res)}));return{type:e.type,data:n}}))}function Do(){var e,t,r,n,o,i;return Sn(this,void 0,void 0,(function(){var a,s,c,u,l,d,p,h,m;return bn(this,(function(v){switch(v.label){case 0:return(a=bt.call(this).error)?[2,Promise.reject(a)]:(B.debug("Call deleteAllMessagesAndConversations"),s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d=s.userId,p=s.jid,h="".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/sdk/message/roaming/user/").concat(d,"/delete/all?resource=").concat(p.clientResource),m={url:h,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"}},[4,oe.call(this,m,f.REST_DELETE_MESSAGES_CONVERSATIONS)]);case 1:return v.sent(),null===(t=null===(e=this._localCache)||void 0===e?void 0:e.getInstance())||void 0===t||t.clearConversationMap(),[4,null===(n=null===(r=this._localCache)||void 0===r?void 0:r.getInstance())||void 0===n?void 0:n.clearStoreData("conversationList")];case 2:return v.sent(),[4,null===(i=null===(o=this._localCache)||void 0===o?void 0:o.getInstance())||void 0===i?void 0:i.clearStoreData("message")];case 3:return v.sent(),[2]}}))}))}function Bo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d,p,h,m,v;return bn(this,(function(g){switch(g.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if(B.debug("Call setMessagePinStatus",e),n=(r=e||{}).conversationId,o=void 0===n?"":n,i=r.conversationType,a=r.messageId,s=r.isPinned,"string"!=typeof o||""===o)throw Error("Invalid parameter conversationId");if("string"!=typeof a||""===a)throw Error("Invalid parameter messageId");if("boolean"!=typeof s)throw Error("Invalid parameter isPinned");return c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.userId,h=c.jid,m={to:o,type:xn[i],pin_msg_id:a},v={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/sdk/user/").concat(p,"/user_channel/pin?resource=").concat(h.clientResource),dataType:"json",data:JSON.stringify(m),type:s?"Post":"Delete",headers:{Authorization:"Bearer "+d}},[4,oe.call(this,v,f.REST_PIN_MESSAGE)];case 1:return g.sent(),[2]}}))}))}function jo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o;return bn(this,(function(i){return B.debug("Call pinMessage",e),r=(t=e||{}).conversationType,n=t.conversationId,o=t.messageId,[2,Bo.call(this,{conversationId:n,conversationType:r,messageId:o,isPinned:!0})]}))}))}function Go(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o;return bn(this,(function(i){return B.debug("Call unpinMessage",e),r=(t=e||{}).conversationType,n=t.conversationId,o=t.messageId,[2,Bo.call(this,{conversationId:n,conversationType:r,messageId:o,isPinned:!1})]}))}))}function Ho(e){var t=this,r=bt.call(this).error;if(r)return Promise.reject(r);B.debug("Call getServerPinnedMessages",e);var n=e.conversationId,o=e.conversationType,i=e.pageSize,a=e.cursor;if("string"!=typeof n||""===n)throw Error("Invalid parameter conversationId");if(i&&"number"!=typeof i)throw Error("Invalid parameter pageSize: ".concat(i));if(a&&"string"!=typeof a)throw Error("Invalid parameter cursor: ".concat(a));var s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/sdk/user/").concat(this.user,"/user_channel/pin"),type:"GET",dataType:"json",data:{to:n,type:xn[o],limit:i||10,cursor:a||""},headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"}};return oe.call(this,d,f.GET_SESSION_LIST).then((function(e){return{type:0,data:{list:e.data.msg_infos.map((function(e){e.message.payload=JSON.parse(e.message.payload);var r=e.message,n=e.pin_opt_at,o=e.pin_operator;return{message:Se.call(t,r,{formatChatType:!0}),pinTime:n,operatorId:o}})),cursor:e.data.cursor||""}}}))}function Fo(){var e=this;B.debug("Call unbindPushToken");var t={deviceId:this.clientResource,deviceToken:"",notifierName:this.pushCertificateName};return At.call(this,t).then((function(t){return e.isRegisterPush=!1,t}))}function qo(e){if(!e||"string"!=typeof e.fileId||""===e.fileId)return Promise.reject(Error('Invalid parameter: "fileId"'));if(void 0!==e.currentUserId&&"string"!=typeof e.currentUserId)return Promise.reject(Error('Invalid parameter: "currentUserId"'));if(void 0!==e.audio){if("object"!==On(e.audio)||null===e.audio||Array.isArray(e.audio))return Promise.reject(Error('Invalid parameter: "audio"'));var t=e.audio,r=t.format,n=t.sampleRate,o=t.bitsPerSample,i=t.channels;if(void 0!==r&&"string"!=typeof r)return Promise.reject(Error('Invalid parameter: "audio.format"'));if(void 0!==n&&"number"!=typeof n)return Promise.reject(Error('Invalid parameter: "audio.sampleRate"'));if(void 0!==o&&"number"!=typeof o)return Promise.reject(Error('Invalid parameter: "audio.bitsPerSample"'));if(void 0!==i&&"number"!=typeof i)return Promise.reject(Error('Invalid parameter: "audio.channels"'))}var a=bt.call(this).error;if(a)return Promise.reject(a);var s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d=s.userId,p=e.currentUserId||d,h={data:Rn({fileId:e.fileId,username:p},e.audio?{audio:e.audio}:{})};if(!c||!u||!p)return Promise.reject(Error('Invalid parameter: "orgname", "appname" or "currentUserId"'));var f={url:"".concat(this.apiUrl,"/api/sdk/v1/").concat(c,"/").concat(u,"/speech/transcriptions"),type:"POST",dataType:"json",data:JSON.stringify(h),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json",Accept:"application/json"}};return B.debug("Call transcribeSpeech",h),oe.call(this,f).then((function(e){var t;return{type:0,data:{text:(null===(t=e.data)||void 0===t?void 0:t.text)||""}}}))}function Wo(e){if(!e||!Vo(t=e.file)&&!Jo(t))return Promise.reject(Error('Invalid parameter: "file"'));var t;if(void 0!==e.currentUserId&&"string"!=typeof e.currentUserId)return Promise.reject(Error('Invalid parameter: "currentUserId"'));if(void 0!==e.audio){if("object"!==On(e.audio)||null===e.audio||Array.isArray(e.audio))return Promise.reject(Error('Invalid parameter: "audio"'));var r=e.audio,n=r.format,o=r.sampleRate,i=r.bitsPerSample,a=r.channels;if(void 0!==n&&"string"!=typeof n)return Promise.reject(Error('Invalid parameter: "audio.format"'));if(void 0!==o&&"number"!=typeof o)return Promise.reject(Error('Invalid parameter: "audio.sampleRate"'));if(void 0!==i&&"number"!=typeof i)return Promise.reject(Error('Invalid parameter: "audio.bitsPerSample"'));if(void 0!==a&&"number"!=typeof a)return Promise.reject(Error('Invalid parameter: "audio.channels"'))}var c=bt.call(this).error;if(c)return Promise.reject(c);var u=this.context,l=u.orgName,d=u.appName,p=u.accessToken,h=u.userId,f=e.currentUserId||h;if(!l||!d||!f)return Promise.reject(Error('Invalid parameter: "orgname", "appname" or "currentUserId"'));var m="".concat(this.apiUrl,"/api/sdk/v1/").concat(l,"/").concat(d,"/speech/recognitions");if(Vo(e.file))return function(e){var t=new FormData,r=zo(e.currentUserId,e.audio);return Object.keys(r).forEach((function(e){t.append(e,r[e])})),t.append("file",e.file),B.debug("Call recognizeSpeech",{currentUserId:e.currentUserId,fileName:e.file.name,fileSize:e.file.size,audio:e.audio}),new Promise((function(r,n){var o=new XMLHttpRequest;o.timeout=q,o.ontimeout=function(){n({type:s.REQUEST_TIMEOUT,message:"Request Timeout",errorType:"timeout_error",xhr:o})},o.onerror=function(){n({type:s.REQUEST_UNKNOWN,message:"Request Unknown Error",errorType:"onerror",xhr:o})},o.onabort=function(){n({type:s.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:o})},o.onreadystatechange=function(){var e,t;if(4===o.readyState){var i=Ko(o.responseText);200!==o.status?n({type:o.status||s.REQUEST_UNKNOWN,data:i,message:(null===(t=null==i?void 0:i.error)||void 0===t?void 0:t.message)||(null==i?void 0:i.message)||"Request Error",xhr:o}):r({type:s.REQUEST_SUCCESS,data:{text:(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.text)||""}})}},o.open("POST",e.requestUrl),o.setRequestHeader("Authorization","Bearer "+e.accessToken),o.setRequestHeader("Accept","application/json"),o.send(t)}))}({file:e.file,currentUserId:f,audio:e.audio,requestUrl:m,accessToken:p});var v=Yo();return Jo(e.file)&&v?function(e){var t=zo(e.currentUserId,e.audio);return B.debug("Call recognizeSpeech",{currentUserId:e.currentUserId,filePath:e.file.filePath,fileName:e.file.name||e.file.filePath.split("?")[0].split("/").filter(Boolean).pop(),fileSize:e.file.size,audio:e.audio}),new Promise((function(r,n){e.platForm.global.uploadFile({url:e.requestUrl,filePath:e.file.filePath,name:"file",header:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+e.accessToken,Accept:"application/json"},formData:t,success:function(e){var t,o,i=Ko(e.data);200!==e.statusCode?n({type:e.statusCode||s.REQUEST_UNKNOWN,data:i,message:(null===(o=null==i?void 0:i.error)||void 0===o?void 0:o.message)||(null==i?void 0:i.message)||"Request Error"}):r({type:s.REQUEST_SUCCESS,data:{text:(null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.text)||""}})},fail:function(e){n({type:s.REQUEST_UNKNOWN,message:"Request Unknown Error",errorType:"upload_fail",data:e})}})}))}({file:e.file,currentUserId:f,audio:e.audio,requestUrl:m,accessToken:p,platForm:v}):Promise.reject(Error('Invalid parameter: "file"'))}function zo(e,t){var r={username:e};return void 0!==(null==t?void 0:t.format)&&(r["audio.format"]=t.format),void 0!==(null==t?void 0:t.sampleRate)&&(r["audio.sampleRate"]=String(t.sampleRate)),void 0!==(null==t?void 0:t.bitsPerSample)&&(r["audio.bitsPerSample"]=String(t.bitsPerSample)),void 0!==(null==t?void 0:t.channels)&&(r["audio.channels"]=String(t.channels)),r}function Ko(e){if("string"==typeof e&&e)try{return JSON.parse(e)}catch(t){return e}return e}function Vo(e){return"undefined"!=typeof File&&e instanceof File}function Jo(e){return"object"===On(e)&&null!==e&&!Array.isArray(e)&&"string"==typeof e.filePath&&""!==e.filePath}function Yo(){var e,t=ye.getEnvInfo();if("web"!==t.platform&&"node"!==t.platform&&"quick_app"!==t.platform&&"function"==typeof(null===(e=t.global)||void 0===e?void 0:e.uploadFile))return t}function Xo(e){var t,r=function(e){var t,r,n=Ko(null==e?void 0:e.data),o=null===(t=null==n?void 0:n.error)||void 0===t?void 0:t.code;return{serviceCode:"string"==typeof o||"number"==typeof o?String(o):void 0,serviceMessage:null===(r=null==n?void 0:n.error)||void 0===r?void 0:r.message}}(e),n=r.serviceCode,o=r.serviceMessage;if("number"==typeof(null==e?void 0:e.type)&&!n)return{type:e.type,message:(null==e?void 0:e.message)||"Voice-to-text failed"};switch(n){case"4041001":return{type:s.FILE_NOT_FOUND,message:"File not found"};case"4001002":return{type:s.FILE_INVALID,message:"Invalid file"};case"5021001":return{type:s.WEBIM_UPLOADFILE_ERROR,message:"File upload failed"};case"4001003":return{type:s.FILE_DURATION_TOO_LONG,message:"Voice duration exceeds 60 seconds"};case"4031001":return{type:s.SERVICE_NOT_ENABLED,message:"Service not enabled"};case"4031002":return{type:s.MAX_LIMIT,message:"Beta service usage limit exceeded"};case"4001001":return"string"==typeof(t=o)&&t.toLowerCase().includes("uploaded file exceeds")?{type:s.FILE_TOO_LARGE,message:"File too large"}:{type:s.REQUEST_PARAMETER_ERROR,message:o||"Missing or invalid request parameter"};case"5021003":case"5001003":return{type:s.FILE_VOICE_TO_TEXT_FAILED,message:"Voice-to-text failed"};case"4011001":return{type:s.NO_PERMISSION,message:o||"Unauthorized or invalid token"};default:return{type:s.FILE_VOICE_TO_TEXT_FAILED,message:o||(null==e?void 0:e.message)||"Voice-to-text failed"}}}function Qo(e,t,r){void 0===r&&(r="");var n={type:e};return e===s.REQUEST_SUCCESS?(n.data={text:r},n):(void 0!==t&&(n.message=t),n)}function $o(e){return!(void 0===e||"object"===On(e)&&null!==e&&!Array.isArray(e))||void 0!==(null==e?void 0:e.format)&&"string"!=typeof e.format||void 0!==(null==e?void 0:e.sampleRate)&&"number"!=typeof e.sampleRate||void 0!==(null==e?void 0:e.bitsPerSample)&&"number"!=typeof e.bitsPerSample||void 0!==(null==e?void 0:e.channels)&&"number"!=typeof e.channels}function Zo(e,t){if(!e||"audio"!==e.type)return Promise.reject(Qo(s.FILE_INVALID,"Invalid file"));if($o(t))return Promise.reject(Qo(s.FILE_INVALID,"Invalid file"));if(!e.url)return Promise.reject(Qo(s.FILE_NOT_FOUND,"File not found"));var r=function(e){if(e){var t=e.split("#")[0].split("?")[0].split("/").filter(Boolean);return t[t.length-1]}}(e.url);return r?qo.call(this,Rn({fileId:r},t?{audio:t}:{})).then((function(e){var t;return Qo(e.type,e.message,(null===(t=e.data)||void 0===t?void 0:t.text)||"")})).catch((function(e){var t=Xo(e);throw Qo(t.type,t.message)})):Promise.reject(Qo(s.FILE_INVALID,"Invalid file"))}function ei(e,t){return $o(t)?Promise.reject(Qo(s.FILE_INVALID,"Invalid file")):Vo(e)||Jo(e)&&Yo()?Wo.call(this,Rn({file:e},t?{audio:t}:{})).then((function(e){var t;return Qo(e.type,e.message,(null===(t=e.data)||void 0===t?void 0:t.text)||"")})).catch((function(e){var t=Xo(e);throw Qo(t.type,t.message)})):Promise.reject(Qo(s.FILE_INVALID,"Invalid file"))}function ti(e){void 0===e&&(e="*");var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i=t.userId,a={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/users/").concat(i,"/token/rtc?channelName=").concat(e),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"}};return oe.call(this,a).then((function(e){return{type:e.type,data:{appId:(null==e?void 0:e.app_id)||"",RTCToken:(null==e?void 0:e.rtc_token)||"",channelName:(null==e?void 0:e.channel_name)||"",RTCUId:(null==e?void 0:e.rtcUid)||0,expire:(null==e?void 0:e.expires_in)||0}}}))}function ri(e){if(!Array.isArray(e)||0===e.length)throw Error("Invalid parameter RTCUIds: "+e);var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/rtc_mapper/batch/get"),type:"POST",dataType:"json",data:JSON.stringify({data:e}),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"}};return oe.call(this,i).then((function(e){return{type:e.type,data:e.data||{}}}))}function ni(e){return ni="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ni(e)}var oi=function(){return oi=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},oi.apply(this,arguments)},ii=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},ai=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function si(e){if(!e||!e.data)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups?resource=").concat(a.clientResource),dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:e.data.groupname,avatar:e.data.avatar,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,maxusers:e.data.maxusers,custom:e.data.ext}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:function(t){e.success&&e.success(t)},error:e.error};return B.debug("Call createGroup:",e),oe.call(this,s,f.CREATE_GROUP)}var ci=si;function ui(e){var t,r,n,o,i,a,c,u,l;if(!e)throw Error("Invalid parameter");var d=bt.call(this).error;if(d)return Promise.reject(d);var p=this.context,h=p.orgName,m=p.appName,v=p.accessToken,g=p.jid,y={url:"".concat(this.apiUrl,"/").concat(h,"/").concat(m,"/chatgroups?resource=").concat(g.clientResource),dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:null!==(t=e.groupName)&&void 0!==t?t:"",avatar:null!==(r=e.avatar)&&void 0!==r?r:"",desc:null!==(n=e.description)&&void 0!==n?n:"",members:e.members,public:null!==(o=e.isPublic)&&void 0!==o&&o,approval:null!==(i=e.needApprovalToJoin)&&void 0!==i&&i,allowinvites:null===(a=e.allowMemberToInvite)||void 0===a||a,invite_need_confirm:null!==(c=e.inviteNeedConfirm)&&void 0!==c&&c,maxusers:null!==(u=e.maxMemberCount)&&void 0!==u?u:200,custom:null!==(l=e.extension)&&void 0!==l?l:""}),headers:{Authorization:"Bearer "+v,"Content-Type":"application/json"}};return B.debug("Call createGroupVNext:",e),oe.call(this,y,f.CREATE_GROUP).then((function(e){return{type:s.REQUEST_SUCCESS,data:{groupId:e.data.groupid}}}))}function li(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");var r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c={entities:[(t={},t["notification_ignore_"+e.groupId]=!0,t)]},u={type:"PUT",url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"?resource=").concat(s.clientResource),data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call blockGroupMessages",e),oe.call(this,u,f.BLOCK_GROUP)}var di=li;function pi(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={limit:e.limit,cursor:e.cursor};e.cursor||delete a.cursor;var s={url:this.apiUrl+"/"+n+"/"+o+"/publicchatgroups?version=v3",type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call listGroups",e),oe.call(this,s,f.LIST_GROUP).then((function(t){var r,n=t.data.map((function(e){return{groupid:e.id,groupname:e.name}}));return null===(r=e.success)||void 0===r||r.call(e,oi(oi({},t),{data:n})),oi(oi({},t),{data:n})}))}var hi=pi;function fi(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+n+"/"+o+"/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 B.debug("Call getJoinedGroups",e),oe.call(this,a,f.GET_USER_GROUP)}function mi(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.needAffiliations||e.needRole?"/chatgroups/user/".concat(this.user,"?pagenum=").concat(e.pageNum,"&pagesize=").concat(e.pageSize,"&needAffiliations=").concat(e.needAffiliations,"&needRole=").concat(e.needRole,"&version=v3"):"/users/".concat(this.user,"/joined_chatgroups?pagenum=").concat(e.pageNum,"&pagesize=").concat(e.pageSize,"&version=v3"),s={url:this.apiUrl+"/"+n+"/"+o+a,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e&&(null==e?void 0:e.error)};return B.debug("Call getGroup",e),oe.call(this,s,f.GET_USER_GROUP).then((function(t){var r,n=t.uri,o=t.entities,i=[];if(n.includes("joined_chatgroups")){var a=t.data.map((function(e){return{groupid:e.id,groupname:e.name,disabled:e.disabled,role:e.permission}}));return null===(r=null==e?void 0:e.success)||void 0===r||r.call(e,oi(oi({},t),{data:a})),oi(oi({},t),{data:a})}return o.forEach((function(e){var t={affiliationsCount:e.affiliations_count,groupName:e.name,groupId:e.groupId,role:e.permission,disabled:e.disabled,approval:e.membersonly,allowInvites:e.allowinvites,description:e.description,maxUsers:e.maxusers,public:e.public};i.push(t)})),t.entities=i,t}))}function vi(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r={newowner:e.newOwner},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/chatgroups/").concat(e.groupId,"?resource=").concat(s.clientResource),type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},data:JSON.stringify(r),success:e.success,error:e.error};return B.debug("Call changeOwner",e),oe.call(this,c,f.CHANGE_OWNER)}var gi=vi;function yi(e){if("string"!=typeof e.groupId&&!Array.isArray(e.groupId))throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+n+"/"+o+"/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 B.debug("Call getGroupInfo",e),oe.call(this,a,f.GET_GROUP_INFO)}function Ei(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={groupname:e.groupName,avatar:e.avatar,description:e.description,custom:e.ext},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"?resource=").concat(a.clientResource),type:"PUT",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call modifyGroup",e),oe.call(this,u,f.MODIFY_GROUP)}function _i(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');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={pagenum:e.pageNum,pagesize:e.pageSize},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={url:this.apiUrl+"/"+o+"/"+i+"/chatgroups/"+e.groupId+"/users?version=v3",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call listGroupMember",e),oe.call(this,s,f.LIST_GROUP_MEMBER)}var Ti=_i;function Ii(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(e.cursor&&"string"!=typeof e.cursor)throw Error('Invalid parameter: "cursor"');if(e.limit&&"number"!=typeof e.limit)throw Error('Invalid parameter: "limit"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={cursor:e.cursor,limit:e.limit||50,joined_time:!0},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+o+"/"+i+"/chatgroups/"+e.groupId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return B.debug("Call getGroupMembers",e),oe.call(this,c,f.LIST_GROUP_MEMBER).then((function(e){var t=e.data,r=e.cursor,n=t.map((function(e){for(var t in e)if(["member","admin","owner"].includes(t))return{role:t,userId:e[t],joinedTime:e.joined_time}}));return{type:s.REQUEST_SUCCESS,data:{cursor:r,members:n}}}))}function Oi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatgroups/"+a+"/admin?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getGroupAdmin",e),oe.call(this,s,f.GET_GROUP_ADMIN)}function Ri(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={newadmin:e.username},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/admin?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call setGroupAdmin",e),oe.call(this,u,f.SET_GROUP_ADMIN)}var Si=Ri;function bi(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/admin/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeAdmin",e),oe.call(this,u,f.REMOVE_GROUP_ADMIN)}var Ci=bi;function Ni(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"?version=v3&resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call destroyGroup",e),oe.call(this,c,f.DISSOLVE_GROUP)}var Ai=Ni;function Mi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/quit?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call quitGroup",e),oe.call(this,c,f.QUIT_GROUP)}var wi=Mi;function Ui(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=e.groupId,n={usernames:e.users},o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatgroups/").concat(r,"/invite?resource=").concat(c.clientResource),type:"POST",data:JSON.stringify(n),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call inviteUsersToGroup",e),oe.call(this,u,f.INVITE_TO_GROUP)}var Li=Ui;function Pi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(e.groupId,"/apply?resource=").concat(a.clientResource),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 B.debug("Call joinGroup",e),oe.call(this,s,f.JOIN_GROUP)}function xi(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={applicant:e.applicant,verifyResult:!0,reason:"no clue"},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/apply_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call agreeJoinGroup",e),oe.call(this,u,f.AGREE_JOIN_GROUP)}var ki=xi;function Di(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={applicant:e.applicant,verifyResult:!1,reason:e.reason||""},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/apply_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call rejectGroupJoinRequest",e),oe.call(this,u,f.REJECT_JOIN_GROUP)}var Bi=Di;function ji(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={invitee:e.invitee,verifyResult:!0},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/invite_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call acceptGroupInvite",e),oe.call(this,u,f.AGREE_INVITE_GROUP)}var Gi=ji;function Hi(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={invitee:e.invitee,verifyResult:!1},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/invite_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call rejectGroupInvite",e),oe.call(this,u,f.REJECT_INVITE_GROUP)}var Fi=Hi;function qi(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=e.groupId,n=e.username,o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatgroups/").concat(r,"/users/").concat(n,"?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeGroupMember",e),oe.call(this,u,f.REMOVE_GROUP_MEMBER)}var Wi=qi;function zi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.users.join(","),u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/users/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeGroupMembers",e),oe.call(this,u,f.MULTI_REMOVE_GROUP_MEMBER)}var Ki=zi;function Vi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!(Array.isArray(e.username)||"string"==typeof e.username&&""!==e.username))throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={usernames:"string"==typeof e.username?[e.username]:e.username,mute_duration:e.muteDuration},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/mute?resource=").concat(a.clientResource,"&version=v3"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(c),success:e.success,error:e.error};return B.debug("Call muteGroupMember",e),oe.call(this,u,f.MUTE_GROUP_MEMBER)}var Ji=Vi;function Yi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!(Array.isArray(e.username)||"string"==typeof e.username&&""!==e.username))throw Error('Invalid parameter: "username"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/mute/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call unmuteGroupMember",e),oe.call(this,u,f.UNMUTE_GROUP_MEMBER)}var Xi=Yi;function Qi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatgroups/"+a+"/mute?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getGroupMuteList",e),oe.call(this,s,f.GET_GROUP_MUTE_LIST)}var $i=Qi,Zi=Qi;function ea(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call blockGroupMember",e),oe.call(this,u,f.BLOCK_GROUP_MEMBER).then((function(t){var r,n=t.data[0]||{},o={action:"add_blocks",groupid:e.groupId,result:n.result,user:n.user};return null===(r=null==e?void 0:e.success)||void 0===r||r.call(e,oi(oi({},t),{data:o})),oi(oi({},t),{data:o})}))}var ta=ea;function ra(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={usernames:e.usernames},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/blocks/users?resource=").concat(a.clientResource,"&version=v3"),data:JSON.stringify(c),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call blockGroupMembers",e),oe.call(this,u,f.BLOCK_GROUP_MEMBERS).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return oi(oi({},t),{action:"add_blocks",groupid:e.groupId})}));return null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,oi(oi({},t),{data:o})),oi(oi({},t),{data:o})}))}var na=ra;function oa(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call unblockGroupMember",e),oe.call(this,u,f.UNBLOCK_GROUP_MEMBER).then((function(t){var r,n=t.data[0]||{},o={action:"remove_blocks",groupid:e.groupId,result:n.result,user:n.user};return null===(r=null==e?void 0:e.success)||void 0===r||r.call(e,oi(oi({},t),{data:o})),oi(oi({},t),{data:o})}))}var ia=oa;function aa(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.usernames.join(","),u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call unblockGroupMembers",e),oe.call(this,u,f.UNBLOCK_GROUP_MEMBERS).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return oi(oi({},t),{action:"remove_blocks",groupid:e.groupId})}));return null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,oi(oi({},t),{data:o})),oi(oi({},t),{data:o})}))}var sa=aa;function ca(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatgroups/"+a+"/blocks/users?version=v3",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getGroupBlacklist",e),oe.call(this,s,f.GET_GROUP_BLACK_LIST)}var ua=ca,la=ca;function da(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/ban?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call disableSendGroupMsg",e),oe.call(this,c,f.DISABLED_SEND_GROUP_MSG)}function pa(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/ban?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call enableSendGroupMsg",e),oe.call(this,c,f.ENABLE_SEND_GROUP_MSG)}function ha(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={usernames:e.users},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/white/users?resource=").concat(a.clientResource,"&version=v3"),type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call addUsersToGroupWhitelist",e),oe.call(this,u,f.ADD_USERS_TO_GROUP_WHITE).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return oi(oi({},t),{action:"add_user_whitelist",groupid:e.groupId})}));return 1===(null==o?void 0:o.length)&&(o=o[0]),null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,oi(oi({},t),{data:o})),oi(oi({},t),{data:o})}))}var fa=ha;function ma(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/white/users/").concat(e.userName,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call removeGroupAllowlistMember",e),oe.call(this,c,f.REMOVE_GROUP_WHITE_MEMBER).then((function(t){var r,n=t.data[0]||{},o={action:"remove_user_whitelist",groupid:e.groupId,result:n.result,user:n.user};return null===(r=null==e?void 0:e.success)||void 0===r||r.call(e,oi(oi({},t),{data:o})),oi(oi({},t),{data:o})}))}var va=ma,ga=ma;function ya(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatgroups/"+a+"/white/users?version=v3",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getGroupAllowlist",e),oe.call(this,s,f.GET_GROUP_WHITE_LIST)}var Ea=ya;function _a(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatgroups/"+a+"/white/users/"+e.userName+"?version=v3",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call isInGroupAllowlist",e),oe.call(this,s,f.IS_IN_GROUP_WHITE_LIST)}var Ta=_a,Ia=_a;function Oa(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.userId,s={url:this.apiUrl+"/"+n+"/"+o+"/sdk/chatgroups/"+e.groupId+"/mute/"+a+"?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i}};return B.debug("Call isInGroupMutelist",e),oe.call(this,s).then((function(e){return{type:e.type,data:e.data}}))}function Ra(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+n+"/"+o+"/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 B.debug("Call getGroupMsgReadUser",e),oe.call(this,a,f.GET_GROUP_MSG_READ_USER)}function Sa(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(a,"/announcement?version=v3"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call fetchGroupAnnouncement",e),oe.call(this,s,f.GET_GROUP_ANN)}function ba(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={announcement:e.announcement},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/announcement?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call updateGroupAnnouncement",e),oe.call(this,u,f.UPDATE_GROUP_ANN)}function Ca(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("object"!==ni(e.file))throw Error('Invalid parameter: "file"');var r=bt.call(this).error;if(r)return null===(t=e.onFileUploadError)||void 0===t?void 0:t.call(e,r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c=e.groupId;he.call(this,{uploadUrl:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/chatgroups/").concat(c,"/share_files?resource=").concat(s.clientResource),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:a,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey,to:c,chatType:"groupChat"},f.UPLOAD_GROUP_FILE),B.debug("Call uploadGroupSharedFile",e)}function Na(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.fileId,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/share_files/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call deleteGroupSharedFile",e),oe.call(this,u,f.DELETE_GROUP_FILE)}function Aa(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.pageNum||1,s=e.pageSize||10,c=e.groupId,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(c,"/share_files?pagenum=").concat(a,"&pagesize=").concat(s,"&version=v3"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getGroupSharedFilelist",e),oe.call(this,u,f.GET_GROUP_FILE_LIST)}var Ma=Aa;function wa(e){var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i=this.apiUrl,a=e.groupId,s=e.fileId;fe.call(this,{url:"".concat(i,"/").concat(r,"/").concat(n,"/chatgroups/").concat(a,"/share_files/").concat(s),onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:o,id:s,secret:e.secret},f.DOWN_GROUP_FILE),B.debug("Call downloadGroupSharedFile",e)}function Ua(e){return ii(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d;return ai(this,(function(p){switch(p.label){case 0:if(t=e.groupId,r=e.userId,n=e.memberAttributes,"string"!=typeof t||""===t)throw Error('Invalid parameter: "groupId"');if("string"!=typeof r||""===r)throw Error('Invalid parameter: "userId"');if("object"!==ni(n))throw Error('Invalid parameter: "memberAttributes"');return(o=bt.call(this).error)?[2,Promise.reject(o)]:(i=this.context,a=i.orgName,s=i.appName,c=i.accessToken,u=i.jid,l={metaData:n},d={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/sdk/metadata/chatgroup/").concat(t,"/user/").concat(r,"?resource=").concat(u.clientResource,"&version=v3"),type:"PUT",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}},B.debug("Call setGroupMemberAttributes",e),[4,oe.call(this,d,f.SET_GROUP_MEMBER_ATTRS)]);case 1:return p.sent(),[2]}}))}))}function La(e){var t=e.groupId,r=e.userId;return Pa.call(this,{groupId:t,userIds:[r]}).then((function(e){var t;return{type:e.type,data:null===(t=e.data)||void 0===t?void 0:t[r]}}))}function Pa(e){var t=e.groupId,r=e.userIds,n=e.keys,o=void 0===n?[]:n;if("string"!=typeof t||""===t)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(r)||(null==r?void 0:r.length)<=0)throw Error('Invalid parameter: "userIds"');if(!Array.isArray(o))throw Error('Invalid parameter: "keys"');var i=bt.call(this).error;if(i)return Promise.reject(i);var a=this.context,s=a.orgName,c=a.appName,u=a.accessToken,l={targets:r,properties:o},d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/sdk/metadata/chatgroup/").concat(t,"/get?version=v3"),type:"POST",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return B.debug("Call getGroupMembersAttributes",e),oe.call(this,d,f.GET_GROUP_MEMBER_ATTR).then((function(e){return{type:e.type,data:(null==e?void 0:e.data)||{}}}))}function xa(){var e=bt.call(this).error;if(e)return Promise.reject(e);var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/chatgroups/user/").concat(this.context.userId,"/joined_count"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"}};return B.debug("Call getJoinedGroupsCount"),oe.call(this,i).then((function(e){return{type:s.REQUEST_SUCCESS,data:e.data||0}}))}function ka(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,c=e.groupId,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(c,"/shield?version=v3&resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call blockGroupMessages",e),oe.call(this,u).then((function(e){return{type:s.REQUEST_SUCCESS,data:e.data||{}}}))}function Da(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,c=e.groupId,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(c,"/shield?version=v3&resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call unblockGroupMessages",e),oe.call(this,u).then((function(e){return{type:s.REQUEST_SUCCESS,data:e.data||{}}}))}function Ba(e){return Ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ba(e)}__webpack_require__(8363);var ja=function(){return ja=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ja.apply(this,arguments)};function Ga(e){var t=this;if("number"!=typeof e.pagenum||"number"!=typeof e.pagesize)throw Error("Invalid parameter");var r=bt.call(this).error;if(r)return Promise.reject(r);var n={pagenum:e.pagenum||1,pagesize:e.pagesize||20},o=this.context,i=o.orgName,a=o.appName,c=o.accessToken,u={url:this.apiUrl+"/"+i+"/"+a+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+c},data:n,success:function(t){"function"==typeof e.success&&e.success(t)},error:function(r){r.error&&r.error_description&&t.onError&&t.onError({type:s.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return B.debug("Call getChatRooms",e),oe.call(this,u,f.GET_CHATROOM_LIST)}function Ha(e){if("string"!=typeof e.name)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r={name:e.name,description:e.description,maxusers:e.maxusers,owner:this.user,members:e.members},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/chatrooms?resource=").concat(s.clientResource),dataType:"json",type:"POST",data:JSON.stringify(r),headers:{Authorization:"Bearer "+(e.token||a),"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call createChatRoom",e),oe.call(this,c,f.CREATE_CHATROOM)}function Fa(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(e.chatRoomId,"?resource=").concat(a.clientResource,"&version=v3"),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+(e.token||i)},success:e.success,error:e.error};return B.debug("Call destroyChatRoom",e),oe.call(this,s,f.DESTROY_CHATROOM)}function qa(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getChatRoomDetails",e),oe.call(this,a,f.GET_CHATROOM_DETAIL)}function Wa(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={groupname:e.chatRoomName,description:e.description,maxusers:e.maxusers},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"?resource=").concat(a.clientResource),type:"PUT",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call modifyChatRoom",e),oe.call(this,u,f.MODIFY_CHATROOM)}function za(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||"string"!=typeof e.username)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/users/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeChatRoomMember",e),oe.call(this,u,f.REMOVE_CHATROOM_MEMBER)}var Ka=za;function Va(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=e.chatRoomId,n=e.users.join(","),o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatrooms/").concat(r,"/users/").concat(n,"?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeChatRoomMembers",e),oe.call(this,u,f.MULTI_REMOVE_CHATROOM_MEMBER)}var Ja=Va;function Ya(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=e.chatRoomId,n={usernames:e.users},o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatrooms/").concat(r,"/users?resource=").concat(c.clientResource),type:"POST",data:JSON.stringify(n),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call addUsersToChatRoom",e),oe.call(this,u,f.ADD_USERS_TO_CHATROOM)}function Xa(e){var t=e.roomId,r=e.message,n=void 0===r?"":r,o=e.ext,i=void 0===o?"":o,a=e.leaveOtherRooms,c=void 0!==a&&a,u=e.success,l=e.error;if("string"!=typeof t||""===t)throw Error("Invalid parameter roomId");if("string"!=typeof i)throw Error("Invalid parameter ext");if("boolean"!=typeof c)throw Error("Invalid parameter leaveOtherRooms");var d=bt.call(this).error;return d?Promise.reject(d):(B.debug("Call joinChatRoom",e),this.logOut?Promise.reject({type:s.WEBIM_CONNECTION_CLOSED,message:"not login"}):this.mSync.handleChatRoom({roomId:t,ext:i,leaveOtherRooms:c,message:n,success:u,errorCb:l},"join"))}function Qa(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");var t=bt.call(this).error;return t?Promise.reject(t):(B.debug("Call leaveChatRoom",e),this.logOut?Promise.reject({type:s.WEBIM_CONNECTION_CLOSED,message:"not login"}):this.mSync.handleChatRoom(e,"leave"))}var $a=Qa;function Za(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');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={pagenum:e.pageNum,pagesize:e.pageSize},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={url:this.apiUrl+"/"+o+"/"+i+"/chatrooms/"+e.chatRoomId+"/users?version=v3",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call listChatRoomMembers",e),oe.call(this,s,f.LIST_CHATROOM_MEMBERS)}var es=Za;function ts(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(e.cursor&&"string"!=typeof e.cursor)throw Error('Invalid parameter: "cursor"');if(e.limit&&"number"!=typeof e.limit)throw Error('Invalid parameter: "limit"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={cursor:e.cursor,limit:e.limit||50,joined_time:!0},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+o+"/"+i+"/chatrooms/"+e.chatRoomId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return B.debug("Call getChatRoomMembers",e),oe.call(this,c,f.LIST_GROUP_MEMBER).then((function(e){var t=e.data,r=e.cursor,n=t.map((function(e){for(var t in e)if(["member","admin","owner"].includes(t))return{role:t,userId:e[t],joinedTime:e.joined_time}}));return{type:s.REQUEST_SUCCESS,data:{cursor:r,members:n}}}))}function rs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+a+"/admin?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getChatRoomAdmin",e),oe.call(this,s,f.GET_CHATROOM_ADMIN)}function ns(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={newadmin:e.username},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/admin?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call setChatRoomAdmin",e),oe.call(this,u,f.SET_CHATROOM_ADMIN)}function os(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/admin/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeChatRoomAdmin",e),oe.call(this,u,f.REMOVE_CHATROOM_ADMIN)}function is(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={usernames:[e.username],mute_duration:e.muteDuration},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/mute?resource=").concat(a.clientResource),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(c),success:e.success,error:e.error};return B.debug("Call muteChatRoomMember",e),oe.call(this,u,f.MUTE_CHATROOM_MEMBER)}function as(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/mute/").concat(c,"?resource=").concat(a.clientResource),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call unmuteChatRoomMember",e),oe.call(this,u,f.REMOVE_MUTE_CHATROOM_MEMBER)}var ss=as;function cs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+a+"/mute?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getChatRoomMutelist",e),oe.call(this,s,f.GET_MUTE_CHATROOM_MEMBERS)}var us=cs,ls=cs;function ds(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call blockChatRoomMember",e),oe.call(this,u,f.SET_CHATROOM_MEMBER_TO_BLACK).then((function(t){var r,n=t.data[0]||{},o=ja(ja({},n),{action:"add_blocks",id:e.chatRoomId});return null===(r=null==e?void 0:e.success)||void 0===r||r.call(e,ja(ja({},t),{data:o})),ja(ja({},t),{data:o})}))}var ps=ds;function hs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={usernames:e.usernames},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/blocks/users?resource=").concat(a.clientResource,"&version=v3"),data:JSON.stringify(c),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Chat blockChatRoomMembers:",u),oe.call(this,u,f.MULTI_SET_CHATROOM_MEMBER_TO_BLACK).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return ja(ja({},t),{action:"add_blocks",id:e.chatRoomId})}));return null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,ja(ja({},t),{data:o})),ja(ja({},t),{data:o})}))}var fs=hs;function ms(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call unblockChatRoomMember",e),oe.call(this,u,f.REMOVE_CHATROOM_MEMBER_BLACK).then((function(t){var r,n=t.data;return null===(r=e.success)||void 0===r||r.call(e,ja(ja({},t),{data:ja(ja({},n[0]),{action:"remove_blocks",id:e.chatRoomId})})),ja(ja({},t),{data:ja(ja({},n[0]),{action:"remove_blocks",id:e.chatRoomId})})}))}var vs=ms;function gs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.usernames.join(","),u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call unblockChatRoomMembers",e),oe.call(this,u,f.MULTI_REMOVE_CHATROOM_MEMBER_BLACK).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return ja(ja({},t),{action:"remove_blocks",id:e.chatRoomId})}));return null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,ja(ja({},t),{data:o})),ja(ja({},t),{data:o})}))}var ys=gs;function Es(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+a+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getChatRoomBlocklist",e),oe.call(this,s,f.GET_CHATROOM_BLOCK_MEMBERS)}var _s=Es,Ts=Es;function Is(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/ban?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call disableSendChatRoomMsg",e),oe.call(this,c,f.DISABLED_CHATROOM_SEND_MSG)}function Os(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/ban?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call enableSendChatRoomMsg",e),oe.call(this,c,f.ENABLE_CHATROOM_SEND_MSG)}function Rs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={usernames:e.users},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/white/users?resource=").concat(a.clientResource,"&version=v3"),type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call addUsersToChatRoomWhitelist",e),oe.call(this,u,f.ADD_USERS_TO_CHATROOM).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return ja(ja({},t),{action:"add_user_whitelist",id:e.chatRoomId})}));return 1===(null==o?void 0:o.length)&&(o=o[0]),null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,ja(ja({},t),{data:o})),ja(ja({},t),{data:o})}))}var Ss=Rs;function bs(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/white/users/").concat(e.userName,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call removeChatRoomAllowlistMember",e),oe.call(this,c,f.REMOVE_CHATROOM_WHITE_USERS).then((function(t){var r;return null===(r=e.success)||void 0===r||r.call(e,ja(ja({},t),{data:ja(ja({},t.data[0]),{action:"remove_user_whitelist",id:e.chatRoomId})})),ja(ja({},t),{data:ja(ja({},t.data[0]),{action:"remove_user_whitelist",id:e.chatRoomId})})}))}var Cs=bs,Ns=bs;function As(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+a+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getChatRoomAllowlist",e),oe.call(this,s,f.GET_CHATROOM_WHITE_USERS)}var Ms=As;function ws(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+a+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call isInChatRoomAllowlist",e),oe.call(this,s,f.CHECK_CHATROOM_WHITE_USER)}var Us=ws;function Ls(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.userId,s={url:this.apiUrl+"/"+n+"/"+o+"/sdk/chatrooms/"+e.chatRoomId+"/mute/"+a+"?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i}};return B.debug("Call isInChatRoomMutelist",e),oe.call(this,s).then((function(e){return{type:e.type,data:e.data}}))}function Ps(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.roomId,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(a,"/announcement?version=v3"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call fetchChatRoomAnnouncement",e),oe.call(this,s,f.GET_CHATROOM_ANN)}function xs(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.roomId,c={announcement:e.announcement},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/announcement?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call updateChatRoomAnnouncement:",e),oe.call(this,u,f.UPDATE_CHATROOM_ANN)}function ks(e){var t;if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("object"!==Ba(e.file))throw Error('Invalid parameter: "file"');var r=bt.call(this).error;if(r)return null===(t=e.onFileUploadError)||void 0===t?void 0:t.call(e,r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c=e.roomId;he.call(this,{uploadUrl:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/chatrooms/").concat(c,"/share_files?resource=").concat(s.clientResource),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:a,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey,to:c,chatType:"chatRoom"},f.UPLOAD_CHATROOM_FILE),B.debug("Call uploadChatRoomSharedFile",e)}function Ds(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.roomId,c=e.fileId,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/share_files/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call deleteChatRoomSharedFile",e),oe.call(this,u,f.DELETE_CHATROOM_FILE)}function Bs(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.roomId,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(a,"/share_files"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json",accept:"application/json"},success:e.success,error:e.error};return B.debug("Call fetchChatRoomSharedFileList",e),oe.call(this,s,f.GET_CHATROOM_FILES)}var js=Bs;function Gs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if(e.attributeKeys&&!Array.isArray(e.attributeKeys))throw Error('"Invalid parameter attributeKeys": '+e.attributeKeys);var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=(r.jid,e.chatRoomId),s={keys:e.attributeKeys},c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/metadata/chatroom/").concat(a),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return B.debug("Call getChatRoomAttributes:",e),oe.call(this,c,f.GET_CHATROOM_ATTR).then((function(e){return{data:e.data,type:e.type}}))}function Hs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("object"!==Ba(e.attributes))throw Error("Invalid parameter attributes: "+e.attributes);var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.userId,s=e.chatRoomId,c=e.attributes,u=e.autoDelete,l=void 0===u||u,d=e.isForced?"/forced":"",p={metaData:c,autoDelete:l?"DELETE":"NO_DELETE"},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/metadata/chatroom/").concat(s,"/user/").concat(a)+d,type:"PUT",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return B.debug("Call setChatRoomAttributes:",e),oe.call(this,h,f.SET_CHATROOM_ATTR).then((function(e){return Ct(e)}))}function Fs(e){var t;if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("string"!=typeof e.attributeKey||""===e.attributeKey)throw Error("Invalid parameter attributeKey: "+e.attributeKey);if("string"!=typeof e.attributeValue||""===e.attributeValue)throw Error("Invalid parameter attributeValue: "+e.attributeValue);var r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.userId,c=e.chatRoomId,u=e.attributeKey,l=e.attributeValue,d=e.autoDelete,p=void 0===d||d,h=e.isForced?"/forced":"",m={metaData:(t={},t[u]=l,t),autoDelete:p?"DELETE":"NO_DELETE"},v={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/metadata/chatroom/").concat(c,"/user/").concat(s)+h,type:"PUT",dataType:"json",data:JSON.stringify(m),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return B.debug("Call setChatRoomAttribute:",e),oe.call(this,v,f.SET_CHATROOM_ATTR).then((function(e){var t=Nt(e);if(t)throw t}))}function qs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if(!Array.isArray(e.attributeKeys))throw Error('"Invalid parameter attributes": '+e.attributeKeys);var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.userId,s=e.chatRoomId,c=e.attributeKeys,u=e.isForced?"/forced":"",l={keys:c},d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/metadata/chatroom/").concat(s,"/user/").concat(a)+u,type:"DELETE",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return B.debug("Call removeChatRoomAttributes:",e),oe.call(this,d,f.DELETE_CHATROOM_ATTR).then((function(e){return Ct(e)}))}function Ws(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("string"!=typeof e.attributeKey||""===e.attributeKey)throw Error('"Invalid parameter attributeKey": '+e.attributeKey);var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.userId,s=e.chatRoomId,c=e.attributeKey,u=e.isForced?"/forced":"",l={keys:[c]},d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/metadata/chatroom/").concat(s,"/user/").concat(a)+u,type:"DELETE",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return B.debug("Call removeChatRoomAttribute:",e),oe.call(this,d,f.DELETE_CHATROOM_ATTR).then((function(e){var t=Nt(e);if(t)throw t}))}function zs(e){var t=this,r=e||{},n=r.pageNum,o=r.pageSize;if(isNaN(n)||n<=0)throw Error("Invalid parameter pageNum:".concat(n));if(isNaN(o)||o<=0)throw Error("Invalid parameter pageSize:".concat(o));var i=bt.call(this).error;if(i)return Promise.reject(i);var a={pagenum:n,pagesize:o,detail:!0},s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(this.user,"/joined_chatrooms"),dataType:"json",type:"GET",data:a,headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"}};return B.debug("Call getJoinedChatRooms",e),oe.call(this,d,f.GET_USER_JOINED_CHATROOM).then((function(e){var r=(e.data||[]).map((function(e){var r=e.id,n=e.title,o=e.owner,i=e.created,a=e.description,s=e.max_users;return{id:r,name:n,owner:o.split("".concat(t.appKey,"_"))[1],created:i,description:a,maxusers:s}}));return{type:e.type,data:r}}))}var Ks=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},Vs=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Js(e){return Ks(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u;return Vs(this,(function(l){switch(l.label){case 0:if("string"!=typeof e.description)throw Error('Invalid parameter: "description"');return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s=this.context.jid.clientResource,c={ext:e.description},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/presence/").concat(s,"/1"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:e.success,error:e.error},B.debug("Call publishPresence:",e),[4,oe.call(this,u)]);case 1:return l.sent(),[2]}}))}))}function Ys(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if("number"!=typeof e.expiry)throw Error('Invalid parameter: "expiry"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.userId,a=r.accessToken,s={usernames:e.usernames},c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(i,"/presence/").concat(e.expiry),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call subscribePresence:",e),oe.call(this,c).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}function Xs(e){return Ks(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return Vs(this,(function(c){switch(c.label){case 0:if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.userId,a=r.accessToken,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(i,"/presence"),type:"DELETE",dataType:"json",data:JSON.stringify(e.usernames),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error},B.debug("Call unsubscribePresence:",e),[4,oe.call(this,s)]);case 1:return c.sent(),[2]}}))}))}function Qs(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.userId,a=r.accessToken,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(i,"/presence/sublist?pageNum=").concat(e.pageNum,"&pageSize=").concat(e.pageSize),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getSubscribedPresenceList:",e),oe.call(this,s).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}var $s=Qs;function Zs(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={usernames:e.usernames},n=this.context,o=n.orgName,i=n.appName,a=n.userId,s=n.accessToken,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/presence"),type:"POST",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getPresenceStatus:",e),oe.call(this,c).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}function ec(e){if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var t=e.options.paramType;if("number"!=typeof t||t<0||t>2)throw Error('Invalid parameter: "options of paramType"');if(0===t){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===t){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===t){var r=e.options,n=r.startTime,o=r.endTime;if(!(n instanceof Object&&Object.keys(n).length))throw Error('Invalid parameter: "options of startTime"');if("number"!=typeof n.hours||"number"!=typeof n.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of endTime"');if("number"!=typeof o.hours||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var i=bt.call(this).error;if(i)return Promise.reject(i);var a=this.context,s=a.accessToken,c=a.orgName,u=a.appName,l=a.userId,d=a.jid,p={};switch(t){case 0:p={type:e.options.remindType};break;case 1:p={ignoreDuration:e.options.duration};break;case 2:var h=e.options;n=h.startTime,o=h.endTime,p={ignoreInterval:"".concat(n.hours,":").concat(n.minutes,"-").concat(o.hours,":").concat(o.minutes)}}var f={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(l,"/notification/user/").concat(l,"?resource=").concat(d.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call setSilentModeForAll:",e),oe.call(this,f)}function tc(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification/user/").concat(a),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return B.debug("Call getSilentModeForAll:",e),oe.call(this,s)}function rc(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var t=e.options.paramType;if("number"!=typeof t||t<0||t>2)throw Error('Invalid parameter: "options of paramType"');if(0===t){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===t){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===t){var r=e.options,n=r.startTime,o=r.endTime;if(!(n instanceof Object&&Object.keys(n).length))throw Error('Invalid parameter: "options of startTime"');if("number"!=typeof n.hours||"number"!=typeof n.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of endTime"');if("number"!=typeof o.hours||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var i=bt.call(this).error;if(i)return Promise.reject(i);var a=this.context,s=a.accessToken,c=a.orgName,u=a.appName,l=a.userId,d=a.jid,p="chatgroup",h={};switch(t){case 0:h={type:e.options.remindType};break;case 1:h={ignoreDuration:e.options.duration};break;case 2:var f=e.options;n=f.startTime,o=f.endTime,h={ignoreInterval:"".concat(n.hours,":").concat(n.minutes,"-").concat(o.hours,":").concat(o.minutes)}}"singleChat"===e.type&&(p="user");var m={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(l,"/notification/").concat(p,"/").concat(e.conversationId,"?resource=").concat(d.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(h),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call setSilentModeForConversation:",e),oe.call(this,m)}function nc(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s=r.jid,c="chatgroup";"singleChat"===e.type&&(c="user");var u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification/").concat(c,"/").concat(e.conversationId,"?resource=").concat(s.clientResource),type:"PUT",dataType:"json",data:JSON.stringify({type:"DEFAULT"}),headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call clearRemindTypeForConversation:",e),oe.call(this,u)}function oc(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s="chatgroup";"singleChat"===e.type&&(s="user");var c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification/").concat(s,"/").concat(e.conversationId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getSilentModeForConversation:",e),oe.call(this,c)}function ic(e){if(!Array.isArray(e.conversationList))throw Error('Invalid parameter: "conversationList"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s=[],c=[];e.conversationList.forEach((function(e){"singleChat"===e.type?s.push(e.id):c.push(e.id)}));var u=s.length?s.join(","):"",l=c.length?c.join(","):"",d={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification?user=").concat(u,"&group=").concat(l),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getSilentModeForConversations:",e),oe.call(this,d)}function ac(e){if("string"!=typeof e.language||!e.language)throw Error('Invalid parameter: "language"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={translationLanguage:e.language},n=this.context,o=n.accessToken,i=n.orgName,a=n.appName,s=n.userId,c={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/users/").concat(s,"/notification/language"),type:"PUT",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call setPushPerformLanguage:",e),oe.call(this,c)}function sc(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification/language"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return B.debug("Call getPushPerformLanguage:",e),oe.call(this,s)}function cc(e){var t=bt.call(this).error;if(t)return Promise.reject(t);if("number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageSize"');var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s={limit:e.pageSize||10,cursor:e.cursor};e.cursor||delete s.cursor;var c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification/mute/type"),type:"GET",dataType:"json",data:s,headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"}};return B.debug("Call getSilentModeRemindTypeConversations:",e),oe.call(this,c).then((function(e){return e.data?{data:{conversations:e.data.map((function(e){return"user"in e?{conversationId:e.user,type:"singleChat",remindType:e.value}:{conversationId:e.group,type:"groupChat",remindType:e.value}})),cursor:e.cursor},type:e.type}:e}))}var uc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},lc=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function dc(e){if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: ".concat(e.name));if("string"!=typeof e.messageId||""===e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: ".concat(e.parentId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={name:e.name,msg_id:e.messageId,group_id:e.parentId,owner:this.user},c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,c).then((function(e){var t=e.data.thread_id;return e.data={chatThreadId:t},e}))}function pc(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"/user/").concat(this.user,"/join?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,s).then((function(e){var t=e.data.detail;return t.messageId=t.msgId,t.parentId=t.groupId,delete t.msgId,delete t.groupId,e}))}function hc(e){return uc(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return lc(this,(function(c){switch(c.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"/user/").concat(this.user,"/quit?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,s)]);case 1:return c.sent(),[2]}}))}))}function fc(e){return uc(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return lc(this,(function(c){switch(c.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,s)]);case 1:return c.sent(),[2]}}))}))}function mc(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: ".concat(e.name));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={name:e.name},c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"?resource=").concat(a.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,c)}function vc(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={limit:e.pageSize||20,cursor:e.cursor||""},s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"/users"),type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,s)}function gc(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if("string"!=typeof e.username||""===e.username)throw Error("Invalid parameter username: ".concat(e.username));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"/users/").concat(e.username,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,s)}function yc(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={limit:e.pageSize||20,cursor:e.cursor||""},s={url:e.parentId?"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/threads/chatgroups/").concat(e.parentId,"/user/").concat(this.user):"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/threads/user/").concat(this.user),type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,s).then((function(e){var t=e.entities;return null==t||t.forEach((function(e){e.parentId=e.groupId,e.messageId=e.msgId,delete e.groupId,delete e.msgId})),e}))}function Ec(e){if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: ".concat(e.parentId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={cursor:e.cursor||"",limit:e.pageSize||20},s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/threads/chatgroups/").concat(e.parentId),type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,s).then((function(e){var t=e.entities;return null==t||t.forEach((function(e){e.parentId=e.groupId,e.messageId=e.msgId,delete e.groupId,delete e.msgId})),e}))}function _c(e){var t=this;if(!Array.isArray(e.chatThreadIds))throw Error("Invalid parameter chatThreadIds: ".concat(e.chatThreadIds));var r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={threadIds:e.chatThreadIds},c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/thread/message"),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return oe.call(this,c).then((function(e){return Tc.call(t,e)}))}function Tc(e){var t=this,r=e.entities;return null==r||r.forEach((function(e){e.chatThreadId=e.thread_id,e.last_message&&"{}"!==JSON.stringify(e.last_message)?e.lastMessage=Se.call(t,e.last_message):e.lastMessage=e.last_message,delete e.thread_id,delete e.last_message})),e}function Ic(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,a).then((function(e){return e.data.affiliationsCount=e.data.affiliations_count,e.data.messageId=e.data.msgId,e.data.parentId=e.data.groupId,delete e.data.affiliations_count,delete e.data.msgId,delete e.data.groupId,e}))}function Oc(){var e=bt.call(this).error;if(e)return Promise.reject(e);var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/users/").concat(this.user,"/translate/support/language"),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+o}};return B.debug("Call getSupportedLanguages"),oe.call(this,i)}function Rc(e){if("string"!=typeof e.text||""===e.text)throw Error('Invalid parameter: "text"');if(!Array.isArray(e.languages))throw Error('Invalid parameter: "language"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a="".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(this.user,"/translate"),s={text:e.text,to:e.languages},c={url:a,dataType:"json",type:"POST",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i}};return B.debug("Call translateMessage"),oe.call(this,c)}__webpack_require__(2480);var Sc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},bc=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Cc(e){return Sc(this,void 0,void 0,(function(){return bc(this,(function(t){return[2,Qt(e)]}))}))}var Nc=new(function(){function e(){}return e.prototype.getImageInfo=function(e){return Sc(this,void 0,void 0,(function(){return bc(this,(function(t){return"string"==typeof e?[2,this._getImageInfoFromUrl(e)]:[2,this._getImageInfoFromFile(e)]}))}))},e.prototype._getImageInfoFromFile=function(e){return new Promise((function(t,r){var n=URL.createObjectURL(e),o=new Image;o.onload=function(){URL.revokeObjectURL(n),t({width:o.width,height:o.height,type:e.type})},o.onerror=function(){URL.revokeObjectURL(n),r(new Error("Failed to load image"))},o.src=n}))},e.prototype._getImageInfoFromUrl=function(e){return new Promise((function(t,r){var n=new Image;n.onload=function(){return t({width:n.width,height:n.height})},n.onerror=function(){return r(new Error("Failed to load image from URL"))},n.src=e}))},e.prototype.generateBigImage=function(e,t){return Sc(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u,l;return bc(this,(function(d){switch(d.label){case 0:if("string"==typeof e)throw new Error("Web image processor requires File input for compression");return[4,this.getImageInfo(e)];case 1:return r=d.sent(),(n=Jt(r.width,r.height,t.maxShortEdge)).width===r.width&&n.height===r.height?[2,null]:"function"!=typeof createImageBitmap?[3,3]:[4,createImageBitmap(e)];case 2:return i=d.sent(),[3,5];case 3:return[4,this._loadImage(e)];case 4:i=d.sent(),d.label=5;case 5:if(o=i,a=void 0!==globalThis.OffscreenCanvas?new globalThis.OffscreenCanvas(n.width,n.height):this._createCanvas(n.width,n.height),!(s=a.getContext("2d")))throw new Error("Failed to get canvas context");return s.drawImage(o,0,0,n.width,n.height),c="image/png"===e.type?"image/png":"image/webp"===e.type?"image/webp":"image/jpeg",[4,this._canvasToBlob(a,c,t.quality)];case 6:return u=d.sent(),[2,{file:l=new File([u],e.name||"compressed.jpg",{type:c}),width:n.width,height:n.height,size:l.size,type:c}]}}))}))},e.prototype.computeMd5=function(e){return Sc(this,void 0,void 0,(function(){return bc(this,(function(t){switch(t.label){case 0:if("string"==typeof e)throw new Error("Web image processor requires File input for MD5");return[4,e.arrayBuffer()];case 1:return[2,Cc(t.sent())]}}))}))},e.prototype._loadImage=function(e){return new Promise((function(t,r){var n=URL.createObjectURL(e),o=new Image;o.onload=function(){URL.revokeObjectURL(n),t(o)},o.onerror=function(){URL.revokeObjectURL(n),r(new Error("Failed to load image"))},o.src=n}))},e.prototype._createCanvas=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r},e.prototype._canvasToBlob=function(e,t,r){return"convertToBlob"in e?e.convertToBlob({type:t,quality:r}):new Promise((function(n,o){e.toBlob((function(e){return e?n(e):o(new Error("toBlob failed"))}),t,r)}))},e}());function Ac(e){return Ac="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ac(e)}__webpack_require__(1761);var Mc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},wc=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Uc=function(){function e(e){this._pathCache=new Map,this.runtime=e}return e.prototype.getImageInfo=function(e){return"string"!=typeof e?Promise.reject(new Error("MiniApp image processor requires file path string")):this._loadImageInfo(e)},e.prototype.generateBigImage=function(e,t){return Mc(this,void 0,void 0,(function(){var r,n,o,i,a,s,c;return wc(this,(function(u){switch(u.label){case 0:return"string"!=typeof e?[2,Promise.reject(new Error("MiniApp image processor requires file path string"))]:this.runtime.compressImage?[4,this._loadImageInfo(e)]:[2,Promise.reject(new Error("Platform missing compressImage capability"))];case 1:return r=u.sent(),(n=r.path||e)!==e&&B.debug("Miniapp image path normalized before compress",e,n),(o=Jt(r.width,r.height,t.maxShortEdge)).width===r.width&&o.height===r.height?[2,null]:(i=this.runtime.compressImage,[4,new Promise((function(e,r){i({src:n,quality:Math.round(100*t.quality),compressedWidth:o.width,compressedHeight:o.height,success:function(t){return e(t.tempFilePath)},fail:r})}))]);case 2:return a=u.sent(),B.debug("Miniapp compressImage temp path",a),[4,this._normalizeLocalPath(a)];case 3:return s=u.sent(),[4,this._getFileSize(s)];case 4:return c=u.sent(),[2,{path:s,width:o.width,height:o.height,size:c,type:"image/jpeg"}]}}))}))},e.prototype.computeMd5=function(e){var t,r;return Mc(this,void 0,void 0,(function(){var n,o;return wc(this,(function(i){switch(i.label){case 0:return"string"!=typeof e?[2,Promise.reject(new Error("MiniApp image processor requires file path string"))]:(n=null===(r=(t=this.runtime).getFileSystemManager)||void 0===r?void 0:r.call(t))?[4,this._normalizeLocalPath(e)]:[2,Promise.reject(new Error("Platform missing getFileSystemManager capability"))];case 1:return o=i.sent(),[4,new Promise((function(e,t){n.readFile({filePath:o,success:function(t){return e(t.data)},fail:t})}))];case 2:return[2,Qt(i.sent())]}}))}))},e.prototype._getFileSize=function(e){var t,r;return Mc(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,l,d,p;return wc(this,(function(h){switch(h.label){case 0:return(n=null===(r=(t=this.runtime).getFileSystemManager)||void 0===r?void 0:r.call(t))?[4,this._normalizeLocalPath(e)]:(B.warn("Miniapp getFileSize: no FileSystemManager available"),[2,0]);case 1:o=h.sent(),B.debug("Miniapp getFileSize paths","original: ".concat(e),"normalized: ".concat(o)),i=function(e){var t,r;return wc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,new Promise((function(t,r){n.getFileInfo({filePath:e,success:function(e){return t(e.size)},fail:r})}))];case 1:return(t=o.sent())>0?(B.debug("Miniapp getFileSize success via getFileInfo","path: ".concat(e,", size: ").concat(t)),[2,{value:t}]):[3,3];case 2:return r=o.sent(),B.debug("Miniapp getFileInfo failed for path",e,r),[3,3];case 3:return[2]}}))},a=0,s=o!==e?[o,e]:[e],h.label=2;case 2:return a<s.length?(c=s[a],[5,i(c)]):[3,5];case 3:if("object"===Ac(u=h.sent()))return[2,u.value];h.label=4;case 4:return a++,[3,2];case 5:return h.trys.push([5,7,,8]),[4,new Promise((function(e,t){n.readFile({filePath:o,success:function(t){return e(t.data)},fail:t})}))];case 6:return l=h.sent(),d=l.byteLength,B.debug("Miniapp getFileSize fallback via readFile","size: ".concat(d)),[2,d];case 7:return p=h.sent(),B.warn("Miniapp getFileSize: all methods failed","path: ".concat(e),p),[2,0];case 8:return[2]}}))}))},e.prototype._loadImageInfo=function(e){var t=this;return new Promise((function(r,n){t.runtime.getImageInfo({src:e,success:function(e){return r({width:e.width,height:e.height,type:e.type,path:e.path})},fail:n})}))},e.prototype._normalizeLocalPath=function(e){return Mc(this,void 0,void 0,(function(){var t,r,n;return wc(this,(function(o){switch(o.label){case 0:return/^https?:\/\/tmp\//i.test(e)?(t=this._pathCache.get(e))?[2,t]:[4,this._loadImageInfo(e)]:[2,e];case 1:return r=o.sent(),n=r.path||e,/^https?:\/\/tmp\//i.test(n)?[4,this._materializeTempPath(n)]:[3,3];case 2:n=o.sent(),o.label=3;case 3:return this._pathCache.set(e,n),B.debug("Miniapp image path normalization result",e,n),[2,n]}}))}))},e.prototype._materializeTempPath=function(e){var t,r,n;return Mc(this,void 0,void 0,(function(){var o,i,a,s,c,u;return wc(this,(function(l){switch(l.label){case 0:if(!(null==(o=null===(r=(t=this.runtime).getFileSystemManager)||void 0===r?void 0:r.call(t))?void 0:o.saveFile)||!(null===(n=this.runtime.env)||void 0===n?void 0:n.USER_DATA_PATH))return[2,e];i=e.match(/(\.[a-zA-Z0-9]+)(?:\?.*)?$/),a=i?i[1]:"",s="".concat(this.runtime.env.USER_DATA_PATH,"/em-image-").concat(Date.now(),"-").concat(Math.random().toString(36).slice(2)).concat(a),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,new Promise((function(t,r){var n;null===(n=o.saveFile)||void 0===n||n.call(o,{tempFilePath:e,filePath:s,success:function(e){return t(e.savedFilePath||s)},fail:r})}))];case 2:return c=l.sent(),B.debug("Miniapp temp image materialized to user data path",e,c),[2,c];case 3:return u=l.sent(),B.warn("Miniapp saveFile failed while materializing temp image path",u),[2,e];case 4:return[2]}}))}))},e}();function Lc(e){return Lc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lc(e)}var Pc=function(){return Pc=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pc.apply(this,arguments)},xc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},kc=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Dc=ye.getEnvInfo(),Bc=function(){function c(s){var u,l=this;this.name="connection",this.appKey="",this.dnsTotal=0,this.max_cache_length=100,this._compressorFailureCount=0,this._reportLogs=!1,this._reportInterval=z,this._isLogging=!1,this._initWithAppId=!1,this.uikitVersion="",this.lastHeartbeat=Date.now(),this.isDebug=s.isDebug||!1,this.isReport=!1,this.uploadPartEnable=!0,this.isHttpDNS=void 0===s.isHttpDNS||s.isHttpDNS,this.heartBeatWait=s.heartBeatWait||3e4,this.autoReconnectNumMax=s.autoReconnectNumMax||5,this.refreshDNSIntervals=this.autoReconnectNumMax<5?this.autoReconnectNumMax:5,this.delivery=s.delivery||!1,this.disconnectedReason=void 0,this.loginInfoCustomExt=void 0,this.https=ye.isUseHttps(s.https),this.dnsArr=["https://rs.easemob.com","https://rs.chat.agora.io","http://59.110.89.59","http://39.97.193.190","http://39.97.193.187"].filter((function(e){return e.startsWith(l.https?"https":"")})),this.dnsIndex=0,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.dnsTotal=this.dnsArr.length,"appKey"in s&&(this.appKey=s.appKey),"appId"in s&&(this.appId=s.appId,this._initWithAppId=!0),this.appName="",this.orgName="",this.token="",this.grantType="",this.apiUrl=s.apiUrl||"",this.url=s.url||"",this.version="4.24.0",this.deviceId=s.deviceId||"webim",this.isFixedDeviceId=null===(u=s.isFixedDeviceId)||void 0===u||u,this.osType=16,this.useOwnUploadFun=s.useOwnUploadFun||!1;var d=ye.getEnvInfo(),p=d.global;if(this._imageProcessor=d.platform===ce.WEB?Nc:(null==p?void 0:p.getImageInfo)?function(e){return new Uc(e)}(p):null,this.isAutoLogin=s.isAutoLogin||!1,this.compressType=[0],this.encryptType=[0],this.clientResource="",this.expiresIn=0,this.expirationTime=0,this.useReplacedMessageContents=s.useReplacedMessageContents||!1,this.logOut=!0,this.context={jid:{appKey:"",clientResource:"",domain:"easemob.com",name:""},userId:"",appKey:"",appId:"",status:0,restTokenData:"",appName:"",orgName:"",root:{},accessToken:""},this._msgHash={},this._msgPromiseHash={},this._queues=[],this._load_msg_cache=[],this.unMSyncSendMsgMap=new Map,this.mr_cache={},this.reconnecting=!1,this._offlineMessagePullState=ve.SYNC_INIT,this._offlineMessagePullQueue=[],this.uniPushConfig={},this.uniPush=null,this.isRegisterPush=!1,this.pushCertificateName="",this._compressor=null,void 0!==s.customOSPlatform){if("number"!=typeof s.customOSPlatform||s.customOSPlatform<1||s.customOSPlatform>100)throw Error("Invalid customOSPlatform: ".concat(s.customOSPlatform));this.customOSPlatform=s.customOSPlatform,this.deviceId=s.customDeviceName||this.deviceId}if(this._initWithAppId){if(this.appKey="","string"!=typeof this.appId||!this.appId)throw Error("Invalid appId: ".concat(this.appId))}else{if("string"!=typeof this.appKey||2!==this.appKey.split("#").length)throw Error("Invalid appKey: ".concat(this.appKey));this.devInfos=this.appKey.split("#"),this.orgName=this.devInfos[0],this.appName=this.devInfos[1]}this.listen=sn.bind(this),this.mSync=this.usePlugin(rn),this.eventHandler=this.usePlugin(on),Object.assign(c.prototype,e),Object.assign(c.prototype,t),Object.assign(c.prototype,r),Object.assign(c.prototype,n),Object.assign(c.prototype,o),Object.assign(c.prototype,i),Object.assign(c.prototype,a),this.dataReport=new In({appkey:this.appKey||"default#appkey",org:this.orgName,sdkVersion:this.version,deviceId:this.deviceId,isReport:this.isReport,uikitVersion:s.uikitVersion||""});var h=0,f=this;if(Object.defineProperty(ye,"ajaxUnconventionalErrorTimes",{set:function(e){0!==e&&(B.debug("rest api request fail times: ".concat(e)),(h=e)%5==0&&f.isHttpDNS&&(B.debug("refresh dns config when rest request fail."),Xc.call(f,(function(){})).catch((function(e){B.error("refresh dns config error",e)}))))},get:function(){return h}}),this.isFixedDeviceId){var m=ye.getLocalDeviceInfo();m&&(this.clientResource=JSON.parse(m).deviceId)}B.debug("init SDK: Conn ".concat(this.version," ").concat(Dc.platform))}return c.prototype.usePlugin=function(e,t){if("push"!==t)return t?void(this[t]=new e(this)):new e(this);e.config&&e.emPush?(this.uniPushConfig=e.config,this.uniPush=e.emPush):B.error("use push plugin failed","emPush",this.uniPush,"config",this.uniPushConfig)},c.prototype.listen=function(e){},c.prototype.addEventHandler=function(e,t){},c.prototype.removeEventHandler=function(e){},c.prototype.registerUser=function(e){return xc(this,void 0,void 0,(function(){var t,r;return kc(this,(function(n){switch(n.label){case 0:if(!e.username||!e.password)throw Error("Invalid parameter");n.label=1;case 1:return n.trys.push([1,5,,6]),t=this.dataReport.geOperateFun({uid:e.username,operationName:f.REGISTER}),this.isHttpDNS?(this.dnsIndex=0,[4,Xc.call(this,t)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[4,Gc.call(this,e,{rpt:t})];case 4:return[2,n.sent()];case 5:throw r=n.sent(),e.error&&e.error(r),r;case 6:return[2]}}))}))},c.prototype.open=function(e){var t;return xc(this,void 0,void 0,(function(){var r,n,o,i,a,c;return kc(this,(function(u){switch(u.label){case 0:if(B.debug("open",e.user,"isLogout:",this.logOut),this._isLogging)throw n=p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:"Currently logging in, please wait."});if(!this.logOut)throw n=p.create({type:s.WEBIM_USER_ALREADY_LOGIN,message:"The user has logged in."});this.retryConnectTimes=0,this._isLogging=!0,u.label=1;case 1:if(u.trys.push([1,6,7,8]),"web"===Dc.platform&&(r=ye.detectBrowser(),B.info("browser",r)),n=Vc.call(this,e))throw null===(t=this.onError)||void 0===t||t.call(this,n),n;return e.accessToken&&(this.token=e.accessToken),o=Pc({},e),i=this.dataReport.geOperateFun({uid:e.user,operationName:f.LOGIN}),this.dnsIndex=0,this.isHttpDNS?[4,Xc.call(this,i)]:[3,3];case 2:u.sent(),u.label=3;case 3:return B.initReport({report:this._reportLogs,reportInterval:this._reportInterval,connection:this}),[4,Fc.call(this,o,{rpt:i})];case 4:return a=u.sent(),[4,zc.call(this,i)];case 5:return u.sent(),B.debug("grantType",this.grantType),ye.listenNetwork(qc.bind(this),Wc.bind(this)),ye.listenBrowserVisibility((function(){B.debug("visibility: true")}),(function(){B.debug("visibility: false")})),[2,a];case 6:throw c=u.sent(),this._isLogging=!1,e.error&&e.error(c),B.error("login failed",c),c;case 7:return B.reportLog(),[7];case 8:return[2]}}))}))},c.prototype.isOpened=function(){return this.sock&&1===this.sock.readyState||!1},c.prototype.close=function(e){var t,r,n,o;void 0===e&&(e="inner:logout"),B.debug("call close"),B._stopReportLogs(),this.logOut=!0,this.disconnectedReason=void 0,this.reconnecting=!1,this.context.status=s.STATUS_CLOSING,e&&(null==e?void 0:e.startsWith("inner"))&&this.sendLogout(e),this.sock&&this.sock.close(),null===(t=this.unMSyncSendMsgMap)||void 0===t||t.clear(),this.stopHeartBeat(),this.rejectMessage(),this.context.status=s.STATUS_CLOSED,this._load_msg_cache=[],this._queues=[],this._msgHash={},this.mr_cache={},this.token="",this.context.accessToken="",this.isRegisterPush=!1,this.clearTokenTimeout(),null===(n=null===(r=null==this?void 0:this._localCache)||void 0===r?void 0:r.getInstance())||void 0===n||n.close(),this.connectionTimer&&clearTimeout(this.connectionTimer),this.provisionTimer&&clearTimeout(this.provisionTimer),this.probingTimer&&clearTimeout(this.probingTimer),null===(o=this._compressor)||void 0===o||o.shrink(),this._compressor=null,this._compressorFailureCount=0,Ue.clearAll()},c.prototype.downloadAndParseCombineMessage=function(e){var t=this,r=e.url,n=e.secret;return new Promise((function(e,o){var i,a,c=ye.getEnvInfo(),u="web"!==c.platform&&"node"!==c.platform&&"quick_app"!==c.platform&&(null===(a=null===(i=c.global)||void 0===i?void 0:i.canIUse)||void 0===a?void 0:a.call(i,"getFileSystemManager")),l=function(r){var n=function(e){o({type:s.PARSE_FILE_ERROR,message:"Read file failed",data:e})},i=function(r){return xc(t,void 0,void 0,(function(){var t,n,i,a,c,l,d,p,h,f,m,v,g;return kc(this,(function(y){switch(y.label){case 0:for(t=u?new Uint8Array(r.data):new Uint8Array(r.target.result),n=0,i=0,a=2,c=t.subarray(n,n+a),l=ye.Uint8ArrayToString(c),B.debug("file header:",l),i+=a,d=0,p=2;p<t.length-1;p++)p%2==1&&(d^=t[p]);if(h=t.subarray(t.length-1,t.length),B.debug("checkResult:",d,h[0]===d),h[0]!==d)return[2,o({type:s.PARSE_FILE_ERROR,message:"File verification failed"})];if("cm"!==l)return[3,7];y.label=1;case 1:y.trys.push([1,5,,6]),f=[],m=function(){var e,r,o,s;return kc(this,(function(c){switch(c.label){case 0:return n+=a,i+=a=4,e=t.subarray(n,n+a),n+=a,a=e.reduce((function(t,r,n){return t+(r<<8*(e.length-n-1))}),0),i+=a,r=t.subarray(n,n+a),o=(o=v.root.lookup("easemob.pb.Meta")).decode(r),[4,ct.call(v,o,0,!0,!0)];case 1:return s=c.sent(),f.push(s),[2]}}))},v=this,y.label=2;case 2:return i<t.length-1?[5,m()]:[3,4];case 3:return y.sent(),[3,2];case 4:return[2,e(f)];case 5:return g=y.sent(),o({type:s.PARSE_FILE_ERROR,message:"Parse file failed",data:g}),[3,6];case 6:return[3,8];case 7:return[2,o({type:s.PARSE_FILE_ERROR,message:"File verification failed"})];case 8:return[2]}}))}))};if(u){var a=c.global.getFileSystemManager(),l=r.tempFilePath;a.readFile({filePath:l,success:i,fail:n})}else if(r instanceof Blob){var d=new FileReader;d.readAsArrayBuffer(r),d.onerror=n,d.onload=i}},d=function(e){o({type:s.WEBIM_DOWNLOADFILE_ERROR,message:"Download failed, please try again",data:e})};u?c.global.downloadFile({url:r,success:l,fail:d}):ye.download.call(t,{url:r,headers:{Accept:"application/json"},onFileDownloadComplete:l,onFileDownloadError:d,secret:n,accessToken:t.context.accessToken})}))},c.prototype.getChatFilesUrl=function(){return"".concat(this.apiUrl,"/").concat(this.orgName,"/").concat(this.appName,"/chatfiles")},c.prototype.stopHeartBeat=function(){clearInterval(this.heartBeatID)},c.prototype.clear=function(){this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.hostTotal=0},c.prototype.heartBeat=function(){},c.prototype.renewToken=function(e){var t=this,r=this.isOpened();return B.debug("isOpened",r),r?this.getTokenExpireTimestamp(e).then((function(r){var n=r.expire_timestamp,o=Date.now();return t.expirationTime=n,t.expiresIn=n-o,t.token=e,t.context.accessToken=e,t.clearTokenTimeout(),t.tokenExpireTimeCountDown(t.expiresIn),{status:!0,token:e,expire:n}})):Promise.reject({status:!1})},c.prototype.clearTokenTimeout=function(){B.info("clearTokenTimeout"),this.tokenWillExpireTimer&&clearTimeout(this.tokenWillExpireTimer),this.tokenExpiredTimer&&clearTimeout(this.tokenExpiredTimer),this.tokenWillExpireTimer=null,this.tokenExpiredTimer=null},c.prototype.tokenExpireTimeCountDown=function(e){var t=this;B.info("tokenExpireTimeCountDown",e),e>Math.pow(2,31)-1&&(e=Math.pow(2,31)-1),this.tokenWillExpireTimer=setTimeout((function(){var r;t.onTokenWillExpire&&t.onTokenWillExpire(),null===(r=t.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),B.info("onTokenWillExpire",Math.floor(e-e/5))}),e-e/5),this.tokenExpiredTimer=setTimeout((function(){var e;B.info("onTokenExpired",0),t.onTokenExpired&&t.onTokenExpired(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),t.close("inner:token expired")}),e)},c.prototype.compareTokenExpireTime=function(e,t){var r,n=Number(t)-Number(e);B.debug("compareTokenExpireTime",n),n<=this.expiresIn/5&&n>0?(this.onTokenWillExpire&&this.onTokenWillExpire(),null===(r=this.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),B.info("onTokenWillExpire",n)):n<=0&&(this.closeByTokenExpired(),B.info("closeByTokenExpired",n))},c.prototype.closeByTokenExpired=function(){var e;B.info("closed By TokenExpired"),this.onTokenExpired&&this.onTokenExpired(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),this.close("inner:token expired")},c.prototype.rejectMessage=function(){var e=this,t=Object.keys(this._msgHash);if(t.length>0){var r=p.create({type:s.MESSAGE_WEBSOCKET_DISCONNECTED,message:"websocket disconnected"});t.forEach((function(t){var n,o,i;(null===(n=e.unMSyncSendMsgMap)||void 0===n?void 0:n.has(t))||(e._msgHash[t].reject instanceof Function&&e._msgHash[t].reject(r),null===(i=null===(o=e._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.updateLocalMessage(t,{serverMsgId:t,status:Pe.FAIL}),e._msgHash[t].fail instanceof Function&&e._msgHash[t].fail(r),e._msgHash[t].messageTimer&&clearTimeout(e._msgHash[t].messageTimer),delete e._msgHash[t])}))}},c.prototype.resetConnState=function(){this.mSync.stopHeartBeat(),this.times=1,this.autoReconnectNumTotal=0,this.hostIndex=0},c.prototype.reconnect=function(e){var t,r=this;if(this.logout)return B.warn("The user has already logged out when reconnecting");if(B.debug("socket reconnect readyState",this.sock.readyState),(0!==this.sock.readyState||e)&&(1!==this.sock.readyState||e)){B.info("reconnect: time",this.times),B.info("reconnect sock.readyState: ",this.sock.readyState),!1===this.reconnecting&&(this.reconnecting=!0),null===(t=this.eventHandler)||void 0===t||t.dispatch("onReconnecting"),this.rejectMessage(),this.isHttpDNS&&(this.hostIndex<this.socketHost.length-1?this.hostIndex++:this.hostIndex=this.socketHost.length-1);var n=1e3*ye.getRetryDelay(this.times);B.info("reconnect delay: ",n),setTimeout((function(){(1!==r.sock.readyState||e)&&(B.info("login sock.readyState: ",r.sock.readyState),r.sock.close(),Kc.call(r).catch((function(e){B.error("reconnect websocket failed",e)})),r.times++)}),n),this.autoReconnectNumTotal++}},c.prototype.send=function(e){return Promise.resolve(null)},c.prototype.setLoginInfoCustomExt=function(e){if(B.debug("setLoginInfoCustomExt","params:",e),e){if("string"!=typeof e)throw new Error("ext must be a string");if(e.length>1024)throw new Error("ext length must be less than 1024")}this.loginInfoCustomExt=e},c.prototype.onShow=function(){var e=this;B.debug("execute onshow callback",this.lastHeartbeat),!this.logOut&&!this.reconnecting&&Date.now()-this.lastHeartbeat>2e3&&(B.debug("send ping"),this.mSync.sendUnreadDeal(),this.probingTimer&&clearTimeout(this.probingTimer),this.probingTimer=setTimeout((function(){B.error("Websocket connection timeout"),e.logOut||e.reconnecting||e.reconnect(!0)}),8e3))},c.prototype.sendLogout=function(e){void 0===e&&(e="logout");try{var t=this.mSync.generateLogout(e),r=Vt.call(this,t),n=r[0];if(r[1]){var o=this._getSock?this.mSync.base64transform(n):n;this.sock&&1===this.sock.readyState&&this.sock.send(o)}}catch(e){B.error("sendLogout failed",e)}},c._getSock=function(){},c}();function jc(e,t){var r=t.rpt,n=t.isRetry,o=this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users",i={requestName:m.RESISTER,requestUrl:o},a={headers:{"Content-Type":"application/json"},url:o,dataType:"json",data:JSON.stringify({username:e.username,password:e.password,nickname:e.nickname||""})};return ye.ajax(a,f.SDK_INTERNAL).then((function(e){var t=Pc(Pc({},e),{type:s.REQUEST_SUCCESS}),o=e.extraInfo,a=o.httpCode,c=o.elapse;return r({isEndApi:!0,isRetry:n,data:Pc(Pc({},{requestElapse:c,isSuccess:1,code:a}),i)}),t})).catch((function(e){var t=e.extraInfo,o=t.elapse,a=t.httpCode,s=t.errDesc;throw r({isRetry:n,data:Pc(Pc({},{requestElapse:o,isSuccess:0,code:a,codeDesc:s}),i)}),e}))}function Gc(e,t){return xc(this,void 0,void 0,(function(){var r,n;return kc(this,(function(o){switch(o.label){case 0:r=t.rpt,o.label=1;case 1:return o.trys.push([1,3,,7]),[4,jc.call(this,e,t)];case 2:return[2,o.sent()];case 3:return!((n=o.sent()).message.includes("Open registration doesn't allow")||n.message.includes("username be unique")||n.message.includes("is not legal"))&&this.isHttpDNS&&this.restIndex+1<this.restTotal?(this.restIndex++,$c.call(this),[4,Gc.call(this,e,{rpt:r})]):[3,5];case 4:return[2,o.sent()];case 5:throw B.error("retry signup failed",n),r({data:{isLastApi:1,isSuccess:0}}),n;case 6:return[3,7];case 7:return[2]}}))}))}function Hc(e,t){var r;return xc(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,l,d,p=this;return kc(this,(function(h){switch(h.label){case 0:if(n=Vc.call(this,e))throw n;return B.debug("socket readyState",null===(r=this.sock)||void 0===r?void 0:r.readyState),o=t.rpt,i=t.isRetry,Jc.call(this,e),this.user=e.user,a=this.context.appName,s=this.context.orgName,c=this.apiUrl+"/"+s+"/"+a+"/token",e.accessToken?(B.debug("login with accessToken"),this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,[2,{accessToken:e.accessToken}]):[3,1];case 1:return e.agoraToken?(B.info("login with agoraToken"),this.grantType="agoraToken",this.token=e.agoraToken,this.context.accessToken=e.agoraToken,this.context.restTokenData=e.agoraToken,[2,{accessToken:e.agoraToken}]):[3,2];case 2:return B.info("login with password"),this.grantType="password",u={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},l=JSON.stringify(u),d={headers:{"Content-Type":"application/json"},url:c,dataType:"json",data:l,version:this.version},B.debug("start get token"),[4,ye.ajax(d,f.SDK_INTERNAL).then((function(e){B.debug("get token success"),p.token=e.access_token,p.context.restTokenData=e.access_token,p.context.accessToken=e.access_token,p.expiresIn=e.expires_in;var t=e.extraInfo,r=t.httpCode,n=t.elapse,a={requestName:m.LOGIN_BY_PWD,requestElapse:n,requestUrl:c,isSuccess:1,code:r};return o({isRetry:i,data:a}),{accessToken:e.access_token,duration:e.expires_in}})).catch((function(e){B.error("get token failed",e);var t=e.extraInfo,r=t.elapse,n=t.httpCode,a=t.errDesc,s={requestName:m.LOGIN_BY_PWD,requestElapse:r,requestUrl:c,isSuccess:0,code:n,codeDesc:a};throw o({isRetry:i,data:s}),e}))];case 3:return[2,h.sent()]}}))}))}function Fc(e,t){var r;return xc(this,void 0,void 0,(function(){var n,o,i;return kc(this,(function(a){switch(a.label){case 0:n=t.rpt,a.label=1;case 1:return a.trys.push([1,3,,7]),[4,Hc.call(this,e,t)];case 2:return[2,a.sent()];case 3:return"invalid password"!==(o=a.sent()).message&&"user not found"!==o.message&&this.isHttpDNS&&this.restIndex+1<this.restTotal?(this.restIndex++,$c.call(this),[4,Fc.call(this,e,{rpt:n,isRetry:!0})]):[3,5];case 4:return[2,a.sent()];case 5:throw B.error("retry login failed",o),n({data:{isLastApi:1,isSuccess:0}}),this.clear(),i=void 0,o.error&&o.error_description?(i=p.create({type:s.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:o.error_description,data:o}),this.onError&&this.onError(i),i):(i=p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:null!==(r=o.message)&&void 0!==r?r:"login failed",data:o}),this.onError&&this.onError(i),i);case 6:return[3,7];case 7:return[2]}}))}))}function qc(){var e;B.debug("online"),this.onOnline&&this.onOnline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOnline"),this.sock&&1!==this.sock.readyState&&(B.debug("sock.readyState:",this.sock.readyState),this.logOut||this.reconnecting||this.reconnect())}function Wc(){var e,t;B.debug("offline"),null===(e=this.sock)||void 0===e||e.close(),this.onOffline&&this.onOffline(),null===(t=this.eventHandler)||void 0===t||t.dispatch("onOffline")}function zc(e){var t,r,n;return xc(this,void 0,void 0,(function(){var o,i,a,c;return kc(this,(function(u){switch(u.label){case 0:o=(new Date).getTime(),u.label=1;case 1:return u.trys.push([1,3,,7]),[4,Kc.call(this,e)];case 2:return i=u.sent(),e&&e({data:{isLastApi:1,isSuccess:1,accessChannel:null===(t=this.socketHost[this.hostIndex])||void 0===t?void 0:t.channel}}),[2,i];case 3:if(a=u.sent(),B.error("connect to msync failed times:",this.retryConnectTimes,a),K.includes(a.type))throw e&&e({data:{isLastApi:1,isSuccess:0,accessChannel:null===(r=this.socketHost[this.hostIndex])||void 0===r?void 0:r.channel,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||a.message}}),a;return this.retryConnectTimes++,this.retryConnectTimes<3?(this.isHttpDNS&&(this.hostIndex<this.socketHost.length-1?this.hostIndex++:this.hostIndex=this.socketHost.length-1,Qc.call(this)),a.type===s.REQUEST_TIMEOUT&&"provision timeout"===a.message||(c=(new Date).getTime()-o,null==e||e({isRetry:1!==this.retryConnectTimes,data:{requestUrl:this.url,requestName:m.CONNECT_WEBSOCKET,isSuccess:0,code:g.closed,requestElapse:c,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||"websocket close"}})),[4,zc.call(this,e)]):[3,5];case 4:return u.sent(),[3,6];case 5:throw B.error("connect failed three times",a),e&&e({data:{isLastApi:1,isSuccess:0,accessChannel:null===(n=this.socketHost[this.hostIndex])||void 0===n?void 0:n.channel,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||a.message}}),a;case 6:return[3,7];case 7:return[2]}}))}))}function Kc(e){var t=this,r=(new Date).getTime(),n="pending";return new Promise((function(o,i){var a;t._getSock?void 0===(a=t._getSock()).readyState&&(t.needSetReadyState=!0):(a=new WebSocket(t.url)).binaryType="arraybuffer",t.sock=a,t.connectionTimer&&clearTimeout(t.connectionTimer),t.connectionTimer=setTimeout((function(){t.disconnectedReason={type:s.REQUEST_TIMEOUT,message:"connection timeout"},a.close(),null==i||i(t.disconnectedReason)}),1e4),B.debug("start connect ws",t.url),t.connectionResolve=o,t.connectionReject=i;var c=function(){if(t.connectionTimer&&clearTimeout(t.connectionTimer),B.debug("websocket onOpen"),e){var n=(new Date).getTime()-r;e({isRetry:0!==t.retryConnectTimes,data:{requestUrl:t.url,requestName:m.CONNECT_WEBSOCKET,isSuccess:1,code:g.success,requestElapse:n}})}var o;o=t._getSock?ye.flow([t.mSync.generateProvision,t.mSync.base64transform])():t.mSync.generateProvision();try{t.provisionTimer&&clearTimeout(t.provisionTimer),t.provisionTimer=setTimeout((function(){B.error("provision timeout"),t.disconnectedReason=p.create({type:s.REQUEST_TIMEOUT,message:"provision timeout"}),a.close(),null==i||i(t.disconnectedReason)}),1e4),a.send(o)}catch(e){B.error("send provision message error",e);var c=p.create({type:s.SDK_RUNTIME_ERROR,message:"send message error",data:e});t.onError&&t.onError(c)}},u=function(e){t.connectionTimer&&clearTimeout(t.connectionTimer),setTimeout((function(){var r,o,a,c,u,l,d;if(B.debug("websocket onClose, isLogging:",t._isLogging,e),t.needSetReadyState&&(t.sock=Pc(Pc({},t.sock),{close:t.sock.close,send:t.sock.send,readyState:3})),t._isLogging)return null==i||i({type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}),void(n="rejected");if("rejected"!==n)if(n="rejected",t.logOut)t.clear(),t.resetConnState(),null===(o=null===(r=null==t?void 0:t._localCache)||void 0===r?void 0:r.getInstance())||void 0===o||o.close(),t.onClosed&&t.onClosed(),null===(a=t.eventHandler)||void 0===a||a.dispatch("onDisconnected",t.disconnectedReason),null==i||i(t.disconnectedReason||{type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"});else if(t.autoReconnectNumTotal<t.autoReconnectNumMax){t.reconnect();var h={type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.onError&&t.onError(h),t.autoReconnectNumTotal%t.refreshDNSIntervals===0&&t.isHttpDNS&&(B.debug("refresh dns config when websocket close"),Xc.call(t,(function(){})).catch((function(e){B.error("refresh dns config failed",e)})))}else null===(c=t.unMSyncSendMsgMap)||void 0===c||c.clear(),t.rejectMessage(),h={type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"},t.disconnectedReason=p.create({type:s.WEBIM_CONNCTION_DISCONNECTED,message:"reconnection failed"}),t.onError&&t.onError(h),null===(l=null===(u=null==t?void 0:t._localCache)||void 0===u?void 0:u.getInstance())||void 0===l||l.close(),t.onClosed&&t.onClosed(),null===(d=t.eventHandler)||void 0===d||d.dispatch("onDisconnected",t.disconnectedReason),t.resetConnState(),t.reconnecting=!1,null==i||i(h),B.debug("reconnect fail");else B.debug("reject is null")}),0)},l=function(e){var r=t.mSync,n=r.decodeMSync,o=r.distributeMSync;ye.flow([n,o])(e)};"web"===Dc.platform?(a.onopen=c,a.onclose=u,a.onmessage=l):(a.onOpen(c),a.onMessage(l),a.onClose(u),"undefined"!=typeof window&&window.WebSocket||a.onError((function(e){var r,o,a,c;if(t.connectionTimer&&clearTimeout(t.connectionTimer),B.debug("websocket onerror, isLogging:",t._isLogging,e),3!==t.sock.readyState&&(t.sock=Pc(Pc({},t.sock),{close:t.sock.close,send:t.sock.send,readyState:3})),t.onError&&t.onError({type:s.WEBIM_CONNECTION_ERROR,message:"on socket error",data:e}),t._isLogging)return null==i||i({type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}),void(n="rejected");if("rejected"!==n){if(n="rejected",!t.logOut)if(t.autoReconnectNumTotal<t.autoReconnectNumMax)B.debug("sock.onError reconnect",t.autoReconnectNumTotal,t.autoReconnectNumMax),t.reconnect(),t.autoReconnectNumTotal%t.refreshDNSIntervals===0&&t.isHttpDNS&&(B.debug("refresh dns config when websocket error"),Xc.call(t,(function(){})).catch((function(e){B.error("refresh dns config failed",e)})));else{var u={type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.disconnectedReason=p.create({type:s.WEBIM_CONNCTION_DISCONNECTED,message:"reconnection failed"}),null===(r=t.unMSyncSendMsgMap)||void 0===r||r.clear(),t.rejectMessage(),t.onError&&t.onError(u),null===(a=null===(o=null==t?void 0:t._localCache)||void 0===o?void 0:o.getInstance())||void 0===a||a.close(),t.onClosed&&t.onClosed(),null===(c=t.eventHandler)||void 0===c||c.dispatch("onDisconnected",t.disconnectedReason),t.resetConnState(),t.reconnecting=!1,null==i||i(u),B.info("reconnect fail")}}else B.debug("reject is null")})))}))}function Vc(e){if("object"!==Lc(e)||null===e)return p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:"the param is illegal"});if(!e.user||"string"!=typeof e.user){var t=p.create({type:s.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR,message:"the user is empty or type is not string"});return B.debug("open params error",t),t}return!("agoraToken"in e)||e.agoraToken&&"string"==typeof e.agoraToken?!("accessToken"in e)||e.accessToken&&"string"==typeof e.accessToken?"accessToken"in e||"agoraToken"in e||e.pwd?void 0:(t=p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:"the accessToken or pwd is illegal"}),B.debug("open params error",t),t):(t=p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:"the accessToken is illegal"}),B.debug("open params error",t),t):(t=p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:"the agoraToken is illegal"}),B.debug("open params error",t),console.warn("agoraToken is deprecated, please use accessToken instead"),t)}function Jc(e){this.context.jid={appKey:this.appKey,name:e.user,domain:this.domain,clientResource:this.clientResource},this.context.root=this.root,this.context.userId=e.user,this.context.appKey=this.appKey,this.context.appName=this.appName,this.context.orgName=this.orgName}function Yc(e){var t=this,r=e.rpt,n=e.isRetry,o=this.dnsIndex<this.dnsTotal?this.dnsIndex:0,i="".concat(this.dnsArr[o],"/easemob/server.json");B.debug("call getHttpDNS: "+this.dnsIndex);var a={url:i,dataType:"json",type:"GET",data:{}};return this._initWithAppId?a.data={app_id:this.appId,sdk_version:"4.10.0",file_version:"1"}:a.data={app_key:Dc.platform===ce.WEB?encodeURIComponent(this.appKey):this.appKey},ye.ajax(a,f.SDK_INTERNAL).then((function(e){if(!e)throw p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed"});B.debug("getHttpDNS success");var o=e.rest.hosts,a=t.https?"https":"http";if(t._initWithAppId){if(!e.app_key)throw(u=p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed"})).extraInfo=e.extraInfo,u;t.appKey=e.app_key,t.context.appKey=t.appKey,t.devInfos=t.appKey.split("#"),t.orgName=t.devInfos[0],t.appName=t.devInfos[1],t.dataReport.updateAppKey(t.appKey)}if(!o)throw(u=p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:"DNS hosts resolution failed",data:e.rest})).extraInfo=e.extraInfo,u;var c=o.filter((function(e){if(e.protocol===a)return e}));t.restHosts=c,t.restTotal=c.length;var u,l=e["msync-wx"].hosts;if(!l)throw(u=p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:"DNS msync-wx resolution failed",data:e["msync-wx"]})).extraInfo=e.extraInfo,u;var d=l.filter((function(e){if(e.protocol===a)return e}));if(t.socketHost=d,t.hostTotal=d.length,t.isHttpDNS&&$c.call(t),t.isHttpDNS&&Qc.call(t),t._reportLogs="true"===e.enableReportLogs,t._reportInterval=Number(e.reportInterval||z),"true"===(null==e?void 0:e.enableDataReport)?(t.dataReport.setIsCollectDt(!0),t.dataReport.setIsReportDt(!0)):(t.dataReport.setIsReportDt(!1),t.dataReport.setIsCollectDt(!1)),"false"===(null==e?void 0:e.uploadinparts_enable)&&(t.uploadPartEnable=!1),e.extraInfo){var h=e.extraInfo,f=h.elapse,v=h.httpCode,g={requestUrl:i,requestName:m.GET_DNS,requestElapse:f,isSuccess:1,code:v};r&&r({isRetry:n,data:g})}})).catch((function(e){var t=e.extraInfo||{},o=t.elapse,a=t.httpCode,c=t.errDesc,u={requestUrl:i,requestName:m.GET_DNS,isSuccess:0,code:a,codeDesc:c,requestElapse:o};throw r&&r({isRetry:n,data:u}),p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:e.message,data:e})}))}function Xc(e,t){return xc(this,void 0,void 0,(function(){var r;return kc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,6]),[4,Yc.call(this,{rpt:e,isRetry:t})];case 1:case 3:return[2,n.sent()];case 2:return r=n.sent(),B.error("get DNS failed",r,"times:",this.dnsIndex),this.dnsIndex++,this.dnsIndex<this.dnsTotal?[4,Xc.call(this,e,!0)]:[3,4];case 4:throw B.error("retryRequestDNS failed"),p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed",data:r});case 5:return[3,6];case 6:return[2]}}))}))}function Qc(){var e=this.socketHost[this.hostIndex],t=e.domain,r=e.ip,n=e.port,o="";o=t||r,n&&"80"!==n&&"443"!==n&&(o+=":"+n),o&&(this.url="//"+o+"/websocket");var i=this.https?"wss:":"ws:";this.url=i+this.url}function $c(){var e,t;if(this.restIndex>this.restTotal)return B.debug("restIndex > restTotal"),"";var r="",n=this.restHosts[this.restIndex],o=n.domain,i=n.ip,a=n.port,s=this.https?"https:":"http:";return i&&"undefined"!=typeof window&&"http:"===(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.protocol)?r=s+"//"+i+":"+a:(r=s+"//"+o,a&&"80"!==a&&"443"!==a&&(r+=":".concat(a)),"undefined"==typeof window||window.location||(r="https://"+o),"undefined"!=typeof window&&window.location&&"file:"===(null===(t=window.location)||void 0===t?void 0:t.protocol)&&(r="https://"+o)),"undefined"==typeof window&&(r=s+"//"+o),this.apiUrl=r,r}u().util.Long=d(),u().configure();var Zc=u().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},editMessageId:{type:"uint64",id:11},editScope:{type:"EditScope",id:12},stream:{type:"Stream",id:13}},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},subType:{type:"SubType",id:22},title:{type:"string",id:23},summary:{type:"string",id:24},combineLevel:{type:"int32",id:25},imageType:{type:"int32",id:26}},nested:{Type:{values:{TEXT:0,IMAGE:1,VIDEO:2,LOCATION:3,VOICE:4,FILE:5,COMMAND:6,CUSTOM:7,COMBINE:8}},Size:{fields:{width:{type:"double",id:1},height:{type:"double",id:2}}},SubType:{values:{COMBINE:0,GIF:1,SUB_STREAM:10}}}},Type:{values:{NORMAL:0,CHAT:1,GROUPCHAT:2,CHATROOM:3,READ_ACK:4,DELIVER_ACK:5,RECALL:6,CHANNEL_ACK:7,EDIT:8}},EditScope:{values:{BODY:1,BODY_AND_EXT:2}},MessageConfig:{fields:{allowGroupAck:{type:"bool",id:1}}},Stream:{fields:{streamType:{type:"string",id:1},streamSeq:{type:"uint64",id:2},streamStatus:{type:"StreamStatus",id:3},streamError:{type:"uint32",id:4},streamFinishReason:{type:"int32",id:5}},nested:{StreamStatus:{values:{STREAM_START:0,STREAM_IN_PROGRESS:1,STREAM_COMPLETED:2,STREAM_FULL:3}}}}}},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},traceId:{type:"uint64",id:20}},nested:{Version:{values:{MSYNC_V1:0,MSYNC_V2:1}},Command:{values:{SYNC:0,UNREAD:1,NOTICE:2,PROVISION:3,LOGOUT:4}}}},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},ext:{rule:"repeated",type:"KeyValue",id:8},meta:{type:"bytes",id:9},directedUsers:{rule:"repeated",type:"string",id:10},env:{type:"string",id:13}},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,ROUTE_DIRECT:2}}}},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},serviceId:{type:"string",id:16},actionVersion:{type:"string",id:17},authToken:{type:"string",id:18},osCustomValue:{type:"uint32",id:19},sessionId:{type:"string",id:20},reason:{type:"string",id:21},protocolCompressType:{rule:"repeated",type:"CompressType",id:22},protocolCompressDirection:{type:"CompressDirection",id:23}},nested:{OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_CUSTOM:5,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,COMPRESS_LZ4:2}},CompressDirection:{values:{ONLY_UP:0,ONLY_DOWN:1,BI:2}}}},Logout:{fields:{sessionId:{type:"string",id:1},reason:{type:"string",id:2},status:{type:"Status",id:3}}},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},isThread:{type:"bool",id:9},mucParentId:{type:"JID",id:10},mucName:{type:"string",id:11},eventInfo:{type:"EventInfo",id:12},mucMemberCount:{type:"int32",id:13},ext:{type:"string",id:14},leaveOtherRooms:{type:"bool",id:15},members:{rule:"repeated",type:"string",id:16}},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,THREAD_CREATE:33,THREAD_DESTROY:34,THREAD_JOIN:35,THREAD_LEAVE:36,THREAD_KICK:37,THREAD_UPDATE:38,THREAD_PRESENCE:39,THREAD_ABSENCE:40,DISABLE_GROUP:41,ABLE_GROUP:42,SET_METADATA:43,DELETE_METADATA:44,GROUP_MEMBER_METADATA_UPDATE:45}},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},chatroomInfo:{type:"string",id:3}},nested:{ErrorCode:{values:{OK:0,PERMISSION_DENIED:1,WRONG_PARAMETER:2,MUC_NOT_EXIST:3,USER_NOT_EXIST:4,UNKNOWN:5}}}},EventInfo:{fields:{eventType:{type:"EventType",id:1,options:{default:"EVENT_NONE"}},ext:{type:"string",id:2}},nested:{EventType:{values:{EVENT_NONE:0,CIRCLE_CHANNEL:1}}}}}},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},reason:{type:"string",id:10}},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_CUSTOM:5,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}}}}}}}}}});Bc.prototype.root=Zc;var eu=B.getLogger("defaultLogger");eu.setConfig({useCache:!1,maxCache:3145728,color:"",background:""}),eu.enableAll(),Bc.prototype.getUniqueId=ye.getUniqueId;var tu={connection:Bc,message:Je,utils:ye,logger:eu,statusCode:s};"undefined"!=typeof window&&(window.WebIM=tu);var ru=tu}(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__}()}));
|
|
2
|
+
!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()}(self,(function(){return function(){var __webpack_modules__={34:function(e,t,r){"use strict";var n=r(4901);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},81:function(e,t,r){"use strict";var n=r(9565),o=r(9306),i=r(8551),a=r(6823),s=r(851),c=TypeError;e.exports=function(e,t){var r=arguments.length<2?s(e):t;if(o(r))return i(n(r,e));throw new c(a(e)+" is not iterable")}},113:function(e,t,r){"use strict";var n=r(6518),o=r(9213).find,i=r(6469),a="find",s=!0;a in[]&&Array(1)[a]((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{find:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i(a)},150:function(e,t,r){"use strict";r(6518)({target:"Number",stat:!0},{isNaN:function(e){return e!=e}})},235:function(e,t,r){"use strict";var n=r(9213).forEach,o=r(4598)("forEach");e.exports=o?[].forEach:function(e){return n(this,e,arguments.length>1?arguments[1]:void 0)}},280:function(e,t,r){"use strict";var n=r(6518),o=r(7751),i=r(6395),a=r(550),s=r(916).CONSTRUCTOR,c=r(3438),u=o("Promise"),l=i&&!s;n({target:"Promise",stat:!0,forced:i||s},{resolve:function(e){return c(l&&this===u?a:this,e)}})},283:function(e,t,r){"use strict";var n=r(9504),o=r(9039),i=r(4901),a=r(9297),s=r(3724),c=r(350).CONFIGURABLE,u=r(3706),l=r(1181),d=l.enforce,p=l.get,h=String,f=Object.defineProperty,m=n("".slice),v=n("".replace),g=n([].join),y=s&&!o((function(){return 8!==f((function(){}),"length",{value:8}).length})),E=String(String).split("String"),_=e.exports=function(e,t,r){"Symbol("===m(h(t),0,7)&&(t="["+v(h(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||c&&e.name!==t)&&(s?f(e,"name",{value:t,configurable:!0}):e.name=t),y&&r&&a(r,"arity")&&e.length!==r.arity&&f(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=d(e);return a(n,"source")||(n.source=g(E,"string"==typeof t?t:"")),e};Function.prototype.toString=_((function(){return i(this)&&p(this).source||u(this)}),"toString")},298:function(e,t,r){"use strict";var n=r(2195),o=r(5397),i=r(8480).f,a=r(7680),s="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];e.exports.f=function(e){return s&&"Window"===n(e)?function(e){try{return i(e)}catch(e){return a(s)}}(e):i(o(e))}},350:function(e,t,r){"use strict";var n=r(3724),o=r(9297),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,s=o(i,"name"),c=s&&"something"===function(){}.name,u=s&&(!n||n&&a(i,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:u}},361:function(e,t,r){"use strict";var n=t,o=r(3262),i=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var r=0,n={};for(t|=0;r<e.length;)n[i[r+t]]=e[r++];return n}n.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",o.emptyArray,null]),n.long=a([0,0,0,1,1],7),n.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=a([1,5,0,0,0,5,5,0,0,0,1,1,0])},373:function(e,t,r){"use strict";var n=r(4576),o=r(7476),i=r(9039),a=r(9306),s=r(4488),c=r(4644),u=r(3709),l=r(3763),d=r(9519),p=r(3607),h=c.aTypedArray,f=c.exportTypedArrayMethod,m=n.Uint16Array,v=m&&o(m.prototype.sort),g=!(!v||i((function(){v(new m(2),null)}))&&i((function(){v(new m(2),{})}))),y=!!v&&!i((function(){if(d)return d<74;if(u)return u<67;if(l)return!0;if(p)return p<602;var e,t,r=new m(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(v(r,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(r[e]!==n[e])return!0}));f("sort",(function(e){return void 0!==e&&a(e),y?v(this,e):s(h(this),function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}}(e))}),!y||g)},397:function(e,t,r){"use strict";var n=r(7751);e.exports=n("document","documentElement")},420:function(e,t,r){"use strict";e.exports=function(e){var t=o.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r={};e.oneofsArray.length&&t("var p={}");for(var n=0;n<e.fieldsArray.length;++n){var c=e._fieldsArray[n].resolve(),u="m"+o.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",u,c.name),c.map)t("if(!util.isObject(%s))",u)("return%j",i(c,"object"))("var k=Object.keys(%s)",u)("for(var i=0;i<k.length;++i){"),s(t,c,"k[i]"),a(t,c,n,u+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",u)("return%j",i(c,"array"))("for(var i=0;i<%s.length;++i){",u),a(t,c,n,u+"[i]")("}");else{if(c.partOf){var l=o.safeProp(c.partOf.name);1===r[c.partOf.name]&&t("if(p%s===1)",l)("return%j",c.partOf.name+": multiple values"),r[c.partOf.name]=1,t("p%s=1",l)}a(t,c,n,u)}c.optional&&t("}")}return t("return null")};var n=r(5643),o=r(3262);function i(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,r,o){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",o)("default:")("return%j",i(t,"enum value"));for(var a=Object.keys(t.resolvedType.values),s=0;s<a.length;++s)e("case %i:",t.resolvedType.values[a[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,o)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",o)("return%j",i(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",o,o,o,o)("return%j",i(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',o)("return%j",i(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',o)("return%j",i(t,"boolean"));break;case"string":e("if(!util.isString(%s))",o)("return%j",i(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',o,o,o)("return%j",i(t,"buffer"))}return e}function s(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",i(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",i(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",i(t,"boolean key"))}return e}},421:function(e){"use strict";e.exports={}},436:function(e,t,r){"use strict";var n,o,i,a=r(6518),s=r(6395),c=r(6193),u=r(4576),l=r(9565),d=r(6840),p=r(2967),h=r(687),f=r(7633),m=r(9306),v=r(4901),g=r(34),y=r(679),E=r(2293),_=r(9225).set,T=r(1955),I=r(3138),O=r(1103),R=r(8265),S=r(1181),b=r(550),C=r(916),N=r(6043),A="Promise",M=C.CONSTRUCTOR,w=C.REJECTION_EVENT,U=C.SUBCLASSING,L=S.getterFor(A),P=S.set,x=b&&b.prototype,k=b,D=x,B=u.TypeError,j=u.document,G=u.process,H=N.f,F=H,q=!!(j&&j.createEvent&&u.dispatchEvent),W="unhandledrejection",z=function(e){var t;return!(!g(e)||!v(t=e.then))&&t},K=function(e,t){var r,n,o,i=t.value,a=1===t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,d=e.domain;try{s?(a||(2===t.rejection&&Q(t),t.rejection=1),!0===s?r=i:(d&&d.enter(),r=s(i),d&&(d.exit(),o=!0)),r===e.promise?u(new B("Promise-chain cycle")):(n=z(r))?l(n,r,c,u):c(r)):u(i)}catch(e){d&&!o&&d.exit(),u(e)}},V=function(e,t){e.notified||(e.notified=!0,T((function(){for(var r,n=e.reactions;r=n.get();)K(r,e);e.notified=!1,t&&!e.rejection&&Y(e)})))},J=function(e,t,r){var n,o;q?((n=j.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),u.dispatchEvent(n)):n={promise:t,reason:r},!w&&(o=u["on"+e])?o(n):e===W&&I("Unhandled promise rejection",r)},Y=function(e){l(_,u,(function(){var t,r=e.facade,n=e.value;if(X(e)&&(t=O((function(){c?G.emit("unhandledRejection",n,r):J(W,r,n)})),e.rejection=c||X(e)?2:1,t.error))throw t.value}))},X=function(e){return 1!==e.rejection&&!e.parent},Q=function(e){l(_,u,(function(){var t=e.facade;c?G.emit("rejectionHandled",t):J("rejectionhandled",t,e.value)}))},$=function(e,t,r){return function(n){e(t,n,r)}},Z=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,V(e,!0))},ee=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new B("Promise can't be resolved itself");var n=z(t);n?T((function(){var r={done:!1};try{l(n,t,$(ee,r,e),$(Z,r,e))}catch(t){Z(r,t,e)}})):(e.value=t,e.state=1,V(e,!1))}catch(t){Z({done:!1},t,e)}}};if(M&&(D=(k=function(e){y(this,D),m(e),l(n,this);var t=L(this);try{e($(ee,t),$(Z,t))}catch(e){Z(t,e)}}).prototype,(n=function(e){P(this,{type:A,done:!1,notified:!1,parent:!1,reactions:new R,rejection:!1,state:0,value:null})}).prototype=d(D,"then",(function(e,t){var r=L(this),n=H(E(this,k));return r.parent=!0,n.ok=!v(e)||e,n.fail=v(t)&&t,n.domain=c?G.domain:void 0,0===r.state?r.reactions.add(n):T((function(){K(n,r)})),n.promise})),o=function(){var e=new n,t=L(e);this.promise=e,this.resolve=$(ee,t),this.reject=$(Z,t)},N.f=H=function(e){return e===k||void 0===e?new o(e):F(e)},!s&&v(b)&&x!==Object.prototype)){i=x.then,U||d(x,"then",(function(e,t){var r=this;return new k((function(e,t){l(i,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete x.constructor}catch(e){}p&&p(x,D)}a({global:!0,constructor:!0,wrap:!0,forced:M},{Promise:k}),h(k,A,!1,!0),f(A)},511:function(e,t,r){"use strict";var n=r(9167),o=r(9297),i=r(1951),a=r(4913).f;e.exports=function(e){var t=n.Symbol||(n.Symbol={});o(t,e)||a(t,e,{value:i.f(e)})}},527:function(e){"use strict";e.exports=d;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,n=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,o=/^ *[*/]+ */,i=/^\s*\*?\/*/,a=/\n/g,s=/\s/,c=/\\(.?)/g,u={0:"\0",r:"\r",n:"\n",t:"\t"};function l(e){return e.replace(c,(function(e,t){switch(t){case"\\":case"":return t;default:return u[t]||""}}))}function d(e,c){e=e.toString();var u=0,d=e.length,p=1,h=null,f=null,m=0,v=!1,g=!1,y=[],E=null;function _(e){return Error("illegal "+e+" (line "+p+")")}function T(t){return e.charAt(t)}function I(t,r,n){h=e.charAt(t++),m=p,v=!1,g=n;var s,u=t-(c?2:3);do{if(--u<0||"\n"===(s=e.charAt(u))){v=!0;break}}while(" "===s||"\t"===s);for(var l=e.substring(t,r).split(a),d=0;d<l.length;++d)l[d]=l[d].replace(c?i:o,"").trim();f=l.join("\n").trim()}function O(t){var r=R(t),n=e.substring(t,r);return/^\s*\/{1,2}/.test(n)}function R(e){for(var t=e;t<d&&"\n"!==T(t);)t++;return t}function S(){if(y.length>0)return y.shift();if(E)return function(){var t="'"===E?n:r;t.lastIndex=u-1;var o=t.exec(e);if(!o)throw _("string");return u=t.lastIndex,b(E),E=null,l(o[1])}();var o,i,a,h,f,m=0===u;do{if(u===d)return null;for(o=!1;s.test(a=T(u));)if("\n"===a&&(m=!0,++p),++u===d)return null;if("/"===T(u)){if(++u===d)throw _("comment");if("/"===T(u))if(c){if(h=u,f=!1,O(u)){f=!0;do{if((u=R(u))===d)break;u++}while(O(u))}else u=Math.min(d,R(u)+1);f&&I(h,u,m),p++,o=!0}else{for(f="/"===T(h=u+1);"\n"!==T(++u);)if(u===d)return null;++u,f&&I(h,u-1,m),++p,o=!0}else{if("*"!==(a=T(u)))return"/";h=u+1,f=c||"*"===T(h);do{if("\n"===a&&++p,++u===d)throw _("comment");i=a,a=T(u)}while("*"!==i||"/"!==a);++u,f&&I(h,u-2,m),o=!0}}}while(o);var v=u;if(t.lastIndex=0,!t.test(T(v++)))for(;v<d&&!t.test(T(v));)++v;var g=e.substring(u,u=v);return'"'!==g&&"'"!==g||(E=g),g}function b(e){y.push(e)}function C(){if(!y.length){var e=S();if(null===e)return null;b(e)}return y[0]}return Object.defineProperty({next:S,peek:C,push:b,skip:function(e,t){var r=C();if(r===e)return S(),!0;if(!t)throw _("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t=null;return void 0===e?m===p-1&&(c||"*"===h||v)&&(t=g?f:null):(m<e&&C(),m!==e||v||!c&&"/"!==h||(t=g?null:f)),t}},"line",{get:function(){return p}})}d.unescape=l},537:function(e,t,r){"use strict";var n=r(550),o=r(4428),i=r(916).CONSTRUCTOR;e.exports=i||!o((function(e){n.all(e).then(void 0,(function(){}))}))},550:function(e,t,r){"use strict";var n=r(4576);e.exports=n.Promise},566:function(e,t,r){"use strict";var n=r(9504),o=r(9306),i=r(34),a=r(9297),s=r(7680),c=r(616),u=Function,l=n([].concat),d=n([].join),p={};e.exports=c?u.bind:function(e){var t=o(this),r=t.prototype,n=s(arguments,1),c=function(){var r=l(n,s(arguments));return this instanceof c?function(e,t,r){if(!a(p,t)){for(var n=[],o=0;o<t;o++)n[o]="a["+o+"]";p[t]=u("C,a","return new C("+d(n,",")+")")}return p[t](e,r)}(t,r.length,r):t.apply(e,r)};return i(r)&&(c.prototype=r),c}},597:function(e,t,r){"use strict";var n=r(9039),o=r(8227),i=r(9519),a=o("species");e.exports=function(e){return i>=51||!n((function(){var t=[];return(t.constructor={})[a]=function(){return{foo:1}},1!==t[e](Boolean).foo}))}},616:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},655:function(e,t,r){"use strict";var n=r(6955),o=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return o(e)}},679:function(e,t,r){"use strict";var n=r(1625),o=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new o("Incorrect invocation")}},687:function(e,t,r){"use strict";var n=r(4913).f,o=r(9297),i=r(8227)("toStringTag");e.exports=function(e,t,r){e&&!r&&(e=e.prototype),e&&!o(e,i)&&n(e,i,{configurable:!0,value:t})}},706:function(e,t,r){"use strict";var n=r(350).PROPER,o=r(9039),i=r(7452);e.exports=function(e){return o((function(){return!!i[e]()||"
"!=="
"[e]()||n&&i[e].name!==e}))}},739:function(e,t,r){"use strict";var n=r(6518),o=r(9039),i=r(8981),a=r(2777);n({target:"Date",proto:!0,arity:1,forced:o((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}))},{toJSON:function(e){var t=i(this),r=a(t,"number");return"number"!=typeof r||isFinite(r)?t.toISOString():null}})},741:function(e){"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},744:function(e,t,r){"use strict";var n=t,o=r(5643),i=r(3262);function a(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof o){e("switch(d%s){",n);for(var i=t.resolvedType.values,a=Object.keys(i),s=0;s<a.length;++s)t.repeated&&i[a[s]]===t.typeDefault&&e("default:"),e("case%j:",a[s])("case %i:",i[a[s]])("m%s=%j",n,i[a[s]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof o?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var i=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=i.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var s=t[n].resolve(),c=i.safeProp(s.name);s.map?(r("if(d%s){",c)('if(typeof d%s!=="object")',c)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",c)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",c),a(r,s,n,c+"[ks[i]]")("}")("}")):s.repeated?(r("if(d%s){",c)("if(!Array.isArray(d%s))",c)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",c)("for(var i=0;i<d%s.length;++i){",c),a(r,s,n,c+"[i]")("}")("}")):(s.resolvedType instanceof o||r("if(d%s!=null){",c),a(r,s,n,c),s.resolvedType instanceof o||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(i.compareFieldsById);if(!t.length)return i.codegen()("return {}");for(var r=i.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],a=[],c=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?n:t[u].map?a:c).push(t[u]);if(n.length){for(r("if(o.arrays||o.defaults){"),u=0;u<n.length;++u)r("d%s=[]",i.safeProp(n[u].name));r("}")}if(a.length){for(r("if(o.objects||o.defaults){"),u=0;u<a.length;++u)r("d%s={}",i.safeProp(a[u].name));r("}")}if(c.length){for(r("if(o.defaults){"),u=0;u<c.length;++u){var l=c[u],d=i.safeProp(l.name);if(l.resolvedType instanceof o)r("d%s=o.enums===String?%j:%j",d,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",d)("}else")("d%s=o.longs===String?%j:%i",d,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var p="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",d,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",d,p)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",d,d)("}")}else r("d%s=%j",d,l.typeDefault)}r("}")}var h=!1;for(u=0;u<t.length;++u){l=t[u];var f=e._fieldsArray.indexOf(l);d=i.safeProp(l.name),l.map?(h||(h=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",d,d)("d%s={}",d)("for(var j=0;j<ks2.length;++j){"),s(r,l,f,d+"[ks2[j]]")("}")):l.repeated?(r("if(m%s&&m%s.length){",d,d)("d%s=[]",d)("for(var j=0;j<m%s.length;++j){",d),s(r,l,f,d+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",d,l.name),s(r,l,f,d),l.partOf&&r("if(o.oneofs)")("d%s=%j",i.safeProp(l.partOf.name),l.name)),r("}")}return r("return d")}},757:function(e,t,r){"use strict";var n=r(7751),o=r(4901),i=r(1625),a=r(7040),s=Object;e.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return o(t)&&i(t.prototype,s(e))}},788:function(e,t,r){"use strict";var n=r(34),o=r(2195),i=r(8227)("match");e.exports=function(e){var t;return n(e)&&(void 0!==(t=e[i])?!!t:"RegExp"===o(e))}},818:function(e,t,r){"use strict";e.exports=i;var n=r(3449);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(3610);function i(){n.call(this)}function a(e,t,r){e.length<40?o.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}i._configure=function(){i.alloc=o._Buffer_allocUnsafe,i.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&"set"===o.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},i.prototype.bytes=function(e){o.isString(e)&&(e=o._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(i.writeBytesBuffer,t,e),this},i.prototype.string=function(e){var t=o.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},i._configure()},851:function(e,t,r){"use strict";var n=r(6955),o=r(5966),i=r(4117),a=r(6269),s=r(8227)("iterator");e.exports=function(e){if(!i(e))return o(e,s)||o(e,"@@iterator")||a[n(e)]}},916:function(e,t,r){"use strict";var n=r(4576),o=r(550),i=r(4901),a=r(2796),s=r(3706),c=r(8227),u=r(4215),l=r(6395),d=r(9519),p=o&&o.prototype,h=c("species"),f=!1,m=i(n.PromiseRejectionEvent),v=a("Promise",(function(){var e=s(o),t=e!==String(o);if(!t&&66===d)return!0;if(l&&(!p.catch||!p.finally))return!0;if(!d||d<51||!/native code/.test(e)){var r=new o((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[h]=n,!(f=r.then((function(){}))instanceof n))return!0}return!(t||"BROWSER"!==u&&"DENO"!==u||m)}));e.exports={CONSTRUCTOR:v,REJECTION_EVENT:m,SUBCLASSING:f}},926:function(e,t,r){"use strict";var n=r(9306),o=r(8981),i=r(7055),a=r(6198),s=TypeError,c="Reduce of empty array with no initial value",u=function(e){return function(t,r,u,l){var d=o(t),p=i(d),h=a(d);if(n(r),0===h&&u<2)throw new s(c);var f=e?h-1:0,m=e?-1:1;if(u<2)for(;;){if(f in p){l=p[f],f+=m;break}if(f+=m,e?f<0:h<=f)throw new s(c)}for(;e?f>=0:h>f;f+=m)f in p&&(l=r(l,p[f],f,d));return l}};e.exports={left:u(!1),right:u(!0)}},1034:function(e,t,r){"use strict";var n=r(9565),o=r(9297),i=r(1625),a=r(7979),s=RegExp.prototype;e.exports=function(e){var t=e.flags;return void 0!==t||"flags"in s||o(e,"flags")||!i(s,e)?t:n(a,e)}},1072:function(e,t,r){"use strict";var n=r(1828),o=r(8727);e.exports=Object.keys||function(e){return n(e,o)}},1080:function(e,t,r){"use strict";e.exports=function(e){for(var t,r=i.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(i.compareFieldsById),c=0;c<s.length;++c){var u=s[c].resolve(),l=e._fieldsArray.indexOf(u),d=u.resolvedType instanceof n?"int32":u.type,p=o.basic[d];t="m"+i.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|o.mapKey[u.keyType],u.keyType),void 0===p?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|p,d,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==o.packed[d]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",d,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===p?a(r,u,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|p)>>>0,d,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===p?a(r,u,l,t):r("w.uint32(%i).%s(%s)",(u.id<<3|p)>>>0,d,t))}return r("return w")};var n=r(5643),o=r(361),i=r(3262);function a(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},1088:function(e,t,r){"use strict";var n=r(6518),o=r(9565),i=r(6395),a=r(350),s=r(4901),c=r(3994),u=r(2787),l=r(2967),d=r(687),p=r(6699),h=r(6840),f=r(8227),m=r(6269),v=r(7657),g=a.PROPER,y=a.CONFIGURABLE,E=v.IteratorPrototype,_=v.BUGGY_SAFARI_ITERATORS,T=f("iterator"),I="keys",O="values",R="entries",S=function(){return this};e.exports=function(e,t,r,a,f,v,b){c(r,t,a);var C,N,A,M=function(e){if(e===f&&x)return x;if(!_&&e&&e in L)return L[e];switch(e){case I:case O:case R:return function(){return new r(this,e)}}return function(){return new r(this)}},w=t+" Iterator",U=!1,L=e.prototype,P=L[T]||L["@@iterator"]||f&&L[f],x=!_&&P||M(f),k="Array"===t&&L.entries||P;if(k&&(C=u(k.call(new e)))!==Object.prototype&&C.next&&(i||u(C)===E||(l?l(C,E):s(C[T])||h(C,T,S)),d(C,w,!0,!0),i&&(m[w]=S)),g&&f===O&&P&&P.name!==O&&(!i&&y?p(L,"name",O):(U=!0,x=function(){return o(P,this)})),f)if(N={values:M(O),keys:v?x:M(I),entries:M(R)},b)for(A in N)(_||U||!(A in L))&&h(L,A,N[A]);else n({target:t,proto:!0,forced:_||U},N);return i&&!b||L[T]===x||h(L,T,x,{name:f}),m[t]=x,N}},1103:function(e){"use strict";e.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}},1108:function(e,t,r){"use strict";var n=r(6955);e.exports=function(e){var t=n(e);return"BigInt64Array"===t||"BigUint64Array"===t}},1181:function(e,t,r){"use strict";var n,o,i,a=r(8622),s=r(4576),c=r(34),u=r(6699),l=r(9297),d=r(7629),p=r(6119),h=r(421),f="Object already initialized",m=s.TypeError,v=s.WeakMap;if(a||d.state){var g=d.state||(d.state=new v);g.get=g.get,g.has=g.has,g.set=g.set,n=function(e,t){if(g.has(e))throw new m(f);return t.facade=e,g.set(e,t),t},o=function(e){return g.get(e)||{}},i=function(e){return g.has(e)}}else{var y=p("state");h[y]=!0,n=function(e,t){if(l(e,y))throw new m(f);return t.facade=e,u(e,y,t),t},o=function(e){return l(e,y)?e[y]:{}},i=function(e){return l(e,y)}}e.exports={set:n,get:o,has:i,enforce:function(e){return i(e)?o(e):n(e,{})},getterFor:function(e){return function(t){var r;if(!c(t)||(r=o(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return r}}}},1240:function(e,t,r){"use strict";var n=r(9504);e.exports=n(1..valueOf)},1291:function(e,t,r){"use strict";var n=r(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},1296:function(e,t,r){"use strict";var n=r(4495);e.exports=n&&!!Symbol.for&&!!Symbol.keyFor},1344:function(e,t,r){"use strict";e.exports=u;var n=r(7209);((u.prototype=Object.create(n.prototype)).constructor=u).className="Field";var o,i=r(5643),a=r(361),s=r(3262),c=/^required|optional|repeated$/;function u(e,t,r,o,i,u,l){if(s.isObject(o)?(l=i,u=o,o=i=void 0):s.isObject(i)&&(l=u,u=i,i=void 0),n.call(this,e,u),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(r))throw TypeError("type must be a string");if(void 0!==o&&!c.test(o=o.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==i&&!s.isString(i))throw TypeError("extend must be a string");"proto3_optional"===o&&(o="optional"),this.rule=o&&"optional"!==o?o:void 0,this.type=r,this.id=t,this.extend=i||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=!!s.Long&&void 0!==a.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=l}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.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])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=a.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof o?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 i&&"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 i)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.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;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof o&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},u.d=function(e,t,r,n){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(o,i){s.decorateType(o.constructor).add(new u(i,e,t,r,{default:n}))}},u._configure=function(e){o=e}},1392:function(e,t,r){"use strict";var n,o=r(6518),i=r(7476),a=r(7347).f,s=r(8014),c=r(655),u=r(5749),l=r(7750),d=r(1436),p=r(6395),h=i("".slice),f=Math.min,m=d("startsWith");o({target:"String",proto:!0,forced:!(!p&&!m&&(n=a(String.prototype,"startsWith"),n&&!n.writable)||m)},{startsWith:function(e){var t=c(l(this));u(e);var r=s(f(arguments.length>1?arguments[1]:void 0,t.length)),n=c(e);return h(t,r,r+n.length)===n}})},1405:function(e,t,r){"use strict";var n=r(4576),o=r(8745),i=r(4644),a=r(9039),s=r(7680),c=n.Int8Array,u=i.aTypedArray,l=i.exportTypedArrayMethod,d=[].toLocaleString,p=!!c&&a((function(){d.call(new c(1))}));l("toLocaleString",(function(){return o(d,p?s(u(this)):u(this),s(arguments))}),a((function(){return[1,2].toLocaleString()!==new c([1,2]).toLocaleString()}))||!a((function(){c.prototype.toLocaleString.call([1,2])})))},1415:function(e,t,r){"use strict";r(2405)},1436:function(e,t,r){"use strict";var n=r(8227)("match");e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n]=!1,"/./"[e](t)}catch(e){}}return!1}},1447:function(e,t){"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,o=null,i=[],a=0;t<r;)(n=e[t++])<128?i[a++]=n:n>191&&n<224?i[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,i[a++]=55296+(n>>10),i[a++]=56320+(1023&n)):i[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,i)),a=0);return o?(a&&o.push(String.fromCharCode.apply(String,i.slice(0,a))),o.join("")):String.fromCharCode.apply(String,i.slice(0,a))},r.write=function(e,t,r){for(var n,o,i=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(o=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&o),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-i}},1457:function(e,t,r){"use strict";e.exports=a;var n=r(7209);((a.prototype=Object.create(n.prototype)).constructor=a).className="OneOf";var o=r(1344),i=r(3262);function a(e,t,r,o){if(Array.isArray(t)||(r=t,t=void 0),n.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 s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},a.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,s(this),this},a.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},a.prototype.onAdd=function(e){n.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))}s(this)},a.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},a.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){i.decorateType(t.constructor).add(new a(r,e)),Object.defineProperty(t,r,{get:i.oneOfGetter(e),set:i.oneOfSetter(e)})}}},1469:function(e,t,r){"use strict";var n=r(7433);e.exports=function(e,t){return new(n(e))(0===t?0:t)}},1481:function(e,t,r){"use strict";var n=r(6518),o=r(6043);n({target:"Promise",stat:!0,forced:r(916).CONSTRUCTOR},{reject:function(e){var t=o.f(this);return(0,t.reject)(e),t.promise}})},1489:function(e,t,r){"use strict";r(5823)("Uint8",(function(e){return function(t,r,n){return e(this,t,r,n)}}))},1510:function(e,t,r){"use strict";var n=r(6518),o=r(7751),i=r(9297),a=r(655),s=r(5745),c=r(1296),u=s("string-to-symbol-registry"),l=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{for:function(e){var t=a(e);if(i(u,t))return u[t];var r=o("Symbol")(t);return u[t]=r,l[r]=t,r}})},1575:function(e,t,r){"use strict";var n=r(4644),o=r(926).left,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},1625:function(e,t,r){"use strict";var n=r(9504);e.exports=n({}.isPrototypeOf)},1629:function(e,t,r){"use strict";var n=r(6518),o=r(235);n({target:"Array",proto:!0,forced:[].forEach!==o},{forEach:o})},1630:function(e,t,r){"use strict";var n=r(9504),o=r(4644),i=n(r(7029)),a=o.aTypedArray;(0,o.exportTypedArrayMethod)("copyWithin",(function(e,t){return i(a(this),e,t,arguments.length>2?arguments[2]:void 0)}))},1694:function(e,t,r){"use strict";var n=r(4644),o=r(9213).find,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("find",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},1699:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(5749),a=r(7750),s=r(655),c=r(1436),u=o("".indexOf);n({target:"String",proto:!0,forced:!c("includes")},{includes:function(e){return!!~u(s(a(this)),s(i(e)),arguments.length>1?arguments[1]:void 0)}})},1745:function(e,t,r){"use strict";var n=r(6518),o=r(7476),i=r(9039),a=r(6346),s=r(8551),c=r(5610),u=r(8014),l=a.ArrayBuffer,d=a.DataView,p=d.prototype,h=o(l.prototype.slice),f=o(p.getUint8),m=o(p.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:i((function(){return!new l(2).slice(1,void 0).byteLength}))},{slice:function(e,t){if(h&&void 0===t)return h(s(this),e);for(var r=s(this).byteLength,n=c(e,r),o=c(void 0===t?r:t,r),i=new l(u(o-n)),a=new d(this),p=new d(i),v=0;n<o;)m(p,v++,f(a,n++));return i}})},1761:function(e,t,r){"use strict";var n=r(9565),o=r(9228),i=r(8551),a=r(34),s=r(8014),c=r(655),u=r(7750),l=r(5966),d=r(7829),p=r(6682);o("match",(function(e,t,r){return[function(t){var r=u(this),o=a(t)?l(t,e):void 0;return o?n(o,t,r):new RegExp(t)[e](c(r))},function(e){var n=i(this),o=c(e),a=r(t,n,o);if(a.done)return a.value;if(!n.global)return p(n,o);var u=n.unicode;n.lastIndex=0;for(var l,h=[],f=0;null!==(l=p(n,o));){var m=c(l[0]);h[f]=m,""===m&&(n.lastIndex=d(o,s(n.lastIndex),u)),f++}return 0===f?null:h}]}))},1828:function(e,t,r){"use strict";var n=r(9504),o=r(9297),i=r(5397),a=r(9617).indexOf,s=r(421),c=n([].push);e.exports=function(e,t){var r,n=i(e),u=0,l=[];for(r in n)!o(s,r)&&o(n,r)&&c(l,r);for(;t.length>u;)o(n,r=t[u++])&&(~a(l,r)||c(l,r));return l}},1920:function(e,t,r){"use strict";var n=r(4644),o=r(9213).filter,i=r(9948),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("filter",(function(e){var t=o(a(this),e,arguments.length>1?arguments[1]:void 0);return i(this,t)}))},1951:function(e,t,r){"use strict";var n=r(8227);t.f=n},1955:function(e,t,r){"use strict";var n,o,i,a,s,c=r(4576),u=r(3389),l=r(6080),d=r(9225).set,p=r(8265),h=r(9544),f=r(4265),m=r(7860),v=r(6193),g=c.MutationObserver||c.WebKitMutationObserver,y=c.document,E=c.process,_=c.Promise,T=u("queueMicrotask");if(!T){var I=new p,O=function(){var e,t;for(v&&(e=E.domain)&&e.exit();t=I.get();)try{t()}catch(e){throw I.head&&n(),e}e&&e.enter()};h||v||m||!g||!y?!f&&_&&_.resolve?((a=_.resolve(void 0)).constructor=_,s=l(a.then,a),n=function(){s(O)}):v?n=function(){E.nextTick(O)}:(d=l(d,c),n=function(){d(O)}):(o=!0,i=y.createTextNode(""),new g(O).observe(i,{characterData:!0}),n=function(){i.data=o=!o}),T=function(e){I.head||n(),I.add(e)}}e.exports=T},2003:function(e,t,r){"use strict";var n=r(6518),o=r(6395),i=r(916).CONSTRUCTOR,a=r(550),s=r(7751),c=r(4901),u=r(6840),l=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!o&&c(a)){var d=s("Promise").prototype.catch;l.catch!==d&&u(l,"catch",d,{unsafe:!0})}},2008:function(e,t,r){"use strict";var n=r(6518),o=r(9213).filter;n({target:"Array",proto:!0,forced:!r(597)("filter")},{filter:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},2010:function(e,t,r){"use strict";var n=r(3724),o=r(350).EXISTS,i=r(9504),a=r(2106),s=Function.prototype,c=i(s.toString),u=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,l=i(u.exec);n&&!o&&a(s,"name",{configurable:!0,get:function(){try{return l(u,c(this))[1]}catch(e){return""}}})},2062:function(e,t,r){"use strict";var n=r(6518),o=r(9213).map;n({target:"Array",proto:!0,forced:!r(597)("map")},{map:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},2087:function(e,t,r){"use strict";var n=r(34),o=Math.floor;e.exports=Number.isInteger||function(e){return!n(e)&&isFinite(e)&&o(e)===e}},2106:function(e,t,r){"use strict";var n=r(283),o=r(4913);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),o.f(e,t,r)}},2140:function(e,t,r){"use strict";var n={};n[r(8227)("toStringTag")]="z",e.exports="[object z]"===String(n)},2170:function(e,t,r){"use strict";var n=r(4644),o=r(9213).every,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("every",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},2195:function(e,t,r){"use strict";var n=r(9504),o=n({}.toString),i=n("".slice);e.exports=function(e){return i(o(e),8,-1)}},2211:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},2239:function(e,t,r){"use strict";e.exports=o;var n=r(3610);function o(e,t){this.lo=e>>>0,this.hi=t>>>0}var i=o.zero=new o(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(e){if(0===e)return i;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new o(r,n)},o.from=function(e){if("number"==typeof e)return o.fromNumber(e);if(n.isString(e)){if(!n.Long)return o.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new o(e.low>>>0,e.high>>>0):i},o.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},o.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;o.fromHash=function(e){return e===a?i:new o((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},o.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)},o.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},o.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},o.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}},2259:function(e,t,r){"use strict";r(511)("iterator")},2293:function(e,t,r){"use strict";var n=r(8551),o=r(5548),i=r(4117),a=r(8227)("species");e.exports=function(e,t){var r,s=n(e).constructor;return void 0===s||i(r=n(s)[a])?t:o(r)}},2333:function(e,t,r){"use strict";var n=r(1291),o=r(655),i=r(7750),a=RangeError;e.exports=function(e){var t=o(i(this)),r="",s=n(e);if(s<0||s===1/0)throw new a("Wrong number of repetitions");for(;s>0;(s>>>=1)&&(t+=t))1&s&&(r+=t);return r}},2357:function(e,t,r){"use strict";var n=r(3724),o=r(9039),i=r(9504),a=r(2787),s=r(1072),c=r(5397),u=i(r(8773).f),l=i([].push),d=n&&o((function(){var e=Object.create(null);return e[2]=2,!u(e,2)})),p=function(e){return function(t){for(var r,o=c(t),i=s(o),p=d&&null===a(o),h=i.length,f=0,m=[];h>f;)r=i[f++],n&&!(p?r in o:u(o,r))||l(m,e?[r,o[r]]:o[r]);return m}};e.exports={entries:p(!0),values:p(!1)}},2360:function(e,t,r){"use strict";var n,o=r(8551),i=r(6801),a=r(8727),s=r(421),c=r(397),u=r(4055),l=r(6119),d="prototype",p="script",h=l("IE_PROTO"),f=function(){},m=function(e){return"<"+p+">"+e+"</"+p+">"},v=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,r;g="undefined"!=typeof document?document.domain&&n?v(n):(t=u("iframe"),r="java"+p+":",t.style.display="none",c.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):v(n);for(var o=a.length;o--;)delete g[d][a[o]];return g()};s[h]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(f[d]=o(e),r=new f,f[d]=null,r[h]=e):r=g(),void 0===t?r:i.f(r,t)}},2405:function(e,t,r){"use strict";r(6468)("Set",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(6938))},2480:function(e,t,r){"use strict";r(5081)},2529:function(e){"use strict";e.exports=function(e,t){return{value:e,done:t}}},2549:function(e,t,r){"use strict";e.exports=r(9100)},2551:function(e,t,r){"use strict";e.exports=o;var n=r(3610);function o(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}o.create=function(e){return this.$type.create(e)},o.encode=function(e,t){return this.$type.encode(e,t)},o.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},o.decode=function(e){return this.$type.decode(e)},o.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},o.verify=function(e){return this.$type.verify(e)},o.fromObject=function(e){return this.$type.fromObject(e)},o.toObject=function(e,t){return this.$type.toObject(e,t)},o.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},2566:function(e,t){var r;r=function(e){e.version="1.2.2";var t=function(){for(var e=0,t=new Array(256),r=0;256!=r;++r)e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=1&(e=r)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1)?-306674912^e>>>1:e>>>1,t[r]=e;return"undefined"!=typeof Int32Array?new Int32Array(t):t}(),r=function(e){var t=0,r=0,n=0,o="undefined"!=typeof Int32Array?new Int32Array(4096):new Array(4096);for(n=0;256!=n;++n)o[n]=e[n];for(n=0;256!=n;++n)for(r=e[n],t=256+n;t<4096;t+=256)r=o[t]=r>>>8^e[255&r];var i=[];for(n=1;16!=n;++n)i[n-1]="undefined"!=typeof Int32Array?o.subarray(256*n,256*n+256):o.slice(256*n,256*n+256);return i}(t),n=r[0],o=r[1],i=r[2],a=r[3],s=r[4],c=r[5],u=r[6],l=r[7],d=r[8],p=r[9],h=r[10],f=r[11],m=r[12],v=r[13],g=r[14];e.table=t,e.bstr=function(e,r){for(var n=-1^r,o=0,i=e.length;o<i;)n=n>>>8^t[255&(n^e.charCodeAt(o++))];return~n},e.buf=function(e,r){for(var y=-1^r,E=e.length-15,_=0;_<E;)y=g[e[_++]^255&y]^v[e[_++]^y>>8&255]^m[e[_++]^y>>16&255]^f[e[_++]^y>>>24]^h[e[_++]]^p[e[_++]]^d[e[_++]]^l[e[_++]]^u[e[_++]]^c[e[_++]]^s[e[_++]]^a[e[_++]]^i[e[_++]]^o[e[_++]]^n[e[_++]]^t[e[_++]];for(E+=15;_<E;)y=y>>>8^t[255&(y^e[_++])];return~y},e.str=function(e,r){for(var n=-1^r,o=0,i=e.length,a=0,s=0;o<i;)(a=e.charCodeAt(o++))<128?n=n>>>8^t[255&(n^a)]:a<2048?n=(n=n>>>8^t[255&(n^(192|a>>6&31))])>>>8^t[255&(n^(128|63&a))]:a>=55296&&a<57344?(a=64+(1023&a),s=1023&e.charCodeAt(o++),n=(n=(n=(n=n>>>8^t[255&(n^(240|a>>8&7))])>>>8^t[255&(n^(128|a>>2&63))])>>>8^t[255&(n^(128|s>>6&15|(3&a)<<4))])>>>8^t[255&(n^(128|63&s))]):n=(n=(n=n>>>8^t[255&(n^(224|a>>12&15))])>>>8^t[255&(n^(128|a>>6&63))])>>>8^t[255&(n^(128|63&a))];return~n}},"undefined"==typeof DO_NOT_EXPORT_CRC?r(t):r({})},2637:function(e,t,r){"use strict";r(6518)({target:"Number",stat:!0},{isInteger:r(2087)})},2652:function(e,t,r){"use strict";var n=r(6080),o=r(9565),i=r(8551),a=r(6823),s=r(4209),c=r(6198),u=r(1625),l=r(81),d=r(851),p=r(9539),h=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,r){var v,g,y,E,_,T,I,O=r&&r.that,R=!(!r||!r.AS_ENTRIES),S=!(!r||!r.IS_RECORD),b=!(!r||!r.IS_ITERATOR),C=!(!r||!r.INTERRUPTED),N=n(t,O),A=function(e){return v&&p(v,"normal",e),new f(!0,e)},M=function(e){return R?(i(e),C?N(e[0],e[1],A):N(e[0],e[1])):C?N(e,A):N(e)};if(S)v=e.iterator;else if(b)v=e;else{if(!(g=d(e)))throw new h(a(e)+" is not iterable");if(s(g)){for(y=0,E=c(e);E>y;y++)if((_=M(e[y]))&&u(m,_))return _;return new f(!1)}v=l(e,g)}for(T=S?e.next:v.next;!(I=o(T,v)).done;){try{_=M(I.value)}catch(e){p(v,"throw",e)}if("object"==typeof _&&_&&u(m,_))return _}return new f(!1)}},2675:function(e,t,r){"use strict";r(6761),r(1510),r(7812),r(3110),r(9773)},2703:function(e,t,r){"use strict";var n=r(4576),o=r(9039),i=r(9504),a=r(655),s=r(3802).trim,c=r(7452),u=n.parseInt,l=n.Symbol,d=l&&l.iterator,p=/^[+-]?0x/i,h=i(p.exec),f=8!==u(c+"08")||22!==u(c+"0x16")||d&&!o((function(){u(Object(d))}));e.exports=f?function(e,t){var r=s(a(e));return u(r,t>>>0||(h(p,r)?16:10))}:u},2712:function(e,t,r){"use strict";var n=r(6518),o=r(926).left,i=r(4598),a=r(9519);n({target:"Array",proto:!0,forced:!r(6193)&&a>79&&a<83||!i("reduce")},{reduce:function(e){var t=arguments.length;return o(this,e,t,t>1?arguments[1]:void 0)}})},2744:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){return Object.isExtensible(Object.preventExtensions({}))}))},2762:function(e,t,r){"use strict";var n=r(6518),o=r(3802).trim;n({target:"String",proto:!0,forced:r(706)("trim")},{trim:function(){return o(this)}})},2777:function(e,t,r){"use strict";var n=r(9565),o=r(34),i=r(757),a=r(5966),s=r(4270),c=r(8227),u=TypeError,l=c("toPrimitive");e.exports=function(e,t){if(!o(e)||i(e))return e;var r,c=a(e,l);if(c){if(void 0===t&&(t="default"),r=n(c,e,t),!o(r)||i(r))return r;throw new u("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},2787:function(e,t,r){"use strict";var n=r(9297),o=r(4901),i=r(8981),a=r(6119),s=r(2211),c=a("IE_PROTO"),u=Object,l=u.prototype;e.exports=s?u.getPrototypeOf:function(e){var t=i(e);if(n(t,c))return t[c];var r=t.constructor;return o(r)&&t instanceof r?r.prototype:t instanceof u?l:null}},2796:function(e,t,r){"use strict";var n=r(9039),o=r(4901),i=/#|\.prototype\./,a=function(e,t){var r=c[s(e)];return r===l||r!==u&&(o(t)?n(t):!!t)},s=a.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=a.data={},u=a.NATIVE="N",l=a.POLYFILL="P";e.exports=a},2805:function(e,t,r){"use strict";var n=r(4576),o=r(9039),i=r(4428),a=r(4644).NATIVE_ARRAY_BUFFER_VIEWS,s=n.ArrayBuffer,c=n.Int8Array;e.exports=!a||!o((function(){c(1)}))||!o((function(){new c(-1)}))||!i((function(e){new c,new c(null),new c(1.5),new c(e)}),!0)||o((function(){return 1!==new c(new s(2),1,void 0).length}))},2812:function(e){"use strict";var t=TypeError;e.exports=function(e,r){if(e<r)throw new t("Not enough arguments");return e}},2839:function(e,t,r){"use strict";var n=r(4576).navigator,o=n&&n.userAgent;e.exports=o?String(o):""},2887:function(e,t,r){"use strict";var n=r(4576),o=r(9039),i=r(9504),a=r(4644),s=r(3792),c=r(8227)("iterator"),u=n.Uint8Array,l=i(s.values),d=i(s.keys),p=i(s.entries),h=a.aTypedArray,f=a.exportTypedArrayMethod,m=u&&u.prototype,v=!o((function(){m[c].call([1])})),g=!!m&&m.values&&m[c]===m.values&&"values"===m.values.name,y=function(){return l(h(this))};f("entries",(function(){return p(h(this))}),v),f("keys",(function(){return d(h(this))}),v),f("values",y,v||!g,{name:"values"}),f(c,y,v||!g,{name:"values"})},2892:function(e,t,r){"use strict";var n=r(6518),o=r(6395),i=r(3724),a=r(4576),s=r(9167),c=r(9504),u=r(2796),l=r(9297),d=r(3167),p=r(1625),h=r(757),f=r(2777),m=r(9039),v=r(8480).f,g=r(7347).f,y=r(4913).f,E=r(1240),_=r(3802).trim,T="Number",I=a[T],O=s[T],R=I.prototype,S=a.TypeError,b=c("".slice),C=c("".charCodeAt),N=u(T,!I(" 0o1")||!I("0b1")||I("+0x1")),A=function(e){var t,r=arguments.length<1?0:I(function(e){var t=f(e,"number");return"bigint"==typeof t?t:function(e){var t,r,n,o,i,a,s,c,u=f(e,"number");if(h(u))throw new S("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=_(u),43===(t=C(u,0))||45===t){if(88===(r=C(u,2))||120===r)return NaN}else if(48===t){switch(C(u,1)){case 66:case 98:n=2,o=49;break;case 79:case 111:n=8,o=55;break;default:return+u}for(a=(i=b(u,2)).length,s=0;s<a;s++)if((c=C(i,s))<48||c>o)return NaN;return parseInt(i,n)}return+u}(t)}(e));return p(R,t=this)&&m((function(){E(t)}))?d(Object(r),this,A):r};A.prototype=R,N&&!o&&(R.constructor=A),n({global:!0,constructor:!0,wrap:!0,forced:N},{Number:A});var M=function(e,t){for(var r,n=i?v(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;n.length>o;o++)l(t,r=n[o])&&!l(e,r)&&y(e,r,g(t,r))};o&&O&&M(s[T],O),(N||o)&&M(s[T],I)},2953:function(e,t,r){"use strict";var n=r(4576),o=r(7400),i=r(9296),a=r(3792),s=r(6699),c=r(687),u=r(8227)("iterator"),l=a.values,d=function(e,t){if(e){if(e[u]!==l)try{s(e,u,l)}catch(t){e[u]=l}if(c(e,t,!0),o[t])for(var r in a)if(e[r]!==a[r])try{s(e,r,a[r])}catch(t){e[r]=a[r]}}};for(var p in o)d(n[p]&&n[p].prototype,p);d(i,"DOMTokenList")},2967:function(e,t,r){"use strict";var n=r(6706),o=r(34),i=r(7750),a=r(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=n(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return i(r),a(n),o(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},3110:function(e,t,r){"use strict";var n=r(6518),o=r(7751),i=r(8745),a=r(9565),s=r(9504),c=r(9039),u=r(4901),l=r(757),d=r(7680),p=r(6933),h=r(4495),f=String,m=o("JSON","stringify"),v=s(/./.exec),g=s("".charAt),y=s("".charCodeAt),E=s("".replace),_=s(1..toString),T=/[\uD800-\uDFFF]/g,I=/^[\uD800-\uDBFF]$/,O=/^[\uDC00-\uDFFF]$/,R=!h||c((function(){var e=o("Symbol")("stringify detection");return"[null]"!==m([e])||"{}"!==m({a:e})||"{}"!==m(Object(e))})),S=c((function(){return'"\\udf06\\ud834"'!==m("\udf06\ud834")||'"\\udead"'!==m("\udead")})),b=function(e,t){var r=d(arguments),n=p(t);if(u(n)||void 0!==e&&!l(e))return r[1]=function(e,t){if(u(n)&&(t=a(n,this,f(e),t)),!l(t))return t},i(m,null,r)},C=function(e,t,r){var n=g(r,t-1),o=g(r,t+1);return v(I,e)&&!v(O,o)||v(O,e)&&!v(I,n)?"\\u"+_(y(e,0),16):e};m&&n({target:"JSON",stat:!0,arity:3,forced:R||S},{stringify:function(e,t,r){var n=d(arguments),o=i(R?b:m,null,n);return S&&"string"==typeof o?E(o,T,C):o}})},3138:function(e){"use strict";e.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch(e){}}},3158:function(e,t,r){"use strict";e.exports=i;var n=r(6237);(i.prototype=Object.create(n.prototype)).constructor=i;var o=r(3610);function i(e){n.call(this,e)}i._configure=function(){o.Buffer&&(i.prototype._slice=o.Buffer.prototype.slice)},i.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},i._configure()},3164:function(e,t,r){"use strict";var n=r(7782),o=r(3602),i=Math.abs;e.exports=function(e,t,r,a){var s=+e,c=i(s),u=n(s);if(c<a)return u*o(c/a/t)*a*t;var l=(1+t/2220446049250313e-31)*c,d=l-(l-c);return d>r||d!=d?u*(1/0):u*d}},3167:function(e,t,r){"use strict";var n=r(4901),o=r(34),i=r(2967);e.exports=function(e,t,r){var a,s;return i&&n(a=t.constructor)&&a!==r&&o(s=a.prototype)&&s!==r.prototype&&i(e,s),e}},3179:function(e,t,r){"use strict";var n=r(2140),o=r(6955);e.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},3206:function(e,t,r){"use strict";var n=r(4644),o=r(9213).forEach,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("forEach",(function(e){o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},3251:function(e,t,r){"use strict";var n=r(6080),o=r(9565),i=r(5548),a=r(8981),s=r(6198),c=r(81),u=r(851),l=r(4209),d=r(1108),p=r(4644).aTypedArrayConstructor,h=r(5854);e.exports=function(e){var t,r,f,m,v,g,y,E,_=i(this),T=a(e),I=arguments.length,O=I>1?arguments[1]:void 0,R=void 0!==O,S=u(T);if(S&&!l(S))for(E=(y=c(T,S)).next,T=[];!(g=o(E,y)).done;)T.push(g.value);for(R&&I>2&&(O=n(O,arguments[2])),r=s(T),f=new(p(_))(r),m=d(f),t=0;r>t;t++)v=R?O(T[t],t):T[t],f[t]=m?h(v):+v;return f}},3262:function(e,t,r){"use strict";var n,o,i=e.exports=r(3610),a=r(4529);i.codegen=r(8561),i.fetch=r(5212),i.path=r(9207),i.fs=i.inquire("fs"),i.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},i.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],o=e[r++];void 0!==o&&(t[n]=o)}return t};var s=/\\/g,c=/"/g;i.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)},i.safeProp=function(e){return!/^[$\w_]+$/.test(e)||i.isReserved(e)?'["'+e.replace(s,"\\\\").replace(c,'\\"')+'"]':"."+e},i.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;i.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},i.compareFieldsById=function(e,t){return e.id-t.id},i.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(i.decorateRoot.remove(e.$type),e.$type.name=t,i.decorateRoot.add(e.$type)),e.$type;n||(n=r(7882));var o=new n(t||e.name);return i.decorateRoot.add(o),o.ctor=e,Object.defineProperty(e,"$type",{value:o,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:o,enumerable:!1}),o};var l=0;i.decorateEnum=function(e){if(e.$type)return e.$type;o||(o=r(5643));var t=new o("Enum"+l++,e);return i.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},i.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var o=r.shift();if("__proto__"===o||"prototype"===o)return t;if(r.length>0)t[o]=e(t[o]||{},r,n);else{var i=t[o];i&&(n=[].concat(i).concat(n)),t[o]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(i,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(r(5330)))}})},3288:function(e,t,r){"use strict";var n=r(9504),o=r(6840),i=Date.prototype,a="Invalid Date",s="toString",c=n(i[s]),u=n(i.getTime);String(new Date(NaN))!==a&&o(i,s,(function(){var e=u(this);return e==e?c(this):a}))},3296:function(e,t,r){"use strict";r(5806)},3362:function(e,t,r){"use strict";r(436),r(6499),r(2003),r(7743),r(1481),r(280)},3389:function(e,t,r){"use strict";var n=r(4576),o=r(3724),i=Object.getOwnPropertyDescriptor;e.exports=function(e){if(!o)return n[e];var t=i(n,e);return t&&t.value}},3392:function(e,t,r){"use strict";var n=r(9504),o=0,i=Math.random(),a=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++o+i,36)}},3418:function(e,t,r){"use strict";var n=r(6518),o=r(7916);n({target:"Array",stat:!0,forced:!r(4428)((function(e){Array.from(e)}))},{from:o})},3438:function(e,t,r){"use strict";var n=r(8551),o=r(34),i=r(6043);e.exports=function(e,t){if(n(e),o(t)&&t.constructor===e)return t;var r=i.f(e);return(0,r.resolve)(t),r.promise}},3449:function(e,t,r){"use strict";e.exports=d;var n,o=r(3610),i=o.LongBits,a=o.base64,s=o.utf8;function c(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new c(u,0,0),this.tail=this.head,this.states=null}var p=function(){return o.Buffer?function(){return(d.create=function(){return new n})()}:function(){return new d}};function h(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(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 v(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}d.create=p(),d.alloc=function(e){return new o.Array(e)},o.Array!==Array&&(d.alloc=o.pool(d.alloc,o.Array.prototype.subarray)),d.prototype._push=function(e,t,r){return this.tail=this.tail.next=new c(e,t,r),this.len+=t,this},f.prototype=Object.create(c.prototype),f.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,i.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=i.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=i.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(h,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(v,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=i.from(e);return this._push(v,4,t.lo)._push(v,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(o.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(o.float.writeDoubleLE,8,e)};var g=o.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};d.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(o.isString(e)){var r=d.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(g,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(h,1,0)},d.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new c(u,0,0),this.len=0,this},d.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 c(u,0,0),this.len=0),this},d.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},d.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},d._configure=function(e){n=e,d.create=p(),n._configure()}},3451:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(421),a=r(34),s=r(9297),c=r(4913).f,u=r(8480),l=r(298),d=r(4124),p=r(3392),h=r(2744),f=!1,m=p("meta"),v=0,g=function(e){c(e,m,{value:{objectID:"O"+v++,weakData:{}}})},y=e.exports={enable:function(){y.enable=function(){},f=!0;var e=u.f,t=o([].splice),r={};r[m]=1,e(r).length&&(u.f=function(r){for(var n=e(r),o=0,i=n.length;o<i;o++)if(n[o]===m){t(n,o,1);break}return n},n({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:l.f}))},fastKey:function(e,t){if(!a(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!s(e,m)){if(!d(e))return"F";if(!t)return"E";g(e)}return e[m].objectID},getWeakData:function(e,t){if(!s(e,m)){if(!d(e))return!0;if(!t)return!1;g(e)}return e[m].weakData},onFreeze:function(e){return h&&f&&d(e)&&!s(e,m)&&g(e),e}};i[m]=!0},3500:function(e,t,r){"use strict";var n=r(4576),o=r(7400),i=r(9296),a=r(235),s=r(6699),c=function(e){if(e&&e.forEach!==a)try{s(e,"forEach",a)}catch(t){e.forEach=a}};for(var u in o)o[u]&&c(n[u]&&n[u].prototype);c(i)},3506:function(e,t,r){"use strict";var n=r(3925),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i("Can't set "+o(e)+" as a prototype")}},3517:function(e,t,r){"use strict";var n=r(9504),o=r(9039),i=r(4901),a=r(6955),s=r(7751),c=r(3706),u=function(){},l=s("Reflect","construct"),d=/^\s*(?:class|function)\b/,p=n(d.exec),h=!d.test(u),f=function(e){if(!i(e))return!1;try{return l(u,[],e),!0}catch(e){return!1}},m=function(e){if(!i(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return h||!!p(d,c(e))}catch(e){return!0}};m.sham=!0,e.exports=!l||o((function(){var e;return f(f.call)||!f(Object)||!f((function(){e=!0}))||e}))?m:f},3602:function(e){"use strict";var t=4503599627370496;e.exports=function(e){return e+t-t}},3607:function(e,t,r){"use strict";var n=r(2839).match(/AppleWebKit\/(\d+)\./);e.exports=!!n&&+n[1]},3610:function(e,t,r){"use strict";var n=t;function o(e,t,r){for(var n=Object.keys(t),o=0;o<n.length;++o)void 0!==e[n[o]]&&r||(e[n[o]]=t[n[o]]);return e}function i(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&&o(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}n.asPromise=r(8045),n.base64=r(8839),n.EventEmitter=r(4358),n.float=r(9410),n.inquire=r(4153),n.utf8=r(1447),n.pool=r(9390),n.LongBits=r(2239),n.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"==typeof e||e instanceof String},n.isObject=function(e){return e&&"object"==typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=o,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=i,n.ProtocolError=i("ProtocolError"),n.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]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},3635:function(e,t,r){"use strict";var n=r(9039),o=r(4576).RegExp;e.exports=n((function(){var e=o(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))},3684:function(e,t,r){"use strict";var n=r(4644).exportTypedArrayMethod,o=r(9039),i=r(4576),a=r(9504),s=i.Uint8Array,c=s&&s.prototype||{},u=[].toString,l=a([].join);o((function(){u.call({})}))&&(u=function(){return l(this)});var d=c.toString!==u;n("toString",u,d)},3706:function(e,t,r){"use strict";var n=r(9504),o=r(4901),i=r(7629),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(e){return a(e)}),e.exports=i.inspectSource},3709:function(e,t,r){"use strict";var n=r(2839).match(/firefox\/(\d+)/i);e.exports=!!n&&+n[1]},3717:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},3724:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},3763:function(e,t,r){"use strict";var n=r(2839);e.exports=/MSIE|Trident/.test(n)},3792:function(e,t,r){"use strict";var n=r(5397),o=r(6469),i=r(6269),a=r(1181),s=r(4913).f,c=r(1088),u=r(2529),l=r(6395),d=r(3724),p="Array Iterator",h=a.set,f=a.getterFor(p);e.exports=c(Array,"Array",(function(e,t){h(this,{type:p,target:n(e),index:0,kind:t})}),(function(){var e=f(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,u(void 0,!0);switch(e.kind){case"keys":return u(r,!1);case"values":return u(t[r],!1)}return u([r,t[r]],!1)}),"values");var m=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!l&&d&&"values"!==m.name)try{s(m,"name",{value:"values"})}catch(e){}},3802:function(e,t,r){"use strict";var n=r(9504),o=r(7750),i=r(655),a=r(7452),s=n("".replace),c=RegExp("^["+a+"]+"),u=RegExp("(^|[^"+a+"])["+a+"]+$"),l=function(e){return function(t){var r=i(o(t));return 1&e&&(r=s(r,c,"")),2&e&&(r=s(r,u,"$1")),r}};e.exports={start:l(1),end:l(2),trim:l(3)}},3887:function(e,t,r){var n,o,i;!function(a){"use strict";if(null!=t&&"number"!=typeof t.nodeType)e.exports=a();else if(null!=r.amdO)o=[],void 0===(i="function"==typeof(n=a)?n.apply(t,o):n)||(e.exports=i);else{var s=a(),c="undefined"!=typeof self?self:$.global;"function"!=typeof c.btoa&&(c.btoa=s.btoa),"function"!=typeof c.atob&&(c.atob=s.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 n,o,i=String(r),a=0,s=e,c="";i.charAt(0|a)||(s="=",a%1);c+=s.charAt(63&n>>8-a%1*8)){if((o=i.charCodeAt(a+=3/4))>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|o}return c},atob:function(r){var n=String(r).replace(/[=]+$/,"");if(n.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,i,a=0,s=0,c="";i=n.charAt(s++);~i&&(o=a%4?64*o+i:i,a++%4)?c+=String.fromCharCode(255&o>>(-2*a&6)):0)i=e.indexOf(i);return c}}}))},3925:function(e,t,r){"use strict";var n=r(34);e.exports=function(e){return n(e)||null===e}},3994:function(e,t,r){"use strict";var n=r(7657).IteratorPrototype,o=r(2360),i=r(6980),a=r(687),s=r(6269),c=function(){return this};e.exports=function(e,t,r,u){var l=t+" Iterator";return e.prototype=o(n,{next:i(+!u,r)}),a(e,l,!1,!0),s[l]=c,e}},4055:function(e,t,r){"use strict";var n=r(4576),o=r(34),i=n.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},4117:function(e){"use strict";e.exports=function(e){return null==e}},4124:function(e,t,r){"use strict";var n=r(9039),o=r(34),i=r(2195),a=r(5652),s=Object.isExtensible,c=n((function(){s(1)}));e.exports=c||a?function(e){return!!o(e)&&(!a||"ArrayBuffer"!==i(e))&&(!s||s(e))}:s},4153:function(module){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},4170:function(e,t,r){"use strict";var n=r(6518),o=r(566);n({target:"Function",proto:!0,forced:Function.bind!==o},{bind:o})},4185:function(e,t,r){"use strict";var n=r(6518),o=r(3724),i=r(4913).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==i,sham:!o},{defineProperty:i})},4209:function(e,t,r){"use strict";var n=r(8227),o=r(6269),i=n("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},4213:function(e,t,r){"use strict";var n=r(3724),o=r(9504),i=r(9565),a=r(9039),s=r(1072),c=r(3717),u=r(8773),l=r(8981),d=r(7055),p=Object.assign,h=Object.defineProperty,f=o([].concat);e.exports=!p||a((function(){if(n&&1!==p({b:1},p(h({},"a",{enumerable:!0,get:function(){h(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),o="abcdefghijklmnopqrst";return e[r]=7,o.split("").forEach((function(e){t[e]=e})),7!==p({},e)[r]||s(p({},t)).join("")!==o}))?function(e,t){for(var r=l(e),o=arguments.length,a=1,p=c.f,h=u.f;o>a;)for(var m,v=d(arguments[a++]),g=p?f(s(v),p(v)):s(v),y=g.length,E=0;y>E;)m=g[E++],n&&!i(h,v,m)||(r[m]=v[m]);return r}:p},4215:function(e,t,r){"use strict";var n=r(4576),o=r(2839),i=r(2195),a=function(e){return o.slice(0,e.length)===e};e.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":n.Bun&&"string"==typeof Bun.version?"BUN":n.Deno&&"object"==typeof Deno.version?"DENO":"process"===i(n.process)?"NODE":n.window&&n.document?"BROWSER":"REST"},4265:function(e,t,r){"use strict";var n=r(2839);e.exports=/ipad|iphone|ipod/i.test(n)&&"undefined"!=typeof Pebble},4270:function(e,t,r){"use strict";var n=r(9565),o=r(4901),i=r(34),a=TypeError;e.exports=function(e,t){var r,s;if("string"===t&&o(r=e.toString)&&!i(s=n(r,e)))return s;if(o(r=e.valueOf)&&!i(s=n(r,e)))return s;if("string"!==t&&o(r=e.toString)&&!i(s=n(r,e)))return s;throw new a("Can't convert object to primitive value")}},4346:function(e,t,r){"use strict";r(6518)({target:"Array",stat:!0},{isArray:r(4376)})},4358:function(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],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},4359:function(e,t,r){"use strict";var n=r(6518),o=r(6346);n({global:!0,constructor:!0,forced:!r(7811)},{DataView:o.DataView})},4373:function(e,t,r){"use strict";var n=r(8981),o=r(5610),i=r(6198);e.exports=function(e){for(var t=n(this),r=i(t),a=arguments.length,s=o(a>1?arguments[1]:void 0,r),c=a>2?arguments[2]:void 0,u=void 0===c?r:o(c,r);u>s;)t[s++]=e;return t}},4376:function(e,t,r){"use strict";var n=r(2195);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4394:function(e,t,r){"use strict";var n=t;function o(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(3449),n.BufferWriter=r(818),n.Reader=r(6237),n.BufferReader=r(3158),n.util=r(3610),n.rpc=r(5047),n.roots=r(4529),n.configure=o,o()},4423:function(e,t,r){"use strict";var n=r(6518),o=r(9617).includes,i=r(9039),a=r(6469);n({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),a("includes")},4428:function(e,t,r){"use strict";var n=r(8227)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(e){}e.exports=function(e,t){try{if(!t&&!o)return!1}catch(e){return!1}var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch(e){}return r}},4488:function(e,t,r){"use strict";var n=r(7680),o=Math.floor,i=function(e,t){var r=e.length;if(r<8)for(var a,s,c=1;c<r;){for(s=c,a=e[c];s&&t(e[s-1],a)>0;)e[s]=e[--s];s!==c++&&(e[s]=a)}else for(var u=o(r/2),l=i(n(e,0,u),t),d=i(n(e,u),t),p=l.length,h=d.length,f=0,m=0;f<p||m<h;)e[f+m]=f<p&&m<h?t(l[f],d[m])<=0?l[f++]:d[m++]:f<p?l[f++]:d[m++];return e};e.exports=i},4490:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(4376),a=o([].reverse),s=[1,2];n({target:"Array",proto:!0,forced:String(s)===String(s.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},4495:function(e,t,r){"use strict";var n=r(9519),o=r(9039),i=r(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!o((function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},4496:function(e,t,r){"use strict";var n=r(4644),o=r(9617).includes,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("includes",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},4527:function(e,t,r){"use strict";var n=r(3724),o=r(4376),i=TypeError,a=Object.getOwnPropertyDescriptor,s=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(o(e)&&!a(e,"length").writable)throw new i("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},4529:function(e){"use strict";e.exports={}},4554:function(e,t,r){"use strict";var n=r(6518),o=r(8981),i=r(5610),a=r(1291),s=r(6198),c=r(4527),u=r(6837),l=r(1469),d=r(4659),p=r(4606),h=r(597)("splice"),f=Math.max,m=Math.min;n({target:"Array",proto:!0,forced:!h},{splice:function(e,t){var r,n,h,v,g,y,E=o(this),_=s(E),T=i(e,_),I=arguments.length;for(0===I?r=n=0:1===I?(r=0,n=_-T):(r=I-2,n=m(f(a(t),0),_-T)),u(_+r-n),h=l(E,n),v=0;v<n;v++)(g=T+v)in E&&d(h,v,E[g]);if(h.length=n,r<n){for(v=T;v<_-n;v++)y=v+r,(g=v+n)in E?E[y]=E[g]:p(E,y);for(v=_;v>_-n+r;v--)p(E,v-1)}else if(r>n)for(v=_-n;v>T;v--)y=v+r-1,(g=v+n-1)in E?E[y]=E[g]:p(E,y);for(v=0;v<r;v++)E[v+T]=arguments[v+2];return c(E,_-n+r),h}})},4576:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4598:function(e,t,r){"use strict";var n=r(9039);e.exports=function(e,t){var r=[][e];return!!r&&n((function(){r.call(null,t||function(){return 1},1)}))}},4599:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(9472)(o.setTimeout,!0);n({global:!0,bind:!0,forced:o.setTimeout!==i},{setTimeout:i})},4606:function(e,t,r){"use strict";var n=r(6823),o=TypeError;e.exports=function(e,t){if(!delete e[t])throw new o("Cannot delete property "+n(t)+" of "+n(e))}},4644:function(e,t,r){"use strict";var n,o,i,a=r(7811),s=r(3724),c=r(4576),u=r(4901),l=r(34),d=r(9297),p=r(6955),h=r(6823),f=r(6699),m=r(6840),v=r(2106),g=r(1625),y=r(2787),E=r(2967),_=r(8227),T=r(3392),I=r(1181),O=I.enforce,R=I.get,S=c.Int8Array,b=S&&S.prototype,C=c.Uint8ClampedArray,N=C&&C.prototype,A=S&&y(S),M=b&&y(b),w=Object.prototype,U=c.TypeError,L=_("toStringTag"),P=T("TYPED_ARRAY_TAG"),x="TypedArrayConstructor",k=a&&!!E&&"Opera"!==p(c.opera),D=!1,B={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},j={BigInt64Array:8,BigUint64Array:8},G=function(e){var t=y(e);if(l(t)){var r=R(t);return r&&d(r,x)?r[x]:G(t)}},H=function(e){if(!l(e))return!1;var t=p(e);return d(B,t)||d(j,t)};for(n in B)(i=(o=c[n])&&o.prototype)?O(i)[x]=o:k=!1;for(n in j)(i=(o=c[n])&&o.prototype)&&(O(i)[x]=o);if((!k||!u(A)||A===Function.prototype)&&(A=function(){throw new U("Incorrect invocation")},k))for(n in B)c[n]&&E(c[n],A);if((!k||!M||M===w)&&(M=A.prototype,k))for(n in B)c[n]&&E(c[n].prototype,M);if(k&&y(N)!==M&&E(N,M),s&&!d(M,L))for(n in D=!0,v(M,L,{configurable:!0,get:function(){return l(this)?this[P]:void 0}}),B)c[n]&&f(c[n],P,n);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:k,TYPED_ARRAY_TAG:D&&P,aTypedArray:function(e){if(H(e))return e;throw new U("Target is not a typed array")},aTypedArrayConstructor:function(e){if(u(e)&&(!E||g(A,e)))return e;throw new U(h(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,r,n){if(s){if(r)for(var o in B){var i=c[o];if(i&&d(i.prototype,e))try{delete i.prototype[e]}catch(r){try{i.prototype[e]=t}catch(e){}}}M[e]&&!r||m(M,e,r?t:k&&b[e]||t,n)}},exportTypedArrayStaticMethod:function(e,t,r){var n,o;if(s){if(E){if(r)for(n in B)if((o=c[n])&&d(o,e))try{delete o[e]}catch(e){}if(A[e]&&!r)return;try{return m(A,e,r?t:k&&A[e]||t)}catch(e){}}for(n in B)!(o=c[n])||o[e]&&!r||m(o,e,t)}},getTypedArrayConstructor:G,isView:function(e){if(!l(e))return!1;var t=p(e);return"DataView"===t||d(B,t)||d(j,t)},isTypedArray:H,TypedArray:A,TypedArrayPrototype:M}},4659:function(e,t,r){"use strict";var n=r(3724),o=r(4913),i=r(6980);e.exports=function(e,t,r){n?o.f(e,t,i(0,r)):e[t]=r}},4743:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(6346),a=r(7633),s="ArrayBuffer",c=i[s];n({global:!0,constructor:!0,forced:o[s]!==c},{ArrayBuffer:c}),a(s)},4782:function(e,t,r){"use strict";var n=r(6518),o=r(4376),i=r(3517),a=r(34),s=r(5610),c=r(6198),u=r(5397),l=r(4659),d=r(8227),p=r(597),h=r(7680),f=p("slice"),m=d("species"),v=Array,g=Math.max;n({target:"Array",proto:!0,forced:!f},{slice:function(e,t){var r,n,d,p=u(this),f=c(p),y=s(e,f),E=s(void 0===t?f:t,f);if(o(p)&&(r=p.constructor,(i(r)&&(r===v||o(r.prototype))||a(r)&&null===(r=r[m]))&&(r=void 0),r===v||void 0===r))return h(p,y,E);for(n=new(void 0===r?v:r)(g(E-y,0)),d=0;y<E;y++,d++)y in p&&l(n,d,p[y]);return n.length=d,n}})},4863:function(e,t,r){"use strict";e.exports=R,R.filename=null,R.defaults={keepCase:!1};var n=r(527),o=r(5330),i=r(7882),a=r(1344),s=r(8252),c=r(1457),u=r(5643),l=r(9687),d=r(8811),p=r(361),h=r(3262),f=/^[1-9][0-9]*$/,m=/^-?[1-9][0-9]*$/,v=/^0[x][0-9a-fA-F]+$/,g=/^-?0[x][0-9a-fA-F]+$/,y=/^0[0-7]+$/,E=/^-?0[0-7]+$/,_=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,T=/^[a-zA-Z_][a-zA-Z_0-9]*$/,I=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,O=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function R(e,t,r){t instanceof o||(r=t,t=new o),r||(r=R.defaults);var S,b,C,N,A,M=r.preferTrailingComment||!1,w=n(e,r.alternateCommentMode||!1),U=w.next,L=w.push,P=w.peek,x=w.skip,k=w.cmnt,D=!0,B=!1,j=t,G=r.keepCase?function(e){return e}:h.camelCase;function H(e,t,r){var n=R.filename;return r||(R.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+w.line+")")}function F(){var e,t=[];do{if('"'!==(e=U())&&"'"!==e)throw H(e);t.push(U()),x(e),e=P()}while('"'===e||"'"===e);return t.join("")}function q(e){var t=U();switch(t){case"'":case'"':return L(t),F();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e){var t=1;switch("-"===e.charAt(0)&&(t=-1,e=e.substring(1)),e){case"inf":case"INF":case"Inf":return t*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(f.test(e))return t*parseInt(e,10);if(v.test(e))return t*parseInt(e,16);if(y.test(e))return t*parseInt(e,8);if(_.test(e))return t*parseFloat(e);throw H(e,"number",!0)}(t)}catch(r){if(e&&I.test(t))return t;throw H(t,"value")}}function W(e,t){var r,n;do{!t||'"'!==(r=P())&&"'"!==r?e.push([n=z(U()),x("to",!0)?z(U()):n]):e.push(F())}while(x(",",!0));x(";")}function z(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw H(e,"id");if(m.test(e))return parseInt(e,10);if(g.test(e))return parseInt(e,16);if(E.test(e))return parseInt(e,8);throw H(e,"id")}function K(){if(void 0!==S)throw H("package");if(S=U(),!I.test(S))throw H(S,"name");j=j.define(S),x(";")}function V(){var e,t=P();switch(t){case"weak":e=C||(C=[]),U();break;case"public":U();default:e=b||(b=[])}t=F(),x(";"),e.push(t)}function J(){if(x("="),N=F(),!(B="proto3"===N)&&"proto2"!==N)throw H(N,"syntax");x(";")}function Y(e,t){switch(t){case"option":return $(e,t),x(";"),!0;case"message":return function(e,t){if(!T.test(t=U()))throw H(t,"type name");var r=new i(t);X(r,(function(e){if(!Y(r,e))switch(e){case"map":!function(e){x("<");var t=U();if(void 0===p.mapKey[t])throw H(t,"type");x(",");var r=U();if(!I.test(r))throw H(r,"type");x(">");var n=U();if(!T.test(n))throw H(n,"name");x("=");var o=new s(G(n),z(U()),t,r);X(o,(function(e){if("option"!==e)throw H(e);$(o,e),x(";")}),(function(){te(o)})),e.add(o)}(r);break;case"required":case"repeated":Q(r,e);break;case"optional":Q(r,B?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!T.test(t=U()))throw H(t,"name");var r=new c(G(t));X(r,(function(e){"option"===e?($(r,e),x(";")):(L(e),Q(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":W(r.extensions||(r.extensions=[]));break;case"reserved":W(r.reserved||(r.reserved=[]),!0);break;default:if(!B||!I.test(e))throw H(e);L(e),Q(r,"optional")}})),e.add(r)}(e,t),!0;case"enum":return function(e,t){if(!T.test(t=U()))throw H(t,"name");var r=new u(t);X(r,(function(e){switch(e){case"option":$(r,e),x(";");break;case"reserved":W(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!T.test(t))throw H(t,"name");x("=");var r=z(U(),!0),n={};X(n,(function(e){if("option"!==e)throw H(e);$(n,e),x(";")}),(function(){te(n)})),e.add(t,r,n.comment)}(r,e)}})),e.add(r)}(e,t),!0;case"service":return function(e,t){if(!T.test(t=U()))throw H(t,"service name");var r=new l(t);X(r,(function(e){if(!Y(r,e)){if("rpc"!==e)throw H(e);!function(e,t){var r=k(),n=t;if(!T.test(t=U()))throw H(t,"name");var o,i,a,s,c=t;if(x("("),x("stream",!0)&&(i=!0),!I.test(t=U()))throw H(t);if(o=t,x(")"),x("returns"),x("("),x("stream",!0)&&(s=!0),!I.test(t=U()))throw H(t);a=t,x(")");var u=new d(c,n,o,a,i,s);u.comment=r,X(u,(function(e){if("option"!==e)throw H(e);$(u,e),x(";")})),e.add(u)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!I.test(t=U()))throw H(t,"reference");var r=t;X(null,(function(t){switch(t){case"required":case"repeated":Q(e,t,r);break;case"optional":Q(e,B?"proto3_optional":"optional",r);break;default:if(!B||!I.test(t))throw H(t);L(t),Q(e,"optional",r)}}))}(e,t),!0}return!1}function X(e,t,r){var n=w.line;if(e&&("string"!=typeof e.comment&&(e.comment=k()),e.filename=R.filename),x("{",!0)){for(var o;"}"!==(o=U());)t(o);x(";",!0)}else r&&r(),x(";"),e&&("string"!=typeof e.comment||M)&&(e.comment=k(n)||e.comment)}function Q(e,t,r){var n=U();if("group"!==n){if(!I.test(n))throw H(n,"type");var o=U();if(!T.test(o))throw H(o,"name");o=G(o),x("=");var s=new a(o,z(U()),n,t,r);if(X(s,(function(e){if("option"!==e)throw H(e);$(s,e),x(";")}),(function(){te(s)})),"proto3_optional"===t){var u=new c("_"+o);s.setOption("proto3_optional",!0),u.add(s),e.add(u)}else e.add(s);B||!s.repeated||void 0===p.packed[n]&&void 0!==p.basic[n]||s.setOption("packed",!1,!0)}else!function(e,t){var r=U();if(!T.test(r))throw H(r,"name");var n=h.lcFirst(r);r===n&&(r=h.ucFirst(r)),x("=");var o=z(U()),s=new i(r);s.group=!0;var c=new a(n,o,r,t);c.filename=R.filename,X(s,(function(e){switch(e){case"option":$(s,e),x(";");break;case"required":case"repeated":Q(s,e);break;case"optional":Q(s,B?"proto3_optional":"optional");break;default:throw H(e)}})),e.add(s).add(c)}(e,t)}function $(e,t){var r=x("(",!0);if(!I.test(t=U()))throw H(t,"name");var n,o=t,i=o;r&&(x(")"),i=o="("+o+")",t=P(),O.test(t)&&(n=t.substr(1),o+=t,U())),x("="),function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,i,Z(e,o),n)}function Z(e,t){if(x("{",!0)){for(var r={};!x("}",!0);){if(!T.test(A=U()))throw H(A,"name");var n,o=A;"{"===P()?n=Z(e,t+"."+A):(x(":"),"{"===P()?n=Z(e,t+"."+A):(n=q(!0),ee(e,t+"."+A,n)));var i=r[o];i&&(n=[].concat(i).concat(n)),r[o]=n,x(",",!0)}return r}var a=q(!0);return ee(e,t,a),a}function ee(e,t,r){e.setOption&&e.setOption(t,r)}function te(e){if(x("[",!0)){do{$(e,"option")}while(x(",",!0));x("]")}return e}for(;null!==(A=U());)switch(A){case"package":if(!D)throw H(A);K();break;case"import":if(!D)throw H(A);V();break;case"syntax":if(!D)throw H(A);J();break;case"option":$(j,A),x(";");break;default:if(Y(j,A)){D=!1;continue}throw H(A)}return R.filename=null,{package:S,imports:b,weakImports:C,syntax:N,root:t}}},4901:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},4913:function(e,t,r){"use strict";var n=r(3724),o=r(5917),i=r(8686),a=r(8551),s=r(6969),c=TypeError,u=Object.defineProperty,l=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",h="writable";t.f=n?i?function(e,t,r){if(a(e),t=s(t),a(r),"function"==typeof e&&"prototype"===t&&"value"in r&&h in r&&!r[h]){var n=l(e,t);n&&n[h]&&(e[t]=r.value,r={configurable:p in r?r[p]:n[p],enumerable:d in r?r[d]:n[d],writable:!1})}return u(e,t,r)}:u:function(e,t,r){if(a(e),t=s(t),a(r),o)try{return u(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new c("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},5031:function(e,t,r){"use strict";var n=r(7751),o=r(9504),i=r(8480),a=r(3717),s=r(8551),c=o([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=i.f(s(e)),r=a.f;return r?c(t,r(e)):t}},5044:function(e,t,r){"use strict";var n=r(4644),o=r(4373),i=r(5854),a=r(6955),s=r(9565),c=r(9504),u=r(9039),l=n.aTypedArray,d=n.exportTypedArrayMethod,p=c("".slice);d("fill",(function(e){var t=arguments.length;l(this);var r="Big"===p(a(this),0,3)?i(e):+e;return s(o,this,r,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),u((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})))},5047:function(e,t,r){"use strict";t.Service=r(7595)},5081:function(e,t,r){"use strict";var n=r(6518),o=r(4576);n({global:!0,forced:o.globalThis!==o},{globalThis:o})},5086:function(e,t,r){"use strict";var n=r(6518),o=r(9213).some;n({target:"Array",proto:!0,forced:!r(4598)("some")},{some:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}})},5095:function(e){"use strict";e.exports=n;var t,r=/\/|\./;function n(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),n[e]=t}n("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),n("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),n("timestamp",{Timestamp:t}),n("empty",{Empty:{fields:{}}}),n("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}}}}),n("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}}}}),n("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),n.get=function(e){return n[e]||null}},5212:function(e,t,r){"use strict";e.exports=i;var n=r(8045),o=r(4153)("fs");function i(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&o&&o.readFile?o.readFile(e,(function(n,o){return n&&"undefined"!=typeof XMLHttpRequest?i.xhr(e,t,r):n?r(n):r(null,t.binary?o:o.toString("utf8"))})):i.xhr(e,t,r):n(i,this,e,t)}i.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var o=0;o<n.responseText.length;++o)e.push(255&n.responseText.charCodeAt(o))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},5276:function(e,t,r){"use strict";var n=r(6518),o=r(7476),i=r(9617).indexOf,a=r(4598),s=o([].indexOf),c=!!s&&1/s([1],1,-0)<0;n({target:"Array",proto:!0,forced:c||!a("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return c?s(this,e,t)||0:i(this,e,t)}})},5325:function(e,t,r){"use strict";var n=e.exports=r(4394);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(1080),n.decoder=r(7728),n.verifier=r(420),n.converter=r(744),n.ReflectionObject=r(7209),n.Namespace=r(8923),n.Root=r(5330),n.Enum=r(5643),n.Type=r(7882),n.Field=r(1344),n.OneOf=r(1457),n.MapField=r(8252),n.Service=r(9687),n.Method=r(8811),n.Message=r(2551),n.wrappers=r(6434),n.types=r(361),n.util=r(3262),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},5330:function(e,t,r){"use strict";e.exports=d;var n=r(8923);((d.prototype=Object.create(n.prototype)).constructor=d).className="Root";var o,i,a,s=r(1344),c=r(5643),u=r(1457),l=r(3262);function d(e){n.call(this,"",e),this.deferred=[],this.files=[]}function p(){}d.fromJSON=function(e,t){return t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=l.path.resolve,d.prototype.fetch=l.fetch,d.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var o=this;if(!n)return l.asPromise(e,o,t,r);var s=n===p;function c(e,t){if(n){var r=n;if(n=null,s)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in a)return r}return null}function d(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){i.filename=e;var n,a=i(t,o,r),d=0;if(a.imports)for(;d<a.imports.length;++d)(n=u(a.imports[d])||o.resolvePath(e,a.imports[d]))&&h(n);if(a.weakImports)for(d=0;d<a.weakImports.length;++d)(n=u(a.weakImports[d])||o.resolvePath(e,a.weakImports[d]))&&h(n,!0)}else o.setOptions(t.options).addJSON(t.nested)}catch(e){c(e)}s||f||c(null,o)}function h(e,t){if(!(o.files.indexOf(e)>-1))if(o.files.push(e),e in a)s?d(e,a[e]):(++f,setTimeout((function(){--f,d(e,a[e])})));else if(s){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||c(e))}d(e,r)}else++f,o.fetch(e,(function(r,i){--f,n&&(r?t?f||c(null,o):c(r):d(e,i))}))}var f=0;l.isString(t)&&(t=[t]);for(var m,v=0;v<t.length;++v)(m=o.resolvePath("",t[v]))&&h(m);if(s)return o;f||c(null,o)},d.prototype.loadSync=function(e,t){if(!l.isNode)throw Error("not supported");return this.load(e,t,p)},d.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 n.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}d.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof c)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof o)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]);h.test(e.name)&&(e.parent[e.name]=e)}},d.prototype._handleRemove=function(e){if(e instanceof s){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 c)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);h.test(e.name)&&delete e.parent[e.name]}},d._configure=function(e,t,r){o=e,i=t,a=r}},5370:function(e,t,r){"use strict";var n=r(6198);e.exports=function(e,t,r){for(var o=0,i=arguments.length>2?r:n(t),a=new e(i);i>o;)a[o]=t[o++];return a}},5397:function(e,t,r){"use strict";var n=r(7055),o=r(7750);e.exports=function(e){return n(o(e))}},5506:function(e,t,r){"use strict";var n=r(6518),o=r(2357).entries;n({target:"Object",stat:!0},{entries:function(e){return o(e)}})},5548:function(e,t,r){"use strict";var n=r(3517),o=r(6823),i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not a constructor")}},5575:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(9472)(o.setInterval,!0);n({global:!0,bind:!0,forced:o.setInterval!==i},{setInterval:i})},5610:function(e,t,r){"use strict";var n=r(1291),o=Math.max,i=Math.min;e.exports=function(e,t){var r=n(e);return r<0?o(r+t,0):i(r,t)}},5617:function(e,t,r){"use strict";var n=r(3164);e.exports=Math.fround||function(e){return n(e,1.1920928955078125e-7,34028234663852886e22,11754943508222875e-54)}},5643:function(e,t,r){"use strict";e.exports=a;var n=r(7209);((a.prototype=Object.create(n.prototype)).constructor=a).className="Enum";var o=r(8923),i=r(3262);function a(e,t,r,o,i){if(n.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=o,this.comments=i||{},this.reserved=void 0,t)for(var a=Object.keys(t),s=0;s<a.length;++s)"number"==typeof t[a[s]]&&(this.valuesById[this.values[a[s]]=t[a[s]]]=a[s])}a.fromJSON=function(e,t){var r=new a(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.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])},a.prototype.add=function(e,t,r){if(!i.isString(e))throw TypeError("name must be a string");if(!i.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},a.prototype.remove=function(e){if(!i.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},a.prototype.isReservedId=function(e){return o.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return o.isReservedName(this.reserved,e)}},5652:function(e,t,r){"use strict";var n=r(9039);e.exports=n((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}))},5745:function(e,t,r){"use strict";var n=r(7629);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},5749:function(e,t,r){"use strict";var n=r(788),o=TypeError;e.exports=function(e){if(n(e))throw new o("The method doesn't accept regular expressions");return e}},5806:function(e,t,r){"use strict";r(7764);var n,o=r(6518),i=r(3724),a=r(7416),s=r(4576),c=r(6080),u=r(9504),l=r(6840),d=r(2106),p=r(679),h=r(9297),f=r(4213),m=r(7916),v=r(7680),g=r(8183).codeAt,y=r(6098),E=r(655),_=r(687),T=r(2812),I=r(8406),O=r(1181),R=O.set,S=O.getterFor("URL"),b=I.URLSearchParams,C=I.getState,N=s.URL,A=s.TypeError,M=s.parseInt,w=Math.floor,U=Math.pow,L=u("".charAt),P=u(/./.exec),x=u([].join),k=u(1..toString),D=u([].pop),B=u([].push),j=u("".replace),G=u([].shift),H=u("".split),F=u("".slice),q=u("".toLowerCase),W=u([].unshift),z="Invalid scheme",K="Invalid host",V="Invalid port",J=/[a-z]/i,Y=/[\d+-.a-z]/i,X=/\d/,Q=/^0x/i,$=/^[0-7]+$/,Z=/^\d+$/,ee=/^[\da-f]+$/i,te=/[\0\t\n\r #%/:<>?@[\\\]^|]/,re=/[\0\t\n\r #/:<>?@[\\\]^|]/,ne=/^[\u0000-\u0020]+/,oe=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,ie=/[\t\n\r]/g,ae=function(e){var t,r,n,o;if("number"==typeof e){for(t=[],r=0;r<4;r++)W(t,e%256),e=w(e/256);return x(t,".")}if("object"==typeof e){for(t="",n=function(e){for(var t=null,r=1,n=null,o=0,i=0;i<8;i++)0!==e[i]?(o>r&&(t=n,r=o),n=null,o=0):(null===n&&(n=i),++o);return o>r?n:t}(e),r=0;r<8;r++)o&&0===e[r]||(o&&(o=!1),n===r?(t+=r?":":"::",o=!0):(t+=k(e[r],16),r<7&&(t+=":")));return"["+t+"]"}return e},se={},ce=f({},se,{" ":1,'"':1,"<":1,">":1,"`":1}),ue=f({},ce,{"#":1,"?":1,"{":1,"}":1}),le=f({},ue,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),de=function(e,t){var r=g(e,0);return r>32&&r<127&&!h(t,e)?e:encodeURIComponent(e)},pe={ftp:21,file:null,http:80,https:443,ws:80,wss:443},he=function(e,t){var r;return 2===e.length&&P(J,L(e,0))&&(":"===(r=L(e,1))||!t&&"|"===r)},fe=function(e){var t;return e.length>1&&he(F(e,0,2))&&(2===e.length||"/"===(t=L(e,2))||"\\"===t||"?"===t||"#"===t)},me=function(e){return"."===e||"%2e"===q(e)},ve={},ge={},ye={},Ee={},_e={},Te={},Ie={},Oe={},Re={},Se={},be={},Ce={},Ne={},Ae={},Me={},we={},Ue={},Le={},Pe={},xe={},ke={},De=function(e,t,r){var n,o,i,a=E(e);if(t){if(o=this.parse(a))throw new A(o);this.searchParams=null}else{if(void 0!==r&&(n=new De(r,!0)),o=this.parse(a,null,n))throw new A(o);(i=C(new b)).bindURL(this),this.searchParams=i}};De.prototype={type:"URL",parse:function(e,t,r){var o,i,a,s,c,u=this,l=t||ve,d=0,p="",f=!1,g=!1,y=!1;for(e=E(e),t||(u.scheme="",u.username="",u.password="",u.host=null,u.port=null,u.path=[],u.query=null,u.fragment=null,u.cannotBeABaseURL=!1,e=j(e,ne,""),e=j(e,oe,"$1")),e=j(e,ie,""),o=m(e);d<=o.length;){switch(i=o[d],l){case ve:if(!i||!P(J,i)){if(t)return z;l=ye;continue}p+=q(i),l=ge;break;case ge:if(i&&(P(Y,i)||"+"===i||"-"===i||"."===i))p+=q(i);else{if(":"!==i){if(t)return z;p="",l=ye,d=0;continue}if(t&&(u.isSpecial()!==h(pe,p)||"file"===p&&(u.includesCredentials()||null!==u.port)||"file"===u.scheme&&!u.host))return;if(u.scheme=p,t)return void(u.isSpecial()&&pe[u.scheme]===u.port&&(u.port=null));p="","file"===u.scheme?l=Ae:u.isSpecial()&&r&&r.scheme===u.scheme?l=Ee:u.isSpecial()?l=Oe:"/"===o[d+1]?(l=_e,d++):(u.cannotBeABaseURL=!0,B(u.path,""),l=Pe)}break;case ye:if(!r||r.cannotBeABaseURL&&"#"!==i)return z;if(r.cannotBeABaseURL&&"#"===i){u.scheme=r.scheme,u.path=v(r.path),u.query=r.query,u.fragment="",u.cannotBeABaseURL=!0,l=ke;break}l="file"===r.scheme?Ae:Te;continue;case Ee:if("/"!==i||"/"!==o[d+1]){l=Te;continue}l=Re,d++;break;case _e:if("/"===i){l=Se;break}l=Le;continue;case Te:if(u.scheme=r.scheme,i===n)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query;else if("/"===i||"\\"===i&&u.isSpecial())l=Ie;else if("?"===i)u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query="",l=xe;else{if("#"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.path.length--,l=Le;continue}u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,u.path=v(r.path),u.query=r.query,u.fragment="",l=ke}break;case Ie:if(!u.isSpecial()||"/"!==i&&"\\"!==i){if("/"!==i){u.username=r.username,u.password=r.password,u.host=r.host,u.port=r.port,l=Le;continue}l=Se}else l=Re;break;case Oe:if(l=Re,"/"!==i||"/"!==L(p,d+1))continue;d++;break;case Re:if("/"!==i&&"\\"!==i){l=Se;continue}break;case Se:if("@"===i){f&&(p="%40"+p),f=!0,a=m(p);for(var _=0;_<a.length;_++){var T=a[_];if(":"!==T||y){var I=de(T,le);y?u.password+=I:u.username+=I}else y=!0}p=""}else if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(f&&""===p)return"Invalid authority";d-=m(p).length+1,p="",l=be}else p+=i;break;case be:case Ce:if(t&&"file"===u.scheme){l=we;continue}if(":"!==i||g){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()){if(u.isSpecial()&&""===p)return K;if(t&&""===p&&(u.includesCredentials()||null!==u.port))return;if(s=u.parseHost(p))return s;if(p="",l=Ue,t)return;continue}"["===i?g=!0:"]"===i&&(g=!1),p+=i}else{if(""===p)return K;if(s=u.parseHost(p))return s;if(p="",l=Ne,t===Ce)return}break;case Ne:if(!P(X,i)){if(i===n||"/"===i||"?"===i||"#"===i||"\\"===i&&u.isSpecial()||t){if(""!==p){var O=M(p,10);if(O>65535)return V;u.port=u.isSpecial()&&O===pe[u.scheme]?null:O,p=""}if(t)return;l=Ue;continue}return V}p+=i;break;case Ae:if(u.scheme="file","/"===i||"\\"===i)l=Me;else{if(!r||"file"!==r.scheme){l=Le;continue}switch(i){case n:u.host=r.host,u.path=v(r.path),u.query=r.query;break;case"?":u.host=r.host,u.path=v(r.path),u.query="",l=xe;break;case"#":u.host=r.host,u.path=v(r.path),u.query=r.query,u.fragment="",l=ke;break;default:fe(x(v(o,d),""))||(u.host=r.host,u.path=v(r.path),u.shortenPath()),l=Le;continue}}break;case Me:if("/"===i||"\\"===i){l=we;break}r&&"file"===r.scheme&&!fe(x(v(o,d),""))&&(he(r.path[0],!0)?B(u.path,r.path[0]):u.host=r.host),l=Le;continue;case we:if(i===n||"/"===i||"\\"===i||"?"===i||"#"===i){if(!t&&he(p))l=Le;else if(""===p){if(u.host="",t)return;l=Ue}else{if(s=u.parseHost(p))return s;if("localhost"===u.host&&(u.host=""),t)return;p="",l=Ue}continue}p+=i;break;case Ue:if(u.isSpecial()){if(l=Le,"/"!==i&&"\\"!==i)continue}else if(t||"?"!==i)if(t||"#"!==i){if(i!==n&&(l=Le,"/"!==i))continue}else u.fragment="",l=ke;else u.query="",l=xe;break;case Le:if(i===n||"/"===i||"\\"===i&&u.isSpecial()||!t&&("?"===i||"#"===i)){if(".."===(c=q(c=p))||"%2e."===c||".%2e"===c||"%2e%2e"===c?(u.shortenPath(),"/"===i||"\\"===i&&u.isSpecial()||B(u.path,"")):me(p)?"/"===i||"\\"===i&&u.isSpecial()||B(u.path,""):("file"===u.scheme&&!u.path.length&&he(p)&&(u.host&&(u.host=""),p=L(p,0)+":"),B(u.path,p)),p="","file"===u.scheme&&(i===n||"?"===i||"#"===i))for(;u.path.length>1&&""===u.path[0];)G(u.path);"?"===i?(u.query="",l=xe):"#"===i&&(u.fragment="",l=ke)}else p+=de(i,ue);break;case Pe:"?"===i?(u.query="",l=xe):"#"===i?(u.fragment="",l=ke):i!==n&&(u.path[0]+=de(i,se));break;case xe:t||"#"!==i?i!==n&&("'"===i&&u.isSpecial()?u.query+="%27":u.query+="#"===i?"%23":de(i,se)):(u.fragment="",l=ke);break;case ke:i!==n&&(u.fragment+=de(i,ce))}d++}},parseHost:function(e){var t,r,n;if("["===L(e,0)){if("]"!==L(e,e.length-1))return K;if(t=function(e){var t,r,n,o,i,a,s,c=[0,0,0,0,0,0,0,0],u=0,l=null,d=0,p=function(){return L(e,d)};if(":"===p()){if(":"!==L(e,1))return;d+=2,l=++u}for(;p();){if(8===u)return;if(":"!==p()){for(t=r=0;r<4&&P(ee,p());)t=16*t+M(p(),16),d++,r++;if("."===p()){if(0===r)return;if(d-=r,u>6)return;for(n=0;p();){if(o=null,n>0){if(!("."===p()&&n<4))return;d++}if(!P(X,p()))return;for(;P(X,p());){if(i=M(p(),10),null===o)o=i;else{if(0===o)return;o=10*o+i}if(o>255)return;d++}c[u]=256*c[u]+o,2!==++n&&4!==n||u++}if(4!==n)return;break}if(":"===p()){if(d++,!p())return}else if(p())return;c[u++]=t}else{if(null!==l)return;d++,l=++u}}if(null!==l)for(a=u-l,u=7;0!==u&&a>0;)s=c[u],c[u--]=c[l+a-1],c[l+--a]=s;else if(8!==u)return;return c}(F(e,1,-1)),!t)return K;this.host=t}else if(this.isSpecial()){if(e=y(e),P(te,e))return K;if(t=function(e){var t,r,n,o,i,a,s,c=H(e,".");if(c.length&&""===c[c.length-1]&&c.length--,(t=c.length)>4)return e;for(r=[],n=0;n<t;n++){if(""===(o=c[n]))return e;if(i=10,o.length>1&&"0"===L(o,0)&&(i=P(Q,o)?16:8,o=F(o,8===i?1:2)),""===o)a=0;else{if(!P(10===i?Z:8===i?$:ee,o))return e;a=M(o,i)}B(r,a)}for(n=0;n<t;n++)if(a=r[n],n===t-1){if(a>=U(256,5-t))return null}else if(a>255)return null;for(s=D(r),n=0;n<r.length;n++)s+=r[n]*U(256,3-n);return s}(e),null===t)return K;this.host=t}else{if(P(re,e))return K;for(t="",r=m(e),n=0;n<r.length;n++)t+=de(r[n],se);this.host=t}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"===this.scheme},includesCredentials:function(){return""!==this.username||""!==this.password},isSpecial:function(){return h(pe,this.scheme)},shortenPath:function(){var e=this.path,t=e.length;!t||"file"===this.scheme&&1===t&&he(e[0],!0)||e.length--},serialize:function(){var e=this,t=e.scheme,r=e.username,n=e.password,o=e.host,i=e.port,a=e.path,s=e.query,c=e.fragment,u=t+":";return null!==o?(u+="//",e.includesCredentials()&&(u+=r+(n?":"+n:"")+"@"),u+=ae(o),null!==i&&(u+=":"+i)):"file"===t&&(u+="//"),u+=e.cannotBeABaseURL?a[0]:a.length?"/"+x(a,"/"):"",null!==s&&(u+="?"+s),null!==c&&(u+="#"+c),u},setHref:function(e){var t=this.parse(e);if(t)throw new A(t);this.searchParams.update()},getOrigin:function(){var e=this.scheme,t=this.port;if("blob"===e)try{return new Be(e.path[0]).origin}catch(e){return"null"}return"file"!==e&&this.isSpecial()?e+"://"+ae(this.host)+(null!==t?":"+t:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(e){this.parse(E(e)+":",ve)},getUsername:function(){return this.username},setUsername:function(e){var t=m(E(e));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var r=0;r<t.length;r++)this.username+=de(t[r],le)}},getPassword:function(){return this.password},setPassword:function(e){var t=m(E(e));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var r=0;r<t.length;r++)this.password+=de(t[r],le)}},getHost:function(){var e=this.host,t=this.port;return null===e?"":null===t?ae(e):ae(e)+":"+t},setHost:function(e){this.cannotBeABaseURL||this.parse(e,be)},getHostname:function(){var e=this.host;return null===e?"":ae(e)},setHostname:function(e){this.cannotBeABaseURL||this.parse(e,Ce)},getPort:function(){var e=this.port;return null===e?"":E(e)},setPort:function(e){this.cannotHaveUsernamePasswordPort()||(""===(e=E(e))?this.port=null:this.parse(e,Ne))},getPathname:function(){var e=this.path;return this.cannotBeABaseURL?e[0]:e.length?"/"+x(e,"/"):""},setPathname:function(e){this.cannotBeABaseURL||(this.path=[],this.parse(e,Ue))},getSearch:function(){var e=this.query;return e?"?"+e:""},setSearch:function(e){""===(e=E(e))?this.query=null:("?"===L(e,0)&&(e=F(e,1)),this.query="",this.parse(e,xe)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var e=this.fragment;return e?"#"+e:""},setHash:function(e){""!==(e=E(e))?("#"===L(e,0)&&(e=F(e,1)),this.fragment="",this.parse(e,ke)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Be=function(e){var t=p(this,je),r=T(arguments.length,1)>1?arguments[1]:void 0,n=R(t,new De(e,!1,r));i||(t.href=n.serialize(),t.origin=n.getOrigin(),t.protocol=n.getProtocol(),t.username=n.getUsername(),t.password=n.getPassword(),t.host=n.getHost(),t.hostname=n.getHostname(),t.port=n.getPort(),t.pathname=n.getPathname(),t.search=n.getSearch(),t.searchParams=n.getSearchParams(),t.hash=n.getHash())},je=Be.prototype,Ge=function(e,t){return{get:function(){return S(this)[e]()},set:t&&function(e){return S(this)[t](e)},configurable:!0,enumerable:!0}};if(i&&(d(je,"href",Ge("serialize","setHref")),d(je,"origin",Ge("getOrigin")),d(je,"protocol",Ge("getProtocol","setProtocol")),d(je,"username",Ge("getUsername","setUsername")),d(je,"password",Ge("getPassword","setPassword")),d(je,"host",Ge("getHost","setHost")),d(je,"hostname",Ge("getHostname","setHostname")),d(je,"port",Ge("getPort","setPort")),d(je,"pathname",Ge("getPathname","setPathname")),d(je,"search",Ge("getSearch","setSearch")),d(je,"searchParams",Ge("getSearchParams")),d(je,"hash",Ge("getHash","setHash"))),l(je,"toJSON",(function(){return S(this).serialize()}),{enumerable:!0}),l(je,"toString",(function(){return S(this).serialize()}),{enumerable:!0}),N){var He=N.createObjectURL,Fe=N.revokeObjectURL;He&&l(Be,"createObjectURL",c(He,N)),Fe&&l(Be,"revokeObjectURL",c(Fe,N))}_(Be,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:Be})},5823:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(9565),a=r(3724),s=r(2805),c=r(4644),u=r(6346),l=r(679),d=r(6980),p=r(6699),h=r(2087),f=r(8014),m=r(7696),v=r(8229),g=r(8319),y=r(6969),E=r(9297),_=r(6955),T=r(34),I=r(757),O=r(2360),R=r(1625),S=r(2967),b=r(8480).f,C=r(3251),N=r(9213).forEach,A=r(7633),M=r(2106),w=r(4913),U=r(7347),L=r(5370),P=r(1181),x=r(3167),k=P.get,D=P.set,B=P.enforce,j=w.f,G=U.f,H=o.RangeError,F=u.ArrayBuffer,q=F.prototype,W=u.DataView,z=c.NATIVE_ARRAY_BUFFER_VIEWS,K=c.TYPED_ARRAY_TAG,V=c.TypedArray,J=c.TypedArrayPrototype,Y=c.isTypedArray,X="BYTES_PER_ELEMENT",Q="Wrong length",$=function(e,t){M(e,t,{configurable:!0,get:function(){return k(this)[t]}})},Z=function(e){var t;return R(q,e)||"ArrayBuffer"===(t=_(e))||"SharedArrayBuffer"===t},ee=function(e,t){return Y(e)&&!I(t)&&t in e&&h(+t)&&t>=0},te=function(e,t){return t=y(t),ee(e,t)?d(2,e[t]):G(e,t)},re=function(e,t,r){return t=y(t),!(ee(e,t)&&T(r)&&E(r,"value"))||E(r,"get")||E(r,"set")||r.configurable||E(r,"writable")&&!r.writable||E(r,"enumerable")&&!r.enumerable?j(e,t,r):(e[t]=r.value,e)};a?(z||(U.f=te,w.f=re,$(J,"buffer"),$(J,"byteOffset"),$(J,"byteLength"),$(J,"length")),n({target:"Object",stat:!0,forced:!z},{getOwnPropertyDescriptor:te,defineProperty:re}),e.exports=function(e,t,r){var a=e.match(/\d+/)[0]/8,c=e+(r?"Clamped":"")+"Array",u="get"+e,d="set"+e,h=o[c],y=h,E=y&&y.prototype,_={},I=function(e,t){j(e,t,{get:function(){return function(e,t){var r=k(e);return r.view[u](t*a+r.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var o=k(e);o.view[d](t*a+o.byteOffset,r?g(n):n,!0)}(this,t,e)},enumerable:!0})};z?s&&(y=t((function(e,t,r,n){return l(e,E),x(T(t)?Z(t)?void 0!==n?new h(t,v(r,a),n):void 0!==r?new h(t,v(r,a)):new h(t):Y(t)?L(y,t):i(C,y,t):new h(m(t)),e,y)})),S&&S(y,V),N(b(h),(function(e){e in y||p(y,e,h[e])})),y.prototype=E):(y=t((function(e,t,r,n){l(e,E);var o,s,c,u=0,d=0;if(T(t)){if(!Z(t))return Y(t)?L(y,t):i(C,y,t);o=t,d=v(r,a);var p=t.byteLength;if(void 0===n){if(p%a)throw new H(Q);if((s=p-d)<0)throw new H(Q)}else if((s=f(n)*a)+d>p)throw new H(Q);c=s/a}else c=m(t),o=new F(s=c*a);for(D(e,{buffer:o,byteOffset:d,byteLength:s,length:c,view:new W(o)});u<c;)I(e,u++)})),S&&S(y,V),E=y.prototype=O(J)),E.constructor!==y&&p(E,"constructor",y),B(E).TypedArrayConstructor=y,K&&p(E,K,c);var R=y!==h;_[c]=y,n({global:!0,constructor:!0,forced:R,sham:!z},_),X in y||p(y,X,a),X in E||p(E,X,a),A(c)}):e.exports=function(){}},5854:function(e,t,r){"use strict";var n=r(2777),o=TypeError;e.exports=function(e){var t=n(e,"number");if("number"==typeof t)throw new o("Can't convert number to bigint");return BigInt(t)}},5917:function(e,t,r){"use strict";var n=r(3724),o=r(9039),i=r(4055);e.exports=!n&&!o((function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},5966:function(e,t,r){"use strict";var n=r(9306),o=r(4117);e.exports=function(e,t){var r=e[t];return o(r)?void 0:n(r)}},6031:function(e,t,r){"use strict";r(5575),r(4599)},6033:function(e,t,r){"use strict";r(8523)},6034:function(e,t,r){"use strict";var n=r(6518),o=r(2357).values;n({target:"Object",stat:!0},{values:function(e){return o(e)}})},6043:function(e,t,r){"use strict";var n=r(9306),o=TypeError,i=function(e){var t,r;this.promise=new e((function(e,n){if(void 0!==t||void 0!==r)throw new o("Bad Promise constructor");t=e,r=n})),this.resolve=n(t),this.reject=n(r)};e.exports.f=function(e){return new i(e)}},6072:function(e,t,r){"use strict";var n=r(4644),o=r(926).right,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return o(i(this),e,t,t>1?arguments[1]:void 0)}))},6080:function(e,t,r){"use strict";var n=r(7476),o=r(9306),i=r(616),a=n(n.bind);e.exports=function(e,t){return o(e),void 0===t?e:i?a(e,t):function(){return e.apply(t,arguments)}}},6098:function(e,t,r){"use strict";var n=r(9504),o=2147483647,i=/[^\0-\u007E]/,a=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",c=RangeError,u=n(a.exec),l=Math.floor,d=String.fromCharCode,p=n("".charCodeAt),h=n([].join),f=n([].push),m=n("".replace),v=n("".split),g=n("".toLowerCase),y=function(e){return e+22+75*(e<26)},E=function(e,t,r){var n=0;for(e=r?l(e/700):e>>1,e+=l(e/t);e>455;)e=l(e/35),n+=36;return l(n+36*e/(e+38))},_=function(e){var t=[];e=function(e){for(var t=[],r=0,n=e.length;r<n;){var o=p(e,r++);if(o>=55296&&o<=56319&&r<n){var i=p(e,r++);56320==(64512&i)?f(t,((1023&o)<<10)+(1023&i)+65536):(f(t,o),r--)}else f(t,o)}return t}(e);var r,n,i=e.length,a=128,u=0,m=72;for(r=0;r<e.length;r++)(n=e[r])<128&&f(t,d(n));var v=t.length,g=v;for(v&&f(t,"-");g<i;){var _=o;for(r=0;r<e.length;r++)(n=e[r])>=a&&n<_&&(_=n);var T=g+1;if(_-a>l((o-u)/T))throw new c(s);for(u+=(_-a)*T,a=_,r=0;r<e.length;r++){if((n=e[r])<a&&++u>o)throw new c(s);if(n===a){for(var I=u,O=36;;){var R=O<=m?1:O>=m+26?26:O-m;if(I<R)break;var S=I-R,b=36-R;f(t,d(y(R+S%b))),I=l(S/b),O+=36}f(t,d(y(I))),m=E(u,T,g===v),u=0,g++}}u++,a++}return h(t,"")};e.exports=function(e){var t,r,n=[],o=v(m(g(e),a,"."),".");for(t=0;t<o.length;t++)r=o[t],f(n,u(i,r)?"xn--"+_(r):r);return h(n,".")}},6099:function(e,t,r){"use strict";var n=r(2140),o=r(6840),i=r(3179);n||o(Object.prototype,"toString",i,{unsafe:!0})},6119:function(e,t,r){"use strict";var n=r(5745),o=r(3392),i=n("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},6193:function(e,t,r){"use strict";var n=r(4215);e.exports="NODE"===n},6198:function(e,t,r){"use strict";var n=r(8014);e.exports=function(e){return n(e.length)}},6237:function(e,t,r){"use strict";e.exports=c;var n,o=r(3610),i=o.LongBits,a=o.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function c(e){this.buf=e,this.pos=0,this.len=e.length}var u,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new c(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new c(e);throw Error("illegal buffer")},d=function(){return o.Buffer?function(e){return(c.create=function(e){return o.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l};function p(){var e=new i(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 h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw s(this,8);return new i(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}c.create=d(),c.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,c.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}),c.prototype.int32=function(){return 0|this.uint32()},c.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},c.prototype.bool=function(){return 0!==this.uint32()},c.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},c.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},c.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},c.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},c.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)},c.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},c.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},c.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},c._configure=function(e){n=e,c.create=d(),n._configure();var t=o.Long?"toLong":"toNumber";o.merge(c.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},6269:function(e){"use strict";e.exports={}},6279:function(e,t,r){"use strict";var n=r(6840);e.exports=function(e,t,r){for(var o in t)n(e,o,t[o],r);return e}},6319:function(e,t,r){"use strict";var n=r(8551),o=r(9539);e.exports=function(e,t,r,i){try{return i?t(n(r)[0],r[1]):t(r)}catch(t){o(e,"throw",t)}}},6346:function(e,t,r){"use strict";var n=r(4576),o=r(9504),i=r(3724),a=r(7811),s=r(350),c=r(6699),u=r(2106),l=r(6279),d=r(9039),p=r(679),h=r(1291),f=r(8014),m=r(7696),v=r(5617),g=r(8490),y=r(2787),E=r(2967),_=r(4373),T=r(7680),I=r(3167),O=r(7740),R=r(687),S=r(1181),b=s.PROPER,C=s.CONFIGURABLE,N="ArrayBuffer",A="DataView",M="prototype",w="Wrong index",U=S.getterFor(N),L=S.getterFor(A),P=S.set,x=n[N],k=x,D=k&&k[M],B=n[A],j=B&&B[M],G=Object.prototype,H=n.Array,F=n.RangeError,q=o(_),W=o([].reverse),z=g.pack,K=g.unpack,V=function(e){return[255&e]},J=function(e){return[255&e,e>>8&255]},Y=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},X=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Q=function(e){return z(v(e),23,4)},$=function(e){return z(e,52,8)},Z=function(e,t,r){u(e[M],t,{configurable:!0,get:function(){return r(this)[t]}})},ee=function(e,t,r,n){var o=L(e),i=m(r),a=!!n;if(i+t>o.byteLength)throw new F(w);var s=o.bytes,c=i+o.byteOffset,u=T(s,c,c+t);return a?u:W(u)},te=function(e,t,r,n,o,i){var a=L(e),s=m(r),c=n(+o),u=!!i;if(s+t>a.byteLength)throw new F(w);for(var l=a.bytes,d=s+a.byteOffset,p=0;p<t;p++)l[d+p]=c[u?p:t-p-1]};if(a){var re=b&&x.name!==N;d((function(){x(1)}))&&d((function(){new x(-1)}))&&!d((function(){return new x,new x(1.5),new x(NaN),1!==x.length||re&&!C}))?re&&C&&c(x,"name",N):((k=function(e){return p(this,D),I(new x(m(e)),this,k)})[M]=D,D.constructor=k,O(k,x)),E&&y(j)!==G&&E(j,G);var ne=new B(new k(2)),oe=o(j.setInt8);ne.setInt8(0,2147483648),ne.setInt8(1,2147483649),!ne.getInt8(0)&&ne.getInt8(1)||l(j,{setInt8:function(e,t){oe(this,e,t<<24>>24)},setUint8:function(e,t){oe(this,e,t<<24>>24)}},{unsafe:!0})}else D=(k=function(e){p(this,D);var t=m(e);P(this,{type:N,bytes:q(H(t),0),byteLength:t}),i||(this.byteLength=t,this.detached=!1)})[M],j=(B=function(e,t,r){p(this,j),p(e,D);var n=U(e),o=n.byteLength,a=h(t);if(a<0||a>o)throw new F("Wrong offset");if(a+(r=void 0===r?o-a:f(r))>o)throw new F("Wrong length");P(this,{type:A,buffer:e,byteLength:r,byteOffset:a,bytes:n.bytes}),i||(this.buffer=e,this.byteLength=r,this.byteOffset=a)})[M],i&&(Z(k,"byteLength",U),Z(B,"buffer",L),Z(B,"byteLength",L),Z(B,"byteOffset",L)),l(j,{getInt8:function(e){return ee(this,1,e)[0]<<24>>24},getUint8:function(e){return ee(this,1,e)[0]},getInt16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=ee(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return X(ee(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return X(ee(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return K(ee(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return K(ee(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){te(this,1,e,V,t)},setUint8:function(e,t){te(this,1,e,V,t)},setInt16:function(e,t){te(this,2,e,J,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){te(this,2,e,J,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){te(this,4,e,Y,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){te(this,4,e,Y,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){te(this,4,e,Q,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){te(this,8,e,$,t,arguments.length>2&&arguments[2])}});R(k,N),R(B,A),e.exports={ArrayBuffer:k,DataView:B}},6395:function(e){"use strict";e.exports=!1},6434:function(e,t,r){"use strict";var n=t,o=r(2551);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var i=this.lookup(n);i&&(e=i.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof o){var a=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),a["@type"]=n,a}return this.toObject(e,t)}}},6468:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(9504),a=r(2796),s=r(6840),c=r(3451),u=r(2652),l=r(679),d=r(4901),p=r(4117),h=r(34),f=r(9039),m=r(4428),v=r(687),g=r(3167);e.exports=function(e,t,r){var y=-1!==e.indexOf("Map"),E=-1!==e.indexOf("Weak"),_=y?"set":"add",T=o[e],I=T&&T.prototype,O=T,R={},S=function(e){var t=i(I[e]);s(I,e,"add"===e?function(e){return t(this,0===e?0:e),this}:"delete"===e?function(e){return!(E&&!h(e))&&t(this,0===e?0:e)}:"get"===e?function(e){return E&&!h(e)?void 0:t(this,0===e?0:e)}:"has"===e?function(e){return!(E&&!h(e))&&t(this,0===e?0:e)}:function(e,r){return t(this,0===e?0:e,r),this})};if(a(e,!d(T)||!(E||I.forEach&&!f((function(){(new T).entries().next()})))))O=r.getConstructor(t,e,y,_),c.enable();else if(a(e,!0)){var b=new O,C=b[_](E?{}:-0,1)!==b,N=f((function(){b.has(1)})),A=m((function(e){new T(e)})),M=!E&&f((function(){for(var e=new T,t=5;t--;)e[_](t,t);return!e.has(-0)}));A||((O=t((function(e,t){l(e,I);var r=g(new T,e,O);return p(t)||u(t,r[_],{that:r,AS_ENTRIES:y}),r}))).prototype=I,I.constructor=O),(N||M)&&(S("delete"),S("has"),y&&S("get")),(M||C)&&S(_),E&&I.clear&&delete I.clear}return R[e]=O,n({global:!0,constructor:!0,forced:O!==T},R),v(O,e),E||r.setStrong(O,e,y),O}},6469:function(e,t,r){"use strict";var n=r(8227),o=r(2360),i=r(4913).f,a=n("unscopables"),s=Array.prototype;void 0===s[a]&&i(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},6499:function(e,t,r){"use strict";var n=r(6518),o=r(9565),i=r(9306),a=r(6043),s=r(1103),c=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{all:function(e){var t=this,r=a.f(t),n=r.resolve,u=r.reject,l=s((function(){var r=i(t.resolve),a=[],s=0,l=1;c(e,(function(e){var i=s++,c=!1;l++,o(r,t,e).then((function(e){c||(c=!0,a[i]=e,--l||n(a))}),u)})),--l||n(a)}));return l.error&&u(l.value),r.promise}})},6518:function(e,t,r){"use strict";var n=r(4576),o=r(7347).f,i=r(6699),a=r(6840),s=r(9433),c=r(7740),u=r(2796);e.exports=function(e,t){var r,l,d,p,h,f=e.target,m=e.global,v=e.stat;if(r=m?n:v?n[f]||s(f,{}):n[f]&&n[f].prototype)for(l in t){if(p=t[l],d=e.dontCallGetSet?(h=o(r,l))&&h.value:r[l],!u(m?l:f+(v?".":"#")+l,e.forced)&&void 0!==d){if(typeof p==typeof d)continue;c(p,d)}(e.sham||d&&d.sham)&&i(p,"sham",!0),a(r,l,p,e)}}},6614:function(e,t,r){"use strict";var n=r(4644),o=r(8014),i=r(5610),a=n.aTypedArray,s=n.getTypedArrayConstructor;(0,n.exportTypedArrayMethod)("subarray",(function(e,t){var r=a(this),n=r.length,c=i(e,n);return new(s(r))(r.buffer,r.byteOffset+c*r.BYTES_PER_ELEMENT,o((void 0===t?n:i(t,n))-c))}))},6651:function(e,t,r){"use strict";var n=r(4644),o=r(9617).indexOf,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("indexOf",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},6682:function(e,t,r){"use strict";var n=r(9565),o=r(8551),i=r(4901),a=r(2195),s=r(7323),c=TypeError;e.exports=function(e,t){var r=e.exec;if(i(r)){var u=n(r,e,t);return null!==u&&o(u),u}if("RegExp"===a(e))return n(s,e,t);throw new c("RegExp#exec called on incompatible receiver")}},6699:function(e,t,r){"use strict";var n=r(3724),o=r(4913),i=r(6980);e.exports=n?function(e,t,r){return o.f(e,t,i(1,r))}:function(e,t,r){return e[t]=r,e}},6706:function(e,t,r){"use strict";var n=r(9504),o=r(9306);e.exports=function(e,t,r){try{return n(o(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}}},6761:function(e,t,r){"use strict";var n=r(6518),o=r(4576),i=r(9565),a=r(9504),s=r(6395),c=r(3724),u=r(4495),l=r(9039),d=r(9297),p=r(1625),h=r(8551),f=r(5397),m=r(6969),v=r(655),g=r(6980),y=r(2360),E=r(1072),_=r(8480),T=r(298),I=r(3717),O=r(7347),R=r(4913),S=r(6801),b=r(8773),C=r(6840),N=r(2106),A=r(5745),M=r(6119),w=r(421),U=r(3392),L=r(8227),P=r(1951),x=r(511),k=r(8242),D=r(687),B=r(1181),j=r(9213).forEach,G=M("hidden"),H="Symbol",F="prototype",q=B.set,W=B.getterFor(H),z=Object[F],K=o.Symbol,V=K&&K[F],J=o.RangeError,Y=o.TypeError,X=o.QObject,Q=O.f,$=R.f,Z=T.f,ee=b.f,te=a([].push),re=A("symbols"),ne=A("op-symbols"),oe=A("wks"),ie=!X||!X[F]||!X[F].findChild,ae=function(e,t,r){var n=Q(z,t);n&&delete z[t],$(e,t,r),n&&e!==z&&$(z,t,n)},se=c&&l((function(){return 7!==y($({},"a",{get:function(){return $(this,"a",{value:7}).a}})).a}))?ae:$,ce=function(e,t){var r=re[e]=y(V);return q(r,{type:H,tag:e,description:t}),c||(r.description=t),r},ue=function(e,t,r){e===z&&ue(ne,t,r),h(e);var n=m(t);return h(r),d(re,n)?(r.enumerable?(d(e,G)&&e[G][n]&&(e[G][n]=!1),r=y(r,{enumerable:g(0,!1)})):(d(e,G)||$(e,G,g(1,y(null))),e[G][n]=!0),se(e,n,r)):$(e,n,r)},le=function(e,t){h(e);var r=f(t),n=E(r).concat(fe(r));return j(n,(function(t){c&&!i(de,r,t)||ue(e,t,r[t])})),e},de=function(e){var t=m(e),r=i(ee,this,t);return!(this===z&&d(re,t)&&!d(ne,t))&&(!(r||!d(this,t)||!d(re,t)||d(this,G)&&this[G][t])||r)},pe=function(e,t){var r=f(e),n=m(t);if(r!==z||!d(re,n)||d(ne,n)){var o=Q(r,n);return!o||!d(re,n)||d(r,G)&&r[G][n]||(o.enumerable=!0),o}},he=function(e){var t=Z(f(e)),r=[];return j(t,(function(e){d(re,e)||d(w,e)||te(r,e)})),r},fe=function(e){var t=e===z,r=Z(t?ne:f(e)),n=[];return j(r,(function(e){!d(re,e)||t&&!d(z,e)||te(n,re[e])})),n};u||(K=function(){if(p(V,this))throw new Y("Symbol is not a constructor");var e=arguments.length&&void 0!==arguments[0]?v(arguments[0]):void 0,t=U(e),r=function(e){var n=void 0===this?o:this;n===z&&i(r,ne,e),d(n,G)&&d(n[G],t)&&(n[G][t]=!1);var a=g(1,e);try{se(n,t,a)}catch(e){if(!(e instanceof J))throw e;ae(n,t,a)}};return c&&ie&&se(z,t,{configurable:!0,set:r}),ce(t,e)},C(V=K[F],"toString",(function(){return W(this).tag})),C(K,"withoutSetter",(function(e){return ce(U(e),e)})),b.f=de,R.f=ue,S.f=le,O.f=pe,_.f=T.f=he,I.f=fe,P.f=function(e){return ce(L(e),e)},c&&(N(V,"description",{configurable:!0,get:function(){return W(this).description}}),s||C(z,"propertyIsEnumerable",de,{unsafe:!0}))),n({global:!0,constructor:!0,wrap:!0,forced:!u,sham:!u},{Symbol:K}),j(E(oe),(function(e){x(e)})),n({target:H,stat:!0,forced:!u},{useSetter:function(){ie=!0},useSimple:function(){ie=!1}}),n({target:"Object",stat:!0,forced:!u,sham:!c},{create:function(e,t){return void 0===t?y(e):le(y(e),t)},defineProperty:ue,defineProperties:le,getOwnPropertyDescriptor:pe}),n({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:he}),k(),D(K,H),w[G]=!0},6801:function(e,t,r){"use strict";var n=r(3724),o=r(8686),i=r(4913),a=r(8551),s=r(5397),c=r(1072);t.f=n&&!o?Object.defineProperties:function(e,t){a(e);for(var r,n=s(t),o=c(t),u=o.length,l=0;u>l;)i.f(e,r=o[l++],n[r]);return e}},6812:function(e,t,r){"use strict";var n=r(4644),o=r(8745),i=r(8379),a=n.aTypedArray;(0,n.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return o(i,a(this),t>1?[e,arguments[1]]:[e])}))},6823:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6837:function(e){"use strict";var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},6840:function(e,t,r){"use strict";var n=r(4901),o=r(4913),i=r(283),a=r(9433);e.exports=function(e,t,r,s){s||(s={});var c=s.enumerable,u=void 0!==s.name?s.name:t;if(n(r)&&i(r,u,s),s.global)c?e[t]=r:a(t,r);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=r:o.f(e,t,{value:r,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},6910:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(9306),a=r(8981),s=r(6198),c=r(4606),u=r(655),l=r(9039),d=r(4488),p=r(4598),h=r(3709),f=r(3763),m=r(9519),v=r(3607),g=[],y=o(g.sort),E=o(g.push),_=l((function(){g.sort(void 0)})),T=l((function(){g.sort(null)})),I=p("sort"),O=!l((function(){if(m)return m<70;if(!(h&&h>3)){if(f)return!0;if(v)return v<603;var e,t,r,n,o="";for(e=65;e<76;e++){switch(t=String.fromCharCode(e),e){case 66:case 69:case 70:case 72:r=3;break;case 68:case 71:r=4;break;default:r=2}for(n=0;n<47;n++)g.push({k:t+n,v:r})}for(g.sort((function(e,t){return t.v-e.v})),n=0;n<g.length;n++)t=g[n].k.charAt(0),o.charAt(o.length-1)!==t&&(o+=t);return"DGBEFHACIJK"!==o}}));n({target:"Array",proto:!0,forced:_||!T||!I||!O},{sort:function(e){void 0!==e&&i(e);var t=a(this);if(O)return void 0===e?y(t):y(t,e);var r,n,o=[],l=s(t);for(n=0;n<l;n++)n in t&&E(o,t[n]);for(d(o,function(e){return function(t,r){return void 0===r?-1:void 0===t?1:void 0!==e?+e(t,r)||0:u(t)>u(r)?1:-1}}(e)),r=s(o),n=0;n<r;)t[n]=o[n++];for(;n<l;)c(t,n++);return t}})},6933:function(e,t,r){"use strict";var n=r(9504),o=r(4376),i=r(4901),a=r(2195),s=r(655),c=n([].push);e.exports=function(e){if(i(e))return e;if(o(e)){for(var t=e.length,r=[],n=0;n<t;n++){var u=e[n];"string"==typeof u?c(r,u):"number"!=typeof u&&"Number"!==a(u)&&"String"!==a(u)||c(r,s(u))}var l=r.length,d=!0;return function(e,t){if(d)return d=!1,t;if(o(this))return t;for(var n=0;n<l;n++)if(r[n]===e)return t}}}},6938:function(e,t,r){"use strict";var n=r(2360),o=r(2106),i=r(6279),a=r(6080),s=r(679),c=r(4117),u=r(2652),l=r(1088),d=r(2529),p=r(7633),h=r(3724),f=r(3451).fastKey,m=r(1181),v=m.set,g=m.getterFor;e.exports={getConstructor:function(e,t,r,l){var d=e((function(e,o){s(e,p),v(e,{type:t,index:n(null),first:null,last:null,size:0}),h||(e.size=0),c(o)||u(o,e[l],{that:e,AS_ENTRIES:r})})),p=d.prototype,m=g(t),y=function(e,t,r){var n,o,i=m(e),a=E(e,t);return a?a.value=r:(i.last=a={index:o=f(t,!0),key:t,value:r,previous:n=i.last,next:null,removed:!1},i.first||(i.first=a),n&&(n.next=a),h?i.size++:e.size++,"F"!==o&&(i.index[o]=a)),e},E=function(e,t){var r,n=m(e),o=f(t);if("F"!==o)return n.index[o];for(r=n.first;r;r=r.next)if(r.key===t)return r};return i(p,{clear:function(){for(var e=m(this),t=e.first;t;)t.removed=!0,t.previous&&(t.previous=t.previous.next=null),t=t.next;e.first=e.last=null,e.index=n(null),h?e.size=0:this.size=0},delete:function(e){var t=this,r=m(t),n=E(t,e);if(n){var o=n.next,i=n.previous;delete r.index[n.index],n.removed=!0,i&&(i.next=o),o&&(o.previous=i),r.first===n&&(r.first=o),r.last===n&&(r.last=i),h?r.size--:t.size--}return!!n},forEach:function(e){for(var t,r=m(this),n=a(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:r.first;)for(n(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!E(this,e)}}),i(p,r?{get:function(e){var t=E(this,e);return t&&t.value},set:function(e,t){return y(this,0===e?0:e,t)}}:{add:function(e){return y(this,e=0===e?0:e,e)}}),h&&o(p,"size",{configurable:!0,get:function(){return m(this).size}}),d},setStrong:function(e,t,r){var n=t+" Iterator",o=g(t),i=g(n);l(e,t,(function(e,t){v(this,{type:n,target:e,state:o(e),kind:t,last:null})}),(function(){for(var e=i(this),t=e.kind,r=e.last;r&&r.removed;)r=r.previous;return e.target&&(e.last=r=r?r.next:e.state.first)?d("keys"===t?r.key:"values"===t?r.value:[r.key,r.value],!1):(e.target=null,d(void 0,!0))}),r?"entries":"values",!r,!0),p(t)}}},6955:function(e,t,r){"use strict";var n=r(2140),o=r(4901),i=r(2195),a=r(8227)("toStringTag"),s=Object,c="Arguments"===i(function(){return arguments}());e.exports=n?i:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch(e){}}(t=s(e),a))?r:c?i(t):"Object"===(n=i(t))&&o(t.callee)?"Arguments":n}},6969:function(e,t,r){"use strict";var n=r(2777),o=r(757);e.exports=function(e){var t=n(e,"string");return o(t)?t:t+""}},6980:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7029:function(e,t,r){"use strict";var n=r(8981),o=r(5610),i=r(6198),a=r(4606),s=Math.min;e.exports=[].copyWithin||function(e,t){var r=n(this),c=i(r),u=o(e,c),l=o(t,c),d=arguments.length>2?arguments[2]:void 0,p=s((void 0===d?c:o(d,c))-l,c-u),h=1;for(l<u&&u<l+p&&(h=-1,l+=p-1,u+=p-1);p-- >0;)l in r?r[u]=r[l]:a(r,u),u+=h,l+=h;return r}},7040:function(e,t,r){"use strict";var n=r(4495);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:function(e,t,r){"use strict";var n=r(9504),o=r(9039),i=r(2195),a=Object,s=n("".split);e.exports=o((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===i(e)?s(e,""):a(e)}:a},7208:function(e,t,r){"use strict";var n=r(6518),o=r(9565);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return o(URL.prototype.toString,this)}})},7209:function(e,t,r){"use strict";e.exports=i,i.className="ReflectionObject";var n,o=r(3262);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.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}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.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var i=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(i){var a=i[e];o.setProperty(a,r,t)}else(i={})[e]=o.setProperty({},r,t),n.push(i)}else{var s={};s[e]=t,n.push(s)}return this},i.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],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=e}},7301:function(e,t,r){"use strict";var n=r(4644),o=r(9213).some,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("some",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))},7323:function(e,t,r){"use strict";var n,o,i=r(9565),a=r(9504),s=r(655),c=r(7979),u=r(8429),l=r(5745),d=r(2360),p=r(1181).get,h=r(3635),f=r(8814),m=l("native-string-replace",String.prototype.replace),v=RegExp.prototype.exec,g=v,y=a("".charAt),E=a("".indexOf),_=a("".replace),T=a("".slice),I=(o=/b*/g,i(v,n=/a/,"a"),i(v,o,"a"),0!==n.lastIndex||0!==o.lastIndex),O=u.BROKEN_CARET,R=void 0!==/()??/.exec("")[1];(I||R||O||h||f)&&(g=function(e){var t,r,n,o,a,u,l,h=this,f=p(h),S=s(e),b=f.raw;if(b)return b.lastIndex=h.lastIndex,t=i(g,b,S),h.lastIndex=b.lastIndex,t;var C=f.groups,N=O&&h.sticky,A=i(c,h),M=h.source,w=0,U=S;if(N&&(A=_(A,"y",""),-1===E(A,"g")&&(A+="g"),U=T(S,h.lastIndex),h.lastIndex>0&&(!h.multiline||h.multiline&&"\n"!==y(S,h.lastIndex-1))&&(M="(?: "+M+")",U=" "+U,w++),r=new RegExp("^(?:"+M+")",A)),R&&(r=new RegExp("^"+M+"$(?!\\s)",A)),I&&(n=h.lastIndex),o=i(v,N?r:h,U),N?o?(o.input=T(o.input,w),o[0]=T(o[0],w),o.index=h.lastIndex,h.lastIndex+=o[0].length):h.lastIndex=0:I&&o&&(h.lastIndex=h.global?o.index+o[0].length:n),R&&o&&o.length>1&&i(m,o[0],r,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)})),o&&C)for(o.groups=u=d(null),a=0;a<C.length;a++)u[(l=C[a])[0]]=o[l[1]];return o}),e.exports=g},7337:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(5610),a=RangeError,s=String.fromCharCode,c=String.fromCodePoint,u=o([].join);n({target:"String",stat:!0,arity:1,forced:!!c&&1!==c.length},{fromCodePoint:function(e){for(var t,r=[],n=arguments.length,o=0;n>o;){if(t=+arguments[o++],i(t,1114111)!==t)throw new a(t+" is not a valid code point");r[o]=t<65536?s(t):s(55296+((t-=65536)>>10),t%1024+56320)}return u(r,"")}})},7347:function(e,t,r){"use strict";var n=r(3724),o=r(9565),i=r(8773),a=r(6980),s=r(5397),c=r(6969),u=r(9297),l=r(5917),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=s(e),t=c(t),l)try{return d(e,t)}catch(e){}if(u(e,t))return a(!o(i.f,e,t),e[t])}},7400:function(e){"use strict";e.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},7416:function(e,t,r){"use strict";var n=r(9039),o=r(8227),i=r(3724),a=r(6395),s=o("iterator");e.exports=!n((function(){var e=new URL("b?a=1&b=2&c=3","https://a"),t=e.searchParams,r=new URLSearchParams("a=1&a=2&b=3"),n="";return e.pathname="c%20d",t.forEach((function(e,r){t.delete("b"),n+=r+e})),r.delete("a",2),r.delete("b",void 0),a&&(!e.toJSON||!r.has("a",1)||r.has("a",2)||!r.has("a",void 0)||r.has("b"))||!t.size&&(a||!i)||!t.sort||"https://a/c%20d?a=1&c=3"!==e.href||"3"!==t.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!t[s]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("https://тест").host||"#%D0%B1"!==new URL("https://a#б").hash||"a1c3"!==n||"x"!==new URL("https://x",void 0).host}))},7433:function(e,t,r){"use strict";var n=r(4376),o=r(3517),i=r(34),a=r(8227)("species"),s=Array;e.exports=function(e){var t;return n(e)&&(t=e.constructor,(o(t)&&(t===s||n(t.prototype))||i(t)&&null===(t=t[a]))&&(t=void 0)),void 0===t?s:t}},7452:function(e){"use strict";e.exports="\t\n\v\f\r \u2028\u2029\ufeff"},7476:function(e,t,r){"use strict";var n=r(2195),o=r(9504);e.exports=function(e){if("Function"===n(e))return o(e)}},7495:function(e,t,r){"use strict";var n=r(6518),o=r(7323);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},7595:function(e,t,r){"use strict";e.exports=o;var n=r(3610);function o(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(o.prototype=Object.create(n.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function e(t,r,o,i,a){if(!i)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,o,i);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](i).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e);if(null!==r){if(!(r instanceof o))try{r=o[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){a(e)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},o.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},7629:function(e,t,r){"use strict";var n=r(6395),o=r(4576),i=r(9433),a="__core-js_shared__",s=e.exports=o[a]||i(a,{});(s.versions||(s.versions=[])).push({version:"3.42.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7633:function(e,t,r){"use strict";var n=r(7751),o=r(2106),i=r(8227),a=r(3724),s=i("species");e.exports=function(e){var t=n(e);a&&t&&!t[s]&&o(t,s,{configurable:!0,get:function(){return this}})}},7657:function(e,t,r){"use strict";var n,o,i,a=r(9039),s=r(4901),c=r(34),u=r(2360),l=r(2787),d=r(6840),p=r(8227),h=r(6395),f=p("iterator"),m=!1;[].keys&&("next"in(i=[].keys())?(o=l(l(i)))!==Object.prototype&&(n=o):m=!0),!c(n)||a((function(){var e={};return n[f].call(e)!==e}))?n={}:h&&(n=u(n)),s(n[f])||d(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},7680:function(e,t,r){"use strict";var n=r(9504);e.exports=n([].slice)},7696:function(e,t,r){"use strict";var n=r(1291),o=r(8014),i=RangeError;e.exports=function(e){if(void 0===e)return 0;var t=n(e),r=o(t);if(t!==r)throw new i("Wrong length or index");return r}},7728:function(e,t,r){"use strict";e.exports=function(e){var t=i.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var s=e._fieldsArray[r].resolve(),c=s.resolvedType instanceof n?"int32":s.type,u="m"+i.safeProp(s.name);t("case %i:",s.id),s.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==o.defaults[s.keyType]?t("k=%j",o.defaults[s.keyType]):t("k=null"),void 0!==o.defaults[c]?t("value=%j",o.defaults[c]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===o.basic[c]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",c),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==o.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):s.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==o.packed[c]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,c)("}else"),void 0===o.basic[c]?t(s.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,c)):void 0===o.basic[c]?t(s.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,c),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var l=e._fieldsArray[r];l.required&&t("if(!m.hasOwnProperty(%j))",l.name)("throw util.ProtocolError(%j,{instance:m})",a(l))}return t("return m")};var n=r(5643),o=r(361),i=r(3262);function a(e){return"missing required '"+e.name+"'"}},7740:function(e,t,r){"use strict";var n=r(9297),o=r(5031),i=r(7347),a=r(4913);e.exports=function(e,t,r){for(var s=o(t),c=a.f,u=i.f,l=0;l<s.length;l++){var d=s[l];n(e,d)||r&&n(r,d)||c(e,d,u(t,d))}}},7743:function(e,t,r){"use strict";var n=r(6518),o=r(9565),i=r(9306),a=r(6043),s=r(1103),c=r(2652);n({target:"Promise",stat:!0,forced:r(537)},{race:function(e){var t=this,r=a.f(t),n=r.reject,u=s((function(){var a=i(t.resolve);c(e,(function(e){o(a,t,e).then(r.resolve,n)}))}));return u.error&&n(u.value),r.promise}})},7750:function(e,t,r){"use strict";var n=r(4117),o=TypeError;e.exports=function(e){if(n(e))throw new o("Can't call method on "+e);return e}},7751:function(e,t,r){"use strict";var n=r(4576),o=r(4901);e.exports=function(e,t){return arguments.length<2?(r=n[e],o(r)?r:void 0):n[e]&&n[e][t];var r}},7764:function(e,t,r){"use strict";var n=r(8183).charAt,o=r(655),i=r(1181),a=r(1088),s=r(2529),c="String Iterator",u=i.set,l=i.getterFor(c);a(String,"String",(function(e){u(this,{type:c,string:o(e),index:0})}),(function(){var e,t=l(this),r=t.string,o=t.index;return o>=r.length?s(void 0,!0):(e=n(r,o),t.index+=e.length,s(e,!1))}))},7782:function(e){"use strict";e.exports=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1}},7811:function(e){"use strict";e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},7812:function(e,t,r){"use strict";var n=r(6518),o=r(9297),i=r(757),a=r(6823),s=r(5745),c=r(1296),u=s("symbol-to-string-registry");n({target:"Symbol",stat:!0,forced:!c},{keyFor:function(e){if(!i(e))throw new TypeError(a(e)+" is not a symbol");if(o(u,e))return u[e]}})},7829:function(e,t,r){"use strict";var n=r(8183).charAt;e.exports=function(e,t,r){return t+(r?n(e,t).length:1)}},7860:function(e,t,r){"use strict";var n=r(2839);e.exports=/web0s(?!.*chrome)/i.test(n)},7882:function(e,t,r){"use strict";e.exports=y;var n=r(8923);((y.prototype=Object.create(n.prototype)).constructor=y).className="Type";var o=r(5643),i=r(1457),a=r(1344),s=r(8252),c=r(9687),u=r(2551),l=r(6237),d=r(3449),p=r(3262),h=r(1080),f=r(7728),m=r(420),v=r(744),g=r(6434);function y(e,t){n.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}Object.defineProperties(y.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]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=p.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=p.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=y.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,p.merge(e.prototype,t)),e.$type=e.prototype.$type=this,p.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:p.oneOfGetter(this._oneofsArray[r].oneof),set:p.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),y.generateConstructor=function(e){for(var t,r=p.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",p.safeProp(t.name)):t.repeated&&r("this%s=[]",p.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},y.fromJSON=function(e,t){var r=new y(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),l=0;l<u.length;++l)r.add((void 0!==t.fields[u[l]].keyType?s.fromJSON:a.fromJSON)(u[l],t.fields[u[l]]));if(t.oneofs)for(u=Object.keys(t.oneofs),l=0;l<u.length;++l)r.add(i.fromJSON(u[l],t.oneofs[u[l]]));if(t.nested)for(u=Object.keys(t.nested),l=0;l<u.length;++l){var d=t.nested[u[l]];r.add((void 0!==d.id?a.fromJSON:void 0!==d.fields?y.fromJSON:void 0!==d.values?o.fromJSON:void 0!==d.methods?c.fromJSON:n.fromJSON)(u[l],d))}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},y.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return p.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.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])},y.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 n.prototype.resolveAll.call(this)},y.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},y.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]: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 i?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),E(this)):n.prototype.add.call(this,e)},y.prototype.remove=function(e){if(e instanceof a&&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 i){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 n.prototype.remove.call(this,e)},y.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},y.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},y.prototype.create=function(e){return new this.ctor(e)},y.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=h(this)({Writer:d,types:t,util:p}),this.decode=f(this)({Reader:l,types:t,util:p}),this.verify=m(this)({types:t,util:p}),this.fromObject=v.fromObject(this)({types:t,util:p}),this.toObject=v.toObject(this)({types:t,util:p});var n=g[e];if(n){var o=Object.create(this);o.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(o),o.toObject=this.toObject,this.toObject=n.toObject.bind(o)}return this},y.prototype.encode=function(e,t){return this.setup().encode(e,t)},y.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},y.prototype.decode=function(e,t){return this.setup().decode(e,t)},y.prototype.decodeDelimited=function(e){return e instanceof l||(e=l.create(e)),this.decode(e,e.uint32())},y.prototype.verify=function(e){return this.setup().verify(e)},y.prototype.fromObject=function(e){return this.setup().fromObject(e)},y.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},y.d=function(e){return function(t){p.decorateType(t,e)}}},7916:function(e,t,r){"use strict";var n=r(6080),o=r(9565),i=r(8981),a=r(6319),s=r(4209),c=r(3517),u=r(6198),l=r(4659),d=r(81),p=r(851),h=Array;e.exports=function(e){var t=i(e),r=c(this),f=arguments.length,m=f>1?arguments[1]:void 0,v=void 0!==m;v&&(m=n(m,f>2?arguments[2]:void 0));var g,y,E,_,T,I,O=p(t),R=0;if(!O||this===h&&s(O))for(g=u(t),y=r?new this(g):h(g);g>R;R++)I=v?m(t[R],R):t[R],l(y,R,I);else for(y=r?new this:[],T=(_=d(t,O)).next;!(E=o(T,_)).done;R++)I=v?a(_,m,[E.value,R],!0):E.value,l(y,R,I);return y.length=R,y}},7979:function(e,t,r){"use strict";var n=r(8551);e.exports=function(){var e=n(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},8014:function(e,t,r){"use strict";var n=r(1291),o=Math.min;e.exports=function(e){var t=n(e);return t>0?o(t,9007199254740991):0}},8045:function(e){"use strict";e.exports=function(e,t){for(var r=new Array(arguments.length-1),n=0,o=2,i=!0;o<arguments.length;)r[n++]=arguments[o++];return new Promise((function(o,a){r[n]=function(e){if(i)if(i=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];o.apply(null,t)}};try{e.apply(t||null,r)}catch(e){i&&(i=!1,a(e))}}))}},8183:function(e,t,r){"use strict";var n=r(9504),o=r(1291),i=r(655),a=r(7750),s=n("".charAt),c=n("".charCodeAt),u=n("".slice),l=function(e){return function(t,r){var n,l,d=i(a(t)),p=o(r),h=d.length;return p<0||p>=h?e?"":void 0:(n=c(d,p))<55296||n>56319||p+1===h||(l=c(d,p+1))<56320||l>57343?e?s(d,p):n:e?u(d,p,p+2):l-56320+(n-55296<<10)+65536}};e.exports={codeAt:l(!1),charAt:l(!0)}},8227:function(e,t,r){"use strict";var n=r(4576),o=r(5745),i=r(9297),a=r(3392),s=r(4495),c=r(7040),u=n.Symbol,l=o("wks"),d=c?u.for||u:u&&u.withoutSetter||a;e.exports=function(e){return i(l,e)||(l[e]=s&&i(u,e)?u[e]:d("Symbol."+e)),l[e]}},8229:function(e,t,r){"use strict";var n=r(9590),o=RangeError;e.exports=function(e,t){var r=n(e);if(r%t)throw new o("Wrong offset");return r}},8242:function(e,t,r){"use strict";var n=r(9565),o=r(7751),i=r(8227),a=r(6840);e.exports=function(){var e=o("Symbol"),t=e&&e.prototype,r=t&&t.valueOf,s=i("toPrimitive");t&&!t[s]&&a(t,s,(function(e){return n(r,this)}),{arity:1})}},8252:function(e,t,r){"use strict";e.exports=a;var n=r(1344);((a.prototype=Object.create(n.prototype)).constructor=a).className="MapField";var o=r(361),i=r(3262);function a(e,t,r,o,a,s){if(n.call(this,e,t,o,void 0,void 0,a,s),!i.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===o.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"==typeof r?r=i.decorateType(r).name:r&&"object"==typeof r&&(r=i.decorateEnum(r).name),function(n,o){i.decorateType(n.constructor).add(new a(o,e,t,r))}}},8265:function(e){"use strict";var t=function(){this.head=null,this.tail=null};t.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},e.exports=t},8309:function(e,t,r){"use strict";r(4359)},8319:function(e){"use strict";var t=Math.round;e.exports=function(e){var r=t(e);return r<0?0:r>255?255:255&r}},8345:function(e,t,r){"use strict";var n=r(2805);(0,r(4644).exportTypedArrayStaticMethod)("from",r(3251),n)},8363:function(e,t,r){"use strict";var n=r(9565),o=r(9504),i=r(9228),a=r(8551),s=r(34),c=r(7750),u=r(2293),l=r(7829),d=r(8014),p=r(655),h=r(5966),f=r(6682),m=r(8429),v=r(9039),g=m.UNSUPPORTED_Y,y=Math.min,E=o([].push),_=o("".slice),T=!v((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),I="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;i("split",(function(e,t,r){var o="0".split(void 0,0).length?function(e,r){return void 0===e&&0===r?[]:n(t,this,e,r)}:t;return[function(t,r){var i=c(this),a=s(t)?h(t,e):void 0;return a?n(a,t,i,r):n(o,p(i),t,r)},function(e,n){var i=a(this),s=p(e);if(!I){var c=r(o,i,s,n,o!==t);if(c.done)return c.value}var h=u(i,RegExp),m=i.unicode,v=(i.ignoreCase?"i":"")+(i.multiline?"m":"")+(i.unicode?"u":"")+(g?"g":"y"),T=new h(g?"^(?:"+i.source+")":i,v),O=void 0===n?4294967295:n>>>0;if(0===O)return[];if(0===s.length)return null===f(T,s)?[s]:[];for(var R=0,S=0,b=[];S<s.length;){T.lastIndex=g?0:S;var C,N=f(T,g?_(s,S):s);if(null===N||(C=y(d(T.lastIndex+(g?S:0)),s.length))===R)S=l(s,S,m);else{if(E(b,_(s,R,S)),b.length===O)return b;for(var A=1;A<=N.length-1;A++)if(E(b,N[A]),b.length===O)return b;S=R=C}}return E(b,_(s,R)),b}]}),I||!T,g)},8379:function(e,t,r){"use strict";var n=r(8745),o=r(5397),i=r(1291),a=r(6198),s=r(4598),c=Math.min,u=[].lastIndexOf,l=!!u&&1/[1].lastIndexOf(1,-0)<0,d=s("lastIndexOf"),p=l||!d;e.exports=p?function(e){if(l)return n(u,this,arguments)||0;var t=o(this),r=a(t);if(0===r)return-1;var s=r-1;for(arguments.length>1&&(s=c(s,i(arguments[1]))),s<0&&(s=r+s);s>=0;s--)if(s in t&&t[s]===e)return s||0;return-1}:u},8406:function(e,t,r){"use strict";r(3792),r(7337);var n=r(6518),o=r(4576),i=r(3389),a=r(7751),s=r(9565),c=r(9504),u=r(3724),l=r(7416),d=r(6840),p=r(2106),h=r(6279),f=r(687),m=r(3994),v=r(1181),g=r(679),y=r(4901),E=r(9297),_=r(6080),T=r(6955),I=r(8551),O=r(34),R=r(655),S=r(2360),b=r(6980),C=r(81),N=r(851),A=r(2529),M=r(2812),w=r(8227),U=r(4488),L=w("iterator"),P="URLSearchParams",x=P+"Iterator",k=v.set,D=v.getterFor(P),B=v.getterFor(x),j=i("fetch"),G=i("Request"),H=i("Headers"),F=G&&G.prototype,q=H&&H.prototype,W=o.TypeError,z=o.encodeURIComponent,K=String.fromCharCode,V=a("String","fromCodePoint"),J=parseInt,Y=c("".charAt),X=c([].join),Q=c([].push),$=c("".replace),Z=c([].shift),ee=c([].splice),te=c("".split),re=c("".slice),ne=c(/./.exec),oe=/\+/g,ie=/^[0-9a-f]+$/i,ae=function(e,t){var r=re(e,t,t+2);return ne(ie,r)?J(r,16):NaN},se=function(e){for(var t=0,r=128;r>0&&0!==(e&r);r>>=1)t++;return t},ce=function(e){var t=null;switch(e.length){case 1:t=e[0];break;case 2:t=(31&e[0])<<6|63&e[1];break;case 3:t=(15&e[0])<<12|(63&e[1])<<6|63&e[2];break;case 4:t=(7&e[0])<<18|(63&e[1])<<12|(63&e[2])<<6|63&e[3]}return t>1114111?null:t},ue=function(e){for(var t=(e=$(e,oe," ")).length,r="",n=0;n<t;){var o=Y(e,n);if("%"===o){if("%"===Y(e,n+1)||n+3>t){r+="%",n++;continue}var i=ae(e,n+1);if(i!=i){r+=o,n++;continue}n+=2;var a=se(i);if(0===a)o=K(i);else{if(1===a||a>4){r+="�",n++;continue}for(var s=[i],c=1;c<a&&!(3+ ++n>t||"%"!==Y(e,n));){var u=ae(e,n+1);if(u!=u){n+=3;break}if(u>191||u<128)break;Q(s,u),n+=2,c++}if(s.length!==a){r+="�";continue}var l=ce(s);null===l?r+="�":o=V(l)}}r+=o,n++}return r},le=/[!'()~]|%20/g,de={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},pe=function(e){return de[e]},he=function(e){return $(z(e),le,pe)},fe=m((function(e,t){k(this,{type:x,target:D(e).entries,index:0,kind:t})}),P,(function(){var e=B(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,A(void 0,!0);var n=t[r];switch(e.kind){case"keys":return A(n.key,!1);case"values":return A(n.value,!1)}return A([n.key,n.value],!1)}),!0),me=function(e){this.entries=[],this.url=null,void 0!==e&&(O(e)?this.parseObject(e):this.parseQuery("string"==typeof e?"?"===Y(e,0)?re(e,1):e:R(e)))};me.prototype={type:P,bindURL:function(e){this.url=e,this.update()},parseObject:function(e){var t,r,n,o,i,a,c,u=this.entries,l=N(e);if(l)for(r=(t=C(e,l)).next;!(n=s(r,t)).done;){if(i=(o=C(I(n.value))).next,(a=s(i,o)).done||(c=s(i,o)).done||!s(i,o).done)throw new W("Expected sequence with length 2");Q(u,{key:R(a.value),value:R(c.value)})}else for(var d in e)E(e,d)&&Q(u,{key:d,value:R(e[d])})},parseQuery:function(e){if(e)for(var t,r,n=this.entries,o=te(e,"&"),i=0;i<o.length;)(t=o[i++]).length&&(r=te(t,"="),Q(n,{key:ue(Z(r)),value:ue(X(r,"="))}))},serialize:function(){for(var e,t=this.entries,r=[],n=0;n<t.length;)e=t[n++],Q(r,he(e.key)+"="+he(e.value));return X(r,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var ve=function(){g(this,ge);var e=k(this,new me(arguments.length>0?arguments[0]:void 0));u||(this.size=e.entries.length)},ge=ve.prototype;if(h(ge,{append:function(e,t){var r=D(this);M(arguments.length,2),Q(r.entries,{key:R(e),value:R(t)}),u||this.length++,r.updateURL()},delete:function(e){for(var t=D(this),r=M(arguments.length,1),n=t.entries,o=R(e),i=r<2?void 0:arguments[1],a=void 0===i?i:R(i),s=0;s<n.length;){var c=n[s];if(c.key!==o||void 0!==a&&c.value!==a)s++;else if(ee(n,s,1),void 0!==a)break}u||(this.size=n.length),t.updateURL()},get:function(e){var t=D(this).entries;M(arguments.length,1);for(var r=R(e),n=0;n<t.length;n++)if(t[n].key===r)return t[n].value;return null},getAll:function(e){var t=D(this).entries;M(arguments.length,1);for(var r=R(e),n=[],o=0;o<t.length;o++)t[o].key===r&&Q(n,t[o].value);return n},has:function(e){for(var t=D(this).entries,r=M(arguments.length,1),n=R(e),o=r<2?void 0:arguments[1],i=void 0===o?o:R(o),a=0;a<t.length;){var s=t[a++];if(s.key===n&&(void 0===i||s.value===i))return!0}return!1},set:function(e,t){var r=D(this);M(arguments.length,1);for(var n,o=r.entries,i=!1,a=R(e),s=R(t),c=0;c<o.length;c++)(n=o[c]).key===a&&(i?ee(o,c--,1):(i=!0,n.value=s));i||Q(o,{key:a,value:s}),u||(this.size=o.length),r.updateURL()},sort:function(){var e=D(this);U(e.entries,(function(e,t){return e.key>t.key?1:-1})),e.updateURL()},forEach:function(e){for(var t,r=D(this).entries,n=_(e,arguments.length>1?arguments[1]:void 0),o=0;o<r.length;)n((t=r[o++]).value,t.key,this)},keys:function(){return new fe(this,"keys")},values:function(){return new fe(this,"values")},entries:function(){return new fe(this,"entries")}},{enumerable:!0}),d(ge,L,ge.entries,{name:"entries"}),d(ge,"toString",(function(){return D(this).serialize()}),{enumerable:!0}),u&&p(ge,"size",{get:function(){return D(this).entries.length},configurable:!0,enumerable:!0}),f(ve,P),n({global:!0,constructor:!0,forced:!l},{URLSearchParams:ve}),!l&&y(H)){var ye=c(q.has),Ee=c(q.set),_e=function(e){if(O(e)){var t,r=e.body;if(T(r)===P)return t=e.headers?new H(e.headers):new H,ye(t,"content-type")||Ee(t,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),S(e,{body:b(0,R(r)),headers:b(0,t)})}return e};if(y(j)&&n({global:!0,enumerable:!0,dontCallGetSet:!0,forced:!0},{fetch:function(e){return j(e,arguments.length>1?_e(arguments[1]):{})}}),y(G)){var Te=function(e){return g(this,F),new G(e,arguments.length>1?_e(arguments[1]):{})};F.constructor=Te,Te.prototype=F,n({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:Te})}}e.exports={URLSearchParams:ve,getState:D}},8408:function(e,t,r){"use strict";r(8406)},8429:function(e,t,r){"use strict";var n=r(9039),o=r(4576).RegExp,i=n((function(){var e=o("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=i||n((function(){return!o("a","y").sticky})),s=i||n((function(){var e=o("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));e.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:i}},8480:function(e,t,r){"use strict";var n=r(1828),o=r(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},8490:function(e){"use strict";var t=Array,r=Math.abs,n=Math.pow,o=Math.floor,i=Math.log,a=Math.LN2;e.exports={pack:function(e,s,c){var u,l,d,p=t(c),h=8*c-s-1,f=(1<<h)-1,m=f>>1,v=23===s?n(2,-24)-n(2,-77):0,g=e<0||0===e&&1/e<0?1:0,y=0;for((e=r(e))!=e||e===1/0?(l=e!=e?1:0,u=f):(u=o(i(e)/a),e*(d=n(2,-u))<1&&(u--,d*=2),(e+=u+m>=1?v/d:v*n(2,1-m))*d>=2&&(u++,d/=2),u+m>=f?(l=0,u=f):u+m>=1?(l=(e*d-1)*n(2,s),u+=m):(l=e*n(2,m-1)*n(2,s),u=0));s>=8;)p[y++]=255&l,l/=256,s-=8;for(u=u<<s|l,h+=s;h>0;)p[y++]=255&u,u/=256,h-=8;return p[y-1]|=128*g,p},unpack:function(e,t){var r,o=e.length,i=8*o-t-1,a=(1<<i)-1,s=a>>1,c=i-7,u=o-1,l=e[u--],d=127&l;for(l>>=7;c>0;)d=256*d+e[u--],c-=8;for(r=d&(1<<-c)-1,d>>=-c,c+=t;c>0;)r=256*r+e[u--],c-=8;if(0===d)d=1-s;else{if(d===a)return r?NaN:l?-1/0:1/0;r+=n(2,t),d-=s}return(l?-1:1)*r*n(2,d-t)}}},8523:function(e,t,r){"use strict";r(6468)("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(6938))},8551:function(e,t,r){"use strict";var n=r(34),o=String,i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not an object")}},8561:function(e){"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function o(e){if("string"!=typeof e){var r=i();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var a=Object.keys(e),s=new Array(a.length+1),c=new Array(a.length),u=0;u<a.length;)s[u]=a[u],c[u]=e[a[u++]];return s[u]=r,Function.apply(null,s).apply(null,c)}return Function(r)()}for(var l=new Array(arguments.length-1),d=0;d<l.length;)l[d]=arguments[++d];if(d=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=l[d++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),d!==l.length)throw Error("parameter count mismatch");return n.push(e),o}function i(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return o.toString=i,o}e.exports=t,t.verbose=!1},8570:function(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 n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var o={},i={};function a(e,t){var r,n,a;return t?(a=0<=(e>>>=0)&&e<256)&&(n=i[e])?n:(r=c(e,(0|e)<0?-1:0,!0),a&&(i[e]=r),r):(a=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=c(e,e<0?-1:0,!1),a&&(o[e]=r),r)}function s(e,t){if(isNaN(e))return t?g:v;if(t){if(e<0)return g;if(e>=h)return I}else{if(e<=-f)return O;if(e+1>=f)return T}return e<0?s(-e,t).neg():c(e%p|0,e/p|0,t)}function c(e,t,n){return new r(e,t,n)}r.fromInt=a,r.fromNumber=s,r.fromBits=c;var u=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return v;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return l(e.substring(1),t,r).neg();for(var o=s(u(r,8)),i=v,a=0;a<e.length;a+=8){var c=Math.min(8,e.length-a),d=parseInt(e.substring(a,a+c),r);if(c<8){var p=s(u(r,c));i=i.mul(p).add(s(d))}else i=(i=i.mul(o)).add(s(d))}return i.unsigned=t,i}function d(e,t){return"number"==typeof e?s(e,t):"string"==typeof e?l(e,t):c(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=d;var p=4294967296,h=p*p,f=h/2,m=a(1<<24),v=a(0);r.ZERO=v;var g=a(0,!0);r.UZERO=g;var y=a(1);r.ONE=y;var E=a(1,!0);r.UONE=E;var _=a(-1);r.NEG_ONE=_;var T=c(-1,2147483647,!1);r.MAX_VALUE=T;var I=c(-1,-1,!0);r.MAX_UNSIGNED_VALUE=I;var O=c(0,-2147483648,!1);r.MIN_VALUE=O;var R=r.prototype;R.toInt=function(){return this.unsigned?this.low>>>0:this.low},R.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},R.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){var t=s(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var o=s(u(e,6),this.unsigned),i=this,a="";;){var c=i.div(o),l=(i.sub(c.mul(o)).toInt()>>>0).toString(e);if((i=c).isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}},R.getHighBits=function(){return this.high},R.getHighBitsUnsigned=function(){return this.high>>>0},R.getLowBits=function(){return this.low},R.getLowBitsUnsigned=function(){return this.low>>>0},R.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&!(e&1<<t);t--);return 0!=this.high?t+33:t+1},R.isZero=function(){return 0===this.high&&0===this.low},R.eqz=R.isZero,R.isNegative=function(){return!this.unsigned&&this.high<0},R.isPositive=function(){return this.unsigned||this.high>=0},R.isOdd=function(){return!(1&~this.low)},R.isEven=function(){return!(1&this.low)},R.equals=function(e){return n(e)||(e=d(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},R.eq=R.equals,R.notEquals=function(e){return!this.eq(e)},R.neq=R.notEquals,R.ne=R.notEquals,R.lessThan=function(e){return this.comp(e)<0},R.lt=R.lessThan,R.lessThanOrEqual=function(e){return this.comp(e)<=0},R.lte=R.lessThanOrEqual,R.le=R.lessThanOrEqual,R.greaterThan=function(e){return this.comp(e)>0},R.gt=R.greaterThan,R.greaterThanOrEqual=function(e){return this.comp(e)>=0},R.gte=R.greaterThanOrEqual,R.ge=R.greaterThanOrEqual,R.compare=function(e){if(n(e)||(e=d(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},R.comp=R.compare,R.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(y)},R.neg=R.negate,R.add=function(e){n(e)||(e=d(e));var t=this.high>>>16,r=65535&this.high,o=this.low>>>16,i=65535&this.low,a=e.high>>>16,s=65535&e.high,u=e.low>>>16,l=0,p=0,h=0,f=0;return h+=(f+=i+(65535&e.low))>>>16,p+=(h+=o+u)>>>16,l+=(p+=r+s)>>>16,l+=t+a,c((h&=65535)<<16|(f&=65535),(l&=65535)<<16|(p&=65535),this.unsigned)},R.subtract=function(e){return n(e)||(e=d(e)),this.add(e.neg())},R.sub=R.subtract,R.multiply=function(e){if(this.isZero())return v;if(n(e)||(e=d(e)),t)return c(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return v;if(this.eq(O))return e.isOdd()?O:v;if(e.eq(O))return this.isOdd()?O:v;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 s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,o=65535&this.high,i=this.low>>>16,a=65535&this.low,u=e.high>>>16,l=65535&e.high,p=e.low>>>16,h=65535&e.low,f=0,g=0,y=0,E=0;return y+=(E+=a*h)>>>16,g+=(y+=i*h)>>>16,y&=65535,g+=(y+=a*p)>>>16,f+=(g+=o*h)>>>16,g&=65535,f+=(g+=i*p)>>>16,g&=65535,f+=(g+=a*l)>>>16,f+=r*h+o*p+i*l+a*u,c((y&=65535)<<16|(E&=65535),(f&=65535)<<16|(g&=65535),this.unsigned)},R.mul=R.multiply,R.divide=function(e){if(n(e)||(e=d(e)),e.isZero())throw Error("division by zero");var r,o,i;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?c((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?g:v;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return E;i=g}else{if(this.eq(O))return e.eq(y)||e.eq(_)?O:e.eq(O)?y:(r=this.shr(1).div(e).shl(1)).eq(v)?e.isNegative()?y:_:(o=this.sub(e.mul(r)),i=r.add(o.div(e)));if(e.eq(O))return this.unsigned?g:v;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=v}for(o=this;o.gte(e);){r=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(r)/Math.LN2),l=a<=48?1:u(2,a-48),p=s(r),h=p.mul(e);h.isNegative()||h.gt(o);)h=(p=s(r-=l,this.unsigned)).mul(e);p.isZero()&&(p=y),i=i.add(p),o=o.sub(h)}return i},R.div=R.divide,R.modulo=function(e){return n(e)||(e=d(e)),t?c((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))},R.mod=R.modulo,R.rem=R.modulo,R.not=function(){return c(~this.low,~this.high,this.unsigned)},R.and=function(e){return n(e)||(e=d(e)),c(this.low&e.low,this.high&e.high,this.unsigned)},R.or=function(e){return n(e)||(e=d(e)),c(this.low|e.low,this.high|e.high,this.unsigned)},R.xor=function(e){return n(e)||(e=d(e)),c(this.low^e.low,this.high^e.high,this.unsigned)},R.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):c(0,this.low<<e-32,this.unsigned)},R.shl=R.shiftLeft,R.shiftRight=function(e){return n(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?c(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):c(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},R.shr=R.shiftRight,R.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0==(e&=63))return this;var t=this.high;return e<32?c(this.low>>>e|t<<32-e,t>>>e,this.unsigned):c(32===e?t:t>>>e-32,0,this.unsigned)},R.shru=R.shiftRightUnsigned,R.shr_u=R.shiftRightUnsigned,R.toSigned=function(){return this.unsigned?c(this.low,this.high,!1):this},R.toUnsigned=function(){return this.unsigned?this:c(this.low,this.high,!0)},R.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},R.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},R.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,n){return n?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)}},8598:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(7055),a=r(5397),s=r(4598),c=o([].join);n({target:"Array",proto:!0,forced:i!==Object||!s("join",",")},{join:function(e){return c(a(this),void 0===e?",":e)}})},8622:function(e,t,r){"use strict";var n=r(4576),o=r(4901),i=n.WeakMap;e.exports=o(i)&&/native code/.test(String(i))},8686:function(e,t,r){"use strict";var n=r(3724),o=r(9039);e.exports=n&&o((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8706:function(e,t,r){"use strict";var n=r(6518),o=r(9039),i=r(4376),a=r(34),s=r(8981),c=r(6198),u=r(6837),l=r(4659),d=r(1469),p=r(597),h=r(8227),f=r(9519),m=h("isConcatSpreadable"),v=f>=51||!o((function(){var e=[];return e[m]=!1,e.concat()[0]!==e})),g=function(e){if(!a(e))return!1;var t=e[m];return void 0!==t?!!t:i(e)};n({target:"Array",proto:!0,arity:1,forced:!v||!p("concat")},{concat:function(e){var t,r,n,o,i,a=s(this),p=d(a,0),h=0;for(t=-1,n=arguments.length;t<n;t++)if(g(i=-1===t?a:arguments[t]))for(o=c(i),u(h+o),r=0;r<o;r++,h++)r in i&&l(p,h,i[r]);else u(h+1),l(p,h++,i);return p.length=h,p}})},8727:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:function(e,t,r){"use strict";var n=r(616),o=Function.prototype,i=o.apply,a=o.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},8747:function(e,t,r){"use strict";var n=r(4644),o=n.aTypedArray,i=n.exportTypedArrayMethod,a=Math.floor;i("reverse",(function(){for(var e,t=this,r=o(t).length,n=a(r/2),i=0;i<n;)e=t[i],t[i++]=t[--r],t[r]=e;return t}))},8773:function(e,t){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!r.call({1:2},1);t.f=o?function(e){var t=n(this,e);return!!t&&t.enumerable}:r},8781:function(e,t,r){"use strict";var n=r(350).PROPER,o=r(6840),i=r(8551),a=r(655),s=r(9039),c=r(1034),u="toString",l=RegExp.prototype,d=l[u],p=s((function(){return"/a/b"!==d.call({source:"a",flags:"b"})})),h=n&&d.name!==u;(p||h)&&o(l,u,(function(){var e=i(this);return"/"+a(e.source)+"/"+a(c(e))}),{unsafe:!0})},8811:function(e,t,r){"use strict";e.exports=i;var n=r(7209);((i.prototype=Object.create(n.prototype)).constructor=i).className="Method";var o=r(3262);function i(e,t,r,i,a,s,c,u,l){if(o.isObject(a)?(c=a,a=s=void 0):o.isObject(s)&&(c=s,s=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,c),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||void 0,this.responseType=i,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=l}i.fromJSON=function(e,t){return new i(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},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,"parsedOptions",this.parsedOptions])},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))}},8814:function(e,t,r){"use strict";var n=r(9039),o=r(4576).RegExp;e.exports=n((function(){var e=o("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))},8839:function(e,t){"use strict";var r=t;r.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 n=new Array(64),o=new Array(123),i=0;i<64;)o[n[i]=i<26?i+65:i<52?i+71:i<62?i-4:i-59|43]=i++;r.encode=function(e,t,r){for(var o,i=null,a=[],s=0,c=0;t<r;){var u=e[t++];switch(c){case 0:a[s++]=n[u>>2],o=(3&u)<<4,c=1;break;case 1:a[s++]=n[o|u>>4],o=(15&u)<<2,c=2;break;case 2:a[s++]=n[o|u>>6],a[s++]=n[63&u],c=0}s>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),s=0)}return c&&(a[s++]=n[o],a[s++]=61,1===c&&(a[s++]=61)),i?(s&&i.push(String.fromCharCode.apply(String,a.slice(0,s))),i.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";r.decode=function(e,t,r){for(var n,i=r,s=0,c=0;c<e.length;){var u=e.charCodeAt(c++);if(61===u&&s>1)break;if(void 0===(u=o[u]))throw Error(a);switch(s){case 0:n=u,s=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,s=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,s=3;break;case 3:t[r++]=(3&n)<<6|u,s=0}}if(1===s)throw Error(a);return r-i},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},8845:function(e,t,r){"use strict";var n=r(4576),o=r(9565),i=r(4644),a=r(6198),s=r(8229),c=r(8981),u=r(9039),l=n.RangeError,d=n.Int8Array,p=d&&d.prototype,h=p&&p.set,f=i.aTypedArray,m=i.exportTypedArrayMethod,v=!u((function(){var e=new Uint8ClampedArray(2);return o(h,e,{length:1,0:3},1),3!==e[1]})),g=v&&i.NATIVE_ARRAY_BUFFER_VIEWS&&u((function(){var e=new d(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));m("set",(function(e){f(this);var t=s(arguments.length>1?arguments[1]:void 0,1),r=c(e);if(v)return o(h,this,r,t);var n=this.length,i=a(r),u=0;if(i+t>n)throw new l("Wrong length");for(;u<i;)this[t+u]=r[u++]}),!v||g)},8921:function(e,t,r){"use strict";var n=r(6518),o=r(8379);n({target:"Array",proto:!0,forced:o!==[].lastIndexOf},{lastIndexOf:o})},8923:function(e,t,r){"use strict";e.exports=d;var n=r(7209);((d.prototype=Object.create(n.prototype)).constructor=d).className="Namespace";var o,i,a,s=r(1344),c=r(1457),u=r(3262);function l(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function d(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function p(e){return e._nestedArray=null,e}d.fromJSON=function(e,t){return new d(e,t.options).addJSON(t.nested)},d.arrayToJSON=l,d.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},d.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(d.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),d.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},d.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?o.fromJSON:void 0!==t.values?a.fromJSON:void 0!==t.methods?i.fromJSON:void 0!==t.id?s.fromJSON:d.fromJSON)(r[n],t));return this},d.prototype.get=function(e){return this.nested&&this.nested[e]||null},d.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof a)return this.nested[e].values;throw Error("no such enum: "+e)},d.prototype.add=function(e){if(!(e instanceof s&&void 0!==e.extend||e instanceof o||e instanceof a||e instanceof i||e instanceof d||e instanceof c))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof d&&e instanceof d)||t instanceof o||t instanceof i)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),p(this)},d.prototype.remove=function(e){if(!(e instanceof n))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),p(this)},d.prototype.define=function(e,t){if(u.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 n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof d))throw Error("path conflicts with non-namespace objects")}else r.add(r=new d(n))}return t&&r.addJSON(t),r},d.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof d?e[t++].resolveAll():e[t++].resolve();return this.resolve()},d.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.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 n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof d&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var o=0;o<this.nestedArray.length;++o)if(this._nestedArray[o]instanceof d&&(n=this._nestedArray[o].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},d.prototype.lookupType=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such type: "+e);return t},d.prototype.lookupEnum=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},d.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[o,a]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},d.prototype.lookupService=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},d._configure=function(e,t,r){o=e,i=t,a=r}},8940:function(e,t,r){"use strict";var n=r(6518),o=r(2703);n({global:!0,forced:parseInt!==o},{parseInt:o})},8980:function(e,t,r){"use strict";var n=r(6518),o=r(9213).findIndex,i=r(6469),a="findIndex",s=!0;a in[]&&Array(1)[a]((function(){s=!1})),n({target:"Array",proto:!0,forced:s},{findIndex:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i(a)},8981:function(e,t,r){"use strict";var n=r(7750),o=Object;e.exports=function(e){return o(n(e))}},8995:function(e,t,r){"use strict";var n=r(4644),o=r(9213).map,i=n.aTypedArray,a=n.getTypedArrayConstructor;(0,n.exportTypedArrayMethod)("map",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(a(e))(t)}))}))},9039:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(e){return!0}}},9085:function(e,t,r){"use strict";var n=r(6518),o=r(4213);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},9089:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=Date,a=o(i.prototype.getTime);n({target:"Date",stat:!0},{now:function(){return a(new i)}})},9100:function(e,t,r){"use strict";var n=e.exports=r(5325);n.build="full",n.tokenize=r(527),n.parse=r(4863),n.common=r(5095),n.Root._configure(n.Type,n.parse,n.common)},9167:function(e,t,r){"use strict";var n=r(4576);e.exports=n},9207:function(e,t){"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},o=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),o="";r&&(o=t.shift()+"/");for(var i=0;i<t.length;)".."===t[i]?i>0&&".."!==t[i-1]?t.splice(--i,2):r?t.splice(i,1):++i:"."===t[i]?t.splice(i,1):++i;return o+t.join("/")};r.resolve=function(e,t,r){return r||(t=o(t)),n(t)?t:(r||(e=o(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?o(e+"/"+t):t)}},9213:function(e,t,r){"use strict";var n=r(6080),o=r(9504),i=r(7055),a=r(8981),s=r(6198),c=r(1469),u=o([].push),l=function(e){var t=1===e,r=2===e,o=3===e,l=4===e,d=6===e,p=7===e,h=5===e||d;return function(f,m,v,g){for(var y,E,_=a(f),T=i(_),I=s(T),O=n(m,v),R=0,S=g||c,b=t?S(f,I):r||p?S(f,0):void 0;I>R;R++)if((h||R in T)&&(E=O(y=T[R],R,_),e))if(t)b[R]=E;else if(E)switch(e){case 3:return!0;case 5:return y;case 6:return R;case 2:u(b,y)}else switch(e){case 4:return!1;case 7:u(b,y)}return d?-1:o||l?l:b}};e.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6),filterReject:l(7)}},9225:function(e,t,r){"use strict";var n,o,i,a,s=r(4576),c=r(8745),u=r(6080),l=r(4901),d=r(9297),p=r(9039),h=r(397),f=r(7680),m=r(4055),v=r(2812),g=r(9544),y=r(6193),E=s.setImmediate,_=s.clearImmediate,T=s.process,I=s.Dispatch,O=s.Function,R=s.MessageChannel,S=s.String,b=0,C={},N="onreadystatechange";p((function(){n=s.location}));var A=function(e){if(d(C,e)){var t=C[e];delete C[e],t()}},M=function(e){return function(){A(e)}},w=function(e){A(e.data)},U=function(e){s.postMessage(S(e),n.protocol+"//"+n.host)};E&&_||(E=function(e){v(arguments.length,1);var t=l(e)?e:O(e),r=f(arguments,1);return C[++b]=function(){c(t,void 0,r)},o(b),b},_=function(e){delete C[e]},y?o=function(e){T.nextTick(M(e))}:I&&I.now?o=function(e){I.now(M(e))}:R&&!g?(a=(i=new R).port2,i.port1.onmessage=w,o=u(a.postMessage,a)):s.addEventListener&&l(s.postMessage)&&!s.importScripts&&n&&"file:"!==n.protocol&&!p(U)?(o=U,s.addEventListener("message",w,!1)):o=N in m("script")?function(e){h.appendChild(m("script"))[N]=function(){h.removeChild(this),A(e)}}:function(e){setTimeout(M(e),0)}),e.exports={set:E,clear:_}},9228:function(e,t,r){"use strict";r(7495);var n=r(9565),o=r(6840),i=r(7323),a=r(9039),s=r(8227),c=r(6699),u=s("species"),l=RegExp.prototype;e.exports=function(e,t,r,d){var p=s(e),h=!a((function(){var t={};return t[p]=function(){return 7},7!==""[e](t)})),f=h&&!a((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[u]=function(){return r},r.flags="",r[p]=/./[p]),r.exec=function(){return t=!0,null},r[p](""),!t}));if(!h||!f||r){var m=/./[p],v=t(p,""[e],(function(e,t,r,o,a){var s=t.exec;return s===i||s===l.exec?h&&!a?{done:!0,value:n(m,t,r,o)}:{done:!0,value:n(e,r,t,o)}:{done:!1}}));o(String.prototype,e,v[0]),o(l,p,v[1])}d&&c(l[p],"sham",!0)}},9296:function(e,t,r){"use strict";var n=r(4055)("span").classList,o=n&&n.constructor&&n.constructor.prototype;e.exports=o===Object.prototype?void 0:o},9297:function(e,t,r){"use strict";var n=r(9504),o=r(8981),i=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(o(e),t)}},9306:function(e,t,r){"use strict";var n=r(4901),o=r(6823),i=TypeError;e.exports=function(e){if(n(e))return e;throw new i(o(e)+" is not a function")}},9369:function(e,t,r){"use strict";var n=r(4644),o=r(9504),i=n.aTypedArray,a=n.exportTypedArrayMethod,s=o([].join);a("join",(function(e){return s(i(this),e)}))},9390:function(e){"use strict";e.exports=function(e,t,r){var n=r||8192,o=n>>>1,i=null,a=n;return function(r){if(r<1||r>o)return e(r);a+r>n&&(i=e(n),a=0);var s=t.call(i,a,a+=r);return 7&a&&(a=1+(7|a)),s}}},9410:function(e){"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3]}function i(e,n,o){t[0]=e,n[o]=r[3],n[o+1]=r[2],n[o+2]=r[1],n[o+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?o:i,e.writeFloatBE=n?i:o,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function t(e,t,r,n){var o=t<0?1:0;if(o&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((o<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((o<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var i=Math.floor(Math.log(t)/Math.LN2);e((o<<31|i+127<<23|8388607&Math.round(t*Math.pow(2,-i)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),o=2*(n>>31)+1,i=n>>>23&255,a=8388607&n;return 255===i?a?NaN:o*(1/0):0===i?1401298464324817e-60*o*a:o*Math.pow(2,i-150)*(a+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=a.bind(null,o),e.readFloatBE=a.bind(null,i)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function o(e,n,o){t[0]=e,n[o]=r[0],n[o+1]=r[1],n[o+2]=r[2],n[o+3]=r[3],n[o+4]=r[4],n[o+5]=r[5],n[o+6]=r[6],n[o+7]=r[7]}function i(e,n,o){t[0]=e,n[o]=r[7],n[o+1]=r[6],n[o+2]=r[5],n[o+3]=r[4],n[o+4]=r[3],n[o+5]=r[2],n[o+6]=r[1],n[o+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?o:i,e.writeDoubleBE=n?i:o,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function t(e,t,r,n,o,i){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,o,i+t),e(1/n>0?0:2147483648,o,i+r);else if(isNaN(n))e(0,o,i+t),e(2146959360,o,i+r);else if(n>17976931348623157e292)e(0,o,i+t),e((a<<31|2146435072)>>>0,o,i+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,o,i+t),e((a<<31|s/4294967296)>>>0,o,i+r);else{var c=Math.floor(Math.log(n)/Math.LN2);1024===c&&(c=1023),e(4503599627370496*(s=n*Math.pow(2,-c))>>>0,o,i+t),e((a<<31|c+1023<<20|1048576*s&1048575)>>>0,o,i+r)}}}function a(e,t,r,n,o){var i=e(n,o+t),a=e(n,o+r),s=2*(a>>31)+1,c=a>>>20&2047,u=4294967296*(1048575&a)+i;return 2047===c?u?NaN:s*(1/0):0===c?5e-324*s*u:s*Math.pow(2,c-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=a.bind(null,o,0,4),e.readDoubleBE=a.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 n(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 o(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)},9423:function(e,t,r){"use strict";var n=r(4644),o=r(9039),i=r(7680),a=n.aTypedArray,s=n.getTypedArrayConstructor;(0,n.exportTypedArrayMethod)("slice",(function(e,t){for(var r=i(a(this),e,t),n=s(this),o=0,c=r.length,u=new n(c);c>o;)u[o]=r[o++];return u}),o((function(){new Int8Array(1).slice()})))},9432:function(e,t,r){"use strict";var n=r(6518),o=r(8981),i=r(1072);n({target:"Object",stat:!0,forced:r(9039)((function(){i(1)}))},{keys:function(e){return i(o(e))}})},9433:function(e,t,r){"use strict";var n=r(4576),o=Object.defineProperty;e.exports=function(e,t){try{o(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},9449:function(e,t,r){"use strict";var n,o=r(6518),i=r(7476),a=r(7347).f,s=r(8014),c=r(655),u=r(5749),l=r(7750),d=r(1436),p=r(6395),h=i("".slice),f=Math.min,m=d("endsWith");o({target:"String",proto:!0,forced:!(!p&&!m&&(n=a(String.prototype,"endsWith"),n&&!n.writable)||m)},{endsWith:function(e){var t=c(l(this));u(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,o=void 0===r?n:f(s(r),n),i=c(e);return h(t,o-i.length,o)===i}})},9463:function(e,t,r){"use strict";var n=r(6518),o=r(3724),i=r(4576),a=r(9504),s=r(9297),c=r(4901),u=r(1625),l=r(655),d=r(2106),p=r(7740),h=i.Symbol,f=h&&h.prototype;if(o&&c(h)&&(!("description"in f)||void 0!==h().description)){var m={},v=function(){var e=arguments.length<1||void 0===arguments[0]?void 0:l(arguments[0]),t=u(f,this)?new h(e):void 0===e?h():h(e);return""===e&&(m[t]=!0),t};p(v,h),v.prototype=f,f.constructor=v;var g="Symbol(description detection)"===String(h("description detection")),y=a(f.valueOf),E=a(f.toString),_=/^Symbol\((.*)\)[^)]+$/,T=a("".replace),I=a("".slice);d(f,"description",{configurable:!0,get:function(){var e=y(this);if(s(m,e))return"";var t=E(e),r=g?I(t,7,-1):T(t,_,"$1");return""===r?void 0:r}}),n({global:!0,constructor:!0,forced:!0},{Symbol:v})}},9472:function(e,t,r){"use strict";var n,o=r(4576),i=r(8745),a=r(4901),s=r(4215),c=r(2839),u=r(7680),l=r(2812),d=o.Function,p=/MSIE .\./.test(c)||"BUN"===s&&((n=o.Bun.version.split(".")).length<3||"0"===n[0]&&(n[1]<3||"3"===n[1]&&"0"===n[2]));e.exports=function(e,t){var r=t?2:1;return p?function(n,o){var s=l(arguments.length,1)>r,c=a(n)?n:d(n),p=s?u(arguments,r):[],h=s?function(){i(c,this,p)}:c;return t?e(h,o):e(h)}:e}},9504:function(e,t,r){"use strict";var n=r(616),o=Function.prototype,i=o.call,a=n&&o.bind.bind(i,i);e.exports=n?a:function(e){return function(){return i.apply(e,arguments)}}},9519:function(e,t,r){"use strict";var n,o,i=r(4576),a=r(2839),s=i.process,c=i.Deno,u=s&&s.versions||c&&c.version,l=u&&u.v8;l&&(o=(n=l.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),e.exports=o},9539:function(e,t,r){"use strict";var n=r(9565),o=r(8551),i=r(5966);e.exports=function(e,t,r){var a,s;o(e);try{if(!(a=i(e,"return"))){if("throw"===t)throw r;return r}a=n(a,e)}catch(e){s=!0,a=e}if("throw"===t)throw r;if(s)throw a;return o(a),r}},9544:function(e,t,r){"use strict";var n=r(2839);e.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},9565:function(e,t,r){"use strict";var n=r(616),o=Function.prototype.call;e.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},9590:function(e,t,r){"use strict";var n=r(1291),o=RangeError;e.exports=function(e){var t=n(e);if(t<0)throw new o("The argument can't be less than 0");return t}},9617:function(e,t,r){"use strict";var n=r(5397),o=r(5610),i=r(6198),a=function(e){return function(t,r,a){var s=n(t),c=i(s);if(0===c)return!e&&-1;var u,l=o(a,c);if(e&&r!=r){for(;c>l;)if((u=s[l++])!=u)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===r)return e||l||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},9638:function(e){"use strict";var t=4096,r=65547,n=15,o=2113929216,i=65536,a=65536,s=10485760,c={MANUAL:0,AUTO_IMMEDIATE:1,AUTO_THRESHOLD:2},u={SUCCESS:0,FAILED:-1,NOT_INITIALIZED:-2,INITIALIZED_FAILED:-3,COMPRESS_FAILED:-4,DECOMPRESS_FAILED:-5,PARAM_ERROR:-6,BUFFER_RESIZE_FAILED:-7};function l(e){if(!(e>0))return a;if(e<=a)return a;if(e>1073741823)return e;for(var t=a;t<e;)t*=2;return t}var d={byU16:0,byU32:1};function p(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}var h="fast";function f(e){return 2654435761*(e>>>0)>>>20&4095}function m(e){return 2654435761*(e>>>0)>>>19&8191}function v(e,t,r){if("fast"===h){var n=p(e,t);return r===d.byU16?m(n):f(n)}throw new Error("Unsupported hash strategy: "+h)}function g(e,t,r,n,o){r[t]=e-o}function y(e,t,r,n,o){g(t,v(e,t,n),r,0,o)}function E(e,t,r,n){return t[e]+n}function _(e,t,r,n,o){return E(v(e,t,n),r,0,o)}function T(e,t,r,n){for(var o=t;t<n-3;){if(p(e,t)!==p(e,r)){for(;t<n&&e[t]===e[r];)t++,r++;return t-o}t+=4,r+=4}for(;t<n&&e[t]===e[r];)t++,r++;return t-o}function I(e,t,i,a,s,c,u,l,p,h){var f,m,I,b,C,N,A=e.hashTable,M=a,w=M-e.dictSize,U=e.dictionary,L=e.dictionaryStart,P=L+e.dictSize,x=e.dictSize>0?P-a:0,k=a,D=a+s,B=D-12,j=D-5,G=0,H=c>0?c:i.length,F=0;if(s>o)return 0;switch(p){case 0:default:f=a,m=a;break;case 1:f=a-e.currentOffset,m=a-e.dictSize;break;case 2:f=a-e.currentOffset,m=a}if(l===d.byU16&&s>=r)return 0;if(s<13)return S(t,i,k,D,G,H,u);y(t,M,A,l,f),I=v(t,++M,l);e:for(;;){var q,W,z=M,K=1,V=64;do{var J=I;if(M=z,z+=K,K=V++>>>6,z>B)return S(t,i,k,D,G,H,u);q=E(J,A,0,f),2===p&&(q<a?(F=x,m=L):(F=0,m=a)),I=v(t,z,l),g(M,J,A,0,f)}while(1===h&&q<w||l!==d.byU16&&q+65535<M||!O(t,U,M,q,F,p,a));for(;M>k&&q+F>m;){var Y=q+F-1;if(t[M-1]!==(2===p&&q<a?U[Y-L+e.dictionaryStart]:t[Y]))break;M--,q--}var X=M-k;if(W=G++,u&&G+X+8+Math.floor(X/255)>H)return 0;if(X>=n){var Q=X-n;for(i[W]=240;Q>=255;)i[G++]=255,Q-=255;i[G++]=Q}else i[W]=X<<4;if(X>=16&&i.set&&t.subarray)i.set(t.subarray(k,k+X),G),G+=X;else for(var $=0;$<X;$++)i[G++]=t[k+$];t:for(;;){var Z;if(N=M-q,(b=i)[C=G]=255&N,b[C+1]=N>>>8&255,G+=2,2===p&&q<a){var ee=M+(P-(q+F));if(ee>j&&(ee=j),(M+=4+(Z=R(t,U,M+4,q+F+4-L+e.dictionaryStart,ee,P-L)))===ee&&ee<j){var te=T(t,M,a,j);Z+=te,M+=te}}else M+=4+(Z=T(t,M+4,q+4,j));if(u&&G+6+(Z>>>8)>H)return 0;if(Z>=15){for(i[W]+=15,Z-=15;Z>=510;)i[G++]=255,i[G++]=255,Z-=510;Z>=255&&(Z-=255,i[G++]=255),i[G++]=Z}else i[W]+=Z;if(k=M,M>B)break e;if(y(t,M-2,A,l,f),q=_(t,M,A,l,f),2===p&&(q<a?(F=x,m=L):(F=0,m=a)),y(t,M,A,l,f),!((1!==h||q>=w)&&q+65535>=M&&O(t,U,M,q,F,p,a)))break t;i[W=G++]=0}I=v(t,++M,l)}return S(t,i,k,D,G,H,u)}function O(e,t,r,n,o,i,a){return p(e,r)===p(2===i&&n+o<a?t:e,n+o)}function R(e,t,r,n,o,i,a){for(var s=r;n<i&&r<o&&t[n]===e[r];)n++,r++;return r-s}function S(e,t,r,o,i,a,s){var c=o-r;if(s&&i+c+1+Math.floor((c+255-n)/255)>a)return 0;if(c>=n){for(t[i++]=240,c-=n;c>=255;)t[i++]=255,c-=255;t[i++]=c}else t[i++]=c<<4;var u=r,l=o,d=l-u;if(d>=16&&t.set&&e.subarray)t.set(e.subarray(u,l),i),i+=d;else for(var p=u;p<l;p++)t[i++]=e[p];return i}function b(e,t,r,n){var o,i=0;if(n&&t.ip>=r)return-1;do{if(i+=o=e[t.ip++],t.ip>r)return-1;if(i>2147483647)return-1}while(255===o);return i}function C(e,t,r,o,i,a,s,c,u,l,d,p,h){if(null==e)return-1;if(a<0)return-1;var f,m,v=r,g=r+o,y=i,E=i+a,_=i+u,T=d-h,I=p+h,O=h<65536;if(c&&_>E-12&&(_=E-12),0===a)return c||1===o&&0===e[v]?0:-1;if(0===o)return-1;for(;;){var R,S,C,N;if(v>=g)return-(v-r)-1;if((S=(R=e[v++])>>>4)===n){var A=b(e,U={ip:v},g-n,!0);if(v=U.ip,-1===A)return-(v-r)-1;if(y+(S+=A)<y)return-(v-r)-1;if(v+S<v)return-(v-r)-1}if(C=y+S,s&&(C>(c?_:E-12)||v+S>g-8)||!s&&C>E-8){if(c)v+S>g&&(C=y+(S=g-v)),C>E&&(C=E,S=E-y);else{if(!s&&C!==E)return-(v-r)-1;if(s&&(v+S!==g||C>E))return-(v-r)-1}if(S>=16&&t.set&&e.subarray)t.set(e.subarray(v,v+S),y);else for(var M=0;M<S;M++)t[y+M]=e[v+M];if(v+=S,y+=S,!c||C===E||v>=g-2)break;if(!c)break}if(S>=16&&t.set&&e.subarray)t.set(e.subarray(v,v+S),y);else for(M=0;M<S;M++)t[y+M]=e[v+M];if(y=C,(v+=S)+2>g)return-(v-r)-1;var w=(f=e)[m=v]|f[m+1]<<8;if(v+=2,N=C-w,O&&N+h<d)return-(v-r)-1;if(0===w)return-(v-r)-1;if(15==(S=15&R)){var U;if(A=b(e,U={ip:v},g-5+1,!1),v=U.ip,-1===A)return-(v-r)-1;if(y+(S+=A)<y)return-(v-r)-1}if(S+=4,2===l&&N<d){if(y+S>E-5){if(!c)return-(v-r)-1;S=Math.min(S,E-y)}if(S<=d-N){var L=I-(d-N);for(M=0;M<S;M++)t[y+M]=t[L+M];y+=S}else{var P=d-N;for(L=I-P,M=0;M<P;M++)t[y+M]=t[L+M];var x=S-P;if(x>(y+=P)-d)for(var k=d,D=y+x;y<D;)t[y++]=t[k++];else{for(M=0;M<x;M++)t[y+M]=t[d+M];y+=x}}}else{if(N<T)return-(v-r)-1;if(C=y+S,c&&C>E-12){var B=Math.min(S,E-y),j=y+B;if(N+B>y)for(;y<j;)t[y++]=t[N++];else{for(M=0;M<B;M++)t[y+M]=t[N+M];y=j}if(y===E)break}else if(y-N<8)for(t[y]=t[N],t[y+1]=t[N+1],t[y+2]=t[N+2],t[y+3]=t[N+3],y+=4,N+=4;y<C;)t[y++]=t[N++];else for(;y<C;)t[y++]=t[N++]}}return s?y-i:v-r}function N(){return{hashTable:new Uint32Array(t),currentOffset:0,initCheck:0,dictionary:null,dictionaryStart:0,dictSize:0,bufferStart:null}}function A(e){e.hashTable.fill(0),e.currentOffset=0,e.initCheck=0,e.dictionary=null,e.dictionaryStart=0,e.dictSize=0,e.bufferStart=null}function M(e,t,r,n,o,i,a,s){n=n||0,i=i||0;var c=e.dictionaryStart+e.dictSize,u=n;if(e.initCheck)return 0;e.dictSize>0&&u>c&&(u=c),function(e){if(e.currentOffset>2147483648){for(var t=e.currentOffset-65536,r=e.dictionaryStart+e.dictSize,n=0;n<e.hashTable.length;n++)e.hashTable[n]<t?e.hashTable[n]=0:e.hashTable[n]-=t;e.currentOffset=65536,e.dictSize>65536&&(e.dictSize=65536),e.dictionaryStart=r-e.dictSize}}(e);var l,p=n+o;e.dictionary&&p>e.dictionaryStart&&p<c&&(e.dictSize=c-p,e.dictSize>65536&&(e.dictSize=65536),e.dictSize<4&&(e.dictSize=0),e.dictionaryStart=c-e.dictSize);var h=e.dictSize<65536&&e.dictSize<e.currentOffset?1:0;return e.dictionary&&c===n?(l=I(e,t,r,n,o,a||0,s||!1,d.byU32,1,h),e.dictSize+=o,e.currentOffset+=o,l):(l=I(e,t,r,n,o,a||0,s||!1,d.byU32,2,h),e.dictionary=t,e.dictionaryStart=n,e.dictSize=o,e.currentOffset+=o,l)}function w(e,t,r,n){var o=e.dictionaryStart+e.dictSize;n>65536&&(n=65536),n>e.dictSize&&(n=e.dictSize);var i=o-n;if(t.set&&e.dictionary.subarray)t.set(e.dictionary.subarray(i,i+n),r);else for(var a=0;a<n;a++)t[r+a]=e.dictionary[i+a];return e.dictionary=t,e.dictionaryStart=r,e.dictSize=n,n}function U(e,t,r,n){return e.prefixSize=n,e.prefixEnd=r+n,e.externalDict=null,e.extDictStart=0,e.extDictSize=0,1}function L(e,t,r,n,o,i,a){var s;if(e.prefixEnd===i){if((s=C(t,r,n,o,i,a,!0,!1,0,2,e.prefixEnd-e.prefixSize,e.extDictStart,e.extDictSize))<=0)return s;e.prefixSize+=s,e.prefixEnd+=s}else{if(e.extDictSize=e.prefixSize,e.extDictStart=e.prefixEnd-e.extDictSize,(s=C(t,r,n,o,i,a,!0,!1,0,2,i,e.extDictStart,e.extDictSize))<=0)return s;e.prefixSize=s,e.prefixEnd=i+s}return s}function P(e){var t=(e=e||{}).minWorkArea||a,r=e.maxWorkArea||s,n=e.shrinkThreshold||t;t<a&&(t=a),r<t&&(r=t),n<t&&(n=t),n>r&&(n=r),this.minBufferSize=i+t,this.maxBufferSize=i+r,this.shrinkThreshold=i+n,this.ringBufferSize=this.minBufferSize,this.shrinkMode=void 0!==e.shrinkMode?e.shrinkMode:c.MANUAL,this.ringBuffer=new Uint8Array(this.ringBufferSize),this.offset=0,this.stream=N()}function x(e){var t=(e=e||{}).minWorkArea||a,r=e.maxWorkArea||s,n=e.shrinkThreshold||t;t<a&&(t=a),r<t&&(r=t),n<t&&(n=t),n>r&&(n=r),this.minBufferSize=i+t,this.maxBufferSize=i+r,this.shrinkThreshold=i+n,this.ringBufferSize=this.minBufferSize,this.shrinkMode=void 0!==e.shrinkMode?e.shrinkMode:c.MANUAL,this.ringBuffer=new Uint8Array(this.ringBufferSize),this.offset=0,this.streamDecode={externalDict:null,extDictStart:0,extDictSize:0,prefixEnd:0,prefixSize:0}}P.prototype._resizeBuffer=function(e){var t=new Uint8Array(e),r=0;if(this.offset>0){var n=this.offset<i?this.offset:i,o=this.offset>i?this.offset-i:0;t.set(this.ringBuffer.subarray(o,o+n),0),w(this.stream,t,0,n),r=n}return this.ringBuffer=t,this.ringBufferSize=e,this.offset=r,!0},P.prototype.compress=function(e,t){var r=e.length;if(r<=0)return u.PARAM_ERROR;if(r>this.maxBufferSize-i)return u.PARAM_ERROR;if(r>this.ringBufferSize-i){var n=l(r),o=i+n;if(o>this.maxBufferSize&&(o=this.maxBufferSize),!this._resizeBuffer(o))return u.BUFFER_RESIZE_FAILED}this.offset+r>this.ringBufferSize&&(w(this.stream,this.ringBuffer,0,i),this.offset=i);var a=this.offset;this.ringBuffer.set(e,a);var s=M(this.stream,this.ringBuffer,t,a,r,0,t.length,!0);return s<=0?u.COMPRESS_FAILED:(this.offset+=r,this._tryAutoShrink(),s)},P.prototype.reset=function(){this.offset=0,A(this.stream)},P.prototype.shrink=function(){this.ringBufferSize>this.minBufferSize&&this._resizeBuffer(this.minBufferSize)},P.prototype._tryAutoShrink=function(){this.shrinkMode!==c.MANUAL&&(this.ringBufferSize<=this.minBufferSize||(this.shrinkMode===c.AUTO_IMMEDIATE||this.shrinkMode===c.AUTO_THRESHOLD&&this.ringBufferSize>this.shrinkThreshold)&&this.shrink())},P.prototype.getWorkArea=function(){return this.ringBufferSize-i},P.prototype.getRingBufferSize=function(){return this.ringBufferSize},P.prototype.getBaseBufferSize=function(){return this.minBufferSize},P.prototype.getMaxBufferSize=function(){return this.maxBufferSize},P.prototype.getCurrentOffset=function(){return this.offset},P.prototype.getShrinkMode=function(){return this.shrinkMode},P.prototype.setShrinkMode=function(e){this.shrinkMode=e},P.prototype.getShrinkThreshold=function(){return this.shrinkThreshold},P.prototype.setShrinkThreshold=function(e){var t=this.minBufferSize-i,r=this.maxBufferSize-i;if(e<t||e>r)return u.PARAM_ERROR;this.shrinkThreshold=i+e},x.prototype._resizeBuffer=function(e){var t=new Uint8Array(e),r=0;if(this.offset>0){var n=this.offset<i?this.offset:i,o=this.offset>i?this.offset-i:0;t.set(this.ringBuffer.subarray(o,o+n),0),r=n,U(this.streamDecode,0,0,n)}return this.ringBuffer=t,this.ringBufferSize=e,this.offset=r,!0},x.prototype.decompress=function(e,t,r){var n=e.length;if(n<=0||r<=0)return u.PARAM_ERROR;if(r>this.maxBufferSize-i)return u.PARAM_ERROR;if(r>this.ringBufferSize-i){var o=l(r),a=i+o;if(a>this.maxBufferSize&&(a=this.maxBufferSize),!this._resizeBuffer(a))return u.BUFFER_RESIZE_FAILED}if(this.offset+r>this.ringBufferSize){var s=this.offset-i;s>0&&this.ringBuffer.set(this.ringBuffer.subarray(s,s+i),0),U(this.streamDecode,this.ringBuffer,0,i),this.offset=i}var c=L(this.streamDecode,e,this.ringBuffer,0,n,this.offset,r);return c<=0?u.DECOMPRESS_FAILED:(t.set(this.ringBuffer.subarray(this.offset,this.offset+c),0),this.offset+=c,this._tryAutoShrink(),c)},x.prototype.reset=function(){this.offset=0,this.streamDecode={externalDict:null,extDictStart:0,extDictSize:0,prefixEnd:0,prefixSize:0}},x.prototype.shrink=function(){this.ringBufferSize>this.minBufferSize&&this._resizeBuffer(this.minBufferSize)},x.prototype._tryAutoShrink=function(){this.shrinkMode!==c.MANUAL&&(this.ringBufferSize<=this.minBufferSize||(this.shrinkMode===c.AUTO_IMMEDIATE||this.shrinkMode===c.AUTO_THRESHOLD&&this.ringBufferSize>this.shrinkThreshold)&&this.shrink())},x.prototype.getWorkArea=function(){return this.ringBufferSize-i},x.prototype.getRingBufferSize=function(){return this.ringBufferSize},x.prototype.getBaseBufferSize=function(){return this.minBufferSize},x.prototype.getMaxBufferSize=function(){return this.maxBufferSize},x.prototype.getCurrentOffset=function(){return this.offset},x.prototype.getShrinkMode=function(){return this.shrinkMode},x.prototype.setShrinkMode=function(e){this.shrinkMode=e},x.prototype.getShrinkThreshold=function(){return this.shrinkThreshold},x.prototype.setShrinkThreshold=function(e){var t=this.minBufferSize-i,r=this.maxBufferSize-i;if(e<t||e>r)return u.PARAM_ERROR;this.shrinkThreshold=i+e},e.exports={LZ4_MAX_INPUT_SIZE:o,BLOCK_MAX_SIZE:65536,DICT_SIZE:i,DEFAULT_WORK_AREA:a,DEFAULT_MAX_WORK:s,SHRINK_MODE:c,LZ4_ERROR:u,alignToPowerOf2:l,calcDefaultBufferSize:function(){return 131072},calcDefaultMaxBufferSize:function(){return 10551296},setHashStrategy:function(e){if("fast"!==e&&"compatible"!==e)throw new Error("Invalid hash strategy: "+e+'. Use "fast" or "compatible".');h=e},getHashStrategy:function(){return h},compress:function(e,n,i,a,s){if(null==e)return 0;if(null==n)return 0;if(i=i||0,a=void 0===a?e.length:a,s=s||0,i<0||s<0)return 0;if(a<0)return 0;if(i+a>e.length)return 0;if(a>o)return 0;if(0===a)return n.length>s?(n[s]=0,1):0;var c=a<r?d.byU16:d.byU32;return I({hashTable:new Uint32Array(c===d.byU16?8192:t),currentOffset:0,dictSize:0,dictionary:null,dictionaryStart:0},e,n,i,a,0,!1,c,0,0)},compressLimited:function(e,n,i,a,s,c){if(null==e)return 0;if(null==n)return 0;if(i=i||0,a=void 0===a?e.length:a,s=s||0,i<0||s<0)return 0;if(a<0||c<0)return 0;if(i+a>e.length)return 0;if(a>o)return 0;if(c<1)return 0;if(0===a)return n[s]=0,1;var u=a<r?d.byU16:d.byU32;return I({hashTable:new Uint32Array(u===d.byU16?8192:t),currentOffset:0,dictSize:0,dictionary:null,dictionaryStart:0},e,n,i,a,c,!0,u,0,0)},compressBound:function(e){return e<0||e>o?0:e+Math.floor(e/255)+16},decompressSafe:function(e,t,r,n,o,i){return null==e||null==t?-1:(o=o||0,(r=r||0)<0||o<0||n<0||i<0||r+n>e.length||o+i>t.length?-1:C(e,t,r,n,o,i,!0,!1,0,0,o,null,0))},decompressFast:function(e,t,r,n,o){return C(e,t,r=r||0,0,n=n||0,o,!1,!1,0,1,n-65536,0,65536)},createStream:N,resetStream:A,loadDict:function(e,t,r,n){if(e.initCheck&&A(e),n<4)return e.dictionary=null,e.dictSize=0,0;n>65536&&(r=r+n-65536,n=65536);var o=r-e.currentOffset;e.dictionary=t,e.dictionaryStart=r,e.dictSize=n,e.currentOffset+=n;for(var i=r,a=r+n;i<=a-4;)y(t,i,e.hashTable,d.byU32,o),i+=3;return n},compressContinue:M,saveDict:w,createStreamDecode:function(){return{externalDict:null,extDictStart:0,extDictSize:0,prefixEnd:0,prefixSize:0}},setStreamDecode:U,decompressSafeContinue:L,RingBufferEncoder:P,RingBufferDecoder:x,_hashU16:m,_hashU32:f,_TABLE_TYPE:d}},9687:function(e,t,r){"use strict";e.exports=s;var n=r(8923);((s.prototype=Object.create(n.prototype)).constructor=s).className="Service";var o=r(8811),i=r(3262),a=r(5047);function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function c(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var r=new s(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},s.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return i.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=i.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},s.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},s.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,c(this)):n.prototype.add.call(this,e)},s.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,c(this)}return n.prototype.remove.call(this,e)},s.prototype.create=function(e,t,r){for(var n,o=new a.Service(e,t,r),s=0;s<this.methodsArray.length;++s){var c=i.lcFirst((n=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");o[c]=i.codegen(["r","c"],i.isReserved(c)?c+"_":c)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return o}},9773:function(e,t,r){"use strict";var n=r(6518),o=r(4495),i=r(9039),a=r(3717),s=r(8981);n({target:"Object",stat:!0,forced:!o||i((function(){a.f(1)}))},{getOwnPropertySymbols:function(e){var t=a.f;return t?t(s(e)):[]}})},9868:function(e,t,r){"use strict";var n=r(6518),o=r(9504),i=r(1291),a=r(1240),s=r(2333),c=r(9039),u=RangeError,l=String,d=Math.floor,p=o(s),h=o("".slice),f=o(1..toFixed),m=function(e,t,r){return 0===t?r:t%2==1?m(e,t-1,r*e):m(e*e,t/2,r)},v=function(e,t,r){for(var n=-1,o=r;++n<6;)o+=t*e[n],e[n]=o%1e7,o=d(o/1e7)},g=function(e,t){for(var r=6,n=0;--r>=0;)n+=e[r],e[r]=d(n/t),n=n%t*1e7},y=function(e){for(var t=6,r="";--t>=0;)if(""!==r||0===t||0!==e[t]){var n=l(e[t]);r=""===r?n:r+p("0",7-n.length)+n}return r};n({target:"Number",proto:!0,forced:c((function(){return"0.000"!==f(8e-5,3)||"1"!==f(.9,0)||"1.25"!==f(1.255,2)||"1000000000000000128"!==f(0xde0b6b3a7640080,0)}))||!c((function(){f({})}))},{toFixed:function(e){var t,r,n,o,s=a(this),c=i(e),d=[0,0,0,0,0,0],f="",E="0";if(c<0||c>20)throw new u("Incorrect fraction digits");if(s!=s)return"NaN";if(s<=-1e21||s>=1e21)return l(s);if(s<0&&(f="-",s=-s),s>1e-21)if(r=(t=function(e){for(var t=0,r=e;r>=4096;)t+=12,r/=4096;for(;r>=2;)t+=1,r/=2;return t}(s*m(2,69,1))-69)<0?s*m(2,-t,1):s/m(2,t,1),r*=4503599627370496,(t=52-t)>0){for(v(d,0,r),n=c;n>=7;)v(d,1e7,0),n-=7;for(v(d,m(10,n,1),0),n=t-1;n>=23;)g(d,1<<23),n-=23;g(d,1<<n),v(d,1,1),g(d,2),E=y(d)}else v(d,0,r),v(d,1<<-t,0),E=y(d)+p("0",c);return c>0?f+((o=E.length)<=c?"0."+p("0",c-o)+E:h(E,0,o-c)+"."+h(E,o-c)):f+E}})},9948:function(e,t,r){"use strict";var n=r(5370),o=r(4644).getTypedArrayConstructor;e.exports=function(e,t){return n(o(e),t)}},9955:function(e,t,r){"use strict";var n=r(4644),o=r(9213).findIndex,i=n.aTypedArray;(0,n.exportTypedArrayMethod)("findIndex",(function(e){return o(i(this),e,arguments.length>1?arguments[1]:void 0)}))}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.amdO={},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=function(e,t){for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var __webpack_exports__={};return function(){"use strict";__webpack_require__.d(__webpack_exports__,{default:function(){return tu}});var e={};__webpack_require__.r(e),__webpack_require__.d(e,{acceptContactInvite:function(){return io},acceptInvitation:function(){return oo},addContact:function(){return to},addConversationMark:function(){return Uo},addReaction:function(){return go},addToBlackList:function(){return co},addUsersToBlacklist:function(){return uo},addUsersToBlocklist:function(){return lo},declineContactInvite:function(){return so},declineInvitation:function(){return ao},deleteAllMessagesAndConversations:function(){return ko},deleteContact:function(){return no},deleteConversation:function(){return zn},deleteReaction:function(){return yo},deleteSession:function(){return Wn},fetchHistoryMessages:function(){return Qn},fetchUserInfoById:function(){return Jn},getAllContacts:function(){return Ao},getBlacklist:function(){return xn},getBlocklist:function(){return kn},getContacts:function(){return Bn},getContactsWithCursor:function(){return Mo},getConversationlist:function(){return Fn},getHistoryMessages:function(){return Zn},getRTCToken:function(){return ei},getReactionDetail:function(){return To},getReactionList:function(){return Eo},getReactionlist:function(){return _o},getRoster:function(){return Dn},getSelfIdsOnOtherPlatform:function(){return xo},getServerConversations:function(){return Ro},getServerConversationsByFilter:function(){return Po},getServerPinnedConversations:function(){return bo},getServerPinnedMessages:function(){return Go},getSessionList:function(){return Hn},getTokenExpireTimestamp:function(){return Xn},getUserIdByRTCUIds:function(){return ti},modifyMessage:function(){return vo},pinConversation:function(){return Co},pinMessage:function(){return Bo},recallMessage:function(){return mo},removeConversationMark:function(){return Lo},removeFromBlackList:function(){return po},removeHistoryMessages:function(){return Oo},removeRoster:function(){return ro},removeUserFromBlackList:function(){return ho},removeUserFromBlocklist:function(){return fo},reportMessage:function(){return Io},searchMessages:function(){return eo},setContactRemark:function(){return No},unbindPushToken:function(){return Ho},unpinMessage:function(){return jo},updateCurrentUserNick:function(){return Yn},updateOwnUserInfo:function(){return Kn},updateUserInfo:function(){return Vn},uploadPushToken:function(){return Gn},uploadToken:function(){return jn},voiceFileToText:function(){return Zo},voiceMessageToText:function(){return $o}});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{acceptGroupInvite:function(){return ji},acceptGroupJoinRequest:function(){return xi},addUsersToGroupAllowlist:function(){return ha},addUsersToGroupWhitelist:function(){return pa},agreeInviteIntoGroup:function(){return Bi},agreeJoinGroup:function(){return Pi},blockGroup:function(){return ui},blockGroupMember:function(){return ea},blockGroupMembers:function(){return ra},blockGroupMessage:function(){return xa},blockGroupMessages:function(){return li},changeGroupOwner:function(){return vi},changeOwner:function(){return mi},createGroup:function(){return si},createGroupNew:function(){return ai},createGroupVNext:function(){return ci},deleteGroupSharedFile:function(){return Ca},destroyGroup:function(){return Ni},disableSendGroupMsg:function(){return la},dissolveGroup:function(){return Ci},downloadGroupSharedFile:function(){return Ma},enableSendGroupMsg:function(){return da},fetchGroupAnnouncement:function(){return Ra},fetchGroupSharedFileList:function(){return Na},getGroup:function(){return hi},getGroupAdmin:function(){return Ii},getGroupAllowlist:function(){return ya},getGroupBlacklist:function(){return ca},getGroupBlacklistNew:function(){return sa},getGroupBlocklist:function(){return ua},getGroupInfo:function(){return gi},getGroupMemberAttributes:function(){return Ua},getGroupMembers:function(){return Ti},getGroupMembersAttributes:function(){return La},getGroupMsgReadUser:function(){return Oa},getGroupMuteList:function(){return Qi},getGroupMutelist:function(){return $i},getGroupSharedFilelist:function(){return Aa},getGroupWhitelist:function(){return ga},getJoinedGroups:function(){return fi},getJoinedGroupsCount:function(){return Pa},getMuted:function(){return Xi},getPublicGroups:function(){return pi},groupBlockMulti:function(){return ta},groupBlockSingle:function(){return Zi},inviteToGroup:function(){return wi},inviteUsersToGroup:function(){return Ui},isGroupWhiteUser:function(){return Ea},isInGroupAllowlist:function(){return Ta},isInGroupMutelist:function(){return Ia},isInGroupWhiteList:function(){return _a},joinGroup:function(){return Li},leaveGroup:function(){return Mi},listGroupMember:function(){return Ei},listGroupMembers:function(){return _i},listGroups:function(){return di},modifyGroup:function(){return yi},mute:function(){return Ki},muteGroupMember:function(){return Vi},quitGroup:function(){return Ai},rejectGroupInvite:function(){return Hi},rejectGroupJoinRequest:function(){return Di},rejectInviteIntoGroup:function(){return Gi},rejectJoinGroup:function(){return ki},removeAdmin:function(){return Si},removeGroupAdmin:function(){return bi},removeGroupAllowlistMember:function(){return va},removeGroupBlockMulti:function(){return ia},removeGroupBlockSingle:function(){return na},removeGroupMember:function(){return qi},removeGroupMembers:function(){return zi},removeGroupWhitelistMember:function(){return ma},removeMultiGroupMember:function(){return Wi},removeMute:function(){return Ji},removeSingleGroupMember:function(){return Fi},rmUsersFromGroupWhitelist:function(){return fa},setAdmin:function(){return Oi},setGroupAdmin:function(){return Ri},setGroupMemberAttributes:function(){return wa},unblockGroupMember:function(){return oa},unblockGroupMembers:function(){return aa},unblockGroupMessage:function(){return ka},unmuteGroupMember:function(){return Yi},updateGroupAnnouncement:function(){return Sa},uploadGroupSharedFile:function(){return ba}});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{addUsersToChatRoom:function(){return Ja},addUsersToChatRoomAllowlist:function(){return Rs},addUsersToChatRoomWhitelist:function(){return Os},blockChatRoomMember:function(){return ds},blockChatRoomMembers:function(){return hs},chatRoomBlockMulti:function(){return ps},chatRoomBlockSingle:function(){return ls},createChatRoom:function(){return Ga},deleteChatRoomSharedFile:function(){return ks},destroyChatRoom:function(){return Ha},disableSendChatRoomMsg:function(){return Ts},enableSendChatRoomMsg:function(){return Is},fetchChatRoomAnnouncement:function(){return Ls},fetchChatRoomSharedFileList:function(){return Ds},getChatRoomAdmin:function(){return ts},getChatRoomAllowlist:function(){return As},getChatRoomAttributes:function(){return js},getChatRoomBlacklist:function(){return Es},getChatRoomBlacklistNew:function(){return ys},getChatRoomBlocklist:function(){return _s},getChatRoomDetails:function(){return Fa},getChatRoomMembers:function(){return es},getChatRoomMuteList:function(){return cs},getChatRoomMuted:function(){return ss},getChatRoomMutelist:function(){return us},getChatRoomSharedFilelist:function(){return Bs},getChatRoomWhitelist:function(){return Ns},getChatRooms:function(){return ja},getJoinedChatRooms:function(){return Ws},isChatRoomWhiteUser:function(){return Ms},isInChatRoomAllowlist:function(){return ws},isInChatRoomMutelist:function(){return Us},joinChatRoom:function(){return Ya},leaveChatRoom:function(){return Qa},listChatRoomMember:function(){return $a},listChatRoomMembers:function(){return Za},modifyChatRoom:function(){return qa},muteChatRoomMember:function(){return os},quitChatRoom:function(){return Xa},removeChatRoomAdmin:function(){return ns},removeChatRoomAllowlistMember:function(){return Cs},removeChatRoomAttribute:function(){return qs},removeChatRoomAttributes:function(){return Fs},removeChatRoomBlockMulti:function(){return vs},removeChatRoomBlockSingle:function(){return fs},removeChatRoomMember:function(){return za},removeChatRoomMembers:function(){return Va},removeChatRoomWhitelistMember:function(){return bs},removeMultiChatRoomMember:function(){return Ka},removeMuteChatRoomMember:function(){return is},removeSingleChatRoomMember:function(){return Wa},rmUsersFromChatRoomWhitelist:function(){return Ss},setChatRoomAdmin:function(){return rs},setChatRoomAttribute:function(){return Hs},setChatRoomAttributes:function(){return Gs},unblockChatRoomMember:function(){return ms},unblockChatRoomMembers:function(){return gs},unmuteChatRoomMember:function(){return as},updateChatRoomAnnouncement:function(){return Ps},uploadChatRoomSharedFile:function(){return xs}});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{getPresenceStatus:function(){return $s},getSubscribedPresenceList:function(){return Xs},getSubscribedPresencelist:function(){return Qs},publishPresence:function(){return Vs},subscribePresence:function(){return Js},unsubscribePresence:function(){return Ys}});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{clearRemindTypeForConversation:function(){return rc},getPushPerformLanguage:function(){return ac},getSilentModeForAll:function(){return ec},getSilentModeForConversation:function(){return nc},getSilentModeForConversations:function(){return oc},getSilentModeRemindTypeConversations:function(){return sc},setPushPerformLanguage:function(){return ic},setSilentModeForAll:function(){return Zs},setSilentModeForConversation:function(){return tc}});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{changeChatThreadName:function(){return fc},createChatThread:function(){return lc},destroyChatThread:function(){return hc},getChatThreadDetail:function(){return Tc},getChatThreadLastMessage:function(){return Ec},getChatThreadMembers:function(){return mc},getChatThreads:function(){return yc},getJoinedChatThreads:function(){return gc},joinChatThread:function(){return dc},leaveChatThread:function(){return pc},removeChatThreadMember:function(){return vc}});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{getSupportedLanguages:function(){return Ic},translateMessage:function(){return Oc}});var s,c=__webpack_require__(2549),u=__webpack_require__.n(c),l=__webpack_require__(8570),d=__webpack_require__.n(l),p=(__webpack_require__(2675),__webpack_require__(9463),__webpack_require__(2259),__webpack_require__(8706),__webpack_require__(2008),__webpack_require__(1629),__webpack_require__(4423),__webpack_require__(3792),__webpack_require__(2712),__webpack_require__(4743),__webpack_require__(1745),__webpack_require__(8309),__webpack_require__(9089),__webpack_require__(739),__webpack_require__(3288),__webpack_require__(4170),__webpack_require__(2010),__webpack_require__(6033),__webpack_require__(2892),__webpack_require__(9085),__webpack_require__(4185),__webpack_require__(9432),__webpack_require__(6099),__webpack_require__(3362),__webpack_require__(1699),__webpack_require__(7764),__webpack_require__(1392),__webpack_require__(1489),__webpack_require__(1630),__webpack_require__(2170),__webpack_require__(5044),__webpack_require__(1920),__webpack_require__(1694),__webpack_require__(9955),__webpack_require__(3206),__webpack_require__(4496),__webpack_require__(6651),__webpack_require__(2887),__webpack_require__(9369),__webpack_require__(6812),__webpack_require__(8995),__webpack_require__(1575),__webpack_require__(6072),__webpack_require__(8747),__webpack_require__(8845),__webpack_require__(9423),__webpack_require__(7301),__webpack_require__(373),__webpack_require__(6614),__webpack_require__(1405),__webpack_require__(3684),__webpack_require__(3500),__webpack_require__(2953),__webpack_require__(6031),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}());__webpack_require__(5276),__webpack_require__(8921),__webpack_require__(4782),__webpack_require__(9868),__webpack_require__(7495),__webpack_require__(8781),__webpack_require__(3296),__webpack_require__(7208),__webpack_require__(8408),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.REQUEST_ABORT=-4]="REQUEST_ABORT",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_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.MAX_LIMIT=50]="MAX_LIMIT",e[e.MESSAGE_NOT_FOUND=51]="MESSAGE_NOT_FOUND",e[e.NO_PERMISSION=52]="NO_PERMISSION",e[e.OPERATION_UNSUPPORTED=53]="OPERATION_UNSUPPORTED",e[e.OPERATION_NOT_ALLOWED=54]="OPERATION_NOT_ALLOWED",e[e.WEBIM_TOKEN_EXPIRED=56]="WEBIM_TOKEN_EXPIRED",e[e.WEBIM_SERVER_SERVING_DISABLED=57]="WEBIM_SERVER_SERVING_DISABLED",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.PARSE_FILE_ERROR=203]="PARSE_FILE_ERROR",e[e.USER_NOT_FOUND=204]="USER_NOT_FOUND",e[e.MESSAGE_PARAMETER_ERROR=205]="MESSAGE_PARAMETER_ERROR",e[e.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE=206]="WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE",e[e.WEBIM_CONNCTION_USER_REMOVED=207]="WEBIM_CONNCTION_USER_REMOVED",e[e.WEBIM_USER_ALREADY_LOGIN=208]="WEBIM_USER_ALREADY_LOGIN",e[e.USER_LOGIN_TOO_MANY_DEVICES=214]="USER_LOGIN_TOO_MANY_DEVICES",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.USER_MUTED_BY_ADMIN=219]="USER_MUTED_BY_ADMIN",e[e.USER_DEVICE_CHANGED=220]="USER_DEVICE_CHANGED",e[e.USER_NOT_FRIEND=221]="USER_NOT_FRIEND",e[e.WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION=222]="WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION",e[e.WEBIM_DOWNLOADFILE_ERROR_EXPIRED=223]="WEBIM_DOWNLOADFILE_ERROR_EXPIRED",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.SERVER_GET_DNSLIST_FAILED=304]="SERVER_GET_DNSLIST_FAILED",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.FILE_INVALID=407]="FILE_INVALID",e[e.FILE_DURATION_TOO_LONG=408]="FILE_DURATION_TOO_LONG",e[e.FILE_VOICE_TO_TEXT_FAILED=409]="FILE_VOICE_TO_TEXT_FAILED",e[e.FILE_NOT_FOUND=410]="FILE_NOT_FOUND",e[e.FILE_TOO_LARGE=411]="FILE_TOO_LARGE",e[e.SERVER_BUSY=500]="SERVER_BUSY",e[e.MESSAGE_INCLUDE_ILLEGAL_CONTENT=501]="MESSAGE_INCLUDE_ILLEGAL_CONTENT",e[e.MESSAGE_EXTERNAL_LOGIC_BLOCKED=502]="MESSAGE_EXTERNAL_LOGIC_BLOCKED",e[e.SERVER_UNKNOWN_ERROR=503]="SERVER_UNKNOWN_ERROR",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.MESSAGE_MODERATION_BLOCKED=508]="MESSAGE_MODERATION_BLOCKED",e[e.MESSAGE_CURRENT_LIMITING=509]="MESSAGE_CURRENT_LIMITING",e[e.MESSAGE_WEBSOCKET_DISCONNECTED=510]="MESSAGE_WEBSOCKET_DISCONNECTED",e[e.MESSAGE_SIZE_LIMIT=511]="MESSAGE_SIZE_LIMIT",e[e.MESSAGE_SEND_TIMEOUT=512]="MESSAGE_SEND_TIMEOUT",e[e.MESSAGE_STREAM_INTERVAL_TIMEOUT=513]="MESSAGE_STREAM_INTERVAL_TIMEOUT",e[e.MESSAGE_STREAM_TIMEOUT=514]="MESSAGE_STREAM_TIMEOUT",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.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.GROUP_MEMBERS_LIMIT=607]="GROUP_MEMBERS_LIMIT",e[e.GROUP_IS_DISABLED=608]="GROUP_IS_DISABLED",e[e.GROUP_MEMBER_ATTRIBUTES_SET_FAILED=609]="GROUP_MEMBER_ATTRIBUTES_SET_FAILED",e[e.REST_PARAMS_STATUS=700]="REST_PARAMS_STATUS",e[e.CHATROOM_NOT_JOINED=702]="CHATROOM_NOT_JOINED",e[e.CHATROOM_MEMBERS_FULL=704]="CHATROOM_MEMBERS_FULL",e[e.CHATROOM_NOT_EXIST=705]="CHATROOM_NOT_EXIST",e[e.LOCAL_DB_OPERATION_FAILED=800]="LOCAL_DB_OPERATION_FAILED",e[e.SDK_RUNTIME_ERROR=999]="SDK_RUNTIME_ERROR",e[e.PRESENCE_PARAM_EXCEED=1100]="PRESENCE_PARAM_EXCEED",e[e.REACTION_ALREADY_ADDED=1101]="REACTION_ALREADY_ADDED",e[e.REACTION_CREATING=1102]="REACTION_CREATING",e[e.REACTION_OPERATION_IS_ILLEGAL=1103]="REACTION_OPERATION_IS_ILLEGAL",e[e.TRANSLATION_NOT_VALID=1200]="TRANSLATION_NOT_VALID",e[e.TRANSLATION_TEXT_TOO_LONG=1201]="TRANSLATION_TEXT_TOO_LONG",e[e.TRANSLATION_FAILED=1204]="TRANSLATION_FAILED",e[e.THREAD_NOT_EXIST=1300]="THREAD_NOT_EXIST",e[e.THREAD_ALREADY_EXIST=1301]="THREAD_ALREADY_EXIST",e[e.MODIFY_MESSAGE_NOT_EXIST=1302]="MODIFY_MESSAGE_NOT_EXIST",e[e.MODIFY_MESSAGE_FORMAT_ERROR=1303]="MODIFY_MESSAGE_FORMAT_ERROR",e[e.MODIFY_MESSAGE_FAILED=1304]="MODIFY_MESSAGE_FAILED",e[e.CONVERSATION_NOT_EXIST=1400]="CONVERSATION_NOT_EXIST"}(s||(s={}));var h,f,m,v,g,y,E,_=function(){return _=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_.apply(this,arguments)},T=function(e,t,r,n){var o,i,a,c,u,l,d,p,h,f,m,v,g,y,E,T,I,O,R,S,b,C,N,A,M,w,U,L,P=e.response;P&&"string"==typeof P&&(P=JSON.parse(P));var x=e.status,k={elapse:n,httpCode:x,errDesc:null==P?void 0:P.error_description};if(400===x){if(4000005===P.error_code||4000006===P.error_code)return void t({type:s.REQUEST_PARAMETER_ERROR,message:null==P?void 0:P.error_description,extraInfo:k});if(40002===P.error_code)return void t({type:s.THREAD_ALREADY_EXIST,message:null==P?void 0:P.error_description,extraInfo:k});if(40009===P.error_code)return void t({type:s.OPERATION_UNSUPPORTED,message:null==P?void 0:P.error_description,extraInfo:k});if(60005===P.error_code)return void t({type:s.GROUP_MEMBER_ATTRIBUTES_SET_FAILED,message:(null==P?void 0:P.desc)||(null==P?void 0:P.error_description),extraInfo:k});if(60010===P.error_code)return void((null===(o=null==P?void 0:P.error_description)||void 0===o?void 0:o.includes("exceeds chatgroup user metadata single value limit"))?t({type:s.MAX_LIMIT,message:(null==P?void 0:P.desc)||P.error_description,extraInfo:k}):t({type:s.NO_PERMISSION,message:(null==P?void 0:P.desc)||P.error_description,extraInfo:k}));if(60011===P.error_code)return void t({type:s.CHATROOM_NOT_JOINED,message:null==P?void 0:P.desc,extraInfo:k});if(14403===P.error_code)return void t({type:s.WEBIM_UPLOADFILE_ERROR,message:null==P?void 0:P.error_description,data:P,extraInfo:k});if(60006===P.error_code||60007===P.error_code||60009===P.error_code||60012===P.error_code)return void t({type:s.MAX_LIMIT,message:(null==P?void 0:P.desc)||(null==P?void 0:P.error_description),extraInfo:k});if(91104===P.error_code)return void t({type:s.NO_PERMISSION,message:null==P?void 0:P.error_description,extraInfo:k});if(null===(i=P.error_description)||void 0===i?void 0:i.includes("are not members of this group"))return(null===(a=e.responseURL)||void 0===a?void 0:a.includes("chatgroups"))?t({type:s.GROUP_NOT_JOINED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):t({type:s.CHATROOM_NOT_JOINED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}),void r({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:null==P?void 0:P.error_description,data:e.responseText,extraInfo:k});if("the app not open presence"===(null==P?void 0:P.result))return void t({type:s.SERVICE_NOT_ENABLED,message:null==P?void 0:P.result,extraInfo:k});if(null===(c=null==P?void 0:P.error_description)||void 0===c?void 0:c.includes("remark length must less"))return void t({type:s.MAX_LIMIT,message:null==P?void 0:P.error_description,extraInfo:k});switch(null==P?void 0:P.error_description){case"the user is already operation this message":t({type:s.REACTION_ALREADY_ADDED,message:null==P?void 0:P.error_description,extraInfo:k});break;case"The quantity has exceeded the limit!":t({type:s.MAX_LIMIT,message:null==P?void 0:P.error_description,extraInfo:k});break;case"The user not in this group!":t({type:s.GROUP_NOT_JOINED,message:null==P?void 0:P.error_description,extraInfo:k});break;case"the user operation is illegal!":t({type:s.REACTION_OPERATION_IS_ILLEGAL,message:null==P?void 0:P.error_description,extraInfo:k});break;case"this appKey is not open reaction service!":case"this appKey not open message roaming":t({type:s.SERVICE_NOT_ENABLED,message:null==P?void 0:P.error_description,extraInfo:k});break;case"this message is creating reaction, please try again.":t({type:s.REACTION_CREATING,message:null==P?void 0:P.error_description,extraInfo:k});break;case"groupId can not be null!":t({type:s.GROUP_NOT_EXIST,message:null==P?void 0:P.error_description,extraInfo:k});break;case"The input text is too long.":t({type:s.TRANSLATION_TEXT_TOO_LONG,message:null==P?void 0:P.error_description,extraInfo:k});break;case"The target language is not valid.":t({type:s.TRANSLATION_NOT_VALID,message:null==P?void 0:P.error_description,extraInfo:k});break;case"report failed, get message by id failed":t({type:s.MESSAGE_NOT_FOUND,message:null==P?void 0:P.error_description,extraInfo:k});break;case"ext is too big ":t({type:s.PRESENCE_PARAM_EXCEED,message:null==P?void 0:P.error_description,extraInfo:k});break;case"Request body not readable.Please check content type is correct!":case"param mark must be not empty, please check!":case"param mark illegal, please check it!":case"param pin_msg_id illegal, please check it!":t({type:s.REQUEST_PARAMETER_ERROR,message:null==P?void 0:P.error_description,extraInfo:k});break;case"updateRemark | they are not friends, please add as a friend first.":t({type:s.USER_NOT_FRIEND,message:null==P?void 0:P.error_description,extraInfo:k});break;default:t({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:null==P?void 0:P.error_description,data:e.responseText,extraInfo:k}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:null==P?void 0:P.error_description,data:e.responseText,extraInfo:k})}}else if(401===x)4010101===P.error_code?t({type:s.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:null==P?void 0:P.error_description,extraInfo:k}):40001===P.error_code||60001===P.error_code||"Unable to authenticate (OAuth)"===P.error_description?t({type:s.NO_PERMISSION,message:null==P?void 0:P.error_description,extraInfo:k}):(r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:k}),t({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:k}));else if(403===x)4e4===P.error_code||60004===P.error_code||15002===P.error_code||4030204===P.error_code?t({type:s.SERVICE_NOT_ENABLED,message:null==P?void 0:P.error_description,extraInfo:k}):40003===P.error_code||40004===P.error_code?t({type:s.THREAD_ALREADY_EXIST,message:null==P?void 0:P.error_description,extraInfo:k}):40005===P.error_code||40007===P.error_code||91002===P.error_code?t({type:s.MAX_LIMIT,message:null==P?void 0:P.error_description,extraInfo:k}):60002===P.error_code?t({type:s.PERMISSION_DENIED,message:null==P?void 0:P.error_description,extraInfo:k}):91101===P.error_code?t({type:s.MAX_LIMIT,message:null==P?void 0:P.error_description,extraInfo:k}):91102===P.error_code&&t({type:s.REQUEST_PARAMETER_ERROR,message:P.error_description,extraInfo:k}),"group member list is full!"===P.error_description?(null===(u=e.responseURL)||void 0===u?void 0:u.includes("chatgroups"))?t({type:s.GROUP_MEMBERS_FULL,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):t({type:s.CHATROOM_MEMBERS_FULL,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(l=P.error_description)||void 0===l?void 0:l.includes("invite users to join group failed"))&&(null===(d=P.error_description)||void 0===d?void 0:d.includes("already in group"))?(null===(p=e.responseURL)||void 0===p?void 0:p.includes("chatgroups"))&&t({type:s.GROUP_ALREADY_JOINED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(h=P.error_description)||void 0===h?void 0:h.includes("are not members of this group"))?(null===(f=e.responseURL)||void 0===f?void 0:f.includes("chatgroups"))?t({type:s.GROUP_NOT_JOINED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):t({type:s.CHATROOM_NOT_JOINED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(m=P.error_description)||void 0===m?void 0:m.includes("service not open!"))||(null===(v=P.error_description)||void 0===v?void 0:v.includes("message report not open"))||(null===(g=P.error_description)||void 0===g?void 0:g.includes("messageroaming function not open"))?t({type:s.SERVICE_NOT_ENABLED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(y=P.error_description)||void 0===y?void 0:y.includes("members size is greater than max user size !"))?t({type:s.GROUP_MEMBERS_LIMIT,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(E=P.error_description)||void 0===E?void 0:E.includes("can not operate this group, reason: group is disabled"))?t({type:s.GROUP_IS_DISABLED,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(T=P.error_description)||void 0===T?void 0:T.includes("Invitee's contact max count"))||(null===(I=P.error_description)||void 0===I?void 0:I.includes("Inviter's contact max count"))?t({type:s.MAX_LIMIT,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):t({type:s.PERMISSION_DENIED,data:e.response||e.responseText,message:"permission denied",extraInfo:_(_({},k),{errDesc:"permission denied"})}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:k});else if(404===x){if(4040302===P.error_code)return void t({type:s.WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR,message:null==P?void 0:P.error_description,extraInfo:k});40011===P.error_code?t({type:s.THREAD_NOT_EXIST,message:null==P?void 0:P.error_description,extraInfo:k}):40012===P.error_code?t({type:s.NO_PERMISSION,message:null==P?void 0:P.error_description,extraInfo:k}):60003===P.error_code||20004===P.error_code?t({type:s.GROUP_NOT_JOINED,message:null==P?void 0:P.error_description,extraInfo:k}):91001===P.error_code&&t({type:s.CONVERSATION_NOT_EXIST,message:null==P?void 0:P.error_description,extraInfo:k}),(null===(O=P.error_description)||void 0===O?void 0:O.includes("do not find this group"))||(null===(R=P.error_description)||void 0===R?void 0:R.includes("does not exist"))?(null===(S=e.responseURL)||void 0===S?void 0:S.includes("chatgroups"))?t({type:s.GROUP_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:_(_({},k),{errDesc:"The chat room dose not exist."})}):t({type:s.CHATROOM_NOT_EXIST,data:e.response||e.responseText,message:"The chat room dose not exist.",extraInfo:_(_({},k),{errDesc:"The chat room dose not exist."})}):(null===(b=P.error_description)||void 0===b?void 0:b.includes("username"))&&(null===(C=P.error_description)||void 0===C?void 0:C.includes("doesn't exist!'"))||(null===(N=P.error_description)||void 0===N?void 0:N.includes("user not found"))||(null===(A=P.error_description)||void 0===A?void 0:A.includes("Service resource not found"))&&"UserNotFoundException"===(null==P?void 0:P.exception)?t({type:s.USER_NOT_FOUND,data:e.response||e.responseText,message:P.error_description,extraInfo:k}):(null===(M=P.error_description)||void 0===M?void 0:M.includes("user session pin message not exist"))?t({type:s.MESSAGE_NOT_FOUND,message:P.error_description,extraInfo:k}):t({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:k}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.response||e.responseText,message:e.responseText,extraInfo:k})}else if(406===x)90004===P.error_code&&t({type:s.OPERATION_NOT_ALLOWED,message:null==P?void 0:P.error_description,extraInfo:k});else if(429===x||503===x){if(null===(w=P.error_description)||void 0===w?void 0:w.includes("The request has reached the maximum limit"))return void t({type:s.MAX_LIMIT,message:e.responseText,extraInfo:k});if(null===(U=P.error_description)||void 0===U?void 0:U.includes("upload client logs reached limit"))return void t({type:s.MAX_LIMIT,message:e.responseText});t({type:s.SERVER_BUSY,data:e.response||e.responseText,message:"Server is busy.",extraInfo:_(_({},k),{errDesc:"Server is busy."})}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"Server is busy.",extraInfo:_(_({},k),{errDesc:"Server is busy."})})}else if(500===x){if(40006===P.error_code||40008===P.error_code||40010===P.error_code||5000701===P.error_code)return void t({type:s.SERVER_UNKNOWN_ERROR,message:null==P?void 0:P.error_description,extraInfo:k});if(90005===P.error_code||99999===P.error_code)return void t({type:s.REQUEST_UNKNOWN,message:null==P?void 0:P.error_description,extraInfo:k});if(null===(L=P.error_description)||void 0===L?void 0:L.includes("translte failed!"))return void t({type:s.TRANSLATION_FAILED,message:e.responseText,extraInfo:k});t({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:k}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:"",extraInfo:k})}else if(502===x){if(5020801===P.error_code)return void t({type:s.SERVER_UNKNOWN_ERROR,message:null==P?void 0:P.error_description,extraInfo:k});t({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:_(_({},k),{errDesc:"ajax error"})}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:_(_({},k),{errDesc:"ajax error"})})}else t({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:_(_({},k),{errDesc:"ajax error"})}),r({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:e.responseText,message:e.responseText,extraInfo:_(_({},k),{errDesc:"ajax error"})})};!function(e){e[e.UNKNOWOPERATION=-1]="UNKNOWOPERATION",e[e.REST_GET_SESSION_LIST=1]="REST_GET_SESSION_LIST",e[e.REST_DEL_SESSION=2]="REST_DEL_SESSION",e[e.REST_GET_HISTORY_MESSAGE=3]="REST_GET_HISTORY_MESSAGE",e[e.REST_PIN_CONVERSATION=4]="REST_PIN_CONVERSATION",e[e.REST_MARK_CONVERSATION=5]="REST_MARK_CONVERSATION",e[e.REST_UPLOAD_FILE_IN_PARTS=6]="REST_UPLOAD_FILE_IN_PARTS",e[e.REST_DELETE_MESSAGES_CONVERSATIONS=7]="REST_DELETE_MESSAGES_CONVERSATIONS",e[e.REST_PIN_MESSAGE=8]="REST_PIN_MESSAGE",e[e.REST_FETCH_PINMESSAGES=9]="REST_FETCH_PINMESSAGES",e[e.REST_FETCH_CONVERSATIONS=10]="REST_FETCH_CONVERSATIONS",e[e.REST_OPERATE=100]="REST_OPERATE",e[e.MSYNC_SENDMESSAGE=101]="MSYNC_SENDMESSAGE",e[e.MSYNC_RECALLMESSAGE=102]="MSYNC_RECALLMESSAGE",e[e.MSYNC_MODIFYMESSAGE=103]="MSYNC_MODIFYMESSAGE",e[e.MSYNC_OPERATE=200]="MSYNC_OPERATE",e[e.ROSTER_ADD=201]="ROSTER_ADD",e[e.ROSTER_REMOVE=202]="ROSTER_REMOVE",e[e.ROSTER_ACCEPT=203]="ROSTER_ACCEPT",e[e.ROSTER_DECLINE=204]="ROSTER_DECLINE",e[e.ROSTER_BAN=205]="ROSTER_BAN",e[e.ROSTER_ALLOW=206]="ROSTER_ALLOW",e[e.ROSTER_BLACKLIST=207]="ROSTER_BLACKLIST",e[e.ROSTER_CONTACTS=208]="ROSTER_CONTACTS",e[e.ROSTER_GET_ALL_CONTACTS_REMARKS=209]="ROSTER_GET_ALL_CONTACTS_REMARKS",e[e.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE=210]="ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE",e[e.ROSTER_SET_CONTACT_REMARK=211]="ROSTER_SET_CONTACT_REMARK",e[e.ROSTER_OPERATE=300]="ROSTER_OPERATE",e[e.USER_LOGIN=301]="USER_LOGIN",e[e.USER_CREATE=302]="USER_CREATE",e[e.USER_UPDATE_USERINFO=303]="USER_UPDATE_USERINFO",e[e.USER_FETCH_USERINFO=304]="USER_FETCH_USERINFO",e[e.USER_UPDATE_NICK=305]="USER_UPDATE_NICK",e[e.USER_UPLOAD_PUSH_TOKEN=306]="USER_UPLOAD_PUSH_TOKEN",e[e.USER_LOGGEDIN_OTHER_PLATFORM=307]="USER_LOGGEDIN_OTHER_PLATFORM",e[e.USER_OPERATE=400]="USER_OPERATE",e[e.GROUP_CREATEGROUP=401]="GROUP_CREATEGROUP",e[e.GROUP_BLOCK_MESSAGE=402]="GROUP_BLOCK_MESSAGE",e[e.GROUP_FETCH_PUBLICGROUPS_WITHCURSOR=403]="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e[e.GROUP_FETCH_USERS_GROUP=404]="GROUP_FETCH_USERS_GROUP",e[e.GROUP_CHANGE_OWNER=405]="GROUP_CHANGE_OWNER",e[e.GROUP_FETCH_SPECIFICATION=406]="GROUP_FETCH_SPECIFICATION",e[e.GROUP_CHANGE_GROUPATTRIBUTE=407]="GROUP_CHANGE_GROUPATTRIBUTE",e[e.GROUP_FETCH_MEMEBERS=408]="GROUP_FETCH_MEMEBERS",e[e.GROUP_GET_ADMIN=409]="GROUP_GET_ADMIN",e[e.GROUP_SET_ADMIN=410]="GROUP_SET_ADMIN",e[e.GROUP_REMOVE_ADMIN=411]="GROUP_REMOVE_ADMIN",e[e.GROUP_DESTOTYGROUP=412]="GROUP_DESTOTYGROUP",e[e.GROUP_LEAVEGROUP=413]="GROUP_LEAVEGROUP",e[e.GROUP_INVITE_TO_GROUP=414]="GROUP_INVITE_TO_GROUP",e[e.GROUP_JOIN_PUBLICGROUP=415]="GROUP_JOIN_PUBLICGROUP",e[e.GROUP_ACCEPT_JOINPUBLICGROUPAPPL=416]="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e[e.GROUP_DECLINE_JOINPUBLICGROUPAPPL=417]="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e[e.GROUP_ACCEPT_INVITATION=418]="GROUP_ACCEPT_INVITATION",e[e.GROUP_DECLINE_INVITATION=419]="GROUP_DECLINE_INVITATION",e[e.GROUP_REMOVE_MEMBER=420]="GROUP_REMOVE_MEMBER",e[e.GROUP_REMOVE_MEMBERS=421]="GROUP_REMOVE_MEMBERS",e[e.GROUP_MUTE_MEMBERS=422]="GROUP_MUTE_MEMBERS",e[e.GROUP_UNMUTE_MEMBERS=423]="GROUP_UNMUTE_MEMBERS",e[e.GROUP_FETCH_MUTES=424]="GROUP_FETCH_MUTES",e[e.GROUP_BLOCK_MEMBER=425]="GROUP_BLOCK_MEMBER",e[e.GROUP_BLOCK_MEMBERS=426]="GROUP_BLOCK_MEMBERS",e[e.GROUP_UNBLOCK_MEMBER=427]="GROUP_UNBLOCK_MEMBER",e[e.GROUP_UNBLOCK_MEMBERS=428]="GROUP_UNBLOCK_MEMBERS",e[e.GROUP_GET_BLOCK_LIST=429]="GROUP_GET_BLOCK_LIST",e[e.GROUP_MUTE_ALLMEMBERS=430]="GROUP_MUTE_ALLMEMBERS",e[e.GROUP_UNMUTE_ALLMEMBERS=431]="GROUP_UNMUTE_ALLMEMBERS",e[e.GROUP_ADD_WHITELIST=432]="GROUP_ADD_WHITELIST",e[e.GROUP_REMOVE_WHITELIST=433]="GROUP_REMOVE_WHITELIST",e[e.GROUP_FETCH_WHITELIST=434]="GROUP_FETCH_WHITELIST",e[e.GROUP_IS_IN_WHITELIST=435]="GROUP_IS_IN_WHITELIST",e[e.GROUP_GET_READ_USERS=436]="GROUP_GET_READ_USERS",e[e.GROUP_FETCH_ANNOUNCEMENT=437]="GROUP_FETCH_ANNOUNCEMENT",e[e.GROUP_UPDATE_ANNOUNCEMENT=438]="GROUP_UPDATE_ANNOUNCEMENT",e[e.GROUP_UPLOAD_SHAREDFILE=439]="GROUP_UPLOAD_SHAREDFILE",e[e.GROUP_DELETE_SHAREDFILE=440]="GROUP_DELETE_SHAREDFILE",e[e.GROUP_FETCH_SHAREDFILE=441]="GROUP_FETCH_SHAREDFILE",e[e.GROUP_DOWNLOAD_SHAREDFILE=442]="GROUP_DOWNLOAD_SHAREDFILE",e[e.GROUP_MEMBER_SET_META_DATA=443]="GROUP_MEMBER_SET_META_DATA",e[e.GROUP_MEMBER_FETCH_META_DATA=444]="GROUP_MEMBER_FETCH_META_DATA",e[e.GROUP_OPERATE=500]="GROUP_OPERATE",e[e.CHATROOM_FETCH_CHATROOMSWITHPAGE=501]="CHATROOM_FETCH_CHATROOMSWITHPAGE",e[e.CHATROOM_CREATECHATROOM=502]="CHATROOM_CREATECHATROOM",e[e.CHATROOM_DESTORYCHATROOM=503]="CHATROOM_DESTORYCHATROOM",e[e.CHATROOM_FETCH_SPECIFICATION=504]="CHATROOM_FETCH_SPECIFICATION",e[e.CHATROOM_CHANGE_ATTRIBUTE=505]="CHATROOM_CHANGE_ATTRIBUTE",e[e.CHATROOM_REMOVE_MEMBER=506]="CHATROOM_REMOVE_MEMBER",e[e.CHATROOM_REMOVE_MEMBERS=507]="CHATROOM_REMOVE_MEMBERS",e[e.CHATROOM_ADD_MEMBERS=508]="CHATROOM_ADD_MEMBERS",e[e.CHATROOM_JOINCAHTROOM=509]="CHATROOM_JOINCAHTROOM",e[e.CHATROOM_LEAVECAHTROOM=510]="CHATROOM_LEAVECAHTROOM",e[e.CHATROOM_FETCH_MEMBERS=511]="CHATROOM_FETCH_MEMBERS",e[e.CHATROOM_GET_ADMIN=512]="CHATROOM_GET_ADMIN",e[e.CHATROOM_SET_ADMIN=513]="CHATROOM_SET_ADMIN",e[e.CHATROOM_REMOVE_ADMIN=514]="CHATROOM_REMOVE_ADMIN",e[e.CHATROOM_MUTE_USER=515]="CHATROOM_MUTE_USER",e[e.CHATROOM_UNMUTE_USER=516]="CHATROOM_UNMUTE_USER",e[e.CHATROOM_FETCH_MUTES=517]="CHATROOM_FETCH_MUTES",e[e.CHATROOM_BLOCK_USER=518]="CHATROOM_BLOCK_USER",e[e.CHATROOM_BLOCK_USERS=519]="CHATROOM_BLOCK_USERS",e[e.CHATROOM_UNBLOCK_USER=520]="CHATROOM_UNBLOCK_USER",e[e.CHATROOM_UNBLOCK_USERS=521]="CHATROOM_UNBLOCK_USERS",e[e.CHATROOM_FETCH_BANS=522]="CHATROOM_FETCH_BANS",e[e.CHATROOM_MUTE_ALLMEMEBERS=523]="CHATROOM_MUTE_ALLMEMEBERS",e[e.CHATROOM_UNMUTE_ALLMEMEBERS=524]="CHATROOM_UNMUTE_ALLMEMEBERS",e[e.CHATROOM_ADD_WHITELIST=525]="CHATROOM_ADD_WHITELIST",e[e.CHATROOM_REMOVE_WHITELIST=526]="CHATROOM_REMOVE_WHITELIST",e[e.CHATROOM_FETCH_WHITELIST=527]="CHATROOM_FETCH_WHITELIST",e[e.CHATROOM_FETCH_MEMBERIN_WHITELIST=528]="CHATROOM_FETCH_MEMBERIN_WHITELIST",e[e.CHATROOM_FETCH_ANNOUNCEMENT=529]="CHATROOM_FETCH_ANNOUNCEMENT",e[e.CHATROOM_UPDATE_ANNOUNCEMENT=530]="CHATROOM_UPDATE_ANNOUNCEMENT",e[e.CHATROOM_REMOVE_SHARE_FILE=531]="CHATROOM_REMOVE_SHARE_FILE",e[e.CHATROOM_GET_SHARE_FILE_LIST=532]="CHATROOM_GET_SHARE_FILE_LIST",e[e.CHATROOM_UPLOAD_FILE=533]="CHATROOM_UPLOAD_FILE",e[e.CHATROOM_SET_META_DATA=534]="CHATROOM_SET_META_DATA",e[e.CHATROOM_DELETE_META_DATA=535]="CHATROOM_DELETE_META_DATA",e[e.CHATROOM_FETCH_META_DATA=536]="CHATROOM_FETCH_META_DATA",e[e.CHATROOM_FETCH_USER_JOINED_CHATROOM=537]="CHATROOM_FETCH_USER_JOINED_CHATROOM",e[e.CHATROOM_OPERATE=600]="CHATROOM_OPERATE"}(h||(h={})),function(e){e.SDK_INTERNAL="SDK_INTERNAL",e.LOGIN="USER_LOGIN",e.REGISTER="USER_CREATE",e.GET_CHATROOM_LIST="CHATROOM_FETCH_CHATROOMSWITHPAGE",e.CREATE_CHATROOM="CHATROOM_CREATECHATROOM",e.DESTROY_CHATROOM="CHATROOM_DESTORYCHATROOM",e.GET_CHATROOM_DETAIL="CHATROOM_FETCH_SPECIFICATION",e.MODIFY_CHATROOM="CHATROOM_CHANGE_ATTRIBUTE",e.REMOVE_CHATROOM_MEMBER="CHATROOM_REMOVE_MEMBER",e.MULTI_REMOVE_CHATROOM_MEMBER="CHATROOM_REMOVE_MEMBERS",e.ADD_USERS_TO_CHATROOM="CHATROOM_ADD_MEMBERS",e.JOIN_CHATROOM="CHATROOM_JOINCAHTROOM",e.QUIT_CHATROOM="CHATROOM_LEAVECAHTROOM",e.LIST_CHATROOM_MEMBERS="CHATROOM_FETCH_MEMBERS",e.GET_CHATROOM_ADMIN="CHATROOM_GET_ADMIN",e.SET_CHATROOM_ADMIN="CHATROOM_SET_ADMIN",e.REMOVE_CHATROOM_ADMIN="CHATROOM_REMOVE_ADMIN",e.MUTE_CHATROOM_MEMBER="CHATROOM_MUTE_USER",e.REMOVE_MUTE_CHATROOM_MEMBER="CHATROOM_UNMUTE_USER",e.GET_MUTE_CHATROOM_MEMBERS="CHATROOM_FETCH_MUTES",e.SET_CHATROOM_MEMBER_TO_BLACK="CHATROOM_BLOCK_USER",e.MULTI_SET_CHATROOM_MEMBER_TO_BLACK="CHATROOM_BLOCK_USERS",e.REMOVE_CHATROOM_MEMBER_BLACK="CHATROOM_UNBLOCK_USER",e.MULTI_REMOVE_CHATROOM_MEMBER_BLACK="CHATROOM_UNBLOCK_USERS",e.GET_CHATROOM_BLOCK_MEMBERS="CHATROOM_FETCH_BANS",e.DISABLED_CHATROOM_SEND_MSG="CHATROOM_MUTE_ALLMEMEBERS",e.ENABLE_CHATROOM_SEND_MSG="CHATROOM_UNMUTE_ALLMEMEBERS",e.ADD_CHATROOM_WHITE_USERS="CHATROOM_ADD_WHITELIST",e.REMOVE_CHATROOM_WHITE_USERS="CHATROOM_REMOVE_WHITELIST",e.GET_CHATROOM_WHITE_USERS="CHATROOM_FETCH_WHITELIST",e.CHECK_CHATROOM_WHITE_USER="CHATROOM_FETCH_MEMBERIN_WHITELIST",e.GET_CHATROOM_ANN="CHATROOM_FETCH_ANNOUNCEMENT",e.UPDATE_CHATROOM_ANN="CHATROOM_UPDATE_ANNOUNCEMENT",e.DELETE_CHATROOM_FILE="CHATROOM_REMOVE_SHARE_FILE",e.GET_CHATROOM_FILES="CHATROOM_GET_SHARE_FILE_LIST",e.UPLOAD_CHATROOM_FILE="CHATROOM_UPLOAD_FILE",e.SET_CHATROOM_ATTR="CHATROOM_SET_META_DATA",e.DELETE_CHATROOM_ATTR="CHATROOM_DELETE_META_DATA",e.GET_CHATROOM_ATTR="CHATROOM_FETCH_META_DATA",e.GET_USER_JOINED_CHATROOM="CHATROOM_FETCH_USER_JOINED_CHATROOM",e.CREATE_GROUP="GROUP_CREATEGROUP",e.BLOCK_GROUP="GROUP_BLOCK_MESSAGE",e.LIST_GROUP="GROUP_FETCH_PUBLICGROUPS_WITHCURSOR",e.GET_USER_GROUP="GROUP_FETCH_USERS_GROUP",e.CHANGE_OWNER="GROUP_CHANGE_OWNER",e.GET_GROUP_INFO="GROUP_FETCH_SPECIFICATION",e.MODIFY_GROUP="GROUP_CHANGE_GROUPATTRIBUTE",e.LIST_GROUP_MEMBER="GROUP_FETCH_MEMEBERS",e.GET_GROUP_ADMIN="GROUP_GET_ADMIN",e.SET_GROUP_ADMIN="GROUP_SET_ADMIN",e.REMOVE_GROUP_ADMIN="GROUP_REMOVE_ADMIN",e.DISSOLVE_GROUP="GROUP_DESTOTYGROUP",e.QUIT_GROUP="GROUP_LEAVEGROUP",e.INVITE_TO_GROUP="GROUP_INVITE_TO_GROUP",e.JOIN_GROUP="GROUP_JOIN_PUBLICGROUP",e.AGREE_JOIN_GROUP="GROUP_ACCEPT_JOINPUBLICGROUPAPPL",e.REJECT_JOIN_GROUP="GROUP_DECLINE_JOINPUBLICGROUPAPPL",e.AGREE_INVITE_GROUP="GROUP_ACCEPT_INVITATION",e.REJECT_INVITE_GROUP="GROUP_DECLINE_INVITATION",e.REMOVE_GROUP_MEMBER="GROUP_REMOVE_MEMBER",e.MULTI_REMOVE_GROUP_MEMBER="GROUP_REMOVE_MEMBERS",e.MUTE_GROUP_MEMBER="GROUP_MUTE_MEMBERS",e.UNMUTE_GROUP_MEMBER="GROUP_UNMUTE_MEMBERS",e.GET_GROUP_MUTE_LIST="GROUP_FETCH_MUTES",e.BLOCK_GROUP_MEMBER="GROUP_BLOCK_MEMBER",e.BLOCK_GROUP_MEMBERS="GROUP_BLOCK_MEMBERS",e.UNBLOCK_GROUP_MEMBER="GROUP_UNBLOCK_MEMBER",e.UNBLOCK_GROUP_MEMBERS="GROUP_UNBLOCK_MEMBERS",e.GET_GROUP_BLACK_LIST="GROUP_GET_BLOCK_LIST",e.DISABLED_SEND_GROUP_MSG="GROUP_MUTE_ALLMEMBERS",e.ENABLE_SEND_GROUP_MSG="GROUP_UNMUTE_ALLMEMBERS",e.ADD_USERS_TO_GROUP_WHITE="GROUP_ADD_WHITELIST",e.REMOVE_GROUP_WHITE_MEMBER="GROUP_REMOVE_WHITELIST",e.GET_GROUP_WHITE_LIST="GROUP_FETCH_WHITELIST",e.IS_IN_GROUP_WHITE_LIST="GROUP_IS_IN_WHITELIST",e.GET_GROUP_MSG_READ_USER="GROUP_GET_READ_USERS",e.GET_GROUP_ANN="GROUP_FETCH_ANNOUNCEMENT",e.UPDATE_GROUP_ANN="GROUP_UPDATE_ANNOUNCEMENT",e.UPLOAD_GROUP_FILE="GROUP_UPLOAD_SHAREDFILE",e.DELETE_GROUP_FILE="GROUP_DELETE_SHAREDFILE",e.GET_GROUP_FILE_LIST="GROUP_FETCH_SHAREDFILE",e.DOWN_GROUP_FILE="GROUP_DOWNLOAD_SHAREDFILE",e.SET_GROUP_MEMBER_ATTRS="GROUP_MEMBER_SET_META_DATA",e.GET_GROUP_MEMBER_ATTR="GROUP_MEMBER_FETCH_META_DATA",e.GET_SESSION_LIST="REST_GET_SESSION_LIST",e.REST_FETCH_CONVERSATIONS="REST_FETCH_CONVERSATIONS",e.DELETE_SESSION="REST_DEL_SESSION",e.GET_HISTORY_MSG="REST_GET_HISTORY_MESSAGE",e.PIN_CONVERSATION="REST_PIN_CONVERSATION",e.REST_UPLOAD_FILE_IN_PARTS="REST_UPLOAD_FILE_IN_PARTS",e.REST_DELETE_MESSAGES_CONVERSATIONS="REST_DELETE_MESSAGES_CONVERSATIONS",e.MARK_CONVERSATION="REST_MARK_CONVERSATION",e.REST_FETCH_PINMESSAGES="REST_FETCH_PINMESSAGES",e.REST_PIN_MESSAGE="REST_PIN_MESSAGE",e.UPDATE_USER_INFO="USER_UPDATE_USERINFO",e.GET_USER_INFO="USER_FETCH_USERINFO",e.UPDATE_USER_NICK="USER_UPDATE_NICK",e.UPLOAD_PUSH_TOKEN="USER_UPLOAD_PUSH_TOKEN",e.USER_LOGGEDIN_OTHER_PLATFORM="USER_LOGGEDIN_OTHER_PLATFORM",e.GET_BLACK_LIST="ROSTER_BLACKLIST",e.GET_CONTACTS="ROSTER_CONTACTS",e.ROSTER_GET_ALL_CONTACTS_REMARKS="ROSTER_GET_ALL_CONTACTS_REMARKS",e.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE="ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE",e.ROSTER_SET_CONTACT_REMARK="ROSTER_SET_CONTACT_REMARK",e.ROSTER_ADD="ROSTER_ADD",e.ROSTER_REMOVE="ROSTER_REMOVE",e.ROSTER_ACCEPT="ROSTER_ACCEPT",e.ROSTER_DECLINE="ROSTER_DECLINE",e.ROSTER_BAN="ROSTER_BAN",e.ROSTER_ALLOW="ROSTER_ALLOW",e.SEND_MSG="MSYNC_SENDMESSAGE",e.UPLOAD_MSG_ATTACH="UPLOAD_MSG_ATTACH",e.SEND_RECALL_MSG="MSYNC_RECALLMESSAGE",e.MODIFY_MESSAGE="MSYNC_MODIFYMESSAGE",e.REST_FETCHHISTORYMESSAGE="REST_FETCHHISTORYMESSAGE",e.REST_SEARCH_MESSAGES="REST_SEARCH_MESSAGES",e.MSYNC_SYNCOFFLINEMESSAGE="MSYNC_SYNCOFFLINEMESSAGE"}(f||(f={})),function(e){e.GET_DNS="REST_DNSLIST",e.LOGIN_BY_AGORA_TOKEN="LOGIN_BY_AGORA_TOKEN",e.LOGIN_BY_PWD="LOGIN_BY_PWD",e.RESISTER="REGISTER",e.REST_INIT_UPLOAD_TASK_IN_PARTS="REST_INIT_UPLOAD_TASK_IN_PARTS",e.REST_UPLOAD_PART="REST_UPLOAD_PART",e.REST_COMPLETE_UPLOAD_PART="REST_COMPLETE_UPLOAD_PART",e.REST_ABORT_UPLOAD_PART="REST_ABORT_UPLOAD_PART",e.CONNECT_WEBSOCKET="CONNECT_WEBSOCKET"}(m||(m={})),function(e){e[e["5G"]=7]="5G",e[e["4G"]=7]="4G",e[e["3G"]=7]="3G",e[e["2G"]=7]="2G",e[e["SLOW-2G"]=7]="SLOW-2G",e[e.WIFI=2]="WIFI",e[e.LAN=1]="LAN",e[e.DISCONNECTED=0]="DISCONNECTED",e[e.NONE=0]="NONE",e[e.UNKNOWN=-1]="UNKNOWN",e[e["WEBIM UNABLE TO GET"]=-2]="WEBIM UNABLE TO GET"}(v||(v={})),function(e){e[e.success=200]="success",e[e.failed=500]="failed",e[e.disconnect=-1]="disconnect",e[e.closed=401]="closed",e[e.notFound=404]="notFound",e[e.reachLimit=429]="reachLimit"}(g||(g={})),function(e){e[e.web=0]="web",e[e.native=1]="native"}(y||(y={})),function(e){e[e.singleChat=0]="singleChat",e[e.groupChat=1]="groupChat",e[e.chatRoom=2]="chatRoom"}(E||(E={}));var I=new Map,O=new Map,R=1e3,S=9675,b=-1;function C(){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()}__webpack_require__(8598);var N="undefined"!=typeof window&&void 0!==window.navigator&&/Trident\/|MSIE /.test(window.navigator.userAgent);function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}var M,w=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},U=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},L=function(){},P={};!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"}(M||(M={}));var x=function(){function e(e,t,r){this.name=e||"defaultLogger",this.currentLevel=0,this.useCookiePersist=!1,this.storageLogLevelKey="loglevel",this.levels=M,this.consoleLogVisibility=!0,this.logMethods=["trace","debug","info","warn","error"],this.methodFactory=r||this.defaultMethodFactory,this.report=!1;var n=this._getPersistedLevel();null==n&&(n=null===t?"WARN":t),this.logs=[],this.reportLogs=[],this.reportInterval=3e5,this.timer=null,this.config={useCache:!1,maxCache:3145728,color:"",background:""},this.logBytes=0,this.setLevel(n,!1,"")}return e.prototype.reportLog=function(){var e,t,r;return w(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,l;return U(this,(function(d){switch(d.label){case 0:if(0===(null===(e=this.reportLogs)||void 0===e?void 0:e.length))return[2];for(n=2097152,o=this.reportLogs.join("\n")+"\n",i=o.length,a=[];i>n;)a.push(o.substring(0,n)),i-=n,o=o.substring(n);a.push(o),s=0,c=a,d.label=1;case 1:if(!(s<c.length))return[3,8];if(u=c[s],this.reportLogs=[],!(null===(r=null===(t=this.connection)||void 0===t?void 0:t.context)||void 0===r?void 0:r.accessToken))return[2];d.label=2;case 2:return d.trys.push([2,4,,5]),[4,this.reportData(u)];case 3:return"ok"!==(null==(l=d.sent())?void 0:l.status)&&this.reportLogs.unshift(u),[3,5];case 4:return d.sent(),this.reportLogs.unshift(u),[3,5];case 5:return[4,ye.delay(3e3)];case 6:d.sent(),d.label=7;case 7:return s++,[3,1];case 8:return[2]}}))}))},e.prototype.reportData=function(e){var t,r=this;if(this.connection){var n=this.connection.context||{},o=n.orgName,i=n.appName,a=n.accessToken,s=n.userId;if(o&&i){var c={url:"".concat(null===(t=this.connection)||void 0===t?void 0:t.apiUrl,"/").concat(o,"/").concat(i,"/sdk/users/").concat(s,"/client/logs"),type:"POST",data:JSON.stringify({resource:this.connection.clientResource||"random_".concat(Date.now()),logContent:e}),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return oe.call(this.connection,c).then((function(e){return r.log("report log success",e),e})).catch((function(e){r.error("report log error",e)}))}}else this.error("report log error","connection is null")},e.prototype._regularlyReportLogs=function(){var e,t=this;this.timer&&clearInterval(this.timer),(null!==(e=this.reportInterval)&&void 0!==e?e:0)<6e4&&(this.reportInterval=6e4),this.timer=setInterval((function(){t.reportLog()}),this.reportInterval||3e5)},e.prototype._stopReportLogs=function(){return w(this,void 0,void 0,(function(){return U(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.reportLog()];case 1:return e.sent(),[3,3];case 2:return e.sent(),this.error("report log error when stopping upload"),[3,3];case 3:return this.reportLogs=[],clearInterval(this.timer),[2]}}))}))},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=M[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<M.SILENT)throw Error("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),n=document.createElement("a");n.style.display="none",n.href=r,n.setAttribute("download","sdklog"),document.body.appendChild(n),n.click()}},e.prototype.setConsoleLogVisibility=function(e){this.consoleLogVisibility=e},e.prototype._bindMethod=function(e,t,r){var n=this,o=e[t],i=this.getTime();if(r)return this._cacheLog;if("function"==typeof o.bind)return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=n.getTime();n.consoleLogVisibility&&o.call.apply(o,function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([e,"".concat(a," IM SDK [").concat("log"===t?"debug":t,"]: ")],r,!1)),n.onLog&&n.onLog({time:a,level:"log"===t?"debug":t,logs:r}),n._cacheReportLogs.apply(n,r)};try{return Function.prototype.bind.call(o,e,"".concat(i," IM SDK [").concat("log"===t?"debug":t,"]: "))}catch(t){return function(){return Function.prototype.apply.apply(o,[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()+": ",n="";e.forEach((function(e){"object"===A(e)?n+=JSON.stringify(e)+" ":n+=e+" "})),this._cacheLogCall(r+n),this._cacheReportLogs.apply(this,e)},e.prototype._cacheLogCall=function(e){var t=e.length,r=this.logBytes+t,n=this.config.maxCache;if(!(t>=n)){if(r<n)this.logBytes+=t;else for(var o=r-n,i=0;i<o;){var a=this.logs.shift();void 0!==a&&(i+=a.length)}this.logs.push(e)}},e.prototype._cacheReportLogs=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(this.report){var r=(new Date).toLocaleString()+": ",n="";e.forEach((function(e){"object"===A(e)?n+=JSON.stringify(e)+" ":n+=e+" "})),this.reportLogs.push(r+n)}},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";if("undefined"!=typeof window){if(window.localStorage)try{window.localStorage[this.storageLogLevelKey]=t}catch(e){console.log(e)}this.useCookiePersist&&(window.document.cookie=encodeURIComponent(this.storageLogLevelKey)+"="+t+";")}},e.prototype.replaceLoggingMethods=function(e,t){for(var r=this,n=0;n<this.logMethods.length;n++){var o=this.logMethods[n];this[o]=n<e?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.report&&r._cacheReportLogs.apply(r,e)}: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&&N?C:void 0!==console[e]?this._bindMethod(console,e,this.config.useCache):void 0!==console.log?this._bindMethod(console,"log",this.config.useCache):L)},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}(),k=new x;k.getLogger=function(e){if("string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");return this};var D="undefined"!=typeof window?window.log:void 0;k.noConflict=function(){return"undefined"!=typeof window&&window.log===k&&(window.log=D),k},k.getLoggers=function(){return P},k.initReport=function(e){var t=e.report,r=e.reportInterval,n=e.connection;k.report=t,k.reportInterval=r,k.connection=n,t&&k._regularlyReportLogs()};var B=k,j=5242880,G=5242880,H={size:0},F={singleChat:"CHAT",groupChat:"GROUP",chatRoom:"ROOM"},q=(__webpack_require__(8980),__webpack_require__(4554),15e3),W=3e5,z=3e5,K=[s.MAX_LIMIT,s.WEBIM_TOKEN_EXPIRED,s.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,s.USER_NOT_FOUND,s.WEBIM_CONNCTION_AUTH_ERROR,s.REQUEST_PARAMETER_ERROR,s.WEBIM_CONNCTION_AUTH_ERROR,s.WEBIM_SERVER_SERVING_DISABLED,s.USER_LOGIN_TOO_MANY_DEVICES,s.USER_DEVICE_CHANGED],V=function(){return V=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},V.apply(this,arguments)};function J(){var e=this.context,t=e.orgName,r=e.appName,n=e.accessToken,o={url:"".concat(this.apiUrl,"/").concat(t,"/").concat(r,"/sdk/chatfiles/part-upload"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+n}};return B.debug("Call multipartInit"),oe.call(this,o,f.SDK_INTERNAL).then((function(e){var t=e.entities[0];return{data:{fileMaxSize:t.file_upper_limit,partMinSize:t.part_lower_limit,uuid:t.uuid},extraInfo:e.extraInfo,type:e.type}}))}function Y(e){var t=this;return new Promise((function(r,n){var o,i,a=(new Date).getTime(),c=t.context,u=c.orgName,l=c.appName,d=c.accessToken,p=e.uuid,h=e.partNumber,f=e.part,m=e.onProgress,v="".concat(t.apiUrl,"/").concat(u,"/").concat(l,"/sdk/chatfiles/part-upload/").concat(p),g=new XMLHttpRequest;B.debug("Call multipartUpload"),g.upload&&(null===(i=(o=g.upload).addEventListener)||void 0===i||i.call(o,"progress",(function(e){null==m||m(e)}),!1)),g.addEventListener("abort",(function(){n({type:s.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:g,extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"Request Abort",url:v}})}),!1),g.addEventListener("error",(function(){n({type:s.WEBIM_UPLOADFILE_ERROR,data:g,extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"request error",url:v}})}),!1),g.addEventListener("load",(function(){try{var e=JSON.parse(g.responseText);if(200!==g.status)return n({type:s.WEBIM_UPLOADFILE_ERROR,data:e,extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"part upload failed",url:v}}),!1;try{r(V(V({},e),{extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,url:v}}))}catch(e){n({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:e,extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"part upload failed",url:v}})}}catch(e){n({type:s.WEBIM_UPLOADFILE_ERROR,data:g.responseText,extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"part upload failed",url:v}})}}),!1),g.addEventListener("timeout",(function(){n({type:s.REQUEST_TIMEOUT,message:"request timeout",extraInfo:{elapse:(new Date).getTime()-a,httpCode:g.status||-1,errDesc:"request timeout",url:v}})}),!1);var y=new FormData;y.append("part_file",f),y.append("part_number",h),g.timeout=W,g.open("PUT",v),g.setRequestHeader("restrict-access","true"),g.setRequestHeader("Accept","*/*"),g.setRequestHeader("Authorization","Bearer "+d),g.send(y)}))}function X(e){var t=e.uuid,r=e.thumbnailHeight,n=e.thumbnailWidth,o=e.conversationInfo,i=e.uploadImageType,a=o.conversationId,s=o.conversationType,c=F[s],u=this.context,l=u.orgName,d=u.appName,p=u.accessToken,h="".concat(this.apiUrl,"/").concat(l,"/").concat(d,"/sdk/chatfiles/part-upload/").concat(t,"?restrict-access=true&chat-type=").concat(c,"&chat-target=").concat(a);n&&(h+="&thumbnail-width=".concat(n)),r&&(h+="&thumbnail-height=".concat(r)),i&&(h+="&imagetype=".concat(i));var m={url:h,dataType:"json",type:"POST",headers:{Authorization:"Bearer "+p}};return B.debug("Call multipartComplete"),oe.call(this,m,f.SDK_INTERNAL)}function Q(e){var t=e.uuid,r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/sdk/chatfiles/part-upload/").concat(t),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i}};return B.debug("Call multipartAbort"),oe.call(this,a,f.SDK_INTERNAL)}var $=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},Z=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},ee=function(){function e(e,t){var r=this;this.handleUploadProgress=function(e,t){var n,o;if(e.total){r.progressArr[t]=e.loaded;var i=r.progressArr.reduce((function(e,t){return e+t}),0);null===(o=(n=r.options).onFileUploadProgress)||void 0===o||o.call(n,{isTrusted:e.isTrusted,type:e.type,loaded:i>r.file.size?r.file.size:i,total:r.file.size,lengthComputable:e.lengthComputable})}},this.uuid="",this.pool=[],this.progressArr=[],this.connection=e,this.options=t,this.partSize=j,this.file=t.file,this.init(),this.rpt=this.connection.dataReport.geOperateFun({operationName:f.REST_UPLOAD_FILE_IN_PARTS})}return e.prototype.init=function(){var e,t,r,n;return $(this,void 0,void 0,(function(){var o,i,a,c,u,l,d,p,h,f,v,g,y,E,_;return Z(this,(function(T){switch(T.label){case 0:return T.trys.push([0,4,,6]),[4,J.call(this.connection)];case 1:return o=T.sent(),i=o.data||{},a=i.fileMaxSize,c=void 0===a?0:a,u=i.partMinSize,l=void 0===u?j:u,d=i.uuid,p=void 0===d?"":d,h=o.extraInfo,g=h.elapse,y=h.httpCode,_=h.url,this.partSize=l,this.uuid=p,H.size=l,B.debug("multipartInit success","uuid: ".concat(p),"fileMaxSize: ".concat(c),"partMinSize: ".concat(l)),this.file.size>c?[4,this.multipartAbort()]:[3,3];case 2:return T.sent(),null===(t=(e=this.options).onFileUploadError)||void 0===t||t.call(e,{code:s.WEBIM_UPLOADFILE_ERROR,message:"The file size exceeds the maximum limit"}),[2];case 3:return this.rpt({data:{requestUrl:_,requestName:m.REST_INIT_UPLOAD_TASK_IN_PARTS,requestElapse:g,requestMethod:"POST",isSuccess:1,code:y}}),this.upload(),[3,6];case 4:return f=T.sent(),v=(null==f?void 0:f.extraInfo)||{},g=v.elapse,y=v.httpCode,E=v.errDesc,_=v.url,this.rpt({data:{requestUrl:_,requestName:m.REST_INIT_UPLOAD_TASK_IN_PARTS,requestElapse:g,requestMethod:"POST",isSuccess:0,codeDesc:E,code:y}}),[4,this.multipartAbort()];case 5:return T.sent(),null===(n=null===(r=this.options)||void 0===r?void 0:r.onInitFail)||void 0===n||n.call(r),[3,6];case 6:return[2]}}))}))},e.prototype.upload=function(){var e,t,r;return $(this,void 0,void 0,(function(){var n,o,i,a,s,c,u=this;return Z(this,(function(l){switch(l.label){case 0:(new FileReader).readAsArrayBuffer(this.file),n=this.file.size,o=Math.ceil(n/this.partSize),l.label=1;case 1:l.trys.push([1,7,,9]),i=function(t){var r,o,i,s;return Z(this,(function(c){switch(c.label){case 0:return r=t*a.partSize,o=Math.min(n,r+a.partSize),i=null===(e=a.file)||void 0===e?void 0:e.slice(r,o),(s=Y.call(a.connection,{uuid:a.uuid,partNumber:"".concat(t+1),part:i,onProgress:function(e){u.handleUploadProgress(e,t)}})).then((function(e){var t=(null==e?void 0:e.extraInfo)||{},r=t.elapse,n=t.httpCode,o=t.url;u.rpt({data:{requestUrl:o,requestName:m.REST_UPLOAD_PART,requestElapse:r,isSuccess:1,requestMethod:"PUT",code:n}}),u.handleTask(s)})),s.catch((function(e){var t=(null==e?void 0:e.extraInfo)||{},r=t.elapse,n=t.httpCode,o=t.url,i=t.errDesc;u.rpt({data:{requestUrl:o,requestName:m.REST_UPLOAD_PART,requestElapse:r,isSuccess:0,requestMethod:"PUT",code:n,codeDesc:i}}),delete e.extraInfo})),a.pool.push(s),4!==a.pool.length?[3,2]:[4,Promise.race(a.pool)];case 1:c.sent(),c.label=2;case 2:return[2]}}))},a=this,s=0,l.label=2;case 2:return s<o?[5,i(s)]:[3,5];case 3:l.sent(),l.label=4;case 4:return s++,[3,2];case 5:return[4,Promise.all(this.pool)];case 6:return l.sent(),this.multipartComplete(),[3,9];case 7:return c=l.sent(),[4,this.multipartAbort()];case 8:return l.sent(),this.rpt({data:{isLastApi:1,isSuccess:0}}),null===(r=(t=this.options).onFileUploadError)||void 0===r||r.call(t,c),[3,9];case 9:return[2]}}))}))},e.prototype.multipartComplete=function(){var e,t,r,n;return $(this,void 0,void 0,(function(){var o,i,a,s,c,u,l,d,p,h,f;return Z(this,(function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),o=this.options.thumbnailInfo||{},i=o.width,a=o.height,[4,X.call(this.connection,{uuid:this.uuid,thumbnailHeight:a,thumbnailWidth:i,conversationInfo:this.options.conversationInfo,uploadImageType:this.options.uploadImageType})];case 1:return s=v.sent(),c=(null==s?void 0:s.extraInfo)||{},d=c.elapse,p=c.httpCode,f=c.url,this.rpt({data:{requestUrl:f,requestName:m.REST_COMPLETE_UPLOAD_PART,requestElapse:d,requestMethod:"POST",isSuccess:1,code:p}}),this.rpt({data:{isLastApi:1,isSuccess:1}}),null===(t=(e=this.options).onFileUploadComplete)||void 0===t||t.call(e,s),[3,3];case 2:return u=v.sent(),l=(null==u?void 0:u.extraInfo)||{},d=l.elapse,p=l.httpCode,h=l.errDesc,f=l.url,this.rpt({data:{requestUrl:f,requestName:m.REST_COMPLETE_UPLOAD_PART,requestElapse:d,requestMethod:"POST",isSuccess:0,codeDesc:h,code:p}}),this.rpt({data:{isLastApi:1,isSuccess:0}}),null===(n=(r=this.options).onFileUploadError)||void 0===n||n.call(r,u),[3,3];case 3:return[2]}}))}))},e.prototype.multipartAbort=function(){return $(this,void 0,void 0,(function(){var e,t,r,n,o,i,a,s;return Z(this,(function(c){switch(c.label){case 0:if(!this.uuid)return[2];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,Q.call(this.connection,{uuid:this.uuid})];case 2:return e=c.sent(),t=(null==e?void 0:e.extraInfo)||{},o=t.elapse,i=t.httpCode,s=t.url,this.rpt({data:{requestUrl:s,requestName:m.REST_ABORT_UPLOAD_PART,requestElapse:o,requestMethod:"DELETE",isSuccess:1,code:i}}),[3,4];case 3:return r=c.sent(),n=(null==r?void 0:r.extraInfo)||{},o=n.elapse,i=n.httpCode,a=n.errDesc,s=n.url,this.rpt({data:{requestUrl:s,requestName:m.REST_ABORT_UPLOAD_PART,requestElapse:o,requestMethod:"DELETE",isSuccess:0,codeDesc:a,code:i}}),[3,4];case 4:return[2]}}))}))},e.prototype.handleTask=function(e){var t=this.pool.findIndex((function(t){return t===e}));this.pool.splice(t,1)},e}(),te=function(e){var t,r,n=this,o=(new Date).getTime(),i=e.apiUrl,a=e.orgName,c=e.appName,u=e.operateName,l=e.accessToken,d=e.conversationInfo,p=d.conversationType,h=d.conversationId,m=F[p],v=e.uploadUrl||"".concat(i,"/").concat(a,"/").concat(c,"/chatfiles?chat-type=").concat(m,"&chat-target=").concat(h).concat(e._uploadImageType?"&imagetype=".concat(e._uploadImageType):""),g=function(t){var r=(new Date).getTime()-o;n.dataReport&&u&&[f.UPLOAD_MSG_ATTACH,f.UPLOAD_CHATROOM_FILE,f.UPLOAD_GROUP_FILE].includes(u)&&n.dataReport.geOperateFun({operationName:u})({isEndApi:!0,data:{isSuccess:0,requestMethod:"POST",requestName:u,requestElapse:r,requestUrl:v,code:(null==E?void 0:E.status)||0,codeDesc:"upload file error"}}),e.onFileUploadError&&e.onFileUploadError(t)};function y(e){g({type:s.WEBIM_UPLOADFILE_ERROR,data:E})}var E=new XMLHttpRequest;E.upload&&(null===(r=(t=E.upload).addEventListener)||void 0===r||r.call(t,"progress",e.onFileUploadProgress||ne,!1)),E.addEventListener("abort",e.onFileUploadCanceled||ne,!1),E.addEventListener("error",y,!1),E.addEventListener("load",(function(t){try{var r=JSON.parse(E.responseText);if(400===E.status)return g({type:s.WEBIM_UPLOADFILE_ERROR,data:r}),!1;try{!function(t){var r=(new Date).getTime()-o;n.dataReport&&u&&[f.UPLOAD_MSG_ATTACH,f.UPLOAD_CHATROOM_FILE,f.UPLOAD_GROUP_FILE].includes(u)&&n.dataReport.geOperateFun({operationName:u})({isEndApi:!0,data:{isSuccess:(null==t?void 0:t.error)?0:1,requestMethod:"POST",requestName:u,requestElapse:r,requestUrl:v,code:E.status,codeDesc:(null==t?void 0:t.error_description)||""}}),e.onFileUploadComplete&&e.onFileUploadComplete(t)}(r)}catch(t){g({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,data:t})}}catch(t){g({type:s.WEBIM_UPLOADFILE_ERROR,data:E.responseText})}}),!1),E.addEventListener("timeout",y,!1),E.timeout=W,E.open("POST",v),E.setRequestHeader("restrict-access","true"),E.setRequestHeader("Accept","*/*"),E.setRequestHeader("Authorization","Bearer "+l);var _=new FormData;_.append("file",e.file.data),e.thumbnailWidth&&_.append("thumbnail-width",e.thumbnailWidth+""),e.thumbnailHeight&&_.append("thumbnail-height",e.thumbnailHeight+""),E.send(_)},re=function(){return re=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},re.apply(this,arguments)},ne=function(){};function oe(e,t){var r,n=this;return de().platform===ce.WEB?new Promise((function(t,n){var o=e.dataType||"text",i=e.success||ne,a=e.error||ne,c=new XMLHttpRequest;c.timeout=q;var u=!1;c.ontimeout=function(){B.warn("request timeout"),u=!0;var e={type:s.REQUEST_TIMEOUT,message:"Request Timeout",errorType:"timeout_error",xhr:c};a(e),n(e)},c.onerror=function(){n({type:s.REQUEST_UNKNOWN,message:"Request Unknow Error",errorType:"onerror",xhr:c})},c.onabort=function(){n({type:s.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:c})},c.onreadystatechange=function(){if(4===c.readyState){var e=(new Date).getTime()-r,l=c.status||0,d={elapse:e,httpCode:l};if(200===l){ye.ajaxUnconventionalErrorTimes=0;try{switch(o){case"text":return i(c.responseText),void t(c.responseText);case"json":var p=JSON.parse(c.responseText);return p.extraInfo=d,i(p),void t(p);case"xml":return c.responseXML&&c.responseXML.documentElement?(i(c.responseXML.documentElement),void t(c.responseXML.documentElement)):(a({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}),void n({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"XHR.responseXML is null or XHR.responseXML.documentElement is null"}));default:a({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"Invalid dataType"}),n({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"Invalid dataType"})}return t(c.response||c.responseText),void i(c.response||c.responseText,c)}catch(e){n(e)}return}0===l?setTimeout((function(){B.error("request timeout:",u),!u&&T(c,n,a,e)}),0):([400,401,403,404,429,500,503].includes(l)||(B.warn("rest api request fail status:",l),ye.ajaxUnconventionalErrorTimes++),T(c,n,a,e))}0===c.readyState&&(a({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"Request not initialized"}),n({type:s.WEBIM_CONNCTION_AJAX_ERROR,data:c.responseText,message:"Request not initialized"}))},e.responseType&&c.responseType&&(c.responseType=e.responseType),e.mimeType&&c.overrideMimeType(e.mimeType);var l=e.type||"POST",d=e.data||null,p="";if("get"===l.toLowerCase()&&d){for(var h in d)d.hasOwnProperty(h)&&(p+=h+"="+d[h]+"&");p=p?p.slice(0,-1):p,e.url+=(e.url.indexOf("?")>0?"&":"?")+(p?p+"&":p)+"_v="+(new Date).getTime(),d=null,p=""}r=(new Date).getTime(),c.open(l,e.url);var f=e.headers||{};for(var m in f["Content-Type"]||(f["Content-Type"]="application/json"),f)f.hasOwnProperty(m)&&c.setRequestHeader(m,f[m]);c.send(d)})).then((function(r){var o,i;if(n.dataReport&&t&&t!==f.SDK_INTERNAL){var a=n.dataReport.geOperateFun({operationName:t}),c=re({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},me(r.extraInfo));t===f.REST_FETCH_CONVERSATIONS?c.resultCount=null===(o=r.data.channel_infos)||void 0===o?void 0:o.length:t===f.REST_FETCHHISTORYMESSAGE&&(c.resultCount=null===(i=r.data.msgs)||void 0===i?void 0:i.length),a({isEndApi:!0,data:c})}return t===f.SDK_INTERNAL&&(r.extraInfo.url=e.url),t!==f.SDK_INTERNAL&&delete r.extraInfo,"Object"===ie(r)?re(re({},r),{type:s.REQUEST_SUCCESS}):{data:r,type:s.REQUEST_SUCCESS}})).catch((function(o){var i,a;if(n.dataReport&&t&&t!==f.SDK_INTERNAL&&n.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:re({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},me(o.extraInfo))}),t===f.SDK_INTERNAL)if(o.extraInfo)o.extraInfo.url=e.url;else{var s={elapse:(new Date).getTime()-r,httpCode:null!==(a=null===(i=o.xhr)||void 0===i?void 0:i.status)&&void 0!==a?a:0,url:e.url};o.extraInfo=s}throw t!==f.SDK_INTERNAL&&delete o.extraInfo,o})):ae.call(this,e,t)}function ie(e){return Object.prototype.toString.call(e).slice(8,-1)}function ae(e,t){var r=this;return new Promise((function(r,n){var o=e.success||ne,i=e.error||ne,a=e.type||"POST",c=e.data||null,u="",l=(new Date).getTime(),d=ye.getEnvInfo();if("get"===a.toLowerCase()&&c){for(var p in c)c.hasOwnProperty(p)&&(u+=p+"="+c[p]+"&");u=u?u.slice(0,-1):u,e.url+=(e.url.indexOf("?")>0?"&":"?")+(u?u+"&":u)+"_v="+(new Date).getTime(),c=null,u=""}var h={url:e.url,data:e.data,method:a,headers:{},timeout:q,success:function(e){var a,s,c,u,d,p={elapse:(new Date).getTime()-l,httpCode:Number((null===(a=e.statusCode)||void 0===a?void 0:a.toString())||(null===(s=e.status)||void 0===s?void 0:s.toString())),errDesc:(null===(c=null==e?void 0:e.data)||void 0===c?void 0:c.error_description)||""};if("200"===(null===(u=e.statusCode)||void 0===u?void 0:u.toString())||"200"===(null===(d=e.status)||void 0===d?void 0:d.toString())){e.data.extraInfo=p;var h=e.data;o(h),r(h)}else e.extraInfo=p,i(h=e),n(h),B.warn(t,"reject reason: ",h)},complete:function(){},fail:function(e){var r={elapse:(new Date).getTime()-l,httpCode:b,errDesc:"request:fail"};if(e.extraInfo=r,e.data={error:"request:fail",error_description:"request:fail"},"request:fail timeout"===e.errMsg)return n({type:s.REQUEST_TIMEOUT,message:"Request Timeout",extraInfo:r}),void i({type:s.REQUEST_TIMEOUT,message:"Request Timeout",extraInfo:r});i(e),n(e),B.error(t,"fail reason:",e)}};if("zfb"===d.platform||"dd"===d.platform?h.headers=e.headers:h.header=e.headers,"dd"===d.platform)return dd.httpRequest(h);d.global.request(h)})).then((function(n){var o,i;if(r.dataReport&&t&&t!==f.SDK_INTERNAL){var a=r.dataReport.geOperateFun({operationName:t}),c=re({isSuccess:1,requestUrl:e.url,requestName:t,requestMethod:e.type},me(n.extraInfo));t===f.REST_FETCH_CONVERSATIONS?c.resultCount=null===(o=n.data.channel_infos)||void 0===o?void 0:o.length:t===f.REST_FETCHHISTORYMESSAGE&&(c.resultCount=null===(i=n.data.msgs)||void 0===i?void 0:i.length),a({isEndApi:!0,data:c})}return t!==f.SDK_INTERNAL&&delete n.extraInfo,"Object"===ie(n)?re(re({},n),{type:s.REQUEST_SUCCESS}):{data:n,type:s.REQUEST_SUCCESS}})).catch((function(n){r.dataReport&&t&&t!==f.SDK_INTERNAL&&r.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:re({isSuccess:0,requestUrl:e.url,requestName:t,requestMethod:e.type},me(n.extraInfo))}),t!==f.SDK_INTERNAL&&delete n.extraInfo;var o=JSON.stringify(n.data||{}),i=re(re({},n),{status:n.statusCode||n.status||0,response:o,responseText:o});T(i,(function(e){throw re(re({},n),{message:e.message,type:e.type})}),ne,0)}))}function se(e,t){var r;return function(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(!e)return r;r=t?e.apply(t,n):e.apply(void 0,n),e=null}}var ce,ue=se((function(e,t){var r=de();if(r.platform!==ce.WEB){var n=r.global,o=function(r){r.isConnected?e():t()};n.offNetworkStatusChange&&n.offNetworkStatusChange(o),n.onNetworkStatusChange&&n.onNetworkStatusChange(o)}else"undefined"!=typeof addEventListener&&(window.addEventListener("online",e),window.addEventListener("offline",t))})),le=se((function(e,t){var r,n,o=de();if(o.platform===ce.WEB)"undefined"!=typeof document&&document.addEventListener("visibilitychange",(function(){document.hidden?null==t||t():null==e||e()}),!1);else{var i=o.global;i.onAppShow&&(null===(r=i.onAppShow)||void 0===r||r.call(i,e)),i.onAppHide&&(null===(n=i.onAppHide)||void 0===n||n.call(i,t))}}));function de(){return"undefined"!=typeof swan&&pe(swan)?{platform:ce.BAIDU,global:swan}:"undefined"!=typeof tt&&pe(tt)?{platform:ce.TT,global:tt}:"undefined"!=typeof dd&&pe(dd)?{platform:ce.DD,global:dd}:"undefined"!=typeof my&&pe(my)?{platform:ce.ZFB,global:my}:"undefined"!=typeof wx&&pe(wx)||"undefined"!=typeof wx&&"function"==typeof wx.createCanvas?{platform:ce.WX,global:wx}:"undefined"!=typeof qq&&pe(qq)?{platform:ce.QQ,global:qq}:"undefined"!=typeof uni&&pe(uni)?{platform:ce.UNI,global:uni}:"undefined"!=typeof window&&window.WebSocket?{platform:ce.WEB,global:window}:{platform:ce.NODE,global:__webpack_require__.g||{}}}function pe(e){for(var t=["canIUse","getSystemInfo"],r=0,n=t.length;r<n;r++)if(!e[t[r]])return!1;return!0}function he(e,t){var r,n,o,i,a=this,c=e.accessToken,u=e.appKey,l=null===(n=null===(r=null==e?void 0:e.file)||void 0===r?void 0:r.data)||void 0===n?void 0:n.size,d=[],p="",h="";if(c)if(u&&(d=u.split("#"),p=d[0],h=d[1]),p||h){var f=e._filePath;if(f&&"string"==typeof f){var m=de(),v=null===(o=m.global)||void 0===o?void 0:o.uploadFile;if(m.platform!==ce.WEB&&"function"==typeof v){var g=F[e.chatType]||"CHAT",y="".concat(e.apiUrl,"/").concat(p,"/").concat(h,"/chatfiles?chat-type=").concat(g,"&chat-target=").concat(e.to);return e._uploadImageType&&(y+="&imagetype=".concat(e._uploadImageType)),void v({url:y,filePath:f,name:"file",header:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+c,"restrict-access":"true"},success:function(t){if(200===t.statusCode)try{var r="string"==typeof t.data?JSON.parse(t.data):t.data;e.onFileUploadComplete&&e.onFileUploadComplete(r)}catch(r){e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,data:re(re({},t),{rawData:t.data,error:r})})}else e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,data:t})},fail:function(t){e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,data:t})}})}e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,message:"Current platform does not support path-based upload"})}else if(l<=0)e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"});else if(e.uploadUrl)te.call(this,re(re({},e),{orgName:p,appName:h,operateName:t,conversationInfo:{conversationId:e.to,conversationType:e.chatType}}));else{var E=H.size||G;this.uploadPartEnable&&l>1.5*E?new ee(this,{file:null===(i=null==e?void 0:e.file)||void 0===i?void 0:i.data,onFileUploadProgress:e.onFileUploadProgress||ne,onFileUploadComplete:e.onFileUploadComplete||ne,onFileUploadError:e.onFileUploadError||ne,onFileUploadCanceled:e.onFileUploadCanceled||ne,conversationInfo:{conversationId:e.to,conversationType:e.chatType},onInitFail:function(){te.call(a,re(re({},e),{orgName:p,appName:h,operateName:t,conversationInfo:{conversationId:e.to,conversationType:e.chatType}}))},thumbnailInfo:{width:e.thumbnailWidth,height:e.thumbnailHeight},uploadImageType:e._uploadImageType}):te.call(this,re(re({},e),{orgName:p,appName:h,operateName:t,conversationInfo:{conversationId:e.to,conversationType:e.chatType}}))}}else e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_ERROR,message:this._initWithAppId?"appId illegal":"AppKey illegal"});else e.onFileUploadError&&e.onFileUploadError({type:s.WEBIM_UPLOADFILE_NO_LOGIN,message:"AccessToken cannot be empty"})}function fe(e,t){var r;e.onFileDownloadComplete=e.onFileDownloadComplete||ne,e.onFileDownloadError=e.onFileDownloadError||ne;var n=(new Date).getTime(),o=new XMLHttpRequest,i=this;o.addEventListener("load",(function(){var r,a=(new Date).getTime()-n;i.dataReport&&t&&t===f.DOWN_GROUP_FILE&&i.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:200===o.status?1:0,requestMethod:e.method||"GET",requestName:t,requestElapse:a,requestUrl:null==e?void 0:e.url,code:o.status,codeDesc:200===o.status?"":"download file error"}}),200===o.status?e.onFileDownloadComplete&&e.onFileDownloadComplete(o.response):403===o.status||404===o.status?((r=new FileReader).addEventListener("loadend",(function(t){var r;try{var n=JSON.parse(null===(r=t.target)||void 0===r?void 0:r.result);B.error("download file failed","status:".concat(o.status),n),403===o.status?"chatfile no permission"===n.error_description?e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION,id:e.id,xhr:o}):e.onFileDownloadError&&e.onFileDownloadError({type:s.PERMISSION_DENIED,id:e.id,xhr:o}):404===o.status&&("file_expired"===n.error?e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR_EXPIRED,id:e.id,xhr:o}):e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o}))}catch(t){B.error("Error parsing download error response:",t),e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o})}})),r.readAsText(o.response)):500===o.status?(B.error("download file failed","status:".concat(o.status),"type:".concat(s.SERVER_UNKNOWN_ERROR)),e.onFileDownloadError&&e.onFileDownloadError({type:s.SERVER_UNKNOWN_ERROR,id:e.id,xhr:o})):(B.error("download file failed","status:".concat(o.status),"type:".concat(s.WEBIM_DOWNLOADFILE_ERROR)),e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o}))}),!1),o.addEventListener("error",(function(r){var a=(new Date).getTime()-n;i.dataReport&&t&&t===f.DOWN_GROUP_FILE&&i.dataReport.geOperateFun({operationName:t})({isEndApi:!0,data:{isSuccess:0,requestMethod:e.method||"GET",requestName:t,requestElapse:a,requestUrl:null==e?void 0:e.url,code:(null==o?void 0:o.status)||0,codeDesc:"download file error"}}),e.onFileDownloadError&&e.onFileDownloadError({type:s.WEBIM_DOWNLOADFILE_ERROR,id:e.id,xhr:o})}),!1);var a=e.method||"GET",c=e.responseType||"blob",u=e.mimeType||"text/plain; charset=x-user-defined";o.open(a,e.url),"undefined"!=typeof Blob?o.responseType=c:o.overrideMimeType(u);var l={"X-Requested-With":"XMLHttpRequest","share-secret":e.secret,Authorization:"Bearer "+(null===(r=null==this?void 0:this.context)||void 0===r?void 0:r.accessToken)},d=e.headers||{};for(var p in d)l[p]=d[p];for(var p in l)l[p]&&o.setRequestHeader(p,l[p]);o.send(null)}function me(e){void 0===e&&(e={});var t=e.elapse,r=void 0===t?0:t,n=e.httpCode,o=void 0===n?0:n,i=e.errDesc;return{requestElapse:r,code:o,codeDesc:void 0===i?"":i}}!function(e){e.WEB="web",e.WX="wx",e.QQ="qq",e.ZFB="zfb",e.DD="dd",e.TT="tt",e.BAIDU="baidu",e.QUICK_APP="quick_app",e.UNI="uni",e.NODE="node"}(ce||(ce={}));var ve,ge="localDeviceInfo",ye={autoIncrement:0,ajaxUnconventionalErrorTimes:0,isUseHttps:function(e){var t;return"boolean"==typeof e?e:!("undefined"!=typeof window)||"https:"===(null===(t=window.location)||void 0===t?void 0:t.protocol)},getRetryDelay:function(e){return e<=5?Number((Math.random()+1).toFixed(2)):e>5&&e<20?Math.floor(4*Math.random())+3:Math.floor(6*Math.random())+5},ajax:oe,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:{}},r="string"==typeof e?document.getElementById(e):e;if(window.URL.createObjectURL){if(!r.files)throw Error("this is not HTMLInputElement");var n=r.files;if(n.length>0){var o=n.item(0);t.data=o,t.url=window.URL.createObjectURL(o),t.filename=(null==o?void 0:o.name)||""}}else{if("string"!=typeof e)throw Error("in IE fileInputId must be string");o=document.getElementById(e).value,t.url=o;var i=o.lastIndexOf("/"),a=o.lastIndexOf("\\"),s=Math.max(i,a);t.filename=s<0?o:o.substring(s+1)}var c=t.filename.lastIndexOf(".");return-1!==c&&(t.filetype=t.filename.substring(c+1).toLowerCase()),t},uploadFile:he,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=[],n=0;n<arguments.length;n++)r[n]=arguments[n];for(var o=0,i=t?e[o].apply(this,r):r[0];++o<t;)i=e[o].call(this,i);return i}},listenNetwork:ue,listenBrowserVisibility:le,getEnvInfo:de,wxRequest:ae,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:fe,parseNotify:function(e){for(var t="",r=0;r<e.length;r++)t+="%"+e[r].toString(16);return JSON.parse(decodeURIComponent(t))},getExtraData:me,retryPromise:function(e,t,r){return new Promise((function(n,o){var i=function(t){e().then(n).catch((function(e){t>0?setTimeout((function(){i(t-1)}),r||1e3):o(e)}))};i(t||3)}))},formatAttachUrl:function(e){return e&&"string"==typeof e?"".concat(this.apiUrl).concat(e.slice(e.indexOf("/",9))):""},Uint8ArrayToString:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},getLocalDeviceInfo:function(){return function(e){var t,r=ye.getEnvInfo(),n=r.platform,o="";n!==ce.NODE&&n!==ce.QUICK_APP||(o="");try{n===ce.WEB?window.localStorage?o=localStorage.getItem(e)||"":B.error("localStorage is not supported"):n===ce.WX||n===ce.QQ||n===ce.TT||n===ce.BAIDU||n===ce.UNI?o=r.global.getStorageSync(e)||"":n!==ce.ZFB&&n!==ce.DD||(o=(null===(t=r.global.getStorageSync({key:e}))||void 0===t?void 0:t.data)||"")}catch(t){B.info("get local ".concat(e," failed: "),t)}return B.info("".concat(e," "),o),o}(ge)},setLocalDeviceInfo:function(e){!function(e,t){var r=ye.getEnvInfo(),n=r.platform;if(n!==ce.NODE&&n!==ce.QUICK_APP)if(n===ce.WEB)try{window.localStorage?localStorage.setItem(e,t):B.error("localStorage is not supported")}catch(t){B.error("set local ".concat(e," failed: "),t)}else r.global.setStorage({key:e,data:t,success:function(t){B.debug("set local ".concat(e," success: "),t)},fail:function(t){B.error("set local ".concat(e," failed: "),t)}})}(ge,e)},detectBrowser:function(){if("undefined"==typeof navigator)return"unknown";var e=navigator.userAgent;return/MicroMessenger/i.test(e)?"WeChat":/QQBrowser/i.test(e)?"QQ":!/Chrome/i.test(e)||/Edg/i.test(e)||/OPR/i.test(e)?!/Safari/i.test(e)||/Chrome/i.test(e)||/CriOS/i.test(e)?/Firefox/i.test(e)?"Firefox":/MSIE/i.test(e)||/Trident/i.test(e)?"IE":/Edg/i.test(e)?"Edge":"unknown":"Safari":"Chrome"},getDevicePlatform:function(e){return e.platform===ce.WX&&"undefined"!=typeof uni&&pe(uni)?ce.UNI:e.platform},delay:function(e){return new Promise((function(t){return setTimeout(t,e)}))}};!function(e){e[e.SYNC_INIT=0]="SYNC_INIT",e[e.SYNC_START=1]="SYNC_START",e[e.SYNC_FINISH=2]="SYNC_FINISH"}(ve||(ve={})),__webpack_require__(113),__webpack_require__(3418),__webpack_require__(4346),__webpack_require__(2062),__webpack_require__(5086),__webpack_require__(2637),__webpack_require__(150),__webpack_require__(8345);var Ee,_e,Te=__webpack_require__(3887),Ie=__webpack_require__.n(Te);!function(e){e[e.OFFLINE=0]="OFFLINE",e[e.ONLINE=1]="ONLINE",e[e.UNKNOWN=2]="UNKNOWN",e[e.NONE=3]="NONE"}(Ee||(Ee={})),function(e){e[e.START=0]="START",e[e.START_AND_COMPLETED=1]="START_AND_COMPLETED",e[e.IN_PROGRESS=2]="IN_PROGRESS",e[e.COMPLETED=3]="COMPLETED",e[e.ERROR=4]="ERROR"}(_e||(_e={}));var Oe=function(){return Oe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Oe.apply(this,arguments)},Re={chat:"singleChat",chatroom:"chatRoom",groupchat:"groupChat",singleChat:"singleChat",chatRoom:"chatRoom",groupChat:"groupChat"};function Se(e,t){var r,n,o,i=t||{},a=i.formatCustomExts,c=void 0===a||a,u=i.formatChatType,l=void 0!==u&&u,d=e.id,p=e.payload,h=e.timestamp,f=e.to,m=p.bodies&&p.bodies.length>0?p.bodies[0]:{},v={},g={},y=p.type?p.type:f.indexOf("@conference.easemob.com")>-1?"groupChat":"singleChat";y="chat"===y?"singleChat":y,l&&p.type&&(y=Re[p.type]);var E="";switch(m.type){case"txt":if(Object.prototype.hasOwnProperty.call(m,"subType")&&"sub_combine"===m.subType)E=rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"combine",chatType:y,to:p.to,from:p.from,ext:p.ext,time:h,title:m.title||"",summary:m.summary||"",url:E||"",secret:m.secret||"",file_length:m.file_length||0,filename:m.filename||"",compatibleText:m.msg,combineLevel:m.combineLevel||0};else if(v={id:d,type:"txt",chatType:y,msg:m.msg||"",to:p.to||"",from:p.from,time:h,ext:p.ext},Object.prototype.hasOwnProperty.call(m,"subType")&&"sub_stream"===m.subType&&p.stream){var _=0;switch(p.stream.stream_status){case"stream_start":_=_e.START;break;case"stream_start_completed":_=_e.START_AND_COMPLETED;break;case"stream_in_progress":_=_e.IN_PROGRESS;break;case"stream_completed":case"stream_full":_=_e.COMPLETED;break;default:_=0}var T=0;512===p.stream.stream_error?T=s.MESSAGE_STREAM_INTERVAL_TIMEOUT:513===p.stream.stream_error&&(T=s.MESSAGE_STREAM_TIMEOUT),v.stream={customType:p.stream.stream_type,status:_,errorType:T,text:m.msg,finishReason:p.stream.stream_finish_reason}}break;case"img":E=this.useOwnUploadFun?null==m?void 0:m.url:rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"img",chatType:y,to:p.to,from:p.from,time:h,ext:p.ext,width:(null===(r=m.size)||void 0===r?void 0:r.width)||0,height:(null===(n=m.size)||void 0===n?void 0:n.height)||0,thumb:this.useOwnUploadFun?"":"".concat(E,"&thumbnail=true"),thumb_secret:m.secret,secret:m.secret||"",url:E||"",file_length:m.file_length||0,file:{},isGif:"sub_gif"===m.subType};break;case"video":E=this.useOwnUploadFun?null==m?void 0:m.url:rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"video",chatType:y,from:p.from,to:p.to,thumb:ye.formatAttachUrl.call(this,m.thumb),thumb_secret:m.thumb_secret||"",url:E||"",secret:m.secret||"",filename:m.filename,length:m.length||0,file:{},file_length:m.file_length||0,filetype:p.ext.file_type||"",ext:p.ext,time:h};break;case"loc":v={id:d,type:"loc",chatType:y,from:p.from,to:p.to,buildingName:m.buildingName||"",addr:m.addr,lat:m.lat,lng:m.lng,ext:p.ext,time:h};break;case"audio":E=this.useOwnUploadFun?null==m?void 0:m.url:rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"audio",chatType:y,from:p.from,to:p.to,secret:m.secret||"",ext:p.ext,time:h,url:E||"",file:{},filename:m.filename,length:m.length||0,file_length:m.file_length||0,filetype:p.ext.file_type||""};break;case"file":E=this.useOwnUploadFun?null==m?void 0:m.url:rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"file",chatType:y,from:p.from,to:p.to,ext:p.ext,time:h,url:E||"",secret:m.secret||"",file:{},filename:m.filename||"",file_length:m.file_length||0,filetype:p.ext.file_type||""};break;case"cmd":v={id:d,type:"cmd",chatType:y,from:p.from,to:p.to,ext:p.ext,time:h,action:m.action||""};break;case"custom":var I=m.customExts||{};c&&m.customExts&&(I={},m.customExts.map((function(e){I=Oe(Oe({},I),e)}))),v={id:d,type:"custom",chatType:y,from:p.from,to:p.to,ext:p.ext,time:h,customEvent:m.customEvent||"",customExts:I};break;case"combine":E=rt.call(this,{remotePath:null==m?void 0:m.url,secret:null==m?void 0:m.secret}),v={id:d,type:"combine",chatType:y,msg:m.msg||"",to:p.to||"",from:p.from,time:h,ext:p.ext,title:m.title||"",summary:m.summary||"",url:E||"",compatibleText:m.text,combineLevel:m.combineLevel||0,secret:m.secret||"",filename:m.filename||"",file_length:m.file_length||0};break;default:B.error("unexpected message: ".concat(e))}if(p.msgConfig&&(g.msgConfig=p.msgConfig),null==p?void 0:p.meta){var O=p.meta;O.thread&&(g.chatThread={messageId:O.thread.msg_parent_id,parentId:O.thread.muc_parent_id,chatThreadName:O.thread.thread_name}),O.reaction&&(g.reactions=O.reaction),O.translations&&(g.translations=O.translations)}var R=null===(o=null==p?void 0:p.meta)||void 0===o?void 0:o.edit_msg;if(R){var S=R.edit_time,b=R.operator,C=R.count;v.modifiedInfo={operationTime:S,operatorId:b,operationCount:C}}return Oe(Oe({},v),g)}var be=function(e){return"".concat(e.conversationType,"-").concat(e.conversationId)},Ce=function(e){var t=e.isRecallSelfMsg,r=e.conversation,n=e.recalledMsgTime,o=r.unReadCount,i=void 0===o?0:o,a=r.unreadCountClearTimestamp;return t||(void 0===a?0:a)>n?i:i&&i>0?i-1:0},Ne=function(e){var t,r=0;if(0===e.length)return r;for(t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return r};function Ae(e){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ae(e)}__webpack_require__(6910),__webpack_require__(1415);var Me,we=function(){return we=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},we.apply(this,arguments)};!function(e){e[e.STREAM_START=0]="STREAM_START",e[e.STREAM_START_COMPLETED=1]="STREAM_START_COMPLETED",e[e.STREAM_IN_PROGRESS=2]="STREAM_IN_PROGRESS",e[e.STREAM_COMPLETED=3]="STREAM_COMPLETED",e[e.STREAM_FULL=4]="STREAM_FULL"}(Me||(Me={}));var Ue=new(function(){function e(){this.cache=new Map,this.mergedContent=new Map,this.lastDispatchedSeq=new Map,this.hasCompleted=new Map,this.msgExt=new Map}return e.prototype.addChunk=function(e,t){this.cache.has(e)||(this.cache.set(e,[]),this.mergedContent.set(e,""),this.lastDispatchedSeq.set(e,-1),this.hasCompleted.set(e,!1)),t.streamInfo.status===_e.COMPLETED&&this.hasCompleted.set(e,!0);var r=this.cache.get(e);-1===r.findIndex((function(e){return e.seq===t.seq}))?(r.push(t),r.sort((function(e,t){return e.seq-t.seq}))):B.warn("Stream message chunk already exists",t.seq)},e.prototype.getMergedContent=function(e){return this.mergedContent.get(e)||""},e.prototype.appendToMergedContent=function(e,t){var r=this.mergedContent.get(e)||"";this.mergedContent.set(e,r+t)},e.prototype.getChunks=function(e){return this.cache.get(e)||[]},e.prototype.getSequentialChunks=function(e){var t=this.cache.get(e);if(!t||0===t.length)return[];for(var r=this.lastDispatchedSeq.get(e),n=[],o=0,i=t;o<i.length;o++){var a=i[o];if(0!==n.length){var s=n[n.length-1];if(a.seq!==s.seq+1)break;n.push(a)}else{if(void 0!==r&&-1!==r&&a.seq!==r+1)continue;n.push(a)}}return n},e.prototype.markDispatched=function(e,t){var r;t>(null!==(r=this.lastDispatchedSeq.get(e))&&void 0!==r?r:-1)&&this.lastDispatchedSeq.set(e,t)},e.prototype.getLastDispatchedSeq=function(e){var t;return null!==(t=this.lastDispatchedSeq.get(e))&&void 0!==t?t:-1},e.prototype.isCompleted=function(e){var t=this.cache.get(e);return!(!t||0===t.length)&&t[t.length-1].streamInfo.status===_e.COMPLETED},e.prototype.hasMissingSeqs=function(e){var t=this.cache.get(e);if(!t||0===t.length)return!1;var r=t.find((function(e){return e.streamInfo.status===_e.START||e.streamInfo.status===_e.START_AND_COMPLETED}));if(!r)return!0;for(var n=r.seq,o=Math.max.apply(Math,t.map((function(e){return e.seq}))),i=new Set(t.map((function(e){return e.seq}))),a=n;a<=o;a++)if(!i.has(a))return!0;return!1},e.prototype.setMergedContent=function(e,t){this.mergedContent.set(e,t)},e.prototype.hasReceivedCompleted=function(e){return this.hasCompleted.get(e)||!1},e.prototype.hasReceivedFull=function(e){var t=this.cache.get(e);return!!t&&t.some((function(e){return e.streamInfo.status===Me.STREAM_FULL}))},e.prototype.setMsgExt=function(e,t){this.msgExt.set(e,t)},e.prototype.getMsgExt=function(e){return this.msgExt.get(e)},e.prototype.clear=function(e){this.cache.delete(e),this.mergedContent.delete(e),this.lastDispatchedSeq.delete(e),this.hasCompleted.delete(e),this.msgExt.delete(e)},e.prototype.clearAll=function(){this.cache.clear(),this.mergedContent.clear(),this.lastDispatchedSeq.clear(),this.hasCompleted.clear(),this.msgExt.clear()},e}());function Le(e,t,r,n,o,i,a,s,c,u,l,d,p,h,f,m,v){var g={id:e,chatType:t,type:"txt",to:r,msg:n,from:o,time:i,stream:a,onlineState:s};return function(e,t,r,n,o,i,a,s,c,u){t&&Object.keys(t).length>0&&(e.ext=t),r&&r.length>0&&(e.reactions=r),n&&n.length>0&&(e.translations=n),o&&o.operationCount>0&&(e.modifiedInfo=o),i&&(e.chatThread=i),a&&(e.chatThreadOverview=a),s&&(e.isContentReplaced=s),c&&(e.isRead=c),u&&(e.isDelivered=u)}(g,c,u,l,d,p,h,f,m,v),g}var Pe,xe=function(e,t,r,n,o,i,a,c,u,l,p,h,f,m,v,g,y,E,_){var T,I,O,R,S,b;try{var C=function(e,t){var r,n=null!==(r=e.streamError)&&void 0!==r?r:0;512===n?n=s.MESSAGE_STREAM_INTERVAL_TIMEOUT:513===n&&(n=s.MESSAGE_STREAM_TIMEOUT);var o={customType:e.streamType,seq:Number(e.streamSeq.toString()),status:e.streamStatus,errorType:n,text:t,finishReason:e.streamFinishReason};return void 0!==e.streamSeq&&(e.streamSeq&&"object"===Ae(e.streamSeq)?o.seq=Number(new(d())(e.streamSeq.low,e.streamSeq.high,e.streamSeq.unsigned).toString()):o.seq=Number(e.streamSeq)),o}(t.stream,e.text),N=C.seq,A=C.text,M=(C.finishReason,t.stream.streamStatus),w={msgId:n,seq:N,text:A,streamInfo:C,timestamp:Number(a)};if(Ue.addChunk(n,w),M===Me.STREAM_FULL){var U=Ue.getChunks(n);if(0===U.length){var L=A,P=Ue.getMergedContent(n),x=L.slice(P.length),k=we(we({},C),{status:_e.START_AND_COMPLETED,text:x}),D=Le(n,c,i,L,o,Number(a),k,u,l,p,h,f,m,v,g,y,E);return!_&&(null===(I=null===(T=this.eventHandler)||void 0===T?void 0:T.dispatch)||void 0===I||I.call(T,"onStreamMessage",D)),Ue.setMergedContent(n,L),Ue.clear(n),D}var j=U[U.length-2];if(j&&j.streamInfo.status===_e.START_AND_COMPLETED)return void B.debug("Stream message FULL ignored (already dispatched)");var G=Ue.hasMissingSeqs(n),H=Ue.hasReceivedCompleted(n);if(G||!H){B.debug("Stream message has missing (FULL)",{msgId:n,seq:N}),L=A,P=Ue.getMergedContent(n),x=L.slice(P.length),"seq"in(k=we(we({},C),{status:0===C.errorType?_e.COMPLETED:_e.ERROR,text:x}))&&delete k.seq;var F=U[0].timestamp;return D=Le(n,c,i,L,o,Number(F)||Number(a),k,u,l,p,h,f,m,v,g,y,E),!_&&(null===(R=null===(O=this.eventHandler)||void 0===O?void 0:O.dispatch)||void 0===R||R.call(O,"onStreamMessage",D)),Ue.setMergedContent(n,L),B.debug("Stream message dispatched (FULL with missing)",{msgId:n,seq:N,status:"STREAM_COMPLETED",incrementalLength:x.length,fullLength:L.length}),Ue.clear(n),D}return B.debug("Stream message FULL ignored (no missing)",{msgId:n,seq:N}),void Ue.clear(n)}if(Ue.hasMissingSeqs(n))return void B.debug("Stream message has missing",{msgId:n,seq:N});for(var q=Ue.getSequentialChunks(n),W=0,z=q;W<z.length;W++){var K=z[W],V=Ue.getMergedContent(n)+K.text,J=(x=K.text,K.streamInfo.status);J===Me.STREAM_FULL&&(J=_e.COMPLETED),0!==K.streamInfo.errorType&&(J=_e.ERROR),"seq"in(k=we(we({},K.streamInfo),{status:J,text:x}))&&delete k.seq,D=Le(n,c,i,V,o,(F=Ue.getChunks(n)[0].timestamp)||K.timestamp,k,u,l,p,h,f,m,v,g,y,E),!_&&(null===(b=null===(S=this.eventHandler)||void 0===S?void 0:S.dispatch)||void 0===b||b.call(S,"onStreamMessage",D)),Ue.markDispatched(n,K.seq),Ue.appendToMergedContent(n,K.text),B.debug("Stream message dispatched",{msgId:n,seq:K.seq,status:J,incrementalLength:x.length,mergedLength:V.length})}var Y=Ue.getMergedContent(n);B.debug("Stream message processed",{msgId:n,seq:N,status:M,textLength:A.length,mergedLength:Y.length,dispatchedChunks:q.length})}catch(t){B.error("Error handling stream message",t,{msgId:n,msgBody:e})}},ke=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:ye.getUniqueId(),chatType:e.chatType,ackId:e.id,type:"read",to:e.to,from:e.from||"",ackContent:e.ackContent,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),De=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:ye.getUniqueId(),ackId:e.ackId,type:"delivery",to:e.to,from:e.from||"",isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),Be=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:ye.getUniqueId(),type:"channel",chatType:e.chatType||"singleChat",to:e.to,from:e.from||"",time:Date.now(),isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly}},e}(),je=function(){function e(e){var t=e.type,r=e.id||ye.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(),isChatThread:e.isChatThread},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:ye.getUniqueId(),msg:e.msg,to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),Ge=function(){function e(e){var t=e.type,r=e.id;this.id=r||ye.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:ye.getUniqueId(),type:"cmd",to:e.to,from:e.from||"",chatType:e.chatType||"singleChat",action:e.action,time:Date.now(),ext:e.ext,msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),He=function(){function e(e){var t=e.type,r=e.id||ye.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:ye.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,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),Fe=function(){function e(e){var t=e.type,r=e.id;this.id=r||ye.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:ye.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,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),qe=(__webpack_require__(9449),function(){function e(e){var t=e.type,r=e.id||ye.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&ye.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,isChatThread:e.isChatThread}},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,n,o,i,a,s,c=e.imageType,u=null===(n=null===(r=null===(t=e.file)||void 0===t?void 0:t.data)||void 0===r?void 0:r.type)||void 0===n?void 0:n.toLowerCase(),l=null===(i=null===(o=e.file)||void 0===o?void 0:o.filetype)||void 0===i?void 0:i.toLowerCase(),d=null===(s=null===(a=e.file)||void 0===a?void 0:a.filename)||void 0===s?void 0:s.toLowerCase(),p="image/gif"===u||"gif"===l||"image/gif"===l||!0===(null==d?void 0:d.endsWith(".gif")),h=e.isGif||p,f=h||!0===e.isOriginalImage||"original"===c;return{id:ye.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,file_length:e.file_length,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv,thumbnailWidth:e.thumbnailWidth,thumbnailHeight:e.thumbnailHeight,isGif:h,isOriginalImage:f}},e}()),We=function(){function e(e){var t=e.type,r=e.id||ye.getUniqueId();this.id=r,this.type=t}return e.prototype.set=function(e){e.file=e.file||e.fileInputId&&ye.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,isChatThread:e.isChatThread}},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:ye.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,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),ze=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&&ye.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,isChatThread:e.isChatThread}},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:ye.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,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),Ke=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&&ye.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,isChatThread:e.isChatThread}},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:ye.getUniqueId(),chatType:e.chatType||"singleChat",type:"file",file:e.file,filename:e.filename,fileInputId:e.fileInputId,file_length:e.file_length,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,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv}},e}(),Ve=function(){function e(e){var t=e.type,r=e.id||ye.getUniqueId();this.id=r,this.type=t,this.value=""}return e.create=function(e){return{type:"combine",id:ye.getUniqueId(),to:e.to,from:e.from||"",chatType:e.chatType,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,webhookEnv:e.webhookEnv,compatibleText:e.compatibleText,title:e.title,summary:e.summary,messageList:e.messageList,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete}},e}(),Je=function(){function e(t,r){return this.type=t,this.id=r||ye.getUniqueId(),e.createOldMsg({type:t,id:this.id})}return e.createOldMsg=function(e){switch(e.type){case"read":return new ke({type:"read",id:e.id});case"delivery":return new De({type:"delivery",id:e.id});case"channel":return new Be({type:"channel",id:e.id});case"txt":return new je({type:"txt",id:e.id});case"cmd":return new Ge({type:"cmd",id:e.id});case"custom":return new He({type:"custom",id:e.id});case"loc":return new Fe({type:"loc",id:e.id});case"img":return new qe({type:"img",id:e.id});case"audio":return new We({type:"audio",id:e.id});case"video":return new ze({type:"video",id:e.id});case"file":return new Ke({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)?qe.create(e):function(e){return"cmd"===e.type&&!("version"in e)}(e)?Ge.create(e):function(e){return"file"===e.type&&!("version"in e)}(e)?Ke.create(e):function(e){return"audio"===e.type&&!("version"in e)}(e)?We.create(e):function(e){return"video"===e.type&&!("version"in e)}(e)?ze.create(e):function(e){return"custom"===e.type&&!("version"in e)}(e)?He.create(e):function(e){return"loc"===e.type&&!("version"in e)}(e)?Fe.create(e):function(e){return"channel"===e.type&&!("version"in e)}(e)?Be.create(e):function(e){return"delivery"===e.type&&!("version"in e)}(e)?De.create(e):function(e){return"read"===e.type&&!("version"in e)}(e)?ke.create(e):function(e){return"combine"===e.type&&!("version"in e)}(e)?Ve.create(e):{}:je.create(e);var t},e.prototype.set=function(e){},e.getFileUrl=ye.getFileUrl,e.createImageMessage=function(e){return function(e){var t,r="image/gif"===e.file.filetype||(null===(t=e.file.filename)||void 0===t?void 0:t.toLowerCase().endsWith(".gif")),n=r||!!e.isOriginalImage;return{id:ye.getUniqueId(),chatType:e.chatType,type:"img",to:e.to,from:e.from||"",file:{url:"",filename:e.file.filename,filetype:e.file.filetype||"",data:e.file.data||void 0},filename:e.file.filename,filetype:e.file.filetype||"",width:e.width,height:e.height,file_length:e.file.size,ext:e.ext,time:Date.now(),msgConfig:e.msgConfig,onFileUploadError:e.onFileUploadError,onFileUploadComplete:e.onFileUploadComplete,onFileUploadProgress:e.onFileUploadProgress,isChatThread:e.isChatThread,priority:e.priority,deliverOnlineOnly:e.deliverOnlineOnly,receiverList:e.receiverList,isGif:r,isOriginalImage:n,_useInternalUpload:!!e.file.path||void 0,_filePath:e.file.path}}(e)},e.download=ye.download,e.parseDownloadResponse=ye.parseDownloadResponse,e}();!function(e){e[e.CREATE=0]="CREATE",e[e.FAIL=1]="FAIL",e[e.INPROGRESS=2]="INPROGRESS",e[e.SUCCESS=3]="SUCCESS"}(Pe||(Pe={}));var Ye,Xe=function(){return Xe=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Xe.apply(this,arguments)},Qe=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},$e=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};!function(e){e["chat:user"]="singleChat",e["chat:group"]="groupChat",e["chat:room"]="chatRoom"}(Ye||(Ye={}));var Ze={0:"TEXT",1:"IMAGE",2:"VIDEO",3:"LOCATION",4:"VOICE",5:"FILE",6:"COMMAND",7:"CUSTOM",8:"COMBINE"};function et(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 n=e[r].varintValue,o=new(d())(n.low,n.high,n.unsigned).toString();t[e[r].key]=0!==Number(o)}else 2!==e[r].type&&3!==e[r].type&&4!==e[r].type||(n=e[r].varintValue,o=new(d())(n.low,n.high,n.unsigned).toString(),t[e[r].key]=Number(o));return t}function rt(e){var t="";return e.remotePath&&(t=ye.formatAttachUrl.call(this,e.remotePath),e.remotePath.includes("?em-redirect")||(t="".concat(t,"?em-redirect=true"),e.secretKey&&(t="".concat(t,"&share-secret=").concat(e.secretKey)))),t}function nt(e,t,r){var n=ye.formatAttachUrl.call(this,e),o=n.indexOf("#"),i=o>=0?n.slice(0,o):n,a=o>=0?n.slice(o):"",s=i.indexOf("?"),c=s>=0?i.slice(0,s):i,u=s>=0?i.slice(s+1):"",l=u?u.split("&"):[],d=function(e){return l.some((function(t){return t.split("=")[0]===e}))};return r&&!d("size")&&l.push("size=".concat(r)),d("em-redirect")||l.push("em-redirect=true"),t&&!d("share-secret")&&l.push("share-secret=".concat(t)),"".concat(c).concat(l.length?"?".concat(l.join("&")):"").concat(a)}function ot(e,t){var r,n,o=t.from&&t.from.name;if(o===this.context.userId){var i=null===(r=null==e?void 0:e.from)||void 0===r?void 0:r.clientResource;o===(null===(n=null==t?void 0:t.to)||void 0===n?void 0:n.name)&&i&&i!==this.clientResource&&(o="".concat(o,"/").concat(i))}return o}function it(e,t){var r,n=t.to&&t.to.name;return(null===(r=null==e?void 0:e.to)||void 0===r?void 0:r.clientResource)&&(n="".concat(n,"/").concat(e.to.clientResource)),n}function at(e){var t,r,n,o,i,a,s,c,u,l,d,p,h,f,m,v,g,y,E,_,T,I,O,R,S,b,C;return Qe(this,void 0,void 0,(function(){var N,A,M,w,U,L,P,x,k,D,j,G,H,F,q,W,z,K,V,J,Y,X,Q,$,Z,ee,te,re,ne,oe,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ve,ge,Ee,_e,Te,Ie,Oe,Re,be,Ce,Ne;return $e(this,(function(Ae){switch(Ae.label){case 0:switch(N=e.status,A=e.thirdMessage,M=e.msgBody,w=e.msgId,U=e.type,L=e.from,P=e.to,x=e.time,k=e.onlineState,D=e.chatType,j=e.ignoreCallback,G=e.priority,H=e.format,F=e.broadcast,q=void 0!==F&&F,W=e.isContentReplaced,z=void 0!==W&&W,K=e.meta,V={},J={},Y=N.errorCode>0,X=N.errorCode,Q=N.reason,$={},Z=[],ee=[],te={},re=null,ne=null,ie=!1,ae=!1,A.ext&&($=et(A.ext)),A.meta&&"string"==typeof A.meta&&((se=JSON.parse(A.meta)).reaction&&(Z=se.reaction).forEach((function(e){e.isAddedBySelf=e.state,delete e.state})),se.translations&&(ee=se.translations),se.edit_msg&&(ce=se.edit_msg,ue=ce.count,le=ce.operator,de=ce.edit_time,te={operationTime:de,operatorId:le,operationCount:ue}),se.thread&&"{}"!==JSON.stringify(se.thread)&&(re={messageId:se.thread.msg_parent_id,parentId:se.thread.muc_parent_id,chatThreadName:se.thread.thread_name}),se.thread_overview&&"{}"!==JSON.stringify(se.thread_overview)&&(ne={id:se.thread_overview.id,parentId:se.thread_overview.muc_parent_id,name:se.thread_overview.name,lastMessage:se.thread_overview.last_message&&"{}"!==JSON.stringify(se.thread_overview.last_message)?Se.call(this,se.thread_overview.last_message):null,createTimestamp:se.thread_overview.create_timestamp,updateTimestamp:se.thread_overview.update_timestamp,messageCount:se.thread_overview.message_count||0}),se.isDelivered&&(ie=!0),se.isRead&&(ae=!0)),M.type){case 0:return[3,1];case 1:return[3,8];case 2:return[3,11];case 3:return[3,14];case 4:return[3,17];case 5:return[3,20];case 6:return[3,23];case 7:return[3,24];case 8:return[3,27]}return[3,28];case 1:return Object.prototype.hasOwnProperty.call(M,"subType")&&0===M.subType?(oe=rt.call(this,M),pe={id:w,type:"combine",chatType:D,to:P,from:L,ext:$,time:Number(x),onlineState:k,title:M.title||"",summary:M.summary||"",url:oe||"",secret:M.secretKey||"",file_length:M.fileLength||0,filename:M.displayName||"",compatibleText:M.text,combineLevel:M.combineLevel||0},V.msgConfig&&(pe.msgConfig=V.msgConfig),Z.length>0&&(pe.reactions=Z),re&&(pe.chatThread=re),ne&&(pe.chatThreadOverview=ne),"chatRoom"===D&&(pe.priority=G,pe.broadcast=q),te.operationCount>0&&(pe.modifiedInfo=te),z&&(pe.isContentReplaced=z),ae&&(pe.isRead=!0),ie&&(pe.isDelivered=!0),J=pe,j?[3,3]:[4,null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r?void 0:r.storeMessage(pe,Pe.SUCCESS)]):[3,4];case 2:Ae.sent(),null===(n=this.eventHandler)||void 0===n||n.dispatch("onCombineMessage",pe),Ae.label=3;case 3:return[3,29];case 4:return Object.prototype.hasOwnProperty.call(M,"subType")&&10===M.subType&&A.stream?(he=xe.call(this,M,A,K,w,L,P,x,D,k,$,Z,ee,te,re,ne,z,ae,ie,null!=j&&j),J=he,[3,29]):[3,5];case 5:return!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,data:M.text,ext:$,sourceMsg:M.text,time:x,msgConfig:A.msgConfig,onlineState:k}).msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onTextMessage&&this.onTextMessage(V),fe={id:w,type:"txt",chatType:D,msg:M.text,to:P,from:L,ext:$,time:Number(x),onlineState:k},V.msgConfig&&(fe.msgConfig=V.msgConfig),Z.length>0&&(fe.reactions=Z),re&&(fe.chatThread=re),ne&&(fe.chatThreadOverview=ne),ee.length>0&&(fe.translations=ee),te.operationCount>0&&(fe.modifiedInfo=te),"chatRoom"===D&&(fe.priority=G,fe.broadcast=q),z&&(fe.isContentReplaced=z),ae&&(fe.isRead=!0),ie&&(fe.isDelivered=!0),J=fe,j?[3,7]:[4,null===(i=null===(o=this._localCache)||void 0===o?void 0:o.getInstance())||void 0===i?void 0:i.storeMessage(fe,Pe.SUCCESS)];case 6:Ae.sent(),null===(a=this.eventHandler)||void 0===a||a.dispatch("onTextMessage",fe),Ae.label=7;case 7:return[3,29];case 8:return me=(null===(s=null==M?void 0:M.size)||void 0===s?void 0:s.width)||0,ve=(null===(c=null==M?void 0:M.size)||void 0===c?void 0:c.height)||0,oe=this.useOwnUploadFun?M.remotePath:rt.call(this,M),!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,url:oe,secret:M.secretKey,filename:M.displayName,thumb:this.useOwnUploadFun?"":"".concat(oe,"&thumbnail=true"),thumb_secret:M.secretKey,file_length:M.fileLength||"",width:me,height:ve,filetype:M.filetype||"",accessToken:this.token,ext:$,time:x,msgConfig:A.msgConfig,onlineState:k}).delay&&delete V.delay,!V.msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onPictureMessage&&this.onPictureMessage(V),ge={id:w,type:"img",chatType:D,from:L,to:P,url:oe||"",width:me,height:ve,secret:M.secretKey||"",thumb:this.useOwnUploadFun?"":"".concat(oe,"&thumbnail=true"),thumb_secret:M.secretKey,file_length:M.fileLength||0,ext:$,time:Number(x),onlineState:k},V.msgConfig&&(ge.msgConfig=V.msgConfig),Z.length>0&&(ge.reactions=Z),re&&(ge.chatThread=re),ne&&(ge.chatThreadOverview=ne),"chatRoom"===D&&(ge.priority=G,ge.broadcast=q),te.operationCount>0&&(ge.modifiedInfo=te),z&&(ge.isContentReplaced=z),ae&&(ge.isRead=!0),ie&&(ge.isDelivered=!0),Object.prototype.hasOwnProperty.call(M,"subType")&&1===M.subType&&(ge.isGif=!0),ge.isOriginalImage=!(2===M.imageType&&!ge.isGif),M.remotePath&&!this.useOwnUploadFun?(ge.originalImageUrl=nt.call(this,M.remotePath,M.secretKey),ge.bigImageUrl=nt.call(this,M.remotePath,M.secretKey,"large"),ge.thumb="".concat(oe,"&thumbnail=true")):M.remotePath&&this.useOwnUploadFun&&(ge.originalImageUrl=M.remotePath),J=ge,j?[3,10]:[4,null===(l=null===(u=this._localCache)||void 0===u?void 0:u.getInstance())||void 0===l?void 0:l.storeMessage(ge,Pe.SUCCESS)];case 9:Ae.sent(),null===(d=this.eventHandler)||void 0===d||d.dispatch("onImageMessage",ge),Ae.label=10;case 10:return[3,29];case 11:return oe=this.useOwnUploadFun?M.remotePath:rt.call(this,M),!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,url:oe,secret:M.secretKey,filename:M.displayName,length:M.duration||"",file_length:M.fileLength||"",filetype:M.filetype||"",accessToken:this.token||"",ext:$,time:x,msgConfig:A.msgConfig,onlineState:k}).delay&&delete V.delay,!V.msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onVideoMessage&&this.onVideoMessage(V),Ee={id:w,type:"video",chatType:D,from:L,to:P,url:oe,secret:M.secretKey,thumb:ye.formatAttachUrl.call(this,M.thumbnailRemotePath),thumb_secret:M.thumbnailSecretKey,filename:M.displayName,length:M.duration||0,file:{},file_length:M.fileLength||0,filetype:M.filetype||"",accessToken:this.token||"",ext:$,time:Number(x),onlineState:k},V.msgConfig&&(Ee.msgConfig=V.msgConfig),Z.length>0&&(Ee.reactions=Z),re&&(Ee.chatThread=re),ne&&(Ee.chatThreadOverview=ne),"chatRoom"===D&&(Ee.priority=G,Ee.broadcast=q),te.operationCount>0&&(Ee.modifiedInfo=te),z&&(Ee.isContentReplaced=z),ae&&(Ee.isRead=!0),ie&&(Ee.isDelivered=!0),J=Ee,j?[3,13]:[4,null===(h=null===(p=this._localCache)||void 0===p?void 0:p.getInstance())||void 0===h?void 0:h.storeMessage(Ee,Pe.SUCCESS)];case 12:Ae.sent(),null===(f=this.eventHandler)||void 0===f||f.dispatch("onVideoMessage",Ee),Ae.label=13;case 13:return[3,29];case 14:return!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,addr:M.address,buildingName:M.buildingName,lat:M.latitude,lng:M.longitude,ext:$,time:x,msgConfig:A.msgConfig,onlineState:k}).delay&&delete V.delay,!V.msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onLocationMessage&&this.onLocationMessage(V),_e={id:w,type:"loc",chatType:D,from:L,to:P,buildingName:M.buildingName,addr:M.address,lat:M.latitude,lng:M.longitude,ext:$,time:Number(x),onlineState:k},V.msgConfig&&(_e.msgConfig=V.msgConfig),Z.length>0&&(_e.reactions=Z),re&&(_e.chatThread=re),ne&&(_e.chatThreadOverview=ne),"chatRoom"===D&&(_e.priority=G,_e.broadcast=q),te.operationCount>0&&(_e.modifiedInfo=te),z&&(_e.isContentReplaced=z),ae&&(_e.isRead=!0),ie&&(_e.isDelivered=!0),J=_e,j?[3,16]:[4,null===(v=null===(m=this._localCache)||void 0===m?void 0:m.getInstance())||void 0===v?void 0:v.storeMessage(_e,Pe.SUCCESS)];case 15:Ae.sent(),null===(g=this.eventHandler)||void 0===g||g.dispatch("onLocationMessage",_e),Ae.label=16;case 16:return[3,29];case 17:return oe=this.useOwnUploadFun?M.remotePath:rt.call(this,M),!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,url:oe,secret:M.secretKey,filename:M.displayName,file_length:M.fileLength||"",accessToken:this.token||"",ext:$,length:M.duration,time:x,msgConfig:A.msgConfig,onlineState:k}).delay&&delete V.delay,!V.msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onAudioMessage&&this.onAudioMessage(V),Te={id:w,type:"audio",chatType:D,from:L,to:P,url:oe,secret:M.secretKey,file:{},filename:M.displayName,length:M.duration||0,file_length:M.fileLength||0,filetype:M.filetype||"",accessToken:this.token||"",ext:$,time:Number(x),onlineState:k},V.msgConfig&&(Te.msgConfig=V.msgConfig),Z.length>0&&(Te.reactions=Z),re&&(Te.chatThread=re),ne&&(Te.chatThreadOverview=ne),"chatRoom"===D&&(Te.priority=G,Te.broadcast=q),te.operationCount>0&&(Te.modifiedInfo=te),z&&(Te.isContentReplaced=z),ae&&(Te.isRead=!0),ie&&(Te.isDelivered=!0),J=Te,j?[3,19]:[4,null===(E=null===(y=this._localCache)||void 0===y?void 0:y.getInstance())||void 0===E?void 0:E.storeMessage(Te,Pe.SUCCESS)];case 18:Ae.sent(),null===(_=this.eventHandler)||void 0===_||_.dispatch("onAudioMessage",Te),Ae.label=19;case 19:return[3,29];case 20:return oe=this.useOwnUploadFun?M.remotePath:rt.call(this,M),!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,url:oe,secret:M.secretKey,filename:M.displayName,file_length:M.fileLength,accessToken:this.token||"",ext:$,time:x,msgConfig:A.msgConfig,onlineState:k}).delay&&delete V.delay,!V.msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onFileMessage&&this.onFileMessage(V),Ie={id:w,type:"file",chatType:D,from:L,to:P,url:oe,secret:M.secretKey,file:{},filename:M.displayName,length:M.duration||0,file_length:M.fileLength||0,filetype:M.filetype||"",accessToken:this.token||"",ext:$,time:Number(x),onlineState:k},V.msgConfig&&(Ie.msgConfig=V.msgConfig),Z.length>0&&(Ie.reactions=Z),re&&(Ie.chatThread=re),ne&&(Ie.chatThreadOverview=ne),"chatRoom"===D&&(Ie.priority=G,Ie.broadcast=q),te.operationCount>0&&(Ie.modifiedInfo=te),z&&(Ie.isContentReplaced=z),ae&&(Ie.isRead=!0),ie&&(Ie.isDelivered=!0),J=Ie,j?[3,22]:[4,null===(I=null===(T=this._localCache)||void 0===T?void 0:T.getInstance())||void 0===I?void 0:I.storeMessage(Ie,Pe.SUCCESS)];case 21:Ae.sent(),null===(O=this.eventHandler)||void 0===O||O.dispatch("onFileMessage",Ie),Ae.label=22;case 22:return[3,29];case 23:return!(V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,action:M.action,ext:$,time:x,msgConfig:A.msgConfig,onlineState:k}).msgConfig&&delete A.msgConfig,V.error=Y,V.errorText=Q,V.errorCode=X,!j&&this.onCmdMessage&&this.onCmdMessage(V),Oe={id:w,type:"cmd",chatType:D,from:L,to:P,action:M.action,ext:$,time:Number(x),onlineState:k},V.msgConfig&&(Oe.msgConfig=V.msgConfig),Z.length>0&&(Oe.reactions=Z),re&&(Oe.chatThread=re),ne&&(Oe.chatThreadOverview=ne),"chatRoom"===D&&(Oe.priority=G,Oe.broadcast=q),te.operationCount>0&&(Oe.modifiedInfo=te),z&&(Oe.isContentReplaced=z),ae&&(Oe.isRead=!0),ie&&(Oe.isDelivered=!0),J=Oe,j||null===(R=this.eventHandler)||void 0===R||R.dispatch("onCmdMessage",Oe),[3,29];case 24:return Re={},be={},A.contents[0].customExts&&(Re=et(A.contents[0].customExts)),A.contents[0].params&&(be=et(A.contents[0].params)),V={id:w,type:U,contentsType:Ze[M.type],from:L,to:P,customEvent:M.customEvent,params:be,customExts:Re,ext:$,time:x,onlineState:k},!j&&this.onCustomMessage&&this.onCustomMessage(V),Ce={id:w,type:"custom",chatType:D,from:L,to:P,customEvent:M.customEvent,params:be,customExts:Re,ext:$,time:Number(x),onlineState:k},V.msgConfig&&(Ce.msgConfig=V.msgConfig),Z.length>0&&(Ce.reactions=Z),re&&(Ce.chatThread=re),ne&&(Ce.chatThreadOverview=ne),te.operationCount>0&&(Ce.modifiedInfo=te),"chatRoom"===D&&(Ce.priority=G,Ce.broadcast=q),z&&(Ce.isContentReplaced=z),ae&&(Ce.isRead=!0),ie&&(Ce.isDelivered=!0),J=Ce,j?[3,26]:[4,null===(b=null===(S=this._localCache)||void 0===S?void 0:S.getInstance())||void 0===b?void 0:b.storeMessage(Ce,Pe.SUCCESS)];case 25:Ae.sent(),null===(C=this.eventHandler)||void 0===C||C.dispatch("onCustomMessage",Ce),Ae.label=26;case 26:return[3,29];case 27:return oe=rt.call(this,M),Ne={id:w,type:"combine",chatType:D,to:P,from:L,ext:$,time:Number(x),onlineState:k,title:M.title||"",summary:M.summary||"",url:oe||"",secret:M.secretKey||"",file_length:M.fileLength||0,filename:M.displayName||"",compatibleText:M.text,combineLevel:M.combineLevel||0},V.msgConfig&&(Ne.msgConfig=V.msgConfig),Z.length>0&&(Ne.reactions=Z),re&&(Ne.chatThread=re),ne&&(Ne.chatThreadOverview=ne),"chatRoom"===D&&(Ne.priority=G,Ne.broadcast=q),te.operationCount>0&&(Ne.modifiedInfo=te),z&&(Ne.isContentReplaced=z),ae&&(Ne.isRead=!0),ie&&(Ne.isDelivered=!0),J=Ne,!j&&this.eventHandler&&this.eventHandler.dispatch("onCombineMessage",Ne),[3,29];case 28:return B.error("Unknow message type, message:",M),[3,29];case 29:return H?[2,J]:[2,V]}}))}))}function st(e,t,r){if(this.delivery&&e!==t){var n=this.getUniqueId(),o=new Je("delivery",n);o.set({ackId:r,to:e}),B.debug("send delivery ack"),this.send(o.body)}}var ct=function(e,t,r,n,o){var i,a,s,c,u,l,p,h,f,m,v,g,y,E,_,T,I,O,R,S,b,C,N,A,M,w,U,L,P,x;return Qe(this,void 0,void 0,(function(){var k,D,j,G,H,F,q,W,z,K,V,J,Y,X,Q,$,Z,ee,te,re,ne,oe,ie,ae,se,ce,ue,le,de,pe,he,fe,me,ve,ge,Ee,_e,Te,Ie,Oe,Re,Se,Ne,Ae,Me;return $e(this,(function(we){switch(we.label){case 0:if(k=new(d())(e.timestamp.low,e.timestamp.high,e.timestamp.unsigned).toString(),D=this.root.lookup("easemob.pb.MessageBody"),j=D.decode(e.payload),G=3,H=!1,F=new(d())(e.id.low,e.id.high,e.id.unsigned).toString(),o&&e.from&&e.from.name===this.context.userId&&e.from.clientResource===this.clientResource&&j.type===sr.CHATROOM)return[2,B.debug("Discard your own chat room message:",F)];if(q=(null===(i=e.from)||void 0===i?void 0:i.name)||"",W=e.to?e.to.name:"",z=!!e.to&&-1!==e.to.domain.indexOf("conference"),this._load_msg_cache.some((function(e){return e.msgId===F}))&&10!==j.contents[0].subType&&!r)return[2,B.debug("Discard message in cache:",F)];if(this._load_msg_cache.length<=this.max_cache_length||this._load_msg_cache.shift(),this._load_msg_cache.push({msgId:F,from:q,to:W,isGroup:z}),e.meta&&e.meta.length){if(K=ye.parseNotify(e.meta),V=K.is_online,J=K.callback_replace,this.useReplacedMessageContents&&J&&(H=!0),V||0===V)switch(V){case 0:G=0;break;case 1:G=1;break;default:G=2}}else G=3;switch(Y=j.ackMessageId?new(d())(j.ackMessageId.low,j.ackMessageId.high,j.ackMessageId.unsigned).toString():"",X="",Q=ot.call(this,e,j),$=it.call(this,e,j),B.debug("received message:",{metaId:F,metaNs:e.ns,type:j.type,from:Q,to:$,contentType:null===(s=null===(a=j.contents)||void 0===a?void 0:a[0])||void 0===s?void 0:s.type,contentLen:null===(c=j.contents)||void 0===c?void 0:c.length}),j.type){case sr.SINGLECHAT:return[3,1];case sr.GROUPCHAT:return[3,2];case sr.CHATROOM:return[3,3];case sr.READ_ACK:return[3,4];case sr.DELIVER_ACK:return[3,5];case sr.RECALL:return[3,6];case sr.CHANNEL_ACK:return[3,15];case sr.EDIT:return[3,16]}return[3,20];case 1:return X="chat","agoraToken"===this.grantType&&(X="singleChat"),this.delivery&&!r&&Q!==this.context.userId&&10!==(null===(u=j.contents[0])||void 0===u?void 0:u.subType)&&st.call(this,Q,$,F),[3,21];case 2:return X="groupchat","agoraToken"===this.grantType&&(X="groupChat"),[3,21];case 3:return X="chatroom","agoraToken"===this.grantType&&(X="chatRoom"),G=1,[3,21];case 4:return X="read_ack",Z=void 0,j.ext[0]&&JSON.parse(j.ext[0].stringValue)?(Z={id:F,type:"read",from:Q,to:$,mid:Y,groupReadCount:j.ext[0]&&JSON.parse(j.ext[0].stringValue),ackContent:j.ackContent,onlineState:G},this.onReadMessage&&this.onReadMessage(Z),null===(l=this.eventHandler)||void 0===l||l.dispatch("onReadMessage",Z),[2]):(Z={id:F,type:"read",from:Q,to:$,mid:Y,onlineState:G},this.onReadMessage&&this.onReadMessage(Z),null===(p=this.eventHandler)||void 0===p||p.dispatch("onReadMessage",Z),[2]);case 5:return X="deliver_ack",this.onDeliveredMessage&&this.onDeliveredMessage({id:F,type:"delivery",from:Q,to:$,mid:Y,onlineState:G}),ee={id:F,type:"delivery",from:Q,to:$,mid:Y,onlineState:G},null===(h=this.eventHandler)||void 0===h||h.dispatch("onDeliveredMessage",ee),[2];case 6:return X="recall",te="",e.ext&&(te=(null===(f=et(e.ext))||void 0===f?void 0:f.recallMessageExtensionInfo)||""),re={id:F,from:Q||"admin",to:$,mid:Y,ext:te,onlineState:G},ne=$===this.user?Q:$,[4,null===(v=null===(m=this._localCache)||void 0===m?void 0:m.getInstance())||void 0===v?void 0:v.getMessageByServerMsgId(re.mid)];case 7:return(oe=we.sent())?[4,null===(y=null===(g=this._localCache)||void 0===g?void 0:g.getInstance())||void 0===y?void 0:y.removeMsgByServerMsgId(re.mid)]:[3,9];case 8:we.sent(),we.label=9;case 9:return"singleChat"!==(null==oe?void 0:oe.chatType)&&"groupChat"!==(null==oe?void 0:oe.chatType)?[3,14]:(ie=(null==oe?void 0:oe.from)===this.user||""===(null==oe?void 0:oe.from),[4,null===(_=null===(E=this._localCache)||void 0===E?void 0:E.getInstance())||void 0===_?void 0:_.getConversationLastMessage(ne,oe.chatType)]);case 10:return ae=we.sent(),[4,null===(I=null===(T=this._localCache)||void 0===T?void 0:T.getInstance())||void 0===I?void 0:I.getConversationBySessionId(be({conversationId:ne,conversationType:oe.chatType}))];case 11:return(se=we.sent())?[4,null===(R=null===(O=this._localCache)||void 0===O?void 0:O.getInstance())||void 0===R?void 0:R.updateLocalConversation(be({conversationId:ne,conversationType:oe.chatType}),{lastMessageId:null==ae?void 0:ae.serverMsgId,unReadCount:Ce({conversation:se,isRecallSelfMsg:ie,recalledMsgTime:oe.time})})]:[3,13];case 12:we.sent(),we.label=13;case 13:we.label=14;case 14:return this.onRecallMessage&&this.onRecallMessage(re),null===(S=this.eventHandler)||void 0===S||S.dispatch("onRecallMessage",re),[2];case 15:return this.onChannelMessage&&this.onChannelMessage({id:F,type:"channel",chatType:"singleChat",from:Q,to:$,time:Number(k),onlineState:G}),ce={id:F,type:"channel",chatType:"singleChat",from:Q,to:$,time:Number(k),onlineState:G},null===(b=this.eventHandler)||void 0===b||b.dispatch("onChannelMessage",ce),[2];case 16:return ue={errorCode:0,reason:""},le="",de=0,pe="",j.meta&&"string"==typeof j.meta&&(he=JSON.parse(j.meta)).edit_msg&&(fe=he.edit_msg,me=fe.sender,ve=fe.send_time,ge=fe.chat_type,le=me,de=ve,pe=Ye[ge]),Ee=j.editMessageId&&new(d())(j.editMessageId.low,j.editMessageId.high,j.editMessageId.unsigned).toString(),_e=j.editScope,[4,at.call(this,{status:ue,thirdMessage:j,msgBody:j.contents[0],msgId:Ee,type:X,from:le,to:$,time:de,onlineState:G,ignoreCallback:!0,format:!0,isContentReplaced:H})];case 17:return(Te=we.sent()).chatType=pe,e.ignoreCallback?[2,Te]:Te?[4,null===(N=null===(C=this._localCache)||void 0===C?void 0:C.getInstance())||void 0===N?void 0:N.getMessageByServerMsgId(Te.id)]:[3,19];case 18:(Ie=we.sent())&&(Oe=Ie.ext||{},(_e===cr.BODY_AND_EXT||Object.keys(Te.ext||{}).length>0)&&(Oe=Te.ext),"txt"===Te.type&&"txt"===Ie.type?null===(M=null===(A=this._localCache)||void 0===A?void 0:A.getInstance())||void 0===M||M.putMessageToDB(Xe(Xe({},Ie),{msg:Te.msg,modifiedInfo:Te.modifiedInfo,translations:Te.translations,ext:Oe})):"custom"===Te.type&&"custom"===Ie.type?null===(U=null===(w=this._localCache)||void 0===w?void 0:w.getInstance())||void 0===U||U.putMessageToDB(Xe(Xe({},Ie),{ext:Oe,customExts:Te.customExts,customEvent:Te.customEvent,modifiedInfo:Te.modifiedInfo})):null===(P=null===(L=this._localCache)||void 0===L?void 0:L.getInstance())||void 0===P||P.putMessageToDB(Xe(Xe({},Ie),{ext:Oe,modifiedInfo:Te.modifiedInfo}))),we.label=19;case 19:return null===(x=this.eventHandler)||void 0===x||x.dispatch("onModifiedMessage",Te),[2];case 20:return B.error("unexpected message type: ".concat(j.type)),[2];case 21:Re="normal",Ne=!1,"chat"===X.toLowerCase()||"singleChat"===X?Se="singleChat":"groupchat"===X.toLowerCase()||"groupChat"===X?Se="groupChat":(Se="chatRoom",G=1,e.ext&&(Ae=et(e.ext),Ne=!!(null==Ae?void 0:Ae.is_broadcast),Re=0===Ae.chatroom_msg_tag?"high":2===Ae.chatroom_msg_tag?"low":"normal")),Me=0,we.label=22;case 22:return Me<j.contents.length?[4,at.call(this,{status:t,thirdMessage:j,msgBody:j.contents[Me],msgId:F,type:X,from:Q,to:$,time:k,onlineState:G,chatType:Se,ignoreCallback:r,priority:Re,format:n,broadcast:Ne,isContentReplaced:H,meta:e})]:[3,25];case 23:return[2,we.sent()];case 24:return Me++,[3,22];case 25:return[2]}}))}))},ut=function(){return ut=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ut.apply(this,arguments)},lt=["public","members_only","allow_user_invites","invite_need_confirm"],dt={name:"name",title:"name",description:"description",public:"public",members_only:"approval",allow_user_invites:"allowInvites",max_users:"maxUsers",invite_need_confirm:"inviteNeedConfirm",custom:"ext",last_modified:"lastModified",avatar:"avatar"};function pt(e,t){var r,n,o,i,a,s,c=this,u=this.context,l=u.userId,d=u.jid,p=t.from.name===l&&d.clientResource!==t.from.clientResource;return t.isThread?(o={id:t.mucId.name,name:t.mucName,operation:"",parentId:t.mucParentId.name,operator:t.from.name,userName:t.to.length?t.to[0].name:""},i={chatThreadId:t.mucId.name,chatThreadName:t.mucName,operation:"",parentId:t.mucParentId.name}):(n={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},a={operation:"",id:t.mucId.name,from:t.from.name},t.isChatroom&&(null===(r=null==t?void 0:t.eventInfo)||void 0===r?void 0:r.ext)&&(s=JSON.parse(t.eventInfo.ext))),({45:function(){var e,r,n;a.operation="memberAttributesUpdate";var o=JSON.parse(null===(e=null==t?void 0:t.eventInfo)||void 0===e?void 0:e.ext)||{};a.attributes=o.properties||{},a.userId=o.username||"",p?null===(r=c.eventHandler)||void 0===r||r.dispatch("onMultiDeviceEvent",a):null===(n=c.eventHandler)||void 0===n||n.dispatch("onGroupEvent",a)},44:function(){var e;a.operation="removeChatRoomAttributes",a.attributes=s.result.successKeys,s.result.successKeys.length>0&&(null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a))},43:function(){var e;a.operation="updateChatRoomAttributes";var t={};s.result.successKeys.forEach((function(e){t[e]=s.properties[e]})),a.attributes=t,s.result.successKeys.length>0&&(null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a))},42:function(){},41:function(){},40:function(){},39:function(){},38:function(){var e;i.operation="chatThreadNameUpdate",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},37:function(){var e;o.operation="userRemove",null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatThreadChange",o)},36:function(){var e;i.operation="chatThreadLeave",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},35:function(){var e;i.operation="chatThreadJoin",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},34:function(){var e;i.operation="chatThreadDestroy",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},33:function(){var e;i.operation="chatThreadCreate",null===(e=c.eventHandler)||void 0===e||e.dispatch("onMultiDeviceEvent",i)},32:function(){var e,r,o,i;n.type=t.isChatroom?"rmChatRoomMute":"rmGroupMute",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="unmuteAllMembers",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},31:function(){var e,r,o,i;n.type=t.isChatroom?"muteChatRoom":"muteGroup",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="muteAllMembers",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},30:function(){var e,r,o,i;n.type=t.isChatroom?"rmUserFromChatRoomWhiteList":"rmUserFromGroupWhiteList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeAllowlistMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},29:function(){var e,r,o,i;n.type=t.isChatroom?"addUserToChatRoomWhiteList":"addUserToGroupWhiteList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="addUserToAllowlist",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},28:function(){var e,r,o,i;n.type="deleteFile",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="deleteFile",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},27:function(){var e,r,o,i;n.type="uploadFile",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="uploadFile",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},26:function(){var e,r,o,i;n.type="deleteAnnouncement",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="deleteAnnouncement",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},25:function(){var e,r,o,i;n.type="updateAnnouncement",n.announcement=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="updateAnnouncement",a.announcement=t.reason,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},24:function(){var e,r,o,i;n.type="removeMute",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="unmuteMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},23:function(){var e,r,o,i;if(n.type="addMute",c.onPresence&&c.onPresence(n),t.ext&&"string"==typeof t.ext){var s=JSON.parse(t.ext);s.user_mute_time&&(n.muteTimestamp=s.user_mute_time,a.muteTimestamp=s.user_mute_time)}t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="muteMember",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},22:function(){var e,r,o,i;n.type="removeAdmin",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeAdmin",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},21:function(){var e,r,o,i;n.type="addAdmin",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="setAdmin",a.userId=n.to,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},20:function(){var e,r,o,i;n.type="changeOwner",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="changeOwner",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},19:function(){var e,r,o,i;n.type="direct_joined",n.groupName=t.mucName,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="directJoined",a.name=t.mucName,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},18:function(){var e,r,o,i,s;n.type=t.isChatroom?"leaveChatRoom":"leaveGroup",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n);var u=t.mucMemberCount;if(u&&(a.memberCount=u),a.operation="memberAbsence",t.members&&t.members.length>0){var l=ut({},a);l.members=t.members,l.operation="membersAbsence",delete l.from,t.isChatroom?t.members.forEach((function(e){var t;null===(t=c.eventHandler)||void 0===t||t.dispatch("onChatroomEvent",ut(ut({},a),{from:e}))})):null===(o=c.eventHandler)||void 0===o||o.dispatch("onGroupEvent",l)}else t.isChatroom?null===(i=c.eventHandler)||void 0===i||i.dispatch("onChatroomEvent",a):null===(s=c.eventHandler)||void 0===s||s.dispatch("onGroupEvent",a)},17:function(){var e,r,o,i,s;t.isChatroom&&t.ext&&(a.ext=t.ext,n.ext=t.ext),n.type=t.isChatroom?"memberJoinChatRoomSuccess":"memberJoinPublicGroupSuccess",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n);var u=t.mucMemberCount;if(a.operation="memberPresence",u&&(a.memberCount=u),t.members&&t.members.length>0){var l=ut({},a);l.members=t.members,l.operation="membersPresence",delete l.from,t.isChatroom?t.members.forEach((function(e){var t;null===(t=c.eventHandler)||void 0===t||t.dispatch("onChatroomEvent",ut(ut({},a),{from:e}))})):null===(o=c.eventHandler)||void 0===o||o.dispatch("onGroupEvent",l)}else t.isChatroom?null===(i=c.eventHandler)||void 0===i||i.dispatch("onChatroomEvent",a):null===(s=c.eventHandler)||void 0===s||s.dispatch("onGroupEvent",a)},16:function(){var e,r;n.type="unblock",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},15:function(){var e,r;n.type="block",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},14:function(){var e,r,o,i,s,u=t.isChatroom;if(!u){var l=JSON.parse((null===(e=null==t?void 0:t.eventInfo)||void 0===e?void 0:e.ext)||"{}",(function(e,t){return"last_modified"===e?Number(t):lt.includes(e)?"true"===t||!0===t:t}));a.detail=n.detail={},Object.keys(l).forEach((function(e){var t=dt[e];if(t){var r=l[e];a.detail&&(a.detail[t]=r),n.detail&&(n.detail[t]=r)}}))}n.type="update",c.onPresence&&c.onPresence(n),u?null===(r=c.eventHandler)||void 0===r||r.dispatch("onChatroomChange",n):null===(o=c.eventHandler)||void 0===o||o.dispatch("onGroupChange",n),a.operation="updateInfo",u?null===(i=c.eventHandler)||void 0===i||i.dispatch("onChatroomEvent",a):null===(s=c.eventHandler)||void 0===s||s.dispatch("onGroupEvent",a)},13:function(){var e,r,o,i;n.type="allow",n.reason=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),t.reason&&(a.reason=t.reason),a.operation="unblockMember",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},12:function(){var e,r;n.type="ban",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},11:function(){var e,r;n.type="getBlackList",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},10:function(){var e,r,o,i;n.type="removedFromGroup",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="removeMember",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},9:function(){var e,r,o,i;n.type="invite_decline",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="rejectInvite",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},8:function(){var e,r,o,i;n.type="invite_accept",n.kicked=n.to,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="acceptInvite",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},7:function(){var e,r,o,i;n.type="invite",n.kicked=n.to,n.groupName=t.mucName,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="inviteToJoin",a.name=t.mucName,t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},6:function(){var e,r,o,i;n.type="joinPublicGroupDeclined",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="joinPublicGroupDeclined",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):(a.userId=t.to.length?t.to[0].name:"",null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a))},5:function(){var e,r,o,i;n.type="joinPublicGroupSuccess",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="acceptRequest",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},4:function(){var e,r,o,i;n.type="joinGroupNotifications",n.reason=t.reason,c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),t.reason&&(a.reason=t.reason),a.operation="requestToJoin",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},3:function(){var e,r;n.type="leave",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},2:function(){var e,r;n.type="join",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n)},1:function(){var e,r,o,i;n.type="deleteGroupChat",c.onPresence&&c.onPresence(n),t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomChange",n):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupChange",n),a.operation="destroy",t.isChatroom?null===(o=c.eventHandler)||void 0===o||o.dispatch("onChatroomEvent",a):null===(i=c.eventHandler)||void 0===i||i.dispatch("onGroupEvent",a)},0:function(){var e,r;a.operation="create",t.isChatroom?null===(e=c.eventHandler)||void 0===e||e.dispatch("onChatroomEvent",a):null===(r=c.eventHandler)||void 0===r||r.dispatch("onGroupEvent",a)}}[e]||function(){console.error("No match operation ".concat(e))})()}var ht,ft=function(e){var t=this.root.lookup("easemob.pb.MUCBody").decode(e.payload),r=t.operation;B.debug("onMucMessage",t),pt.call(this,r,t)},mt={handleRosterMsg:function(e){var t,r,n,o,i,a,s=this.root.lookup("easemob.pb.RosterBody").decode(e.payload),c={type:"",to:s.to[0].name,from:s.from.name,status:s.reason};switch(s.operation){case 2:c.type="subscribe",this.onContactInvited&&this.onContactInvited(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onContactInvited",c);break;case 3:c.type="unsubscribed",this.onContactDeleted&&this.onContactDeleted(c),null===(r=this.eventHandler)||void 0===r||r.dispatch("onContactDeleted",c);break;case 4:c.type="subscribed",this.onContactAdded&&this.onContactAdded(c),null===(n=this.eventHandler)||void 0===n||n.dispatch("onContactAdded",c);break;case 5:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(o=this.eventHandler)||void 0===o||o.dispatch("onContactRefuse",c);break;case 6:case 7:break;case 8:c.type="subscribed",this.onContactAgreed&&this.onContactAgreed(c),null===(i=this.eventHandler)||void 0===i||i.dispatch("onContactAgreed",c);break;case 9:c.type="unsubscribed",this.onContactRefuse&&this.onContactRefuse(c),null===(a=this.eventHandler)||void 0===a||a.dispatch("onContactRefuse",c);break;default:B.error("handleRosterMsg:",s)}this.onPresence&&c.type&&this.onPresence(c)}},vt=function(e){var t,r,n,o,i,a,c=this.root.lookup("easemob.pb.StatisticsBody").decode(e.payload),u=c.operation,l=c.reason;switch(u){case 0:this.onStatisticMessage&&this.onStatisticMessage(c),null===(t=this.eventHandler)||void 0===t||t.dispatch("onStatisticMessage",c);break;case 1:a=p.create({type:s.WEBIM_CONNCTION_USER_REMOVED,message:"user has been removed"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(r=this.eventHandler)||void 0===r||r.dispatch("onError",a),Ue.clearAll();break;case 2:a=p.create({type:s.WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE,message:"the user is already logged on another device"}),l&&(a.data={loginInfoCustomExt:c.reason}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(n=this.eventHandler)||void 0===n||n.dispatch("onError",a),Ue.clearAll();break;case 3:a=p.create({type:s.WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD,message:"the user was kicked by changing password"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",a),Ue.clearAll();break;case 4:a=p.create({type:s.WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE,message:"the user was kicked by other device"}),this.disconnectedReason=a,this.logOut=!0,this.onError&&this.onError(a),null===(i=this.eventHandler)||void 0===i||i.dispatch("onError",a),Ue.clearAll();break;default:B.error("handleStatisticsMsg:",c)}};function gt(e){var t,r=[],n=[],o=e.data;o&&o.values&&o.values.forEach((function(e){Object.entries(e.status).forEach((function(e){n.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:n})})),this.onPresenceStatusChange&&this.onPresenceStatusChange(r),null===(t=this.eventHandler)||void 0===t||t.dispatch("onPresenceStatusChange",r)}function yt(e){var t=this;e.data.forEach((function(e){var r,n={from:e.from,to:e.to,chatType:"chat"===e.channel_type?"singleChat":"groupChat",messageId:e.messageId,reactions:e.reactions,ts:e.ts};null===(r=t.eventHandler)||void 0===r||r.dispatch("onReactionChange",n)}))}function Et(e){var t,r,n,o;if(e.data){var i=e.data,a={id:i.id||"",name:i.name||"",parentId:i.muc_parent_id||"",messageId:i.msg_parent_id||"",timestamp:i.timestamp||0,operator:i.from||"",operation:""};switch(i.operation){case"create":a.operation="create",a.createTimestamp=a.timestamp,a.messageCount=0,null===(t=this.eventHandler)||void 0===t||t.dispatch("onChatThreadChange",a);break;case"update_msg":a.operation="update",a.messageCount=i.message_count,i.last_message&&"{}"!==JSON.stringify(i.last_message)?a.lastMessage=Se.call(this,i.last_message):"{}"===JSON.stringify(i.last_message)&&(a.lastMessage={}),null===(r=this.eventHandler)||void 0===r||r.dispatch("onChatThreadChange",a);break;case"update":a.operation="update",a.messageCount=i.message_count,null===(n=this.eventHandler)||void 0===n||n.dispatch("onChatThreadChange",a);break;case"delete":a.operation="destroy",null===(o=this.eventHandler)||void 0===o||o.dispatch("onChatThreadChange",a)}}}function _t(e){var t,r=e.data;if(r.resource!==this.clientResource){var n={operation:"deleteRoaming",conversationId:r.to,chatType:"chat"===r.chatType?"singleChat":"groupChat",resource:r.resource};null===(t=this.eventHandler)||void 0===t||t.dispatch("onMultiDeviceEvent",n)}}function Tt(e){var t,r,n=e.data,o="";if(this.clientResource!==n.res||n.from!==this.user){switch(n.op){case"del":o="deleteConversation";break;case"top":o="pinnedConversation";break;case"not_top":o="unpinnedConversation";break;case"mark":o="markConversation";break;case"mark_delete":o="unMarkConversation";break;case"pin":o="pin";break;case"pin_delete":o="unpin";break;default:return void B.error("unexpected conversation op:",n.op)}if("pin"!==o&&"unpin"!==o){var i={operation:o,conversationId:n.id,conversationType:"chat"===n.type?"singleChat":"groupChat",timestamp:n.ts};"markConversation"!==i.operation&&"unMarkConversation"!==i.operation||n.ext&&(i.conversationMark=ht[n.ext]),null===(r=this.eventHandler)||void 0===r||r.dispatch("onMultiDeviceEvent",i)}else{var a=n.ext,s=n.from,c=n.id,u=n.type,l=n.ts,d={messageId:a||"",conversationId:"chat"===u?s:c,conversationType:Re[u],operation:o,operatorId:s,time:l};null===(t=this.eventHandler)||void 0===t||t.dispatch("onMessagePinEvent",d)}}}function It(e){var t,r=this;null===(t=e.values)||void 0===t||t.forEach((function(e){var t,n,o,i,a;if(e.operator_resource!==r.clientResource)if("ignoreInterval"in e.data){var s={operation:"setSilentModeForUser",resource:e.operator_resource,data:e.data};null===(t=r.eventHandler)||void 0===t||t.dispatch("onMultiDeviceEvent",s)}else"group"in e?(s={operation:0===Object.keys(null!==(n=e.data)&&void 0!==n?n:{}).length?"removeSilentModeForConversation":"setSilentModeForConversation",resource:e.operator_resource,conversationId:e.group,type:"groupChat",data:e.data},null===(o=r.eventHandler)||void 0===o||o.dispatch("onMultiDeviceEvent",s)):(s={operation:0===Object.keys(null!==(i=e.data)&&void 0!==i?i:{}).length?"removeSilentModeForConversation":"setSilentModeForConversation",resource:e.operator_resource,conversationId:e.user,type:"singleChat",data:e.data},null===(a=r.eventHandler)||void 0===a||a.dispatch("onMultiDeviceEvent",s))}))}__webpack_require__(5506),function(e){e[e.mark_0=0]="mark_0",e[e.mark_1=1]="mark_1",e[e.mark_2=2]="mark_2",e[e.mark_3=3]="mark_3",e[e.mark_4=4]="mark_4",e[e.mark_5=5]="mark_5",e[e.mark_6=6]="mark_6",e[e.mark_7=7]="mark_7",e[e.mark_8=8]="mark_8",e[e.mark_9=9]="mark_9",e[e.mark_10=10]="mark_10",e[e.mark_11=11]="mark_11",e[e.mark_12=12]="mark_12",e[e.mark_13=13]="mark_13",e[e.mark_14=14]="mark_14",e[e.mark_15=15]="mark_15",e[e.mark_16=16]="mark_16",e[e.mark_17=17]="mark_17",e[e.mark_18=18]="mark_18",e[e.mark_19=19]="mark_19"}(ht||(ht={}));var Ot=function(e){var t=ye.parseNotify(e.payload);switch(t.type){case"presence":gt.call(this,t);break;case"reaction":yt.call(this,t);break;case"thread":Et.call(this,t);break;case"roaming_delete":_t.call(this,t);break;case"conv":Tt.call(this,t);break;case"user_notification_mute":It.call(this,t);break;default:B.error("unexpected notify type: ".concat(t.type))}};function Rt(){var e=this.context.appName,t=this.context.orgName;return!(!e||!t)||(this.onError&&this.onError({type:s.WEBIM_CONNCTION_AUTH_ERROR,message:"appName or orgName is illegal"}),!1)}function St(){var e,t=this.context.accessToken;if(!t){var r=p.create({type:s.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"});return B.debug("token not assign error",t),this.onError&&this.onError(r),null===(e=this.eventHandler)||void 0===e||e.dispatch("onError",r),!1}return!0}function bt(){if(this._initWithAppId){if(!Rt.call(this))return{error:p.create({type:s.WEBIM_CONNECTION_CLOSED,message:"not login"})};if(!St.call(this))return{error:p.create({type:s.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"token not assign error"})}}else if(!Rt.call(this)||!St.call(this))return{error:p.create({type:s.REST_PARAMS_STATUS,message:"appkey or token error"})};return{}}function Ct(e){var t=e.data,r=e.type;return{data:{status:Object.keys(t.errorKeys).length>0?"fail":"success",errorKeys:t.errorKeys,successKeys:t.successKeys},type:r}}function Nt(e){var t=e.data,r=void 0;return Object.keys(t.errorKeys).length>0&&Object.keys(t.errorKeys).forEach((function(e){var n=t.errorKeys[e];r=n.includes("is not part of you")?p.create({type:s.NO_PERMISSION,message:n}):n.includes("size of metadata for this single chatroom exceeds the user defined limit")||n.includes("total size of chatroom metadata for this app exceeds the user defined limit")||n.includes("is exceeding maximum limit")?p.create({type:s.MAX_LIMIT,message:n}):n.includes("is not Legal")?p.create({type:s.REQUEST_PARAMETER_ERROR,message:n}):n.includes("Failed to update userMetadata. Concurrent updates not allowed")?p.create({type:s.OPERATION_NOT_ALLOWED,message:n}):p.create({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:n})})),r}function At(e){if("string"!=typeof e.deviceId||""===e.deviceId)throw Error('Invalid parameter: "deviceId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(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};B.debug("Call uploadPushTokenToServer",e);var s=oe.bind(this,a,f.UPLOAD_PUSH_TOKEN);return ye.retryPromise(s).then((function(e){var t=e.entities[0]||{};return{type:e.type,data:t}}))}var Mt,wt,Ut=__webpack_require__(9638),Lt=__webpack_require__.n(Ut),Pt=__webpack_require__(2566),xt=__webpack_require__.n(Pt),kt=268435455;function Dt(e){var t=e;return xt().buf(t)>>>0}!function(e){e[e.COMPRESS_NONE=0]="COMPRESS_NONE",e[e.COMPRESS_ZLIB=1]="COMPRESS_ZLIB",e[e.COMPRESS_LZ4=2]="COMPRESS_LZ4"}(Mt||(Mt={})),function(e){e[e.NONE=-1]="NONE",e[e.UPLINK_ONLY=0]="UPLINK_ONLY",e[e.DOWNLINK_ONLY=1]="DOWNLINK_ONLY",e[e.BIDIRECTIONAL=2]="BIDIRECTIONAL"}(wt||(wt={}));var Bt=268435455,jt=function(){function e(){this.mode=wt.NONE,this.enableUplinkCompression=!1,this.enableDownlinkCompression=!1;var e={minWorkArea:Lt().DEFAULT_WORK_AREA,maxWorkArea:Lt().DEFAULT_MAX_WORK,shrinkMode:Lt().SHRINK_MODE.MANUAL};this.encoder=new(Lt().RingBufferEncoder)(e),this.decoder=new(Lt().RingBufferDecoder)(e)}return e.prototype.compress=function(e){var t=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!t||0===t.length)return new Uint8Array(0);if(t.length>Bt)throw new Error("Data size exceeds maximum allowed: ".concat(t.length));var r=Lt().compressBound(t.length),n=new Uint8Array(r),o=this.encoder.compress(t,n);if(o<0)throw new Error("LZ4 compression failed with error code: ".concat(o));var i=n.subarray(0,o),a=function(e){if(e<0)throw new Error("encodeLength: Length must be non-negative");if(e>kt)throw new Error("encodeLength: Length exceeds maximum: ".concat(kt));if(0===e)return new Uint8Array([0]);for(var t=[],r=e;r>0;){var n=127&r;(r>>>=7)>0&&(n|=128),t.push(n)}return new Uint8Array(t)}(t.length),s=Dt(t),c=new Uint8Array(a.length+4+o),u=0;return c.set(a,u),u+=a.length,new DataView(c.buffer).setUint32(u,s,!1),u+=4,c.set(i,u),c},e.prototype.decompress=function(e){var t=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!t||0===t.length)return new Uint8Array(0);if(t.length<5)throw new Error("Compressed data is too short: must contain at least length and CRC32");var r={offset:0},n=function(e,t){if(t.offset>=e.length)throw new Error("decodeLength: No data to decode: offset beyond data length");for(var r=0,n=0;t.offset<e.length;){var o=e[t.offset];if(t.offset++,r|=(127&o)<<n,!(128&o))return r>>>0;if((n+=7)>=28)throw new Error("decodeLength: Invalid length encoding: exceeds 4 bytes")}throw new Error("decodeLength: Incomplete length encoding: missing terminator byte")}(t,r);if(n>Bt)throw new Error("Original size exceeds maximum allowed: ".concat(n));if(t.length<r.offset+4)throw new Error("Compressed data is too short: missing CRC32 checksum");var o=new DataView(t.buffer,t.byteOffset+r.offset,4).getUint32(0,!1);r.offset+=4;var i=t.subarray(r.offset),a=new Uint8Array(n),s=this.decoder.decompress(i,a,n);if(s<0||s!==n)throw new Error("LZ4 decompression failed: expected ".concat(n,", got ").concat(s));var c=Dt(a);if(c!==o)throw new Error("CRC32 checksum mismatch: expected ".concat(o,", got ").concat(c));return a},e.prototype.resetEncoder=function(){this.encoder.reset()},e.prototype.resetDecoder=function(){this.decoder.reset()},e.prototype.reset=function(){this.resetEncoder(),this.resetDecoder()},e.prototype.shrinkEncoder=function(){this.encoder.shrink()},e.prototype.shrinkDecoder=function(){this.decoder.shrink()},e.prototype.shrink=function(){this.shrinkEncoder(),this.shrinkDecoder()},e}();function Gt(e){switch(e){case wt.UPLINK_ONLY:return{mode:wt.UPLINK_ONLY,enableUplinkCompression:!0,enableDownlinkCompression:!1};case wt.DOWNLINK_ONLY:return{mode:wt.DOWNLINK_ONLY,enableUplinkCompression:!1,enableDownlinkCompression:!0};case wt.BIDIRECTIONAL:return{mode:wt.BIDIRECTIONAL,enableUplinkCompression:!0,enableDownlinkCompression:!0};case wt.NONE:default:return{mode:wt.NONE,enableUplinkCompression:!1,enableDownlinkCompression:!1}}}function Ht(e,t){var r=Gt(t),n=r.mode,o=r.enableUplinkCompression,i=r.enableDownlinkCompression;e.reset(),e.mode=n,e.enableUplinkCompression=o,e.enableDownlinkCompression=i}function Ft(e,t,r){for(var n=[],o=Math.max(e.length,t.length),i=0,a=0;a<o||i;){var s=i+(a<e.length?e[a]:0)+(a<t.length?t[a]:0);n.push(s%r),i=Math.floor(s/r),a++}return n}function qt(e,t,r){if(e<0)return null;if(0==e)return[];for(var n=[],o=t;1&e&&(n=Ft(n,o,r)),0!=(e>>=1);)o=Ft(o,o,r);return n}__webpack_require__(8940);var Wt=function(){function e(e){e=e||{},this.seq=0,this.mid=(e.mid||1)%1023,this.timeOffset=e.timeOffset||0,this.lastTime=0}return e.prototype.gen=function(){var e=Date.now();if(this.lastTime==e){if(this.seq++,this.seq>4095){for(this.seq=0;Date.now()<=e;);e=Date.now()}}else this.seq=0;this.lastTime=e;for(var t=(e-this.timeOffset).toString(2),r=this.seq.toString(2),n=this.mid.toString(2);r.length<12;)r="0"+r;for(;n.length<10;)n="0"+n;for(var o,i=t+n+r,a="",s=i.length;s>0;s-=4)a=parseInt(i.substring(s-4,s),2).toString(16)+a;return"0x"===(o=a).substring(0,2)&&(o=o.substring(2)),function(e,t,r){var n=function(e,t){for(var r=e.split(""),n=[],o=r.length-1;o>=0;o--){var i=parseInt(r[o],t);if(isNaN(i))return null;n.push(i)}return n}(e,t);if(null===n)return null;for(var o=[],i=[1],a=0;a<n.length;a++)n[a]&&(o=Ft(o,qt(n[a],i,r),r)),i=qt(t,i,r);var s="";for(a=o.length-1;a>=0;a--)s+=o[a].toString(r);return s}(o=o.toLowerCase(),16,10)},e}(),zt=function(){return zt=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},zt.apply(this,arguments)};function Kt(e){try{var t=this._compressor;return t&&t.enableDownlinkCompression&&"string"!=typeof e.data?[zt(zt({},e),{data:t.decompress(e.data)}),!0]:[e,!0]}catch(t){return this._compressorFailureCount++,B.error("decompress message error",t),B.error("decompress failure times:",this._compressorFailureCount),this.sock.close(),[e,!1]}}function Vt(e){try{var t=this._compressor;return t&&t.enableUplinkCompression?[t.compress(e),!0]:[e,!0]}catch(t){return this._compressorFailureCount++,B.error("compress message error",t),B.error("compress failure times:",this._compressorFailureCount),this.sock.close(),[e,!1]}}function Jt(e,t,r){var n=Math.min(e,t);if(n<=r)return{width:e,height:t};var o=r/n;return{width:Math.round(e*o),height:Math.round(t*o)}}function Yt(e,t){return e+t|0}function Xt(e){for(var t="",r=0;r<4;r++)t+="0".concat((e>>>8*r&255).toString(16)).slice(-2);return t}function Qt(e){var t=new Uint8Array(e),r=t.length,n=64*((r+8>>>6)+1),o=new Uint8Array(n);o.set(t),o[r]=128;for(var i=8*r,a=i>>>0,s=Math.floor(i/4294967296)>>>0,c=0;c<4;c++)o[n-8+c]=a>>>8*c&255,o[n-4+c]=s>>>8*c&255;var u=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],l=new Array(64);for(c=0;c<64;c++)l[c]=Math.floor(4294967296*Math.abs(Math.sin(c+1)));for(var d,p,h=1732584193,f=4023233417,m=2562383102,v=271733878,g=new Array(16),y=0;y<n;y+=64){for(c=0;c<16;c++){var E=y+4*c;g[c]=o[E]|o[E+1]<<8|o[E+2]<<16|o[E+3]<<24}var _=h,T=f,I=m,O=v;for(c=0;c<64;c++){var R=0,S=0;c<16?(R=T&I|~T&O,S=c):c<32?(R=O&T|~O&I,S=(5*c+1)%16):c<48?(R=T^I^O,S=(3*c+5)%16):(R=I^(T|~O),S=7*c%16);var b=I,C=T,N=(d=Yt(Yt(_,R),Yt(l[c],g[S])))<<(p=u[c])|d>>>32-p;T=Yt(T,N),_=O,I=C,O=b}h=Yt(h,_),f=Yt(f,T),m=Yt(m,I),v=Yt(v,O)}return"".concat(Xt(h)).concat(Xt(f)).concat(Xt(m)).concat(Xt(v))}var $t=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},Zt=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},er=1048576;function tr(e){return new Promise((function(t,r){if("undefined"!=typeof FileReader){var n=new FileReader;n.onload=function(){return t(n.result)},n.onerror=function(){return r(n.error||new Error("Failed to read file"))},n.readAsArrayBuffer(e)}else r(new Error("FileReader is not available"))}))}function rr(e,t,r){return"img"===t?e>("original"===r?204800:er):e>er}function nr(e){return $t(this,void 0,void 0,(function(){return Zt(this,(function(t){switch(t.label){case 0:return[4,tr(e)];case 1:return[2,Qt(t.sent())]}}))}))}function or(e){return"original"===e?"origin":"large"}function ir(e,t,r,n){var o,i;return $t(this,void 0,void 0,(function(){var a,s,c,u,l,d,p,h,m,v,g,y,E,_;return Zt(this,(function(T){switch(T.label){case 0:a=e.context,s=a.orgName,c=a.appName,u=a.accessToken,l="".concat(e.apiUrl,"/").concat(s,"/").concat(c,"/chatfiles/exists?md5=").concat(t),"img"===r&&n&&(l+="&imageType=".concat(or(n))),T.label=1;case 1:return T.trys.push([1,3,,4]),[4,oe.call(e,{url:l,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+u}},f.SDK_INTERNAL)];case 2:return d=T.sent(),(p=null===(o=null==d?void 0:d.entities)||void 0===o?void 0:o[0])?(h=!0===p.exists,m=p.uuid||"",v=p["share-secret"]||"",I=null!==(i=p["exists-type"])&&void 0!==i?i:p.existsType,g="origin"===I||"original"===I?"original":"large"===I?"large":void 0,y=h&&!!m,E=n,"img"===r&&y&&("original"===g?E="original":"large"===g&&("original"===n?y=!1:E="large")),B.debug("precheck result","exists: ".concat(h),"uuid: ".concat(m),"existsType: ".concat(g||""),"effectiveImageType: ".concat(E||""),"hit: ".concat(y)),[2,{exists:h,uuid:m,shareSecret:v,existsType:g,effectiveImageType:E,hit:y}]):[2,{exists:!1,hit:!1}];case 3:return _=T.sent(),B.warn("precheck failed, proceeding with upload",_),[2,{exists:!1,hit:!1}];case 4:return[2]}var I}))}))}function ar(e){return ar="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ar(e)}var sr,cr,ur,lr,dr=function(){return dr=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},dr.apply(this,arguments)},pr=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},hr=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},fr=new Wt;!function(e){e[e.NORMAL=0]="NORMAL",e[e.SINGLECHAT=1]="SINGLECHAT",e[e.GROUPCHAT=2]="GROUPCHAT",e[e.CHATROOM=3]="CHATROOM",e[e.READ_ACK=4]="READ_ACK",e[e.DELIVER_ACK=5]="DELIVER_ACK",e[e.RECALL=6]="RECALL",e[e.CHANNEL_ACK=7]="CHANNEL_ACK",e[e.EDIT=8]="EDIT"}(sr||(sr={})),function(e){e[e.BODY=1]="BODY",e[e.BODY_AND_EXT=2]="BODY_AND_EXT"}(cr||(cr={})),function(e){e[e.APNs=0]="APNs",e[e.FCM=1]="FCM",e[e.HMSPUSH=2]="HMSPUSH",e[e.MIPUSH=3]="MIPUSH",e[e.MEIZUPUSH=4]="MEIZUPUSH",e[e.VIVOPUSH=5]="VIVOPUSH",e[e.OPPOPUSH=6]="OPPOPUSH",e[e.HONORPUSH=7]="HONORPUSH"}(ur||(ur={})),function(e){e[e.OK=0]="OK",e[e.FAIL=1]="FAIL",e[e.UNAUTHORIZED=2]="UNAUTHORIZED",e[e.MISSING_PARAMETER=3]="MISSING_PARAMETER",e[e.WRONG_PARAMETER=4]="WRONG_PARAMETER",e[e.REDIRECT=5]="REDIRECT",e[e.TOKEN_EXPIRED=6]="TOKEN_EXPIRED",e[e.PERMISSION_DENIED=7]="PERMISSION_DENIED",e[e.NO_ROUTE=8]="NO_ROUTE",e[e.UNKNOWN_COMMAND=9]="UNKNOWN_COMMAND",e[e.PB_PARSER_ERROR=10]="PB_PARSER_ERROR",e[e.BIND_ANOTHER_DEVICE=11]="BIND_ANOTHER_DEVICE",e[e.IM_FORBIDDEN=12]="IM_FORBIDDEN",e[e.TOO_MANY_DEVICES=13]="TOO_MANY_DEVICES",e[e.PLATFORM_LIMIT=14]="PLATFORM_LIMIT",e[e.USER_MUTED=15]="USER_MUTED",e[e.ENCRYPT_DISABLE=16]="ENCRYPT_DISABLE",e[e.ENCRYPT_ENABLE=17]="ENCRYPT_ENABLE",e[e.DECRYPT_FAILURE=18]="DECRYPT_FAILURE",e[e.PERMISSION_DENIED_EXTERNAL=19]="PERMISSION_DENIED_EXTERNAL",e[e.RESOURCE_CHANGED=20]="RESOURCE_CHANGED"}(lr||(lr={}));var mr=["txt","img","video","audio","file","loc","custom","cmd","combine"],vr=ye.getEnvInfo();function gr(){var e="webim",t="",r="",n=(new Date).valueOf(),o=ye.getDevicePlatform(vr);if(this.isFixedDeviceId){var i=ye.getLocalDeviceInfo();if(i){var a=JSON.parse(i);e=a.deviceId,t=a.deviceName,r=a.deviceUuid,void 0!==this.customOSPlatform&&(t=this.deviceId,e="custom".concat(this.customOSPlatform,"_").concat(r))}else"webim"===this.deviceId?(r="".concat(o,"_").concat(n.toString()),e="".concat(this.deviceId,"_").concat(r),t=this.deviceId,void 0!==this.customOSPlatform&&(e="custom".concat(this.customOSPlatform,"_").concat(r))):(e=t=r="webim_".concat(o,"_").concat(this.deviceId),void 0!==this.customOSPlatform&&(r="".concat(o,"_").concat(n.toString()),t=this.deviceId,e="custom".concat(this.customOSPlatform,"_").concat(r))),ye.setLocalDeviceInfo(JSON.stringify({deviceId:e,deviceName:t,deviceUuid:r}))}else"webim"===this.deviceId?(r="random_".concat(o,"_").concat(n.toString()),e="".concat(this.deviceId,"_").concat(r),t=this.deviceId):e=t=r="webim_".concat(o,"_").concat(this.deviceId),void 0!==this.customOSPlatform&&(r="random_".concat(o,"_").concat(n.toString()),t=this.deviceId,e="custom".concat(this.customOSPlatform,"_").concat(r));return{deviceId:e,deviceName:t,deviceUuid:r,devicePlatform:o}}function yr(){var e,t,r,n,o=gr.call(this),i=o.deviceId,a=o.deviceName,s=o.deviceUuid,c=o.devicePlatform,u=[];this.context.jid&&(this.context.jid.clientResource=i),this._compressor&&Ht(this._compressor,wt.NONE);var l=this.root.lookup("easemob.pb.Provision"),d=c===ce.UNI,p=!this.logOut,h=l.decode(u);if(void 0!==this.customOSPlatform&&(h.osCustomValue=this.customOSPlatform,this.osType=5),h.compressType=this.compressType,h.encryptType=this.encryptType,h.osType=this.osType,h.version=this.version,h.deviceName=a,h.resource=i,h.deviceUuid=s,h.authToken='{"token":"$t$'+this.token+'"}',h.sessionId=Date.now().toString()+":",d){var f=!this.isAutoLogin;p&&(f=!1),B.debug("isManualLogin",f),h.isManualLogin=f}var m=this._compressorFailureCount>=1?[]:[Mt.COMPRESS_LZ4];h.protocolCompressType=m,this.sessionId=h.sessionId,this.loginInfoCustomExt&&(h.reason=this.loginInfoCustomExt),B.info("provision info",{version:this.version,resource:i,isFixedDeviceId:this.isFixedDeviceId,loginInfoCustomExt:!!this.loginInfoCustomExt,token:(null===(t=null===(e=this.token)||void 0===e?void 0:e.slice)||void 0===t?void 0:t.call(e,0,10))+"...",userId:null===(n=null===(r=this.context)||void 0===r?void 0:r.jid)||void 0===n?void 0:n.name}),h.actionVersion="v5.2",h=l.encode(h).finish();var v=this.root.lookup("easemob.pb.MSync"),g=v.decode(u);return g.version=this.version,g.guid=this.context.jid,g.auth="$t$"+this.token,g.command=3,g.deviceId=a,g.serviceId=this.dataReport.getServiceId(),g.encryptType=this.encryptType,g.payload=h,g.traceId=fr.gen(),v.encode(g).finish()}function Er(e){var t=[],r=this.root.lookup("easemob.pb.Logout"),n=r.decode(t);n.sessionId=this.sessionId,n.reason=e,n=r.encode(n).finish();var o=this.root.lookup("easemob.pb.MSync"),i=o.decode(t);return i.version=this.version,i.guid=this.context.jid,i.auth="$t$"+this.token,i.command=4,i.deviceId=this.deviceId||"webim",i.serviceId=this.dataReport.getServiceId(),i.encryptType=this.encryptType,i.payload=n,i.traceId=fr.gen(),B.debug("traceId",i.traceId),o.encode(i).finish()}function _r(e,t){var r=this,n=ye.getEnvInfo();if("zfb"===n.platform||"dd"===n.platform){for(var o="",i=0;i<e.length;i++)o+=String.fromCharCode(e[i]);return{data:o=Ie().btoa(o),isBuffer:!1,complete:function(){},fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||(B.error("send message fail and reconnect"),r.reconnecting||r.reconnect()),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}var a=e;return{data:a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength),fail:function(e){"sendSocketMessage:fail taskID not exist"!==e.errMsg&&"SocketTast.send:fail SocketTask.readyState is not OPEN"!==e.errMsg||r.reconnecting||r.reconnect(),t&&r._msgHash&&r._msgHash[t]&&r._msgHash[t].fail({id:t})}}}function Tr(e,t){var r;return pr(this,void 0,void 0,(function(){var n,o,i,a,s;return hr(this,(function(c){switch(c.label){case 0:for(B.debug("metas length: ",e.length),n=[],o=0;o<e.length;o++)switch(i=e[o],new(d())(i.id.low,i.id.high,i.id.unsigned).toString(),i.ns){case 0:vt.call(this,i);break;case 1:n.push(ct.call(this,i,t,!1,!0,!0));break;case 2:ft.call(this,i);break;case 3:mt.handleRosterMsg.call(this,i);break;case 4:this.registerConfrIQHandler&&this.registerConfrIQHandler(i,t,this);break;case 5:Ot.call(this,i);break;default:B.error("distributeMeta",i)}return[4,Promise.all(n)];case 1:return a=c.sent(),(s=a.filter((function(e){return e&&"cmd"!==e.type}))).length>0&&(null===(r=this.eventHandler)||void 0===r||r.dispatch("onMessage",s)),[2]}}))}))}function Ir(e,t){Tr.call(this,e,t)}function Or(e){var t,r=this;zr.clear(),this._offlineMessagePullState===ve.SYNC_INIT&&(this._offlineMessagePullState=ve.SYNC_START,this._offlineMessagePullQueue=e.unread.reduce((function(e,t,n){return e.find((function(e){return e.name===t.queue.name}))||e.push(t),r.pullOfflineMessageInfo.pullCount+=t.n,e}),[]),this.pullOfflineMessageInfo.startTime=Date.now(),this._offlineMessageRpt=this.dataReport.geOperateFun({operationName:f.MSYNC_SYNCOFFLINEMESSAGE}),null===(t=this.eventHandler)||void 0===t||t.dispatch("onOfflineMessageSyncStart"))}function Rr(e){var t;if(this._offlineMessagePullState===ve.SYNC_START){var r=this._offlineMessagePullQueue.findIndex((function(t){return t.queue.name===e.queue.name}));if(r>-1){this._offlineMessagePullQueue.splice(r,1);var n=zr.get(e.queue.name)||0;n>0&&this._offlineMessageRpt({isEndApi:!1,data:{isSuccess:1,requestName:f.MSYNC_SYNCOFFLINEMESSAGE,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.success,resultCount:n,requestElapse:Date.now()-this.pullOfflineMessageInfo.startTime}})}0===this._offlineMessagePullQueue.length&&(this._offlineMessagePullState=ve.SYNC_FINISH,null===(t=this.eventHandler)||void 0===t||t.dispatch("onOfflineMessageSyncFinish"),this._offlineMessageRpt({data:{isLastApi:1,isSuccess:1,requestName:f.MSYNC_SYNCOFFLINEMESSAGE,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.success,resultCount:this.pullOfflineMessageInfo.pullCount}}),zr.clear())}}function Sr(e){var t=this.root.lookup("easemob.pb.CommUnreadDL");t=t.decode(e.payload);var r=new(d())(t.timestamp.low,t.timestamp.high,t.timestamp.unsigned).toString();if(this.expirationTime&&this.compareTokenExpireTime(Number(r),this.expirationTime),0===t.unread.length)kr.call(this);else{Or.call(this,t),B.debug("pull unread message",t.unread);for(var n=0;n<t.unread.length;n++)Nr.call(this,t.unread[n].queue)}kr.call(this)}function br(){var e=[],t=this.root.lookup("easemob.pb.StatisticsBody"),r=t.decode(e);r.operation=0,r=t.encode(r).finish();var n=this.root.lookup("easemob.pb.Meta").decode(e);n.id=(new Date).valueOf(),n.ns=0,n.payload=r;var o=this.root.lookup("easemob.pb.CommSyncUL"),i=o.decode(e);i.meta=n,i=o.encode(i).finish();var a=this.root.lookup("easemob.pb.MSync"),s=a.decode(e);return s.version=this.version,s.encryptType=[0],s.command=0,s.payload=i,s.traceId=fr.gen(),B.debug("traceId",s.traceId),a.encode(s).finish()}function Cr(e){var t=[],r=this.root.lookup("easemob.pb.CommSyncUL"),n=r.decode(t);n.queue=e,n=r.encode(n).finish();var o=this.root.lookup("easemob.pb.MSync"),i=o.decode(t);return i.version=this.version,i.encryptType=this.encryptType,i.command=0,i.payload=n,i.traceId=fr.gen(),B.debug("traceId",i.traceId),o.encode(i).finish()}function Nr(e){B.debug("sendBackqueue",e);var t=Cr.call(this,e);tn.call(this,t)}function Ar(e,t){var r=[],n=this.root.lookup("easemob.pb.CommSyncUL"),o=n.decode(r);o.queue=t,o.key=new(d())(e.low,e.high,e.unsigned).toString(),o=n.encode(o).finish();var i=this.root.lookup("easemob.pb.MSync"),a=i.decode(r);return a.version=this.version,a.encryptType=this.encryptType,a.command=0,a.payload=o,a.traceId=fr.gen(),B.debug("traceId",a.traceId),i.encode(a).finish()}function Mr(){var e=this;this.uniPush&&!1===this.isRegisterPush&&(this.isRegisterPush=!0,this.uniPush.onRegister((function(t){B.debug("push token onRegister");var r=e.uniPushConfig||{},n=r.APNsCertificateName,o=void 0===n?"":n,i=r.HMSCertificateName,a=void 0===i?"":i,s=r.HONORCertificateName,c=void 0===s?"":s,u=r.MEIZUCertificateName,l=void 0===u?"":u,d=r.MICertificateName,p=void 0===d?"":d,h=r.OPPOCertificateName,f=void 0===h?"":h,m=r.VIVOCertificateName,v=void 0===m?"":m,g=r.FCMCertificateName,y=void 0===g?"":g;switch(t.push_type){case ur.APNs:e.pushCertificateName=o;break;case ur.FCM:e.pushCertificateName=y;break;case ur.HMSPUSH:e.pushCertificateName=a;break;case ur.HONORPUSH:e.pushCertificateName=c;break;case ur.MEIZUPUSH:e.pushCertificateName=l;break;case ur.MIPUSH:e.pushCertificateName=p;break;case ur.OPPOPUSH:e.pushCertificateName=f;break;case ur.VIVOPUSH:e.pushCertificateName=v;break;default:B.error("unexpected push type",t.push_type)}e.pushCertificateName&&t.push_token&&At.call(e,{deviceId:e.clientResource,deviceToken:t.push_token,notifierName:e.pushCertificateName}).then((function(){B.debug("uploadPushToken success")})).catch((function(e){B.debug("uploadPushToken failed",e)}))})))}function wr(){var e;this._offlineMessagePullState=ve.SYNC_INIT,this._offlineMessagePullQueue=[],this.times=1,this.autoReconnectNumTotal=0,this.onOpened&&this.onOpened(),Mr.call(this),null===(e=this.eventHandler)||void 0===e||e.dispatch("onConnected"),xr.call(this),Br.call(this),Dr.call(this),kr.call(this),this.pullOfflineMessageInfo={pullCount:0,startTime:0}}function Ur(e,t){B.debug("sendLastSession",e);var r=Ar.call(this,e,t);tn.call(this,r)}function Lr(e){var t,r,n,o,i,a,c,u,l,d,h,f,m,v,g,y,E,_,T=this,I=this.root.lookup("easemob.pb.Provision").decode(e.payload);if(this.context.jid&&(this.context.jid.clientResource=I.resource),this.clientResource=I.resource,this.provisionTimer&&clearTimeout(this.provisionTimer),B.debug("provision status",I.status),this._isLogging=!1,I.status.errorCode===lr.OK){if(this.disconnectedReason=void 0,I.authToken){var O=JSON.parse(I.authToken).expires_in;if(!this.tokenExpiredTimer&&!this.tokenWillExpireTimer){var R=Date.now();this.expirationTime=O;var S=this.expirationTime-R;this.expiresIn=S<0?0:S,this.tokenExpireTimeCountDown(this.expiresIn)}}var b=I.protocolCompressType,C=I.protocolCompressDirection;if(B.debug("protocol compress types",b),B.debug("protocol compress direction",C),b.length>0&&b[0]===Mt.COMPRESS_LZ4){var N=null!=C?C:wt.NONE;this._compressor?Ht(this._compressor,N):this._compressor=function(e){var t=Gt(e),r=t.mode,n=t.enableUplinkCompression,o=t.enableDownlinkCompression;if(r===wt.NONE)return null;var i=new jt;return i.mode=r,i.enableUplinkCompression=n,i.enableDownlinkCompression=o,i}(N)}this.reconnecting=!1,this.logOut=!1,this.needSetReadyState&&(this.sock=dr(dr({},this.sock),{close:this.sock.close,send:this.sock.send,readyState:1})),this._localCache?(null===(t=this._localCache)||void 0===t?void 0:t.getInstance())?wr.call(this):this._localCache&&new this._localCache({user:this.user,dbName:"cache_".concat(Math.abs(Ne(this.appKey||this.appId)),"_").concat(this.user),version:2,onInit:function(){return pr(T,void 0,void 0,(function(){return hr(this,(function(e){return B.debug("localCache init success"),wr.call(this),[2]}))}))}}):wr.call(this),null===(r=this.connectionResolve)||void 0===r||r.call(this)}else{var A=void 0,M=I.status,w=M.reason,U=M.errorCode;switch(B.error("provision errorCode: ",U),B.error("provision reason: ",w),U){case lr.FAIL:A="Sorry, user register limit"===w?p.create({type:s.MAX_LIMIT,message:"Sorry, the number of user registrations limit has been reached"}):"Sorry, user register rate limit"===w?p.create({type:s.MAX_LIMIT,message:"Sorry, user register rate limit"}):"Sorry, token expired"===w?p.create({type:s.WEBIM_TOKEN_EXPIRED,message:"Sorry, token expired"}):"Sorry, token or password does not match login info"===w?p.create({type:s.WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR,message:"INVALID_TOKEN"}):"Sorry, user not found"===w?p.create({type:s.USER_NOT_FOUND,message:"User not found"}):p.create({type:s.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(n=this.connectionReject)||void 0===n||n.call(this,A),null===(o=this.eventHandler)||void 0===o||o.dispatch("onError",A);break;case lr.WRONG_PARAMETER:A=p.create({type:s.REQUEST_PARAMETER_ERROR,message:"Invalid parameter"}),null===(i=this.connectionReject)||void 0===i||i.call(this,A),null===(a=this.eventHandler)||void 0===a||a.dispatch("onError",A);break;case lr.UNAUTHORIZED:A=p.create({type:s.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(c=this.connectionReject)||void 0===c||c.call(this,A),null===(u=this.eventHandler)||void 0===u||u.dispatch("onError",A);break;case lr.IM_FORBIDDEN:A=p.create({type:s.WEBIM_SERVER_SERVING_DISABLED,message:"Server serving disabled."}),null===(l=this.connectionReject)||void 0===l||l.call(this,A),null===(d=this.eventHandler)||void 0===d||d.dispatch("onError",A);break;case lr.PERMISSION_DENIED:A="Sorry, the app month live count limit"===w?p.create({type:s.MAX_LIMIT,message:"Sorry, the monthly active user limit for this app has been reached"}):"Sorry, the app day live count limit"===w?p.create({type:s.MAX_LIMIT,message:"Sorry, the daily active user limit for this app has been reached"}):"Sorry, the app online count limit"===w?p.create({type:s.MAX_LIMIT,message:"Sorry, the maximum number limit of online users for this app has been reached"}):p.create({type:s.WEBIM_CONNCTION_AUTH_ERROR,message:"Auth failed"}),null===(h=this.connectionReject)||void 0===h||h.call(this,A),null===(f=this.eventHandler)||void 0===f||f.dispatch("onError",A);break;case lr.TOO_MANY_DEVICES:A=p.create({type:s.USER_LOGIN_TOO_MANY_DEVICES,message:"the number of devices the user is logged in to exceeds the limit"}),null===(m=this.connectionReject)||void 0===m||m.call(this,A),null===(v=this.eventHandler)||void 0===v||v.dispatch("onError",A);break;case lr.RESOURCE_CHANGED:A=p.create({type:s.USER_DEVICE_CHANGED,message:"user device is changed"}),null===(g=this.connectionReject)||void 0===g||g.call(this,A),null===(y=this.eventHandler)||void 0===y||y.dispatch("onError",A);break;default:A=p.create({type:s.WEBIM_CONNCTION_AUTH_ERROR,message:w}),null===(E=this.connectionReject)||void 0===E||E.call(this,A),null===(_=this.eventHandler)||void 0===_||_.dispatch("onError",A)}this.disconnectedReason=A}}function Pr(e){var t=this.root.lookup("easemob.pb.Logout").decode(e.payload);B.debug("receiveLogoutResult",t)}function xr(){var e,t;if((null===(e=this.unMSyncSendMsgMap)||void 0===e?void 0:e.size)>0){for(var r=Array.from(this.unMSyncSendMsgMap.keys()),n=0;n<r.length;n++){var o=this.unMSyncSendMsgMap.get(r[n]);tn.call(this,o,r[n])}null===(t=this.unMSyncSendMsgMap)||void 0===t||t.clear()}}function kr(){var e=br.call(this);tn.call(this,e)}function Dr(){B.debug("sendUnreadDeal");var e=Gr.call(this);tn.call(this,e)}function Br(){var e=this;jr.call(this),this.heartBeatID=setInterval((function(){(Date.now()-e.lastHeartbeat)/1e3>=30&&(B.debug("send heart beat"),Dr.call(e),e.lastHeartbeat=Date.now())}),this.heartBeatWait)}function jr(){clearInterval(this.heartBeatID)}function Gr(){var e=this.root.lookup("easemob.pb.MSync"),t=e.decode([]);return t.version=this.version,t.encryptType=this.encryptType,t.command=1,t.traceId=fr.gen(),B.debug("traceId",t.traceId),e.encode(t).finish()}function Hr(e,t){return e.some((function(e){return e.name===t.name}))}function Fr(e){var t=this.root.lookup("easemob.pb.CommNotice").decode(e.payload),r=Hr(this._queues,t.queue);B.debug("receive notice",t.queue,r),r||this.clientResource===t.queue.clientResource&&t.queue.name===this.context.userId||(this._queues.push(t.queue),1===this._queues.length&&Nr.call(this,t.queue))}function qr(e){return pr(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u;return hr(this,(function(l){t=ye.getEnvInfo(),r=this.root.lookup("easemob.pb.MSync"),n=e,"zfb"!==t.platform&&"dd"!==t.platform||(o=Ie().atob(e.data),i=Array.from(o,(function(e,t){return o.charCodeAt(t)})),n=dr(dr({},e),{data:new Uint8Array(i)}));try{return a=Kt.call(this,n),s=a[0],a[1]?(c="miniCore"===this.name||"web"===t.platform,u=c?new Uint8Array(s.data):s.data,[2,r.decode(u)]):[2,void 0]}catch(e){throw new Error("decode message fail.")}}))}))}function Wr(e){var t=this;this.lastHeartbeat=Date.now(),this.probingTimer&&clearTimeout(this.probingTimer),e.then((function(e){if(e)switch(e.command){case 0:Kr.call(t,e);break;case 1:Sr.call(t,e);break;case 2:Fr.call(t,e);break;case 3:Lr.call(t,e);break;case 4:Pr.call(t,e);break;default:B.error("unexpected msync command: ".concat(e.command))}else B.error("unexpected msync result: ".concat(e))}))}var zr=new Map;function Kr(e){var t,r,n,o,i,a,c,u,l,h,f,m,v,y,_,T,R,S,b,C,N,A,M,w,U,L,P,x,k,D,j,G,H,F,q,W,z,K,V,J,Y,X,Q,$,Z,ee,te,re,ne,oe,ie,ae,se,ce,ue,le,de;return pr(this,void 0,void 0,(function(){var pe,he,fe,me,ge,Ee,_e,Te,Ie,Oe,Re,Se,be,Ce,Ne,Ae,Me,we,Ue,Le,xe,ke,De,Be,je,Ge,He,Fe,qe,We,ze,Ke,Ve,Je,Xe,Qe,$e,Ze,et,tt,rt,nt,ot,it,at,st,ut,lt=this;return hr(this,(function(dt){switch(dt.label){case 0:if(pe=(pe=this.root.lookup("easemob.pb.CommSyncDL")).decode(e.payload),he=new(d())(pe.serverId.low,pe.serverId.high,pe.serverId.unsigned).toString(),fe=new(d())(pe.metaId.low,pe.metaId.high,pe.metaId.unsigned).toString(),!(Number(fe)>0))return[3,23];if(clearTimeout(null===(t=this._msgHash[fe])||void 0===t?void 0:t.messageTimer),!pe.status)return[3,22];if(0!==pe.status.errorCode)return[3,21];if(null==(me=this._msgHash[fe])?void 0:me.isHandleChatroom){try{if(ge="join"===(null===(r=this._msgHash[fe])||void 0===r?void 0:r.operation)){Ee={};try{pe.metas.length>0&&(_e=this.root.lookup("easemob.pb.MUCBody"),Te=_e.decode(pe.metas[0].payload),(Ie=JSON.parse(Te.status.chatroomInfo||"{}")[this.user])&&(Ee={isAllMembersMuted:Ie.is_all_mute,createTimestamp:Ie.create_timestamp,isInAllowlist:Ie.is_in_white_list,memberCount:Ie.member_count,muteExpireTimestamp:Ie.mute_duration?Ie.mute_duration:-1}))}catch(e){B.error("decode chat room info error",e)}(null===(n=this._msgHash[fe])||void 0===n?void 0:n.resolve)instanceof Function&&this._msgHash[fe].resolve({type:0,data:{action:"apply",id:this._msgHash[fe].roomId,result:!0,user:this.context.userId,info:Ee}}),(null===(o=this._msgHash[fe])||void 0===o?void 0:o.success)instanceof Function&&this._msgHash[fe].success({type:0,data:{action:"apply",id:this._msgHash[fe].roomId,result:!0,user:this.context.userId,info:Ee}})}(null===(i=this._msgHash[fe])||void 0===i?void 0:i.resolve)instanceof Function&&!ge&&this._msgHash[fe].resolve({type:0,data:{result:!0}}),(null===(a=this._msgHash[fe])||void 0===a?void 0:a.success)instanceof Function&&!ge&&this._msgHash[fe].success({type:0,data:{result:!0}}),O.has(fe)&&(Oe=O.get(fe),et=Oe.rpt,tt=Oe.requestName,et({isEndApi:!0,data:{isSuccess:1,requestName:tt,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.success}}),O.delete(fe))}catch(e){O.has(fe)&&(Re=O.get(fe),et=Re.rpt,tt=Re.requestName,et({isEndApi:!0,data:{isSuccess:0,requestName:tt,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.failed,codeDesc:"when executing success function error"}}),O.delete(fe)),nt=p.create({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:e}),this.onError&&this.onError(nt),null===(c=this.eventHandler)||void 0===c||c.dispatch("onError",nt)}delete this._msgHash[fe]}return!me||me.isHandleChatroom?[3,20]:(Se=null,be="",Ce=0,Ne="",Ae=null,this._msgHash[fe].thirdMessage?(this._msgHash[fe].thirdMessage.id=pe.serverId,this._msgHash[fe].thirdMessage.timestamp=pe.timestamp,[4,ct.call(this,this._msgHash[fe].thirdMessage,pe.status,!0,!0)]):[3,2]);case 1:Ae=dt.sent(),dt.label=2;case 2:if(0===pe.metas.length)return[3,13];dt.label=3;case 3:switch(dt.trys.push([3,12,,13]),Me=pe.metas[0],we=pe.status,Me.ns){case 1:return[3,4];case 5:return[3,9]}return[3,10];case 4:return this.useReplacedMessageContents?[4,ct.call(this,Me,we,!0,!0)]:[3,8];case 5:return Ae=dt.sent(),[4,null===(l=null===(u=this._localCache)||void 0===u?void 0:u.getInstance())||void 0===l?void 0:l.getMessageByServerMsgId(fe)];case 6:return(Ue=dt.sent())?[4,null===(f=null===(h=this._localCache)||void 0===h?void 0:h.getInstance())||void 0===f?void 0:f.putMessageToDB(dr(dr(dr({},Ue),Ae),{id:fe}))]:[3,8];case 7:dt.sent(),dt.label=8;case 8:return[3,11];case 9:return(Le=ye.parseNotify(pe.metas[0].payload)).edit_msg&&(xe=Le.edit_msg,ke=xe.count,De=xe.operator,Be=xe.edit_time,je=xe.sender,Ge=xe.send_time,He=xe.chat_type,Se={operationTime:Be,operatorId:De,operationCount:ke},be=je,Ce=Number(Ge),Ne=Ye[He]),[3,11];case 10:return B.error("decode local meta error",Me),[3,11];case 11:return[3,13];case 12:return Fe=dt.sent(),nt=p.create({type:s.WEBIM_LOAD_MSG_ERROR,message:"decode local meta message error",data:Fe}),this.onError&&this.onError(nt),null===(m=this.eventHandler)||void 0===m||m.dispatch("onError",nt),[3,13];case 13:I.has(fe)&&(I.get(fe).rpt({isEndApi:!0,data:{isSuccess:1,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.success,msgId:he,messageType:null!==(v=E[null==Ae?void 0:Ae.chatType])&&void 0!==v?v:E.singleChat}}),I.delete(fe)),dt.label=14;case 14:return dt.trys.push([14,18,,19]),qe={localMsgId:fe,serverMsgId:he},Se&&(We=this._msgHash[fe],ze=We.editMessageId,Ke=We.ext,Ve=We.customExts,Je=We.customEvent,Ae.modifiedInfo=Se,Ae.from=be,Ae.time=Number(Ce),Ae.chatType=Ne,Ae.id=ze,null===(T=null===(_=null===(y=this._localCache)||void 0===y?void 0:y.getInstance())||void 0===_?void 0:_.getMessageByServerMsgId(ze))||void 0===T||T.then((function(e){var t,r,n,o,i,a;e&&("txt"===e.type?null===(r=null===(t=lt._localCache)||void 0===t?void 0:t.getInstance())||void 0===r||r.putMessageToDB(dr(dr({},e),{msg:Ae.msg,modifiedInfo:Ae.modifiedInfo,translations:Ae.translations,ext:Ke?Ae.ext:e.ext})):"custom"===e.type?null===(o=null===(n=lt._localCache)||void 0===n?void 0:n.getInstance())||void 0===o||o.putMessageToDB(dr(dr({},e),{ext:Ke?Ae.ext:e.ext,customExts:Ve,customEvent:Je,modifiedInfo:Ae.modifiedInfo})):null===(a=null===(i=lt._localCache)||void 0===i?void 0:i.getInstance())||void 0===a||a.putMessageToDB(dr(dr({},e),{ext:Ke?Ae.ext:e.ext,modifiedInfo:Ae.modifiedInfo})))}))),Ae&&(Se?("txt"===Ae.type&&(qe.message=Ae),qe.modifiedInfo=Se):qe.message=Ae),[4,null===(S=null===(R=this._localCache)||void 0===R?void 0:R.getInstance())||void 0===S?void 0:S.updateLocalMessage(fe,{serverMsgId:he,status:Pe.SUCCESS})];case 15:return dt.sent(),(null===(b=this._msgHash[fe])||void 0===b?void 0:b.success)instanceof Function?[4,this._msgHash[fe].success(fe,he)]:[3,17];case 16:dt.sent(),dt.label=17;case 17:return(null===(C=this._msgHash[fe])||void 0===C?void 0:C.resolve)instanceof Function&&this._msgHash[fe].resolve(qe),[3,19];case 18:return Xe=dt.sent(),nt=p.create({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing success function error",data:Xe}),this.onError&&this.onError(nt),null===(N=this.eventHandler)||void 0===N||N.dispatch("onError",nt),[3,19];case 19:this.onReceivedMessage&&this.onReceivedMessage({id:fe,mid:he,to:this._msgHash[fe].to,time:0}),null===(A=this.eventHandler)||void 0===A||A.dispatch("onReceivedMessage",{id:fe,mid:he,to:this._msgHash[fe].to}),delete this._msgHash[fe],dt.label=20;case 20:return[3,22];case 21:if(15===pe.status.errorCode)(null===(M=this._msgHash[fe])||void 0===M?void 0:M.fail)instanceof Function&&this._msgHash[fe].fail({type:s.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject({type:s.SERVICE_NOT_ALLOW_MESSAGING_MUTE,reason:"you were muted"}),null===(U=null===(w=this._localCache)||void 0===w?void 0:w.getInstance())||void 0===U||U.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL});else if(1===pe.status.errorCode){switch(Qe=void 0,pe.status.reason){case"blocked":Qe=s.PERMISSION_DENIED;break;case"group not found":Qe=s.GROUP_NOT_EXIST;break;case"not in group or chatroom":Qe=s.GROUP_NOT_JOINED;break;case"exceed recall time limit":Qe=s.MESSAGE_RECALL_TIME_LIMIT;break;case"message recall disabled":Qe=s.SERVICE_NOT_ENABLED;break;case"not in group or chatroom white list":Qe=s.SERVICE_NOT_ALLOW_MESSAGING;break;case"nonroster":Qe=s.USER_NOT_FRIEND,pe.status.reason="not contact";break;case"group is disabled":Qe=s.GROUP_IS_DISABLED,pe.status.reason="group is disabled";break;case"limit directed users":Qe=s.MAX_LIMIT;break;case"Sorry, edit limit reached":Qe=s.MAX_LIMIT,pe.status.reason="Modify message limit reached";break;case"Sorry, message does not exist":Qe=s.MODIFY_MESSAGE_NOT_EXIST,pe.status.reason="The message does not exist.";break;case"Sorry, You do not have permission":Qe=s.PERMISSION_DENIED,pe.status.reason="You do not have the modified permission.";break;case"Sorry, format is incorrect":Qe=s.MODIFY_MESSAGE_FORMAT_ERROR,pe.status.reason="The modify messaged format error.";break;case"Sorry, edit is not available":Qe=s.SERVICE_NOT_ENABLED,pe.status.reason="The message modify function is not activated.";break;case"Sorry, edit fail":Qe=s.MODIFY_MESSAGE_FAILED,pe.status.reason="Modify message failed.";break;default:pe.status.reason.includes("grpID")&&pe.status.reason.includes("does not exist!")?(Qe=s.CHATROOM_NOT_EXIST,pe.status.reason="The chat room dose not exist."):pe.status.reason.includes("username")&&pe.status.reason.includes("doesn't exist!")?Qe=s.USER_NOT_FOUND:"group member list is full!"===pe.status.reason?Qe=s.CHATROOM_MEMBERS_FULL:pe.status.reason.includes("can not join this group")&&pe.status.reason.includes("is in the blacklist")?(Qe=s.PERMISSION_DENIED,pe.status.reason="permission denied"):"can not operate this group, reason: group is disabled"===pe.status.reason?Qe=s.GROUP_IS_DISABLED:pe.status.reason.includes("moderation")?Qe=s.MESSAGE_MODERATION_BLOCKED:pe.status.reason.includes("group ID illegal, please check it")?(Qe=s.REQUEST_PARAMETER_ERROR,pe.status.reason="Invalid parameter"):Qe=pe.status.reason.includes("has create too many chatrooms")||pe.status.reason.includes("has joined too many chatrooms")?s.MAX_LIMIT:pe.status.reason.includes("auto create failed")?s.SERVER_BUSY:s.SERVER_UNKNOWN_ERROR}this._msgHash[fe]&&((null===(L=this._msgHash[fe])||void 0===L?void 0:L.isHandleChatroom)?(rt=p.create({type:Qe,message:pe.status.reason||"",data:""}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].error instanceof Function&&this._msgHash[fe].error(rt),O.has(fe)&&($e=g.failed,Qe===s.CHATROOM_NOT_EXIST?$e=g.notFound:Qe===s.CHATROOM_MEMBERS_FULL&&($e=g.reachLimit),Ze=O.get(fe),et=Ze.rpt,tt=Ze.requestName,et({isEndApi:!0,data:{isSuccess:0,requestName:tt,requestMethod:"WEBSOCKET",requestUrl:this.url,code:$e,codeDesc:pe.status.reason}}),O.delete(fe))):(rt=p.create({type:Qe,message:pe.status.reason||"",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail({type:Qe,reason:pe.status.reason?pe.status.reason:"",data:{id:fe,mid:he}}),null===(x=null===(P=this._localCache)||void 0===P?void 0:P.getInstance())||void 0===x||x.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL})),delete this._msgHash[fe])}else if(7===pe.status.errorCode)"sensitive words"===pe.status.reason&&this._msgHash[fe]?(rt=p.create({type:s.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"sensitive words",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail({type:s.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:fe,mid:he,reason:"sensitive words"}}),null===(D=null===(k=this._localCache)||void 0===k?void 0:k.getInstance())||void 0===D||D.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL})):"blocked by mod_antispam"===pe.status.reason&&this._msgHash[fe]?(rt=p.create({type:s.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"blocked by mod_antispam",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail({type:s.MESSAGE_INCLUDE_ILLEGAL_CONTENT,data:{id:fe,mid:he,reason:"blocked by mod_antispam"}}),null===(G=null===(j=this._localCache)||void 0===j?void 0:j.getInstance())||void 0===G||G.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL})):"user is mute"===pe.status.reason&&this._msgHash[fe]?(rt=p.create({type:s.USER_MUTED_BY_ADMIN,message:"user is mute",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail(rt),null===(F=null===(H=this._localCache)||void 0===H?void 0:H.getInstance())||void 0===F||F.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL})):"traffic limit"===pe.status.reason&&this._msgHash[fe]?(rt=p.create({type:s.MESSAGE_CURRENT_LIMITING,message:"traffic limit",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail(rt),null===(W=null===(q=this._localCache)||void 0===q?void 0:q.getInstance())||void 0===W||W.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL})):"Sorry, data is too large"===pe.status.reason&&this._msgHash[fe]&&(rt=p.create({type:s.MESSAGE_SIZE_LIMIT,message:"Sorry, data is too large",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail(rt),null===(K=null===(z=this._localCache)||void 0===z?void 0:z.getInstance())||void 0===K||K.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL}));else if(19===pe.status.errorCode)this._msgHash[fe]&&(I.has(fe)&&(I.get(fe).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.MESSAGE_EXTERNAL_LOGIC_BLOCKED,codeDesc:pe.status.reason||"",msgId:he,messageType:null!==(J=E[null===(V=this._msgHash[fe])||void 0===V?void 0:V.chatType])&&void 0!==J?J:E.singleChat}}),I.delete(fe)),rt=p.create({type:s.MESSAGE_EXTERNAL_LOGIC_BLOCKED,message:pe.status.reason||"",data:{id:fe,mid:he}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail({type:s.MESSAGE_EXTERNAL_LOGIC_BLOCKED,data:{id:fe,mid:he,reason:pe.status.reason}}),null===(X=null===(Y=this._localCache)||void 0===Y?void 0:Y.getInstance())||void 0===X||X.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL}));else if(this._msgHash[fe]){I.has(fe)&&(I.get(fe).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.WEBIM_LOAD_MSG_ERROR,codeDesc:(null===(Q=pe.status)||void 0===Q?void 0:Q.reason)||"",msgId:he,messageType:null!==(Z=E[null===($=this._msgHash[fe])||void 0===$?void 0:$.chatType])&&void 0!==Z?Z:E.singleChat}}),I.delete(fe));try{rt=p.create({type:s.WEBIM_LOAD_MSG_ERROR,message:(null===(ee=pe.status)||void 0===ee?void 0:ee.reason)||"",data:{id:fe,mid:he,reason:pe.status&&pe.status.reason}}),this._msgHash[fe].reject instanceof Function&&this._msgHash[fe].reject(rt),null===(re=null===(te=this._localCache)||void 0===te?void 0:te.getInstance())||void 0===re||re.updateLocalMessage(fe,{serverMsgId:he,status:Pe.FAIL}),this._msgHash[fe].fail instanceof Function&&this._msgHash[fe].fail({type:s.WEBIM_LOAD_MSG_ERROR,data:{errorCode:pe.status&&pe.status.errorCode,reason:pe.status&&pe.status.reason}})}catch(e){nt=p.create({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"when executing fail function error",data:e}),this.onError&&this.onError(nt),null===(ne=this.eventHandler)||void 0===ne||ne.dispatch("onError",nt)}delete this._msgHash[fe]}else I.has(fe)&&(I.get(fe).rpt({isEndApi:!0,data:{isSuccess:0,requestMethod:"WEBSOCKET",requestUrl:this.url,code:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,codeDesc:"on message error",msgId:he,messageType:null!==(ie=E[null===(oe=this._msgHash[fe])||void 0===oe?void 0:oe.chatType])&&void 0!==ie?ie:E.singleChat}}),I.delete(fe)),nt=p.create({type:s.WEBIM_CONNCTION_CALLBACK_INNER_ERROR,message:"on message error"}),this.onError&&this.onError(nt),null===(ae=this.eventHandler)||void 0===ae||ae.dispatch("onError",nt);dt.label=22;case 22:return[2];case 23:if(pe.metas&&0!==pe.metas.length){this._offlineMessagePullState!==ve.SYNC_FINISH&&zr.set(pe.queue.name,pe.metas.length);try{Ir.call(this,pe.metas,pe.status)}catch(e){nt=p.create({type:s.WEBIM_LOAD_MSG_ERROR,message:"decode message error",data:e}),B.error("decode message error",e),this.onError&&this.onError(nt),null===(se=this.eventHandler)||void 0===se||se.dispatch("onError",nt)}finally{pe.isLast?(B.debug("DLMessage isLast",pe.isLast),ot=-1,this._queues.some((function(e,t){return e.name===pe.name&&(ot=t,!0)}))&&ot>0&&this._queues.splice(ot,1),this._queues.length>0&&Nr.call(this,this._queues[0]),Rr.call(this,pe)):pe.nextKey&&(st=new(d())(pe.nextKey.low,pe.nextKey.high,pe.nextKey.unsigned).toString(),B.debug("nexKey:",st,"this.nextKey:",this.nexKey),st!==this.nexKey||(null===(ce=pe.queue)||void 0===ce?void 0:ce.name)!==this.currentQueue?(this.nexKey=st,this.currentQueue=null===(ue=pe.queue)||void 0===ue?void 0:ue.name,Ur.call(this,pe.nextKey,pe.queue)):(B.debug("nexKey and queue are same, delete it"),it=-1,this._queues.some((function(e,t){return e.name===pe.queue.name&&(it=t,!0)}))&&this._queues.splice(it,1),this._queues.length>0&&Nr.call(this,this._queues[0])))}}else pe.isLast?(B.debug("isLast",pe.isLast),at=-1,this._queues.some((function(e,t){return e.name===pe.queue.name&&(at=t,!0)}))&&this._queues.splice(at,1),this._queues.length>0&&Nr.call(this,this._queues[0]),Rr.call(this,pe)):pe.nextKey&&(st=new(d())(pe.nextKey.low,pe.nextKey.high,pe.nextKey.unsigned).toString(),B.debug("nexKey:",st,"this.nextKey:",this.nexKey),st!==this.nexKey||(null===(le=pe.queue)||void 0===le?void 0:le.name)!==this.currentQueue?(this.nexKey=st,this.currentQueue=null===(de=pe.queue)||void 0===de?void 0:de.name,Ur.call(this,pe.nextKey,pe.queue)):(B.debug("nexKey and queue are same, delete it"),ut=-1,this._queues.some((function(e,t){return e.name===pe.queue.name&&(ut=t,!0)}))&&this._queues.splice(ut,1),this._queues.length>0&&Nr.call(this,this._queues[0])));return[2]}}))}))}function Vr(e){var t=[],r=this.root.lookup("easemob.pb.KeyValue"),n=[];for(var o in e){var i=r.decode(t);if(i.key=o,void 0!==e[o]){if("object"===ar(e[o]))i.type=8,i.stringValue=JSON.stringify(e[o]);else if("string"==typeof e[o])i.type=7,i.stringValue=e[o];else if("boolean"==typeof e[o])i.type=1,i.varintValue=!0===e[o]?1:0;else if(Number.isInteger(e[o]))i.type=2,i.varintValue=e[o];else if("bigint"==typeof e[o]||"symbol"===ar(e[o])||"function"==typeof e[o]||Number.isNaN(e[o]))i.type=7,i.stringValue=e[o].toString();else{if("number"!=typeof e[o]||Number.isInteger(e[o]))continue;i.type=6,i.doubleValue=e[o]}n.push(i)}}return n}function Jr(e){var t,r,n,o=[];if(this.root){var i,a=this.root.lookup("easemob.pb.MessageBody.Content").decode(o);switch(i=!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":a.type=0,a.text=e.msg;break;case"img":a.type=1,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.size=e.body.size,a.thumbnailDisplayName=e.body.filename):e.file?(a.displayName=e.file.filename,a.remotePath=e.file.url,a.secretKey=e.file.secret,a.fileLength=e.file.file_length,a.size=e.file.size,a.thumbnailDisplayName=e.file.filename):(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.size=e.size,a.thumbnailDisplayName=e.filename),e.isBuildCombinedMsg&&(a.remotePath=e.url,a.secretKey=e.secret,a.size={height:e.height,width:e.width}),e.isGif&&(a.subType=1);var c=e.imageType,u=e.isGif||!0===e.isOriginalImage||"original"===c;a.imageType=u?1:2;break;case"video":a.type=2,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.duration=e.body.length,a.thumbnailDisplayName=e.body.filename,a.thumbnailRemotePath=this.useOwnUploadFun?"":"".concat(e.body.url,"?vframe=true"),a.thumbnailSecretKey=this.useOwnUploadFun?"":e.body.secret):e.isBuildCombinedMsg&&(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.duration=e.length,a.thumbnailDisplayName=e.filename,a.thumbnailRemotePath=e.thumb,a.thumbnailSecretKey=e.thumb_secret);break;case"loc":a.type=3,a.latitude=e.lat,a.longitude=e.lng,a.address=e.addr,a.buildingName=e.buildingName,a.latitude=e.lat;break;case"audio":a.type=4,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.duration=e.body.length,a.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.duration=e.length,a.thumbnailDisplayName=e.filename);break;case"file":a.type=5,e.body?(a.displayName=e.body.filename,a.remotePath=e.body.url,a.secretKey=e.body.secret,a.fileLength=e.body.file_length,a.thumbnailDisplayName=e.body.filename):e.isBuildCombinedMsg&&(a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.thumbnailDisplayName=e.filename);break;case"cmd":a.type=6,a.action=e.action;break;case"custom":a.type=7,a.customEvent=e.customEvent,a.customExts=Vr.call(this,e.customExts);break;case"combine":a.type=0,a.subType=0,a.text=e.compatibleText,a.displayName=e.filename,a.remotePath=e.url,a.secretKey=e.secret,a.fileLength=e.file_length,a.title=e.title,a.summary=e.summary,a.combineLevel=e.combineLevel}var l=[];e.ext&&(l=Vr.call(this,e.ext));var p=this.root.lookup("easemob.pb.MessageBody"),h=p.decode(o),f=e.from||this.context.jid.name;h.from={name:e.isBuildCombinedMsg?f:this.context.jid.name};var m=e.to.indexOf("/"),v=m>-1?e.to.substring(0,m):e.to;if(h.to={name:v},"channel"===e.type)h.type=sr.CHANNEL_ACK;else if("recall"===e.type)h.type=sr.RECALL,h.ackMessageId=e.ackId;else if("delivery"===e.type)h.type=sr.DELIVER_ACK,h.ackMessageId=e.ackId;else if("read"===e.type)h.type=sr.READ_ACK,h.ackMessageId=e.ackId,"groupChat"===i&&(h.msgConfig={allowGroupAck:!0},h.ackContent=e.ackContent);else if("chatRoom"===i)h.type=sr.CHATROOM;else if("groupChat"===i){if(h.type=sr.GROUPCHAT,e.msgConfig){var g=e.msgConfig.allowGroupAck;h.msgConfig={allowGroupAck:!!g}}}else"singleChat"===i&&(h.type=sr.SINGLECHAT);e.editMessageId&&(h.type=sr.EDIT,h.editMessageId=e.editMessageId,h.editScope=cr.BODY,e.ext&&(h.editScope=cr.BODY_AND_EXT)),h.contents=[a],h.ext=l;var y=function(e){var t={};return"translations"in e&&(t.translations=e.translations),"isChatThread"in e&&e.isChatThread&&(t.thread={}),Object.keys(t).length>0?JSON.stringify(t):""}(e);y&&(h.meta=y),h=p.encode(h).finish();var E=this.root.lookup("easemob.pb.Meta"),_=E.decode(o);_.id=e.id;var T="easemob.com";if("chatRoom"!==i&&"groupChat"!==i||(T="conference.easemob.com"),_.to={appKey:this.appKey,name:v,domain:T},m>-1&&(_.to.clientResource=e.to.substring(m+1,e.to.length)),"chatRoom"===i&&(_.ext=Vr.call(this,function(e){return{chatroom_msg_tag:"high"===e.priority?0:"low"===e.priority?2:1}}(e))),"recall"===e.type&&e.metaExt&&(_.ext=Vr.call(this,{recallMessageExtensionInfo:e.metaExt})),_.ns=1,_.payload=h,_.routetype=e.deliverOnlineOnly?1:0,"singleChat"!==i&&Array.isArray(e.receiverList)&&(null===(n=e.receiverList)||void 0===n?void 0:n.length)>0&&(_.directedUsers=e.receiverList,_.routetype=2),"delivery"!==e.type&&void 0!==e.webhookEnv){if("string"!=typeof e.webhookEnv)throw Error('Invalid parameter: "webhookEnv"');_.env=e.webhookEnv}if(e.isBuildCombinedMsg)return _.timestamp=d().fromValue(e.time),E.encode(_).finish();var I=this.root.lookup("easemob.pb.CommSyncUL"),O=I.decode(o);O.meta=_,!e.isPing&&Xr.call(this,e,_),O=I.encode(O).finish();var R=this.root.lookup("easemob.pb.MSync"),S=R.decode(o);return S.version=this.version,S.encryptType=this.encryptType,S.command=0,S.payload=O,S.traceId=fr.gen(),B.debug("traceId",S.traceId),R.encode(S).finish()}e.fail&&e.fail({type:s.WEBIM_CONNCTION_CLIENT_OFFLINE,message:"Not logged in"})}function Yr(e){var t,r,n,o,i,a,c,u,l,d=this,p=dr({},e);if(p.editMessageId){var h=Jr.call(this,p);tn.call(this,h)}else{if(e.file||"img"===e.type&&e._filePath){if(p.accessToken=this.token,p.appKey=this.appKey,p.apiUrl=this.apiUrl,p.body&&p.body.url)return Jr.call(this,p);var m=(null===(r=null===(t=p.file)||void 0===t?void 0:t.data)||void 0===r?void 0:r.type)||(null===(n=p.file)||void 0===n?void 0:n.filetype)||p.filetype||"";if(p.isGif&&m&&"image/gif"!==m)return void this._msgHash[p.id].reject({type:s.MESSAGE_INCLUDE_ILLEGAL_CONTENT,message:"The file type is not gif."});var v=null!==(a=null===(i=null===(o=p.file)||void 0===o?void 0:o.data)||void 0===i?void 0:i.size)&&void 0!==a?a:p.file_length;if("number"==typeof v&&v<=0){var g={type:s.WEBIM_UPLOADFILE_ERROR,message:"fileSize must be greater than 0"};return p.onFileUploadError instanceof Function&&p.onFileUploadError(g),void(null===(c=this._msgHash[p.id])||void 0===c||c.reject(g))}return new Promise((function(t,r){var n=p.onFileUploadComplete,o=p.onFileUploadError,i=function(e,t){var r,n={type:s.WEBIM_UPLOADFILE_ERROR,message:e,data:t};o instanceof Function&&o(n),null===(r=d._msgHash[p.id])||void 0===r||r.reject(n)},a=function(e){var t=(null==e?void 0:e.message)||"";return/missing .*capability|requires file path string/i.test(t)},c=function(t){var r,o,i,a,c,u,l,h,m,v,g,y,E;if(t.entities){if(t.entities[0]["file-metadata"]){var _=t.entities[0]["file-metadata"]["content-length"];p.file_length=_,p.filetype=t.entities[0]["file-metadata"]["content-type"],_>204800&&(p.thumbnail=!0)}var T,O,S,b=(null===(o=p.file)||void 0===o?void 0:o.filename)||p.filename||(null===(i=p.body)||void 0===i?void 0:i.filename)||"image",C=p.filetype||(null===(a=p.file)||void 0===a?void 0:a.filetype)||(null===(c=t.entities[0]["file-metadata"])||void 0===c?void 0:c["content-type"])||"",N=null!==(g=null!==(m=null!==(h=null===(l=null===(u=p.file)||void 0===u?void 0:u.data)||void 0===l?void 0:l.size)&&void 0!==h?h:p.file_length)&&void 0!==m?m:null===(v=t.entities[0]["file-metadata"])||void 0===v?void 0:v["content-length"])&&void 0!==g?g:0,A="".concat(d.getChatFilesUrl(),"/").concat(t.entities[0].uuid);if(p.body={type:p.type||"file",secret:t.entities[0]["share-secret"],filename:b,url:A,length:p.length||0,filetype:C,file_length:N,size:{width:p.width||0,height:p.height||0}},p.file&&(p.file.url=t.uri),e.secret=t.entities[0]["share-secret"],t.url=e.url="".concat(A,"?em-redirect=true&share-secret=").concat(t.entities[0]["share-secret"]),e.file_length=p.file_length=N,"img"===p.type){var M=(T=A,O=t.entities[0]["share-secret"],S="em-redirect=true".concat(O?"&share-secret=".concat(O):""),{originalImageUrl:"".concat(T,"?").concat(S),bigImageUrl:"".concat(T,"?size=large&").concat(S)}),w="".concat(e.url,"&thumbnail=true");e.thumb=w,t.thumb="".concat(t.url,"&thumbnail=true"),e.originalImageUrl=M.originalImageUrl,e.bigImageUrl=M.bigImageUrl,t.originalImageUrl=M.originalImageUrl,t.bigImageUrl=M.bigImageUrl}"video"===p.type&&(e.thumb="".concat(e.url,"&vframe=true"),e.thumb_secret=t.entities[0]["share-secret"],t.thumb="".concat(t.url,"&vframe=true")),n instanceof Function&&n(t,p.id);var U=Jr.call(d,p);I.size<=R&&I.set(p.id,{rpt:d.dataReport.geOperateFun({operationName:f.SEND_MSG})}),null===(E=null===(y=d._localCache)||void 0===y?void 0:y.getInstance())||void 0===E||E.storeMessage(e,Pe.INPROGRESS),tn.call(d,U)}else null===(r=d._msgHash[p.id])||void 0===r||r.reject({type:s.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the file",data:t})};p.onFileUploadComplete=c,p.onFileUploadError=function(e){var t;o instanceof Function&&o(e),null===(t=d._msgHash[p.id])||void 0===t||t.reject({type:s.WEBIM_UPLOADFILE_ERROR,message:e.message||"Failed to upload the file",data:e})},pr(d,void 0,void 0,(function(){var e,t,r,n,o,s,u,l,d,h,m,v,g,y,E,_,T,I,O,R,S,b,C,N,A,M,w,U,L,P,x,k,D,j,G,H,F,q,W,z,K,V,J;return hr(this,(function(Y){switch(Y.label){case 0:if(Y.trys.push([0,24,,25]),"img"!==p.type)return[3,23];if(e=this._imageProcessor,t=null===(P=p.file)||void 0===P?void 0:P.data,r=p._filePath,n=null!==(k=null!==(x=null==t?void 0:t.size)&&void 0!==x?x:p.file_length)&&void 0!==k?k:0,o=(null==t?void 0:t.type)||(null===(D=p.file)||void 0===D?void 0:D.filetype)||p.filetype||"",s=p.imageType,u=p.isGif||!0===p.isOriginalImage||"original"===s,l=void 0,!r||!e)return[3,4];Y.label=1;case 1:return Y.trys.push([1,3,,4]),[4,e.getImageInfo(r)];case 2:return(l=Y.sent()).path&&l.path!==r&&(B.debug("Miniapp image message file path normalized",r,l.path),r=l.path,p._filePath=l.path),[3,4];case 3:return d=Y.sent(),B.warn("Failed to normalize miniapp image path",d),[3,4];case 4:if(p.width&&p.height||!t&&!r)return[3,12];Y.label=5;case 5:return Y.trys.push([5,11,,12]),e?(m=l)?[3,7]:[4,e.getImageInfo(r||t)]:[3,8];case 6:m=Y.sent(),Y.label=7;case 7:return h=m,r&&h.path&&h.path!==r&&(r=h.path,p._filePath=h.path),p.width||(p.width=h.width),p.height||(p.height=h.height),[3,10];case 8:return"undefined"==typeof Image||"undefined"==typeof URL?[3,10]:[4,new Promise((function(e,r){var n=new Image,o=URL.createObjectURL(t);n.onload=function(){URL.revokeObjectURL(o),e({w:n.width,h:n.height})},n.onerror=function(){URL.revokeObjectURL(o),r(new Error("load failed"))},n.src=o}))];case 9:v=Y.sent(),p.width||(p.width=v.w),p.height||(p.height=v.h),Y.label=10;case 10:return[3,12];case 11:return g=Y.sent(),r&&a(g)?(i("Failed to read image info on mini program platform",g),[2]):(B.warn("Failed to read image info",g),[3,12]);case 12:if(r&&(!p.width||!p.height)&&!e)return i("Mini program platform is missing image info capability"),[2];if(y=p.width,E=p.height,!u&&!p.isGif&&r&&!e)return i("Mini program platform is missing image compression capability"),[2];if(u||p.isGif||!e)return[3,16];if(!(O=r||t))return[3,16];Y.label=13;case 13:return Y.trys.push([13,15,,16]),[4,e.generateBigImage(O,{maxShortEdge:720,quality:.85})];case 14:return(_=Y.sent())&&(_.file&&(p.file=dr(dr({},p.file),{data:_.file})),_.path&&(p._filePath=_.path,r=_.path),p.file_length=_.size,p.filetype=_.type,p.file&&(p.file.filetype=_.type),p.width=_.width,p.height=_.height,B.debug("Image compressed for large send","".concat(_.width,"x").concat(_.height,", size: ").concat(_.size))),[3,16];case 15:return T=Y.sent(),r&&a(T)?(i("Mini program platform is missing image compression capability",T),[2]):(B.warn("Big image generation failed, falling back to original",T),p.isOriginalImage=!0,u=!0,[3,16]);case 16:if(w=null!==(F=null!==(H=null===(G=null===(j=p.file)||void 0===j?void 0:j.data)||void 0===G?void 0:G.size)&&void 0!==H?H:p.file_length)&&void 0!==F?F:0,I=u?"original":"large",r&&rr(w,"img",I)&&!e)return i("Mini program platform is missing image MD5 capability"),[2];if(!rr(w,"img",I)||!e)return[3,22];Y.label=17;case 17:return Y.trys.push([17,21,,22]),(O=r||t)?[4,e.computeMd5(O)]:[3,20];case 18:return[4,ir(this,Y.sent(),"img",I)];case 19:if((U=Y.sent()).hit&&U.uuid)return"original"===(R=U.effectiveImageType||I)&&(p.isOriginalImage=!0,u=!0,p.width=y,p.height=E),B.debug("Precheck hit, skipping upload","uuid: ".concat(U.uuid),"effectiveImageType: ".concat(R)),S="original"===R?n:w,b="original"===R?o||(null===(q=p.file)||void 0===q?void 0:q.filetype)||"image/jpeg":(null===(W=p.file)||void 0===W?void 0:W.filetype)||p.filetype||"image/jpeg",C={entities:[{uuid:U.uuid,"share-secret":U.shareSecret||"","file-metadata":{"content-length":S,"content-type":b}}],uri:"".concat(this.getChatFilesUrl(),"/").concat(U.uuid)},c(C),[2];Y.label=20;case 20:return[3,22];case 21:return N=Y.sent(),r&&a(N)?(i("Mini program platform is missing image MD5 capability",N),[2]):(B.warn("Precheck error, proceeding with upload",N),[3,22]);case 22:p._uploadImageType=or(I),Y.label=23;case 23:return[3,25];case 24:return A=Y.sent(),B.warn("Image preprocessing failed, proceeding with normal upload",A),[3,25];case 25:if("img"===p.type)return[3,30];if(M=null===(z=p.file)||void 0===z?void 0:z.data,w=null!==(V=null!==(K=null==M?void 0:M.size)&&void 0!==K?K:p.file_length)&&void 0!==V?V:0,!M||!rr(w,p.type))return[3,30];Y.label=26;case 26:return Y.trys.push([26,29,,30]),[4,nr(M)];case 27:return[4,ir(this,Y.sent(),p.type)];case 28:return(U=Y.sent()).hit&&U.uuid?(B.debug("Attachment precheck hit, skipping upload","uuid: ".concat(U.uuid),"type: ".concat(p.type)),c({entities:[{uuid:U.uuid,"share-secret":U.shareSecret||"","file-metadata":{"content-length":w,"content-type":M.type||p.filetype||(null===(J=p.file)||void 0===J?void 0:J.filetype)||""}}],uri:"".concat(this.getChatFilesUrl(),"/").concat(U.uuid)}),[2]):[3,30];case 29:return L=Y.sent(),B.warn("Attachment precheck failed, proceeding with upload",L),[3,30];case 30:return ye.uploadFile.call(this,p,f.UPLOAD_MSG_ATTACH),[2]}}))}))}))}if("combine"===e.type){p.accessToken=this.token,p.appKey=this.appKey,p.apiUrl=this.apiUrl;var y=p.onFileUploadComplete,E=p.onFileUploadError;return new Promise((function(t,r){var n,o,i,a;if((null===(n=e.messageList)||void 0===n?void 0:n.length)>300||0===(null===(o=e.messageList)||void 0===o?void 0:o.length))return d._msgHash[p.id].reject({type:s.MAX_LIMIT,message:"The number of combined messages exceeded the limit."});var c=function(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}([],e.messageList,!0),u=0;if(c.forEach((function(e){(null==e?void 0:e.combineLevel)>u&&(u=null==e?void 0:e.combineLevel)})),p.combineLevel=u+1,p.combineLevel>10)return d._msgHash[p.id].reject({type:s.MAX_LIMIT,message:"The level of the merged message exceeded the limit."});var l=Qr.call(d,c),h=function(t,r){var n,o,i,a,s,c,u="".concat(d.getChatFilesUrl(),"/").concat(t.entities[0].uuid),l=null===(n=t.entities[0])||void 0===n?void 0:n["share-secret"],h="".concat(u,"?em-redirect=true");l&&(h="".concat(h,"&share-secret=").concat(l)),y instanceof Function&&y({url:h,secret:l}),e.url=h,e.secret=l,p.url=h,p.secret=t.entities[0]["share-secret"],p.filename=(null===(o=p.file)||void 0===o?void 0:o.filename)||(null==r?void 0:r.fileName),p.file_length=(null===(a=null===(i=p.file)||void 0===i?void 0:i.data)||void 0===a?void 0:a.size)||(null==r?void 0:r.fileLength)||0,null===(c=null===(s=d._localCache)||void 0===s?void 0:s.getInstance())||void 0===c||c.storeMessage(e,Pe.INPROGRESS);var f=Jr.call(d,p);tn.call(d,f)},m=ye.getEnvInfo();if("web"!==m.platform&&"node"!==m.platform&&"quick_app"!==m.platform&&(null===(a=null===(i=m.global)||void 0===i?void 0:i.canIUse)||void 0===a?void 0:a.call(i,"getFileSystemManager"))){var v=m.global.getFileSystemManager(),g=d.getChatFilesUrl();v.writeFile({filePath:"".concat(m.global.env.USER_DATA_PATH,"/combine"),data:l.buffer,encoding:"binary",success:function(e){m.global.uploadFile({url:g,filePath:"".concat(m.global.env.USER_DATA_PATH,"/combine"),name:"file",header:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+p.accessToken},success:function(e){if(200===e.statusCode){B.debug("upload success");var t=JSON.parse(e.data);h(t,{fileName:"combine",fileLength:l.length})}else B.error("upload fail"),p.onFileUploadError instanceof Function&&p.onFileUploadError(e),this._msgHash[p.id].reject({type:s.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})},fail:function(t){B.error("upload fail"),p.onFileUploadError instanceof Function&&p.onFileUploadError(e),this._msgHash[p.id].reject({type:s.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:t})}})},fail:function(e){B.error("write file fail",e),this._msgHash[p.id].reject({type:s.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})}})}else{var _=new File([l],"combine",{type:"application/octet-stream"}),T={url:URL.createObjectURL(_),filename:p.id,data:_};p.file=T,p.onFileUploadComplete=function(e){h(e)},p.onFileUploadError=function(e){E instanceof Function&&E(e),d._msgHash[p.id].reject({type:s.WEBIM_UPLOADFILE_ERROR,message:"Failed to upload the merge message.Please try again",data:e})},ye.uploadFile.call(d,p,f.UPLOAD_MSG_ATTACH)}}))}"img"===e.type&&(p.body||(p.body=dr(dr({},p),{size:{width:p.width||0,height:p.height||0}}))),null===(l=null===(u=this._localCache)||void 0===u?void 0:u.getInstance())||void 0===l||l.storeMessage(e,Pe.INPROGRESS),h=Jr.call(this,p),tn.call(this,h)}}function Xr(e,t){if(e.editMessageId)return t.ignoreCallback=!0,void(this._msgHash[e.id].thirdMessage=t);mr.includes(e.type)&&(this._msgHash[e.id].thirdMessage=t)}function Qr(e){for(var t=Uint8Array.from("cm",(function(e){return e.charCodeAt(0)})),r=0;r<e.length;r++){for(var n=e[r],o=dr(dr({},n),{isBuildCombinedMsg:!0}),i=this.mSync.encodeChatMsg.call(this,o),a=i.length,s=new Uint8Array(4),c=0;c<4;c++)s[c]=a>>8*(3-c)&255;var u=new Uint8Array(t.length+s.length+i.length);u.set(t),u.set(s,t.length),u.set(i,t.length+s.length),t=u}var l=new Uint8Array(t.length+1),d=0;for(r=2;r<t.length;r++)r%2==1&&(d^=t[r]);return l.set(t),B.debug("checkResult:",d),l[t.length]=d,l}function $r(e,t,r){var n=[],o=this.root.lookup("easemob.pb.MUCBody"),i=e.roomId,a=e.ext,s=void 0===a?"":a,c=e.leaveOtherRooms,u=void 0!==c&&c,l=o.decode(n);l.mucId={appKey:this.appKey,name:i,domain:"conference.easemob.com"},l.operation="join"===r?2:3,l.from={name:this.context.userId},l.isChatroom=!0,"join"===r&&(l.ext=s,l.leaveOtherRooms=u),l=o.encode(l).finish();var d=this.root.lookup("easemob.pb.Meta").decode(n);d.id=t,d.from={appKey:this.appKey,name:this.context.userId,domain:"easemob.com",client_resource:this.context.jid.clientResource},d.to={domain:"easemob.com"},d.ns=2,d.payload=l;var p=this.root.lookup("easemob.pb.CommSyncUL"),h=p.decode(n);h.meta=d,h=p.encode(h).finish();var f=this.root.lookup("easemob.pb.MSync"),m=f.decode(n);return m.version=this.version,m.encryptType=this.encryptType,m.command=0,m.payload=h,m.traceId=fr.gen(),B.debug("traceId",m.traceId),f.encode(m).finish()}function Zr(e,t){var r=ye.getUniqueId(),n=$r.call(this,e,r,t),o="join"===t?f.JOIN_CHATROOM:f.QUIT_CHATROOM,i=this.dataReport.geOperateFun({operationName:o});return O.size<=R&&O.set(r,{rpt:i,requestName:o}),tn.call(this,dr(dr({},e),{isHandleChatroom:!0,joinMsg:n,id:r,operation:t}),r)}function en(e){var t=this;return new Promise((function(r,n){var o,i,a,c,u,l;if(B.debug("call send"),t.logOut)return B.error("send message failed",s.WEBIM_CONNECTION_CLOSED),n({type:s.WEBIM_CONNECTION_CLOSED,message:"not login"});if(!e.id||"string"!=typeof e.id||""===e.id)return n({type:s.MESSAGE_PARAMETER_ERROR,message:'Missing required parameter: "id"'});if(!e.to||"string"!=typeof e.to||""===e.to)return n({type:s.MESSAGE_PARAMETER_ERROR,message:'Missing required parameter: "to"'});var d="file"===e.type||"img"===e.type||"audio"===e.type||"video"===e.type,p="delivery"===e.type||"read"===e.type||"channel"===e.type,h="cmd"===e.type,m="recall"===e.type,v=null==e?void 0:e.editMessageId,g=!(p||m||h||v);if(e.id){if(!d&&!p||d&&t.useOwnUploadFun){var y="recall"===e.type?f.SEND_RECALL_MSG:f.SEND_MSG;v&&(y=f.MODIFY_MESSAGE),I.size<=R&&I.set(e.id,{rpt:t.dataReport.geOperateFun({operationName:y})})}g&&(null===(i=null===(o=t._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.storeMessage(e,Pe.CREATE)),t._msgHash[e.id]=dr(dr({},e),{resolve:r,reject:n})}if(d||"combine"===e.type)return Yr.call(t,e);if("txt"===e.type&&(null===(a=e.msgConfig)||void 0===a?void 0:a.languages)&&Array.isArray(null===(c=e.msgConfig)||void 0===c?void 0:c.languages)&&e.msgConfig.languages.length>0){var E=t.translateMessage||t.translation.translateMessage;if(!E)throw new Error("there is no method to translate message");E.call(t,{text:e.msg,languages:e.msgConfig.languages}).then((function(r){var n,o,i,a=null===(n=r.data[0])||void 0===n?void 0:n.translations;a=a.map((function(e){return{code:e.to,text:e.text}})),e.translations=a,t._msgHash[e.id].translations=a,null===(i=null===(o=t._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.storeMessage(e,Pe.INPROGRESS);var s=Jr.call(t,e);tn.call(t,s,e.id)})).catch((function(e){n(e)}))}else{g&&(null===(l=null===(u=t._localCache)||void 0===u?void 0:u.getInstance())||void 0===l||l.storeMessage(e,Pe.INPROGRESS));var _=Jr.call(t,e);tn.call(t,_,e.id)}}))}function tn(e,t){var r,n,o,i,a=this;if(e.isHandleChatroom){if(!this.isOpened()){var c={data:"",type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};if(O.has(e.id)){var u=O.get(e.id);(0,u.rpt)({isEndApi:!0,data:{isSuccess:0,requestName:u.requestName,requestMethod:"WEBSOCKET",requestUrl:this.url,code:g.disconnect,codeDesc:"websocket has been disconnected"}}),O.delete(e.id)}return Promise.reject(c)}return new Promise((function(r,n){var o,i;a._msgHash[e.id]=dr(dr({},e),{resolve:r,reject:n});var c=Vt.call(a,e.joinMsg),u=c[0];if(!c[1]){var l={type:s.SDK_RUNTIME_ERROR,message:"compress message failed"};return null===(i=null===(o=a._msgHash[e.id])||void 0===o?void 0:o.reject)||void 0===i||i.call(o,l),void delete a._msgHash[e.id]}var d=a._getSock?_r.call(a,u,t):u;if(t){var p=setTimeout((function(){var t,r=a._msgHash[e.id];if(r){var n={type:s.REQUEST_TIMEOUT,message:"request timeout"};null===(t=r.reject)||void 0===t||t.call(r,n),clearTimeout(r.messageTimer),delete a._msgHash[e.id],a.reconnecting||a.reconnect(!0)}}),15e3);a._msgHash[e.id].messageTimer=p}a.sock.send(d)}))}if(!this.isOpened())return null===(r=this.unMSyncSendMsgMap)||void 0===r||r.set(t,e),!this.logOut&&this.autoReconnectNumTotal<this.autoReconnectNumMax&&(B.info("need to reconnect",this.autoReconnectNumTotal,this.autoReconnectNumMax),this.offLineSendConnecting=!0,this.reconnecting||this.reconnect()),void(this.onError&&this.onError({type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}));var l=t&&setTimeout((function(){var e,r,n;if(a._msgHash[null!=t?t:""]){var o={type:s.MESSAGE_SEND_TIMEOUT,message:"send message timeout"};null===(r=(e=a._msgHash[null!=t?t:""]).reject)||void 0===r||r.call(e,o),clearTimeout(null===(n=a._msgHash[null!=t?t:""])||void 0===n?void 0:n.messageTimer),delete a._msgHash[null!=t?t:""],a.reconnecting||a.reconnect(!0)}}),15e3);this._msgHash[null!=t?t:""]&&(this._msgHash[null!=t?t:""].messageTimer=l);var d=Vt.call(this,e),p=d[0];if(!d[1])return c={type:s.SDK_RUNTIME_ERROR,message:"compress message failed"},null===(o=null===(n=this._msgHash[null!=t?t:""])||void 0===n?void 0:n.reject)||void 0===o||o.call(n,c),clearTimeout(null===(i=this._msgHash[null!=t?t:""])||void 0===i?void 0:i.messageTimer),void delete this._msgHash[null!=t?t:""];var h=this._getSock?_r.call(this,p,t):p;this.sock.send(h)}var rn=function(e,t){return e.send=en,e.sendMsg=en,B.info("init Msync by ".concat(e.name)),{generateProvision:yr.bind(e),generateLogout:Er.bind(e),base64transform:_r.bind(e),distributeMeta:Tr.bind(e),decodeMeta:Ir.bind(e),decodeUnreadDL:Sr.bind(e),_rebuild:br.bind(e),_lastsession:Ar.bind(e),receiveProvision:Lr.bind(e),isInQueue:Hr.bind(e),decodeNotice:Fr.bind(e),decodeMSync:qr.bind(e),distributeMSync:Wr.bind(e),encodeChatMsg:Jr.bind(e),upLoadFile:Yr.bind(e),send:en.bind(e),stopHeartBeat:jr.bind(e),handleChatRoom:Zr.bind(e),sendUnreadDeal:Dr.bind(e)}},nn=["onTextMessage","onFileMessage","onAudioMessage","onVideoMessage","onImageMessage","onLocationMessage","onCustomMessage","onCMDMessage","onStreamMessage"],on=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 nn.includes(e)&&t?B.debug("dispatch event: "+e,{id:t.id,type:t.type,time:t.time,from:t.from,to:t.to,chatType:t.chatType}):"onMessage"===e?B.debug("dispatch event: "+e,null==t?void 0:t.length):B.debug("dispatch event: "+e,t||""),this.handlerData){var n=this.handlerData[r][e];n&&n(t)}},e}(),an=function(){};function sn(e){this.onOpened=e.onOpened||an,this.onPresence=e.onPresence||an,this.onTextMessage=e.onTextMessage||an,this.onPictureMessage=e.onPictureMessage||an,this.onAudioMessage=e.onAudioMessage||an,this.onVideoMessage=e.onVideoMessage||an,this.onFileMessage=e.onFileMessage||an,this.onLocationMessage=e.onLocationMessage||an,this.onCmdMessage=e.onCmdMessage||an,this.onCustomMessage=e.onCustomMessage||an,this.onReceivedMessage=e.onReceivedMessage||an,this.onDeliveredMessage=e.onDeliveredMessage||an,this.onReadMessage=e.onReadMessage||an,this.onRecallMessage=e.onRecallMessage||an,this.onChannelMessage=e.onChannelMessage||an,this.onError=e.onError||an,this.onOffline=e.onOffline||an,this.onOnline=e.onOnline||an,this.onStatisticMessage=e.onStatisticMessage||an,this.onContactInvited=e.onContactInvited||an,this.onContactAgreed=e.onContactAgreed||an,this.onContactRefuse=e.onContactRefuse||an,this.onContactDeleted=e.onContactDeleted||an,this.onContactAdded=e.onContactAdded||an,this.onTokenWillExpire=e.onTokenWillExpire||an,this.onTokenExpired=e.onTokenExpired||an,this.onClosed=e.onClosed||an,this.onPresenceStatusChange=e.onPresenceStatusChange||an}var cn={biz:"",debug:!1,token:""},un="https://data-reporting.agora.io/report",ln="https://data-reporting.sh.agoralab.co/report",dn=function(e){var t=Number(h[e]);return t===h.USER_LOGIN?"MANUALLOGIN":t===h.MSYNC_SENDMESSAGE?"SENDMESSAGE":t>h.UNKNOWOPERATION&&t<h.REST_OPERATE?"REST":t>h.REST_OPERATE&&t<h.MSYNC_OPERATE?"MESSAGE":t>h.MSYNC_OPERATE&&t<h.ROSTER_OPERATE?"ROSTER":t>h.ROSTER_OPERATE&&t<h.USER_OPERATE?"USER":t>h.USER_OPERATE&&t<h.GROUP_OPERATE?"GROUP":t>h.GROUP_OPERATE&&t<h.CHATROOM_OPERATE?"CHATROOM":"OPERATION"},pn=function(){return(new Date).getTime()},hn=function(e){return[ce.BAIDU,ce.WX,ce.DD,ce.ZFB,ce.TT,ce.QUICK_APP,ce.UNI].includes(e.platform)},fn=function(){return e=1,t=99999,e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e))+e;var e,t},mn={},vn=1e3,gn=function(){function e(e){this.eventQueue=[],this.stock=vn,this.config=e,this.governor()}return e.prototype.add=function(e){this.stock<=0?console.warn("Event Report limit ".concat(vn," per minute")):(this.eventQueue.push(e),this.consume(),this.stock-=1)},e.prototype.consume=function(){var e=this;0!==this.eventQueue.length&&(this.timer&&this.eventQueue.length<=10&&clearTimeout(this.timer),this.timer=setTimeout((function(){var t,r=e.eventQueue.splice(0,10),n=r.filter((function(e){return e.appId===r[0].appId})),o=r.filter((function(e){return e.appId!==r[0].appId}));(t=e.eventQueue).unshift.apply(t,o),e.batchSend(n)}),1e3))},e.prototype.governor=function(){var e=this,t=setInterval((function(){e.stock=vn}),6e4);"undefined"!=typeof addEventListener&&addEventListener("beforeunload",(function(){clearInterval(t)}))},e.prototype.batchSend=function(e){var t,r;if(void 0===e&&(e=[]),0!==e.length)try{var n=e.map((function(e){e.biz,e.appId;var t=e.eventId,r=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["biz","appId","eventId"]);return{eventId:Number(t),body:r}}));!function(e,t){try{var r=t.biz,n=t.appId,o=t.data,i=t.debug,a=t.onSuccess;if(!r)throw new Error("biz is not defined");mn.global||(mn=ye.getEnvInfo());var s=mn;if(hn(s)){var c={url:i?ln:un,data:o,method:"POST",timeout:W,success:function(){null==a||a()},fail:function(){},complete:function(){}},u={token:e,appid:null!=n?n:"",sendts:"".concat(Math.floor((new Date).getTime()/1e3)),biz:r,debug:"".concat(i)};if("zfb"===s.platform||"dd"===s.platform?c.headers=u:c.header=u,"dd"===s.platform)return s.global.httpRequest(c);s.global.request(c)}else{var l=new XMLHttpRequest;l.onreadystatechange=function(){2===l.readyState&&(null==a||a())},l.open("POST",i?ln:un),l.setRequestHeader("Content-Type","application/json"),l.setRequestHeader("token",e),l.setRequestHeader("appid",null!=n?n:""),l.setRequestHeader("sendts","".concat(Math.floor((new Date).getTime()/1e3))),l.setRequestHeader("biz",r),l.setRequestHeader("debug","".concat(i)),l.send(JSON.stringify(o))}}catch(e){console.error(e)}}(this.config.token,{biz:null===(t=e[0])||void 0===t?void 0:t.biz,appId:null===(r=e[0])||void 0===r?void 0:r.appId,data:n,debug:this.config.debug,onSuccess:this.consume.bind(this)})}catch(e){console.error(e)}},e}(),yn=function(){return yn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},yn.apply(this,arguments)},En=new(function(){function e(e){this.inited=!1,this.appId="",this.biz="",this.eventQueue={},this.config=cn,e&&this.init(e)}return e.prototype.init=function(e){var t;if(void 0===e&&(e={}),!e.biz||!e.token)throw new Error("Event Report: biz or token is not defined");try{this.appId=null!==(t=e.appId)&&void 0!==t?t:"",this.biz=e.biz,this.config=yn(yn({},cn),e),this.eventQueue=new gn(this.config),this.log(e),this.inited=!0}catch(e){console.error(e)}},e.prototype.updateAppId=function(e){this.appId=e},e.prototype.send=function(e,t,r){var n;if(void 0===t&&(t={}),this.inited){var o=yn(yn({},t),{eventId:Number(e),biz:this.biz,appId:null!==(n=null==r?void 0:r.appId)&&void 0!==n?n:this.appId});this.eventQueue.add(o),this.log(o)}else console.error("Event Report: init is not called")},e.prototype.log=function(e){try{if(this.config.debug){var t=e.payload,r=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["payload"]);console.log("%c Event Report: ".concat(this.config.biz," "),"background: #8A97FC; color: #fff"),console.table(r),t&&(console.info("payload:"),console.table(t))}}catch(e){console.error(e)}},e}()),_n=function(){return _n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},_n.apply(this,arguments)},Tn={requestName:"",subrequestid:"1",requestMethod:"GET",requestUrl:"",requestElapse:0,code:0,codeDesc:"",isLastApi:0,isSuccess:1},In=function(){function e(e){this.platform=ye.getEnvInfo(),this.isReportDt=e.isReport||!1,this.isCollectDt=!0,hn(this.platform)&&!this.isReportDt&&(this.isCollectDt=!1),this.eventQueue=[],this.accessChannel="direct",this.options=function(e,t){t.platform||(t=ye.getEnvInfo());var r=e.org,n=e.appkey,o=e.deviceId,i=e.sdkVersion,a=e.uikitVersion,s="undefined"!=typeof navigator?null===navigator||void 0===navigator?void 0:navigator.userAgent:"".concat(t.platform,"_mini_program");return{org:r,appkey:n,deviceId:o,sdkServiceId:"sid_".concat(ye.getUniqueId(),"_").concat(fn()),did:s,sdkVersion:i,os:7,sdkProduct:y.web,uikitVersion:a}}(e,this.platform),this.sid=this.options.sdkServiceId,this.init(e)}return e.getInstance=function(t){return e.instance||(e.instance=new e(t)),e.instance},e.prototype.getServiceId=function(){return this.sid||"sid_0"},e.prototype.setIsReportDt=function(e){this.isReportDt=e,e&&this.rptEventQueue()},e.prototype.setIsCollectDt=function(e){this.isCollectDt=e,e||(this.eventQueue=[])},e.prototype.rptEventQueue=function(){var e=this;this.eventQueue.length&&this.eventQueue.forEach((function(t,r){En.send(t.eventId,t.dt),r>=e.eventQueue.length-1&&(e.eventQueue=[])}))},e.prototype.init=function(t){e.instance||(e.instance=this,En.init({biz:"im",token:"32f24ab2ddb74f508aa9286c356cec84",appId:t.appkey,debug:!1}),this.reportInit())},e.prototype.updateAppKey=function(e){this.options.appkey=e,this.eventQueue.forEach((function(t){"default#appkey"===t.dt.appkey&&(t.dt.appkey=e)}))},e.prototype.reportInit=function(){if(this.isCollectDt){var e=this.options,t=e.did,r=e.os,n=e.sdkVersion,o=e.deviceId;this.reportData(9674,{did:t,os:r,sdkVersion:n,deviceId:o})}},e.prototype.geOperateFun=function(e){var t=this;if(!this.isCollectDt)return function(){};var r=1,n=0,o="",i=pn(),a=e.uid,s=e.operationName;a&&(this.uid=a);var c={uid:this.uid,operationId:"opr_".concat(ye.getUniqueId(),"_").concat(fn()),requestid:"req_".concat(ye.getUniqueId(),"_").concat(fn()),operationName:s};return function(e){var a,u,l,d;if(e.data.isSuccess?(n=0,o=""):(0===e.data.code&&(e.data.code=b),n=null!==(a=e.data.code)&&void 0!==a?a:n,o=null!==(u=e.data.codeDesc)&&void 0!==u?u:o),(null===(l=e.data)||void 0===l?void 0:l.accessChannel)&&(t.accessChannel=null===(d=e.data)||void 0===d?void 0:d.accessChannel),e.isRetry?(r++,e.data.subrequestid="".concat(r)):(c.requestid="req_".concat(ye.getUniqueId(),"_").concat(fn()),r=1),e.data.isLastApi){var p=pn();e.data.requestElapse=p-i,e.data.requestMethod="",e.data.subrequestid="0",e.data.code=200===n?0:n,e.data.codeDesc=o}else e.data.requestName||(e.data.requestName=s);e.data.requestElapse||(e.data.requestElapse=pn()-i),t.reportData.call(t,S,_n(_n(_n(_n({},Tn),c),e.data),{accessChannel:t.accessChannel,operationType:dn(s)})),e.isEndApi&&t.reportData.call(t,S,_n(_n(_n({},c),Tn),{isSuccess:e.data.isSuccess,isLastApi:1,subrequestid:"0",requestMethod:"",code:200===n?0:n,codeDesc:o,requestElapse:e.data.requestElapse,accessChannel:t.accessChannel,operationType:dn(s)}))}},e.prototype.reportData=function(e,t){return r=this,n=void 0,i=function(){var r,n,o,i,a,s,c,u,l;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}(this,(function(d){switch(d.label){case 0:return d.trys.push([0,3,,4]),r=pn(),n=0,e!==S?[3,2]:[4,(p=this.platform,new Promise((function(e){var t;p.platform||(p=ye.getEnvInfo());var r="";if(p.platform===ce.WEB){var n=navigator.connection;(null==n?void 0:n.type)?(null==n||n.type,r=v.WIFI):(null==n?void 0:n.effectiveType)&&(r=v[n.effectiveType.toLocaleUpperCase()]),e(r)}else p.platform===ce.NODE?(r=v.UNKNOWN,e(r)):null===(t=p.global)||void 0===t||t.getNetworkType({success:function(t){r=v[t.networkType.toLocaleUpperCase()],e(r)}})})))];case 1:n=d.sent(),d.label=2;case 2:return o=this.options,i=o.appkey,a=o.sdkServiceId,s=o.sdkProduct,c=o.uikitVersion,u=_n({lts:r,net:n,appkey:i,sdkServiceId:a,sdkProduct:s,uikitVersion:c},t),this.isReportDt?En.send(e,u):this.isCollectDt&&this.eventQueue.push({eventId:e,dt:u}),[3,4];case 3:return l=d.sent(),console.warn(l),[3,4];case 4:return[2]}var p}))},new((o=void 0)||(o=Promise))((function(e,t){function a(e){try{c(i.next(e))}catch(e){t(e)}}function s(e){try{c(i.throw(e))}catch(e){t(e)}}function c(t){var r;t.done?e(t.value):(r=t.value,r instanceof o?r:new o((function(e){e(r)}))).then(a,s)}c((i=i.apply(r,n||[])).next())}));var r,n,o,i},e}();function On(e){return On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},On(e)}__webpack_require__(4490),__webpack_require__(6034),__webpack_require__(2762);var Rn=function(){return Rn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Rn.apply(this,arguments)},Sn=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},bn=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},Cn={txt:"text",img:"image",video:"video",file:"file",loc:"location",custom:"custom",combine:"combine"},Nn={text:"txt",image:"img",video:"video",file:"file",location:"loc",custom:"custom"},An=5,Mn=new Set(["txt","img","video","file","loc","custom","combine"]);function wn(e){return p.create({type:s.REQUEST_PARAMETER_ERROR,message:e})}function Un(e,t){B.error(e,t)}function Ln(e){var t,r,n,o=Re[e.conversationType],i=Nn[e.contentType]||e.contentType,a=function(e,t){return"groupchat"===t.conversationType||"chatroom"===t.conversationType?t.receiverId:t.senderId!==e?t.senderId:t.receiverId}(this.context.userId,e),s={id:"".concat(e.messageId),conversationId:a,chatType:o,from:e.senderId,to:e.receiverId,ext:e.ext||{},time:new Date(e.sentTime).getTime()},c=e.content||{},u="string"==typeof e.text?e.text:void 0;switch(i){case"txt":n=Rn(Rn({},s),{type:"txt",msg:c.message||e.text||""}),Array.isArray(e.translations)&&e.translations.length>0&&(n.translations={translations:e.translations.map((function(e){return{text:e.text,to:e.code}}))});break;case"img":var l=c.url||c.remotePath||"",d=c.secret||c.secretKey||"",p=this.useOwnUploadFun?l:rt.call(this,{remotePath:l,secretKey:d});n=Rn(Rn({},s),{type:"img",url:p||"",width:(null===(t=c.size)||void 0===t?void 0:t.width)||c.width||0,height:(null===(r=c.size)||void 0===r?void 0:r.height)||c.height||0,secret:d,thumb:this.useOwnUploadFun?c.thumb||"":c.thumb?ye.formatAttachUrl.call(this,c.thumb):p?"".concat(p,"&thumbnail=true"):"",thumb_secret:c.thumb_secret||c.thumbnailSecretKey||d||"",file_length:c.file_length||c.fileLength||0,filetype:c.filetype||"",file:{},isGif:"sub_gif"===c.subType||1===c.subType});break;case"video":l=c.url||c.remotePath||"",d=c.secret||c.secretKey||"",p=this.useOwnUploadFun?l:rt.call(this,{remotePath:l,secretKey:d}),n=Rn(Rn({},s),{type:"video",url:p||"",secret:d||"",thumb:c.thumb?ye.formatAttachUrl.call(this,c.thumb):ye.formatAttachUrl.call(this,c.thumbnailRemotePath||""),thumb_secret:c.thumb_secret||c.thumbnailSecretKey||"",filename:c.filename||c.displayName||"",length:c.length||c.duration||0,file:{},file_length:c.file_length||c.fileLength||0,filetype:c.filetype||""});break;case"file":l=c.url||c.remotePath||"",d=c.secret||c.secretKey||"",p=this.useOwnUploadFun?l:rt.call(this,{remotePath:l,secretKey:d}),n=Rn(Rn({},s),{type:"file",url:p||"",secret:d||"",file:{},filename:c.filename||c.displayName||"",length:c.length||c.duration||0,file_length:c.file_length||c.fileLength||0,filetype:c.filetype||""});break;case"loc":n=Rn(Rn({},s),{type:"loc",buildingName:c.buildingName||"",addr:c.addr||c.address||"",lat:c.lat||c.latitude||0,lng:c.lng||c.longitude||0});break;case"custom":n=Rn(Rn({},s),{type:"custom",customEvent:c.customEvent||"",customExts:c.customExts||{},params:c.params||{}});break;default:n=Rn(Rn({},s),{type:i})}if(void 0!==u&&(n.text=u),e.highlight&&"object"===On(e.highlight)){for(var h=[],f=0,m=Object.values(e.highlight);f<m.length;f++){var v=m[f];Array.isArray(v)&&h.push.apply(h,v)}h.length>0&&(n.highlight=h)}return n}var Pn={singleChat:"chat",chatRoom:"chatroom",groupChat:"groupchat"};function xn(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+n+"/"+o+"/users/"+this.user+"/blocks/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i},success:function(t){var r={};t.data.forEach((function(e){r[e]={name:e}})),"function"==typeof(null==e?void 0:e.success)&&e.success(t)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return B.debug("Call getBlocklist"),oe.call(this,a,f.GET_BLACK_LIST)}var kn=xn,Dn=Bn;function Bn(e){var t=this,r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={url:this.apiUrl+"/"+o+"/"+i+"/users/"+this.user+"/contacts/users",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+a},success:function(r){var n=[];r.data.forEach((function(e){n.push({name:e,subscription:"both",jid:t.context.jid})})),"function"==typeof(null==e?void 0:e.success)&&e.success(n)},error:function(t){"function"==typeof(null==e?void 0:e.error)&&e.error(t)}};return B.debug("Call getContacts"),oe.call(this,s,f.GET_CONTACTS)}function jn(e){return B.debug("Call uploadPushToken"),At.call(this,e)}var Gn=jn;function Hn(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(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 B.debug("Call getSessionList"),oe.call(this,a)}function Fn(e){var t=this,r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=!!(e&&"number"==typeof e.pageNum&&"number"==typeof e.pageSize&&e.pageNum>0&&e.pageSize>0),c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/user_channels").concat(s?"/page":""),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e&&(null==e?void 0:e.success),error:e&&(null==e?void 0:e.error)};return s&&(c.data={pageNum:e.pageNum,pageSize:e.pageSize}),B.debug("Call getConversationlist"),oe.call(this,c,f.GET_SESSION_LIST).then((function(e){return qn.call(t,e)}))}function qn(e){var t=this,r=e.data.channel_infos;return null==r||r.forEach((function(e){e.meta&&"{}"!==JSON.stringify(e.meta)?(e.meta.payload=JSON.parse(e.meta.payload),e.lastMessage=Se.call(t,e.meta,{formatCustomExts:!1})):e.lastMessage=e.meta,delete e.meta})),e}function Wn(e){if(e&&"string"!=typeof e.channel)throw Error("Invalid parameter channel: ".concat(e.channel));if(e&&"singleChat"!==e.chatType&&"groupChat"!==e.chatType)throw Error("Invalid parameter chatType: ".concat(e.chatType));if(e&&"boolean"!=typeof e.deleteRoam)throw Error("Invalid parameter deleteRoam: ".concat(e.deleteRoam));var t=bt.call(this).error;if(t)return Promise.reject(t);var r,n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid;r="singleChat"===e.chatType?"chat":"groupChat";var c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/user/").concat(this.user,"/user_channel?resource=").concat(s.clientResource),dataType:"json",type:"DELETE",data:JSON.stringify({channel:e.channel,type:r,delete_roam:e.deleteRoam}),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call deleteSession",e),oe.call(this,c,f.DELETE_SESSION)}var zn=Wn;function Kn(e,t){var r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=["nickname","avatarurl","mail","phone","gender","sign","birth","ext"],c={},u=ye.getEnvInfo();if("wx"===u.platform||"qq"===u.platform)if("string"==typeof e&&void 0!==t){if(!s.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");c[e]=t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");s.forEach((function(t){s.includes(t)&&void 0!==e[t]&&(c[t]=e[t])}))}else if("string"==typeof e){if(!s.includes(e))throw new Error("illegal key, only these keys: nickname, avatarurl, mail, phone, gender, sign, birth, ext are allowed");c=e+"="+t}else{if("[object Object]"!==Object.prototype.toString.call(e))throw new Error("illegal params");var l=[];s.forEach((function(t){if(s.includes(t)&&void 0!==e[t]){var r=encodeURIComponent(t),n=encodeURIComponent(e[t]);l.push(r+"="+n)}})),c=l.join("&")}var d={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/metadata/user/").concat(this.user),type:"PUT",data:c,dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/x-www-form-urlencoded"}};return B.debug("Call updateOwnUserInfo",e),oe.call(this,d,f.UPDATE_USER_INFO)}var Vn=Kn;function Jn(e,t){var r=bt.call(this).error;if(r)return Promise.reject(r);var n,o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=[];if("string"==typeof e)c=[e];else{if("[object Array]"!==Object.prototype.toString.call(e))throw new Error("illegal params");c=e}n="string"==typeof t?[t]:t&&"[object Array]"===Object.prototype.toString.call(t)?t:["nickname","avatarurl","mail","phone","gender","sign","birth","ext"];var u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/metadata/user/get"),type:"POST",data:JSON.stringify({targets:c,properties:n}),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}};return B.debug("Call fetchUserInfoById",e),oe.call(this,u,f.GET_USER_INFO)}function Yn(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(this.user),type:"PUT",dataType:"json",data:JSON.stringify({nickname:e}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return B.debug("Call updateCurrentUserNick",e),oe.call(this,a)}function Xn(e){if("string"!=typeof e||""===e)throw Error('Invalid parameter: "token"');var t=this.context,r=t.orgName,n=t.appName,o={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/sdk/users/").concat(this.user,"/token/expires"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+e,"Content-Type":"application/json"}};return B.debug("Call getTokenExpireTimestamp",e),oe.call(this,o,f.SDK_INTERNAL)}function Qn(e){var t=this;return new Promise((function(r,n){if(!e.queue)throw Error('Invalid parameter: "specified"');var o=bt.call(t).error;if(o)return Promise.reject(o);(function e(t){var o=this,i=t.count||20;$n.call(this,{count:i,isGroup:!!t.isGroup,queue:t.queue,start:t.start,format:t.format,success:function(n){if(n.msgs.length>=i||n.is_last){var a=n.msgs.splice(0,i).reverse();t.success&&t.success(a),r(a)}else e.call(o,Rn(Rn({},t),{start:null}))},fail:function(e){n(e),t.fail&&t.fail(e)}})}).call(t,e),B.debug("Call fetchHistoryMessages",e)}))}function $n(e){var t=this,r=e.queue,n=this.mr_cache[r]||(this.mr_cache[r]={msgs:[]}),o=this.context.userId,i=e.start||-1,a=e.count||20;if(n.msgs.length>=a||n.is_last)"function"==typeof e.success&&e.success(n);else{n&&n.next_key&&(i=n.next_key),e.start&&(i=e.start);var c={queue:r+(e.isGroup?"@conference.easemob.com":"@easemob.com"),start:i,end:-1},u=this.context,l=u.orgName,d=u.appName,h={url:"".concat(this.apiUrl,"/").concat(l,"/").concat(d,"/users/").concat(o,"/messageroaming"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"},data:JSON.stringify(c),success:function(r){return Sn(t,void 0,void 0,(function(){var t,o,i,a,s,c,u=this;return bn(this,(function(l){switch(l.label){case 0:if(t=null==r?void 0:r.data,!r.data.msgs)return"function"==typeof e.success&&e.success(n),n.is_last=!0,n.next_key="",[2];o=t.msgs,i=o.length,n.is_last=t.is_last,n.next_key=t.next_key,a=function(t){return Sn(u,void 0,void 0,(function(){var r,n,o,i,a;return bn(this,(function(s){switch(s.label){case 0:for(r=[],t=Ie().atob(t),n=0,o=t.length;n<o;++n)r.push(t.charCodeAt(n));return i=(i=this.context.root.lookup("easemob.pb.Meta")).decode(r),a={errorCode:0,reason:""},1!==i.ns?[3,2]:[4,ct.call(this,i,a,!0,e.format)];case 1:return[2,s.sent()];case 2:return[2]}}))}))},s=0,l.label=1;case 1:return s<i?[4,a(o[s].msg)]:[3,4];case 2:(c=l.sent())&&n.msgs.push(c),l.label=3;case 3:return s++,[3,1];case 4:return"function"==typeof e.success&&e.success(n),[2]}}))}))},error:function(e){if(e.error&&e.error_description){var r=p.create({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:"fetch history messages error",data:e});t.onError&&t.onError(r)}}};oe.call(this,h,f.GET_HISTORY_MSG).catch((function(t){"function"==typeof e.fail&&e.fail(t)}))}}function Zn(e){var t=this;return new Promise((function(r,n){var o=e.targetId,i=e.cursor,a=void 0===i?-1:i,s=e.pageSize,c=void 0===s?20:s,u=e.chatType,l=e.searchDirection,d=e.searchOptions,p=void 0===d?{}:d,h=p.msgTypes,m=void 0===h?[]:h,v=p.startTime,g=void 0===v?null:v,y=p.endTime,E=void 0===y?null:y,_=p.from,T=void 0===_?null:_;if("string"!=typeof o||""===o)return n(wn('"Invalid parameter": "targetId"'));if(T&&"string"!=typeof T)return n(wn('"Invalid parameter": "searchOptions.from"'));if(m&&!Array.isArray(m))return n(wn('"Invalid parameter": "searchOptions.msgTypes"'));if(g&&"number"!=typeof g)return n(wn('"Invalid parameter": "searchOptions.startTime"'));if(E&&"number"!=typeof E)return n(wn('"Invalid parameter": "searchOptions.endTime"'));var I=bt.call(t).error;if(I)return n(I);var O=t.context,R=O.orgName,S=O.appName,b=O.userId,C="singleChat"===e.chatType?"@easemob.com":"@conference.easemob.com",N={queue:"".concat(o).concat(C),start:a,pull_number:c,is_positive:"down"===l,msgType:m.join(",")||"",end:-1,startTime:g,endTime:E,userId:"singleChat"===u?null:T},A={url:"".concat(t.apiUrl,"/").concat(R,"/").concat(S,"/users/").concat(b,"/messageroaming"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+t.token,"Content-Type":"application/json"},data:JSON.stringify(N),success:function(n){return Sn(t,void 0,void 0,(function(){var t,o,i,a,s,c,u,l,d=this;return bn(this,(function(p){switch(p.label){case 0:t=null==n?void 0:n.data,o=t.msgs||[],i=function(e){return Sn(d,void 0,void 0,(function(){var t,r,n,o,i;return bn(this,(function(a){switch(a.label){case 0:for(t=[],e=Ie().atob(e),r=0,n=e.length;r<n;++r)t.push(e.charCodeAt(r));return o=(o=this.context.root.lookup("easemob.pb.Meta")).decode(t),i={errorCode:0,reason:""},1!==o.ns?[3,2]:[4,ct.call(this,o,i,!0,!0)];case 1:return[2,a.sent()];case 2:return[2]}}))}))},a=[],s=0,p.label=1;case 1:return s<o.length?[4,i(o[s].msg)]:[3,4];case 2:(c=p.sent())&&a.push(c),p.label=3;case 3:return s++,[3,1];case 4:return t.msgs=a,u={cursor:t.next_key,messages:a,isLast:t.is_last},null===(l=e.success)||void 0===l||l.call(e,u),r(u),[2]}}))}))},error:e.fail};oe.call(t,A,f.REST_FETCHHISTORYMESSAGE).catch((function(e){n(e)})),B.debug("Call getHistoryMessages",e)}))}function eo(e){var t,r,n=this,o=bt.call(this).error;if(o)return Promise.reject(o);var i=null==e?void 0:e.option,a=null!==(t=null==e?void 0:e.pageNum)&&void 0!==t?t:1,c=null!==(r=null==e?void 0:e.pageSize)&&void 0!==r?r:20,u=[];try{u=function(e,t,r){var n;if(!e||"object"!==On(e))throw wn('"Invalid parameter": "option"');if(!Array.isArray(e.keywordList))throw wn('"Invalid parameter": "keywordList"');var o=e.keywordList.map((function(e){return"".concat(null!=e?e:"").trim()})).filter((function(e){return e.length>0}));if(0===o.length)throw wn('"Invalid parameter": "keywordList"');if(o.length>An)throw wn('"Invalid parameter": "keywordList exceeds max count 5"');if(void 0!==e.conversationId&&("string"!=typeof e.conversationId||""===e.conversationId.trim()))throw wn('"Invalid parameter": "conversationId"');if(void 0!==e.conversationType&&!["singleChat","groupChat","chatRoom"].includes(e.conversationType))throw wn('"Invalid parameter": "conversationType"');if(void 0===e.conversationId!=(void 0===e.conversationType))throw wn('"Invalid parameter": "conversationId and conversationType must be used together"');if(void 0!==e.startTime&&void 0===e.endTime||void 0===e.startTime&&void 0!==e.endTime)throw wn('"Invalid parameter": "startTime/endTime"');if(void 0!==e.startTime&&("number"!=typeof e.startTime||"number"!=typeof e.endTime||e.endTime<e.startTime))throw wn('"Invalid parameter": "startTime/endTime"');if("number"!=typeof t||t<1)throw wn('"Invalid parameter": "pageNum"');if("number"!=typeof r||r<1||r>100)throw wn('"Invalid parameter": "pageSize"');if(e.msgTypes&&!Array.isArray(e.msgTypes))throw wn('"Invalid parameter": "msgTypes"');if(null===(n=e.msgTypes)||void 0===n?void 0:n.some((function(e){return!Mn.has(e)})))throw wn('"Invalid parameter": "msgTypes contains unsupported type"');return o}(i,a,c)}catch(t){return B.error("searchMessages parameter validation failed",{params:e,error:t}),Promise.reject(t)}var l=this.context,d=l.orgName,h=l.appName,m=l.accessToken,v=function(e,t,r,n,o){var i=function(e,t){var r,n=null!==(r=e.keywordListMatchType)&&void 0!==r?r:"or",o={searchMode:"default"};return 1===t.length?o.keyword=t[0]:(o.keywords=t,o.keywordMatch="and"===n?"all":"any"),{data:o,normalizedKeywordList:t}}(e,t).data;return e.conversationId&&("singleChat"===e.conversationType?i.participantPairs=[{userId1:o,userId2:e.conversationId}]:"groupChat"===e.conversationType?i.groupIds=[e.conversationId]:"chatRoom"===e.conversationType?i.chatroomIds=[e.conversationId]:i.conversationId=e.conversationId),e.msgTypes&&e.msgTypes.length>0&&(i.contentType=e.msgTypes.filter((function(e){return e in Cn})).map((function(e){return Cn[e]})).join(",")),"number"==typeof e.startTime&&"number"==typeof e.endTime&&(i.startTime=e.startTime,i.endTime=e.endTime),e.searchScope&&(i.searchExt=e.searchScope),i.sort="relevance:desc",i.highlightEnable=!0,i.page=r,i.size=n,i}(i,u,a,c,this.user),g={url:"".concat(this.apiUrl,"/").concat(d,"/").concat(h,"/users/").concat(this.user,"/messages/search/get"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+m,"Content-Type":"application/json",Accept:"application/json; charset=utf-8"},data:JSON.stringify({data:v})};return B.debug("Call searchMessages",e),oe.call(this,g,f.REST_SEARCH_MESSAGES).then((function(t){var r,o,i=(null==t?void 0:t.data)||{},u=(null==i?void 0:i.data)&&"object"===On(i.data)?i.data:i,l=u.pagination||{},d=Array.isArray(u.items)?u.items:Array.isArray(u.list)?u.list:[];Array.isArray(u.items)||Array.isArray(u.list)||Un("searchMessages response items/list is invalid",{params:e,responseData:u,rawResponse:t});var h=[];d.forEach((function(t,r){try{h.push(Ln.call(n,t))}catch(n){throw Un("searchMessages failed to map response item",{params:e,index:r,item:t,error:n}),p.create({type:s.WEBIM_CONNCTION_AJAX_ERROR,message:"Failed to parse search result item",data:{index:r,item:t,error:n}})}}));var f={messages:h,pageNum:l.page||u.page||a,pageSize:c,totalPages:"number"==typeof l.totalPages?l.totalPages:-1,isLast:"number"!=typeof l.isFinished||1===l.isFinished,requestId:null===(r=null==i?void 0:i.meta)||void 0===r?void 0:r.requestId,timestamp:(null===(o=null==i?void 0:i.meta)||void 0===o?void 0:o.timestamp)||Date.now()};return"number"!=typeof l.page&&void 0!==l.page&&Un("searchMessages pagination.page is invalid",{params:e,pagination:l,rawResponse:t}),f}))}function to(e,t){return Sn(this,void 0,void 0,(function(){var r,n,o,i,a,s,c;return bn(this,(function(u){switch(u.label){case 0:if(r=bt.call(this).error)return[2,Promise.reject(r)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return B.debug("Call addContact",e,t),n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"/contacts/apply?resource=").concat(s.clientResource),type:"POST",dataType:"json",data:JSON.stringify({usernames:[e],reason:t}),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}},[4,oe.call(this,c,f.ROSTER_ADD)];case 1:return u.sent(),[2]}}))}))}var ro=no;function no(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return bn(this,(function(c){switch(c.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return B.debug("Call deleteContact",e),r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(this.user,"/contacts/users/").concat(e,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,s,f.ROSTER_REMOVE)];case 1:return c.sent(),[2]}}))}))}function oo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return bn(this,(function(c){switch(c.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return B.debug("Call acceptInvitation",e),r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(this.user,"/contacts/accept/users/").concat(e,"?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,s,f.ROSTER_ACCEPT)];case 1:return c.sent(),[2]}}))}))}var io=oo;function ao(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return bn(this,(function(c){switch(c.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if("string"!=typeof e||""===e)throw Error('"Invalid parameter": "to"');return B.debug("Call declineInvitation",e),r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(this.user,"/contacts/decline/users/").concat(e,"?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,s,f.ROSTER_DECLINE)];case 1:return c.sent(),[2]}}))}))}var so=ao;function co(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u;return bn(this,(function(l){switch(l.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if(r=e.name,n=[],"string"==typeof r){if(""===r)throw Error('"Invalid parameter": "name"');n=[r]}else{if(!Array.isArray(r))throw Error('"Invalid parameter": "name"');n=r}return B.debug("Call addToBlockList",e),o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/sdk/user/").concat(this.user,"/blocks?resource=").concat(c.clientResource),type:"POST",dataType:"json",data:JSON.stringify({usernames:n}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,oe.call(this,u,f.ROSTER_BAN).then((function(e){return{type:e.type,data:{userIds:(null==e?void 0:e.data)||[]}}}))];case 1:return[2,l.sent()]}}))}))}var uo=co,lo=co;function po(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u;return bn(this,(function(l){switch(l.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if(r=e.name,n=[],"string"==typeof r){if(""===r)throw Error('"Invalid parameter": "name"');n=[r]}else{if(!Array.isArray(r))throw Error('"Invalid parameter": "name"');n=r}return B.debug("Call removeFromBlockList",e),o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/sdk/user/").concat(this.user,"/blocks?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",data:JSON.stringify({usernames:n}),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,oe.call(this,u,f.ROSTER_ALLOW)];case 1:return l.sent(),[2]}}))}))}var ho=po,fo=po;function mo(e){var t=this,r=(null==e?void 0:e.ext)||"";if("string"!=typeof r)throw Error('"Invalid parameter": "ext"',r);var n=this.getUniqueId(),o={id:n,to:e.to};this._msgHash[n]=Rn({},o);var i="";void 0!==e.chatType?i=e.chatType:void 0!==e.type&&(i="chat"===e.type?"singleChat":e.type);var a={id:n,type:"recall",chatType:i,ackId:e.mid,to:e.to,isChatThread:e.isChatThread||!1,metaExt:r,success:function(r){return Sn(t,void 0,void 0,(function(){var t,n,o,a,s,c,u,l,d;return bn(this,(function(p){switch(p.label){case 0:return p.trys.push([0,5,,6]),"singleChat"!==i&&"groupChat"!==i?[3,4]:[4,null===(o=null===(n=this._localCache)||void 0===n?void 0:n.getInstance())||void 0===o?void 0:o.removeMsgByServerMsgId(e.mid)];case 1:return p.sent(),[4,null===(s=null===(a=this._localCache)||void 0===a?void 0:a.getInstance())||void 0===s?void 0:s.getConversationLastMessage(e.to,i)];case 2:return t=p.sent(),[4,null===(u=null===(c=this._localCache)||void 0===c?void 0:c.getInstance())||void 0===u?void 0:u.updateLocalConversation(be({conversationId:e.to,conversationType:i}),{lastMessageId:null==t?void 0:t.serverMsgId})];case 3:p.sent(),p.label=4;case 4:return null===(l=null==e?void 0:e.success)||void 0===l||l.call(e,r),[3,6];case 5:return p.sent(),null===(d=null==e?void 0:e.success)||void 0===d||d.call(e,r),[3,6];case 6:return[2]}}))}))},fail:e.fail};return B.debug("Call recallMessage",e),this.mSync.send(a,this)}function vo(e){var t=e||{},r=t.messageId,n=t.modifiedMessage;if(B.debug("Call modifyMessage",r,n),""===r)throw Error('Invalid parameter: "messageId"');return this.mSync.send(Rn({editMessageId:r},n))}function go(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u;return bn(this,(function(l){switch(l.label){case 0:if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: ".concat(e.reaction));return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.reaction,s=e.messageId,c={msgId:s,message:a},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/reaction/user/").concat(this.user),type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,u)]);case 1:return l.sent(),[2]}}))}))}function yo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c;return bn(this,(function(u){switch(u.label){case 0:if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reactionId: ".concat(e.reaction));return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.messageId,s=e.reaction,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/reaction/user/").concat(this.user,"?msgId=").concat(a,"&message=").concat(s),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,c)]);case 1:return u.sent(),[2]}}))}))}function Eo(e){if("string"!=typeof e.chatType||!e.chatType)throw Error("Invalid parameter chatType: ".concat(e.chatType));if(!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatType,s=e.messageId,c={msgIdList:"string"==typeof s?[s]:s,msgType:"singleChat"===a?"chat":"groupchat",groupId:e.groupId||null},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/reaction/user/").concat(this.user),type:"GET",data:c,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,u).then((function(e){var t=e.data;return null==t||t.forEach((function(e){null==e||e.reactionList.forEach((function(e){e.isAddedBySelf=e.state,delete e.state,delete e.reactionId}))})),e}))}var _o=Eo;function To(e){if("string"!=typeof e.reaction||!e.reaction)throw Error("Invalid parameter reaction: ".concat(e.reaction));if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.cursor,s=e.pageSize,c={msgId:e.messageId,message:e.reaction,currentPage:a||null,pageSize:s||20},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/reaction/user/").concat(this.user,"/detail"),type:"GET",data:c,dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,u).then((function(e){return e.data.isAddedBySelf=e.data.state,delete e.data.state,delete e.data.reactionId,e}))}function Io(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d;return bn(this,(function(p){switch(p.label){case 0:if("string"!=typeof e.reportType||!e.reportType)throw Error("Invalid parameter reportType: ".concat(e.reportType));if("string"!=typeof e.messageId||!e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.reportReason||!e.reportReason)throw Error("Invalid parameter messageId: ".concat(e.reportReason));return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.reportType,s=e.reportReason,c=e.messageId,u={username:this.user,reportType:a,reportReason:s},l="".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/user/").concat(this.user,"/moderation/report/message/").concat(c),d={url:l,type:"POST",data:JSON.stringify(u),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,d)]);case 1:return p.sent(),[2]}}))}))}function Oo(e){var t;return Sn(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u,l;return bn(this,(function(d){switch(d.label){case 0:if("string"!=typeof e.targetId||""===e.targetId)throw Error('"Invalid parameter targetId": '+e.targetId);if(!["singleChat","groupChat","chatRoom"].includes(e.chatType))throw Error('"Invalid parameter chatType": '+e.chatType);if(e.beforeTimeStamp&&("number"!=typeof e.beforeTimeStamp||e.beforeTimeStamp<0||(null===(t=e.beforeTimeStamp)||void 0===t?void 0:t.toString().length)>18))throw Error('"Invalid parameter beforeTimeStamp": '+e.beforeTimeStamp);if(e.messageIds&&!(Array.isArray(e.messageIds)&&e.messageIds.length>0&&e.messageIds.length<=20))throw Error('"Invalid parameter messageIds": '+e.messageIds);if(!e.messageIds&&!e.beforeTimeStamp)throw Error("messageIds or beforeTimeStamp field is required.");return(r=bt.call(this).error)?[2,Promise.reject(r)]:(n=this.context,o=n.orgName,i=n.appName,a=n.userId,s="singleChat"===e.chatType?"userId":"groupId",c="singleChat"===e.chatType?"chat":"group",u=e.messageIds?"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/sdk/message/roaming/").concat(c,"/user/").concat(a,"?").concat(s,"=").concat(e.targetId,"&msgIdList=").concat(e.messageIds,"&resource=").concat(this.clientResource):"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/sdk/message/roaming/").concat(c,"/user/").concat(a,"/time?").concat(s,"=").concat(e.targetId,"&delTime=").concat(e.beforeTimeStamp,"&&resource=").concat(this.clientResource),l={url:u,dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+this.token,"Content-Type":"application/json"}},B.debug("Call removeHistoryMessages",e),[4,oe.call(this,l)]);case 1:return d.sent(),[2]}}))}))}function Ro(e){var t=this,r=bt.call(this).error;if(r)return Promise.reject(r);if((null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));if((null==e?void 0:e.includeEmptyConversations)&&"boolean"!=typeof e.includeEmptyConversations)throw Error("Invalid parameter includeEmptyConversations: ".concat(e.includeEmptyConversations));var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/sdk/user/").concat(this.user,"/user_channels/list?"),type:"GET",dataType:"json",data:{limit:(null==e?void 0:e.pageSize)||20,cursor:(null==e?void 0:e.cursor)||"",need_mark:!0,needEmptySession:(null==e?void 0:e.includeEmptyConversations)||!1},headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return B.debug("Call getServerConversations",e),new Promise((function(e,r){oe.call(t,s,f.REST_FETCH_CONVERSATIONS).then((function(r){return Sn(t,void 0,void 0,(function(){var t,n,o=this;return bn(this,(function(i){switch(i.label){case 0:return t=So.call(this,r),this._localCache?(n=t.data.conversations.map((function(e){return Sn(o,void 0,void 0,(function(){var t,r,n,o;return bn(this,(function(i){switch(i.label){case 0:return[4,null===(r=null===(t=this._localCache)||void 0===t?void 0:t.getInstance())||void 0===r?void 0:r.storeMessage(e.lastMessage,Pe.SUCCESS,!0)];case 1:return i.sent(),[4,null===(o=null===(n=this._localCache)||void 0===n?void 0:n.getInstance())||void 0===o?void 0:o.updateLocalConversation(be({conversationId:e.conversationId,conversationType:e.conversationType}),{unReadCount:e.unReadCount})];case 2:return i.sent(),[2]}}))}))})),[4,Promise.all(n)]):[3,2];case 1:i.sent(),i.label=2;case 2:return e(t),[2]}}))}))})).catch((function(e){r(e)}))}))}function So(e){var t=this,r=e.data,n=r.cursor,o=r.channel_infos,i=[];null==o||o.forEach((function(e){var r=null;(null==e?void 0:e.meta)&&"{}"!==JSON.stringify(e.meta)&&(e.meta.payload=JSON.parse(e.meta.payload),"delivery"!==(r=Se.call(t,e.meta)).type&&"read"!==r.type&&"channel"!==r.type&&(r.chatType=Re[r.chatType]));var n={conversationId:e.session_to,conversationType:"chat"===e.session_type?"singleChat":"groupChat",isPinned:e.is_top,pinnedTime:e.is_top?e.update_top_status_time:0,unReadCount:e.unread_num,lastMessage:r};e.marks&&(n.marks=e.marks.map((function(e){return ht[e]}))),i.push(n)}));var a={conversations:i,cursor:n||""};return{type:e.type,data:a}}function bo(e){var t=this,r=bt.call(this).error;if(r)return Promise.reject(r);if((null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));if((null==e?void 0:e.includeEmptyConversations)&&"boolean"!=typeof e.includeEmptyConversations)throw Error("Invalid parameter includeEmptyConversations: ".concat(e.includeEmptyConversations));var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/sdk/user/").concat(this.user,"/user_channels/list?"),type:"GET",dataType:"json",data:{limit:(null==e?void 0:e.pageSize)||20,cursor:(null==e?void 0:e.cursor)||"",is_top:!0,need_mark:!0,needEmptySession:(null==e?void 0:e.includeEmptyConversations)||!1},headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return B.debug("Call getServerPinnedConversations",e),oe.call(this,s,f.GET_SESSION_LIST).then((function(e){return So.call(t,e)}))}function Co(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d,p,h,m;return bn(this,(function(v){if(t=bt.call(this).error)return[2,Promise.reject(t)];if(r=e.conversationId,n=e.conversationType,o=e.isPinned,i="singleChat"===n?"chat":"groupChat","string"!=typeof r||""===r)throw Error("Invalid parameter conversationId: ".concat(r));if(!["singleChat","groupChat"].includes(n))throw Error("Invalid parameter conversationType: ".concat(n));if("boolean"!=typeof o)throw Error("Invalid parameter isPinned: ".concat(o));return a=this.context,s=a.orgName,c=a.appName,u=a.accessToken,l=a.jid,d={type:i,to:r},p=o?"":"type=".concat(i,"&to=").concat(r,"&"),h="".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/sdk/user/").concat(this.user,"/user_channel/top?").concat(p,"resource=").concat(l.clientResource),m={url:h,type:o?"POST":"DELETE",dataType:"json",headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}},o&&(m.data=JSON.stringify(d)),B.debug("Call pinConversation",e),[2,oe.call(this,m,f.PIN_CONVERSATION).then((function(e){var t=e.type,r=e.data;return{type:t,data:{isPinned:r.is_top||!1,pinnedTime:r.is_top?r.update_top_status_time:0}}}))]}))}))}function No(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l;return bn(this,(function(d){switch(d.label){case 0:if(t=e.userId,r=e.remark,n=bt.call(this).error)return[2,Promise.reject(n)];if("string"!=typeof t||""===t)throw Error('Invalid parameter: "userId"');if("string"!=typeof r)throw Error('Invalid parameter: "remark"');return B.debug("Call setContactRemark",e),o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u="".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/users/").concat(this.context.userId,"/contacts/users/").concat(t,"?resource=").concat(c.clientResource),l={url:u,type:"PUT",data:JSON.stringify({remark:r}),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"}},[4,oe.call(this,l,f.ROSTER_SET_CONTACT_REMARK)];case 1:return d.sent(),[2]}}))}))}function Ao(){var e=bt.call(this).error;if(e)return Promise.reject(e);var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/users/").concat(this.user,"/contacts/users?needReturnRemark=true"),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+o}};return B.debug("Call getAllContacts"),oe.call(this,i,f.ROSTER_GET_ALL_CONTACTS_REMARKS).then((function(e){var t=((null==e?void 0:e.entities)||[]).map((function(e){return{userId:e.username,remark:e.remark}}));return{type:e.type,data:t}}))}function Mo(e){var t=bt.call(this).error;if(t)return Promise.reject(t);B.debug("Call getContactsWithCursor",e);var r=e||{},n=r.pageSize,o=void 0===n?20:n,i=r.cursor,a=void 0===i?"":i;if(o&&"number"!=typeof o)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));var s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(this.user,"/contacts?needReturnRemark=true&limit=").concat(o,"&cursor=").concat(a),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+l}};return oe.call(this,d,f.ROSTER_GET_ALL_CONTACTS_REMARKS_FROM_SERVER_BY_PAGE).then((function(e){var t,r,n=(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.contacts)||[],o=(null===(r=null==e?void 0:e.data)||void 0===r?void 0:r.cursor)||"",i=n.map((function(e){return{userId:e.username,remark:e.remark}}));return{type:e.type,data:{cursor:o,contacts:i}}}))}function wo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d,p,h,m,v;return bn(this,(function(g){switch(g.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if(B.debug("Call markConversation",e),n=(r=e||{}).conversations,o=void 0===n?[]:n,i=r.mark,a=r.isMarked,!Array.isArray(o))throw Error("Invalid parameter conversations");if(s=o.map((function(e){if(!e.conversationId||!["singleChat","groupChat"].includes(e.conversationType))throw Error("Invalid parameter conversations");return{to:e.conversationId,type:Pn[e.conversationType]}})),"boolean"!=typeof a)throw Error("Invalid parameter isMarked: ".concat(a));if("number"!=typeof i)throw Error("Invalid parameter mark: ".concat(i));return c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.userId,h=c.jid,m={mark:ht[i],targets:s},v={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/sdk/user/").concat(p,"/user_channels/mark?resource=").concat(h.clientResource),dataType:"json",data:JSON.stringify(m),type:a?"Post":"Delete",headers:{Authorization:"Bearer "+d}},[4,oe.call(this,v,f.MARK_CONVERSATION).then((function(e){var t,r=(null===(t=e.data)||void 0===t?void 0:t.ignore)||[];r&&Array.isArray(r)&&r.length>0&&B.debug("markConversation has ignored conversations",r.map((function(e){return{conversationId:e.to,conversationType:Re[e.type]}})))}))];case 1:return g.sent(),[2]}}))}))}function Uo(e){return Sn(this,void 0,void 0,(function(){var t,r;return bn(this,(function(n){return B.debug("Call addConversationMark",e),t=e.conversations,r=e.mark,[2,wo.call(this,{conversations:t,mark:r,isMarked:!0})]}))}))}function Lo(e){return Sn(this,void 0,void 0,(function(){var t,r;return bn(this,(function(n){return B.debug("Call removeConversationMark",e),t=e.conversations,r=e.mark,[2,wo.call(this,{conversations:t,mark:r,isMarked:!1})]}))}))}function Po(e){var t,r,n=this,o=bt.call(this).error;if(o)return Promise.reject(o);if(B.debug("Call getServerConversationsByFilter",e),(null==e?void 0:e.pageSize)&&"number"!=typeof e.pageSize)throw Error("Invalid parameter pageSize: ".concat(e.pageSize));if((null==e?void 0:e.cursor)&&"string"!=typeof e.cursor)throw Error("Invalid parameter cursor: ".concat(e.cursor));if("number"!=typeof(null===(t=null==e?void 0:e.filter)||void 0===t?void 0:t.mark))throw Error("Invalid parameter mark: ".concat(null===(r=null==e?void 0:e.filter)||void 0===r?void 0:r.mark));var i=this.context,a=i.orgName,s=i.appName,c=i.accessToken,u="".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/sdk/user/").concat(this.user,"/user_channels/mark/search?"),l=e.pageSize,d=e.cursor,p=((null==e?void 0:e.filter)||{}).mark,h={url:u,type:"GET",dataType:"json",data:{limit:l||10,cursor:d||"",need_mark:!0,mark:ht[p]},headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}};return oe.call(this,h,f.GET_SESSION_LIST).then((function(e){return So.call(n,e)}))}function xo(){var e=bt.call(this).error;if(e)return Promise.reject(e);B.debug("Call getSelfIdsOnOtherPlatform");var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i=t.userId,a=t.jid,s={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/users/").concat(i,"/resources"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"}};return oe.call(this,s,f.USER_LOGGEDIN_OTHER_PLATFORM).then((function(e){var t,r=null===(t=e.data)||void 0===t?void 0:t.filter((function(e){return e.res!==a.clientResource})),n=null==r?void 0:r.map((function(e){return"".concat(i,"/").concat(e.res)}));return{type:e.type,data:n}}))}function ko(){var e,t,r,n,o,i;return Sn(this,void 0,void 0,(function(){var a,s,c,u,l,d,p,h,m;return bn(this,(function(v){switch(v.label){case 0:return(a=bt.call(this).error)?[2,Promise.reject(a)]:(B.debug("Call deleteAllMessagesAndConversations"),s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d=s.userId,p=s.jid,h="".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/sdk/message/roaming/user/").concat(d,"/delete/all?resource=").concat(p.clientResource),m={url:h,type:"POST",dataType:"json",headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"}},[4,oe.call(this,m,f.REST_DELETE_MESSAGES_CONVERSATIONS)]);case 1:return v.sent(),null===(t=null===(e=this._localCache)||void 0===e?void 0:e.getInstance())||void 0===t||t.clearConversationMap(),[4,null===(n=null===(r=this._localCache)||void 0===r?void 0:r.getInstance())||void 0===n?void 0:n.clearStoreData("conversationList")];case 2:return v.sent(),[4,null===(i=null===(o=this._localCache)||void 0===o?void 0:o.getInstance())||void 0===i?void 0:i.clearStoreData("message")];case 3:return v.sent(),[2]}}))}))}function Do(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d,p,h,m,v;return bn(this,(function(g){switch(g.label){case 0:if(t=bt.call(this).error)return[2,Promise.reject(t)];if(B.debug("Call setMessagePinStatus",e),n=(r=e||{}).conversationId,o=void 0===n?"":n,i=r.conversationType,a=r.messageId,s=r.isPinned,"string"!=typeof o||""===o)throw Error("Invalid parameter conversationId");if("string"!=typeof a||""===a)throw Error("Invalid parameter messageId");if("boolean"!=typeof s)throw Error("Invalid parameter isPinned");return c=this.context,u=c.orgName,l=c.appName,d=c.accessToken,p=c.userId,h=c.jid,m={to:o,type:Pn[i],pin_msg_id:a},v={url:"".concat(this.apiUrl,"/").concat(u,"/").concat(l,"/sdk/user/").concat(p,"/user_channel/pin?resource=").concat(h.clientResource),dataType:"json",data:JSON.stringify(m),type:s?"Post":"Delete",headers:{Authorization:"Bearer "+d}},[4,oe.call(this,v,f.REST_PIN_MESSAGE)];case 1:return g.sent(),[2]}}))}))}function Bo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o;return bn(this,(function(i){return B.debug("Call pinMessage",e),r=(t=e||{}).conversationType,n=t.conversationId,o=t.messageId,[2,Do.call(this,{conversationId:n,conversationType:r,messageId:o,isPinned:!0})]}))}))}function jo(e){return Sn(this,void 0,void 0,(function(){var t,r,n,o;return bn(this,(function(i){return B.debug("Call unpinMessage",e),r=(t=e||{}).conversationType,n=t.conversationId,o=t.messageId,[2,Do.call(this,{conversationId:n,conversationType:r,messageId:o,isPinned:!1})]}))}))}function Go(e){var t=this,r=bt.call(this).error;if(r)return Promise.reject(r);B.debug("Call getServerPinnedMessages",e);var n=e.conversationId,o=e.conversationType,i=e.pageSize,a=e.cursor;if("string"!=typeof n||""===n)throw Error("Invalid parameter conversationId");if(i&&"number"!=typeof i)throw Error("Invalid parameter pageSize: ".concat(i));if(a&&"string"!=typeof a)throw Error("Invalid parameter cursor: ".concat(a));var s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/sdk/user/").concat(this.user,"/user_channel/pin"),type:"GET",dataType:"json",data:{to:n,type:Pn[o],limit:i||10,cursor:a||""},headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"}};return oe.call(this,d,f.GET_SESSION_LIST).then((function(e){return{type:0,data:{list:e.data.msg_infos.map((function(e){e.message.payload=JSON.parse(e.message.payload);var r=e.message,n=e.pin_opt_at,o=e.pin_operator;return{message:Se.call(t,r,{formatChatType:!0}),pinTime:n,operatorId:o}})),cursor:e.data.cursor||""}}}))}function Ho(){var e=this;B.debug("Call unbindPushToken");var t={deviceId:this.clientResource,deviceToken:"",notifierName:this.pushCertificateName};return At.call(this,t).then((function(t){return e.isRegisterPush=!1,t}))}function Fo(e){if(!e||"string"!=typeof e.fileId||""===e.fileId)return Promise.reject(Error('Invalid parameter: "fileId"'));if(void 0!==e.currentUserId&&"string"!=typeof e.currentUserId)return Promise.reject(Error('Invalid parameter: "currentUserId"'));if(void 0!==e.audio){if("object"!==On(e.audio)||null===e.audio||Array.isArray(e.audio))return Promise.reject(Error('Invalid parameter: "audio"'));var t=e.audio,r=t.format,n=t.sampleRate,o=t.bitsPerSample,i=t.channels;if(void 0!==r&&"string"!=typeof r)return Promise.reject(Error('Invalid parameter: "audio.format"'));if(void 0!==n&&"number"!=typeof n)return Promise.reject(Error('Invalid parameter: "audio.sampleRate"'));if(void 0!==o&&"number"!=typeof o)return Promise.reject(Error('Invalid parameter: "audio.bitsPerSample"'));if(void 0!==i&&"number"!=typeof i)return Promise.reject(Error('Invalid parameter: "audio.channels"'))}var a=bt.call(this).error;if(a)return Promise.reject(a);var s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d=s.userId,p=e.currentUserId||d,h={data:Rn({fileId:e.fileId,username:p},e.audio?{audio:e.audio}:{})};if(!c||!u||!p)return Promise.reject(Error('Invalid parameter: "orgname", "appname" or "currentUserId"'));var f={url:"".concat(this.apiUrl,"/api/sdk/v1/").concat(c,"/").concat(u,"/speech/transcriptions"),type:"POST",dataType:"json",data:JSON.stringify(h),headers:{Authorization:"Bearer "+l,"Content-Type":"application/json",Accept:"application/json"}};return B.debug("Call transcribeSpeech",h),oe.call(this,f).then((function(e){var t;return{type:0,data:{text:(null===(t=e.data)||void 0===t?void 0:t.text)||""}}}))}function qo(e){if(!e||!Ko(t=e.file)&&!Vo(t))return Promise.reject(Error('Invalid parameter: "file"'));var t;if(void 0!==e.currentUserId&&"string"!=typeof e.currentUserId)return Promise.reject(Error('Invalid parameter: "currentUserId"'));if(void 0!==e.audio){if("object"!==On(e.audio)||null===e.audio||Array.isArray(e.audio))return Promise.reject(Error('Invalid parameter: "audio"'));var r=e.audio,n=r.format,o=r.sampleRate,i=r.bitsPerSample,a=r.channels;if(void 0!==n&&"string"!=typeof n)return Promise.reject(Error('Invalid parameter: "audio.format"'));if(void 0!==o&&"number"!=typeof o)return Promise.reject(Error('Invalid parameter: "audio.sampleRate"'));if(void 0!==i&&"number"!=typeof i)return Promise.reject(Error('Invalid parameter: "audio.bitsPerSample"'));if(void 0!==a&&"number"!=typeof a)return Promise.reject(Error('Invalid parameter: "audio.channels"'))}var c=bt.call(this).error;if(c)return Promise.reject(c);var u=this.context,l=u.orgName,d=u.appName,p=u.accessToken,h=u.userId,f=e.currentUserId||h;if(!l||!d||!f)return Promise.reject(Error('Invalid parameter: "orgname", "appname" or "currentUserId"'));var m="".concat(this.apiUrl,"/api/sdk/v1/").concat(l,"/").concat(d,"/speech/recognitions");if(Ko(e.file))return function(e){var t=new FormData,r=Wo(e.currentUserId,e.audio);return Object.keys(r).forEach((function(e){t.append(e,r[e])})),t.append("file",e.file),B.debug("Call recognizeSpeech",{currentUserId:e.currentUserId,fileName:e.file.name,fileSize:e.file.size,audio:e.audio}),new Promise((function(r,n){var o=new XMLHttpRequest;o.timeout=q,o.ontimeout=function(){n({type:s.REQUEST_TIMEOUT,message:"Request Timeout",errorType:"timeout_error",xhr:o})},o.onerror=function(){n({type:s.REQUEST_UNKNOWN,message:"Request Unknown Error",errorType:"onerror",xhr:o})},o.onabort=function(){n({type:s.REQUEST_ABORT,message:"Request Abort",errorType:"onabort",xhr:o})},o.onreadystatechange=function(){var e,t;if(4===o.readyState){var i=zo(o.responseText);200!==o.status?n({type:o.status||s.REQUEST_UNKNOWN,data:i,message:(null===(t=null==i?void 0:i.error)||void 0===t?void 0:t.message)||(null==i?void 0:i.message)||"Request Error",xhr:o}):r({type:s.REQUEST_SUCCESS,data:{text:(null===(e=null==i?void 0:i.data)||void 0===e?void 0:e.text)||""}})}},o.open("POST",e.requestUrl),o.setRequestHeader("Authorization","Bearer "+e.accessToken),o.setRequestHeader("Accept","application/json"),o.send(t)}))}({file:e.file,currentUserId:f,audio:e.audio,requestUrl:m,accessToken:p});var v=Jo();return Vo(e.file)&&v?function(e){var t=Wo(e.currentUserId,e.audio);return B.debug("Call recognizeSpeech",{currentUserId:e.currentUserId,filePath:e.file.filePath,fileName:e.file.name||e.file.filePath.split("?")[0].split("/").filter(Boolean).pop(),fileSize:e.file.size,audio:e.audio}),new Promise((function(r,n){e.platForm.global.uploadFile({url:e.requestUrl,filePath:e.file.filePath,name:"file",header:{"Content-Type":"multipart/form-data",Authorization:"Bearer "+e.accessToken,Accept:"application/json"},formData:t,success:function(e){var t,o,i=zo(e.data);200!==e.statusCode?n({type:e.statusCode||s.REQUEST_UNKNOWN,data:i,message:(null===(o=null==i?void 0:i.error)||void 0===o?void 0:o.message)||(null==i?void 0:i.message)||"Request Error"}):r({type:s.REQUEST_SUCCESS,data:{text:(null===(t=null==i?void 0:i.data)||void 0===t?void 0:t.text)||""}})},fail:function(e){n({type:s.REQUEST_UNKNOWN,message:"Request Unknown Error",errorType:"upload_fail",data:e})}})}))}({file:e.file,currentUserId:f,audio:e.audio,requestUrl:m,accessToken:p,platForm:v}):Promise.reject(Error('Invalid parameter: "file"'))}function Wo(e,t){var r={username:e};return void 0!==(null==t?void 0:t.format)&&(r["audio.format"]=t.format),void 0!==(null==t?void 0:t.sampleRate)&&(r["audio.sampleRate"]=String(t.sampleRate)),void 0!==(null==t?void 0:t.bitsPerSample)&&(r["audio.bitsPerSample"]=String(t.bitsPerSample)),void 0!==(null==t?void 0:t.channels)&&(r["audio.channels"]=String(t.channels)),r}function zo(e){if("string"==typeof e&&e)try{return JSON.parse(e)}catch(t){return e}return e}function Ko(e){return"undefined"!=typeof File&&e instanceof File}function Vo(e){return"object"===On(e)&&null!==e&&!Array.isArray(e)&&"string"==typeof e.filePath&&""!==e.filePath}function Jo(){var e,t=ye.getEnvInfo();if("web"!==t.platform&&"node"!==t.platform&&"quick_app"!==t.platform&&"function"==typeof(null===(e=t.global)||void 0===e?void 0:e.uploadFile))return t}function Yo(e){var t,r=function(e){var t,r,n=zo(null==e?void 0:e.data),o=null===(t=null==n?void 0:n.error)||void 0===t?void 0:t.code;return{serviceCode:"string"==typeof o||"number"==typeof o?String(o):void 0,serviceMessage:null===(r=null==n?void 0:n.error)||void 0===r?void 0:r.message}}(e),n=r.serviceCode,o=r.serviceMessage;if("number"==typeof(null==e?void 0:e.type)&&!n)return{type:e.type,message:(null==e?void 0:e.message)||"Voice-to-text failed"};switch(n){case"4041001":return{type:s.FILE_NOT_FOUND,message:"File not found"};case"4001002":return{type:s.FILE_INVALID,message:"Invalid file"};case"5021001":return{type:s.WEBIM_UPLOADFILE_ERROR,message:"File upload failed"};case"4001003":return{type:s.FILE_DURATION_TOO_LONG,message:"Voice duration exceeds 60 seconds"};case"4031001":return{type:s.SERVICE_NOT_ENABLED,message:"Service not enabled"};case"4031002":return{type:s.MAX_LIMIT,message:"Beta service usage limit exceeded"};case"4001001":return"string"==typeof(t=o)&&t.toLowerCase().includes("uploaded file exceeds")?{type:s.FILE_TOO_LARGE,message:"File too large"}:{type:s.REQUEST_PARAMETER_ERROR,message:o||"Missing or invalid request parameter"};case"5021003":case"5001003":return{type:s.FILE_VOICE_TO_TEXT_FAILED,message:"Voice-to-text failed"};case"4011001":return{type:s.NO_PERMISSION,message:o||"Unauthorized or invalid token"};default:return{type:s.FILE_VOICE_TO_TEXT_FAILED,message:o||(null==e?void 0:e.message)||"Voice-to-text failed"}}}function Xo(e,t,r){void 0===r&&(r="");var n={type:e};return e===s.REQUEST_SUCCESS?(n.data={text:r},n):(void 0!==t&&(n.message=t),n)}function Qo(e){return!(void 0===e||"object"===On(e)&&null!==e&&!Array.isArray(e))||void 0!==(null==e?void 0:e.format)&&"string"!=typeof e.format||void 0!==(null==e?void 0:e.sampleRate)&&"number"!=typeof e.sampleRate||void 0!==(null==e?void 0:e.bitsPerSample)&&"number"!=typeof e.bitsPerSample||void 0!==(null==e?void 0:e.channels)&&"number"!=typeof e.channels}function $o(e,t){if(!e||"audio"!==e.type)return Promise.reject(Xo(s.FILE_INVALID,"Invalid file"));if(Qo(t))return Promise.reject(Xo(s.FILE_INVALID,"Invalid file"));if(!e.url)return Promise.reject(Xo(s.FILE_NOT_FOUND,"File not found"));var r=function(e){if(e){var t=e.split("#")[0].split("?")[0].split("/").filter(Boolean);return t[t.length-1]}}(e.url);return r?Fo.call(this,Rn({fileId:r},t?{audio:t}:{})).then((function(e){var t;return Xo(e.type,e.message,(null===(t=e.data)||void 0===t?void 0:t.text)||"")})).catch((function(e){var t=Yo(e);throw Xo(t.type,t.message)})):Promise.reject(Xo(s.FILE_INVALID,"Invalid file"))}function Zo(e,t){return Qo(t)?Promise.reject(Xo(s.FILE_INVALID,"Invalid file")):Ko(e)||Vo(e)&&Jo()?qo.call(this,Rn({file:e},t?{audio:t}:{})).then((function(e){var t;return Xo(e.type,e.message,(null===(t=e.data)||void 0===t?void 0:t.text)||"")})).catch((function(e){var t=Yo(e);throw Xo(t.type,t.message)})):Promise.reject(Xo(s.FILE_INVALID,"Invalid file"))}function ei(e){void 0===e&&(e="*");var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i=t.userId,a={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/users/").concat(i,"/token/rtc?channelName=").concat(e),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"}};return oe.call(this,a).then((function(e){return{type:e.type,data:{appId:(null==e?void 0:e.app_id)||"",RTCToken:(null==e?void 0:e.rtc_token)||"",channelName:(null==e?void 0:e.channel_name)||"",RTCUId:(null==e?void 0:e.rtcUid)||0,expire:(null==e?void 0:e.expires_in)||0}}}))}function ti(e){if(!Array.isArray(e)||0===e.length)throw Error("Invalid parameter RTCUIds: "+e);var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/rtc_mapper/batch/get"),type:"POST",dataType:"json",data:JSON.stringify({data:e}),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"}};return oe.call(this,i).then((function(e){return{type:e.type,data:e.data||{}}}))}function ri(e){return ri="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ri(e)}var ni=function(){return ni=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ni.apply(this,arguments)},oi=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},ii=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function ai(e){if(!e||!e.data)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups?resource=").concat(a.clientResource),dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:e.data.groupname,avatar:e.data.avatar,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,maxusers:e.data.maxusers,custom:e.data.ext}),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:function(t){e.success&&e.success(t)},error:e.error};return B.debug("Call createGroup:",e),oe.call(this,s,f.CREATE_GROUP)}var si=ai;function ci(e){var t,r,n,o,i,a,c,u,l;if(!e)throw Error("Invalid parameter");var d=bt.call(this).error;if(d)return Promise.reject(d);var p=this.context,h=p.orgName,m=p.appName,v=p.accessToken,g=p.jid,y={url:"".concat(this.apiUrl,"/").concat(h,"/").concat(m,"/chatgroups?resource=").concat(g.clientResource),dataType:"json",type:"POST",data:JSON.stringify({owner:this.user,groupname:null!==(t=e.groupName)&&void 0!==t?t:"",avatar:null!==(r=e.avatar)&&void 0!==r?r:"",desc:null!==(n=e.description)&&void 0!==n?n:"",members:e.members,public:null!==(o=e.isPublic)&&void 0!==o&&o,approval:null!==(i=e.needApprovalToJoin)&&void 0!==i&&i,allowinvites:null===(a=e.allowMemberToInvite)||void 0===a||a,invite_need_confirm:null!==(c=e.inviteNeedConfirm)&&void 0!==c&&c,maxusers:null!==(u=e.maxMemberCount)&&void 0!==u?u:200,custom:null!==(l=e.extension)&&void 0!==l?l:""}),headers:{Authorization:"Bearer "+v,"Content-Type":"application/json"}};return B.debug("Call createGroupVNext:",e),oe.call(this,y,f.CREATE_GROUP).then((function(e){return{type:s.REQUEST_SUCCESS,data:{groupId:e.data.groupid}}}))}function ui(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");var r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c={entities:[(t={},t["notification_ignore_"+e.groupId]=!0,t)]},u={type:"PUT",url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(this.user,"?resource=").concat(s.clientResource),data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call blockGroupMessages",e),oe.call(this,u,f.BLOCK_GROUP)}var li=ui;function di(e){if("number"!=typeof e.limit)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={limit:e.limit,cursor:e.cursor};e.cursor||delete a.cursor;var s={url:this.apiUrl+"/"+n+"/"+o+"/publicchatgroups?version=v3",type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call listGroups",e),oe.call(this,s,f.LIST_GROUP).then((function(t){var r,n=t.data.map((function(e){return{groupid:e.id,groupname:e.name}}));return null===(r=e.success)||void 0===r||r.call(e,ni(ni({},t),{data:n})),ni(ni({},t),{data:n})}))}var pi=di;function hi(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+n+"/"+o+"/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 B.debug("Call getJoinedGroups",e),oe.call(this,a,f.GET_USER_GROUP)}function fi(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.needAffiliations||e.needRole?"/chatgroups/user/".concat(this.user,"?pagenum=").concat(e.pageNum,"&pagesize=").concat(e.pageSize,"&needAffiliations=").concat(e.needAffiliations,"&needRole=").concat(e.needRole,"&version=v3"):"/users/".concat(this.user,"/joined_chatgroups?pagenum=").concat(e.pageNum,"&pagesize=").concat(e.pageSize,"&version=v3"),s={url:this.apiUrl+"/"+n+"/"+o+a,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e&&(null==e?void 0:e.error)};return B.debug("Call getGroup",e),oe.call(this,s,f.GET_USER_GROUP).then((function(t){var r,n=t.uri,o=t.entities,i=[];if(n.includes("joined_chatgroups")){var a=t.data.map((function(e){return{groupid:e.id,groupname:e.name,disabled:e.disabled,role:e.permission}}));return null===(r=null==e?void 0:e.success)||void 0===r||r.call(e,ni(ni({},t),{data:a})),ni(ni({},t),{data:a})}return o.forEach((function(e){var t={affiliationsCount:e.affiliations_count,groupName:e.name,groupId:e.groupId,role:e.permission,disabled:e.disabled,approval:e.membersonly,allowInvites:e.allowinvites,description:e.description,maxUsers:e.maxusers,public:e.public};i.push(t)})),t.entities=i,t}))}function mi(e){if("string"!=typeof e.groupId||"string"!=typeof e.newOwner)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r={newowner:e.newOwner},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/chatgroups/").concat(e.groupId,"?resource=").concat(s.clientResource),type:"PUT",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},data:JSON.stringify(r),success:e.success,error:e.error};return B.debug("Call changeOwner",e),oe.call(this,c,f.CHANGE_OWNER)}var vi=mi;function gi(e){if("string"!=typeof e.groupId&&!Array.isArray(e.groupId))throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+n+"/"+o+"/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 B.debug("Call getGroupInfo",e),oe.call(this,a,f.GET_GROUP_INFO)}function yi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={groupname:e.groupName,avatar:e.avatar,description:e.description,custom:e.ext},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"?resource=").concat(a.clientResource),type:"PUT",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call modifyGroup",e),oe.call(this,u,f.MODIFY_GROUP)}function Ei(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');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={pagenum:e.pageNum,pagesize:e.pageSize},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={url:this.apiUrl+"/"+o+"/"+i+"/chatgroups/"+e.groupId+"/users?version=v3",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call listGroupMember",e),oe.call(this,s,f.LIST_GROUP_MEMBER)}var _i=Ei;function Ti(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(e.cursor&&"string"!=typeof e.cursor)throw Error('Invalid parameter: "cursor"');if(e.limit&&"number"!=typeof e.limit)throw Error('Invalid parameter: "limit"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={cursor:e.cursor,limit:e.limit||50,joined_time:!0},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+o+"/"+i+"/chatgroups/"+e.groupId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return B.debug("Call getGroupMembers",e),oe.call(this,c,f.LIST_GROUP_MEMBER).then((function(e){var t=e.data,r=e.cursor,n=t.map((function(e){for(var t in e)if(["member","admin","owner"].includes(t))return{role:t,userId:e[t],joinedTime:e.joined_time}}));return{type:s.REQUEST_SUCCESS,data:{cursor:r,members:n}}}))}function Ii(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatgroups/"+a+"/admin?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getGroupAdmin",e),oe.call(this,s,f.GET_GROUP_ADMIN)}function Oi(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={newadmin:e.username},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/admin?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call setGroupAdmin",e),oe.call(this,u,f.SET_GROUP_ADMIN)}var Ri=Oi;function Si(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/admin/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeAdmin",e),oe.call(this,u,f.REMOVE_GROUP_ADMIN)}var bi=Si;function Ci(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"?version=v3&resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call destroyGroup",e),oe.call(this,c,f.DISSOLVE_GROUP)}var Ni=Ci;function Ai(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/quit?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call quitGroup",e),oe.call(this,c,f.QUIT_GROUP)}var Mi=Ai;function wi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=e.groupId,n={usernames:e.users},o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatgroups/").concat(r,"/invite?resource=").concat(c.clientResource),type:"POST",data:JSON.stringify(n),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call inviteUsersToGroup",e),oe.call(this,u,f.INVITE_TO_GROUP)}var Ui=wi;function Li(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(e.groupId,"/apply?resource=").concat(a.clientResource),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 B.debug("Call joinGroup",e),oe.call(this,s,f.JOIN_GROUP)}function Pi(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={applicant:e.applicant,verifyResult:!0,reason:"no clue"},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/apply_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call agreeJoinGroup",e),oe.call(this,u,f.AGREE_JOIN_GROUP)}var xi=Pi;function ki(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={applicant:e.applicant,verifyResult:!1,reason:e.reason||""},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/apply_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call rejectGroupJoinRequest",e),oe.call(this,u,f.REJECT_JOIN_GROUP)}var Di=ki;function Bi(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={invitee:e.invitee,verifyResult:!0},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/invite_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call acceptGroupInvite",e),oe.call(this,u,f.AGREE_INVITE_GROUP)}var ji=Bi;function Gi(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={invitee:e.invitee,verifyResult:!1},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/invite_verify?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call rejectGroupInvite",e),oe.call(this,u,f.REJECT_INVITE_GROUP)}var Hi=Gi;function Fi(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=e.groupId,n=e.username,o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatgroups/").concat(r,"/users/").concat(n,"?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeGroupMember",e),oe.call(this,u,f.REMOVE_GROUP_MEMBER)}var qi=Fi;function Wi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.users.join(","),u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/users/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeGroupMembers",e),oe.call(this,u,f.MULTI_REMOVE_GROUP_MEMBER)}var zi=Wi;function Ki(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!(Array.isArray(e.username)||"string"==typeof e.username&&""!==e.username))throw Error('Invalid parameter: "username"');if("number"!=typeof e.muteDuration)throw Error('Invalid parameter: "muteDuration"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={usernames:"string"==typeof e.username?[e.username]:e.username,mute_duration:e.muteDuration},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/mute?resource=").concat(a.clientResource,"&version=v3"),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(c),success:e.success,error:e.error};return B.debug("Call muteGroupMember",e),oe.call(this,u,f.MUTE_GROUP_MEMBER)}var Vi=Ki;function Ji(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!(Array.isArray(e.username)||"string"==typeof e.username&&""!==e.username))throw Error('Invalid parameter: "username"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/mute/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call unmuteGroupMember",e),oe.call(this,u,f.UNMUTE_GROUP_MEMBER)}var Yi=Ji;function Xi(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatgroups/"+a+"/mute?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getGroupMuteList",e),oe.call(this,s,f.GET_GROUP_MUTE_LIST)}var Qi=Xi,$i=Xi;function Zi(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call blockGroupMember",e),oe.call(this,u,f.BLOCK_GROUP_MEMBER).then((function(t){var r,n=t.data[0]||{},o={action:"add_blocks",groupid:e.groupId,result:n.result,user:n.user};return null===(r=null==e?void 0:e.success)||void 0===r||r.call(e,ni(ni({},t),{data:o})),ni(ni({},t),{data:o})}))}var ea=Zi;function ta(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={usernames:e.usernames},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/blocks/users?resource=").concat(a.clientResource,"&version=v3"),data:JSON.stringify(c),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call blockGroupMembers",e),oe.call(this,u,f.BLOCK_GROUP_MEMBERS).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return ni(ni({},t),{action:"add_blocks",groupid:e.groupId})}));return null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,ni(ni({},t),{data:o})),ni(ni({},t),{data:o})}))}var ra=ta;function na(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call unblockGroupMember",e),oe.call(this,u,f.UNBLOCK_GROUP_MEMBER).then((function(t){var r,n=t.data[0]||{},o={action:"remove_blocks",groupid:e.groupId,result:n.result,user:n.user};return null===(r=null==e?void 0:e.success)||void 0===r||r.call(e,ni(ni({},t),{data:o})),ni(ni({},t),{data:o})}))}var oa=na;function ia(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.usernames.join(","),u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call unblockGroupMembers",e),oe.call(this,u,f.UNBLOCK_GROUP_MEMBERS).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return ni(ni({},t),{action:"remove_blocks",groupid:e.groupId})}));return null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,ni(ni({},t),{data:o})),ni(ni({},t),{data:o})}))}var aa=ia;function sa(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatgroups/"+a+"/blocks/users?version=v3",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getGroupBlacklist",e),oe.call(this,s,f.GET_GROUP_BLACK_LIST)}var ca=sa,ua=sa;function la(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/ban?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call disableSendGroupMsg",e),oe.call(this,c,f.DISABLED_SEND_GROUP_MSG)}function da(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/ban?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call enableSendGroupMsg",e),oe.call(this,c,f.ENABLE_SEND_GROUP_MSG)}function pa(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={usernames:e.users},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/white/users?resource=").concat(a.clientResource,"&version=v3"),type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call addUsersToGroupWhitelist",e),oe.call(this,u,f.ADD_USERS_TO_GROUP_WHITE).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return ni(ni({},t),{action:"add_user_whitelist",groupid:e.groupId})}));return 1===(null==o?void 0:o.length)&&(o=o[0]),null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,ni(ni({},t),{data:o})),ni(ni({},t),{data:o})}))}var ha=pa;function fa(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/white/users/").concat(e.userName,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call removeGroupAllowlistMember",e),oe.call(this,c,f.REMOVE_GROUP_WHITE_MEMBER).then((function(t){var r,n=t.data[0]||{},o={action:"remove_user_whitelist",groupid:e.groupId,result:n.result,user:n.user};return null===(r=null==e?void 0:e.success)||void 0===r||r.call(e,ni(ni({},t),{data:o})),ni(ni({},t),{data:o})}))}var ma=fa,va=fa;function ga(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatgroups/"+a+"/white/users?version=v3",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getGroupAllowlist",e),oe.call(this,s,f.GET_GROUP_WHITE_LIST)}var ya=ga;function Ea(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatgroups/"+a+"/white/users/"+e.userName+"?version=v3",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call isInGroupAllowlist",e),oe.call(this,s,f.IS_IN_GROUP_WHITE_LIST)}var _a=Ea,Ta=Ea;function Ia(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.userId,s={url:this.apiUrl+"/"+n+"/"+o+"/sdk/chatgroups/"+e.groupId+"/mute/"+a+"?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i}};return B.debug("Call isInGroupMutelist",e),oe.call(this,s).then((function(e){return{type:e.type,data:e.data}}))}function Oa(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+n+"/"+o+"/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 B.debug("Call getGroupMsgReadUser",e),oe.call(this,a,f.GET_GROUP_MSG_READ_USER)}function Ra(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.groupId,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(a,"/announcement?version=v3"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call fetchGroupAnnouncement",e),oe.call(this,s,f.GET_GROUP_ANN)}function Sa(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c={announcement:e.announcement},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/announcement?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call updateGroupAnnouncement",e),oe.call(this,u,f.UPDATE_GROUP_ANN)}function ba(e){var t;if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');if("object"!==ri(e.file))throw Error('Invalid parameter: "file"');var r=bt.call(this).error;if(r)return null===(t=e.onFileUploadError)||void 0===t?void 0:t.call(e,r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c=e.groupId;he.call(this,{uploadUrl:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/chatgroups/").concat(c,"/share_files?resource=").concat(s.clientResource),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:a,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey,to:c,chatType:"groupChat"},f.UPLOAD_GROUP_FILE),B.debug("Call uploadGroupSharedFile",e)}function Ca(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.groupId,c=e.fileId,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(s,"/share_files/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call deleteGroupSharedFile",e),oe.call(this,u,f.DELETE_GROUP_FILE)}function Na(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.pageNum||1,s=e.pageSize||10,c=e.groupId,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(c,"/share_files?pagenum=").concat(a,"&pagesize=").concat(s,"&version=v3"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getGroupSharedFilelist",e),oe.call(this,u,f.GET_GROUP_FILE_LIST)}var Aa=Na;function Ma(e){var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i=this.apiUrl,a=e.groupId,s=e.fileId;fe.call(this,{url:"".concat(i,"/").concat(r,"/").concat(n,"/chatgroups/").concat(a,"/share_files/").concat(s),onFileDownloadComplete:e.onFileDownloadComplete,onFileDownloadError:e.onFileDownloadError,accessToken:o,id:s,secret:e.secret},f.DOWN_GROUP_FILE),B.debug("Call downloadGroupSharedFile",e)}function wa(e){return oi(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u,l,d;return ii(this,(function(p){switch(p.label){case 0:if(t=e.groupId,r=e.userId,n=e.memberAttributes,"string"!=typeof t||""===t)throw Error('Invalid parameter: "groupId"');if("string"!=typeof r||""===r)throw Error('Invalid parameter: "userId"');if("object"!==ri(n))throw Error('Invalid parameter: "memberAttributes"');return(o=bt.call(this).error)?[2,Promise.reject(o)]:(i=this.context,a=i.orgName,s=i.appName,c=i.accessToken,u=i.jid,l={metaData:n},d={url:"".concat(this.apiUrl,"/").concat(a,"/").concat(s,"/sdk/metadata/chatgroup/").concat(t,"/user/").concat(r,"?resource=").concat(u.clientResource,"&version=v3"),type:"PUT",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+c,"Content-Type":"application/json"}},B.debug("Call setGroupMemberAttributes",e),[4,oe.call(this,d,f.SET_GROUP_MEMBER_ATTRS)]);case 1:return p.sent(),[2]}}))}))}function Ua(e){var t=e.groupId,r=e.userId;return La.call(this,{groupId:t,userIds:[r]}).then((function(e){var t;return{type:e.type,data:null===(t=e.data)||void 0===t?void 0:t[r]}}))}function La(e){var t=e.groupId,r=e.userIds,n=e.keys,o=void 0===n?[]:n;if("string"!=typeof t||""===t)throw Error('Invalid parameter: "groupId"');if(!Array.isArray(r)||(null==r?void 0:r.length)<=0)throw Error('Invalid parameter: "userIds"');if(!Array.isArray(o))throw Error('Invalid parameter: "keys"');var i=bt.call(this).error;if(i)return Promise.reject(i);var a=this.context,s=a.orgName,c=a.appName,u=a.accessToken,l={targets:r,properties:o},d={url:"".concat(this.apiUrl,"/").concat(s,"/").concat(c,"/sdk/metadata/chatgroup/").concat(t,"/get?version=v3"),type:"POST",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+u,"Content-Type":"application/json"}};return B.debug("Call getGroupMembersAttributes",e),oe.call(this,d,f.GET_GROUP_MEMBER_ATTR).then((function(e){return{type:e.type,data:(null==e?void 0:e.data)||{}}}))}function Pa(){var e=bt.call(this).error;if(e)return Promise.reject(e);var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/chatgroups/user/").concat(this.context.userId,"/joined_count"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"}};return B.debug("Call getJoinedGroupsCount"),oe.call(this,i).then((function(e){return{type:s.REQUEST_SUCCESS,data:e.data||0}}))}function xa(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,c=e.groupId,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(c,"/shield?version=v3&resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call blockGroupMessages",e),oe.call(this,u).then((function(e){return{type:s.REQUEST_SUCCESS,data:e.data||{}}}))}function ka(e){if("string"!=typeof e.groupId||""===e.groupId)throw Error('Invalid parameter: "groupId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,c=e.groupId,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatgroups/").concat(c,"/shield?version=v3&resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call unblockGroupMessages",e),oe.call(this,u).then((function(e){return{type:s.REQUEST_SUCCESS,data:e.data||{}}}))}function Da(e){return Da="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Da(e)}__webpack_require__(8363);var Ba=function(){return Ba=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Ba.apply(this,arguments)};function ja(e){var t=this;if("number"!=typeof e.pagenum||"number"!=typeof e.pagesize)throw Error("Invalid parameter");var r=bt.call(this).error;if(r)return Promise.reject(r);var n={pagenum:e.pagenum||1,pagesize:e.pagesize||20},o=this.context,i=o.orgName,a=o.appName,c=o.accessToken,u={url:this.apiUrl+"/"+i+"/"+a+"/chatrooms",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+c},data:n,success:function(t){"function"==typeof e.success&&e.success(t)},error:function(r){r.error&&r.error_description&&t.onError&&t.onError({type:s.WEBIM_CONNCTION_LOAD_CHATROOM_ERROR,message:r.error_description,data:r}),"function"==typeof e.error&&e.error(r)}};return B.debug("Call getChatRooms",e),oe.call(this,u,f.GET_CHATROOM_LIST)}function Ga(e){if("string"!=typeof e.name)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r={name:e.name,description:e.description,maxusers:e.maxusers,owner:this.user,members:e.members},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/chatrooms?resource=").concat(s.clientResource),dataType:"json",type:"POST",data:JSON.stringify(r),headers:{Authorization:"Bearer "+(e.token||a),"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call createChatRoom",e),oe.call(this,c,f.CREATE_CHATROOM)}function Ha(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(e.chatRoomId,"?resource=").concat(a.clientResource,"&version=v3"),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+(e.token||i)},success:e.success,error:e.error};return B.debug("Call destroyChatRoom",e),oe.call(this,s,f.DESTROY_CHATROOM)}function Fa(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+e.chatRoomId,dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getChatRoomDetails",e),oe.call(this,a,f.GET_CHATROOM_DETAIL)}function qa(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={groupname:e.chatRoomName,description:e.description,maxusers:e.maxusers},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"?resource=").concat(a.clientResource),type:"PUT",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call modifyChatRoom",e),oe.call(this,u,f.MODIFY_CHATROOM)}function Wa(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||"string"!=typeof e.username)throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/users/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeChatRoomMember",e),oe.call(this,u,f.REMOVE_CHATROOM_MEMBER)}var za=Wa;function Ka(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=e.chatRoomId,n=e.users.join(","),o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatrooms/").concat(r,"/users/").concat(n,"?resource=").concat(c.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeChatRoomMembers",e),oe.call(this,u,f.MULTI_REMOVE_CHATROOM_MEMBER)}var Va=Ka;function Ja(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId||!Array.isArray(e.users))throw Error("Invalid parameter");var t=bt.call(this).error;if(t)return Promise.reject(t);var r=e.chatRoomId,n={usernames:e.users},o=this.context,i=o.orgName,a=o.appName,s=o.accessToken,c=o.jid,u={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/chatrooms/").concat(r,"/users?resource=").concat(c.clientResource),type:"POST",data:JSON.stringify(n),dataType:"json",headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call addUsersToChatRoom",e),oe.call(this,u,f.ADD_USERS_TO_CHATROOM)}function Ya(e){var t=e.roomId,r=e.message,n=void 0===r?"":r,o=e.ext,i=void 0===o?"":o,a=e.leaveOtherRooms,c=void 0!==a&&a,u=e.success,l=e.error;if("string"!=typeof t||""===t)throw Error("Invalid parameter roomId");if("string"!=typeof i)throw Error("Invalid parameter ext");if("boolean"!=typeof c)throw Error("Invalid parameter leaveOtherRooms");var d=bt.call(this).error;return d?Promise.reject(d):(B.debug("Call joinChatRoom",e),this.logOut?Promise.reject({type:s.WEBIM_CONNECTION_CLOSED,message:"not login"}):this.mSync.handleChatRoom({roomId:t,ext:i,leaveOtherRooms:c,message:n,success:u,errorCb:l},"join"))}function Xa(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error("Invalid parameter");var t=bt.call(this).error;return t?Promise.reject(t):(B.debug("Call leaveChatRoom",e),this.logOut?Promise.reject({type:s.WEBIM_CONNECTION_CLOSED,message:"not login"}):this.mSync.handleChatRoom(e,"leave"))}var Qa=Xa;function $a(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');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={pagenum:e.pageNum,pagesize:e.pageSize},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={url:this.apiUrl+"/"+o+"/"+i+"/chatrooms/"+e.chatRoomId+"/users?version=v3",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call listChatRoomMembers",e),oe.call(this,s,f.LIST_CHATROOM_MEMBERS)}var Za=$a;function es(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(e.cursor&&"string"!=typeof e.cursor)throw Error('Invalid parameter: "cursor"');if(e.limit&&"number"!=typeof e.limit)throw Error('Invalid parameter: "limit"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={cursor:e.cursor,limit:e.limit||50,joined_time:!0},n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,c={url:this.apiUrl+"/"+o+"/"+i+"/chatrooms/"+e.chatRoomId+"/users",dataType:"json",type:"GET",data:r,headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return B.debug("Call getChatRoomMembers",e),oe.call(this,c,f.LIST_GROUP_MEMBER).then((function(e){var t=e.data,r=e.cursor,n=t.map((function(e){for(var t in e)if(["member","admin","owner"].includes(t))return{role:t,userId:e[t],joinedTime:e.joined_time}}));return{type:s.REQUEST_SUCCESS,data:{cursor:r,members:n}}}))}function ts(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+a+"/admin?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getChatRoomAdmin",e),oe.call(this,s,f.GET_CHATROOM_ADMIN)}function rs(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={newadmin:e.username},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/admin?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call setChatRoomAdmin",e),oe.call(this,u,f.SET_CHATROOM_ADMIN)}function ns(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/admin/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call removeChatRoomAdmin",e),oe.call(this,u,f.REMOVE_CHATROOM_ADMIN)}function os(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={usernames:[e.username],mute_duration:e.muteDuration},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/mute?resource=").concat(a.clientResource),dataType:"json",type:"POST",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},data:JSON.stringify(c),success:e.success,error:e.error};return B.debug("Call muteChatRoomMember",e),oe.call(this,u,f.MUTE_CHATROOM_MEMBER)}function is(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/mute/").concat(c,"?resource=").concat(a.clientResource),dataType:"json",type:"DELETE",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call unmuteChatRoomMember",e),oe.call(this,u,f.REMOVE_MUTE_CHATROOM_MEMBER)}var as=is;function ss(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+a+"/mute?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getChatRoomMutelist",e),oe.call(this,s,f.GET_MUTE_CHATROOM_MEMBERS)}var cs=ss,us=ss;function ls(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call blockChatRoomMember",e),oe.call(this,u,f.SET_CHATROOM_MEMBER_TO_BLACK).then((function(t){var r,n=t.data[0]||{},o=Ba(Ba({},n),{action:"add_blocks",id:e.chatRoomId});return null===(r=null==e?void 0:e.success)||void 0===r||r.call(e,Ba(Ba({},t),{data:o})),Ba(Ba({},t),{data:o})}))}var ds=ls;function ps(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={usernames:e.usernames},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/blocks/users?resource=").concat(a.clientResource,"&version=v3"),data:JSON.stringify(c),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Chat blockChatRoomMembers:",u),oe.call(this,u,f.MULTI_SET_CHATROOM_MEMBER_TO_BLACK).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return Ba(Ba({},t),{action:"add_blocks",id:e.chatRoomId})}));return null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,Ba(Ba({},t),{data:o})),Ba(Ba({},t),{data:o})}))}var hs=ps;function fs(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.username,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call unblockChatRoomMember",e),oe.call(this,u,f.REMOVE_CHATROOM_MEMBER_BLACK).then((function(t){var r,n=t.data;return null===(r=e.success)||void 0===r||r.call(e,Ba(Ba({},t),{data:Ba(Ba({},n[0]),{action:"remove_blocks",id:e.chatRoomId})})),Ba(Ba({},t),{data:Ba(Ba({},n[0]),{action:"remove_blocks",id:e.chatRoomId})})}))}var ms=fs;function vs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c=e.usernames.join(","),u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/blocks/users/").concat(c,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call unblockChatRoomMembers",e),oe.call(this,u,f.MULTI_REMOVE_CHATROOM_MEMBER_BLACK).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return Ba(Ba({},t),{action:"remove_blocks",id:e.chatRoomId})}));return null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,Ba(Ba({},t),{data:o})),Ba(Ba({},t),{data:o})}))}var gs=vs;function ys(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+a+"/blocks/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getChatRoomBlocklist",e),oe.call(this,s,f.GET_CHATROOM_BLOCK_MEMBERS)}var Es=ys,_s=ys;function Ts(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/ban?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call disableSendChatRoomMsg",e),oe.call(this,c,f.DISABLED_CHATROOM_SEND_MSG)}function Is(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/ban?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call enableSendChatRoomMsg",e),oe.call(this,c,f.ENABLE_CHATROOM_SEND_MSG)}function Os(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');if(!Array.isArray(e.users))throw Error('Invalid parameter: "users"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={usernames:e.users},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/white/users?resource=").concat(a.clientResource,"&version=v3"),type:"POST",data:JSON.stringify(c),dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call addUsersToChatRoomWhitelist",e),oe.call(this,u,f.ADD_USERS_TO_CHATROOM).then((function(t){var r,n,o=null===(r=t.data)||void 0===r?void 0:r.map((function(t){return Ba(Ba({},t),{action:"add_user_whitelist",id:e.chatRoomId})}));return 1===(null==o?void 0:o.length)&&(o=o[0]),null===(n=null==e?void 0:e.success)||void 0===n||n.call(e,Ba(Ba({},t),{data:o})),Ba(Ba({},t),{data:o})}))}var Rs=Os;function Ss(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.chatRoomId,c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/white/users/").concat(e.userName,"?resource=").concat(a.clientResource,"&version=v3"),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},error:e.error};return B.debug("Call removeChatRoomAllowlistMember",e),oe.call(this,c,f.REMOVE_CHATROOM_WHITE_USERS).then((function(t){var r;return null===(r=e.success)||void 0===r||r.call(e,Ba(Ba({},t),{data:Ba(Ba({},t.data[0]),{action:"remove_user_whitelist",id:e.chatRoomId})})),Ba(Ba({},t),{data:Ba(Ba({},t.data[0]),{action:"remove_user_whitelist",id:e.chatRoomId})})}))}var bs=Ss,Cs=Ss;function Ns(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+a+"/white/users",type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getChatRoomAllowlist",e),oe.call(this,s,f.GET_CHATROOM_WHITE_USERS)}var As=Ns;function Ms(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.chatRoomId,s={url:this.apiUrl+"/"+n+"/"+o+"/chatrooms/"+a+"/white/users/"+e.userName,type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call isInChatRoomAllowlist",e),oe.call(this,s,f.CHECK_CHATROOM_WHITE_USER)}var ws=Ms;function Us(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error('Invalid parameter: "chatRoomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.userId,s={url:this.apiUrl+"/"+n+"/"+o+"/sdk/chatrooms/"+e.chatRoomId+"/mute/"+a+"?version=v3",dataType:"json",type:"GET",headers:{Authorization:"Bearer "+i}};return B.debug("Call isInChatRoomMutelist",e),oe.call(this,s).then((function(e){return{type:e.type,data:e.data}}))}function Ls(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.roomId,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(a,"/announcement?version=v3"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call fetchChatRoomAnnouncement",e),oe.call(this,s,f.GET_CHATROOM_ANN)}function Ps(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("string"!=typeof e.announcement)throw Error('Invalid parameter: "announcement"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.roomId,c={announcement:e.announcement},u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/announcement?resource=").concat(a.clientResource,"&version=v3"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call updateChatRoomAnnouncement:",e),oe.call(this,u,f.UPDATE_CHATROOM_ANN)}function xs(e){var t;if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');if("object"!==Da(e.file))throw Error('Invalid parameter: "file"');var r=bt.call(this).error;if(r)return null===(t=e.onFileUploadError)||void 0===t?void 0:t.call(e,r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.jid,c=e.roomId;he.call(this,{uploadUrl:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/chatrooms/").concat(c,"/share_files?resource=").concat(s.clientResource),onFileUploadProgress:e.onFileUploadProgress,onFileUploadComplete:e.onFileUploadComplete,onFileUploadError:e.onFileUploadError,onFileUploadCanceled:e.onFileUploadCanceled,accessToken:a,apiUrl:this.apiUrl,file:e.file,appKey:this.context.appKey,to:c,chatType:"chatRoom"},f.UPLOAD_CHATROOM_FILE),B.debug("Call uploadChatRoomSharedFile",e)}function ks(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"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s=e.roomId,c=e.fileId,u={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(s,"/share_files/").concat(c,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call deleteChatRoomSharedFile",e),oe.call(this,u,f.DELETE_CHATROOM_FILE)}function Ds(e){if("string"!=typeof e.roomId||""===e.roomId)throw Error('Invalid parameter: "roomId"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=e.roomId,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/chatrooms/").concat(a,"/share_files"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json",accept:"application/json"},success:e.success,error:e.error};return B.debug("Call fetchChatRoomSharedFileList",e),oe.call(this,s,f.GET_CHATROOM_FILES)}var Bs=Ds;function js(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if(e.attributeKeys&&!Array.isArray(e.attributeKeys))throw Error('"Invalid parameter attributeKeys": '+e.attributeKeys);var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=(r.jid,e.chatRoomId),s={keys:e.attributeKeys},c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/metadata/chatroom/").concat(a),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return B.debug("Call getChatRoomAttributes:",e),oe.call(this,c,f.GET_CHATROOM_ATTR).then((function(e){return{data:e.data,type:e.type}}))}function Gs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("object"!==Da(e.attributes))throw Error("Invalid parameter attributes: "+e.attributes);var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.userId,s=e.chatRoomId,c=e.attributes,u=e.autoDelete,l=void 0===u||u,d=e.isForced?"/forced":"",p={metaData:c,autoDelete:l?"DELETE":"NO_DELETE"},h={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/metadata/chatroom/").concat(s,"/user/").concat(a)+d,type:"PUT",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return B.debug("Call setChatRoomAttributes:",e),oe.call(this,h,f.SET_CHATROOM_ATTR).then((function(e){return Ct(e)}))}function Hs(e){var t;if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("string"!=typeof e.attributeKey||""===e.attributeKey)throw Error("Invalid parameter attributeKey: "+e.attributeKey);if("string"!=typeof e.attributeValue||""===e.attributeValue)throw Error("Invalid parameter attributeValue: "+e.attributeValue);var r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s=n.userId,c=e.chatRoomId,u=e.attributeKey,l=e.attributeValue,d=e.autoDelete,p=void 0===d||d,h=e.isForced?"/forced":"",m={metaData:(t={},t[u]=l,t),autoDelete:p?"DELETE":"NO_DELETE"},v={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/metadata/chatroom/").concat(c,"/user/").concat(s)+h,type:"PUT",dataType:"json",data:JSON.stringify(m),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return B.debug("Call setChatRoomAttribute:",e),oe.call(this,v,f.SET_CHATROOM_ATTR).then((function(e){var t=Nt(e);if(t)throw t}))}function Fs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if(!Array.isArray(e.attributeKeys))throw Error('"Invalid parameter attributes": '+e.attributeKeys);var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.userId,s=e.chatRoomId,c=e.attributeKeys,u=e.isForced?"/forced":"",l={keys:c},d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/metadata/chatroom/").concat(s,"/user/").concat(a)+u,type:"DELETE",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return B.debug("Call removeChatRoomAttributes:",e),oe.call(this,d,f.DELETE_CHATROOM_ATTR).then((function(e){return Ct(e)}))}function qs(e){if("string"!=typeof e.chatRoomId||""===e.chatRoomId)throw Error("Invalid parameter chatRoomId: "+e.chatRoomId);if("string"!=typeof e.attributeKey||""===e.attributeKey)throw Error('"Invalid parameter attributeKey": '+e.attributeKey);var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.userId,s=e.chatRoomId,c=e.attributeKey,u=e.isForced?"/forced":"",l={keys:[c]},d={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/metadata/chatroom/").concat(s,"/user/").concat(a)+u,type:"DELETE",dataType:"json",data:JSON.stringify(l),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return B.debug("Call removeChatRoomAttribute:",e),oe.call(this,d,f.DELETE_CHATROOM_ATTR).then((function(e){var t=Nt(e);if(t)throw t}))}function Ws(e){var t=this,r=e||{},n=r.pageNum,o=r.pageSize;if(isNaN(n)||n<=0)throw Error("Invalid parameter pageNum:".concat(n));if(isNaN(o)||o<=0)throw Error("Invalid parameter pageSize:".concat(o));var i=bt.call(this).error;if(i)return Promise.reject(i);var a={pagenum:n,pagesize:o,detail:!0},s=this.context,c=s.orgName,u=s.appName,l=s.accessToken,d={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(this.user,"/joined_chatrooms"),dataType:"json",type:"GET",data:a,headers:{Authorization:"Bearer "+l,"Content-Type":"application/json"}};return B.debug("Call getJoinedChatRooms",e),oe.call(this,d,f.GET_USER_JOINED_CHATROOM).then((function(e){var r=(e.data||[]).map((function(e){var r=e.id,n=e.title,o=e.owner,i=e.created,a=e.description,s=e.max_users;return{id:r,name:n,owner:o.split("".concat(t.appKey,"_"))[1],created:i,description:a,maxusers:s}}));return{type:e.type,data:r}}))}var zs=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},Ks=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function Vs(e){return zs(this,void 0,void 0,(function(){var t,r,n,o,i,a,s,c,u;return Ks(this,(function(l){switch(l.label){case 0:if("string"!=typeof e.description)throw Error('Invalid parameter: "description"');return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s=this.context.jid.clientResource,c={ext:e.description},u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/presence/").concat(s,"/1"),type:"POST",dataType:"json",data:JSON.stringify(c),headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:e.success,error:e.error},B.debug("Call publishPresence:",e),[4,oe.call(this,u)]);case 1:return l.sent(),[2]}}))}))}function Js(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');if("number"!=typeof e.expiry)throw Error('Invalid parameter: "expiry"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.userId,a=r.accessToken,s={usernames:e.usernames},c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(i,"/presence/").concat(e.expiry),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call subscribePresence:",e),oe.call(this,c).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}function Ys(e){return zs(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return Ks(this,(function(c){switch(c.label){case 0:if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.userId,a=r.accessToken,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(i,"/presence"),type:"DELETE",dataType:"json",data:JSON.stringify(e.usernames),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error},B.debug("Call unsubscribePresence:",e),[4,oe.call(this,s)]);case 1:return c.sent(),[2]}}))}))}function Xs(e){if("number"!=typeof e.pageNum||"number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageNum or pageSize"');if(e.pageNum<0||e.pageSize<0)throw Error('"pageNum" should >= 0 and "pageSize" should >= 0');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.userId,a=r.accessToken,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(i,"/presence/sublist?pageNum=").concat(e.pageNum,"&pageSize=").concat(e.pageSize),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getSubscribedPresenceList:",e),oe.call(this,s).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}var Qs=Xs;function $s(e){if(!Array.isArray(e.usernames))throw Error('Invalid parameter: "usernames"');if(!e.usernames.length)throw Error('"usernames" can not be empty');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={usernames:e.usernames},n=this.context,o=n.orgName,i=n.appName,a=n.userId,s=n.accessToken,c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/presence"),type:"POST",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getPresenceStatus:",e),oe.call(this,c).then((function(e){return e.data={result:null==e?void 0:e.result},e}))}function Zs(e){if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var t=e.options.paramType;if("number"!=typeof t||t<0||t>2)throw Error('Invalid parameter: "options of paramType"');if(0===t){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===t){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===t){var r=e.options,n=r.startTime,o=r.endTime;if(!(n instanceof Object&&Object.keys(n).length))throw Error('Invalid parameter: "options of startTime"');if("number"!=typeof n.hours||"number"!=typeof n.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of endTime"');if("number"!=typeof o.hours||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var i=bt.call(this).error;if(i)return Promise.reject(i);var a=this.context,s=a.accessToken,c=a.orgName,u=a.appName,l=a.userId,d=a.jid,p={};switch(t){case 0:p={type:e.options.remindType};break;case 1:p={ignoreDuration:e.options.duration};break;case 2:var h=e.options;n=h.startTime,o=h.endTime,p={ignoreInterval:"".concat(n.hours,":").concat(n.minutes,"-").concat(o.hours,":").concat(o.minutes)}}var f={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(l,"/notification/user/").concat(l,"?resource=").concat(d.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(p),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call setSilentModeForAll:",e),oe.call(this,f)}function ec(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification/user/").concat(a),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return B.debug("Call getSilentModeForAll:",e),oe.call(this,s)}function tc(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');if(!(e.options instanceof Object))throw Error('Invalid parameter: "options"');var t=e.options.paramType;if("number"!=typeof t||t<0||t>2)throw Error('Invalid parameter: "options of paramType"');if(0===t){if("string"!=typeof e.options.remindType)throw Error('Invalid parameter: "options of remindType"')}else if(1===t){if("number"!=typeof e.options.duration)throw Error('Invalid parameter: "options of duration"')}else if(2===t){var r=e.options,n=r.startTime,o=r.endTime;if(!(n instanceof Object&&Object.keys(n).length))throw Error('Invalid parameter: "options of startTime"');if("number"!=typeof n.hours||"number"!=typeof n.minutes)throw Error('Invalid parameter: "options of startTime of hours or minutes"');if(!(o instanceof Object&&Object.keys(o).length))throw Error('Invalid parameter: "options of endTime"');if("number"!=typeof o.hours||"number"!=typeof o.minutes)throw Error('Invalid parameter: "options of endTime of hours or minutes"')}var i=bt.call(this).error;if(i)return Promise.reject(i);var a=this.context,s=a.accessToken,c=a.orgName,u=a.appName,l=a.userId,d=a.jid,p="chatgroup",h={};switch(t){case 0:h={type:e.options.remindType};break;case 1:h={ignoreDuration:e.options.duration};break;case 2:var f=e.options;n=f.startTime,o=f.endTime,h={ignoreInterval:"".concat(n.hours,":").concat(n.minutes,"-").concat(o.hours,":").concat(o.minutes)}}"singleChat"===e.type&&(p="user");var m={url:"".concat(this.apiUrl,"/").concat(c,"/").concat(u,"/users/").concat(l,"/notification/").concat(p,"/").concat(e.conversationId,"?resource=").concat(d.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(h),headers:{Authorization:"Bearer "+s,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call setSilentModeForConversation:",e),oe.call(this,m)}function rc(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s=r.jid,c="chatgroup";"singleChat"===e.type&&(c="user");var u={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification/").concat(c,"/").concat(e.conversationId,"?resource=").concat(s.clientResource),type:"PUT",dataType:"json",data:JSON.stringify({type:"DEFAULT"}),headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call clearRemindTypeForConversation:",e),oe.call(this,u)}function nc(e){if("string"!=typeof e.conversationId||!e.conversationId)throw Error('Invalid parameter: "conversationId"');if("string"!=typeof e.type||!e.type)throw Error('Invalid parameter: "type"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s="chatgroup";"singleChat"===e.type&&(s="user");var c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification/").concat(s,"/").concat(e.conversationId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getSilentModeForConversation:",e),oe.call(this,c)}function oc(e){if(!Array.isArray(e.conversationList))throw Error('Invalid parameter: "conversationList"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s=[],c=[];e.conversationList.forEach((function(e){"singleChat"===e.type?s.push(e.id):c.push(e.id)}));var u=s.length?s.join(","):"",l=c.length?c.join(","):"",d={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification?user=").concat(u,"&group=").concat(l),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call getSilentModeForConversations:",e),oe.call(this,d)}function ic(e){if("string"!=typeof e.language||!e.language)throw Error('Invalid parameter: "language"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r={translationLanguage:e.language},n=this.context,o=n.accessToken,i=n.orgName,a=n.appName,s=n.userId,c={url:"".concat(this.apiUrl,"/").concat(i,"/").concat(a,"/users/").concat(s,"/notification/language"),type:"PUT",dataType:"json",data:JSON.stringify(r),headers:{Authorization:"Bearer "+o,"Content-Type":"application/json"},success:e.success,error:e.error};return B.debug("Call setPushPerformLanguage:",e),oe.call(this,c)}function ac(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification/language"),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"},success:null==e?void 0:e.success,error:null==e?void 0:e.error};return B.debug("Call getPushPerformLanguage:",e),oe.call(this,s)}function sc(e){var t=bt.call(this).error;if(t)return Promise.reject(t);if("number"!=typeof e.pageSize)throw Error('Invalid parameter: "pageSize"');var r=this.context,n=r.accessToken,o=r.orgName,i=r.appName,a=r.userId,s={limit:e.pageSize||10,cursor:e.cursor};e.cursor||delete s.cursor;var c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/users/").concat(a,"/notification/mute/type"),type:"GET",dataType:"json",data:s,headers:{Authorization:"Bearer "+n,"Content-Type":"application/json"}};return B.debug("Call getSilentModeRemindTypeConversations:",e),oe.call(this,c).then((function(e){return e.data?{data:{conversations:e.data.map((function(e){return"user"in e?{conversationId:e.user,type:"singleChat",remindType:e.value}:{conversationId:e.group,type:"groupChat",remindType:e.value}})),cursor:e.cursor},type:e.type}:e}))}var cc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},uc=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function lc(e){if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: ".concat(e.name));if("string"!=typeof e.messageId||""===e.messageId)throw Error("Invalid parameter messageId: ".concat(e.messageId));if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: ".concat(e.parentId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={name:e.name,msg_id:e.messageId,group_id:e.parentId,owner:this.user},c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread?resource=").concat(a.clientResource),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,c).then((function(e){var t=e.data.thread_id;return e.data={chatThreadId:t},e}))}function dc(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"/user/").concat(this.user,"/join?resource=").concat(a.clientResource),type:"POST",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,s).then((function(e){var t=e.data.detail;return t.messageId=t.msgId,t.parentId=t.groupId,delete t.msgId,delete t.groupId,e}))}function pc(e){return cc(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return uc(this,(function(c){switch(c.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"/user/").concat(this.user,"/quit?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,s)]);case 1:return c.sent(),[2]}}))}))}function hc(e){return cc(this,void 0,void 0,(function(){var t,r,n,o,i,a,s;return uc(this,(function(c){switch(c.label){case 0:if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));return(t=bt.call(this).error)?[2,Promise.reject(t)]:(r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}},[4,oe.call(this,s)]);case 1:return c.sent(),[2]}}))}))}function fc(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if("string"!=typeof e.name||""===e.name)throw Error("Invalid parameter name: ".concat(e.name));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={name:e.name},c={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"?resource=").concat(a.clientResource),type:"PUT",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,c)}function mc(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={limit:e.pageSize||20,cursor:e.cursor||""},s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"/users"),type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,s)}function vc(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));if("string"!=typeof e.username||""===e.username)throw Error("Invalid parameter username: ".concat(e.username));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a=r.jid,s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId,"/users/").concat(e.username,"?resource=").concat(a.clientResource),type:"DELETE",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,s)}function gc(e){var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={limit:e.pageSize||20,cursor:e.cursor||""},s={url:e.parentId?"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/threads/chatgroups/").concat(e.parentId,"/user/").concat(this.user):"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/threads/user/").concat(this.user),type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,s).then((function(e){var t=e.entities;return null==t||t.forEach((function(e){e.parentId=e.groupId,e.messageId=e.msgId,delete e.groupId,delete e.msgId})),e}))}function yc(e){if("string"!=typeof e.parentId||""===e.parentId)throw Error("Invalid parameter parentId: ".concat(e.parentId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={cursor:e.cursor||"",limit:e.pageSize||20},s={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/threads/chatgroups/").concat(e.parentId),type:"GET",dataType:"json",data:a,headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,s).then((function(e){var t=e.entities;return null==t||t.forEach((function(e){e.parentId=e.groupId,e.messageId=e.msgId,delete e.groupId,delete e.msgId})),e}))}function Ec(e){var t=this;if(!Array.isArray(e.chatThreadIds))throw Error("Invalid parameter chatThreadIds: ".concat(e.chatThreadIds));var r=bt.call(this).error;if(r)return Promise.reject(r);var n=this.context,o=n.orgName,i=n.appName,a=n.accessToken,s={threadIds:e.chatThreadIds},c={url:"".concat(this.apiUrl,"/").concat(o,"/").concat(i,"/thread/message"),type:"POST",dataType:"json",data:JSON.stringify(s),headers:{Authorization:"Bearer "+a,"Content-Type":"application/json"}};return oe.call(this,c).then((function(e){return _c.call(t,e)}))}function _c(e){var t=this,r=e.entities;return null==r||r.forEach((function(e){e.chatThreadId=e.thread_id,e.last_message&&"{}"!==JSON.stringify(e.last_message)?e.lastMessage=Se.call(t,e.last_message):e.lastMessage=e.last_message,delete e.thread_id,delete e.last_message})),e}function Tc(e){if("string"!=typeof e.chatThreadId||""===e.chatThreadId)throw Error("Invalid parameter chatThreadId: ".concat(e.chatThreadId));var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a={url:"".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/thread/").concat(e.chatThreadId),type:"GET",dataType:"json",headers:{Authorization:"Bearer "+i,"Content-Type":"application/json"}};return oe.call(this,a).then((function(e){return e.data.affiliationsCount=e.data.affiliations_count,e.data.messageId=e.data.msgId,e.data.parentId=e.data.groupId,delete e.data.affiliations_count,delete e.data.msgId,delete e.data.groupId,e}))}function Ic(){var e=bt.call(this).error;if(e)return Promise.reject(e);var t=this.context,r=t.orgName,n=t.appName,o=t.accessToken,i={url:"".concat(this.apiUrl,"/").concat(r,"/").concat(n,"/users/").concat(this.user,"/translate/support/language"),dataType:"json",type:"GET",headers:{Authorization:"Bearer "+o}};return B.debug("Call getSupportedLanguages"),oe.call(this,i)}function Oc(e){if("string"!=typeof e.text||""===e.text)throw Error('Invalid parameter: "text"');if(!Array.isArray(e.languages))throw Error('Invalid parameter: "language"');var t=bt.call(this).error;if(t)return Promise.reject(t);var r=this.context,n=r.orgName,o=r.appName,i=r.accessToken,a="".concat(this.apiUrl,"/").concat(n,"/").concat(o,"/users/").concat(this.user,"/translate"),s={text:e.text,to:e.languages},c={url:a,dataType:"json",type:"POST",data:JSON.stringify(s),headers:{Authorization:"Bearer "+i}};return B.debug("Call translateMessage"),oe.call(this,c)}__webpack_require__(2480);var Rc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},Sc=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}};function bc(e){return Rc(this,void 0,void 0,(function(){return Sc(this,(function(t){return[2,Qt(e)]}))}))}var Cc=new(function(){function e(){}return e.prototype.getImageInfo=function(e){return Rc(this,void 0,void 0,(function(){return Sc(this,(function(t){return"string"==typeof e?[2,this._getImageInfoFromUrl(e)]:[2,this._getImageInfoFromFile(e)]}))}))},e.prototype._getImageInfoFromFile=function(e){return new Promise((function(t,r){var n=URL.createObjectURL(e),o=new Image;o.onload=function(){URL.revokeObjectURL(n),t({width:o.width,height:o.height,type:e.type})},o.onerror=function(){URL.revokeObjectURL(n),r(new Error("Failed to load image"))},o.src=n}))},e.prototype._getImageInfoFromUrl=function(e){return new Promise((function(t,r){var n=new Image;n.onload=function(){return t({width:n.width,height:n.height})},n.onerror=function(){return r(new Error("Failed to load image from URL"))},n.src=e}))},e.prototype.generateBigImage=function(e,t){return Rc(this,void 0,void 0,(function(){var r,n,o,i,a,s,c,u,l;return Sc(this,(function(d){switch(d.label){case 0:if("string"==typeof e)throw new Error("Web image processor requires File input for compression");return[4,this.getImageInfo(e)];case 1:return r=d.sent(),(n=Jt(r.width,r.height,t.maxShortEdge)).width===r.width&&n.height===r.height?[2,null]:"function"!=typeof createImageBitmap?[3,3]:[4,createImageBitmap(e)];case 2:return i=d.sent(),[3,5];case 3:return[4,this._loadImage(e)];case 4:i=d.sent(),d.label=5;case 5:if(o=i,a=void 0!==globalThis.OffscreenCanvas?new globalThis.OffscreenCanvas(n.width,n.height):this._createCanvas(n.width,n.height),!(s=a.getContext("2d")))throw new Error("Failed to get canvas context");return s.drawImage(o,0,0,n.width,n.height),c="image/png"===e.type?"image/png":"image/webp"===e.type?"image/webp":"image/jpeg",[4,this._canvasToBlob(a,c,t.quality)];case 6:return u=d.sent(),[2,{file:l=new File([u],e.name||"compressed.jpg",{type:c}),width:n.width,height:n.height,size:l.size,type:c}]}}))}))},e.prototype.computeMd5=function(e){return Rc(this,void 0,void 0,(function(){return Sc(this,(function(t){switch(t.label){case 0:if("string"==typeof e)throw new Error("Web image processor requires File input for MD5");return[4,e.arrayBuffer()];case 1:return[2,bc(t.sent())]}}))}))},e.prototype._loadImage=function(e){return new Promise((function(t,r){var n=URL.createObjectURL(e),o=new Image;o.onload=function(){URL.revokeObjectURL(n),t(o)},o.onerror=function(){URL.revokeObjectURL(n),r(new Error("Failed to load image"))},o.src=n}))},e.prototype._createCanvas=function(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r},e.prototype._canvasToBlob=function(e,t,r){return"convertToBlob"in e?e.convertToBlob({type:t,quality:r}):new Promise((function(n,o){e.toBlob((function(e){return e?n(e):o(new Error("toBlob failed"))}),t,r)}))},e}());function Nc(e){return Nc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nc(e)}__webpack_require__(1761);var Ac=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},Mc=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},wc=function(){function e(e){this._pathCache=new Map,this.runtime=e}return e.prototype.getImageInfo=function(e){return"string"!=typeof e?Promise.reject(new Error("MiniApp image processor requires file path string")):this._loadImageInfo(e)},e.prototype.generateBigImage=function(e,t){return Ac(this,void 0,void 0,(function(){var r,n,o,i,a,s,c;return Mc(this,(function(u){switch(u.label){case 0:return"string"!=typeof e?[2,Promise.reject(new Error("MiniApp image processor requires file path string"))]:this.runtime.compressImage?[4,this._loadImageInfo(e)]:[2,Promise.reject(new Error("Platform missing compressImage capability"))];case 1:return r=u.sent(),(n=r.path||e)!==e&&B.debug("Miniapp image path normalized before compress",e,n),(o=Jt(r.width,r.height,t.maxShortEdge)).width===r.width&&o.height===r.height?[2,null]:(i=this.runtime.compressImage,[4,new Promise((function(e,r){i({src:n,quality:Math.round(100*t.quality),compressedWidth:o.width,compressedHeight:o.height,success:function(t){return e(t.tempFilePath)},fail:r})}))]);case 2:return a=u.sent(),B.debug("Miniapp compressImage temp path",a),[4,this._normalizeLocalPath(a)];case 3:return s=u.sent(),[4,this._getFileSize(s)];case 4:return c=u.sent(),[2,{path:s,width:o.width,height:o.height,size:c,type:"image/jpeg"}]}}))}))},e.prototype.computeMd5=function(e){var t,r;return Ac(this,void 0,void 0,(function(){var n,o;return Mc(this,(function(i){switch(i.label){case 0:return"string"!=typeof e?[2,Promise.reject(new Error("MiniApp image processor requires file path string"))]:(n=null===(r=(t=this.runtime).getFileSystemManager)||void 0===r?void 0:r.call(t))?[4,this._normalizeLocalPath(e)]:[2,Promise.reject(new Error("Platform missing getFileSystemManager capability"))];case 1:return o=i.sent(),[4,new Promise((function(e,t){n.readFile({filePath:o,success:function(t){return e(t.data)},fail:t})}))];case 2:return[2,Qt(i.sent())]}}))}))},e.prototype._getFileSize=function(e){var t,r;return Ac(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,l,d,p;return Mc(this,(function(h){switch(h.label){case 0:return(n=null===(r=(t=this.runtime).getFileSystemManager)||void 0===r?void 0:r.call(t))?[4,this._normalizeLocalPath(e)]:(B.warn("Miniapp getFileSize: no FileSystemManager available"),[2,0]);case 1:o=h.sent(),B.debug("Miniapp getFileSize paths","original: ".concat(e),"normalized: ".concat(o)),i=function(e){var t,r;return Mc(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,new Promise((function(t,r){n.getFileInfo({filePath:e,success:function(e){return t(e.size)},fail:r})}))];case 1:return(t=o.sent())>0?(B.debug("Miniapp getFileSize success via getFileInfo","path: ".concat(e,", size: ").concat(t)),[2,{value:t}]):[3,3];case 2:return r=o.sent(),B.debug("Miniapp getFileInfo failed for path",e,r),[3,3];case 3:return[2]}}))},a=0,s=o!==e?[o,e]:[e],h.label=2;case 2:return a<s.length?(c=s[a],[5,i(c)]):[3,5];case 3:if("object"===Nc(u=h.sent()))return[2,u.value];h.label=4;case 4:return a++,[3,2];case 5:return h.trys.push([5,7,,8]),[4,new Promise((function(e,t){n.readFile({filePath:o,success:function(t){return e(t.data)},fail:t})}))];case 6:return l=h.sent(),d=l.byteLength,B.debug("Miniapp getFileSize fallback via readFile","size: ".concat(d)),[2,d];case 7:return p=h.sent(),B.warn("Miniapp getFileSize: all methods failed","path: ".concat(e),p),[2,0];case 8:return[2]}}))}))},e.prototype._loadImageInfo=function(e){var t=this;return new Promise((function(r,n){t.runtime.getImageInfo({src:e,success:function(e){return r({width:e.width,height:e.height,type:e.type,path:e.path})},fail:n})}))},e.prototype._normalizeLocalPath=function(e){return Ac(this,void 0,void 0,(function(){var t,r,n;return Mc(this,(function(o){switch(o.label){case 0:return/^https?:\/\/tmp\//i.test(e)?(t=this._pathCache.get(e))?[2,t]:[4,this._loadImageInfo(e)]:[2,e];case 1:return r=o.sent(),n=r.path||e,/^https?:\/\/tmp\//i.test(n)?[4,this._materializeTempPath(n)]:[3,3];case 2:n=o.sent(),o.label=3;case 3:return this._pathCache.set(e,n),B.debug("Miniapp image path normalization result",e,n),[2,n]}}))}))},e.prototype._materializeTempPath=function(e){var t,r,n;return Ac(this,void 0,void 0,(function(){var o,i,a,s,c,u;return Mc(this,(function(l){switch(l.label){case 0:if(!(null==(o=null===(r=(t=this.runtime).getFileSystemManager)||void 0===r?void 0:r.call(t))?void 0:o.saveFile)||!(null===(n=this.runtime.env)||void 0===n?void 0:n.USER_DATA_PATH))return[2,e];i=e.match(/(\.[a-zA-Z0-9]+)(?:\?.*)?$/),a=i?i[1]:"",s="".concat(this.runtime.env.USER_DATA_PATH,"/em-image-").concat(Date.now(),"-").concat(Math.random().toString(36).slice(2)).concat(a),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,new Promise((function(t,r){var n;null===(n=o.saveFile)||void 0===n||n.call(o,{tempFilePath:e,filePath:s,success:function(e){return t(e.savedFilePath||s)},fail:r})}))];case 2:return c=l.sent(),B.debug("Miniapp temp image materialized to user data path",e,c),[2,c];case 3:return u=l.sent(),B.warn("Miniapp saveFile failed while materializing temp image path",u),[2,e];case 4:return[2]}}))}))},e}();function Uc(e){return Uc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Uc(e)}var Lc=function(){return Lc=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Lc.apply(this,arguments)},Pc=function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{c(n.next(e))}catch(e){i(e)}}function s(e){try{c(n.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}c((n=n.apply(e,t||[])).next())}))},xc=function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},kc=ye.getEnvInfo(),Dc=function(){function c(s){var u,l=this;this.name="connection",this.appKey="",this.dnsTotal=0,this.max_cache_length=100,this._compressorFailureCount=0,this._reportLogs=!1,this._reportInterval=z,this._isLogging=!1,this._initWithAppId=!1,this.uikitVersion="",this.lastHeartbeat=Date.now(),this.isDebug=s.isDebug||!1,this.isReport=!1,this.uploadPartEnable=!0,this.isHttpDNS=void 0===s.isHttpDNS||s.isHttpDNS,this.heartBeatWait=s.heartBeatWait||3e4,this.autoReconnectNumMax=s.autoReconnectNumMax||5,this.refreshDNSIntervals=this.autoReconnectNumMax<5?this.autoReconnectNumMax:5,this.delivery=s.delivery||!1,this.disconnectedReason=void 0,this.loginInfoCustomExt=void 0,this.https=ye.isUseHttps(s.https),this.dnsArr=["https://rs.easemob.com","https://rs.chat.agora.io","http://59.110.89.59","http://39.97.193.190","http://39.97.193.187"].filter((function(e){return e.startsWith(l.https?"https":"")})),this.dnsIndex=0,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.dnsTotal=this.dnsArr.length,"appKey"in s&&(this.appKey=s.appKey),"appId"in s&&(this.appId=s.appId,this._initWithAppId=!0),this.appName="",this.orgName="",this.token="",this.grantType="",this.apiUrl=s.apiUrl||"",this.url=s.url||"",this.version="4.24.1",this.deviceId=s.deviceId||"webim",this.isFixedDeviceId=null===(u=s.isFixedDeviceId)||void 0===u||u,this.osType=16,this.useOwnUploadFun=s.useOwnUploadFun||!1;var d=ye.getEnvInfo(),p=d.global;if(this._imageProcessor=d.platform===ce.WEB?Cc:(null==p?void 0:p.getImageInfo)?function(e){return new wc(e)}(p):null,this.isAutoLogin=s.isAutoLogin||!1,this.compressType=[0],this.encryptType=[0],this.clientResource="",this.expiresIn=0,this.expirationTime=0,this.useReplacedMessageContents=s.useReplacedMessageContents||!1,this.logOut=!0,this.context={jid:{appKey:"",clientResource:"",domain:"easemob.com",name:""},userId:"",appKey:"",appId:"",status:0,restTokenData:"",appName:"",orgName:"",root:{},accessToken:""},this._msgHash={},this._msgPromiseHash={},this._queues=[],this._load_msg_cache=[],this.unMSyncSendMsgMap=new Map,this.mr_cache={},this.reconnecting=!1,this._offlineMessagePullState=ve.SYNC_INIT,this._offlineMessagePullQueue=[],this.uniPushConfig={},this.uniPush=null,this.isRegisterPush=!1,this.pushCertificateName="",this._compressor=null,void 0!==s.customOSPlatform){if("number"!=typeof s.customOSPlatform||s.customOSPlatform<1||s.customOSPlatform>100)throw Error("Invalid customOSPlatform: ".concat(s.customOSPlatform));this.customOSPlatform=s.customOSPlatform,this.deviceId=s.customDeviceName||this.deviceId}if(this._initWithAppId){if(this.appKey="","string"!=typeof this.appId||!this.appId)throw Error("Invalid appId: ".concat(this.appId))}else{if("string"!=typeof this.appKey||2!==this.appKey.split("#").length)throw Error("Invalid appKey: ".concat(this.appKey));this.devInfos=this.appKey.split("#"),this.orgName=this.devInfos[0],this.appName=this.devInfos[1]}this.listen=sn.bind(this),this.mSync=this.usePlugin(rn),this.eventHandler=this.usePlugin(on),Object.assign(c.prototype,e),Object.assign(c.prototype,t),Object.assign(c.prototype,r),Object.assign(c.prototype,n),Object.assign(c.prototype,o),Object.assign(c.prototype,i),Object.assign(c.prototype,a),this.dataReport=new In({appkey:this.appKey||"default#appkey",org:this.orgName,sdkVersion:this.version,deviceId:this.deviceId,isReport:this.isReport,uikitVersion:s.uikitVersion||""});var h=0,f=this;if(Object.defineProperty(ye,"ajaxUnconventionalErrorTimes",{set:function(e){0!==e&&(B.debug("rest api request fail times: ".concat(e)),(h=e)%5==0&&f.isHttpDNS&&(B.debug("refresh dns config when rest request fail."),Yc.call(f,(function(){})).catch((function(e){B.error("refresh dns config error",e)}))))},get:function(){return h}}),this.isFixedDeviceId){var m=ye.getLocalDeviceInfo();m&&(this.clientResource=JSON.parse(m).deviceId)}B.debug("init SDK: Conn ".concat(this.version," ").concat(kc.platform))}return c.prototype.usePlugin=function(e,t){if("push"!==t)return t?void(this[t]=new e(this)):new e(this);e.config&&e.emPush?(this.uniPushConfig=e.config,this.uniPush=e.emPush):B.error("use push plugin failed","emPush",this.uniPush,"config",this.uniPushConfig)},c.prototype.listen=function(e){},c.prototype.addEventHandler=function(e,t){},c.prototype.removeEventHandler=function(e){},c.prototype.registerUser=function(e){return Pc(this,void 0,void 0,(function(){var t,r;return xc(this,(function(n){switch(n.label){case 0:if(!e.username||!e.password)throw Error("Invalid parameter");n.label=1;case 1:return n.trys.push([1,5,,6]),t=this.dataReport.geOperateFun({uid:e.username,operationName:f.REGISTER}),this.isHttpDNS?(this.dnsIndex=0,[4,Yc.call(this,t)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[4,jc.call(this,e,{rpt:t})];case 4:return[2,n.sent()];case 5:throw r=n.sent(),e.error&&e.error(r),r;case 6:return[2]}}))}))},c.prototype.open=function(e){var t;return Pc(this,void 0,void 0,(function(){var r,n,o,i,a,c;return xc(this,(function(u){switch(u.label){case 0:if(B.debug("open",e.user,"isLogout:",this.logOut),this._isLogging)throw n=p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:"Currently logging in, please wait."});if(!this.logOut)throw n=p.create({type:s.WEBIM_USER_ALREADY_LOGIN,message:"The user has logged in."});this.retryConnectTimes=0,this._isLogging=!0,u.label=1;case 1:if(u.trys.push([1,6,7,8]),"web"===kc.platform&&(r=ye.detectBrowser(),B.info("browser",r)),n=Kc.call(this,e))throw null===(t=this.onError)||void 0===t||t.call(this,n),n;return e.accessToken&&(this.token=e.accessToken),o=Lc({},e),i=this.dataReport.geOperateFun({uid:e.user,operationName:f.LOGIN}),this.dnsIndex=0,this.isHttpDNS?[4,Yc.call(this,i)]:[3,3];case 2:u.sent(),u.label=3;case 3:return B.initReport({report:this._reportLogs,reportInterval:this._reportInterval,connection:this}),[4,Hc.call(this,o,{rpt:i})];case 4:return a=u.sent(),[4,Wc.call(this,i)];case 5:return u.sent(),B.debug("grantType",this.grantType),ye.listenNetwork(Fc.bind(this),qc.bind(this)),ye.listenBrowserVisibility((function(){B.debug("visibility: true")}),(function(){B.debug("visibility: false")})),[2,a];case 6:throw c=u.sent(),this._isLogging=!1,e.error&&e.error(c),B.error("login failed",c),c;case 7:return B.reportLog(),[7];case 8:return[2]}}))}))},c.prototype.isOpened=function(){return this.sock&&1===this.sock.readyState||!1},c.prototype.close=function(e){var t,r,n,o;void 0===e&&(e="inner:logout"),B.debug("call close"),B._stopReportLogs(),this.logOut=!0,this.disconnectedReason=void 0,this.reconnecting=!1,this.context.status=s.STATUS_CLOSING,e&&(null==e?void 0:e.startsWith("inner"))&&this.sendLogout(e),this.sock&&this.sock.close(),null===(t=this.unMSyncSendMsgMap)||void 0===t||t.clear(),this.stopHeartBeat(),this.rejectMessage(),this.context.status=s.STATUS_CLOSED,this._load_msg_cache=[],this._queues=[],this._msgHash={},this.mr_cache={},this.token="",this.context.accessToken="",this.isRegisterPush=!1,this.clearTokenTimeout(),null===(n=null===(r=null==this?void 0:this._localCache)||void 0===r?void 0:r.getInstance())||void 0===n||n.close(),this.connectionTimer&&clearTimeout(this.connectionTimer),this.provisionTimer&&clearTimeout(this.provisionTimer),this.probingTimer&&clearTimeout(this.probingTimer),null===(o=this._compressor)||void 0===o||o.shrink(),this._compressor=null,this._compressorFailureCount=0,Ue.clearAll()},c.prototype.downloadAndParseCombineMessage=function(e){var t=this,r=e.url,n=e.secret;return new Promise((function(e,o){var i,a,c=ye.getEnvInfo(),u="web"!==c.platform&&"node"!==c.platform&&"quick_app"!==c.platform&&(null===(a=null===(i=c.global)||void 0===i?void 0:i.canIUse)||void 0===a?void 0:a.call(i,"getFileSystemManager")),l=function(r){var n=function(e){o({type:s.PARSE_FILE_ERROR,message:"Read file failed",data:e})},i=function(r){return Pc(t,void 0,void 0,(function(){var t,n,i,a,c,l,d,p,h,f,m,v,g;return xc(this,(function(y){switch(y.label){case 0:for(t=u?new Uint8Array(r.data):new Uint8Array(r.target.result),n=0,i=0,a=2,c=t.subarray(n,n+a),l=ye.Uint8ArrayToString(c),B.debug("file header:",l),i+=a,d=0,p=2;p<t.length-1;p++)p%2==1&&(d^=t[p]);if(h=t.subarray(t.length-1,t.length),B.debug("checkResult:",d,h[0]===d),h[0]!==d)return[2,o({type:s.PARSE_FILE_ERROR,message:"File verification failed"})];if("cm"!==l)return[3,7];y.label=1;case 1:y.trys.push([1,5,,6]),f=[],m=function(){var e,r,o,s;return xc(this,(function(c){switch(c.label){case 0:return n+=a,i+=a=4,e=t.subarray(n,n+a),n+=a,a=e.reduce((function(t,r,n){return t+(r<<8*(e.length-n-1))}),0),i+=a,r=t.subarray(n,n+a),o=(o=v.root.lookup("easemob.pb.Meta")).decode(r),[4,ct.call(v,o,0,!0,!0)];case 1:return s=c.sent(),f.push(s),[2]}}))},v=this,y.label=2;case 2:return i<t.length-1?[5,m()]:[3,4];case 3:return y.sent(),[3,2];case 4:return[2,e(f)];case 5:return g=y.sent(),o({type:s.PARSE_FILE_ERROR,message:"Parse file failed",data:g}),[3,6];case 6:return[3,8];case 7:return[2,o({type:s.PARSE_FILE_ERROR,message:"File verification failed"})];case 8:return[2]}}))}))};if(u){var a=c.global.getFileSystemManager(),l=r.tempFilePath;a.readFile({filePath:l,success:i,fail:n})}else if(r instanceof Blob){var d=new FileReader;d.readAsArrayBuffer(r),d.onerror=n,d.onload=i}},d=function(e){o({type:s.WEBIM_DOWNLOADFILE_ERROR,message:"Download failed, please try again",data:e})};u?c.global.downloadFile({url:r,success:l,fail:d}):ye.download.call(t,{url:r,headers:{Accept:"application/json"},onFileDownloadComplete:l,onFileDownloadError:d,secret:n,accessToken:t.context.accessToken})}))},c.prototype.getChatFilesUrl=function(){return"".concat(this.apiUrl,"/").concat(this.orgName,"/").concat(this.appName,"/chatfiles")},c.prototype.stopHeartBeat=function(){clearInterval(this.heartBeatID)},c.prototype.clear=function(){this.restTotal=0,this.restIndex=0,this.hostIndex=0,this.hostTotal=0},c.prototype.heartBeat=function(){},c.prototype.renewToken=function(e){var t=this,r=this.isOpened();return B.debug("isOpened",r),r?this.getTokenExpireTimestamp(e).then((function(r){var n=r.expire_timestamp,o=Date.now();return t.expirationTime=n,t.expiresIn=n-o,t.token=e,t.context.accessToken=e,t.clearTokenTimeout(),t.tokenExpireTimeCountDown(t.expiresIn),{status:!0,token:e,expire:n}})):Promise.reject({status:!1})},c.prototype.clearTokenTimeout=function(){B.info("clearTokenTimeout"),this.tokenWillExpireTimer&&clearTimeout(this.tokenWillExpireTimer),this.tokenExpiredTimer&&clearTimeout(this.tokenExpiredTimer),this.tokenWillExpireTimer=null,this.tokenExpiredTimer=null},c.prototype.tokenExpireTimeCountDown=function(e){var t=this;B.info("tokenExpireTimeCountDown",e),e>Math.pow(2,31)-1&&(e=Math.pow(2,31)-1),this.tokenWillExpireTimer=setTimeout((function(){var r;t.onTokenWillExpire&&t.onTokenWillExpire(),null===(r=t.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),B.info("onTokenWillExpire",Math.floor(e-e/5))}),e-e/5),this.tokenExpiredTimer=setTimeout((function(){var e;B.info("onTokenExpired",0),t.onTokenExpired&&t.onTokenExpired(),null===(e=t.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),t.close("inner:token expired")}),e)},c.prototype.compareTokenExpireTime=function(e,t){var r,n=Number(t)-Number(e);B.debug("compareTokenExpireTime",n),n<=this.expiresIn/5&&n>0?(this.onTokenWillExpire&&this.onTokenWillExpire(),null===(r=this.eventHandler)||void 0===r||r.dispatch("onTokenWillExpire"),B.info("onTokenWillExpire",n)):n<=0&&(this.closeByTokenExpired(),B.info("closeByTokenExpired",n))},c.prototype.closeByTokenExpired=function(){var e;B.info("closed By TokenExpired"),this.onTokenExpired&&this.onTokenExpired(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onTokenExpired"),this.close("inner:token expired")},c.prototype.rejectMessage=function(){var e=this,t=Object.keys(this._msgHash);if(t.length>0){var r=p.create({type:s.MESSAGE_WEBSOCKET_DISCONNECTED,message:"websocket disconnected"});t.forEach((function(t){var n,o,i;(null===(n=e.unMSyncSendMsgMap)||void 0===n?void 0:n.has(t))||(e._msgHash[t].reject instanceof Function&&e._msgHash[t].reject(r),null===(i=null===(o=e._localCache)||void 0===o?void 0:o.getInstance())||void 0===i||i.updateLocalMessage(t,{serverMsgId:t,status:Pe.FAIL}),e._msgHash[t].fail instanceof Function&&e._msgHash[t].fail(r),e._msgHash[t].messageTimer&&clearTimeout(e._msgHash[t].messageTimer),delete e._msgHash[t])}))}},c.prototype.resetConnState=function(){this.mSync.stopHeartBeat(),this.times=1,this.autoReconnectNumTotal=0,this.hostIndex=0},c.prototype.reconnect=function(e){var t,r=this;if(this.logout)return B.warn("The user has already logged out when reconnecting");if(B.debug("socket reconnect readyState",this.sock.readyState),(0!==this.sock.readyState||e)&&(1!==this.sock.readyState||e)){B.info("reconnect: time",this.times),B.info("reconnect sock.readyState: ",this.sock.readyState),!1===this.reconnecting&&(this.reconnecting=!0),null===(t=this.eventHandler)||void 0===t||t.dispatch("onReconnecting"),this.rejectMessage(),this.isHttpDNS&&(this.hostIndex<this.socketHost.length-1?this.hostIndex++:this.hostIndex=this.socketHost.length-1);var n=1e3*ye.getRetryDelay(this.times);B.info("reconnect delay: ",n),setTimeout((function(){(1!==r.sock.readyState||e)&&(B.info("login sock.readyState: ",r.sock.readyState),r.sock.close(),zc.call(r).catch((function(e){B.error("reconnect websocket failed",e)})),r.times++)}),n),this.autoReconnectNumTotal++}},c.prototype.send=function(e){return Promise.resolve(null)},c.prototype.setLoginInfoCustomExt=function(e){if(B.debug("setLoginInfoCustomExt","params:",e),e){if("string"!=typeof e)throw new Error("ext must be a string");if(e.length>1024)throw new Error("ext length must be less than 1024")}this.loginInfoCustomExt=e},c.prototype.onShow=function(){var e=this;B.debug("execute onshow callback",this.lastHeartbeat),!this.logOut&&!this.reconnecting&&Date.now()-this.lastHeartbeat>2e3&&(B.debug("send ping"),this.mSync.sendUnreadDeal(),this.probingTimer&&clearTimeout(this.probingTimer),this.probingTimer=setTimeout((function(){B.error("Websocket connection timeout"),e.logOut||e.reconnecting||e.reconnect(!0)}),8e3))},c.prototype.sendLogout=function(e){void 0===e&&(e="logout");try{var t=this.mSync.generateLogout(e),r=Vt.call(this,t),n=r[0];if(r[1]){var o=this._getSock?this.mSync.base64transform(n):n;this.sock&&1===this.sock.readyState&&this.sock.send(o)}}catch(e){B.error("sendLogout failed",e)}},c._getSock=function(){},c}();function Bc(e,t){var r=t.rpt,n=t.isRetry,o=this.apiUrl+"/"+this.orgName+"/"+this.appName+"/users",i={requestName:m.RESISTER,requestUrl:o},a={headers:{"Content-Type":"application/json"},url:o,dataType:"json",data:JSON.stringify({username:e.username,password:e.password,nickname:e.nickname||""})};return ye.ajax(a,f.SDK_INTERNAL).then((function(e){var t=Lc(Lc({},e),{type:s.REQUEST_SUCCESS}),o=e.extraInfo,a=o.httpCode,c=o.elapse;return r({isEndApi:!0,isRetry:n,data:Lc(Lc({},{requestElapse:c,isSuccess:1,code:a}),i)}),t})).catch((function(e){var t=e.extraInfo,o=t.elapse,a=t.httpCode,s=t.errDesc;throw r({isRetry:n,data:Lc(Lc({},{requestElapse:o,isSuccess:0,code:a,codeDesc:s}),i)}),e}))}function jc(e,t){return Pc(this,void 0,void 0,(function(){var r,n;return xc(this,(function(o){switch(o.label){case 0:r=t.rpt,o.label=1;case 1:return o.trys.push([1,3,,7]),[4,Bc.call(this,e,t)];case 2:return[2,o.sent()];case 3:return!((n=o.sent()).message.includes("Open registration doesn't allow")||n.message.includes("username be unique")||n.message.includes("is not legal"))&&this.isHttpDNS&&this.restIndex+1<this.restTotal?(this.restIndex++,Qc.call(this),[4,jc.call(this,e,{rpt:r})]):[3,5];case 4:return[2,o.sent()];case 5:throw B.error("retry signup failed",n),r({data:{isLastApi:1,isSuccess:0}}),n;case 6:return[3,7];case 7:return[2]}}))}))}function Gc(e,t){var r;return Pc(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,l,d,p=this;return xc(this,(function(h){switch(h.label){case 0:if(n=Kc.call(this,e))throw n;return B.debug("socket readyState",null===(r=this.sock)||void 0===r?void 0:r.readyState),o=t.rpt,i=t.isRetry,Vc.call(this,e),this.user=e.user,a=this.context.appName,s=this.context.orgName,c=this.apiUrl+"/"+s+"/"+a+"/token",e.accessToken?(B.debug("login with accessToken"),this.grantType="accessToken",this.token=e.accessToken,this.context.accessToken=e.accessToken,this.context.restTokenData=e.accessToken,[2,{accessToken:e.accessToken}]):[3,1];case 1:return e.agoraToken?(B.info("login with agoraToken"),this.grantType="agoraToken",this.token=e.agoraToken,this.context.accessToken=e.agoraToken,this.context.restTokenData=e.agoraToken,[2,{accessToken:e.agoraToken}]):[3,2];case 2:return B.info("login with password"),this.grantType="password",u={grant_type:"password",username:e.user,password:e.pwd,timestamp:+new Date},l=JSON.stringify(u),d={headers:{"Content-Type":"application/json"},url:c,dataType:"json",data:l,version:this.version},B.debug("start get token"),[4,ye.ajax(d,f.SDK_INTERNAL).then((function(e){B.debug("get token success"),p.token=e.access_token,p.context.restTokenData=e.access_token,p.context.accessToken=e.access_token,p.expiresIn=e.expires_in;var t=e.extraInfo,r=t.httpCode,n=t.elapse,a={requestName:m.LOGIN_BY_PWD,requestElapse:n,requestUrl:c,isSuccess:1,code:r};return o({isRetry:i,data:a}),{accessToken:e.access_token,duration:e.expires_in}})).catch((function(e){B.error("get token failed",e);var t=e.extraInfo,r=t.elapse,n=t.httpCode,a=t.errDesc,s={requestName:m.LOGIN_BY_PWD,requestElapse:r,requestUrl:c,isSuccess:0,code:n,codeDesc:a};throw o({isRetry:i,data:s}),e}))];case 3:return[2,h.sent()]}}))}))}function Hc(e,t){var r;return Pc(this,void 0,void 0,(function(){var n,o,i;return xc(this,(function(a){switch(a.label){case 0:n=t.rpt,a.label=1;case 1:return a.trys.push([1,3,,7]),[4,Gc.call(this,e,t)];case 2:return[2,a.sent()];case 3:return"invalid password"!==(o=a.sent()).message&&"user not found"!==o.message&&this.isHttpDNS&&this.restIndex+1<this.restTotal?(this.restIndex++,Qc.call(this),[4,Hc.call(this,e,{rpt:n,isRetry:!0})]):[3,5];case 4:return[2,a.sent()];case 5:throw B.error("retry login failed",o),n({data:{isLastApi:1,isSuccess:0}}),this.clear(),i=void 0,o.error&&o.error_description?(i=p.create({type:s.WEBIM_CONNCTION_OPEN_USERGRID_ERROR,message:o.error_description,data:o}),this.onError&&this.onError(i),i):(i=p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:null!==(r=o.message)&&void 0!==r?r:"login failed",data:o}),this.onError&&this.onError(i),i);case 6:return[3,7];case 7:return[2]}}))}))}function Fc(){var e;B.debug("online"),this.onOnline&&this.onOnline(),null===(e=this.eventHandler)||void 0===e||e.dispatch("onOnline"),this.sock&&1!==this.sock.readyState&&(B.debug("sock.readyState:",this.sock.readyState),this.logOut||this.reconnecting||this.reconnect())}function qc(){var e,t;B.debug("offline"),null===(e=this.sock)||void 0===e||e.close(),this.onOffline&&this.onOffline(),null===(t=this.eventHandler)||void 0===t||t.dispatch("onOffline")}function Wc(e){var t,r,n;return Pc(this,void 0,void 0,(function(){var o,i,a,c;return xc(this,(function(u){switch(u.label){case 0:o=(new Date).getTime(),u.label=1;case 1:return u.trys.push([1,3,,7]),[4,zc.call(this,e)];case 2:return i=u.sent(),e&&e({data:{isLastApi:1,isSuccess:1,accessChannel:null===(t=this.socketHost[this.hostIndex])||void 0===t?void 0:t.channel}}),[2,i];case 3:if(a=u.sent(),B.error("connect to msync failed times:",this.retryConnectTimes,a),K.includes(a.type))throw e&&e({data:{isLastApi:1,isSuccess:0,accessChannel:null===(r=this.socketHost[this.hostIndex])||void 0===r?void 0:r.channel,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||a.message}}),a;return this.retryConnectTimes++,this.retryConnectTimes<3?(this.isHttpDNS&&(this.hostIndex<this.socketHost.length-1?this.hostIndex++:this.hostIndex=this.socketHost.length-1,Xc.call(this)),a.type===s.REQUEST_TIMEOUT&&"provision timeout"===a.message||(c=(new Date).getTime()-o,null==e||e({isRetry:1!==this.retryConnectTimes,data:{requestUrl:this.url,requestName:m.CONNECT_WEBSOCKET,isSuccess:0,code:g.closed,requestElapse:c,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||"websocket close"}})),[4,Wc.call(this,e)]):[3,5];case 4:return u.sent(),[3,6];case 5:throw B.error("connect failed three times",a),e&&e({data:{isLastApi:1,isSuccess:0,accessChannel:null===(n=this.socketHost[this.hostIndex])||void 0===n?void 0:n.channel,codeDesc:this.disconnectedReason&&JSON.stringify(this.disconnectedReason)||a.message}}),a;case 6:return[3,7];case 7:return[2]}}))}))}function zc(e){var t=this,r=(new Date).getTime(),n="pending";return new Promise((function(o,i){var a;t._getSock?void 0===(a=t._getSock()).readyState&&(t.needSetReadyState=!0):(a=new WebSocket(t.url)).binaryType="arraybuffer",t.sock=a,t.connectionTimer&&clearTimeout(t.connectionTimer),t.connectionTimer=setTimeout((function(){t.disconnectedReason={type:s.REQUEST_TIMEOUT,message:"connection timeout"},a.close(),null==i||i(t.disconnectedReason)}),1e4),B.debug("start connect ws",t.url),t.connectionResolve=o,t.connectionReject=i;var c=function(){if(t.connectionTimer&&clearTimeout(t.connectionTimer),B.debug("websocket onOpen"),e){var n=(new Date).getTime()-r;e({isRetry:0!==t.retryConnectTimes,data:{requestUrl:t.url,requestName:m.CONNECT_WEBSOCKET,isSuccess:1,code:g.success,requestElapse:n}})}var o;o=t._getSock?ye.flow([t.mSync.generateProvision,t.mSync.base64transform])():t.mSync.generateProvision();try{t.provisionTimer&&clearTimeout(t.provisionTimer),t.provisionTimer=setTimeout((function(){B.error("provision timeout"),t.disconnectedReason=p.create({type:s.REQUEST_TIMEOUT,message:"provision timeout"}),a.close(),null==i||i(t.disconnectedReason)}),1e4),a.send(o)}catch(e){B.error("send provision message error",e);var c=p.create({type:s.SDK_RUNTIME_ERROR,message:"send message error",data:e});t.onError&&t.onError(c)}},u=function(e){t.connectionTimer&&clearTimeout(t.connectionTimer),setTimeout((function(){var r,o,a,c,u,l,d;if(B.debug("websocket onClose, isLogging:",t._isLogging,e),t.needSetReadyState&&(t.sock=Lc(Lc({},t.sock),{close:t.sock.close,send:t.sock.send,readyState:3})),t._isLogging)return null==i||i({type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}),void(n="rejected");if("rejected"!==n)if(n="rejected",t.logOut)t.clear(),t.resetConnState(),null===(o=null===(r=null==t?void 0:t._localCache)||void 0===r?void 0:r.getInstance())||void 0===o||o.close(),t.onClosed&&t.onClosed(),null===(a=t.eventHandler)||void 0===a||a.dispatch("onDisconnected",t.disconnectedReason),null==i||i(t.disconnectedReason||{type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"});else if(t.autoReconnectNumTotal<t.autoReconnectNumMax){t.reconnect();var h={type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.onError&&t.onError(h),t.autoReconnectNumTotal%t.refreshDNSIntervals===0&&t.isHttpDNS&&(B.debug("refresh dns config when websocket close"),Yc.call(t,(function(){})).catch((function(e){B.error("refresh dns config failed",e)})))}else null===(c=t.unMSyncSendMsgMap)||void 0===c||c.clear(),t.rejectMessage(),h={type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"},t.disconnectedReason=p.create({type:s.WEBIM_CONNCTION_DISCONNECTED,message:"reconnection failed"}),t.onError&&t.onError(h),null===(l=null===(u=null==t?void 0:t._localCache)||void 0===u?void 0:u.getInstance())||void 0===l||l.close(),t.onClosed&&t.onClosed(),null===(d=t.eventHandler)||void 0===d||d.dispatch("onDisconnected",t.disconnectedReason),t.resetConnState(),t.reconnecting=!1,null==i||i(h),B.debug("reconnect fail");else B.debug("reject is null")}),0)},l=function(e){var r=t.mSync,n=r.decodeMSync,o=r.distributeMSync;ye.flow([n,o])(e)};"web"===kc.platform?(a.onopen=c,a.onclose=u,a.onmessage=l):(a.onOpen(c),a.onMessage(l),a.onClose(u),"undefined"!=typeof window&&window.WebSocket||a.onError((function(e){var r,o,a,c;if(t.connectionTimer&&clearTimeout(t.connectionTimer),B.debug("websocket onerror, isLogging:",t._isLogging,e),3!==t.sock.readyState&&(t.sock=Lc(Lc({},t.sock),{close:t.sock.close,send:t.sock.send,readyState:3})),t.onError&&t.onError({type:s.WEBIM_CONNECTION_ERROR,message:"on socket error",data:e}),t._isLogging)return null==i||i({type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"}),void(n="rejected");if("rejected"!==n){if(n="rejected",!t.logOut)if(t.autoReconnectNumTotal<t.autoReconnectNumMax)B.debug("sock.onError reconnect",t.autoReconnectNumTotal,t.autoReconnectNumMax),t.reconnect(),t.autoReconnectNumTotal%t.refreshDNSIntervals===0&&t.isHttpDNS&&(B.debug("refresh dns config when websocket error"),Yc.call(t,(function(){})).catch((function(e){B.error("refresh dns config failed",e)})));else{var u={type:s.WEBIM_CONNCTION_DISCONNECTED,message:"websocket has been disconnected"};t.disconnectedReason=p.create({type:s.WEBIM_CONNCTION_DISCONNECTED,message:"reconnection failed"}),null===(r=t.unMSyncSendMsgMap)||void 0===r||r.clear(),t.rejectMessage(),t.onError&&t.onError(u),null===(a=null===(o=null==t?void 0:t._localCache)||void 0===o?void 0:o.getInstance())||void 0===a||a.close(),t.onClosed&&t.onClosed(),null===(c=t.eventHandler)||void 0===c||c.dispatch("onDisconnected",t.disconnectedReason),t.resetConnState(),t.reconnecting=!1,null==i||i(u),B.info("reconnect fail")}}else B.debug("reject is null")})))}))}function Kc(e){if("object"!==Uc(e)||null===e)return p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:"the param is illegal"});if(!e.user||"string"!=typeof e.user){var t=p.create({type:s.WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR,message:"the user is empty or type is not string"});return B.debug("open params error",t),t}return!("agoraToken"in e)||e.agoraToken&&"string"==typeof e.agoraToken?!("accessToken"in e)||e.accessToken&&"string"==typeof e.accessToken?"accessToken"in e||"agoraToken"in e||e.pwd?void 0:(t=p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:"the accessToken or pwd is illegal"}),B.debug("open params error",t),t):(t=p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:"the accessToken is illegal"}),B.debug("open params error",t),t):(t=p.create({type:s.WEBIM_CONNCTION_OPEN_ERROR,message:"the agoraToken is illegal"}),B.debug("open params error",t),console.warn("agoraToken is deprecated, please use accessToken instead"),t)}function Vc(e){this.context.jid={appKey:this.appKey,name:e.user,domain:this.domain,clientResource:this.clientResource},this.context.root=this.root,this.context.userId=e.user,this.context.appKey=this.appKey,this.context.appName=this.appName,this.context.orgName=this.orgName}function Jc(e){var t=this,r=e.rpt,n=e.isRetry,o=this.dnsIndex<this.dnsTotal?this.dnsIndex:0,i="".concat(this.dnsArr[o],"/easemob/server.json");B.debug("call getHttpDNS: "+this.dnsIndex);var a={url:i,dataType:"json",type:"GET",data:{}};return this._initWithAppId?a.data={app_id:this.appId,sdk_version:"4.10.0",file_version:"1"}:a.data={app_key:kc.platform===ce.WEB?encodeURIComponent(this.appKey):this.appKey},ye.ajax(a,f.SDK_INTERNAL).then((function(e){if(!e)throw p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed"});B.debug("getHttpDNS success");var o=e.rest.hosts,a=t.https?"https":"http";if(t._initWithAppId){if(!e.app_key)throw(u=p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed"})).extraInfo=e.extraInfo,u;t.appKey=e.app_key,t.context.appKey=t.appKey,t.devInfos=t.appKey.split("#"),t.orgName=t.devInfos[0],t.appName=t.devInfos[1],t.dataReport.updateAppKey(t.appKey)}if(!o)throw(u=p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:"DNS hosts resolution failed",data:e.rest})).extraInfo=e.extraInfo,u;var c=o.filter((function(e){if(e.protocol===a)return e}));t.restHosts=c,t.restTotal=c.length;var u,l=e["msync-wx"].hosts;if(!l)throw(u=p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:"DNS msync-wx resolution failed",data:e["msync-wx"]})).extraInfo=e.extraInfo,u;var d=l.filter((function(e){if(e.protocol===a)return e}));if(t.socketHost=d,t.hostTotal=d.length,t.isHttpDNS&&Qc.call(t),t.isHttpDNS&&Xc.call(t),t._reportLogs="true"===e.enableReportLogs,t._reportInterval=Number(e.reportInterval||z),"true"===(null==e?void 0:e.enableDataReport)?(t.dataReport.setIsCollectDt(!0),t.dataReport.setIsReportDt(!0)):(t.dataReport.setIsReportDt(!1),t.dataReport.setIsCollectDt(!1)),"false"===(null==e?void 0:e.uploadinparts_enable)&&(t.uploadPartEnable=!1),e.extraInfo){var h=e.extraInfo,f=h.elapse,v=h.httpCode,g={requestUrl:i,requestName:m.GET_DNS,requestElapse:f,isSuccess:1,code:v};r&&r({isRetry:n,data:g})}})).catch((function(e){var t=e.extraInfo||{},o=t.elapse,a=t.httpCode,c=t.errDesc,u={requestUrl:i,requestName:m.GET_DNS,isSuccess:0,code:a,codeDesc:c,requestElapse:o};throw r&&r({isRetry:n,data:u}),p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:e.message,data:e})}))}function Yc(e,t){return Pc(this,void 0,void 0,(function(){var r;return xc(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,6]),[4,Jc.call(this,{rpt:e,isRetry:t})];case 1:case 3:return[2,n.sent()];case 2:return r=n.sent(),B.error("get DNS failed",r,"times:",this.dnsIndex),this.dnsIndex++,this.dnsIndex<this.dnsTotal?[4,Yc.call(this,e,!0)]:[3,4];case 4:throw B.error("retryRequestDNS failed"),p.create({type:s.SERVER_GET_DNSLIST_FAILED,message:"get DNS failed",data:r});case 5:return[3,6];case 6:return[2]}}))}))}function Xc(){var e=this.socketHost[this.hostIndex],t=e.domain,r=e.ip,n=e.port,o="";o=t||r,n&&"80"!==n&&"443"!==n&&(o+=":"+n),o&&(this.url="//"+o+"/websocket");var i=this.https?"wss:":"ws:";this.url=i+this.url}function Qc(){var e,t;if(this.restIndex>this.restTotal)return B.debug("restIndex > restTotal"),"";var r="",n=this.restHosts[this.restIndex],o=n.domain,i=n.ip,a=n.port,s=this.https?"https:":"http:";return i&&"undefined"!=typeof window&&"http:"===(null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.protocol)?r=s+"//"+i+":"+a:(r=s+"//"+o,a&&"80"!==a&&"443"!==a&&(r+=":".concat(a)),"undefined"==typeof window||window.location||(r="https://"+o),"undefined"!=typeof window&&window.location&&"file:"===(null===(t=window.location)||void 0===t?void 0:t.protocol)&&(r="https://"+o)),"undefined"==typeof window&&(r=s+"//"+o),this.apiUrl=r,r}u().util.Long=d(),u().configure();var $c=u().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},editMessageId:{type:"uint64",id:11},editScope:{type:"EditScope",id:12},stream:{type:"Stream",id:13}},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},subType:{type:"SubType",id:22},title:{type:"string",id:23},summary:{type:"string",id:24},combineLevel:{type:"int32",id:25},imageType:{type:"int32",id:26}},nested:{Type:{values:{TEXT:0,IMAGE:1,VIDEO:2,LOCATION:3,VOICE:4,FILE:5,COMMAND:6,CUSTOM:7,COMBINE:8}},Size:{fields:{width:{type:"double",id:1},height:{type:"double",id:2}}},SubType:{values:{COMBINE:0,GIF:1,SUB_STREAM:10}}}},Type:{values:{NORMAL:0,CHAT:1,GROUPCHAT:2,CHATROOM:3,READ_ACK:4,DELIVER_ACK:5,RECALL:6,CHANNEL_ACK:7,EDIT:8}},EditScope:{values:{BODY:1,BODY_AND_EXT:2}},MessageConfig:{fields:{allowGroupAck:{type:"bool",id:1}}},Stream:{fields:{streamType:{type:"string",id:1},streamSeq:{type:"uint64",id:2},streamStatus:{type:"StreamStatus",id:3},streamError:{type:"uint32",id:4},streamFinishReason:{type:"int32",id:5}},nested:{StreamStatus:{values:{STREAM_START:0,STREAM_IN_PROGRESS:1,STREAM_COMPLETED:2,STREAM_FULL:3}}}}}},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},traceId:{type:"uint64",id:20}},nested:{Version:{values:{MSYNC_V1:0,MSYNC_V2:1}},Command:{values:{SYNC:0,UNREAD:1,NOTICE:2,PROVISION:3,LOGOUT:4}}}},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},ext:{rule:"repeated",type:"KeyValue",id:8},meta:{type:"bytes",id:9},directedUsers:{rule:"repeated",type:"string",id:10},env:{type:"string",id:13}},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,ROUTE_DIRECT:2}}}},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},serviceId:{type:"string",id:16},actionVersion:{type:"string",id:17},authToken:{type:"string",id:18},osCustomValue:{type:"uint32",id:19},sessionId:{type:"string",id:20},reason:{type:"string",id:21},protocolCompressType:{rule:"repeated",type:"CompressType",id:22},protocolCompressDirection:{type:"CompressDirection",id:23}},nested:{OsType:{values:{OS_IOS:0,OS_ANDROID:1,OS_LINUX:2,OS_OSX:3,OS_WIN:4,OS_CUSTOM:5,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,COMPRESS_LZ4:2}},CompressDirection:{values:{ONLY_UP:0,ONLY_DOWN:1,BI:2}}}},Logout:{fields:{sessionId:{type:"string",id:1},reason:{type:"string",id:2},status:{type:"Status",id:3}}},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},isThread:{type:"bool",id:9},mucParentId:{type:"JID",id:10},mucName:{type:"string",id:11},eventInfo:{type:"EventInfo",id:12},mucMemberCount:{type:"int32",id:13},ext:{type:"string",id:14},leaveOtherRooms:{type:"bool",id:15},members:{rule:"repeated",type:"string",id:16}},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,THREAD_CREATE:33,THREAD_DESTROY:34,THREAD_JOIN:35,THREAD_LEAVE:36,THREAD_KICK:37,THREAD_UPDATE:38,THREAD_PRESENCE:39,THREAD_ABSENCE:40,DISABLE_GROUP:41,ABLE_GROUP:42,SET_METADATA:43,DELETE_METADATA:44,GROUP_MEMBER_METADATA_UPDATE:45}},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},chatroomInfo:{type:"string",id:3}},nested:{ErrorCode:{values:{OK:0,PERMISSION_DENIED:1,WRONG_PARAMETER:2,MUC_NOT_EXIST:3,USER_NOT_EXIST:4,UNKNOWN:5}}}},EventInfo:{fields:{eventType:{type:"EventType",id:1,options:{default:"EVENT_NONE"}},ext:{type:"string",id:2}},nested:{EventType:{values:{EVENT_NONE:0,CIRCLE_CHANNEL:1}}}}}},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},reason:{type:"string",id:10}},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_CUSTOM:5,OS_OTHER:16}},NetworkType:{values:{NETWORK_NONE:0,NETWORK_WIFI:1,NETWORK_4G:2,NETWORK_3G:3,NETWORK_2G:4,NETWORK_WIRE:5}}}}}}}}}});Dc.prototype.root=$c;var Zc=B.getLogger("defaultLogger");Zc.setConfig({useCache:!1,maxCache:3145728,color:"",background:""}),Zc.enableAll(),Dc.prototype.getUniqueId=ye.getUniqueId;var eu={connection:Dc,message:Je,utils:ye,logger:Zc,statusCode:s};"undefined"!=typeof window&&(window.WebIM=eu);var tu=eu}(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__}()}));
|