let e=4,t=11,s=12,o=20,n=23,i=27;class r{constructor(e=0,t=0){this.high=e,this.low=t}equal(e){return null!==e&&this.low===e.low&&this.high===e.high}toString(){var e=Number(this.high).toString(16);let t=Number(this.low).toString(16);if(t.length<8){let e=8-t.length;for(;e;)t="0"+t,e--}return e+t}}let u={TEST:{CHINA:{DEFAULT:"wss://wss-dev.tim.qq.com"},OVERSEA:{DEFAULT:"wss://wss-dev.tim.qq.com"},SINGAPORE:{DEFAULT:"wss://wsssgp-dev.im.qcloud.com"},KOREA:{DEFAULT:"wss://wsskr-dev.im.qcloud.com"},GERMANY:{DEFAULT:"wss://wssger-dev.im.qcloud.com"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"},JPN:{DEFAULT:"wss://wssjpn-dev.im.qcloud.com"},USA:{DEFAULT:"wss://wssusa-dev.im.qcloud.com"},INDONESIA:{DEFAULT:"wss://wssidn-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",BACKUP_CN:"wss://wss.im.tencent.cn",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT0:"wss://*w4c.my-imcloud.com",DEFAULT:"wss://wss.im.qcloud.com",IPV6:"wss://wssv6.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",BACKUP_WEB:"wss://*w4c.my-cpaas.com",BACKUP_CN:"wss://wss.im.tencent.cn",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT0:"wss://*w4s.my-imcloud.com",DEFAULT:"wss://wsssgp.im.qcloud.com",IPV6:"wss://wsssgpv6.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",BACKUP_WEB:"wss://*w4s.my-cpaas.com",STAT:"https://apisgp.my-imcloud.com",ANYCAST:"wss://162.14.19.159"},KOREA:{DEFAULT0:"wss://*w4k.my-imcloud.com",DEFAULT:"wss://wsskr.im.qcloud.com",IPV6:"wss://wsskrv6.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",BACKUP_WEB:"wss://*w4k.my-cpaas.com",STAT:"https://apikr.my-imcloud.com",ANYCAST:"wss://162.14.13.104"},GERMANY:{DEFAULT0:"wss://*w4g.my-imcloud.com",DEFAULT:"wss://wssger.im.qcloud.com",IPV6:"wss://wssgerv6.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",BACKUP_WEB:"wss://*w4g.my-cpaas.com",STAT:"https://apiger.my-imcloud.com",ANYCAST:"wss://162.14.3.17"},IND:{DEFAULT0:"wss://*w4i.my-imcloud.com",DEFAULT:"wss://wssind.my-imcloud.com",IPV6:"wss://wssindv6.im.qcloud.com",BACKUP:"wss://wssind.im.qcloud.com",BACKUP_WEB:"wss://*w4i.my-cpaas.com",STAT:"https://apiind.my-imcloud.com",ANYCAST:"wss://162.14.19.46"},JPN:{DEFAULT0:"wss://*w4j.my-imcloud.com",DEFAULT:"wss://wssjpn.im.qcloud.com",IPV6:"wss://wssjpnv6.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",BACKUP_WEB:"wss://*w4j.my-cpaas.com",STAT:"https://apijpn.my-imcloud.com",ANYCAST:"wss://162.14.13.254"},USA:{DEFAULT0:"wss://*w4u.my-imcloud.com",DEFAULT:"wss://wssusa.im.qcloud.com",IPV6:"wss://wssusav6.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",BACKUP_WEB:"wss://*w4u.my-cpaas.com",STAT:"https://apiusa.my-imcloud.com",ANYCAST:"wss://162.14.10.42"},INDONESIA:{DEFAULT0:"wss://*w4y.my-imcloud.com",DEFAULT:"wss://wssidn.im.qcloud.com",IPV6:"wss://wssidnv6.im.qcloud.com",BACKUP:"wss://wssidn.my-imcloud.com",BACKUP_WEB:"wss://*w4y.my-cpaas.com",STAT:"https://apiidn.my-imcloud.com",ANYCAST:"wss://43.129.34.169"}}},c={ANDROID:2,IOS:3,MAC:4,WEB:7,WX_MP:8,QQ_MP:9,TT_MP:10,BAIDU_MP:11,ALI_MP:12,IPAD:13,UNI_NATIVE_APP:15,DONUT_NATIVE_APP:19,NS_NATIVE_APP:20,RN_NATIVE_APP:21},m="CHINA",a={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent(e=m){this.CURRENT=u.PRODUCTION[e]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GRP:"group_open_http_svc",GRP_AV:"group_open_avchatroom_http_svc",GRP_COMMUNITY:"million_group_open_http_svc",GRP_ATTR:"group_open_attr_http_svc",FD:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GRP_NO_AUTH:"group_open_http_noauth_svc",BIG_GRP_POLLING:"group_open_long_polling_http_svc",BIG_GRP_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MSG:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate",IM_OPEN_SPEECH:"im_open_speech",MSG_SEARCH:"message_search",GRP_SEARCH:"group_search",GRP_MEMBER_SEARCH:"group_member_search",USER_SEARCH:"user_search",FOLLOW:"follow",OFFLINE_PUSH_REPORT:"offline_push_report",IM_MSG_LOGIC:"im_msg_db_logic"}},l=(new r(0,Math.pow(2,1)).toString(),new r(0,Math.pow(2,2)).toString(),new r(0,Math.pow(2,3)).toString(),new r(0,Math.pow(2,4)).toString(),new r(0,Math.pow(2,6)).toString(),new r(0,Math.pow(2,7)).toString(),new r(0,Math.pow(2,9)).toString(),new r(0,Math.pow(2,10)).toString(),new r(0,Math.pow(2,11)).toString(),new r(0,Math.pow(2,13)).toString(),new r(0,Math.pow(2,15)).toString(),new r(Math.pow(2,6)).toString(),new r(Math.pow(2,7)).toString(),new r(Math.pow(2,8)).toString(),new r(Math.pow(2,9)).toString(),new r(Math.pow(2,10)).toString(),new r(Math.pow(2,16)).toString(),new r(Math.pow(2,20)).toString(),a.HOST.setCurrent(m),"undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&("mac"===wx.getSystemInfoSync().platform||"windows"===wx.getSystemInfoSync().platform)&&void 0===wx.getSystemInfoSync().uniPlatform),g="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting)||l,h=(g&&wx.createGamePortal,"undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting)),d="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),p="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),f="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),w="undefined"!=typeof jd&&"function"==typeof jd.getSystemInfoSync,_="undefined"!=typeof uni&&"undefined"==typeof window&&"function"==typeof uni.requireNativePlugin,S=g&&"object"==typeof wx.miniapp,y=g||h||d||p||f||_||w,T="undefined"==typeof window&&!y&&"undefined"!=typeof global&&void 0!==global.NativeScriptGlobals,A="undefined"!=typeof global&&(void 0!==global.nativeModuleProxy||void 0!==global.ReactNative),M="undefined"!=typeof uni?!y:"undefined"!=typeof window&&!y&&!A,I=(h?qq:d?tt:p?swan:f?my:g?wx:_?uni:w&&jd,M&&window&&window.navigator&&window.navigator.userAgent||""),E=/(micromessenger|webbrowser)/i.test(I),P=function(){let e="WEB";return E?e="WEB":h?e="QQ_MP":d?e="TT_MP":p?e="BAIDU_MP":f?e="ALI_MP":g?e=S?"DONUT_NATIVE_APP":"WX_MP":_?e="UNI_NATIVE_APP":T?e="NS_NATIVE_APP":A&&(e="RN_NATIVE_APP"),c[e]}(),C=(!function(){var e=I.match(/OS (\d+)_/i);e&&e[1]&&e[1]}(),function(){var e,t,s=I.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);s&&(e=s[1]&&parseFloat(s[1]),t=s[2]&&parseFloat(s[2]),e)&&t&&parseFloat(s[1]+"."+s[2])}(),/MSIE/.test(I)||-1{this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)},0)}}setError(t){if(t instanceof Error){if(!this._sentFlag){let e=!0;if(e=this._netMonitorModule?this._netMonitorModule.isOnline():e)t.code&&this.setCode(t.code),t.message&&this.setMoreMessage(t.message);else{let e=oe;this.setCode(e)}this.setLevel("error")}}else ee.w(this._n+".setError value not instanceof Error, please check!");return this}setCode(e){return W(e)||this._sentFlag||("ECONNABORTED"===e&&(this.code=103),G(e)?this.code=e:ee.w(this._n+".setCode value not a number, please check!",e,typeof e)),this}setMessage(e){return W(e)||this._sentFlag||(G(e)&&(this.message=e.toString()),j(e)&&(this.message=e)),this}setCostTime(e){return this.costTime=e,this}setLevel(e){return W(e)||this._sentFlag||(this.level=de[e]),this}setMoreMessage(e){return function(e){if(null==e)return 1;if("boolean"!=typeof e){if("number"==typeof e)return 0===e;if("string"==typeof e)return 0===e.length;if("function"==typeof e)return 0===e.length;if(Array.isArray(e))return 0===e.length;if(e instanceof Error)return""===e.message;if($(e)){for(var t in e)if(F.call(e,t))return;return 1}return(x(e)||B(e)||k(e))&&0===e.size}}(this.moreMessage)?this.moreMessage=""+e:this.moreMessage+=" "+e,this}setNetworkType(e){return W(e)?ee.w(this._n+".setNetworkType value is undefined, please check!"):(e=pe[e.toLowerCase()],W(e)||(this.networkType=e)),this}getStartTs(){return this._startts}setUIPlatform(e){return this.uiPlatform=e,this}setExtension(e){return this.extension=e,this}setEventType(e){return this.eventType=e,this}}let _e=["groupID","name","avatar","type","introduction","notification","ownerID","selfInfo","createTime","infoSequence","lastInfoTime","lastMessage","nextMessageSeq","memberNum","maxMemberNum","memberList","joinOption","groupCustomField","muteAllMembers","isSupportTopic","inviteOption","_lastRevokedTime"];class Se{constructor(e){this.groupID="",this.name="",this.avatar="",this.type="",this.introduction="",this.notification="",this.ownerID="",this.createTime="",this.infoSequence="",this.lastInfoTime="",this.selfInfo={messageRemindType:"",joinTime:"",nameCard:"",role:"",userID:"",memberCustomField:void 0,readedSequence:0,excludedUnreadSequenceList:void 0},this.lastMessage={lastTime:"",lastSequence:"",fromAccount:"",messageForShow:""},this.nextMessageSeq="",this.memberNum="",this.memberCount="",this.maxMemberNum="",this.maxMemberCount="",this.joinOption="",this.inviteOption="",this.groupCustomField=[],this.muteAllMembers=!1,this.isSupportTopic=!1,this._lastRevokedTime=0,this._initGroup(e)}set memberNum(e){}set maxMemberNum(e){}get memberNum(){return this.memberCount}get maxMemberNum(){return this.maxMemberCount}_initGroup(e){for(var t in e)_e.indexOf(t)<0||("selfInfo"!==t?("memberNum"===t&&(this.memberCount=e[t]),"maxMemberNum"===t&&(this.maxMemberCount=e[t]),"isSupportTopic"!==t?"muteAllMembers"===t&&j(e[t])?this.muteAllMembers="On"===e[t]:this[t]=e[t]:this.isSupportTopic=1===e[t]):this.updateSelfInfo(e[t]))}updateGroup(e){e.appid=void 0,e.grossTopicNextMsgSeq=void 0,e.selfInfo&&(e.selfInfo.grossTopicReadSeq=void 0);e=JSON.parse(JSON.stringify(e));if(e.lastMsgTime&&(this.lastMessage.lastTime=e.lastMsgTime),W(e.muteAllMembers)||("On"===e.muteAllMembers?e.muteAllMembers=!0:e.muteAllMembers=!1),e.groupCustomField){var o=this.groupCustomField,t=e.groupCustomField;if(K(o)&&K(t)){let r=!1;t.forEach(({key:t,value:e})=>{var s=o.find(e=>e.key===t);s?s.value!==e&&(s.value=e,r=!0):(o.push({key:t,value:e}),r=!0)})}}W(e.memberNum)||(this.memberCount=e.memberNum),W(e.maxMemberNum)||(this.maxMemberCount=e.maxMemberNum),W(e.isSupportTopic)||(this.isSupportTopic=G(e.isSupportTopic)?1===e.isSupportTopic:e.isSupportTopic),z(this,e,["members","errorCode","lastMsgTime","groupCustomField","memberNum","maxMemberNum","isSupportTopic"]),K(e.members)&&0{e.userID===this.selfInfo.userID&&z(this.selfInfo,e,["sequence"])})}updateSelfInfo({nameCard:e,joinTime:t,role:s,messageRemindType:r,readedSequence:o,excludedUnreadSequenceList:i}){e={nameCard:e,joinTime:t,role:s,messageRemindType:r,readedSequence:o,excludedUnreadSequenceList:i};z(this.selfInfo,{...e},[],["",null,void 0,0,NaN])}setSelfNameCard(e){this.selfInfo.nameCard=e}}let ye="Message",Te="User",Ae="Group",Me="GroupMember",Ie={[ye]:ae,[Te]:he,[Ae]:le,[Me]:ge};class Ee extends class{constructor(e){this._m=e,this._n=""}isLoggedIn(){return this._m.get(s).isLoggedIn()}isOversea(){return this._m.get(s).isOversea()}isPrivateNetWork(){var e=this._m.get(s);return e.isPrivateNetWork()&&!e.getFileDownloadProxy()}getFileDownloadProxy(){return this._m.get(s).getFileDownloadProxy()}getDownloadFileAuthKey(){return this._m.get(s).getDownloadFileAuthKey()}getMyUserID(){return this._m.get(s).getUserID()}getMyTinyID(){return this._m.get(s).getTinyID()}getSDKAppID(){return this._m.get(s).getSDKAppID()}isIntl(){return this._m.get(s).isIntl()}isUsingChatCore(){return this._m.get(s).isUsingChatCore()}isDevMode(){return this._m.get(s).isDevMode()}get(e){return this._m.get(e)}getPlatform(){return P}getCloudConfig(e){return this._m.get(n).getCloudConfig(e)}emitOEvt(e,t){this._m.getOEmitInst().emit(e,t)}emitIEvt(e,t){this._m.getIEmitInst().emit(e,t)}getIEmitInst(){return this._m.getIEmitInst()}req(e){return this._m.get(o).req(e)}canIUse(e){return this._m.get(i).canIUse(e)}getErrMsg(e,t,s){return this._m.getErrMsg(e,t,s)}warn(e,t,s){e=this.getErrMsg(e,t,s);e&&ee.w(e)}noUse(e){var t=ie;return me({code:t,message:this.getErrMsg(t,e)})}}{constructor(e){super(e),this._n="CSModule"}searchCloudMessages(e){return this.search(ye,e)}searchCloudUsers(e){return this.search(Te,e)}searchCloudGroups(e){return this.search(Ae,e)}searchCloudGroupMembers(e){return this.search(Me,e)}search(n,s){let e=`searchCloud${n}s`,a=this._n+"."+e;if(!s)return me({code:re,message:this.getErrMsg(re,e)});var t=s["keywordList"],r=V(t);let o=s.count;if(s.count&&(o=parseInt(o)),n===ye&&!r&&!V(s.senderUserIDList)&&!V(s.messageTypeList)||n!==ye&&!r)throw ee.e(`[${e}] Missing required params: "keywordList".`),new Error("Params validate failed.");let m=Date.now(),u=new we(e),c=`keywordList:${t} keywordListMatchType:${s.keywordListMatchType} cursor:${s.cursor} count:`+o;return ee.l(a+" "+c),this.req({P:Ie[n],data:this._genParams(n,s)}).then(e=>{var{code:r,message:o}=e.data;if(0!==r){let e=r,t=(60020===r?e="SearchUnable":n!==ye&&27003===r?e="SearchParamsError":n!==ye&&60018===r&&(e="SearchOverLimit"),this.getErrMsg(e)||o),s=new se({code:r,message:t});return u.setMessage(c).setError(s).end(),me(s)}this.get(i).isCSPluginEnabled();var{cursor:o="",totalCount:r}=e.data,t=`totalCount:${r} cost:`+(t=m,Date.now()-t)+" ms",t=(ee.l(a+` ok. cursor:${o} `+t),u.setMessage(c+" "+t).end(),this._genRes(n,s,e.data));return te({searchResultList:t,cursor:o,totalCount:r})}).catch(e=>(u.setMessage(c).setError(e).end(),me(e)))}_genParams(e,t){let{count:s,...r}=t;var o;return s&&(r.count=parseInt(s)),e===ye?this._genMsgParams(r):({keywordList:t,keywordListMatchType:o}=t,r.keywords=t,r.keywordMatchType="and"===o?1:0,e===Te?this._genUserParams(r):r)}_genMsgParams(e){let{conversationID:t,timePosition:s,timePeriod:r,...o}=e;return W(t)||(e=t,j(e)&&e.slice(0,3)===L&&(o.account=t.replace(L,"")),e=t,j(e)&&e.slice(0,5)===R&&(o.groupID=t.replace(R,""))),G(r)&&0{var o=t?""+R+t:""+L+e,i={conversationID:o,messageCount:s,messageList:[]};if(!(n&&1!!e);if(0