open-im-sdk-for-cocos
Version:
OpenIM SDK for js extend cocos
2 lines (1 loc) • 46.9 kB
JavaScript
function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.apply(this,arguments)}function t(e,n){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},t(e,n)}function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}var r,o,i;!function(e){e[e.ConnectionEstablishmentFailed=1e4]="ConnectionEstablishmentFailed",e[e.ResourceLoadNotCompleteError=10004]="ResourceLoadNotCompleteError",e[e.UnknownError=10005]="UnknownError",e[e.LoginRepeatError=10102]="LoginRepeatError"}(r||(r={})),function(e){e.InitSDK="InitSDK",e.Login="Login",e.Logout="Logout",e.GetLoginStatus="GetLoginStatus",e.GetLoginUserID="GetLoginUserID",e.GetSelfUserInfo="GetSelfUserInfo",e.SetSelfInfo="SetSelfInfo",e.GetUsersInfoWithCache="GetUsersInfoWithCache",e.SubscribeUsersStatus="SubscribeUsersStatus",e.UnsubscribeUsersStatus="UnsubscribeUsersStatus",e.GetSubscribeUsersStatus="GetSubscribeUsersStatus",e.SetAppBackgroundStatus="SetAppBackgroundStatus",e.NetworkStatusChanged="NetworkStatusChanged",e.SetGlobalRecvMessageOpt="SetGlobalRecvMessageOpt",e.AcceptFriendApplication="AcceptFriendApplication",e.AddBlack="AddBlack",e.AddFriend="AddFriend",e.CheckFriend="CheckFriend",e.DeleteFriend="DeleteFriend",e.GetBlackList="GetBlackList",e.GetFriendApplicationListAsApplicant="GetFriendApplicationListAsApplicant",e.GetFriendApplicationListAsRecipient="GetFriendApplicationListAsRecipient",e.GetFriendList="GetFriendList",e.GetSpecifiedFriendsInfo="GetSpecifiedFriendsInfo",e.RefuseFriendApplication="RefuseFriendApplication",e.RemoveBlack="RemoveBlack",e.SearchFriends="SearchFriends",e.SetFriendRemark="SetFriendRemark",e.CreateGroup="CreateGroup",e.JoinGroup="JoinGroup",e.InviteUserToGroup="InviteUserToGroup",e.GetJoinedGroupList="GetJoinedGroupList",e.SearchGroups="SearchGroups",e.GetSpecifiedGroupsInfo="GetSpecifiedGroupsInfo",e.SetGroupInfo="SetGroupInfo",e.GetGroupApplicationListAsRecipient="GetGroupApplicationListAsRecipient",e.GetGroupApplicationListAsApplicant="GetGroupApplicationListAsApplicant",e.AcceptGroupApplication="AcceptGroupApplication",e.RefuseGroupApplication="RefuseGroupApplication",e.GetGroupMemberList="GetGroupMemberList",e.GetSpecifiedGroupMembersInfo="GetSpecifiedGroupMembersInfo",e.SearchGroupMembers="SearchGroupMembers",e.SetGroupMemberInfo="SetGroupMemberInfo",e.GetGroupMemberOwnerAndAdmin="GetGroupMemberOwnerAndAdmin",e.GetGroupMemberListByJoinTimeFilter="GetGroupMemberListByJoinTimeFilter",e.KickGroupMember="KickGroupMember",e.ChangeGroupMemberMute="ChangeGroupMemberMute",e.ChangeGroupMute="ChangeGroupMute",e.TransferGroupOwner="TransferGroupOwner",e.DismissGroup="DismissGroup",e.QuitGroup="QuitGroup",e.GetAllConversationList="GetAllConversationList",e.GetConversationListSplit="GetConversationListSplit",e.GetOneConversation="GetOneConversation",e.GetMultipleConversation="GetMultipleConversation",e.GetConversationIDBySessionType="GetConversationIDBySessionType",e.GetTotalUnreadMsgCount="GetTotalUnreadMsgCount",e.MarkConversationMessageAsRead="MarkConversationMessageAsRead",e.SetConversationDraft="SetConversationDraft",e.PinConversation="PinConversation",e.SetConversationRecvMessageOpt="SetConversationRecvMessageOpt",e.SetConversationPrivateChat="SetConversationPrivateChat",e.SetConversationBurnDuration="SetConversationBurnDuration",e.ResetConversationGroupAtType="ResetConversationGroupAtType",e.HideConversation="HideConversation",e.HideAllConversation="HideAllConversation",e.ClearConversationAndDeleteAllMsg="ClearConversationAndDeleteAllMsg",e.DeleteConversationAndDeleteAllMsg="DeleteConversationAndDeleteAllMsg",e.CreateTextMessage="CreateTextMessage",e.CreateTextAtMessage="CreateTextAtMessage",e.CreateImageMessageByFile="CreateImageMessageByFile",e.CreateImageMessageByURL="CreateImageMessageByURL",e.CreateSoundMessageByFile="CreateSoundMessageByFile",e.CreateSoundMessageByURL="CreateSoundMessageByURL",e.CreateVideoMessageByFile="CreateVideoMessageByFile",e.CreateVideoMessageByURL="CreateVideoMessageByURL",e.CreateFileMessageByFile="CreateFileMessageByFile",e.CreateFileMessageByURL="CreateFileMessageByURL",e.CreateMergerMessage="CreateMergerMessage",e.CreateForwardMessage="CreateForwardMessage",e.CreateLocationMessage="CreateLocationMessage",e.CreateQuoteMessage="CreateQuoteMessage",e.CreateCardMessage="CreateCardMessage",e.CreateCustomMessage="CreateCustomMessage",e.CreateFaceMessage="CreateFaceMessage",e.SendMessage="SendMessage",e.SendMessageNotOss="SendMessageNotOss",e.UploadFile="UploadFile",e.TypingStatusUpdate="TypingStatusUpdate",e.RevokeMessage="RevokeMessage",e.DeleteMessage="DeleteMessage",e.DeleteMessageFromLocalStorage="DeleteMessageFromLocalStorage",e.DeleteAllMsgFromLocal="DeleteAllMsgFromLocal",e.DeleteAllMsgFromLocalAndSvr="DeleteAllMsgFromLocalAndSvr",e.SearchLocalMessages="SearchLocalMessages",e.GetAdvancedHistoryMessageList="GetAdvancedHistoryMessageList",e.GetAdvancedHistoryMessageListReverse="GetAdvancedHistoryMessageListReverse",e.FindMessageList="FindMessageList",e.InsertGroupMessageToLocalStorage="InsertGroupMessageToLocalStorage",e.InsertSingleMessageToLocalStorage="InsertSingleMessageToLocalStorage",e.SetMessageLocalEx="SetMessageLocalEx"}(o||(o={})),function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(i||(i={}));var s,a=function(e,t,n,r,s){var a=this,u=this;void 0===r&&(r=5e3),void 0===s&&(s=10),this.onMessage=void 0,this.onReconnectSuccess=void 0,this.ws=void 0,this.url=void 0,this.reconnectInterval=void 0,this.maxReconnectAttempts=void 0,this.reconnectAttempts=void 0,this.shouldReconnect=void 0,this.isProcessingMessage=!1,this.platformNamespace=void 0,this.checkPlatform=function(){return"undefined"!=typeof WebSocket?(console.info("IMSDK","this is web"),"web"):"undefined"!=typeof my?"my":"undefined"!=typeof uni?"uni":"undefined"!=typeof wx?"wx":(console.error("IMSDK","paltform is unkonwn"),"unknow")},this.connect=function(){return"unknow"===u.platformNamespace?Promise.reject(new Error("WebSocket is not supported")):new Promise(function(e,t){if(u.ws&&u.ws.readyState!==i.CLOSED)u.ws.readyState===u.ws.OPEN?e():t(new Error("WebSocket is in an unknown state"));else{var n=function(){u.reconnectAttempts&&u.onReconnectSuccess(),u.reconnectAttempts=0,console.info("IMSDK","WebSocket connection opened"),e()},r=function(e){console.error("IMSDK WebSocket error:",JSON.stringify(e)),t(e)};if("web"===u.platformNamespace)console.info("IMSDK","connect by WebSocket"),console.info("IMSDK","connect to "+u.url),u.ws=new WebSocket(u.url),u.ws.onopen=n,u.ws.onerror=r;else{var o={url:u.url,complete:function(){}};"uni"===u.platformNamespace&&(u.ws=uni.connectSocket(o)),"wx"===u.platformNamespace&&(u.ws=wx.connectSocket(o)),u.ws.onOpen(n),u.ws.onError(r)}u.setupEventListeners()}})},this.setupEventListeners=function(){if(u.ws){var e=function(e){return u.onBinaryMessage(e.data)},t=function e(t){if(u.shouldReconnect&&u.reconnectAttempts<u.maxReconnectAttempts){if(u.isProcessingMessage)return void setTimeout(function(){return e()},100);setTimeout(function(){return u.connect()},u.reconnectInterval),u.reconnectAttempts++}};"web"===u.platformNamespace?(u.ws.onmessage=e,u.ws.onclose=t):(u.ws.onMessage(e),u.ws.onClose(t))}},this.onBinaryMessage=function(e){try{a.isProcessingMessage=!0;var t=JSON.parse(e);return a.onMessage(t),t.event===o.Login&&0===t.errCode&&(a.shouldReconnect=!0),a.isProcessingMessage=!1,Promise.resolve()}catch(e){return Promise.reject(e)}},this.encodeMessage=function(e){return function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);for(var t,n=[],r=0;r<e.length;r++)(t=e.charCodeAt(r))>=65536&&t<=1114111?(n.push(t>>18&7|240),n.push(t>>12&63|128),n.push(t>>6&63|128),n.push(63&t|128)):t>=2048&&t<=65535?(n.push(t>>12&15|224),n.push(t>>6&63|128),n.push(63&t|128)):t>=128&&t<=2047?(n.push(t>>6&31|192),n.push(63&t|128)):n.push(255&t);return new Uint8Array(n).buffer}(JSON.stringify(e))},this.sendMessage=function(e){var t;(null==(t=u.ws)?void 0:t.readyState)===i.OPEN?u.ws.send("web"===u.platformNamespace?JSON.stringify(e):{data:JSON.stringify(e)}):console.error("WebSocket is not open. Message not sent.")},this.close=function(){var e;u.shouldReconnect=!1,(null==(e=u.ws)?void 0:e.readyState)===i.OPEN&&u.ws.close()},this.onMessage=t,this.onReconnectSuccess=n,this.url=e,this.reconnectInterval=r,this.maxReconnectAttempts=s,this.reconnectAttempts=0,this.shouldReconnect=!1,this.platformNamespace=this.checkPlatform(),console.log("IMSDK",this.url),console.log("IMSDK","platform is "+this.platformNamespace)},u=/*#__PURE__*/function(){function e(){this.events=void 0,this.events={}}var t=e.prototype;return t.emit=function(e,t){return this.events[e]&&this.events[e].forEach(function(e){return e(t)}),this},t.on=function(e,t){return this.events[e]?this.events[e].push(t):this.events[e]=[t],this},t.off=function(e,t){if(e&&"function"==typeof t&&this.events[e]){var n=this.events[e];if(!n||0===n.length)return;var r=n.findIndex(function(e){return e===t});-1!==r&&n.splice(r,1)}return this},e}();!function(e){e.OnConnectFailed="OnConnectFailed",e.OnConnectSuccess="OnConnectSuccess",e.OnConnecting="OnConnecting",e.OnKickedOffline="OnKickedOffline",e.OnSelfInfoUpdated="OnSelfInfoUpdated",e.OnUserTokenExpired="OnUserTokenExpired",e.OnProgress="OnProgress",e.OnRecvNewMessage="OnRecvNewMessage",e.OnRecvNewMessages="OnRecvNewMessages",e.OnRecvMessageRevoked="OnRecvMessageRevoked",e.OnNewRecvMessageRevoked="OnNewRecvMessageRevoked",e.OnRecvC2CReadReceipt="OnRecvC2CReadReceipt",e.OnRecvGroupReadReceipt="OnRecvGroupReadReceipt",e.OnConversationChanged="OnConversationChanged",e.OnNewConversation="OnNewConversation",e.OnSyncServerFailed="OnSyncServerFailed",e.OnSyncServerFinish="OnSyncServerFinish",e.OnSyncServerStart="OnSyncServerStart",e.OnTotalUnreadMessageCountChanged="OnTotalUnreadMessageCountChanged",e.OnBlackAdded="OnBlackAdded",e.OnBlackDeleted="OnBlackDeleted",e.OnFriendApplicationAccepted="OnFriendApplicationAccepted",e.OnFriendApplicationAdded="OnFriendApplicationAdded",e.OnFriendApplicationDeleted="OnFriendApplicationDeleted",e.OnFriendApplicationRejected="OnFriendApplicationRejected",e.OnFriendInfoChanged="OnFriendInfoChanged",e.OnFriendAdded="OnFriendAdded",e.OnFriendDeleted="OnFriendDeleted",e.OnJoinedGroupAdded="OnJoinedGroupAdded",e.OnJoinedGroupDeleted="OnJoinedGroupDeleted",e.OnGroupDismissed="OnGroupDismissed",e.OnGroupMemberAdded="OnGroupMemberAdded",e.OnGroupMemberDeleted="OnGroupMemberDeleted",e.OnGroupApplicationAdded="OnGroupApplicationAdded",e.OnGroupApplicationDeleted="OnGroupApplicationDeleted",e.OnGroupInfoChanged="OnGroupInfoChanged",e.OnGroupMemberInfoChanged="OnGroupMemberInfoChanged",e.OnGroupApplicationAccepted="OnGroupApplicationAccepted",e.OnGroupApplicationRejected="OnGroupApplicationRejected",e.UploadComplete="UploadComplete",e.OnRecvCustomBusinessMessage="OnRecvCustomBusinessMessage",e.OnUserStatusChanged="OnUserStatusChanged",e.OnReceiveNewInvitation="OnReceiveNewInvitation",e.OnInviteeAccepted="OnInviteeAccepted",e.OnInviteeRejected="OnInviteeRejected",e.OnInvitationCancelled="OnInvitationCancelled",e.OnHangUp="OnHangUp",e.OnInvitationTimeout="OnInvitationTimeout",e.OnInviteeAcceptedByOtherDevice="OnInviteeAcceptedByOtherDevice",e.OnInviteeRejectedByOtherDevice="OnInviteeRejectedByOtherDevice",e.OnStreamChange="OnStreamChange",e.OnRoomParticipantConnected="OnRoomParticipantConnected",e.OnRoomParticipantDisconnected="OnRoomParticipantDisconnected",e.OnReceiveCustomSignal="OnReceiveCustomSignal"}(s||(s={}));var c,d,p=(c=function(e,t){e.exports=function(e){var t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function n(e,t){var n=e[0],r=e[1],o=e[2],i=e[3];r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&o|~r&i)+t[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&o)+t[1]-389564586|0)<<12|i>>>20)+n|0)&n|~i&r)+t[2]+606105819|0)<<17|o>>>15)+i|0)&i|~o&n)+t[3]-1044525330|0)<<22|r>>>10)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&o|~r&i)+t[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&o)+t[5]+1200080426|0)<<12|i>>>20)+n|0)&n|~i&r)+t[6]-1473231341|0)<<17|o>>>15)+i|0)&i|~o&n)+t[7]-45705983|0)<<22|r>>>10)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&o|~r&i)+t[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&o)+t[9]-1958414417|0)<<12|i>>>20)+n|0)&n|~i&r)+t[10]-42063|0)<<17|o>>>15)+i|0)&i|~o&n)+t[11]-1990404162|0)<<22|r>>>10)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&o|~r&i)+t[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&o)+t[13]-40341101|0)<<12|i>>>20)+n|0)&n|~i&r)+t[14]-1502002290|0)<<17|o>>>15)+i|0)&i|~o&n)+t[15]+1236535329|0)<<22|r>>>10)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&i|o&~i)+t[1]-165796510|0)<<5|n>>>27)+r|0)&o|r&~o)+t[6]-1069501632|0)<<9|i>>>23)+n|0)&r|n&~r)+t[11]+643717713|0)<<14|o>>>18)+i|0)&n|i&~n)+t[0]-373897302|0)<<20|r>>>12)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&i|o&~i)+t[5]-701558691|0)<<5|n>>>27)+r|0)&o|r&~o)+t[10]+38016083|0)<<9|i>>>23)+n|0)&r|n&~r)+t[15]-660478335|0)<<14|o>>>18)+i|0)&n|i&~n)+t[4]-405537848|0)<<20|r>>>12)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&i|o&~i)+t[9]+568446438|0)<<5|n>>>27)+r|0)&o|r&~o)+t[14]-1019803690|0)<<9|i>>>23)+n|0)&r|n&~r)+t[3]-187363961|0)<<14|o>>>18)+i|0)&n|i&~n)+t[8]+1163531501|0)<<20|r>>>12)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r&i|o&~i)+t[13]-1444681467|0)<<5|n>>>27)+r|0)&o|r&~o)+t[2]-51403784|0)<<9|i>>>23)+n|0)&r|n&~r)+t[7]+1735328473|0)<<14|o>>>18)+i|0)&n|i&~n)+t[12]-1926607734|0)<<20|r>>>12)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r^o^i)+t[5]-378558|0)<<4|n>>>28)+r|0)^r^o)+t[8]-2022574463|0)<<11|i>>>21)+n|0)^n^r)+t[11]+1839030562|0)<<16|o>>>16)+i|0)^i^n)+t[14]-35309556|0)<<23|r>>>9)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r^o^i)+t[1]-1530992060|0)<<4|n>>>28)+r|0)^r^o)+t[4]+1272893353|0)<<11|i>>>21)+n|0)^n^r)+t[7]-155497632|0)<<16|o>>>16)+i|0)^i^n)+t[10]-1094730640|0)<<23|r>>>9)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r^o^i)+t[13]+681279174|0)<<4|n>>>28)+r|0)^r^o)+t[0]-358537222|0)<<11|i>>>21)+n|0)^n^r)+t[3]-722521979|0)<<16|o>>>16)+i|0)^i^n)+t[6]+76029189|0)<<23|r>>>9)+o|0,r=((r+=((o=((o+=((i=((i+=((n=((n+=(r^o^i)+t[9]-640364487|0)<<4|n>>>28)+r|0)^r^o)+t[12]-421815835|0)<<11|i>>>21)+n|0)^n^r)+t[15]+530742520|0)<<16|o>>>16)+i|0)^i^n)+t[2]-995338651|0)<<23|r>>>9)+o|0,r=((r+=((i=((i+=(r^((n=((n+=(o^(r|~i))+t[0]-198630844|0)<<6|n>>>26)+r|0)|~o))+t[7]+1126891415|0)<<10|i>>>22)+n|0)^((o=((o+=(n^(i|~r))+t[14]-1416354905|0)<<15|o>>>17)+i|0)|~n))+t[5]-57434055|0)<<21|r>>>11)+o|0,r=((r+=((i=((i+=(r^((n=((n+=(o^(r|~i))+t[12]+1700485571|0)<<6|n>>>26)+r|0)|~o))+t[3]-1894986606|0)<<10|i>>>22)+n|0)^((o=((o+=(n^(i|~r))+t[10]-1051523|0)<<15|o>>>17)+i|0)|~n))+t[1]-2054922799|0)<<21|r>>>11)+o|0,r=((r+=((i=((i+=(r^((n=((n+=(o^(r|~i))+t[8]+1873313359|0)<<6|n>>>26)+r|0)|~o))+t[15]-30611744|0)<<10|i>>>22)+n|0)^((o=((o+=(n^(i|~r))+t[6]-1560198380|0)<<15|o>>>17)+i|0)|~n))+t[13]+1309151649|0)<<21|r>>>11)+o|0,r=((r+=((i=((i+=(r^((n=((n+=(o^(r|~i))+t[4]-145523070|0)<<6|n>>>26)+r|0)|~o))+t[11]-1120210379|0)<<10|i>>>22)+n|0)^((o=((o+=(n^(i|~r))+t[2]+718787259|0)<<15|o>>>17)+i|0)|~n))+t[9]-343485551|0)<<21|r>>>11)+o|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=o+e[2]|0,e[3]=i+e[3]|0}function r(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function o(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function i(e){var t,o,i,s,a,u,c=e.length,d=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(d,r(e.substring(t-64,t)));for(o=(e=e.substring(t-64)).length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<o;t+=1)i[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(n(d,i),t=0;t<16;t+=1)i[t]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,i[14]=a,i[15]=u,n(d,i),d}function s(e){var n,r="";for(n=0;n<4;n+=1)r+=t[e>>8*n+4&15]+t[e>>8*n&15];return r}function a(e){var t;for(t=0;t<e.length;t+=1)e[t]=s(e[t]);return e.join("")}function u(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function c(e){var t,n=[],r=e.length;for(t=0;t<r-1;t+=2)n.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,n)}function d(){this.reset()}return a(i("hello")),"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function e(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(t,n){var r,o,i,s,a=this.byteLength,u=e(t,a),c=a;return void 0!==n&&(c=e(n,a)),u>c?new ArrayBuffer(0):(r=c-u,o=new ArrayBuffer(r),i=new Uint8Array(o),s=new Uint8Array(this,u,r),i.set(s),o)}}(),d.prototype.append=function(e){return this.appendBinary(u(e)),this},d.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,o=this._buff.length;for(t=64;t<=o;t+=64)n(this._hash,r(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},d.prototype.end=function(e){var t,n,r=this._buff,o=r.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<o;t+=1)i[t>>2]|=r.charCodeAt(t)<<(t%4<<3);return this._finish(i,o),n=a(this._hash),e&&(n=c(n)),this.reset(),n},d.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},d.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},d.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},d.prototype._finish=function(e,t){var r,o,i,s=t;if(e[s>>2]|=128<<(s%4<<3),s>55)for(n(this._hash,e),s=0;s<16;s+=1)e[s]=0;r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(r[2],16),i=parseInt(r[1],16)||0,e[14]=o,e[15]=i,n(this._hash,e)},d.hash=function(e,t){return d.hashBinary(u(e),t)},d.hashBinary=function(e,t){var n=a(i(e));return t?c(n):n},(d.ArrayBuffer=function(){this.reset()}).prototype.append=function(e){var t,r,i,s,a=(r=this._buff.buffer,i=e,(s=new Uint8Array(r.byteLength+i.byteLength)).set(new Uint8Array(r)),s.set(new Uint8Array(i),r.byteLength),s),u=a.length;for(this._length+=e.byteLength,t=64;t<=u;t+=64)n(this._hash,o(a.subarray(t-64,t)));return this._buff=t-64<u?new Uint8Array(a.buffer.slice(t-64)):new Uint8Array(0),this},d.ArrayBuffer.prototype.end=function(e){var t,n,r=this._buff,o=r.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<o;t+=1)i[t>>2]|=r[t]<<(t%4<<3);return this._finish(i,o),n=a(this._hash),e&&(n=c(n)),this.reset(),n},d.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.ArrayBuffer.prototype.getState=function(){var e=d.prototype.getState.call(this);return e.buff=String.fromCharCode.apply(null,new Uint8Array(e.buff)),e},d.ArrayBuffer.prototype.setState=function(e){return e.buff=function(e,t){var n,r=e.length,o=new ArrayBuffer(r),i=new Uint8Array(o);for(n=0;n<r;n+=1)i[n]=e.charCodeAt(n);return i}(e.buff),d.prototype.setState.call(this,e)},d.ArrayBuffer.prototype.destroy=d.prototype.destroy,d.ArrayBuffer.prototype._finish=d.prototype._finish,d.ArrayBuffer.hash=function(e,t){var r=a(function(e){var t,r,i,s,a,u,c=e.length,d=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=c;t+=64)n(d,o(e.subarray(t-64,t)));for(r=(e=t-64<c?e.subarray(t-64):new Uint8Array(0)).length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<r;t+=1)i[t>>2]|=e[t]<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(n(d,i),t=0;t<16;t+=1)i[t]=0;return s=(s=8*c).toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,i[14]=a,i[15]=u,n(d,i),d}(new Uint8Array(e)));return t?c(r):r},d}()},c(d={exports:{}}),d.exports),l=function(e){try{if(!e.ok)throw new Error(e.statusText);return Promise.resolve(e.json()).then(function(e){if(0!==e.errCode)throw new Error(e.errMsg);return e.data})}catch(e){return Promise.reject(e)}},g={txt:"text/plain",html:"text/html",css:"text/css",js:"text/javascript",json:"application/json",csv:"text/csv",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",bmp:"image/bmp",svg:"image/svg+xml",mp3:"audio/mpeg",mp4:"video/mp4",wav:"audio/wav",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",xml:"application/xml",zip:"application/zip",tar:"application/x-tar","7z":"application/x-7z-compressed",rar:"application/vnd.rar",ogg:"audio/ogg",midi:"audio/midi",webm:"audio/webm",avi:"video/x-msvideo",mpeg:"video/mpeg",ts:"video/mp2t",mov:"video/quicktime",wmv:"video/x-ms-wmv",flv:"video/x-flv",mkv:"video/x-matroska",webp:"image/webp",heic:"image/heic",psd:"image/vnd.adobe.photoshop",ai:"application/postscript",eps:"application/postscript",ttf:"font/ttf",otf:"font/otf",woff:"font/woff",woff2:"font/woff2",jsonld:"application/ld+json",ics:"text/calendar",sh:"application/x-sh",php:"application/x-httpd-php",jar:"application/java-archive"},f=function(){return(36*Math.random()).toString(36).slice(2)+(new Date).getTime().toString()};function v(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}var h=[o.Logout,s.OnKickedOffline,s.OnUserTokenExpired];function M(e,t,n){if(!e.s){if(n instanceof m){if(!n.s)return void(n.o=M.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(M.bind(null,e,t),M.bind(null,e,2));e.s=t,e.v=n;const r=e.o;r&&r(e)}}var m=/*#__PURE__*/function(){function e(){}return e.prototype.then=function(t,n){var r=new e,o=this.s;if(o){var i=1&o?t:n;if(i){try{M(r,1,i(this.v))}catch(e){M(r,2,e)}return r}return this}return this.o=function(e){try{var o=e.v;1&e.s?M(r,1,t?t(o):o):n?M(r,1,n(o)):M(r,2,o)}catch(e){M(r,2,e)}},r},e}();function S(e){return e instanceof m&&1&e.s}var A,y,C,F,O,G,R,I,L,b,D,w,N,U,k,q,B,P,T,J=/*#__PURE__*/function(i){var u,c;function d(){var t,u;return(t=i.call(this)||this).userID=void 0,t.token=void 0,t.apiAddr=void 0,t.wsManager=void 0,t.requestMap=new Map,t.sendRequest=function(e){return new Promise(function(n,o){var i;t.wsManager?(t.requestMap.set(e.operationID,{resolve:n,reject:o}),null==(i=t.wsManager)||i.sendMessage(e)):o({data:"",operationID:e.operationID,errMsg:"please login first",errCode:r.ResourceLoadNotCompleteError,event:e.reqFuncName})})},t.defaultDataFormatter=function(e){return"object"==typeof e&&(e=JSON.stringify(e)),JSON.stringify([e])},t.createRequestFunction=function(e,n){return void 0===n&&(n=t.defaultDataFormatter),function(r,o){void 0===o&&(o=f());var i=n(r);return t.sendRequest({data:i,operationID:o,userID:t.userID,reqFuncName:e})}},t.createRequestFunctionWithoutParams=function(e){return function(n){return void 0===n&&(n=f()),t.sendRequest({data:"[]",operationID:n,userID:t.userID,reqFuncName:e})}},t.handleMessage=function(e){if(e.event!==o.InitSDK){try{e.data=JSON.parse(e.data)}catch(e){}var n,r;if(h.includes(e.event)&&(null==(n=t.wsManager)||n.close(),t.wsManager=void 0),r=e.event,Object.values(s).includes(r))return t.emit(e.event,e),void(h.includes(e.event)&&t.requestMap.clear());var i=t.requestMap.get(e.operationID);i&&((0===e.errCode?i.resolve:i.reject)(e),t.requestMap.delete(e.operationID)),h.includes(e.event)&&t.requestMap.clear()}else 0!==e.errCode&&console.error(e)},t.handleReconnectSuccess=function(){t.userID&&t.sendRequest({data:JSON.stringify([t.userID,t.token]),operationID:f(),userID:t.userID,reqFuncName:o.Login})},t.login=function(e,n){try{var i,s=function(r){return i?r:t.sendRequest({data:JSON.stringify([e.userID,e.token]),operationID:n,userID:t.userID,reqFuncName:o.Login})};if(void 0===n&&(n=f()),t.wsManager)return Promise.resolve({data:"",operationID:n,errMsg:"login repeat",errCode:r.LoginRepeatError,event:o.Login});var u=e.wsAddr+"?sendID="+e.userID+"&token="+e.token+"&platformID="+e.platformID+"&operationID="+n;t.userID=e.userID,t.token=e.token,t.apiAddr=e.apiAddr,t.wsManager=new a(u,t.handleMessage,t.handleReconnectSuccess);var c=v(function(){return Promise.resolve(t.wsManager.connect()).then(function(){})},function(e){var t=Promise.reject({data:"",operationID:n,errMsg:e.message,errCode:r.ConnectionEstablishmentFailed,event:o.Login});return i=1,t});return Promise.resolve(c&&c.then?c.then(s):s(c))}catch(e){return Promise.reject(e)}},t.logout=t.createRequestFunctionWithoutParams(o.Logout),t.getLoginStatus=t.createRequestFunctionWithoutParams(o.GetLoginStatus),t.getLoginUserID=t.createRequestFunctionWithoutParams(o.GetLoginUserID),t.internalUploadFile=function(n,r){try{return Promise.resolve(v(function(){var o=t.userID+"/"+n.name,i=function(e){var t,n,r=null!=(t=null==(n=e.split(".").pop())?void 0:n.toLowerCase())?t:"";return g[r]||"application/octet-stream"}(n.name),s={operationID:r,token:t.token};return Promise.resolve(function(t,n,r){return fetch(t+"/object/part_size",{method:"POST",headers:e({},r),body:JSON.stringify({size:n})}).then(l)}(t.apiAddr,n.size,s)).then(function(r){var a=r.size;function u(){var r=g.join(",");f.destroy();var u=new p;return u.append(r),Promise.resolve(function(t,n,r){return fetch(t+"/object/initiate_multipart_upload",{method:"POST",headers:e({},r),body:JSON.stringify(n)}).then(l)}(t.apiAddr,{hash:u.end(),size:n.size,partSize:a,maxParts:-1,cause:"",name:o,contentType:i},s)).then(function(r){var a=r.url,c=r.upload;if(u.destroy(),a)return{url:a};var p=c.sign.query,f=c.sign.header;return Promise.resolve(Promise.all(c.sign.parts.map(function(e,t){try{var r=new URL(e.url||c.sign.url);if(p){var o=new URLSearchParams(r.search);p.forEach(function(e){o.set(e.key,e.values[0])}),r.search=o.toString()}if(e.query){var s=new URLSearchParams(r.search);e.query.forEach(function(e){s.set(e.key,e.values[0])}),r.search=s.toString()}var a=r.toString(),u=new Headers;return f&&f.forEach(function(e){u.set(e.key,e.values[0])}),e.header&&e.header.forEach(function(e){u.set(e.key,e.values[0])}),u.set("Content-Length",(d[t].end-d[t].start).toString()),u.set("Content-Type",i),Promise.resolve(fetch(a,{method:"PUT",headers:u,body:n.slice(d[t].start,d[t].end)})).then(function(e){if(!e.ok)throw new Error("Failed to upload chunk "+(t+1))})}catch(e){return Promise.reject(e)}}))).then(function(){return Promise.resolve(function(t,n,r){return fetch(t+"/object/complete_multipart_upload",{method:"POST",headers:e({},r),body:JSON.stringify(n)}).then(l)}(t.apiAddr,{uploadID:c.uploadID,parts:g,cause:"",name:o,contentType:i},s)).then(function(e){return{url:e.url}})})})}var c=Math.ceil(n.size/a),d=[],g=[],f=new p.ArrayBuffer,v=0,h=function(e,t,n){for(var r;;){var o=e();if(S(o)&&(o=o.v),!o)return i;if(o.then){r=0;break}var i=n();if(i&&i.then){if(!S(i)){r=1;break}i=i.s}if(t){var s=t();if(s&&s.then&&!S(s)){r=2;break}}}var a=new m,u=M.bind(null,a,2);return(0===r?o.then(d):1===r?i.then(c):s.then(p)).then(void 0,u),a;function c(r){i=r;do{if(t&&(s=t())&&s.then&&!S(s))return void s.then(p).then(void 0,u);if(!(o=e())||S(o)&&!o.v)return void M(a,1,i);if(o.then)return void o.then(d).then(void 0,u);S(i=n())&&(i=i.v)}while(!i||!i.then);i.then(c).then(void 0,u)}function d(e){e?(i=n())&&i.then?i.then(c).then(void 0,u):c(i):M(a,1,i)}function p(){(o=e())?o.then?o.then(d).then(void 0,u):d(o):M(a,1,i)}}(function(){return v<c},void 0,function(){var e=v*a,t=Math.min(e+a,n.size),r=n.slice(e,t);return d.push({start:e,end:t}),Promise.resolve(new Promise(function(e,t){var n=new FileReader;n.readAsArrayBuffer(r),n.onload=function(t){t.target&&(f.append(t.target.result),e(f.end()))},n.onerror=function(e){return t(e)}})).then(function(e){g.push(e),v++})});return h&&h.then?h.then(u):u()})},function(e){return console.error("Upload failed:",e),{error:e}}))}catch(e){return Promise.reject(e)}},t.uploadFile=function(e,n){var i=e.file;try{return void 0===n&&(n=f()),Promise.resolve(t.internalUploadFile(i,n)).then(function(e){var t,i=e.url,s=e.error;return{data:{url:void 0===i?"":i},operationID:n,errMsg:null!=(t=null==s?void 0:s.message)?t:"",errCode:s?r.UnknownError:0,event:o.UploadFile}})}catch(e){return Promise.reject(e)}},t.createImageMessageByFile=function(n,i){try{return void 0===i&&(i=f()),Promise.resolve(t.internalUploadFile(n.file,i)).then(function(s){var a=s.url,u=s.error;if(u)return Promise.reject({data:"",operationID:i,errMsg:u.message,errCode:r.UnknownError,event:o.CreateImageMessageByFile});n.sourcePicture.url=a,n.bigPicture.url=a,n.snapshotPicture.url=a+"?type=image&width="+n.snapshotPicture.width+"&height="+n.snapshotPicture.height;var c=e({},n);return delete c.file,t.createImageMessageByURL(c,i)})}catch(e){return Promise.reject(e)}},t.createVideoMessageByFile=function(n,i){try{return void 0===i&&(i=f()),Promise.resolve(v(function(){return Promise.resolve(Promise.all([t.internalUploadFile(n.snapshotFile,i),t.internalUploadFile(n.videoFile,i)])).then(function(r){var o=r[0].url;n.videoUrl=r[1].url,n.snapshotUrl=o+"?type=image&width="+n.snapshotWidth+"&height="+n.snapshotHeight;var s=e({},n);return delete s.videoFile,delete s.snapshotFile,t.createVideoMessageByURL(s,i)})},function(e){return Promise.reject({data:"",operationID:i,errMsg:e.message,errCode:r.UnknownError,event:o.CreateVideoMessageByFile})}))}catch(e){return Promise.reject(e)}},t.createSoundMessageByFile=function(n,i){try{return void 0===i&&(i=f()),Promise.resolve(t.internalUploadFile(n.file,i)).then(function(s){var a=s.url,u=s.error;if(u)return Promise.reject({data:"",operationID:i,errMsg:u.message,errCode:r.UnknownError,event:o.CreateSoundMessageByFile});n.sourceUrl=a;var c=e({},n);return delete c.file,t.createSoundMessageByURL(c,i)})}catch(e){return Promise.reject(e)}},t.createFileMessageByFile=function(n,i){try{return void 0===i&&(i=f()),Promise.resolve(t.internalUploadFile(n.file,i)).then(function(s){var a=s.url,u=s.error;if(u)return Promise.reject({data:"",operationID:i,errMsg:u.message,errCode:r.UnknownError,event:o.CreateFileMessageByFile});n.sourceUrl=a;var c=e({},n);return delete c.file,t.createFileMessageByURL(c,i)})}catch(e){return Promise.reject(e)}},t.getSelfUserInfo=void 0,t.setSelfInfo=void 0,t.getUsersInfoWithCache=void 0,t.subscribeUsersStatus=void 0,t.unsubscribeUsersStatus=void 0,t.getSubscribeUsersStatus=void 0,t.setAppBackgroundStatus=void 0,t.networkStatusChanged=void 0,t.setGlobalRecvMessageOpt=void 0,t.acceptFriendApplication=void 0,t.addBlack=void 0,t.addFriend=void 0,t.checkFriend=void 0,t.deleteFriend=void 0,t.getBlackList=void 0,t.getFriendApplicationListAsApplicant=void 0,t.getFriendApplicationListAsRecipient=void 0,t.getFriendList=void 0,t.getSpecifiedFriendsInfo=void 0,t.refuseFriendApplication=void 0,t.removeBlack=void 0,t.searchFriends=void 0,t.setFriendRemark=void 0,t.createGroup=void 0,t.joinGroup=void 0,t.inviteUserToGroup=void 0,t.getJoinedGroupList=void 0,t.searchGroups=void 0,t.getSpecifiedGroupsInfo=void 0,t.setGroupInfo=void 0,t.getGroupApplicationListAsRecipient=void 0,t.getGroupApplicationListAsApplicant=void 0,t.acceptGroupApplication=void 0,t.refuseGroupApplication=void 0,t.getGroupMemberList=void 0,t.getSpecifiedGroupMembersInfo=void 0,t.searchGroupMembers=void 0,t.setGroupMemberInfo=void 0,t.getGroupMemberOwnerAndAdmin=void 0,t.getGroupMemberListByJoinTimeFilter=void 0,t.kickGroupMember=void 0,t.changeGroupMemberMute=void 0,t.changeGroupMute=void 0,t.transferGroupOwner=void 0,t.dismissGroup=void 0,t.quitGroup=void 0,t.createTextMessage=void 0,t.createTextAtMessage=void 0,t.createImageMessageByURL=void 0,t.createSoundMessageByURL=void 0,t.createVideoMessageByURL=void 0,t.createFileMessageByURL=void 0,t.createMergerMessage=void 0,t.createForwardMessage=void 0,t.createLocationMessage=void 0,t.createQuoteMessage=void 0,t.createCardMessage=void 0,t.createCustomMessage=void 0,t.createFaceMessage=void 0,t.sendMessage=void 0,t.sendMessageNotOss=void 0,t.typingStatusUpdate=void 0,t.revokeMessage=void 0,t.deleteMessage=void 0,t.deleteMessageFromLocalStorage=void 0,t.deleteAllMsgFromLocal=void 0,t.deleteAllMsgFromLocalAndSvr=void 0,t.searchLocalMessages=void 0,t.getAdvancedHistoryMessageList=void 0,t.getAdvancedHistoryMessageListReverse=void 0,t.findMessageList=void 0,t.insertGroupMessageToLocalStorage=void 0,t.insertSingleMessageToLocalStorage=void 0,t.setMessageLocalEx=void 0,t.getAllConversationList=void 0,t.getConversationListSplit=void 0,t.getOneConversation=void 0,t.getMultipleConversation=void 0,t.getConversationIDBySessionType=void 0,t.getTotalUnreadMsgCount=void 0,t.markConversationMessageAsRead=void 0,t.setConversationDraft=void 0,t.pinConversation=void 0,t.setConversationRecvMessageOpt=void 0,t.setConversationPrivateChat=void 0,t.setConversationBurnDuration=void 0,t.resetConversationGroupAtType=void 0,t.hideConversation=void 0,t.hideAllConversation=void 0,t.clearConversationAndDeleteAllMsg=void 0,t.deleteConversationAndDeleteAllMsg=void 0,Object.assign(n(t),{getSelfUserInfo:(u=n(t)).createRequestFunctionWithoutParams(o.GetSelfUserInfo),setSelfInfo:u.createRequestFunction(o.SetSelfInfo),getUsersInfoWithCache:u.createRequestFunction(o.GetUsersInfoWithCache,function(e){var t;return JSON.stringify([JSON.stringify(e.userIDList),null!=(t=e.groupID)?t:""])}),subscribeUsersStatus:u.createRequestFunction(o.SubscribeUsersStatus),unsubscribeUsersStatus:u.createRequestFunction(o.UnsubscribeUsersStatus),getSubscribeUsersStatus:u.createRequestFunctionWithoutParams(o.GetSubscribeUsersStatus),setAppBackgroundStatus:u.createRequestFunction(o.SetAppBackgroundStatus),networkStatusChanged:u.createRequestFunctionWithoutParams(o.NetworkStatusChanged),setGlobalRecvMessageOpt:u.createRequestFunction(o.SetGlobalRecvMessageOpt)}),Object.assign(n(t),function(e){return{acceptFriendApplication:e.createRequestFunction(o.AcceptFriendApplication),addBlack:e.createRequestFunction(o.AddBlack,function(e){var t;return JSON.stringify([e.toUserID,null!=(t=e.ex)?t:""])}),addFriend:e.createRequestFunction(o.AddFriend),checkFriend:e.createRequestFunction(o.CheckFriend),deleteFriend:e.createRequestFunction(o.DeleteFriend),getBlackList:e.createRequestFunctionWithoutParams(o.GetBlackList),getFriendApplicationListAsApplicant:e.createRequestFunctionWithoutParams(o.GetFriendApplicationListAsApplicant),getFriendApplicationListAsRecipient:e.createRequestFunctionWithoutParams(o.GetFriendApplicationListAsRecipient),getFriendList:e.createRequestFunctionWithoutParams(o.GetFriendList),getSpecifiedFriendsInfo:e.createRequestFunction(o.GetSpecifiedFriendsInfo),refuseFriendApplication:e.createRequestFunction(o.RefuseFriendApplication),removeBlack:e.createRequestFunction(o.RemoveBlack),searchFriends:e.createRequestFunction(o.SearchFriends),setFriendRemark:e.createRequestFunction(o.SetFriendRemark)}}(n(t))),Object.assign(n(t),function(e){return{createGroup:e.createRequestFunction(o.CreateGroup),joinGroup:e.createRequestFunction(o.JoinGroup,function(e){var t;return JSON.stringify([e.groupID,e.reqMsg,e.joinSource,null!=(t=e.ex)?t:""])}),inviteUserToGroup:e.createRequestFunction(o.InviteUserToGroup,function(e){return JSON.stringify([e.groupID,e.reason,JSON.stringify(e.userIDList)])}),getJoinedGroupList:e.createRequestFunctionWithoutParams(o.GetJoinedGroupList),searchGroups:e.createRequestFunction(o.SearchGroups),getSpecifiedGroupsInfo:e.createRequestFunction(o.GetSpecifiedGroupsInfo),setGroupInfo:e.createRequestFunction(o.SetGroupInfo),getGroupApplicationListAsRecipient:e.createRequestFunctionWithoutParams(o.GetGroupApplicationListAsRecipient),getGroupApplicationListAsApplicant:e.createRequestFunctionWithoutParams(o.GetGroupApplicationListAsApplicant),acceptGroupApplication:e.createRequestFunction(o.AcceptGroupApplication,function(e){return JSON.stringify([e.groupID,e.fromUserID,e.handleMsg])}),refuseGroupApplication:e.createRequestFunction(o.RefuseGroupApplication,function(e){return JSON.stringify([e.groupID,e.fromUserID,e.handleMsg])}),getGroupMemberList:e.createRequestFunction(o.GetGroupMemberList,function(e){return JSON.stringify([e.groupID,e.filter,e.offset,e.count])}),getSpecifiedGroupMembersInfo:e.createRequestFunction(o.GetSpecifiedGroupMembersInfo,function(e){return JSON.stringify([e.groupID,JSON.stringify(e.userIDList)])}),searchGroupMembers:e.createRequestFunction(o.SearchGroupMembers),setGroupMemberInfo:e.createRequestFunction(o.SetGroupMemberInfo),getGroupMemberOwnerAndAdmin:e.createRequestFunction(o.GetGroupMemberOwnerAndAdmin),getGroupMemberListByJoinTimeFilter:e.createRequestFunction(o.GetGroupMemberListByJoinTimeFilter,function(e){return JSON.stringify([e.groupID,e.offset,e.count,e.joinTimeBegin,e.joinTimeEnd,JSON.stringify(e.filterUserIDList)])}),kickGroupMember:e.createRequestFunction(o.KickGroupMember,function(e){return JSON.stringify([e.groupID,e.reason,JSON.stringify(e.userIDList)])}),changeGroupMemberMute:e.createRequestFunction(o.ChangeGroupMemberMute,function(e){return JSON.stringify([e.groupID,e.userID,e.mutedSeconds])}),changeGroupMute:e.createRequestFunction(o.ChangeGroupMute,function(e){return JSON.stringify([e.groupID,e.isMute])}),transferGroupOwner:e.createRequestFunction(o.TransferGroupOwner,function(e){return JSON.stringify([e.groupID,e.newOwnerUserID])}),dismissGroup:e.createRequestFunction(o.DismissGroup),quitGroup:e.createRequestFunction(o.QuitGroup)}}(n(t))),Object.assign(n(t),function(e){return{createTextMessage:e.createRequestFunction(o.CreateTextMessage),createTextAtMessage:e.createRequestFunction(o.CreateTextAtMessage,function(e){var t;return JSON.stringify([e.text,JSON.stringify(e.atUserIDList),JSON.stringify(e.atUsersInfo),null!=(t=JSON.stringify(e.message))?t:""])}),createImageMessageByURL:e.createRequestFunction(o.CreateImageMessageByURL,function(e){return JSON.stringify([e.sourcePath,JSON.stringify(e.sourcePicture),JSON.stringify(e.bigPicture),JSON.stringify(e.snapshotPicture)])}),createSoundMessageByURL:e.createRequestFunction(o.CreateSoundMessageByURL),createVideoMessageByURL:e.createRequestFunction(o.CreateVideoMessageByURL),createFileMessageByURL:e.createRequestFunction(o.CreateFileMessageByURL),createMergerMessage:e.createRequestFunction(o.CreateMergerMessage,function(e){return JSON.stringify([JSON.stringify(e.messageList),e.title,JSON.stringify(e.summaryList)])}),createForwardMessage:e.createRequestFunction(o.CreateForwardMessage),createLocationMessage:e.createRequestFunction(o.CreateLocationMessage,function(e){return JSON.stringify([e.description,e.longitude,e.latitude])}),createQuoteMessage:e.createRequestFunction(o.CreateQuoteMessage,function(e){return JSON.stringify([e.text,e.message])}),createCardMessage:e.createRequestFunction(o.CreateCardMessage),createCustomMessage:e.createRequestFunction(o.CreateCustomMessage,function(e){return JSON.stringify([e.data,e.extension,e.description])}),createFaceMessage:e.createRequestFunction(o.CreateFaceMessage,function(e){return JSON.stringify([e.index,e.data])}),sendMessage:e.createRequestFunction(o.SendMessageNotOss,function(e){var t,n,r=null!=(t=e.offlinePushInfo)?t:{title:"You has a new message.",desc:"message",ex:"",iOSPushSound:"+1",iOSBadgeCount:!0};return JSON.stringify([JSON.stringify(e.message),e.recvID,e.groupID,JSON.stringify(r),null!=(n=e.isOnlineOnly)&&n])}),sendMessageNotOss:e.createRequestFunction(o.SendMessageNotOss,function(e){var t,n,r=null!=(t=e.offlinePushInfo)?t:{title:"You has a new message.",desc:"message",ex:"",iOSPushSound:"+1",iOSBadgeCount:!0};return JSON.stringify([JSON.stringify(e.message),e.recvID,e.groupID,JSON.stringify(r),null!=(n=e.isOnlineOnly)&&n])}),typingStatusUpdate:e.createRequestFunction(o.TypingStatusUpdate,function(e){return JSON.stringify([e.recvID,e.msgTip])}),revokeMessage:e.createRequestFunction(o.RevokeMessage,function(e){return JSON.stringify([e.conversationID,e.clientMsgID])}),deleteMessage:e.createRequestFunction(o.DeleteMessage,function(e){return JSON.stringify([e.conversationID,e.clientMsgID])}),deleteMessageFromLocalStorage:e.createRequestFunction(o.DeleteMessageFromLocalStorage,function(e){return JSON.stringify([e.conversationID,e.clientMsgID])}),deleteAllMsgFromLocal:e.createRequestFunctionWithoutParams(o.DeleteAllMsgFromLocal),deleteAllMsgFromLocalAndSvr:e.createRequestFunctionWithoutParams(o.DeleteAllMsgFromLocalAndSvr),searchLocalMessages:e.createRequestFunction(o.SearchLocalMessages),getAdvancedHistoryMessageList:e.createRequestFunction(o.GetAdvancedHistoryMessageList),getAdvancedHistoryMessageListReverse:e.createRequestFunction(o.GetAdvancedHistoryMessageListReverse),findMessageList:e.createRequestFunction(o.FindMessageList),insertGroupMessageToLocalStorage:e.createRequestFunction(o.InsertGroupMessageToLocalStorage,function(e){return JSON.stringify([JSON.stringify(e.message),e.groupID,e.sendID])}),insertSingleMessageToLocalStorage:e.createRequestFunction(o.InsertSingleMessageToLocalStorage,function(e){return JSON.stringify([JSON.stringify(e.message),e.recvID,e.sendID])}),setMessageLocalEx:e.createRequestFunction(o.SetMessageLocalEx,function(e){return JSON.stringify([e.conversationID,e.clientMsgID,e.localEx])})}}(n(t))),Object.assign(n(t),function(e){return{getAllConversationList:e.createRequestFunctionWithoutParams(o.GetAllConversationList),getConversationListSplit:e.createRequestFunction(o.GetConversationListSplit,function(e){return JSON.stringify([e.offset,e.count])}),getOneConversation:e.createRequestFunction(o.GetOneConversation,function(e){return JSON.stringify([e.sessionType,e.sourceID])}),getMultipleConversation:e.createRequestFunction(o.GetMultipleConversation),getConversationIDBySessionType:e.createRequestFunction(o.GetConversationIDBySessionType,function(e){return JSON.stringify([e.sourceID,e.sessionType])}),getTotalUnreadMsgCount:e.createRequestFunctionWithoutParams(o.GetTotalUnreadMsgCount),markConversationMessageAsRead:e.createRequestFunction(o.MarkConversationMessageAsRead),setConversationDraft:e.createRequestFunction(o.SetConversationDraft,function(e){return JSON.stringify([e.conversationID,e.draftText])}),pinConversation:e.createRequestFunction(o.PinConversation,function(e){return JSON.stringify([e.conversationID,e.isPinned])}),setConversationRecvMessageOpt:e.createRequestFunction(o.SetConversationRecvMessageOpt,function(e){return JSON.stringify([e.conversationID,e.opt])}),setConversationPrivateChat:e.createRequestFunction(o.SetConversationPrivateChat,function(e){return JSON.stringify([e.conversationID,e.isPrivate])}),setConversationBurnDuration:e.createRequestFunction(o.SetConversationBurnDuration,function(e){return JSON.stringify([e.conversationID,e.burnDuration])}),resetConversationGroupAtType:e.createRequestFunction(o.ResetConversationGroupAtType),hideConversation:e.createRequestFunction(o.HideConversation),hideAllConversation:e.createRequestFunctionWithoutParams(o.HideAllConversation),clearConversationAndDeleteAllMsg:e.createRequestFunction(o.ClearConversationAndDeleteAllMsg),deleteConversationAndDeleteAllMsg:e.createRequestFunction(o.DeleteConversationAndDeleteAllMsg)}}(n(t))),t}return c=i,(u=d).prototype=Object.create(c.prototype),u.prototype.constructor=u,t(u,c),d}(u);!function(e){e[e.Nomal=0]="Nomal",e[e.NotReceive=1]="NotReceive",e[e.NotNotify=2]="NotNotify"}(A||(A={})),function(e){e[e.Allowed=0]="Allowed",e[e.NotAllowed=1]="NotAllowed"}(y||(y={})),function(e){e[e.Group=2]="Group",e[e.WorkingGroup=2]="WorkingGroup"}(C||(C={})),function(e){e[e.Invitation=2]="Invitation",e[e.Search=3]="Search",e[e.QrCode=4]="QrCode"}(F||(F={})),function(e){e[e.Nomal=20]="Nomal",e[e.Admin=60]="Admin",e[e.Owner=100]="Owner"}(O||(O={})),function(e){e[e.ApplyNeedInviteNot=0]="ApplyNeedInviteNot",e[e.AllNeed=1]="AllNeed",e[e.AllNot=2]="AllNot"}(G||(G={})),function(e){e[e.Sending=1]="Sending",e[e.Succeed=2]="Succeed",e[e.Failed=3]="Failed"}(R||(R={})),function(e){e[e.iOS=1]="iOS",e[e.Android=2]="Android",e[e.Windows=3]="Windows",e[e.MacOSX=4]="MacOSX",e[e.Web=5]="Web",e[e.Linux=7]="Linux",e[e.AndroidPad=8]="AndroidPad",e[e.iPad=9]="iPad"}(I||(I={})),function(e){e[e.Debug=5]="Debug",e[e.Info=4]="Info",e[e.Warn=3]="Warn",e[e.Error=2]="Error",e[e.Fatal=1]="Fatal",e[e.Panic=0]="Panic"}(L||(L={})),function(e){e[e.Unprocessed=0]="Unprocessed",e[e.Agree=1]="Agree",e[e.Reject=-1]="Reject"}(b||(b={})),function(e){e[e.TextMessage=101]="TextMessage",e[e.PictureMessage=102]="PictureMessage",e[e.VoiceMessage=103]="VoiceMessage",e[e.VideoMessage=104]="VideoMessage",e[e.FileMessage=105]="FileMessage",e[e.AtTextMessage=106]="AtTextMessage",e[e.MergeMessage=107]="MergeMessage",e[e.CardMessage=108]="CardMessage",e[e.LocationMessage=109]="LocationMessage",e[e.CustomMessage=110]="CustomMessage",e[e.TypingMessage=113]="TypingMessage",e[e.QuoteMessage=114]="QuoteMessage",e[e.FaceMessage=115]="FaceMessage",e[e.FriendAdded=1201]="FriendAdded",e[e.OANotification=1400]="OANotification",e[e.GroupCreated=1501]="GroupCreated",e[e.MemberQuit=1504]="MemberQuit",e[e.GroupOwnerTransferred=1507]="GroupOwnerTransferred",e[e.MemberKicked=1508]="MemberKicked",e[e.MemberInvited=1509]="MemberInvited",e[e.MemberEnter=1510]="MemberEnter",e[e.GroupDismissed=1511]="GroupDismissed",e[e.GroupMemberMuted=1512]="GroupMemberMuted",e[e.GroupMemberCancelMuted=1513]="GroupMemberCancelMuted",e[e.GroupMuted=1514]="GroupMuted",e[e.GroupCancelMuted=1515]="GroupCancelMuted",e[e.GroupAnnouncementUpdated=1519]="GroupAnnouncementUpdated",e[e.GroupNameUpdated=1520]="GroupNameUpdated",e[e.BurnMessageChange=1701]="BurnMessageChange",e[e.RevokeMessage=2101]="RevokeMessage"}(D||(D={})),function(e){e[e.Single=1]="Single",e[e.Group=3]="Group",e[e.WorkingGroup=3]="WorkingGroup",e[e.Notification=4]="Notification"}(w||(w={})),function(e){e[e.Nomal=0]="Nomal",e[e.Baned=1]="Baned",e[e.Dismissed=2]="Dismissed",e[e.Muted=3]="Muted"}(N||(N={})),function(e){e[e.AtNormal=0]="AtNormal",e[e.AtMe=1]="AtMe",e[e.AtAll=2]="AtAll",e[e.AtAllAtMe=3]="AtAllAtMe",e[e.AtGroupNotice=4]="AtGroupNotice"}(U||(U={})),function(e){e[e.All=0]="All",e[e.Owner=1]="Owner",e[e.Admin=2]="Admin",e[e.Nomal=3]="Nomal",e[e.AdminAndNomal=4]="AdminAndNomal",e[e.AdminAndOwner=5]="AdminAndOwner"}(k||(k={})),function(e){e[e.isBlack=0]="isBlack",e[e.isFriend=1]="isFriend"}(q||(q={})),function(e){e[e.Logout=1]="Logout",e[e.Logging=2]="Logging",e[e.Logged=3]="Logged"}(B||(B={})),function(e){e[e.Online=1]="Online",e[e.Offline=0]="Offline"}(P||(P={})),function(e){e[e.Readed=0]="Readed",e[e.UnRead=1]="UnRead"}(T||(T={}));export{y as AllowType,b as ApplicationHandleResult,s as CbEvents,r as ErrorCode,U as GroupAtType,F as GroupJoinSource,k as GroupMemberFilter,O as GroupMemberRole,T as GroupMessageReaderFilter,N as GroupStatus,C as GroupType,G as GroupVerificationType,L as LogLevel,B as LoginStatus,A as MessageReceiveOptType,R as MessageStatus,D as MessageType,P as OnlineState,J as OpenIMSDK,I as Platform,q as Relationship,o as RequestApi,w as SessionType};