@rongcloud/imlib-v2-adapter 5.7.2 → 5.7.3-beem.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +109 -124
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@rongcloud/engine");!function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(e||(e={}));var s,o=e;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(s||(s={}));var n=s,a=function(){return a=Object.assign||function(e){for(var t,s=1,o=arguments.length;s<o;s++)for(var n in t=arguments[s])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)};function r(e,t,s,o){return new(s||(s=Promise))((function(n,a){function r(e){try{i(o.next(e))}catch(e){a(e)}}function c(e){try{i(o.throw(e))}catch(e){a(e)}}function i(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,c)}i((o=o.apply(e,t||[])).next())}))}function c(e,t){var s,o,n,a,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(i){return function(c){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(s=1,o&&(n=2&c[0]?o.return:c[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,c[1])).done)return n;switch(o=0,n&&(c=[2&c[0],n.value]),c[0]){case 0:case 1:n=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(!(n=r.trys,(n=n.length>0&&n[n.length-1])||6!==c[0]&&2!==c[0])){r=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3])){r.label=c[1];break}if(6===c[0]&&r.label<n[1]){r.label=n[1],n=c;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(c);break}n[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e],o=0}finally{s=n=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,i])}}}var i=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],s=0,o=t.length;s<o;s++)if(!e[t[s]])return!1;return!0}(uni))},g=i(),d=function(){var e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return"undefined"!=typeof XMLHttpRequest&&e?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")};var u={tag:"browser",httpReq:function(e){var s=e.method||t.HttpMethod.GET,o=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){var t=d(),a="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(s,c),n&&t.setRequestHeader)for(var i in n)t.setRequestHeader(i,n[i]);if(a){t.timeout=o,t.onload=function(){e({data:t.responseText,status:t.status||200})},t.onerror=function(){e({status:t.status||0})},t.ontimeout=function(){e({status:t.status||0})};var g="object"==typeof r?JSON.stringify(r):r;t.send(g)}else t.onreadystatechange=function(){4===t.readyState&&e({data:t.responseText,status:t.status})},t.onerror=function(){e({status:t.status||0})},setTimeout((function(){t.abort(),e({status:t.status||0})}),o),t.send(r)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:g,createWebSocket:function(e,t){var s=new WebSocket(e,t);return s.binaryType="arraybuffer",{onClose:function(e){s.onclose=function(t){var s=t.code,o=t.reason;e(s,o)}},onError:function(e){s.onerror=e},onMessage:function(e){s.onmessage=function(t){e(t.data)}},onOpen:function(e){s.onopen=e},send:function(e){s.send(e)},close:function(e,t){s.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,s=e.type,o=e.effectiveType,n=s||o||t.NetworkType.UNKONWN;return new Promise((function(e){e(n)}))}},l=i(),C=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},h={setItem:C("setStorageSync"),getItem:C("getStorageSync"),removeItem:C("removeStorageSync"),clear:C("clearStorageSync")},f={tag:"wechat",httpReq:function(e){var s=e.method||t.HttpMethod.GET,o=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){wx.request({url:c,method:s,header:n,timeout:o,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:h,sessionStorage:h,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:l,createWebSocket:function(e,t){var s=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){s.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){s.onError((function(t){e(t.errMsg)}))},onMessage:function(e){s.onMessage((function(t){e(t.data)}))},onOpen:function(e){s.onOpen(e)},send:function(e){s.send({data:e})},close:function(e,t){s.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},p=i(),R=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},I={setItem:R("setStorageSync"),getItem:R("getStorageSync"),removeItem:R("removeStorageSync"),clear:R("clearStorageSync")},T={tag:"alipay",httpReq:function(e){var s=e.method||t.HttpMethod.GET,o=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a),i=e.dataType||"json";return new Promise((function(e){my.request({url:c,method:s,headers:n,timeout:o,data:r,dataType:i,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:I,sessionStorage:I,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:p,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},S=i(),m=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{return tt[e].apply(tt,t)}catch(e){}}},v={setItem:m("setStorageSync"),getItem:m("getStorageSync"),removeItem:m("removeStorageSync"),clear:m("clearStorageSync")},y={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:S,localStorage:v,sessionStorage:v,httpReq:function(e){return new Promise((function(s){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};s(o)},fail:function(e){s({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var s=tt.connectSocket({url:e,protocols:t});return{onOpen:function(e){s.onOpen(e)},onClose:function(e){s.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){s.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){s.onMessage((function(t){return e(t.data)}))},send:function(e){s.send({data:e})},close:function(e,t){s.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},M=i(),E=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{return swan[e].apply(swan,t)}catch(e){}}},A={setItem:E("setStorageSync"),getItem:E("getStorageSync"),removeItem:E("removeStorageSync"),clear:E("clearStorageSync")},L={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:M,localStorage:A,sessionStorage:A,httpReq:function(e){return new Promise((function(s,o){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};s(o)},fail:function(e){s({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var s=swan.connectSocket({url:e,protocols:t});return{onOpen:function(e){s.onOpen(e)},onClose:function(e){s.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){s.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){s.onMessage((function(t){return e(t.data)}))},send:function(e){s.send({data:e})},close:function(e,t){s.close({code:e,reason:t})}}},getNetworkType:function(){return r(this,void 0,void 0,(function(){return c(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))]}))}))}},O=i(),N=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},U={setItem:N("setStorageSync"),getItem:N("getStorageSync"),removeItem:N("removeStorageSync"),clear:N("clearStorageSync")},_={tag:"jingdong",httpReq:function(e){var s=e.method||t.HttpMethod.GET,o=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){jd.request({url:c,method:s,headers:n,timeout:o,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:U,sessionStorage:U,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:O,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},x=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},B={setItem:x("setStorageSync"),getItem:x("getStorageSync"),removeItem:x("removeStorageSync"),clear:x("clearStorageSync")},P={tag:"uniapp",httpReq:function(e){var s=e.method||t.HttpMethod.GET,o=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){uni.request({url:c,method:s,header:n,timeout:o,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:B,sessionStorage:B,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var s={complete:function(){},url:e,protocols:t},o=uni.connectSocket(s);return{onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},w=function(e){return e&&e.request&&e.getSystemInfo},k="undefined"!=typeof uni&&w(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return P;case"mp-jd":return _;case"mp-baidu":return L;case"mp-toutiao":return y;case"mp-alipay":return T;case"mp-weixin":return f;default:return u}}():"undefined"!=typeof jd&&w(jd)?_:"undefined"!=typeof my&&w(my)?T:"undefined"!=typeof tt&&w(tt)?y:"undefined"!=typeof swan&&w(swan)?L:"undefined"!=typeof wx&&w(wx)?f:u;function b(e,t,s){return"".concat(e,"_").concat(t,"_").concat(s)}var D=function(){function e(){}return e.set=function(s){if(t.SEND_MESSAGE_TYPE_OPTION[s.messageType]&&t.SEND_MESSAGE_TYPE_OPTION[s.messageType].isPersited){var o=e.get(s.conversationType,s.targetId,s.channelId||"");if(!o||o.sentTime<s.sentTime){var n=b(s.conversationType,s.targetId,s.channelId||"");e.map[n]=s}}},e.get=function(t,s,o){var n=b(t,s,o);return e.map[n]||null},e.remove=function(t,s,o){var n=b(t,s,o);delete e.map[n]},e.clear=function(){e.map={}},e.map={},e}(),G={"RC:TxtMsg":"TextMessage","RC:ImgMsg":"ImageMessage","RC:VcMsg":"VoiceMessage","RC:ImgTextMsg":"RichContentMessage","RC:ReferenceMsg":"ReferenceMessage","RC:FileMsg":"FileMessage","RC:HQVCMsg":"HQVoiceMessage","RC:GIFMsg":"GIFMessage","RC:SightMsg":"SightMessage","RC:LBSMsg":"LocationMessage","RC:InfoNtf":"InformationNotificationMessage","RC:ContactNtf":"ContactNotificationMessage","RC:ProfileNtf":"ProfileNotificationMessage","RC:CmdNtf":"CommandNotificationMessage","RC:DizNtf":"DiscussionNotificationMessage","RC:CmdMsg":"CommandMessage","RC:TypSts":"TypingStatusMessage","RC:CsChaR":"ChangeModeResponseMessage","RC:CsHsR":"HandShakeResponseMessage","RC:CsEnd":"TerminateMessage","RC:CsSp":"SuspendMessage","RC:CsUpdate":"CustomerStatusUpdateMessage","RC:ReadNtf":"ReadReceiptMessage","RC:VCAccept":"AcceptMessage","RC:VCRinging":"RingingMessage","RC:VCSummary":"SummaryMessage","RC:VCHangup":"HungupMessage","RC:VCInvite":"InviteMessage","RC:VCModifyMedia":"MediaModifyMessage","RC:VCModifyMem":"MemberModifyMessage","RC:CsContact":"CustomerContact","RC:PSImgTxtMsg":"PublicServiceRichContentMessage","RC:PSMultiImgTxtMsg":"PublicServiceMultiRichContentMessage","RC:GrpNtf":"GroupNotificationMessage","RC:PSCmd":"PublicServiceCommandMessage","RC:RcCmd":"RecallCommandMessage","RC:SRSMsg":"SyncReadStatusMessage","RC:RRReqMsg":"ReadReceiptRequestMessage","RC:RRRspMsg":"ReadReceiptResponseMessage","RCJrmf:RpMsg":"JrmfRedPacketMessage","RCJrmf:RpOpendMsg":"JrmfRedPacketOpenedMessage","RC:CombineMsg":"RCCombineMessage","RC:chrmKVNotiMsg":"ChrmKVNotificationMessage","RC:LogCmdMsg":"LogCommandMessage","RC:MsgExMsg":"ExpansionCommandMessage","RC:RRMsg":"GroupReadReceiptResponseMessage"},F={};function K(e){var s=e.channelId,o=e.conversationType,n=e.targetId,a=e.unreadMessageCount,r=e.latestMessage,c=e.isTop,i=e.notificationStatus,g=e.matchCount;if(!t.usingCppEngine()){var d=D.get(o,n,s||"");r?d&&r.sentTime<d.sentTime&&(r=d):r=d}var u=r?H(r):null;return{channelId:s||"",conversationType:o,targetId:n,unreadMessageCount:a,latestMessage:u,latestMessageId:null==u?void 0:u.messageId,objectName:null==u?void 0:u.messageType,sentTime:null==u?void 0:u.sentTime,isTop:c,notificationStatus:i,receivedStatus:null==u?void 0:u.receivedStatus,matchCount:g}}function H(e){var s=e.conversationType,n=e.targetId,a=e.senderUserId,r=e.content,c=e.messageType,i=e.messageUId,g=e.messageDirection,d=e.isOffLineMessage,u=e.sentTime,l=e.receivedStatus,C=e.receivedTime,h=e.canIncludeExpansion,f=e.disableNotification,p=e.expansion,R=e.messageId,I=e.sentStatus,T=e.channelId,S=e.readReceiptInfo,m=e.pushConfig,v="";return c in G?v=G[c]:c in F?v=F[c]:(r={message:{content:r,objectName:c},messageName:"UnknownMessage"},v="UnknownMessage"),l||(l=t.ReceivedStatus.UNREAD),void 0===R&&(R=~~(16777215*Math.random())),{channelId:T||"",conversationType:s,targetId:n,senderUserId:a,content:r,messageType:v,messageUId:i,messageDirection:g,offLineMessage:d,sentTime:u,receivedStatus:l,receivedTime:C,objectName:c,messageId:R,sentStatus:I||o.SENT,disableNotification:f,canIncludeExpansion:h,expansion:p,readReceiptInfo:S,pushConfig:m}}function j(e,s,o,n,a){var r=new Date(o-1e3*n*60*60*24).getTime()-e.sentTime<0,c=e.messageType,i=e.messageDirection;if("ReadReceiptRequestMessage"===c&&r&&i===t.MessageDirection.SEND){var g="".concat(s).concat(e.content.messageUId,"SENT");a.set(g,{count:0,dealtime:e.sentTime,userIds:{}})}else if("ReadReceiptRequestMessage"===c&&r){var d="".concat(s).concat(e.conversationType).concat(e.targetId,"RECEIVED"),u=a.get(d);if(u)if(e.senderUserId in u)u[e.senderUserId].uIds&&-1===u[e.senderUserId].uIds.indexOf(e.content.messageUId)&&(u[e.senderUserId].uIds.push(e.content.messageUId),u[e.senderUserId].dealtime=e.sentTime,u[e.senderUserId].isResponse=!1,a.set(d,u));else{var l={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1};u[e.senderUserId]=l,a.set(d,u)}else{var C={};C[e.senderUserId]={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1},a.set(d,C)}}}function W(e,t,s){try{e(t,s)}catch(e){null===console||void 0===console||console.error(e)}}function V(e,t,s){try{e(t,s)}catch(e){null===console||void 0===console||console.error(e)}}var J=function(e,t,s,o,n){void 0===o&&(o=!0),void 0===n&&(n=!0),this.messageType=e,this.objectName=t,this.content=s,this.isPersited=o,this.isCounted=n};function q(e,t,s,o){void 0===s&&(s=!0),void 0===o&&(o=!0);var n=function(n){return new J(e,t,n,s,o)};return n.MessageType=e,n.ObjectName=t,n}var Y,Q,X=q("ReadReceiptResponseMessage","RC:RRRspMsg"),z=function(){function e(e,t,s,o,n,a){this.logger=e,this._context=t,this.channelId=s,this._isCPPMode=o,this._readReceiptTimeout=n,this._storage=a,this._draftMap={}}return e.prototype.getConversationList=function(e,s,o){var n=this;t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("conversationTypes",s,t.AssertRules.ARRAY),t.assert("count",o,t.AssertRules.NUMBER),this._context.getConversationList(o,void 0,0,0,this.channelId).then((function(o){var a=o.code,r=o.data,c=[];r=r||[],a===t.ErrorCode.SUCCESS?(s?r.forEach((function(e){s.indexOf(e.conversationType)>-1&&c.push(K(e))})):r.forEach((function(e){c.push(K(e))})),W(e.onSuccess,c)):(n.logger.warn(t.LogTagId.O,"getConversationList -> code:".concat(a)),V(e.onError,a))}))},e.prototype.getConversation=function(e,s,o){var n=this;t.assert("callback",o,t.AssertRules.CALLBACK),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getConversation ->targetId:".concat(s,",conversationType:").concat(e)),r(n,void 0,void 0,(function(){var n,a,r;return c(this,(function(c){switch(c.label){case 0:return[4,this._context.getConversation(e,s,this.channelId)];case 1:return n=c.sent(),a=n.code,r=n.data,a!==t.ErrorCode.SUCCESS?(this.logger.warn(t.LogTagId.O,"getConversation ->code:".concat(a,",targetId:").concat(s)),o.onError(a),[2]):(o.onSuccess(r?K(r):null),[2])}}))}))},e.prototype.removeConversation=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeConversation ->targetId:".concat(s,",conversationType:").concat(e)),this._context.removeConversation(e,s,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(n._isCPPMode||D.remove(e,s,n.channelId),W(o.onSuccess)):(n.logger.warn(t.LogTagId.O,"removeConversation ->code:".concat(a,",targetId:").concat(s)),V(o.onError,a))}))},e.prototype.saveTextMessageDraft=function(e,s,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("draftText",o,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"saveTextMessageDraft ->targetId:".concat(s,",conversationType:").concat(e));var n=this._context.getCurrentUserId();return!!n&&((this._draftMap[n]=this._draftMap[n]||{})["".concat(e,"_").concat(s,"_").concat(this.channelId)]=o,!0)},e.prototype.getTextMessageDraft=function(e,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getTextMessageDraft ->targetId:".concat(s,",conversationType:").concat(e));var o=this._context.getCurrentUserId();if(o)return(this._draftMap[o]||{})["".concat(e,"_").concat(s,"_").concat(this.channelId)]},e.prototype.clearTextMessageDraft=function(e,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"clearTextMessageDraft ->targetId:".concat(s,",conversationType:").concat(e));var o=this._context.getCurrentUserId();return!!o&&delete(this._draftMap[o]||{})["".concat(e,"_").concat(s,"_").concat(this.channelId)]},e.prototype.getTotalUnreadCount=function(e,s,o){var n=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getTotalUnreadCount ->conversationTypes:".concat(s)),this._context.getTotalUnreadCount(this.channelId,s,o).then((function(s){var o=s.code,a=s.data;o===t.ErrorCode.SUCCESS?W(e.onSuccess,a):(n.logger.warn(t.LogTagId.O,"getTotalUnreadCount ->code:".concat(o)),V(e.onError,o))}))},e.prototype.getUnreadCount=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getUnreadCount ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getUnreadCount(e,s,this.channelId).then((function(e){var a=e.code,r=e.data;a===t.ErrorCode.SUCCESS?W(o.onSuccess,r):(n.logger.warn(t.LogTagId.O,"getUnreadCount ->code:".concat(a,",targetId:").concat(s)),V(o.onError,a))}))},e.prototype.clearConversations=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"clearConversations -> conversationTypes:".concat(s)),this._isCPPMode?this._context.clearConversations(s,this.channelId).then((function(s){s===t.ErrorCode.SUCCESS?W(e.onSuccess,!0):(o.logger.warn(t.LogTagId.O,"clearConversations ->code:".concat(s)),V(e.onError,s))})):this.logger.error(t.LogTagId.O,"Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"clearUnreadCount ->targetId:".concat(s,",conversationType:").concat(e)),this._context.clearUnreadCount(e,s,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?W(o.onSuccess,!0):(n.logger.warn(t.LogTagId.O,"clearUnreadCount ->code:".concat(e,",targetId:").concat(s)),V(o.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){var s=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(o){o===t.ErrorCode.SUCCESS?W(e.onSuccess,!0):(s.logger.warn(t.LogTagId.O,"clearUnreadCount ->code:".concat(o)),V(e.onError,o))}))},e.prototype.getFirstUnreadMessage=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getFirstUnreadMessage ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,s,this.channelId).then((function(e){e.code===t.ErrorCode.SUCCESS?W(o.onSuccess,e.data?H(e.data):null):(n.logger.warn(t.LogTagId.O,"getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(s)),V(o.onError,e.code))}))},e.prototype.setConversationStatus=function(e,s,o,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("status",o,t.AssertRules.OBJECT,!0),this.logger.info(t.LogTagId.O,"setConversationStatus ->targetId:".concat(s,",status:").concat(o));var r=o.isTop,c=o.notificationStatus;this._context.setConversationStatus(e,s,r,c,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?W(n.onSuccess):(a.logger.warn(t.LogTagId.O,"setConversationStatus ->code:".concat(e,",targetId:").concat(s)),V(n.onError,e))}))},e.prototype.sendMessage=function(e,s,n,r,c,i,g,d){var u=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("msg",n,t.AssertRules.OBJECT,!0),t.assert("callback",r,t.AssertRules.CALLBACK),t.assert("isMentioned",c,t.AssertRules.BOOLEAN),t.assert("pushContent",i,t.AssertRules.ONLY_STRING),t.assert("pushData",g,t.AssertRules.ONLY_STRING),t.assert("options.userIds",null==d?void 0:d.userIds,t.AssertRules.ARRAY),t.assert("options.isVoipPush",null==d?void 0:d.isVoipPush,t.AssertRules.BOOLEAN),t.assert("options.disableNotification",null==d?void 0:d.disableNotification,t.AssertRules.BOOLEAN),t.assert("options.canIncludeExpansion",null==d?void 0:d.canIncludeExpansion,t.AssertRules.BOOLEAN),t.assert("options.expansion",null==d?void 0:d.expansion,t.AssertRules.OBJECT),t.assert("options.pushConfig",null==d?void 0:d.pushConfig,t.AssertRules.OBJECT),t.assert("options.resendMessageId",null==d?void 0:d.resendMessageId,t.AssertRules.NUMBER),this.logger.info(t.LogTagId.O,"sendMessage ->targetId:".concat(s,",conversationType:").concat(e));var l=!(!(null==d?void 0:d.isStatusMessage)&&!(null==d?void 0:d.isStatus)),C=function(e,t,s){var o,n=e||{},a=n.userIds,r=n.isVoipPush,c=n.disableNotification,i=n.isFilerWhiteBlacklist,g=n.expansion,d=n.canIncludeExpansion,u=n.pushConfig,l=n.resendMessageId,C=[];if(t){var h=(s||{}).content.mentionedInfo;C=h.userIdList,o=h.type}return{mentionedType:o,mentionedUserIdList:C,directionalUserIdList:a,isVoipPush:r,disableNotification:c,isFilerWhiteBlacklist:i,expansion:g,canIncludeExpansion:d,pushConfig:u,messageId:l}}(d,c,n),h=Object.assign(n,a(a({isMentioned:c,pushContent:i,pushData:g},C),{messageType:n.objectName,channelId:this.channelId,isStatusMessage:l})),f=this._context.getCurrentUserId(),p=this.logger.createTraceId();this.logger.info(t.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:h.messageType,conversationType:e,targetId:s,channelId:this.channelId}),p),this._context.sendMessage(e,s,h,r.onBefore,p).then((function(a){var c=a.code,i=a.data,g=c===t.ErrorCode.SUCCESS?"info":"warn";if(u.logger[g](t.LogTagId.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:i?i.messageUId:"",messageId:i?i.messageId:""}),p),c===t.ErrorCode.SUCCESS){u._isCPPMode||D.set(i);var C=H(i);j(C,f,u._context.getConnectedTime(),u._readReceiptTimeout,u._storage),W(r.onSuccess,C)}else u.logger.warn(t.LogTagId.O,"sendMessage ->code:".concat(c,",targetId:").concat(s)),V(r.onError,c,H({isMentioned:!!h.isMentioned,content:n.content,messageType:n.messageType,isPersited:n.isPersited,isCounted:n.isCounted,disableNotification:!!(null==d?void 0:d.disableNotification),canIncludeExpansion:!!(null==d?void 0:d.canIncludeExpansion),expansion:(null==d?void 0:d.expansion)||null,conversationType:e,targetId:s,senderUserId:f,messageUId:"",messageDirection:t.MessageDirection.SEND,isOffLineMessage:!1,sentTime:(null==i?void 0:i.sentTime)||0,receivedTime:0,isStatusMessage:l,receivedStatus:t.ReceivedStatus.UNREAD,messageId:null==i?void 0:i.messageId,sentStatus:o.FAILED}))}))},e.prototype.sendRecallMessage=function(e,s,o){var n=this;t.assert("message.conversationType",e.conversationType,t.AssertRules.NUMBER,!0),t.assert("message.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("message.messageUId",e.messageUId,t.AssertRules.STRING,!0),t.assert("message.sentTime",e.sentTime,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("options.disableNotification",null==o?void 0:o.disableNotification,t.AssertRules.BOOLEAN),t.assert("options.pushConfig",null==o?void 0:o.pushConfig,t.AssertRules.OBJECT),t.assert("options.extra",null==o?void 0:o.extra,t.AssertRules.STRING);var r=e.conversationType,c=e.targetId,i=e.messageUId,g=e.sentTime;this.logger.info(t.LogTagId.O,"sendRecallMessage ->targetId:".concat(c,",conversationType:").concat(r,",messageUId:").concat(i));var d=a({channelId:this.channelId},o);this._context.recallMessage(r,c,i,g,d).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?(n._isCPPMode||D.set(a),W(s.onSuccess,H(a))):(n.logger.warn(t.LogTagId.O,"sendRecallMessage ->code:".concat(o,",targetId:").concat(c,",messageUId:").concat(i)),V(s.onError,o))}))},e.prototype.sendTypingStatusMessage=function(e,s,o,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("typingContentType",o,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"sendTypingStatusMessage ->targetId:".concat(s,",conversationType:").concat(e));var r={messageType:"RC:TypSts",content:{typingContentType:o},isStatusMessage:!0,channelId:this.channelId},c=this.logger.createTraceId();this.logger.info(t.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:r.messageType,conversationType:e,targetId:s,channelId:r.channelId}),c),this._context.sendMessage(e,s,r,void 0,c).then((function(e){var o=e.code,r=e.data,i=o===t.ErrorCode.SUCCESS?"info":"warn";a.logger[i](t.LogTagId.A_SEND_MSG_R,JSON.stringify({code:o,messageUId:r?r.messageUId:"",messageId:r?r.messageId:""}),c),o===t.ErrorCode.SUCCESS?W(n.onSuccess,H(r)):(a.logger.warn(t.LogTagId.O,"sendTypingStatusMessage ->code:".concat(o,",targetId:").concat(s)),V(n.onError,o))}))},e.prototype.sendReceiptResponse=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"sendReceiptResponse ->targetId:".concat(s,",conversationType:").concat(e));var a=this._context.getCurrentUserId(),r="".concat(a).concat(e).concat(s,"RECEIVED"),c=this._storage.get(r);if(c){var i=[];for(var g in c){var d={};d[g]=c[g].uIds,c[g].isResponse||i.push(d)}if(0===i.length)return void o.onSuccess(null);var u=setInterval((function(){1===i.length&&clearInterval(u);var a=i.splice(0,1)[0],g=new X({receiptMessageDic:a});n.sendMessage(e,s,g,{onSuccess:function(e){var t=Object.keys(a)[0];c[t].isResponse=!0,n._storage.set(r,c),W(o.onSuccess,e)},onError:function(e){n.logger.warn(t.LogTagId.O,"sendReceiptResponse ->code:".concat(e,",targetId:").concat(s)),V(o.onError,e)}})}),200)}else o.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,s,o){var n=this;t.assert("messageUIds",e,t.AssertRules.ARRAY,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"sendReadReceiptMessage ->targetId:".concat(s,",messageUIds:").concat(e));for(var a=0,r=e;a<r.length;a++){var c=r[a];t.assert("messageUId",c,t.AssertRules.STRING)}this._context.sendReadReceiptMessage(s,e,this.channelId).then((function(a){var r=a.code;r===t.ErrorCode.SUCCESS?o.onSuccess():(n.logger.warn(t.LogTagId.O,"sendReadReceiptMessage ->code:".concat(r,",targetId:").concat(s,",messageUIds:").concat(e)),o.onError(r))})).catch((function(a){n.logger.warn(t.LogTagId.O,"sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(s,",messageUIds:").concat(e)),o.onError(a)}))},e.prototype.getMessageReader=function(e,s,o){var n=this;t.assert("messageUId",e,t.AssertRules.STRING,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getMessageReader ->targetId:".concat(s,",messageUId:").concat(e)),this._context.getMessageReader(s,e,this.channelId).then((function(a){var r=a.code,c=a.data;r===t.ErrorCode.SUCCESS?o.onSuccess(c):(n.logger.warn(t.LogTagId.O,"getMessageReader ->code:".concat(r,",targetId:").concat(s,",messageUId:").concat(e)),o.onError(r))})).catch((function(a){n.logger.warn(t.LogTagId.O,"getMessageReader ->code:".concat(a,",targetId:").concat(s,",messageUId:").concat(e)),o.onError(a)}))},e.prototype.updateMessageExpansion=function(e,s,o){var n=this;t.assert("expansion",e,t.AssertRules.OBJECT,!0),t.assert("message",s,t.AssertRules.OBJECT,!0);var a=s.conversationType,r=s.targetId,c=s.messageUId,i=s.canIncludeExpansion,g=s.expansion;this.logger.info(t.LogTagId.O,"updateMessageExpansion ->targetId:".concat(r,",messageUId:").concat(c,",conversationType:").concat(a)),this._context.sendExpansionMessage({conversationType:a,targetId:r,messageUId:c,canIncludeExpansion:i,originExpansion:g,expansion:e,channelId:this.channelId}).then((function(e){var s=e.code;s===t.ErrorCode.SUCCESS?W(o.onSuccess):(n.logger.warn(t.LogTagId.O,"updateMessageExpansion ->code:".concat(s,",targetId:").concat(r,",messageUId:").concat(c)),V(o.onError,s))}))},e.prototype.removeMessageExpansionForKey=function(e,s,o){var n=this;t.assert("keys",e,t.AssertRules.ARRAY,!0),t.assert("message",s,t.AssertRules.OBJECT,!0);var a=s.conversationType,r=s.targetId,c=s.messageUId,i=s.canIncludeExpansion;this.logger.info(t.LogTagId.O,"removeMessageExpansionForKey ->targetId:".concat(r,",messageUId:").concat(c,",conversationType:").concat(a)),this._context.sendExpansionMessage({conversationType:a,targetId:r,messageUId:c,canIncludeExpansion:i,keys:e,channelId:this.channelId}).then((function(e){var s=e.code;s===t.ErrorCode.SUCCESS?W(o.onSuccess):(n.logger.warn(t.LogTagId.O,"removeMessageExpansionForKey ->code:".concat(s,",targetId:").concat(r,",messageUId:").concat(c)),V(o.onError,s))}))},e.prototype.getHistoryMessages=function(e,s,o,n,a,r,c){var i=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("callback",a,t.AssertRules.CALLBACK,!0),t.assert("order",c,t.AssertRules.NUMBER),this.logger.info(t.LogTagId.O,"getHistoryMessages ->targetId:".concat(s,",conversationType:").concat(e,",timestamp:").concat(o));var g=this.logger.createTraceId();this.logger.info(t.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:s,conversationType:e,channelId:"",timestamp:o,count:n}),g),this._context.getHistoryMessage(e,s,o,n,c,this.channelId,r,g).then((function(e){var s=e.code,o=e.data;if(s===t.ErrorCode.SUCCESS)if(o){var n=o.list,r=o.hasMore,c=[],d=n.map((function(e){return c.push(e.messageUId),H(e)}));i.logger.info(t.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:c.join(",")}),g),W(a.onSuccess,d,r)}else i.logger.info(t.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),g),W(a.onSuccess,[],!1);else i.logger.warn(t.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),g),V(a.onError,s)}))},e.prototype.deleteRemoteMessages=function(e,s,o,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("messages",o,t.AssertRules.ARRAY,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"deleteRemoteMessages ->targetId:".concat(s,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,s,o,this.channelId).then((function(r){if(r===t.ErrorCode.SUCCESS){if(!a._isCPPMode){var c=D.get(e,s,a.channelId);c&&o.forEach((function(t){c.messageUId===t.messageUId&&D.remove(e,s,a.channelId)}))}W(n.onSuccess)}else a.logger.warn(t.LogTagId.O,"deleteRemoteMessages ->code:".concat(r,",targetId:").concat(s)),V(n.onError,r)}))},e.prototype.clearRemoteHistoryMessages=function(e,s){var o=this;t.assert("param.conversationType",e.conversationType,t.AssertRules.NUMBER,!0),t.assert("param.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("param.timestamp",e.timestamp,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK);var n=e.conversationType,a=e.targetId,r=e.timestamp;this.logger.info(t.LogTagId.O,"clearRemoteHistoryMessages ->targetId:".concat(a,",conversationType:").concat(n)),this._context.deleteRemoteMessageByTimestamp(n,a,r,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?W(s.onSuccess):(o.logger.warn(t.LogTagId.O,"clearRemoteHistoryMessages ->code:".concat(e)),V(s.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getConversationListWithAllChannel().then((function(s){var o=s.code,n=s.data;o===t.ErrorCode.SUCCESS?W(e.onSuccess,n.map(K)):V(e.onError,o)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,s,o){t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("index",s,t.AssertRules.NUMBER),t.assert("limit",o,t.AssertRules.NUMBER),this._context.getConversationListWithAllChannelByPage(s,o).then((function(s){var o=s.code,n=s.data;o===t.ErrorCode.SUCCESS?W(e.onSuccess,n.map(K)):V(e.onError,o)}))},e.prototype.insertMessage=function(e,s,o,n,a){var r=this;void 0===a&&(a={});var c=o.senderUserId,i=o.objectName,g=o.content,d=o.messageDirection;o.messageUId;var u=o.canIncludeExpansion,l=o.expansion,C=o.disableNotification,h=o.sentTime,f=o.sentStatus;this.logger.info(t.LogTagId.O,"insertMessage ->targetId:".concat(s,",conversationType:").concat(e));var p=a.isUnread,R={senderUserId:c,messageType:i,content:g,messageDirection:d,sentTime:h,sentStatus:f,searchContent:a.searchContent,isUnread:p,messageUId:"",disableNotification:C,canIncludeExpansion:u,expansionMsg:JSON.stringify(l),channelId:this.channelId};this._context.insertMessage(e,s,R).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?W(n.onSuccess,H(a)):(r.logger.warn(t.LogTagId.O,"insertMessage ->code:".concat(o,",targetId:").concat(s)),V(n.onError,o))}))},e.prototype.batchInsertMessage=function(e,s,o){this._context.batchInsertMessage(e,s).then((function(e){var s=e.code,n=e.data;s===t.ErrorCode.SUCCESS?W(o.onSuccess,n):V(o.onError,s)}))},e.prototype.getMessageCount=function(e,s,o){this._context.getMessageCount(e,s).then((function(e){var s=e.code,n=e.data;s===t.ErrorCode.SUCCESS?W(o.onSuccess,n):V(o.onError,s)}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,s,o,n,a){var r=this;this.logger.info(t.LogTagId.O,"deleteLocalMessagesByTimestamp ->targetId:".concat(s,",conversationType:").concat(e,",timestamp:").concat(o)),this._context.deleteMessagesByTimestamp(e,s,o,n,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?W(a.onSuccess,!0):(r.logger.warn(t.LogTagId.O,"deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(s)),V(a.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,s,o,n,a,r){var c=this;this.logger.info(t.LogTagId.O,"getRemoteHistoryMessages ->targetId:".concat(s,",conversationType:").concat(e));var i=r.order||0;this._context.getRemoteHistoryMessages(e,s,o,n,i,this.channelId).then((function(e){var o=e.code,n=e.data;if(o===t.ErrorCode.SUCCESS)if(n){var r=n.list,i=n.hasMore,g=r.map((function(e){return H(e)}));W(a.onSuccess,g,i)}else W(a.onSuccess,[],!1);else c.logger.warn(t.LogTagId.O,"getRemoteHistoryMessages ->code:".concat(o,",targetId:").concat(s)),V(a.onError,o)}))},e.prototype.clearMessages=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"clearMessages ->targetId:".concat(s,",conversationType:").concat(e)),this._context.clearMessages(e,s,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(n._isCPPMode||D.remove(e,s,n.channelId),W(o.onSuccess,!0)):(n.logger.warn(t.LogTagId.O,"clearMessages ->code:".concat(a,",targetId:").concat(s)),V(o.onError,a))}))},e.prototype.searchConversationByContent=function(e,s,o,n){var a=this;this.logger.info(t.LogTagId.O,"searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,n,this.channelId,o).then((function(o){var n=o.code,r=o.data,c=[];r=r||[],n===t.ErrorCode.SUCCESS?(r.forEach((function(e){c.push(K(e))})),W(s.onSuccess,c)):(a.logger.warn(t.LogTagId.O,"searchConversationByContent ->code:".concat(n,",keyword:").concat(e)),V(s.onError,n))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,s,o,n){var a=this;void 0===o&&(o=[]),this.logger.info(t.LogTagId.O,"searchConversationByContentWithAllChannel ->keyword:".concat(e)),this._context.searchConversationByContentWithAllChannel(e,o,n).then((function(o){var n=o.code,r=o.data,c=[];r=r||[],n===t.ErrorCode.SUCCESS?(r.forEach((function(e){c.push(K(e))})),W(s.onSuccess,c)):(a.logger.warn(t.LogTagId.O,"searchConversationByContentWithAllChannel ->code:".concat(n,",keyword:").concat(e)),V(s.onError,n))}))},e.prototype.searchMessageByContent=function(e,s,o,n,a,r,c){var i=this;this.logger.info(t.LogTagId.O,"searchMessageByContent ->targetId:".concat(s,",conversationType:").concat(e,",keyword:").concat(o)),this._context.searchMessageByContent(e,s,o,n,a,r,this.channelId).then((function(e){var o=e.code,n=e.data,a=[];if(o===t.ErrorCode.SUCCESS){var r=n=n||{},g=r.messages,d=r.count;g.forEach((function(e){a.push(H(e))})),W(c.onSuccess,a,d)}else i.logger.warn(t.LogTagId.O,"searchMessageByContent ->code:".concat(o,",targetId:").concat(s)),V(c.onError,o)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,s,o,n,a,r){var c=this;this.logger.info(t.LogTagId.O,"searchMessageByContentWithAllChannel ->targetId: ".concat(s," ,conversationType: ").concat(e," ,keyword: ").concat(o,", timestamp: ").concat(n,", count: ").concat(a)),this._context.searchMessageByContentWithAllChannel(e,s,o,n,a).then((function(e){var o=e.code,n=e.data,a=[];if(o===t.ErrorCode.SUCCESS){var i=n=n||{},g=i.messages,d=i.count;g.forEach((function(e){a.push(H(e))})),W(r.onSuccess,a,d)}else c.logger.warn(t.LogTagId.O,"searchMessageByContentWithAllChannel ->code:".concat(o,",targetId:").concat(s)),V(r.onError,o)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,s,o,n,a,r,c,i){var g=this;this.logger.info(t.LogTagId.O,"searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(s," ,conversationType: ").concat(e," ,keyword: ").concat(o,", startTime: ").concat(n,", endTime: ").concat(a,", offset: ").concat(r,", limit: ").concat(c)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,s,o,n,a,r,c).then((function(e){var o=e.code,n=e.data,a=[];o===t.ErrorCode.SUCCESS?((n=n||{}).messages.forEach((function(e){a.push(H(e))})),W(i.onSuccess,a)):(g.logger.warn(t.LogTagId.O,"searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(o,",targetId:").concat(s)),V(i.onError,o))}))},e.prototype.getUnreadMentionedMessages=function(e,s){return this.logger.info(t.LogTagId.O,"getUnreadMentionedMessages ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getUnreadMentionedMessages(e,s,this.channelId).map((function(e){return H(e)}))},e.prototype.clearUnreadCountByTimestamp=function(e,s,o,n){var a=this;this.logger.info(t.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(s,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,s,o,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?W(n.onSuccess,!0):(a.logger.warn(t.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(s)),V(n.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,s,this.channelId).then((function(e){var a=e.code,r=e.data;a===t.ErrorCode.SUCCESS?W(o.onSuccess,r):(n.logger.warn(t.LogTagId.O,"getConversationNotificationStatus ->code:".concat(a,",targetId:").concat(s)),V(o.onError,a))}))},e.prototype.getGroupMessageDeliverList=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"getGroupMessageDeliverList ->targetId:".concat(e,"',messageUId:").concat(s)),this._context.getGroupMessageDeliverList(e,s,this.channelId).then((function(e){var a=e.code,r=e.data;a===t.ErrorCode.SUCCESS?W(o.onSuccess,r):(n.logger.warn(t.LogTagId.O,"getGroupMessageDeliverList ->code:".concat(a,",messageUId:").concat(s)),V(o.onError,a))}))},e.prototype.getPrivateMessageDeliverTime=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"getPrivateMessageDeliverTime -> messageUId:".concat(e)),this._context.getPrivateMessageDeliverTime(e,this.channelId).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?W(s.onSuccess,r):(o.logger.warn(t.LogTagId.O,"getPrivateMessageDeliverTime ->code:".concat(a,",messageUId:").concat(e)),V(s.onError,a))}))},e}(),$=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},Z=function(){function e(e,s,o,n){this._context=e,this._options=s,this.logger=o,this._storage=n,this._channelClient={},this._isCPPMode=t.usingCppEngine(),this._defaultChannelClient=new z(this.logger,e,"",this._isCPPMode,s.readReceiptTimeout,this._storage)}return e.prototype.assertCPPMode=function(e,s,o){if(!this._isCPPMode)return null==o||o.onError(t.ErrorCode.NOT_SUPPORT),void this.logger.error(t.LogTagId.O,"'".concat(s,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){if(this.logger.info(t.LogTagId.O,"getChannel ->channelId:".concat(e)),!this._isCPPMode)return this.logger.error(t.LogTagId.O,"getChannel method is only available in protocol stack mode"),null;if(t.assert("channelId",e,t.AssertRules.STRING,!0),e.length>20)return this.logger.error(t.LogTagId.O,"The channelId cannot exceed 20 characters"),null;if(e in this._channelClient)return this._channelClient[e];if(Object.keys(this._channelClient).length>1e3)return this.logger.error(t.LogTagId.O,"Only 1000 channels can be obtained"),null;var s=new z(this.logger,this._context,e,this._isCPPMode,this._options.readReceiptTimeout,this._storage);return this._channelClient[e]=s,s},e.prototype.deleteChannels=function(e){var s=this;t.assert("channelIds",e,t.AssertRules.ARRAY,!0),this.logger.info(t.LogTagId.O,"deleteChannels ->channelIds:".concat(e)),this.assertCPPMode((function(){e.forEach((function(e){delete s._channelClient[e]}))}),"deleteChannels")},e.prototype.getNavi=function(){return this._context.getNaviInfoFromCache()||{}},e.prototype.getSDKInfo=function(){return{version:"5.7.2"}},e.prototype.getAppInfo=function(){return{appKey:this._context.appkey}},e.prototype.getCurrentUserId=function(){return this._context.getCurrentUserId()},e.prototype.disconnect=function(e){return r(this,void 0,void 0,(function(){return c(this,(function(s){switch(s.label){case 0:return this.logger.info(t.LogTagId.A_DISCONNECT_O),[4,this._context.disconnect(e)];case 1:return s.sent(),[2]}}))}))},e.prototype.logout=function(){return this.disconnect()},e.prototype.clearCache=function(){},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.getConversationList=function(e,t,s){this._defaultChannelClient.getConversationList(e,t,s)},e.prototype.getConversationListWithAllChannel=function(e){this._defaultChannelClient.getConversationListWithAllChannel(e)},e.prototype.getConversationListWithAllChannelByPage=function(e,t,s){void 0===s&&(s=30),this._defaultChannelClient.getConversationListWithAllChannelByPage(e,t,s)},e.prototype.getConversation=function(e,t,s){return this._defaultChannelClient.getConversation(e,t,s)},e.prototype.removeConversation=function(e,t,s){return this._defaultChannelClient.removeConversation(e,t,s)},e.prototype.saveTextMessageDraft=function(e,t,s){return this._defaultChannelClient.saveTextMessageDraft(e,t,s)},e.prototype.getTextMessageDraft=function(e,t){return this._defaultChannelClient.getTextMessageDraft(e,t)},e.prototype.clearTextMessageDraft=function(e,t){return this._defaultChannelClient.clearTextMessageDraft(e,t)},e.prototype.getTotalUnreadCount=function(e,t,s){return this._defaultChannelClient.getTotalUnreadCount(e,t,s)},e.prototype.getUnreadCount=function(e,t,s){return this._defaultChannelClient.getUnreadCount(e,t,s)},e.prototype.getConversationUnreadCount=function(e,s){this.logger.error(t.LogTagId.O,"Method is deprecated")},e.prototype.clearConversations=function(e,t){return this._defaultChannelClient.clearConversations(e,t)},e.prototype.clearUnreadCount=function(e,t,s){this._defaultChannelClient.clearUnreadCount(e,t,s)},e.prototype.clearAllUnreadCount=function(e){this._defaultChannelClient.clearAllUnreadCount(e)},e.prototype.setConversationStatus=function(e,t,s,o){return this._defaultChannelClient.setConversationStatus(e,t,s,o)},e.prototype.sendMessage=function(e,t,s,o,n,a,r,c,i){return this._defaultChannelClient.sendMessage(e,t,s,o,n,a,r,i)},e.prototype.sendRecallMessage=function(e,t,s){return this._defaultChannelClient.sendRecallMessage(e,t,s)},e.prototype.sendTypingStatusMessage=function(e,t,s,o){return this._defaultChannelClient.sendTypingStatusMessage(e,t,s,o)},e.prototype.sendReceiptResponse=function(e,t,s){return this._defaultChannelClient.sendReceiptResponse(e,t,s)},e.prototype.sendReadReceiptMessage=function(e,t,s){return this._defaultChannelClient.sendReadReceiptMessage(e,t,s)},e.prototype.getMessageReader=function(e,t,s){this._defaultChannelClient.getMessageReader(e,t,s)},e.prototype.updateMessageExpansion=function(e,t,s){this._defaultChannelClient.updateMessageExpansion(e,t,s)},e.prototype.removeMessageExpansionForKey=function(e,t,s){this._defaultChannelClient.removeMessageExpansionForKey(e,t,s)},e.prototype.getHistoryMessages=function(e,t,s,o,n,a,r){return this._defaultChannelClient.getHistoryMessages(e,t,s,o,n,a,r)},e.prototype.joinChatRoom=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"joinChatRoom ->chatRoomId:".concat(e));var a=this.logger.createTraceId();this.logger.info(t.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:s,joinExist:!1}),a),this._context.joinChatroom(e,s,a).then((function(s){var r=s===t.ErrorCode.SUCCESS?"info":"warn";n.logger[r](t.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),a),s===t.ErrorCode.SUCCESS?W(o.onSuccess):(n.logger.warn(t.LogTagId.O,"joinChatRoom ->code:".concat(s,",chatRoomId:").concat(e)),V(o.onError,s))}))},e.prototype.quitChatRoom=function(e,s){var o=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"quitChatRoom ->chatRoomId:".concat(e));var n=this.logger.createTraceId();this.logger.info(t.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),n),this._context.quitChatroom(e).then((function(a){var r=a===t.ErrorCode.SUCCESS?"info":"warn";o.logger[r](t.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:a}),n),a===t.ErrorCode.SUCCESS?W(s.onSuccess):(o.logger.warn(t.LogTagId.O,"quitChatRoom ->code:".concat(a,",chatRoomId:").concat(e)),V(s.onError,a))}))},e.prototype.getChatRoomInfo=function(e,s,o,n){var a=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("order",o,t.AssertRules.NUMBER,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,s,o).then((function(s){var o=s.code,r=s.data;o===t.ErrorCode.SUCCESS?W(n.onSuccess,{userInfos:(null==r?void 0:r.userInfos)||[],userTotalNums:(null==r?void 0:r.userCount)||0}):(a.logger.warn(t.LogTagId.O,"getChatRoomInfo ->code:".concat(o,",chatRoomId:").concat(e)),V(n.onError,o))}))},e.prototype.setChatroomEntry=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?W(o.onSuccess):(n.logger.warn(t.LogTagId.O,"setChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),V(o.onError,s))}))},e.prototype.setChatRoomEntries=function(e,s,o){var n=this;if(t.assert("chatRoomId",e,t.AssertRules.STRING,!0),function(e){e.entries.forEach((function(e){t.assert("entry.key",e.key,t.AssertRules.STRING,!0),t.assert("entry.value",e.value,t.AssertRules.STRING,!0)})),t.assert("options.isAutoDelete",e.isAutoDelete,t.AssertRules.BOOLEAN)}(s),t.assert("callback",o,t.AssertRules.CALLBACK),s.entries.length>10)V(o.onError,t.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT);else{var a="id:".concat(e);this.logger.info(t.LogTagId.O,"set chatroom entry->".concat(a)),this._context.setChatroomEntries(e,s).then((function(e){var s=e.code,r=e.data;s===t.ErrorCode.SUCCESS?W(o.onSuccess):(n.logger.warn(t.LogTagId.O,"set chatroom entry fail ->code+:".concat(s,",").concat(a)),V(o.onError,s,r))}))}},e.prototype.forceSetChatroomEntry=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?W(o.onSuccess):(n.logger.warn(t.LogTagId.O,"forceSetChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),V(o.onError,s))}))},e.prototype.removeChatroomEntry=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?W(o.onSuccess):(n.logger.warn(t.LogTagId.O,"removeChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),V(o.onError,s))}))},e.prototype.removeChatRoomEntries=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),function(e){e.entries.forEach((function(e){t.assert("key",e,t.AssertRules.STRING,!0)}))}(s);var r="id:".concat(e);this.logger.debug(t.LogTagId.O,"remove chatroom entry->".concat(r));var c=a({},s);c.entries=s.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,c).then((function(e){var s=e.code,a=e.data;s===t.ErrorCode.SUCCESS?W(o.onSuccess):(n.logger.warn(t.LogTagId.O,"remove chatroom entry fail ->code+:".concat(s,",").concat(r)),V(o.onError,s,a))}))},e.prototype.forceRemoveChatroomEntry=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?W(o.onSuccess):(n.logger.warn(t.LogTagId.O,"forceRemoveChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),V(o.onError,s))}))},e.prototype.getChatroomEntry=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("key",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(s)),this._context.getChatroomEntry(e,s).then((function(s){var a=s.code,r=s.data;a===t.ErrorCode.SUCCESS?W(o.onSuccess,r||""):(n.logger.warn(t.LogTagId.O,"getChatroomEntry ->code:".concat(a,",chatRoomId:").concat(e)),V(o.onError,a))}))},e.prototype.getAllChatroomEntries=function(e,s){var o=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?W(s.onSuccess,r):(o.logger.warn(t.LogTagId.O,"getAllChatroomEntries ->code:".concat(a,",chatRoomId:").concat(e)),V(s.onError,a))}))},e.prototype.getChatRoomHistoryMessages=function(e,s,o,n,a){var r=this;void 0===a&&(a=0),t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("order",o,t.AssertRules.NUMBER,!0),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("timestamp",a,t.AssertRules.NUMBER),this.logger.info(t.LogTagId.O,"getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,s,o,a).then((function(s){var o=s.code,a=s.data;if(o===t.ErrorCode.SUCCESS)if(a){var c=a.list,i=a.hasMore,g=c.map((function(e){return H(e)}));W(n.onSuccess,g,i)}else W(n.onSuccess,[],!1);else r.logger.warn(t.LogTagId.O,"getChatRoomHistoryMessages ->code:".concat(o,",chatRoomId:").concat(e)),V(n.onError,o)}))},e.prototype.setDeviceInfo=function(e){},e.prototype.getCurrentConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.deleteRemoteMessages=function(e,t,s,o){return this._defaultChannelClient.deleteRemoteMessages(e,t,s,o)},e.prototype.clearRemoteHistoryMessages=function(e,t){return this._defaultChannelClient.clearRemoteHistoryMessages(e,t)},e.prototype.getFileToken=function(e,s,o,n,a){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",o,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getFileToken ->fileType:".concat(e,",fileName:").concat(o,",queryString:").concat(a)),this._context.getFileToken(e,o,n,a).then(s.onSuccess).catch(s.onError)},e.prototype.getFileUrl=function(e,s,o,n,a,r){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",s,t.AssertRules.STRING,!0),t.assert("saveName",o,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("serverType",r,t.AssertRules.NUMBER),t.assert("uploadRes",a,t.AssertRules.OBJECT),this.logger.info(t.LogTagId.O,"getFileUrl ->fileType:".concat(e,",fileName:").concat(s)),this._context.getFileUrl(e,s,o,a,r).then(n.onSuccess).catch(n.onError)},e.prototype.createTag=function(e,s){var o=this;t.assert("tag.tagId",e.tagId,t.AssertRules.STRING,!0),t.assert("tag.tagId",e.tagId,(function(e){return e.length<=10})),t.assert("tag.tagName",e.tagName,(function(e){return e.length<=15})),t.assert("tag.tagName",e.tagName,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(n){var a=n.code;a===t.ErrorCode.SUCCESS?s.onSuccess():(o.logger.warn(t.LogTagId.O,"createTag ->code:".concat(a,",tagId:").concat(e.tagId)),s.onError(a))})).catch((function(n){o.logger.warn(t.LogTagId.O,"createTag ->code:".concat(n,",tagId:").concat(e.tagId)),s.onError(n)}))},e.prototype.removeTag=function(e,s){var o=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(n){var a=n.code;a===t.ErrorCode.SUCCESS?s.onSuccess():(o.logger.warn(t.LogTagId.O,"removeTag ->code:".concat(a,",tagId:").concat(e)),s.onError(a))})).catch((function(n){o.logger.warn(t.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(e)),s.onError(n)}))},e.prototype.updateTag=function(e,s){var o=this;t.assert("tag.tagId",e.tagId,t.AssertRules.STRING,!0),t.assert("tag.tagName",e.tagName,t.AssertRules.STRING,!0),t.assert("tag.tagName",e.tagName,(function(e){return e.length<=15})),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(n){var a=n.code;a===t.ErrorCode.SUCCESS?s.onSuccess():(o.logger.warn(t.LogTagId.O,"updateTag ->code:".concat(a,",tagId:").concat(e.tagId)),s.onError(a))})).catch((function(n){o.logger.warn(t.LogTagId.O,"updateTag ->reason:".concat(n,",tagId:").concat(e.tagId)),s.onError(n)}))},e.prototype.getTagList=function(e){var s=this;t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getTagList().then((function(o){var n=o.code,a=o.data;n===t.ErrorCode.SUCCESS?e.onSuccess(a||[]):(s.logger.warn(t.LogTagId.O,"getTagList ->code:".concat(n)),e.onError(n))})).catch((function(o){s.logger.warn(t.LogTagId.O,"getTagList ->reason:".concat(o)),e.onError(o)}))},e.prototype.getTagsForConversation=function(e,s){var o=this;t.assert("conversationType",e.type,t.AssertRules.NUMBER),t.assert("targetId",e.targetId,t.AssertRules.STRING),t.assert("channelId",e.channelId,t.AssertRules.ONLY_STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation($(e)).then((function(e){var n=e.code,a=e.data;n===t.ErrorCode.SUCCESS?s.onSuccess(a||[]):(o.logger.warn(t.LogTagId.O,"getTagsForConversation ->code:".concat(n)),s.onError(n))})).catch((function(e){o.logger.warn(t.LogTagId.O,"getTagsForConversation ->reason:".concat(e)),s.onError(e)}))},e.prototype.addTagForConversations=function(e,s,o){var n=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",s,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),s.forEach((function(e){t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING)})),this.logger.info(t.LogTagId.O,"addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,s.map((function(e){return $(e)}))).then((function(s){var a=s.code;s.data,a===t.ErrorCode.SUCCESS?o.onSuccess():(n.logger.warn(t.LogTagId.O,"addTagForConversations ->code:".concat(a,",tagId:").concat(e)),o.onError(a))})).catch((function(s){n.logger.warn(t.LogTagId.O,"addTagForConversations ->reason:".concat(s,",tagId:").concat(e)),o.onError(s)}))},e.prototype.removeTagForConversations=function(e,s,o){var n=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",s,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),s.forEach((function(e){t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING)})),this.logger.info(t.LogTagId.O,"removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,s.map((function(e){return $(e)}))).then((function(s){var a=s.code;s.data,a===t.ErrorCode.SUCCESS?o.onSuccess():(n.logger.warn(t.LogTagId.O,"removeTagForConversations ->code:".concat(a,",tagId:").concat(e)),o.onError(a))})).catch((function(s){n.logger.warn(t.LogTagId.O,"removeTagForConversations ->reason:".concat(s,",tagId:").concat(e)),o.onError(s)}))},e.prototype.removeTagsForConversation=function(e,s,o){var n=this;t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING),t.assert("tagIds",s,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),s.forEach((function(e){t.assert("tagId",e,t.AssertRules.STRING,!0)})),this.logger.info(t.LogTagId.O,"removeTagsForConversation ->tagIds:".concat(s,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation($(e),s).then((function(e){var a=e.code;e.data,a===t.ErrorCode.SUCCESS?o.onSuccess():(n.logger.warn(t.LogTagId.O,"removeTagsForConversation ->code:".concat(a,",tagIds:").concat(s)),o.onError(a))})).catch((function(e){n.logger.warn(t.LogTagId.O,"removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(s)),o.onError(e)}))},e.prototype.getConversationListByTag=function(e,s,o,n){var a=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("startTime",o,t.AssertRules.NUMBER,!0),t.assert("callback",n,t.AssertRules.CALLBACK,!0),this.logger.info(t.LogTagId.O,"getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,o,s).then((function(s){var o=s.code,r=s.data,c=[];o===t.ErrorCode.SUCCESS?((r=r||[]).forEach((function(e){c.push(function(e){var t=e.channelId,s=e.conversationType,o=e.targetId,n=e.unreadMessageCount,a=e.latestMessage,r=e.isTop,c=e.notificationStatus,i=e.isTopInTag,g=a?H(a):null,d=g||{};return d.messageType,d.sentTime,d.receivedStatus,d.messageId,{channelId:t||"",conversationType:s,targetId:o,unreadMessageCount:n,latestMessage:g,isTopInTag:i,latestMessageId:null==g?void 0:g.messageId,objectName:null==g?void 0:g.messageType,sentTime:null==g?void 0:g.sentTime,isTop:r,notificationStatus:c,receivedStatus:null==g?void 0:g.receivedStatus}}(e))})),n.onSuccess(c)):(a.logger.warn(t.LogTagId.O,"getConversationListByTag ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(s){a.logger.warn(t.LogTagId.O,"getConversationListByTag ->reason:".concat(s,",tagId:").concat(e)),n.onError(s)}))},e.prototype.getUnreadCountByTag=function(e,s,o){var n=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("containMuted",s,t.AssertRules.BOOLEAN,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,s).then((function(s){var a=s.code,r=s.data;n.logger.info(t.LogTagId.O,JSON.stringify({code:a,data:r})),a===t.ErrorCode.SUCCESS?o.onSuccess(r||0):(n.logger.warn(t.LogTagId.O,"getUnreadCountByTag ->code:".concat(a,",tagId:").concat(e)),o.onError(a))})).catch((function(s){n.logger.warn(t.LogTagId.O,"getUnreadCountByTag ->reason:".concat(s,",tagId:").concat(e)),o.onError(s)}))},e.prototype.setConversationStatusInTag=function(e,s,o,n){var a=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversation.targetId",s.targetId,t.AssertRules.STRING,!0),t.assert("conversation.type",s.type,t.AssertRules.NUMBER,!0),t.assert("conversation.channelId",s.channelId,t.AssertRules.ONLY_STRING),t.assert("status.isTop",null==o?void 0:o.isTop,t.AssertRules.BOOLEAN,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(s.targetId,",type").concat(s.type)),this._context.setConversationStatusInTag(e,$(s),o).then((function(s){var o=s.code;s.data,o===t.ErrorCode.SUCCESS?n.onSuccess():(a.logger.warn(t.LogTagId.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(s){a.logger.warn(t.LogTagId.O,"setConversationStatusInTag ->reason:".concat(s,",tagId:").concat(e)),n.onError(s)}))},e.prototype.callExtra=function(e,s){for(var o,n=this,a=[],r=2;r<arguments.length;r++)a[r-2]=arguments[r];this.logger.info(t.LogTagId.O,"callExtra ->method:".concat(e)),(o=this._context).callExtra.apply(o,function(e,t,s){if(s||2===arguments.length)for(var o,n=0,a=t.length;n<a;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}([e],a,!1)).then((function(o){var a=o.code,r=o.data;if(a!==t.ErrorCode.SUCCESS)n.logger.warn(t.LogTagId.O,"callExtra ->code:".concat(a)),s.onError&&V(s.onError,a);else{if("getConversationsByPage"===e&&r.forEach((function(e){e.latestMessage=e.latestMessage?H(e.latestMessage):null})),"getHistoryMessagesByObjectNames"===e){var c=r,i=c.list,g=c.hasMore,d=i.map((function(e){return H(e)}));return void W(s.onSuccess,d,g)}s.onSuccess&&W(s.onSuccess,r)}}))},e.prototype.hasRemoteUnreadMessages=function(e,s){t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){W(s.onSuccess,!1)}),"hasRemoteUnreadMessages",s)},e.prototype.setUserStatusListener=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){o._context.setUserStatusListener(e,s)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,s){var o=this;t.assert("status",e,t.AssertRules.NUMBER),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){o._context.setUserStatus(e).then((function(e){e===t.ErrorCode.SUCCESS?W(s.onSuccess,!0):(o.logger.warn(t.LogTagId.O,"setUserStatus ->code:".concat(e)),V(s.onError,e))}))}),"setUserStatus",s)},e.prototype.getUserStatus=function(e,s){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){o._context.getUserStatus(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?W(s.onSuccess,r):(o.logger.warn(t.LogTagId.O,"getUserStatus ->code:".concat(a,",useerId:").concat(e)),V(s.onError,a))}))}),"getUserStatus",s)},e.prototype.addToBlacklist=function(e,s){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){o._context.addToBlacklist(e).then((function(n){n===t.ErrorCode.SUCCESS?W(s.onSuccess):(o.logger.warn(t.LogTagId.O,"addToBlacklist ->code:".concat(n,",useerId:").concat(e)),V(s.onError,n))}))}),"addToBlacklist",s)},e.prototype.removeFromBlacklist=function(e,s){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){o._context.removeFromBlacklist(e).then((function(n){n===t.ErrorCode.SUCCESS?W(s.onSuccess):(o.logger.warn(t.LogTagId.O,"removeFromBlacklist ->code:".concat(n,",useerId:").concat(e)),V(s.onError,n))}))}),"removeFromBlacklist",s)},e.prototype.getBlacklist=function(e){var s=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.assertCPPMode((function(){s._context.getBlacklist().then((function(o){var n=o.code,a=o.data;n===t.ErrorCode.SUCCESS?W(e.onSuccess,a):(s.logger.warn(t.LogTagId.O,"getBlacklist ->code:".concat(n)),V(e.onError,n))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,s){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){o._context.getBlacklistStatus(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?W(s.onSuccess,r):(o.logger.warn(t.LogTagId.O,"getBlacklistStatus ->code:".concat(a,",userId:").concat(e)),V(s.onError,a))}))}),"getBlacklistStatus",s)},e.prototype.insertMessage=function(e,s,o,n,a){var r=this;void 0===a&&(a={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("content.senderUserId",o.senderUserId,t.AssertRules.STRING,!0),t.assert("content.messageDirection",o.messageDirection,t.AssertRules.NUMBER,!0),t.assert("content.messageType",o.messageType,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"insertMessage ->targetId:".concat(s,",conversationType:").concat(e,",senderUserId:").concat(o.senderUserId)),this.assertCPPMode((function(){r._defaultChannelClient.insertMessage(e,s,o,n,a)}),"insertMessage",n)},e.prototype.batchInsertMessage=function(e,s,o){var n,a,r=this;for(var c in t.assert("messages",e,(function(s){return t.isArray(s)&&!(e.length<=0||e.length>=500)}),!0),t.assert("checkDuplicate",s,t.AssertRules.BOOLEAN),t.assert("callback",o,t.AssertRules.CALLBACK),e)t.assert("message",e[c],t.AssertRules.OBJECT,!0),t.assert("message.conversationType",e[c].conversationType,(function(e){return[t.ConversationType.PRIVATE,t.ConversationType.DISCUSSION,t.ConversationType.GROUP,t.ConversationType.CUSTOMER_SERVICE,t.ConversationType.SYSTEM,t.ConversationType.APP_PUBLIC_SERVICE,t.ConversationType.PUBLIC_SERVICE].includes(e)}),!0),t.assert("message.targetId",e[c].targetId,t.AssertRules.STRING,!0),t.assert("message.senderUserId",e[c].senderUserId,t.AssertRules.STRING,!0),t.assert("message.messageType",e[c].messageType,t.AssertRules.STRING,!0),t.assert("message.content",e[c].content,t.AssertRules.OBJECT,!0),t.assert("message.messageDirection",e[c].messageDirection,t.AssertRules.NUMBER,!0),t.assert("message.canIncludeExpansion",e[c].canIncludeExpansion,t.AssertRules.BOOLEAN),t.assert("message.expansion",e[c].expansion,t.AssertRules.OBJECT),t.assert("message.disableNotification",e[c].disableNotification,t.AssertRules.BOOLEAN),t.assert("message.sentTime",e[c].sentTime,t.AssertRules.NUMBER),t.assert("message.sentStatus",e[c].sentStatus,t.AssertRules.NUMBER),t.assert("options.isUnread",null===(n=e[c])||void 0===n?void 0:n.isUnread,t.AssertRules.BOOLEAN),t.assert("options.searchContent",null===(a=e[c])||void 0===a?void 0:a.searchContent,t.AssertRules.STRING);this.assertCPPMode((function(){r._defaultChannelClient.batchInsertMessage(e,s,o)}),"batchInsertMessage",o)},e.prototype.getMessageCount=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.assertCPPMode((function(){n._defaultChannelClient.getMessageCount(e,s,o)}),"getMessageCount",o)},e.prototype.getRemoteHistoryMessages=function(e,s,o,n,a,r){var c=this;void 0===r&&(r={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("callback",a,t.AssertRules.CALLBACK),t.assert("options.order",r.order,t.AssertRules.NUMBER),this.assertCPPMode((function(){c._defaultChannelClient.getRemoteHistoryMessages(e,s,o,n,a,r)}),"getRemoteHistoryMessages",a)},e.prototype.deleteLocalMessages=function(e,s,o,n){var a=this;t.assert("messageIds",o,t.AssertRules.ARRAY,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"deleteLocalMessages ->messageIds:".concat(o)),this.assertCPPMode((function(){a._context.deleteMessages(o).then((function(e){e===t.ErrorCode.SUCCESS?W(n.onSuccess,!0):(a.logger.warn(t.LogTagId.O,"deleteLocalMessages ->code:".concat(e,",messageIds:").concat(o)),V(n.onError,e))}))}),"deleteLocalMessages",n)},e.prototype.deleteLocalMessagesByTimestamp=function(e,s,o,n,a){var r=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("cleanSpace",n,t.AssertRules.BOOLEAN),t.assert("callback",a,t.AssertRules.CALLBACK),this.assertCPPMode((function(){r._defaultChannelClient.deleteLocalMessagesByTimestamp(e,s,o,n,a)}),"deleteLocalMessagesByTimestamp",a)},e.prototype.clearMessages=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.assertCPPMode((function(){n._defaultChannelClient.clearMessages(e,s,o)}),"clearMessages",o)},e.prototype.getMessage=function(e,s){var o=this;t.assert("callback",s,t.AssertRules.CALLBACK),this.assertCPPMode((function(){o._context.getMessage(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?W(s.onSuccess,H(r)):(o.logger.warn(t.LogTagId.O,"getMessage ->code:".concat(a,",messageId:").concat(e)),V(s.onError,a))}))}),"getMessage",s)},e.prototype.setMessageSentStatus=function(e,s,o){var n=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("sentStatus",s,t.AssertRules.NUMBER,!0),this.logger.info(t.LogTagId.O,"setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(s)),this.assertCPPMode((function(){n._context.setMessageSentStatus(e,s).then((function(s){s===t.ErrorCode.SUCCESS?W(o.onSuccess,!0):(n.logger.warn(t.LogTagId.O,"setMessageSentStatus ->code:".concat(s,",messageId:").concat(e)),V(o.onError,s))}))}),"setMessageSentStatus",o)},e.prototype.setMessageReceivedStatus=function(e,s,o){var n=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("receivedStatus",s,t.AssertRules.NUMBER,!0),this.logger.info(t.LogTagId.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(s)),this.assertCPPMode((function(){n._context.setMessageReceivedStatus(e,s).then((function(s){s===t.ErrorCode.SUCCESS?W(o.onSuccess,!0):(n.logger.warn(t.LogTagId.O,"setMessageReceivedStatus ->code:".concat(s,",messageId:").concat(e)),V(o.onError,s))}))}),"setMessageReceivedStatus",o)},e.prototype.setMessageContent=function(e,s,o,n){var a=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("objectName",o,t.AssertRules.ONLY_STRING,!0),this.assertCPPMode((function(){a.logger.info(t.LogTagId.A_SET_MSG_CONTENT_O,JSON.stringify({messageId:e,objectName:o})),a._context.setMessageContent(e,s,o).then((function(e){e===t.ErrorCode.SUCCESS?W(n.onSuccess,!0):V(n.onError,e)}))}),"setMessageContent",n)},e.prototype.setMessageSearchField=function(e,s,o){var n=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("searchFiles",o,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"setMessageSearchField ->messageId:".concat(e,",searchFiles:").concat(o)),this.assertCPPMode((function(){n._context.setMessageSearchField(e,s,o)}),"setMessageSearchField")},e.prototype.searchConversationByContent=function(e,s,o,n){var a=this;t.assert("keyword",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("conversationTypes",o,t.AssertRules.ARRAY),t.assert("customMessageType",n,t.AssertRules.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContent(e,s,o,n)}),"searchConversationByContent",s)},e.prototype.searchConversationByContentWithAllChannel=function(e,s,o,n){var a=this;void 0===o&&(o=[]),t.assert("keyword",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("conversationTypes",n,t.AssertRules.ARRAY),t.assert("customMessageType",o,t.AssertRules.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContentWithAllChannel(e,s,o,n)}),"searchConversationByContentWithAllChannel",s)},e.prototype.searchMessageByContent=function(e,s,o,n,a,r,c){var i=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("keyword",o,t.AssertRules.STRING,!0),t.assert("timestamp",n,t.AssertRules.NUMBER),t.assert("count",a,t.AssertRules.NUMBER),t.assert("total",r,t.AssertRules.NUMBER),t.assert("callback",c,t.AssertRules.CALLBACK),this.assertCPPMode((function(){i._defaultChannelClient.searchMessageByContent(e,s,o,n,a,r,c)}),"searchMessageByContent",c)},e.prototype.searchMessageByContentWithAllChannel=function(e,s,o,n,a,r){var c=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("keyword",o,t.AssertRules.STRING,!0),t.assert("timestamp",n,t.AssertRules.NUMBER),t.assert("count",a,t.AssertRules.NUMBER),t.assert("callback",r,t.AssertRules.CALLBACK),this.assertCPPMode((function(){c._defaultChannelClient.searchMessageByContentWithAllChannel(e,s,o,n,a,r)}),"searchMessageByContentWithAllChannel",r)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,s,o,n,a,r,c,i){var g=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("keyword",o,t.AssertRules.STRING,!0),t.assert("startTime",n,t.AssertRules.NUMBER),t.assert("endTime",a,t.AssertRules.NUMBER),t.assert("offset",r,t.AssertRules.NUMBER),t.assert("limit",c,t.AssertRules.NUMBER),t.assert("callback",i,t.AssertRules.CALLBACK),this.assertCPPMode((function(){g._defaultChannelClient.searchMessageByContentInTimeRangeWithAllChannel(e,s,o,n,a,r,c,i)}),"searchMessageByContentInTimeRangeWithAllChannel",i)},e.prototype.getUnreadMentionedMessages=function(e,s){return this._isCPPMode?(t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,s)):(this.logger.error(t.LogTagId.O,"getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,s,o,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),this.assertCPPMode((function(){a._defaultChannelClient.clearUnreadCountByTimestamp(e,s,o,n)}),"clearUnreadCountByTimestamp",n)},e.prototype.getFirstUnreadMessage=function(e,t,s){return this._defaultChannelClient.getFirstUnreadMessage(e,t,s)},e.prototype.getConversationNotificationStatus=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.assertCPPMode((function(){n._defaultChannelClient.getConversationNotificationStatus(e,s,o)}),"getConversationNotificationStatus",o)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getGroupMessageDeliverList=function(e,t,s){this._defaultChannelClient.getGroupMessageDeliverList(e,t,s)},e.prototype.getPrivateMessageDeliverTime=function(e,t){this._defaultChannelClient.getPrivateMessageDeliverTime(e,t)},e.prototype.getRTCUserInfoList=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"getRTCUserInfoList ->roomId:".concat(e.id)),this._context.getRTCUserInfoList(e.id).then((function(n){var a=n.code,r=n.data;if(a!==t.ErrorCode.SUCCESS)o.logger.warn(t.LogTagId.O,"getRTCUserInfoList ->code:".concat(a,",roomId:").concat(e.id)),s.onError(a);else{var c=null==r?void 0:r.users;s.onSuccess(c)}})).catch((function(n){o.logger.warn(t.LogTagId.O,"getRTCUserInfoList ->error:".concat(n,",roomId:").concat(e.id)),s.onError(n)}))},e.prototype.getRTCUserList=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"getRTCUserList ->roomId:".concat(e.id)),this._context.getRTCUserList(e.id).then((function(n){var a=n.code,r=n.data;a!==t.ErrorCode.SUCCESS?(o.logger.warn(t.LogTagId.O,"getRTCUserList ->code:".concat(a,",roomId:").concat(e.id)),s.onError(a)):s.onSuccess(r)})).catch((function(n){o.logger.warn(t.LogTagId.O,"getRTCUserList ->error:".concat(n,",roomId:").concat(e.id)),s.onError(n)}))},e.prototype.setRTCUserInfo=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"setRTCUserInfo ->roomId:".concat(e.id,",info:").concat(JSON.stringify(s||{}))),this._context.setRTCUserInfo(e.id,s.key,s.value).then((function(a){a!==t.ErrorCode.SUCCESS?(n.logger.warn(t.LogTagId.O,"setRTCUserInfo ->code:".concat(a,",roomId:").concat(e.id,",key:").concat(s.key,",value:").concat(s.value)),o.onError(a)):o.onSuccess(!0)})).catch((function(a){n.logger.warn(t.LogTagId.O,"setRTCUserInfo ->code:".concat(a,",roomId:").concat(e.id,",key:").concat(s.key,",value:").concat(s.value)),o.onError(a)}))},e.prototype.removeRTCUserInfo=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"removeRTCUserInfo ->roomId:".concat(e.id,"keys:").concat(s.keys)),this._context.removeRTCUserInfo(e.id,s.keys).then((function(s){s!==t.ErrorCode.SUCCESS?(n.logger.warn(t.LogTagId.O,"removeRTCUserInfo ->code:".concat(s,",roomId:").concat(e.id)),o.onError(s)):o.onSuccess(!0)})).catch((function(s){n.logger.warn(t.LogTagId.O,"removeRTCUserInfo ->error:".concat(s,",roomId:").concat(e.id)),o.onError(s)}))},e.prototype.getRTCRoomInfo=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"getRTCRoomInfo ->roomId:".concat(e.id)),this._context.getRTCRoomInfo(e.id).then((function(n){var a=n.code,r=n.data;a!==t.ErrorCode.SUCCESS?(o.logger.warn(t.LogTagId.O,"getRTCRoomInfo ->code:".concat(a,",roomId:").concat(e.id)),s.onError(a)):s.onSuccess(r)})).catch((function(n){o.logger.warn(t.LogTagId.O,"getRTCRoomInfo ->error:".concat(n,",roomId:").concat(e.id)),s.onError(n)}))},e.prototype.setRTCRoomInfo=function(e,s,o){throw t.todo("setRTCRoomInfo")},e.prototype.removeRTCRoomInfo=function(e,s,o){throw t.todo("removeRTCRoomInfo")},e.prototype.joinRTCRoom=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"joinRTCRoom ->roomId:".concat(e.id));var n=e.mode||0;this._context.joinRTCRoom(e.id,n).then((function(n){var a=n.code,r=n.data;a!==t.ErrorCode.SUCCESS?(o.logger.warn(t.LogTagId.O,"joinRTCRoom ->code:".concat(a,",roomId:").concat(e.id)),s.onError(a)):s.onSuccess(r)})).catch((function(n){o.logger.warn(t.LogTagId.O,"joinRTCRoom ->error:".concat(n,",roomId:").concat(e.id)),s.onError(n)}))},e.prototype.quitRTCRoom=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"quitRTCRoom ->roomId:".concat(e.id)),this._context.quitRTCRoom(e.id).then((function(n){n!==t.ErrorCode.SUCCESS?(o.logger.warn(t.LogTagId.O,"quitRTCRoom ->code:".concat(n,",roomId:").concat(e.id)),s.onError(n)):s.onSuccess(!0)})).catch((function(n){o.logger.warn(t.LogTagId.O,"quitRTCRoom ->error:".concat(n,",roomId:").concat(e.id)),s.onError(n)}))},e.prototype.RTCPing=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"RTCPing ->roomId:".concat(e.id));var n=e.mode||0;this._context.rtcPing(e.id,n).then((function(n){var a=n.code;a!==t.ErrorCode.SUCCESS?(o.logger.warn(t.LogTagId.O,"RTCPing ->code:".concat(a,",roomId:").concat(e.id)),s.onError(a)):s.onSuccess(!0)})).catch((function(n){o.logger.warn(t.LogTagId.O,"RTCPing ->error:".concat(n,",roomId:").concat(e.id)),s.onError(n)}))},e.prototype.setRTCData=function(e,s,o,n,a,r,c){var i=this;this.logger.info(t.LogTagId.O,"setRTCData ->roomId:".concat(e,",key:").concat(s)),this._context.setRTCData(e,s,o,n,a,c).then((function(s){s!==t.ErrorCode.SUCCESS?(i.logger.warn(t.LogTagId.O,"setRTCData ->code:".concat(s,",roomId:").concat(e)),r.onError(s)):r.onSuccess(!0)})).catch((function(s){i.logger.warn(t.LogTagId.O,"setRTCData ->error:".concat(s,",roomId:").concat(e)),r.onError(s)}))},e.prototype.getRTCData=function(e,s,o,n,a){var r=this;this.logger.info(t.LogTagId.O,"getRTCData ->roomId:".concat(e,",keys:").concat(s)),this._context.getRTCData(e,s,o,n).then((function(s){var o=s.code,n=s.data;o!==t.ErrorCode.SUCCESS?(r.logger.warn(t.LogTagId.O,"getRTCData ->code:".concat(o,",roomId:").concat(e)),a.onError(o)):a.onSuccess(n)})).catch((function(s){r.logger.warn(t.LogTagId.O,"setRTCUserInfo ->error:".concat(s,",roomId:").concat(e)),a.onError(s)}))},e.prototype.removeRTCData=function(e,s,o,n,a,r){var c=this;this.logger.info(t.LogTagId.O,"removeRTCData ->roomId:".concat(e,",keys:").concat(s)),this._context.removeRTCData(e,s,o,n,r).then((function(s){s!==t.ErrorCode.SUCCESS?(c.logger.warn(t.LogTagId.O,"removeRTCData ->code:".concat(s,",roomId:").concat(e)),a.onError(s)):a.onSuccess(!0)})).catch((function(s){c.logger.warn(t.LogTagId.O,"removeRTCData ->error:".concat(s,",roomId:").concat(e)),a.onError(s)}))},e.prototype.setRTCUserData=function(e,s,o,n,a,r){this.setRTCData(e,s,o,n,t.RTCApiType.PERSON,a,r)},e.prototype.setRTCUserTotalRes=function(e,s,o,n,a){var r=this;this.logger.info(t.LogTagId.O,"setRTCUserTotalRes ->roomId:".concat(e)),this._context.setRTCTotalRes(e,s,o,n).then((function(s){s!==t.ErrorCode.SUCCESS?(r.logger.warn(t.LogTagId.O,"setRTCUserTotalRes ->code:".concat(s,",roomId:").concat(e)),a.onError(s)):a.onSuccess(!0)})).catch((function(s){r.logger.warn(t.LogTagId.O,"setRTCUserTotalRes ->error:".concat(s,",roomId:").concat(e)),a.onError(s)}))},e.prototype.getRTCUserData=function(e,s,o,n){this.getRTCData(e,s,o,t.RTCApiType.PERSON,n)},e.prototype.removeRTCUserData=function(e,s,o,n,a){this.removeRTCData(e,s,o,t.RTCApiType.PERSON,n,a)},e.prototype.setRTCRoomData=function(e,s,o,n,a,r){this.setRTCData(e,s,o,n,t.RTCApiType.ROOM,a,r)},e.prototype.getRTCRoomData=function(e,s,o,n){this.getRTCData(e,s,o,t.RTCApiType.ROOM,n)},e.prototype.removeRTCRoomData=function(e,s,o,n,a){this.removeRTCData(e,s,o,t.RTCApiType.ROOM,n,a)},e.prototype.setRTCOutData=function(e,s,o,n,a){throw t.todo("setRTCOutData")},e.prototype.getRTCOutData=function(e,s,o){throw t.todo("getRTCOutData")},e.prototype.getRTCToken=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"getRTCToken ->roomId:".concat(e.id)),this._context.getRTCToken(e.id,e.mode,e.broadcastType).then((function(n){var a=n.code,r=n.data;a!==t.ErrorCode.SUCCESS?(o.logger.warn(t.LogTagId.O,"getRTCToken ->code:".concat(a,",roomId:").concat(e.id)),s.onError(a)):s.onSuccess(r)})).catch((function(n){o.logger.warn(t.LogTagId.O,"getRTCToken ->error:".concat(n,",roomId:").concat(e.id)),s.onError(n)}))},e.prototype.setRTCState=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"setRTCState ->roomId:".concat(e.id)),this._context.setRTCState(e.id,s.report).then((function(s){s!==t.ErrorCode.SUCCESS?(n.logger.warn(t.LogTagId.O,"setRTCState ->code:".concat(s,",roomId:").concat(e.id)),o.onError(s)):o.onSuccess(!0)})).catch((function(s){n.logger.warn(t.LogTagId.O,"setRTCState ->error:".concat(s,",roomId:").concat(e.id)),o.onError(s)}))},e}(),ee=[],te=[],se={message:function(e){ee.forEach((function(t){return t(H(e))}))},status:function(e){te.forEach((function(t){return t(e)}))}},oe=1;t.VersionManage.add("imlib-v2-adapter","5.7.2");var ne,ae,re=null,ce={init:function(e,s,o){var n;void 0===o&&(o={}),t.assert("appkey",e,t.AssertRules.STRING,!0);var a=(null===(n=o.__runtimeCreator__)||void 0===n?void 0:n.call(o))||k;ne=new t.AppStorage(a,"API-V2"),Q=t.APIContext.init(a,{appkey:e,navigators:o.navi?[o.navi]:[],miniCMPProxy:[],logOutputLevel:o.logOutputLevel,typingExpireTime:o.typingExpireTime,httpInMainProcess:!!o.httpInMainProcess,logExpireTime:o.logExpireTime}),(re=Q.createLogger("RC-IM","IM")).setOutputLevel(o.logOutputLevel),re.info(t.LogTagId.A_INIT_O,JSON.stringify({appkey:e,navigators:o.navi?[o.navi]:[],typingExpireTime:o.typingExpireTime})),oe=Math.min(15,Math.max(o.readReceiptTimeout||1,1)),Y=new Z(Q,{readReceiptTimeout:oe},re,ne)},getInstance:function(){return Y},setConnectionStatusListener:function(e){throw new Error("Please use `onConnectionStatusChange()` instead of `setConnectionStatusListener()`")},onConnectionStatusChange:function(e){Q.assignWatcher({connection:function(s,o){try{e.onChanged(s,o)}catch(e){null==re||re.error(t.LogTagId.A_CALLBACK_E,"onConnectionStatusChange -> ".concat(e.stack))}}})},setOnReceiveMessageListener:function(e){Q.assignWatcher({message:function(s,o,n){try{var a=H(s),r=Q.getCurrentUserId(),c=Q.getConnectedTime();j(a,r,c,oe,ne),a=function(e,t,s,o,n){var a=new Date(s-1e3*o*60*60*24).getTime()-e.sentTime<0;if("ReadReceiptResponseMessage"!==e.messageType||!a)return e;var r=e.content,c=((r=r||{}).receiptMessageDic||{})[t],i="",g={};if(e.receiptResponse=e.receiptResponse||{},c){for(var d=[],u=0;u<c.length;u++)i="".concat(t).concat(c[u],"SENT"),(g=n.get(i))&&!(e.senderUserId in g.userIds)&&(d.push(c[u]),g.count+=1,g.userIds[e.senderUserId]=e.sentTime,e.receiptResponse[c[u]]=g.count,n.set(i,g));r.receiptMessageDic[t]=d,e.content=r}return e}(a,r,c,oe,ne),t.usingCppEngine()||D.set(s),e.onReceived(a,void 0,n)}catch(e){null==re||re.error(t.LogTagId.A_CALLBACK_E,"setOnReceiveMessageListener -> ".concat(e.stack))}}})},setConversationStatusListener:function(e){Q.assignWatcher({conversationState:function(s){try{var o=[];s.forEach((function(e){var t=e.updatedItems,s=e.conversationType,n=e.targetId,a=e.channelId,r=(t=t||{}).notificationStatus,c=t.isTop;r&&c&&o.push({notificationStatus:r.val,isTop:c.val,conversationType:s,targetId:n,channelId:a||"",updatedTime:r.time})})),o.length>0&&e.onChanged(o)}catch(e){null==re||re.error(t.LogTagId.O,"setConversationStatusListener ->error:".concat(e))}}})},setMessageExpansionListener:function(e){Q.assignWatcher({expansion:function(s){try{s.updatedExpansion&&e.onUpdated(s.updatedExpansion),s.deletedExpansion&&e.onDeleted(s.deletedExpansion)}catch(e){null==re||re.error(t.LogTagId.O,"setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){Q.assignWatcher({tag:function(){try{e.onChanged()}catch(e){null==re||re.error(t.LogTagId.O,"setTagListener ->error:".concat(e))}}})},setConversationTagListener:function(e){Q.assignWatcher({conversationTagChanged:function(){try{e.onChanged()}catch(e){null==re||re.error(t.LogTagId.O,"setConversationTagListener ->error:".concat(e))}}})},setPullOffLineFinished:function(e){Q.assignWatcher({pullFinished:function(){try{e.onFinished()}catch(e){null==re||re.error(t.LogTagId.O,"setPullOffLineFinished ->error:".concat(e))}}})},setTypingStatusListener:function(e){Q.assignWatcher({typingState:function(s){try{e.onChanged(s)}catch(e){null==re||re.error(t.LogTagId.O,"setTypingStatusListener ->error:".concat(e))}}})},setMessageBlockedListener:function(e){Q.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){Q.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},setMessageDeliveredListener:function(e){Q.assignWatcher({messageDelivered:function(s){try{e.onDelivered(s)}catch(e){null==re||re.error(t.LogTagId.O,"setMessageDeliveredListener ->error:".concat(e))}}})},setGroupMessageDeliveredStatusListener:function(e){Q.assignWatcher({groupMessageDeliveredStatus:function(s){try{e.onDelivered(s)}catch(e){null==re||re.error(t.LogTagId.O,"setGroupMessageDeliveredStatusListener ->error:".concat(e))}}})},connect:function(e,s,o){return r(this,void 0,void 0,(function(){var n,a,r,i;return c(this,(function(c){switch(c.label){case 0:return n=null==re?void 0:re.createTraceId(),null==re||re.info(t.LogTagId.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:!1}),n),[4,Q.connect(e,!!o,n)];case 1:return a=c.sent(),r=a.code===t.ErrorCode.SUCCESS?"info":"warn",null==re||re[r](t.LogTagId.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===t.ErrorCode.SUCCESS?(s.onSuccess(a.userId),i=new Date(Q.getConnectedTime()-1e3*oe*60*60*24).getTime(),ne.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=ne.get(e).dealtime;t&&i-t>0&&ne.remove(e)}else if(/RECEIVED$/.test(e)){var s=ne.get(e),o=Object.keys(s).length;Object.keys(s).forEach((function(e){var t=s[e].dealtime;t&&i-t>0&&delete s[e]})),Object.keys(s).length!==o&&(0===s.length?ne.remove(e):ne.set(e,s))}}))):a.code===t.ErrorCode.RC_CONN_TOKEN_INCORRECT?(null==re||re.warn(t.LogTagId.O,"connect ->code:".concat(a.code,",token:").concat(e)),s.onTokenIncorrect()):(null==re||re.warn(t.LogTagId.O,"connect ->code:".concat(a.code,",token:").concat(e)),s.onError(a.code)),[2]}}))}))},reconnect:function(e,s,o){var n=null==re?void 0:re.createTraceId();null==re||re.info(t.LogTagId.A_RECONNECT_T,null,n),Q.reconnect(o).then((function(s){var o=s.code===t.ErrorCode.SUCCESS?"info":"warn";null==re||re[o](t.LogTagId.A_RECONNECT_R,JSON.stringify({code:s.code,userId:s.userId}),n),s.code===t.ErrorCode.SUCCESS?e.onSuccess(s.userId):(null==re||re.warn(t.LogTagId.O,"reconnect ->code:".concat(s.code)),e.onError(s.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:F,getMessageObjectName:function(e){var t=a(a({},G),F);return Object.keys(t).find((function(s){return t[s]===e}))||e},registerMessageType:function(e,t,s,o){this.RegisterMessage[e]=q(e,t,s.isPersited,s.isCounted),this.RegisterMessageTypeMapping[t]=e,Q.registerMessageType(t,s.isPersited,s.isCounted,o)},messageWatch:function(e){var s=this;ee.push((function(o){var n,a;null==re||re.info(t.LogTagId.O,"messageWatch ->message:".concat(JSON.stringify(o||{})));try{e(o),null===(a=(n=s._voipProvider).onReceived)||void 0===a||a.call(n,o)}catch(e){null==re||re.error(t.LogTagId.O,"messageWatch ->error:".concat(e))}})),Q.assignWatcher({rtcInnerWatcher:se})},statusWatch:function(e){te.push((function(s){null==re||re.info(t.LogTagId.O,"statusWatch ->status:".concat(s));try{e(s)}catch(e){null==re||re.error(t.LogTagId.O,"statusWatch ->error:".concat(e))}}))},MessageType:{TextMessage:"TextMessage",ImageMessage:"ImageMessage",ReferenceMessage:"ReferenceMessage",DiscussionNotificationMessage:"DiscussionNotificationMessage",VoiceMessage:"VoiceMessage",RichContentMessage:"RichContentMessage",HandshakeMessage:"HandshakeMessage",UnknownMessage:"UnknownMessage",LocationMessage:"LocationMessage",InformationNotificationMessage:"InformationNotificationMessage",ContactNotificationMessage:"ContactNotificationMessage",ProfileNotificationMessage:"ProfileNotificationMessage",CommandNotificationMessage:"CommandNotificationMessage",CommandMessage:"CommandMessage",TypingStatusMessage:"TypingStatusMessage",ChangeModeResponseMessage:"ChangeModeResponseMessage",ChangeModeMessage:"ChangeModeMessage",EvaluateMessage:"EvaluateMessage",HandShakeMessage:"HandShakeMessage",HandShakeResponseMessage:"HandShakeResponseMessage",SuspendMessage:"SuspendMessage",TerminateMessage:"TerminateMessage",CustomerContact:"CustomerContact",CustomerStatusUpdateMessage:"CustomerStatusUpdateMessage",SyncReadStatusMessage:"SyncReadStatusMessage",ReadReceiptRequestMessage:"ReadReceiptRequestMessage",ReadReceiptResponseMessage:"ReadReceiptResponseMessage",FileMessage:"FileMessage",HQVoiceMessage:"HQVoiceMessage",GIFMessage:"GIFMessage",SightMessage:"SightMessage",AcceptMessage:"AcceptMessage",RingingMessage:"RingingMessage",SummaryMessage:"SummaryMessage",HungupMessage:"HungupMessage",InviteMessage:"InviteMessage",MediaModifyMessage:"MediaModifyMessage",MemberModifyMessage:"MemberModifyMessage",JrmfRedPacketMessage:"JrmfRedPacketMessage",JrmfRedPacketOpenedMessage:"JrmfRedPacketOpenedMessage",GroupNotificationMessage:"GroupNotificationMessage",PublicServiceRichContentMessage:"PublicServiceRichContentMessage",PublicServiceMultiRichContentMessage:"PublicServiceMultiRichContentMessage",PublicServiceCommandMessage:"PublicServiceCommandMessage",RecallCommandMessage:"RecallCommandMessage",ReadReceiptMessage:"ReadReceiptMessage",RCCombineMessage:"RCCombineMessage",ChrmKVNotificationMessage:"ChrmKVNotificationMessage",LogCommandMessage:"LogCommandMessage"},_voipProvider:{}},ie=function(e,t,s){this.type=e,this.userIdList=t,this.mentionedContent=s},ge=function(e,t){this.isCounted=e,this.isPersited=t},de=q("TextMessage","RC:TxtMsg"),ue=q("LocationMessage","RC:LBSMsg"),le=q("TypingStatusMessage","RC:TypSts"),Ce=q("ImageMessage","RC:ImgMsg"),he=q("RichContentMessage","RC:ImgTextMsg"),fe=q("VoiceMessage","RC:VcMsg"),pe=q("HQVoiceMessage","RC:HQVCMsg"),Re=q("FileMessage","RC:FileMsg"),Ie=q("SightMessage","RC:SightMsg"),Te=q("GIFMessage","RC:GIFMsg"),Se=q("ReadReceiptMessage","RC:ReadNtf"),me=q("ReadReceiptRequestMessage","RC:RRReqMsg"),ve=q("RCCombineMessage","RC:CombineMsg"),ye=function(e,t,s,o,n,a,r,c,i,g,d,u,l,C,h,f,p,R){this.conversationType=e,this.targetId=t,this.senderUserId=s,this.content=o,this.objectName=n,this.messageType=a,this.messageId=r,this.messageUId=c,this.messageDirection=i,this.offLineMessage=g,this.sentStatus=d,this.sentTime=u,this.receivedStatus=l,this.receivedTime=C,this.canIncludeExpansion=h,this.expansion=f,this.receiptResponse=p,this.disableNotification=R};exports.VoIPMediaType=void 0,(ae=exports.VoIPMediaType||(exports.VoIPMediaType={}))[ae.MEDIA_AUDIO=1]="MEDIA_AUDIO",ae[ae.MEDIA_VEDIO=2]="MEDIA_VEDIO",ae[ae.MEDIA_VIDEO=2]="MEDIA_VIDEO";var Me,Ee=q("AcceptMessage","RC:VCAccept"),Ae=q("RingingMessage","RC:VCRinging"),Le=q("SummaryMessage","RC:VCSummary"),Oe=q("HungupMessage","RC:VCHangup"),Ne=q("InviteMessage","RC:VCInvite"),Ue=q("MediaModifyMessage","RC:VCModifyMedia"),_e=q("MemberModifyMessage","RC:VCModifyMem"),xe=q("lastMessageSendTime","RC:SRSMsg"),Be=q("ReferenceMessage","RC:ReferenceMsg"),Pe=q("PublicServiceRichContentMessage","RC:PSImgTxtMsg"),we=q("PublicServiceMultiRichContentMessage","RC:PSMultiImgTxtMsg");!function(e){e[e.ALL=1]="ALL",e[e.PART=2]="PART"}(Me||(Me={}));var ke=Me;window&&(window.RongIMClient=ce),Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return t.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return t.ChatroomUserChangeType}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return t.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return t.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return t.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return t.FileType}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return t.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(exports,"LogSource",{enumerable:!0,get:function(){return t.LogSource}}),Object.defineProperty(exports,"LogTagId",{enumerable:!0,get:function(){return t.LogTagId}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return t.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return t.MessageDirection}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return t.NotificationStatus}}),Object.defineProperty(exports,"RCConnectionStatus",{enumerable:!0,get:function(){return t.RCConnectionStatus}}),Object.defineProperty(exports,"RTCApiType",{enumerable:!0,get:function(){return t.RTCApiType}}),Object.defineProperty(exports,"RTCMode",{enumerable:!0,get:function(){return t.RTCMode}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return t.ReceivedStatus}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return t.UploadMethod}}),Object.defineProperty(exports,"logger",{enumerable:!0,get:function(){return t.logger}}),exports.AcceptMessage=Ee,exports.BaseMessage=J,exports.ChannelClient=z,exports.ConnectionState={ACCEPTED:0,UNACCEPTABLE_PROTOCOL_VERSION:1,IDENTIFIER_REJECTED:2,SERVER_UNAVAILABLE:3,TOKEN_INCORRECT:4,NOT_AUTHORIZED:5,REDIRECT:6,PACKAGE_ERROR:7,APP_BLOCK_OR_DELETE:8,BLOCK:9,TOKEN_EXPIRE:10,DEVICE_ERROR:11,HOSTNAME_ERROR:12,HASOHTERSAMECLIENTONLINE:13,OUT_OF_LIMIT:14,IN_OTHER_CLUSTER:15,APP_AUTH_NOT_PASS:16,OTP_USED:17,PLATFORM_ERROR:18,USER_LOGOUT:19,ACCOUNT_CANCELLATION:19,LICENSE_EXPIRED:20},exports.FileMessage=Re,exports.GIFMessage=Te,exports.GetChatRoomType=n,exports.HQVoiceMessage=pe,exports.HungupMessage=Oe,exports.IMClient=Z,exports.ImageMessage=Ce,exports.InviteMessage=Ne,exports.LocationMessage=ue,exports.MediaModifyMessage=Ue,exports.MemberModifyMessage=_e,exports.MentionedInfo=ie,exports.MentionedType=ke,exports.Message=ye,exports.MessageTag=ge,exports.PublicServiceMultiRichContentMessage=we,exports.PublicServiceRichContentMessage=Pe,exports.RCCombineMessage=ve,exports.ReadReceiptMessage=Se,exports.ReadReceiptRequestMessage=me,exports.ReadReceiptResponseMessage=X,exports.ReferenceMessage=Be,exports.RichContentMessage=he,exports.RingingMessage=Ae,exports.RongIMClient=ce,exports.SentStatus=o,exports.SightMessage=Ie,exports.SummaryMessage=Le,exports.SyncReadStatusMessage=xe,exports.TextMessage=de,exports.TypingStatusMessage=le,exports.VoiceMessage=fe;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@rongcloud/engine");!function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(e||(e={}));var s,o=e;!function(e){e[e.NONE=0]="NONE",e[e.SQQUENCE=1]="SQQUENCE",e[e.REVERSE=2]="REVERSE"}(s||(s={}));var n=s,a=function(){return a=Object.assign||function(e){for(var t,s=1,o=arguments.length;s<o;s++)for(var n in t=arguments[s])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)};function r(e,t,s,o){return new(s||(s=Promise))((function(n,a){function r(e){try{i(o.next(e))}catch(e){a(e)}}function c(e){try{i(o.throw(e))}catch(e){a(e)}}function i(e){var t;e.done?n(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(r,c)}i((o=o.apply(e,t||[])).next())}))}function c(e,t){var s,o,n,a,r={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(c){return function(i){return function(c){if(s)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(r=0)),r;)try{if(s=1,o&&(n=2&c[0]?o.return:c[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,c[1])).done)return n;switch(o=0,n&&(c=[2&c[0],n.value]),c[0]){case 0:case 1:n=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,o=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(!(n=r.trys,(n=n.length>0&&n[n.length-1])||6!==c[0]&&2!==c[0])){r=0;continue}if(3===c[0]&&(!n||c[1]>n[0]&&c[1]<n[3])){r.label=c[1];break}if(6===c[0]&&r.label<n[1]){r.label=n[1],n=c;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(c);break}n[2]&&r.ops.pop(),r.trys.pop();continue}c=t.call(e,r)}catch(e){c=[6,e],o=0}finally{s=n=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,i])}}}function i(e,t,s){if(s||2===arguments.length)for(var o,n=0,a=t.length;n<a;n++)!o&&n in t||(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))}var g=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],s=0,o=t.length;s<o;s++)if(!e[t[s]])return!1;return!0}(uni))},d=g();var u={tag:"browser",httpReq:function(e){var s=e.method||t.HttpMethod.GET,o=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){var t,a=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),i="[object XDomainRequest]"===Object.prototype.toString.call(a);if(a.open(s,c),n&&a.setRequestHeader)for(var g in n)a.setRequestHeader(g,n[g]);if(i){a.timeout=o,a.onload=function(){e({data:a.responseText,status:a.status||200})},a.onerror=function(){e({status:a.status})},a.ontimeout=function(){e({status:a.status})};var d="object"==typeof r?JSON.stringify(r):r;a.send(d)}else a.onreadystatechange=function(){4===a.readyState&&e({data:a.responseText,status:a.status})},a.onerror=function(){e({status:a.status})},setTimeout((function(){a.abort(),e({status:a.status})}),o),a.send(r)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:d,createWebSocket:function(e,t){var s=new WebSocket(e,t);return s.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){s.onclose=function(t){var s=t.code,o=t.reason;e(s,o)}},onError:function(e){s.onerror=e},onMessage:function(e){s.onmessage=function(t){e(t.data)}},onOpen:function(e){s.onopen=e},send:function(e){s.send(e)},close:function(e,t){s.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection,s=e.type,o=e.effectiveType,n=s||o||t.NetworkType.UNKONWN;return new Promise((function(e){e(n)}))}},l=g(),h=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},C={setItem:h("setStorageSync"),getItem:h("getStorageSync"),removeItem:h("removeStorageSync"),clear:h("clearStorageSync")},p={tag:"wechat",httpReq:function(e){var s=e.method||t.HttpMethod.GET,o=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){wx.request({url:c,method:s,header:n,timeout:o,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:C,sessionStorage:C,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:l,createWebSocket:function(e,t){var s=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){s.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){s.onError((function(t){e(t.errMsg)}))},onMessage:function(e){s.onMessage((function(t){e(t.data)}))},onOpen:function(e){s.onOpen(e)},send:function(e){s.send({data:e})},close:function(e,t){s.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},f=g(),I=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},R={setItem:I("setStorageSync"),getItem:I("getStorageSync"),removeItem:I("removeStorageSync"),clear:I("clearStorageSync")},T={tag:"alipay",httpReq:function(e){var s=e.method||t.HttpMethod.GET,o=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a),i=e.dataType||"json";return new Promise((function(e){my.request({url:c,method:s,headers:n,timeout:o,data:r,dataType:i,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:R,sessionStorage:R,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:f,createWebSocket:function(e){return my.connectSocket({url:e}),{id:Date.now(),onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},S=g(),v=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{return tt[e].apply(tt,t)}catch(e){}}},y={setItem:v("setStorageSync"),getItem:v("getStorageSync"),removeItem:v("removeStorageSync"),clear:v("clearStorageSync")},m={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:S,localStorage:y,sessionStorage:y,httpReq:function(e){return new Promise((function(s){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};s(o)},fail:function(e){s({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var s=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){s.onOpen(e)},onClose:function(e){s.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){s.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){s.onMessage((function(t){return e(t.data)}))},send:function(e){s.send({data:e})},close:function(e,t){s.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},M=g(),E=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{return swan[e].apply(swan,t)}catch(e){}}},A={setItem:E("setStorageSync"),getItem:E("getStorageSync"),removeItem:E("removeStorageSync"),clear:E("clearStorageSync")},L={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:M,localStorage:A,sessionStorage:A,httpReq:function(e){return new Promise((function(s,o){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};s(o)},fail:function(e){s({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var s=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){s.onOpen(e)},onClose:function(e){s.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){s.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){s.onMessage((function(t){return e(t.data)}))},send:function(e){s.send({data:e})},close:function(e,t){s.close({code:e,reason:t})}}},getNetworkType:function(){return r(this,void 0,void 0,(function(){return c(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))]}))}))}},O=g(),N=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},U={setItem:N("setStorageSync"),getItem:N("getStorageSync"),removeItem:N("removeStorageSync"),clear:N("clearStorageSync")},_={tag:"jingdong",httpReq:function(e){var s=e.method||t.HttpMethod.GET,o=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){jd.request({url:c,method:s,headers:n,timeout:o,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:U,sessionStorage:U,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:O,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},x=function(e){return function(){for(var t=[],s=0;s<arguments.length;s++)t[s]=arguments[s];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},B={setItem:x("setStorageSync"),getItem:x("getStorageSync"),removeItem:x("removeStorageSync"),clear:x("clearStorageSync")},P={tag:"uniapp",httpReq:function(e){var s=e.method||t.HttpMethod.GET,o=e.timeout||t.HTTP_TIMEOUT,n=e.headers,a=e.query,r=e.body,c=t.appendUrl(e.url,a);return new Promise((function(e){uni.request({url:c,method:s,header:n,timeout:o,data:r,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:t.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:B,sessionStorage:B,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var s={url:e,protocols:t},o=uni.connectSocket(s);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var s=t.networkType;e(s)},fail:function(){e(t.NetworkType.UNKONWN)}})}))}},w=function(e){return e&&e.request&&e.getSystemInfo},b="undefined"!=typeof uni&&w(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return P;case"mp-jd":return _;case"mp-baidu":return L;case"mp-toutiao":return m;case"mp-alipay":return T;case"mp-weixin":return p;default:return u}}():"undefined"!=typeof jd&&w(jd)?_:"undefined"!=typeof my&&w(my)?T:"undefined"!=typeof tt&&w(tt)?m:"undefined"!=typeof swan&&w(swan)?L:"undefined"!=typeof wx&&w(wx)?p:u;function k(e,t,s){return"".concat(e,"_").concat(t,"_").concat(s)}var G=function(){function e(){}return e.set=function(s){if(t.SEND_MESSAGE_TYPE_OPTION[s.messageType]&&t.SEND_MESSAGE_TYPE_OPTION[s.messageType].isPersited){var o=e.get(s.conversationType,s.targetId,s.channelId||"");if(!o||o.sentTime<s.sentTime){var n=k(s.conversationType,s.targetId,s.channelId||"");e.map[n]=s}}},e.get=function(t,s,o){var n=k(t,s,o);return e.map[n]||null},e.remove=function(t,s,o){var n=k(t,s,o);delete e.map[n]},e.clear=function(){e.map={}},e.map={},e}(),D={"RC:TxtMsg":"TextMessage","RC:ImgMsg":"ImageMessage","RC:VcMsg":"VoiceMessage","RC:ImgTextMsg":"RichContentMessage","RC:ReferenceMsg":"ReferenceMessage","RC:FileMsg":"FileMessage","RC:HQVCMsg":"HQVoiceMessage","RC:GIFMsg":"GIFMessage","RC:SightMsg":"SightMessage","RC:LBSMsg":"LocationMessage","RC:InfoNtf":"InformationNotificationMessage","RC:ContactNtf":"ContactNotificationMessage","RC:ProfileNtf":"ProfileNotificationMessage","RC:CmdNtf":"CommandNotificationMessage","RC:DizNtf":"DiscussionNotificationMessage","RC:CmdMsg":"CommandMessage","RC:TypSts":"TypingStatusMessage","RC:CsChaR":"ChangeModeResponseMessage","RC:CsHsR":"HandShakeResponseMessage","RC:CsEnd":"TerminateMessage","RC:CsSp":"SuspendMessage","RC:CsUpdate":"CustomerStatusUpdateMessage","RC:ReadNtf":"ReadReceiptMessage","RC:VCAccept":"AcceptMessage","RC:VCRinging":"RingingMessage","RC:VCSummary":"SummaryMessage","RC:VCHangup":"HungupMessage","RC:VCInvite":"InviteMessage","RC:VCModifyMedia":"MediaModifyMessage","RC:VCModifyMem":"MemberModifyMessage","RC:CsContact":"CustomerContact","RC:PSImgTxtMsg":"PublicServiceRichContentMessage","RC:PSMultiImgTxtMsg":"PublicServiceMultiRichContentMessage","RC:GrpNtf":"GroupNotificationMessage","RC:PSCmd":"PublicServiceCommandMessage","RC:RcCmd":"RecallCommandMessage","RC:SRSMsg":"SyncReadStatusMessage","RC:RRReqMsg":"ReadReceiptRequestMessage","RC:RRRspMsg":"ReadReceiptResponseMessage","RCJrmf:RpMsg":"JrmfRedPacketMessage","RCJrmf:RpOpendMsg":"JrmfRedPacketOpenedMessage","RC:CombineMsg":"RCCombineMessage","RC:chrmKVNotiMsg":"ChrmKVNotificationMessage","RC:LogCmdMsg":"LogCommandMessage","RC:MsgExMsg":"ExpansionCommandMessage","RC:RRMsg":"GroupReadReceiptResponseMessage"},K={};function F(e){var s=e.channelId,o=e.conversationType,n=e.targetId,a=e.unreadMessageCount,r=e.latestMessage,c=e.isTop,i=e.notificationStatus,g=e.matchCount;if(!t.usingCppEngine()){var d=G.get(o,n,s||"");r?d&&r.sentTime<d.sentTime&&(r=d):r=d}var u=r?H(r):null;return{channelId:s||"",conversationType:o,targetId:n,unreadMessageCount:a,latestMessage:u,latestMessageId:null==u?void 0:u.messageId,objectName:null==u?void 0:u.messageType,sentTime:null==u?void 0:u.sentTime,isTop:c,notificationStatus:i,receivedStatus:null==u?void 0:u.receivedStatus,matchCount:g}}function H(e){var s=e.conversationType,n=e.targetId,a=e.senderUserId,r=e.content,c=e.messageType,i=e.messageUId,g=e.messageDirection,d=e.isOffLineMessage,u=e.sentTime,l=e.receivedStatus,h=e.receivedTime,C=e.canIncludeExpansion,p=e.disableNotification,f=e.expansion,I=e.messageId,R=e.sentStatus,T=e.channelId,S=e.readReceiptInfo,v=e.pushConfig,y=e.extraContent,m="";return c in D?m=D[c]:c in K?m=K[c]:(r={message:{content:r,objectName:c},messageName:"UnknownMessage"},m="UnknownMessage"),l||(l=t.ReceivedStatus.UNREAD),void 0===I&&(I=~~(16777215*Math.random())),{channelId:T||"",conversationType:s,targetId:n,senderUserId:a,content:r,messageType:m,messageUId:i,messageDirection:g,offLineMessage:d,sentTime:u,receivedStatus:l,receivedTime:h,objectName:c,messageId:I,sentStatus:R||o.SENT,disableNotification:p,canIncludeExpansion:C,expansion:f,readReceiptInfo:S,pushConfig:v,extraContent:y}}function j(e,s,o,n,a){var r=new Date(o-1e3*n*60*60*24).getTime()-e.sentTime<0,c=e.messageType,i=e.messageDirection;if("ReadReceiptRequestMessage"===c&&r&&i===t.MessageDirection.SEND){var g="".concat(s).concat(e.content.messageUId,"SENT");a.set(g,{count:0,dealtime:e.sentTime,userIds:{}})}else if("ReadReceiptRequestMessage"===c&&r){var d="".concat(s).concat(e.conversationType).concat(e.targetId,"RECEIVED"),u=a.get(d);if(u)if(e.senderUserId in u)u[e.senderUserId].uIds&&-1===u[e.senderUserId].uIds.indexOf(e.content.messageUId)&&(u[e.senderUserId].uIds.push(e.content.messageUId),u[e.senderUserId].dealtime=e.sentTime,u[e.senderUserId].isResponse=!1,a.set(d,u));else{var l={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1};u[e.senderUserId]=l,a.set(d,u)}else{var h={};h[e.senderUserId]={uIds:[e.content.messageUId],dealtime:e.sentTime,isResponse:!1},a.set(d,h)}}}function V(e,t,s){try{e(t,s)}catch(e){null===console||void 0===console||console.error(e)}}function W(e,t,s){try{e(t,s)}catch(e){null===console||void 0===console||console.error(e)}}var J=function(e,t,s,o,n){void 0===o&&(o=!0),void 0===n&&(n=!0),this.messageType=e,this.objectName=t,this.content=s,this.isPersited=o,this.isCounted=n};function q(e,t,s,o){void 0===s&&(s=!0),void 0===o&&(o=!0);var n=function(n){return new J(e,t,n,s,o)};return n.MessageType=e,n.ObjectName=t,n}var Y,Q,X=q("ReadReceiptResponseMessage","RC:RRRspMsg"),z=function(){function e(e,t,s,o,n,a){this.logger=e,this._context=t,this.channelId=s,this._isCPPMode=o,this._readReceiptTimeout=n,this._storage=a,this._draftMap={}}return e.prototype.getConversationList=function(e,s,o){var n=this;t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("conversationTypes",s,t.AssertRules.ARRAY),t.assert("count",o,t.AssertRules.NUMBER),this._context.getConversationList(o,void 0,0,0,this.channelId).then((function(o){var a=o.code,r=o.data,c=[];r=r||[],a===t.ErrorCode.SUCCESS?(s?r.forEach((function(e){s.indexOf(e.conversationType)>-1&&c.push(F(e))})):r.forEach((function(e){c.push(F(e))})),V(e.onSuccess,c)):(n.logger.warn(t.LogTagId.O,"getConversationList -> code:".concat(a)),W(e.onError,a))}))},e.prototype.getConversation=function(e,s,o){var n=this;t.assert("callback",o,t.AssertRules.CALLBACK),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getConversation ->targetId:".concat(s,",conversationType:").concat(e)),r(n,void 0,void 0,(function(){var n,a,r;return c(this,(function(c){switch(c.label){case 0:return[4,this._context.getConversation(e,s,this.channelId)];case 1:return n=c.sent(),a=n.code,r=n.data,a!==t.ErrorCode.SUCCESS?(this.logger.warn(t.LogTagId.O,"getConversation ->code:".concat(a,",targetId:").concat(s)),o.onError(a),[2]):(o.onSuccess(r?F(r):null),[2])}}))}))},e.prototype.removeConversation=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeConversation ->targetId:".concat(s,",conversationType:").concat(e)),this._context.removeConversation(e,s,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(n._isCPPMode||G.remove(e,s,n.channelId),V(o.onSuccess)):(n.logger.warn(t.LogTagId.O,"removeConversation ->code:".concat(a,",targetId:").concat(s)),W(o.onError,a))}))},e.prototype.saveTextMessageDraft=function(e,s,o){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("draftText",o,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"saveTextMessageDraft ->targetId:".concat(s,",conversationType:").concat(e));var n=this._context.getCurrentUserId();return!!n&&((this._draftMap[n]=this._draftMap[n]||{})["".concat(e,"_").concat(s,"_").concat(this.channelId)]=o,!0)},e.prototype.getTextMessageDraft=function(e,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getTextMessageDraft ->targetId:".concat(s,",conversationType:").concat(e));var o=this._context.getCurrentUserId();if(o)return(this._draftMap[o]||{})["".concat(e,"_").concat(s,"_").concat(this.channelId)]},e.prototype.clearTextMessageDraft=function(e,s){t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"clearTextMessageDraft ->targetId:".concat(s,",conversationType:").concat(e));var o=this._context.getCurrentUserId();return!!o&&delete(this._draftMap[o]||{})["".concat(e,"_").concat(s,"_").concat(this.channelId)]},e.prototype.getTotalUnreadCount=function(e,s,o){var n=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getTotalUnreadCount ->conversationTypes:".concat(s)),this._context.getTotalUnreadCount(this.channelId,s,o).then((function(s){var o=s.code,a=s.data;o===t.ErrorCode.SUCCESS?V(e.onSuccess,a):(n.logger.warn(t.LogTagId.O,"getTotalUnreadCount ->code:".concat(o)),W(e.onError,o))}))},e.prototype.getUnreadCount=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getUnreadCount ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getUnreadCount(e,s,this.channelId).then((function(e){var a=e.code,r=e.data;a===t.ErrorCode.SUCCESS?V(o.onSuccess,r):(n.logger.warn(t.LogTagId.O,"getUnreadCount ->code:".concat(a,",targetId:").concat(s)),W(o.onError,a))}))},e.prototype.clearConversations=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"clearConversations -> conversationTypes:".concat(s)),this._isCPPMode?this._context.clearConversations(s,this.channelId).then((function(s){s===t.ErrorCode.SUCCESS?V(e.onSuccess,!0):(o.logger.warn(t.LogTagId.O,"clearConversations ->code:".concat(s)),W(e.onError,s))})):this.logger.error(t.LogTagId.O,"Method is only available in cppProtocol mode")},e.prototype.clearUnreadCount=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"clearUnreadCount ->targetId:".concat(s,",conversationType:").concat(e)),this._context.clearUnreadCount(e,s,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?V(o.onSuccess,!0):(n.logger.warn(t.LogTagId.O,"clearUnreadCount ->code:".concat(e,",targetId:").concat(s)),W(o.onError,e))}))},e.prototype.clearAllUnreadCount=function(e){var s=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"clearUnreadCount ->"),this._context.clearAllUnreadCount().then((function(o){o===t.ErrorCode.SUCCESS?V(e.onSuccess,!0):(s.logger.warn(t.LogTagId.O,"clearUnreadCount ->code:".concat(o)),W(e.onError,o))}))},e.prototype.getFirstUnreadMessage=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getFirstUnreadMessage ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getFirstUnreadMessage(e,s,this.channelId).then((function(e){e.code===t.ErrorCode.SUCCESS?V(o.onSuccess,e.data?H(e.data):null):(n.logger.warn(t.LogTagId.O,"getFirstUnreadMessage ->code:".concat(e.code,",targetId:").concat(s)),W(o.onError,e.code))}))},e.prototype.getMessageByUids=function(e){return this._isCPPMode?(t.assert("msgUids",e,t.AssertRules.ARRAY,!0),this._context.getMessageByUids(e)):(this.logger.error(t.LogTagId.O,"getMessageByUids method is not supported in a browser!"),[])},e.prototype.getMessageByMsgUids=function(e,s,o){return this._isCPPMode?(t.assert("targetId",e,t.AssertRules.STRING,!0),t.assert("conversationType",s,t.AssertRules.NUMBER,!0),t.assert("msgUids",o,t.AssertRules.ARRAY,!0),this._context.getMessageByMsgUids(e,this.channelId,s,o)):(this.logger.error(t.LogTagId.O,"getUnreadMentionedMessages method is not supported in a browser!"),[])},e.prototype.setConversationStatus=function(e,s,o,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("status",o,t.AssertRules.OBJECT,!0),this.logger.info(t.LogTagId.O,"setConversationStatus ->targetId:".concat(s,",status:").concat(o));var r=o.isTop,c=o.notificationStatus;this._context.setConversationStatus(e,s,r,c,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?V(n.onSuccess):(a.logger.warn(t.LogTagId.O,"setConversationStatus ->code:".concat(e,",targetId:").concat(s)),W(n.onError,e))}))},e.prototype.setConversationsMuteStatus=function(e){t.assert("status",e,t.AssertRules.ARRAY,!0),this.logger.info(t.LogTagId.O,"setConversationsStatus ->status:".concat(e)),this._context.setConversationsMuteStatus(e)},e.prototype.setConversationsTopStatus=function(e){t.assert("status",e,t.AssertRules.ARRAY,!0),this.logger.info(t.LogTagId.O,"setConversationsStatus ->status:".concat(e)),this._context.setConversationsTopStatus(e)},e.prototype.sendMessage=function(e,s,n,r,c,i,g,d){var u=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("msg",n,t.AssertRules.OBJECT,!0),t.assert("callback",r,t.AssertRules.CALLBACK),t.assert("isMentioned",c,t.AssertRules.BOOLEAN),t.assert("pushContent",i,t.AssertRules.ONLY_STRING),t.assert("pushData",g,t.AssertRules.ONLY_STRING),t.assert("options.userIds",null==d?void 0:d.userIds,t.AssertRules.ARRAY),t.assert("options.isVoipPush",null==d?void 0:d.isVoipPush,t.AssertRules.BOOLEAN),t.assert("options.disableNotification",null==d?void 0:d.disableNotification,t.AssertRules.BOOLEAN),t.assert("options.canIncludeExpansion",null==d?void 0:d.canIncludeExpansion,t.AssertRules.BOOLEAN),t.assert("options.expansion",null==d?void 0:d.expansion,t.AssertRules.OBJECT),t.assert("options.pushConfig",null==d?void 0:d.pushConfig,t.AssertRules.OBJECT),t.assert("options.resendMessageId",null==d?void 0:d.resendMessageId,t.AssertRules.NUMBER),this.logger.info(t.LogTagId.O,"sendMessage ->targetId:".concat(s,",conversationType:").concat(e));var l=!(!(null==d?void 0:d.isStatusMessage)&&!(null==d?void 0:d.isStatus)),h=function(e,t,s){var o,n=e||{},a=n.userIds,r=n.isVoipPush,c=n.disableNotification,i=n.isFilerWhiteBlacklist,g=n.expansion,d=n.canIncludeExpansion,u=n.pushConfig,l=n.resendMessageId,h=n.isResend,C=[];if(t){var p=(s||{}).content.mentionedInfo;C=p.userIdList,o=p.type}return{mentionedType:o,mentionedUserIdList:C,directionalUserIdList:a,isVoipPush:r,disableNotification:c,isFilerWhiteBlacklist:i,expansion:g,canIncludeExpansion:d,pushConfig:u,messageId:l,isResend:h}}(d,c,n),C=Object.assign(n,a(a({isMentioned:c,pushContent:i,pushData:g},h),{messageType:n.objectName,channelId:this.channelId,isStatusMessage:l})),p=this._context.getCurrentUserId(),f=this.logger.createTraceId();this.logger.info(t.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:C.messageType,conversationType:e,targetId:s,channelId:this.channelId}),f),this._context.sendMessage(e,s,C,r.onBefore,f).then((function(a){var c=a.code,i=a.data,g=c===t.ErrorCode.SUCCESS?"info":"warn";if(u.logger[g](t.LogTagId.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:i?i.messageUId:"",messageId:i?i.messageId:""}),f),c===t.ErrorCode.SUCCESS){u._isCPPMode||G.set(i);var h=H(i);j(h,p,u._context.getConnectedTime(),u._readReceiptTimeout,u._storage),V(r.onSuccess,h)}else u.logger.warn(t.LogTagId.O,"sendMessage ->code:".concat(c,",targetId:").concat(s)),W(r.onError,c,H({isMentioned:!!C.isMentioned,content:n.content,messageType:n.messageType,isPersited:n.isPersited,isCounted:n.isCounted,disableNotification:!!(null==d?void 0:d.disableNotification),canIncludeExpansion:!!(null==d?void 0:d.canIncludeExpansion),expansion:(null==d?void 0:d.expansion)||null,conversationType:e,targetId:s,senderUserId:p,messageUId:"",messageDirection:t.MessageDirection.SEND,isOffLineMessage:!1,sentTime:(null==i?void 0:i.sentTime)||0,receivedTime:0,isStatusMessage:l,receivedStatus:t.ReceivedStatus.UNREAD,messageId:null==i?void 0:i.messageId,sentStatus:o.FAILED}))}))},e.prototype.sendRecallMessage=function(e,s,o){var n=this;t.assert("message.conversationType",e.conversationType,t.AssertRules.NUMBER,!0),t.assert("message.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("message.messageUId",e.messageUId,t.AssertRules.STRING,!0),t.assert("message.sentTime",e.sentTime,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("options.disableNotification",null==o?void 0:o.disableNotification,t.AssertRules.BOOLEAN),t.assert("options.pushConfig",null==o?void 0:o.pushConfig,t.AssertRules.OBJECT),t.assert("options.extra",null==o?void 0:o.extra,t.AssertRules.STRING);var r=e.conversationType,c=e.targetId,i=e.messageUId,g=e.sentTime;this.logger.info(t.LogTagId.O,"sendRecallMessage ->targetId:".concat(c,",conversationType:").concat(r,",messageUId:").concat(i));var d=a({channelId:this.channelId},o);this._context.recallMessage(r,c,i,g,d).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?(n._isCPPMode||G.set(a),V(s.onSuccess,H(a))):(n.logger.warn(t.LogTagId.O,"sendRecallMessage ->code:".concat(o,",targetId:").concat(c,",messageUId:").concat(i)),W(s.onError,o))}))},e.prototype.sendTypingStatusMessage=function(e,s,o,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("typingContentType",o,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"sendTypingStatusMessage ->targetId:".concat(s,",conversationType:").concat(e));var r={messageType:"RC:TypSts",content:{typingContentType:o},isStatusMessage:!0,channelId:this.channelId},c=this.logger.createTraceId();this.logger.info(t.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:r.messageType,conversationType:e,targetId:s,channelId:r.channelId}),c),this._context.sendMessage(e,s,r,void 0,c).then((function(e){var o=e.code,r=e.data,i=o===t.ErrorCode.SUCCESS?"info":"warn";a.logger[i](t.LogTagId.A_SEND_MSG_R,JSON.stringify({code:o,messageUId:r?r.messageUId:"",messageId:r?r.messageId:""}),c),o===t.ErrorCode.SUCCESS?V(n.onSuccess,H(r)):(a.logger.warn(t.LogTagId.O,"sendTypingStatusMessage ->code:".concat(o,",targetId:").concat(s)),W(n.onError,o))}))},e.prototype.sendReceiptResponse=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"sendReceiptResponse ->targetId:".concat(s,",conversationType:").concat(e));var a=this._context.getCurrentUserId(),r="".concat(a).concat(e).concat(s,"RECEIVED"),c=this._storage.get(r);if(c){var i=[];for(var g in c){var d={};d[g]=c[g].uIds,c[g].isResponse||i.push(d)}if(0===i.length)return void o.onSuccess(null);var u=setInterval((function(){1===i.length&&clearInterval(u);var a=i.splice(0,1)[0],g=new X({receiptMessageDic:a});n.sendMessage(e,s,g,{onSuccess:function(e){var t=Object.keys(a)[0];c[t].isResponse=!0,n._storage.set(r,c),V(o.onSuccess,e)},onError:function(e){n.logger.warn(t.LogTagId.O,"sendReceiptResponse ->code:".concat(e,",targetId:").concat(s)),W(o.onError,e)}})}),200)}else o.onSuccess(null)},e.prototype.sendReadReceiptMessage=function(e,s,o){var n=this;t.assert("messageUIds",e,t.AssertRules.ARRAY,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"sendReadReceiptMessage ->targetId:".concat(s,",messageUIds:").concat(e));for(var a=0,r=e;a<r.length;a++){var c=r[a];t.assert("messageUId",c,t.AssertRules.STRING)}this._context.sendReadReceiptMessage(s,e,this.channelId).then((function(a){var r=a.code;r===t.ErrorCode.SUCCESS?o.onSuccess():(n.logger.warn(t.LogTagId.O,"sendReadReceiptMessage ->code:".concat(r,",targetId:").concat(s,",messageUIds:").concat(e)),o.onError(r))})).catch((function(a){n.logger.warn(t.LogTagId.O,"sendReadReceiptMessage ->code:".concat(a,",targetId:").concat(s,",messageUIds:").concat(e)),o.onError(a)}))},e.prototype.getMessageReader=function(e,s,o){var n=this;t.assert("messageUId",e,t.AssertRules.STRING,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getMessageReader ->targetId:".concat(s,",messageUId:").concat(e)),this._context.getMessageReader(s,e,this.channelId).then((function(a){var r=a.code,c=a.data;r===t.ErrorCode.SUCCESS?o.onSuccess(c):(n.logger.warn(t.LogTagId.O,"getMessageReader ->code:".concat(r,",targetId:").concat(s,",messageUId:").concat(e)),o.onError(r))})).catch((function(a){n.logger.warn(t.LogTagId.O,"getMessageReader ->code:".concat(a,",targetId:").concat(s,",messageUId:").concat(e)),o.onError(a)}))},e.prototype.setGroupVoiceMessagePlayed=function(e,s,o){var n=this;t.assert("targetId",e,t.AssertRules.STRING,!0),t.assert("messageUId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"setGroupVoiceMessagePlayed ->targetId:".concat(e,",messageUId:").concat(s)),this._context.setGroupVoiceMessagePlayed(e,this.channelId,s).then((function(a){var r=a.code;r===t.ErrorCode.SUCCESS?o.onSuccess():(n.logger.warn(t.LogTagId.O,"setGroupVoiceMessagePlayed ->code:".concat(r,",targetId:").concat(e,",messageUId:").concat(s)),o.onError(r))})).catch((function(a){n.logger.warn(t.LogTagId.O,"setGroupVoiceMessagePlayed ->code:".concat(a,",targetId:").concat(e,",messageUId:").concat(s)),o.onError(a)}))},e.prototype.getGroupVoiceMessageReader=function(e,s,o){var n=this;t.assert("targetId",e,t.AssertRules.STRING,!0),t.assert("messageUId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getGroupVoiceMessageReader ->targetId:".concat(e,",messageUId:").concat(s)),this._context.getGroupVoiceMessageReader(e,this.channelId,s).then((function(a){var r=a.code,c=a.data;r===t.ErrorCode.SUCCESS?o.onSuccess(c):(n.logger.warn(t.LogTagId.O,"getGroupVoiceMessageReader ->code:".concat(r,",targetId:").concat(e,",messageUId:").concat(s)),o.onError(r))})).catch((function(a){n.logger.warn(t.LogTagId.O,"getGroupVoiceMessageReader ->code:".concat(a,",targetId:").concat(e,",messageUId:").concat(s)),o.onError(a)}))},e.prototype.setReadMessages=function(e,s,o,n){var a=this;t.assert("targetId",e,t.AssertRules.STRING,!0),t.assert("beginMessageUId",s,t.AssertRules.STRING,!0),t.assert("endMessageUId",o,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"setReadMessages ->targetId:".concat(e,",\n channelId:").concat(this.channelId,",\n beginMessageUId:").concat(s,",\n endMessageUId:").concat(o)),this._context.setReadMessages(e,this.channelId,s,o).then((function(r){var c=r.code;c===t.ErrorCode.SUCCESS?n.onSuccess():(a.logger.warn(t.LogTagId.O,"setReadMessages ->code:".concat(c,",targetId:").concat(e,",channelId:").concat(a.channelId,",\n beginMessageUId:").concat(s,",endMessageUId:").concat(o)),n.onError(c))})).catch((function(r){a.logger.warn(t.LogTagId.O,"setReadMessages ->code:".concat(r,",targetId:").concat(e,",channelId:").concat(a.channelId,",\n beginMessageUId:").concat(s,",endMessageUId:").concat(o)),n.onError(r)}))},e.prototype.getMessageReceiptInfo=function(e,s,o){var n=this;t.assert("messageUId",e,t.AssertRules.STRING,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"getMessageReceiptInfo ->targetId:".concat(s,",messageUId:").concat(e)),this._context.getMessageReceiptInfo(s,e,this.channelId).then((function(a){var r=a.code,c=a.data;r===t.ErrorCode.SUCCESS?o.onSuccess(c):(n.logger.warn(t.LogTagId.O,"getMessageReceiptInfo ->code:".concat(r,",targetId:").concat(s,",messageUId:").concat(e)),o.onError(r))})).catch((function(a){n.logger.warn(t.LogTagId.O,"getMessageReceiptInfo ->code:".concat(a,",targetId:").concat(s,",messageUId:").concat(e)),o.onError(a)}))},e.prototype.updateMessageExpansion=function(e,s,o){var n=this;t.assert("expansion",e,t.AssertRules.OBJECT,!0),t.assert("message",s,t.AssertRules.OBJECT,!0);var a=s.conversationType,r=s.targetId,c=s.messageUId,i=s.canIncludeExpansion,g=s.expansion;this.logger.info(t.LogTagId.O,"updateMessageExpansion ->targetId:".concat(r,",messageUId:").concat(c,",conversationType:").concat(a)),this._context.sendExpansionMessage({conversationType:a,targetId:r,messageUId:c,canIncludeExpansion:i,originExpansion:g,expansion:e,channelId:this.channelId}).then((function(e){var s=e.code;s===t.ErrorCode.SUCCESS?V(o.onSuccess):(n.logger.warn(t.LogTagId.O,"updateMessageExpansion ->code:".concat(s,",targetId:").concat(r,",messageUId:").concat(c)),W(o.onError,s))}))},e.prototype.removeMessageExpansionForKey=function(e,s,o){var n=this;t.assert("keys",e,t.AssertRules.ARRAY,!0),t.assert("message",s,t.AssertRules.OBJECT,!0);var a=s.conversationType,r=s.targetId,c=s.messageUId,i=s.canIncludeExpansion;this.logger.info(t.LogTagId.O,"removeMessageExpansionForKey ->targetId:".concat(r,",messageUId:").concat(c,",conversationType:").concat(a)),this._context.sendExpansionMessage({conversationType:a,targetId:r,messageUId:c,canIncludeExpansion:i,keys:e,channelId:this.channelId}).then((function(e){var s=e.code;s===t.ErrorCode.SUCCESS?V(o.onSuccess):(n.logger.warn(t.LogTagId.O,"removeMessageExpansionForKey ->code:".concat(s,",targetId:").concat(r,",messageUId:").concat(c)),W(o.onError,s))}))},e.prototype.getHistoryMessages=function(e,s,o,n,a,r,c){var i=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("callback",a,t.AssertRules.CALLBACK,!0),t.assert("order",c,t.AssertRules.NUMBER),this.logger.info(t.LogTagId.O,"getHistoryMessages ->targetId:".concat(s,",conversationType:").concat(e,",timestamp:").concat(o));var g=this.logger.createTraceId();this.logger.info(t.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:s,conversationType:e,channelId:"",timestamp:o,count:n}),g),this._context.getHistoryMessage(e,s,o,n,c,this.channelId,r,g).then((function(e){var s=e.code,o=e.data;if(s===t.ErrorCode.SUCCESS)if(o){var n=o.list,r=o.hasMore,c=[],d=n.map((function(e){return c.push(e.messageUId),H(e)}));i.logger.info(t.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:c.join(",")}),g),V(a.onSuccess,d,r)}else i.logger.info(t.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),g),V(a.onSuccess,[],!1);else i.logger.warn(t.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),g),W(a.onError,s)}))},e.prototype.deleteRemoteMessages=function(e,s,o,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("messages",o,t.AssertRules.ARRAY,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"deleteRemoteMessages ->targetId:".concat(s,",conversationType:").concat(e)),this._context.deleteRemoteMessage(e,s,o,this.channelId).then((function(r){if(r===t.ErrorCode.SUCCESS){if(!a._isCPPMode){var c=G.get(e,s,a.channelId);c&&o.forEach((function(t){c.messageUId===t.messageUId&&G.remove(e,s,a.channelId)}))}V(n.onSuccess)}else a.logger.warn(t.LogTagId.O,"deleteRemoteMessages ->code:".concat(r,",targetId:").concat(s)),W(n.onError,r)}))},e.prototype.clearRemoteHistoryMessages=function(e,s){var o=this;t.assert("param.conversationType",e.conversationType,t.AssertRules.NUMBER,!0),t.assert("param.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("param.timestamp",e.timestamp,t.AssertRules.NUMBER,!0),t.assert("callback",s,t.AssertRules.CALLBACK);var n=e.conversationType,a=e.targetId,r=e.timestamp;this.logger.info(t.LogTagId.O,"clearRemoteHistoryMessages ->targetId:".concat(a,",conversationType:").concat(n)),this._context.deleteRemoteMessageByTimestamp(n,a,r,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?V(s.onSuccess):(o.logger.warn(t.LogTagId.O,"clearRemoteHistoryMessages ->code:".concat(e)),W(s.onError,e))}))},e.prototype.getConversationListWithAllChannel=function(e){t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getConversationListWithAllChannel().then((function(s){var o=s.code,n=s.data;o===t.ErrorCode.SUCCESS?V(e.onSuccess,n.map(F)):W(e.onError,o)}))},e.prototype.getConversationListWithAllChannelByPage=function(e,s,o){t.assert("callback",e,t.AssertRules.CALLBACK),t.assert("index",s,t.AssertRules.NUMBER),t.assert("limit",o,t.AssertRules.NUMBER),this._context.getConversationListWithAllChannelByPage(s,o).then((function(s){var o=s.code,n=s.data;o===t.ErrorCode.SUCCESS?V(e.onSuccess,n.map(F)):W(e.onError,o)}))},e.prototype.insertMessage=function(e,s,o,n,a){var r=this;void 0===a&&(a={});var c=o.senderUserId,i=o.objectName,g=o.content,d=o.messageDirection;o.messageUId;var u=o.canIncludeExpansion,l=o.expansion,h=o.disableNotification,C=o.sentTime,p=o.sentStatus;this.logger.info(t.LogTagId.O,"insertMessage ->targetId:".concat(s,",conversationType:").concat(e));var f=a.isUnread,I={senderUserId:c,messageType:i,content:g,messageDirection:d,sentTime:C,sentStatus:p,searchContent:a.searchContent,isUnread:f,messageUId:"",disableNotification:h,canIncludeExpansion:u,expansionMsg:JSON.stringify(l),channelId:this.channelId};this._context.insertMessage(e,s,I).then((function(e){var o=e.code,a=e.data;o===t.ErrorCode.SUCCESS?V(n.onSuccess,H(a)):(r.logger.warn(t.LogTagId.O,"insertMessage ->code:".concat(o,",targetId:").concat(s)),W(n.onError,o))}))},e.prototype.batchInsertMessage=function(e,s,o){this._context.batchInsertMessage(e,s).then((function(e){var s=e.code,n=e.data;s===t.ErrorCode.SUCCESS?V(o.onSuccess,n):W(o.onError,s)}))},e.prototype.getMessageCount=function(e,s,o){this._context.getMessageCount(e,s).then((function(e){var s=e.code,n=e.data;s===t.ErrorCode.SUCCESS?V(o.onSuccess,n):W(o.onError,s)}))},e.prototype.deleteLocalMessagesByTimestamp=function(e,s,o,n,a){var r=this;this.logger.info(t.LogTagId.O,"deleteLocalMessagesByTimestamp ->targetId:".concat(s,",conversationType:").concat(e,",timestamp:").concat(o)),this._context.deleteMessagesByTimestamp(e,s,o,n,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?V(a.onSuccess,!0):(r.logger.warn(t.LogTagId.O,"deleteLocalMessagesByTimestamp ->code:".concat(e,",targetId:").concat(s)),W(a.onError,e))}))},e.prototype.getRemoteHistoryMessages=function(e,s,o,n,a,r){var c=this;this.logger.info(t.LogTagId.O,"getRemoteHistoryMessages ->targetId:".concat(s,",conversationType:").concat(e));var i=r.order||0;this._context.getRemoteHistoryMessages(e,s,o,n,i,this.channelId).then((function(e){var o=e.code,n=e.data;if(o===t.ErrorCode.SUCCESS)if(n){var r=n.list,i=n.hasMore,g=r.map((function(e){return H(e)}));V(a.onSuccess,g,i)}else V(a.onSuccess,[],!1);else c.logger.warn(t.LogTagId.O,"getRemoteHistoryMessages ->code:".concat(o,",targetId:").concat(s)),W(a.onError,o)}))},e.prototype.clearMessages=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"clearMessages ->targetId:".concat(s,",conversationType:").concat(e)),this._context.clearMessages(e,s,this.channelId).then((function(a){a===t.ErrorCode.SUCCESS?(n._isCPPMode||G.remove(e,s,n.channelId),V(o.onSuccess,!0)):(n.logger.warn(t.LogTagId.O,"clearMessages ->code:".concat(a,",targetId:").concat(s)),W(o.onError,a))}))},e.prototype.searchConversationByContent=function(e,s,o,n){var a=this;this.logger.info(t.LogTagId.O,"searchConversationByContent ->keyword:".concat(e)),this._context.searchConversationByContent(e,n,this.channelId,o).then((function(o){var n=o.code,r=o.data,c=[];r=r||[],n===t.ErrorCode.SUCCESS?(r.forEach((function(e){c.push(F(e))})),V(s.onSuccess,c)):(a.logger.warn(t.LogTagId.O,"searchConversationByContent ->code:".concat(n,",keyword:").concat(e)),W(s.onError,n))}))},e.prototype.searchConversationByContentWithAllChannel=function(e,s,o,n){var a=this;void 0===o&&(o=[]),this.logger.info(t.LogTagId.O,"searchConversationByContentWithAllChannel ->keyword:".concat(e)),this._context.searchConversationByContentWithAllChannel(e,o,n).then((function(o){var n=o.code,r=o.data,c=[];r=r||[],n===t.ErrorCode.SUCCESS?(r.forEach((function(e){c.push(F(e))})),V(s.onSuccess,c)):(a.logger.warn(t.LogTagId.O,"searchConversationByContentWithAllChannel ->code:".concat(n,",keyword:").concat(e)),W(s.onError,n))}))},e.prototype.searchMessageByContent=function(e,s,o,n,a,r,c){var i=this;this.logger.info(t.LogTagId.O,"searchMessageByContent ->targetId:".concat(s,",conversationType:").concat(e,",keyword:").concat(o)),this._context.searchMessageByContent(e,s,o,n,a,r,this.channelId).then((function(e){var o=e.code,n=e.data,a=[];if(o===t.ErrorCode.SUCCESS){var r=n=n||{},g=r.messages,d=r.count;g.forEach((function(e){a.push(H(e))})),V(c.onSuccess,a,d)}else i.logger.warn(t.LogTagId.O,"searchMessageByContent ->code:".concat(o,",targetId:").concat(s)),W(c.onError,o)}))},e.prototype.searchMessageByContentWithAllChannel=function(e,s,o,n,a,r){var c=this;this.logger.info(t.LogTagId.O,"searchMessageByContentWithAllChannel ->targetId: ".concat(s," ,conversationType: ").concat(e," ,keyword: ").concat(o,", timestamp: ").concat(n,", count: ").concat(a)),this._context.searchMessageByContentWithAllChannel(e,s,o,n,a).then((function(e){var o=e.code,n=e.data,a=[];if(o===t.ErrorCode.SUCCESS){var i=n=n||{},g=i.messages,d=i.count;g.forEach((function(e){a.push(H(e))})),V(r.onSuccess,a,d)}else c.logger.warn(t.LogTagId.O,"searchMessageByContentWithAllChannel ->code:".concat(o,",targetId:").concat(s)),W(r.onError,o)}))},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,s,o,n,a,r,c,i){var g=this;this.logger.info(t.LogTagId.O,"searchMessageByContentInTimeRangeWithAllChannel ->targetId: ".concat(s," ,conversationType: ").concat(e," ,keyword: ").concat(o,", startTime: ").concat(n,", endTime: ").concat(a,", offset: ").concat(r,", limit: ").concat(c)),this._context.searchMessageByContentInTimeRangeWithAllChannel(e,s,o,n,a,r,c).then((function(e){var o=e.code,n=e.data,a=[];o===t.ErrorCode.SUCCESS?((n=n||{}).messages.forEach((function(e){a.push(H(e))})),V(i.onSuccess,a)):(g.logger.warn(t.LogTagId.O,"searchMessageByContentInTimeRangeWithAllChannel ->code:".concat(o,",targetId:").concat(s)),W(i.onError,o))}))},e.prototype.getUnreadMentionedMessages=function(e,s){return this.logger.info(t.LogTagId.O,"getUnreadMentionedMessages ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getUnreadMentionedMessages(e,s,this.channelId).map((function(e){return H(e)}))},e.prototype.clearUnreadCountByTimestamp=function(e,s,o,n){var a=this;this.logger.info(t.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(s,",conversationType:").concat(e)),this._context.clearUnreadCountByTimestamp(e,s,o,this.channelId).then((function(e){e===t.ErrorCode.SUCCESS?V(n.onSuccess,!0):(a.logger.warn(t.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(e,",targetId:").concat(s)),W(n.onError,e))}))},e.prototype.getConversationNotificationStatus=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(s,",conversationType:").concat(e)),this._context.getConversationNotificationStatus(e,s,this.channelId).then((function(e){var a=e.code,r=e.data;a===t.ErrorCode.SUCCESS?V(o.onSuccess,r):(n.logger.warn(t.LogTagId.O,"getConversationNotificationStatus ->code:".concat(a,",targetId:").concat(s)),W(o.onError,a))}))},e.prototype.getGroupMessageDeliverList=function(e,s,o){var n=this;this.logger.info(t.LogTagId.O,"getGroupMessageDeliverList ->targetId:".concat(e,"',messageUId:").concat(s)),this._context.getGroupMessageDeliverList(e,s,this.channelId).then((function(e){var a=e.code,r=e.data;a===t.ErrorCode.SUCCESS?V(o.onSuccess,r):(n.logger.warn(t.LogTagId.O,"getGroupMessageDeliverList ->code:".concat(a,",messageUId:").concat(s)),W(o.onError,a))}))},e.prototype.getPrivateMessageDeliverTime=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"getPrivateMessageDeliverTime -> messageUId:".concat(e)),this._context.getPrivateMessageDeliverTime(e,this.channelId).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?V(s.onSuccess,r):(o.logger.warn(t.LogTagId.O,"getPrivateMessageDeliverTime ->code:".concat(a,",messageUId:").concat(e)),W(s.onError,a))}))},e}(),$=function(e){return{targetId:e.targetId,channelId:e.channelId,conversationType:e.type}},Z=function(){function e(e,s,o,n){this._context=e,this._options=s,this.logger=o,this._storage=n,this._channelClient={},this._isCPPMode=t.usingCppEngine(),this._defaultChannelClient=new z(this.logger,e,"",this._isCPPMode,s.readReceiptTimeout,this._storage)}return e.prototype.assertCPPMode=function(e,s,o){if(!this._isCPPMode)return null==o||o.onError(t.ErrorCode.NOT_SUPPORT),void this.logger.error(t.LogTagId.O,"'".concat(s,"' is unusable!"));e()},e.prototype.install=function(e,t){return this._context.install(e,t)},e.prototype.getChannel=function(e){if(this.logger.info(t.LogTagId.O,"getChannel ->channelId:".concat(e)),!this._isCPPMode)return this.logger.error(t.LogTagId.O,"getChannel method is only available in protocol stack mode"),null;if(t.assert("channelId",e,t.AssertRules.STRING,!0),e.length>20)return this.logger.error(t.LogTagId.O,"The channelId cannot exceed 20 characters"),null;if(e in this._channelClient)return this._channelClient[e];if(Object.keys(this._channelClient).length>1e3)return this.logger.error(t.LogTagId.O,"Only 1000 channels can be obtained"),null;var s=new z(this.logger,this._context,e,this._isCPPMode,this._options.readReceiptTimeout,this._storage);return this._channelClient[e]=s,s},e.prototype.deleteChannels=function(e){var s=this;t.assert("channelIds",e,t.AssertRules.ARRAY,!0),this.logger.info(t.LogTagId.O,"deleteChannels ->channelIds:".concat(e)),this.assertCPPMode((function(){e.forEach((function(e){delete s._channelClient[e]}))}),"deleteChannels")},e.prototype.getNavi=function(){return this._context.getNaviInfoFromCache()||{}},e.prototype.getSDKInfo=function(){return{version:"5.7.3-beem.1"}},e.prototype.getAppInfo=function(){return{appKey:this._context.appkey}},e.prototype.getCurrentUserId=function(){return this._context.getCurrentUserId()},e.prototype.disconnect=function(e){return r(this,void 0,void 0,(function(){return c(this,(function(s){switch(s.label){case 0:return this.logger.info(t.LogTagId.A_DISCONNECT_O),[4,this._context.disconnect(e)];case 1:return s.sent(),[2]}}))}))},e.prototype.logout=function(){return this.disconnect()},e.prototype.clearCache=function(){},e.prototype.getDeviceId=function(){return this._context.getDeviceId()},e.prototype.getConversationList=function(e,t,s){this._defaultChannelClient.getConversationList(e,t,s)},e.prototype.getConversationListWithAllChannel=function(e){this._defaultChannelClient.getConversationListWithAllChannel(e)},e.prototype.getConversationListWithAllChannelByPage=function(e,t,s){void 0===s&&(s=30),this._defaultChannelClient.getConversationListWithAllChannelByPage(e,t,s)},e.prototype.getConversation=function(e,t,s){return this._defaultChannelClient.getConversation(e,t,s)},e.prototype.removeConversation=function(e,t,s){return this._defaultChannelClient.removeConversation(e,t,s)},e.prototype.saveTextMessageDraft=function(e,t,s){return this._defaultChannelClient.saveTextMessageDraft(e,t,s)},e.prototype.getTextMessageDraft=function(e,t){return this._defaultChannelClient.getTextMessageDraft(e,t)},e.prototype.clearTextMessageDraft=function(e,t){return this._defaultChannelClient.clearTextMessageDraft(e,t)},e.prototype.getTotalUnreadCount=function(e,t,s){return this._defaultChannelClient.getTotalUnreadCount(e,t,s)},e.prototype.getUnreadCount=function(e,t,s){return this._defaultChannelClient.getUnreadCount(e,t,s)},e.prototype.getConversationUnreadCount=function(e,s){this.logger.error(t.LogTagId.O,"Method is deprecated")},e.prototype.clearConversations=function(e,t){return this._defaultChannelClient.clearConversations(e,t)},e.prototype.clearUnreadCount=function(e,t,s){this._defaultChannelClient.clearUnreadCount(e,t,s)},e.prototype.clearAllUnreadCount=function(e){this._defaultChannelClient.clearAllUnreadCount(e)},e.prototype.setConversationStatus=function(e,t,s,o){return this._defaultChannelClient.setConversationStatus(e,t,s,o)},e.prototype.setConversationsMuteStatus=function(e){return this._defaultChannelClient.setConversationsMuteStatus(e)},e.prototype.setConversationsTopStatus=function(e){return this._defaultChannelClient.setConversationsTopStatus(e)},e.prototype.sendMessage=function(e,t,s,o,n,a,r,c,i){return this._defaultChannelClient.sendMessage(e,t,s,o,n,a,r,i)},e.prototype.sendRecallMessage=function(e,t,s){return this._defaultChannelClient.sendRecallMessage(e,t,s)},e.prototype.sendTypingStatusMessage=function(e,t,s,o){return this._defaultChannelClient.sendTypingStatusMessage(e,t,s,o)},e.prototype.sendReceiptResponse=function(e,t,s){return this._defaultChannelClient.sendReceiptResponse(e,t,s)},e.prototype.sendReadReceiptMessage=function(e,t,s){return this._defaultChannelClient.sendReadReceiptMessage(e,t,s)},e.prototype.getMessageReader=function(e,t,s){this._defaultChannelClient.getMessageReader(e,t,s)},e.prototype.setGroupVoiceMessagePlayed=function(e,t,s){this._defaultChannelClient.setGroupVoiceMessagePlayed(e,t,s)},e.prototype.getGroupVoiceMessageReader=function(e,t,s){this._defaultChannelClient.getGroupVoiceMessageReader(e,t,s)},e.prototype.getMessageReceiptInfo=function(e,t,s){this._defaultChannelClient.getMessageReceiptInfo(e,t,s)},e.prototype.setReadMessages=function(e,t,s,o){this._defaultChannelClient.setReadMessages(e,t,s,o)},e.prototype.updateMessageExpansion=function(e,t,s){this._defaultChannelClient.updateMessageExpansion(e,t,s)},e.prototype.removeMessageExpansionForKey=function(e,t,s){this._defaultChannelClient.removeMessageExpansionForKey(e,t,s)},e.prototype.getHistoryMessages=function(e,t,s,o,n,a,r){return this._defaultChannelClient.getHistoryMessages(e,t,s,o,n,a,r)},e.prototype.joinChatRoom=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"joinChatRoom ->chatRoomId:".concat(e));var a=this.logger.createTraceId();this.logger.info(t.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:s,joinExist:!1}),a),this._context.joinChatroom(e,s,a).then((function(s){var r=s===t.ErrorCode.SUCCESS?"info":"warn";n.logger[r](t.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),a),s===t.ErrorCode.SUCCESS?V(o.onSuccess):(n.logger.warn(t.LogTagId.O,"joinChatRoom ->code:".concat(s,",chatRoomId:").concat(e)),W(o.onError,s))}))},e.prototype.quitChatRoom=function(e,s){var o=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"quitChatRoom ->chatRoomId:".concat(e));var n=this.logger.createTraceId();this.logger.info(t.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),n),this._context.quitChatroom(e).then((function(a){var r=a===t.ErrorCode.SUCCESS?"info":"warn";o.logger[r](t.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:a}),n),a===t.ErrorCode.SUCCESS?V(s.onSuccess):(o.logger.warn(t.LogTagId.O,"quitChatRoom ->code:".concat(a,",chatRoomId:").concat(e)),W(s.onError,a))}))},e.prototype.getChatRoomInfo=function(e,s,o,n){var a=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("order",o,t.AssertRules.NUMBER,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getChatRoomInfo ->chatRoomId:".concat(e)),this._context.getChatroomInfo(e,s,o).then((function(s){var o=s.code,r=s.data;o===t.ErrorCode.SUCCESS?V(n.onSuccess,{userInfos:(null==r?void 0:r.userInfos)||[],userTotalNums:(null==r?void 0:r.userCount)||0}):(a.logger.warn(t.LogTagId.O,"getChatRoomInfo ->code:".concat(o,",chatRoomId:").concat(e)),W(n.onError,o))}))},e.prototype.setChatroomEntry=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"setChatroomEntry ->chatRoomId:".concat(e)),this._context.setChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?V(o.onSuccess):(n.logger.warn(t.LogTagId.O,"setChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),W(o.onError,s))}))},e.prototype.setChatRoomEntries=function(e,s,o){var n=this;if(t.assert("chatRoomId",e,t.AssertRules.STRING,!0),function(e){e.entries.forEach((function(e){t.assert("entry.key",e.key,t.AssertRules.STRING,!0),t.assert("entry.value",e.value,t.AssertRules.STRING,!0)})),t.assert("options.isAutoDelete",e.isAutoDelete,t.AssertRules.BOOLEAN)}(s),t.assert("callback",o,t.AssertRules.CALLBACK),s.entries.length>10)W(o.onError,t.ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT);else{var a="id:".concat(e);this.logger.info(t.LogTagId.O,"set chatroom entry->".concat(a)),this._context.setChatroomEntries(e,s).then((function(e){var s=e.code,r=e.data;s===t.ErrorCode.SUCCESS?V(o.onSuccess):(n.logger.warn(t.LogTagId.O,"set chatroom entry fail ->code+:".concat(s,",").concat(a)),W(o.onError,s,r))}))}},e.prototype.forceSetChatroomEntry=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"forceSetChatroomEntry ->chatRoomId:".concat(e)),this._context.forceSetChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?V(o.onSuccess):(n.logger.warn(t.LogTagId.O,"forceSetChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),W(o.onError,s))}))},e.prototype.removeChatroomEntry=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeChatroomEntry ->chatRoomId:".concat(e)),this._context.removeChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?V(o.onSuccess):(n.logger.warn(t.LogTagId.O,"removeChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),W(o.onError,s))}))},e.prototype.removeChatRoomEntries=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),function(e){e.entries.forEach((function(e){t.assert("key",e,t.AssertRules.STRING,!0)}))}(s);var r="id:".concat(e);this.logger.debug(t.LogTagId.O,"remove chatroom entry->".concat(r));var c=a({},s);c.entries=s.entries.map((function(e){return{key:e}})),this._context.removeChatroomEntries(e,c).then((function(e){var s=e.code,a=e.data;s===t.ErrorCode.SUCCESS?V(o.onSuccess):(n.logger.warn(t.LogTagId.O,"remove chatroom entry fail ->code+:".concat(s,",").concat(r)),W(o.onError,s,a))}))},e.prototype.forceRemoveChatroomEntry=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("chatroomEntry",s,t.AssertRules.OBJECT,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"forceRemoveChatroomEntry ->chatRoomId:".concat(e)),this._context.forceRemoveChatroomEntry(e,s).then((function(s){s===t.ErrorCode.SUCCESS?V(o.onSuccess):(n.logger.warn(t.LogTagId.O,"forceRemoveChatroomEntry ->code:".concat(s,",chatRoomId:").concat(e)),W(o.onError,s))}))},e.prototype.getChatroomEntry=function(e,s,o){var n=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("key",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getChatroomEntry ->chatRoomId:".concat(e,",key:").concat(s)),this._context.getChatroomEntry(e,s).then((function(s){var a=s.code,r=s.data;a===t.ErrorCode.SUCCESS?V(o.onSuccess,r||""):(n.logger.warn(t.LogTagId.O,"getChatroomEntry ->code:".concat(a,",chatRoomId:").concat(e)),W(o.onError,a))}))},e.prototype.getAllChatroomEntries=function(e,s){var o=this;t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getAllChatroomEntries ->chatRoomId:".concat(e)),this._context.getAllChatroomEntries(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?V(s.onSuccess,r):(o.logger.warn(t.LogTagId.O,"getAllChatroomEntries ->code:".concat(a,",chatRoomId:").concat(e)),W(s.onError,a))}))},e.prototype.getChatRoomHistoryMessages=function(e,s,o,n,a){var r=this;void 0===a&&(a=0),t.assert("chatRoomId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("order",o,t.AssertRules.NUMBER,!0),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("timestamp",a,t.AssertRules.NUMBER),this.logger.info(t.LogTagId.O,"getChatRoomHistoryMessages ->chatRoomId:".concat(e)),this._context.getChatRoomHistoryMessages(e,s,o,a).then((function(s){var o=s.code,a=s.data;if(o===t.ErrorCode.SUCCESS)if(a){var c=a.list,i=a.hasMore,g=c.map((function(e){return H(e)}));V(n.onSuccess,g,i)}else V(n.onSuccess,[],!1);else r.logger.warn(t.LogTagId.O,"getChatRoomHistoryMessages ->code:".concat(o,",chatRoomId:").concat(e)),W(n.onError,o)}))},e.prototype.setDeviceInfo=function(e){},e.prototype.getCurrentConnectionStatus=function(){return this._context.getConnectionStatus()},e.prototype.deleteRemoteMessages=function(e,t,s,o){return this._defaultChannelClient.deleteRemoteMessages(e,t,s,o)},e.prototype.clearRemoteHistoryMessages=function(e,t){return this._defaultChannelClient.clearRemoteHistoryMessages(e,t)},e.prototype.getFileToken=function(e,s,o,n,a){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",o,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getFileToken ->fileType:".concat(e,",fileName:").concat(o,",queryString:").concat(a)),this._context.getFileToken(e,o,n,a).then(s.onSuccess).catch(s.onError)},e.prototype.getFileUrl=function(e,s,o,n,a,r){t.assert("fileType",e,t.AssertRules.NUMBER,!0),t.assert("fileName",s,t.AssertRules.STRING,!0),t.assert("saveName",o,t.AssertRules.STRING),t.assert("callback",n,t.AssertRules.CALLBACK),t.assert("serverType",r,t.AssertRules.NUMBER),t.assert("uploadRes",a,t.AssertRules.OBJECT),this.logger.info(t.LogTagId.O,"getFileUrl ->fileType:".concat(e,",fileName:").concat(s)),this._context.getFileUrl(e,s,o,a,r).then(n.onSuccess).catch(n.onError)},e.prototype.createTag=function(e,s){var o=this;t.assert("tag.tagId",e.tagId,t.AssertRules.STRING,!0),t.assert("tag.tagId",e.tagId,(function(e){return e.length<=10})),t.assert("tag.tagName",e.tagName,(function(e){return e.length<=15})),t.assert("tag.tagName",e.tagName,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.createTag(e).then((function(n){var a=n.code;a===t.ErrorCode.SUCCESS?s.onSuccess():(o.logger.warn(t.LogTagId.O,"createTag ->code:".concat(a,",tagId:").concat(e.tagId)),s.onError(a))})).catch((function(n){o.logger.warn(t.LogTagId.O,"createTag ->code:".concat(n,",tagId:").concat(e.tagId)),s.onError(n)}))},e.prototype.removeTag=function(e,s){var o=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeTag ->tagId:".concat(e)),this._context.removeTag(e).then((function(n){var a=n.code;a===t.ErrorCode.SUCCESS?s.onSuccess():(o.logger.warn(t.LogTagId.O,"removeTag ->code:".concat(a,",tagId:").concat(e)),s.onError(a))})).catch((function(n){o.logger.warn(t.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(e)),s.onError(n)}))},e.prototype.updateTag=function(e,s){var o=this;t.assert("tag.tagId",e.tagId,t.AssertRules.STRING,!0),t.assert("tag.tagName",e.tagName,t.AssertRules.STRING,!0),t.assert("tag.tagName",e.tagName,(function(e){return e.length<=15})),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),this._context.updateTag(e).then((function(n){var a=n.code;a===t.ErrorCode.SUCCESS?s.onSuccess():(o.logger.warn(t.LogTagId.O,"updateTag ->code:".concat(a,",tagId:").concat(e.tagId)),s.onError(a))})).catch((function(n){o.logger.warn(t.LogTagId.O,"updateTag ->reason:".concat(n,",tagId:").concat(e.tagId)),s.onError(n)}))},e.prototype.getTagList=function(e){var s=this;t.assert("callback",e,t.AssertRules.CALLBACK),this._context.getTagList().then((function(o){var n=o.code,a=o.data;n===t.ErrorCode.SUCCESS?e.onSuccess(a||[]):(s.logger.warn(t.LogTagId.O,"getTagList ->code:".concat(n)),e.onError(n))})).catch((function(o){s.logger.warn(t.LogTagId.O,"getTagList ->reason:".concat(o)),e.onError(o)}))},e.prototype.getTagsForConversation=function(e,s){var o=this;t.assert("conversationType",e.type,t.AssertRules.NUMBER),t.assert("targetId",e.targetId,t.AssertRules.STRING),t.assert("channelId",e.channelId,t.AssertRules.ONLY_STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.type)),this._context.getTagsForConversation($(e)).then((function(e){var n=e.code,a=e.data;n===t.ErrorCode.SUCCESS?s.onSuccess(a||[]):(o.logger.warn(t.LogTagId.O,"getTagsForConversation ->code:".concat(n)),s.onError(n))})).catch((function(e){o.logger.warn(t.LogTagId.O,"getTagsForConversation ->reason:".concat(e)),s.onError(e)}))},e.prototype.addTagForConversations=function(e,s,o){var n=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",s,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),s.forEach((function(e){t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING)})),this.logger.info(t.LogTagId.O,"addTagForConversations ->tagId:".concat(e)),this._context.addTagForConversations(e,s.map((function(e){return $(e)}))).then((function(s){var a=s.code;s.data,a===t.ErrorCode.SUCCESS?o.onSuccess():(n.logger.warn(t.LogTagId.O,"addTagForConversations ->code:".concat(a,",tagId:").concat(e)),o.onError(a))})).catch((function(s){n.logger.warn(t.LogTagId.O,"addTagForConversations ->reason:".concat(s,",tagId:").concat(e)),o.onError(s)}))},e.prototype.removeTagForConversations=function(e,s,o){var n=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversations",s,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),s.forEach((function(e){t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING)})),this.logger.info(t.LogTagId.O,"removeTagForConversations ->tagId:".concat(e)),this._context.removeTagForConversations(e,s.map((function(e){return $(e)}))).then((function(s){var a=s.code;s.data,a===t.ErrorCode.SUCCESS?o.onSuccess():(n.logger.warn(t.LogTagId.O,"removeTagForConversations ->code:".concat(a,",tagId:").concat(e)),o.onError(a))})).catch((function(s){n.logger.warn(t.LogTagId.O,"removeTagForConversations ->reason:".concat(s,",tagId:").concat(e)),o.onError(s)}))},e.prototype.removeTagsForConversation=function(e,s,o){var n=this;t.assert("conversation.type",e.type,t.AssertRules.NUMBER,!0),t.assert("conversation.targetId",e.targetId,t.AssertRules.STRING,!0),t.assert("conversation.channelId",e.channelId,t.AssertRules.ONLY_STRING),t.assert("tagIds",s,t.AssertRules.ARRAY,!0),t.assert("callback",o,t.AssertRules.CALLBACK),s.forEach((function(e){t.assert("tagId",e,t.AssertRules.STRING,!0)})),this.logger.info(t.LogTagId.O,"removeTagsForConversation ->tagIds:".concat(s,",targetId:").concat(e.targetId,",type:").concat(e.type)),this._context.removeTagsForConversation($(e),s).then((function(e){var a=e.code;e.data,a===t.ErrorCode.SUCCESS?o.onSuccess():(n.logger.warn(t.LogTagId.O,"removeTagsForConversation ->code:".concat(a,",tagIds:").concat(s)),o.onError(a))})).catch((function(e){n.logger.warn(t.LogTagId.O,"removeTagsForConversation ->reason:".concat(e,",tagIds:").concat(s)),o.onError(e)}))},e.prototype.getConversationListByTag=function(e,s,o,n){var a=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("count",s,t.AssertRules.NUMBER,!0),t.assert("startTime",o,t.AssertRules.NUMBER,!0),t.assert("callback",n,t.AssertRules.CALLBACK,!0),this.logger.info(t.LogTagId.O,"getConversationListByTag ->tagId:".concat(e)),this._context.getConversationListByTag(e,o,s).then((function(s){var o=s.code,r=s.data,c=[];o===t.ErrorCode.SUCCESS?((r=r||[]).forEach((function(e){c.push(function(e){var t=e.channelId,s=e.conversationType,o=e.targetId,n=e.unreadMessageCount,a=e.latestMessage,r=e.isTop,c=e.notificationStatus,i=e.isTopInTag,g=a?H(a):null,d=g||{};return d.messageType,d.sentTime,d.receivedStatus,d.messageId,{channelId:t||"",conversationType:s,targetId:o,unreadMessageCount:n,latestMessage:g,isTopInTag:i,latestMessageId:null==g?void 0:g.messageId,objectName:null==g?void 0:g.messageType,sentTime:null==g?void 0:g.sentTime,isTop:r,notificationStatus:c,receivedStatus:null==g?void 0:g.receivedStatus}}(e))})),n.onSuccess(c)):(a.logger.warn(t.LogTagId.O,"getConversationListByTag ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(s){a.logger.warn(t.LogTagId.O,"getConversationListByTag ->reason:".concat(s,",tagId:").concat(e)),n.onError(s)}))},e.prototype.getUnreadCountByTag=function(e,s,o){var n=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("containMuted",s,t.AssertRules.BOOLEAN,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(e)),this._context.getUnreadCountByTag(e,s).then((function(s){var a=s.code,r=s.data;n.logger.info(t.LogTagId.O,JSON.stringify({code:a,data:r})),a===t.ErrorCode.SUCCESS?o.onSuccess(r||0):(n.logger.warn(t.LogTagId.O,"getUnreadCountByTag ->code:".concat(a,",tagId:").concat(e)),o.onError(a))})).catch((function(s){n.logger.warn(t.LogTagId.O,"getUnreadCountByTag ->reason:".concat(s,",tagId:").concat(e)),o.onError(s)}))},e.prototype.setConversationStatusInTag=function(e,s,o,n){var a=this;t.assert("tagId",e,t.AssertRules.STRING,!0),t.assert("conversation.targetId",s.targetId,t.AssertRules.STRING,!0),t.assert("conversation.type",s.type,t.AssertRules.NUMBER,!0),t.assert("conversation.channelId",s.channelId,t.AssertRules.ONLY_STRING),t.assert("status.isTop",null==o?void 0:o.isTop,t.AssertRules.BOOLEAN,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(s.targetId,",type").concat(s.type)),this._context.setConversationStatusInTag(e,$(s),o).then((function(s){var o=s.code;s.data,o===t.ErrorCode.SUCCESS?n.onSuccess():(a.logger.warn(t.LogTagId.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),n.onError(o))})).catch((function(s){a.logger.warn(t.LogTagId.O,"setConversationStatusInTag ->reason:".concat(s,",tagId:").concat(e)),n.onError(s)}))},e.prototype.callExtra=function(e,s){for(var o,n=this,a=[],r=2;r<arguments.length;r++)a[r-2]=arguments[r];this.logger.info(t.LogTagId.O,"callExtra ->method:".concat(e)),(o=this._context).callExtra.apply(o,i([e],a,!1)).then((function(o){var a=o.code,r=o.data;if(a!==t.ErrorCode.SUCCESS)n.logger.warn(t.LogTagId.O,"callExtra ->code:".concat(a)),s.onError&&W(s.onError,a);else{if("getConversationsByPage"===e&&r.forEach((function(e){e.latestMessage=e.latestMessage?H(e.latestMessage):null})),"getHistoryMessagesByObjectNames"===e){var c=r,i=c.list,g=c.hasMore,d=i.map((function(e){return H(e)}));return void V(s.onSuccess,d,g)}s.onSuccess&&V(s.onSuccess,r)}}))},e.prototype.hasRemoteUnreadMessages=function(e,s){t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"hasRemoteUnreadMessages ->token:".concat(e)),this.assertCPPMode((function(){V(s.onSuccess,!1)}),"hasRemoteUnreadMessages",s)},e.prototype.setUserStatusListener=function(e,s){var o=this;this.logger.info(t.LogTagId.O,"setUserStatusListener ->userIds:".concat(e.userIds)),this.assertCPPMode((function(){o._context.setUserStatusListener(e,s)}),"setUserStatusListener")},e.prototype.setUserStatus=function(e,s){var o=this;t.assert("status",e,t.AssertRules.NUMBER),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"setUserStatus ->status:".concat(e)),this.assertCPPMode((function(){o._context.setUserStatus(e).then((function(e){e===t.ErrorCode.SUCCESS?V(s.onSuccess,!0):(o.logger.warn(t.LogTagId.O,"setUserStatus ->code:".concat(e)),W(s.onError,e))}))}),"setUserStatus",s)},e.prototype.getUserStatus=function(e,s){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getUserStatus ->userId:".concat(e)),this.assertCPPMode((function(){o._context.getUserStatus(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?V(s.onSuccess,r):(o.logger.warn(t.LogTagId.O,"getUserStatus ->code:".concat(a,",useerId:").concat(e)),W(s.onError,a))}))}),"getUserStatus",s)},e.prototype.addToBlacklist=function(e,s){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"addToBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){o._context.addToBlacklist(e).then((function(n){n===t.ErrorCode.SUCCESS?V(s.onSuccess):(o.logger.warn(t.LogTagId.O,"addToBlacklist ->code:".concat(n,",useerId:").concat(e)),W(s.onError,n))}))}),"addToBlacklist",s)},e.prototype.removeFromBlacklist=function(e,s){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"removeFromBlacklist ->userId:".concat(e)),this.assertCPPMode((function(){o._context.removeFromBlacklist(e).then((function(n){n===t.ErrorCode.SUCCESS?V(s.onSuccess):(o.logger.warn(t.LogTagId.O,"removeFromBlacklist ->code:".concat(n,",useerId:").concat(e)),W(s.onError,n))}))}),"removeFromBlacklist",s)},e.prototype.getBlacklist=function(e){var s=this;t.assert("callback",e,t.AssertRules.CALLBACK),this.assertCPPMode((function(){s._context.getBlacklist().then((function(o){var n=o.code,a=o.data;n===t.ErrorCode.SUCCESS?V(e.onSuccess,a):(s.logger.warn(t.LogTagId.O,"getBlacklist ->code:".concat(n)),W(e.onError,n))}))}),"getBlacklist",e)},e.prototype.getBlacklistStatus=function(e,s){var o=this;t.assert("userId",e,t.AssertRules.STRING),t.assert("callback",s,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"getBlacklistStatus ->userId:".concat(e)),this.assertCPPMode((function(){o._context.getBlacklistStatus(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?V(s.onSuccess,r):(o.logger.warn(t.LogTagId.O,"getBlacklistStatus ->code:".concat(a,",userId:").concat(e)),W(s.onError,a))}))}),"getBlacklistStatus",s)},e.prototype.insertMessage=function(e,s,o,n,a){var r=this;void 0===a&&(a={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("content.senderUserId",o.senderUserId,t.AssertRules.STRING,!0),t.assert("content.messageDirection",o.messageDirection,t.AssertRules.NUMBER,!0),t.assert("content.objectName",o.objectName,t.AssertRules.STRING,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"insertMessage ->targetId:".concat(s,",conversationType:").concat(e,",senderUserId:").concat(o.senderUserId)),this.assertCPPMode((function(){r._defaultChannelClient.insertMessage(e,s,o,n,a)}),"insertMessage",n)},e.prototype.batchInsertMessage=function(e,s,o){var n,a,r=this;for(var c in t.assert("messages",e,(function(s){return t.isArray(s)&&!(e.length<=0||e.length>=500)}),!0),t.assert("checkDuplicate",s,t.AssertRules.BOOLEAN),t.assert("callback",o,t.AssertRules.CALLBACK),e)t.assert("message",e[c],t.AssertRules.OBJECT,!0),t.assert("message.conversationType",e[c].conversationType,(function(e){return[t.ConversationType.PRIVATE,t.ConversationType.DISCUSSION,t.ConversationType.GROUP,t.ConversationType.CUSTOMER_SERVICE,t.ConversationType.SYSTEM,t.ConversationType.APP_PUBLIC_SERVICE,t.ConversationType.PUBLIC_SERVICE].includes(e)}),!0),t.assert("message.targetId",e[c].targetId,t.AssertRules.STRING,!0),t.assert("message.senderUserId",e[c].senderUserId,t.AssertRules.STRING,!0),t.assert("message.messageType",e[c].messageType,t.AssertRules.STRING,!0),t.assert("message.content",e[c].content,t.AssertRules.OBJECT,!0),t.assert("message.messageDirection",e[c].messageDirection,t.AssertRules.NUMBER,!0),t.assert("message.canIncludeExpansion",e[c].canIncludeExpansion,t.AssertRules.BOOLEAN),t.assert("message.expansion",e[c].expansion,t.AssertRules.OBJECT),t.assert("message.disableNotification",e[c].disableNotification,t.AssertRules.BOOLEAN),t.assert("message.sentTime",e[c].sentTime,t.AssertRules.NUMBER),t.assert("message.sentStatus",e[c].sentStatus,t.AssertRules.NUMBER),t.assert("options.isUnread",null===(n=e[c])||void 0===n?void 0:n.isUnread,t.AssertRules.BOOLEAN),t.assert("options.searchContent",null===(a=e[c])||void 0===a?void 0:a.searchContent,t.AssertRules.STRING);this.assertCPPMode((function(){r._defaultChannelClient.batchInsertMessage(e,s,o)}),"batchInsertMessage",o)},e.prototype.getMessageCount=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.assertCPPMode((function(){n._defaultChannelClient.getMessageCount(e,s,o)}),"getMessageCount",o)},e.prototype.getRemoteHistoryMessages=function(e,s,o,n,a,r){var c=this;void 0===r&&(r={}),t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("count",n,t.AssertRules.NUMBER,!0),t.assert("callback",a,t.AssertRules.CALLBACK),t.assert("options.order",r.order,t.AssertRules.NUMBER),this.assertCPPMode((function(){c._defaultChannelClient.getRemoteHistoryMessages(e,s,o,n,a,r)}),"getRemoteHistoryMessages",a)},e.prototype.deleteLocalMessages=function(e,s,o,n){var a=this;t.assert("messageIds",o,t.AssertRules.ARRAY,!0),t.assert("callback",n,t.AssertRules.CALLBACK),this.logger.info(t.LogTagId.O,"deleteLocalMessages ->messageIds:".concat(o)),this.assertCPPMode((function(){a._context.deleteMessages(o).then((function(e){e===t.ErrorCode.SUCCESS?V(n.onSuccess,!0):(a.logger.warn(t.LogTagId.O,"deleteLocalMessages ->code:".concat(e,",messageIds:").concat(o)),W(n.onError,e))}))}),"deleteLocalMessages",n)},e.prototype.deleteLocalMessagesByTimestamp=function(e,s,o,n,a){var r=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),t.assert("cleanSpace",n,t.AssertRules.BOOLEAN),t.assert("callback",a,t.AssertRules.CALLBACK),this.assertCPPMode((function(){r._defaultChannelClient.deleteLocalMessagesByTimestamp(e,s,o,n,a)}),"deleteLocalMessagesByTimestamp",a)},e.prototype.clearMessages=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("callback",o,t.AssertRules.CALLBACK),this.assertCPPMode((function(){n._defaultChannelClient.clearMessages(e,s,o)}),"clearMessages",o)},e.prototype.getMessage=function(e,s){var o=this;t.assert("callback",s,t.AssertRules.CALLBACK),this.assertCPPMode((function(){o._context.getMessage(e).then((function(n){var a=n.code,r=n.data;a===t.ErrorCode.SUCCESS?V(s.onSuccess,H(r)):(o.logger.warn(t.LogTagId.O,"getMessage ->code:".concat(a,",messageId:").concat(e)),W(s.onError,a))}))}),"getMessage",s)},e.prototype.setTextMessageExtra=function(e,s,o){var n=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("value",s,t.AssertRules.STRING,!1),this.logger.info(t.LogTagId.O,"setTextMessageExtra ->messageId:".concat(e,",value:").concat(s)),this.assertCPPMode((function(){n._context.setTextMessageExtra(e,s).then((function(s){s===t.ErrorCode.SUCCESS?V(o.onSuccess,!0):(n.logger.warn(t.LogTagId.O,"setTextMessageExtra ->code:".concat(s,",messageId:").concat(e)),W(o.onError,s))}))}),"setTextMessageExtra",o)},e.prototype.setMessageSentStatus=function(e,s,o){var n=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("sentStatus",s,t.AssertRules.NUMBER,!0),this.logger.info(t.LogTagId.O,"setMessageSentStatus ->messageId:".concat(e,",sentStatus:").concat(s)),this.assertCPPMode((function(){n._context.setMessageSentStatus(e,s).then((function(s){s===t.ErrorCode.SUCCESS?V(o.onSuccess,!0):(n.logger.warn(t.LogTagId.O,"setMessageSentStatus ->code:".concat(s,",messageId:").concat(e)),W(o.onError,s))}))}),"setMessageSentStatus",o)},e.prototype.setMessageReceivedStatus=function(e,s,o){var n=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("receivedStatus",s,t.AssertRules.NUMBER,!0),this.logger.info(t.LogTagId.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(s)),this.assertCPPMode((function(){n._context.setMessageReceivedStatus(e,s).then((function(s){s===t.ErrorCode.SUCCESS?V(o.onSuccess,!0):(n.logger.warn(t.LogTagId.O,"setMessageReceivedStatus ->code:".concat(s,",messageId:").concat(e)),W(o.onError,s))}))}),"setMessageReceivedStatus",o)},e.prototype.setMessageContent=function(e,s,o,n){var a=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("objectName",o,t.AssertRules.ONLY_STRING,!0),this.assertCPPMode((function(){a.logger.info(t.LogTagId.A_SET_MSG_CONTENT_O,JSON.stringify({messageId:e,objectName:o})),a._context.setMessageContent(e,s,o).then((function(e){e===t.ErrorCode.SUCCESS?V(n.onSuccess,!0):W(n.onError,e)}))}),"setMessageContent",n)},e.prototype.setMessageSearchField=function(e,s,o){var n=this;t.assert("messageId",e,t.AssertRules.NUMBER,!0),t.assert("searchFiles",o,t.AssertRules.STRING,!0),this.logger.info(t.LogTagId.O,"setMessageSearchField ->messageId:".concat(e,",searchFiles:").concat(o)),this.assertCPPMode((function(){n._context.setMessageSearchField(e,s,o)}),"setMessageSearchField")},e.prototype.searchConversationByContent=function(e,s,o,n){var a=this;t.assert("keyword",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("conversationTypes",o,t.AssertRules.ARRAY),t.assert("customMessageType",n,t.AssertRules.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContent(e,s,o,n)}),"searchConversationByContent",s)},e.prototype.searchConversationByContentWithAllChannel=function(e,s,o,n){var a=this;void 0===o&&(o=[]),t.assert("keyword",e,t.AssertRules.STRING,!0),t.assert("callback",s,t.AssertRules.CALLBACK),t.assert("conversationTypes",n,t.AssertRules.ARRAY),t.assert("customMessageType",o,t.AssertRules.ARRAY),this.assertCPPMode((function(){a._defaultChannelClient.searchConversationByContentWithAllChannel(e,s,o,n)}),"searchConversationByContentWithAllChannel",s)},e.prototype.searchMessageByContent=function(e,s,o,n,a,r,c){var i=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("keyword",o,t.AssertRules.STRING,!0),t.assert("timestamp",n,t.AssertRules.NUMBER),t.assert("count",a,t.AssertRules.NUMBER),t.assert("total",r,t.AssertRules.NUMBER),t.assert("callback",c,t.AssertRules.CALLBACK),this.assertCPPMode((function(){i._defaultChannelClient.searchMessageByContent(e,s,o,n,a,r,c)}),"searchMessageByContent",c)},e.prototype.searchMessageByContentWithAllChannel=function(e,s,o,n,a,r){var c=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("keyword",o,t.AssertRules.STRING,!0),t.assert("timestamp",n,t.AssertRules.NUMBER),t.assert("count",a,t.AssertRules.NUMBER),t.assert("callback",r,t.AssertRules.CALLBACK),this.assertCPPMode((function(){c._defaultChannelClient.searchMessageByContentWithAllChannel(e,s,o,n,a,r)}),"searchMessageByContentWithAllChannel",r)},e.prototype.searchMessageByContentInTimeRangeWithAllChannel=function(e,s,o,n,a,r,c,i){var g=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("keyword",o,t.AssertRules.STRING,!0),t.assert("startTime",n,t.AssertRules.NUMBER),t.assert("endTime",a,t.AssertRules.NUMBER),t.assert("offset",r,t.AssertRules.NUMBER),t.assert("limit",c,t.AssertRules.NUMBER),t.assert("callback",i,t.AssertRules.CALLBACK),this.assertCPPMode((function(){g._defaultChannelClient.searchMessageByContentInTimeRangeWithAllChannel(e,s,o,n,a,r,c,i)}),"searchMessageByContentInTimeRangeWithAllChannel",i)},e.prototype.getUnreadMentionedMessages=function(e,s){return this._isCPPMode?(t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this._defaultChannelClient.getUnreadMentionedMessages(e,s)):(this.logger.error(t.LogTagId.O,"getUnreadMentionedMessages method is not supported in a browser!"),null)},e.prototype.clearUnreadCountByTimestamp=function(e,s,o,n){var a=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),t.assert("timestamp",o,t.AssertRules.NUMBER,!0),this.assertCPPMode((function(){a._defaultChannelClient.clearUnreadCountByTimestamp(e,s,o,n)}),"clearUnreadCountByTimestamp",n)},e.prototype.getFirstUnreadMessage=function(e,t,s){return this._defaultChannelClient.getFirstUnreadMessage(e,t,s)},e.prototype.getMessageByUids=function(e){return this._defaultChannelClient.getMessageByUids(e)},e.prototype.getMessageByMsgUids=function(e,t,s){return this._defaultChannelClient.getMessageByMsgUids(e,t,s)},e.prototype.setMessageSearchContent=function(e,t){return this._context.setMessageSearchContent(e,t)},e.prototype.getConversationNotificationStatus=function(e,s,o){var n=this;t.assert("conversationType",e,t.AssertRules.NUMBER,!0),t.assert("targetId",s,t.AssertRules.STRING,!0),this.assertCPPMode((function(){n._defaultChannelClient.getConversationNotificationStatus(e,s,o)}),"getConversationNotificationStatus",o)},e.prototype.getServerTime=function(){return this._context.getServerTime()},e.prototype.getGroupMessageDeliverList=function(e,t,s){this._defaultChannelClient.getGroupMessageDeliverList(e,t,s)},e.prototype.getPrivateMessageDeliverTime=function(e,t){this._defaultChannelClient.getPrivateMessageDeliverTime(e,t)},e}(),ee=1;t.VersionManage.add("imlib-v2-adapter","5.7.3-beem.1");var te,se,oe=null,ne={init:function(e,s,o){var n;void 0===o&&(o={}),t.assert("appkey",e,t.AssertRules.STRING,!0);var a=(null===(n=o.__runtimeCreator__)||void 0===n?void 0:n.call(o))||b;te=new t.AppStorage(a,"API-V2"),Q=t.APIContext.init(a,{appkey:e,navigators:o.navi?[o.navi]:[],miniCMPProxy:[],logOutputLevel:o.logOutputLevel,typingExpireTime:o.typingExpireTime,httpInMainProcess:!!o.httpInMainProcess,logExpireTime:o.logExpireTime}),(oe=Q.createLogger("RC-IM","IM")).setOutputLevel(o.logOutputLevel),oe.info(t.LogTagId.A_INIT_O,JSON.stringify({appkey:e,navigators:o.navi?[o.navi]:[],typingExpireTime:o.typingExpireTime})),ee=Math.min(15,Math.max(o.readReceiptTimeout||1,1)),Y=new Z(Q,{readReceiptTimeout:ee},oe,te),t.logger.init(oe)},getInstance:function(){return Y},setConnectionStatusListener:function(e){throw new Error("Please use `onConnectionStatusChange()` instead of `setConnectionStatusListener()`")},onConnectionStatusChange:function(e){Q.assignWatcher({connection:function(s,o){try{e.onChanged(s,o)}catch(e){null==oe||oe.error(t.LogTagId.A_CALLBACK_E,"onConnectionStatusChange -> ".concat(e.stack))}}})},setOnReceiveMessageListener:function(e){Q.assignWatcher({message:function(s,o,n){try{var a=H(s),r=Q.getCurrentUserId(),c=Q.getConnectedTime();j(a,r,c,ee,te),a=function(e,t,s,o,n){var a=new Date(s-1e3*o*60*60*24).getTime()-e.sentTime<0;if("ReadReceiptResponseMessage"!==e.messageType||!a)return e;var r=e.content,c=((r=r||{}).receiptMessageDic||{})[t],i="",g={};if(e.receiptResponse=e.receiptResponse||{},c){for(var d=[],u=0;u<c.length;u++)i="".concat(t).concat(c[u],"SENT"),(g=n.get(i))&&!(e.senderUserId in g.userIds)&&(d.push(c[u]),g.count+=1,g.userIds[e.senderUserId]=e.sentTime,e.receiptResponse[c[u]]=g.count,n.set(i,g));r.receiptMessageDic[t]=d,e.content=r}return e}(a,r,c,ee,te),t.usingCppEngine()||G.set(s),e.onReceived(a,void 0,n)}catch(e){null==oe||oe.error(t.LogTagId.A_CALLBACK_E,"setOnReceiveMessageListener -> ".concat(e.stack))}}})},setConversationStatusListener:function(e){Q.assignWatcher({conversationState:function(s){try{var o=[];s.forEach((function(e){var t=e.updatedItems,s=e.conversationType,n=e.targetId,a=e.channelId,r=(t=t||{}).notificationStatus,c=t.isTop;r&&c&&o.push({notificationStatus:r.val,isTop:c.val,conversationType:s,targetId:n,channelId:a||"",updatedTime:r.time})})),o.length>0&&e.onChanged(o)}catch(e){null==oe||oe.error(t.LogTagId.O,"setConversationStatusListener ->error:".concat(e))}}})},setMessageExpansionListener:function(e){Q.assignWatcher({expansion:function(s){try{s.updatedExpansion&&e.onUpdated(s.updatedExpansion),s.deletedExpansion&&e.onDeleted(s.deletedExpansion)}catch(e){null==oe||oe.error(t.LogTagId.O,"setMessageExpansionListener ->error:".concat(e))}}})},setTagListener:function(e){Q.assignWatcher({tag:function(){try{e.onChanged()}catch(e){null==oe||oe.error(t.LogTagId.O,"setTagListener ->error:".concat(e))}}})},setConversationTagListener:function(e){Q.assignWatcher({conversationTagChanged:function(){try{e.onChanged()}catch(e){null==oe||oe.error(t.LogTagId.O,"setConversationTagListener ->error:".concat(e))}}})},setPullOffLineFinished:function(e){Q.assignWatcher({pullFinished:function(){try{e.onFinished()}catch(e){null==oe||oe.error(t.LogTagId.O,"setPullOffLineFinished ->error:".concat(e))}}})},setTypingStatusListener:function(e){Q.assignWatcher({typingState:function(s){try{e.onChanged(s)}catch(e){null==oe||oe.error(t.LogTagId.O,"setTypingStatusListener ->error:".concat(e))}}})},setMessageBlockedListener:function(e){Q.assignWatcher({messageBlocked:function(t){e.onReceived(t)}})},setChatRoomStatusListener:function(e){Q.assignWatcher({chatroomState:function(t){e.onChanged(t)}})},setMessageDeliveredListener:function(e){Q.assignWatcher({messageDelivered:function(s){try{e.onDelivered(s)}catch(e){null==oe||oe.error(t.LogTagId.O,"setMessageDeliveredListener ->error:".concat(e))}}})},setGroupMessageDeliveredStatusListener:function(e){Q.assignWatcher({groupMessageDeliveredStatus:function(s){try{e.onDelivered(s)}catch(e){null==oe||oe.error(t.LogTagId.O,"setGroupMessageDeliveredStatusListener ->error:".concat(e))}}})},connect:function(e,s,o){return r(this,void 0,void 0,(function(){var n,a,r,i;return c(this,(function(c){switch(c.label){case 0:return n=null==oe?void 0:oe.createTraceId(),null==oe||oe.info(t.LogTagId.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:!1}),n),[4,Q.connect(e,!!o,n)];case 1:return a=c.sent(),r=a.code===t.ErrorCode.SUCCESS?"info":"warn",null==oe||oe[r](t.LogTagId.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===t.ErrorCode.SUCCESS?(s.onSuccess(a.userId),i=new Date(Q.getConnectedTime()-1e3*ee*60*60*24).getTime(),te.getKeys().forEach((function(e){if(/SENT$/.test(e)){var t=te.get(e).dealtime;t&&i-t>0&&te.remove(e)}else if(/RECEIVED$/.test(e)){var s=te.get(e),o=Object.keys(s).length;Object.keys(s).forEach((function(e){var t=s[e].dealtime;t&&i-t>0&&delete s[e]})),Object.keys(s).length!==o&&(0===s.length?te.remove(e):te.set(e,s))}}))):a.code===t.ErrorCode.RC_CONN_TOKEN_INCORRECT?(null==oe||oe.warn(t.LogTagId.O,"connect ->code:".concat(a.code,",token:").concat(e)),s.onTokenIncorrect()):(null==oe||oe.warn(t.LogTagId.O,"connect ->code:".concat(a.code,",token:").concat(e)),s.onError(a.code)),[2]}}))}))},reconnect:function(e,s,o){var n=null==oe?void 0:oe.createTraceId();null==oe||oe.info(t.LogTagId.A_RECONNECT_T,null,n),Q.reconnect(o).then((function(s){var o=s.code===t.ErrorCode.SUCCESS?"info":"warn";null==oe||oe[o](t.LogTagId.A_RECONNECT_R,JSON.stringify({code:s.code,userId:s.userId}),n),s.code===t.ErrorCode.SUCCESS?e.onSuccess(s.userId):(null==oe||oe.warn(t.LogTagId.O,"reconnect ->code:".concat(s.code)),e.onError(s.code))})).catch((function(t){e.onError(t)}))},RegisterMessage:{},RegisterMessageTypeMapping:K,getMessageObjectName:function(e){var t=a(a({},D),K);return Object.keys(t).find((function(s){return t[s]===e}))||e},registerMessageType:function(e,t,s,o){this.RegisterMessage[e]=q(e,t,s.isPersited,s.isCounted),this.RegisterMessageTypeMapping[t]=e,Q.registerMessageType(t,s.isPersited,s.isCounted,o)}},ae=function(e,t,s){this.type=e,this.userIdList=t,this.mentionedContent=s},re=function(e,t){this.isCounted=e,this.isPersited=t},ce=q("TextMessage","RC:TxtMsg"),ie=q("LocationMessage","RC:LBSMsg"),ge=q("TypingStatusMessage","RC:TypSts"),de=q("ImageMessage","RC:ImgMsg"),ue=q("RichContentMessage","RC:ImgTextMsg"),le=q("VoiceMessage","RC:VcMsg"),he=q("HQVoiceMessage","RC:HQVCMsg"),Ce=q("FileMessage","RC:FileMsg"),pe=q("SightMessage","RC:SightMsg"),fe=q("GIFMessage","RC:GIFMsg"),Ie=q("ReadReceiptMessage","RC:ReadNtf"),Re=q("ReadReceiptRequestMessage","RC:RRReqMsg"),Te=q("RCCombineMessage","RC:CombineMsg"),Se=function(e,t,s,o,n,a,r,c,i,g,d,u,l,h,C,p,f,I){this.conversationType=e,this.targetId=t,this.senderUserId=s,this.content=o,this.objectName=n,this.messageType=a,this.messageId=r,this.messageUId=c,this.messageDirection=i,this.offLineMessage=g,this.sentStatus=d,this.sentTime=u,this.receivedStatus=l,this.receivedTime=h,this.canIncludeExpansion=C,this.expansion=p,this.receiptResponse=f,this.disableNotification=I};exports.VoIPMediaType=void 0,(se=exports.VoIPMediaType||(exports.VoIPMediaType={}))[se.MEDIA_AUDIO=1]="MEDIA_AUDIO",se[se.MEDIA_VEDIO=2]="MEDIA_VEDIO",se[se.MEDIA_VIDEO=2]="MEDIA_VIDEO";var ve,ye=q("AcceptMessage","RC:VCAccept"),me=q("RingingMessage","RC:VCRinging"),Me=q("SummaryMessage","RC:VCSummary"),Ee=q("HungupMessage","RC:VCHangup"),Ae=q("InviteMessage","RC:VCInvite"),Le=q("MediaModifyMessage","RC:VCModifyMedia"),Oe=q("MemberModifyMessage","RC:VCModifyMem"),Ne=q("lastMessageSendTime","RC:SRSMsg"),Ue=q("ReferenceMessage","RC:ReferenceMsg"),_e=q("PublicServiceRichContentMessage","RC:PSImgTxtMsg"),xe=q("PublicServiceMultiRichContentMessage","RC:PSMultiImgTxtMsg");!function(e){e[e.ALL=1]="ALL",e[e.PART=2]="PART"}(ve||(ve={}));var Be=ve;window&&(window.RongIMClient=ne),Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return t.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return t.ChatroomUserChangeType}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return t.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return t.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return t.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return t.FileType}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return t.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return t.LogLevel}}),Object.defineProperty(exports,"LogSource",{enumerable:!0,get:function(){return t.LogSource}}),Object.defineProperty(exports,"LogTagId",{enumerable:!0,get:function(){return t.LogTagId}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return t.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return t.MessageDirection}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return t.NotificationStatus}}),Object.defineProperty(exports,"RCConnectionStatus",{enumerable:!0,get:function(){return t.RCConnectionStatus}}),Object.defineProperty(exports,"RTCApiType",{enumerable:!0,get:function(){return t.RTCApiType}}),Object.defineProperty(exports,"RTCMode",{enumerable:!0,get:function(){return t.RTCMode}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return t.ReceivedStatus}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return t.UploadMethod}}),Object.defineProperty(exports,"logger",{enumerable:!0,get:function(){return t.logger}}),exports.AcceptMessage=ye,exports.BaseMessage=J,exports.ChannelClient=z,exports.ConnectionState={ACCEPTED:0,UNACCEPTABLE_PROTOCOL_VERSION:1,IDENTIFIER_REJECTED:2,SERVER_UNAVAILABLE:3,TOKEN_INCORRECT:4,NOT_AUTHORIZED:5,REDIRECT:6,PACKAGE_ERROR:7,APP_BLOCK_OR_DELETE:8,BLOCK:9,TOKEN_EXPIRE:10,DEVICE_ERROR:11,HOSTNAME_ERROR:12,HASOHTERSAMECLIENTONLINE:13,OUT_OF_LIMIT:14,IN_OTHER_CLUSTER:15,APP_AUTH_NOT_PASS:16,OTP_USED:17,PLATFORM_ERROR:18,USER_LOGOUT:19,ACCOUNT_CANCELLATION:19,LICENSE_EXPIRED:20},exports.FileMessage=Ce,exports.GIFMessage=fe,exports.GetChatRoomType=n,exports.HQVoiceMessage=he,exports.HungupMessage=Ee,exports.IMClient=Z,exports.ImageMessage=de,exports.InviteMessage=Ae,exports.LocationMessage=ie,exports.MediaModifyMessage=Le,exports.MemberModifyMessage=Oe,exports.MentionedInfo=ae,exports.MentionedType=Be,exports.Message=Se,exports.MessageTag=re,exports.PublicServiceMultiRichContentMessage=xe,exports.PublicServiceRichContentMessage=_e,exports.RCCombineMessage=Te,exports.ReadReceiptMessage=Ie,exports.ReadReceiptRequestMessage=Re,exports.ReadReceiptResponseMessage=X,exports.ReferenceMessage=Ue,exports.RichContentMessage=ue,exports.RingingMessage=me,exports.RongIMClient=ne,exports.SentStatus=o,exports.SightMessage=pe,exports.SummaryMessage=Me,exports.SyncReadStatusMessage=Ne,exports.TextMessage=ce,exports.TypingStatusMessage=ge,exports.VoiceMessage=le;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"types": "index.d.ts",
|
|
12
12
|
"module": "index.esm.js",
|
|
13
|
-
"version": "5.7.
|
|
13
|
+
"version": "5.7.3-beem.1",
|
|
14
14
|
"author": "pass-web@rongcloud.cn",
|
|
15
15
|
"license": "LGPL 2.1",
|
|
16
16
|
"homepage": "https://www.rongcloud.cn",
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
"globals": "RongIMLib"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"@rongcloud/engine": "=5.7.
|
|
24
|
+
"@rongcloud/engine": "=5.7.3-beem.1"
|
|
25
25
|
}
|
|
26
26
|
}
|