nim-web-sdk-ng 0.12.0 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHATROOM_BROWSER_SDK.js +4 -4
- package/dist/CHATROOM_MINIAPP_SDK.js +4 -4
- package/dist/CHATROOM_UNIAPP_SDK.js +4 -4
- package/dist/NIM_BROWSER_SDK/NIMInterface.d.ts +0 -11
- package/dist/NIM_BROWSER_SDK/SignalingServiceInterface.d.ts +369 -1
- package/dist/NIM_BROWSER_SDK/index.d.ts +2 -0
- package/dist/NIM_BROWSER_SDK.js +4 -4
- package/dist/NIM_MINIAPP_SDK/NIMInterface.d.ts +0 -11
- package/dist/NIM_MINIAPP_SDK/SignalingServiceInterface.d.ts +369 -1
- package/dist/NIM_MINIAPP_SDK/index.d.ts +2 -0
- package/dist/NIM_MINIAPP_SDK.js +4 -4
- package/dist/NIM_UNIAPP_SDK.js +4 -4
- package/dist/QCHAT_BROWSER_SDK.js +4 -4
- package/dist/QCHAT_UNIAPP_SDK.js +4 -4
- package/dist/esm/index.d.ts +15 -0
- package/dist/esm/index.js +4 -4
- package/dist/esm/nim/src/NIMInterface.d.ts +0 -11
- package/dist/esm/nim/src/SignalingServiceInterface.d.ts +369 -1
- package/dist/esm/nim/src/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
*
|
|
3
|
-
* Version: 0.12.
|
|
3
|
+
* Version: 0.12.2
|
|
4
4
|
*
|
|
5
|
-
* Git Hash:
|
|
5
|
+
* Git Hash: 648c0e4a3332d949ceeb43c1845e57f264c408fa
|
|
6
6
|
*
|
|
7
|
-
* Created At: 2023/2/
|
|
7
|
+
* Created At: 2023/2/21 下午6:52:15
|
|
8
8
|
*
|
|
9
9
|
* Target: CHATROOM_BROWSER_SDK.js
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(t="undefined"!=typeof globalThis?globalThis:t||self).Chatroom=o()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t){var o={exports:{}};return t(o,o.exports),o.exports}var o,a,c=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports}))),check=function(t){return t&&t.Math==Math&&t},h=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||function(){return this}()||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},m=!fails((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),v=Function.prototype,b=v.apply,x=v.call,w="object"==typeof Reflect&&Reflect.apply||(m?x.bind(b):function(){return x.apply(b,arguments)}),S=Function.prototype,k=S.bind,_=S.call,T=m&&k.bind(_,_),C=m?function(t){return t&&T(t)}:function(t){return t&&function(){return _.apply(t,arguments)}},isCallable=function(t){return"function"==typeof t},M=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),E=Function.prototype.call,O=m?E.bind(E):function(){return E.apply(E,arguments)},P={}.propertyIsEnumerable,I=Object.getOwnPropertyDescriptor,A={f:I&&!P.call({1:2},1)?function propertyIsEnumerable(t){var o=I(this,t);return!!o&&o.enumerable}:P},createPropertyDescriptor=function(t,o){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:o}},j=C({}.toString),R=C("".slice),classofRaw=function(t){return R(j(t),8,-1)},L=Object,N=C("".split),U=fails((function(){return!L("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?N(t,""):L(t)}:L,isNullOrUndefined=function(t){return null==t},D=TypeError,requireObjectCoercible=function(t){if(isNullOrUndefined(t))throw D("Can't call method on "+t);return t},toIndexedObject=function(t){return U(requireObjectCoercible(t))},B="object"==typeof document&&document.all,q=void 0===B&&void 0!==B?function(t){return"object"==typeof t?null!==t:isCallable(t)||t===B}:function(t){return"object"==typeof t?null!==t:isCallable(t)},z={},aFunction=function(t){return isCallable(t)?t:void 0},getBuiltIn=function(t,o){return arguments.length<2?aFunction(z[t])||aFunction(h[t]):z[t]&&z[t][o]||h[t]&&h[t][o]},K=C({}.isPrototypeOf),H=getBuiltIn("navigator","userAgent")||"",G=h.process,$=h.Deno,W=G&&G.versions||$&&$.version,V=W&&W.v8;V&&(a=(o=V.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!a&&H&&(!(o=H.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=H.match(/Chrome\/(\d+)/))&&(a=+o[1]);var Q,J=a,X=!!Object.getOwnPropertySymbols&&!fails((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&J&&J<41})),Y=X&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Z=Object,ee=Y?function(t){return"symbol"==typeof t}:function(t){var o=getBuiltIn("Symbol");return isCallable(o)&&K(o.prototype,Z(t))},te=String,tryToString=function(t){try{return te(t)}catch(t){return"Object"}},re=TypeError,aCallable=function(t){if(isCallable(t))return t;throw re(tryToString(t)+" is not a function")},getMethod=function(t,o){var a=t[o];return isNullOrUndefined(a)?void 0:aCallable(a)},ne=TypeError,oe=Object.defineProperty,ie="__core-js_shared__",ae=h[ie]||function(t,o){try{oe(h,t,{value:o,configurable:!0,writable:!0})}catch(a){h[t]=o}return o}(ie,{}),se=createCommonjsModule((function(t){(t.exports=function(t,o){return ae[t]||(ae[t]=void 0!==o?o:{})})("versions",[]).push({version:"3.25.0",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"})})),ce=Object,toObject=function(t){return ce(requireObjectCoercible(t))},ue=C({}.hasOwnProperty),le=Object.hasOwn||function hasOwn(t,o){return ue(toObject(t),o)},fe=0,pe=Math.random(),de=C(1..toString),uid=function(t){return"Symbol("+(void 0===t?"":t)+")_"+de(++fe+pe,36)},he=se("wks"),me=h.Symbol,ge=me&&me.for,ve=Y?me:me&&me.withoutSetter||uid,wellKnownSymbol=function(t){if(!le(he,t)||!X&&"string"!=typeof he[t]){var o="Symbol."+t;X&&le(me,t)?he[t]=me[t]:he[t]=Y&&ge?ge(o):ve(o)}return he[t]},ye=TypeError,be=wellKnownSymbol("toPrimitive"),toPrimitive=function(t,o){if(!q(t)||ee(t))return t;var a,c=getMethod(t,be);if(c){if(void 0===o&&(o="default"),a=O(c,t,o),!q(a)||ee(a))return a;throw ye("Can't convert object to primitive value")}return void 0===o&&(o="number"),function(t,o){var a,c;if("string"===o&&isCallable(a=t.toString)&&!q(c=O(a,t)))return c;if(isCallable(a=t.valueOf)&&!q(c=O(a,t)))return c;if("string"!==o&&isCallable(a=t.toString)&&!q(c=O(a,t)))return c;throw ne("Can't convert object to primitive value")}(t,o)},toPropertyKey=function(t){var o=toPrimitive(t,"string");return ee(o)?o:o+""},xe=h.document,we=q(xe)&&q(xe.createElement),documentCreateElement=function(t){return we?xe.createElement(t):{}},Se=!M&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),ke=Object.getOwnPropertyDescriptor,_e={f:M?ke:function getOwnPropertyDescriptor(t,o){if(t=toIndexedObject(t),o=toPropertyKey(o),Se)try{return ke(t,o)}catch(t){}if(le(t,o))return createPropertyDescriptor(!O(A.f,t,o),t[o])}},Te=/#|\.prototype\./,isForced=function(t,o){var a=Me[Ce(t)];return a==Oe||a!=Ee&&(isCallable(o)?fails(o):!!o)},Ce=isForced.normalize=function(t){return String(t).replace(Te,".").toLowerCase()},Me=isForced.data={},Ee=isForced.NATIVE="N",Oe=isForced.POLYFILL="P",Pe=isForced,Ie=C(C.bind),functionBindContext=function(t,o){return aCallable(t),void 0===o?t:m?Ie(t,o):function(){return t.apply(o,arguments)}},Ae=M&&fails((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),je=String,Re=TypeError,anObject=function(t){if(q(t))return t;throw Re(je(t)+" is not an object")},Le=TypeError,Fe=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ue="enumerable",De="configurable",Be="writable",qe={f:M?Ae?function defineProperty(t,o,a){if(anObject(t),o=toPropertyKey(o),anObject(a),"function"==typeof t&&"prototype"===o&&"value"in a&&Be in a&&!a.writable){var c=Ne(t,o);c&&c.writable&&(t[o]=a.value,a={configurable:De in a?a.configurable:c.configurable,enumerable:Ue in a?a.enumerable:c.enumerable,writable:!1})}return Fe(t,o,a)}:Fe:function defineProperty(t,o,a){if(anObject(t),o=toPropertyKey(o),anObject(a),Se)try{return Fe(t,o,a)}catch(t){}if("get"in a||"set"in a)throw Le("Accessors not supported");return"value"in a&&(t[o]=a.value),t}},ze=M?function(t,o,a){return qe.f(t,o,createPropertyDescriptor(1,a))}:function(t,o,a){return t[o]=a,t},Ke=_e.f,wrapConstructor=function(t){var Wrapper=function(o,a,c){if(this instanceof Wrapper){switch(arguments.length){case 0:return new t;case 1:return new t(o);case 2:return new t(o,a)}return new t(o,a,c)}return w(t,this,arguments)};return Wrapper.prototype=t.prototype,Wrapper},_export=function(t,o){var a,c,m,v,b,x,w,S,k=t.target,_=t.global,T=t.stat,M=t.proto,E=_?h:T?h[k]:(h[k]||{}).prototype,O=_?z:z[k]||ze(z,k,{})[k],P=O.prototype;for(m in o)a=!Pe(_?m:k+(T?".":"#")+m,t.forced)&&E&&le(E,m),b=O[m],a&&(x=t.dontCallGetSet?(S=Ke(E,m))&&S.value:E[m]),v=a&&x?x:o[m],a&&typeof b==typeof v||(w=t.bind&&a?functionBindContext(v,h):t.wrap&&a?wrapConstructor(v):M&&isCallable(v)?C(v):v,(t.sham||v&&v.sham||b&&b.sham)&&ze(w,"sham",!0),ze(O,m,w),M&&(le(z,c=k+"Prototype")||ze(z,c,{}),ze(z[c],m,v),t.real&&P&&!P[m]&&ze(P,m,v)))},He=Math.ceil,Ge=Math.floor,$e=Math.trunc||function trunc(t){var o=+t;return(o>0?Ge:He)(o)},toIntegerOrInfinity=function(t){var o=+t;return o!=o||0===o?0:$e(o)},We=Math.max,Ve=Math.min,toAbsoluteIndex=function(t,o){var a=toIntegerOrInfinity(t);return a<0?We(a+o,0):Ve(a,o)},Qe=Math.min,lengthOfArrayLike=function(t){return(o=t.length)>0?Qe(toIntegerOrInfinity(o),9007199254740991):0;var o},createMethod$4=function(t){return function(o,a,c){var h,m=toIndexedObject(o),v=lengthOfArrayLike(m),b=toAbsoluteIndex(c,v);if(t&&a!=a){for(;v>b;)if((h=m[b++])!=h)return!0}else for(;v>b;b++)if((t||b in m)&&m[b]===a)return t||b||0;return!t&&-1}},Je={includes:createMethod$4(!0),indexOf:createMethod$4(!1)},Xe={},Ye=Je.indexOf,Ze=C([].push),objectKeysInternal=function(t,o){var a,c=toIndexedObject(t),h=0,m=[];for(a in c)!le(Xe,a)&&le(c,a)&&Ze(m,a);for(;o.length>h;)le(c,a=o[h++])&&(~Ye(m,a)||Ze(m,a));return m},et=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tt=Object.keys||function keys(t){return objectKeysInternal(t,et)},rt=M&&!Ae?Object.defineProperties:function defineProperties(t,o){anObject(t);for(var a,c=toIndexedObject(o),h=tt(o),m=h.length,v=0;m>v;)qe.f(t,a=h[v++],c[a]);return t},nt={f:rt},ot=getBuiltIn("document","documentElement"),it=se("keys"),sharedKey=function(t){return it[t]||(it[t]=uid(t))},at=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag("")),t.close();var o=t.parentWindow.Object;return t=null,o},NullProtoObject=function(){try{Q=new ActiveXObject("htmlfile")}catch(t){}var t,o;NullProtoObject="undefined"!=typeof document?document.domain&&Q?NullProtoObjectViaActiveX(Q):((o=documentCreateElement("iframe")).style.display="none",ot.appendChild(o),o.src=String("javascript:"),(t=o.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F):NullProtoObjectViaActiveX(Q);for(var a=et.length;a--;)delete NullProtoObject.prototype[et[a]];return NullProtoObject()};Xe[at]=!0;var st=Object.create||function create(t,o){var a;return null!==t?(EmptyConstructor.prototype=anObject(t),a=new EmptyConstructor,EmptyConstructor.prototype=null,a[at]=t):a=NullProtoObject(),void 0===o?a:nt.f(a,o)};_export({target:"Object",stat:!0,sham:!M},{create:st});var ct=z.Object,ut=function create(t,o){return ct.create(t,o)},lt=String,ft=TypeError,pt=Object.setPrototypeOf||("__proto__"in{}?function(){var t,o=!1,a={};try{(t=C(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(a,[]),o=a instanceof Array}catch(t){}return function setPrototypeOf(a,c){return anObject(a),function(t){if("object"==typeof t||isCallable(t))return t;throw ft("Can't set "+lt(t)+" as a prototype")}(c),o?t(a,c):a.__proto__=c,a}}():void 0);_export({target:"Object",stat:!0},{setPrototypeOf:pt});var dt=z.Object.setPrototypeOf,ht=C([].slice),mt=Function,gt=C([].concat),vt=C([].join),yt={},construct$8=function(t,o,a){if(!le(yt,o)){for(var c=[],h=0;h<o;h++)c[h]="a["+h+"]";yt[o]=mt("C,a","return new C("+vt(c,",")+")")}return yt[o](t,a)},bt=m?mt.bind:function bind(t){var o=aCallable(this),a=o.prototype,c=ht(arguments,1),h=function bound(){var a=gt(c,ht(arguments));return this instanceof h?construct$8(o,a.length,a):o.apply(t,a)};return q(a)&&(h.prototype=a),h};_export({target:"Function",proto:!0,forced:Function.bind!==bt},{bind:bt});var entryVirtual=function(t){return z[t+"Prototype"]},xt=entryVirtual("Function").bind,wt=Function.prototype,bind$1=function(t){var o=t.bind;return t===wt||K(wt,t)&&o===wt.bind?xt:o},St=createCommonjsModule((function(t){function _setPrototypeOf(o,a){var c;return t.exports=_setPrototypeOf=dt?bind$1(c=dt).call(c):function _setPrototypeOf(t,o){return t.__proto__=o,t},t.exports.__esModule=!0,t.exports.default=t.exports,_setPrototypeOf(o,a)}t.exports=_setPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),kt=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _inheritsLoose(t,o){t.prototype=ut(o.prototype),t.prototype.constructor=t,St(t,o)},t.exports.__esModule=!0,t.exports.default=t.exports}))),_t=Array.isArray||function isArray(t){return"Array"==classofRaw(t)},Tt=TypeError,doesNotExceedSafeInteger=function(t){if(t>9007199254740991)throw Tt("Maximum allowed index exceeded");return t},createProperty=function(t,o,a){var c=toPropertyKey(o);c in t?qe.f(t,c,createPropertyDescriptor(0,a)):t[c]=a},Ct={};Ct[wellKnownSymbol("toStringTag")]="z";var Mt="[object z]"===String(Ct),Et=wellKnownSymbol("toStringTag"),Ot=Object,Pt="Arguments"==classofRaw(function(){return arguments}()),It=Mt?classofRaw:function(t){var o,a,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(a=function(t,o){try{return t[o]}catch(t){}}(o=Ot(t),Et))?a:Pt?classofRaw(o):"Object"==(c=classofRaw(o))&&isCallable(o.callee)?"Arguments":c},At=C(Function.toString);isCallable(ae.inspectSource)||(ae.inspectSource=function(t){return At(t)});var jt=ae.inspectSource,noop$1=function(){},Rt=[],Lt=getBuiltIn("Reflect","construct"),Ft=/^\s*(?:class|function)\b/,Nt=C(Ft.exec),Ut=!Ft.exec(noop$1),Dt=function isConstructor(t){if(!isCallable(t))return!1;try{return Lt(noop$1,Rt,t),!0}catch(t){return!1}},Bt=function isConstructor(t){if(!isCallable(t))return!1;switch(It(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ut||!!Nt(Ft,jt(t))}catch(t){return!0}};Bt.sham=!0;var qt=!Lt||fails((function(){var t;return Dt(Dt.call)||!Dt(Object)||!Dt((function(){t=!0}))||t}))?Bt:Dt,zt=wellKnownSymbol("species"),Kt=Array,arraySpeciesCreate=function(t,o){return new(function(t){var o;return _t(t)&&(o=t.constructor,(qt(o)&&(o===Kt||_t(o.prototype))||q(o)&&null===(o=o[zt]))&&(o=void 0)),void 0===o?Kt:o}(t))(0===o?0:o)},Ht=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return J>=51||!fails((function(){var o=[];return(o.constructor={})[Ht]=function(){return{foo:1}},1!==o[t](Boolean).foo}))},Gt=wellKnownSymbol("isConcatSpreadable"),$t=J>=51||!fails((function(){var t=[];return t[Gt]=!1,t.concat()[0]!==t})),Wt=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!q(t))return!1;var o=t[Gt];return void 0!==o?!!o:_t(t)};_export({target:"Array",proto:!0,arity:1,forced:!$t||!Wt},{concat:function concat(t){var o,a,c,h,m,v=toObject(this),b=arraySpeciesCreate(v,0),x=0;for(o=-1,c=arguments.length;o<c;o++)if(isConcatSpreadable(m=-1===o?v:arguments[o]))for(h=lengthOfArrayLike(m),doesNotExceedSafeInteger(x+h),a=0;a<h;a++,x++)a in m&&createProperty(b,x,m[a]);else doesNotExceedSafeInteger(x+1),createProperty(b,x++,m);return b.length=x,b}});var Vt,Qt,Jt,Xt=String,toString$1=function(t){if("Symbol"===It(t))throw TypeError("Cannot convert a Symbol value to a string");return Xt(t)},Yt=et.concat("length","prototype"),Zt={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,Yt)}},er=Array,tr=Math.max,rr=Zt.f,nr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(t){try{return rr(t)}catch(t){return function(t,o,a){for(var c=lengthOfArrayLike(t),h=toAbsoluteIndex(o,c),m=toAbsoluteIndex(void 0===a?c:a,c),v=er(tr(m-h,0)),b=0;h<m;h++,b++)createProperty(v,b,t[h]);return v.length=b,v}(nr)}},or={f:function getOwnPropertyNames(t){return nr&&"Window"==classofRaw(t)?getWindowNames(t):rr(toIndexedObject(t))}},ir={f:Object.getOwnPropertySymbols},defineBuiltIn=function(t,o,a,c){return c&&c.enumerable?t[o]=a:ze(t,o,a),t},ar={f:wellKnownSymbol},sr=qe.f,wellKnownSymbolDefine=function(t){var o=z.Symbol||(z.Symbol={});le(o,t)||sr(o,t,{value:ar.f(t)})},symbolDefineToPrimitive=function(){var t=getBuiltIn("Symbol"),o=t&&t.prototype,a=o&&o.valueOf,c=wellKnownSymbol("toPrimitive");o&&!o[c]&&defineBuiltIn(o,c,(function(t){return O(a,this)}),{arity:1})},cr=Mt?{}.toString:function toString(){return"[object "+It(this)+"]"},ur=qe.f,lr=wellKnownSymbol("toStringTag"),setToStringTag=function(t,o,a,c){if(t){var h=a?t:t.prototype;le(h,lr)||ur(h,lr,{configurable:!0,value:o}),c&&!Mt&&ze(h,"toString",cr)}},fr=h.WeakMap,pr=isCallable(fr)&&/native code/.test(String(fr)),dr="Object already initialized",hr=h.TypeError,mr=h.WeakMap;if(pr||ae.state){var gr=ae.state||(ae.state=new mr),vr=C(gr.get),yr=C(gr.has),br=C(gr.set);Vt=function(t,o){if(yr(gr,t))throw hr(dr);return o.facade=t,br(gr,t,o),o},Qt=function(t){return vr(gr,t)||{}},Jt=function(t){return yr(gr,t)}}else{var xr=sharedKey("state");Xe[xr]=!0,Vt=function(t,o){if(le(t,xr))throw hr(dr);return o.facade=t,ze(t,xr,o),o},Qt=function(t){return le(t,xr)?t[xr]:{}},Jt=function(t){return le(t,xr)}}var wr={set:Vt,get:Qt,has:Jt,enforce:function(t){return Jt(t)?Qt(t):Vt(t,{})},getterFor:function(t){return function(o){var a;if(!q(o)||(a=Qt(o)).type!==t)throw hr("Incompatible receiver, "+t+" required");return a}}},Sr=C([].push),createMethod$3=function(t){var o=1==t,a=2==t,c=3==t,h=4==t,m=6==t,v=7==t,b=5==t||m;return function(x,w,S,k){for(var _,T,C=toObject(x),M=U(C),E=functionBindContext(w,S),O=lengthOfArrayLike(M),P=0,I=k||arraySpeciesCreate,A=o?I(x,O):a||v?I(x,0):void 0;O>P;P++)if((b||P in M)&&(T=E(_=M[P],P,C),t))if(o)A[P]=T;else if(T)switch(t){case 3:return!0;case 5:return _;case 6:return P;case 2:Sr(A,_)}else switch(t){case 4:return!1;case 7:Sr(A,_)}return m?-1:c||h?h:A}},kr={forEach:createMethod$3(0),map:createMethod$3(1),filter:createMethod$3(2),some:createMethod$3(3),every:createMethod$3(4),find:createMethod$3(5),findIndex:createMethod$3(6),filterReject:createMethod$3(7)},_r=kr.forEach,Tr=sharedKey("hidden"),Cr="Symbol",Mr=wr.set,Er=wr.getterFor(Cr),Or=Object.prototype,Pr=h.Symbol,Ir=Pr&&Pr.prototype,Ar=h.TypeError,jr=h.QObject,Rr=_e.f,Lr=qe.f,Fr=or.f,Nr=A.f,Ur=C([].push),Dr=se("symbols"),Br=se("op-symbols"),qr=se("wks"),zr=!jr||!jr.prototype||!jr.prototype.findChild,Kr=M&&fails((function(){return 7!=st(Lr({},"a",{get:function(){return Lr(this,"a",{value:7}).a}})).a}))?function(t,o,a){var c=Rr(Or,o);c&&delete Or[o],Lr(t,o,a),c&&t!==Or&&Lr(Or,o,c)}:Lr,wrap$1=function(t,o){var a=Dr[t]=st(Ir);return Mr(a,{type:Cr,tag:t,description:o}),M||(a.description=o),a},Hr=function defineProperty(t,o,a){t===Or&&Hr(Br,o,a),anObject(t);var c=toPropertyKey(o);return anObject(a),le(Dr,c)?(a.enumerable?(le(t,Tr)&&t[Tr][c]&&(t[Tr][c]=!1),a=st(a,{enumerable:createPropertyDescriptor(0,!1)})):(le(t,Tr)||Lr(t,Tr,createPropertyDescriptor(1,{})),t[Tr][c]=!0),Kr(t,c,a)):Lr(t,c,a)},Gr=function defineProperties(t,o){anObject(t);var a=toIndexedObject(o),c=tt(a).concat($getOwnPropertySymbols(a));return _r(c,(function(o){M&&!O($r,a,o)||Hr(t,o,a[o])})),t},$r=function propertyIsEnumerable(t){var o=toPropertyKey(t),a=O(Nr,this,o);return!(this===Or&&le(Dr,o)&&!le(Br,o))&&(!(a||!le(this,o)||!le(Dr,o)||le(this,Tr)&&this[Tr][o])||a)},Wr=function getOwnPropertyDescriptor(t,o){var a=toIndexedObject(t),c=toPropertyKey(o);if(a!==Or||!le(Dr,c)||le(Br,c)){var h=Rr(a,c);return!h||!le(Dr,c)||le(a,Tr)&&a[Tr][c]||(h.enumerable=!0),h}},Vr=function getOwnPropertyNames(t){var o=Fr(toIndexedObject(t)),a=[];return _r(o,(function(t){le(Dr,t)||le(Xe,t)||Ur(a,t)})),a},$getOwnPropertySymbols=function(t){var o=t===Or,a=Fr(o?Br:toIndexedObject(t)),c=[];return _r(a,(function(t){!le(Dr,t)||o&&!le(Or,t)||Ur(c,Dr[t])})),c};X||(Pr=function Symbol(){if(K(Ir,this))throw Ar("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?toString$1(arguments[0]):void 0,o=uid(t),setter=function(t){this===Or&&O(setter,Br,t),le(this,Tr)&&le(this[Tr],o)&&(this[Tr][o]=!1),Kr(this,o,createPropertyDescriptor(1,t))};return M&&zr&&Kr(Or,o,{configurable:!0,set:setter}),wrap$1(o,t)},Ir=Pr.prototype,defineBuiltIn(Ir,"toString",(function toString(){return Er(this).tag})),defineBuiltIn(Pr,"withoutSetter",(function(t){return wrap$1(uid(t),t)})),A.f=$r,qe.f=Hr,nt.f=Gr,_e.f=Wr,Zt.f=or.f=Vr,ir.f=$getOwnPropertySymbols,ar.f=function(t){return wrap$1(wellKnownSymbol(t),t)},M&&Lr(Ir,"description",{configurable:!0,get:function description(){return Er(this).description}})),_export({global:!0,constructor:!0,wrap:!0,forced:!X,sham:!X},{Symbol:Pr}),_r(tt(qr),(function(t){wellKnownSymbolDefine(t)})),_export({target:Cr,stat:!0,forced:!X},{useSetter:function(){zr=!0},useSimple:function(){zr=!1}}),_export({target:"Object",stat:!0,forced:!X,sham:!M},{create:function create(t,o){return void 0===o?st(t):Gr(st(t),o)},defineProperty:Hr,defineProperties:Gr,getOwnPropertyDescriptor:Wr}),_export({target:"Object",stat:!0,forced:!X},{getOwnPropertyNames:Vr}),symbolDefineToPrimitive(),setToStringTag(Pr,Cr),Xe[Tr]=!0;var Qr=X&&!!Symbol.for&&!!Symbol.keyFor,Jr=se("string-to-symbol-registry"),Xr=se("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Qr},{for:function(t){var o=toString$1(t);if(le(Jr,o))return Jr[o];var a=getBuiltIn("Symbol")(o);return Jr[o]=a,Xr[a]=o,a}});var Yr=se("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Qr},{keyFor:function keyFor(t){if(!ee(t))throw TypeError(tryToString(t)+" is not a symbol");if(le(Yr,t))return Yr[t]}});var Zr=getBuiltIn("JSON","stringify"),en=C(/./.exec),tn=C("".charAt),rn=C("".charCodeAt),nn=C("".replace),an=C(1..toString),sn=/[\uD800-\uDFFF]/g,cn=/^[\uD800-\uDBFF]$/,un=/^[\uDC00-\uDFFF]$/,ln=!X||fails((function(){var t=getBuiltIn("Symbol")();return"[null]"!=Zr([t])||"{}"!=Zr({a:t})||"{}"!=Zr(Object(t))})),fn=fails((function(){return'"\\udf06\\ud834"'!==Zr("\udf06\ud834")||'"\\udead"'!==Zr("\udead")})),stringifyWithSymbolsFix=function(t,o){var a=ht(arguments),c=o;if((q(o)||void 0!==t)&&!ee(t))return _t(o)||(o=function(t,o){if(isCallable(c)&&(o=O(c,this,t,o)),!ee(o))return o}),a[1]=o,w(Zr,null,a)},fixIllFormed=function(t,o,a){var c=tn(a,o-1),h=tn(a,o+1);return en(cn,t)&&!en(un,h)||en(un,t)&&!en(cn,c)?"\\u"+an(rn(t,0),16):t};Zr&&_export({target:"JSON",stat:!0,arity:3,forced:ln||fn},{stringify:function stringify(t,o,a){var c=ht(arguments),h=w(ln?stringifyWithSymbolsFix:Zr,null,c);return fn&&"string"==typeof h?nn(h,sn,fixIllFormed):h}});var pn=!X||fails((function(){ir.f(1)}));_export({target:"Object",stat:!0,forced:pn},{getOwnPropertySymbols:function getOwnPropertySymbols(t){var o=ir.f;return o?o(toObject(t)):[]}}),wellKnownSymbolDefine("asyncIterator"),wellKnownSymbolDefine("hasInstance"),wellKnownSymbolDefine("isConcatSpreadable"),wellKnownSymbolDefine("iterator"),wellKnownSymbolDefine("match"),wellKnownSymbolDefine("matchAll"),wellKnownSymbolDefine("replace"),wellKnownSymbolDefine("search"),wellKnownSymbolDefine("species"),wellKnownSymbolDefine("split"),wellKnownSymbolDefine("toPrimitive"),symbolDefineToPrimitive(),wellKnownSymbolDefine("toStringTag"),setToStringTag(getBuiltIn("Symbol"),"Symbol"),wellKnownSymbolDefine("unscopables"),setToStringTag(h.JSON,"JSON",!0);var dn,hn,mn,gn=z.Symbol,vn={},yn=Function.prototype,bn=M&&Object.getOwnPropertyDescriptor,xn=le(yn,"name"),wn={EXISTS:xn,PROPER:xn&&"something"===function something(){}.name,CONFIGURABLE:xn&&(!M||M&&bn(yn,"name").configurable)},Sn=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),kn=sharedKey("IE_PROTO"),_n=Object,Tn=_n.prototype,Cn=Sn?_n.getPrototypeOf:function(t){var o=toObject(t);if(le(o,kn))return o[kn];var a=o.constructor;return isCallable(a)&&o instanceof a?a.prototype:o instanceof _n?Tn:null},Mn=wellKnownSymbol("iterator"),En=!1;[].keys&&("next"in(mn=[].keys())?(hn=Cn(Cn(mn)))!==Object.prototype&&(dn=hn):En=!0);var On=!q(dn)||fails((function(){var t={};return dn[Mn].call(t)!==t}));dn=On?{}:st(dn),isCallable(dn[Mn])||defineBuiltIn(dn,Mn,(function(){return this}));var Pn={IteratorPrototype:dn,BUGGY_SAFARI_ITERATORS:En},In=Pn.IteratorPrototype,returnThis$1=function(){return this},An=wn.PROPER,jn=Pn.BUGGY_SAFARI_ITERATORS,Rn=wellKnownSymbol("iterator"),Ln="keys",Fn="values",Nn="entries",returnThis=function(){return this},iteratorDefine=function(t,o,a,c,h,m,v){!function(t,o,a,c){var h=o+" Iterator";t.prototype=st(In,{next:createPropertyDescriptor(+!c,a)}),setToStringTag(t,h,!1,!0),vn[h]=returnThis$1}(a,o,c);var b,x,w,getIterationMethod=function(t){if(t===h&&C)return C;if(!jn&&t in _)return _[t];switch(t){case Ln:return function keys(){return new a(this,t)};case Fn:return function values(){return new a(this,t)};case Nn:return function entries(){return new a(this,t)}}return function(){return new a(this)}},S=o+" Iterator",k=!1,_=t.prototype,T=_[Rn]||_["@@iterator"]||h&&_[h],C=!jn&&T||getIterationMethod(h),M="Array"==o&&_.entries||T;if(M&&(b=Cn(M.call(new t)))!==Object.prototype&&b.next&&(setToStringTag(b,S,!0,!0),vn[S]=returnThis),An&&h==Fn&&T&&T.name!==Fn&&(k=!0,C=function values(){return O(T,this)}),h)if(x={values:getIterationMethod(Fn),keys:m?C:getIterationMethod(Ln),entries:getIterationMethod(Nn)},v)for(w in x)(jn||k||!(w in _))&&defineBuiltIn(_,w,x[w]);else _export({target:o,proto:!0,forced:jn||k},x);return v&&_[Rn]!==C&&defineBuiltIn(_,Rn,C,{name:h}),vn[o]=C,x};qe.f;var Un="Array Iterator",Dn=wr.set,Bn=wr.getterFor(Un);iteratorDefine(Array,"Array",(function(t,o){Dn(this,{type:Un,target:toIndexedObject(t),index:0,kind:o})}),(function(){var t=Bn(this),o=t.target,a=t.kind,c=t.index++;return!o||c>=o.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==a?{value:c,done:!1}:"values"==a?{value:o[c],done:!1}:{value:[c,o[c]],done:!1}}),"values"),vn.Arguments=vn.Array;var qn=wellKnownSymbol("toStringTag");for(var zn in{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}){var Kn=h[zn],Hn=Kn&&Kn.prototype;Hn&&It(Hn)!==qn&&ze(Hn,qn,zn),vn[zn]=vn.Array}var Gn=gn;wellKnownSymbolDefine("asyncDispose"),wellKnownSymbolDefine("dispose"),wellKnownSymbolDefine("matcher"),wellKnownSymbolDefine("metadataKey"),wellKnownSymbolDefine("observable"),wellKnownSymbolDefine("metadata"),wellKnownSymbolDefine("patternMatch"),wellKnownSymbolDefine("replaceAll");var $n=Gn,Wn=C("".charAt),Vn=C("".charCodeAt),Qn=C("".slice),createMethod$2=function(t){return function(o,a){var c,h,m=toString$1(requireObjectCoercible(o)),v=toIntegerOrInfinity(a),b=m.length;return v<0||v>=b?t?"":void 0:(c=Vn(m,v))<55296||c>56319||v+1===b||(h=Vn(m,v+1))<56320||h>57343?t?Wn(m,v):c:t?Qn(m,v,v+2):h-56320+(c-55296<<10)+65536}},Jn={codeAt:createMethod$2(!1),charAt:createMethod$2(!0)}.charAt,Xn="String Iterator",Yn=wr.set,Zn=wr.getterFor(Xn);iteratorDefine(String,"String",(function(t){Yn(this,{type:Xn,string:toString$1(t),index:0})}),(function next(){var t,o=Zn(this),a=o.string,c=o.index;return c>=a.length?{value:void 0,done:!0}:(t=Jn(a,c),o.index+=t.length,{value:t,done:!1})}));var eo=ar.f("iterator"),to=createCommonjsModule((function(t){function _typeof(o){return t.exports=_typeof="function"==typeof $n&&"symbol"==typeof eo?function(t){return typeof t}:function(t){return t&&"function"==typeof $n&&t.constructor===$n&&t!==$n.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,_typeof(o)}t.exports=_typeof,t.exports.__esModule=!0,t.exports.default=t.exports})),ro=qe.f;_export({target:"Object",stat:!0,forced:Object.defineProperty!==ro,sham:!M},{defineProperty:ro});var no=createCommonjsModule((function(t){var o=z.Object,a=t.exports=function defineProperty(t,a,c){return o.defineProperty(t,a,c)};o.defineProperty.sham&&(a.sham=!0)})),oo=no,io=fails((function(){Cn(1)}));_export({target:"Object",stat:!0,forced:io,sham:!Sn},{getPrototypeOf:function getPrototypeOf(t){return Cn(toObject(t))}});var ao=z.Object.getPrototypeOf,arrayMethodIsStrict=function(t,o){var a=[][t];return!!a&&fails((function(){a.call(null,o||function(){return 1},1)}))},so=kr.forEach,co=arrayMethodIsStrict("forEach")?[].forEach:function forEach(t){return so(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=co},{forEach:co});var uo=entryVirtual("Array").forEach,lo=Array.prototype,fo={DOMTokenList:!0,NodeList:!0},forEach$1=function(t){var o=t.forEach;return t===lo||K(lo,t)&&o===lo.forEach||le(fo,It(t))?uo:o},po=C([].concat),ho=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var o=Zt.f(anObject(t)),a=ir.f;return a?po(o,a(t)):o},mo=Error,go=C("".replace),vo=String(mo("zxcasd").stack),yo=/\n\s*at [^:]*:[^\n]*/,bo=yo.test(vo),errorStackClear=function(t,o){if(bo&&"string"==typeof t&&!mo.prepareStackTrace)for(;o--;)t=go(t,yo,"");return t},installErrorCause=function(t,o){q(o)&&"cause"in o&&ze(t,"cause",o.cause)},xo=wellKnownSymbol("iterator"),wo=Array.prototype,isArrayIteratorMethod=function(t){return void 0!==t&&(vn.Array===t||wo[xo]===t)},So=wellKnownSymbol("iterator"),getIteratorMethod$5=function(t){if(!isNullOrUndefined(t))return getMethod(t,So)||getMethod(t,"@@iterator")||vn[It(t)]},ko=TypeError,getIterator=function(t,o){var a=arguments.length<2?getIteratorMethod$5(t):o;if(aCallable(a))return anObject(O(a,t));throw ko(tryToString(t)+" is not iterable")},iteratorClose=function(t,o,a){var c,h;anObject(t);try{if(!(c=getMethod(t,"return"))){if("throw"===o)throw a;return a}c=O(c,t)}catch(t){h=!0,c=t}if("throw"===o)throw a;if(h)throw c;return anObject(c),a},_o=TypeError,Result=function(t,o){this.stopped=t,this.result=o},To=Result.prototype,iterate=function(t,o,a){var c,h,m,v,b,x,w,S=a&&a.that,k=!(!a||!a.AS_ENTRIES),_=!(!a||!a.IS_RECORD),T=!(!a||!a.IS_ITERATOR),C=!(!a||!a.INTERRUPTED),M=functionBindContext(o,S),stop=function(t){return c&&iteratorClose(c,"normal",t),new Result(!0,t)},callFn=function(t){return k?(anObject(t),C?M(t[0],t[1],stop):M(t[0],t[1])):C?M(t,stop):M(t)};if(_)c=t.iterator;else if(T)c=t;else{if(!(h=getIteratorMethod$5(t)))throw _o(tryToString(t)+" is not iterable");if(isArrayIteratorMethod(h)){for(m=0,v=lengthOfArrayLike(t);v>m;m++)if((b=callFn(t[m]))&&K(To,b))return b;return new Result(!1)}c=getIterator(t,h)}for(x=_?t.next:c.next;!(w=O(x,c)).done;){try{b=callFn(w.value)}catch(t){iteratorClose(c,"throw",t)}if("object"==typeof b&&b&&K(To,b))return b}return new Result(!1)},normalizeStringArgument=function(t,o){return void 0===t?arguments.length<2?"":o:toString$1(t)},Co=!fails((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",createPropertyDescriptor(1,7)),7!==t.stack)})),Mo=wellKnownSymbol("toStringTag"),Eo=Error,Oo=[].push,Po=function AggregateError(t,o){var a,c=arguments.length>2?arguments[2]:void 0,h=K(Io,this);pt?a=pt(Eo(),h?Cn(this):Io):(a=h?this:st(Io),ze(a,Mo,"Error")),void 0!==o&&ze(a,"message",normalizeStringArgument(o)),Co&&ze(a,"stack",errorStackClear(a.stack,1)),installErrorCause(a,c);var m=[];return iterate(t,Oo,{that:m}),ze(a,"errors",m),a};pt?pt(Po,Eo):function(t,o,a){for(var c=ho(o),h=qe.f,m=_e.f,v=0;v<c.length;v++){var b=c[v];le(t,b)||a&&le(a,b)||h(t,b,m(o,b))}}(Po,Eo,{name:!0});var Io=Po.prototype=st(Eo.prototype,{constructor:createPropertyDescriptor(1,Po),message:createPropertyDescriptor(1,""),name:createPropertyDescriptor(1,"AggregateError")});_export({global:!0,constructor:!0,arity:2},{AggregateError:Po});var Ao,jo,Ro,Lo,Fo="process"==classofRaw(h.process),No=wellKnownSymbol("species"),setSpecies=function(t){var o=getBuiltIn(t),a=qe.f;M&&o&&!o[No]&&a(o,No,{configurable:!0,get:function(){return this}})},Uo=TypeError,anInstance=function(t,o){if(K(o,t))return t;throw Uo("Incorrect invocation")},Do=TypeError,aConstructor=function(t){if(qt(t))return t;throw Do(tryToString(t)+" is not a constructor")},Bo=wellKnownSymbol("species"),speciesConstructor=function(t,o){var a,c=anObject(t).constructor;return void 0===c||isNullOrUndefined(a=anObject(c)[Bo])?o:aConstructor(a)},qo=TypeError,validateArgumentsLength=function(t,o){if(t<o)throw qo("Not enough arguments");return t},zo=/(?:ipad|iphone|ipod).*applewebkit/i.test(H),Ko=h.setImmediate,Ho=h.clearImmediate,Go=h.process,$o=h.Dispatch,Wo=h.Function,Vo=h.MessageChannel,Qo=h.String,Jo=0,Xo={},Yo="onreadystatechange";try{Ao=h.location}catch(t){}var run=function(t){if(le(Xo,t)){var o=Xo[t];delete Xo[t],o()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){h.postMessage(Qo(t),Ao.protocol+"//"+Ao.host)};Ko&&Ho||(Ko=function setImmediate(t){validateArgumentsLength(arguments.length,1);var o=isCallable(t)?t:Wo(t),a=ht(arguments,1);return Xo[++Jo]=function(){w(o,void 0,a)},jo(Jo),Jo},Ho=function clearImmediate(t){delete Xo[t]},Fo?jo=function(t){Go.nextTick(runner(t))}:$o&&$o.now?jo=function(t){$o.now(runner(t))}:Vo&&!zo?(Lo=(Ro=new Vo).port2,Ro.port1.onmessage=listener,jo=functionBindContext(Lo.postMessage,Lo)):h.addEventListener&&isCallable(h.postMessage)&&!h.importScripts&&Ao&&"file:"!==Ao.protocol&&!fails(post)?(jo=post,h.addEventListener("message",listener,!1)):jo=Yo in documentCreateElement("script")?function(t){ot.appendChild(documentCreateElement("script")).onreadystatechange=function(){ot.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)});var Zo,ei,ti,ri,ni,oi,ii,ai,si={set:Ko,clear:Ho},ci=/ipad|iphone|ipod/i.test(H)&&void 0!==h.Pebble,ui=/web0s(?!.*chrome)/i.test(H),li=_e.f,fi=si.set,pi=h.MutationObserver||h.WebKitMutationObserver,di=h.document,hi=h.process,mi=h.Promise,gi=li(h,"queueMicrotask"),vi=gi&&gi.value;vi||(Zo=function(){var t,o;for(Fo&&(t=hi.domain)&&t.exit();ei;){o=ei.fn,ei=ei.next;try{o()}catch(t){throw ei?ri():ti=void 0,t}}ti=void 0,t&&t.enter()},zo||Fo||ui||!pi||!di?!ci&&mi&&mi.resolve?((ii=mi.resolve(void 0)).constructor=mi,ai=functionBindContext(ii.then,ii),ri=function(){ai(Zo)}):Fo?ri=function(){hi.nextTick(Zo)}:(fi=functionBindContext(fi,h),ri=function(){fi(Zo)}):(ni=!0,oi=di.createTextNode(""),new pi(Zo).observe(oi,{characterData:!0}),ri=function(){oi.data=ni=!ni}));var yi=vi||function(t){var o={fn:t,next:void 0};ti&&(ti.next=o),ei||(ei=o,ri()),ti=o},perform=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(t){var o={item:t,next:null};this.head?this.tail.next=o:this.head=o,this.tail=o},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var bi,xi,wi=Queue,Si=h.Promise,ki="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,_i=!ki&&!Fo&&"object"==typeof window&&"object"==typeof document,Ti=Si&&Si.prototype,Ci=wellKnownSymbol("species"),Mi=!1,Ei=isCallable(h.PromiseRejectionEvent),Oi=Pe("Promise",(function(){var t=jt(Si),o=t!==String(Si);if(!o&&66===J)return!0;if(!Ti.catch||!Ti.finally)return!0;if(!J||J<51||!/native code/.test(t)){var a=new Si((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};if((a.constructor={})[Ci]=FakePromise,!(Mi=a.then((function(){}))instanceof FakePromise))return!0}return!o&&(_i||ki)&&!Ei})),Pi={CONSTRUCTOR:Oi,REJECTION_EVENT:Ei,SUBCLASSING:Mi},Ii=TypeError,PromiseCapability=function(t){var o,a;this.promise=new t((function(t,c){if(void 0!==o||void 0!==a)throw Ii("Bad Promise constructor");o=t,a=c})),this.resolve=aCallable(o),this.reject=aCallable(a)},Ai={f:function(t){return new PromiseCapability(t)}},ji=si.set,Ri="Promise",Li=Pi.CONSTRUCTOR,Fi=Pi.REJECTION_EVENT,Ni=wr.getterFor(Ri),Ui=wr.set,Di=Si&&Si.prototype,Bi=Si,qi=Di,zi=h.TypeError,Ki=h.document,Hi=h.process,Gi=Ai.f,$i=Gi,Wi=!!(Ki&&Ki.createEvent&&h.dispatchEvent),Vi="unhandledrejection",isThenable=function(t){var o;return!(!q(t)||!isCallable(o=t.then))&&o},callReaction=function(t,o){var a,c,h,m=o.value,v=1==o.state,b=v?t.ok:t.fail,x=t.resolve,w=t.reject,S=t.domain;try{b?(v||(2===o.rejection&&onHandleUnhandled(o),o.rejection=1),!0===b?a=m:(S&&S.enter(),a=b(m),S&&(S.exit(),h=!0)),a===t.promise?w(zi("Promise-chain cycle")):(c=isThenable(a))?O(c,a,x,w):x(a)):w(m)}catch(t){S&&!h&&S.exit(),w(t)}},notify=function(t,o){t.notified||(t.notified=!0,yi((function(){for(var a,c=t.reactions;a=c.get();)callReaction(a,t);t.notified=!1,o&&!t.rejection&&onUnhandled(t)})))},dispatchEvent=function(t,o,a){var c,m;Wi?((c=Ki.createEvent("Event")).promise=o,c.reason=a,c.initEvent(t,!1,!0),h.dispatchEvent(c)):c={promise:o,reason:a},!Fi&&(m=h["on"+t])?m(c):t===Vi&&function(t,o){var a=h.console;a&&a.error&&(1==arguments.length?a.error(t):a.error(t,o))}("Unhandled promise rejection",a)},onUnhandled=function(t){O(ji,h,(function(){var o,a=t.facade,c=t.value;if(isUnhandled(t)&&(o=perform((function(){Fo?Hi.emit("unhandledRejection",c,a):dispatchEvent(Vi,a,c)})),t.rejection=Fo||isUnhandled(t)?2:1,o.error))throw o.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){O(ji,h,(function(){var o=t.facade;Fo?Hi.emit("rejectionHandled",o):dispatchEvent("rejectionhandled",o,t.value)}))},bind=function(t,o,a){return function(c){t(o,c,a)}},internalReject=function(t,o,a){t.done||(t.done=!0,a&&(t=a),t.value=o,t.state=2,notify(t,!0))},internalResolve=function(t,o,a){if(!t.done){t.done=!0,a&&(t=a);try{if(t.facade===o)throw zi("Promise can't be resolved itself");var c=isThenable(o);c?yi((function(){var a={done:!1};try{O(c,o,bind(internalResolve,a,t),bind(internalReject,a,t))}catch(o){internalReject(a,o,t)}})):(t.value=o,t.state=1,notify(t,!1))}catch(o){internalReject({done:!1},o,t)}}};Li&&(qi=(Bi=function Promise(t){anInstance(this,qi),aCallable(t),O(bi,this);var o=Ni(this);try{t(bind(internalResolve,o),bind(internalReject,o))}catch(t){internalReject(o,t)}}).prototype,(bi=function Promise(t){Ui(this,{type:Ri,done:!1,notified:!1,parent:!1,reactions:new wi,rejection:!1,state:0,value:void 0})}).prototype=defineBuiltIn(qi,"then",(function then(t,o){var a=Ni(this),c=Gi(speciesConstructor(this,Bi));return a.parent=!0,c.ok=!isCallable(t)||t,c.fail=isCallable(o)&&o,c.domain=Fo?Hi.domain:void 0,0==a.state?a.reactions.add(c):yi((function(){callReaction(c,a)})),c.promise})),xi=function(){var t=new bi,o=Ni(t);this.promise=t,this.resolve=bind(internalResolve,o),this.reject=bind(internalReject,o)},Ai.f=Gi=function(t){return t===Bi||undefined===t?new xi(t):$i(t)}),_export({global:!0,constructor:!0,wrap:!0,forced:Li},{Promise:Bi}),setToStringTag(Bi,Ri,!1,!0),setSpecies(Ri);var Qi=wellKnownSymbol("iterator"),Ji=!1;try{var Xi=0,Yi={next:function(){return{done:!!Xi++}},return:function(){Ji=!0}};Yi[Qi]=function(){return this},Array.from(Yi,(function(){throw 2}))}catch(t){}var checkCorrectnessOfIteration=function(t,o){if(!o&&!Ji)return!1;var a=!1;try{var c={};c[Qi]=function(){return{next:function(){return{done:a=!0}}}},t(c)}catch(t){}return a},Zi=Pi.CONSTRUCTOR||!checkCorrectnessOfIteration((function(t){Si.all(t).then(void 0,(function(){}))}));_export({target:"Promise",stat:!0,forced:Zi},{all:function all(t){var o=this,a=Ai.f(o),c=a.resolve,h=a.reject,m=perform((function(){var a=aCallable(o.resolve),m=[],v=0,b=1;iterate(t,(function(t){var x=v++,w=!1;b++,O(a,o,t).then((function(t){w||(w=!0,m[x]=t,--b||c(m))}),h)})),--b||c(m)}));return m.error&&h(m.value),a.promise}});var ea=Pi.CONSTRUCTOR;Si&&Si.prototype,_export({target:"Promise",proto:!0,forced:ea,real:!0},{catch:function(t){return this.then(void 0,t)}}),_export({target:"Promise",stat:!0,forced:Zi},{race:function race(t){var o=this,a=Ai.f(o),c=a.reject,h=perform((function(){var h=aCallable(o.resolve);iterate(t,(function(t){O(h,o,t).then(a.resolve,c)}))}));return h.error&&c(h.value),a.promise}}),_export({target:"Promise",stat:!0,forced:Pi.CONSTRUCTOR},{reject:function reject(t){var o=Ai.f(this);return O(o.reject,void 0,t),o.promise}});var promiseResolve=function(t,o){if(anObject(t),q(o)&&o.constructor===t)return o;var a=Ai.f(t);return(0,a.resolve)(o),a.promise},ta=Pi.CONSTRUCTOR,ra=getBuiltIn("Promise"),na=!ta;_export({target:"Promise",stat:!0,forced:!0},{resolve:function resolve(t){return promiseResolve(na&&this===ra?Si:this,t)}}),_export({target:"Promise",stat:!0},{allSettled:function allSettled(t){var o=this,a=Ai.f(o),c=a.resolve,h=a.reject,m=perform((function(){var a=aCallable(o.resolve),h=[],m=0,v=1;iterate(t,(function(t){var b=m++,x=!1;v++,O(a,o,t).then((function(t){x||(x=!0,h[b]={status:"fulfilled",value:t},--v||c(h))}),(function(t){x||(x=!0,h[b]={status:"rejected",reason:t},--v||c(h))}))})),--v||c(h)}));return m.error&&h(m.value),a.promise}});var oa="No one promise resolved";_export({target:"Promise",stat:!0},{any:function any(t){var o=this,a=getBuiltIn("AggregateError"),c=Ai.f(o),h=c.resolve,m=c.reject,v=perform((function(){var c=aCallable(o.resolve),v=[],b=0,x=1,w=!1;iterate(t,(function(t){var S=b++,k=!1;x++,O(c,o,t).then((function(t){k||w||(w=!0,h(t))}),(function(t){k||w||(k=!0,v[S]=t,--x||m(new a(v,oa)))}))})),--x||m(new a(v,oa))}));return v.error&&m(v.value),c.promise}});var ia=Si&&Si.prototype,aa=!!Si&&fails((function(){ia.finally.call({then:function(){}},(function(){}))}));_export({target:"Promise",proto:!0,real:!0,forced:aa},{finally:function(t){var o=speciesConstructor(this,getBuiltIn("Promise")),a=isCallable(t);return this.then(a?function(a){return promiseResolve(o,t()).then((function(){return a}))}:t,a?function(a){return promiseResolve(o,t()).then((function(){throw a}))}:t)}});var sa=z.Promise;_export({target:"Promise",stat:!0,forced:!0},{try:function(t){var o=Ai.f(this),a=perform(t);return(a.error?o.reject:o.resolve)(a.value),o.promise}});var ca=sa,ua=C([].reverse),la=[1,2];_export({target:"Array",proto:!0,forced:String(la)===String(la.reverse())},{reverse:function reverse(){return _t(this)&&(this.length=this.length),ua(this)}});var fa=entryVirtual("Array").reverse,pa=Array.prototype,reverse=function(t){var o=t.reverse;return t===pa||K(pa,t)&&o===pa.reverse?fa:o},da=arrayMethodHasSpeciesSupport("slice"),ha=wellKnownSymbol("species"),ma=Array,ga=Math.max;_export({target:"Array",proto:!0,forced:!da},{slice:function slice(t,o){var a,c,h,m=toIndexedObject(this),v=lengthOfArrayLike(m),b=toAbsoluteIndex(t,v),x=toAbsoluteIndex(void 0===o?v:o,v);if(_t(m)&&(a=m.constructor,(qt(a)&&(a===ma||_t(a.prototype))||q(a)&&null===(a=a[ha]))&&(a=void 0),a===ma||void 0===a))return ht(m,b,x);for(c=new(void 0===a?ma:a)(ga(x-b,0)),h=0;b<x;b++,h++)b in m&&createProperty(c,h,m[b]);return c.length=h,c}});var va=entryVirtual("Array").slice,ya=Array.prototype,slice=function(t){var o=t.slice;return t===ya||K(ya,t)&&o===ya.slice?va:o},ba=createCommonjsModule((function(t){var o=to.default;function _regeneratorRuntime(){t.exports=_regeneratorRuntime=function _regeneratorRuntime(){return a},t.exports.__esModule=!0,t.exports.default=t.exports;var a={},c=Object.prototype,h=c.hasOwnProperty,m="function"==typeof $n?$n:{},v=m.iterator||"@@iterator",b=m.asyncIterator||"@@asyncIterator",x=m.toStringTag||"@@toStringTag";function define(t,o,a){return oo(t,o,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{define({},"")}catch(t){define=function define(t,o,a){return t[o]=a}}function wrap(t,o,a,c){var h=o&&o.prototype instanceof Generator?o:Generator,m=ut(h.prototype),v=new Context(c||[]);return m._invoke=function(t,o,a){var c="suspendedStart";return function(h,m){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===h)throw m;return doneResult()}for(a.method=h,a.arg=m;;){var v=a.delegate;if(v){var b=maybeInvokeDelegate(v,a);if(b){if(b===w)continue;return b}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===c)throw c="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c="executing";var x=tryCatch(t,o,a);if("normal"===x.type){if(c=a.done?"completed":"suspendedYield",x.arg===w)continue;return{value:x.arg,done:a.done}}"throw"===x.type&&(c="completed",a.method="throw",a.arg=x.arg)}}}(t,a,v),m}function tryCatch(t,o,a){try{return{type:"normal",arg:t.call(o,a)}}catch(t){return{type:"throw",arg:t}}}a.wrap=wrap;var w={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var S={};define(S,v,(function(){return this}));var k=ao&&ao(ao(values([])));k&&k!==c&&h.call(k,v)&&(S=k);var _=GeneratorFunctionPrototype.prototype=Generator.prototype=ut(S);function defineIteratorMethods(t){var o;forEach$1(o=["next","throw","return"]).call(o,(function(o){define(t,o,(function(t){return this._invoke(o,t)}))}))}function AsyncIterator(t,a){function invoke(c,m,v,b){var x=tryCatch(t[c],t,m);if("throw"!==x.type){var w=x.arg,S=w.value;return S&&"object"==o(S)&&h.call(S,"__await")?a.resolve(S.__await).then((function(t){invoke("next",t,v,b)}),(function(t){invoke("throw",t,v,b)})):a.resolve(S).then((function(t){w.value=t,v(w)}),(function(t){return invoke("throw",t,v,b)}))}b(x.arg)}var c;this._invoke=function(t,o){function callInvokeWithMethodAndArg(){return new a((function(a,c){invoke(t,o,a,c)}))}return c=c?c.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,o){var a=t.iterator[o.method];if(void 0===a){if(o.delegate=null,"throw"===o.method){if(t.iterator.return&&(o.method="return",o.arg=void 0,maybeInvokeDelegate(t,o),"throw"===o.method))return w;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return w}var c=tryCatch(a,t.iterator,o.arg);if("throw"===c.type)return o.method="throw",o.arg=c.arg,o.delegate=null,w;var h=c.arg;return h?h.done?(o[t.resultName]=h.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=void 0),o.delegate=null,w):h:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,w)}function pushTryEntry(t){var o={tryLoc:t[0]};1 in t&&(o.catchLoc=t[1]),2 in t&&(o.finallyLoc=t[2],o.afterLoc=t[3]),this.tryEntries.push(o)}function resetTryEntry(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function Context(t){this.tryEntries=[{tryLoc:"root"}],forEach$1(t).call(t,pushTryEntry,this),this.reset(!0)}function values(t){if(t){var o=t[v];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,c=function next(){for(;++a<t.length;)if(h.call(t,a))return next.value=t[a],next.done=!1,next;return next.value=void 0,next.done=!0,next};return c.next=c}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(_,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,x,"GeneratorFunction"),a.isGeneratorFunction=function(t){var o="function"==typeof t&&t.constructor;return!!o&&(o===GeneratorFunction||"GeneratorFunction"===(o.displayName||o.name))},a.mark=function(t){return dt?dt(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,x,"GeneratorFunction")),t.prototype=ut(_),t},a.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,b,(function(){return this})),a.AsyncIterator=AsyncIterator,a.async=function(t,o,c,h,m){void 0===m&&(m=ca);var v=new AsyncIterator(wrap(t,o,c,h),m);return a.isGeneratorFunction(o)?v:v.next().then((function(t){return t.done?t.value:v.next()}))},defineIteratorMethods(_),define(_,x,"Generator"),define(_,v,(function(){return this})),define(_,"toString",(function(){return"[object Generator]"})),a.keys=function(t){var o=[];for(var a in t)o.push(a);return reverse(o).call(o),function next(){for(;o.length;){var a=o.pop();if(a in t)return next.value=a,next.done=!1,next}return next.done=!0,next}},a.values=values,Context.prototype={constructor:Context,reset:function reset(t){var o;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,forEach$1(o=this.tryEntries).call(o,resetTryEntry),!t)for(var a in this)"t"===a.charAt(0)&&h.call(this,a)&&!isNaN(+slice(a).call(a,1))&&(this[a]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var o=this;function handle(a,c){return m.type="throw",m.arg=t,o.next=a,c&&(o.method="next",o.arg=void 0),!!c}for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a],m=c.completion;if("root"===c.tryLoc)return handle("end");if(c.tryLoc<=this.prev){var v=h.call(c,"catchLoc"),b=h.call(c,"finallyLoc");if(v&&b){if(this.prev<c.catchLoc)return handle(c.catchLoc,!0);if(this.prev<c.finallyLoc)return handle(c.finallyLoc)}else if(v){if(this.prev<c.catchLoc)return handle(c.catchLoc,!0)}else{if(!b)throw new Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return handle(c.finallyLoc)}}}},abrupt:function abrupt(t,o){for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a];if(c.tryLoc<=this.prev&&h.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var m=c;break}}m&&("break"===t||"continue"===t)&&m.tryLoc<=o&&o<=m.finallyLoc&&(m=null);var v=m?m.completion:{};return v.type=t,v.arg=o,m?(this.method="next",this.next=m.finallyLoc,w):this.complete(v)},complete:function complete(t,o){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&o&&(this.next=o),w},finish:function finish(t){for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),w}},catch:function _catch(t){for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o];if(a.tryLoc===t){var c=a.completion;if("throw"===c.type){var h=c.arg;resetTryEntry(a)}return h}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,o,a){return this.delegate={iterator:values(t),resultName:o,nextLoc:a},"next"===this.method&&(this.arg=void 0),w}},a}t.exports=_regeneratorRuntime,t.exports.__esModule=!0,t.exports.default=t.exports})),xa=ba(),wa=xa;try{regeneratorRuntime=xa}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=xa:Function("r","regeneratorRuntime = r")(xa)}_export({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991});var Sa=9007199254740991,ka=Object.assign,_a=Object.defineProperty,Ta=C([].concat),Ca=!ka||fails((function(){if(M&&1!==ka({b:1},ka(_a({},"a",{enumerable:!0,get:function(){_a(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},o={},a=Symbol(),c="abcdefghijklmnopqrst";return t[a]=7,c.split("").forEach((function(t){o[t]=t})),7!=ka({},t)[a]||tt(ka({},o)).join("")!=c}))?function assign(t,o){for(var a=toObject(t),c=arguments.length,h=1,m=ir.f,v=A.f;c>h;)for(var b,x=U(arguments[h++]),w=m?Ta(tt(x),m(x)):tt(x),S=w.length,k=0;S>k;)b=w[k++],M&&!O(v,x,b)||(a[b]=x[b]);return a}:ka;_export({target:"Object",stat:!0,arity:2,forced:Object.assign!==Ca},{assign:Ca});var Ma=z.Object.assign,Ea=Date,Oa=C(Ea.prototype.getTime);_export({target:"Date",stat:!0},{now:function now(){return Oa(new Ea)}});var Pa=z.Date.now;z.JSON||(z.JSON={stringify:JSON.stringify});var Ia=function stringify(t,o,a){return w(z.JSON.stringify,null,arguments)},Aa=Ia;function __rest(t,o){var a={};for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.indexOf(c)<0&&(a[c]=t[c]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var h=0;for(c=Object.getOwnPropertySymbols(t);h<c.length;h++)o.indexOf(c[h])<0&&Object.prototype.propertyIsEnumerable.call(t,c[h])&&(a[c[h]]=t[c[h]])}return a}function __awaiter(t,o,a,c){return new(a||(a=Promise))((function(h,m){function fulfilled(t){try{step(c.next(t))}catch(t){m(t)}}function rejected(t){try{step(c.throw(t))}catch(t){m(t)}}function step(t){t.done?h(t.value):function adopt(t){return t instanceof a?t:new a((function(o){o(t)}))}(t.value).then(fulfilled,rejected)}step((c=c.apply(t,o||[])).next())}))}var ja=fails((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Ra=Object.isExtensible,La=fails((function(){Ra(1)}))||ja?function isExtensible(t){return!!q(t)&&((!ja||"ArrayBuffer"!=classofRaw(t))&&(!Ra||Ra(t)))}:Ra,Fa=!fails((function(){return Object.isExtensible(Object.preventExtensions({}))})),Na=createCommonjsModule((function(t){var o=qe.f,a=!1,c=uid("meta"),h=0,setMetadata=function(t){o(t,c,{value:{objectID:"O"+h++,weakData:{}}})},m=t.exports={enable:function(){m.enable=function(){},a=!0;var t=Zt.f,o=C([].splice),h={};h[c]=1,t(h).length&&(Zt.f=function(a){for(var h=t(a),m=0,v=h.length;m<v;m++)if(h[m]===c){o(h,m,1);break}return h},_export({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:or.f}))},fastKey:function(t,o){if(!q(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!le(t,c)){if(!La(t))return"F";if(!o)return"E";setMetadata(t)}return t[c].objectID},getWeakData:function(t,o){if(!le(t,c)){if(!La(t))return!0;if(!o)return!1;setMetadata(t)}return t[c].weakData},onFreeze:function(t){return Fa&&a&&La(t)&&!le(t,c)&&setMetadata(t),t}};Xe[c]=!0})),Ua=qe.f,Da=kr.forEach,Ba=wr.set,qa=wr.getterFor,defineBuiltIns=function(t,o,a){for(var c in o)a&&a.unsafe&&t[c]?t[c]=o[c]:defineBuiltIn(t,c,o[c],a);return t},za=qe.f,Ka=Na.fastKey,Ha=wr.set,Ga=wr.getterFor,$a={getConstructor:function(t,o,a,c){var h=t((function(t,h){anInstance(t,m),Ha(t,{type:o,index:st(null),first:void 0,last:void 0,size:0}),M||(t.size=0),isNullOrUndefined(h)||iterate(h,t[c],{that:t,AS_ENTRIES:a})})),m=h.prototype,v=Ga(o),define=function(t,o,a){var c,h,m=v(t),b=getEntry(t,o);return b?b.value=a:(m.last=b={index:h=Ka(o,!0),key:o,value:a,previous:c=m.last,next:void 0,removed:!1},m.first||(m.first=b),c&&(c.next=b),M?m.size++:t.size++,"F"!==h&&(m.index[h]=b)),t},getEntry=function(t,o){var a,c=v(t),h=Ka(o);if("F"!==h)return c.index[h];for(a=c.first;a;a=a.next)if(a.key==o)return a};return defineBuiltIns(m,{clear:function clear(){for(var t=v(this),o=t.index,a=t.first;a;)a.removed=!0,a.previous&&(a.previous=a.previous.next=void 0),delete o[a.index],a=a.next;t.first=t.last=void 0,M?t.size=0:this.size=0},delete:function(t){var o=this,a=v(o),c=getEntry(o,t);if(c){var h=c.next,m=c.previous;delete a.index[c.index],c.removed=!0,m&&(m.next=h),h&&(h.previous=m),a.first==c&&(a.first=h),a.last==c&&(a.last=m),M?a.size--:o.size--}return!!c},forEach:function forEach(t){for(var o,a=v(this),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0);o=o?o.next:a.first;)for(c(o.value,o.key,this);o&&o.removed;)o=o.previous},has:function has(t){return!!getEntry(this,t)}}),defineBuiltIns(m,a?{get:function get(t){var o=getEntry(this,t);return o&&o.value},set:function set(t,o){return define(this,0===t?0:t,o)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}}),M&&za(m,"size",{get:function(){return v(this).size}}),h},setStrong:function(t,o,a){var c=o+" Iterator",h=Ga(o),m=Ga(c);iteratorDefine(t,o,(function(t,o){Ha(this,{type:c,target:t,state:h(t),kind:o,last:void 0})}),(function(){for(var t=m(this),o=t.kind,a=t.last;a&&a.removed;)a=a.previous;return t.target&&(t.last=a=a?a.next:t.state.first)?"keys"==o?{value:a.key,done:!1}:"values"==o?{value:a.value,done:!1}:{value:[a.key,a.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),a?"entries":"values",!a,!0),setSpecies(o)}};!function(t,o,a){var c,m=-1!==t.indexOf("Map"),v=-1!==t.indexOf("Weak"),b=m?"set":"add",x=h[t],w=x&&x.prototype,S={};if(M&&isCallable(x)&&(v||w.forEach&&!fails((function(){(new x).entries().next()})))){var k=(c=o((function(o,a){Ba(anInstance(o,k),{type:t,collection:new x}),null!=a&&iterate(a,o[b],{that:o,AS_ENTRIES:m})}))).prototype,_=qa(t);Da(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var o="add"==t||"set"==t;!(t in w)||v&&"clear"==t||ze(k,t,(function(a,c){var h=_(this).collection;if(!o&&v&&!q(a))return"get"==t&&void 0;var m=h[t](0===a?0:a,c);return o?this:m}))})),v||Ua(k,"size",{configurable:!0,get:function(){return _(this).collection.size}})}else c=a.getConstructor(o,t,m,b),Na.enable();setToStringTag(c,t,!1,!0),S[t]=c,_export({global:!0,forced:!0},S),v||a.setStrong(c,t,m)}("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),$a);var Wa=z.Map,Va=[].push;_export({target:"Map",stat:!0,forced:!0},{from:function from(t){var o,a,c,h,m=arguments.length,v=m>1?arguments[1]:void 0;return aConstructor(this),(o=void 0!==v)&&aCallable(v),isNullOrUndefined(t)?new this:(a=[],o?(c=0,h=functionBindContext(v,m>2?arguments[2]:void 0),iterate(t,(function(t){O(Va,a,h(t,c++))}))):iterate(t,Va,{that:a}),new this(a))}});_export({target:"Map",stat:!0,forced:!0},{of:function of(){return new this(ht(arguments))}});_export({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function deleteAll(){for(var t,o=anObject(this),a=aCallable(o.delete),c=!0,h=0,m=arguments.length;h<m;h++)t=O(a,o,arguments[h]),c=c&&t;return!!c}});_export({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function emplace(t,o){var a,c,h=anObject(this),m=aCallable(h.get),v=aCallable(h.has),b=aCallable(h.set);return O(v,h,t)?(a=O(m,h,t),"update"in o&&(a=o.update(a,t,h),O(b,h,t,a)),a):(c=o.insert(t,h),O(b,h,t,c),c)}});var Qa=getIterator;_export({target:"Map",proto:!0,real:!0,forced:!0},{every:function every(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return!iterate(a,(function(t,a,h){if(!c(a,t,o))return h()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{filter:function filter(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0),h=new(speciesConstructor(o,getBuiltIn("Map"))),m=aCallable(h.set);return iterate(a,(function(t,a){c(a,t,o)&&O(m,h,t,a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),h}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{find:function find(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(a,(function(t,a,h){if(c(a,t,o))return h(a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function findKey(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(a,(function(t,a,h){if(c(a,t,o))return h(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});var Ja=C([].push);_export({target:"Map",stat:!0,forced:!0},{groupBy:function groupBy(t,o){aCallable(o);var a=getIterator(t),c=new this,h=aCallable(c.has),m=aCallable(c.get),v=aCallable(c.set);return iterate(a,(function(t){var a=o(t);O(h,c,a)?Ja(O(m,c,a),t):O(v,c,a,[t])}),{IS_ITERATOR:!0}),c}});_export({target:"Map",proto:!0,real:!0,forced:!0},{includes:function includes(t){return iterate(Qa(anObject(this)),(function(o,a,c){if((h=a)===(m=t)||h!=h&&m!=m)return c();var h,m}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",stat:!0,forced:!0},{keyBy:function keyBy(t,o){var a=new this;aCallable(o);var c=aCallable(a.set);return iterate(t,(function(t){O(c,a,o(t),t)})),a}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function keyOf(t){return iterate(Qa(anObject(this)),(function(o,a,c){if(a===t)return c(o)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function mapKeys(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0),h=new(speciesConstructor(o,getBuiltIn("Map"))),m=aCallable(h.set);return iterate(a,(function(t,a){O(m,h,c(a,t,o),a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),h}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function mapValues(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0),h=new(speciesConstructor(o,getBuiltIn("Map"))),m=aCallable(h.set);return iterate(a,(function(t,a){O(m,h,t,c(a,t,o))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),h}}),_export({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function merge(t){for(var o=anObject(this),a=aCallable(o.set),c=arguments.length,h=0;h<c;)iterate(arguments[h++],a,{that:o,AS_ENTRIES:!0});return o}});var Xa=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function reduce(t){var o=anObject(this),a=Qa(o),c=arguments.length<2,h=c?void 0:arguments[1];if(aCallable(t),iterate(a,(function(a,m){c?(c=!1,h=m):h=t(h,m,a,o)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),c)throw Xa("Reduce of empty map with no initial value");return h}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{some:function some(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(a,(function(t,a,h){if(c(a,t,o))return h()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var Ya=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{update:function update(t,o){var a=anObject(this),c=aCallable(a.get),h=aCallable(a.has),m=aCallable(a.set),v=arguments.length;aCallable(o);var b=O(h,a,t);if(!b&&v<3)throw Ya("Updating absent value");var x=b?O(c,a,t):aCallable(v>2?arguments[2]:void 0)(t,a);return O(m,a,t,o(x,t,a)),a}});var Za=TypeError,es=function upsert(t,o){var a,c=anObject(this),h=aCallable(c.get),m=aCallable(c.has),v=aCallable(c.set),b=arguments.length>2?arguments[2]:void 0;if(!isCallable(o)&&!isCallable(b))throw Za("At least one callback required");return O(m,c,t)?(a=O(h,c,t),isCallable(o)&&(a=o(a),O(v,c,t,a))):isCallable(b)&&(a=b(),O(v,c,t,a)),a};_export({target:"Map",proto:!0,real:!0,forced:!0},{upsert:es}),_export({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:es});var ts=Wa,rs=entryVirtual("Array").concat,ns=Array.prototype,concat=function(t){var o=t.concat;return t===ns||K(ns,t)&&o===ns.concat?rs:o},os=/MSIE .\./.test(H),is=h.Function,wrap=function(t){return os?function(o,a){var c=validateArgumentsLength(arguments.length,1)>2,h=isCallable(o)?o:is(o),m=c?ht(arguments,2):void 0;return t(c?function(){w(h,this,m)}:h,a)}:t},as={setTimeout:wrap(h.setTimeout),setInterval:wrap(h.setInterval)},ss=as.setInterval;_export({global:!0,bind:!0,forced:h.setInterval!==ss},{setInterval:ss});var cs=as.setTimeout;_export({global:!0,bind:!0,forced:h.setTimeout!==cs},{setTimeout:cs});var us=z.setTimeout,ls=kr.map,fs=arrayMethodHasSpeciesSupport("map");_export({target:"Array",proto:!0,forced:!fs},{map:function map(t){return ls(this,t,arguments.length>1?arguments[1]:void 0)}});var ps=entryVirtual("Array").map,ds=Array.prototype,map=function(t){var o=t.map;return t===ds||K(ds,t)&&o===ds.map?ps:o},hs=createCommonjsModule((function(t){var o=Object.prototype.hasOwnProperty,a="~";function Events(){}function EE(t,o,a){this.fn=t,this.context=o,this.once=a||!1}function addListener(t,o,c,h,m){if("function"!=typeof c)throw new TypeError("The listener must be a function");var v=new EE(c,h||t,m),b=a?a+o:o;return t._events[b]?t._events[b].fn?t._events[b]=[t._events[b],v]:t._events[b].push(v):(t._events[b]=v,t._eventsCount++),t}function clearEvent(t,o){0==--t._eventsCount?t._events=new Events:delete t._events[o]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(a=!1)),EventEmitter.prototype.eventNames=function eventNames(){var t,c,h=[];if(0===this._eventsCount)return h;for(c in t=this._events)o.call(t,c)&&h.push(a?c.slice(1):c);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(t)):h},EventEmitter.prototype.listeners=function listeners(t){var o=a?a+t:t,c=this._events[o];if(!c)return[];if(c.fn)return[c.fn];for(var h=0,m=c.length,v=new Array(m);h<m;h++)v[h]=c[h].fn;return v},EventEmitter.prototype.listenerCount=function listenerCount(t){var o=a?a+t:t,c=this._events[o];return c?c.fn?1:c.length:0},EventEmitter.prototype.emit=function emit(t,o,c,h,m,v){var b=a?a+t:t;if(!this._events[b])return!1;var x,w,S=this._events[b],k=arguments.length;if(S.fn){switch(S.once&&this.removeListener(t,S.fn,void 0,!0),k){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,o),!0;case 3:return S.fn.call(S.context,o,c),!0;case 4:return S.fn.call(S.context,o,c,h),!0;case 5:return S.fn.call(S.context,o,c,h,m),!0;case 6:return S.fn.call(S.context,o,c,h,m,v),!0}for(w=1,x=new Array(k-1);w<k;w++)x[w-1]=arguments[w];S.fn.apply(S.context,x)}else{var _,T=S.length;for(w=0;w<T;w++)switch(S[w].once&&this.removeListener(t,S[w].fn,void 0,!0),k){case 1:S[w].fn.call(S[w].context);break;case 2:S[w].fn.call(S[w].context,o);break;case 3:S[w].fn.call(S[w].context,o,c);break;case 4:S[w].fn.call(S[w].context,o,c,h);break;default:if(!x)for(_=1,x=new Array(k-1);_<k;_++)x[_-1]=arguments[_];S[w].fn.apply(S[w].context,x)}}return!0},EventEmitter.prototype.on=function on(t,o,a){return addListener(this,t,o,a,!1)},EventEmitter.prototype.once=function once(t,o,a){return addListener(this,t,o,a,!0)},EventEmitter.prototype.removeListener=function removeListener(t,o,c,h){var m=a?a+t:t;if(!this._events[m])return this;if(!o)return clearEvent(this,m),this;var v=this._events[m];if(v.fn)v.fn!==o||h&&!v.once||c&&v.context!==c||clearEvent(this,m);else{for(var b=0,x=[],w=v.length;b<w;b++)(v[b].fn!==o||h&&!v[b].once||c&&v[b].context!==c)&&x.push(v[b]);x.length?this._events[m]=1===x.length?x[0]:x:clearEvent(this,m)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(t){var o;return t?(o=a?a+t:t,this._events[o]&&clearEvent(this,o)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=a,EventEmitter.EventEmitter=EventEmitter,t.exports=EventEmitter})),ms=Backoff;function Backoff(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var o=Math.random(),a=Math.floor(o*this.jitter*t);t=0==(1&Math.floor(10*o))?t-a:t+a}return 0|Math.min(t,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(t){this.ms=t},Backoff.prototype.setMax=function(t){this.max=t},Backoff.prototype.setJitter=function(t){this.jitter=t};var gs="object"==typeof t&&t&&t.Object===Object&&t,vs="object"==typeof self&&self&&self.Object===Object&&self,ys=gs||vs||Function("return this")(),bs=ys.Symbol,xs=Object.prototype,ws=xs.hasOwnProperty,Ss=xs.toString,ks=bs?bs.toStringTag:void 0;var _s=function getRawTag(t){var o=ws.call(t,ks),a=t[ks];try{t[ks]=void 0;var c=!0}catch(t){}var h=Ss.call(t);return c&&(o?t[ks]=a:delete t[ks]),h},Ts=Object.prototype.toString;var Cs=function objectToString(t){return Ts.call(t)},Ms=bs?bs.toStringTag:void 0;var Es=function baseGetTag(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Ms&&Ms in Object(t)?_s(t):Cs(t)};var Os=function isObject(t){var o=typeof t;return null!=t&&("object"==o||"function"==o)};var Ps=function isFunction(t){if(!Os(t))return!1;var o=Es(t);return"[object Function]"==o||"[object GeneratorFunction]"==o||"[object AsyncFunction]"==o||"[object Proxy]"==o},Is={deviceId:"",timeout:8e3},As={account:"",appkey:"",token:"",debugLevel:"off",needReconnect:!0,reconnectionAttempts:Sa,isAbtestEnable:!0,abtestUrl:"https://abt-online.netease.im/v1/api/abt/client/getExperimentInfo",abtestProjectKey:"imElite_sdk_abtest_web"},js=Je.includes,Rs=fails((function(){return!Array(1).includes()}));_export({target:"Array",proto:!0,forced:Rs},{includes:function includes(t){return js(this,t,arguments.length>1?arguments[1]:void 0)}});var Ls=entryVirtual("Array").includes,Fs=wellKnownSymbol("match"),Ns=TypeError,notARegexp=function(t){if(function(t){var o;return q(t)&&(void 0!==(o=t[Fs])?!!o:"RegExp"==classofRaw(t))}(t))throw Ns("The method doesn't accept regular expressions");return t},Us=wellKnownSymbol("match"),Ds=C("".indexOf);_export({target:"String",proto:!0,forced:!function(t){var o=/./;try{"/./"[t](o)}catch(a){try{return o[Us]=!1,"/./"[t](o)}catch(t){}}return!1}("includes")},{includes:function includes(t){return!!~Ds(toString$1(requireObjectCoercible(this)),toString$1(notARegexp(t)),arguments.length>1?arguments[1]:void 0)}});var Bs=entryVirtual("String").includes,qs=Array.prototype,zs=String.prototype,includes=function(t){var o=t.includes;return t===qs||K(qs,t)&&o===qs.includes?Ls:"string"==typeof t||t===zs||K(zs,t)&&o===zs.includes?Bs:o},Ks=kr.findIndex,Hs="findIndex",Gs=!0;Hs in[]&&Array(1).findIndex((function(){Gs=!1})),_export({target:"Array",proto:!0,forced:Gs},{findIndex:function findIndex(t){return Ks(this,t,arguments.length>1?arguments[1]:void 0)}});var $s=entryVirtual("Array").findIndex,Ws=Array.prototype,findIndex=function(t){var o=t.findIndex;return t===Ws||K(Ws,t)&&o===Ws.findIndex?$s:o},Vs=createCommonjsModule((function(t){function _getPrototypeOf(o){var a;return t.exports=_getPrototypeOf=dt?bind$1(a=ao).call(a):function _getPrototypeOf(t){return t.__proto__||ao(t)},t.exports.__esModule=!0,t.exports.default=t.exports,_getPrototypeOf(o)}t.exports=_getPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),Qs=Je.indexOf,Js=C([].indexOf),Xs=!!Js&&1/Js([1],1,-0)<0,Ys=arrayMethodIsStrict("indexOf");_export({target:"Array",proto:!0,forced:Xs||!Ys},{indexOf:function indexOf(t){var o=arguments.length>1?arguments[1]:void 0;return Xs?Js(this,t,o)||0:Qs(this,t,o)}});var Zs=entryVirtual("Array").indexOf,ec=Array.prototype,indexOf=function(t){var o=t.indexOf;return t===ec||K(ec,t)&&o===ec.indexOf?Zs:o},tc=createCommonjsModule((function(t){t.exports=function _isNativeFunction(t){var o;return-1!==indexOf(o=Function.toString.call(t)).call(o,"[native code]")},t.exports.__esModule=!0,t.exports.default=t.exports})),rc=getBuiltIn("Reflect","construct"),nc=Object.prototype,oc=[].push,ic=fails((function(){function F(){}return!(rc((function(){}),[],F)instanceof F)})),ac=!fails((function(){rc((function(){}))})),sc=ic||ac;_export({target:"Reflect",stat:!0,forced:sc,sham:sc},{construct:function construct(t,o){aConstructor(t),anObject(o);var a=arguments.length<3?t:aConstructor(arguments[2]);if(ac&&!ic)return rc(t,o,a);if(t==a){switch(o.length){case 0:return new t;case 1:return new t(o[0]);case 2:return new t(o[0],o[1]);case 3:return new t(o[0],o[1],o[2]);case 4:return new t(o[0],o[1],o[2],o[3])}var c=[null];return w(oc,c,o),new(w(bt,t,c))}var h=a.prototype,m=st(q(h)?h:nc),v=w(t,m,o);return q(v)?v:m}});var cc=z.Reflect.construct,uc=createCommonjsModule((function(t){t.exports=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!cc)return!1;if(cc.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(cc(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports})),lc=createCommonjsModule((function(t){function _construct(o,a,c){var h;uc()?(t.exports=_construct=bind$1(h=cc).call(h),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=_construct=function _construct(t,o,a){var c=[null];c.push.apply(c,o);var h=new(bind$1(Function).apply(t,c));return a&&St(h,a.prototype),h},t.exports.__esModule=!0,t.exports.default=t.exports);return _construct.apply(null,arguments)}t.exports=_construct,t.exports.__esModule=!0,t.exports.default=t.exports})),fc=createCommonjsModule((function(t){function _wrapNativeSuper(o){var a="function"==typeof ts?new ts:void 0;return t.exports=_wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!tc(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==a){if(a.has(t))return a.get(t);a.set(t,Wrapper)}function Wrapper(){return lc(t,arguments,Vs(this).constructor)}return Wrapper.prototype=ut(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),St(Wrapper,t)},t.exports.__esModule=!0,t.exports.default=t.exports,_wrapNativeSuper(o)}t.exports=_wrapNativeSuper,t.exports.__esModule=!0,t.exports.default=t.exports})),pc=function(t){function CustomError(o,a,c){var h;return void 0===a&&(a={}),void 0===c&&(c=400),(h=t.call(this,o)||this).data=a,h.code=c,h.name="customError",h}return kt(CustomError,t),CustomError}(getDefaultExportFromCjs(fc)(Error)),dc=function(t){function ValidateError(o,a,c){var h;return void 0===a&&(a={}),(h=t.call(this,o,a,414)||this).code=414,h.name="validateError",h.rules=c,h}return kt(ValidateError,t),ValidateError}(pc),hc={200:null,406:null,808:null,810:null,201:"The client version is incorrect. You need to upgrade the SDK",302:"The user name or password is incorrect. Please check whether the appkey and token are valid and whether the account and token match",403:"Illegal operation or no permission",404:"Target object does not exist",405:"Parameter length too long",408:"Client request timed out",414:"Request parameter error",415:"Service unavailable",416:"Frequency control",417:"Repeat operation",422:"Account disabled",500:"Server internal error",503:"Server busy",508:"Expiration date",509:"Invalid",7101:"Be pulled black",700:"Partial failure of batch operation",801:"The number of people in the team has reached the upper limit",802:"No permission",803:"The team does not exist or has not changed",804:"The user is not in the team",805:"Team type mismatch",806:"The number of teams created has reached the limit",807:"Team member not valid",809:"Already in the team",811:"The number of accounts in the forced push list exceeds the limit",812:"The team is muted",813:"Due to the limited number of team, some pull people successfully",814:"Disable team message read service",815:"Maximum number of team administrators",816:"Batch operation partial failure",997:"The packet has expired",998:"Deserialize packet error",999:"Serialize packet error",9102:"Channel failure",9103:"This call has been answered / rejected at another end",10201:"Signaling: target NIM client is offline",10202:"Signaling: push is unreachable",10404:"Signaling: channel not exists",10405:"Signaling: channel already exists",10406:"Signaling: member of channel not exists",10407:"Signaling: member of channel already exists",10408:"Signaling: the invitation request does not exist or has expired",10409:"Signaling: the invitation request has been rejected",10410:"Signaling: the invitation request has been accepted",10414:"Signaling: request parameter error",10417:"Signaling: uid conflict",10419:"Signaling: the number of members of channel exceed the limit",10420:"Signaling: member is already in the channel on other client",10700:"Signaling: phased success",13002:"Abnormal chatroom status",13003:"In the blacklist",13004:"In the mute list",13006:"All members are muted, and only the administrator can speak"},mc=function(t){function CmdError(o,a,c,h,m){var v;return void 0===c&&(c=""),void 0===h&&(h=(new Date).getTime()),void 0===m&&(m={}),c=c||hc[o],(v=t.call(this,c,m,o)||this).name="cmdError",v.cmd=a,v.timetag=h,v}return kt(CmdError,t),CmdError}(pc);var gc=function(t){function UploadError(o,a,c,h,m){var v;return(v=t.call(this,o,{file:m},400)||this).name="uploadError",v.rawError=a,v.curProvider=c||1,v.mixStorePolicy=h,v}return kt(UploadError,t),UploadError}(pc),vc=["error","warn","log","debug"],yc=function emptyFunc(){},bc=["off","error","warn","log","debug"],xc=function(){function Logger(t,o){this.name=o,this.strategies={debug:console.log,log:console.log,warn:console.warn,error:console.error},this.debug=yc,this.log=yc,this.warn=yc,this.error=yc,this.name=o,Logger.instancesName.push(o),includes(bc).call(bc,t)||(t="off"),this.setLogFunc(t)}var t=Logger.prototype;return t.setLogFunc=function setLogFunc(t){var o=this,a=findIndex(vc).call(vc,(function(o){return o===t}));forEach$1(vc).call(vc,(function(t,c){c<=a&&(o[t]=function(){var o=slice(Array.prototype).call(arguments),a=this.formatArgs(o,t);this.strategies[t](a)})}))},t.formatArgs=function formatArgs(t,o){var a=new Date,c=a.getMonth()+1+"-"+a.getDate()+" "+a.getHours()+":"+a.getMinutes()+":"+a.getSeconds()+":"+a.getMilliseconds();return"[NIM "+o+" "+this.name+" "+c+"] "+map(t).call(t,(function(t){return t instanceof pc?t.name+", "+t.code+", "+t.message:t instanceof Error?t&&t.message?t.message:t:"object"==typeof t?Aa(t):t})).join(" ")},Logger}();xc.instancesName=[];var wc=createCommonjsModule((function(t,o){t.exports=function(){function _classCallCheck(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,o){for(var a=0;a<o.length;a++){var c=o[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function _createClass(t,o,a){return o&&_defineProperties(t.prototype,o),a&&_defineProperties(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function __rest(t,o){var a={};for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.indexOf(c)<0&&(a[c]=t[c]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var h=0;for(c=Object.getOwnPropertySymbols(t);h<c.length;h++)o.indexOf(c[h])<0&&Object.prototype.propertyIsEnumerable.call(t,c[h])&&(a[c[h]]=t[c[h]])}return a}var t={reportUrl:"https://statistic.live.126.net/statics/report/common/form",maxSize:100,msgListMaxSize:1e3,cacheMaxSize:1e3,maxDelay:3e5,maxInterval:3e4,minInterval:1e4,timeout:5e3,autoStart:!0},o="https://statistic.live.126.net/dispatcher/req",a=function emptyFn(){},c=function(){function Reporter(o){_classCallCheck(this,Reporter),this.enable=!1,this.initConfigLoaded=!1,this.loading=!1,this.isDestroyed=!1,this.reportConfig=t,this.msgList=[],this.traceMsgCache={},this.lowPriorityMsgList=[],this.cacheMsgList=[],this.lastReportTime=Date.now(),this.timer=null,this.setConfig(o),this.reportConfig.autoStart&&this.initUploadConfig()}return _createClass(Reporter,[{key:"setConfig",value:function setConfig(t){this.reportConfig=Object.assign({},this.reportConfig,t)}},{key:"reportImmediately",value:function reportImmediately(t,o){var a=this;this.reportConfig.request(t,Object.assign({dataType:"json",method:"POST",timeout:this.reportConfig.timeout},o)).catch((function(t){var o,c;null===(c=null===(o=a.reportConfig)||void 0===o?void 0:o.logger)||void 0===c||c.warn("Reporter immediately upload failed",t)}))}},{key:"report",value:function report(t,o){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t){var c=Date.now();a?this.lowPriorityMsgList.push({module:t,msg:o,createTime:c}):this.msgList.push({module:t,msg:o,createTime:c}),this.msgList.length>this.reportConfig.msgListMaxSize&&this.msgList.shift(),this.lowPriorityMsgList.length>this.reportConfig.msgListMaxSize&&this.lowPriorityMsgList.shift(),this.doReport()}}},{key:"reportTraceStart",value:function reportTraceStart(t,o){if(t&&!this.traceMsgCache[t]){var a=Object.assign(Object.assign({start_time:Date.now()},o),{extension:[]});this.traceMsgCache[t]=a}}},{key:"reportTraceUpdate",value:function reportTraceUpdate(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.traceMsgCache[t]){var c,h=o.operation_type,m=o.code,v=o.target,b=o.error,x=__rest(o,["operation_type","code","target","error"]),w=Date.now(),S=this.traceMsgCache[t].extension.length;c=0===S?this.traceMsgCache[t].start_time:this.traceMsgCache[t].extension[S-1].end_time,b&&b.code&&(m=b.code),this.traceMsgCache[t].extension.push({operation_type:h,code:m,succeed:a,target:v,duration:w-c,description:JSON.stringify(x),end_time:w})}}},{key:"reportTraceUpdateV2",value:function reportTraceUpdateV2(t,o){if(this.traceMsgCache[t]){var a=this.traceMsgCache[t].extension.length;o.end_time=0===a?this.traceMsgCache[t].start_time+(o.duration?o.duration:0):this.traceMsgCache[t].extension[a-1].end_time+(o.duration?o.duration:0),this.traceMsgCache[t].extension.push(o)}}},{key:"reportTraceEnd",value:function reportTraceEnd(t){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.traceMsgCache[t]&&("nos"!==t||!1===o?("boolean"==typeof o?this.traceMsgCache[t].succeed=!!o:this.traceMsgCache[t].state=o,this.traceMsgCache[t].duration=Date.now()-this.traceMsgCache[t].start_time,this.traceMsgCache[t].extension.forEach((function(t){delete t.end_time})),this.report(t,this.traceMsgCache[t]),this.traceMsgCache[t]=null):this.traceMsgCache[t]=null)}},{key:"pause",value:function pause(){this.enable=!1}},{key:"restore",value:function restore(){this.enable=!0,this.initConfigLoaded||this.initUploadConfig()}},{key:"destroy",value:function destroy(){var t=this;Object.keys(this.traceMsgCache).forEach((function(o){t.reportTraceEnd(o,1)})),null!==this.timer&&clearTimeout(this.timer),this.setConfig=a,this.report=a,this.reportTraceStart=a,this.reportTraceUpdate=a,this.reportTraceEnd=a,this.pause=a,this.restore=a,this.destroy=a,this.cacheMsgList=[],this.traceMsgCache={},this.lowPriorityMsgList=[],this.msgList=[],this.reportConfig={},this.isDestroyed=!0}},{key:"initUploadConfig",value:function initUploadConfig(){var t,a,c=this;if(!this.loading){this.loading=!0;var h=this.reportConfig.common||{};try{this.reportConfig.request(o,{method:"GET",dataType:"json",params:{deviceId:h.dev_id,sdkVer:h.sdk_ver,platform:h.platform,appkey:h.app_key},timeout:this.reportConfig.timeout}).then((function(t){var o,a;if(!c.isDestroyed){if(200===t.status&&t.data&&200===t.data.code){var h=t.data.data||{};c.reportConfig.maxSize=h.maxSize>1e3?1e3:h.maxSize,c.reportConfig.maxInterval=h.maxInterval>1e4?1e4:h.maxInterval,c.reportConfig.maxInterval=h.maxInterval<10?10:h.maxInterval,c.reportConfig.minInterval=h.minInterval<2?2:h.minInterval,c.reportConfig.maxDelay=h.maxDelay||300,c.reportConfig.maxInterval=1e3*c.reportConfig.maxInterval,c.reportConfig.minInterval=1e3*c.reportConfig.minInterval,c.reportConfig.maxDelay=1e3*c.reportConfig.maxDelay,c.enable=!0,c.initConfigLoaded=!0,c.loading=!1,c.reportHeartBeat()}null===(a=null===(o=c.reportConfig)||void 0===o?void 0:o.logger)||void 0===a||a.log("Get reporter upload config success")}})).catch((function(t){var o,a;c.loading=!1,null===(a=null===(o=c.reportConfig)||void 0===o?void 0:o.logger)||void 0===a||a.error("Get reporter upload config failed",t)}))}catch(o){this.loading=!1,null===(a=null===(t=this.reportConfig)||void 0===t?void 0:t.logger)||void 0===a||a.error("Exec reporter request failed",o)}}}},{key:"reportHeartBeat",value:function reportHeartBeat(){var t=this;this.isDestroyed||(this.timer=setTimeout((function(){t.reportHeartBeat()}),this.reportConfig.minInterval),this.doReport())}},{key:"doReport",value:function doReport(){if(!this.isDestroyed){var t=this.msgList.length+this.lowPriorityMsgList.length+this.cacheMsgList.length>2*this.reportConfig.maxSize?this.reportConfig.minInterval:this.reportConfig.maxInterval;Date.now()-this.lastReportTime>=t&&this.upload()}}},{key:"getUploadMsg",value:function getUploadMsg(){var t=this,o={},a=Date.now();this.msgList=this.msgList.filter((function(o){return a-o.createTime<t.reportConfig.maxDelay})),this.lowPriorityMsgList=this.lowPriorityMsgList.filter((function(o){return a-o.createTime<t.reportConfig.maxDelay})),this.cacheMsgList=this.cacheMsgList.filter((function(o){return a-o.createTime<t.reportConfig.maxDelay}));var c=this.msgList.slice(0,this.reportConfig.maxSize);if(this.msgList=this.msgList.slice(c.length),c.length<this.reportConfig.maxSize){var h=this.reportConfig.maxSize-c.length;c=c.concat(this.lowPriorityMsgList.slice(0,h)),this.lowPriorityMsgList=this.lowPriorityMsgList.slice(h)}if(c.length<this.reportConfig.maxSize){var m=this.reportConfig.maxSize-c.length;c=c.concat(this.cacheMsgList.slice(0,m)),this.cacheMsgList=this.cacheMsgList.slice(m)}return c.forEach((function(t){o[t.module]?o[t.module].push(t.msg):o[t.module]=[t.msg]})),{uploadMsgArr:c,uploadMsg:o}}},{key:"upload",value:function upload(){var t,o,a=this;if(this.enable&&!(this.lastReportTime&&Date.now()-this.lastReportTime<this.reportConfig.minInterval)){var c=this.getUploadMsg(),h=c.uploadMsgArr,m=c.uploadMsg;if(h.length){this.lastReportTime=Date.now();try{this.reportConfig.request(this.reportConfig.reportUrl,{dataType:"json",method:"POST",params:{common:this.reportConfig.common,event:m},headers:{sdktype:"im"},timeout:this.reportConfig.timeout}).catch((function(t){var o,c;a.cacheMsgList=a.cacheMsgList.concat(h).slice(0,a.reportConfig.cacheMaxSize),null===(c=null===(o=a.reportConfig)||void 0===o?void 0:o.logger)||void 0===c||c.warn("Reporter upload failed",t)}))}catch(a){null===(o=null===(t=this.reportConfig)||void 0===t?void 0:t.logger)||void 0===o||o.warn("Exec reporter request failed",a)}clearTimeout(this.timer),this.reportHeartBeat()}}}}]),Reporter}();return c}()})),Sc={setLogger:function setLogger(t){throw new Error("Function not implemented.")},platform:"",WebSocket:function(){function AdapterSocket(t,o){throw this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,new Error("Method not implemented.")}var t=AdapterSocket.prototype;return t.close=function close(t,o){throw new Error("Method not implemented.")},t.send=function send(t){throw new Error("Method not implemented.")},t.onclose=function onclose(t){throw new Error("Method not implemented.")},t.onerror=function onerror(t){throw new Error("Method not implemented.")},t.onmessage=function onmessage(t){throw new Error("Method not implemented.")},t.onopen=function onopen(t){throw new Error("Method not implemented.")},AdapterSocket}(),localStorage:{},request:function request(t,o){throw new Error("Function not implemented.")},uploadFile:function uploadFile(t){throw new Error("Function not implemented.")},getSystemInfo:function getSystemInfo(){throw new Error("Function not implemented.")}};var kc=TypeError,createMethod$1=function(t){return function(o,a,c,h){aCallable(a);var m=toObject(o),v=U(m),b=lengthOfArrayLike(m),x=t?b-1:0,w=t?-1:1;if(c<2)for(;;){if(x in v){h=v[x],x+=w;break}if(x+=w,t?x<0:b<=x)throw kc("Reduce of empty array with no initial value")}for(;t?x>=0:b>x;x+=w)x in v&&(h=a(h,v[x],x,m));return h}},_c={left:createMethod$1(!1),right:createMethod$1(!0)}.left,Tc=arrayMethodIsStrict("reduce");_export({target:"Array",proto:!0,forced:!Tc||!Fo&&J>79&&J<83},{reduce:function reduce(t){var o=arguments.length;return _c(this,t,o,o>1?arguments[1]:void 0)}});var Cc=entryVirtual("Array").reduce,Mc=Array.prototype,reduce=function(t){var o=t.reduce;return t===Mc||K(Mc,t)&&o===Mc.reduce?Cc:o},Ec=fails((function(){tt(1)}));_export({target:"Object",stat:!0,forced:Ec},{keys:function keys(t){return tt(toObject(t))}});var Oc=z.Object.keys;var Pc=function isUndefined(t){return void 0===t},Ic={},Ac={};function parseCmd(t,o){var a,c,h;try{h=JSON.parse(t)}catch(a){throw o.error("Parse command error: ",t),a}var m=h.sid+"_"+h.cid,v=h.r;if(includes(a=["4_1","4_2","4_10","4_11"]).call(a,m)){var b=h.r[1].headerPacket;m=b.sid+"_"+b.cid,v=h.r[1].body}var x,w=Ac[m],S=Ic[w],k=function genCmdError(t,o){var a=hc[t];return null===a?null:new mc(t,o,a,(new Date).getTime())}(h.code,w),_={cmd:w,raw:h,error:k,service:null==S?void 0:S.service,content:{}};if(_.error){if(_.error.cmd=w,_.error.callFunc="parseCmd",!(null===(c=null==S?void 0:S.ignoreErrCodes)||void 0===c?void 0:includes(c).call(c,h.code)))return _;o.warn("parseCmd:: ignore error ",_.error),_.error.ignore=!0}if(!w||!S)return _.notFound=!0,_;S.response&&forEach$1(x=S.response).call(x,(function(t,o){var a=v[o],c=t.type,h=t.name,m=t.reflectMapper;if(!Pc(a))switch(c){case"Property":_.content[h]=m?deserialize(a,m):a;break;case"PropertyArray":_.content[h]=map(a).call(a,(function(t){return m?deserialize(t,m):t}));break;case"long":case"Long":case"byte":case"Byte":case"Number":_.content[h]=+a;break;default:_.content[h]=a}}));return _}function serialize(t,o){var a={};for(var c in t)void 0!==o[c]&&(a[o[c]]=t[c]);return a}function deserialize(t,o){var a={};for(var c in t)void 0!==o[c]&&(a[o[c]]=t[c]);return a}function registerParser(t){Ic=Ma(Ic,t.cmdConfig),Ac=Ma(Ac,t.cmdMap)}function invertSerializeMap(t){var o;return reduce(o=Oc(t)).call(o,(function(o,a){var c,h=t[a];return o[a]=reduce(c=Oc(h)).call(c,(function(t,o){return t[h[o]]=o,t}),{}),o}),{})}var jc=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"],Rc=["transport not supported","client not handshaken","unauthorized"],Lc=["reconnect"],Fc=function(t){function NIMWebsocket(o,a,c){var h;return(h=t.call(this)||this).url=a,h.logger=c,h.websocket=null,h.core=o,h.url=a,h.status="disconnected",h.logger=c,h.connect(),h}kt(NIMWebsocket,t);var o=NIMWebsocket.prototype;return o.connect=function connect(){var t=this;"connecting"!==this.status&&"connected"!==this.status?(this.status="connecting",this.core.adapters.request("https://"+this.url+"/socket.io/1/?t="+Pa(),{method:"GET",dataType:"text",timeout:8e3}).then((function(o){var a=o.data.split(":"),c=a[0],h=a[1];return t.sessionId=c,t.closeTimeout=1e3*h,t._createWebsocket("wss://"+t.url+"/socket.io/1/websocket/"+c)})).catch((function(o){t.logger.error("imsocket::handshake fail. ",o&&o.message),t.status="disconnected",t.emit("handshakeFailed")}))):this.logger.warn("imsocket::socket is connecting or connected",this.status)},o.close=function close(){var t;if(this.websocket){this.status="disconnected",this.websocket.onmessage=null,this.websocket.onopen=null,this.websocket.onerror=null;try{null===(t=this.websocket)||void 0===t||t.send(this.encodePacket({type:"disconnect"})),this.websocket.close()}catch(t){this.logger.warn("attempt to close websocket error",t)}this.websocket.onclose=null,this.websocket=null,this.emit("disconnect")}},o.onConnect=function onConnect(){this.status="connected",this.resetCloseTimer(),this.emit("connect")},o._createWebsocket=function _createWebsocket(t){var o,a=this;this.websocket=new Sc.WebSocket(t),this.websocket.onmessage=bind$1(o=this.onMessage).call(o,this),this.websocket.onclose=function(){a.logger.log("imsocket:: websocket onclose done"),"disconnected"!==a.status&&(a.logger.log("imsocket:: close()",a.status),a.close())},this.websocket.onerror=function(t){a.logger.error("imsocket:: onerror",t)}},o.onMessage=function onMessage(t){var o;this.resetCloseTimer();var a=this.decodePacket(t.data);if(a)switch(a.type){case"connect":this.onConnect();break;case"disconnect":this.close();break;case"message":case"json":this.emit("message",a.data);break;case"event":a.name&&this.emit(a.name,a.args);break;case"error":"unauthorized"===a.reason?this.emit("connect_failed",a.reason):this.emit("error",a.reason);break;case"heartbeat":null===(o=this.websocket)||void 0===o||o.send(this.encodePacket({type:"heartbeat"}));break;default:this.logger.warn("imsocket::no handler type",a.type)}},o.encodePacket=function encodePacket(t){var o,a,c=t.type,h=t.id,m=void 0===h?"":h,v=t.endpoint,b=void 0===v?"":v,x=t.ack,w=null;if(!c)return"";switch(c){case"error":o=t.reason?indexOf(Rc).call(Rc,t.reason):"",a=t.advice?indexOf(Lc).call(Lc,t.advice):"",""===o&&""===a||(w=o+(""!==a?"+"+a:""));break;case"message":""!==t.data&&(w=t.data);break;case"event":o={name:t.name},o=t.args&&t.args.length?{name:t.name,args:t.args}:{name:t.name},w=Aa(o);break;case"json":w=Aa(t.data);break;case"connect":t.qs&&(w=t.qs);break;case"ack":w=t.ackId+(t.args&&t.args.length?"+"+Aa(t.args):"")}var S=[indexOf(jc).call(jc,c),m+("data"===x?"+":""),b];return null!=w&&S.push(w),S.join(":")},o.decodePacket=function decodePacket(t){if(t)if("�"!=t.charAt(0)){var o=t.match(/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/);if(o){var a,c=o[1],h=o[2],m=o[3],v=o[4],b=o[5],x={type:jc[+c],endpoint:v};switch(h&&(x.id=h,x.ack=!m||"data"),x.type){case"error":a=b.split("+"),x.reason=Rc[+a[0]]||"";break;case"message":x.data=b||"";break;case"connect":x.qs=b||"";break;case"event":try{var w=JSON.parse(b);x.name=w.name,x.args=w.args}catch(t){this.logger.error("imsocket::parseData::type::event error",t)}x.args=x.args||[];break;case"json":try{x.data=JSON.parse(b)}catch(t){this.logger.error("imsocket::parseData::type::json error",t)}break;case"ack":if((a=b.match(/^([0-9]+)(\+)?(.*)/))&&(x.ackId=a[1],x.args=[],a[3]))try{x.args=a[3]?JSON.parse(a[3]):[]}catch(t){this.logger.error("imsocket::parseData::type::ack error",t)}}return x}}else this.logger.error("imsocket::unrecognize dataStr",slice(t).call(t,0,20))},o.send=function send(t){var o,a={data:t,type:"message",endpoint:""};null===(o=this.websocket)||void 0===o||o.send(this.encodePacket(a))},o.resetCloseTimer=function resetCloseTimer(){var t=this;this.closeTimeout&&(clearTimeout(this.closeTimer),this.closeTimer=us((function(){t.close()}),this.closeTimeout))},NIMWebsocket}(hs),Nc=entryVirtual("Array").values,Uc=Array.prototype,Dc={DOMTokenList:!0,NodeList:!0},values=function(t){var o=t.values;return t===Uc||K(Uc,t)&&o===Uc.values||le(Dc,It(t))?Nc:o};_export({target:"Array",stat:!0},{isArray:_t});var Bc=z.Array.isArray,qc=kr.every,zc=arrayMethodIsStrict("every");_export({target:"Array",proto:!0,forced:!zc},{every:function every(t){return qc(this,t,arguments.length>1?arguments[1]:void 0)}});var Kc=entryVirtual("Array").every,Hc=Array.prototype,every=function(t){var o=t.every;return t===Hc||K(Hc,t)&&o===Hc.every?Kc:o};var Gc=function isObjectLike(t){return null!=t&&"object"==typeof t};var $c=function baseIsRegExp(t){return Gc(t)&&"[object RegExp]"==Es(t)};var Wc=function baseUnary(t){return function(o){return t(o)}},Vc=createCommonjsModule((function(t,o){var a=o&&!o.nodeType&&o,c=a&&t&&!t.nodeType&&t,h=c&&c.exports===a&&gs.process,m=function(){try{var t=c&&c.require&&c.require("util").types;return t||h&&h.binding&&h.binding("util")}catch(t){}}();t.exports=m})),Qc=Vc&&Vc.isRegExp,Jc=Qc?Wc(Qc):$c,Xc=ys["__core-js_shared__"],Yc=function(){var t=/[^.]+$/.exec(Xc&&Xc.keys&&Xc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var Zc=function isMasked(t){return!!Yc&&Yc in t},eu=Function.prototype.toString;var tu=function toSource(t){if(null!=t){try{return eu.call(t)}catch(t){}try{return t+""}catch(t){}}return""},ru=/^\[object .+?Constructor\]$/,nu=Function.prototype,ou=Object.prototype,iu=nu.toString,au=ou.hasOwnProperty,su=RegExp("^"+iu.call(au).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var cu=function baseIsNative(t){return!(!Os(t)||Zc(t))&&(Ps(t)?su:ru).test(tu(t))};var uu=function getValue(t,o){return null==t?void 0:t[o]};var lu=function getNative(t,o){var a=uu(t,o);return cu(a)?a:void 0},fu=lu(Object,"create");var pu=function hashClear(){this.__data__=fu?fu(null):{},this.size=0};var du=function hashDelete(t){var o=this.has(t)&&delete this.__data__[t];return this.size-=o?1:0,o},hu=Object.prototype.hasOwnProperty;var mu=function hashGet(t){var o=this.__data__;if(fu){var a=o[t];return"__lodash_hash_undefined__"===a?void 0:a}return hu.call(o,t)?o[t]:void 0},gu=Object.prototype.hasOwnProperty;var vu=function hashHas(t){var o=this.__data__;return fu?void 0!==o[t]:gu.call(o,t)};var yu=function hashSet(t,o){var a=this.__data__;return this.size+=this.has(t)?0:1,a[t]=fu&&void 0===o?"__lodash_hash_undefined__":o,this};function Hash(t){var o=-1,a=null==t?0:t.length;for(this.clear();++o<a;){var c=t[o];this.set(c[0],c[1])}}Hash.prototype.clear=pu,Hash.prototype.delete=du,Hash.prototype.get=mu,Hash.prototype.has=vu,Hash.prototype.set=yu;var bu=Hash;var xu=function listCacheClear(){this.__data__=[],this.size=0};var wu=function eq(t,o){return t===o||t!=t&&o!=o};var Su=function assocIndexOf(t,o){for(var a=t.length;a--;)if(wu(t[a][0],o))return a;return-1},ku=Array.prototype.splice;var _u=function listCacheDelete(t){var o=this.__data__,a=Su(o,t);return!(a<0)&&(a==o.length-1?o.pop():ku.call(o,a,1),--this.size,!0)};var Tu=function listCacheGet(t){var o=this.__data__,a=Su(o,t);return a<0?void 0:o[a][1]};var Cu=function listCacheHas(t){return Su(this.__data__,t)>-1};var Mu=function listCacheSet(t,o){var a=this.__data__,c=Su(a,t);return c<0?(++this.size,a.push([t,o])):a[c][1]=o,this};function ListCache(t){var o=-1,a=null==t?0:t.length;for(this.clear();++o<a;){var c=t[o];this.set(c[0],c[1])}}ListCache.prototype.clear=xu,ListCache.prototype.delete=_u,ListCache.prototype.get=Tu,ListCache.prototype.has=Cu,ListCache.prototype.set=Mu;var Eu=ListCache,Ou=lu(ys,"Map");var Pu=function mapCacheClear(){this.size=0,this.__data__={hash:new bu,map:new(Ou||Eu),string:new bu}};var Iu=function isKeyable(t){var o=typeof t;return"string"==o||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==t:null===t};var Au=function getMapData(t,o){var a=t.__data__;return Iu(o)?a["string"==typeof o?"string":"hash"]:a.map};var ju=function mapCacheDelete(t){var o=Au(this,t).delete(t);return this.size-=o?1:0,o};var Ru=function mapCacheGet(t){return Au(this,t).get(t)};var Lu=function mapCacheHas(t){return Au(this,t).has(t)};var Fu=function mapCacheSet(t,o){var a=Au(this,t),c=a.size;return a.set(t,o),this.size+=a.size==c?0:1,this};function MapCache(t){var o=-1,a=null==t?0:t.length;for(this.clear();++o<a;){var c=t[o];this.set(c[0],c[1])}}MapCache.prototype.clear=Pu,MapCache.prototype.delete=ju,MapCache.prototype.get=Ru,MapCache.prototype.has=Lu,MapCache.prototype.set=Fu;var Nu=MapCache;var Uu=function setCacheAdd(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var Du=function setCacheHas(t){return this.__data__.has(t)};function SetCache(t){var o=-1,a=null==t?0:t.length;for(this.__data__=new Nu;++o<a;)this.add(t[o])}SetCache.prototype.add=SetCache.prototype.push=Uu,SetCache.prototype.has=Du;var Bu=SetCache;var qu=function baseFindIndex(t,o,a,c){for(var h=t.length,m=a+(c?1:-1);c?m--:++m<h;)if(o(t[m],m,t))return m;return-1};var zu=function baseIsNaN(t){return t!=t};var Ku=function strictIndexOf(t,o,a){for(var c=a-1,h=t.length;++c<h;)if(t[c]===o)return c;return-1};var Hu=function baseIndexOf(t,o,a){return o==o?Ku(t,o,a):qu(t,zu,a)};var Gu=function arrayIncludes(t,o){return!!(null==t?0:t.length)&&Hu(t,o,0)>-1};var $u=function arrayIncludesWith(t,o,a){for(var c=-1,h=null==t?0:t.length;++c<h;)if(a(o,t[c]))return!0;return!1};var Wu=function arrayMap(t,o){for(var a=-1,c=null==t?0:t.length,h=Array(c);++a<c;)h[a]=o(t[a],a,t);return h};var Vu=function cacheHas(t,o){return t.has(o)};var Qu=function baseDifference(t,o,a,c){var h=-1,m=Gu,v=!0,b=t.length,x=[],w=o.length;if(!b)return x;a&&(o=Wu(o,Wc(a))),c?(m=$u,v=!1):o.length>=200&&(m=Vu,v=!1,o=new Bu(o));e:for(;++h<b;){var S=t[h],k=null==a?S:a(S);if(S=c||0!==S?S:0,v&&k==k){for(var _=w;_--;)if(o[_]===k)continue e;x.push(S)}else m(o,k,c)||x.push(S)}return x};var Ju=function identity(t){return t};var Xu=function apply(t,o,a){switch(a.length){case 0:return t.call(o);case 1:return t.call(o,a[0]);case 2:return t.call(o,a[0],a[1]);case 3:return t.call(o,a[0],a[1],a[2])}return t.apply(o,a)},Yu=Math.max;var Zu=function overRest(t,o,a){return o=Yu(void 0===o?t.length-1:o,0),function(){for(var c=arguments,h=-1,m=Yu(c.length-o,0),v=Array(m);++h<m;)v[h]=c[o+h];h=-1;for(var b=Array(o+1);++h<o;)b[h]=c[h];return b[o]=a(v),Xu(t,this,b)}};var el=function constant(t){return function(){return t}},tl=function(){try{var t=lu(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),rl=tl?function(t,o){return tl(t,"toString",{configurable:!0,enumerable:!1,value:el(o),writable:!0})}:Ju,nl=Date.now;var ol=function shortOut(t){var o=0,a=0;return function(){var c=nl(),h=16-(c-a);if(a=c,h>0){if(++o>=800)return arguments[0]}else o=0;return t.apply(void 0,arguments)}},il=ol(rl);var al=function isLength(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var sl=function isArrayLike(t){return null!=t&&al(t.length)&&!Ps(t)};var cl=function isArrayLikeObject(t){return Gc(t)&&sl(t)},ul=function baseRest(t,o){return il(Zu(t,o,Ju),t+"")}((function(t,o){return cl(t)?Qu(t,o):[]})),ll=ul;function replacer(t,o){return o instanceof RegExp?"__REGEXP "+o.toString():o}function validate(t,o,a){var c;void 0===o&&(o={});var h={};return forEach$1(c=Oc(t)).call(c,(function(c){var m=t[c].type,v=a?"In "+a+", ":"";if(void 0===o[c]){if(!1===t[c].required)return void(h[c]=o[c]);throw new dc(v+'param "'+c+'" is required',{key:c},"required")}var b=fl[m];if(b&&!b(o,c,t[c]))throw new dc(v+'param "'+c+'" expects '+Aa(t[c],replacer),{key:c,value:o[c]},Aa(t[c]));h[c]=o[c]})),h}var fl={string:function string(t,o,a){var c=a.allowEmpty,h=a.max,m=a.min,v=a.regExp,b=t[o];return"string"==typeof b&&((!1!==c||""!==b)&&(!("number"==typeof h&&b.length>h)&&(!("number"==typeof m&&b.length<m)&&!(Jc(v)&&!v.test(b)))))},number:function number(t,o,a){var c=a.min,h=a.max,m=t[o];return"number"==typeof m&&(!("number"==typeof c&&m<c)&&!("number"==typeof h&&m>h))},boolean:function boolean(t,o){return"boolean"==typeof t[o]},enum:function _enum(t,o,a){var c=values(a),h=t[o];return!c||indexOf(c).call(c,h)>-1},array:function array(t,o,a){var c,h=a.itemType,m=a.rules,v=a.min,b=a.max,x=values(a),w=t[o];return!!Bc(w)&&(!("number"==typeof b&&w.length>b)&&(!("number"==typeof v&&w.length<v)&&(!(h&&"enum"!==h&&!every(w).call(w,(function(t){return typeof t===h})))&&(("enum"!==h||!x||!ll.apply(void 0,concat(c=[w]).call(c,x)).length)&&(m&&forEach$1(w).call(w,(function(t,a){return validate(m,t,o+"["+a+"]")})),!0)))))},object:function object(t,o,a){var c=a.rules,h=t[o];return c&&validate(c,h,o),!0}},pl=lu(ys,"Set");var dl=function noop(){};var hl=function setToArray(t){var o=-1,a=Array(t.size);return t.forEach((function(t){a[++o]=t})),a},ml=pl&&1/hl(new pl([,-0]))[1]==1/0?function(t){return new pl(t)}:dl,gl=ml;var vl=function baseUniq(t,o,a){var c=-1,h=Gu,m=t.length,v=!0,b=[],x=b;if(a)v=!1,h=$u;else if(m>=200){var w=o?null:gl(t);if(w)return hl(w);v=!1,h=Vu,x=new Bu}else x=o?[]:b;e:for(;++c<m;){var S=t[c],k=o?o(S):S;if(S=a||0!==S?S:0,v&&k==k){for(var _=x.length;_--;)if(x[_]===k)continue e;o&&x.push(k),b.push(S)}else h(x,k,a)||(x!==b&&x.push(k),b.push(S))}return b};var yl=function uniq(t){return t&&t.length?vl(t):[]},bl=kr.filter,xl=arrayMethodHasSpeciesSupport("filter");_export({target:"Array",proto:!0,forced:!xl},{filter:function filter(t){return bl(this,t,arguments.length>1?arguments[1]:void 0)}});var wl=entryVirtual("Array").filter,Sl=Array.prototype,filter=function(t){var o=t.filter;return t===Sl||K(Sl,t)&&o===Sl.filter?wl:o},kl="\t\n\v\f\r \u2028\u2029\ufeff",_l=C("".replace),Tl="["+kl+"]",Cl=RegExp("^"+Tl+Tl+"*"),Ml=RegExp(Tl+Tl+"*$"),createMethod=function(t){return function(o){var a=toString$1(requireObjectCoercible(o));return 1&t&&(a=_l(a,Cl,"")),2&t&&(a=_l(a,Ml,"")),a}},El={start:createMethod(1),end:createMethod(2),trim:createMethod(3)}.trim,Ol=h.parseInt,Pl=h.Symbol,Il=Pl&&Pl.iterator,Al=/^[+-]?0x/i,jl=C(Al.exec),Rl=8!==Ol(kl+"08")||22!==Ol(kl+"0x16")||Il&&!fails((function(){Ol(Object(Il))}))?function parseInt(t,o){var a=El(toString$1(t));return Ol(a,o>>>0||(jl(Al,a)?16:10))}:Ol;_export({global:!0,forced:parseInt!=Rl},{parseInt:Rl});var Ll,Fl=z.parseInt,Nl=(Ll=function _s4(){return(65536*(1+Math.random())|0).toString(16).substring(1)},function(){return Ll()+Ll()+Ll()+Ll()+Ll()+Ll()+Ll()+Ll()});function getEnumKeys(t){var o;return filter(o=Oc(t)).call(o,(function(t){return!(+t>=0)}))}function getEnumKeyByEnumValue(t,o){var a,c=filter(a=Oc(t)).call(a,(function(a){return t[a]==o}));return c.length>0?c[0]:void 0}var Ul=TypeError,Dl=Object.getOwnPropertyDescriptor,Bl=M&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,o){if(_t(t)&&!Dl(t,"length").writable)throw Ul("Cannot set read only .length");return t.length=o}:function(t,o){return t.length=o},ql=TypeError,deletePropertyOrThrow=function(t,o){if(!delete t[o])throw ql("Cannot delete property "+tryToString(o)+" of "+tryToString(t))},zl=arrayMethodHasSpeciesSupport("splice"),Kl=Math.max,Hl=Math.min;_export({target:"Array",proto:!0,forced:!zl},{splice:function splice(t,o){var a,c,h,m,v,b,x=toObject(this),w=lengthOfArrayLike(x),S=toAbsoluteIndex(t,w),k=arguments.length;for(0===k?a=c=0:1===k?(a=0,c=w-S):(a=k-2,c=Hl(Kl(toIntegerOrInfinity(o),0),w-S)),doesNotExceedSafeInteger(w+a-c),h=arraySpeciesCreate(x,c),m=0;m<c;m++)(v=S+m)in x&&createProperty(h,m,x[v]);if(h.length=c,a<c){for(m=S;m<w-c;m++)b=m+a,(v=m+c)in x?x[b]=x[v]:deletePropertyOrThrow(x,b);for(m=w;m>w-c+a;m--)deletePropertyOrThrow(x,m-1)}else if(a>c)for(m=w-c;m>S;m--)b=m+a-1,(v=m+c-1)in x?x[b]=x[v]:deletePropertyOrThrow(x,b);for(m=0;m<a;m++)x[m+S]=arguments[m+2];return Bl(x,w-c+a),h}});var Gl=entryVirtual("Array").splice,$l=Array.prototype,splice=function(t){var o=t.splice;return t===$l||K($l,t)&&o===$l.splice?Gl:o},callWithSafeIterationClosing=function(t,o,a,c){try{return c?o(anObject(a)[0],a[1]):o(a)}catch(o){iteratorClose(t,"throw",o)}},Wl=Array,Vl=!checkCorrectnessOfIteration((function(t){Array.from(t)}));_export({target:"Array",stat:!0,forced:Vl},{from:function from(t){var o=toObject(t),a=qt(this),c=arguments.length,h=c>1?arguments[1]:void 0,m=void 0!==h;m&&(h=functionBindContext(h,c>2?arguments[2]:void 0));var v,b,x,w,S,k,_=getIteratorMethod$5(o),T=0;if(!_||this===Wl&&isArrayIteratorMethod(_))for(v=lengthOfArrayLike(o),b=a?new this(v):Wl(v);v>T;T++)k=m?h(o[T],T):o[T],createProperty(b,T,k);else for(S=(w=getIterator(o,_)).next,b=a?new this:[];!(x=O(S,w)).done;T++)k=m?callWithSafeIterationClosing(w,h,[x.value,T],!0):x.value,createProperty(b,T,k);return b.length=T,b}});var Ql=z.Array.from,Jl=getIteratorMethod$5;function _createForOfIteratorHelperLoose(t,o){var a,c=void 0!==$n&&Jl(t)||t["@@iterator"];if(c)return bind$1(a=(c=c.call(t)).next).call(a,c);if(Bc(t)||(c=function _unsupportedIterableToArray(t,o){var a;if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,o);var c=slice(a=Object.prototype.toString.call(t)).call(a,8,-1);"Object"===c&&t.constructor&&(c=t.constructor.name);if("Map"===c||"Set"===c)return Ql(t);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return _arrayLikeToArray(t,o)}(t))||o&&t&&"number"==typeof t.length){c&&(t=c);var h=0;return function(){return h>=t.length?{done:!0}:{done:!1,value:t[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray(t,o){(null==o||o>t.length)&&(o=t.length);for(var a=0,c=new Array(o);a<o;a++)c[a]=t[a];return c}var Xl,Yl=function(){function TimerManager(){this.timerList=[],this.id=0,this.timer=null,this.timeout=0}var t=TimerManager.prototype;return t.addTimer=function addTimer(t,o,a){void 0===o&&(o=0),void 0===a&&(a=1);var c=(new Date).getTime(),h=this.id;return this.timerList.push({id:h,loop:a,count:0,timeout:c+o,interval:o,callback:t}),this.id++,this.checkTimer(c),h},t.checkTimer=function checkTimer(t){if(void 0===t&&(t=(new Date).getTime()),this.removeFinished(),0!==this.timerList.length||null==this.timer){for(var o,a,c=0,h=_createForOfIteratorHelperLoose(this.timerList);!(o=h()).done;){var m=o.value;(0===c||c>m.timeout)&&(c=m.timeout)}if(0!==this.timerList.length)if(null===this.timer||c<this.timeout||this.timeout<t)this.timer=us(bind$1(a=this.nowTime).call(a,this),c-t),this.timeout=c}},t.nowTime=function nowTime(){for(var t,nowTime=(new Date).getTime(),o=_createForOfIteratorHelperLoose(this.timerList);!(t=o()).done;){var a=t.value;nowTime>=a.timeout&&(a.callback(),a.count++,a.timeout=nowTime+a.interval)}this.clerTime(),this.checkTimer(nowTime)},t.clerTime=function clerTime(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},t.deleteTimer=function deleteTimer(t){for(var o=this.timerList.length-1;o>=0;o--){var a;if(this.timerList[o].id===t)splice(a=this.timerList).call(a,o,1)}},t.removeFinished=function removeFinished(){for(var t=this.timerList.length-1;t>=0;t--){var o,a=this.timerList[t];if(a.loop>=0&&a.count>=a.loop)splice(o=this.timerList).call(o,t,1)}},t.destroy=function destroy(){this.clerTime(),this.timerList=[],this.id=0,this.timer=null},TimerManager}(),Zl=function(){function CoreAdapters(t){this.core=t}var t=CoreAdapters.prototype;return t.request=function request(t,o){var a=this,c=(new Date).getTime();return Sc.request(t,o).catch((function(h){var m,v,b=h;throw a.core.reporter.reportTraceStart("exceptions",{user_id:a.core.options.account,trace_id:null===(v=null===(m=a.core)||void 0===m?void 0:m.socket)||void 0===v?void 0:v.sessionId,start_time:c,action:1}),a.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof b.code?b.code:0,description:b.message||""+b.code,operation_type:0,target:t,context:o?Aa(o):""}),a.core.reporter.reportTraceEnd("exceptions",1),h}))},t.uploadFile=function uploadFile(t){var o=this,a=(new Date).getTime();return Sc.uploadFile(t).catch((function(c){var h,m,v=c;o.core.reporter.reportTraceStart("exceptions",{user_id:o.core.options.account,trace_id:null===(m=null===(h=o.core)||void 0===h?void 0:h.socket)||void 0===m?void 0:m.sessionId,start_time:a,action:1});var b="BROWSER"===Sc.platform?t.chunkUploadHost:t.commonUploadHost?t.commonUploadHost+"/"+(t.nosToken&&t.nosToken.bucket):"https://nos.netease.com/nim";throw o.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof v.code?v.code:0,description:v.message||""+v.code,operation_type:1,target:b}),o.core.reporter.reportTraceEnd("exceptions",1),c}))},CoreAdapters}();!function(t){t[t.ACTIVE=1]="ACTIVE",t[t.KICKED=2]="KICKED",t[t.OFFLINE=3]="OFFLINE"}(Xl||(Xl={}));var ef=window&&Ps(window.addEventListener)&&Ps(window.removeEventListener),tf=function(t){function Core(o,a){var h;(h=t.call(this)||this).status="unconnected",h.linkUrls=[],h.eventBus=new hs,h.packetSer=1,h.retryCount=0,h.reconnectTimer=0,h.backoff=new ms({max:8e3,min:1600,jitter:.01}),h.sendingCmdMap=new ts,h.pingTimer=0,h.config=Is,h.abtInfo={},validate({linkUrls:{type:"array",itemType:"string",required:!1}},o),h.options=Ma(Ma({},As),o),h.adapters=new Zl(c(h));var m=Sc.localStorage.getItem("__NIM_DEVC_ID__");h.options.isFixedDeviceId?(m=Sc.localStorage.getItem("__NIM_DEVC_ID__")||Nl(),Sc.localStorage.setItem("__NIM_DEVC_ID__",m)):m=Nl(),h.config=Ma(Ma(Ma({},Is),a),{deviceId:m}),h.timerManager=new Yl,h.logger=new xc(h.options.debugLevel,h.options.account);var v=Sc.getSystemInfo();return h.reporter=new wc({common:{app_key:o.appkey,dev_id:m,platform:"Web",sdk_ver:"0.12.0",env:"online",os_name:v.os,os_ver:v.osVer,host_env:v.hostEnv,host_info:v.hostInfo,host_env_ver:v.hostEnvVer},request:Sc.request,logger:h.logger,autoStart:"BROWSER"===Sc.platform}),Sc.setLogger(h.logger),h.logger.log("Core init, version ","0.12.0"," sdk version ",90900," appkey ",o.appkey),h}kt(Core,t);var o=Core.prototype;return o.connect=function connect(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,wa.mark((function _callee(){var o,a,c,h,m,v;return wa.wrap((function _callee$(b){for(;;)switch(b.prev=b.next){case 0:if(validate({linkUrls:{type:"array",itemType:"string",required:!1}},t),/^(unconnected|waitReconnect)$/.test(this.status)){b.next=5;break}return o="Core socket status is "+this.status+", and would not connect",this.logger.warn(o),b.abrupt("return",ca.reject(o));case 5:this.status="connecting",t.linkUrls&&t.linkUrls.length>0&&(this.linkUrls=concat(a=t.linkUrls).call(a,this.linkUrls),this.linkUrls=yl(this.linkUrls)),0===this.linkUrls.length&&this.linkUrls.push("weblink.netease.im:443"),c=0;case 9:if(!(c<this.linkUrls.length)){b.next=33;break}return h=this.linkUrls[c],m=(new Date).getTime(),b.prev=12,b.next=15,this.doConnect(h);case 15:return this.reporter.reportTraceUpdate("login",{operation_type:"TCP",target:h}),this.status="connected",this.logger.log("core:: connect success with url: "+h),this.abtRequest(),b.abrupt("return",h);case 22:b.prev=22,b.t0=b.catch(12),v=b.t0,this.reporter.reportTraceUpdate("login",{operation_type:"TCP",error:"ws_handshake_failed",target:h},!1),this.reporter.reportTraceStart("exceptions",{user_id:this.options.account,start_time:m,action:0}),this.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof v.code?v.code:0,description:v.message||""+v.code,operation_type:0,target:h}),this.reporter.reportTraceEnd("exceptions",1),this.logger.warn("core:: connect failed with url: "+h,b.t0);case 30:c++,b.next=9;break;case 33:throw this.reporter.reportTraceEnd("login",!1),0===this.retryCount?this.doDisconnect(Xl.ACTIVE,"SocketHandshakeFailed"):this.doDisconnect(Xl.OFFLINE,"ReconnectHadRetryAllLinks"),new Error("core: socket handshake failed");case 36:case"end":return b.stop()}}),_callee,this,[[12,22]])})))},o.doConnect=function doConnect(t){var o=this;return new ca((function(a,c){var h;o.socket=new Fc(o,t,o.logger),o.socket.on("connect",(function(){o.logger.log("socket on connect",t),a()})),o.socket.on("message",bind$1(h=o.onMessage).call(h,o)),o.socket.on("disconnect",(function(t){o.logger.log("core:: socket on disconnect",t),o.doDisconnect(Xl.OFFLINE,"SocketOnDisconnect")})),o.socket.on("handshakeFailed",(function(){o.logger.warn("core:: socket handshake failed"),c(new pc("handshake failed",{},408))}))}))},o.resetConnectStatus=function resetConnectStatus(){clearTimeout(this.reconnectTimer),this.backoff.reset(),this.retryCount=0,this.initOnlineListener()},o.doDisconnect=function doDisconnect(t,o){if(this.logger.log("doDisconnect: type "+t+", description "+o),"unconnected"!==this.status){this.markAllCmdInvaild(new pc("Client request timed out",{},408)),this.timerManager.destroy(),clearTimeout(this.pingTimer),this.socket&&("function"==typeof this.socket.removeAllListeners&&this.socket.removeAllListeners(),"function"==typeof this.socket.close&&this.socket.close(),this.socket=void 0);var a=!this.options.needReconnect||this.retryCount>=this.options.reconnectionAttempts;if(t===Xl.ACTIVE||a)this.logger.log("doDisconnect: emit disconnect, type "+t,a),this.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.eventBus.emit("disconnect"),this.emit("disconnect"),this.destroyOnlineListener();else if(t===Xl.KICKED){this.logger.log("doDisconnect: kicked"),this.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer);var c="string"==typeof o?{reason:"unknow",message:o}:o;this.eventBus.emit("kicked",c),this.emit("kicked",c),this.destroyOnlineListener()}else t===Xl.OFFLINE?(this.logger.log("doDisconnect: start to reconnect"),this.attempToReconnect()):this.logger.log("doDisconnect: nothing to do")}else this.logger.warn("doDisconnect: already unconnected")},o.attempToReconnect=function attempToReconnect(){var t=this;if("waitReconnect"!==this.status){var o=this.backoff.duration();this.retryCount++,this.logger.log("willReconnect "+this.retryCount+" "+o),this.eventBus.emit("willReconnect",{retryCount:this.retryCount,duration:o}),this.emit("willReconnect",{retryCount:this.retryCount,duration:o}),this.status="waitReconnect",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=us((function(){"waitReconnect"===t.status?t.connect({isAutoReconnect:!0}).catch((function(){t.logger.error("core::attempToReconnect failed "+t.retryCount)})):t.logger.warn("doDisconnect: reconnectTimer status is "+t.status+", would not go on reconnecting")}),o)}else this.logger.warn("doDisconnect: already is waiting reconnect")},o.sendCmd=function sendCmd(t,o,a){var c=this;if("logined"!==this.status&&"login"!==t&&"chatroomLogin"!==t&&"qchatLogin"!==t)return this.logger.warn("nim status is "+this.status+", so can not sendCmd "+t),ca.reject({cmd:t,error:{code:"No_connected",message:"Connection not established",timetag:(new Date).getTime()}});if(!this.socket||!this.socket.send)return ca.reject("No_socket");var h="heartbeat"!==t,m=h?this.packetSer++:0,v=function createCmd(t,o,a,c){var h=Ic[t];if(!h)return a.error("createCmd:: can not find cmd config: ",t),null;var m,v={SER:o,SID:h.sid,CID:h.cid,Q:[]};return h.params&&c&&forEach$1(m=h.params).call(m,(function(t){var o=c[t.name];if(!Pc(o)){var a=t.type,h=t.reflectMapper;switch(t.type){case"PropertyArray":a="ArrayMable",o=map(o).call(o,(function(t){return{t:"Property",v:h?serialize(t,h):t}}));break;case"Property":o=h?serialize(o,h):o;break;case"Bool":case"bool":o=o?"true":"false"}v.Q.push({t:a,v:o})}})),{packet:v,isNoResponse:h.isNoResponse||!1}}(t,m,this.logger,o);if(!v){var b="SendCmd "+m+" "+t+" error";return this.logger.error(b),ca.reject(b)}var x=v.packet,w=v.isNoResponse,S=Aa(x);h&&("debug"===this.options.debugLevel?this.logger.debug("core::sendCmd",t,"ser:"+m,S):this.logger.log("core::sendCmd",t,"ser:"+m));var k=(new Date).getTime();return new ca((function(h,v){c.sendingCmdMap.set(m,{cmd:t,params:o,callback:[h,v],timer:w?null:us((function(){var o,a=new mc(504,t,"Packet Timeout",(new Date).getTime(),{message:"ser "+m+" cmd "+t+" timeout"});a.callFunc="sendCmd",c.markCmdInvalid(m,a,t),c.reporter.reportTraceStart("exceptions",{user_id:c.options.account,trace_id:null===(o=c.socket)||void 0===o?void 0:o.sessionId,start_time:k,action:2}),c.reporter.reportTraceUpdateV2("exceptions",{code:408,description:"Packet timeout",operation_type:1,target:x.SID+"-"+x.CID,context:""+x.SER}),c.reporter.reportTraceEnd("exceptions",1)}),a&&a.timeout?a.timeout:c.config.timeout)});try{c.socket.send(S)}catch(o){var b=new mc(415,t,o&&o.message||"Unable to send packet",(new Date).getTime(),{message:"send json error",rawError:o});b.callFunc="sendCmd",c.markCmdInvalid(m,b,t),v(o)}}))},o.onMessage=function onMessage(t){var o=parseCmd(t,this.logger);if(o){var a=o.raw.ser;if(o.error&&this.logger.error("core:onMessage packet error",o.raw.sid+"_"+o.raw.cid+", ser:"+a+",",o.error),!o.notFound)return"heartbeat"!==o.cmd&&("debug"===this.options.debugLevel?this.logger.debug("imsocket::recvCmd ser:"+a,o.cmd,o.content):this.logger.log("imsocket::recvCmd ser:"+a,o.cmd)),o.__receiveTime=Pa(),o;this.logger.warn("core::onMessage packet not found",o.raw.sid+"_"+o.raw.cid+", ser:"+a)}},o.markCmdInvalid=function markCmdInvalid(t,o,a){var c=this.sendingCmdMap.get(t);if(c){var h=c.callback,m=c.timer;m&&clearTimeout(m),this.sendingCmdMap.delete(t),this.logger.warn("packet "+t+", "+a+" is invalid:",o),h[1](o)}},o.markAllCmdInvaild=function markAllCmdInvaild(t){var o;this.logger.log("markAllCmdInvaild"),forEach$1(o=this.sendingCmdMap).call(o,(function(o){var a=o.callback,c=o.timer;c&&clearTimeout(c),a[1](t)})),this.sendingCmdMap.clear()},o.ping=function ping(){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){var t=this;return wa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return clearTimeout(this.pingTimer),o.prev=1,o.next=4,this.sendCmd("heartbeat");case 4:o.next=14;break;case 6:return o.prev=6,o.t0=o.catch(1),o.next=10,this.testHeartBeat5Timeout();case 10:if(!o.sent){o.next=14;break}return this.doDisconnect(Xl.OFFLINE,"PingError"),o.abrupt("return");case 14:this.pingTimer=us((function(){t.ping()}),3e4);case 15:case"end":return o.stop()}}),_callee2,this,[[1,6]])})))},o.testHeartBeat5Timeout=function testHeartBeat5Timeout(){return __awaiter(this,void 0,void 0,wa.mark((function _callee3(){var t;return wa.wrap((function _callee3$(o){for(;;)switch(o.prev=o.next){case 0:clearTimeout(this.pingTimer),t=0;case 2:if(!(t<5)){o.next=15;break}return o.prev=3,o.next=6,this.sendCmd("heartbeat",{},{timeout:3e3});case 6:return o.abrupt("return",!1);case 9:o.prev=9,o.t0=o.catch(3),this.logger.debug("core:: test heartbeat "+t+" Timeout");case 12:t++,o.next=2;break;case 15:return o.abrupt("return",!0);case 16:case"end":return o.stop()}}),_callee3,this,[[3,9]])})))},o.initOnlineListener=function initOnlineListener(){var t,o;this.onlineListener||(ef?(this.onlineListener=bind$1(t=function _context7(){"logined"===this.status&&this.ping()}).call(t,this),this.offlineListener=bind$1(o=function _context8(){this.logger.log("offline"),this.doDisconnect(Xl.OFFLINE,"OfflineListener")}).call(o,this),window.addEventListener("online",this.onlineListener),window.addEventListener("offline",this.offlineListener)):this.logger.warn("initOnlineListener not support add listener"))},o.destroyOnlineListener=function destroyOnlineListener(){this.onlineListener&&(window.removeEventListener("online",this.onlineListener),this.onlineListener=void 0),this.offlineListener&&(window.removeEventListener("offline",this.offlineListener),this.offlineListener=void 0)},o.disconnect=function disconnect(){switch(this.status){case"connected":case"logined":case"connecting":case"waitReconnect":return this.doDisconnect(Xl.ACTIVE,"UserActiveDisconnect"),ca.resolve();case"unconnected":case"destroyed":return ca.resolve()}},o.destroy=function destroy(){var t=this;return this.disconnect().then((function(){t.status="destroyed",t.removeAllListeners(),t.eventBus.removeAllListeners(),t.reporter.destroy(),t.connect=function(){return ca.resolve()},t.disconnect=function(){return ca.resolve()},t.destroy=function(){return ca.resolve()}}))},o.abtRequest=function abtRequest(){var t,o;return __awaiter(this,void 0,void 0,wa.mark((function _callee4(){var a,c;return wa.wrap((function _callee4$(h){for(;;)switch(h.prev=h.next){case 0:if(this.options.isAbtestEnable){h.next=2;break}return h.abrupt("return");case 2:if(!this.abtInfo.experiments){h.next=4;break}return h.abrupt("return");case 4:if(this.options.abtestUrl){h.next=6;break}return h.abrupt("return");case 6:return h.prev=6,h.next=9,this.adapters.request(this.options.abtestUrl,{method:"POST",dataType:"json",headers:{sdktype:"ABTest"},params:{clientInfo:{projectKey:this.options.abtestProjectKey,appKey:this.options.appkey,osType:"Web",sdkVersion:"0.12.0",deviceId:this.config.deviceId},useLocalCache:!0}});case 9:a=h.sent,h.next=15;break;case 12:h.prev=12,h.t0=h.catch(6),this.logger.warn("ABTest request failed");case 15:this.abtInfo=(null===(o=null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.data)||void 0===o?void 0:o.abtInfo)||{},this.abtInfo.experiments&&this.abtInfo.experiments.length>0&&this.reporter.reportImmediately("https://statistic.live.126.net/statics/report/abtest/result",{params:{app_key:this.options.appkey,biz_sdk_type:"IM",sdk_ver:"0.12.0",device_id:this.config.deviceId,platform:"Web",projectKey:this.options.abtestProjectKey,experiments:map(c=this.abtInfo.experiments).call(c,(function(t){return{experimentKey:t.experimentKey,schemeKey:t.schemeKey}}))},headers:{sdktype:"ABTest"},method:"POST",dataType:"json"});case 17:case"end":return h.stop()}}),_callee4,this,[[6,12]])})))},Core}(hs);tf.setAdapters=function setAdapters(t){Ma(Sc,t)};var rf=function createBaseFor(t){return function(o,a,c){for(var h=-1,m=Object(o),v=c(o),b=v.length;b--;){var x=v[t?b:++h];if(!1===a(m[x],x,m))break}return o}}();var nf=function baseTimes(t,o){for(var a=-1,c=Array(t);++a<t;)c[a]=o(a);return c};var af=function baseIsArguments(t){return Gc(t)&&"[object Arguments]"==Es(t)},sf=Object.prototype,cf=sf.hasOwnProperty,uf=sf.propertyIsEnumerable,lf=af(function(){return arguments}())?af:function(t){return Gc(t)&&cf.call(t,"callee")&&!uf.call(t,"callee")},ff=lf,pf=Array.isArray;var df=function stubFalse(){return!1},hf=createCommonjsModule((function(t,o){var a=o&&!o.nodeType&&o,c=a&&t&&!t.nodeType&&t,h=c&&c.exports===a?ys.Buffer:void 0,m=(h?h.isBuffer:void 0)||df;t.exports=m})),mf=/^(?:0|[1-9]\d*)$/;var gf=function isIndex(t,o){var a=typeof t;return!!(o=null==o?9007199254740991:o)&&("number"==a||"symbol"!=a&&mf.test(t))&&t>-1&&t%1==0&&t<o},vf={};vf["[object Float32Array]"]=vf["[object Float64Array]"]=vf["[object Int8Array]"]=vf["[object Int16Array]"]=vf["[object Int32Array]"]=vf["[object Uint8Array]"]=vf["[object Uint8ClampedArray]"]=vf["[object Uint16Array]"]=vf["[object Uint32Array]"]=!0,vf["[object Arguments]"]=vf["[object Array]"]=vf["[object ArrayBuffer]"]=vf["[object Boolean]"]=vf["[object DataView]"]=vf["[object Date]"]=vf["[object Error]"]=vf["[object Function]"]=vf["[object Map]"]=vf["[object Number]"]=vf["[object Object]"]=vf["[object RegExp]"]=vf["[object Set]"]=vf["[object String]"]=vf["[object WeakMap]"]=!1;var yf=function baseIsTypedArray(t){return Gc(t)&&al(t.length)&&!!vf[Es(t)]},bf=Vc&&Vc.isTypedArray,xf=bf?Wc(bf):yf,wf=Object.prototype.hasOwnProperty;var Sf=function arrayLikeKeys(t,o){var a=pf(t),c=!a&&ff(t),h=!a&&!c&&hf(t),m=!a&&!c&&!h&&xf(t),v=a||c||h||m,b=v?nf(t.length,String):[],x=b.length;for(var w in t)!o&&!wf.call(t,w)||v&&("length"==w||h&&("offset"==w||"parent"==w)||m&&("buffer"==w||"byteLength"==w||"byteOffset"==w)||gf(w,x))||b.push(w);return b},kf=Object.prototype;var _f=function isPrototype(t){var o=t&&t.constructor;return t===("function"==typeof o&&o.prototype||kf)};var Tf=function overArg(t,o){return function(a){return t(o(a))}},Cf=Tf(Object.keys,Object),Mf=Object.prototype.hasOwnProperty;var Ef=function baseKeys(t){if(!_f(t))return Cf(t);var o=[];for(var a in Object(t))Mf.call(t,a)&&"constructor"!=a&&o.push(a);return o};var Of=function keys(t){return sl(t)?Sf(t):Ef(t)};var Pf=function baseForOwn(t,o){return t&&rf(t,o,Of)};var If=function baseInverter(t,o,a,c){return Pf(t,(function(t,h,m){o(c,a(t),h,m)})),c};var Af,jf,Rf=function createInverter(t,o){return function(a,c){return If(a,t,o(c),{})}},Lf=Object.prototype.toString,Ff=Rf((function(t,o,a){null!=o&&"function"!=typeof o.toString&&(o=Lf.call(o)),t[o]=a}),el(Ju));function formatChatroom(t){var o=Ma({},t),a=["announcement","broadcastUrl","ext"],c=["createTime","updateTime","onlineMemberNum"],h=["mute"];return forEach$1(a).call(a,(function(t){void 0===o[t]&&(o[t]="")})),forEach$1(c).call(c,(function(t){void 0!==o[t]&&(o[t]=Fl(o[t]))})),forEach$1(h).call(h,(function(t){void 0!==o[t]&&(o[t]=1===Fl(o[t]))})),o}!function(t){t[t.Android=1]="Android",t[t.iOS=2]="iOS",t[t.PC=4]="PC",t[t.WindowsPhone=8]="WindowsPhone",t[t.Web=16]="Web",t[t.Server=32]="Server",t[t.Mac=64]="Mac"}(Af||(Af={})),function(t){t[t.text=0]="text",t[t.image=1]="image",t[t.audio=2]="audio",t[t.video=3]="video",t[t.geo=4]="geo",t[t.notification=5]="notification",t[t.file=6]="file",t[t.tip=10]="tip",t[t.robot=11]="robot",t[t.g2=12]="g2",t[t.custom=100]="custom"}(jf||(jf={}));var Nf=Ff({unset:"-2",restricted:"-1",common:"0",owner:"1",manager:"2",guest:"3",anonymous:"4"});function formatChatroomMember(t){var o,a=Ma({},t),c=["chatroomId"],h=["level","enterTime","updateTime","tempMuteDuration"],m=["online","guest","blacked","muted","valid","tempMuted"],v={tempMuted:!1,tempMuteDuration:0};return forEach$1(o=Oc(v)).call(o,(function(t){a[t]=a[t]||v[t]})),forEach$1(c).call(c,(function(t){void 0!==a[t]&&(a[t]=a[t].toString())})),forEach$1(h).call(h,(function(t){void 0!==a[t]&&(a[t]=Fl(a[t]))})),forEach$1(m).call(m,(function(t){void 0!==a[t]&&(a[t]=1===Fl(a[t]))})),void 0!==a.type&&(a.type=Nf[a.type]),a.avatar,a.online||delete a.enterTime,a.guest&&(a.type="guest",delete a.valid,delete a.guest),"common"!==a.type&&delete a.level,a}function formatChatroomMembers(t){return t&&t.length>0?map(t).call(t,(function(t){return formatChatroomMember(t)})):[]}function generatorMsgForCmd(t,o,a){t.onSendBefore;var c=__rest(t,["onSendBefore"]),h=["subType"],m=["body","antiSpamContent","antiSpamBusinessId","ext"],v=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];return t.resend||(c.idClient=Nl()),c.type=jf[t.type],c.from=o,c.fromClientType=16,c.fromDeviceId=a,c.status=c.status||"sending",forEach$1(v).call(v,(function(o){void 0!==t[o]&&(c[o]=t[o]?1:0)})),forEach$1(h).call(h,(function(o){void 0!==t[o]&&(c[o]=Fl(t[o]))})),forEach$1(m).call(m,(function(o){void 0!==t[o]&&(c[o]="string"==typeof t[o]?t[o]:Aa(t[o]))})),c}var Uf={301:"memberEnter",302:"memberExit",303:"blackMember",304:"unblackMember",305:"gagMember",306:"ungagMember",307:"addManager",308:"removeManager",309:"addCommon",310:"removeCommon",311:"closeChatroom",312:"updateChatroom",313:"kickMember",314:"addTempMute",315:"removeTempMute",316:"updateMemberInfo",317:"updateQueue",318:"muteRoom",319:"unmuteRoom",320:"batchUpdateQueue",321:"addTempMuteTag",322:"removeTempMuteTag",323:"deleteChatroomMsg",325:"updateChatroomTags"};function formatChatroomMsg(t,o){t.onUploadDone,t.onUploadProgress,t.onUploadStart;var a=__rest(t,["onUploadDone","onUploadProgress","onUploadStart"]),c=["time","userUpdateTime"],h=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];if(forEach$1(c).call(c,(function(t){void 0!==a[t]&&(a[t]=Fl(a[t]))})),forEach$1(h).call(h,(function(t){void 0!==a[t]&&(a[t]=1===Fl(a[t]))})),a.type=getEnumKeyByEnumValue(jf,a.type),a.fromClientType=getEnumKeyByEnumValue(Af,a.fromClientType),a.flow=a.from===o?"out":"in",a.status=a.status||"success","string"==typeof a.body)try{a.body=JSON.parse(a.body)}catch(t){}return"notification"===a.type&&(a.attach=a.body?function formatNotificationBody(t){var o,a={};if(a.type=Uf[t.id]||t.id,!t.data)return t;a=Ma(a,t.data);var c={operator:"from",opeNick:"fromNick",target:"to",tarNick:"toNick"};forEach$1(o=Oc(c)).call(o,(function(t){void 0!==a[t]&&(a[c[t]]=a[t],delete a[t])}));var h=["muteDuration"];if(forEach$1(h).call(h,(function(t){void 0!==a[t]&&(a[t]=Fl(a[t]))})),!a.queueChange)return a;var m={};try{m=JSON.parse(a.queueChange)}catch(t){return a}switch(m._e){case"OFFER":m={type:"OFFER",elementKey:m.key,elementValue:m.content};break;case"POLL":m={type:"POLL",elementKey:m.key,elementValue:m.content};break;case"DROP":m={type:"DROP"};break;case"PARTCLEAR":case"BATCH_UPDATE":m={type:m._e,elementKv:m.kvObject}}return a.queueChange=m,a}(a.body):{},a.body=""),a}function formatChatroomMsgs(t,o){return t&&t.length>0?map(t).call(t,(function(t){return formatChatroomMsg(t,o)})):[]}var Df={1:{code:"chatroomClosed",message:"Chatroom is closed"},2:{code:"managerKick",message:"Kicked out by owners or administrators"},3:{code:"samePlatformKick",message:"The same account is not allowed to multiple login at the same time"},4:{code:"silentlyKick",message:"Quietly kicked"},5:{code:"blacked",message:"Was blacklisted"}};var Bf=function(){function Service(t,o){this.name=t,this.core=o,this.name=t,this.logger=o.logger,this.core=o}return Service.prototype.process=function process(t){var o=this[t.cmd+"Handler"];return"function"==typeof o?o.call(this,t):t.error&&!t.error.ignore?ca.reject(t.error):ca.resolve(t)},Service}(),qf=function(t){function ChatroomService(o){return t.call(this,"chatroom",o)||this}kt(ChatroomService,t);var o=ChatroomService.prototype;return o.getInfo=function getInfo(){var t;return __awaiter(this,void 0,void 0,wa.mark((function _callee(){var o;return wa.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("getChatroom");case 2:return o=a.sent,a.abrupt("return",formatChatroom(null===(t=o.content)||void 0===t?void 0:t.chatroom));case 4:case"end":return a.stop()}}),_callee,this)})))},o.updateInfo=function updateInfo(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){return wa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return validate({chatroom:{type:"object",rules:{name:{type:"string",required:!1},announcement:{type:"string",required:!1},broadcastUrl:{type:"string",required:!1},ext:{type:"string",required:!1},queuelevel:{type:"number",min:0,max:1,required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1}},t),o.next=3,this.core.sendCmd("updateChatroom",Ma(Ma({},t),{ext:t.ext||""}));case 3:case"end":return o.stop()}}),_callee2,this)})))},o.beKickedFromChatroomHandler=function beKickedFromChatroomHandler(t){var o=t.content,a=o.reason,c=o.ext,h=function formatKickedReason(t){var o=Df[t];return{reason:o?o.code:"unknow",message:o?o.message:"Unknown reason"}}(a);this.logger.warn("beKickedFromChatroomHandler:: ",h.reason,h.message,c),this.core.doDisconnect(Xl.KICKED,h)},o.updateChatroomTagHandler=function updateChatroomTagHandler(t){var o,a=t.content;this.logger.log("updateChatroomTagHandler:: ",a);var c=null===(o=null==a?void 0:a.updateTags)||void 0===o?void 0:o.currentTags;try{c=JSON.parse(c)}catch(t){this.logger.error("updateChatroomTagHandler:: ",t)}this.core.emit("tagsUpdate",c)},ChatroomService}(Bf),zf=kr.some,Kf=arrayMethodIsStrict("some");_export({target:"Array",proto:!0,forced:!Kf},{some:function some(t){return zf(this,t,arguments.length>1?arguments[1]:void 0)}});var Hf=entryVirtual("Array").some,Gf=Array.prototype,some=function(t){var o=t.some;return t===Gf||K(Gf,t)&&o===Gf.some?Hf:o};var $f=function stackClear(){this.__data__=new Eu,this.size=0};var Wf=function stackDelete(t){var o=this.__data__,a=o.delete(t);return this.size=o.size,a};var Vf=function stackGet(t){return this.__data__.get(t)};var Qf=function stackHas(t){return this.__data__.has(t)};var Jf=function stackSet(t,o){var a=this.__data__;if(a instanceof Eu){var c=a.__data__;if(!Ou||c.length<199)return c.push([t,o]),this.size=++a.size,this;a=this.__data__=new Nu(c)}return a.set(t,o),this.size=a.size,this};function Stack(t){var o=this.__data__=new Eu(t);this.size=o.size}Stack.prototype.clear=$f,Stack.prototype.delete=Wf,Stack.prototype.get=Vf,Stack.prototype.has=Qf,Stack.prototype.set=Jf;var Xf=Stack;var Yf=function arraySome(t,o){for(var a=-1,c=null==t?0:t.length;++a<c;)if(o(t[a],a,t))return!0;return!1};var Zf=function equalArrays(t,o,a,c,h,m){var v=1&a,b=t.length,x=o.length;if(b!=x&&!(v&&x>b))return!1;var w=m.get(t),S=m.get(o);if(w&&S)return w==o&&S==t;var k=-1,_=!0,T=2&a?new Bu:void 0;for(m.set(t,o),m.set(o,t);++k<b;){var C=t[k],M=o[k];if(c)var E=v?c(M,C,k,o,t,m):c(C,M,k,t,o,m);if(void 0!==E){if(E)continue;_=!1;break}if(T){if(!Yf(o,(function(t,o){if(!Vu(T,o)&&(C===t||h(C,t,a,c,m)))return T.push(o)}))){_=!1;break}}else if(C!==M&&!h(C,M,a,c,m)){_=!1;break}}return m.delete(t),m.delete(o),_},ep=ys.Uint8Array;var tp=function mapToArray(t){var o=-1,a=Array(t.size);return t.forEach((function(t,c){a[++o]=[c,t]})),a},rp=bs?bs.prototype:void 0,np=rp?rp.valueOf:void 0;var op=function equalByTag(t,o,a,c,h,m,v){switch(a){case"[object DataView]":if(t.byteLength!=o.byteLength||t.byteOffset!=o.byteOffset)return!1;t=t.buffer,o=o.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=o.byteLength||!m(new ep(t),new ep(o)));case"[object Boolean]":case"[object Date]":case"[object Number]":return wu(+t,+o);case"[object Error]":return t.name==o.name&&t.message==o.message;case"[object RegExp]":case"[object String]":return t==o+"";case"[object Map]":var b=tp;case"[object Set]":var x=1&c;if(b||(b=hl),t.size!=o.size&&!x)return!1;var w=v.get(t);if(w)return w==o;c|=2,v.set(t,o);var S=Zf(b(t),b(o),c,h,m,v);return v.delete(t),S;case"[object Symbol]":if(np)return np.call(t)==np.call(o)}return!1};var ip=function arrayPush(t,o){for(var a=-1,c=o.length,h=t.length;++a<c;)t[h+a]=o[a];return t};var ap=function baseGetAllKeys(t,o,a){var c=o(t);return pf(t)?c:ip(c,a(t))};var sp=function arrayFilter(t,o){for(var a=-1,c=null==t?0:t.length,h=0,m=[];++a<c;){var v=t[a];o(v,a,t)&&(m[h++]=v)}return m};var cp=function stubArray(){return[]},up=Object.prototype.propertyIsEnumerable,lp=Object.getOwnPropertySymbols,fp=lp?function(t){return null==t?[]:(t=Object(t),sp(lp(t),(function(o){return up.call(t,o)})))}:cp,pp=fp;var dp=function getAllKeys(t){return ap(t,Of,pp)},hp=Object.prototype.hasOwnProperty;var mp=function equalObjects(t,o,a,c,h,m){var v=1&a,b=dp(t),x=b.length;if(x!=dp(o).length&&!v)return!1;for(var w=x;w--;){var S=b[w];if(!(v?S in o:hp.call(o,S)))return!1}var k=m.get(t),_=m.get(o);if(k&&_)return k==o&&_==t;var T=!0;m.set(t,o),m.set(o,t);for(var C=v;++w<x;){var M=t[S=b[w]],E=o[S];if(c)var O=v?c(E,M,S,o,t,m):c(M,E,S,t,o,m);if(!(void 0===O?M===E||h(M,E,a,c,m):O)){T=!1;break}C||(C="constructor"==S)}if(T&&!C){var P=t.constructor,I=o.constructor;P==I||!("constructor"in t)||!("constructor"in o)||"function"==typeof P&&P instanceof P&&"function"==typeof I&&I instanceof I||(T=!1)}return m.delete(t),m.delete(o),T},gp=lu(ys,"DataView"),vp=lu(ys,"Promise"),yp=lu(ys,"WeakMap"),bp="[object Map]",xp="[object Promise]",wp="[object Set]",Sp="[object WeakMap]",kp="[object DataView]",_p=tu(gp),Tp=tu(Ou),Cp=tu(vp),Mp=tu(pl),Ep=tu(yp),Op=Es;(gp&&Op(new gp(new ArrayBuffer(1)))!=kp||Ou&&Op(new Ou)!=bp||vp&&Op(vp.resolve())!=xp||pl&&Op(new pl)!=wp||yp&&Op(new yp)!=Sp)&&(Op=function(t){var o=Es(t),a="[object Object]"==o?t.constructor:void 0,c=a?tu(a):"";if(c)switch(c){case _p:return kp;case Tp:return bp;case Cp:return xp;case Mp:return wp;case Ep:return Sp}return o});var Pp=Op,Ip="[object Arguments]",Ap="[object Array]",jp="[object Object]",Rp=Object.prototype.hasOwnProperty;var Lp=function baseIsEqualDeep(t,o,a,c,h,m){var v=pf(t),b=pf(o),x=v?Ap:Pp(t),w=b?Ap:Pp(o),S=(x=x==Ip?jp:x)==jp,k=(w=w==Ip?jp:w)==jp,_=x==w;if(_&&hf(t)){if(!hf(o))return!1;v=!0,S=!1}if(_&&!S)return m||(m=new Xf),v||xf(t)?Zf(t,o,a,c,h,m):op(t,o,x,a,c,h,m);if(!(1&a)){var T=S&&Rp.call(t,"__wrapped__"),C=k&&Rp.call(o,"__wrapped__");if(T||C){var M=T?t.value():t,E=C?o.value():o;return m||(m=new Xf),h(M,E,a,c,m)}}return!!_&&(m||(m=new Xf),mp(t,o,a,c,h,m))};var Fp=function baseIsEqual(t,o,a,c,h){return t===o||(null==t||null==o||!Gc(t)&&!Gc(o)?t!=t&&o!=o:Lp(t,o,a,c,baseIsEqual,h))};var Np=function baseIsMatch(t,o,a,c){var h=a.length,m=h,v=!c;if(null==t)return!m;for(t=Object(t);h--;){var b=a[h];if(v&&b[2]?b[1]!==t[b[0]]:!(b[0]in t))return!1}for(;++h<m;){var x=(b=a[h])[0],w=t[x],S=b[1];if(v&&b[2]){if(void 0===w&&!(x in t))return!1}else{var k=new Xf;if(c)var _=c(w,S,x,t,o,k);if(!(void 0===_?Fp(S,w,3,c,k):_))return!1}}return!0};var Up=function isStrictComparable(t){return t==t&&!Os(t)};var Dp=function getMatchData(t){for(var o=Of(t),a=o.length;a--;){var c=o[a],h=t[c];o[a]=[c,h,Up(h)]}return o};var Bp=function matchesStrictComparable(t,o){return function(a){return null!=a&&(a[t]===o&&(void 0!==o||t in Object(a)))}};var qp=function baseMatches(t){var o=Dp(t);return 1==o.length&&o[0][2]?Bp(o[0][0],o[0][1]):function(a){return a===t||Np(a,t,o)}};var zp=function isSymbol(t){return"symbol"==typeof t||Gc(t)&&"[object Symbol]"==Es(t)},Kp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hp=/^\w*$/;var Gp=function isKey(t,o){if(pf(t))return!1;var a=typeof t;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=t&&!zp(t))||(Hp.test(t)||!Kp.test(t)||null!=o&&t in Object(o))};function memoize(t,o){if("function"!=typeof t||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");var memoized=function(){var a=arguments,c=o?o.apply(this,a):a[0],h=memoized.cache;if(h.has(c))return h.get(c);var m=t.apply(this,a);return memoized.cache=h.set(c,m)||h,m};return memoized.cache=new(memoize.Cache||Nu),memoized}memoize.Cache=Nu;var $p=memoize;var Wp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vp=/\\(\\)?/g,Qp=function memoizeCapped(t){var o=$p(t,(function(t){return 500===a.size&&a.clear(),t})),a=o.cache;return o}((function(t){var o=[];return 46===t.charCodeAt(0)&&o.push(""),t.replace(Wp,(function(t,a,c,h){o.push(c?h.replace(Vp,"$1"):a||t)})),o})),Jp=Qp,Xp=bs?bs.prototype:void 0,Yp=Xp?Xp.toString:void 0;var Zp=function baseToString(t){if("string"==typeof t)return t;if(pf(t))return Wu(t,baseToString)+"";if(zp(t))return Yp?Yp.call(t):"";var o=t+"";return"0"==o&&1/t==-Infinity?"-0":o};var ed=function toString(t){return null==t?"":Zp(t)};var td=function castPath(t,o){return pf(t)?t:Gp(t,o)?[t]:Jp(ed(t))};var rd=function toKey(t){if("string"==typeof t||zp(t))return t;var o=t+"";return"0"==o&&1/t==-Infinity?"-0":o};var nd=function baseGet(t,o){for(var a=0,c=(o=td(o,t)).length;null!=t&&a<c;)t=t[rd(o[a++])];return a&&a==c?t:void 0};var od=function get(t,o,a){var c=null==t?void 0:nd(t,o);return void 0===c?a:c};var id=function baseHasIn(t,o){return null!=t&&o in Object(t)};var ad=function hasPath(t,o,a){for(var c=-1,h=(o=td(o,t)).length,m=!1;++c<h;){var v=rd(o[c]);if(!(m=null!=t&&a(t,v)))break;t=t[v]}return m||++c!=h?m:!!(h=null==t?0:t.length)&&al(h)&&gf(v,h)&&(pf(t)||ff(t))};var sd=function hasIn(t,o){return null!=t&&ad(t,o,id)};var cd=function baseMatchesProperty(t,o){return Gp(t)&&Up(o)?Bp(rd(t),o):function(a){var c=od(a,t);return void 0===c&&c===o?sd(a,t):Fp(o,c,3)}};var ud=function baseProperty(t){return function(o){return null==o?void 0:o[t]}};var ld=function basePropertyDeep(t){return function(o){return nd(o,t)}};var fd=function property(t){return Gp(t)?ud(rd(t)):ld(t)};var pd=function baseIteratee(t){return"function"==typeof t?t:null==t?Ju:"object"==typeof t?pf(t)?cd(t[0],t[1]):qp(t):fd(t)};var dd=function baseAssignValue(t,o,a){"__proto__"==o&&tl?tl(t,o,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[o]=a},hd=Object.prototype.hasOwnProperty;var md=function assignValue(t,o,a){var c=t[o];hd.call(t,o)&&wu(c,a)&&(void 0!==a||o in t)||dd(t,o,a)};var gd=function baseSet(t,o,a,c){if(!Os(t))return t;for(var h=-1,m=(o=td(o,t)).length,v=m-1,b=t;null!=b&&++h<m;){var x=rd(o[h]),w=a;if("__proto__"===x||"constructor"===x||"prototype"===x)return t;if(h!=v){var S=b[x];void 0===(w=c?c(S,x,b):void 0)&&(w=Os(S)?S:gf(o[h+1])?[]:{})}md(b,x,w),b=b[x]}return t};var vd=function basePickBy(t,o,a){for(var c=-1,h=o.length,m={};++c<h;){var v=o[c],b=nd(t,v);a(b,v)&&gd(m,td(v,t),b)}return m},yd=Tf(Object.getPrototypeOf,Object),bd=Object.getOwnPropertySymbols?function(t){for(var o=[];t;)ip(o,pp(t)),t=yd(t);return o}:cp;var xd=function nativeKeysIn(t){var o=[];if(null!=t)for(var a in Object(t))o.push(a);return o},wd=Object.prototype.hasOwnProperty;var Sd=function baseKeysIn(t){if(!Os(t))return xd(t);var o=_f(t),a=[];for(var c in t)("constructor"!=c||!o&&wd.call(t,c))&&a.push(c);return a};var kd=function keysIn(t){return sl(t)?Sf(t,!0):Sd(t)};var _d=function getAllKeysIn(t){return ap(t,kd,bd)};var Td,Cd,Md=function pickBy(t,o){if(null==t)return{};var a=Wu(_d(t),(function(t){return[t]}));return o=pd(o),vd(t,a,(function(t,a){return o(t,a[0])}))},Ed={"6_2":"getNosToken","6_22":"getOriginUrl","6_26":"getNosCdnHost","6_27":"getGrayscaleConfig","6_28":"getMixStorePolicy","6_29":"getMixStoreToken","6_30":"getFileAuthToken"},Od={nosToken:{objectName:1,token:2,bucket:3,expireTime:4,expireSec:7,tag:8,shortUrl:9},mixStoreTokenReqTag:{provider:0,tokenCount:1,fileExpireSec:2,tag:3,returnBody:4},nosConfigTag:{bucket:1,cdnDomain:2,expire:3,objectNamePrefix:4},grayConfigTag:{config:0,ttl:1},mixStorePolicyTag:{providers:0,ttl:1,mixEnable:2,nosPolicy:3,s3Policy:4},mixStoreTokenResTag:{provider:0,accessKeyId:1,secretAccessKey:2,sessionToken:3,token:4,expireTime:5,bucket:6,objectName:7,fileExpireSec:8,tag:9,shortUrl:10,region:11},nosSafeUrlTag:{safeUrl:0,originUrl:1},mixStoreAuthTokenReqTag:{type:1,urls:2},mixStoreAuthTokenResTag:{type:1,tokens:2,token:3,ttl:4}},Pd=invertSerializeMap(Od),Id={getNosToken:{sid:6,cid:2,service:"cloudStorage",response:[{type:"Property",name:"nosToken",reflectMapper:Pd.nosToken}],params:[{type:"String",name:"responseBody"},{type:"Property",name:"nosToken",entity:"nosToken",reflectMapper:Od.nosToken}]},getOriginUrl:{sid:6,cid:22,service:"cloudStorage",response:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:Pd.nosSafeUrlTag}],params:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:Od.nosSafeUrlTag}]},getNosCdnHost:{sid:6,cid:26,service:"misc",response:[{type:"Property",name:"nosConfigTag",reflectMapper:Pd.nosConfigTag}]},getGrayscaleConfig:{sid:6,cid:27,service:"cloudStorage",response:[{type:"Property",name:"grayConfigTag",reflectMapper:Pd.grayConfigTag}],params:[{type:"Property",name:"config"}]},getMixStorePolicy:{sid:6,cid:28,service:"cloudStorage",params:[{type:"LongArray",name:"supportType"}],response:[{type:"Property",name:"mixStorePolicyTag",reflectMapper:Pd.mixStorePolicyTag}]},getMixStoreToken:{sid:6,cid:29,service:"cloudStorage",params:[{type:"Property",name:"mixStoreTokenReqTag",reflectMapper:Od.mixStoreTokenReqTag}],response:[{type:"Property",name:"mixStoreTokenResTag",reflectMapper:Pd.mixStoreTokenResTag}]},getFileAuthToken:{sid:6,cid:30,service:"cloudStorage",params:[{type:"Property",name:"mixStoreAuthTokenReqTag",reflectMapper:Od.mixStoreAuthTokenReqTag}],response:[{type:"Property",name:"mixStoreAuthTokenResTag",reflectMapper:Pd.mixStoreAuthTokenResTag}]}};!function(t){t[t.nos=1]="nos",t[t.s3=2]="s3"}(Td||(Td={})),function(t){t[t.dontNeed=-1]="dontNeed",t[t.time=2]="time",t[t.urls=3]="urls"}(Cd||(Cd={}));var Ad,jd,Rd={chunkUploadHost:"https://wanproxy-web.127.net",commonUploadHost:"https://nos.netease.com",chunkMaxSize:4194304e4,commonMaxSize:104857600,uploadReplaceFormat:"https://{host}/{object}",cdn:{defaultCdnDomain:"nim.nosdn.127.net",cdnDomain:"",bucket:"",objectNamePrefix:""},downloadUrl:"https://{bucket}-nosdn.netease.im/{object}",downloadHostList:["nos.netease.com"],nosCdnEnable:!0,isNeedToGetUploadPolicyFromServer:!0},Ld={file:{md5:"$(Etag)",size:"$(ObjectSize)"},image:{md5:"$(Etag)",size:"$(ObjectSize)",w:"$(ImageInfo.Width)",h:"$(ImageInfo.Height)",orientation:"$(ImageInfo.Orientation)"},audio:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Audio.Duration)"},video:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Video.Duration)",w:"$(AVinfo.Video.Width)",h:"$(AVinfo.Video.Height)"}},Fd={accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"",maxRetries:0,bucket:"",objectName:"",token:"",shortUrl:""};function getUploadResponseFormat(t){return void 0===t&&(t="file"),Aa(Ld[t]||{}).replace(/"/gi,'\\"')}!function(t){t[t.nos=1]="nos",t[t.s3=2]="s3"}(Ad||(Ad={})),function(t){t[t.dontNeed=-1]="dontNeed",t[t.time=2]="time",t[t.urls=3]="urls"}(jd||(jd={}));var Nd,Ud=function(){function CloudStorageService(t,o){void 0===o&&(o={}),this.GRAYKEY="AllGrayscaleConfig",this.MIXSTOREKEY="AllMixStorePolicy",this.config={},this.nosCdnHostTimer=0,this.grayConfig={mixStoreEnable:!1,timeStamp:0,ttl:0},this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=Ad.nos,this.s3=null,this.mixStoreErrorCount=10,this.nosErrorCount=0,this.circuitTimer=0,this.name="cloudStorage",this.logger=t.logger,this.core=t,registerParser({cmdMap:Ed,cmdConfig:Id}),this.setOptions(o)}var t=CloudStorageService.prototype;return t.setOptions=function setOptions(t){void 0===t&&(t={});var o=t.storageKeyPrefix||"NIMClient";this.GRAYKEY=o+"-AllGrayscaleConfig",this.MIXSTOREKEY=o+"-AllMixStorePolicy";var a=t.s3,c=__rest(t,["s3"]),h=Ma({},Rd,this.config);if(c&&Object.prototype.hasOwnProperty.call(c,"cdn")){var m={cdn:Ma(Ma({},h.cdn),c.cdn)};this.config=Ma({},h,c,m)}else this.config=Ma({},h,c);a&&(this.s3=a)},t.init=function init(){return __awaiter(this,void 0,void 0,wa.mark((function _callee(){return wa.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(this.grayConfig=null,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=Ad.nos,this.mixStoreErrorCount=10,!this.config.isNeedToGetUploadPolicyFromServer){t.next=9;break}return t.next=7,this.getGrayscaleConfig(this.core.options.appkey);case 7:return t.next=9,this.getNosCdnHost();case 9:case"end":return t.stop()}}),_callee,this)})))},t.uploadFile=function uploadFile(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){var o,a,c;return wa.wrap((function _callee2$(h){for(;;)switch(h.prev=h.next){case 0:if(validate({maxSize:{type:"number",required:!1},type:{type:"enum",values:["file","image","audio","video"]}},t),t.fileInput||t.file||t.filePath){h.next=3;break}throw new Error("uploadFile needs target file object or a filePath");case 3:if(!t.type||"file"===t.type){h.next=7;break}if("string"!=typeof(o=od(t,"file.type"))||-1!==indexOf(o).call(o,t.type)){h.next=7;break}throw new Error('The meta type "'+o+'" does not match "'+t.type+'"');case 7:if(this.grayConfig&&this.grayConfig.mixStoreEnable&&this.mixStorePolicy.providers.length){h.next=10;break}return this.logger.log("uploadFile:: uploadFile begin, use old nos"),h.abrupt("return",this.nosUpload(t));case 10:return this.logger.log("uploadFile:: uploadFile begin,Current settings grayConfig mixStoreEnable:"+this.grayConfig.mixStoreEnable+" curProvider:"+this.curProvider),this.s3||(this.curProvider=Ad.nos),a=Fd,h.prev=13,h.next=16,this.core.sendCmd("getMixStoreToken",{mixStoreTokenReqTag:{provider:this.curProvider,tokenCount:1,tag:"qchat",returnBody:getUploadResponseFormat(t.type)}});case 16:c=h.sent,a=c.content.mixStoreTokenResTag,h.next=24;break;case 20:throw h.prev=20,h.t0=h.catch(13),this.core.logger.error("uploadFile:: getMixStoreToken error",h.t0),new gc("getMixStoreToken error",h.t0,this.curProvider,this.mixStorePolicy);case 24:return h.abrupt("return",this.curProvider===Ad.s3?this.s3Upload(t,a):this.nosUpload(t,a));case 25:case"end":return h.stop()}}),_callee2,this,[[13,20]])})))},t.nosUpload=function nosUpload(t,o){var a,c;return __awaiter(this,void 0,void 0,wa.mark((function _callee3(){var h,m,v,b,x,w,S,k,_,T,C,M,E;return wa.wrap((function _callee3$(O){for(;;)switch(O.prev=O.next){case 0:if(h=od(this.core,"config.cdn.bucket"),m={tag:t.nosScenes||h||"nim",expireSec:t.nosSurvivalTime},o){O.next=13;break}return O.prev=3,O.next=6,this.core.sendCmd("getNosToken",{responseBody:getUploadResponseFormat(t.type),nosToken:m});case 6:v=O.sent,O.next=13;break;case 9:throw O.prev=9,O.t0=O.catch(3),this.core.logger.error("uploadFile:: getNosToken error",O.t0),new gc("getNosToken error",O.t0,1);case 13:return O.prev=13,x=v?v.content.nosToken:o,this.core.logger.debug("uploadFile:: uploadFile params",{nosToken:x,chunkUploadHost:this.config.chunkUploadHost,commonUploadHost:this.config.commonUploadHost,platform:Sc.platform}),O.next=18,this.core.adapters.uploadFile(Ma(Ma({},t),{nosToken:x,chunkUploadHost:this.config.chunkUploadHost,commonUploadHost:this.config.commonUploadHost,maxSize:t.maxSize||this.config.chunkMaxSize}));case 18:b=O.sent,O.next=42;break;case 21:if(O.prev=21,O.t1=O.catch(13),this.core.logger.error("uploadFile::nos uploadFile error",O.t1),!o){O.next=41;break}if(0!==this.nosErrorCount){O.next=37;break}O.prev=26,this._addCircuitTimer(),O.next=33;break;case 30:throw O.prev=30,O.t2=O.catch(26),new gc("upload file error",O.t2,this.curProvider,this.mixStorePolicy,t.file||t.filePath);case 33:return this.nosErrorCount=null===(a=this.mixStorePolicy.nosPolicy)||void 0===a?void 0:a.uploadConfig.retryPolicy.retry,O.abrupt("return",this.uploadFile(t));case 37:return this.nosErrorCount--,O.abrupt("return",this.nosUpload(t,o));case 39:O.next=42;break;case 41:throw new gc("nos uploadFile error",O.t1,1);case 42:if(w=null==b?void 0:b.type,S=w&&indexOf(w).call(w,"/")>-1?slice(w).call(w,0,indexOf(w).call(w,"/")):"",k={image:"imageInfo",video:"vinfo",audio:"vinfo"},_=this.config.uploadReplaceFormat.replace("{host}",this.config.cdn.cdnDomain||this.config.cdn.defaultCdnDomain).replace("{object}",v?v.content.nosToken.objectName:null==o?void 0:o.objectName),o&&o.shortUrl&&(_=o.shortUrl),k[S]){O.next=49;break}return O.abrupt("return",Ma({url:_},b));case 49:if(O.prev=49,!(indexOf(_).call(_,"_im_url=1")<0)){O.next=54;break}return O.next=53,this.core.adapters.request(_+"?"+k[S],{method:"GET",dataType:"json",timeout:5e3});case 53:T=O.sent;case 54:O.next=60;break;case 56:return O.prev=56,O.t3=O.catch(49),this.core.logger.error("uploadFile:: fetch file info error",O.t3),O.abrupt("return",Ma({url:_},b));case 60:if(!T){O.next=67;break}return C=T.data,M="imageInfo"===k[S]?C:null===(c=null==C?void 0:C.GetVideoInfo)||void 0===c?void 0:c.VideoInfo,E={url:_,name:b.name,size:b.size,ext:b.ext,w:M.Width,h:M.Height,orientation:M.Orientation,dur:M.Duration,audioCodec:M.AudioCodec,videoCodec:M.VideoCodec,container:M.Container},O.abrupt("return",Md(E,(function(t,o){return void 0!==o})));case 67:return O.abrupt("return",Ma({url:_},b));case 68:case"end":return O.stop()}}),_callee3,this,[[3,9],[13,21],[26,30],[49,56]])})))},t.getNosCdnHost=function getNosCdnHost(){var t;return __awaiter(this,void 0,void 0,wa.mark((function _callee4(){var o,a,c,h=this;return wa.wrap((function _callee4$(m){for(;;)switch(m.prev=m.next){case 0:return m.prev=0,m.next=3,this.core.sendCmd("getNosCdnHost");case 3:o=m.sent,m.next=10;break;case 6:return m.prev=6,m.t0=m.catch(0),this.logger.error("getNosCdnHost::error",m.t0),m.abrupt("return");case 10:if(o){m.next=12;break}return m.abrupt("return");case 12:a=null===(t=null==o?void 0:o.content)||void 0===t?void 0:t.nosConfigTag,0!==(c=Fl(null==a?void 0:a.expire))&&a.cdnDomain?-1===c?(this.config.cdn.bucket=a.bucket,this.config.cdn.cdnDomain=a.cdnDomain,this.config.cdn.objectNamePrefix=a.objectNamePrefix):(this.config.cdn.bucket=a.bucket,this.config.cdn.cdnDomain=a.cdnDomain,this.config.cdn.objectNamePrefix=a.objectNamePrefix,this.nosCdnHostTimer=this.core.timerManager.addTimer((function(){h.getNosCdnHost()}),1e3*c)):(this.config.cdn.bucket="",this.config.cdn.cdnDomain="",this.config.cdn.objectNamePrefix="");case 15:case"end":return m.stop()}}),_callee4,this,[[0,6]])})))},t.getGrayscaleConfig=function getGrayscaleConfig(t){var o;return __awaiter(this,void 0,void 0,wa.mark((function _callee5(){var a,c;return wa.wrap((function _callee5$(h){for(;;)switch(h.prev=h.next){case 0:if(Sc.localStorage)try{Sc.localStorage.getItem&&Sc.localStorage.getItem(this.GRAYKEY)&&(this.grayConfig=JSON.parse(Sc.localStorage.getItem(this.GRAYKEY))[t])}catch(t){Sc.localStorage.getItem(this.GRAYKEY)&&this.core.logger.error("uploadFile:: JSON.parse grayscaleConfig error ",t)}if(this.grayConfig&&!(this.grayConfig.timeStamp+1e3*this.grayConfig.ttl<(new Date).getTime())){h.next=17;break}return h.next=4,this.core.sendCmd("getGrayscaleConfig",{config:{}});case 4:if(!(a=h.sent).content||!a.content.grayConfigTag){h.next=16;break}this.logger.log("uploadFile::getAppGrayConfigRequest success ");try{this.grayConfig=JSON.parse(a.content.grayConfigTag.config),this.grayConfig.ttl=JSON.parse(a.content.grayConfigTag.ttl)}catch(t){this.logger.error("getGrayscaleConfig error",t)}if(this.grayConfig){h.next=10;break}return h.abrupt("return");case 10:c=Sc.localStorage.getItem(this.GRAYKEY)?JSON.parse(Sc.localStorage.getItem(this.GRAYKEY)):{},this.grayConfig.timeStamp=(new Date).getTime(),c[t]=this.grayConfig,Sc.localStorage.setItem(this.GRAYKEY,Aa(c)),h.next=17;break;case 16:this.logger.debug("uploadFile:: result grayConfig:",a.content);case 17:if(!(null===(o=this.grayConfig)||void 0===o?void 0:o.mixStoreEnable)){h.next=20;break}return h.next=20,this._getMixStorePolicy(t);case 20:case"end":return h.stop()}}),_callee5,this)})))},t._getMixStorePolicy=function _getMixStorePolicy(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee6(){var o,a,c,h,m,v,b;return wa.wrap((function _callee6$(x){for(;;)switch(x.prev=x.next){case 0:if(o=(new Date).getTime(),Sc.localStorage)try{this.mixStorePolicy=JSON.parse(Sc.localStorage.getItem(this.MIXSTOREKEY))[t],this.curProvider=Fl(this.mixStorePolicy.providers[0]),this.mixStorePolicy.timeStamp&&this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl>o&&(c=this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl-o,this.core.timerManager.addTimer(bind$1(a=this._getMixStorePolicy).call(a,this,t),c))}catch(o){Sc.localStorage.getItem(this.MIXSTOREKEY)&&JSON.parse(Sc.localStorage.getItem(this.MIXSTOREKEY))[t]&&this.core.logger.error("uploadFile:: JSON.parse mixStorePolicy error ",o)}if(this.mixStorePolicy&&!(this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl<=o)){x.next=30;break}return x.prev=3,x.next=6,this.core.sendCmd("getMixStorePolicy",{supportType:this.s3?[1,2]:[1]});case 6:m=x.sent,v=m.content.mixStorePolicyTag,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.mixStorePolicy.ttl=Number(v.ttl),this.mixStorePolicy.providers=v.providers.split(","),this.circuitTimer&&this.core.timerManager.deleteTimer(this.circuitTimer),this.curProvider=Fl(this.mixStorePolicy.providers[0]),this.mixStorePolicy.nosPolicy=v.nosPolicy?JSON.parse(v.nosPolicy):null,this.mixStorePolicy.s3Policy=v.s3Policy?JSON.parse(v.s3Policy):null,null===this.mixStorePolicy.s3Policy?this.mixStorePolicy.providers=["1"]:null===this.mixStorePolicy.nosPolicy?this.mixStorePolicy.providers=["2"]:this.mixStorePolicy.providers=this.mixStorePolicy.s3Policy.priority<this.mixStorePolicy.nosPolicy.priority?["2","1"]:["1","2"],this.core.timerManager.addTimer(bind$1(h=this._getMixStorePolicy).call(h,this,t),1e3*this.mixStorePolicy.ttl),b=Sc.localStorage.getItem(this.MIXSTOREKEY)?JSON.parse(Sc.localStorage.getItem(this.MIXSTOREKEY)):{},this.mixStorePolicy.timeStamp=(new Date).getTime(),b[t]=this.mixStorePolicy,Sc.localStorage.setItem(this.MIXSTOREKEY,Aa(b)),x.next=30;break;case 23:if(x.prev=23,x.t0=x.catch(3),this.logger.error("getMixStorePolicy error",x.t0),0!==this.mixStoreErrorCount){x.next=28;break}throw new Error("getMixStorePolicy all count error");case 28:this._getMixStorePolicy(t),this.mixStoreErrorCount--;case 30:this.mixStorePolicy.nosPolicy&&(this.nosErrorCount=this.mixStorePolicy.nosPolicy.uploadConfig.retryPolicy.retry);case 31:case"end":return x.stop()}}),_callee6,this,[[3,23]])})))},t.s3Upload=function s3Upload(t,o){return __awaiter(this,void 0,void 0,wa.mark((function _callee7(){var a,c,h,m,v,b,x,w,S,k,_=this;return wa.wrap((function _callee7$(T){for(;;)switch(T.prev=T.next){case 0:if(!t.file){T.next=4;break}a=t.file,T.next=19;break;case 4:if("string"!=typeof t.fileInput){T.next=14;break}if(this.logger.warn("fileInput will abandon,Please use file or filepath"),!((c=document.getElementById(t.fileInput))&&c.files&&c.files[0])){T.next=11;break}a=c.files[0],T.next=12;break;case 11:throw new Error("Can not get file from fileInput");case 12:T.next=19;break;case 14:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){T.next=18;break}a=t.fileInput.files[0],T.next=19;break;case 18:throw new Error("Can not get file from fileInput "+t.fileInput);case 19:if(this.mixStorePolicy.s3Policy){T.next=21;break}throw new Error("dont get s3 policy");case 21:return h={accessKeyId:o.accessKeyId,secretAccessKey:o.secretAccessKey,sessionToken:o.sessionToken,region:o.region,maxRetries:this.mixStorePolicy.s3Policy.uploadConfig.retryPolicy.retry},m=this.s3,(v=new m).config.update(h),b=decodeURIComponent(o.bucket),x=decodeURIComponent(o.objectName),S={Bucket:b,Key:x,Body:w=a,Metadata:{token:o.token},ContentType:w.type||"application/octet-stream"},this.core.logger.debug("uploadFile:: s3 upload params:",S),k=v.upload(S),T.abrupt("return",new ca((function(a){var c=(new Date).getTime();k.send((function(h,m){var v,b;if(h){_.logger.error("uploadFile:","api::s3:upload file failed",h),_.core.reporter.reportTraceStart("exceptions",{user_id:_.core.options.account,trace_id:null===(b=null===(v=_.core)||void 0===v?void 0:v.socket)||void 0===b?void 0:b.sessionId,start_time:c,action:1}),_.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof h.status?h.status:"number"==typeof h.code?h.code:0,description:h.message||""+h.code,operation_type:1,target:h.hostname}),_.core.reporter.reportTraceEnd("exceptions",1);try{_._addCircuitTimer()}catch(h){throw new gc("upload file error",h,_.curProvider,_.mixStorePolicy,t.file||t.filePath)}a(_.uploadFile(t))}else{var x=_.mixStorePolicy.s3Policy.cdnSchema;x=(x=x.replace("{cdnDomain}",_.mixStorePolicy.s3Policy.dlcdn)).replace("{objectName}",m.Key),a({size:w.size,name:w.name,url:o.shortUrl?o.shortUrl:x,ext:w.name.split(".")[1]||"unknown"})}}))})));case 32:case"end":return T.stop()}}),_callee7,this)})))},t.getPrivateUrl=function getPrivateUrl(t){var o;if(!new RegExp(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/).test(t))return this.logger.error("illegal file url:"+t),"";var a=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(t);a[0];var c=a[1];a[2];var h=a[3];a[4];var m=a[5];if(a[6],a[7],null===(o=this.grayConfig)||void 0===o?void 0:o.mixStoreEnable){var v=this._getUrlType(t);return v===Ad.s3&&this.mixStorePolicy.s3Policy&&(t=this.mixStorePolicy.s3Policy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.s3Policy.dlcdn).replace("{objectName}",m)),v===Ad.nos&&this.mixStorePolicy.nosPolicy&&(t=this.mixStorePolicy.nosPolicy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.nosPolicy.dlcdn).replace("{objectName}",m)),t}var b=this.config,x=b.downloadUrl,w=b.downloadHostList,S=b.nosCdnEnable,k=this.config.cdn.cdnDomain,_=this.config.cdn.objectNamePrefix?decodeURIComponent(this.config.cdn.objectNamePrefix):"",T=decodeURIComponent(m),C=indexOf(T).call(T,_);if(k&&C>-1&&S)return""+c+k+"/"+slice(T).call(T,C);if(includes(w).call(w,h)&&includes(m).call(m,"/")){var M=indexOf(m).call(m,"/"),E=m.substring(0,M),O=m.substring(M+1);return x.replace("{bucket}",E).replace("{object}",O)}var P=filter(w).call(w,(function(t){return"string"==typeof h&&includes(h).call(h,t)}))[0],I=P?h.replace(P,"").replace(/\W/g,""):null;return I?x.replace("{bucket}",I).replace("{object}",m):t},t.getOriginUrl=function getOriginUrl(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee8(){var o;return wa.wrap((function _callee8$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("getOriginUrl",{nosSafeUrlTag:{safeUrl:t}});case 2:return o=a.sent,a.abrupt("return",o.content.nosSafeUrlTag.originUrl);case 4:case"end":return a.stop()}}),_callee8,this)})))},t.getFileToken=function getFileToken(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee9(){var o,a,c,h,m,v=this;return wa.wrap((function _callee9$(b){for(;;)switch(b.prev=b.next){case 0:if(validate({type:{type:"number",min:2,max:3},urls:{type:"array",required:!1,itemType:"string"}},t),o=this.mixStorePolicy.nosPolicy?this.mixStorePolicy.nosPolicy.authPolicy.policyType:null,a=this.mixStorePolicy.s3Policy?this.mixStorePolicy.s3Policy.authPolicy.policyType:null,o!==String(jd.dontNeed)||a!==String(jd.dontNeed)){b.next=8;break}throw this.logger.error("don't need token"),new Error("don't need token");case 8:if(t.type!==jd.time){b.next=17;break}if(!(o&&indexOf(o).call(o,String(jd.time))>=0||a&&indexOf(a).call(a,String(jd.time))>0)){b.next=13;break}return b.abrupt("return",this.getFileAuthToken(t));case 13:throw this.logger.error("don't support time token "),new Error("don't support type time token ");case 15:b.next=33;break;case 17:if(t.urls&&t.urls.length){b.next=20;break}throw this.logger.error("urls is required when urls token"),new Error("urls is required when urls token");case 20:if(h=[],m=[],forEach$1(c=t.urls).call(c,(function(t){var o=v._getUrlType(t);o===Ad.nos&&m.push(t),o===Ad.s3&&h.push(t)})),(!a||0!==h.length&&indexOf(a).call(a,String(jd.urls))<0)&&(this.logger.warn("s3 url don't support url token"),h=[]),(!o||0!==m.length&&indexOf(o).call(o,String(jd.urls))<0)&&(this.logger.warn("nos url don't support url token"),m=[]),0!==h.length||0!==m.length){b.next=30;break}throw this.logger.error("not support urls"),new Error("not support urls");case 30:if(0!==h.length&&0!==m.length){b.next=33;break}return t.urls=Aa(t.urls),b.abrupt("return",this.getFileAuthToken(t));case 33:case"end":return b.stop()}}),_callee9,this)})))},t.getFileAuthToken=function getFileAuthToken(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee10(){var o;return wa.wrap((function _callee10$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("getFileAuthToken",{mixStoreAuthTokenReqTag:t});case 2:return o=a.sent,a.abrupt("return",o.content.mixStoreAuthTokenResTag);case 4:case"end":return a.stop()}}),_callee10,this)})))},t._getUrlType=function _getUrlType(t){var o,a;return this.mixStorePolicy.nosPolicy&&some(o=this.mixStorePolicy.nosPolicy.dlcdns).call(o,(function(o){return indexOf(t).call(t,o)>=0}))?Ad.nos:this.mixStorePolicy.s3Policy&&some(a=this.mixStorePolicy.s3Policy.dlcdns).call(a,(function(o){return indexOf(t).call(t,o)>=0}))?Ad.s3:null},t._addCircuitTimer=function _addCircuitTimer(){var t=this,o=this.mixStorePolicy.providers,a=o[(indexOf(o).call(o,String(this.curProvider))+1)%o.length];if(a===o[0])throw new Error("uploadFile all policy fail");var c=od(this.mixStorePolicy,"s3Policy.uploadConfig.retryPolicy");if(c&&c.retryNext&&a&&(this.logger.log("uploadFile:: upload policy will change,now policy:"+this.curProvider+" nextProvider:"+a),this.curProvider=Fl(a),this.mixStorePolicy.nosPolicy&&this.mixStorePolicy.s3Policy)){var h=this.mixStorePolicy[this.curProvider===Ad.nos?"nosPolicy":"s3Policy"].uploadConfig.retryPolicy.circuit;if(!h||0===h)return;this.circuitTimer=this.core.timerManager.addTimer((function(){t.logger.log("uploadFile:: upload policy will change,now policy:"+t.curProvider+" nextProvider:"+Fl(t.mixStorePolicy.providers[0])),t.curProvider=Fl(t.mixStorePolicy.providers[0]),t.core.timerManager.deleteTimer(t.circuitTimer)}),1e3*h)}},t.process=function process(t){var o=this[t.cmd+"Handler"];return"function"==typeof o?o.call(this,t):t.error&&!t.error.ignore?ca.reject(t.error):ca.resolve(t)},CloudStorageService}(),Dd=function(t){function ChatroomMsgService(o){return t.call(this,"chatroomMsg",o)||this}kt(ChatroomMsgService,t);var o=ChatroomMsgService.prototype;return o.sendTextMsg=function sendTextMsg(t){return validate({body:{type:"string",allowEmpty:!1}},t),this.sendMsg(Ma(Ma({},t),{type:"text"}))},o.sendGeoLocationMsg=function sendGeoLocationMsg(t){return validate({body:{type:"object",rules:{title:{type:"string",allowEmpty:!1},lat:{type:"number"},lng:{type:"number"}}}},t),this.sendMsg(Ma(Ma({},t),{type:"geo",body:Aa(t.body)}))},o.sendTipMsg=function sendTipMsg(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee(){return wa.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),o.abrupt("return",this.sendMsg(Ma(Ma({},t),{type:"tip"})));case 2:case"end":return o.stop()}}),_callee,this)})))},o.sendCustomMsg=function sendCustomMsg(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){return wa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),o.abrupt("return",this.sendMsg(Ma(Ma({},t),{type:"custom"})));case 2:case"end":return o.stop()}}),_callee2,this)})))},o.sendImageMsg=function sendImageMsg(t){return this.doSendFile(Ma(Ma({},t),{type:"image"}))},o.sendFileMsg=function sendFileMsg(t){return this.doSendFile(Ma(Ma({},t),{type:"file"}))},o.sendAudioMsg=function sendAudioMsg(t){return this.doSendFile(Ma(Ma({},t),{type:"audio"}))},o.sendVideoMsg=function sendVideoMsg(t){return this.doSendFile(Ma(Ma({},t),{type:"video"}))},o.doSendFile=function doSendFile(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee3(){var o;return wa.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:if(validate({type:{type:"string",allowEmpty:!1},body:{type:"object",rules:{url:{type:"string",allowEmpty:!1}},required:!1},maxSize:{type:"number",min:1,required:!1}},t),o=t.body){a.next=27;break}if(this.core.cloudStorage&&this.core.cloudStorage.uploadFile){a.next=5;break}throw new Error('Service "cloudStorage" does not exist');case 5:return a.prev=5,this.core.reporter.reportTraceStart("nos",{user_id:this.core.account,action:"upload"}),a.next=9,this.core.cloudStorage.uploadFile(t);case 9:o=a.sent,this.core.reporter.reportTraceEnd("nos",!0),a.next=19;break;case 13:throw a.prev=13,a.t0=a.catch(5),this.core.reporter.reportTraceUpdate("nos",{operation_type:"transfer",error:a.t0},!1),this.core.reporter.reportTraceEnd("nos",!1),this.logger.error("sendFile:: upload File error or abort",a.t0),a.t0;case 19:a.prev=19,t.onUploadDone&&t.onUploadDone(o),a.next=27;break;case 23:throw a.prev=23,a.t1=a.catch(19),this.logger.error("sendFile options.onUploadDone err",a.t1),a.t1;case 27:return a.abrupt("return",this.sendMsg(Ma(Ma({},t),{body:Aa(o),type:t.type})));case 28:case"end":return a.stop()}}),_callee3,this,[[5,13],[19,23]])})))},o.queryMessageHistory=function queryMessageHistory(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee4(){var o,a,c;return wa.wrap((function _callee4$(h){for(;;)switch(h.prev=h.next){case 0:return validate({timetag:{type:"number",required:!1},limit:{type:"number",min:1,max:100,required:!1},reverse:{type:"boolean",required:!1},msgTypes:{type:"array",itemType:"string",required:!1}},t),h.next=3,this.core.sendCmd("chatroomQueryMessageHistory",Ma(Ma({timetag:0,limit:100,reverse:!1},t),{msgTypes:t.msgTypes?map(o=t.msgTypes).call(o,(function(t){return jf[t]})):[]}));case 3:return a=h.sent,c=a.content.chatroomMsgs,h.abrupt("return",formatChatroomMsgs(c,this.core.account));case 6:case"end":return h.stop()}}),_callee4,this)})))},o.getHistoryMsgsByTags=function getHistoryMsgsByTags(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee5(){var o,a,c,h,m;return wa.wrap((function _callee5$(v){for(;;)switch(v.prev=v.next){case 0:return validate({tags:{type:"array",itemType:"string",required:!0},types:{type:"array",itemType:"string",required:!1},fromTime:{type:"number",min:0,required:!1},toTime:{type:"number",min:0,required:!1},limit:{type:"number",min:0,required:!1},reverse:{type:"number",required:!1}},t),c=Ma(Ma({fromTime:0,toTime:0,limit:100,reverse:0},t),{types:t.types?map(o=filter(a=t.types).call(a,(function(t){return void 0!==jf[t]}))).call(o,(function(t){return jf[t]})):[]}),v.next=4,this.core.sendCmd("getHistoryMsgsByTags",{chatRoomTagHistoryMsgRequestTag:Ma(c,{tags:Aa(c.tags),types:Aa(c.types)})});case 4:return h=v.sent,m=h.content.chatroomMsgs,v.abrupt("return",formatChatroomMsgs(m,this.core.account));case 7:case"end":return v.stop()}}),_callee5,this)})))},o.onChatroomMsgHandler=function onChatroomMsgHandler(t){var o=t.content,a=Pa(),c=formatChatroomMsg(null==o?void 0:o.chatroomMsg,this.core.account);if("debug"===this.core.options.debugLevel?this.logger.debug("onChatroomMsgHandler::recvMsg",c.type,c.idClient,c):this.logger.log("onChatroomMsgHandler::recvMsg",c.type,c.idClient),this.core.emit("chatroomMsg",c),"out"!==c.flow){var h={msgId:"",clientId:c.idClient,receiveTime:t.__receiveTime,serverTime:c.time,callbackTime:Pa(),preHandleTime:a,fromAccid:c.from,toAccid:this.core.account,type:4,roomId:c.chatroomId,tid:"",result:200,failReason:"",rt:Pa()-c.time};this.core.reporter.report("msgReceive",h,!0)}},o.sendMsg=function sendMsg(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee6(){var o,a,c,h,m;return wa.wrap((function _callee6$(v){for(;;)switch(v.prev=v.next){case 0:validate({type:{type:"enum",values:getEnumKeys(jf)},subType:{type:"number",min:1,required:!1}},t),o=generatorMsgForCmd(t,this.core.account,this.core.config.deviceId),a=formatChatroomMsg(Ma(Ma({},o),{status:"sending",time:(new Date).getTime()}),this.core.account);try{t.onSendBefore&&t.onSendBefore(a)}catch(t){this.core.logger.error("sendMsg: options.onSendBefore error",t)}return v.prev=4,v.next=7,this.core.sendCmd("sendChatroomMsg",{chatroomMsg:o});case 7:return c=v.sent,h=formatChatroomMsg(Ma(Ma(Ma({},o),c.content.chatroomMsg),{status:"success"}),this.core.account),this.core.reporter.report("msgSend",{msgId:"",clientId:h.idClient,msgTime:h.time,fromAccid:this.core.account,toAccid:"",type:4,roomId:h.chatroomId,tid:"",result:200,faiReason:"",rt:Pa()-a.time}),v.abrupt("return",h);case 13:throw v.prev=13,v.t0=v.catch(4),m=formatChatroomMsg(Ma(Ma({},o),{status:"fail"}),this.core.account),v.t0.msg=m,this.core.reporter.report("msgSend",{msgId:"",clientId:m.idClient,fromAccid:this.core.account,toAccid:"",type:4,roomId:m.chatroomId,tid:"",result:null===v.t0||void 0===v.t0?void 0:v.t0.code,faiReason:(null===v.t0||void 0===v.t0?void 0:v.t0.message)||"",rt:Pa()-o.time}),v.t0;case 19:case"end":return v.stop()}}),_callee6,this,[[4,13]])})))},ChatroomMsgService}(Bf);!function(t){t[t.regular=0]="regular",t[t.temp=1]="temp",t[t.regularOnline=2]="regularOnline",t[t.regularReverse=3]="regularReverse"}(Nd||(Nd={}));var Bd=function(t){function ChatroomMemberService(o){return t.call(this,"chatroomMember",o)||this}kt(ChatroomMemberService,t);var o=ChatroomMemberService.prototype;return o.updateMyRoomRole=function updateMyRoomRole(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee(){return wa.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return validate({member:{type:"object",rules:{nick:{type:"string",required:!1},avatar:{type:"string",required:!1},ext:{type:"string",required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1},needSave:{type:"boolean",required:!1}},t),o.next=3,this.core.sendCmd("chatroomUpdateMyRoomRole",Ma(Ma({},t),{chatroomMember:t.member,ext:t.ext||""}));case 3:case"end":return o.stop()}}),_callee,this)})))},o.setMemberManager=function setMemberManager(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){return wa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.markChatroomMember(Ma(Ma({},t),{type:1}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}}),_callee2,this)})))},o.setMemberNormal=function setMemberNormal(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee3(){return wa.wrap((function _callee3$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.markChatroomMember(Ma(Ma({},t),{type:2}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}}),_callee3,this)})))},o.setMemberMute=function setMemberMute(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee4(){return wa.wrap((function _callee4$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.markChatroomMember(Ma(Ma({},t),{type:-2}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}}),_callee4,this)})))},o.setMemberBlackList=function setMemberBlackList(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee5(){return wa.wrap((function _callee5$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.markChatroomMember(Ma(Ma({},t),{type:-1}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}}),_callee5,this)})))},o.queryMembers=function queryMembers(t){var o;return __awaiter(this,void 0,void 0,wa.mark((function _callee6(){var a;return wa.wrap((function _callee6$(c){for(;;)switch(c.prev=c.next){case 0:return validate({type:{type:"enum",values:getEnumKeys(Nd)},time:{type:"number",required:!1},limit:{type:"number",required:!1}},t),c.next=3,this.core.sendCmd("chatroomQueryMembers",Ma(Ma({time:0,limit:100},t),{type:Nd[t.type]}));case 3:return a=c.sent,c.abrupt("return",formatChatroomMembers(null===(o=a.content)||void 0===o?void 0:o.members));case 5:case"end":return c.stop()}}),_callee6,this)})))},o.queryMembersByAccounts=function queryMembersByAccounts(t){var o;return __awaiter(this,void 0,void 0,wa.mark((function _callee7(){var a;return wa.wrap((function _callee7$(c){for(;;)switch(c.prev=c.next){case 0:return validate({accounts:{type:"array",min:1,max:20,itemType:"string"}},t),c.next=3,this.core.sendCmd("chatroomQueryMembersByAccounts",t);case 3:return a=c.sent,c.abrupt("return",formatChatroomMembers(null===(o=a.content)||void 0===o?void 0:o.members));case 5:case"end":return c.stop()}}),_callee7,this)})))},o.setMemberTempMute=function setMemberTempMute(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee8(){return wa.wrap((function _callee8$(o){for(;;)switch(o.prev=o.next){case 0:return validate({account:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean",required:!1},ext:{type:"string",required:!1}},t),o.next=3,this.core.sendCmd("chatroomSetMemberTempMute",Ma(Ma({},t),{ext:t.ext||""}));case 3:case"end":return o.stop()}}),_callee8,this)})))},o.kickMember=function kickMember(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee9(){return wa.wrap((function _callee9$(o){for(;;)switch(o.prev=o.next){case 0:return validate({account:{type:"string",allowEmpty:!1},ext:{type:"string",required:!1}},t),o.next=3,this.core.sendCmd("chatroomKickMember",Ma(Ma({},t),{ext:t.ext||""}));case 3:case"end":return o.stop()}}),_callee9,this)})))},o.queryMembersCountByTag=function queryMembersCountByTag(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee10(){var o;return wa.wrap((function _callee10$(a){for(;;)switch(a.prev=a.next){case 0:return validate({tag:{type:"string",allowEmpty:!1}},t),a.next=3,this.core.sendCmd("chatroomQueryMembersCountByTag",Ma({},t));case 3:return o=a.sent,a.abrupt("return",o.content.count);case 5:case"end":return a.stop()}}),_callee10,this)})))},o.queryMembersByTag=function queryMembersByTag(t){var o;return __awaiter(this,void 0,void 0,wa.mark((function _callee11(){var a;return wa.wrap((function _callee11$(c){for(;;)switch(c.prev=c.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},time:{type:"number",required:!1},limit:{type:"number",max:100,required:!1}},t),c.next=3,this.core.sendCmd("chatroomQueryMembersByTag",{chatroomTagMemberReq:Ma({time:0,limit:100},t)});case 3:return a=c.sent,c.abrupt("return",formatChatroomMembers(null===(o=a.content)||void 0===o?void 0:o.members));case 5:case"end":return c.stop()}}),_callee11,this)})))},o.setMembersTempMuteByTag=function setMembersTempMuteByTag(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee12(){return wa.wrap((function _callee12$(o){for(;;)switch(o.prev=o.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean"},notifyTargetTags:{type:"string",allowEmpty:!1,required:!1},ext:{type:"string",required:!1}},t),o.next=3,this.core.sendCmd("chatroomSetMembersTempMuteByTag",{chatroomTagMuteReq:Ma(Ma({},t),{needNotify:t.needNotify?1:0,ext:t.ext||""})});case 3:case"end":return o.stop()}}),_callee12,this)})))},o.markChatroomMember=function markChatroomMember(t){var o;return __awaiter(this,void 0,void 0,wa.mark((function _callee13(){var a;return wa.wrap((function _callee13$(c){for(;;)switch(c.prev=c.next){case 0:return validate({account:{type:"string"},isAdd:{type:"boolean"},ext:{type:"string",required:!1},level:{type:"number",required:!1}},t),c.next=3,this.core.sendCmd("markChatroomMember",Ma(Ma({level:0},t),{ext:t.ext||""}));case 3:return a=c.sent,c.abrupt("return",formatChatroomMember(null===(o=a.content)||void 0===o?void 0:o.chatroomMember));case 5:case"end":return c.stop()}}),_callee13,this)})))},ChatroomMemberService}(Bf),qd=function(t){function ChatroomQueueService(o){return t.call(this,"chatroomQueue",o)||this}kt(ChatroomQueueService,t);var o=ChatroomQueueService.prototype;return o.init=function init(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee(){return wa.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return validate({maxItemCount:{type:"number",min:0,max:1e3}},t),o.next=3,this.core.sendCmd("chatroomQueueInit",t);case 3:case"end":return o.stop()}}),_callee,this)})))},o.update=function update(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){return wa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return validate({elementKey:{type:"string",allowEmpty:!1},elementValue:{type:"string",max:4096,allowEmpty:!1},transient:{type:"boolean",required:!1},account:{type:"string",required:!1}},t),o.next=3,this.core.sendCmd("chatroomQueueOffer",Ma(Ma({},t),{transient:!!t.transient}));case 3:case"end":return o.stop()}}),_callee2,this)})))},o.poll=function poll(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee3(){var o;return wa.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:return validate({key:{type:"string",required:!1}},t),t.key||(t.key=""),a.next=4,this.core.sendCmd("chatroomQueuePoll",t||{});case 4:return o=a.sent,a.abrupt("return",o.content);case 6:case"end":return a.stop()}}),_callee3,this)})))},o.batchUpdate=function batchUpdate(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee4(){var o;return wa.wrap((function _callee4$(a){for(;;)switch(a.prev=a.next){case 0:return validate({itemList:{type:"object"},needNotify:{type:"boolean",required:!1},notifyExtension:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomQueueChange",Ma(Ma({},t),{needNotify:!!t.needNotify}));case 3:return o=a.sent,a.abrupt("return",o.content.invalidKeyList);case 5:case"end":return a.stop()}}),_callee4,this)})))},o.fetch=function fetch(){return __awaiter(this,void 0,void 0,wa.mark((function _callee5(){var t;return wa.wrap((function _callee5$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.core.sendCmd("chatroomQueueList");case 2:return t=o.sent,o.abrupt("return",t.content.itemList);case 4:case"end":return o.stop()}}),_callee5,this)})))},o.pickHeader=function pickHeader(){return __awaiter(this,void 0,void 0,wa.mark((function _callee6(){var t,o,a,c;return wa.wrap((function _callee6$(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,this.core.sendCmd("chatroomQueuePeak");case 2:return o=h.sent,a=o.content.elementKey,c=o.content.elementValue,h.abrupt("return",((t={})[a]=c,t));case 6:case"end":return h.stop()}}),_callee6,this)})))},o.clear=function clear(){return __awaiter(this,void 0,void 0,wa.mark((function _callee7(){return wa.wrap((function _callee7$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.core.sendCmd("chatroomQueueDrop");case 2:case"end":return t.stop()}}),_callee7,this)})))},ChatroomQueueService}(Bf),zd={"1_2":"heartbeat","13_2":"chatroomLogin","13_3":"beKickedFromChatroom","13_4":"chatroomExit","13_6":"sendChatroomMsg","13_7":"onChatroomMsg","13_8":"chatroomQueryMembers","13_9":"chatroomQueryMessageHistory","13_11":"markChatroomMember","13_12":"closeChatroom","13_13":"getChatroom","13_14":"updateChatroom","13_15":"chatroomUpdateMyRoomRole","13_16":"chatroomQueryMembersByAccounts","13_17":"chatroomKickMember","13_19":"chatroomSetMemberTempMute","13_20":"chatroomQueueOffer","13_21":"chatroomQueuePoll","13_22":"chatroomQueueList","13_23":"chatroomQueuePeak","13_24":"chatroomQueueDrop","13_25":"chatroomQueueInit","13_26":"chatroomQueueChange","13_30":"chatroomSetMembersTempMuteByTag","13_31":"chatroomQueryMembersByTag","13_32":"chatroomQueryMembersCountByTag","13_36":"getHistoryMsgsByTags","13_101":"updateChatroomTag"},Kd={chatroomLogin:{appkey:1,account:2,deviceId:3,chatroomId:5,appLogin:8,chatroomNick:20,chatroomAvatar:21,chatroomExt:22,chatroomEnterExt:23,session:26,isAnonymous:38,tags:39,notifyTargetTags:40,authType:41,loginExt:42},chatroomIMLogin:{clientType:3,os:4,sdkVersion:6,appLogin:8,protocolVersion:9,pushTokenName:10,pushToken:11,deviceId:13,appkey:18,account:19,browser:24,session:26,deviceInfo:32,token:1e3,customTag:38,customClientType:39,sdkHumanVersion:40,sdkType:41,userAgent:42,isReactNative:112,authType:115,loginExt:116},chatroomMsg:{idClient:1,type:2,body:3,ext:4,resend:5,userUpdateTime:6,fromNick:7,fromAvatar:8,fromExt:9,needAntiSpam:10,antiSpamContent:11,skipHistory:12,messageBody:13,antiSpamBusinessId:14,clientAntiSpam:15,antiSpamUsingYidun:16,time:20,from:21,chatroomId:22,fromClientType:23,highPriority:25,callbackExt:27,subType:28,yidunAntiCheating:29,env:30,notifyTargetTags:31,yidunAntiSpamExt:32,yidunAntiSpamRes:33},chatroom:{id:1,name:3,announcement:4,broadcastUrl:5,ext:12,createTime:14,updateTime:15,queuelevel:16,creator:100,onlineMemberNum:101,mute:102},chatroomMember:{chatroomId:1,account:2,type:3,level:4,nick:5,avatar:6,ext:7,online:8,guest:9,enterTime:10,blacked:12,muted:13,valid:14,updateTime:15,tempMuted:16,tempMuteDuration:17},chatroomTagMemberReq:{tag:1,time:2,limit:3},chatroomTagMuteReq:{tag:1,duration:2,needNotify:3,ext:4,notifyTargetTags:5},chatroomCdnInfo:{enable:1,cdnUrls:2,timestamp:3,interval:4,decryptType:5,decryptKey:6,timeout:7},chatRoomTagHistoryMsgRequestTag:{tags:1,types:2,fromTime:3,toTime:4,limit:5,reverse:6},updateTags:{currentTags:1}},Hd=invertSerializeMap(Kd),Gd={heartbeat:{sid:1,cid:2,service:"chatroom"},chatroomLogin:{sid:13,cid:2,service:"chatroom",params:[{type:"Byte",name:"type"},{type:"Property",name:"chatroomLogin",reflectMapper:Kd.chatroomLogin},{type:"Property",name:"chatroomIMLogin",reflectMapper:Kd.chatroomIMLogin}],response:[{type:"Property",name:"chatroom",reflectMapper:Hd.chatroom},{type:"Property",name:"chatroomMember",reflectMapper:Hd.chatroomMember},{type:"Property",name:"chatroomCdnInfo",reflectMapper:Hd.chatroomCdnInfo}]},chatroomExit:{sid:13,cid:4,service:"chatroom"},sendChatroomMsg:{sid:13,cid:6,service:"chatroomMsg",params:[{type:"Property",name:"chatroomMsg",reflectMapper:Kd.chatroomMsg}],response:[{type:"Property",name:"chatroomMsg",reflectMapper:Hd.chatroomMsg}]},chatroomQueryMessageHistory:{sid:13,cid:9,service:"chatroomMsg",params:[{type:"Long",name:"timetag"},{type:"Int",name:"limit"},{type:"Bool",name:"reverse"},{type:"LongArray",name:"msgTypes"}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:Hd.chatroomMsg}]},getHistoryMsgsByTags:{sid:13,cid:36,service:"chatroomMsg",params:[{type:"Property",name:"chatRoomTagHistoryMsgRequestTag",reflectMapper:Kd.chatRoomTagHistoryMsgRequestTag}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:Hd.chatroomMsg}]},getChatroom:{sid:13,cid:13,service:"chatroom",response:[{type:"Property",name:"chatroom",reflectMapper:Hd.chatroom}]},updateChatroom:{sid:13,cid:14,service:"chatroom",params:[{type:"Property",name:"chatroom",reflectMapper:Kd.chatroom},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"}]},chatroomUpdateMyRoomRole:{sid:13,cid:15,service:"chatroomMember",params:[{type:"Property",name:"chatroomMember",reflectMapper:Kd.chatroomMember},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"},{type:"Bool",name:"needSave"}]},markChatroomMember:{sid:13,cid:11,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Int",name:"type"},{type:"Bool",name:"isAdd"},{type:"Int",name:"level"},{type:"String",name:"ext"}],response:[{type:"Property",name:"chatroomMember",reflectMapper:Hd.chatroomMember}]},chatroomQueryMembers:{sid:13,cid:8,service:"chatroomMember",params:[{type:"Byte",name:"type"},{type:"Long",name:"time"},{type:"Int",name:"limit"}],response:[{type:"PropertyArray",name:"members",reflectMapper:Hd.chatroomMember}]},chatroomQueryMembersByAccounts:{sid:13,cid:16,service:"chatroomMember",params:[{type:"StrArray",name:"accounts"}],response:[{type:"PropertyArray",name:"members",reflectMapper:Hd.chatroomMember}]},chatroomKickMember:{sid:13,cid:17,service:"chatroomMember",params:[{type:"string",name:"account"},{type:"string",name:"ext"}]},chatroomSetMemberTempMute:{sid:13,cid:19,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Long",name:"duration"},{type:"bool",name:"needNotify"},{type:"String",name:"ext"}]},closeChatroom:{sid:13,cid:12,service:"chatroom",params:[{type:"String",name:"ext"}]},chatroomQueryMembersCountByTag:{sid:13,cid:32,service:"chatroomMember",params:[{type:"String",name:"tag"}],response:[{type:"Long",name:"count"}]},chatroomQueryMembersByTag:{sid:13,cid:31,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMemberReq",reflectMapper:Kd.chatroomTagMemberReq}],response:[{type:"PropertyArray",name:"members",reflectMapper:Hd.chatroomMember}]},chatroomSetMembersTempMuteByTag:{sid:13,cid:30,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMuteReq",reflectMapper:Kd.chatroomTagMuteReq}]},chatroomQueueOffer:{sid:13,cid:20,service:"chatroomQueue",params:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"},{type:"bool",name:"transient"},{type:"String",name:"account"}]},chatroomQueuePoll:{sid:13,cid:21,service:"chatroomQueue",params:[{type:"String",name:"key"}],response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueChange:{sid:13,cid:26,service:"chatroomQueue",params:[{type:"StrStrMap",name:"itemList"},{type:"bool",name:"needNotify"},{type:"String",name:"notifyExtension"}],response:[{type:"StrArray",name:"invalidKeyList"}]},chatroomQueueList:{sid:13,cid:22,service:"chatroomQueue",response:[{type:"KVArray",name:"itemList"}]},chatroomQueuePeak:{sid:13,cid:23,service:"chatroomQueue",response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueDrop:{sid:13,cid:24,service:"chatroomQueue"},chatroomQueueInit:{sid:13,cid:25,service:"chatroomQueue",params:[{type:"Int",name:"maxItemCount"}]},onChatroomMsg:{sid:13,cid:7,service:"chatroomMsg",response:[{type:"Property",name:"chatroomMsg",reflectMapper:Hd.chatroomMsg}]},beKickedFromChatroom:{sid:13,cid:3,service:"chatroom",response:[{type:"Number",name:"reason"},{type:"String",name:"ext"}]},updateChatroomTag:{sid:13,cid:101,service:"chatroom",response:[{type:"Property",name:"updateTags",reflectMapper:Hd.updateTags}]}},$d={BROWSER:0,RN:2,UNIAPP:3,WECHAT:6},Wd={debugLevel:"off",needReconnect:!0,reconnectionAttempts:Sa,autoMarkRead:!0,isAbtestEnable:!0,abtestUrl:"https://abt-online.netease.im/v1/api/abt/client/getExperimentInfo",abtestProjectKey:"imElite_sdk_abtest_web"},Vd=function(t){function Chatroom(o,a){var h;return void 0===a&&(a={}),(h=t.call(this,o)||this).instanceName="Chatroom",h.account="",h.options={},h.chatroom={},h.chatroomMsg={},h.chatroomMember={},h.chatroomQueue={},h.cloudStorage={},h.setOptions(o),registerParser({cmdMap:zd,cmdConfig:Gd}),registerParser({cmdMap:Ed,cmdConfig:Id}),h.chatroom=new qf(c(h)),h.chatroomMsg=new Dd(c(h)),h.chatroomMember=new Bd(c(h)),h.chatroomQueue=new qd(c(h)),h.cloudStorage=new Ud(c(h),Ma({storageKeyPrefix:h.instanceName},a.cloudStorageConfig)),Chatroom.instance=c(h),h}kt(Chatroom,t),Chatroom.getInstance=function getInstance(t,o){if(!Chatroom.instance){if(t)return new Chatroom(t,o);throw new Error("Instance not exist, please input options")}if(t){if(Chatroom.instance.options.account===t.account&&Chatroom.instance.options.appkey===t.appkey)return Chatroom.instance.setOptions(t),Chatroom.instance;throw new Error("Unexpected login")}return Chatroom.instance};var o=Chatroom.prototype;return o.setOptions=function setOptions(t){validate({account:{type:"string"},appkey:{type:"string"},token:{type:"string"},chatroomId:{type:"string"},chatroomAddresses:{type:"array",itemType:"string",min:1},needReconnect:{type:"boolean",required:!1},reconnectionAttempts:{type:"number",required:!1},isAnonymous:{type:"boolean",required:!1},tags:{type:"array",itemType:"string",required:!1}},t),this.logger.log("chatroom::setOptions options is",t),this.account=t.account,this.options=Ma(Ma({},Wd),t)},o.connect=function connect(o){void 0===o&&(o={});var a=ut(null,{connect:{get:function get(){return t.prototype.connect}}});return __awaiter(this,void 0,void 0,wa.mark((function _callee(){var t,c,h,m,v;return wa.wrap((function _callee$(b){for(;;)switch(b.prev=b.next){case 0:if(/^(unconnected|waitReconnect)$/.test(this.status)){b.next=4;break}return t="Chatroom status is "+this.status+", and would not connect",this.logger.warn(t),b.abrupt("return",ca.reject(t));case 4:return c=o.isAutoReconnect||!1,h=Pa(),b.next=8,a.connect.call(this,{linkUrls:this.options.chatroomAddresses,isAutoReconnect:c});case 8:return m=b.sent,b.prev=9,b.next=12,this.login(c);case 12:v=b.sent,this.reporter.report("chatroomLogin",{accid:this.account,roomId:this.options.chatroomId,serverIps:this.options.chatroomAddresses,currentServerIp:m,rt:Pa()-h,result:200,failReason:"",time:Pa()}),b.next=25;break;case 16:if(b.prev=16,b.t0=b.catch(9),this.logger.error("chatroom login error",b.t0),this.reporter.report("chatroomLogin",{accid:this.account,roomId:this.options.chatroomId,serverIps:this.options.chatroomAddresses,currentServerIp:m,rt:Pa()-h,result:b.t0&&b.t0.error&&b.t0.error.code,failReason:b.t0&&b.t0.error&&b.t0.error.message,time:Pa()}),0!==this.retryCount){b.next=23;break}throw this.doDisconnect(Xl.ACTIVE,"FailedToInitializeLogin"),b.t0;case 23:return this.doDisconnect(Xl.OFFLINE,"ReconnectLoginFailed"),b.abrupt("return");case 25:return b.prev=25,b.next=28,this.cloudStorage.init();case 28:b.next=33;break;case 30:b.prev=30,b.t1=b.catch(25),this.logger.error("NIM:login cloudStorage init failed ",b.t1);case 33:this.eventBus.emit("logined",v),this.emit("logined",v),this.resetConnectStatus(),this.ping();case 37:case"end":return b.stop()}}),_callee,this,[[9,16],[25,30]])})))},o.login=function login(t){var o,a;return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,wa.mark((function _callee2(){var c,h,m,v,b,x,w;return wa.wrap((function _callee2$(S){for(;;)switch(S.prev=S.next){case 0:return c=this.options,h=Sc.getSystemInfo(),m=Ma(Ma({},c),{appLogin:t?0:1,deviceId:this.config.deviceId,clientType:16,protocolVersion:1,sdkVersion:90900,sdkHumanVersion:"0.12.0",os:h.os,browser:h.browser,session:null===(o=this.socket)||void 0===o?void 0:o.sessionId,sdkType:$d[Sc.platform]||0,userAgent:"Native/0.12.0"}),v=Ma(Ma({},c),{appkey:c.appkey,account:c.account,deviceId:this.config.deviceId,session:null===(a=this.socket)||void 0===a?void 0:a.sessionId,appLogin:1}),c.isAnonymous&&(v.isAnonymous=1,v.account=v.account||"nimanon_"+Nl(),m.account=v.account,v.chatroomNick=v.account||"nimanon_"+Nl(),v.chatroomAvatar=v.chatroomAvatar||" "),c.tags&&c.tags.length>0&&(v.tags=Aa(c.tags)),S.next=8,this.sendCmd("chatroomLogin",{type:1,chatroomLogin:v,chatroomIMLogin:m});case 8:return b=S.sent,this.status="logined",x=formatChatroom(b.content.chatroom),w=formatChatroomMember(b.content.chatroomMember),S.abrupt("return",{chatroom:x,member:w});case 13:case"end":return S.stop()}}),_callee2,this)})))},o.onMessage=function onMessage(o){var a,c,h=t.prototype.onMessage.call(this,o);if(h){var m=h.raw.ser,v=this.sendingCmdMap.get(m);if(v&&v.cmd===h.cmd){var b=v.callback,x=v.timer,w=v.params;if(clearTimeout(x),h.params=w,this.sendingCmdMap.delete(m),"heartbeat"===h.cmd)return void b[0]();var S=null===(a=this[h.service])||void 0===a?void 0:a.process(h);S&&"function"==typeof S.then?S.then((function(t){b[0](t)})).catch((function(t){b[1](t)})):(this.logger.log("imsocket:: handlerFn without promise",h.service,h.cmd),b[0]())}else null===(c=this[h.service])||void 0===c||c.process(h)}},o.disconnect=function disconnect(){var o=this;switch(this.status){case"connected":case"logined":return this.sendCmd("chatroomExit").then((function(){t.prototype.doDisconnect.call(o,Xl.ACTIVE,"UserActiveDisconnect")}));case"connecting":case"waitReconnect":return t.prototype.doDisconnect.call(this,Xl.ACTIVE,"UserActiveDisconnect"),ca.resolve();case"unconnected":case"destroyed":return ca.resolve()}},o.destroy=function destroy(){return Chatroom.instance=null,t.prototype.destroy.call(this)},Chatroom}(tf);Vd.instance=null;var Qd=Math.min,Jd=[].lastIndexOf,Xd=!!Jd&&1/[1].lastIndexOf(1,-0)<0,Yd=arrayMethodIsStrict("lastIndexOf"),Zd=Xd||!Yd?function lastIndexOf(t){if(Xd)return w(Jd,this,arguments)||0;var o=toIndexedObject(this),a=lengthOfArrayLike(o),c=a-1;for(arguments.length>1&&(c=Qd(c,toIntegerOrInfinity(arguments[1]))),c<0&&(c=a+c);c>=0;c--)if(c in o&&o[c]===t)return c||0;return-1}:Jd;_export({target:"Array",proto:!0,forced:Zd!==[].lastIndexOf},{lastIndexOf:Zd});var eh=entryVirtual("Array").lastIndexOf,th=Array.prototype,lastIndexOf=function(t){var o=t.lastIndexOf;return t===th||K(th,t)&&o===th.lastIndexOf?eh:o},rh=createCommonjsModule((function(o,a){(function(){var c={function:!0,object:!0}[typeof window]&&window||this,h=a,m=o&&!o.nodeType&&o,v=h&&m&&"object"==typeof t&&t;!v||v.global!==v&&v.window!==v&&v.self!==v||(c=v);var b=Math.pow(2,53)-1,x=/\bOpera/,w=Object.prototype,S=w.hasOwnProperty,k=w.toString;function capitalize(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function format(t){return t=trim(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:capitalize(t)}function forOwn(t,o){for(var a in t)S.call(t,a)&&o(t[a],a,t)}function getClassOf(t){return null==t?capitalize(t):k.call(t).slice(8,-1)}function qualify(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function reduce(t,o){var a=null;return function each(t,o){var a=-1,c=t?t.length:0;if("number"==typeof c&&c>-1&&c<=b)for(;++a<c;)o(t[a],a,t);else forOwn(t,o)}(t,(function(c,h){a=o(a,c,h,t)})),a}function trim(t){return String(t).replace(/^ +| +$/g,"")}var _=function parse(t){var o=c,a=t&&"object"==typeof t&&"String"!=getClassOf(t);a&&(o=t,t=null);var h=o.navigator||{},m=h.userAgent||"";t||(t=m);var v,b,w=a?!!h.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(k.toString()),S="Object",_=a?S:"ScriptBridgingProxyObject",T=a?S:"Environment",C=a&&o.java?"JavaPackage":getClassOf(o.java),M=a?S:"RuntimeObject",E=/\bJava/.test(C)&&o.java,O=E&&getClassOf(o.environment)==T,P=E?"a":"α",I=E?"b":"β",A=o.document||{},j=o.operamini||o.opera,R=x.test(R=a&&j?j["[[Class]]"]:getClassOf(j))?R:j=null,L=t,N=[],U=null,D=t==m,B=D&&j&&"function"==typeof j.version&&j.version(),q=function getLayout(o){return reduce(o,(function(o,a){return o||RegExp("\\b"+(a.pattern||qualify(a))+"\\b","i").exec(t)&&(a.label||a)}))}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),z=function getName(o){return reduce(o,(function(o,a){return o||RegExp("\\b"+(a.pattern||qualify(a))+"\\b","i").exec(t)&&(a.label||a)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),K=getProduct([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),H=function getManufacturer(o){return reduce(o,(function(o,a,c){return o||(a[K]||a[/^[a-z]+(?: +[a-z]+\b)*/i.exec(K)]||RegExp("\\b"+qualify(c)+"(?:\\b|\\w*\\d)","i").exec(t))&&c}))}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),G=function getOS(o){return reduce(o,(function(o,a){var c=a.pattern||qualify(a);return!o&&(o=RegExp("\\b"+c+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(o=function cleanupOS(t,o,a){var c={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return o&&a&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(c=c[/[\d.]+$/.exec(t)])&&(t="Windows "+c),t=String(t),o&&a&&(t=t.replace(RegExp(o,"i"),a)),format(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(o,c,a.label||a)),o}))}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function getProduct(o){return reduce(o,(function(o,a){var c=a.pattern||qualify(a);return!o&&(o=RegExp("\\b"+c+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+c+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+c+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((o=String(a.label&&!RegExp(c,"i").test(a.label)?a.label:o).split("/"))[1]&&!/[\d.]+/.test(o[0])&&(o[0]+=" "+o[1]),a=a.label||a,o=format(o[0].replace(RegExp(c,"i"),a).replace(RegExp("; *(?:"+a+"[_-])?","i")," ").replace(RegExp("("+a+")[-_.]?(\\w)","i"),"$1 $2"))),o}))}function getVersion(o){return reduce(o,(function(o,a){return o||(RegExp(a+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}if(q&&(q=[q]),/\bAndroid\b/.test(G)&&!K&&(v=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(K=trim(v[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),H&&!K?K=getProduct([H]):H&&K&&(K=K.replace(RegExp("^("+qualify(H)+")[-_.\\s]","i"),H+" ").replace(RegExp("^("+qualify(H)+")[-_.]?(\\w)","i"),H+" $2")),(v=/\bGoogle TV\b/.exec(K))&&(K=v[0]),/\bSimulator\b/i.test(t)&&(K=(K?K+" ":"")+"Simulator"),"Opera Mini"==z&&/\bOPiOS\b/.test(t)&&N.push("running in Turbo/Uncompressed mode"),"IE"==z&&/\blike iPhone OS\b/.test(t)?(H=(v=parse(t.replace(/like iPhone OS/,""))).manufacturer,K=v.product):/^iP/.test(K)?(z||(z="Safari"),G="iOS"+((v=/ OS ([\d_]+)/i.exec(t))?" "+v[1].replace(/_/g,"."):"")):"Konqueror"==z&&/^Linux\b/i.test(G)?G="Kubuntu":H&&"Google"!=H&&(/Chrome/.test(z)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(K))||/\bAndroid\b/.test(G)&&/^Chrome/.test(z)&&/\bVersion\//i.test(t)?(z="Android Browser",G=/\bAndroid\b/.test(G)?G:"Android"):"Silk"==z?(/\bMobi/i.test(t)||(G="Android",N.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&N.unshift("accelerated")):"UC Browser"==z&&/\bUCWEB\b/.test(t)?N.push("speed mode"):"PaleMoon"==z&&(v=/\bFirefox\/([\d.]+)\b/.exec(t))?N.push("identifying as Firefox "+v[1]):"Firefox"==z&&(v=/\b(Mobile|Tablet|TV)\b/i.exec(t))?(G||(G="Firefox OS"),K||(K=v[1])):!z||(v=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(z))?(z&&!K&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(v+"/")+8))&&(z=null),(v=K||H||G)&&(K||H||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(G))&&(z=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(G)?G:v)+" Browser")):"Electron"==z&&(v=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&N.push("Chromium "+v),B||(B=getVersion(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",qualify(z),"(?:Firefox|Minefield|NetFront)"])),(v=("iCab"==q&&parseFloat(B)>3?"WebKit":/\bOpera\b/.test(z)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(q)&&"WebKit"||!q&&/\bMSIE\b/i.test(t)&&("Mac OS"==G?"Tasman":"Trident")||"WebKit"==q&&/\bPlayStation\b(?! Vita\b)/i.test(z)&&"NetFront")&&(q=[v]),"IE"==z&&(v=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(z+=" Mobile",G="Windows Phone "+(/\+$/.test(v)?v:v+".x"),N.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(z="IE Mobile",G="Windows Phone 8.x",N.unshift("desktop mode"),B||(B=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=z&&"Trident"==q&&(v=/\brv:([\d.]+)/.exec(t))&&(z&&N.push("identifying as "+z+(B?" "+B:"")),z="IE",B=v[1]),D){if(function isHostType(t,o){var a=null!=t?typeof t[o]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(a)||"object"==a&&!t[o])}(o,"global"))if(E&&(L=(v=E.lang.System).getProperty("os.arch"),G=G||v.getProperty("os.name")+" "+v.getProperty("os.version")),O){try{B=o.require("ringo/engine").version.join("."),z="RingoJS"}catch(t){(v=o.system)&&v.global.system==o.system&&(z="Narwhal",G||(G=v[0].os||null))}z||(z="Rhino")}else"object"==typeof o.process&&!o.process.browser&&(v=o.process)&&("object"==typeof v.versions&&("string"==typeof v.versions.electron?(N.push("Node "+v.versions.node),z="Electron",B=v.versions.electron):"string"==typeof v.versions.nw&&(N.push("Chromium "+B,"Node "+v.versions.node),z="NW.js",B=v.versions.nw)),z||(z="Node.js",L=v.arch,G=v.platform,B=(B=/[\d.]+/.exec(v.version))?B[0]:null));else getClassOf(v=o.runtime)==_?(z="Adobe AIR",G=v.flash.system.Capabilities.os):getClassOf(v=o.phantom)==M?(z="PhantomJS",B=(v=v.version||null)&&v.major+"."+v.minor+"."+v.patch):"number"==typeof A.documentMode&&(v=/\bTrident\/(\d+)/i.exec(t))?(B=[B,A.documentMode],(v=+v[1]+4)!=B[1]&&(N.push("IE "+B[1]+" mode"),q&&(q[1]=""),B[1]=v),B="IE"==z?String(B[1].toFixed(1)):B[0]):"number"==typeof A.documentMode&&/^(?:Chrome|Firefox)\b/.test(z)&&(N.push("masking as "+z+" "+B),z="IE",B="11.0",q=["Trident"],G="Windows");G=G&&format(G)}if(B&&(v=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(B)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(D&&h.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(U=/b/i.test(v)?"beta":"alpha",B=B.replace(RegExp(v+"\\+?$"),"")+("beta"==U?I:P)+(/\d+\+?/.exec(v)||"")),"Fennec"==z||"Firefox"==z&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(G))z="Firefox Mobile";else if("Maxthon"==z&&B)B=B.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(K))"Xbox 360"==K&&(G=null),"Xbox 360"==K&&/\bIEMobile\b/.test(t)&&N.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(z)&&(!z||K||/Browser|Mobi/.test(z))||"Windows CE"!=G&&!/Mobi/i.test(t))if("IE"==z&&D)try{null===o.external&&N.unshift("platform preview")}catch(t){N.unshift("embedded")}else(/\bBlackBerry\b/.test(K)||/\bBB10\b/.test(t))&&(v=(RegExp(K.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||B)?(G=((v=[v,/BB10/.test(t)])[1]?(K=null,H="BlackBerry"):"Device Software")+" "+v[0],B=null):this!=forOwn&&"Wii"!=K&&(D&&j||/Opera/.test(z)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==z&&/\bOS X (?:\d+\.){2,}/.test(G)||"IE"==z&&(G&&!/^Win/.test(G)&&B>5.5||/\bWindows XP\b/.test(G)&&B>8||8==B&&!/\bTrident\b/.test(t)))&&!x.test(v=parse.call(forOwn,t.replace(x,"")+";"))&&v.name&&(v="ing as "+v.name+((v=v.version)?" "+v:""),x.test(z)?(/\bIE\b/.test(v)&&"Mac OS"==G&&(G=null),v="identify"+v):(v="mask"+v,z=R?format(R.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(v)&&(G=null),D||(B=null)),q=["Presto"],N.push(v));else z+=" Mobile";(v=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(v=[parseFloat(v.replace(/\.(\d)$/,".0$1")),v],"Safari"==z&&"+"==v[1].slice(-1)?(z="WebKit Nightly",U="alpha",B=v[1].slice(0,-1)):B!=v[1]&&B!=(v[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(B=null),v[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==v[0]&&537.36==v[2]&&parseFloat(v[1])>=28&&"WebKit"==q&&(q=["Blink"]),D&&(w||v[1])?(q&&(q[1]="like Chrome"),v=v[1]||((v=v[0])<530?1:v<532?2:v<532.05?3:v<533?4:v<534.03?5:v<534.07?6:v<534.1?7:v<534.13?8:v<534.16?9:v<534.24?10:v<534.3?11:v<535.01?12:v<535.02?"13+":v<535.07?15:v<535.11?16:v<535.19?17:v<536.05?18:v<536.1?19:v<537.01?20:v<537.11?"21+":v<537.13?23:v<537.18?24:v<537.24?25:v<537.36?26:"Blink"!=q?"27":"28")):(q&&(q[1]="like Safari"),v=(v=v[0])<400?1:v<500?2:v<526?3:v<533?4:v<534?"4+":v<535?5:v<537?6:v<538?7:v<601?8:v<602?9:v<604?10:v<606?11:v<608?12:"12"),q&&(q[1]+=" "+(v+="number"==typeof v?".x":/[.+]/.test(v)?"":"+")),"Safari"==z&&(!B||parseInt(B)>45)?B=v:"Chrome"==z&&/\bHeadlessChrome/i.test(t)&&N.unshift("headless")),"Opera"==z&&(v=/\bzbov|zvav$/.exec(G))?(z+=" ",N.unshift("desktop mode"),"zvav"==v?(z+="Mini",B=null):z+="Mobile",G=G.replace(RegExp(" *"+v+"$"),"")):"Safari"==z&&/\bChrome\b/.exec(q&&q[1])?(N.unshift("desktop mode"),z="Chrome Mobile",B=null,/\bOS X\b/.test(G)?(H="Apple",G="iOS 4.3+"):G=null):/\bSRWare Iron\b/.test(z)&&!B&&(B=getVersion("Chrome")),B&&0==B.indexOf(v=/[\d.]+$/.exec(G))&&t.indexOf("/"+v+"-")>-1&&(G=trim(G.replace(v,""))),G&&-1!=G.indexOf(z)&&!RegExp(z+" OS").test(G)&&(G=G.replace(RegExp(" *"+qualify(z)+" *"),"")),q&&!/\b(?:Avant|Nook)\b/.test(z)&&(/Browser|Lunascape|Maxthon/.test(z)||"Safari"!=z&&/^iOS/.test(G)&&/\bSafari\b/.test(q[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(z)&&q[1])&&(v=q[q.length-1])&&N.push(v),N.length&&(N=["("+N.join("; ")+")"]),H&&K&&K.indexOf(H)<0&&N.push("on "+H),K&&N.push((/^on /.test(N[N.length-1])?"":"on ")+K),G&&(v=/ ([\d.+]+)$/.exec(G),b=v&&"/"==G.charAt(G.length-v[0].length-1),G={architecture:32,family:v&&!b?G.replace(v[0],""):G,version:v?v[1]:null,toString:function(){var t=this.version;return this.family+(t&&!b?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(v=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(L))&&!/\bi686\b/i.test(L)?(G&&(G.architecture=64,G.family=G.family.replace(RegExp(" *"+v),"")),z&&(/\bWOW64\b/i.test(t)||D&&/\w(?:86|32)$/.test(h.cpuClass||h.platform)&&!/\bWin64; x64\b/i.test(t))&&N.unshift("32-bit")):G&&/^OS X/.test(G.family)&&"Chrome"==z&&parseFloat(B)>=39&&(G.architecture=64),t||(t=null);var $={};return $.description=t,$.layout=q&&q[0],$.manufacturer=H,$.name=z,$.prerelease=U,$.product=K,$.ua=t,$.version=z&&B,$.os=G||{architecture:null,family:null,version:null,toString:function(){return"null"}},$.parse=parse,$.toString=function toStringPlatform(){return this.description||""},$.version&&N.unshift(B),$.name&&N.unshift(z),G&&z&&(G!=String(G).split(" ")[0]||G!=z.split(" ")[0]&&!K)&&N.push(K?"("+G+")":"on "+G),N.length&&($.description=N.join(" ")),$}();h&&m?forOwn(_,(function(t,o){h[o]=t})):c.platform=_}).call(t)})),nh=createCommonjsModule((function(t,o){self,t.exports=function(){var t={d:function(o,a){for(var c in a)t.o(a,c)&&!t.o(o,c)&&Object.defineProperty(o,c,{enumerable:!0,get:a[c]})},o:function(t,o){return Object.prototype.hasOwnProperty.call(t,o)}},o={};t.d(o,{default:function(){return k}});var a=function e(t){for(var o in function(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e),this.directUploadAddr="https://wanproxy-web.127.net",this.retryCount=2,this.trunkSize=4194304,this.trunkUploadTimeout=5e4,this.getOffsetTimeout=1e4,this.version="1.0",this.onError=function(t){},this.onProgress=function(t){},this.onComplete=function(t){},t)this[o]=t[o]};function n(t,o){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function(t,o){if(t){if("string"==typeof t)return r(t,o);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?r(t,o):void 0}}(t))||o&&t&&"number"==typeof t.length){a&&(t=a);var c=0,i=function(){};return{s:i,n:function(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h,m=!0,v=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return m=t.done,t},e:function(t){v=!0,h=t},f:function(){try{m||null==a.return||a.return()}finally{if(v)throw h}}}}function r(t,o){(null==o||o>t.length)&&(o=t.length);for(var a=0,c=new Array(o);a<o;a++)c[a]=t[a];return c}var c=window.localStorage;window.localStorage&&"function"==typeof window.localStorage.getItem&&"function"==typeof window.localStorage.setItem&&"function"==typeof window.localStorage.removeItem||(c={privateObj:{},setItem:function(t,o){c.privateObj[t]=o},getItem:function(t){return c.privateObj[t]},removeItem:function(t){delete c.privateObj[t]},getKeys:function(){return Object.keys(c.privateObj)}});var h={getFileKey:function(t){var o=t.size.toString(),a=t.lastModified.toString();return t.name+o.slice(o.length-5)+a.slice(a.length-5)},getFileInfo:function(t){var o=c.getItem(t);if(!o)return null;try{return JSON.parse(o)}catch(t){return null}},initFile:function(t,o){h.clearExpiredInfo();var a=this.getFileKey(o),m={ctx:void 0!==t.ctx?t.ctx:"",bucket:t.bucketName,obj:t.objectName,token:t.token,modifyAt:Date.now(),end:!1};return t.payload&&(m.payload=t.payload),c.setItem(a,JSON.stringify(m)),a},setUploadContext:function(t,o){var a=this.getFileInfo(t);a&&(a.ctx=o,c.setItem(t,JSON.stringify(a)))},setComplete:function(t){var o=this.getFileInfo(t);o&&(o.modifyAt=Date.now(),o.end=!0,c.setItem(t,JSON.stringify(o)))},getUploadContext:function(t){var o=this.getFileInfo(t);return o?o.ctx:""},removeFileInfo:function(t){c.removeItem(t)},clearExpiredInfo:function(){var t,o="function"==typeof c.getKeys?c.getKeys():Object.keys(c),a=Date.now(),m=[],v=n(o);try{for(v.s();!(t=v.n()).done;){var b=t.value,x=h.getFileInfo(b);null===x||a-x.modifyAt>k.expireTime?c.removeItem(b):m.push({fileInfo:x,key:b})}}catch(t){v.e(t)}finally{v.f()}if(m.length>k.maxFileCache){var w,S=n(m.sort((function(t,o){return o.fileInfo.modifyAt-t.fileInfo.modifyAt})).slice(k.maxFileCache));try{for(S.s();!(w=S.n()).done;){var _=w.value;c.removeItem(_.key)}}catch(t){S.e(t)}finally{S.f()}}}},m=h;function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,o){return!o||"object"!==u(o)&&"function"!=typeof o?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):o}function l(t){var o="function"==typeof Map?new Map:void 0;return(l=function(t){if(null===t||(a=t,-1===Function.toString.call(a).indexOf("[native code]")))return t;var a;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(t))return o.get(t);o.set(t,n)}function n(){return s(t,arguments,y(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)})(t)}function s(t,o,a){return(s=p()?Reflect.construct:function(t,o,a){var c=[null];c.push.apply(c,o);var h=new(Function.bind.apply(t,c));return a&&d(h,a.prototype),h}).apply(null,arguments)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,o){return(d=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,o)}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var v=function(t){!function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o&&d(t,o)}(r,t);var o,a,c=(o=r,a=p(),function(){var t,c=y(o);if(a){var h=y(this).constructor;t=Reflect.construct(c,arguments,h)}else t=c.apply(this,arguments);return f(this,t)});function r(t,o){var a;return function(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}(this,r),(a=c.call(this,"NosUploadError:"+t)).errCode=o,a.errMsg=t,a}return r}(l(Error)),b=function e(t,o,a){if("uploading"===t.uploadState){var c=t.config,h=t.param,b=m.getUploadContext(t.fileKey);if(!b)return a(0);var x=new XMLHttpRequest,w=c.directUploadAddr+"/".concat(h.bucketName)+"/".concat(encodeURIComponent(h.objectName))+"?uploadContext"+"&context=".concat(b)+"&version=".concat(c.version);x.onreadystatechange=function(){if("abort"!==t.uploadState&&4===x.readyState){var h;try{h=JSON.parse(x.responseText)}catch(t){h={errMsg:"JsonParseError in getOffset",errCode:500}}200===x.status?h.errCode?t.config.onError(new v(h.errMsg,h.errCode)):a(h.offset):x.status.toString().match(/^5/)?e(t,o-1,a):(m.removeFileInfo(t.fileKey),x.status?c.onError(new v("getOffset(".concat(w,") error: ").concat(x.status," ").concat(x.statusText))):c.onError(new v("getOffset(".concat(w,") error. no Error Code"))))}},x.open("get",w),x.setRequestHeader("x-nos-token",h.token),x.timeout=c.getOffsetTimeout,x.send()}},x=function e(t,o,a,c){if("uploading"===t.uploadState){var h=t.param,b=t.config,x=File.prototype.slice,w=void 0!==h.ctx?h.ctx:"",S=o+b.trunkSize>t.file.size,k=S?t.file.size:o+b.trunkSize,_=new XMLHttpRequest,T=b.directUploadAddr+"/".concat(h.bucketName)+"/".concat(encodeURIComponent(h.objectName));if(_.upload.onprogress=function(a){var c=0;a.lengthComputable?(c=(o+a.loaded)/t.file.size,b.onProgress(c)):b.onError(new v("browser does not support query upload progress"))},_.onreadystatechange=function(){if("abort"!==t.uploadState&&4===_.readyState){var h;try{h=JSON.parse(_.responseText)}catch(t){console.error("JsonParseError in uploadTrunk",t),h={errMsg:"JsonParseError in uploadTrunk"}}200===_.status?(t.setContext(h.context),S?(c(),t.setComplete()):e(t,h.offset,b.retryCount,c)):_.status.toString().match(/^5/)?a>0?e(t,o,a-1,c):(m.removeFileInfo(t.fileKey),b.onError(new v(h.errMsg,h.errCode))):_.status?(m.removeFileInfo(t.fileKey),b.onError(new v("uploadTrunk(".concat(T,") error: ").concat(_.status," ").concat(_.statusText)))):(console.log("upload is paused",_),b.onError(new v("uploadTrunk(".concat(T,") error. no Error Code"))))}},_.open("post",T+"?offset=".concat(o)+"&complete=".concat(S)+"&context=".concat(w)+"&version=".concat(b.version)),_.setRequestHeader("x-nos-token",h.token),t.file.type&&_.setRequestHeader("content-type",t.file.type),_.timeout=b.trunkUploadTimeout,"undefined"!=typeof FileReader){var C=new FileReader;C.addEventListener("load",(function(t){var o;(null===(o=null==t?void 0:t.target)||void 0===o?void 0:o.result)?_.send(t.target.result):b.onError(new v("Read ArrayBuffer failed"))})),C.addEventListener("error",(function(t){var o=t.target.error;b.onError(new v("Read ArrayBuffer error. ".concat(o.toString()),o.code))})),C.readAsArrayBuffer(x.call(t.file,o,k))}else _.send(x.call(t.file,o,k))}};function g(t,o){for(var a=0;a<o.length;a++){var c=o[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}var w=function(){function e(t,o,a){!function(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e),this.uploadState="paused",this.config=a,this.file=t,this.param=o,this.fileKey=m.initFile(o,t),this.resume()}var t;return(t=[{key:"resume",value:function(){var t=this;if("uploading"!==this.uploadState){this.setUploadState("uploading");var o=this.config;b(this,o.retryCount,(function(a){x(t,a,o.retryCount,(function(){t.setUploadState("ended"),"function"==typeof o.onComplete&&o.onComplete(t.param)}))}))}}},{key:"pause",value:function(){this.setUploadState("paused")}},{key:"abort",value:function(){this.setUploadState("abort"),m.removeFileInfo(this.fileKey)}},{key:"setUploadState",value:function(t){t!==this.uploadState&&(this.uploadState=t)}},{key:"setContext",value:function(t){m.setUploadContext(this.fileKey,t),this.param.ctx=t}},{key:"setComplete",value:function(){m.setComplete(this.fileKey),this.setUploadState("ended")}}])&&g(e.prototype,t),e}(),S={maxFileCache:6,expireTime:864e5,getFileUploadInformation:function(t){var o=m.getFileKey(t),a=m.getFileInfo(o);return null===a?null:Date.now()-a.modifyAt>S.expireTime?(m.removeFileInfo(o),null):{uploadInfo:Object.assign({bucketName:a.bucket,objectName:a.obj,token:a.token,ctx:a.ctx},a.payload?{payload:a.payload}:{}),complete:a.end}},setMaxFileCache:function(t){S.maxFileCache=t},setExpireTime:function(t){S.expireTime=t},printCaches:function(){for(var t=0,o=Object.keys(localStorage);t<o.length;t++){var a=o[t],c=m.getFileInfo(a);c&&console.log(c,"modifiedAt",new Date(c.modifyAt).toTimeString())}},createConfig:function(t){return new a(t)},createTask:function(t,o,a){return new w(t,o,a)}},k=S;return o.default}()})),oh=createCommonjsModule((function(t,o){t.exports=function(){const t=5e3;function object2String(t){if(t){let o="";return Object.entries(t).forEach((([t,a],c)=>{o+=0===c?"?":"&",o+=`${t}=${a}`})),o}return""}function timeoutPromise(o,a){return new Promise(((c,h)=>{setTimeout((()=>{h({message:"request timeout",params:a})}),o||t)}))}function request(o,a={dataType:"json",method:"GET",timeout:t}){const c="text"===a.dataType?"text/plain; charset=UTF-8":"application/json; charset=UTF-8";let h="GET"===a.method?object2String(a.params):"";return Promise.race([timeoutPromise(a.timeout,{url:o,params:a}),new Promise((function(t,m){if(window.fetch&&"function"==typeof window.fetch)try{let v={method:a.method,headers:Object.assign({"Content-Type":c},a.headers)};"POST"===a.method&&(v.body=JSON.stringify(a.params)),fetch(`${o}${h}`,v).then((o=>{"text"!==a.dataType?o.json().then((a=>{o.data=a,t(o)}),m):o.text().then((a=>{o.data=a,t(o)}),m)}),m)}catch(t){m(t)}else if(window.XMLHttpRequest){const v=new XMLHttpRequest;let b;if(v.onreadystatechange=function(){if(4===v.readyState)if(200===v.status){try{b=JSON.parse(v.response||"{}")}catch(t){b=v.response}t({status:v.status,data:b})}else m(v.status)},v.open(a.method,`${o}${h}`),v.setRequestHeader("Content-Type",c),a.headers)for(let t in a.headers)v.setRequestHeader(t,a.headers[t]);v.send(JSON.stringify(a.params))}else m("request no suppout")}))])}return request}()})),ih=console;var ah={setLogger:function setLogger(t){ih=t},platform:"BROWSER",localStorage:window.localStorage,request:oh,WebSocket:window.WebSocket,uploadFile:function uploadFile(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee(){var o,a,c,h,m,v;return wa.wrap((function _callee$(b){for(;;)switch(b.prev=b.next){case 0:if(t.fileInput||t.file){b.next=2;break}throw new Error("File not exist");case 2:if(!t.file){b.next=6;break}h=t.file,b.next=20;break;case 6:if("string"!=typeof t.fileInput){b.next=15;break}if(!((m=document.getElementById(t.fileInput))&&m.files&&m.files[0])){b.next=12;break}h=m.files[0],b.next=13;break;case 12:throw new Error("Can not get file from fileInput");case 13:b.next=20;break;case 15:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){b.next=19;break}h=t.fileInput.files[0],b.next=20;break;case 19:throw new Error("Can not get file from fileInput "+t.fileInput);case 20:if(!(t.maxSize&&h.size>t.maxSize)){b.next=22;break}throw new Error("The file exceeds maxSize limit. maxSize: "+t.maxSize+", get "+h.size);case 22:return b.next=24,new ca((function(o,a){var c=nh.createConfig({directUploadAddr:t.chunkUploadHost,onError:function onError(t){a(t)},onProgress:t.onUploadProgress||function(){},onComplete:function onComplete(t){o(t)}}),m=nh.createTask(h,{bucketName:t.nosToken.bucket,objectName:decodeURIComponent(t.nosToken.objectName),token:t.nosToken.token},c);try{t.onUploadStart&&t.onUploadStart(m)}catch(t){ih.error("Adapter uploadFile: options.onUploadStart error",t&&t.message),m.abort(),a(t)}}));case 24:return(v=b.sent).name=h.name,v.size=h.size,v.type=h.type,v.ext=lastIndexOf(o=v.name).call(o,".")>-1?slice(a=v.name).call(a,lastIndexOf(c=v.name).call(c,".")+1).toLowerCase():"",b.abrupt("return",v);case 30:case"end":return b.stop()}}),_callee)})))},getSystemInfo:function getSystemInfo(){var t,o;return{os:(null===(t=rh.os)||void 0===t?void 0:t.family)||"",osVer:(null===(o=rh.os)||void 0===o?void 0:o.version)||"",browser:rh.name||"",browserVer:rh.version||"",hostEnv:"BROWSER",hostEnvVer:rh.version||"",hostInfo:rh.ua||""}}};return Vd.setAdapters(ah),Vd}));
|
|
13
|
+
!function(t,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):(t="undefined"!=typeof globalThis?globalThis:t||self).Chatroom=o()}(this,(function(){"use strict";var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t){var o={exports:{}};return t(o,o.exports),o.exports}var o,a,c=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports}))),check=function(t){return t&&t.Math==Math&&t},h=check("object"==typeof globalThis&&globalThis)||check("object"==typeof window&&window)||check("object"==typeof self&&self)||check("object"==typeof t&&t)||function(){return this}()||Function("return this")(),fails=function(t){try{return!!t()}catch(t){return!0}},m=!fails((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),v=Function.prototype,b=v.apply,x=v.call,w="object"==typeof Reflect&&Reflect.apply||(m?x.bind(b):function(){return x.apply(b,arguments)}),S=Function.prototype,k=S.bind,_=S.call,T=m&&k.bind(_,_),C=m?function(t){return t&&T(t)}:function(t){return t&&function(){return _.apply(t,arguments)}},isCallable=function(t){return"function"==typeof t},M=!fails((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),E=Function.prototype.call,O=m?E.bind(E):function(){return E.apply(E,arguments)},P={}.propertyIsEnumerable,I=Object.getOwnPropertyDescriptor,A={f:I&&!P.call({1:2},1)?function propertyIsEnumerable(t){var o=I(this,t);return!!o&&o.enumerable}:P},createPropertyDescriptor=function(t,o){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:o}},j=C({}.toString),R=C("".slice),classofRaw=function(t){return R(j(t),8,-1)},L=Object,N=C("".split),U=fails((function(){return!L("z").propertyIsEnumerable(0)}))?function(t){return"String"==classofRaw(t)?N(t,""):L(t)}:L,isNullOrUndefined=function(t){return null==t},D=TypeError,requireObjectCoercible=function(t){if(isNullOrUndefined(t))throw D("Can't call method on "+t);return t},toIndexedObject=function(t){return U(requireObjectCoercible(t))},B="object"==typeof document&&document.all,q=void 0===B&&void 0!==B?function(t){return"object"==typeof t?null!==t:isCallable(t)||t===B}:function(t){return"object"==typeof t?null!==t:isCallable(t)},z={},aFunction=function(t){return isCallable(t)?t:void 0},getBuiltIn=function(t,o){return arguments.length<2?aFunction(z[t])||aFunction(h[t]):z[t]&&z[t][o]||h[t]&&h[t][o]},K=C({}.isPrototypeOf),H=getBuiltIn("navigator","userAgent")||"",G=h.process,$=h.Deno,W=G&&G.versions||$&&$.version,V=W&&W.v8;V&&(a=(o=V.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!a&&H&&(!(o=H.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=H.match(/Chrome\/(\d+)/))&&(a=+o[1]);var Q,J=a,X=!!Object.getOwnPropertySymbols&&!fails((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&J&&J<41})),Y=X&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Z=Object,ee=Y?function(t){return"symbol"==typeof t}:function(t){var o=getBuiltIn("Symbol");return isCallable(o)&&K(o.prototype,Z(t))},te=String,tryToString=function(t){try{return te(t)}catch(t){return"Object"}},re=TypeError,aCallable=function(t){if(isCallable(t))return t;throw re(tryToString(t)+" is not a function")},getMethod=function(t,o){var a=t[o];return isNullOrUndefined(a)?void 0:aCallable(a)},ne=TypeError,oe=Object.defineProperty,ie="__core-js_shared__",ae=h[ie]||function(t,o){try{oe(h,t,{value:o,configurable:!0,writable:!0})}catch(a){h[t]=o}return o}(ie,{}),se=createCommonjsModule((function(t){(t.exports=function(t,o){return ae[t]||(ae[t]=void 0!==o?o:{})})("versions",[]).push({version:"3.25.0",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.25.0/LICENSE",source:"https://github.com/zloirock/core-js"})})),ce=Object,toObject=function(t){return ce(requireObjectCoercible(t))},ue=C({}.hasOwnProperty),le=Object.hasOwn||function hasOwn(t,o){return ue(toObject(t),o)},fe=0,pe=Math.random(),de=C(1..toString),uid=function(t){return"Symbol("+(void 0===t?"":t)+")_"+de(++fe+pe,36)},he=se("wks"),me=h.Symbol,ge=me&&me.for,ve=Y?me:me&&me.withoutSetter||uid,wellKnownSymbol=function(t){if(!le(he,t)||!X&&"string"!=typeof he[t]){var o="Symbol."+t;X&&le(me,t)?he[t]=me[t]:he[t]=Y&&ge?ge(o):ve(o)}return he[t]},ye=TypeError,be=wellKnownSymbol("toPrimitive"),toPrimitive=function(t,o){if(!q(t)||ee(t))return t;var a,c=getMethod(t,be);if(c){if(void 0===o&&(o="default"),a=O(c,t,o),!q(a)||ee(a))return a;throw ye("Can't convert object to primitive value")}return void 0===o&&(o="number"),function(t,o){var a,c;if("string"===o&&isCallable(a=t.toString)&&!q(c=O(a,t)))return c;if(isCallable(a=t.valueOf)&&!q(c=O(a,t)))return c;if("string"!==o&&isCallable(a=t.toString)&&!q(c=O(a,t)))return c;throw ne("Can't convert object to primitive value")}(t,o)},toPropertyKey=function(t){var o=toPrimitive(t,"string");return ee(o)?o:o+""},xe=h.document,we=q(xe)&&q(xe.createElement),documentCreateElement=function(t){return we?xe.createElement(t):{}},Se=!M&&!fails((function(){return 7!=Object.defineProperty(documentCreateElement("div"),"a",{get:function(){return 7}}).a})),ke=Object.getOwnPropertyDescriptor,_e={f:M?ke:function getOwnPropertyDescriptor(t,o){if(t=toIndexedObject(t),o=toPropertyKey(o),Se)try{return ke(t,o)}catch(t){}if(le(t,o))return createPropertyDescriptor(!O(A.f,t,o),t[o])}},Te=/#|\.prototype\./,isForced=function(t,o){var a=Me[Ce(t)];return a==Oe||a!=Ee&&(isCallable(o)?fails(o):!!o)},Ce=isForced.normalize=function(t){return String(t).replace(Te,".").toLowerCase()},Me=isForced.data={},Ee=isForced.NATIVE="N",Oe=isForced.POLYFILL="P",Pe=isForced,Ie=C(C.bind),functionBindContext=function(t,o){return aCallable(t),void 0===o?t:m?Ie(t,o):function(){return t.apply(o,arguments)}},Ae=M&&fails((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),je=String,Re=TypeError,anObject=function(t){if(q(t))return t;throw Re(je(t)+" is not an object")},Le=TypeError,Fe=Object.defineProperty,Ne=Object.getOwnPropertyDescriptor,Ue="enumerable",De="configurable",Be="writable",qe={f:M?Ae?function defineProperty(t,o,a){if(anObject(t),o=toPropertyKey(o),anObject(a),"function"==typeof t&&"prototype"===o&&"value"in a&&Be in a&&!a.writable){var c=Ne(t,o);c&&c.writable&&(t[o]=a.value,a={configurable:De in a?a.configurable:c.configurable,enumerable:Ue in a?a.enumerable:c.enumerable,writable:!1})}return Fe(t,o,a)}:Fe:function defineProperty(t,o,a){if(anObject(t),o=toPropertyKey(o),anObject(a),Se)try{return Fe(t,o,a)}catch(t){}if("get"in a||"set"in a)throw Le("Accessors not supported");return"value"in a&&(t[o]=a.value),t}},ze=M?function(t,o,a){return qe.f(t,o,createPropertyDescriptor(1,a))}:function(t,o,a){return t[o]=a,t},Ke=_e.f,wrapConstructor=function(t){var Wrapper=function(o,a,c){if(this instanceof Wrapper){switch(arguments.length){case 0:return new t;case 1:return new t(o);case 2:return new t(o,a)}return new t(o,a,c)}return w(t,this,arguments)};return Wrapper.prototype=t.prototype,Wrapper},_export=function(t,o){var a,c,m,v,b,x,w,S,k=t.target,_=t.global,T=t.stat,M=t.proto,E=_?h:T?h[k]:(h[k]||{}).prototype,O=_?z:z[k]||ze(z,k,{})[k],P=O.prototype;for(m in o)a=!Pe(_?m:k+(T?".":"#")+m,t.forced)&&E&&le(E,m),b=O[m],a&&(x=t.dontCallGetSet?(S=Ke(E,m))&&S.value:E[m]),v=a&&x?x:o[m],a&&typeof b==typeof v||(w=t.bind&&a?functionBindContext(v,h):t.wrap&&a?wrapConstructor(v):M&&isCallable(v)?C(v):v,(t.sham||v&&v.sham||b&&b.sham)&&ze(w,"sham",!0),ze(O,m,w),M&&(le(z,c=k+"Prototype")||ze(z,c,{}),ze(z[c],m,v),t.real&&P&&!P[m]&&ze(P,m,v)))},He=Math.ceil,Ge=Math.floor,$e=Math.trunc||function trunc(t){var o=+t;return(o>0?Ge:He)(o)},toIntegerOrInfinity=function(t){var o=+t;return o!=o||0===o?0:$e(o)},We=Math.max,Ve=Math.min,toAbsoluteIndex=function(t,o){var a=toIntegerOrInfinity(t);return a<0?We(a+o,0):Ve(a,o)},Qe=Math.min,lengthOfArrayLike=function(t){return(o=t.length)>0?Qe(toIntegerOrInfinity(o),9007199254740991):0;var o},createMethod$4=function(t){return function(o,a,c){var h,m=toIndexedObject(o),v=lengthOfArrayLike(m),b=toAbsoluteIndex(c,v);if(t&&a!=a){for(;v>b;)if((h=m[b++])!=h)return!0}else for(;v>b;b++)if((t||b in m)&&m[b]===a)return t||b||0;return!t&&-1}},Je={includes:createMethod$4(!0),indexOf:createMethod$4(!1)},Xe={},Ye=Je.indexOf,Ze=C([].push),objectKeysInternal=function(t,o){var a,c=toIndexedObject(t),h=0,m=[];for(a in c)!le(Xe,a)&&le(c,a)&&Ze(m,a);for(;o.length>h;)le(c,a=o[h++])&&(~Ye(m,a)||Ze(m,a));return m},et=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tt=Object.keys||function keys(t){return objectKeysInternal(t,et)},rt=M&&!Ae?Object.defineProperties:function defineProperties(t,o){anObject(t);for(var a,c=toIndexedObject(o),h=tt(o),m=h.length,v=0;m>v;)qe.f(t,a=h[v++],c[a]);return t},nt={f:rt},ot=getBuiltIn("document","documentElement"),it=se("keys"),sharedKey=function(t){return it[t]||(it[t]=uid(t))},at=sharedKey("IE_PROTO"),EmptyConstructor=function(){},scriptTag=function(t){return"<script>"+t+"</"+"script>"},NullProtoObjectViaActiveX=function(t){t.write(scriptTag("")),t.close();var o=t.parentWindow.Object;return t=null,o},NullProtoObject=function(){try{Q=new ActiveXObject("htmlfile")}catch(t){}var t,o;NullProtoObject="undefined"!=typeof document?document.domain&&Q?NullProtoObjectViaActiveX(Q):((o=documentCreateElement("iframe")).style.display="none",ot.appendChild(o),o.src=String("javascript:"),(t=o.contentWindow.document).open(),t.write(scriptTag("document.F=Object")),t.close(),t.F):NullProtoObjectViaActiveX(Q);for(var a=et.length;a--;)delete NullProtoObject.prototype[et[a]];return NullProtoObject()};Xe[at]=!0;var st=Object.create||function create(t,o){var a;return null!==t?(EmptyConstructor.prototype=anObject(t),a=new EmptyConstructor,EmptyConstructor.prototype=null,a[at]=t):a=NullProtoObject(),void 0===o?a:nt.f(a,o)};_export({target:"Object",stat:!0,sham:!M},{create:st});var ct=z.Object,ut=function create(t,o){return ct.create(t,o)},lt=String,ft=TypeError,pt=Object.setPrototypeOf||("__proto__"in{}?function(){var t,o=!1,a={};try{(t=C(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(a,[]),o=a instanceof Array}catch(t){}return function setPrototypeOf(a,c){return anObject(a),function(t){if("object"==typeof t||isCallable(t))return t;throw ft("Can't set "+lt(t)+" as a prototype")}(c),o?t(a,c):a.__proto__=c,a}}():void 0);_export({target:"Object",stat:!0},{setPrototypeOf:pt});var dt=z.Object.setPrototypeOf,ht=C([].slice),mt=Function,gt=C([].concat),vt=C([].join),yt={},construct$8=function(t,o,a){if(!le(yt,o)){for(var c=[],h=0;h<o;h++)c[h]="a["+h+"]";yt[o]=mt("C,a","return new C("+vt(c,",")+")")}return yt[o](t,a)},bt=m?mt.bind:function bind(t){var o=aCallable(this),a=o.prototype,c=ht(arguments,1),h=function bound(){var a=gt(c,ht(arguments));return this instanceof h?construct$8(o,a.length,a):o.apply(t,a)};return q(a)&&(h.prototype=a),h};_export({target:"Function",proto:!0,forced:Function.bind!==bt},{bind:bt});var entryVirtual=function(t){return z[t+"Prototype"]},xt=entryVirtual("Function").bind,wt=Function.prototype,bind$1=function(t){var o=t.bind;return t===wt||K(wt,t)&&o===wt.bind?xt:o},St=createCommonjsModule((function(t){function _setPrototypeOf(o,a){var c;return t.exports=_setPrototypeOf=dt?bind$1(c=dt).call(c):function _setPrototypeOf(t,o){return t.__proto__=o,t},t.exports.__esModule=!0,t.exports.default=t.exports,_setPrototypeOf(o,a)}t.exports=_setPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),kt=getDefaultExportFromCjs(createCommonjsModule((function(t){t.exports=function _inheritsLoose(t,o){t.prototype=ut(o.prototype),t.prototype.constructor=t,St(t,o)},t.exports.__esModule=!0,t.exports.default=t.exports}))),_t=Array.isArray||function isArray(t){return"Array"==classofRaw(t)},Tt=TypeError,doesNotExceedSafeInteger=function(t){if(t>9007199254740991)throw Tt("Maximum allowed index exceeded");return t},createProperty=function(t,o,a){var c=toPropertyKey(o);c in t?qe.f(t,c,createPropertyDescriptor(0,a)):t[c]=a},Ct={};Ct[wellKnownSymbol("toStringTag")]="z";var Mt="[object z]"===String(Ct),Et=wellKnownSymbol("toStringTag"),Ot=Object,Pt="Arguments"==classofRaw(function(){return arguments}()),It=Mt?classofRaw:function(t){var o,a,c;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(a=function(t,o){try{return t[o]}catch(t){}}(o=Ot(t),Et))?a:Pt?classofRaw(o):"Object"==(c=classofRaw(o))&&isCallable(o.callee)?"Arguments":c},At=C(Function.toString);isCallable(ae.inspectSource)||(ae.inspectSource=function(t){return At(t)});var jt=ae.inspectSource,noop$1=function(){},Rt=[],Lt=getBuiltIn("Reflect","construct"),Ft=/^\s*(?:class|function)\b/,Nt=C(Ft.exec),Ut=!Ft.exec(noop$1),Dt=function isConstructor(t){if(!isCallable(t))return!1;try{return Lt(noop$1,Rt,t),!0}catch(t){return!1}},Bt=function isConstructor(t){if(!isCallable(t))return!1;switch(It(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Ut||!!Nt(Ft,jt(t))}catch(t){return!0}};Bt.sham=!0;var qt=!Lt||fails((function(){var t;return Dt(Dt.call)||!Dt(Object)||!Dt((function(){t=!0}))||t}))?Bt:Dt,zt=wellKnownSymbol("species"),Kt=Array,arraySpeciesCreate=function(t,o){return new(function(t){var o;return _t(t)&&(o=t.constructor,(qt(o)&&(o===Kt||_t(o.prototype))||q(o)&&null===(o=o[zt]))&&(o=void 0)),void 0===o?Kt:o}(t))(0===o?0:o)},Ht=wellKnownSymbol("species"),arrayMethodHasSpeciesSupport=function(t){return J>=51||!fails((function(){var o=[];return(o.constructor={})[Ht]=function(){return{foo:1}},1!==o[t](Boolean).foo}))},Gt=wellKnownSymbol("isConcatSpreadable"),$t=J>=51||!fails((function(){var t=[];return t[Gt]=!1,t.concat()[0]!==t})),Wt=arrayMethodHasSpeciesSupport("concat"),isConcatSpreadable=function(t){if(!q(t))return!1;var o=t[Gt];return void 0!==o?!!o:_t(t)};_export({target:"Array",proto:!0,arity:1,forced:!$t||!Wt},{concat:function concat(t){var o,a,c,h,m,v=toObject(this),b=arraySpeciesCreate(v,0),x=0;for(o=-1,c=arguments.length;o<c;o++)if(isConcatSpreadable(m=-1===o?v:arguments[o]))for(h=lengthOfArrayLike(m),doesNotExceedSafeInteger(x+h),a=0;a<h;a++,x++)a in m&&createProperty(b,x,m[a]);else doesNotExceedSafeInteger(x+1),createProperty(b,x++,m);return b.length=x,b}});var Vt,Qt,Jt,Xt=String,toString$1=function(t){if("Symbol"===It(t))throw TypeError("Cannot convert a Symbol value to a string");return Xt(t)},Yt=et.concat("length","prototype"),Zt={f:Object.getOwnPropertyNames||function getOwnPropertyNames(t){return objectKeysInternal(t,Yt)}},er=Array,tr=Math.max,rr=Zt.f,nr="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(t){try{return rr(t)}catch(t){return function(t,o,a){for(var c=lengthOfArrayLike(t),h=toAbsoluteIndex(o,c),m=toAbsoluteIndex(void 0===a?c:a,c),v=er(tr(m-h,0)),b=0;h<m;h++,b++)createProperty(v,b,t[h]);return v.length=b,v}(nr)}},or={f:function getOwnPropertyNames(t){return nr&&"Window"==classofRaw(t)?getWindowNames(t):rr(toIndexedObject(t))}},ir={f:Object.getOwnPropertySymbols},defineBuiltIn=function(t,o,a,c){return c&&c.enumerable?t[o]=a:ze(t,o,a),t},ar={f:wellKnownSymbol},sr=qe.f,wellKnownSymbolDefine=function(t){var o=z.Symbol||(z.Symbol={});le(o,t)||sr(o,t,{value:ar.f(t)})},symbolDefineToPrimitive=function(){var t=getBuiltIn("Symbol"),o=t&&t.prototype,a=o&&o.valueOf,c=wellKnownSymbol("toPrimitive");o&&!o[c]&&defineBuiltIn(o,c,(function(t){return O(a,this)}),{arity:1})},cr=Mt?{}.toString:function toString(){return"[object "+It(this)+"]"},ur=qe.f,lr=wellKnownSymbol("toStringTag"),setToStringTag=function(t,o,a,c){if(t){var h=a?t:t.prototype;le(h,lr)||ur(h,lr,{configurable:!0,value:o}),c&&!Mt&&ze(h,"toString",cr)}},fr=h.WeakMap,pr=isCallable(fr)&&/native code/.test(String(fr)),dr="Object already initialized",hr=h.TypeError,mr=h.WeakMap;if(pr||ae.state){var gr=ae.state||(ae.state=new mr),vr=C(gr.get),yr=C(gr.has),br=C(gr.set);Vt=function(t,o){if(yr(gr,t))throw hr(dr);return o.facade=t,br(gr,t,o),o},Qt=function(t){return vr(gr,t)||{}},Jt=function(t){return yr(gr,t)}}else{var xr=sharedKey("state");Xe[xr]=!0,Vt=function(t,o){if(le(t,xr))throw hr(dr);return o.facade=t,ze(t,xr,o),o},Qt=function(t){return le(t,xr)?t[xr]:{}},Jt=function(t){return le(t,xr)}}var wr={set:Vt,get:Qt,has:Jt,enforce:function(t){return Jt(t)?Qt(t):Vt(t,{})},getterFor:function(t){return function(o){var a;if(!q(o)||(a=Qt(o)).type!==t)throw hr("Incompatible receiver, "+t+" required");return a}}},Sr=C([].push),createMethod$3=function(t){var o=1==t,a=2==t,c=3==t,h=4==t,m=6==t,v=7==t,b=5==t||m;return function(x,w,S,k){for(var _,T,C=toObject(x),M=U(C),E=functionBindContext(w,S),O=lengthOfArrayLike(M),P=0,I=k||arraySpeciesCreate,A=o?I(x,O):a||v?I(x,0):void 0;O>P;P++)if((b||P in M)&&(T=E(_=M[P],P,C),t))if(o)A[P]=T;else if(T)switch(t){case 3:return!0;case 5:return _;case 6:return P;case 2:Sr(A,_)}else switch(t){case 4:return!1;case 7:Sr(A,_)}return m?-1:c||h?h:A}},kr={forEach:createMethod$3(0),map:createMethod$3(1),filter:createMethod$3(2),some:createMethod$3(3),every:createMethod$3(4),find:createMethod$3(5),findIndex:createMethod$3(6),filterReject:createMethod$3(7)},_r=kr.forEach,Tr=sharedKey("hidden"),Cr="Symbol",Mr=wr.set,Er=wr.getterFor(Cr),Or=Object.prototype,Pr=h.Symbol,Ir=Pr&&Pr.prototype,Ar=h.TypeError,jr=h.QObject,Rr=_e.f,Lr=qe.f,Fr=or.f,Nr=A.f,Ur=C([].push),Dr=se("symbols"),Br=se("op-symbols"),qr=se("wks"),zr=!jr||!jr.prototype||!jr.prototype.findChild,Kr=M&&fails((function(){return 7!=st(Lr({},"a",{get:function(){return Lr(this,"a",{value:7}).a}})).a}))?function(t,o,a){var c=Rr(Or,o);c&&delete Or[o],Lr(t,o,a),c&&t!==Or&&Lr(Or,o,c)}:Lr,wrap$1=function(t,o){var a=Dr[t]=st(Ir);return Mr(a,{type:Cr,tag:t,description:o}),M||(a.description=o),a},Hr=function defineProperty(t,o,a){t===Or&&Hr(Br,o,a),anObject(t);var c=toPropertyKey(o);return anObject(a),le(Dr,c)?(a.enumerable?(le(t,Tr)&&t[Tr][c]&&(t[Tr][c]=!1),a=st(a,{enumerable:createPropertyDescriptor(0,!1)})):(le(t,Tr)||Lr(t,Tr,createPropertyDescriptor(1,{})),t[Tr][c]=!0),Kr(t,c,a)):Lr(t,c,a)},Gr=function defineProperties(t,o){anObject(t);var a=toIndexedObject(o),c=tt(a).concat($getOwnPropertySymbols(a));return _r(c,(function(o){M&&!O($r,a,o)||Hr(t,o,a[o])})),t},$r=function propertyIsEnumerable(t){var o=toPropertyKey(t),a=O(Nr,this,o);return!(this===Or&&le(Dr,o)&&!le(Br,o))&&(!(a||!le(this,o)||!le(Dr,o)||le(this,Tr)&&this[Tr][o])||a)},Wr=function getOwnPropertyDescriptor(t,o){var a=toIndexedObject(t),c=toPropertyKey(o);if(a!==Or||!le(Dr,c)||le(Br,c)){var h=Rr(a,c);return!h||!le(Dr,c)||le(a,Tr)&&a[Tr][c]||(h.enumerable=!0),h}},Vr=function getOwnPropertyNames(t){var o=Fr(toIndexedObject(t)),a=[];return _r(o,(function(t){le(Dr,t)||le(Xe,t)||Ur(a,t)})),a},$getOwnPropertySymbols=function(t){var o=t===Or,a=Fr(o?Br:toIndexedObject(t)),c=[];return _r(a,(function(t){!le(Dr,t)||o&&!le(Or,t)||Ur(c,Dr[t])})),c};X||(Pr=function Symbol(){if(K(Ir,this))throw Ar("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?toString$1(arguments[0]):void 0,o=uid(t),setter=function(t){this===Or&&O(setter,Br,t),le(this,Tr)&&le(this[Tr],o)&&(this[Tr][o]=!1),Kr(this,o,createPropertyDescriptor(1,t))};return M&&zr&&Kr(Or,o,{configurable:!0,set:setter}),wrap$1(o,t)},Ir=Pr.prototype,defineBuiltIn(Ir,"toString",(function toString(){return Er(this).tag})),defineBuiltIn(Pr,"withoutSetter",(function(t){return wrap$1(uid(t),t)})),A.f=$r,qe.f=Hr,nt.f=Gr,_e.f=Wr,Zt.f=or.f=Vr,ir.f=$getOwnPropertySymbols,ar.f=function(t){return wrap$1(wellKnownSymbol(t),t)},M&&Lr(Ir,"description",{configurable:!0,get:function description(){return Er(this).description}})),_export({global:!0,constructor:!0,wrap:!0,forced:!X,sham:!X},{Symbol:Pr}),_r(tt(qr),(function(t){wellKnownSymbolDefine(t)})),_export({target:Cr,stat:!0,forced:!X},{useSetter:function(){zr=!0},useSimple:function(){zr=!1}}),_export({target:"Object",stat:!0,forced:!X,sham:!M},{create:function create(t,o){return void 0===o?st(t):Gr(st(t),o)},defineProperty:Hr,defineProperties:Gr,getOwnPropertyDescriptor:Wr}),_export({target:"Object",stat:!0,forced:!X},{getOwnPropertyNames:Vr}),symbolDefineToPrimitive(),setToStringTag(Pr,Cr),Xe[Tr]=!0;var Qr=X&&!!Symbol.for&&!!Symbol.keyFor,Jr=se("string-to-symbol-registry"),Xr=se("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Qr},{for:function(t){var o=toString$1(t);if(le(Jr,o))return Jr[o];var a=getBuiltIn("Symbol")(o);return Jr[o]=a,Xr[a]=o,a}});var Yr=se("symbol-to-string-registry");_export({target:"Symbol",stat:!0,forced:!Qr},{keyFor:function keyFor(t){if(!ee(t))throw TypeError(tryToString(t)+" is not a symbol");if(le(Yr,t))return Yr[t]}});var Zr=getBuiltIn("JSON","stringify"),en=C(/./.exec),tn=C("".charAt),rn=C("".charCodeAt),nn=C("".replace),an=C(1..toString),sn=/[\uD800-\uDFFF]/g,cn=/^[\uD800-\uDBFF]$/,un=/^[\uDC00-\uDFFF]$/,ln=!X||fails((function(){var t=getBuiltIn("Symbol")();return"[null]"!=Zr([t])||"{}"!=Zr({a:t})||"{}"!=Zr(Object(t))})),fn=fails((function(){return'"\\udf06\\ud834"'!==Zr("\udf06\ud834")||'"\\udead"'!==Zr("\udead")})),stringifyWithSymbolsFix=function(t,o){var a=ht(arguments),c=o;if((q(o)||void 0!==t)&&!ee(t))return _t(o)||(o=function(t,o){if(isCallable(c)&&(o=O(c,this,t,o)),!ee(o))return o}),a[1]=o,w(Zr,null,a)},fixIllFormed=function(t,o,a){var c=tn(a,o-1),h=tn(a,o+1);return en(cn,t)&&!en(un,h)||en(un,t)&&!en(cn,c)?"\\u"+an(rn(t,0),16):t};Zr&&_export({target:"JSON",stat:!0,arity:3,forced:ln||fn},{stringify:function stringify(t,o,a){var c=ht(arguments),h=w(ln?stringifyWithSymbolsFix:Zr,null,c);return fn&&"string"==typeof h?nn(h,sn,fixIllFormed):h}});var pn=!X||fails((function(){ir.f(1)}));_export({target:"Object",stat:!0,forced:pn},{getOwnPropertySymbols:function getOwnPropertySymbols(t){var o=ir.f;return o?o(toObject(t)):[]}}),wellKnownSymbolDefine("asyncIterator"),wellKnownSymbolDefine("hasInstance"),wellKnownSymbolDefine("isConcatSpreadable"),wellKnownSymbolDefine("iterator"),wellKnownSymbolDefine("match"),wellKnownSymbolDefine("matchAll"),wellKnownSymbolDefine("replace"),wellKnownSymbolDefine("search"),wellKnownSymbolDefine("species"),wellKnownSymbolDefine("split"),wellKnownSymbolDefine("toPrimitive"),symbolDefineToPrimitive(),wellKnownSymbolDefine("toStringTag"),setToStringTag(getBuiltIn("Symbol"),"Symbol"),wellKnownSymbolDefine("unscopables"),setToStringTag(h.JSON,"JSON",!0);var dn,hn,mn,gn=z.Symbol,vn={},yn=Function.prototype,bn=M&&Object.getOwnPropertyDescriptor,xn=le(yn,"name"),wn={EXISTS:xn,PROPER:xn&&"something"===function something(){}.name,CONFIGURABLE:xn&&(!M||M&&bn(yn,"name").configurable)},Sn=!fails((function(){function F(){}return F.prototype.constructor=null,Object.getPrototypeOf(new F)!==F.prototype})),kn=sharedKey("IE_PROTO"),_n=Object,Tn=_n.prototype,Cn=Sn?_n.getPrototypeOf:function(t){var o=toObject(t);if(le(o,kn))return o[kn];var a=o.constructor;return isCallable(a)&&o instanceof a?a.prototype:o instanceof _n?Tn:null},Mn=wellKnownSymbol("iterator"),En=!1;[].keys&&("next"in(mn=[].keys())?(hn=Cn(Cn(mn)))!==Object.prototype&&(dn=hn):En=!0);var On=!q(dn)||fails((function(){var t={};return dn[Mn].call(t)!==t}));dn=On?{}:st(dn),isCallable(dn[Mn])||defineBuiltIn(dn,Mn,(function(){return this}));var Pn={IteratorPrototype:dn,BUGGY_SAFARI_ITERATORS:En},In=Pn.IteratorPrototype,returnThis$1=function(){return this},An=wn.PROPER,jn=Pn.BUGGY_SAFARI_ITERATORS,Rn=wellKnownSymbol("iterator"),Ln="keys",Fn="values",Nn="entries",returnThis=function(){return this},iteratorDefine=function(t,o,a,c,h,m,v){!function(t,o,a,c){var h=o+" Iterator";t.prototype=st(In,{next:createPropertyDescriptor(+!c,a)}),setToStringTag(t,h,!1,!0),vn[h]=returnThis$1}(a,o,c);var b,x,w,getIterationMethod=function(t){if(t===h&&C)return C;if(!jn&&t in _)return _[t];switch(t){case Ln:return function keys(){return new a(this,t)};case Fn:return function values(){return new a(this,t)};case Nn:return function entries(){return new a(this,t)}}return function(){return new a(this)}},S=o+" Iterator",k=!1,_=t.prototype,T=_[Rn]||_["@@iterator"]||h&&_[h],C=!jn&&T||getIterationMethod(h),M="Array"==o&&_.entries||T;if(M&&(b=Cn(M.call(new t)))!==Object.prototype&&b.next&&(setToStringTag(b,S,!0,!0),vn[S]=returnThis),An&&h==Fn&&T&&T.name!==Fn&&(k=!0,C=function values(){return O(T,this)}),h)if(x={values:getIterationMethod(Fn),keys:m?C:getIterationMethod(Ln),entries:getIterationMethod(Nn)},v)for(w in x)(jn||k||!(w in _))&&defineBuiltIn(_,w,x[w]);else _export({target:o,proto:!0,forced:jn||k},x);return v&&_[Rn]!==C&&defineBuiltIn(_,Rn,C,{name:h}),vn[o]=C,x};qe.f;var Un="Array Iterator",Dn=wr.set,Bn=wr.getterFor(Un);iteratorDefine(Array,"Array",(function(t,o){Dn(this,{type:Un,target:toIndexedObject(t),index:0,kind:o})}),(function(){var t=Bn(this),o=t.target,a=t.kind,c=t.index++;return!o||c>=o.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==a?{value:c,done:!1}:"values"==a?{value:o[c],done:!1}:{value:[c,o[c]],done:!1}}),"values"),vn.Arguments=vn.Array;var qn=wellKnownSymbol("toStringTag");for(var zn in{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}){var Kn=h[zn],Hn=Kn&&Kn.prototype;Hn&&It(Hn)!==qn&&ze(Hn,qn,zn),vn[zn]=vn.Array}var Gn=gn;wellKnownSymbolDefine("asyncDispose"),wellKnownSymbolDefine("dispose"),wellKnownSymbolDefine("matcher"),wellKnownSymbolDefine("metadataKey"),wellKnownSymbolDefine("observable"),wellKnownSymbolDefine("metadata"),wellKnownSymbolDefine("patternMatch"),wellKnownSymbolDefine("replaceAll");var $n=Gn,Wn=C("".charAt),Vn=C("".charCodeAt),Qn=C("".slice),createMethod$2=function(t){return function(o,a){var c,h,m=toString$1(requireObjectCoercible(o)),v=toIntegerOrInfinity(a),b=m.length;return v<0||v>=b?t?"":void 0:(c=Vn(m,v))<55296||c>56319||v+1===b||(h=Vn(m,v+1))<56320||h>57343?t?Wn(m,v):c:t?Qn(m,v,v+2):h-56320+(c-55296<<10)+65536}},Jn={codeAt:createMethod$2(!1),charAt:createMethod$2(!0)}.charAt,Xn="String Iterator",Yn=wr.set,Zn=wr.getterFor(Xn);iteratorDefine(String,"String",(function(t){Yn(this,{type:Xn,string:toString$1(t),index:0})}),(function next(){var t,o=Zn(this),a=o.string,c=o.index;return c>=a.length?{value:void 0,done:!0}:(t=Jn(a,c),o.index+=t.length,{value:t,done:!1})}));var eo=ar.f("iterator"),to=createCommonjsModule((function(t){function _typeof(o){return t.exports=_typeof="function"==typeof $n&&"symbol"==typeof eo?function(t){return typeof t}:function(t){return t&&"function"==typeof $n&&t.constructor===$n&&t!==$n.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,_typeof(o)}t.exports=_typeof,t.exports.__esModule=!0,t.exports.default=t.exports})),ro=qe.f;_export({target:"Object",stat:!0,forced:Object.defineProperty!==ro,sham:!M},{defineProperty:ro});var no=createCommonjsModule((function(t){var o=z.Object,a=t.exports=function defineProperty(t,a,c){return o.defineProperty(t,a,c)};o.defineProperty.sham&&(a.sham=!0)})),oo=no,io=fails((function(){Cn(1)}));_export({target:"Object",stat:!0,forced:io,sham:!Sn},{getPrototypeOf:function getPrototypeOf(t){return Cn(toObject(t))}});var ao=z.Object.getPrototypeOf,arrayMethodIsStrict=function(t,o){var a=[][t];return!!a&&fails((function(){a.call(null,o||function(){return 1},1)}))},so=kr.forEach,co=arrayMethodIsStrict("forEach")?[].forEach:function forEach(t){return so(this,t,arguments.length>1?arguments[1]:void 0)};_export({target:"Array",proto:!0,forced:[].forEach!=co},{forEach:co});var uo=entryVirtual("Array").forEach,lo=Array.prototype,fo={DOMTokenList:!0,NodeList:!0},forEach$1=function(t){var o=t.forEach;return t===lo||K(lo,t)&&o===lo.forEach||le(fo,It(t))?uo:o},po=C([].concat),ho=getBuiltIn("Reflect","ownKeys")||function ownKeys(t){var o=Zt.f(anObject(t)),a=ir.f;return a?po(o,a(t)):o},mo=Error,go=C("".replace),vo=String(mo("zxcasd").stack),yo=/\n\s*at [^:]*:[^\n]*/,bo=yo.test(vo),errorStackClear=function(t,o){if(bo&&"string"==typeof t&&!mo.prepareStackTrace)for(;o--;)t=go(t,yo,"");return t},installErrorCause=function(t,o){q(o)&&"cause"in o&&ze(t,"cause",o.cause)},xo=wellKnownSymbol("iterator"),wo=Array.prototype,isArrayIteratorMethod=function(t){return void 0!==t&&(vn.Array===t||wo[xo]===t)},So=wellKnownSymbol("iterator"),getIteratorMethod$5=function(t){if(!isNullOrUndefined(t))return getMethod(t,So)||getMethod(t,"@@iterator")||vn[It(t)]},ko=TypeError,getIterator=function(t,o){var a=arguments.length<2?getIteratorMethod$5(t):o;if(aCallable(a))return anObject(O(a,t));throw ko(tryToString(t)+" is not iterable")},iteratorClose=function(t,o,a){var c,h;anObject(t);try{if(!(c=getMethod(t,"return"))){if("throw"===o)throw a;return a}c=O(c,t)}catch(t){h=!0,c=t}if("throw"===o)throw a;if(h)throw c;return anObject(c),a},_o=TypeError,Result=function(t,o){this.stopped=t,this.result=o},To=Result.prototype,iterate=function(t,o,a){var c,h,m,v,b,x,w,S=a&&a.that,k=!(!a||!a.AS_ENTRIES),_=!(!a||!a.IS_RECORD),T=!(!a||!a.IS_ITERATOR),C=!(!a||!a.INTERRUPTED),M=functionBindContext(o,S),stop=function(t){return c&&iteratorClose(c,"normal",t),new Result(!0,t)},callFn=function(t){return k?(anObject(t),C?M(t[0],t[1],stop):M(t[0],t[1])):C?M(t,stop):M(t)};if(_)c=t.iterator;else if(T)c=t;else{if(!(h=getIteratorMethod$5(t)))throw _o(tryToString(t)+" is not iterable");if(isArrayIteratorMethod(h)){for(m=0,v=lengthOfArrayLike(t);v>m;m++)if((b=callFn(t[m]))&&K(To,b))return b;return new Result(!1)}c=getIterator(t,h)}for(x=_?t.next:c.next;!(w=O(x,c)).done;){try{b=callFn(w.value)}catch(t){iteratorClose(c,"throw",t)}if("object"==typeof b&&b&&K(To,b))return b}return new Result(!1)},normalizeStringArgument=function(t,o){return void 0===t?arguments.length<2?"":o:toString$1(t)},Co=!fails((function(){var t=Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",createPropertyDescriptor(1,7)),7!==t.stack)})),Mo=wellKnownSymbol("toStringTag"),Eo=Error,Oo=[].push,Po=function AggregateError(t,o){var a,c=arguments.length>2?arguments[2]:void 0,h=K(Io,this);pt?a=pt(Eo(),h?Cn(this):Io):(a=h?this:st(Io),ze(a,Mo,"Error")),void 0!==o&&ze(a,"message",normalizeStringArgument(o)),Co&&ze(a,"stack",errorStackClear(a.stack,1)),installErrorCause(a,c);var m=[];return iterate(t,Oo,{that:m}),ze(a,"errors",m),a};pt?pt(Po,Eo):function(t,o,a){for(var c=ho(o),h=qe.f,m=_e.f,v=0;v<c.length;v++){var b=c[v];le(t,b)||a&&le(a,b)||h(t,b,m(o,b))}}(Po,Eo,{name:!0});var Io=Po.prototype=st(Eo.prototype,{constructor:createPropertyDescriptor(1,Po),message:createPropertyDescriptor(1,""),name:createPropertyDescriptor(1,"AggregateError")});_export({global:!0,constructor:!0,arity:2},{AggregateError:Po});var Ao,jo,Ro,Lo,Fo="process"==classofRaw(h.process),No=wellKnownSymbol("species"),setSpecies=function(t){var o=getBuiltIn(t),a=qe.f;M&&o&&!o[No]&&a(o,No,{configurable:!0,get:function(){return this}})},Uo=TypeError,anInstance=function(t,o){if(K(o,t))return t;throw Uo("Incorrect invocation")},Do=TypeError,aConstructor=function(t){if(qt(t))return t;throw Do(tryToString(t)+" is not a constructor")},Bo=wellKnownSymbol("species"),speciesConstructor=function(t,o){var a,c=anObject(t).constructor;return void 0===c||isNullOrUndefined(a=anObject(c)[Bo])?o:aConstructor(a)},qo=TypeError,validateArgumentsLength=function(t,o){if(t<o)throw qo("Not enough arguments");return t},zo=/(?:ipad|iphone|ipod).*applewebkit/i.test(H),Ko=h.setImmediate,Ho=h.clearImmediate,Go=h.process,$o=h.Dispatch,Wo=h.Function,Vo=h.MessageChannel,Qo=h.String,Jo=0,Xo={},Yo="onreadystatechange";try{Ao=h.location}catch(t){}var run=function(t){if(le(Xo,t)){var o=Xo[t];delete Xo[t],o()}},runner=function(t){return function(){run(t)}},listener=function(t){run(t.data)},post=function(t){h.postMessage(Qo(t),Ao.protocol+"//"+Ao.host)};Ko&&Ho||(Ko=function setImmediate(t){validateArgumentsLength(arguments.length,1);var o=isCallable(t)?t:Wo(t),a=ht(arguments,1);return Xo[++Jo]=function(){w(o,void 0,a)},jo(Jo),Jo},Ho=function clearImmediate(t){delete Xo[t]},Fo?jo=function(t){Go.nextTick(runner(t))}:$o&&$o.now?jo=function(t){$o.now(runner(t))}:Vo&&!zo?(Lo=(Ro=new Vo).port2,Ro.port1.onmessage=listener,jo=functionBindContext(Lo.postMessage,Lo)):h.addEventListener&&isCallable(h.postMessage)&&!h.importScripts&&Ao&&"file:"!==Ao.protocol&&!fails(post)?(jo=post,h.addEventListener("message",listener,!1)):jo=Yo in documentCreateElement("script")?function(t){ot.appendChild(documentCreateElement("script")).onreadystatechange=function(){ot.removeChild(this),run(t)}}:function(t){setTimeout(runner(t),0)});var Zo,ei,ti,ri,ni,oi,ii,ai,si={set:Ko,clear:Ho},ci=/ipad|iphone|ipod/i.test(H)&&void 0!==h.Pebble,ui=/web0s(?!.*chrome)/i.test(H),li=_e.f,fi=si.set,pi=h.MutationObserver||h.WebKitMutationObserver,di=h.document,hi=h.process,mi=h.Promise,gi=li(h,"queueMicrotask"),vi=gi&&gi.value;vi||(Zo=function(){var t,o;for(Fo&&(t=hi.domain)&&t.exit();ei;){o=ei.fn,ei=ei.next;try{o()}catch(t){throw ei?ri():ti=void 0,t}}ti=void 0,t&&t.enter()},zo||Fo||ui||!pi||!di?!ci&&mi&&mi.resolve?((ii=mi.resolve(void 0)).constructor=mi,ai=functionBindContext(ii.then,ii),ri=function(){ai(Zo)}):Fo?ri=function(){hi.nextTick(Zo)}:(fi=functionBindContext(fi,h),ri=function(){fi(Zo)}):(ni=!0,oi=di.createTextNode(""),new pi(Zo).observe(oi,{characterData:!0}),ri=function(){oi.data=ni=!ni}));var yi=vi||function(t){var o={fn:t,next:void 0};ti&&(ti.next=o),ei||(ei=o,ri()),ti=o},perform=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},Queue=function(){this.head=null,this.tail=null};Queue.prototype={add:function(t){var o={item:t,next:null};this.head?this.tail.next=o:this.head=o,this.tail=o},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}};var bi,xi,wi=Queue,Si=h.Promise,ki="object"==typeof Deno&&Deno&&"object"==typeof Deno.version,_i=!ki&&!Fo&&"object"==typeof window&&"object"==typeof document,Ti=Si&&Si.prototype,Ci=wellKnownSymbol("species"),Mi=!1,Ei=isCallable(h.PromiseRejectionEvent),Oi=Pe("Promise",(function(){var t=jt(Si),o=t!==String(Si);if(!o&&66===J)return!0;if(!Ti.catch||!Ti.finally)return!0;if(!J||J<51||!/native code/.test(t)){var a=new Si((function(t){t(1)})),FakePromise=function(t){t((function(){}),(function(){}))};if((a.constructor={})[Ci]=FakePromise,!(Mi=a.then((function(){}))instanceof FakePromise))return!0}return!o&&(_i||ki)&&!Ei})),Pi={CONSTRUCTOR:Oi,REJECTION_EVENT:Ei,SUBCLASSING:Mi},Ii=TypeError,PromiseCapability=function(t){var o,a;this.promise=new t((function(t,c){if(void 0!==o||void 0!==a)throw Ii("Bad Promise constructor");o=t,a=c})),this.resolve=aCallable(o),this.reject=aCallable(a)},Ai={f:function(t){return new PromiseCapability(t)}},ji=si.set,Ri="Promise",Li=Pi.CONSTRUCTOR,Fi=Pi.REJECTION_EVENT,Ni=wr.getterFor(Ri),Ui=wr.set,Di=Si&&Si.prototype,Bi=Si,qi=Di,zi=h.TypeError,Ki=h.document,Hi=h.process,Gi=Ai.f,$i=Gi,Wi=!!(Ki&&Ki.createEvent&&h.dispatchEvent),Vi="unhandledrejection",isThenable=function(t){var o;return!(!q(t)||!isCallable(o=t.then))&&o},callReaction=function(t,o){var a,c,h,m=o.value,v=1==o.state,b=v?t.ok:t.fail,x=t.resolve,w=t.reject,S=t.domain;try{b?(v||(2===o.rejection&&onHandleUnhandled(o),o.rejection=1),!0===b?a=m:(S&&S.enter(),a=b(m),S&&(S.exit(),h=!0)),a===t.promise?w(zi("Promise-chain cycle")):(c=isThenable(a))?O(c,a,x,w):x(a)):w(m)}catch(t){S&&!h&&S.exit(),w(t)}},notify=function(t,o){t.notified||(t.notified=!0,yi((function(){for(var a,c=t.reactions;a=c.get();)callReaction(a,t);t.notified=!1,o&&!t.rejection&&onUnhandled(t)})))},dispatchEvent=function(t,o,a){var c,m;Wi?((c=Ki.createEvent("Event")).promise=o,c.reason=a,c.initEvent(t,!1,!0),h.dispatchEvent(c)):c={promise:o,reason:a},!Fi&&(m=h["on"+t])?m(c):t===Vi&&function(t,o){var a=h.console;a&&a.error&&(1==arguments.length?a.error(t):a.error(t,o))}("Unhandled promise rejection",a)},onUnhandled=function(t){O(ji,h,(function(){var o,a=t.facade,c=t.value;if(isUnhandled(t)&&(o=perform((function(){Fo?Hi.emit("unhandledRejection",c,a):dispatchEvent(Vi,a,c)})),t.rejection=Fo||isUnhandled(t)?2:1,o.error))throw o.value}))},isUnhandled=function(t){return 1!==t.rejection&&!t.parent},onHandleUnhandled=function(t){O(ji,h,(function(){var o=t.facade;Fo?Hi.emit("rejectionHandled",o):dispatchEvent("rejectionhandled",o,t.value)}))},bind=function(t,o,a){return function(c){t(o,c,a)}},internalReject=function(t,o,a){t.done||(t.done=!0,a&&(t=a),t.value=o,t.state=2,notify(t,!0))},internalResolve=function(t,o,a){if(!t.done){t.done=!0,a&&(t=a);try{if(t.facade===o)throw zi("Promise can't be resolved itself");var c=isThenable(o);c?yi((function(){var a={done:!1};try{O(c,o,bind(internalResolve,a,t),bind(internalReject,a,t))}catch(o){internalReject(a,o,t)}})):(t.value=o,t.state=1,notify(t,!1))}catch(o){internalReject({done:!1},o,t)}}};Li&&(qi=(Bi=function Promise(t){anInstance(this,qi),aCallable(t),O(bi,this);var o=Ni(this);try{t(bind(internalResolve,o),bind(internalReject,o))}catch(t){internalReject(o,t)}}).prototype,(bi=function Promise(t){Ui(this,{type:Ri,done:!1,notified:!1,parent:!1,reactions:new wi,rejection:!1,state:0,value:void 0})}).prototype=defineBuiltIn(qi,"then",(function then(t,o){var a=Ni(this),c=Gi(speciesConstructor(this,Bi));return a.parent=!0,c.ok=!isCallable(t)||t,c.fail=isCallable(o)&&o,c.domain=Fo?Hi.domain:void 0,0==a.state?a.reactions.add(c):yi((function(){callReaction(c,a)})),c.promise})),xi=function(){var t=new bi,o=Ni(t);this.promise=t,this.resolve=bind(internalResolve,o),this.reject=bind(internalReject,o)},Ai.f=Gi=function(t){return t===Bi||undefined===t?new xi(t):$i(t)}),_export({global:!0,constructor:!0,wrap:!0,forced:Li},{Promise:Bi}),setToStringTag(Bi,Ri,!1,!0),setSpecies(Ri);var Qi=wellKnownSymbol("iterator"),Ji=!1;try{var Xi=0,Yi={next:function(){return{done:!!Xi++}},return:function(){Ji=!0}};Yi[Qi]=function(){return this},Array.from(Yi,(function(){throw 2}))}catch(t){}var checkCorrectnessOfIteration=function(t,o){if(!o&&!Ji)return!1;var a=!1;try{var c={};c[Qi]=function(){return{next:function(){return{done:a=!0}}}},t(c)}catch(t){}return a},Zi=Pi.CONSTRUCTOR||!checkCorrectnessOfIteration((function(t){Si.all(t).then(void 0,(function(){}))}));_export({target:"Promise",stat:!0,forced:Zi},{all:function all(t){var o=this,a=Ai.f(o),c=a.resolve,h=a.reject,m=perform((function(){var a=aCallable(o.resolve),m=[],v=0,b=1;iterate(t,(function(t){var x=v++,w=!1;b++,O(a,o,t).then((function(t){w||(w=!0,m[x]=t,--b||c(m))}),h)})),--b||c(m)}));return m.error&&h(m.value),a.promise}});var ea=Pi.CONSTRUCTOR;Si&&Si.prototype,_export({target:"Promise",proto:!0,forced:ea,real:!0},{catch:function(t){return this.then(void 0,t)}}),_export({target:"Promise",stat:!0,forced:Zi},{race:function race(t){var o=this,a=Ai.f(o),c=a.reject,h=perform((function(){var h=aCallable(o.resolve);iterate(t,(function(t){O(h,o,t).then(a.resolve,c)}))}));return h.error&&c(h.value),a.promise}}),_export({target:"Promise",stat:!0,forced:Pi.CONSTRUCTOR},{reject:function reject(t){var o=Ai.f(this);return O(o.reject,void 0,t),o.promise}});var promiseResolve=function(t,o){if(anObject(t),q(o)&&o.constructor===t)return o;var a=Ai.f(t);return(0,a.resolve)(o),a.promise},ta=Pi.CONSTRUCTOR,ra=getBuiltIn("Promise"),na=!ta;_export({target:"Promise",stat:!0,forced:!0},{resolve:function resolve(t){return promiseResolve(na&&this===ra?Si:this,t)}}),_export({target:"Promise",stat:!0},{allSettled:function allSettled(t){var o=this,a=Ai.f(o),c=a.resolve,h=a.reject,m=perform((function(){var a=aCallable(o.resolve),h=[],m=0,v=1;iterate(t,(function(t){var b=m++,x=!1;v++,O(a,o,t).then((function(t){x||(x=!0,h[b]={status:"fulfilled",value:t},--v||c(h))}),(function(t){x||(x=!0,h[b]={status:"rejected",reason:t},--v||c(h))}))})),--v||c(h)}));return m.error&&h(m.value),a.promise}});var oa="No one promise resolved";_export({target:"Promise",stat:!0},{any:function any(t){var o=this,a=getBuiltIn("AggregateError"),c=Ai.f(o),h=c.resolve,m=c.reject,v=perform((function(){var c=aCallable(o.resolve),v=[],b=0,x=1,w=!1;iterate(t,(function(t){var S=b++,k=!1;x++,O(c,o,t).then((function(t){k||w||(w=!0,h(t))}),(function(t){k||w||(k=!0,v[S]=t,--x||m(new a(v,oa)))}))})),--x||m(new a(v,oa))}));return v.error&&m(v.value),c.promise}});var ia=Si&&Si.prototype,aa=!!Si&&fails((function(){ia.finally.call({then:function(){}},(function(){}))}));_export({target:"Promise",proto:!0,real:!0,forced:aa},{finally:function(t){var o=speciesConstructor(this,getBuiltIn("Promise")),a=isCallable(t);return this.then(a?function(a){return promiseResolve(o,t()).then((function(){return a}))}:t,a?function(a){return promiseResolve(o,t()).then((function(){throw a}))}:t)}});var sa=z.Promise;_export({target:"Promise",stat:!0,forced:!0},{try:function(t){var o=Ai.f(this),a=perform(t);return(a.error?o.reject:o.resolve)(a.value),o.promise}});var ca=sa,ua=C([].reverse),la=[1,2];_export({target:"Array",proto:!0,forced:String(la)===String(la.reverse())},{reverse:function reverse(){return _t(this)&&(this.length=this.length),ua(this)}});var fa=entryVirtual("Array").reverse,pa=Array.prototype,reverse=function(t){var o=t.reverse;return t===pa||K(pa,t)&&o===pa.reverse?fa:o},da=arrayMethodHasSpeciesSupport("slice"),ha=wellKnownSymbol("species"),ma=Array,ga=Math.max;_export({target:"Array",proto:!0,forced:!da},{slice:function slice(t,o){var a,c,h,m=toIndexedObject(this),v=lengthOfArrayLike(m),b=toAbsoluteIndex(t,v),x=toAbsoluteIndex(void 0===o?v:o,v);if(_t(m)&&(a=m.constructor,(qt(a)&&(a===ma||_t(a.prototype))||q(a)&&null===(a=a[ha]))&&(a=void 0),a===ma||void 0===a))return ht(m,b,x);for(c=new(void 0===a?ma:a)(ga(x-b,0)),h=0;b<x;b++,h++)b in m&&createProperty(c,h,m[b]);return c.length=h,c}});var va=entryVirtual("Array").slice,ya=Array.prototype,slice=function(t){var o=t.slice;return t===ya||K(ya,t)&&o===ya.slice?va:o},ba=createCommonjsModule((function(t){var o=to.default;function _regeneratorRuntime(){t.exports=_regeneratorRuntime=function _regeneratorRuntime(){return a},t.exports.__esModule=!0,t.exports.default=t.exports;var a={},c=Object.prototype,h=c.hasOwnProperty,m="function"==typeof $n?$n:{},v=m.iterator||"@@iterator",b=m.asyncIterator||"@@asyncIterator",x=m.toStringTag||"@@toStringTag";function define(t,o,a){return oo(t,o,{value:a,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{define({},"")}catch(t){define=function define(t,o,a){return t[o]=a}}function wrap(t,o,a,c){var h=o&&o.prototype instanceof Generator?o:Generator,m=ut(h.prototype),v=new Context(c||[]);return m._invoke=function(t,o,a){var c="suspendedStart";return function(h,m){if("executing"===c)throw new Error("Generator is already running");if("completed"===c){if("throw"===h)throw m;return doneResult()}for(a.method=h,a.arg=m;;){var v=a.delegate;if(v){var b=maybeInvokeDelegate(v,a);if(b){if(b===w)continue;return b}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===c)throw c="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);c="executing";var x=tryCatch(t,o,a);if("normal"===x.type){if(c=a.done?"completed":"suspendedYield",x.arg===w)continue;return{value:x.arg,done:a.done}}"throw"===x.type&&(c="completed",a.method="throw",a.arg=x.arg)}}}(t,a,v),m}function tryCatch(t,o,a){try{return{type:"normal",arg:t.call(o,a)}}catch(t){return{type:"throw",arg:t}}}a.wrap=wrap;var w={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var S={};define(S,v,(function(){return this}));var k=ao&&ao(ao(values([])));k&&k!==c&&h.call(k,v)&&(S=k);var _=GeneratorFunctionPrototype.prototype=Generator.prototype=ut(S);function defineIteratorMethods(t){var o;forEach$1(o=["next","throw","return"]).call(o,(function(o){define(t,o,(function(t){return this._invoke(o,t)}))}))}function AsyncIterator(t,a){function invoke(c,m,v,b){var x=tryCatch(t[c],t,m);if("throw"!==x.type){var w=x.arg,S=w.value;return S&&"object"==o(S)&&h.call(S,"__await")?a.resolve(S.__await).then((function(t){invoke("next",t,v,b)}),(function(t){invoke("throw",t,v,b)})):a.resolve(S).then((function(t){w.value=t,v(w)}),(function(t){return invoke("throw",t,v,b)}))}b(x.arg)}var c;this._invoke=function(t,o){function callInvokeWithMethodAndArg(){return new a((function(a,c){invoke(t,o,a,c)}))}return c=c?c.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}}function maybeInvokeDelegate(t,o){var a=t.iterator[o.method];if(void 0===a){if(o.delegate=null,"throw"===o.method){if(t.iterator.return&&(o.method="return",o.arg=void 0,maybeInvokeDelegate(t,o),"throw"===o.method))return w;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return w}var c=tryCatch(a,t.iterator,o.arg);if("throw"===c.type)return o.method="throw",o.arg=c.arg,o.delegate=null,w;var h=c.arg;return h?h.done?(o[t.resultName]=h.value,o.next=t.nextLoc,"return"!==o.method&&(o.method="next",o.arg=void 0),o.delegate=null,w):h:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,w)}function pushTryEntry(t){var o={tryLoc:t[0]};1 in t&&(o.catchLoc=t[1]),2 in t&&(o.finallyLoc=t[2],o.afterLoc=t[3]),this.tryEntries.push(o)}function resetTryEntry(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function Context(t){this.tryEntries=[{tryLoc:"root"}],forEach$1(t).call(t,pushTryEntry,this),this.reset(!0)}function values(t){if(t){var o=t[v];if(o)return o.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var a=-1,c=function next(){for(;++a<t.length;)if(h.call(t,a))return next.value=t[a],next.done=!1,next;return next.value=void 0,next.done=!0,next};return c.next=c}}return{next:doneResult}}function doneResult(){return{value:void 0,done:!0}}return GeneratorFunction.prototype=GeneratorFunctionPrototype,define(_,"constructor",GeneratorFunctionPrototype),define(GeneratorFunctionPrototype,"constructor",GeneratorFunction),GeneratorFunction.displayName=define(GeneratorFunctionPrototype,x,"GeneratorFunction"),a.isGeneratorFunction=function(t){var o="function"==typeof t&&t.constructor;return!!o&&(o===GeneratorFunction||"GeneratorFunction"===(o.displayName||o.name))},a.mark=function(t){return dt?dt(t,GeneratorFunctionPrototype):(t.__proto__=GeneratorFunctionPrototype,define(t,x,"GeneratorFunction")),t.prototype=ut(_),t},a.awrap=function(t){return{__await:t}},defineIteratorMethods(AsyncIterator.prototype),define(AsyncIterator.prototype,b,(function(){return this})),a.AsyncIterator=AsyncIterator,a.async=function(t,o,c,h,m){void 0===m&&(m=ca);var v=new AsyncIterator(wrap(t,o,c,h),m);return a.isGeneratorFunction(o)?v:v.next().then((function(t){return t.done?t.value:v.next()}))},defineIteratorMethods(_),define(_,x,"Generator"),define(_,v,(function(){return this})),define(_,"toString",(function(){return"[object Generator]"})),a.keys=function(t){var o=[];for(var a in t)o.push(a);return reverse(o).call(o),function next(){for(;o.length;){var a=o.pop();if(a in t)return next.value=a,next.done=!1,next}return next.done=!0,next}},a.values=values,Context.prototype={constructor:Context,reset:function reset(t){var o;if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,forEach$1(o=this.tryEntries).call(o,resetTryEntry),!t)for(var a in this)"t"===a.charAt(0)&&h.call(this,a)&&!isNaN(+slice(a).call(a,1))&&(this[a]=void 0)},stop:function stop(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function dispatchException(t){if(this.done)throw t;var o=this;function handle(a,c){return m.type="throw",m.arg=t,o.next=a,c&&(o.method="next",o.arg=void 0),!!c}for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a],m=c.completion;if("root"===c.tryLoc)return handle("end");if(c.tryLoc<=this.prev){var v=h.call(c,"catchLoc"),b=h.call(c,"finallyLoc");if(v&&b){if(this.prev<c.catchLoc)return handle(c.catchLoc,!0);if(this.prev<c.finallyLoc)return handle(c.finallyLoc)}else if(v){if(this.prev<c.catchLoc)return handle(c.catchLoc,!0)}else{if(!b)throw new Error("try statement without catch or finally");if(this.prev<c.finallyLoc)return handle(c.finallyLoc)}}}},abrupt:function abrupt(t,o){for(var a=this.tryEntries.length-1;a>=0;--a){var c=this.tryEntries[a];if(c.tryLoc<=this.prev&&h.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var m=c;break}}m&&("break"===t||"continue"===t)&&m.tryLoc<=o&&o<=m.finallyLoc&&(m=null);var v=m?m.completion:{};return v.type=t,v.arg=o,m?(this.method="next",this.next=m.finallyLoc,w):this.complete(v)},complete:function complete(t,o){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&o&&(this.next=o),w},finish:function finish(t){for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o];if(a.finallyLoc===t)return this.complete(a.completion,a.afterLoc),resetTryEntry(a),w}},catch:function _catch(t){for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o];if(a.tryLoc===t){var c=a.completion;if("throw"===c.type){var h=c.arg;resetTryEntry(a)}return h}}throw new Error("illegal catch attempt")},delegateYield:function delegateYield(t,o,a){return this.delegate={iterator:values(t),resultName:o,nextLoc:a},"next"===this.method&&(this.arg=void 0),w}},a}t.exports=_regeneratorRuntime,t.exports.__esModule=!0,t.exports.default=t.exports})),xa=ba(),wa=xa;try{regeneratorRuntime=xa}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=xa:Function("r","regeneratorRuntime = r")(xa)}_export({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991});var Sa=9007199254740991,ka=Object.assign,_a=Object.defineProperty,Ta=C([].concat),Ca=!ka||fails((function(){if(M&&1!==ka({b:1},ka(_a({},"a",{enumerable:!0,get:function(){_a(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},o={},a=Symbol(),c="abcdefghijklmnopqrst";return t[a]=7,c.split("").forEach((function(t){o[t]=t})),7!=ka({},t)[a]||tt(ka({},o)).join("")!=c}))?function assign(t,o){for(var a=toObject(t),c=arguments.length,h=1,m=ir.f,v=A.f;c>h;)for(var b,x=U(arguments[h++]),w=m?Ta(tt(x),m(x)):tt(x),S=w.length,k=0;S>k;)b=w[k++],M&&!O(v,x,b)||(a[b]=x[b]);return a}:ka;_export({target:"Object",stat:!0,arity:2,forced:Object.assign!==Ca},{assign:Ca});var Ma=z.Object.assign,Ea=Date,Oa=C(Ea.prototype.getTime);_export({target:"Date",stat:!0},{now:function now(){return Oa(new Ea)}});var Pa=z.Date.now;z.JSON||(z.JSON={stringify:JSON.stringify});var Ia=function stringify(t,o,a){return w(z.JSON.stringify,null,arguments)},Aa=Ia;function __rest(t,o){var a={};for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.indexOf(c)<0&&(a[c]=t[c]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var h=0;for(c=Object.getOwnPropertySymbols(t);h<c.length;h++)o.indexOf(c[h])<0&&Object.prototype.propertyIsEnumerable.call(t,c[h])&&(a[c[h]]=t[c[h]])}return a}function __awaiter(t,o,a,c){return new(a||(a=Promise))((function(h,m){function fulfilled(t){try{step(c.next(t))}catch(t){m(t)}}function rejected(t){try{step(c.throw(t))}catch(t){m(t)}}function step(t){t.done?h(t.value):function adopt(t){return t instanceof a?t:new a((function(o){o(t)}))}(t.value).then(fulfilled,rejected)}step((c=c.apply(t,o||[])).next())}))}var ja=fails((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),Ra=Object.isExtensible,La=fails((function(){Ra(1)}))||ja?function isExtensible(t){return!!q(t)&&((!ja||"ArrayBuffer"!=classofRaw(t))&&(!Ra||Ra(t)))}:Ra,Fa=!fails((function(){return Object.isExtensible(Object.preventExtensions({}))})),Na=createCommonjsModule((function(t){var o=qe.f,a=!1,c=uid("meta"),h=0,setMetadata=function(t){o(t,c,{value:{objectID:"O"+h++,weakData:{}}})},m=t.exports={enable:function(){m.enable=function(){},a=!0;var t=Zt.f,o=C([].splice),h={};h[c]=1,t(h).length&&(Zt.f=function(a){for(var h=t(a),m=0,v=h.length;m<v;m++)if(h[m]===c){o(h,m,1);break}return h},_export({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:or.f}))},fastKey:function(t,o){if(!q(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!le(t,c)){if(!La(t))return"F";if(!o)return"E";setMetadata(t)}return t[c].objectID},getWeakData:function(t,o){if(!le(t,c)){if(!La(t))return!0;if(!o)return!1;setMetadata(t)}return t[c].weakData},onFreeze:function(t){return Fa&&a&&La(t)&&!le(t,c)&&setMetadata(t),t}};Xe[c]=!0})),Ua=qe.f,Da=kr.forEach,Ba=wr.set,qa=wr.getterFor,defineBuiltIns=function(t,o,a){for(var c in o)a&&a.unsafe&&t[c]?t[c]=o[c]:defineBuiltIn(t,c,o[c],a);return t},za=qe.f,Ka=Na.fastKey,Ha=wr.set,Ga=wr.getterFor,$a={getConstructor:function(t,o,a,c){var h=t((function(t,h){anInstance(t,m),Ha(t,{type:o,index:st(null),first:void 0,last:void 0,size:0}),M||(t.size=0),isNullOrUndefined(h)||iterate(h,t[c],{that:t,AS_ENTRIES:a})})),m=h.prototype,v=Ga(o),define=function(t,o,a){var c,h,m=v(t),b=getEntry(t,o);return b?b.value=a:(m.last=b={index:h=Ka(o,!0),key:o,value:a,previous:c=m.last,next:void 0,removed:!1},m.first||(m.first=b),c&&(c.next=b),M?m.size++:t.size++,"F"!==h&&(m.index[h]=b)),t},getEntry=function(t,o){var a,c=v(t),h=Ka(o);if("F"!==h)return c.index[h];for(a=c.first;a;a=a.next)if(a.key==o)return a};return defineBuiltIns(m,{clear:function clear(){for(var t=v(this),o=t.index,a=t.first;a;)a.removed=!0,a.previous&&(a.previous=a.previous.next=void 0),delete o[a.index],a=a.next;t.first=t.last=void 0,M?t.size=0:this.size=0},delete:function(t){var o=this,a=v(o),c=getEntry(o,t);if(c){var h=c.next,m=c.previous;delete a.index[c.index],c.removed=!0,m&&(m.next=h),h&&(h.previous=m),a.first==c&&(a.first=h),a.last==c&&(a.last=m),M?a.size--:o.size--}return!!c},forEach:function forEach(t){for(var o,a=v(this),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0);o=o?o.next:a.first;)for(c(o.value,o.key,this);o&&o.removed;)o=o.previous},has:function has(t){return!!getEntry(this,t)}}),defineBuiltIns(m,a?{get:function get(t){var o=getEntry(this,t);return o&&o.value},set:function set(t,o){return define(this,0===t?0:t,o)}}:{add:function add(t){return define(this,t=0===t?0:t,t)}}),M&&za(m,"size",{get:function(){return v(this).size}}),h},setStrong:function(t,o,a){var c=o+" Iterator",h=Ga(o),m=Ga(c);iteratorDefine(t,o,(function(t,o){Ha(this,{type:c,target:t,state:h(t),kind:o,last:void 0})}),(function(){for(var t=m(this),o=t.kind,a=t.last;a&&a.removed;)a=a.previous;return t.target&&(t.last=a=a?a.next:t.state.first)?"keys"==o?{value:a.key,done:!1}:"values"==o?{value:a.value,done:!1}:{value:[a.key,a.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),a?"entries":"values",!a,!0),setSpecies(o)}};!function(t,o,a){var c,m=-1!==t.indexOf("Map"),v=-1!==t.indexOf("Weak"),b=m?"set":"add",x=h[t],w=x&&x.prototype,S={};if(M&&isCallable(x)&&(v||w.forEach&&!fails((function(){(new x).entries().next()})))){var k=(c=o((function(o,a){Ba(anInstance(o,k),{type:t,collection:new x}),null!=a&&iterate(a,o[b],{that:o,AS_ENTRIES:m})}))).prototype,_=qa(t);Da(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var o="add"==t||"set"==t;!(t in w)||v&&"clear"==t||ze(k,t,(function(a,c){var h=_(this).collection;if(!o&&v&&!q(a))return"get"==t&&void 0;var m=h[t](0===a?0:a,c);return o?this:m}))})),v||Ua(k,"size",{configurable:!0,get:function(){return _(this).collection.size}})}else c=a.getConstructor(o,t,m,b),Na.enable();setToStringTag(c,t,!1,!0),S[t]=c,_export({global:!0,forced:!0},S),v||a.setStrong(c,t,m)}("Map",(function(t){return function Map(){return t(this,arguments.length?arguments[0]:void 0)}}),$a);var Wa=z.Map,Va=[].push;_export({target:"Map",stat:!0,forced:!0},{from:function from(t){var o,a,c,h,m=arguments.length,v=m>1?arguments[1]:void 0;return aConstructor(this),(o=void 0!==v)&&aCallable(v),isNullOrUndefined(t)?new this:(a=[],o?(c=0,h=functionBindContext(v,m>2?arguments[2]:void 0),iterate(t,(function(t){O(Va,a,h(t,c++))}))):iterate(t,Va,{that:a}),new this(a))}});_export({target:"Map",stat:!0,forced:!0},{of:function of(){return new this(ht(arguments))}});_export({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function deleteAll(){for(var t,o=anObject(this),a=aCallable(o.delete),c=!0,h=0,m=arguments.length;h<m;h++)t=O(a,o,arguments[h]),c=c&&t;return!!c}});_export({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function emplace(t,o){var a,c,h=anObject(this),m=aCallable(h.get),v=aCallable(h.has),b=aCallable(h.set);return O(v,h,t)?(a=O(m,h,t),"update"in o&&(a=o.update(a,t,h),O(b,h,t,a)),a):(c=o.insert(t,h),O(b,h,t,c),c)}});var Qa=getIterator;_export({target:"Map",proto:!0,real:!0,forced:!0},{every:function every(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return!iterate(a,(function(t,a,h){if(!c(a,t,o))return h()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{filter:function filter(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0),h=new(speciesConstructor(o,getBuiltIn("Map"))),m=aCallable(h.set);return iterate(a,(function(t,a){c(a,t,o)&&O(m,h,t,a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),h}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{find:function find(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(a,(function(t,a,h){if(c(a,t,o))return h(a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function findKey(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(a,(function(t,a,h){if(c(a,t,o))return h(t)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}});var Ja=C([].push);_export({target:"Map",stat:!0,forced:!0},{groupBy:function groupBy(t,o){aCallable(o);var a=getIterator(t),c=new this,h=aCallable(c.has),m=aCallable(c.get),v=aCallable(c.set);return iterate(a,(function(t){var a=o(t);O(h,c,a)?Ja(O(m,c,a),t):O(v,c,a,[t])}),{IS_ITERATOR:!0}),c}});_export({target:"Map",proto:!0,real:!0,forced:!0},{includes:function includes(t){return iterate(Qa(anObject(this)),(function(o,a,c){if((h=a)===(m=t)||h!=h&&m!=m)return c();var h,m}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}}),_export({target:"Map",stat:!0,forced:!0},{keyBy:function keyBy(t,o){var a=new this;aCallable(o);var c=aCallable(a.set);return iterate(t,(function(t){O(c,a,o(t),t)})),a}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function keyOf(t){return iterate(Qa(anObject(this)),(function(o,a,c){if(a===t)return c(o)}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).result}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function mapKeys(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0),h=new(speciesConstructor(o,getBuiltIn("Map"))),m=aCallable(h.set);return iterate(a,(function(t,a){O(m,h,c(a,t,o),a)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),h}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{mapValues:function mapValues(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0),h=new(speciesConstructor(o,getBuiltIn("Map"))),m=aCallable(h.set);return iterate(a,(function(t,a){O(m,h,t,c(a,t,o))}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),h}}),_export({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function merge(t){for(var o=anObject(this),a=aCallable(o.set),c=arguments.length,h=0;h<c;)iterate(arguments[h++],a,{that:o,AS_ENTRIES:!0});return o}});var Xa=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function reduce(t){var o=anObject(this),a=Qa(o),c=arguments.length<2,h=c?void 0:arguments[1];if(aCallable(t),iterate(a,(function(a,m){c?(c=!1,h=m):h=t(h,m,a,o)}),{AS_ENTRIES:!0,IS_ITERATOR:!0}),c)throw Xa("Reduce of empty map with no initial value");return h}}),_export({target:"Map",proto:!0,real:!0,forced:!0},{some:function some(t){var o=anObject(this),a=Qa(o),c=functionBindContext(t,arguments.length>1?arguments[1]:void 0);return iterate(a,(function(t,a,h){if(c(a,t,o))return h()}),{AS_ENTRIES:!0,IS_ITERATOR:!0,INTERRUPTED:!0}).stopped}});var Ya=TypeError;_export({target:"Map",proto:!0,real:!0,forced:!0},{update:function update(t,o){var a=anObject(this),c=aCallable(a.get),h=aCallable(a.has),m=aCallable(a.set),v=arguments.length;aCallable(o);var b=O(h,a,t);if(!b&&v<3)throw Ya("Updating absent value");var x=b?O(c,a,t):aCallable(v>2?arguments[2]:void 0)(t,a);return O(m,a,t,o(x,t,a)),a}});var Za=TypeError,es=function upsert(t,o){var a,c=anObject(this),h=aCallable(c.get),m=aCallable(c.has),v=aCallable(c.set),b=arguments.length>2?arguments[2]:void 0;if(!isCallable(o)&&!isCallable(b))throw Za("At least one callback required");return O(m,c,t)?(a=O(h,c,t),isCallable(o)&&(a=o(a),O(v,c,t,a))):isCallable(b)&&(a=b(),O(v,c,t,a)),a};_export({target:"Map",proto:!0,real:!0,forced:!0},{upsert:es}),_export({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:es});var ts=Wa,rs=entryVirtual("Array").concat,ns=Array.prototype,concat=function(t){var o=t.concat;return t===ns||K(ns,t)&&o===ns.concat?rs:o},os=/MSIE .\./.test(H),is=h.Function,wrap=function(t){return os?function(o,a){var c=validateArgumentsLength(arguments.length,1)>2,h=isCallable(o)?o:is(o),m=c?ht(arguments,2):void 0;return t(c?function(){w(h,this,m)}:h,a)}:t},as={setTimeout:wrap(h.setTimeout),setInterval:wrap(h.setInterval)},ss=as.setInterval;_export({global:!0,bind:!0,forced:h.setInterval!==ss},{setInterval:ss});var cs=as.setTimeout;_export({global:!0,bind:!0,forced:h.setTimeout!==cs},{setTimeout:cs});var us=z.setTimeout,ls=kr.map,fs=arrayMethodHasSpeciesSupport("map");_export({target:"Array",proto:!0,forced:!fs},{map:function map(t){return ls(this,t,arguments.length>1?arguments[1]:void 0)}});var ps=entryVirtual("Array").map,ds=Array.prototype,map=function(t){var o=t.map;return t===ds||K(ds,t)&&o===ds.map?ps:o},hs=createCommonjsModule((function(t){var o=Object.prototype.hasOwnProperty,a="~";function Events(){}function EE(t,o,a){this.fn=t,this.context=o,this.once=a||!1}function addListener(t,o,c,h,m){if("function"!=typeof c)throw new TypeError("The listener must be a function");var v=new EE(c,h||t,m),b=a?a+o:o;return t._events[b]?t._events[b].fn?t._events[b]=[t._events[b],v]:t._events[b].push(v):(t._events[b]=v,t._eventsCount++),t}function clearEvent(t,o){0==--t._eventsCount?t._events=new Events:delete t._events[o]}function EventEmitter(){this._events=new Events,this._eventsCount=0}Object.create&&(Events.prototype=Object.create(null),(new Events).__proto__||(a=!1)),EventEmitter.prototype.eventNames=function eventNames(){var t,c,h=[];if(0===this._eventsCount)return h;for(c in t=this._events)o.call(t,c)&&h.push(a?c.slice(1):c);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(t)):h},EventEmitter.prototype.listeners=function listeners(t){var o=a?a+t:t,c=this._events[o];if(!c)return[];if(c.fn)return[c.fn];for(var h=0,m=c.length,v=new Array(m);h<m;h++)v[h]=c[h].fn;return v},EventEmitter.prototype.listenerCount=function listenerCount(t){var o=a?a+t:t,c=this._events[o];return c?c.fn?1:c.length:0},EventEmitter.prototype.emit=function emit(t,o,c,h,m,v){var b=a?a+t:t;if(!this._events[b])return!1;var x,w,S=this._events[b],k=arguments.length;if(S.fn){switch(S.once&&this.removeListener(t,S.fn,void 0,!0),k){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,o),!0;case 3:return S.fn.call(S.context,o,c),!0;case 4:return S.fn.call(S.context,o,c,h),!0;case 5:return S.fn.call(S.context,o,c,h,m),!0;case 6:return S.fn.call(S.context,o,c,h,m,v),!0}for(w=1,x=new Array(k-1);w<k;w++)x[w-1]=arguments[w];S.fn.apply(S.context,x)}else{var _,T=S.length;for(w=0;w<T;w++)switch(S[w].once&&this.removeListener(t,S[w].fn,void 0,!0),k){case 1:S[w].fn.call(S[w].context);break;case 2:S[w].fn.call(S[w].context,o);break;case 3:S[w].fn.call(S[w].context,o,c);break;case 4:S[w].fn.call(S[w].context,o,c,h);break;default:if(!x)for(_=1,x=new Array(k-1);_<k;_++)x[_-1]=arguments[_];S[w].fn.apply(S[w].context,x)}}return!0},EventEmitter.prototype.on=function on(t,o,a){return addListener(this,t,o,a,!1)},EventEmitter.prototype.once=function once(t,o,a){return addListener(this,t,o,a,!0)},EventEmitter.prototype.removeListener=function removeListener(t,o,c,h){var m=a?a+t:t;if(!this._events[m])return this;if(!o)return clearEvent(this,m),this;var v=this._events[m];if(v.fn)v.fn!==o||h&&!v.once||c&&v.context!==c||clearEvent(this,m);else{for(var b=0,x=[],w=v.length;b<w;b++)(v[b].fn!==o||h&&!v[b].once||c&&v[b].context!==c)&&x.push(v[b]);x.length?this._events[m]=1===x.length?x[0]:x:clearEvent(this,m)}return this},EventEmitter.prototype.removeAllListeners=function removeAllListeners(t){var o;return t?(o=a?a+t:t,this._events[o]&&clearEvent(this,o)):(this._events=new Events,this._eventsCount=0),this},EventEmitter.prototype.off=EventEmitter.prototype.removeListener,EventEmitter.prototype.addListener=EventEmitter.prototype.on,EventEmitter.prefixed=a,EventEmitter.EventEmitter=EventEmitter,t.exports=EventEmitter})),ms=Backoff;function Backoff(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var o=Math.random(),a=Math.floor(o*this.jitter*t);t=0==(1&Math.floor(10*o))?t-a:t+a}return 0|Math.min(t,this.max)},Backoff.prototype.reset=function(){this.attempts=0},Backoff.prototype.setMin=function(t){this.ms=t},Backoff.prototype.setMax=function(t){this.max=t},Backoff.prototype.setJitter=function(t){this.jitter=t};var gs="object"==typeof t&&t&&t.Object===Object&&t,vs="object"==typeof self&&self&&self.Object===Object&&self,ys=gs||vs||Function("return this")(),bs=ys.Symbol,xs=Object.prototype,ws=xs.hasOwnProperty,Ss=xs.toString,ks=bs?bs.toStringTag:void 0;var _s=function getRawTag(t){var o=ws.call(t,ks),a=t[ks];try{t[ks]=void 0;var c=!0}catch(t){}var h=Ss.call(t);return c&&(o?t[ks]=a:delete t[ks]),h},Ts=Object.prototype.toString;var Cs=function objectToString(t){return Ts.call(t)},Ms=bs?bs.toStringTag:void 0;var Es=function baseGetTag(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":Ms&&Ms in Object(t)?_s(t):Cs(t)};var Os=function isObject(t){var o=typeof t;return null!=t&&("object"==o||"function"==o)};var Ps=function isFunction(t){if(!Os(t))return!1;var o=Es(t);return"[object Function]"==o||"[object GeneratorFunction]"==o||"[object AsyncFunction]"==o||"[object Proxy]"==o},Is={deviceId:"",timeout:8e3},As={account:"",appkey:"",token:"",debugLevel:"off",needReconnect:!0,reconnectionAttempts:Sa,isAbtestEnable:!0,abtestUrl:"https://abt-online.netease.im/v1/api/abt/client/getExperimentInfo",abtestProjectKey:"imElite_sdk_abtest_web"},js=Je.includes,Rs=fails((function(){return!Array(1).includes()}));_export({target:"Array",proto:!0,forced:Rs},{includes:function includes(t){return js(this,t,arguments.length>1?arguments[1]:void 0)}});var Ls=entryVirtual("Array").includes,Fs=wellKnownSymbol("match"),Ns=TypeError,notARegexp=function(t){if(function(t){var o;return q(t)&&(void 0!==(o=t[Fs])?!!o:"RegExp"==classofRaw(t))}(t))throw Ns("The method doesn't accept regular expressions");return t},Us=wellKnownSymbol("match"),Ds=C("".indexOf);_export({target:"String",proto:!0,forced:!function(t){var o=/./;try{"/./"[t](o)}catch(a){try{return o[Us]=!1,"/./"[t](o)}catch(t){}}return!1}("includes")},{includes:function includes(t){return!!~Ds(toString$1(requireObjectCoercible(this)),toString$1(notARegexp(t)),arguments.length>1?arguments[1]:void 0)}});var Bs=entryVirtual("String").includes,qs=Array.prototype,zs=String.prototype,includes=function(t){var o=t.includes;return t===qs||K(qs,t)&&o===qs.includes?Ls:"string"==typeof t||t===zs||K(zs,t)&&o===zs.includes?Bs:o},Ks=kr.findIndex,Hs="findIndex",Gs=!0;Hs in[]&&Array(1).findIndex((function(){Gs=!1})),_export({target:"Array",proto:!0,forced:Gs},{findIndex:function findIndex(t){return Ks(this,t,arguments.length>1?arguments[1]:void 0)}});var $s=entryVirtual("Array").findIndex,Ws=Array.prototype,findIndex=function(t){var o=t.findIndex;return t===Ws||K(Ws,t)&&o===Ws.findIndex?$s:o},Vs=createCommonjsModule((function(t){function _getPrototypeOf(o){var a;return t.exports=_getPrototypeOf=dt?bind$1(a=ao).call(a):function _getPrototypeOf(t){return t.__proto__||ao(t)},t.exports.__esModule=!0,t.exports.default=t.exports,_getPrototypeOf(o)}t.exports=_getPrototypeOf,t.exports.__esModule=!0,t.exports.default=t.exports})),Qs=Je.indexOf,Js=C([].indexOf),Xs=!!Js&&1/Js([1],1,-0)<0,Ys=arrayMethodIsStrict("indexOf");_export({target:"Array",proto:!0,forced:Xs||!Ys},{indexOf:function indexOf(t){var o=arguments.length>1?arguments[1]:void 0;return Xs?Js(this,t,o)||0:Qs(this,t,o)}});var Zs=entryVirtual("Array").indexOf,ec=Array.prototype,indexOf=function(t){var o=t.indexOf;return t===ec||K(ec,t)&&o===ec.indexOf?Zs:o},tc=createCommonjsModule((function(t){t.exports=function _isNativeFunction(t){var o;return-1!==indexOf(o=Function.toString.call(t)).call(o,"[native code]")},t.exports.__esModule=!0,t.exports.default=t.exports})),rc=getBuiltIn("Reflect","construct"),nc=Object.prototype,oc=[].push,ic=fails((function(){function F(){}return!(rc((function(){}),[],F)instanceof F)})),ac=!fails((function(){rc((function(){}))})),sc=ic||ac;_export({target:"Reflect",stat:!0,forced:sc,sham:sc},{construct:function construct(t,o){aConstructor(t),anObject(o);var a=arguments.length<3?t:aConstructor(arguments[2]);if(ac&&!ic)return rc(t,o,a);if(t==a){switch(o.length){case 0:return new t;case 1:return new t(o[0]);case 2:return new t(o[0],o[1]);case 3:return new t(o[0],o[1],o[2]);case 4:return new t(o[0],o[1],o[2],o[3])}var c=[null];return w(oc,c,o),new(w(bt,t,c))}var h=a.prototype,m=st(q(h)?h:nc),v=w(t,m,o);return q(v)?v:m}});var cc=z.Reflect.construct,uc=createCommonjsModule((function(t){t.exports=function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!cc)return!1;if(cc.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(cc(Boolean,[],(function(){}))),!0}catch(t){return!1}},t.exports.__esModule=!0,t.exports.default=t.exports})),lc=createCommonjsModule((function(t){function _construct(o,a,c){var h;uc()?(t.exports=_construct=bind$1(h=cc).call(h),t.exports.__esModule=!0,t.exports.default=t.exports):(t.exports=_construct=function _construct(t,o,a){var c=[null];c.push.apply(c,o);var h=new(bind$1(Function).apply(t,c));return a&&St(h,a.prototype),h},t.exports.__esModule=!0,t.exports.default=t.exports);return _construct.apply(null,arguments)}t.exports=_construct,t.exports.__esModule=!0,t.exports.default=t.exports})),fc=createCommonjsModule((function(t){function _wrapNativeSuper(o){var a="function"==typeof ts?new ts:void 0;return t.exports=_wrapNativeSuper=function _wrapNativeSuper(t){if(null===t||!tc(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==a){if(a.has(t))return a.get(t);a.set(t,Wrapper)}function Wrapper(){return lc(t,arguments,Vs(this).constructor)}return Wrapper.prototype=ut(t.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),St(Wrapper,t)},t.exports.__esModule=!0,t.exports.default=t.exports,_wrapNativeSuper(o)}t.exports=_wrapNativeSuper,t.exports.__esModule=!0,t.exports.default=t.exports})),pc=function(t){function CustomError(o,a,c){var h;return void 0===a&&(a={}),void 0===c&&(c=400),(h=t.call(this,o)||this).data=a,h.code=c,h.name="customError",h}return kt(CustomError,t),CustomError}(getDefaultExportFromCjs(fc)(Error)),dc=function(t){function ValidateError(o,a,c){var h;return void 0===a&&(a={}),(h=t.call(this,o,a,414)||this).code=414,h.name="validateError",h.rules=c,h}return kt(ValidateError,t),ValidateError}(pc),hc={200:null,406:null,808:null,810:null,201:"The client version is incorrect. You need to upgrade the SDK",302:"The user name or password is incorrect. Please check whether the appkey and token are valid and whether the account and token match",403:"Illegal operation or no permission",404:"Target object does not exist",405:"Parameter length too long",408:"Client request timed out",414:"Request parameter error",415:"Service unavailable",416:"Frequency control",417:"Repeat operation",422:"Account disabled",500:"Server internal error",503:"Server busy",508:"Expiration date",509:"Invalid",7101:"Be pulled black",700:"Partial failure of batch operation",801:"The number of people in the team has reached the upper limit",802:"No permission",803:"The team does not exist or has not changed",804:"The user is not in the team",805:"Team type mismatch",806:"The number of teams created has reached the limit",807:"Team member not valid",809:"Already in the team",811:"The number of accounts in the forced push list exceeds the limit",812:"The team is muted",813:"Due to the limited number of team, some pull people successfully",814:"Disable team message read service",815:"Maximum number of team administrators",816:"Batch operation partial failure",997:"The packet has expired",998:"Deserialize packet error",999:"Serialize packet error",9102:"Channel failure",9103:"This call has been answered / rejected at another end",10201:"Signaling: target NIM client is offline",10202:"Signaling: push is unreachable",10404:"Signaling: channel not exists",10405:"Signaling: channel already exists",10406:"Signaling: member of channel not exists",10407:"Signaling: member of channel already exists",10408:"Signaling: the invitation request does not exist or has expired",10409:"Signaling: the invitation request has been rejected",10410:"Signaling: the invitation request has been accepted",10414:"Signaling: request parameter error",10417:"Signaling: uid conflict",10419:"Signaling: the number of members of channel exceed the limit",10420:"Signaling: member is already in the channel on other client",10700:"Signaling: phased success",13002:"Abnormal chatroom status",13003:"In the blacklist",13004:"In the mute list",13006:"All members are muted, and only the administrator can speak"},mc=function(t){function CmdError(o,a,c,h,m){var v;return void 0===c&&(c=""),void 0===h&&(h=(new Date).getTime()),void 0===m&&(m={}),c=c||hc[o],(v=t.call(this,c,m,o)||this).name="cmdError",v.cmd=a,v.timetag=h,v}return kt(CmdError,t),CmdError}(pc);var gc=function(t){function UploadError(o,a,c,h,m){var v;return(v=t.call(this,o,{file:m},400)||this).name="uploadError",v.rawError=a,v.curProvider=c||1,v.mixStorePolicy=h,v}return kt(UploadError,t),UploadError}(pc),vc=["error","warn","log","debug"],yc=function emptyFunc(){},bc=["off","error","warn","log","debug"],xc=function(){function Logger(t,o){this.name=o,this.strategies={debug:console.log,log:console.log,warn:console.warn,error:console.error},this.debug=yc,this.log=yc,this.warn=yc,this.error=yc,this.name=o,Logger.instancesName.push(o),includes(bc).call(bc,t)||(t="off"),this.setLogFunc(t)}var t=Logger.prototype;return t.setLogFunc=function setLogFunc(t){var o=this,a=findIndex(vc).call(vc,(function(o){return o===t}));forEach$1(vc).call(vc,(function(t,c){c<=a&&(o[t]=function(){var o=slice(Array.prototype).call(arguments),a=this.formatArgs(o,t);this.strategies[t](a)})}))},t.formatArgs=function formatArgs(t,o){var a=new Date,c=a.getMonth()+1+"-"+a.getDate()+" "+a.getHours()+":"+a.getMinutes()+":"+a.getSeconds()+":"+a.getMilliseconds();return"[NIM "+o+" "+this.name+" "+c+"] "+map(t).call(t,(function(t){return t instanceof pc?t.name+", "+t.code+", "+t.message:t instanceof Error?t&&t.message?t.message:t:"object"==typeof t?Aa(t):t})).join(" ")},Logger}();xc.instancesName=[];var wc=createCommonjsModule((function(t,o){t.exports=function(){function _classCallCheck(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,o){for(var a=0;a<o.length;a++){var c=o[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}function _createClass(t,o,a){return o&&_defineProperties(t.prototype,o),a&&_defineProperties(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}function __rest(t,o){var a={};for(var c in t)Object.prototype.hasOwnProperty.call(t,c)&&o.indexOf(c)<0&&(a[c]=t[c]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var h=0;for(c=Object.getOwnPropertySymbols(t);h<c.length;h++)o.indexOf(c[h])<0&&Object.prototype.propertyIsEnumerable.call(t,c[h])&&(a[c[h]]=t[c[h]])}return a}var t={reportUrl:"https://statistic.live.126.net/statics/report/common/form",maxSize:100,msgListMaxSize:1e3,cacheMaxSize:1e3,maxDelay:3e5,maxInterval:3e4,minInterval:1e4,timeout:5e3,autoStart:!0},o="https://statistic.live.126.net/dispatcher/req",a=function emptyFn(){},c=function(){function Reporter(o){_classCallCheck(this,Reporter),this.enable=!1,this.initConfigLoaded=!1,this.loading=!1,this.isDestroyed=!1,this.reportConfig=t,this.msgList=[],this.traceMsgCache={},this.lowPriorityMsgList=[],this.cacheMsgList=[],this.lastReportTime=Date.now(),this.timer=null,this.setConfig(o),this.reportConfig.autoStart&&this.initUploadConfig()}return _createClass(Reporter,[{key:"setConfig",value:function setConfig(t){this.reportConfig=Object.assign({},this.reportConfig,t)}},{key:"reportImmediately",value:function reportImmediately(t,o){var a=this;this.reportConfig.request(t,Object.assign({dataType:"json",method:"POST",timeout:this.reportConfig.timeout},o)).catch((function(t){var o,c;null===(c=null===(o=a.reportConfig)||void 0===o?void 0:o.logger)||void 0===c||c.warn("Reporter immediately upload failed",t)}))}},{key:"report",value:function report(t,o){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(t){var c=Date.now();a?this.lowPriorityMsgList.push({module:t,msg:o,createTime:c}):this.msgList.push({module:t,msg:o,createTime:c}),this.msgList.length>this.reportConfig.msgListMaxSize&&this.msgList.shift(),this.lowPriorityMsgList.length>this.reportConfig.msgListMaxSize&&this.lowPriorityMsgList.shift(),this.doReport()}}},{key:"reportTraceStart",value:function reportTraceStart(t,o){if(t&&!this.traceMsgCache[t]){var a=Object.assign(Object.assign({start_time:Date.now()},o),{extension:[]});this.traceMsgCache[t]=a}}},{key:"reportTraceUpdate",value:function reportTraceUpdate(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.traceMsgCache[t]){var c,h=o.operation_type,m=o.code,v=o.target,b=o.error,x=__rest(o,["operation_type","code","target","error"]),w=Date.now(),S=this.traceMsgCache[t].extension.length;c=0===S?this.traceMsgCache[t].start_time:this.traceMsgCache[t].extension[S-1].end_time,b&&b.code&&(m=b.code),this.traceMsgCache[t].extension.push({operation_type:h,code:m,succeed:a,target:v,duration:w-c,description:JSON.stringify(x),end_time:w})}}},{key:"reportTraceUpdateV2",value:function reportTraceUpdateV2(t,o){if(this.traceMsgCache[t]){var a=this.traceMsgCache[t].extension.length;o.end_time=0===a?this.traceMsgCache[t].start_time+(o.duration?o.duration:0):this.traceMsgCache[t].extension[a-1].end_time+(o.duration?o.duration:0),this.traceMsgCache[t].extension.push(o)}}},{key:"reportTraceEnd",value:function reportTraceEnd(t){var o=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.traceMsgCache[t]&&("nos"!==t||!1===o?("boolean"==typeof o?this.traceMsgCache[t].succeed=!!o:this.traceMsgCache[t].state=o,this.traceMsgCache[t].duration=Date.now()-this.traceMsgCache[t].start_time,this.traceMsgCache[t].extension.forEach((function(t){delete t.end_time})),this.report(t,this.traceMsgCache[t]),this.traceMsgCache[t]=null):this.traceMsgCache[t]=null)}},{key:"pause",value:function pause(){this.enable=!1}},{key:"restore",value:function restore(){this.enable=!0,this.initConfigLoaded||this.initUploadConfig()}},{key:"destroy",value:function destroy(){var t=this;Object.keys(this.traceMsgCache).forEach((function(o){t.reportTraceEnd(o,1)})),null!==this.timer&&clearTimeout(this.timer),this.setConfig=a,this.report=a,this.reportTraceStart=a,this.reportTraceUpdate=a,this.reportTraceEnd=a,this.pause=a,this.restore=a,this.destroy=a,this.cacheMsgList=[],this.traceMsgCache={},this.lowPriorityMsgList=[],this.msgList=[],this.reportConfig={},this.isDestroyed=!0}},{key:"initUploadConfig",value:function initUploadConfig(){var t,a,c=this;if(!this.loading){this.loading=!0;var h=this.reportConfig.common||{};try{this.reportConfig.request(o,{method:"GET",dataType:"json",params:{deviceId:h.dev_id,sdkVer:h.sdk_ver,platform:h.platform,appkey:h.app_key},timeout:this.reportConfig.timeout}).then((function(t){var o,a;if(!c.isDestroyed){if(200===t.status&&t.data&&200===t.data.code){var h=t.data.data||{};c.reportConfig.maxSize=h.maxSize>1e3?1e3:h.maxSize,c.reportConfig.maxInterval=h.maxInterval>1e4?1e4:h.maxInterval,c.reportConfig.maxInterval=h.maxInterval<10?10:h.maxInterval,c.reportConfig.minInterval=h.minInterval<2?2:h.minInterval,c.reportConfig.maxDelay=h.maxDelay||300,c.reportConfig.maxInterval=1e3*c.reportConfig.maxInterval,c.reportConfig.minInterval=1e3*c.reportConfig.minInterval,c.reportConfig.maxDelay=1e3*c.reportConfig.maxDelay,c.enable=!0,c.initConfigLoaded=!0,c.loading=!1,c.reportHeartBeat()}null===(a=null===(o=c.reportConfig)||void 0===o?void 0:o.logger)||void 0===a||a.log("Get reporter upload config success")}})).catch((function(t){var o,a;c.loading=!1,null===(a=null===(o=c.reportConfig)||void 0===o?void 0:o.logger)||void 0===a||a.error("Get reporter upload config failed",t)}))}catch(o){this.loading=!1,null===(a=null===(t=this.reportConfig)||void 0===t?void 0:t.logger)||void 0===a||a.error("Exec reporter request failed",o)}}}},{key:"reportHeartBeat",value:function reportHeartBeat(){var t=this;this.isDestroyed||(this.timer=setTimeout((function(){t.reportHeartBeat()}),this.reportConfig.minInterval),this.doReport())}},{key:"doReport",value:function doReport(){if(!this.isDestroyed){var t=this.msgList.length+this.lowPriorityMsgList.length+this.cacheMsgList.length>2*this.reportConfig.maxSize?this.reportConfig.minInterval:this.reportConfig.maxInterval;Date.now()-this.lastReportTime>=t&&this.upload()}}},{key:"getUploadMsg",value:function getUploadMsg(){var t=this,o={},a=Date.now();this.msgList=this.msgList.filter((function(o){return a-o.createTime<t.reportConfig.maxDelay})),this.lowPriorityMsgList=this.lowPriorityMsgList.filter((function(o){return a-o.createTime<t.reportConfig.maxDelay})),this.cacheMsgList=this.cacheMsgList.filter((function(o){return a-o.createTime<t.reportConfig.maxDelay}));var c=this.msgList.slice(0,this.reportConfig.maxSize);if(this.msgList=this.msgList.slice(c.length),c.length<this.reportConfig.maxSize){var h=this.reportConfig.maxSize-c.length;c=c.concat(this.lowPriorityMsgList.slice(0,h)),this.lowPriorityMsgList=this.lowPriorityMsgList.slice(h)}if(c.length<this.reportConfig.maxSize){var m=this.reportConfig.maxSize-c.length;c=c.concat(this.cacheMsgList.slice(0,m)),this.cacheMsgList=this.cacheMsgList.slice(m)}return c.forEach((function(t){o[t.module]?o[t.module].push(t.msg):o[t.module]=[t.msg]})),{uploadMsgArr:c,uploadMsg:o}}},{key:"upload",value:function upload(){var t,o,a=this;if(this.enable&&!(this.lastReportTime&&Date.now()-this.lastReportTime<this.reportConfig.minInterval)){var c=this.getUploadMsg(),h=c.uploadMsgArr,m=c.uploadMsg;if(h.length){this.lastReportTime=Date.now();try{this.reportConfig.request(this.reportConfig.reportUrl,{dataType:"json",method:"POST",params:{common:this.reportConfig.common,event:m},headers:{sdktype:"im"},timeout:this.reportConfig.timeout}).catch((function(t){var o,c;a.cacheMsgList=a.cacheMsgList.concat(h).slice(0,a.reportConfig.cacheMaxSize),null===(c=null===(o=a.reportConfig)||void 0===o?void 0:o.logger)||void 0===c||c.warn("Reporter upload failed",t)}))}catch(a){null===(o=null===(t=this.reportConfig)||void 0===t?void 0:t.logger)||void 0===o||o.warn("Exec reporter request failed",a)}clearTimeout(this.timer),this.reportHeartBeat()}}}}]),Reporter}();return c}()})),Sc={setLogger:function setLogger(t){throw new Error("Function not implemented.")},platform:"",WebSocket:function(){function AdapterSocket(t,o){throw this.CONNECTING=0,this.OPEN=1,this.CLOSING=2,this.CLOSED=3,new Error("Method not implemented.")}var t=AdapterSocket.prototype;return t.close=function close(t,o){throw new Error("Method not implemented.")},t.send=function send(t){throw new Error("Method not implemented.")},t.onclose=function onclose(t){throw new Error("Method not implemented.")},t.onerror=function onerror(t){throw new Error("Method not implemented.")},t.onmessage=function onmessage(t){throw new Error("Method not implemented.")},t.onopen=function onopen(t){throw new Error("Method not implemented.")},AdapterSocket}(),localStorage:{},request:function request(t,o){throw new Error("Function not implemented.")},uploadFile:function uploadFile(t){throw new Error("Function not implemented.")},getSystemInfo:function getSystemInfo(){throw new Error("Function not implemented.")}};var kc=TypeError,createMethod$1=function(t){return function(o,a,c,h){aCallable(a);var m=toObject(o),v=U(m),b=lengthOfArrayLike(m),x=t?b-1:0,w=t?-1:1;if(c<2)for(;;){if(x in v){h=v[x],x+=w;break}if(x+=w,t?x<0:b<=x)throw kc("Reduce of empty array with no initial value")}for(;t?x>=0:b>x;x+=w)x in v&&(h=a(h,v[x],x,m));return h}},_c={left:createMethod$1(!1),right:createMethod$1(!0)}.left,Tc=arrayMethodIsStrict("reduce");_export({target:"Array",proto:!0,forced:!Tc||!Fo&&J>79&&J<83},{reduce:function reduce(t){var o=arguments.length;return _c(this,t,o,o>1?arguments[1]:void 0)}});var Cc=entryVirtual("Array").reduce,Mc=Array.prototype,reduce=function(t){var o=t.reduce;return t===Mc||K(Mc,t)&&o===Mc.reduce?Cc:o},Ec=fails((function(){tt(1)}));_export({target:"Object",stat:!0,forced:Ec},{keys:function keys(t){return tt(toObject(t))}});var Oc=z.Object.keys;var Pc=function isUndefined(t){return void 0===t},Ic={},Ac={};function parseCmd(t,o){var a,c,h;try{h=JSON.parse(t)}catch(a){throw o.error("Parse command error: ",t),a}var m=h.sid+"_"+h.cid,v=h.r;if(includes(a=["4_1","4_2","4_10","4_11"]).call(a,m)){var b=h.r[1].headerPacket;m=b.sid+"_"+b.cid,v=h.r[1].body}var x,w=Ac[m],S=Ic[w],k=function genCmdError(t,o){var a=hc[t];return null===a?null:new mc(t,o,a,(new Date).getTime())}(h.code,w),_={cmd:w,raw:h,error:k,service:null==S?void 0:S.service,content:{}};if(_.error){if(_.error.cmd=w,_.error.callFunc="parseCmd",!(null===(c=null==S?void 0:S.ignoreErrCodes)||void 0===c?void 0:includes(c).call(c,h.code)))return _;o.warn("parseCmd:: ignore error ",_.error),_.error.ignore=!0}if(!w||!S)return _.notFound=!0,_;S.response&&forEach$1(x=S.response).call(x,(function(t,o){var a=v[o],c=t.type,h=t.name,m=t.reflectMapper;if(!Pc(a))switch(c){case"Property":_.content[h]=m?deserialize(a,m):a;break;case"PropertyArray":_.content[h]=map(a).call(a,(function(t){return m?deserialize(t,m):t}));break;case"long":case"Long":case"byte":case"Byte":case"Number":_.content[h]=+a;break;default:_.content[h]=a}}));return _}function serialize(t,o){var a={};for(var c in t)void 0!==o[c]&&(a[o[c]]=t[c]);return a}function deserialize(t,o){var a={};for(var c in t)void 0!==o[c]&&(a[o[c]]=t[c]);return a}function registerParser(t){Ic=Ma(Ic,t.cmdConfig),Ac=Ma(Ac,t.cmdMap)}function invertSerializeMap(t){var o;return reduce(o=Oc(t)).call(o,(function(o,a){var c,h=t[a];return o[a]=reduce(c=Oc(h)).call(c,(function(t,o){return t[h[o]]=o,t}),{}),o}),{})}var jc=["disconnect","connect","heartbeat","message","json","event","ack","error","noop"],Rc=["transport not supported","client not handshaken","unauthorized"],Lc=["reconnect"],Fc=function(t){function NIMWebsocket(o,a,c){var h;return(h=t.call(this)||this).url=a,h.logger=c,h.websocket=null,h.core=o,h.url=a,h.status="disconnected",h.logger=c,h.connect(),h}kt(NIMWebsocket,t);var o=NIMWebsocket.prototype;return o.connect=function connect(){var t=this;"connecting"!==this.status&&"connected"!==this.status?(this.status="connecting",this.core.adapters.request("https://"+this.url+"/socket.io/1/?t="+Pa(),{method:"GET",dataType:"text",timeout:8e3}).then((function(o){var a=o.data.split(":"),c=a[0],h=a[1];return t.sessionId=c,t.closeTimeout=1e3*h,t._createWebsocket("wss://"+t.url+"/socket.io/1/websocket/"+c)})).catch((function(o){t.logger.error("imsocket::handshake fail. ",o&&o.message),t.status="disconnected",t.emit("handshakeFailed")}))):this.logger.warn("imsocket::socket is connecting or connected",this.status)},o.close=function close(){var t;if(this.websocket){this.status="disconnected",this.websocket.onmessage=null,this.websocket.onopen=null,this.websocket.onerror=null;try{null===(t=this.websocket)||void 0===t||t.send(this.encodePacket({type:"disconnect"})),this.websocket.close()}catch(t){this.logger.warn("attempt to close websocket error",t)}this.websocket.onclose=null,this.websocket=null,this.emit("disconnect")}},o.onConnect=function onConnect(){this.status="connected",this.resetCloseTimer(),this.emit("connect")},o._createWebsocket=function _createWebsocket(t){var o,a=this;this.websocket=new Sc.WebSocket(t),this.websocket.onmessage=bind$1(o=this.onMessage).call(o,this),this.websocket.onclose=function(){a.logger.log("imsocket:: websocket onclose done"),"disconnected"!==a.status&&(a.logger.log("imsocket:: close()",a.status),a.close())},this.websocket.onerror=function(t){a.logger.error("imsocket:: onerror",t)}},o.onMessage=function onMessage(t){var o;this.resetCloseTimer();var a=this.decodePacket(t.data);if(a)switch(a.type){case"connect":this.onConnect();break;case"disconnect":this.close();break;case"message":case"json":this.emit("message",a.data);break;case"event":a.name&&this.emit(a.name,a.args);break;case"error":"unauthorized"===a.reason?this.emit("connect_failed",a.reason):this.emit("error",a.reason);break;case"heartbeat":null===(o=this.websocket)||void 0===o||o.send(this.encodePacket({type:"heartbeat"}));break;default:this.logger.warn("imsocket::no handler type",a.type)}},o.encodePacket=function encodePacket(t){var o,a,c=t.type,h=t.id,m=void 0===h?"":h,v=t.endpoint,b=void 0===v?"":v,x=t.ack,w=null;if(!c)return"";switch(c){case"error":o=t.reason?indexOf(Rc).call(Rc,t.reason):"",a=t.advice?indexOf(Lc).call(Lc,t.advice):"",""===o&&""===a||(w=o+(""!==a?"+"+a:""));break;case"message":""!==t.data&&(w=t.data);break;case"event":o={name:t.name},o=t.args&&t.args.length?{name:t.name,args:t.args}:{name:t.name},w=Aa(o);break;case"json":w=Aa(t.data);break;case"connect":t.qs&&(w=t.qs);break;case"ack":w=t.ackId+(t.args&&t.args.length?"+"+Aa(t.args):"")}var S=[indexOf(jc).call(jc,c),m+("data"===x?"+":""),b];return null!=w&&S.push(w),S.join(":")},o.decodePacket=function decodePacket(t){if(t)if("�"!=t.charAt(0)){var o=t.match(/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/);if(o){var a,c=o[1],h=o[2],m=o[3],v=o[4],b=o[5],x={type:jc[+c],endpoint:v};switch(h&&(x.id=h,x.ack=!m||"data"),x.type){case"error":a=b.split("+"),x.reason=Rc[+a[0]]||"";break;case"message":x.data=b||"";break;case"connect":x.qs=b||"";break;case"event":try{var w=JSON.parse(b);x.name=w.name,x.args=w.args}catch(t){this.logger.error("imsocket::parseData::type::event error",t)}x.args=x.args||[];break;case"json":try{x.data=JSON.parse(b)}catch(t){this.logger.error("imsocket::parseData::type::json error",t)}break;case"ack":if((a=b.match(/^([0-9]+)(\+)?(.*)/))&&(x.ackId=a[1],x.args=[],a[3]))try{x.args=a[3]?JSON.parse(a[3]):[]}catch(t){this.logger.error("imsocket::parseData::type::ack error",t)}}return x}}else this.logger.error("imsocket::unrecognize dataStr",slice(t).call(t,0,20))},o.send=function send(t){var o,a={data:t,type:"message",endpoint:""};null===(o=this.websocket)||void 0===o||o.send(this.encodePacket(a))},o.resetCloseTimer=function resetCloseTimer(){var t=this;this.closeTimeout&&(clearTimeout(this.closeTimer),this.closeTimer=us((function(){t.close()}),this.closeTimeout))},NIMWebsocket}(hs),Nc=entryVirtual("Array").values,Uc=Array.prototype,Dc={DOMTokenList:!0,NodeList:!0},values=function(t){var o=t.values;return t===Uc||K(Uc,t)&&o===Uc.values||le(Dc,It(t))?Nc:o};_export({target:"Array",stat:!0},{isArray:_t});var Bc=z.Array.isArray,qc=kr.every,zc=arrayMethodIsStrict("every");_export({target:"Array",proto:!0,forced:!zc},{every:function every(t){return qc(this,t,arguments.length>1?arguments[1]:void 0)}});var Kc=entryVirtual("Array").every,Hc=Array.prototype,every=function(t){var o=t.every;return t===Hc||K(Hc,t)&&o===Hc.every?Kc:o};var Gc=function isObjectLike(t){return null!=t&&"object"==typeof t};var $c=function baseIsRegExp(t){return Gc(t)&&"[object RegExp]"==Es(t)};var Wc=function baseUnary(t){return function(o){return t(o)}},Vc=createCommonjsModule((function(t,o){var a=o&&!o.nodeType&&o,c=a&&t&&!t.nodeType&&t,h=c&&c.exports===a&&gs.process,m=function(){try{var t=c&&c.require&&c.require("util").types;return t||h&&h.binding&&h.binding("util")}catch(t){}}();t.exports=m})),Qc=Vc&&Vc.isRegExp,Jc=Qc?Wc(Qc):$c,Xc=ys["__core-js_shared__"],Yc=function(){var t=/[^.]+$/.exec(Xc&&Xc.keys&&Xc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();var Zc=function isMasked(t){return!!Yc&&Yc in t},eu=Function.prototype.toString;var tu=function toSource(t){if(null!=t){try{return eu.call(t)}catch(t){}try{return t+""}catch(t){}}return""},ru=/^\[object .+?Constructor\]$/,nu=Function.prototype,ou=Object.prototype,iu=nu.toString,au=ou.hasOwnProperty,su=RegExp("^"+iu.call(au).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var cu=function baseIsNative(t){return!(!Os(t)||Zc(t))&&(Ps(t)?su:ru).test(tu(t))};var uu=function getValue(t,o){return null==t?void 0:t[o]};var lu=function getNative(t,o){var a=uu(t,o);return cu(a)?a:void 0},fu=lu(Object,"create");var pu=function hashClear(){this.__data__=fu?fu(null):{},this.size=0};var du=function hashDelete(t){var o=this.has(t)&&delete this.__data__[t];return this.size-=o?1:0,o},hu=Object.prototype.hasOwnProperty;var mu=function hashGet(t){var o=this.__data__;if(fu){var a=o[t];return"__lodash_hash_undefined__"===a?void 0:a}return hu.call(o,t)?o[t]:void 0},gu=Object.prototype.hasOwnProperty;var vu=function hashHas(t){var o=this.__data__;return fu?void 0!==o[t]:gu.call(o,t)};var yu=function hashSet(t,o){var a=this.__data__;return this.size+=this.has(t)?0:1,a[t]=fu&&void 0===o?"__lodash_hash_undefined__":o,this};function Hash(t){var o=-1,a=null==t?0:t.length;for(this.clear();++o<a;){var c=t[o];this.set(c[0],c[1])}}Hash.prototype.clear=pu,Hash.prototype.delete=du,Hash.prototype.get=mu,Hash.prototype.has=vu,Hash.prototype.set=yu;var bu=Hash;var xu=function listCacheClear(){this.__data__=[],this.size=0};var wu=function eq(t,o){return t===o||t!=t&&o!=o};var Su=function assocIndexOf(t,o){for(var a=t.length;a--;)if(wu(t[a][0],o))return a;return-1},ku=Array.prototype.splice;var _u=function listCacheDelete(t){var o=this.__data__,a=Su(o,t);return!(a<0)&&(a==o.length-1?o.pop():ku.call(o,a,1),--this.size,!0)};var Tu=function listCacheGet(t){var o=this.__data__,a=Su(o,t);return a<0?void 0:o[a][1]};var Cu=function listCacheHas(t){return Su(this.__data__,t)>-1};var Mu=function listCacheSet(t,o){var a=this.__data__,c=Su(a,t);return c<0?(++this.size,a.push([t,o])):a[c][1]=o,this};function ListCache(t){var o=-1,a=null==t?0:t.length;for(this.clear();++o<a;){var c=t[o];this.set(c[0],c[1])}}ListCache.prototype.clear=xu,ListCache.prototype.delete=_u,ListCache.prototype.get=Tu,ListCache.prototype.has=Cu,ListCache.prototype.set=Mu;var Eu=ListCache,Ou=lu(ys,"Map");var Pu=function mapCacheClear(){this.size=0,this.__data__={hash:new bu,map:new(Ou||Eu),string:new bu}};var Iu=function isKeyable(t){var o=typeof t;return"string"==o||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==t:null===t};var Au=function getMapData(t,o){var a=t.__data__;return Iu(o)?a["string"==typeof o?"string":"hash"]:a.map};var ju=function mapCacheDelete(t){var o=Au(this,t).delete(t);return this.size-=o?1:0,o};var Ru=function mapCacheGet(t){return Au(this,t).get(t)};var Lu=function mapCacheHas(t){return Au(this,t).has(t)};var Fu=function mapCacheSet(t,o){var a=Au(this,t),c=a.size;return a.set(t,o),this.size+=a.size==c?0:1,this};function MapCache(t){var o=-1,a=null==t?0:t.length;for(this.clear();++o<a;){var c=t[o];this.set(c[0],c[1])}}MapCache.prototype.clear=Pu,MapCache.prototype.delete=ju,MapCache.prototype.get=Ru,MapCache.prototype.has=Lu,MapCache.prototype.set=Fu;var Nu=MapCache;var Uu=function setCacheAdd(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this};var Du=function setCacheHas(t){return this.__data__.has(t)};function SetCache(t){var o=-1,a=null==t?0:t.length;for(this.__data__=new Nu;++o<a;)this.add(t[o])}SetCache.prototype.add=SetCache.prototype.push=Uu,SetCache.prototype.has=Du;var Bu=SetCache;var qu=function baseFindIndex(t,o,a,c){for(var h=t.length,m=a+(c?1:-1);c?m--:++m<h;)if(o(t[m],m,t))return m;return-1};var zu=function baseIsNaN(t){return t!=t};var Ku=function strictIndexOf(t,o,a){for(var c=a-1,h=t.length;++c<h;)if(t[c]===o)return c;return-1};var Hu=function baseIndexOf(t,o,a){return o==o?Ku(t,o,a):qu(t,zu,a)};var Gu=function arrayIncludes(t,o){return!!(null==t?0:t.length)&&Hu(t,o,0)>-1};var $u=function arrayIncludesWith(t,o,a){for(var c=-1,h=null==t?0:t.length;++c<h;)if(a(o,t[c]))return!0;return!1};var Wu=function arrayMap(t,o){for(var a=-1,c=null==t?0:t.length,h=Array(c);++a<c;)h[a]=o(t[a],a,t);return h};var Vu=function cacheHas(t,o){return t.has(o)};var Qu=function baseDifference(t,o,a,c){var h=-1,m=Gu,v=!0,b=t.length,x=[],w=o.length;if(!b)return x;a&&(o=Wu(o,Wc(a))),c?(m=$u,v=!1):o.length>=200&&(m=Vu,v=!1,o=new Bu(o));e:for(;++h<b;){var S=t[h],k=null==a?S:a(S);if(S=c||0!==S?S:0,v&&k==k){for(var _=w;_--;)if(o[_]===k)continue e;x.push(S)}else m(o,k,c)||x.push(S)}return x};var Ju=function identity(t){return t};var Xu=function apply(t,o,a){switch(a.length){case 0:return t.call(o);case 1:return t.call(o,a[0]);case 2:return t.call(o,a[0],a[1]);case 3:return t.call(o,a[0],a[1],a[2])}return t.apply(o,a)},Yu=Math.max;var Zu=function overRest(t,o,a){return o=Yu(void 0===o?t.length-1:o,0),function(){for(var c=arguments,h=-1,m=Yu(c.length-o,0),v=Array(m);++h<m;)v[h]=c[o+h];h=-1;for(var b=Array(o+1);++h<o;)b[h]=c[h];return b[o]=a(v),Xu(t,this,b)}};var el=function constant(t){return function(){return t}},tl=function(){try{var t=lu(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),rl=tl?function(t,o){return tl(t,"toString",{configurable:!0,enumerable:!1,value:el(o),writable:!0})}:Ju,nl=Date.now;var ol=function shortOut(t){var o=0,a=0;return function(){var c=nl(),h=16-(c-a);if(a=c,h>0){if(++o>=800)return arguments[0]}else o=0;return t.apply(void 0,arguments)}},il=ol(rl);var al=function isLength(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991};var sl=function isArrayLike(t){return null!=t&&al(t.length)&&!Ps(t)};var cl=function isArrayLikeObject(t){return Gc(t)&&sl(t)},ul=function baseRest(t,o){return il(Zu(t,o,Ju),t+"")}((function(t,o){return cl(t)?Qu(t,o):[]})),ll=ul;function replacer(t,o){return o instanceof RegExp?"__REGEXP "+o.toString():o}function validate(t,o,a){var c;void 0===o&&(o={});var h={};return forEach$1(c=Oc(t)).call(c,(function(c){var m=t[c].type,v=a?"In "+a+", ":"";if(void 0===o[c]){if(!1===t[c].required)return void(h[c]=o[c]);throw new dc(v+'param "'+c+'" is required',{key:c},"required")}var b=fl[m];if(b&&!b(o,c,t[c]))throw new dc(v+'param "'+c+'" expects '+Aa(t[c],replacer),{key:c,value:o[c]},Aa(t[c]));h[c]=o[c]})),h}var fl={string:function string(t,o,a){var c=a.allowEmpty,h=a.max,m=a.min,v=a.regExp,b=t[o];return"string"==typeof b&&((!1!==c||""!==b)&&(!("number"==typeof h&&b.length>h)&&(!("number"==typeof m&&b.length<m)&&!(Jc(v)&&!v.test(b)))))},number:function number(t,o,a){var c=a.min,h=a.max,m=t[o];return"number"==typeof m&&(!("number"==typeof c&&m<c)&&!("number"==typeof h&&m>h))},boolean:function boolean(t,o){return"boolean"==typeof t[o]},enum:function _enum(t,o,a){var c=values(a),h=t[o];return!c||indexOf(c).call(c,h)>-1},array:function array(t,o,a){var c,h=a.itemType,m=a.rules,v=a.min,b=a.max,x=values(a),w=t[o];return!!Bc(w)&&(!("number"==typeof b&&w.length>b)&&(!("number"==typeof v&&w.length<v)&&(!(h&&"enum"!==h&&!every(w).call(w,(function(t){return typeof t===h})))&&(("enum"!==h||!x||!ll.apply(void 0,concat(c=[w]).call(c,x)).length)&&(m&&forEach$1(w).call(w,(function(t,a){return validate(m,t,o+"["+a+"]")})),!0)))))},object:function object(t,o,a){var c=a.rules,h=t[o];return c&&validate(c,h,o),!0}},pl=lu(ys,"Set");var dl=function noop(){};var hl=function setToArray(t){var o=-1,a=Array(t.size);return t.forEach((function(t){a[++o]=t})),a},ml=pl&&1/hl(new pl([,-0]))[1]==1/0?function(t){return new pl(t)}:dl,gl=ml;var vl=function baseUniq(t,o,a){var c=-1,h=Gu,m=t.length,v=!0,b=[],x=b;if(a)v=!1,h=$u;else if(m>=200){var w=o?null:gl(t);if(w)return hl(w);v=!1,h=Vu,x=new Bu}else x=o?[]:b;e:for(;++c<m;){var S=t[c],k=o?o(S):S;if(S=a||0!==S?S:0,v&&k==k){for(var _=x.length;_--;)if(x[_]===k)continue e;o&&x.push(k),b.push(S)}else h(x,k,a)||(x!==b&&x.push(k),b.push(S))}return b};var yl=function uniq(t){return t&&t.length?vl(t):[]},bl=kr.filter,xl=arrayMethodHasSpeciesSupport("filter");_export({target:"Array",proto:!0,forced:!xl},{filter:function filter(t){return bl(this,t,arguments.length>1?arguments[1]:void 0)}});var wl=entryVirtual("Array").filter,Sl=Array.prototype,filter=function(t){var o=t.filter;return t===Sl||K(Sl,t)&&o===Sl.filter?wl:o},kl="\t\n\v\f\r \u2028\u2029\ufeff",_l=C("".replace),Tl="["+kl+"]",Cl=RegExp("^"+Tl+Tl+"*"),Ml=RegExp(Tl+Tl+"*$"),createMethod=function(t){return function(o){var a=toString$1(requireObjectCoercible(o));return 1&t&&(a=_l(a,Cl,"")),2&t&&(a=_l(a,Ml,"")),a}},El={start:createMethod(1),end:createMethod(2),trim:createMethod(3)}.trim,Ol=h.parseInt,Pl=h.Symbol,Il=Pl&&Pl.iterator,Al=/^[+-]?0x/i,jl=C(Al.exec),Rl=8!==Ol(kl+"08")||22!==Ol(kl+"0x16")||Il&&!fails((function(){Ol(Object(Il))}))?function parseInt(t,o){var a=El(toString$1(t));return Ol(a,o>>>0||(jl(Al,a)?16:10))}:Ol;_export({global:!0,forced:parseInt!=Rl},{parseInt:Rl});var Ll,Fl=z.parseInt,Nl=(Ll=function _s4(){return(65536*(1+Math.random())|0).toString(16).substring(1)},function(){return Ll()+Ll()+Ll()+Ll()+Ll()+Ll()+Ll()+Ll()});function getEnumKeys(t){var o;return filter(o=Oc(t)).call(o,(function(t){return!(+t>=0)}))}function getEnumKeyByEnumValue(t,o){var a,c=filter(a=Oc(t)).call(a,(function(a){return t[a]==o}));return c.length>0?c[0]:void 0}var Ul=TypeError,Dl=Object.getOwnPropertyDescriptor,Bl=M&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,o){if(_t(t)&&!Dl(t,"length").writable)throw Ul("Cannot set read only .length");return t.length=o}:function(t,o){return t.length=o},ql=TypeError,deletePropertyOrThrow=function(t,o){if(!delete t[o])throw ql("Cannot delete property "+tryToString(o)+" of "+tryToString(t))},zl=arrayMethodHasSpeciesSupport("splice"),Kl=Math.max,Hl=Math.min;_export({target:"Array",proto:!0,forced:!zl},{splice:function splice(t,o){var a,c,h,m,v,b,x=toObject(this),w=lengthOfArrayLike(x),S=toAbsoluteIndex(t,w),k=arguments.length;for(0===k?a=c=0:1===k?(a=0,c=w-S):(a=k-2,c=Hl(Kl(toIntegerOrInfinity(o),0),w-S)),doesNotExceedSafeInteger(w+a-c),h=arraySpeciesCreate(x,c),m=0;m<c;m++)(v=S+m)in x&&createProperty(h,m,x[v]);if(h.length=c,a<c){for(m=S;m<w-c;m++)b=m+a,(v=m+c)in x?x[b]=x[v]:deletePropertyOrThrow(x,b);for(m=w;m>w-c+a;m--)deletePropertyOrThrow(x,m-1)}else if(a>c)for(m=w-c;m>S;m--)b=m+a-1,(v=m+c-1)in x?x[b]=x[v]:deletePropertyOrThrow(x,b);for(m=0;m<a;m++)x[m+S]=arguments[m+2];return Bl(x,w-c+a),h}});var Gl=entryVirtual("Array").splice,$l=Array.prototype,splice=function(t){var o=t.splice;return t===$l||K($l,t)&&o===$l.splice?Gl:o},callWithSafeIterationClosing=function(t,o,a,c){try{return c?o(anObject(a)[0],a[1]):o(a)}catch(o){iteratorClose(t,"throw",o)}},Wl=Array,Vl=!checkCorrectnessOfIteration((function(t){Array.from(t)}));_export({target:"Array",stat:!0,forced:Vl},{from:function from(t){var o=toObject(t),a=qt(this),c=arguments.length,h=c>1?arguments[1]:void 0,m=void 0!==h;m&&(h=functionBindContext(h,c>2?arguments[2]:void 0));var v,b,x,w,S,k,_=getIteratorMethod$5(o),T=0;if(!_||this===Wl&&isArrayIteratorMethod(_))for(v=lengthOfArrayLike(o),b=a?new this(v):Wl(v);v>T;T++)k=m?h(o[T],T):o[T],createProperty(b,T,k);else for(S=(w=getIterator(o,_)).next,b=a?new this:[];!(x=O(S,w)).done;T++)k=m?callWithSafeIterationClosing(w,h,[x.value,T],!0):x.value,createProperty(b,T,k);return b.length=T,b}});var Ql=z.Array.from,Jl=getIteratorMethod$5;function _createForOfIteratorHelperLoose(t,o){var a,c=void 0!==$n&&Jl(t)||t["@@iterator"];if(c)return bind$1(a=(c=c.call(t)).next).call(a,c);if(Bc(t)||(c=function _unsupportedIterableToArray(t,o){var a;if(!t)return;if("string"==typeof t)return _arrayLikeToArray(t,o);var c=slice(a=Object.prototype.toString.call(t)).call(a,8,-1);"Object"===c&&t.constructor&&(c=t.constructor.name);if("Map"===c||"Set"===c)return Ql(t);if("Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c))return _arrayLikeToArray(t,o)}(t))||o&&t&&"number"==typeof t.length){c&&(t=c);var h=0;return function(){return h>=t.length?{done:!0}:{done:!1,value:t[h++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _arrayLikeToArray(t,o){(null==o||o>t.length)&&(o=t.length);for(var a=0,c=new Array(o);a<o;a++)c[a]=t[a];return c}var Xl,Yl=function(){function TimerManager(){this.timerList=[],this.id=0,this.timer=null,this.timeout=0}var t=TimerManager.prototype;return t.addTimer=function addTimer(t,o,a){void 0===o&&(o=0),void 0===a&&(a=1);var c=(new Date).getTime(),h=this.id;return this.timerList.push({id:h,loop:a,count:0,timeout:c+o,interval:o,callback:t}),this.id++,this.checkTimer(c),h},t.checkTimer=function checkTimer(t){if(void 0===t&&(t=(new Date).getTime()),this.removeFinished(),0!==this.timerList.length||null==this.timer){for(var o,a,c=0,h=_createForOfIteratorHelperLoose(this.timerList);!(o=h()).done;){var m=o.value;(0===c||c>m.timeout)&&(c=m.timeout)}if(0!==this.timerList.length)if(null===this.timer||c<this.timeout||this.timeout<t)this.timer=us(bind$1(a=this.nowTime).call(a,this),c-t),this.timeout=c}},t.nowTime=function nowTime(){for(var t,nowTime=(new Date).getTime(),o=_createForOfIteratorHelperLoose(this.timerList);!(t=o()).done;){var a=t.value;nowTime>=a.timeout&&(a.callback(),a.count++,a.timeout=nowTime+a.interval)}this.clerTime(),this.checkTimer(nowTime)},t.clerTime=function clerTime(){null!==this.timer&&(clearTimeout(this.timer),this.timer=null)},t.deleteTimer=function deleteTimer(t){for(var o=this.timerList.length-1;o>=0;o--){var a;if(this.timerList[o].id===t)splice(a=this.timerList).call(a,o,1)}},t.removeFinished=function removeFinished(){for(var t=this.timerList.length-1;t>=0;t--){var o,a=this.timerList[t];if(a.loop>=0&&a.count>=a.loop)splice(o=this.timerList).call(o,t,1)}},t.destroy=function destroy(){this.clerTime(),this.timerList=[],this.id=0,this.timer=null},TimerManager}(),Zl=function(){function CoreAdapters(t){this.core=t}var t=CoreAdapters.prototype;return t.request=function request(t,o){var a=this,c=(new Date).getTime();return Sc.request(t,o).catch((function(h){var m,v,b=h;throw a.core.reporter.reportTraceStart("exceptions",{user_id:a.core.options.account,trace_id:null===(v=null===(m=a.core)||void 0===m?void 0:m.socket)||void 0===v?void 0:v.sessionId,start_time:c,action:1}),a.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof b.code?b.code:0,description:b.message||""+b.code,operation_type:0,target:t,context:o?Aa(o):""}),a.core.reporter.reportTraceEnd("exceptions",1),h}))},t.uploadFile=function uploadFile(t){var o=this,a=(new Date).getTime();return Sc.uploadFile(t).catch((function(c){var h,m,v=c;o.core.reporter.reportTraceStart("exceptions",{user_id:o.core.options.account,trace_id:null===(m=null===(h=o.core)||void 0===h?void 0:h.socket)||void 0===m?void 0:m.sessionId,start_time:a,action:1});var b="BROWSER"===Sc.platform?t.chunkUploadHost:t.commonUploadHost?t.commonUploadHost+"/"+(t.nosToken&&t.nosToken.bucket):"https://nos.netease.com/nim";throw o.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof v.code?v.code:0,description:v.message||""+v.code,operation_type:1,target:b}),o.core.reporter.reportTraceEnd("exceptions",1),c}))},CoreAdapters}();!function(t){t[t.ACTIVE=1]="ACTIVE",t[t.KICKED=2]="KICKED",t[t.OFFLINE=3]="OFFLINE"}(Xl||(Xl={}));var ef=window&&Ps(window.addEventListener)&&Ps(window.removeEventListener),tf=function(t){function Core(o,a){var h;(h=t.call(this)||this).status="unconnected",h.linkUrls=[],h.eventBus=new hs,h.packetSer=1,h.retryCount=0,h.reconnectTimer=0,h.backoff=new ms({max:8e3,min:1600,jitter:.01}),h.sendingCmdMap=new ts,h.pingTimer=0,h.config=Is,h.abtInfo={},validate({linkUrls:{type:"array",itemType:"string",required:!1}},o),h.options=Ma(Ma({},As),o),h.adapters=new Zl(c(h));var m=Sc.localStorage.getItem("__NIM_DEVC_ID__");h.options.isFixedDeviceId?(m=Sc.localStorage.getItem("__NIM_DEVC_ID__")||Nl(),Sc.localStorage.setItem("__NIM_DEVC_ID__",m)):m=Nl(),h.config=Ma(Ma(Ma({},Is),a),{deviceId:m}),h.timerManager=new Yl,h.logger=new xc(h.options.debugLevel,h.options.account);var v=Sc.getSystemInfo();return h.reporter=new wc({common:{app_key:o.appkey,dev_id:m,platform:"Web",sdk_ver:"0.12.2",env:"online",os_name:v.os,os_ver:v.osVer,host_env:v.hostEnv,host_info:v.hostInfo,host_env_ver:v.hostEnvVer},request:Sc.request,logger:h.logger,autoStart:"BROWSER"===Sc.platform}),Sc.setLogger(h.logger),h.logger.log("Core init, version ","0.12.2"," sdk version ",90902," appkey ",o.appkey),h}kt(Core,t);var o=Core.prototype;return o.connect=function connect(t){return void 0===t&&(t={}),__awaiter(this,void 0,void 0,wa.mark((function _callee(){var o,a,c,h,m,v;return wa.wrap((function _callee$(b){for(;;)switch(b.prev=b.next){case 0:if(validate({linkUrls:{type:"array",itemType:"string",required:!1}},t),/^(unconnected|waitReconnect)$/.test(this.status)){b.next=5;break}return o="Core socket status is "+this.status+", and would not connect",this.logger.warn(o),b.abrupt("return",ca.reject(o));case 5:this.status="connecting",t.linkUrls&&t.linkUrls.length>0&&(this.linkUrls=concat(a=t.linkUrls).call(a,this.linkUrls),this.linkUrls=yl(this.linkUrls)),0===this.linkUrls.length&&this.linkUrls.push("weblink.netease.im:443"),c=0;case 9:if(!(c<this.linkUrls.length)){b.next=33;break}return h=this.linkUrls[c],m=(new Date).getTime(),b.prev=12,b.next=15,this.doConnect(h);case 15:return this.reporter.reportTraceUpdate("login",{operation_type:"TCP",target:h}),this.status="connected",this.logger.log("core:: connect success with url: "+h),this.abtRequest(),b.abrupt("return",h);case 22:b.prev=22,b.t0=b.catch(12),v=b.t0,this.reporter.reportTraceUpdate("login",{operation_type:"TCP",error:"ws_handshake_failed",target:h},!1),this.reporter.reportTraceStart("exceptions",{user_id:this.options.account,start_time:m,action:0}),this.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof v.code?v.code:0,description:v.message||""+v.code,operation_type:0,target:h}),this.reporter.reportTraceEnd("exceptions",1),this.logger.warn("core:: connect failed with url: "+h,b.t0);case 30:c++,b.next=9;break;case 33:throw this.reporter.reportTraceEnd("login",!1),0===this.retryCount?this.doDisconnect(Xl.ACTIVE,"SocketHandshakeFailed"):this.doDisconnect(Xl.OFFLINE,"ReconnectHadRetryAllLinks"),new Error("core: socket handshake failed");case 36:case"end":return b.stop()}}),_callee,this,[[12,22]])})))},o.doConnect=function doConnect(t){var o=this;return new ca((function(a,c){var h;o.socket=new Fc(o,t,o.logger),o.socket.on("connect",(function(){o.logger.log("socket on connect",t),a()})),o.socket.on("message",bind$1(h=o.onMessage).call(h,o)),o.socket.on("disconnect",(function(t){o.logger.log("core:: socket on disconnect",t),o.doDisconnect(Xl.OFFLINE,"SocketOnDisconnect")})),o.socket.on("handshakeFailed",(function(){o.logger.warn("core:: socket handshake failed"),c(new pc("handshake failed",{},408))}))}))},o.resetConnectStatus=function resetConnectStatus(){clearTimeout(this.reconnectTimer),this.backoff.reset(),this.retryCount=0,this.initOnlineListener()},o.doDisconnect=function doDisconnect(t,o){if(this.logger.log("doDisconnect: type "+t+", description "+o),"unconnected"!==this.status){this.markAllCmdInvaild(new pc("Packet timeout due to instance disconnect",{},408)),this.timerManager.destroy(),clearTimeout(this.pingTimer),this.socket&&("function"==typeof this.socket.removeAllListeners&&this.socket.removeAllListeners(),"function"==typeof this.socket.close&&this.socket.close(),this.socket=void 0);var a=!this.options.needReconnect||this.retryCount>=this.options.reconnectionAttempts;if(t===Xl.ACTIVE||a)this.logger.log("doDisconnect: emit disconnect, type "+t,a),this.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.eventBus.emit("disconnect"),this.emit("disconnect"),this.destroyOnlineListener();else if(t===Xl.KICKED){this.logger.log("doDisconnect: kicked"),this.status="unconnected",this.reconnectTimer&&clearTimeout(this.reconnectTimer);var c="string"==typeof o?{reason:"unknow",message:o}:o;this.eventBus.emit("kicked",c),this.emit("kicked",c),this.destroyOnlineListener()}else t===Xl.OFFLINE?(this.logger.log("doDisconnect: start to reconnect"),this.attempToReconnect()):this.logger.log("doDisconnect: nothing to do")}else this.logger.warn("doDisconnect: already unconnected")},o.attempToReconnect=function attempToReconnect(){var t=this;if("waitReconnect"!==this.status){var o=this.backoff.duration();this.retryCount++,this.logger.log("willReconnect "+this.retryCount+" "+o),this.eventBus.emit("willReconnect",{retryCount:this.retryCount,duration:o}),this.emit("willReconnect",{retryCount:this.retryCount,duration:o}),this.status="waitReconnect",this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=us((function(){"waitReconnect"===t.status?t.connect({isAutoReconnect:!0}).catch((function(){t.logger.error("core::attempToReconnect failed "+t.retryCount)})):t.logger.warn("doDisconnect: reconnectTimer status is "+t.status+", would not go on reconnecting")}),o)}else this.logger.warn("doDisconnect: already is waiting reconnect")},o.sendCmd=function sendCmd(t,o,a){var c=this;if("logined"!==this.status&&"login"!==t&&"chatroomLogin"!==t&&"qchatLogin"!==t)return this.logger.warn("nim status is "+this.status+", so can not sendCmd "+t),ca.reject({cmd:t,error:{code:"No_connected",message:"Connection not established",timetag:(new Date).getTime()}});if(!this.socket||!this.socket.send)return ca.reject("No_socket");var h="heartbeat"!==t,m=h?this.packetSer++:0,v=function createCmd(t,o,a,c){var h=Ic[t];if(!h)return a.error("createCmd:: can not find cmd config: ",t),null;var m,v={SER:o,SID:h.sid,CID:h.cid,Q:[]};return h.params&&c&&forEach$1(m=h.params).call(m,(function(t){var o=c[t.name];if(!Pc(o)){var a=t.type,h=t.reflectMapper;switch(t.type){case"PropertyArray":a="ArrayMable",o=map(o).call(o,(function(t){return{t:"Property",v:h?serialize(t,h):t}}));break;case"Property":o=h?serialize(o,h):o;break;case"Bool":case"bool":o=o?"true":"false"}v.Q.push({t:a,v:o})}})),{packet:v,isNoResponse:h.isNoResponse||!1}}(t,m,this.logger,o);if(!v){var b="SendCmd "+m+" "+t+" error";return this.logger.error(b),ca.reject(b)}var x=v.packet,w=v.isNoResponse,S=Aa(x);h&&("debug"===this.options.debugLevel?this.logger.debug("core::sendCmd",t,"ser:"+m,S):this.logger.log("core::sendCmd",t,"ser:"+m));var k=(new Date).getTime();return new ca((function(h,v){c.sendingCmdMap.set(m,{cmd:t,params:o,callback:[h,v],timer:w?null:us((function(){var o,a=new mc(504,t,"Packet Timeout",(new Date).getTime(),{message:"ser "+m+" cmd "+t+" timeout"});a.callFunc="sendCmd",c.markCmdInvalid(m,a,t),c.reporter.reportTraceStart("exceptions",{user_id:c.options.account,trace_id:null===(o=c.socket)||void 0===o?void 0:o.sessionId,start_time:k,action:2}),c.reporter.reportTraceUpdateV2("exceptions",{code:408,description:"Packet timeout",operation_type:1,target:x.SID+"-"+x.CID,context:""+x.SER}),c.reporter.reportTraceEnd("exceptions",1)}),a&&a.timeout?a.timeout:c.config.timeout)});try{c.socket.send(S)}catch(o){var b=new mc(415,t,o&&o.message||"Unable to send packet",(new Date).getTime(),{message:"send json error",rawError:o});b.callFunc="sendCmd",c.markCmdInvalid(m,b,t),v(o)}}))},o.onMessage=function onMessage(t){var o=parseCmd(t,this.logger);if(o){var a=o.raw.ser;if(o.error&&this.logger.error("core:onMessage packet error",o.raw.sid+"_"+o.raw.cid+", ser:"+a+",",o.error),!o.notFound)return"heartbeat"!==o.cmd&&("debug"===this.options.debugLevel?this.logger.debug("imsocket::recvCmd ser:"+a,o.cmd,o.content):this.logger.log("imsocket::recvCmd ser:"+a,o.cmd)),o.__receiveTime=Pa(),o;this.logger.warn("core::onMessage packet not found",o.raw.sid+"_"+o.raw.cid+", ser:"+a)}},o.markCmdInvalid=function markCmdInvalid(t,o,a){var c=this.sendingCmdMap.get(t);if(c){var h=c.callback,m=c.timer;m&&clearTimeout(m),this.sendingCmdMap.delete(t),this.logger.warn("packet "+t+", "+a+" is invalid:",o),h[1](o)}},o.markAllCmdInvaild=function markAllCmdInvaild(t){var o;this.logger.log("markAllCmdInvaild"),forEach$1(o=this.sendingCmdMap).call(o,(function(o){var a=o.callback,c=o.timer;c&&clearTimeout(c),a[1](t)})),this.sendingCmdMap.clear()},o.ping=function ping(){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){var t=this;return wa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return clearTimeout(this.pingTimer),o.prev=1,o.next=4,this.sendCmd("heartbeat");case 4:o.next=14;break;case 6:return o.prev=6,o.t0=o.catch(1),o.next=10,this.testHeartBeat5Timeout();case 10:if(!o.sent){o.next=14;break}return this.doDisconnect(Xl.OFFLINE,"PingError"),o.abrupt("return");case 14:this.pingTimer=us((function(){t.ping()}),3e4);case 15:case"end":return o.stop()}}),_callee2,this,[[1,6]])})))},o.testHeartBeat5Timeout=function testHeartBeat5Timeout(){return __awaiter(this,void 0,void 0,wa.mark((function _callee3(){var t;return wa.wrap((function _callee3$(o){for(;;)switch(o.prev=o.next){case 0:clearTimeout(this.pingTimer),t=0;case 2:if(!(t<5)){o.next=15;break}return o.prev=3,o.next=6,this.sendCmd("heartbeat",{},{timeout:3e3});case 6:return o.abrupt("return",!1);case 9:o.prev=9,o.t0=o.catch(3),this.logger.debug("core:: test heartbeat "+t+" Timeout");case 12:t++,o.next=2;break;case 15:return o.abrupt("return",!0);case 16:case"end":return o.stop()}}),_callee3,this,[[3,9]])})))},o.initOnlineListener=function initOnlineListener(){var t,o;this.onlineListener||(ef?(this.onlineListener=bind$1(t=function _context7(){"logined"===this.status&&this.ping()}).call(t,this),this.offlineListener=bind$1(o=function _context8(){this.logger.log("offline"),this.doDisconnect(Xl.OFFLINE,"OfflineListener")}).call(o,this),window.addEventListener("online",this.onlineListener),window.addEventListener("offline",this.offlineListener)):this.logger.warn("initOnlineListener not support add listener"))},o.destroyOnlineListener=function destroyOnlineListener(){this.onlineListener&&(window.removeEventListener("online",this.onlineListener),this.onlineListener=void 0),this.offlineListener&&(window.removeEventListener("offline",this.offlineListener),this.offlineListener=void 0)},o.disconnect=function disconnect(){switch(this.status){case"connected":case"logined":case"connecting":case"waitReconnect":return this.doDisconnect(Xl.ACTIVE,"UserActiveDisconnect"),ca.resolve();case"unconnected":case"destroyed":return ca.resolve()}},o.destroy=function destroy(){var t=this;return this.disconnect().then((function(){t.status="destroyed",t.removeAllListeners(),t.eventBus.removeAllListeners(),t.reporter.destroy(),t.connect=function(){return ca.resolve()},t.disconnect=function(){return ca.resolve()},t.destroy=function(){return ca.resolve()}}))},o.abtRequest=function abtRequest(){var t,o;return __awaiter(this,void 0,void 0,wa.mark((function _callee4(){var a,c;return wa.wrap((function _callee4$(h){for(;;)switch(h.prev=h.next){case 0:if(this.options.isAbtestEnable){h.next=2;break}return h.abrupt("return");case 2:if(!this.abtInfo.experiments){h.next=4;break}return h.abrupt("return");case 4:if(this.options.abtestUrl){h.next=6;break}return h.abrupt("return");case 6:return h.prev=6,h.next=9,this.adapters.request(this.options.abtestUrl,{method:"POST",dataType:"json",headers:{sdktype:"ABTest"},params:{clientInfo:{projectKey:this.options.abtestProjectKey,appKey:this.options.appkey,osType:"Web",sdkVersion:"0.12.2",deviceId:this.config.deviceId},useLocalCache:!0}});case 9:a=h.sent,h.next=15;break;case 12:h.prev=12,h.t0=h.catch(6),this.logger.warn("ABTest request failed");case 15:this.abtInfo=(null===(o=null===(t=null==a?void 0:a.data)||void 0===t?void 0:t.data)||void 0===o?void 0:o.abtInfo)||{},this.abtInfo.experiments&&this.abtInfo.experiments.length>0&&this.reporter.reportImmediately("https://statistic.live.126.net/statics/report/abtest/result",{params:{app_key:this.options.appkey,biz_sdk_type:"IM",sdk_ver:"0.12.2",device_id:this.config.deviceId,platform:"Web",projectKey:this.options.abtestProjectKey,experiments:map(c=this.abtInfo.experiments).call(c,(function(t){return{experimentKey:t.experimentKey,schemeKey:t.schemeKey}}))},headers:{sdktype:"ABTest"},method:"POST",dataType:"json"});case 17:case"end":return h.stop()}}),_callee4,this,[[6,12]])})))},Core}(hs);tf.setAdapters=function setAdapters(t){Ma(Sc,t)};var rf=function createBaseFor(t){return function(o,a,c){for(var h=-1,m=Object(o),v=c(o),b=v.length;b--;){var x=v[t?b:++h];if(!1===a(m[x],x,m))break}return o}}();var nf=function baseTimes(t,o){for(var a=-1,c=Array(t);++a<t;)c[a]=o(a);return c};var af=function baseIsArguments(t){return Gc(t)&&"[object Arguments]"==Es(t)},sf=Object.prototype,cf=sf.hasOwnProperty,uf=sf.propertyIsEnumerable,lf=af(function(){return arguments}())?af:function(t){return Gc(t)&&cf.call(t,"callee")&&!uf.call(t,"callee")},ff=lf,pf=Array.isArray;var df=function stubFalse(){return!1},hf=createCommonjsModule((function(t,o){var a=o&&!o.nodeType&&o,c=a&&t&&!t.nodeType&&t,h=c&&c.exports===a?ys.Buffer:void 0,m=(h?h.isBuffer:void 0)||df;t.exports=m})),mf=/^(?:0|[1-9]\d*)$/;var gf=function isIndex(t,o){var a=typeof t;return!!(o=null==o?9007199254740991:o)&&("number"==a||"symbol"!=a&&mf.test(t))&&t>-1&&t%1==0&&t<o},vf={};vf["[object Float32Array]"]=vf["[object Float64Array]"]=vf["[object Int8Array]"]=vf["[object Int16Array]"]=vf["[object Int32Array]"]=vf["[object Uint8Array]"]=vf["[object Uint8ClampedArray]"]=vf["[object Uint16Array]"]=vf["[object Uint32Array]"]=!0,vf["[object Arguments]"]=vf["[object Array]"]=vf["[object ArrayBuffer]"]=vf["[object Boolean]"]=vf["[object DataView]"]=vf["[object Date]"]=vf["[object Error]"]=vf["[object Function]"]=vf["[object Map]"]=vf["[object Number]"]=vf["[object Object]"]=vf["[object RegExp]"]=vf["[object Set]"]=vf["[object String]"]=vf["[object WeakMap]"]=!1;var yf=function baseIsTypedArray(t){return Gc(t)&&al(t.length)&&!!vf[Es(t)]},bf=Vc&&Vc.isTypedArray,xf=bf?Wc(bf):yf,wf=Object.prototype.hasOwnProperty;var Sf=function arrayLikeKeys(t,o){var a=pf(t),c=!a&&ff(t),h=!a&&!c&&hf(t),m=!a&&!c&&!h&&xf(t),v=a||c||h||m,b=v?nf(t.length,String):[],x=b.length;for(var w in t)!o&&!wf.call(t,w)||v&&("length"==w||h&&("offset"==w||"parent"==w)||m&&("buffer"==w||"byteLength"==w||"byteOffset"==w)||gf(w,x))||b.push(w);return b},kf=Object.prototype;var _f=function isPrototype(t){var o=t&&t.constructor;return t===("function"==typeof o&&o.prototype||kf)};var Tf=function overArg(t,o){return function(a){return t(o(a))}},Cf=Tf(Object.keys,Object),Mf=Object.prototype.hasOwnProperty;var Ef=function baseKeys(t){if(!_f(t))return Cf(t);var o=[];for(var a in Object(t))Mf.call(t,a)&&"constructor"!=a&&o.push(a);return o};var Of=function keys(t){return sl(t)?Sf(t):Ef(t)};var Pf=function baseForOwn(t,o){return t&&rf(t,o,Of)};var If=function baseInverter(t,o,a,c){return Pf(t,(function(t,h,m){o(c,a(t),h,m)})),c};var Af,jf,Rf=function createInverter(t,o){return function(a,c){return If(a,t,o(c),{})}},Lf=Object.prototype.toString,Ff=Rf((function(t,o,a){null!=o&&"function"!=typeof o.toString&&(o=Lf.call(o)),t[o]=a}),el(Ju));function formatChatroom(t){var o=Ma({},t),a=["announcement","broadcastUrl","ext"],c=["createTime","updateTime","onlineMemberNum"],h=["mute"];return forEach$1(a).call(a,(function(t){void 0===o[t]&&(o[t]="")})),forEach$1(c).call(c,(function(t){void 0!==o[t]&&(o[t]=Fl(o[t]))})),forEach$1(h).call(h,(function(t){void 0!==o[t]&&(o[t]=1===Fl(o[t]))})),o}!function(t){t[t.Android=1]="Android",t[t.iOS=2]="iOS",t[t.PC=4]="PC",t[t.WindowsPhone=8]="WindowsPhone",t[t.Web=16]="Web",t[t.Server=32]="Server",t[t.Mac=64]="Mac"}(Af||(Af={})),function(t){t[t.text=0]="text",t[t.image=1]="image",t[t.audio=2]="audio",t[t.video=3]="video",t[t.geo=4]="geo",t[t.notification=5]="notification",t[t.file=6]="file",t[t.tip=10]="tip",t[t.robot=11]="robot",t[t.g2=12]="g2",t[t.custom=100]="custom"}(jf||(jf={}));var Nf=Ff({unset:"-2",restricted:"-1",common:"0",owner:"1",manager:"2",guest:"3",anonymous:"4"});function formatChatroomMember(t){var o,a=Ma({},t),c=["chatroomId"],h=["level","enterTime","updateTime","tempMuteDuration"],m=["online","guest","blacked","muted","valid","tempMuted"],v={tempMuted:!1,tempMuteDuration:0};return forEach$1(o=Oc(v)).call(o,(function(t){a[t]=a[t]||v[t]})),forEach$1(c).call(c,(function(t){void 0!==a[t]&&(a[t]=a[t].toString())})),forEach$1(h).call(h,(function(t){void 0!==a[t]&&(a[t]=Fl(a[t]))})),forEach$1(m).call(m,(function(t){void 0!==a[t]&&(a[t]=1===Fl(a[t]))})),void 0!==a.type&&(a.type=Nf[a.type]),a.avatar,a.online||delete a.enterTime,a.guest&&(a.type="guest",delete a.valid,delete a.guest),"common"!==a.type&&delete a.level,a}function formatChatroomMembers(t){return t&&t.length>0?map(t).call(t,(function(t){return formatChatroomMember(t)})):[]}function generatorMsgForCmd(t,o,a){t.onSendBefore;var c=__rest(t,["onSendBefore"]),h=["subType"],m=["body","antiSpamContent","antiSpamBusinessId","ext"],v=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];return t.resend||(c.idClient=Nl()),c.type=jf[t.type],c.from=o,c.fromClientType=16,c.fromDeviceId=a,c.status=c.status||"sending",forEach$1(v).call(v,(function(o){void 0!==t[o]&&(c[o]=t[o]?1:0)})),forEach$1(h).call(h,(function(o){void 0!==t[o]&&(c[o]=Fl(t[o]))})),forEach$1(m).call(m,(function(o){void 0!==t[o]&&(c[o]="string"==typeof t[o]?t[o]:Aa(t[o]))})),c}var Uf={301:"memberEnter",302:"memberExit",303:"blackMember",304:"unblackMember",305:"gagMember",306:"ungagMember",307:"addManager",308:"removeManager",309:"addCommon",310:"removeCommon",311:"closeChatroom",312:"updateChatroom",313:"kickMember",314:"addTempMute",315:"removeTempMute",316:"updateMemberInfo",317:"updateQueue",318:"muteRoom",319:"unmuteRoom",320:"batchUpdateQueue",321:"addTempMuteTag",322:"removeTempMuteTag",323:"deleteChatroomMsg",325:"updateChatroomTags"};function formatChatroomMsg(t,o){t.onUploadDone,t.onUploadProgress,t.onUploadStart;var a=__rest(t,["onUploadDone","onUploadProgress","onUploadStart"]),c=["time","userUpdateTime"],h=["resend","needAntiSpam","antiSpamUsingYidun","skipHistory","highPriority","clientAntiSpam"];if(forEach$1(c).call(c,(function(t){void 0!==a[t]&&(a[t]=Fl(a[t]))})),forEach$1(h).call(h,(function(t){void 0!==a[t]&&(a[t]=1===Fl(a[t]))})),a.type=getEnumKeyByEnumValue(jf,a.type),a.fromClientType=getEnumKeyByEnumValue(Af,a.fromClientType),a.flow=a.from===o?"out":"in",a.status=a.status||"success","string"==typeof a.body)try{a.body=JSON.parse(a.body)}catch(t){}return"notification"===a.type&&(a.attach=a.body?function formatNotificationBody(t){var o,a={};if(a.type=Uf[t.id]||t.id,!t.data)return t;a=Ma(a,t.data);var c={operator:"from",opeNick:"fromNick",target:"to",tarNick:"toNick"};forEach$1(o=Oc(c)).call(o,(function(t){void 0!==a[t]&&(a[c[t]]=a[t],delete a[t])}));var h=["muteDuration"];if(forEach$1(h).call(h,(function(t){void 0!==a[t]&&(a[t]=Fl(a[t]))})),!a.queueChange)return a;var m={};try{m=JSON.parse(a.queueChange)}catch(t){return a}switch(m._e){case"OFFER":m={type:"OFFER",elementKey:m.key,elementValue:m.content};break;case"POLL":m={type:"POLL",elementKey:m.key,elementValue:m.content};break;case"DROP":m={type:"DROP"};break;case"PARTCLEAR":case"BATCH_UPDATE":m={type:m._e,elementKv:m.kvObject}}return a.queueChange=m,a}(a.body):{},a.body=""),a}function formatChatroomMsgs(t,o){return t&&t.length>0?map(t).call(t,(function(t){return formatChatroomMsg(t,o)})):[]}var Df={1:{code:"chatroomClosed",message:"Chatroom is closed"},2:{code:"managerKick",message:"Kicked out by owners or administrators"},3:{code:"samePlatformKick",message:"The same account is not allowed to multiple login at the same time"},4:{code:"silentlyKick",message:"Quietly kicked"},5:{code:"blacked",message:"Was blacklisted"}};var Bf=function(){function Service(t,o){this.name=t,this.core=o,this.name=t,this.logger=o.logger,this.core=o}return Service.prototype.process=function process(t){var o=this[t.cmd+"Handler"];return"function"==typeof o?o.call(this,t):t.error&&!t.error.ignore?ca.reject(t.error):ca.resolve(t)},Service}(),qf=function(t){function ChatroomService(o){return t.call(this,"chatroom",o)||this}kt(ChatroomService,t);var o=ChatroomService.prototype;return o.getInfo=function getInfo(){var t;return __awaiter(this,void 0,void 0,wa.mark((function _callee(){var o;return wa.wrap((function _callee$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("getChatroom");case 2:return o=a.sent,a.abrupt("return",formatChatroom(null===(t=o.content)||void 0===t?void 0:t.chatroom));case 4:case"end":return a.stop()}}),_callee,this)})))},o.updateInfo=function updateInfo(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){return wa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return validate({chatroom:{type:"object",rules:{name:{type:"string",required:!1},announcement:{type:"string",required:!1},broadcastUrl:{type:"string",required:!1},ext:{type:"string",required:!1},queuelevel:{type:"number",min:0,max:1,required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1}},t),o.next=3,this.core.sendCmd("updateChatroom",Ma(Ma({},t),{ext:t.ext||""}));case 3:case"end":return o.stop()}}),_callee2,this)})))},o.beKickedFromChatroomHandler=function beKickedFromChatroomHandler(t){var o=t.content,a=o.reason,c=o.ext,h=function formatKickedReason(t){var o=Df[t];return{reason:o?o.code:"unknow",message:o?o.message:"Unknown reason"}}(a);this.logger.warn("beKickedFromChatroomHandler:: ",h.reason,h.message,c),this.core.doDisconnect(Xl.KICKED,h)},o.updateChatroomTagHandler=function updateChatroomTagHandler(t){var o,a=t.content;this.logger.log("updateChatroomTagHandler:: ",a);var c=null===(o=null==a?void 0:a.updateTags)||void 0===o?void 0:o.currentTags;try{c=JSON.parse(c)}catch(t){this.logger.error("updateChatroomTagHandler:: ",t)}this.core.emit("tagsUpdate",c)},ChatroomService}(Bf),zf=kr.some,Kf=arrayMethodIsStrict("some");_export({target:"Array",proto:!0,forced:!Kf},{some:function some(t){return zf(this,t,arguments.length>1?arguments[1]:void 0)}});var Hf=entryVirtual("Array").some,Gf=Array.prototype,some=function(t){var o=t.some;return t===Gf||K(Gf,t)&&o===Gf.some?Hf:o};var $f=function stackClear(){this.__data__=new Eu,this.size=0};var Wf=function stackDelete(t){var o=this.__data__,a=o.delete(t);return this.size=o.size,a};var Vf=function stackGet(t){return this.__data__.get(t)};var Qf=function stackHas(t){return this.__data__.has(t)};var Jf=function stackSet(t,o){var a=this.__data__;if(a instanceof Eu){var c=a.__data__;if(!Ou||c.length<199)return c.push([t,o]),this.size=++a.size,this;a=this.__data__=new Nu(c)}return a.set(t,o),this.size=a.size,this};function Stack(t){var o=this.__data__=new Eu(t);this.size=o.size}Stack.prototype.clear=$f,Stack.prototype.delete=Wf,Stack.prototype.get=Vf,Stack.prototype.has=Qf,Stack.prototype.set=Jf;var Xf=Stack;var Yf=function arraySome(t,o){for(var a=-1,c=null==t?0:t.length;++a<c;)if(o(t[a],a,t))return!0;return!1};var Zf=function equalArrays(t,o,a,c,h,m){var v=1&a,b=t.length,x=o.length;if(b!=x&&!(v&&x>b))return!1;var w=m.get(t),S=m.get(o);if(w&&S)return w==o&&S==t;var k=-1,_=!0,T=2&a?new Bu:void 0;for(m.set(t,o),m.set(o,t);++k<b;){var C=t[k],M=o[k];if(c)var E=v?c(M,C,k,o,t,m):c(C,M,k,t,o,m);if(void 0!==E){if(E)continue;_=!1;break}if(T){if(!Yf(o,(function(t,o){if(!Vu(T,o)&&(C===t||h(C,t,a,c,m)))return T.push(o)}))){_=!1;break}}else if(C!==M&&!h(C,M,a,c,m)){_=!1;break}}return m.delete(t),m.delete(o),_},ep=ys.Uint8Array;var tp=function mapToArray(t){var o=-1,a=Array(t.size);return t.forEach((function(t,c){a[++o]=[c,t]})),a},rp=bs?bs.prototype:void 0,np=rp?rp.valueOf:void 0;var op=function equalByTag(t,o,a,c,h,m,v){switch(a){case"[object DataView]":if(t.byteLength!=o.byteLength||t.byteOffset!=o.byteOffset)return!1;t=t.buffer,o=o.buffer;case"[object ArrayBuffer]":return!(t.byteLength!=o.byteLength||!m(new ep(t),new ep(o)));case"[object Boolean]":case"[object Date]":case"[object Number]":return wu(+t,+o);case"[object Error]":return t.name==o.name&&t.message==o.message;case"[object RegExp]":case"[object String]":return t==o+"";case"[object Map]":var b=tp;case"[object Set]":var x=1&c;if(b||(b=hl),t.size!=o.size&&!x)return!1;var w=v.get(t);if(w)return w==o;c|=2,v.set(t,o);var S=Zf(b(t),b(o),c,h,m,v);return v.delete(t),S;case"[object Symbol]":if(np)return np.call(t)==np.call(o)}return!1};var ip=function arrayPush(t,o){for(var a=-1,c=o.length,h=t.length;++a<c;)t[h+a]=o[a];return t};var ap=function baseGetAllKeys(t,o,a){var c=o(t);return pf(t)?c:ip(c,a(t))};var sp=function arrayFilter(t,o){for(var a=-1,c=null==t?0:t.length,h=0,m=[];++a<c;){var v=t[a];o(v,a,t)&&(m[h++]=v)}return m};var cp=function stubArray(){return[]},up=Object.prototype.propertyIsEnumerable,lp=Object.getOwnPropertySymbols,fp=lp?function(t){return null==t?[]:(t=Object(t),sp(lp(t),(function(o){return up.call(t,o)})))}:cp,pp=fp;var dp=function getAllKeys(t){return ap(t,Of,pp)},hp=Object.prototype.hasOwnProperty;var mp=function equalObjects(t,o,a,c,h,m){var v=1&a,b=dp(t),x=b.length;if(x!=dp(o).length&&!v)return!1;for(var w=x;w--;){var S=b[w];if(!(v?S in o:hp.call(o,S)))return!1}var k=m.get(t),_=m.get(o);if(k&&_)return k==o&&_==t;var T=!0;m.set(t,o),m.set(o,t);for(var C=v;++w<x;){var M=t[S=b[w]],E=o[S];if(c)var O=v?c(E,M,S,o,t,m):c(M,E,S,t,o,m);if(!(void 0===O?M===E||h(M,E,a,c,m):O)){T=!1;break}C||(C="constructor"==S)}if(T&&!C){var P=t.constructor,I=o.constructor;P==I||!("constructor"in t)||!("constructor"in o)||"function"==typeof P&&P instanceof P&&"function"==typeof I&&I instanceof I||(T=!1)}return m.delete(t),m.delete(o),T},gp=lu(ys,"DataView"),vp=lu(ys,"Promise"),yp=lu(ys,"WeakMap"),bp="[object Map]",xp="[object Promise]",wp="[object Set]",Sp="[object WeakMap]",kp="[object DataView]",_p=tu(gp),Tp=tu(Ou),Cp=tu(vp),Mp=tu(pl),Ep=tu(yp),Op=Es;(gp&&Op(new gp(new ArrayBuffer(1)))!=kp||Ou&&Op(new Ou)!=bp||vp&&Op(vp.resolve())!=xp||pl&&Op(new pl)!=wp||yp&&Op(new yp)!=Sp)&&(Op=function(t){var o=Es(t),a="[object Object]"==o?t.constructor:void 0,c=a?tu(a):"";if(c)switch(c){case _p:return kp;case Tp:return bp;case Cp:return xp;case Mp:return wp;case Ep:return Sp}return o});var Pp=Op,Ip="[object Arguments]",Ap="[object Array]",jp="[object Object]",Rp=Object.prototype.hasOwnProperty;var Lp=function baseIsEqualDeep(t,o,a,c,h,m){var v=pf(t),b=pf(o),x=v?Ap:Pp(t),w=b?Ap:Pp(o),S=(x=x==Ip?jp:x)==jp,k=(w=w==Ip?jp:w)==jp,_=x==w;if(_&&hf(t)){if(!hf(o))return!1;v=!0,S=!1}if(_&&!S)return m||(m=new Xf),v||xf(t)?Zf(t,o,a,c,h,m):op(t,o,x,a,c,h,m);if(!(1&a)){var T=S&&Rp.call(t,"__wrapped__"),C=k&&Rp.call(o,"__wrapped__");if(T||C){var M=T?t.value():t,E=C?o.value():o;return m||(m=new Xf),h(M,E,a,c,m)}}return!!_&&(m||(m=new Xf),mp(t,o,a,c,h,m))};var Fp=function baseIsEqual(t,o,a,c,h){return t===o||(null==t||null==o||!Gc(t)&&!Gc(o)?t!=t&&o!=o:Lp(t,o,a,c,baseIsEqual,h))};var Np=function baseIsMatch(t,o,a,c){var h=a.length,m=h,v=!c;if(null==t)return!m;for(t=Object(t);h--;){var b=a[h];if(v&&b[2]?b[1]!==t[b[0]]:!(b[0]in t))return!1}for(;++h<m;){var x=(b=a[h])[0],w=t[x],S=b[1];if(v&&b[2]){if(void 0===w&&!(x in t))return!1}else{var k=new Xf;if(c)var _=c(w,S,x,t,o,k);if(!(void 0===_?Fp(S,w,3,c,k):_))return!1}}return!0};var Up=function isStrictComparable(t){return t==t&&!Os(t)};var Dp=function getMatchData(t){for(var o=Of(t),a=o.length;a--;){var c=o[a],h=t[c];o[a]=[c,h,Up(h)]}return o};var Bp=function matchesStrictComparable(t,o){return function(a){return null!=a&&(a[t]===o&&(void 0!==o||t in Object(a)))}};var qp=function baseMatches(t){var o=Dp(t);return 1==o.length&&o[0][2]?Bp(o[0][0],o[0][1]):function(a){return a===t||Np(a,t,o)}};var zp=function isSymbol(t){return"symbol"==typeof t||Gc(t)&&"[object Symbol]"==Es(t)},Kp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hp=/^\w*$/;var Gp=function isKey(t,o){if(pf(t))return!1;var a=typeof t;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=t&&!zp(t))||(Hp.test(t)||!Kp.test(t)||null!=o&&t in Object(o))};function memoize(t,o){if("function"!=typeof t||null!=o&&"function"!=typeof o)throw new TypeError("Expected a function");var memoized=function(){var a=arguments,c=o?o.apply(this,a):a[0],h=memoized.cache;if(h.has(c))return h.get(c);var m=t.apply(this,a);return memoized.cache=h.set(c,m)||h,m};return memoized.cache=new(memoize.Cache||Nu),memoized}memoize.Cache=Nu;var $p=memoize;var Wp=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vp=/\\(\\)?/g,Qp=function memoizeCapped(t){var o=$p(t,(function(t){return 500===a.size&&a.clear(),t})),a=o.cache;return o}((function(t){var o=[];return 46===t.charCodeAt(0)&&o.push(""),t.replace(Wp,(function(t,a,c,h){o.push(c?h.replace(Vp,"$1"):a||t)})),o})),Jp=Qp,Xp=bs?bs.prototype:void 0,Yp=Xp?Xp.toString:void 0;var Zp=function baseToString(t){if("string"==typeof t)return t;if(pf(t))return Wu(t,baseToString)+"";if(zp(t))return Yp?Yp.call(t):"";var o=t+"";return"0"==o&&1/t==-Infinity?"-0":o};var ed=function toString(t){return null==t?"":Zp(t)};var td=function castPath(t,o){return pf(t)?t:Gp(t,o)?[t]:Jp(ed(t))};var rd=function toKey(t){if("string"==typeof t||zp(t))return t;var o=t+"";return"0"==o&&1/t==-Infinity?"-0":o};var nd=function baseGet(t,o){for(var a=0,c=(o=td(o,t)).length;null!=t&&a<c;)t=t[rd(o[a++])];return a&&a==c?t:void 0};var od=function get(t,o,a){var c=null==t?void 0:nd(t,o);return void 0===c?a:c};var id=function baseHasIn(t,o){return null!=t&&o in Object(t)};var ad=function hasPath(t,o,a){for(var c=-1,h=(o=td(o,t)).length,m=!1;++c<h;){var v=rd(o[c]);if(!(m=null!=t&&a(t,v)))break;t=t[v]}return m||++c!=h?m:!!(h=null==t?0:t.length)&&al(h)&&gf(v,h)&&(pf(t)||ff(t))};var sd=function hasIn(t,o){return null!=t&&ad(t,o,id)};var cd=function baseMatchesProperty(t,o){return Gp(t)&&Up(o)?Bp(rd(t),o):function(a){var c=od(a,t);return void 0===c&&c===o?sd(a,t):Fp(o,c,3)}};var ud=function baseProperty(t){return function(o){return null==o?void 0:o[t]}};var ld=function basePropertyDeep(t){return function(o){return nd(o,t)}};var fd=function property(t){return Gp(t)?ud(rd(t)):ld(t)};var pd=function baseIteratee(t){return"function"==typeof t?t:null==t?Ju:"object"==typeof t?pf(t)?cd(t[0],t[1]):qp(t):fd(t)};var dd=function baseAssignValue(t,o,a){"__proto__"==o&&tl?tl(t,o,{configurable:!0,enumerable:!0,value:a,writable:!0}):t[o]=a},hd=Object.prototype.hasOwnProperty;var md=function assignValue(t,o,a){var c=t[o];hd.call(t,o)&&wu(c,a)&&(void 0!==a||o in t)||dd(t,o,a)};var gd=function baseSet(t,o,a,c){if(!Os(t))return t;for(var h=-1,m=(o=td(o,t)).length,v=m-1,b=t;null!=b&&++h<m;){var x=rd(o[h]),w=a;if("__proto__"===x||"constructor"===x||"prototype"===x)return t;if(h!=v){var S=b[x];void 0===(w=c?c(S,x,b):void 0)&&(w=Os(S)?S:gf(o[h+1])?[]:{})}md(b,x,w),b=b[x]}return t};var vd=function basePickBy(t,o,a){for(var c=-1,h=o.length,m={};++c<h;){var v=o[c],b=nd(t,v);a(b,v)&&gd(m,td(v,t),b)}return m},yd=Tf(Object.getPrototypeOf,Object),bd=Object.getOwnPropertySymbols?function(t){for(var o=[];t;)ip(o,pp(t)),t=yd(t);return o}:cp;var xd=function nativeKeysIn(t){var o=[];if(null!=t)for(var a in Object(t))o.push(a);return o},wd=Object.prototype.hasOwnProperty;var Sd=function baseKeysIn(t){if(!Os(t))return xd(t);var o=_f(t),a=[];for(var c in t)("constructor"!=c||!o&&wd.call(t,c))&&a.push(c);return a};var kd=function keysIn(t){return sl(t)?Sf(t,!0):Sd(t)};var _d=function getAllKeysIn(t){return ap(t,kd,bd)};var Td,Cd,Md=function pickBy(t,o){if(null==t)return{};var a=Wu(_d(t),(function(t){return[t]}));return o=pd(o),vd(t,a,(function(t,a){return o(t,a[0])}))},Ed={"6_2":"getNosToken","6_22":"getOriginUrl","6_26":"getNosCdnHost","6_27":"getGrayscaleConfig","6_28":"getMixStorePolicy","6_29":"getMixStoreToken","6_30":"getFileAuthToken"},Od={nosToken:{objectName:1,token:2,bucket:3,expireTime:4,expireSec:7,tag:8,shortUrl:9},mixStoreTokenReqTag:{provider:0,tokenCount:1,fileExpireSec:2,tag:3,returnBody:4},nosConfigTag:{bucket:1,cdnDomain:2,expire:3,objectNamePrefix:4},grayConfigTag:{config:0,ttl:1},mixStorePolicyTag:{providers:0,ttl:1,mixEnable:2,nosPolicy:3,s3Policy:4},mixStoreTokenResTag:{provider:0,accessKeyId:1,secretAccessKey:2,sessionToken:3,token:4,expireTime:5,bucket:6,objectName:7,fileExpireSec:8,tag:9,shortUrl:10,region:11},nosSafeUrlTag:{safeUrl:0,originUrl:1},mixStoreAuthTokenReqTag:{type:1,urls:2},mixStoreAuthTokenResTag:{type:1,tokens:2,token:3,ttl:4}},Pd=invertSerializeMap(Od),Id={getNosToken:{sid:6,cid:2,service:"cloudStorage",response:[{type:"Property",name:"nosToken",reflectMapper:Pd.nosToken}],params:[{type:"String",name:"responseBody"},{type:"Property",name:"nosToken",entity:"nosToken",reflectMapper:Od.nosToken}]},getOriginUrl:{sid:6,cid:22,service:"cloudStorage",response:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:Pd.nosSafeUrlTag}],params:[{type:"Property",name:"nosSafeUrlTag",reflectMapper:Od.nosSafeUrlTag}]},getNosCdnHost:{sid:6,cid:26,service:"misc",response:[{type:"Property",name:"nosConfigTag",reflectMapper:Pd.nosConfigTag}]},getGrayscaleConfig:{sid:6,cid:27,service:"cloudStorage",response:[{type:"Property",name:"grayConfigTag",reflectMapper:Pd.grayConfigTag}],params:[{type:"Property",name:"config"}]},getMixStorePolicy:{sid:6,cid:28,service:"cloudStorage",params:[{type:"LongArray",name:"supportType"}],response:[{type:"Property",name:"mixStorePolicyTag",reflectMapper:Pd.mixStorePolicyTag}]},getMixStoreToken:{sid:6,cid:29,service:"cloudStorage",params:[{type:"Property",name:"mixStoreTokenReqTag",reflectMapper:Od.mixStoreTokenReqTag}],response:[{type:"Property",name:"mixStoreTokenResTag",reflectMapper:Pd.mixStoreTokenResTag}]},getFileAuthToken:{sid:6,cid:30,service:"cloudStorage",params:[{type:"Property",name:"mixStoreAuthTokenReqTag",reflectMapper:Od.mixStoreAuthTokenReqTag}],response:[{type:"Property",name:"mixStoreAuthTokenResTag",reflectMapper:Pd.mixStoreAuthTokenResTag}]}};!function(t){t[t.nos=1]="nos",t[t.s3=2]="s3"}(Td||(Td={})),function(t){t[t.dontNeed=-1]="dontNeed",t[t.time=2]="time",t[t.urls=3]="urls"}(Cd||(Cd={}));var Ad,jd,Rd={chunkUploadHost:"https://wanproxy-web.127.net",commonUploadHost:"https://nos.netease.com",chunkMaxSize:4194304e4,commonMaxSize:104857600,uploadReplaceFormat:"https://{host}/{object}",cdn:{defaultCdnDomain:"nim.nosdn.127.net",cdnDomain:"",bucket:"",objectNamePrefix:""},downloadUrl:"https://{bucket}-nosdn.netease.im/{object}",downloadHostList:["nos.netease.com"],nosCdnEnable:!0,isNeedToGetUploadPolicyFromServer:!0},Ld={file:{md5:"$(Etag)",size:"$(ObjectSize)"},image:{md5:"$(Etag)",size:"$(ObjectSize)",w:"$(ImageInfo.Width)",h:"$(ImageInfo.Height)",orientation:"$(ImageInfo.Orientation)"},audio:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Audio.Duration)"},video:{md5:"$(Etag)",size:"$(ObjectSize)",dur:"$(AVinfo.Video.Duration)",w:"$(AVinfo.Video.Width)",h:"$(AVinfo.Video.Height)"}},Fd={accessKeyId:"",secretAccessKey:"",sessionToken:"",region:"",maxRetries:0,bucket:"",objectName:"",token:"",shortUrl:""};function getUploadResponseFormat(t){return void 0===t&&(t="file"),Aa(Ld[t]||{}).replace(/"/gi,'\\"')}!function(t){t[t.nos=1]="nos",t[t.s3=2]="s3"}(Ad||(Ad={})),function(t){t[t.dontNeed=-1]="dontNeed",t[t.time=2]="time",t[t.urls=3]="urls"}(jd||(jd={}));var Nd,Ud=function(){function CloudStorageService(t,o){void 0===o&&(o={}),this.GRAYKEY="AllGrayscaleConfig",this.MIXSTOREKEY="AllMixStorePolicy",this.config={},this.nosCdnHostTimer=0,this.grayConfig={mixStoreEnable:!1,timeStamp:0,ttl:0},this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=Ad.nos,this.s3=null,this.mixStoreErrorCount=10,this.nosErrorCount=0,this.circuitTimer=0,this.name="cloudStorage",this.logger=t.logger,this.core=t,registerParser({cmdMap:Ed,cmdConfig:Id}),this.setOptions(o)}var t=CloudStorageService.prototype;return t.setOptions=function setOptions(t){void 0===t&&(t={});var o=t.storageKeyPrefix||"NIMClient";this.GRAYKEY=o+"-AllGrayscaleConfig",this.MIXSTOREKEY=o+"-AllMixStorePolicy";var a=t.s3,c=__rest(t,["s3"]),h=Ma({},Rd,this.config);if(c&&Object.prototype.hasOwnProperty.call(c,"cdn")){var m={cdn:Ma(Ma({},h.cdn),c.cdn)};this.config=Ma({},h,c,m)}else this.config=Ma({},h,c);a&&(this.s3=a)},t.init=function init(){return __awaiter(this,void 0,void 0,wa.mark((function _callee(){return wa.wrap((function _callee$(t){for(;;)switch(t.prev=t.next){case 0:if(this.grayConfig=null,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.curProvider=Ad.nos,this.mixStoreErrorCount=10,!this.config.isNeedToGetUploadPolicyFromServer){t.next=9;break}return t.next=7,this.getGrayscaleConfig(this.core.options.appkey);case 7:return t.next=9,this.getNosCdnHost();case 9:case"end":return t.stop()}}),_callee,this)})))},t.uploadFile=function uploadFile(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){var o,a,c;return wa.wrap((function _callee2$(h){for(;;)switch(h.prev=h.next){case 0:if(validate({maxSize:{type:"number",required:!1},type:{type:"enum",values:["file","image","audio","video"]}},t),t.fileInput||t.file||t.filePath){h.next=3;break}throw new Error("uploadFile needs target file object or a filePath");case 3:if(!t.type||"file"===t.type){h.next=7;break}if("string"!=typeof(o=od(t,"file.type"))||-1!==indexOf(o).call(o,t.type)){h.next=7;break}throw new Error('The meta type "'+o+'" does not match "'+t.type+'"');case 7:if(this.grayConfig&&this.grayConfig.mixStoreEnable&&this.mixStorePolicy.providers.length){h.next=10;break}return this.logger.log("uploadFile:: uploadFile begin, use old nos"),h.abrupt("return",this.nosUpload(t));case 10:return this.logger.log("uploadFile:: uploadFile begin,Current settings grayConfig mixStoreEnable:"+this.grayConfig.mixStoreEnable+" curProvider:"+this.curProvider),this.s3||(this.curProvider=Ad.nos),a=Fd,h.prev=13,h.next=16,this.core.sendCmd("getMixStoreToken",{mixStoreTokenReqTag:{provider:this.curProvider,tokenCount:1,tag:"qchat",returnBody:getUploadResponseFormat(t.type)}});case 16:c=h.sent,a=c.content.mixStoreTokenResTag,h.next=24;break;case 20:throw h.prev=20,h.t0=h.catch(13),this.core.logger.error("uploadFile:: getMixStoreToken error",h.t0),new gc("getMixStoreToken error",h.t0,this.curProvider,this.mixStorePolicy);case 24:return h.abrupt("return",this.curProvider===Ad.s3?this.s3Upload(t,a):this.nosUpload(t,a));case 25:case"end":return h.stop()}}),_callee2,this,[[13,20]])})))},t.nosUpload=function nosUpload(t,o){var a,c;return __awaiter(this,void 0,void 0,wa.mark((function _callee3(){var h,m,v,b,x,w,S,k,_,T,C,M,E;return wa.wrap((function _callee3$(O){for(;;)switch(O.prev=O.next){case 0:if(h=od(this.core,"config.cdn.bucket"),m={tag:t.nosScenes||h||"nim",expireSec:t.nosSurvivalTime},o){O.next=13;break}return O.prev=3,O.next=6,this.core.sendCmd("getNosToken",{responseBody:getUploadResponseFormat(t.type),nosToken:m});case 6:v=O.sent,O.next=13;break;case 9:throw O.prev=9,O.t0=O.catch(3),this.core.logger.error("uploadFile:: getNosToken error",O.t0),new gc("getNosToken error",O.t0,1);case 13:return O.prev=13,x=v?v.content.nosToken:o,this.core.logger.debug("uploadFile:: uploadFile params",{nosToken:x,chunkUploadHost:this.config.chunkUploadHost,commonUploadHost:this.config.commonUploadHost,platform:Sc.platform}),O.next=18,this.core.adapters.uploadFile(Ma(Ma({},t),{nosToken:x,chunkUploadHost:this.config.chunkUploadHost,commonUploadHost:this.config.commonUploadHost,maxSize:t.maxSize||this.config.chunkMaxSize}));case 18:b=O.sent,O.next=42;break;case 21:if(O.prev=21,O.t1=O.catch(13),this.core.logger.error("uploadFile::nos uploadFile error",O.t1),!o){O.next=41;break}if(0!==this.nosErrorCount){O.next=37;break}O.prev=26,this._addCircuitTimer(),O.next=33;break;case 30:throw O.prev=30,O.t2=O.catch(26),new gc("upload file error",O.t2,this.curProvider,this.mixStorePolicy,t.file||t.filePath);case 33:return this.nosErrorCount=null===(a=this.mixStorePolicy.nosPolicy)||void 0===a?void 0:a.uploadConfig.retryPolicy.retry,O.abrupt("return",this.uploadFile(t));case 37:return this.nosErrorCount--,O.abrupt("return",this.nosUpload(t,o));case 39:O.next=42;break;case 41:throw new gc("nos uploadFile error",O.t1,1);case 42:if(w=null==b?void 0:b.type,S=w&&indexOf(w).call(w,"/")>-1?slice(w).call(w,0,indexOf(w).call(w,"/")):"",k={image:"imageInfo",video:"vinfo",audio:"vinfo"},_=this.config.uploadReplaceFormat.replace("{host}",this.config.cdn.cdnDomain||this.config.cdn.defaultCdnDomain).replace("{object}",v?v.content.nosToken.objectName:null==o?void 0:o.objectName),o&&o.shortUrl&&(_=o.shortUrl),k[S]){O.next=49;break}return O.abrupt("return",Ma({url:_},b));case 49:if(O.prev=49,!(indexOf(_).call(_,"_im_url=1")<0)){O.next=54;break}return O.next=53,this.core.adapters.request(_+"?"+k[S],{method:"GET",dataType:"json",timeout:5e3});case 53:T=O.sent;case 54:O.next=60;break;case 56:return O.prev=56,O.t3=O.catch(49),this.core.logger.error("uploadFile:: fetch file info error",O.t3),O.abrupt("return",Ma({url:_},b));case 60:if(!T){O.next=67;break}return C=T.data,M="imageInfo"===k[S]?C:null===(c=null==C?void 0:C.GetVideoInfo)||void 0===c?void 0:c.VideoInfo,E={url:_,name:b.name,size:b.size,ext:b.ext,w:M.Width,h:M.Height,orientation:M.Orientation,dur:M.Duration,audioCodec:M.AudioCodec,videoCodec:M.VideoCodec,container:M.Container},O.abrupt("return",Md(E,(function(t,o){return void 0!==o})));case 67:return O.abrupt("return",Ma({url:_},b));case 68:case"end":return O.stop()}}),_callee3,this,[[3,9],[13,21],[26,30],[49,56]])})))},t.getNosCdnHost=function getNosCdnHost(){var t;return __awaiter(this,void 0,void 0,wa.mark((function _callee4(){var o,a,c,h=this;return wa.wrap((function _callee4$(m){for(;;)switch(m.prev=m.next){case 0:return m.prev=0,m.next=3,this.core.sendCmd("getNosCdnHost");case 3:o=m.sent,m.next=10;break;case 6:return m.prev=6,m.t0=m.catch(0),this.logger.error("getNosCdnHost::error",m.t0),m.abrupt("return");case 10:if(o){m.next=12;break}return m.abrupt("return");case 12:a=null===(t=null==o?void 0:o.content)||void 0===t?void 0:t.nosConfigTag,0!==(c=Fl(null==a?void 0:a.expire))&&a.cdnDomain?-1===c?(this.config.cdn.bucket=a.bucket,this.config.cdn.cdnDomain=a.cdnDomain,this.config.cdn.objectNamePrefix=a.objectNamePrefix):(this.config.cdn.bucket=a.bucket,this.config.cdn.cdnDomain=a.cdnDomain,this.config.cdn.objectNamePrefix=a.objectNamePrefix,this.nosCdnHostTimer=this.core.timerManager.addTimer((function(){h.getNosCdnHost()}),1e3*c)):(this.config.cdn.bucket="",this.config.cdn.cdnDomain="",this.config.cdn.objectNamePrefix="");case 15:case"end":return m.stop()}}),_callee4,this,[[0,6]])})))},t.getGrayscaleConfig=function getGrayscaleConfig(t){var o;return __awaiter(this,void 0,void 0,wa.mark((function _callee5(){var a,c;return wa.wrap((function _callee5$(h){for(;;)switch(h.prev=h.next){case 0:if(Sc.localStorage)try{Sc.localStorage.getItem&&Sc.localStorage.getItem(this.GRAYKEY)&&(this.grayConfig=JSON.parse(Sc.localStorage.getItem(this.GRAYKEY))[t])}catch(t){Sc.localStorage.getItem(this.GRAYKEY)&&this.core.logger.error("uploadFile:: JSON.parse grayscaleConfig error ",t)}if(this.grayConfig&&!(this.grayConfig.timeStamp+1e3*this.grayConfig.ttl<(new Date).getTime())){h.next=17;break}return h.next=4,this.core.sendCmd("getGrayscaleConfig",{config:{}});case 4:if(!(a=h.sent).content||!a.content.grayConfigTag){h.next=16;break}this.logger.log("uploadFile::getAppGrayConfigRequest success ");try{this.grayConfig=JSON.parse(a.content.grayConfigTag.config),this.grayConfig.ttl=JSON.parse(a.content.grayConfigTag.ttl)}catch(t){this.logger.error("getGrayscaleConfig error",t)}if(this.grayConfig){h.next=10;break}return h.abrupt("return");case 10:c=Sc.localStorage.getItem(this.GRAYKEY)?JSON.parse(Sc.localStorage.getItem(this.GRAYKEY)):{},this.grayConfig.timeStamp=(new Date).getTime(),c[t]=this.grayConfig,Sc.localStorage.setItem(this.GRAYKEY,Aa(c)),h.next=17;break;case 16:this.logger.debug("uploadFile:: result grayConfig:",a.content);case 17:if(!(null===(o=this.grayConfig)||void 0===o?void 0:o.mixStoreEnable)){h.next=20;break}return h.next=20,this._getMixStorePolicy(t);case 20:case"end":return h.stop()}}),_callee5,this)})))},t._getMixStorePolicy=function _getMixStorePolicy(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee6(){var o,a,c,h,m,v,b;return wa.wrap((function _callee6$(x){for(;;)switch(x.prev=x.next){case 0:if(o=(new Date).getTime(),Sc.localStorage)try{this.mixStorePolicy=JSON.parse(Sc.localStorage.getItem(this.MIXSTOREKEY))[t],this.curProvider=Fl(this.mixStorePolicy.providers[0]),this.mixStorePolicy.timeStamp&&this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl>o&&(c=this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl-o,this.core.timerManager.addTimer(bind$1(a=this._getMixStorePolicy).call(a,this,t),c))}catch(o){Sc.localStorage.getItem(this.MIXSTOREKEY)&&JSON.parse(Sc.localStorage.getItem(this.MIXSTOREKEY))[t]&&this.core.logger.error("uploadFile:: JSON.parse mixStorePolicy error ",o)}if(this.mixStorePolicy&&!(this.mixStorePolicy.timeStamp+1e3*this.mixStorePolicy.ttl<=o)){x.next=30;break}return x.prev=3,x.next=6,this.core.sendCmd("getMixStorePolicy",{supportType:this.s3?[1,2]:[1]});case 6:m=x.sent,v=m.content.mixStorePolicyTag,this.mixStorePolicy={providers:[],timeStamp:0,ttl:0,s3Policy:null,nosPolicy:null},this.mixStorePolicy.ttl=Number(v.ttl),this.mixStorePolicy.providers=v.providers.split(","),this.circuitTimer&&this.core.timerManager.deleteTimer(this.circuitTimer),this.curProvider=Fl(this.mixStorePolicy.providers[0]),this.mixStorePolicy.nosPolicy=v.nosPolicy?JSON.parse(v.nosPolicy):null,this.mixStorePolicy.s3Policy=v.s3Policy?JSON.parse(v.s3Policy):null,null===this.mixStorePolicy.s3Policy?this.mixStorePolicy.providers=["1"]:null===this.mixStorePolicy.nosPolicy?this.mixStorePolicy.providers=["2"]:this.mixStorePolicy.providers=this.mixStorePolicy.s3Policy.priority<this.mixStorePolicy.nosPolicy.priority?["2","1"]:["1","2"],this.core.timerManager.addTimer(bind$1(h=this._getMixStorePolicy).call(h,this,t),1e3*this.mixStorePolicy.ttl),b=Sc.localStorage.getItem(this.MIXSTOREKEY)?JSON.parse(Sc.localStorage.getItem(this.MIXSTOREKEY)):{},this.mixStorePolicy.timeStamp=(new Date).getTime(),b[t]=this.mixStorePolicy,Sc.localStorage.setItem(this.MIXSTOREKEY,Aa(b)),x.next=30;break;case 23:if(x.prev=23,x.t0=x.catch(3),this.logger.error("getMixStorePolicy error",x.t0),0!==this.mixStoreErrorCount){x.next=28;break}throw new Error("getMixStorePolicy all count error");case 28:this._getMixStorePolicy(t),this.mixStoreErrorCount--;case 30:this.mixStorePolicy.nosPolicy&&(this.nosErrorCount=this.mixStorePolicy.nosPolicy.uploadConfig.retryPolicy.retry);case 31:case"end":return x.stop()}}),_callee6,this,[[3,23]])})))},t.s3Upload=function s3Upload(t,o){return __awaiter(this,void 0,void 0,wa.mark((function _callee7(){var a,c,h,m,v,b,x,w,S,k,_=this;return wa.wrap((function _callee7$(T){for(;;)switch(T.prev=T.next){case 0:if(!t.file){T.next=4;break}a=t.file,T.next=19;break;case 4:if("string"!=typeof t.fileInput){T.next=14;break}if(this.logger.warn("fileInput will abandon,Please use file or filepath"),!((c=document.getElementById(t.fileInput))&&c.files&&c.files[0])){T.next=11;break}a=c.files[0],T.next=12;break;case 11:throw new Error("Can not get file from fileInput");case 12:T.next=19;break;case 14:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){T.next=18;break}a=t.fileInput.files[0],T.next=19;break;case 18:throw new Error("Can not get file from fileInput "+t.fileInput);case 19:if(this.mixStorePolicy.s3Policy){T.next=21;break}throw new Error("dont get s3 policy");case 21:return h={accessKeyId:o.accessKeyId,secretAccessKey:o.secretAccessKey,sessionToken:o.sessionToken,region:o.region,maxRetries:this.mixStorePolicy.s3Policy.uploadConfig.retryPolicy.retry},m=this.s3,(v=new m).config.update(h),b=decodeURIComponent(o.bucket),x=decodeURIComponent(o.objectName),S={Bucket:b,Key:x,Body:w=a,Metadata:{token:o.token},ContentType:w.type||"application/octet-stream"},this.core.logger.debug("uploadFile:: s3 upload params:",S),k=v.upload(S),T.abrupt("return",new ca((function(a){var c=(new Date).getTime();k.send((function(h,m){var v,b;if(h){_.logger.error("uploadFile:","api::s3:upload file failed",h),_.core.reporter.reportTraceStart("exceptions",{user_id:_.core.options.account,trace_id:null===(b=null===(v=_.core)||void 0===v?void 0:v.socket)||void 0===b?void 0:b.sessionId,start_time:c,action:1}),_.core.reporter.reportTraceUpdateV2("exceptions",{code:"number"==typeof h.status?h.status:"number"==typeof h.code?h.code:0,description:h.message||""+h.code,operation_type:1,target:h.hostname}),_.core.reporter.reportTraceEnd("exceptions",1);try{_._addCircuitTimer()}catch(h){throw new gc("upload file error",h,_.curProvider,_.mixStorePolicy,t.file||t.filePath)}a(_.uploadFile(t))}else{var x=_.mixStorePolicy.s3Policy.cdnSchema;x=(x=x.replace("{cdnDomain}",_.mixStorePolicy.s3Policy.dlcdn)).replace("{objectName}",m.Key),a({size:w.size,name:w.name,url:o.shortUrl?o.shortUrl:x,ext:w.name.split(".")[1]||"unknown"})}}))})));case 32:case"end":return T.stop()}}),_callee7,this)})))},t.getPrivateUrl=function getPrivateUrl(t){var o;if(!new RegExp(/http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- ./?%&=]*)?/).test(t))return this.logger.error("illegal file url:"+t),"";var a=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(t);a[0];var c=a[1];a[2];var h=a[3];a[4];var m=a[5];if(a[6],a[7],null===(o=this.grayConfig)||void 0===o?void 0:o.mixStoreEnable){var v=this._getUrlType(t);return v===Ad.s3&&this.mixStorePolicy.s3Policy&&(t=this.mixStorePolicy.s3Policy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.s3Policy.dlcdn).replace("{objectName}",m)),v===Ad.nos&&this.mixStorePolicy.nosPolicy&&(t=this.mixStorePolicy.nosPolicy.cdnSchema.replace("{cdnDomain}",this.mixStorePolicy.nosPolicy.dlcdn).replace("{objectName}",m)),t}var b=this.config,x=b.downloadUrl,w=b.downloadHostList,S=b.nosCdnEnable,k=this.config.cdn.cdnDomain,_=this.config.cdn.objectNamePrefix?decodeURIComponent(this.config.cdn.objectNamePrefix):"",T=decodeURIComponent(m),C=indexOf(T).call(T,_);if(k&&C>-1&&S)return""+c+k+"/"+slice(T).call(T,C);if(includes(w).call(w,h)&&includes(m).call(m,"/")){var M=indexOf(m).call(m,"/"),E=m.substring(0,M),O=m.substring(M+1);return x.replace("{bucket}",E).replace("{object}",O)}var P=filter(w).call(w,(function(t){return"string"==typeof h&&includes(h).call(h,t)}))[0],I=P?h.replace(P,"").replace(/\W/g,""):null;return I?x.replace("{bucket}",I).replace("{object}",m):t},t.getOriginUrl=function getOriginUrl(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee8(){var o;return wa.wrap((function _callee8$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("getOriginUrl",{nosSafeUrlTag:{safeUrl:t}});case 2:return o=a.sent,a.abrupt("return",o.content.nosSafeUrlTag.originUrl);case 4:case"end":return a.stop()}}),_callee8,this)})))},t.getFileToken=function getFileToken(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee9(){var o,a,c,h,m,v=this;return wa.wrap((function _callee9$(b){for(;;)switch(b.prev=b.next){case 0:if(validate({type:{type:"number",min:2,max:3},urls:{type:"array",required:!1,itemType:"string"}},t),o=this.mixStorePolicy.nosPolicy?this.mixStorePolicy.nosPolicy.authPolicy.policyType:null,a=this.mixStorePolicy.s3Policy?this.mixStorePolicy.s3Policy.authPolicy.policyType:null,o!==String(jd.dontNeed)||a!==String(jd.dontNeed)){b.next=8;break}throw this.logger.error("don't need token"),new Error("don't need token");case 8:if(t.type!==jd.time){b.next=17;break}if(!(o&&indexOf(o).call(o,String(jd.time))>=0||a&&indexOf(a).call(a,String(jd.time))>0)){b.next=13;break}return b.abrupt("return",this.getFileAuthToken(t));case 13:throw this.logger.error("don't support time token "),new Error("don't support type time token ");case 15:b.next=33;break;case 17:if(t.urls&&t.urls.length){b.next=20;break}throw this.logger.error("urls is required when urls token"),new Error("urls is required when urls token");case 20:if(h=[],m=[],forEach$1(c=t.urls).call(c,(function(t){var o=v._getUrlType(t);o===Ad.nos&&m.push(t),o===Ad.s3&&h.push(t)})),(!a||0!==h.length&&indexOf(a).call(a,String(jd.urls))<0)&&(this.logger.warn("s3 url don't support url token"),h=[]),(!o||0!==m.length&&indexOf(o).call(o,String(jd.urls))<0)&&(this.logger.warn("nos url don't support url token"),m=[]),0!==h.length||0!==m.length){b.next=30;break}throw this.logger.error("not support urls"),new Error("not support urls");case 30:if(0!==h.length&&0!==m.length){b.next=33;break}return t.urls=Aa(t.urls),b.abrupt("return",this.getFileAuthToken(t));case 33:case"end":return b.stop()}}),_callee9,this)})))},t.getFileAuthToken=function getFileAuthToken(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee10(){var o;return wa.wrap((function _callee10$(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.core.sendCmd("getFileAuthToken",{mixStoreAuthTokenReqTag:t});case 2:return o=a.sent,a.abrupt("return",o.content.mixStoreAuthTokenResTag);case 4:case"end":return a.stop()}}),_callee10,this)})))},t._getUrlType=function _getUrlType(t){var o,a;return this.mixStorePolicy.nosPolicy&&some(o=this.mixStorePolicy.nosPolicy.dlcdns).call(o,(function(o){return indexOf(t).call(t,o)>=0}))?Ad.nos:this.mixStorePolicy.s3Policy&&some(a=this.mixStorePolicy.s3Policy.dlcdns).call(a,(function(o){return indexOf(t).call(t,o)>=0}))?Ad.s3:null},t._addCircuitTimer=function _addCircuitTimer(){var t=this,o=this.mixStorePolicy.providers,a=o[(indexOf(o).call(o,String(this.curProvider))+1)%o.length];if(a===o[0])throw new Error("uploadFile all policy fail");var c=od(this.mixStorePolicy,"s3Policy.uploadConfig.retryPolicy");if(c&&c.retryNext&&a&&(this.logger.log("uploadFile:: upload policy will change,now policy:"+this.curProvider+" nextProvider:"+a),this.curProvider=Fl(a),this.mixStorePolicy.nosPolicy&&this.mixStorePolicy.s3Policy)){var h=this.mixStorePolicy[this.curProvider===Ad.nos?"nosPolicy":"s3Policy"].uploadConfig.retryPolicy.circuit;if(!h||0===h)return;this.circuitTimer=this.core.timerManager.addTimer((function(){t.logger.log("uploadFile:: upload policy will change,now policy:"+t.curProvider+" nextProvider:"+Fl(t.mixStorePolicy.providers[0])),t.curProvider=Fl(t.mixStorePolicy.providers[0]),t.core.timerManager.deleteTimer(t.circuitTimer)}),1e3*h)}},t.process=function process(t){var o=this[t.cmd+"Handler"];return"function"==typeof o?o.call(this,t):t.error&&!t.error.ignore?ca.reject(t.error):ca.resolve(t)},CloudStorageService}(),Dd=function(t){function ChatroomMsgService(o){return t.call(this,"chatroomMsg",o)||this}kt(ChatroomMsgService,t);var o=ChatroomMsgService.prototype;return o.sendTextMsg=function sendTextMsg(t){return validate({body:{type:"string",allowEmpty:!1}},t),this.sendMsg(Ma(Ma({},t),{type:"text"}))},o.sendGeoLocationMsg=function sendGeoLocationMsg(t){return validate({body:{type:"object",rules:{title:{type:"string",allowEmpty:!1},lat:{type:"number"},lng:{type:"number"}}}},t),this.sendMsg(Ma(Ma({},t),{type:"geo",body:Aa(t.body)}))},o.sendTipMsg=function sendTipMsg(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee(){return wa.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),o.abrupt("return",this.sendMsg(Ma(Ma({},t),{type:"tip"})));case 2:case"end":return o.stop()}}),_callee,this)})))},o.sendCustomMsg=function sendCustomMsg(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){return wa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return validate({body:{type:"string",allowEmpty:!1}},t),o.abrupt("return",this.sendMsg(Ma(Ma({},t),{type:"custom"})));case 2:case"end":return o.stop()}}),_callee2,this)})))},o.sendImageMsg=function sendImageMsg(t){return this.doSendFile(Ma(Ma({},t),{type:"image"}))},o.sendFileMsg=function sendFileMsg(t){return this.doSendFile(Ma(Ma({},t),{type:"file"}))},o.sendAudioMsg=function sendAudioMsg(t){return this.doSendFile(Ma(Ma({},t),{type:"audio"}))},o.sendVideoMsg=function sendVideoMsg(t){return this.doSendFile(Ma(Ma({},t),{type:"video"}))},o.doSendFile=function doSendFile(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee3(){var o;return wa.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:if(validate({type:{type:"string",allowEmpty:!1},body:{type:"object",rules:{url:{type:"string",allowEmpty:!1}},required:!1},maxSize:{type:"number",min:1,required:!1}},t),o=t.body){a.next=27;break}if(this.core.cloudStorage&&this.core.cloudStorage.uploadFile){a.next=5;break}throw new Error('Service "cloudStorage" does not exist');case 5:return a.prev=5,this.core.reporter.reportTraceStart("nos",{user_id:this.core.account,action:"upload"}),a.next=9,this.core.cloudStorage.uploadFile(t);case 9:o=a.sent,this.core.reporter.reportTraceEnd("nos",!0),a.next=19;break;case 13:throw a.prev=13,a.t0=a.catch(5),this.core.reporter.reportTraceUpdate("nos",{operation_type:"transfer",error:a.t0},!1),this.core.reporter.reportTraceEnd("nos",!1),this.logger.error("sendFile:: upload File error or abort",a.t0),a.t0;case 19:a.prev=19,t.onUploadDone&&t.onUploadDone(o),a.next=27;break;case 23:throw a.prev=23,a.t1=a.catch(19),this.logger.error("sendFile options.onUploadDone err",a.t1),a.t1;case 27:return a.abrupt("return",this.sendMsg(Ma(Ma({},t),{body:Aa(o),type:t.type})));case 28:case"end":return a.stop()}}),_callee3,this,[[5,13],[19,23]])})))},o.queryMessageHistory=function queryMessageHistory(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee4(){var o,a,c;return wa.wrap((function _callee4$(h){for(;;)switch(h.prev=h.next){case 0:return validate({timetag:{type:"number",required:!1},limit:{type:"number",min:1,max:100,required:!1},reverse:{type:"boolean",required:!1},msgTypes:{type:"array",itemType:"string",required:!1}},t),h.next=3,this.core.sendCmd("chatroomQueryMessageHistory",Ma(Ma({timetag:0,limit:100,reverse:!1},t),{msgTypes:t.msgTypes?map(o=t.msgTypes).call(o,(function(t){return jf[t]})):[]}));case 3:return a=h.sent,c=a.content.chatroomMsgs,h.abrupt("return",formatChatroomMsgs(c,this.core.account));case 6:case"end":return h.stop()}}),_callee4,this)})))},o.getHistoryMsgsByTags=function getHistoryMsgsByTags(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee5(){var o,a,c,h,m;return wa.wrap((function _callee5$(v){for(;;)switch(v.prev=v.next){case 0:return validate({tags:{type:"array",itemType:"string",required:!0},types:{type:"array",itemType:"string",required:!1},fromTime:{type:"number",min:0,required:!1},toTime:{type:"number",min:0,required:!1},limit:{type:"number",min:0,required:!1},reverse:{type:"number",required:!1}},t),c=Ma(Ma({fromTime:0,toTime:0,limit:100,reverse:0},t),{types:t.types?map(o=filter(a=t.types).call(a,(function(t){return void 0!==jf[t]}))).call(o,(function(t){return jf[t]})):[]}),v.next=4,this.core.sendCmd("getHistoryMsgsByTags",{chatRoomTagHistoryMsgRequestTag:Ma(c,{tags:Aa(c.tags),types:Aa(c.types)})});case 4:return h=v.sent,m=h.content.chatroomMsgs,v.abrupt("return",formatChatroomMsgs(m,this.core.account));case 7:case"end":return v.stop()}}),_callee5,this)})))},o.onChatroomMsgHandler=function onChatroomMsgHandler(t){var o=t.content,a=Pa(),c=formatChatroomMsg(null==o?void 0:o.chatroomMsg,this.core.account);if("debug"===this.core.options.debugLevel?this.logger.debug("onChatroomMsgHandler::recvMsg",c.type,c.idClient,c):this.logger.log("onChatroomMsgHandler::recvMsg",c.type,c.idClient),this.core.emit("chatroomMsg",c),"out"!==c.flow){var h={msgId:"",clientId:c.idClient,receiveTime:t.__receiveTime,serverTime:c.time,callbackTime:Pa(),preHandleTime:a,fromAccid:c.from,toAccid:this.core.account,type:4,roomId:c.chatroomId,tid:"",result:200,failReason:"",rt:Pa()-c.time};this.core.reporter.report("msgReceive",h,!0)}},o.sendMsg=function sendMsg(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee6(){var o,a,c,h,m;return wa.wrap((function _callee6$(v){for(;;)switch(v.prev=v.next){case 0:validate({type:{type:"enum",values:getEnumKeys(jf)},subType:{type:"number",min:1,required:!1}},t),o=generatorMsgForCmd(t,this.core.account,this.core.config.deviceId),a=formatChatroomMsg(Ma(Ma({},o),{status:"sending",time:(new Date).getTime()}),this.core.account);try{t.onSendBefore&&t.onSendBefore(a)}catch(t){this.core.logger.error("sendMsg: options.onSendBefore error",t)}return v.prev=4,v.next=7,this.core.sendCmd("sendChatroomMsg",{chatroomMsg:o});case 7:return c=v.sent,h=formatChatroomMsg(Ma(Ma(Ma({},o),c.content.chatroomMsg),{status:"success"}),this.core.account),this.core.reporter.report("msgSend",{msgId:"",clientId:h.idClient,msgTime:h.time,fromAccid:this.core.account,toAccid:"",type:4,roomId:h.chatroomId,tid:"",result:200,faiReason:"",rt:Pa()-a.time}),v.abrupt("return",h);case 13:throw v.prev=13,v.t0=v.catch(4),m=formatChatroomMsg(Ma(Ma({},o),{status:"fail"}),this.core.account),v.t0.msg=m,this.core.reporter.report("msgSend",{msgId:"",clientId:m.idClient,fromAccid:this.core.account,toAccid:"",type:4,roomId:m.chatroomId,tid:"",result:null===v.t0||void 0===v.t0?void 0:v.t0.code,faiReason:(null===v.t0||void 0===v.t0?void 0:v.t0.message)||"",rt:Pa()-o.time}),v.t0;case 19:case"end":return v.stop()}}),_callee6,this,[[4,13]])})))},ChatroomMsgService}(Bf);!function(t){t[t.regular=0]="regular",t[t.temp=1]="temp",t[t.regularOnline=2]="regularOnline",t[t.regularReverse=3]="regularReverse"}(Nd||(Nd={}));var Bd=function(t){function ChatroomMemberService(o){return t.call(this,"chatroomMember",o)||this}kt(ChatroomMemberService,t);var o=ChatroomMemberService.prototype;return o.updateMyRoomRole=function updateMyRoomRole(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee(){return wa.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return validate({member:{type:"object",rules:{nick:{type:"string",required:!1},avatar:{type:"string",required:!1},ext:{type:"string",required:!1}}},needNotify:{type:"boolean"},ext:{type:"string",required:!1},needSave:{type:"boolean",required:!1}},t),o.next=3,this.core.sendCmd("chatroomUpdateMyRoomRole",Ma(Ma({},t),{chatroomMember:t.member,ext:t.ext||""}));case 3:case"end":return o.stop()}}),_callee,this)})))},o.setMemberManager=function setMemberManager(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){return wa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.markChatroomMember(Ma(Ma({},t),{type:1}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}}),_callee2,this)})))},o.setMemberNormal=function setMemberNormal(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee3(){return wa.wrap((function _callee3$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.markChatroomMember(Ma(Ma({},t),{type:2}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}}),_callee3,this)})))},o.setMemberMute=function setMemberMute(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee4(){return wa.wrap((function _callee4$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.markChatroomMember(Ma(Ma({},t),{type:-2}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}}),_callee4,this)})))},o.setMemberBlackList=function setMemberBlackList(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee5(){return wa.wrap((function _callee5$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.markChatroomMember(Ma(Ma({},t),{type:-1}));case 2:return o.abrupt("return",o.sent);case 3:case"end":return o.stop()}}),_callee5,this)})))},o.queryMembers=function queryMembers(t){var o;return __awaiter(this,void 0,void 0,wa.mark((function _callee6(){var a;return wa.wrap((function _callee6$(c){for(;;)switch(c.prev=c.next){case 0:return validate({type:{type:"enum",values:getEnumKeys(Nd)},time:{type:"number",required:!1},limit:{type:"number",required:!1}},t),c.next=3,this.core.sendCmd("chatroomQueryMembers",Ma(Ma({time:0,limit:100},t),{type:Nd[t.type]}));case 3:return a=c.sent,c.abrupt("return",formatChatroomMembers(null===(o=a.content)||void 0===o?void 0:o.members));case 5:case"end":return c.stop()}}),_callee6,this)})))},o.queryMembersByAccounts=function queryMembersByAccounts(t){var o;return __awaiter(this,void 0,void 0,wa.mark((function _callee7(){var a;return wa.wrap((function _callee7$(c){for(;;)switch(c.prev=c.next){case 0:return validate({accounts:{type:"array",min:1,max:20,itemType:"string"}},t),c.next=3,this.core.sendCmd("chatroomQueryMembersByAccounts",t);case 3:return a=c.sent,c.abrupt("return",formatChatroomMembers(null===(o=a.content)||void 0===o?void 0:o.members));case 5:case"end":return c.stop()}}),_callee7,this)})))},o.setMemberTempMute=function setMemberTempMute(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee8(){return wa.wrap((function _callee8$(o){for(;;)switch(o.prev=o.next){case 0:return validate({account:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean",required:!1},ext:{type:"string",required:!1}},t),o.next=3,this.core.sendCmd("chatroomSetMemberTempMute",Ma(Ma({},t),{ext:t.ext||""}));case 3:case"end":return o.stop()}}),_callee8,this)})))},o.kickMember=function kickMember(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee9(){return wa.wrap((function _callee9$(o){for(;;)switch(o.prev=o.next){case 0:return validate({account:{type:"string",allowEmpty:!1},ext:{type:"string",required:!1}},t),o.next=3,this.core.sendCmd("chatroomKickMember",Ma(Ma({},t),{ext:t.ext||""}));case 3:case"end":return o.stop()}}),_callee9,this)})))},o.queryMembersCountByTag=function queryMembersCountByTag(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee10(){var o;return wa.wrap((function _callee10$(a){for(;;)switch(a.prev=a.next){case 0:return validate({tag:{type:"string",allowEmpty:!1}},t),a.next=3,this.core.sendCmd("chatroomQueryMembersCountByTag",Ma({},t));case 3:return o=a.sent,a.abrupt("return",o.content.count);case 5:case"end":return a.stop()}}),_callee10,this)})))},o.queryMembersByTag=function queryMembersByTag(t){var o;return __awaiter(this,void 0,void 0,wa.mark((function _callee11(){var a;return wa.wrap((function _callee11$(c){for(;;)switch(c.prev=c.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},time:{type:"number",required:!1},limit:{type:"number",max:100,required:!1}},t),c.next=3,this.core.sendCmd("chatroomQueryMembersByTag",{chatroomTagMemberReq:Ma({time:0,limit:100},t)});case 3:return a=c.sent,c.abrupt("return",formatChatroomMembers(null===(o=a.content)||void 0===o?void 0:o.members));case 5:case"end":return c.stop()}}),_callee11,this)})))},o.setMembersTempMuteByTag=function setMembersTempMuteByTag(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee12(){return wa.wrap((function _callee12$(o){for(;;)switch(o.prev=o.next){case 0:return validate({tag:{type:"string",allowEmpty:!1},duration:{type:"number",min:0},needNotify:{type:"boolean"},notifyTargetTags:{type:"string",allowEmpty:!1,required:!1},ext:{type:"string",required:!1}},t),o.next=3,this.core.sendCmd("chatroomSetMembersTempMuteByTag",{chatroomTagMuteReq:Ma(Ma({},t),{needNotify:t.needNotify?1:0,ext:t.ext||""})});case 3:case"end":return o.stop()}}),_callee12,this)})))},o.markChatroomMember=function markChatroomMember(t){var o;return __awaiter(this,void 0,void 0,wa.mark((function _callee13(){var a;return wa.wrap((function _callee13$(c){for(;;)switch(c.prev=c.next){case 0:return validate({account:{type:"string"},isAdd:{type:"boolean"},ext:{type:"string",required:!1},level:{type:"number",required:!1}},t),c.next=3,this.core.sendCmd("markChatroomMember",Ma(Ma({level:0},t),{ext:t.ext||""}));case 3:return a=c.sent,c.abrupt("return",formatChatroomMember(null===(o=a.content)||void 0===o?void 0:o.chatroomMember));case 5:case"end":return c.stop()}}),_callee13,this)})))},ChatroomMemberService}(Bf),qd=function(t){function ChatroomQueueService(o){return t.call(this,"chatroomQueue",o)||this}kt(ChatroomQueueService,t);var o=ChatroomQueueService.prototype;return o.init=function init(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee(){return wa.wrap((function _callee$(o){for(;;)switch(o.prev=o.next){case 0:return validate({maxItemCount:{type:"number",min:0,max:1e3}},t),o.next=3,this.core.sendCmd("chatroomQueueInit",t);case 3:case"end":return o.stop()}}),_callee,this)})))},o.update=function update(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee2(){return wa.wrap((function _callee2$(o){for(;;)switch(o.prev=o.next){case 0:return validate({elementKey:{type:"string",allowEmpty:!1},elementValue:{type:"string",max:4096,allowEmpty:!1},transient:{type:"boolean",required:!1},account:{type:"string",required:!1}},t),o.next=3,this.core.sendCmd("chatroomQueueOffer",Ma(Ma({},t),{transient:!!t.transient}));case 3:case"end":return o.stop()}}),_callee2,this)})))},o.poll=function poll(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee3(){var o;return wa.wrap((function _callee3$(a){for(;;)switch(a.prev=a.next){case 0:return validate({key:{type:"string",required:!1}},t),t.key||(t.key=""),a.next=4,this.core.sendCmd("chatroomQueuePoll",t||{});case 4:return o=a.sent,a.abrupt("return",o.content);case 6:case"end":return a.stop()}}),_callee3,this)})))},o.batchUpdate=function batchUpdate(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee4(){var o;return wa.wrap((function _callee4$(a){for(;;)switch(a.prev=a.next){case 0:return validate({itemList:{type:"object"},needNotify:{type:"boolean",required:!1},notifyExtension:{type:"string",required:!1}},t),a.next=3,this.core.sendCmd("chatroomQueueChange",Ma(Ma({},t),{needNotify:!!t.needNotify}));case 3:return o=a.sent,a.abrupt("return",o.content.invalidKeyList);case 5:case"end":return a.stop()}}),_callee4,this)})))},o.fetch=function fetch(){return __awaiter(this,void 0,void 0,wa.mark((function _callee5(){var t;return wa.wrap((function _callee5$(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.core.sendCmd("chatroomQueueList");case 2:return t=o.sent,o.abrupt("return",t.content.itemList);case 4:case"end":return o.stop()}}),_callee5,this)})))},o.pickHeader=function pickHeader(){return __awaiter(this,void 0,void 0,wa.mark((function _callee6(){var t,o,a,c;return wa.wrap((function _callee6$(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,this.core.sendCmd("chatroomQueuePeak");case 2:return o=h.sent,a=o.content.elementKey,c=o.content.elementValue,h.abrupt("return",((t={})[a]=c,t));case 6:case"end":return h.stop()}}),_callee6,this)})))},o.clear=function clear(){return __awaiter(this,void 0,void 0,wa.mark((function _callee7(){return wa.wrap((function _callee7$(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.core.sendCmd("chatroomQueueDrop");case 2:case"end":return t.stop()}}),_callee7,this)})))},ChatroomQueueService}(Bf),zd={"1_2":"heartbeat","13_2":"chatroomLogin","13_3":"beKickedFromChatroom","13_4":"chatroomExit","13_6":"sendChatroomMsg","13_7":"onChatroomMsg","13_8":"chatroomQueryMembers","13_9":"chatroomQueryMessageHistory","13_11":"markChatroomMember","13_12":"closeChatroom","13_13":"getChatroom","13_14":"updateChatroom","13_15":"chatroomUpdateMyRoomRole","13_16":"chatroomQueryMembersByAccounts","13_17":"chatroomKickMember","13_19":"chatroomSetMemberTempMute","13_20":"chatroomQueueOffer","13_21":"chatroomQueuePoll","13_22":"chatroomQueueList","13_23":"chatroomQueuePeak","13_24":"chatroomQueueDrop","13_25":"chatroomQueueInit","13_26":"chatroomQueueChange","13_30":"chatroomSetMembersTempMuteByTag","13_31":"chatroomQueryMembersByTag","13_32":"chatroomQueryMembersCountByTag","13_36":"getHistoryMsgsByTags","13_101":"updateChatroomTag"},Kd={chatroomLogin:{appkey:1,account:2,deviceId:3,chatroomId:5,appLogin:8,chatroomNick:20,chatroomAvatar:21,chatroomExt:22,chatroomEnterExt:23,session:26,isAnonymous:38,tags:39,notifyTargetTags:40,authType:41,loginExt:42},chatroomIMLogin:{clientType:3,os:4,sdkVersion:6,appLogin:8,protocolVersion:9,pushTokenName:10,pushToken:11,deviceId:13,appkey:18,account:19,browser:24,session:26,deviceInfo:32,token:1e3,customTag:38,customClientType:39,sdkHumanVersion:40,sdkType:41,userAgent:42,isReactNative:112,authType:115,loginExt:116},chatroomMsg:{idClient:1,type:2,body:3,ext:4,resend:5,userUpdateTime:6,fromNick:7,fromAvatar:8,fromExt:9,needAntiSpam:10,antiSpamContent:11,skipHistory:12,messageBody:13,antiSpamBusinessId:14,clientAntiSpam:15,antiSpamUsingYidun:16,time:20,from:21,chatroomId:22,fromClientType:23,highPriority:25,callbackExt:27,subType:28,yidunAntiCheating:29,env:30,notifyTargetTags:31,yidunAntiSpamExt:32,yidunAntiSpamRes:33},chatroom:{id:1,name:3,announcement:4,broadcastUrl:5,ext:12,createTime:14,updateTime:15,queuelevel:16,creator:100,onlineMemberNum:101,mute:102},chatroomMember:{chatroomId:1,account:2,type:3,level:4,nick:5,avatar:6,ext:7,online:8,guest:9,enterTime:10,blacked:12,muted:13,valid:14,updateTime:15,tempMuted:16,tempMuteDuration:17},chatroomTagMemberReq:{tag:1,time:2,limit:3},chatroomTagMuteReq:{tag:1,duration:2,needNotify:3,ext:4,notifyTargetTags:5},chatroomCdnInfo:{enable:1,cdnUrls:2,timestamp:3,interval:4,decryptType:5,decryptKey:6,timeout:7},chatRoomTagHistoryMsgRequestTag:{tags:1,types:2,fromTime:3,toTime:4,limit:5,reverse:6},updateTags:{currentTags:1}},Hd=invertSerializeMap(Kd),Gd={heartbeat:{sid:1,cid:2,service:"chatroom"},chatroomLogin:{sid:13,cid:2,service:"chatroom",params:[{type:"Byte",name:"type"},{type:"Property",name:"chatroomLogin",reflectMapper:Kd.chatroomLogin},{type:"Property",name:"chatroomIMLogin",reflectMapper:Kd.chatroomIMLogin}],response:[{type:"Property",name:"chatroom",reflectMapper:Hd.chatroom},{type:"Property",name:"chatroomMember",reflectMapper:Hd.chatroomMember},{type:"Property",name:"chatroomCdnInfo",reflectMapper:Hd.chatroomCdnInfo}]},chatroomExit:{sid:13,cid:4,service:"chatroom"},sendChatroomMsg:{sid:13,cid:6,service:"chatroomMsg",params:[{type:"Property",name:"chatroomMsg",reflectMapper:Kd.chatroomMsg}],response:[{type:"Property",name:"chatroomMsg",reflectMapper:Hd.chatroomMsg}]},chatroomQueryMessageHistory:{sid:13,cid:9,service:"chatroomMsg",params:[{type:"Long",name:"timetag"},{type:"Int",name:"limit"},{type:"Bool",name:"reverse"},{type:"LongArray",name:"msgTypes"}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:Hd.chatroomMsg}]},getHistoryMsgsByTags:{sid:13,cid:36,service:"chatroomMsg",params:[{type:"Property",name:"chatRoomTagHistoryMsgRequestTag",reflectMapper:Kd.chatRoomTagHistoryMsgRequestTag}],response:[{type:"PropertyArray",name:"chatroomMsgs",reflectMapper:Hd.chatroomMsg}]},getChatroom:{sid:13,cid:13,service:"chatroom",response:[{type:"Property",name:"chatroom",reflectMapper:Hd.chatroom}]},updateChatroom:{sid:13,cid:14,service:"chatroom",params:[{type:"Property",name:"chatroom",reflectMapper:Kd.chatroom},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"}]},chatroomUpdateMyRoomRole:{sid:13,cid:15,service:"chatroomMember",params:[{type:"Property",name:"chatroomMember",reflectMapper:Kd.chatroomMember},{type:"Bool",name:"needNotify"},{type:"String",name:"ext"},{type:"Bool",name:"needSave"}]},markChatroomMember:{sid:13,cid:11,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Int",name:"type"},{type:"Bool",name:"isAdd"},{type:"Int",name:"level"},{type:"String",name:"ext"}],response:[{type:"Property",name:"chatroomMember",reflectMapper:Hd.chatroomMember}]},chatroomQueryMembers:{sid:13,cid:8,service:"chatroomMember",params:[{type:"Byte",name:"type"},{type:"Long",name:"time"},{type:"Int",name:"limit"}],response:[{type:"PropertyArray",name:"members",reflectMapper:Hd.chatroomMember}]},chatroomQueryMembersByAccounts:{sid:13,cid:16,service:"chatroomMember",params:[{type:"StrArray",name:"accounts"}],response:[{type:"PropertyArray",name:"members",reflectMapper:Hd.chatroomMember}]},chatroomKickMember:{sid:13,cid:17,service:"chatroomMember",params:[{type:"string",name:"account"},{type:"string",name:"ext"}]},chatroomSetMemberTempMute:{sid:13,cid:19,service:"chatroomMember",params:[{type:"String",name:"account"},{type:"Long",name:"duration"},{type:"bool",name:"needNotify"},{type:"String",name:"ext"}]},closeChatroom:{sid:13,cid:12,service:"chatroom",params:[{type:"String",name:"ext"}]},chatroomQueryMembersCountByTag:{sid:13,cid:32,service:"chatroomMember",params:[{type:"String",name:"tag"}],response:[{type:"Long",name:"count"}]},chatroomQueryMembersByTag:{sid:13,cid:31,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMemberReq",reflectMapper:Kd.chatroomTagMemberReq}],response:[{type:"PropertyArray",name:"members",reflectMapper:Hd.chatroomMember}]},chatroomSetMembersTempMuteByTag:{sid:13,cid:30,service:"chatroomMember",params:[{type:"Property",name:"chatroomTagMuteReq",reflectMapper:Kd.chatroomTagMuteReq}]},chatroomQueueOffer:{sid:13,cid:20,service:"chatroomQueue",params:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"},{type:"bool",name:"transient"},{type:"String",name:"account"}]},chatroomQueuePoll:{sid:13,cid:21,service:"chatroomQueue",params:[{type:"String",name:"key"}],response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueChange:{sid:13,cid:26,service:"chatroomQueue",params:[{type:"StrStrMap",name:"itemList"},{type:"bool",name:"needNotify"},{type:"String",name:"notifyExtension"}],response:[{type:"StrArray",name:"invalidKeyList"}]},chatroomQueueList:{sid:13,cid:22,service:"chatroomQueue",response:[{type:"KVArray",name:"itemList"}]},chatroomQueuePeak:{sid:13,cid:23,service:"chatroomQueue",response:[{type:"String",name:"elementKey"},{type:"String",name:"elementValue"}]},chatroomQueueDrop:{sid:13,cid:24,service:"chatroomQueue"},chatroomQueueInit:{sid:13,cid:25,service:"chatroomQueue",params:[{type:"Int",name:"maxItemCount"}]},onChatroomMsg:{sid:13,cid:7,service:"chatroomMsg",response:[{type:"Property",name:"chatroomMsg",reflectMapper:Hd.chatroomMsg}]},beKickedFromChatroom:{sid:13,cid:3,service:"chatroom",response:[{type:"Number",name:"reason"},{type:"String",name:"ext"}]},updateChatroomTag:{sid:13,cid:101,service:"chatroom",response:[{type:"Property",name:"updateTags",reflectMapper:Hd.updateTags}]}},$d={BROWSER:0,RN:2,UNIAPP:3,WECHAT:6},Wd={debugLevel:"off",needReconnect:!0,reconnectionAttempts:Sa,autoMarkRead:!0,isAbtestEnable:!0,abtestUrl:"https://abt-online.netease.im/v1/api/abt/client/getExperimentInfo",abtestProjectKey:"imElite_sdk_abtest_web"},Vd=function(t){function Chatroom(o,a){var h;return void 0===a&&(a={}),(h=t.call(this,o)||this).instanceName="Chatroom",h.account="",h.options={},h.chatroom={},h.chatroomMsg={},h.chatroomMember={},h.chatroomQueue={},h.cloudStorage={},h.setOptions(o),registerParser({cmdMap:zd,cmdConfig:Gd}),registerParser({cmdMap:Ed,cmdConfig:Id}),h.chatroom=new qf(c(h)),h.chatroomMsg=new Dd(c(h)),h.chatroomMember=new Bd(c(h)),h.chatroomQueue=new qd(c(h)),h.cloudStorage=new Ud(c(h),Ma({storageKeyPrefix:h.instanceName},a.cloudStorageConfig)),Chatroom.instance=c(h),h}kt(Chatroom,t),Chatroom.getInstance=function getInstance(t,o){if(!Chatroom.instance){if(t)return new Chatroom(t,o);throw new Error("Instance not exist, please input options")}if(t){if(Chatroom.instance.options.account===t.account&&Chatroom.instance.options.appkey===t.appkey)return Chatroom.instance.setOptions(t),Chatroom.instance;throw new Error("Unexpected login")}return Chatroom.instance};var o=Chatroom.prototype;return o.setOptions=function setOptions(t){validate({account:{type:"string"},appkey:{type:"string"},token:{type:"string"},chatroomId:{type:"string"},chatroomAddresses:{type:"array",itemType:"string",min:1},needReconnect:{type:"boolean",required:!1},reconnectionAttempts:{type:"number",required:!1},isAnonymous:{type:"boolean",required:!1},tags:{type:"array",itemType:"string",required:!1}},t),this.logger.log("chatroom::setOptions options is",t),this.account=t.account,this.options=Ma(Ma({},Wd),t)},o.connect=function connect(o){void 0===o&&(o={});var a=ut(null,{connect:{get:function get(){return t.prototype.connect}}});return __awaiter(this,void 0,void 0,wa.mark((function _callee(){var t,c,h,m,v;return wa.wrap((function _callee$(b){for(;;)switch(b.prev=b.next){case 0:if(/^(unconnected|waitReconnect)$/.test(this.status)){b.next=4;break}return t="Chatroom status is "+this.status+", and would not connect",this.logger.warn(t),b.abrupt("return",ca.reject(t));case 4:return c=o.isAutoReconnect||!1,h=Pa(),b.next=8,a.connect.call(this,{linkUrls:this.options.chatroomAddresses,isAutoReconnect:c});case 8:return m=b.sent,b.prev=9,b.next=12,this.login(c);case 12:v=b.sent,this.reporter.report("chatroomLogin",{accid:this.account,roomId:this.options.chatroomId,serverIps:this.options.chatroomAddresses,currentServerIp:m,rt:Pa()-h,result:200,failReason:"",time:Pa()}),b.next=25;break;case 16:if(b.prev=16,b.t0=b.catch(9),this.logger.error("chatroom login error",b.t0),this.reporter.report("chatroomLogin",{accid:this.account,roomId:this.options.chatroomId,serverIps:this.options.chatroomAddresses,currentServerIp:m,rt:Pa()-h,result:b.t0&&b.t0.error&&b.t0.error.code,failReason:b.t0&&b.t0.error&&b.t0.error.message,time:Pa()}),0!==this.retryCount){b.next=23;break}throw this.doDisconnect(Xl.ACTIVE,"FailedToInitializeLogin"),b.t0;case 23:return this.doDisconnect(Xl.OFFLINE,"ReconnectLoginFailed"),b.abrupt("return");case 25:return b.prev=25,b.next=28,this.cloudStorage.init();case 28:b.next=33;break;case 30:b.prev=30,b.t1=b.catch(25),this.logger.error("NIM:login cloudStorage init failed ",b.t1);case 33:this.eventBus.emit("logined",v),this.emit("logined",v),this.resetConnectStatus(),this.ping();case 37:case"end":return b.stop()}}),_callee,this,[[9,16],[25,30]])})))},o.login=function login(t){var o,a;return void 0===t&&(t=!1),__awaiter(this,void 0,void 0,wa.mark((function _callee2(){var c,h,m,v,b,x,w;return wa.wrap((function _callee2$(S){for(;;)switch(S.prev=S.next){case 0:return c=this.options,h=Sc.getSystemInfo(),m=Ma(Ma({},c),{appLogin:t?0:1,deviceId:this.config.deviceId,clientType:16,protocolVersion:1,sdkVersion:90902,sdkHumanVersion:"0.12.2",os:h.os,browser:h.browser,session:null===(o=this.socket)||void 0===o?void 0:o.sessionId,sdkType:$d[Sc.platform]||0,userAgent:"Native/0.12.2"}),v=Ma(Ma({},c),{appkey:c.appkey,account:c.account,deviceId:this.config.deviceId,session:null===(a=this.socket)||void 0===a?void 0:a.sessionId,appLogin:1}),c.isAnonymous&&(v.isAnonymous=1,v.account=v.account||"nimanon_"+Nl(),m.account=v.account,v.chatroomNick=v.account||"nimanon_"+Nl(),v.chatroomAvatar=v.chatroomAvatar||" "),c.tags&&c.tags.length>0&&(v.tags=Aa(c.tags)),S.next=8,this.sendCmd("chatroomLogin",{type:1,chatroomLogin:v,chatroomIMLogin:m});case 8:return b=S.sent,this.status="logined",x=formatChatroom(b.content.chatroom),w=formatChatroomMember(b.content.chatroomMember),S.abrupt("return",{chatroom:x,member:w});case 13:case"end":return S.stop()}}),_callee2,this)})))},o.onMessage=function onMessage(o){var a,c,h=t.prototype.onMessage.call(this,o);if(h){var m=h.raw.ser,v=this.sendingCmdMap.get(m);if(v&&v.cmd===h.cmd){var b=v.callback,x=v.timer,w=v.params;if(clearTimeout(x),h.params=w,this.sendingCmdMap.delete(m),"heartbeat"===h.cmd)return void b[0]();var S=null===(a=this[h.service])||void 0===a?void 0:a.process(h);S&&"function"==typeof S.then?S.then((function(t){b[0](t)})).catch((function(t){b[1](t)})):(this.logger.log("imsocket:: handlerFn without promise",h.service,h.cmd),b[0]())}else null===(c=this[h.service])||void 0===c||c.process(h)}},o.disconnect=function disconnect(){var o=this;switch(this.status){case"connected":case"logined":return this.sendCmd("chatroomExit").then((function(){t.prototype.doDisconnect.call(o,Xl.ACTIVE,"UserActiveDisconnect")}));case"connecting":case"waitReconnect":return t.prototype.doDisconnect.call(this,Xl.ACTIVE,"UserActiveDisconnect"),ca.resolve();case"unconnected":case"destroyed":return ca.resolve()}},o.destroy=function destroy(){return Chatroom.instance=null,t.prototype.destroy.call(this)},Chatroom}(tf);Vd.instance=null;var Qd=Math.min,Jd=[].lastIndexOf,Xd=!!Jd&&1/[1].lastIndexOf(1,-0)<0,Yd=arrayMethodIsStrict("lastIndexOf"),Zd=Xd||!Yd?function lastIndexOf(t){if(Xd)return w(Jd,this,arguments)||0;var o=toIndexedObject(this),a=lengthOfArrayLike(o),c=a-1;for(arguments.length>1&&(c=Qd(c,toIntegerOrInfinity(arguments[1]))),c<0&&(c=a+c);c>=0;c--)if(c in o&&o[c]===t)return c||0;return-1}:Jd;_export({target:"Array",proto:!0,forced:Zd!==[].lastIndexOf},{lastIndexOf:Zd});var eh=entryVirtual("Array").lastIndexOf,th=Array.prototype,lastIndexOf=function(t){var o=t.lastIndexOf;return t===th||K(th,t)&&o===th.lastIndexOf?eh:o},rh=createCommonjsModule((function(o,a){(function(){var c={function:!0,object:!0}[typeof window]&&window||this,h=a,m=o&&!o.nodeType&&o,v=h&&m&&"object"==typeof t&&t;!v||v.global!==v&&v.window!==v&&v.self!==v||(c=v);var b=Math.pow(2,53)-1,x=/\bOpera/,w=Object.prototype,S=w.hasOwnProperty,k=w.toString;function capitalize(t){return(t=String(t)).charAt(0).toUpperCase()+t.slice(1)}function format(t){return t=trim(t),/^(?:webOS|i(?:OS|P))/.test(t)?t:capitalize(t)}function forOwn(t,o){for(var a in t)S.call(t,a)&&o(t[a],a,t)}function getClassOf(t){return null==t?capitalize(t):k.call(t).slice(8,-1)}function qualify(t){return String(t).replace(/([ -])(?!$)/g,"$1?")}function reduce(t,o){var a=null;return function each(t,o){var a=-1,c=t?t.length:0;if("number"==typeof c&&c>-1&&c<=b)for(;++a<c;)o(t[a],a,t);else forOwn(t,o)}(t,(function(c,h){a=o(a,c,h,t)})),a}function trim(t){return String(t).replace(/^ +| +$/g,"")}var _=function parse(t){var o=c,a=t&&"object"==typeof t&&"String"!=getClassOf(t);a&&(o=t,t=null);var h=o.navigator||{},m=h.userAgent||"";t||(t=m);var v,b,w=a?!!h.likeChrome:/\bChrome\b/.test(t)&&!/internal|\n/i.test(k.toString()),S="Object",_=a?S:"ScriptBridgingProxyObject",T=a?S:"Environment",C=a&&o.java?"JavaPackage":getClassOf(o.java),M=a?S:"RuntimeObject",E=/\bJava/.test(C)&&o.java,O=E&&getClassOf(o.environment)==T,P=E?"a":"α",I=E?"b":"β",A=o.document||{},j=o.operamini||o.opera,R=x.test(R=a&&j?j["[[Class]]"]:getClassOf(j))?R:j=null,L=t,N=[],U=null,D=t==m,B=D&&j&&"function"==typeof j.version&&j.version(),q=function getLayout(o){return reduce(o,(function(o,a){return o||RegExp("\\b"+(a.pattern||qualify(a))+"\\b","i").exec(t)&&(a.label||a)}))}([{label:"EdgeHTML",pattern:"Edge"},"Trident",{label:"WebKit",pattern:"AppleWebKit"},"iCab","Presto","NetFront","Tasman","KHTML","Gecko"]),z=function getName(o){return reduce(o,(function(o,a){return o||RegExp("\\b"+(a.pattern||qualify(a))+"\\b","i").exec(t)&&(a.label||a)}))}(["Adobe AIR","Arora","Avant Browser","Breach","Camino","Electron","Epiphany","Fennec","Flock","Galeon","GreenBrowser","iCab","Iceweasel","K-Meleon","Konqueror","Lunascape","Maxthon",{label:"Microsoft Edge",pattern:"(?:Edge|Edg|EdgA|EdgiOS)"},"Midori","Nook Browser","PaleMoon","PhantomJS","Raven","Rekonq","RockMelt",{label:"Samsung Internet",pattern:"SamsungBrowser"},"SeaMonkey",{label:"Silk",pattern:"(?:Cloud9|Silk-Accelerated)"},"Sleipnir","SlimBrowser",{label:"SRWare Iron",pattern:"Iron"},"Sunrise","Swiftfox","Vivaldi","Waterfox","WebPositive",{label:"Yandex Browser",pattern:"YaBrowser"},{label:"UC Browser",pattern:"UCBrowser"},"Opera Mini",{label:"Opera Mini",pattern:"OPiOS"},"Opera",{label:"Opera",pattern:"OPR"},"Chromium","Chrome",{label:"Chrome",pattern:"(?:HeadlessChrome)"},{label:"Chrome Mobile",pattern:"(?:CriOS|CrMo)"},{label:"Firefox",pattern:"(?:Firefox|Minefield)"},{label:"Firefox for iOS",pattern:"FxiOS"},{label:"IE",pattern:"IEMobile"},{label:"IE",pattern:"MSIE"},"Safari"]),K=getProduct([{label:"BlackBerry",pattern:"BB10"},"BlackBerry",{label:"Galaxy S",pattern:"GT-I9000"},{label:"Galaxy S2",pattern:"GT-I9100"},{label:"Galaxy S3",pattern:"GT-I9300"},{label:"Galaxy S4",pattern:"GT-I9500"},{label:"Galaxy S5",pattern:"SM-G900"},{label:"Galaxy S6",pattern:"SM-G920"},{label:"Galaxy S6 Edge",pattern:"SM-G925"},{label:"Galaxy S7",pattern:"SM-G930"},{label:"Galaxy S7 Edge",pattern:"SM-G935"},"Google TV","Lumia","iPad","iPod","iPhone","Kindle",{label:"Kindle Fire",pattern:"(?:Cloud9|Silk-Accelerated)"},"Nexus","Nook","PlayBook","PlayStation Vita","PlayStation","TouchPad","Transformer",{label:"Wii U",pattern:"WiiU"},"Wii","Xbox One",{label:"Xbox 360",pattern:"Xbox"},"Xoom"]),H=function getManufacturer(o){return reduce(o,(function(o,a,c){return o||(a[K]||a[/^[a-z]+(?: +[a-z]+\b)*/i.exec(K)]||RegExp("\\b"+qualify(c)+"(?:\\b|\\w*\\d)","i").exec(t))&&c}))}({Apple:{iPad:1,iPhone:1,iPod:1},Alcatel:{},Archos:{},Amazon:{Kindle:1,"Kindle Fire":1},Asus:{Transformer:1},"Barnes & Noble":{Nook:1},BlackBerry:{PlayBook:1},Google:{"Google TV":1,Nexus:1},HP:{TouchPad:1},HTC:{},Huawei:{},Lenovo:{},LG:{},Microsoft:{Xbox:1,"Xbox One":1},Motorola:{Xoom:1},Nintendo:{"Wii U":1,Wii:1},Nokia:{Lumia:1},Oppo:{},Samsung:{"Galaxy S":1,"Galaxy S2":1,"Galaxy S3":1,"Galaxy S4":1},Sony:{PlayStation:1,"PlayStation Vita":1},Xiaomi:{Mi:1,Redmi:1}}),G=function getOS(o){return reduce(o,(function(o,a){var c=a.pattern||qualify(a);return!o&&(o=RegExp("\\b"+c+"(?:/[\\d.]+|[ \\w.]*)","i").exec(t))&&(o=function cleanupOS(t,o,a){var c={"10.0":"10",6.4:"10 Technical Preview",6.3:"8.1",6.2:"8",6.1:"Server 2008 R2 / 7","6.0":"Server 2008 / Vista",5.2:"Server 2003 / XP 64-bit",5.1:"XP",5.01:"2000 SP1","5.0":"2000","4.0":"NT","4.90":"ME"};return o&&a&&/^Win/i.test(t)&&!/^Windows Phone /i.test(t)&&(c=c[/[\d.]+$/.exec(t)])&&(t="Windows "+c),t=String(t),o&&a&&(t=t.replace(RegExp(o,"i"),a)),format(t.replace(/ ce$/i," CE").replace(/\bhpw/i,"web").replace(/\bMacintosh\b/,"Mac OS").replace(/_PowerPC\b/i," OS").replace(/\b(OS X) [^ \d]+/i,"$1").replace(/\bMac (OS X)\b/,"$1").replace(/\/(\d)/," $1").replace(/_/g,".").replace(/(?: BePC|[ .]*fc[ \d.]+)$/i,"").replace(/\bx86\.64\b/gi,"x86_64").replace(/\b(Windows Phone) OS\b/,"$1").replace(/\b(Chrome OS \w+) [\d.]+\b/,"$1").split(" on ")[0])}(o,c,a.label||a)),o}))}(["Windows Phone","KaiOS","Android","CentOS",{label:"Chrome OS",pattern:"CrOS"},"Debian",{label:"DragonFly BSD",pattern:"DragonFly"},"Fedora","FreeBSD","Gentoo","Haiku","Kubuntu","Linux Mint","OpenBSD","Red Hat","SuSE","Ubuntu","Xubuntu","Cygwin","Symbian OS","hpwOS","webOS ","webOS","Tablet OS","Tizen","Linux","Mac OS X","Macintosh","Mac","Windows 98;","Windows "]);function getProduct(o){return reduce(o,(function(o,a){var c=a.pattern||qualify(a);return!o&&(o=RegExp("\\b"+c+" *\\d+[.\\w_]*","i").exec(t)||RegExp("\\b"+c+" *\\w+-[\\w]*","i").exec(t)||RegExp("\\b"+c+"(?:; *(?:[a-z]+[_-])?[a-z]+\\d+|[^ ();-]*)","i").exec(t))&&((o=String(a.label&&!RegExp(c,"i").test(a.label)?a.label:o).split("/"))[1]&&!/[\d.]+/.test(o[0])&&(o[0]+=" "+o[1]),a=a.label||a,o=format(o[0].replace(RegExp(c,"i"),a).replace(RegExp("; *(?:"+a+"[_-])?","i")," ").replace(RegExp("("+a+")[-_.]?(\\w)","i"),"$1 $2"))),o}))}function getVersion(o){return reduce(o,(function(o,a){return o||(RegExp(a+"(?:-[\\d.]+/|(?: for [\\w-]+)?[ /-])([\\d.]+[^ ();/_-]*)","i").exec(t)||0)[1]||null}))}if(q&&(q=[q]),/\bAndroid\b/.test(G)&&!K&&(v=/\bAndroid[^;]*;(.*?)(?:Build|\) AppleWebKit)\b/i.exec(t))&&(K=trim(v[1]).replace(/^[a-z]{2}-[a-z]{2};\s*/i,"")||null),H&&!K?K=getProduct([H]):H&&K&&(K=K.replace(RegExp("^("+qualify(H)+")[-_.\\s]","i"),H+" ").replace(RegExp("^("+qualify(H)+")[-_.]?(\\w)","i"),H+" $2")),(v=/\bGoogle TV\b/.exec(K))&&(K=v[0]),/\bSimulator\b/i.test(t)&&(K=(K?K+" ":"")+"Simulator"),"Opera Mini"==z&&/\bOPiOS\b/.test(t)&&N.push("running in Turbo/Uncompressed mode"),"IE"==z&&/\blike iPhone OS\b/.test(t)?(H=(v=parse(t.replace(/like iPhone OS/,""))).manufacturer,K=v.product):/^iP/.test(K)?(z||(z="Safari"),G="iOS"+((v=/ OS ([\d_]+)/i.exec(t))?" "+v[1].replace(/_/g,"."):"")):"Konqueror"==z&&/^Linux\b/i.test(G)?G="Kubuntu":H&&"Google"!=H&&(/Chrome/.test(z)&&!/\bMobile Safari\b/i.test(t)||/\bVita\b/.test(K))||/\bAndroid\b/.test(G)&&/^Chrome/.test(z)&&/\bVersion\//i.test(t)?(z="Android Browser",G=/\bAndroid\b/.test(G)?G:"Android"):"Silk"==z?(/\bMobi/i.test(t)||(G="Android",N.unshift("desktop mode")),/Accelerated *= *true/i.test(t)&&N.unshift("accelerated")):"UC Browser"==z&&/\bUCWEB\b/.test(t)?N.push("speed mode"):"PaleMoon"==z&&(v=/\bFirefox\/([\d.]+)\b/.exec(t))?N.push("identifying as Firefox "+v[1]):"Firefox"==z&&(v=/\b(Mobile|Tablet|TV)\b/i.exec(t))?(G||(G="Firefox OS"),K||(K=v[1])):!z||(v=!/\bMinefield\b/i.test(t)&&/\b(?:Firefox|Safari)\b/.exec(z))?(z&&!K&&/[\/,]|^[^(]+?\)/.test(t.slice(t.indexOf(v+"/")+8))&&(z=null),(v=K||H||G)&&(K||H||/\b(?:Android|Symbian OS|Tablet OS|webOS)\b/.test(G))&&(z=/[a-z]+(?: Hat)?/i.exec(/\bAndroid\b/.test(G)?G:v)+" Browser")):"Electron"==z&&(v=(/\bChrome\/([\d.]+)\b/.exec(t)||0)[1])&&N.push("Chromium "+v),B||(B=getVersion(["(?:Cloud9|CriOS|CrMo|Edge|Edg|EdgA|EdgiOS|FxiOS|HeadlessChrome|IEMobile|Iron|Opera ?Mini|OPiOS|OPR|Raven|SamsungBrowser|Silk(?!/[\\d.]+$)|UCBrowser|YaBrowser)","Version",qualify(z),"(?:Firefox|Minefield|NetFront)"])),(v=("iCab"==q&&parseFloat(B)>3?"WebKit":/\bOpera\b/.test(z)&&(/\bOPR\b/.test(t)?"Blink":"Presto"))||/\b(?:Midori|Nook|Safari)\b/i.test(t)&&!/^(?:Trident|EdgeHTML)$/.test(q)&&"WebKit"||!q&&/\bMSIE\b/i.test(t)&&("Mac OS"==G?"Tasman":"Trident")||"WebKit"==q&&/\bPlayStation\b(?! Vita\b)/i.test(z)&&"NetFront")&&(q=[v]),"IE"==z&&(v=(/; *(?:XBLWP|ZuneWP)(\d+)/i.exec(t)||0)[1])?(z+=" Mobile",G="Windows Phone "+(/\+$/.test(v)?v:v+".x"),N.unshift("desktop mode")):/\bWPDesktop\b/i.test(t)?(z="IE Mobile",G="Windows Phone 8.x",N.unshift("desktop mode"),B||(B=(/\brv:([\d.]+)/.exec(t)||0)[1])):"IE"!=z&&"Trident"==q&&(v=/\brv:([\d.]+)/.exec(t))&&(z&&N.push("identifying as "+z+(B?" "+B:"")),z="IE",B=v[1]),D){if(function isHostType(t,o){var a=null!=t?typeof t[o]:"number";return!(/^(?:boolean|number|string|undefined)$/.test(a)||"object"==a&&!t[o])}(o,"global"))if(E&&(L=(v=E.lang.System).getProperty("os.arch"),G=G||v.getProperty("os.name")+" "+v.getProperty("os.version")),O){try{B=o.require("ringo/engine").version.join("."),z="RingoJS"}catch(t){(v=o.system)&&v.global.system==o.system&&(z="Narwhal",G||(G=v[0].os||null))}z||(z="Rhino")}else"object"==typeof o.process&&!o.process.browser&&(v=o.process)&&("object"==typeof v.versions&&("string"==typeof v.versions.electron?(N.push("Node "+v.versions.node),z="Electron",B=v.versions.electron):"string"==typeof v.versions.nw&&(N.push("Chromium "+B,"Node "+v.versions.node),z="NW.js",B=v.versions.nw)),z||(z="Node.js",L=v.arch,G=v.platform,B=(B=/[\d.]+/.exec(v.version))?B[0]:null));else getClassOf(v=o.runtime)==_?(z="Adobe AIR",G=v.flash.system.Capabilities.os):getClassOf(v=o.phantom)==M?(z="PhantomJS",B=(v=v.version||null)&&v.major+"."+v.minor+"."+v.patch):"number"==typeof A.documentMode&&(v=/\bTrident\/(\d+)/i.exec(t))?(B=[B,A.documentMode],(v=+v[1]+4)!=B[1]&&(N.push("IE "+B[1]+" mode"),q&&(q[1]=""),B[1]=v),B="IE"==z?String(B[1].toFixed(1)):B[0]):"number"==typeof A.documentMode&&/^(?:Chrome|Firefox)\b/.test(z)&&(N.push("masking as "+z+" "+B),z="IE",B="11.0",q=["Trident"],G="Windows");G=G&&format(G)}if(B&&(v=/(?:[ab]|dp|pre|[ab]\d+pre)(?:\d+\+?)?$/i.exec(B)||/(?:alpha|beta)(?: ?\d)?/i.exec(t+";"+(D&&h.appMinorVersion))||/\bMinefield\b/i.test(t)&&"a")&&(U=/b/i.test(v)?"beta":"alpha",B=B.replace(RegExp(v+"\\+?$"),"")+("beta"==U?I:P)+(/\d+\+?/.exec(v)||"")),"Fennec"==z||"Firefox"==z&&/\b(?:Android|Firefox OS|KaiOS)\b/.test(G))z="Firefox Mobile";else if("Maxthon"==z&&B)B=B.replace(/\.[\d.]+/,".x");else if(/\bXbox\b/i.test(K))"Xbox 360"==K&&(G=null),"Xbox 360"==K&&/\bIEMobile\b/.test(t)&&N.unshift("mobile mode");else if(!/^(?:Chrome|IE|Opera)$/.test(z)&&(!z||K||/Browser|Mobi/.test(z))||"Windows CE"!=G&&!/Mobi/i.test(t))if("IE"==z&&D)try{null===o.external&&N.unshift("platform preview")}catch(t){N.unshift("embedded")}else(/\bBlackBerry\b/.test(K)||/\bBB10\b/.test(t))&&(v=(RegExp(K.replace(/ +/g," *")+"/([.\\d]+)","i").exec(t)||0)[1]||B)?(G=((v=[v,/BB10/.test(t)])[1]?(K=null,H="BlackBerry"):"Device Software")+" "+v[0],B=null):this!=forOwn&&"Wii"!=K&&(D&&j||/Opera/.test(z)&&/\b(?:MSIE|Firefox)\b/i.test(t)||"Firefox"==z&&/\bOS X (?:\d+\.){2,}/.test(G)||"IE"==z&&(G&&!/^Win/.test(G)&&B>5.5||/\bWindows XP\b/.test(G)&&B>8||8==B&&!/\bTrident\b/.test(t)))&&!x.test(v=parse.call(forOwn,t.replace(x,"")+";"))&&v.name&&(v="ing as "+v.name+((v=v.version)?" "+v:""),x.test(z)?(/\bIE\b/.test(v)&&"Mac OS"==G&&(G=null),v="identify"+v):(v="mask"+v,z=R?format(R.replace(/([a-z])([A-Z])/g,"$1 $2")):"Opera",/\bIE\b/.test(v)&&(G=null),D||(B=null)),q=["Presto"],N.push(v));else z+=" Mobile";(v=(/\bAppleWebKit\/([\d.]+\+?)/i.exec(t)||0)[1])&&(v=[parseFloat(v.replace(/\.(\d)$/,".0$1")),v],"Safari"==z&&"+"==v[1].slice(-1)?(z="WebKit Nightly",U="alpha",B=v[1].slice(0,-1)):B!=v[1]&&B!=(v[2]=(/\bSafari\/([\d.]+\+?)/i.exec(t)||0)[1])||(B=null),v[1]=(/\b(?:Headless)?Chrome\/([\d.]+)/i.exec(t)||0)[1],537.36==v[0]&&537.36==v[2]&&parseFloat(v[1])>=28&&"WebKit"==q&&(q=["Blink"]),D&&(w||v[1])?(q&&(q[1]="like Chrome"),v=v[1]||((v=v[0])<530?1:v<532?2:v<532.05?3:v<533?4:v<534.03?5:v<534.07?6:v<534.1?7:v<534.13?8:v<534.16?9:v<534.24?10:v<534.3?11:v<535.01?12:v<535.02?"13+":v<535.07?15:v<535.11?16:v<535.19?17:v<536.05?18:v<536.1?19:v<537.01?20:v<537.11?"21+":v<537.13?23:v<537.18?24:v<537.24?25:v<537.36?26:"Blink"!=q?"27":"28")):(q&&(q[1]="like Safari"),v=(v=v[0])<400?1:v<500?2:v<526?3:v<533?4:v<534?"4+":v<535?5:v<537?6:v<538?7:v<601?8:v<602?9:v<604?10:v<606?11:v<608?12:"12"),q&&(q[1]+=" "+(v+="number"==typeof v?".x":/[.+]/.test(v)?"":"+")),"Safari"==z&&(!B||parseInt(B)>45)?B=v:"Chrome"==z&&/\bHeadlessChrome/i.test(t)&&N.unshift("headless")),"Opera"==z&&(v=/\bzbov|zvav$/.exec(G))?(z+=" ",N.unshift("desktop mode"),"zvav"==v?(z+="Mini",B=null):z+="Mobile",G=G.replace(RegExp(" *"+v+"$"),"")):"Safari"==z&&/\bChrome\b/.exec(q&&q[1])?(N.unshift("desktop mode"),z="Chrome Mobile",B=null,/\bOS X\b/.test(G)?(H="Apple",G="iOS 4.3+"):G=null):/\bSRWare Iron\b/.test(z)&&!B&&(B=getVersion("Chrome")),B&&0==B.indexOf(v=/[\d.]+$/.exec(G))&&t.indexOf("/"+v+"-")>-1&&(G=trim(G.replace(v,""))),G&&-1!=G.indexOf(z)&&!RegExp(z+" OS").test(G)&&(G=G.replace(RegExp(" *"+qualify(z)+" *"),"")),q&&!/\b(?:Avant|Nook)\b/.test(z)&&(/Browser|Lunascape|Maxthon/.test(z)||"Safari"!=z&&/^iOS/.test(G)&&/\bSafari\b/.test(q[1])||/^(?:Adobe|Arora|Breach|Midori|Opera|Phantom|Rekonq|Rock|Samsung Internet|Sleipnir|SRWare Iron|Vivaldi|Web)/.test(z)&&q[1])&&(v=q[q.length-1])&&N.push(v),N.length&&(N=["("+N.join("; ")+")"]),H&&K&&K.indexOf(H)<0&&N.push("on "+H),K&&N.push((/^on /.test(N[N.length-1])?"":"on ")+K),G&&(v=/ ([\d.+]+)$/.exec(G),b=v&&"/"==G.charAt(G.length-v[0].length-1),G={architecture:32,family:v&&!b?G.replace(v[0],""):G,version:v?v[1]:null,toString:function(){var t=this.version;return this.family+(t&&!b?" "+t:"")+(64==this.architecture?" 64-bit":"")}}),(v=/\b(?:AMD|IA|Win|WOW|x86_|x)64\b/i.exec(L))&&!/\bi686\b/i.test(L)?(G&&(G.architecture=64,G.family=G.family.replace(RegExp(" *"+v),"")),z&&(/\bWOW64\b/i.test(t)||D&&/\w(?:86|32)$/.test(h.cpuClass||h.platform)&&!/\bWin64; x64\b/i.test(t))&&N.unshift("32-bit")):G&&/^OS X/.test(G.family)&&"Chrome"==z&&parseFloat(B)>=39&&(G.architecture=64),t||(t=null);var $={};return $.description=t,$.layout=q&&q[0],$.manufacturer=H,$.name=z,$.prerelease=U,$.product=K,$.ua=t,$.version=z&&B,$.os=G||{architecture:null,family:null,version:null,toString:function(){return"null"}},$.parse=parse,$.toString=function toStringPlatform(){return this.description||""},$.version&&N.unshift(B),$.name&&N.unshift(z),G&&z&&(G!=String(G).split(" ")[0]||G!=z.split(" ")[0]&&!K)&&N.push(K?"("+G+")":"on "+G),N.length&&($.description=N.join(" ")),$}();h&&m?forOwn(_,(function(t,o){h[o]=t})):c.platform=_}).call(t)})),nh=createCommonjsModule((function(t,o){self,t.exports=function(){var t={d:function(o,a){for(var c in a)t.o(a,c)&&!t.o(o,c)&&Object.defineProperty(o,c,{enumerable:!0,get:a[c]})},o:function(t,o){return Object.prototype.hasOwnProperty.call(t,o)}},o={};t.d(o,{default:function(){return k}});var a=function e(t){for(var o in function(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e),this.directUploadAddr="https://wanproxy-web.127.net",this.retryCount=2,this.trunkSize=4194304,this.trunkUploadTimeout=5e4,this.getOffsetTimeout=1e4,this.version="1.0",this.onError=function(t){},this.onProgress=function(t){},this.onComplete=function(t){},t)this[o]=t[o]};function n(t,o){var a="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!a){if(Array.isArray(t)||(a=function(t,o){if(t){if("string"==typeof t)return r(t,o);var a=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?r(t,o):void 0}}(t))||o&&t&&"number"==typeof t.length){a&&(t=a);var c=0,i=function(){};return{s:i,n:function(){return c>=t.length?{done:!0}:{done:!1,value:t[c++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var h,m=!0,v=!1;return{s:function(){a=a.call(t)},n:function(){var t=a.next();return m=t.done,t},e:function(t){v=!0,h=t},f:function(){try{m||null==a.return||a.return()}finally{if(v)throw h}}}}function r(t,o){(null==o||o>t.length)&&(o=t.length);for(var a=0,c=new Array(o);a<o;a++)c[a]=t[a];return c}var c=window.localStorage;window.localStorage&&"function"==typeof window.localStorage.getItem&&"function"==typeof window.localStorage.setItem&&"function"==typeof window.localStorage.removeItem||(c={privateObj:{},setItem:function(t,o){c.privateObj[t]=o},getItem:function(t){return c.privateObj[t]},removeItem:function(t){delete c.privateObj[t]},getKeys:function(){return Object.keys(c.privateObj)}});var h={getFileKey:function(t){var o=t.size.toString(),a=t.lastModified.toString();return t.name+o.slice(o.length-5)+a.slice(a.length-5)},getFileInfo:function(t){var o=c.getItem(t);if(!o)return null;try{return JSON.parse(o)}catch(t){return null}},initFile:function(t,o){h.clearExpiredInfo();var a=this.getFileKey(o),m={ctx:void 0!==t.ctx?t.ctx:"",bucket:t.bucketName,obj:t.objectName,token:t.token,modifyAt:Date.now(),end:!1};return t.payload&&(m.payload=t.payload),c.setItem(a,JSON.stringify(m)),a},setUploadContext:function(t,o){var a=this.getFileInfo(t);a&&(a.ctx=o,c.setItem(t,JSON.stringify(a)))},setComplete:function(t){var o=this.getFileInfo(t);o&&(o.modifyAt=Date.now(),o.end=!0,c.setItem(t,JSON.stringify(o)))},getUploadContext:function(t){var o=this.getFileInfo(t);return o?o.ctx:""},removeFileInfo:function(t){c.removeItem(t)},clearExpiredInfo:function(){var t,o="function"==typeof c.getKeys?c.getKeys():Object.keys(c),a=Date.now(),m=[],v=n(o);try{for(v.s();!(t=v.n()).done;){var b=t.value,x=h.getFileInfo(b);null===x||a-x.modifyAt>k.expireTime?c.removeItem(b):m.push({fileInfo:x,key:b})}}catch(t){v.e(t)}finally{v.f()}if(m.length>k.maxFileCache){var w,S=n(m.sort((function(t,o){return o.fileInfo.modifyAt-t.fileInfo.modifyAt})).slice(k.maxFileCache));try{for(S.s();!(w=S.n()).done;){var _=w.value;c.removeItem(_.key)}}catch(t){S.e(t)}finally{S.f()}}}},m=h;function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function f(t,o){return!o||"object"!==u(o)&&"function"!=typeof o?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):o}function l(t){var o="function"==typeof Map?new Map:void 0;return(l=function(t){if(null===t||(a=t,-1===Function.toString.call(a).indexOf("[native code]")))return t;var a;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==o){if(o.has(t))return o.get(t);o.set(t,n)}function n(){return s(t,arguments,y(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,t)})(t)}function s(t,o,a){return(s=p()?Reflect.construct:function(t,o,a){var c=[null];c.push.apply(c,o);var h=new(Function.bind.apply(t,c));return a&&d(h,a.prototype),h}).apply(null,arguments)}function p(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function d(t,o){return(d=Object.setPrototypeOf||function(t,o){return t.__proto__=o,t})(t,o)}function y(t){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var v=function(t){!function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(o&&o.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),o&&d(t,o)}(r,t);var o,a,c=(o=r,a=p(),function(){var t,c=y(o);if(a){var h=y(this).constructor;t=Reflect.construct(c,arguments,h)}else t=c.apply(this,arguments);return f(this,t)});function r(t,o){var a;return function(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}(this,r),(a=c.call(this,"NosUploadError:"+t)).errCode=o,a.errMsg=t,a}return r}(l(Error)),b=function e(t,o,a){if("uploading"===t.uploadState){var c=t.config,h=t.param,b=m.getUploadContext(t.fileKey);if(!b)return a(0);var x=new XMLHttpRequest,w=c.directUploadAddr+"/".concat(h.bucketName)+"/".concat(encodeURIComponent(h.objectName))+"?uploadContext"+"&context=".concat(b)+"&version=".concat(c.version);x.onreadystatechange=function(){if("abort"!==t.uploadState&&4===x.readyState){var h;try{h=JSON.parse(x.responseText)}catch(t){h={errMsg:"JsonParseError in getOffset",errCode:500}}200===x.status?h.errCode?t.config.onError(new v(h.errMsg,h.errCode)):a(h.offset):x.status.toString().match(/^5/)?e(t,o-1,a):(m.removeFileInfo(t.fileKey),x.status?c.onError(new v("getOffset(".concat(w,") error: ").concat(x.status," ").concat(x.statusText))):c.onError(new v("getOffset(".concat(w,") error. no Error Code"))))}},x.open("get",w),x.setRequestHeader("x-nos-token",h.token),x.timeout=c.getOffsetTimeout,x.send()}},x=function e(t,o,a,c){if("uploading"===t.uploadState){var h=t.param,b=t.config,x=File.prototype.slice,w=void 0!==h.ctx?h.ctx:"",S=o+b.trunkSize>t.file.size,k=S?t.file.size:o+b.trunkSize,_=new XMLHttpRequest,T=b.directUploadAddr+"/".concat(h.bucketName)+"/".concat(encodeURIComponent(h.objectName));if(_.upload.onprogress=function(a){var c=0;a.lengthComputable?(c=(o+a.loaded)/t.file.size,b.onProgress(c)):b.onError(new v("browser does not support query upload progress"))},_.onreadystatechange=function(){if("abort"!==t.uploadState&&4===_.readyState){var h;try{h=JSON.parse(_.responseText)}catch(t){console.error("JsonParseError in uploadTrunk",t),h={errMsg:"JsonParseError in uploadTrunk"}}200===_.status?(t.setContext(h.context),S?(c(),t.setComplete()):e(t,h.offset,b.retryCount,c)):_.status.toString().match(/^5/)?a>0?e(t,o,a-1,c):(m.removeFileInfo(t.fileKey),b.onError(new v(h.errMsg,h.errCode))):_.status?(m.removeFileInfo(t.fileKey),b.onError(new v("uploadTrunk(".concat(T,") error: ").concat(_.status," ").concat(_.statusText)))):(console.log("upload is paused",_),b.onError(new v("uploadTrunk(".concat(T,") error. no Error Code"))))}},_.open("post",T+"?offset=".concat(o)+"&complete=".concat(S)+"&context=".concat(w)+"&version=".concat(b.version)),_.setRequestHeader("x-nos-token",h.token),t.file.type&&_.setRequestHeader("content-type",t.file.type),_.timeout=b.trunkUploadTimeout,"undefined"!=typeof FileReader){var C=new FileReader;C.addEventListener("load",(function(t){var o;(null===(o=null==t?void 0:t.target)||void 0===o?void 0:o.result)?_.send(t.target.result):b.onError(new v("Read ArrayBuffer failed"))})),C.addEventListener("error",(function(t){var o=t.target.error;b.onError(new v("Read ArrayBuffer error. ".concat(o.toString()),o.code))})),C.readAsArrayBuffer(x.call(t.file,o,k))}else _.send(x.call(t.file,o,k))}};function g(t,o){for(var a=0;a<o.length;a++){var c=o[a];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(t,c.key,c)}}var w=function(){function e(t,o,a){!function(t,o){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}(this,e),this.uploadState="paused",this.config=a,this.file=t,this.param=o,this.fileKey=m.initFile(o,t),this.resume()}var t;return(t=[{key:"resume",value:function(){var t=this;if("uploading"!==this.uploadState){this.setUploadState("uploading");var o=this.config;b(this,o.retryCount,(function(a){x(t,a,o.retryCount,(function(){t.setUploadState("ended"),"function"==typeof o.onComplete&&o.onComplete(t.param)}))}))}}},{key:"pause",value:function(){this.setUploadState("paused")}},{key:"abort",value:function(){this.setUploadState("abort"),m.removeFileInfo(this.fileKey)}},{key:"setUploadState",value:function(t){t!==this.uploadState&&(this.uploadState=t)}},{key:"setContext",value:function(t){m.setUploadContext(this.fileKey,t),this.param.ctx=t}},{key:"setComplete",value:function(){m.setComplete(this.fileKey),this.setUploadState("ended")}}])&&g(e.prototype,t),e}(),S={maxFileCache:6,expireTime:864e5,getFileUploadInformation:function(t){var o=m.getFileKey(t),a=m.getFileInfo(o);return null===a?null:Date.now()-a.modifyAt>S.expireTime?(m.removeFileInfo(o),null):{uploadInfo:Object.assign({bucketName:a.bucket,objectName:a.obj,token:a.token,ctx:a.ctx},a.payload?{payload:a.payload}:{}),complete:a.end}},setMaxFileCache:function(t){S.maxFileCache=t},setExpireTime:function(t){S.expireTime=t},printCaches:function(){for(var t=0,o=Object.keys(localStorage);t<o.length;t++){var a=o[t],c=m.getFileInfo(a);c&&console.log(c,"modifiedAt",new Date(c.modifyAt).toTimeString())}},createConfig:function(t){return new a(t)},createTask:function(t,o,a){return new w(t,o,a)}},k=S;return o.default}()})),oh=createCommonjsModule((function(t,o){t.exports=function(){const t=5e3;function object2String(t){if(t){let o="";return Object.entries(t).forEach((([t,a],c)=>{o+=0===c?"?":"&",o+=`${t}=${a}`})),o}return""}function timeoutPromise(o,a){return new Promise(((c,h)=>{setTimeout((()=>{h({message:"request timeout",params:a})}),o||t)}))}function request(o,a={dataType:"json",method:"GET",timeout:t}){const c="text"===a.dataType?"text/plain; charset=UTF-8":"application/json; charset=UTF-8";let h="GET"===a.method?object2String(a.params):"";return Promise.race([timeoutPromise(a.timeout,{url:o,params:a}),new Promise((function(t,m){if(window.fetch&&"function"==typeof window.fetch)try{let v={method:a.method,headers:Object.assign({"Content-Type":c},a.headers)};"POST"===a.method&&(v.body=JSON.stringify(a.params)),fetch(`${o}${h}`,v).then((o=>{"text"!==a.dataType?o.json().then((a=>{o.data=a,t(o)}),m):o.text().then((a=>{o.data=a,t(o)}),m)}),m)}catch(t){m(t)}else if(window.XMLHttpRequest){const v=new XMLHttpRequest;let b;if(v.onreadystatechange=function(){if(4===v.readyState)if(200===v.status){try{b=JSON.parse(v.response||"{}")}catch(t){b=v.response}t({status:v.status,data:b})}else m(v.status)},v.open(a.method,`${o}${h}`),v.setRequestHeader("Content-Type",c),a.headers)for(let t in a.headers)v.setRequestHeader(t,a.headers[t]);v.send(JSON.stringify(a.params))}else m("request no suppout")}))])}return request}()})),ih=console;var ah={setLogger:function setLogger(t){ih=t},platform:"BROWSER",localStorage:window.localStorage,request:oh,WebSocket:window.WebSocket,uploadFile:function uploadFile(t){return __awaiter(this,void 0,void 0,wa.mark((function _callee(){var o,a,c,h,m,v;return wa.wrap((function _callee$(b){for(;;)switch(b.prev=b.next){case 0:if(t.fileInput||t.file){b.next=2;break}throw new Error("File not exist");case 2:if(!t.file){b.next=6;break}h=t.file,b.next=20;break;case 6:if("string"!=typeof t.fileInput){b.next=15;break}if(!((m=document.getElementById(t.fileInput))&&m.files&&m.files[0])){b.next=12;break}h=m.files[0],b.next=13;break;case 12:throw new Error("Can not get file from fileInput");case 13:b.next=20;break;case 15:if(!(t.fileInput&&t.fileInput.files&&t.fileInput.files[0])){b.next=19;break}h=t.fileInput.files[0],b.next=20;break;case 19:throw new Error("Can not get file from fileInput "+t.fileInput);case 20:if(!(t.maxSize&&h.size>t.maxSize)){b.next=22;break}throw new Error("The file exceeds maxSize limit. maxSize: "+t.maxSize+", get "+h.size);case 22:return b.next=24,new ca((function(o,a){var c=nh.createConfig({directUploadAddr:t.chunkUploadHost,onError:function onError(t){a(t)},onProgress:t.onUploadProgress||function(){},onComplete:function onComplete(t){o(t)}}),m=nh.createTask(h,{bucketName:t.nosToken.bucket,objectName:decodeURIComponent(t.nosToken.objectName),token:t.nosToken.token},c);try{t.onUploadStart&&t.onUploadStart(m)}catch(t){ih.error("Adapter uploadFile: options.onUploadStart error",t&&t.message),m.abort(),a(t)}}));case 24:return(v=b.sent).name=h.name,v.size=h.size,v.type=h.type,v.ext=lastIndexOf(o=v.name).call(o,".")>-1?slice(a=v.name).call(a,lastIndexOf(c=v.name).call(c,".")+1).toLowerCase():"",b.abrupt("return",v);case 30:case"end":return b.stop()}}),_callee)})))},getSystemInfo:function getSystemInfo(){var t,o;return{os:(null===(t=rh.os)||void 0===t?void 0:t.family)||"",osVer:(null===(o=rh.os)||void 0===o?void 0:o.version)||"",browser:rh.name||"",browserVer:rh.version||"",hostEnv:"BROWSER",hostEnvVer:rh.version||"",hostInfo:rh.ua||""}}};return Vd.setAdapters(ah),Vd}));
|