@rongcloud/imlib-next 5.7.2 → 5.7.3
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 +8 -2
- 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=require("@rongcloud/engine"),t=function(){return t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},t.apply(this,arguments)};function n(e,t,n,o){return new(n||(n=Promise))((function(r,s){function a(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((o=o.apply(e,t||[])).next())}))}function o(e,t){var n,o,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function i(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,i[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var r=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},s=r(),a=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 i,c={tag:"browser",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,i=t.body,c=e.appendUrl(t.url,s);return new Promise((function(e){var t=a(),s="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(n,c),r&&t.setRequestHeader)for(var d in r)t.setRequestHeader(d,r[d]);if(s){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 u="object"==typeof i?JSON.stringify(i):i;t.send(u)}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(i)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:s,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.NetworkType.UNKONWN;return new Promise((function(e){e(r)}))}},d=r(),u=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},l={setItem:u("setStorageSync"),getItem:u("getStorageSync"),removeItem:u("removeStorageSync"),clear:u("clearStorageSync")},g={tag:"wechat",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){wx.request({url:i,method:n,header:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:l,sessionStorage:l,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:d,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},v=r(),f=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];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:f("setStorageSync"),getItem:f("getStorageSync"),removeItem:f("removeStorageSync"),clear:f("clearStorageSync")},E={tag:"alipay",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s),c=t.dataType||"json";return new Promise((function(t){my.request({url:i,method:n,headers:r,timeout:o,data:a,dataType:c,success:function(e){t({data:e.data,status:e.status})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:R,sessionStorage:R,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:v,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(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},I=r(),p=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},T={setItem:p("setStorageSync"),getItem:p("getStorageSync"),removeItem:p("removeStorageSync"),clear:p("clearStorageSync")},h={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:I,localStorage:T,sessionStorage:T,httpReq:function(t){return new Promise((function(n){tt.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},C=r(),m=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},S={setItem:m("setStorageSync"),getItem:m("getStorageSync"),removeItem:m("removeStorageSync"),clear:m("clearStorageSync")},A={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:C,localStorage:S,sessionStorage:S,httpReq:function(t){return new Promise((function(n,o){swan.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))]}))}))}},O=r(),N=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},_={setItem:N("setStorageSync"),getItem:N("getStorageSync"),removeItem:N("removeStorageSync"),clear:N("clearStorageSync")},y={tag:"jingdong",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){jd.request({url:i,method:n,headers:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:_,sessionStorage:_,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(t){jd.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},M=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},U={setItem:M("setStorageSync"),getItem:M("getStorageSync"),removeItem:M("removeStorageSync"),clear:M("clearStorageSync")},L={tag:"uniapp",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){uni.request({url:i,method:n,header:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:U,sessionStorage:U,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);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(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},P=function(e){return e&&e.request&&e.getSystemInfo},x="undefined"!=typeof uni&&P(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return L;case"mp-jd":return y;case"mp-baidu":return A;case"mp-toutiao":return h;case"mp-alipay":return E;case"mp-weixin":return g;default:return c}}():"undefined"!=typeof jd&&P(jd)?y:"undefined"!=typeof my&&P(my)?E:"undefined"!=typeof tt&&P(tt)?h:"undefined"!=typeof swan&&P(swan)?A:"undefined"!=typeof wx&&P(wx)?g:c;function w(t){var n=t.conversationType,o=t.channelId,r=t.messageType,s=t.content,a=t.senderUserId,i=t.targetId,c=t.sentTime,d=t.receivedTime,u=t.messageUId,l=t.messageDirection,g=t.isPersited,v=t.isCounted,f=t.isOffLineMessage,R=t.canIncludeExpansion,E=t.expansion,I=t.receivedStatus,p=t.disableNotification,T=t.isMentioned,h=t.isStatusMessage,C=t.readReceiptInfo,m=t.pushConfig,S=t.messageId,A=t.isInterrupt,O=t.isModifyMessage,N=t.channelType,_=t.sentStatus;I||(I=e.ReceivedStatus.UNREAD);var y={messageType:r,channelId:o||"",content:s,senderUserId:a,targetId:i,conversationType:n,sentTime:c,receivedTime:d,messageUId:u,messageDirection:l,isPersited:g,isCounted:v,isMentioned:T,disableNotification:p,isStatusMessage:h,canIncludeExpansion:R,expansion:E,receivedStatus:I,readReceiptInfo:C,pushConfig:m,messageId:S,isInterrupt:A,isModifyMessage:O,sentStatus:_};return n!==e.ConversationType.ULTRA_GROUP&&(y.isOffLineMessage=f),n===e.ConversationType.ULTRA_GROUP&&e.isNumber(N)&&(y.channelType=N),y}function b(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,s=e.hasMentioned,a=e.mentionedInfo,i=e.lastUnreadTime,c=e.notificationStatus,d=e.notificationLevel,u=e.isTop,l=e.channelId,g=e.unreadMentionedCount,v=e.matchCount;return{conversationType:t,targetId:n,latestMessage:o&&w(o),unreadMessageCount:r,hasMentioned:s,mentionedInfo:s?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:i,notificationStatus:c,notificationLevel:d,isTop:u,channelId:l,unreadMentionedCount:g,matchCount:v}}function B(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}exports.Events=void 0,(i=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",i.CONNECTED="CONNECTED",i.DISCONNECT="DISCONNECT",i.SUSPEND="SUSPEND",i.MESSAGES="MESSAGES",i.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",i.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",i.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",i.CONVERSATION="CONVERSATION",i.CHATROOM="CHATROOM",i.EXPANSION="EXPANSION",i.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",i.TAG="TAG",i.CONVERSATION_TAG="CONVERSATION_TAG",i.TYPING_STATUS="TYPING_STATUS",i.MESSAGE_BLOCKED="MESSAGE_BLOCKED",i.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",i.OPERATE_STATUS="OPERATE_STATUS",i.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",i.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",i.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",i.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",i.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",i.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",i.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",i.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED";var D=new e.EventEmitter,G={connection:function(t,n){switch(t){case e.RCConnectionStatus.CONNECTED:D.emit(exports.Events.CONNECTED);break;case e.RCConnectionStatus.CONNECTING:D.emit(exports.Events.CONNECTING);break;case e.RCConnectionStatus.SUSPENDED:D.emit(exports.Events.SUSPEND,n);break;case e.RCConnectionStatus.DISCONNECTED:D.emit(exports.Events.DISCONNECT,n)}},batchMessage:function(e){D.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return w(e)}))})},typingState:function(e){D.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){D.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){D.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){D.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(t){var n=t.map((function(t){var n=t.conversationType,o={conversationType:n,latestMessage:t.latestMessage?w(t.latestMessage):null,targetId:t.targetId,unreadMessageCount:t.unreadMessageCount,unreadMentionedCount:t.unreadMentionedCount,notificationStatus:t.notificationStatus,notificationLevel:t.notificationLevel,lastUnreadTime:t.lastUnreadTime,channelId:t.channelId};return n===e.ConversationType.ULTRA_GROUP?(o.versionTime=t.versionTime,{conversation:o}):(o.hasMentioned=t.hasMentioned,o.mentionedInfo=t.mentionedInfo,o.isTop=t.isTop,{conversation:o,updatedItems:t.updatedItems})}));D.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){D.emit(exports.Events.CHATROOM,e)},expansion:function(e){D.emit(exports.Events.EXPANSION,e)},pullFinished:function(){D.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){D.emit(exports.Events.TAG)},conversationTagChanged:function(){D.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){D.emit(exports.Events.MESSAGE_BLOCKED,e)},messageDelivered:function(e){D.emit(exports.Events.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){D.emit(exports.Events.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){D.emit(exports.Events.ULTRA_GROUP_ENABLE,e.map((function(e){return b(e)})))},operateStatus:function(e){D.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){D.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return w(e)})))},ultraGroupMessageModified:function(e){D.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return w(e)})))},ultraGroupMessageRecalled:function(e){D.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return w(e)})))},ultraGroupChannelChangeType:function(e){D.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){D.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){D.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)}};e.VersionManage.add("imlib-next","5.7.2");var V=null,k=null,H=null;function F(){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return V?(H.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),k=null,V=null,H=null,[2]}}))}))}function Z(e){if(!V)throw new Error("Not initialized yet!");return e(V,H,k)}function q(t){return V?t(V,H,k):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function J(){D.clear()}var z={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:e.ErrorCode.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:e.ErrorCode.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},j={};for(var K in z){var Y=z[K].code;j[Y]=K}z.ROAMING_SERVICE_UNAVAILABLE.code;var W=function(t,n,o){void 0===o&&(o="");var r="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return t.debug(e.LogTagId.O,"".concat(o," -> ").concat(r)),r},X=function(t,r,s,a){return void 0===a&&(a=""),n(void 0,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return n=W(t,r,a),[4,s()];case 1:return(i=o.sent())!==e.ErrorCode.SUCCESS?(t.warn(e.LogTagId.O,"".concat(a," fail -> ").concat(i," : ").concat(j[i]," , ").concat(n)),[2,{code:i,msg:j[i]}]):[2,{code:i}]}}))}))};var Q=function(t){return!!(e.validate("options.key",t.key,e.AssertRules.STRING,!0)&&e.validate("options.value",t.value,e.AssertRules.STRING,!0)&&e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)&&e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING))},$=function(t){return t.entries.every((function(t){return e.validate("entry.key",t.key,e.AssertRules.STRING,!0)&&e.validate("entry.value",t.value,e.AssertRules.STRING,!0)}))&&e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)&&e.validate("options.isForce",t.isForce,e.AssertRules.BOOLEAN)},ee=function(t){return e.validate("options.key",t.key,e.AssertRules.STRING,!0)&&e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)},te=function(t){return t.entries.every((function(t){return e.validate("key",t,e.AssertRules.STRING,!0)}))&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)};var ne=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function oe(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new ne(e,o,t,n)}}var re,se,ae=oe("RC:ImgMsg"),ie=oe("RC:HQVCMsg"),ce=oe("RC:SightMsg"),de=oe("RC:TxtMsg"),ue=oe("RC:CombineMsg"),le=oe("RC:FileMsg"),ge=oe("RC:GIFMsg"),ve=oe("RC:VcMsg"),fe=oe("RC:LBSMsg"),Re=oe("RC:ReferenceMsg"),Ee=oe("RC:ImgTextMsg"),Ie={qiniu:function(t,n,o,r){Z((function(s){var a=s.getNaviInfoFromCache();if(1===(null==a?void 0:a.type)&&n.chunk_size&&r.size>n.chunk_size){var i=e.getUUID();i+=r.name.substr(r.name.lastIndexOf(".")),r.uniqueName=i,Ne(r,n,o)}else Oe(t,n,o,r)}))},baidu:function(e,t,n,o){if(o.size>Te.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=t||{};t=t||se;var s=new XMLHttpRequest,a=me();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var i=a+pe[0][1]+r.bosUploadPath;pe.shift();var c=r.bosHeader||{},d={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:i,isBosRes:!0};s.upload&&t.support_options&&(s.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});s.onreadystatechange=function(){if(4===s.readyState)if(JSON.parse(s.responseText||"{}").filename=t.uniqueValue,200===s.status){n.onCompleted(d,!0)}else pe.length?Ie[pe[0][0]](e,t,n,o):n.onError("upload fail")},s.open(t.method,i,!0),s.setRequestHeader("authorization",c.bosToken),s.setRequestHeader("x-bce-date",c.bosDate),s.send(o)},aliyun:function(t,n,o,r){if(r.size>Te.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var s=new FormData;s.set("file",t.get("file")),s.set("key",t.get("key")),s.set("token",t.get("token"));var a=pe[0][1];pe.shift(),t=t||re,n=(n=n||{})||se;var i=new XMLHttpRequest,c=me(),d="".concat(c+n.ossBucketName,".").concat(a);i.upload&&n.support_options&&(i.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var t=JSON.parse(i.responseText||"{}");t.name=n.uniqueValue,t.filename=n.uploadFileName,t.uploadMethod=e.UploadMethod?e.UploadMethod.ALI:"",200===i.status?o.onCompleted(t):pe.length?Ie[pe[0][0]](s,n,o,r):o.onError("upload fail")}},i.open(n.method,d,!0),console.log("ali:url",d);var u=n.aliHeader||{};t.set("OSSAccessKeyId",u.osskeyId),t.set("policy",u.ossPolicy),t.set("Signature",u.ossSign),t.set("success_action_status",200),t.delete("key"),t.append("key",n.uploadFileName),t.delete("file"),t.append("file",r),i.send(t)},s3:function(t,n,o,r){var s=new FormData,a=new XMLHttpRequest,i=me(),c=n.contentDisposition,d=pe[0][1],u="".concat(i+n.s3BucketName,".").concat(d);console.log("uploadS3:url",u),pe.shift(),a.upload&&n.support_options&&(a.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var s=JSON.parse(a.responseText||"{}");if(s.name=n.uniqueValue,s.filename=n.uploadFileName,s.uploadMethod=e.UploadMethod.AWS,200===a.status||204===a.status)o.onCompleted(s);else if(pe.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),Ie[pe[0][0]](i,n,o,r)}else o.onError("upload fail")}},a.open(n.method,u,!0);var l=n?n.s3Header:{},g=r&&r.type;c?s.set("Content-Disposition","".concat(c,";")):s.set("Content-Disposition","text/html"===g?"inline;":"attachment;");s.set("Content-Type",g),s.set("x-amz-credential",l.s3Credential),s.set("x-amz-algorithm",l.s3Algorithm),s.set("x-amz-date",l.s3Date),s.set("policy",l.s3Policy),s.set("x-amz-signature",l.s3Signature),s.set("key",n.uploadFileName),s.set("file",r),a.send(s)},stc:function(t,n,o,r){var s=new XMLHttpRequest,a=n.contentDisposition,i=pe[0][1],c="https://".concat(i,"/").concat(n.stcBucketName,"/").concat(n.uploadFileName);pe.shift(),s.upload&&n.support_options&&(s.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});s.onreadystatechange=function(){if(4===s.readyState){var a=JSON.parse(s.responseText||"{}");if(a.name=n.uniqueValue,a.filename=n.uploadFileName,a.uploadMethod=e.UploadMethod?e.UploadMethod.STC:"",200===s.status||204===s.status)o.onCompleted(a);else if(pe.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),Ie[pe[0][0]](i,n,o,r)}else o.onError("upload fail")}},s.open("PUT",c,!0);var d=n?n.stcHeader:{};s.setRequestHeader("Content-Type",r.type),a?s.setRequestHeader("Content-Disposition","".concat(a,";")):s.setRequestHeader("Content-Disposition","text/html"===r.type?"inline;":"attachment;");s.setRequestHeader("Authorization",d.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",d.stcContentSha256),s.setRequestHeader("x-amz-date",d.stcDate),s.send(r)}},pe=[],Te={BOS_CHUNCK_SIZE:5368709120},he="http://",Ce="https://";function me(){var e=Ce;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=he),e}var Se,Ae=(Se="RC-upload-",{get:function(e){e=Se+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=Se+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=Se+e,localStorage.removeItem(e)}});function Oe(t,n,o,r){var s=Ce+n.uploadHost.qiniu,a=(/http/.test(pe[0][1])?"":me())+pe[0][1]||s;n.isChunk||pe.shift();var i=new XMLHttpRequest;i.upload&&n.support_options&&(i.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var s=JSON.parse(i.responseText||"{}");s.filename=n.uniqueValue,s.uploadMethod=e.UploadMethod?e.UploadMethod.QINIU:"",200===i.status||204===i.status?o.onCompleted(s):pe.length?Ie[pe[0][0]](t,n,o,r):o.onError("upload fail")}},i.open(n.method,a,!0),o.onOpen(i),n.stream&&i.setRequestHeader("authorization","UpToken ".concat(n.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(n.headers,(function(e,t){i.setRequestHeader(e,t)})),i.send(t)}function Ne(t,n,o,r){var s=0,a=r||e.getUUID(),i=Ae.get(a);i&&(t.uniqueName=i.sessionId,s=i.offset);var c=Math.min(n.chunk_size,t.size-s),d=t.slice(s,s+c),u=t.uniqueName;n.multi_parmas.name=u,n.filesize=t.size;var l="bytes=".concat(s,"-").concat(s+c);n.headers={Range:l,"X-File-TransactionId":u,"X-File-Total-Size":t.size},n.isChunk=!0,d.name=t.name,d=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var s=t.multi_parmas[r];o.append(r,s)}return o}(d,n,t.uniqueName),Oe(d,n,{onCompleted:function(e){s+=c;var r=t.uniqueName;Ae.set(a,{offset:s,sessionId:r}),s<t.size?Ne(t,n,o,a):(s=0,Ae.remove(a),o.onCompleted(e))},onError:function(e){console.error(e),o.onError(e)},onProgress:function(e,t){var r=e+s;o.onProgress(r,n.filesize)},onOpen:function(e){o.onOpen(e)}},t)}function _e(t,n,o,r){var s,a,i=n&&n.type||"text/plain",c=i.indexOf("image")>-1?1:4,d=o.contentDisposition,u=Math.ceil(n.size/o.stc_chunk_size),l=o&&JSON.parse(o.ossConfig?o.ossConfig:"");Array.isArray(l)||(l=[]);var g=l.find((function(e){return Object.keys(e).includes("stc")})),v="uploads";t.getFileToken(c,s,"POST",v).then((function(e){s=e.fileName,a="https://".concat(g.stc,"/").concat(o.stcBucketName,"/").concat(s),console.log("uploadStcMultipart:url",a);var t=new XMLHttpRequest;t.open("POST","".concat(a,"?").concat(v),!0),d?t.setRequestHeader("Content-Disposition","".concat(d,";")):t.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),t.setRequestHeader("Authorization",e&&e.stcAuthorization),t.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),t.setRequestHeader("x-amz-date",e&&e.stcDate),t.setRequestHeader("Content-Type",i),t.send(),t.onreadystatechange=function(){if(4===t.readyState){var e=t.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===t.status||204===t.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(I(e,n));E(e,t)}(Array.isArray(e)&&e[1]):r.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));var f=[],R=new Map;function E(d,l){l&&Array.isArray(l)&&0!==l.length&&Promise.all(l).then((function(){var l="uploadId=".concat(d);if(R.size===u)t.getFileToken(c,s,"POST",l).then((function(t){console.log("onSuccess",t),console.log("onSuccess:uploadId",d);var s=new XMLHttpRequest;s.open("POST","".concat(a,"?").concat(l),!0),s.setRequestHeader("Authorization",t&&t.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",t&&t.stcContentSha256),s.setRequestHeader("x-amz-date",t&&t.stcDate),s.setRequestHeader("Content-Type",i);var c="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(R.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",u),u.forEach((function(e){c+="<Part><ETag>".concat(R.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),c+="</CompleteMultipartUpload>",s.send(c),console.log("xml",c),s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status||204===s.status){var t={name:n.name,filename:o.uploadFileName,uploadMethod:e.UploadMethod.STC};r.onCompleted(t)}else r.onError("uploadStcMultipart:upload does not end")}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));else{for(var g=[],v=0,p=f;v<p.length;v++){var T=p[v];g.push(I(d,T))}E(d,g)}}),(function(e){console.error(e),r.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,o=f;n<o.length;n++){var s=o[n];t.push(I(d,s))}E(d,t)}))}function I(e,r){return new Promise((function(d,u){var l="partNumber=".concat(r,"&uploadId=").concat(e);t.getFileToken(c,s,"PUT",l).then((function(e){console.log("signature ".concat(r," onSuccess"),e);var t=n&&n.slice((r-1)*o.stc_chunk_size,r*o.stc_chunk_size);console.log("fileChunk:size",t.size);var s=new XMLHttpRequest;s.open("PUT","".concat(a,"?").concat(l),!0),s.setRequestHeader("Authorization",e&&e.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),s.setRequestHeader("x-amz-date",e&&e.stcDate),s.setRequestHeader("Content-Type",i),s.send(t),s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status||204===s.status){var e=s.getResponseHeader("etag");console.log("etag:".concat(r),e),R.set(r,e),d(e)}else f.includes(r)||f.push(r),u(r)}}),(function(e){console.log("getETags:签名验证失败"),f.includes(r)||f.push(r),u(r)}))}))}}var ye={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Me()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),Ue(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Me()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,Ue(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Me(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function Ue(e,t){for(var n in e)t(n,e[n])}var Le,Pe=0,xe=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:ye.form,genUId:Me};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;Ue(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){re=n,se=o,pe=[];var s,a=e.getNaviInfoFromCache();if(1===(null==a?void 0:a.type)&&t.uploadDomain)pe=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var i,c,d=JSON.parse(o.ossConfig),u="",l=[];d.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(u=e[n]),"s3"===n&&(i=e[n]),"stc"===n&&(c=e[n]),"p"!==n&&(l[t]=[n,e[n]])})),l.forEach((function(e){e&&pe.push(e)})),d.length!==pe.length&&(pe=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",u],["s3",i],["stc",c]])}else pe=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var g=o&&JSON.parse(o.ossConfig);Array.isArray(g)||(g=[]),s=g.find((function(e){return Object.keys(e).includes("stc")}))}if(s&&1===parseInt(s.p,10)&&n.size>=4194304)_e(e,n,o,r);else{var v=o.data(n,o);Ie[pe[0][0]](v,o,r,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(Le=e,n)?Le=Pe+e/t*(t-Pe):Pe=Le;o.onProgress(Le,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var we,be,Be={init:function(e){return new xe(e)},dataType:ye,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,s=new Image;s.src=r;var a=s.width,i=s.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var s=e.height,a=t.maxHeight||0;if(a>0&&s>a){var i=a/s;n=Math.min(n,i)}var c=t.maxSize||0,d=Math.ceil(e.size/1e3);if(d>c){var u=c/d;n=Math.min(n,u)}return n}({width:a,height:i,size:e.total},t),d=r;c<1&&(d=function(e,t,n){o.width=t,o.height=n;var r=o.getContext("2d");return r.drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(s,a*c,i*c)),n(d)}},Upload:xe},De=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),s=new Image,a="string"==typeof e;s.onload=function(a){var i=function(e,t,n){var o,r,s,a=e<t,i=0,c=0;return(a?t/e:e/t)>n.scale?(a?(r=100,c=((s=t/(o=e/100))-n.maxHeight)/2):(s=100,i=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:s,x:-i,y:-c}):(a?(o=t/n.maxHeight,s=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,s=t/o),{w:r,h:s,x:-i,y:-c})}(s.width,s.height,t);o.width=i.w>t.maxWidth?t.maxWidth:i.w,o.height=i.h>t.maxHeight?t.maxHeight:i.h,r.drawImage(s,i.x,i.y,i.w,i.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},s.src=a?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},Ge=function(e,t){var n=e.file,o=e.compress;De(n,o,t)},Ve=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=Be.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Be.init(e);t(n)}},ke=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||Ge;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},He=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){ke(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Fe=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};ke(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Ze={initFile:function(e,t){Ve(e,(function(e){var n=new He(e);t(n)}))},initImage:function(e,t){Ve(e,(function(n){var o,r,s,a,i={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(s=e.thumbnailConfig)||void 0===s?void 0:s.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new Fe(n,i);t(c)}))},dataType:Be.dataType};function qe(r,s,a,i,c,d,u){var l,g=this;void 0===c&&(c=e.FileType.FILE),l=c===e.FileType.IMAGE?e.FileType.IMAGE:e.FileType.FILE;var v=r.getNaviInfoFromCache();if(!be&&(be="upload.qiniup.com",v&&v.ossConfig))try{var f=JSON.parse(v.ossConfig).find((function(e){return void 0!==e.qiniu}));f&&(be=f.qiniu)}catch(e){}var R=t({domain:be,getToken:function(e){r.getFileToken(l).then((function(t){e(t.token,t)})).catch((function(e){d.onFail(e)}))}},u);(l===e.FileType.IMAGE?Ze.initImage:Ze.initFile)(R,(function(s){s.upload(r,a,i,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=d.onProgress)||void 0===n||n.call(d,o)},onCompleted:function(r){return n(g,void 0,void 0,(function(){return o(this,(function(n){return 1===(null==v?void 0:v.type)?function(n,o,r,s,a,i){var c={type:s.type,name:a.rc_url.file_name,downloadUrl:n.uploadDomain+a.rc_url.path};if(o===e.FileType.AUDIO)return void Je(s).then((function(e){i.onSuccess(t(t({},c),e))}));o===e.FileType.IMAGE&&(c.thumbnail=a.thumbnail);i.onSuccess(c)}(a,c,0,i,r,d):function(n,o,r,s,a){je(o,s.filename,s.name,s,s.uploadMethod).then((function(i){if(0===i.code){var c=i.data;c.type=r.type,c.name=s.name||s.filename,n!==e.FileType.AUDIO?(o===e.FileType.IMAGE&&(c.thumbnail=s.thumbnail),a.onSuccess(c)):Je(r).then((function(e){a.onSuccess(t(t({},c),e))}))}else a.onFail(i)})).catch((function(e){a.onFail(e)}))}(c,l,i,r,d),[2]}))}))},onError:function(e){d.onFail(e)}})}))}function Je(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?ze(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(ze).then((function(e){t(e)}))}))}function ze(e){return we=we||new AudioContext,new Promise((function(t,n){we.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function je(t,n,o,r,s){return e.validate("fileType",t,e.isValidFileType,!0)&&e.validate("filename",n,e.AssertRules.STRING)&&e.validate("saveName",o,e.AssertRules.STRING)&&e.validate("serverType",s,e.AssertRules.NUMBER)?q((function(a){return new Promise((function(i){a.getFileUrl(t,n,o,r,s).then((function(t){i({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){i({code:e})}))}))})):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER})}function Ke(r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g,v,f,R,E,I,p,T,h;return o(this,(function(o){switch(o.label){case 0:return a=a||{},s instanceof ne==!1?(d.warn(e.LogTagId.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,z.ILLGAL_PARAMS]):e.validate("conversation",r,e.AssertRules.OBJECT,!0)?(n=r.conversationType,i=r.targetId,u=r.channelId,e.validate("conversation.targetId",i,e.AssertRules.STRING,!0)&&e.validate("conversation.conversationType",n,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",u,e.AssertRules.CHANNEL_ID)&&e.validate("options.isStatusMessage",null==a?void 0:a.isStatusMessage,e.AssertRules.BOOLEAN)&&e.validate("options.disableNotification",null==a?void 0:a.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushContent",null==a?void 0:a.pushContent,e.AssertRules.STRING)&&e.validate("options.pushData",null==a?void 0:a.pushData,e.AssertRules.STRING)&&e.validate("options.isMentioned",null==a?void 0:a.isMentioned,e.AssertRules.BOOLEAN)&&e.validate("options.mentionedType",null==a?void 0:a.mentionedType,e.AssertRules.NUMBER)&&e.validate("options.mentionedUserIdList",null==a?void 0:a.mentionedUserIdList,e.AssertRules.ARRAY)&&e.validate("options.directionalUserIdList",null==a?void 0:a.directionalUserIdList,e.AssertRules.ARRAY)&&e.validate("options.isVoipPush",null==a?void 0:a.isVoipPush,e.AssertRules.BOOLEAN)&&e.validate("options.canIncludeExpansion",null==a?void 0:a.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("options.expansion",null==a?void 0:a.expansion,e.AssertRules.OBJECT)&&e.validate("options.pushConfig",null==a?void 0:a.pushConfig,e.AssertRules.OBJECT)&&e.validate("options.messageId",null==a?void 0:a.messageId,e.AssertRules.NUMBER)?(l="conversationType:".concat(n,",targetId:").concat(i),d.debug(e.LogTagId.O,"send message ->".concat(l)),g=function(e,n,o){var r=e.isStatusMessage,s=e.disableNotification,a=e.pushContent,i=e.pushData,c=e.isMentioned,d=e.mentionedType,u=e.mentionedUserIdList,l=e.directionalUserIdList,g=e.isVoipPush,v=e.canIncludeExpansion,f=e.expansion,R=e.isFilerWhiteBlacklist,E=e.pushConfig,I=e.messageId,p=o.channelId;return t({isStatusMessage:r,disableNotification:s,pushContent:a,pushData:i,isMentioned:c,mentionedType:d,mentionedUserIdList:u,directionalUserIdList:l,isVoipPush:g,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:R,pushConfig:E,channelId:p||"",messageId:I},n)}(a,s,r),v={isMentioned:!!a.isMentioned,content:s.content,messageType:s.messageType,isPersited:s.isPersited||!1,isCounted:s.isCounted||!1,disableNotification:!!(null==a?void 0:a.disableNotification),canIncludeExpansion:!!(null==a?void 0:a.canIncludeExpansion),expansion:(null==a?void 0:a.expansion)||null,conversationType:r.conversationType,targetId:r.targetId,channelId:r.channelId,senderUserId:c.getCurrentUserId(),messageUId:"",messageDirection:e.MessageDirection.SEND,receivedTime:0,isStatusMessage:a.isStatusMessage||!1,receivedStatus:e.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:null==a?void 0:a.pushConfig,sentStatus:e.SentStatus.SENDING},n!==e.ConversationType.ULTRA_GROUP&&(v.isOffLineMessage=!1),f=d.createTraceId(),R=function(t){v.messageId=t;try{(null==a?void 0:a.onSendBefore)&&a.onSendBefore(w(v))}catch(t){d.error(e.LogTagId.O,'Callback method "onSendBefore" execution error.\n'.concat(null==t?void 0:t.stack),f)}},d.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:s.messageType,conversationType:n,targetId:i,channelId:u}),f),[4,c.sendMessage(n,i,g,R,f)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=o.sent(),I=E.code,p=E.data,T=I===e.ErrorCode.SUCCESS?"info":"warn",d[T](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:I,messageUId:p?p.messageUId:"",messageId:p?p.messageId:""}),f),I===e.ErrorCode.SUCCESS?(h=w(p),[2,{code:I,data:h}]):(d.warn(e.LogTagId.O,"send message fail ->".concat(I,":").concat(j[I],",").concat(l)),v.sentTime=(null==p?void 0:p.sentTime)||0,v.sentStatus=null==p?void 0:p.sentStatus,[2,{code:I,msg:j[I],data:w(v)}])}}))}))}))]}))}))}function Ye(t,n){return function(o,r,s,a){if(!e.validate("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});var i={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(e.validate("sendOptions.maxHeight",null==c?void 0:c.maxHeight,e.AssertRules.NUMBER)&&e.validate("sendOptions.maxWidth",null==c?void 0:c.maxWidth,e.AssertRules.NUMBER)&&e.validate("sendOptions.quality",null==c?void 0:c.quality,e.AssertRules.NUMBER)&&e.validate("sendOptions.scale",null==c?void 0:c.scale,e.AssertRules.NUMBER)))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});i.thumbnailConfig=c}return q((function(c,d,u){return new Promise((function(l){var g=d.createTraceId();d.info(e.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:r.file.size,type:t}),g),qe(c,0,u,r.file,t,{onProgress:null==s?void 0:s.onProgress,onSuccess:function(t){var i,c=(null===(i=null==s?void 0:s.onComplete)||void 0===i?void 0:i.call(s,{url:t.downloadUrl}))||n(t,r);t&&t.downloadUrl&&d.info(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:t.downloadUrl,code:e.ErrorCode.SUCCESS}),g),Ke(o,c,a).then(l)},onFail:function(t){d.warn(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({code:e.ErrorCode.UPLOAD_FILE_FAILED}),g),l({code:e.ErrorCode.UPLOAD_FILE_FAILED,msg:t||e.ErrorCode[e.ErrorCode.UPLOAD_FILE_FAILED]})}},i)}))}))}}var We=Ye(e.FileType.FILE,(function(e,t){return new le({name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl,user:t.user,extra:t.extra});var n,o})),Xe=Ye(e.FileType.IMAGE,(function(e,t){return new ae({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),Qe=Ye(e.FileType.AUDIO,(function(e,t){return new ie({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),$e=Ye(e.FileType.SIGHT,(function(e,t){return new ce({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));Ye(e.FileType.COMBINE_HTML,(function(e,t){return new ue({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var et=Object.freeze({__proto__:null,getAllConversationList:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("channelId",t,e.AssertRules.CHANNEL_ID)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getAllConversationList -> channelId: ".concat(t)),e.isUndefined(t)?[4,s.getConversationListWithAllChannel()]:[3,2];case 1:return n=o.sent(),[3,4];case 2:return[4,s.getConversationList(void 0,void 0,void 0,void 0,t)];case 3:n=o.sent(),o.label=4;case 4:return r=n.code,i=n.data,r===e.ErrorCode.SUCCESS&&i?(c=i.map((function(e){return b(e)})),[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(t)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversationList:function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("startTime",t,e.AssertRules.NUMBER,!0)&&e.validate("count",r,e.AssertRules.NUMBER,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n="startTime: ".concat(t,", count: ").concat(r,", channelId: ").concat(s),c.info(e.LogTagId.O,"getConversationList -> ".concat(n)),e.isUndefined(s)?[4,i.getConversationListWithAllChannelByPage(t,r)]:[3,2];case 1:return a=o.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(d,t,r,s)];case 3:a=o.sent(),o.label=4;case 4:return u=a.code,l=a.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return b(e)})),[2,{code:u,data:g}]):(c.warn(e.LogTagId.O,"getConversationList fail -> code: ".concat(u," ").concat(n)),[2,{code:u,msg:j[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent:function t(r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.usingCppEngine()?e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("messageTypes",s,e.AssertRules.ARRAY,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)&&!s.some((function(t){return!e.validate("messageType",t,e.AssertRules.STRING,!0)}))?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n="keyword: ".concat(r,", messageTypes: ").concat(JSON.stringify(s),", channelId: ").concat(a),d.info(e.LogTagId.O,"searchConversationByContent -> ".concat(t)),e.isUndefined(a)?[4,c.searchConversationByContentWithAllChannel(r,s)]:[3,2];case 1:return i=o.sent(),[3,4];case 2:return[4,c.searchConversationByContent(r,s,a)];case 3:i=o.sent(),o.label=4;case 4:return u=i.code,l=i.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return b(e)})),[2,{code:u,data:g}]):(d.warn(e.LogTagId.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(n)),[2,{code:u,msg:j[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessages:function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("startTime",s,e.AssertRules.NUMBER,!0)&&e.validate("count",a,e.AssertRules.NUMBER,!0)?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g,v,f,R,E,I;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", keyword: ").concat(r,", timestamp: ").concat(s,", count: ").concat(a),d.info(e.LogTagId.O,"searchMessages -> ".concat(n)),i=t.targetId,u=t.conversationType,l=t.channelId,e.isUndefined(l)?[4,c.searchMessageByContentWithAllChannel(u,i,r,s,a)]:[3,2];case 1:return g=o.sent(),[3,4];case 2:return 0,[4,c.searchMessageByContent(u,i,r,s,a,0,l)];case 3:g=o.sent(),o.label=4;case 4:return v=g.code,f=g.data,v===e.ErrorCode.SUCCESS&&f?(R=f.messages,E=f.count,I=R.map((function(e){return w(e)})),[2,{code:v,data:{messages:I,count:E}}]):(d.warn(e.LogTagId.O,"searchMessages fail -> code: ".concat(v," ").concat(n)),[2,{code:v,msg:j[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",r,e.AssertRules.OBJECT,!0)&&e.validate("option.keyword",r.keyword,e.AssertRules.STRING,!0)&&e.validate("option.startTime",r.startTime,e.AssertRules.NUMBER,!0)&&e.validate("option.endTime",r.endTime,e.AssertRules.NUMBER,!0)&&e.validate("option.offset",r.offset,e.AssertRules.NUMBER)&&e.validate("option.limit",r.limit,e.AssertRules.NUMBER)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R,E;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"searchMessageInTimeRange -> ".concat(n)),s=t.conversationType,c=t.targetId,d=r.keyword,u=r.startTime,l=r.endTime,g=r.offset,v=r.limit,g=g||0,v=v||5,[4,a.searchMessageByContentInTimeRangeWithAllChannel(s,c,d,u,l,g,v)];case 1:return f=o.sent(),R=f.code,E=f.data,R===e.ErrorCode.SUCCESS&&E?[2,{code:R,data:{messages:E.messages.map((function(e){return w(e)}))}}]:(i.warn(e.LogTagId.O,"searchMessageInTimeRange fail -> code: ".concat(R,", ").concat(n)),[2,{code:R}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",r,e.AssertRules.OBJECT,!0)&&e.validate("option.count",r.count,e.AssertRules.NUMBER)&&e.validate("option.timestamp",r.timestamp,e.AssertRules.NUMBER)&&e.validate("option.order",r.order,(function(e){return[0,1].includes(e)}))&&e.validate("option.messageTypes",r.messageTypes,e.AssertRules.ARRAY,!0)&&!r.messageTypes.some((function(t){return!e.validate("option.messageType",t,e.AssertRules.STRING,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R,E,I,p,T,h;return o(this,(function(o){switch(o.label){case 0:return n=r.count,s=r.timestamp,c=r.order,d=r.messageTypes,u="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),l=t.conversationType,g=t.targetId,v=t.channelId,n||(n=20),s||(s=0),c||(c=0),v||(v=""),[4,a.getHistoryMessagesByObjectNames(l,g,s,n,d,c,v)];case 1:return f=o.sent(),R=f.code,E=f.data,R===e.ErrorCode.SUCCESS?(p=(I=E).list,T=I.hasMore,h=p.map((function(e){return w(e)})),[2,{code:R,data:{messages:h,hasMore:T,list:h}}]):(i.warn(e.LogTagId.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(R," ").concat(u)),[2,{code:R,msg:j[R]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", timestamp: ").concat(r),i.info(e.LogTagId.O,"updateSentMsgReceiptStatus -> ".concat(n)),s=t.conversationType,c=t.targetId,d=t.channelId,[4,a.setMessageStatusToRead(s,c,r,d)];case 1:return[2,o.sent()]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,(function(t){return!e.isUndefined(e.ReceivedStatus[t])}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus -> messageId: ".concat(t,", receivedStatus: ").concat(r)),[4,a.setMessageReceivedStatus(t,r)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("sentStatus",r,(function(t){return!e.isUndefined(e.SentStatus[t])}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", sentStatus: ").concat(r)),[4,a.setMessageSentStatus(t,r)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageContent:function(t,r,s){return void 0===s&&(s=""),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("content",r,e.AssertRules.OBJECT,!0)&&e.validate("messageType",s,e.AssertRules.ONLY_STRING,!0)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return c.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", messageType: ").concat(s)),[4,i.setMessageContent(t,r,s)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?!e.validate("messageIds",t,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("messageId",t,e.AssertRules.NUMBER,!0)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(s,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(t))),[4,s.deleteMessages(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,a.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,s.clearMessages(n,r,i)];case 1:return(c=o.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(a.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(t,r,s){return n(this,void 0,void 0,(function(){var a,i,c,d=this;return o(this,(function(u){return e.usingCppEngine()?(a=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",a,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",s,e.AssertRules.BOOLEAN)?[2,q((function(t,u){return n(d,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,t.deleteMessagesByTimestamp(a,i,r,s,c)];case 1:return(n=o.sent())===e.ErrorCode.SUCCESS?[2,{code:n}]:(u.warn(e.LogTagId.O,"deleteMessagesByTimestamp ->code:".concat(n,",targetId:").concat(i)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},insertMessage:function(t,r,s){return void 0===s&&(s={}),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("options",s,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==s?void 0:s.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==s?void 0:s.searchContent,e.AssertRules.STRING)&&(r instanceof ne||e.validate("message.senderUserId",r.senderUserId,e.AssertRules.STRING,!0)&&e.validate("message.messageType",r.messageType,e.AssertRules.STRING,!0)&&e.validate("message.content",r.content,e.AssertRules.OBJECT,!0)&&e.validate("message.messageDirection",r.messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("message.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("message.expansion",r.expansion,e.AssertRules.OBJECT)&&e.validate("message.disableNotification",r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("message.sentTime",r.sentTime,e.AssertRules.NUMBER)&&e.validate("message.sentStatus",r.sentStatus,e.AssertRules.NUMBER))?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g,v,f,R,E,I,p,T,h,C;return o(this,(function(o){switch(o.label){case 0:return n="",a=1,g=!1,f=r.messageType,R=r.content,r instanceof ne||(n=r.senderUserId,a=r.messageDirection,g=r.canIncludeExpansion,v=r.expansion,l=r.disableNotification,d=r.sentTime,u=r.sentStatus),c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),E=s.isUnread,I=s.searchContent,p={senderUserId:n,messageType:f,content:R,messageDirection:a,sentTime:d,sentStatus:u,searchContent:I,isUnread:E,messageUId:"",disableNotification:l,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,p)];case 1:return T=o.sent(),h=T.code,C=T.data,h===e.ErrorCode.SUCCESS?[2,{code:h,data:w(C)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(h,",targetId:").concat(t.targetId)),[2,{code:h,msg:j[h]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(t,r){var s,a;return n(this,void 0,void 0,(function(){var i,c=this;return o(this,(function(d){if(!e.usingCppEngine())return[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}];if(!e.validate("messages",t,(function(t){return e.isArray(t)&&!(t.length<=0||t.length>=500)}),!0)||!e.validate("checkDuplicate",r,e.AssertRules.BOOLEAN))return[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];for(i in t)if(!(e.validate("message",t[i],e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",t[i].conversationType,(function(t){return[e.ConversationType.PRIVATE,e.ConversationType.DISCUSSION,e.ConversationType.GROUP,e.ConversationType.CUSTOMER_SERVICE,e.ConversationType.SYSTEM,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.PUBLIC_SERVICE].includes(t)}),!0)&&e.validate("message.targetId",t[i].targetId,e.AssertRules.STRING,!0)&&e.validate("message.senderUserId",t[i].senderUserId,e.AssertRules.STRING,!0)&&e.validate("message.messageType",t[i].messageType,e.AssertRules.STRING,!0)&&e.validate("message.content",t[i].content,e.AssertRules.OBJECT,!0)&&e.validate("message.messageDirection",t[i].messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("message.canIncludeExpansion",t[i].canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("message.expansion",t[i].expansion,e.AssertRules.OBJECT)&&e.validate("message.disableNotification",t[i].disableNotification,e.AssertRules.BOOLEAN)&&e.validate("message.sentTime",t[i].sentTime,e.AssertRules.NUMBER)&&e.validate("message.sentStatus",t[i].sentStatus,e.AssertRules.NUMBER)&&e.validate("options.isUnread",null===(s=t[i])||void 0===s?void 0:s.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null===(a=t[i])||void 0===a?void 0:a.searchContent,e.AssertRules.STRING)))return[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,msg:String(i)}];return[2,q((function(s){return n(c,void 0,void 0,(function(){var n,a,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.batchInsertMessage(t,r)];case 1:return n=o.sent(),a=n.code,i=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:j[a]}]}}))}))}))]}))}))},getMessageCount:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?[2,q((function(s){return n(r,void 0,void 0,(function(){var n,r,a,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,a=t.channelId,[4,s.getMessageCount(n,r,a)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:[2,{code:c,msg:j[c]}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("messageUId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getPrivateMessageDeliverTime(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(t)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",r,e.AssertRules.STRING,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getGroupMessageDeliverList(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(s,", targetId:").concat(t," messageUId:").concat(r)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("enableCheck",t,e.AssertRules.BOOLEAN)?[2,q((function(e){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,e.setCheckDuplicateMessage(t)];case 1:return[2,{code:n.sent().code}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return e.usingCppEngine()?[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"clearLocalData ->"),[4,r.clearData()];case 1:return t=o.sent(),n=t.code,a=t.data,[2,{code:n,data:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))}}),nt=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return e.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return e.ChatroomUserChangeType}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return e.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return e.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return e.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return e.FileType}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return e.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return e.LogLevel}}),Object.defineProperty(exports,"MentionedType",{enumerable:!0,get:function(){return e.MentionedType}}),Object.defineProperty(exports,"MessageBlockSourceType",{enumerable:!0,get:function(){return e.MessageBlockSourceType}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return e.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return e.MessageDirection}}),Object.defineProperty(exports,"NotificationLevel",{enumerable:!0,get:function(){return e.NotificationLevel}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return e.NotificationStatus}}),Object.defineProperty(exports,"RCConnectionStatus",{enumerable:!0,get:function(){return e.RCConnectionStatus}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return e.ReceivedStatus}}),Object.defineProperty(exports,"SentStatus",{enumerable:!0,get:function(){return e.SentStatus}}),Object.defineProperty(exports,"UltraGroupChannelChangeType",{enumerable:!0,get:function(){return e.UltraGroupChannelChangeType}}),Object.defineProperty(exports,"UltraGroupChannelType",{enumerable:!0,get:function(){return e.UltraGroupChannelType}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return e.UploadMethod}}),exports.BaseMessage=ne,exports.CombineMessage=ue,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=le,exports.GIFMessage=ge,exports.HQVoiceMessage=ie,exports.ImageMessage=ae,exports.LocationMessage=fe,exports.MentionedInfoBody=nt,exports.MessageType={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"},exports.ReferenceMessage=Re,exports.RichContentMessage=Ee,exports.SightMessage=ce,exports.TextMessage=de,exports.VoiceMessage=ve,exports.__addSDKVersion=function(t,n){e.VersionManage.add(t,n)},exports.addConversationsToTag=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"addTagForConversations ->tagId:".concat(t)),[4,a.addTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addEventListener=function(e,t,n){D.on(e,t,n)},exports.addTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagId",t.tagId,(function(e){return e.length<=10}))&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"createTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,s.createTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"createTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addToBlacklist=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"addToBlacklist -> userId: ".concat(t)),[4,s.addToBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.bindRTCRoomForChatroom=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("option.chatRoomId",t.chatRoomId,e.AssertRules.STRING,!0)&&e.validate("option.rtcRoomId",t.rtcRoomId,e.AssertRules.STRING,!0)?[2,q((function(e){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,e.bindRTCRoomForChatroom(t)];case 1:return[2,{code:n=o.sent(),msg:j[n]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearAllMessagesUnreadStatus=function(){return n(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,q((function(t,r){return n(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))},exports.clearEventListeners=J,exports.clearHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"clear message ->".concat(n)),[4,a.deleteRemoteMessageByTimestamp(t.conversationType,t.targetId,r,t.channelId)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"clear message ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearMessages=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return B("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),e.usingCppEngine()?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,a.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,s.clearMessages(n,r,i)];case 1:return(c=o.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(a.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.clearMessagesUnreadStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,s.clearUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"clear unreadMsgNum ->".concat(r)),n!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"clear unreadMsgNum fail ->".concat(n,":").concat(j[n],",").concat(r)),[2,{code:n,msg:j[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearTextMessageDraft=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"delete draft ->".concat(n)),[4,s.clearConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return(r=o.sent())===e.ErrorCode.SUCCESS?[2,{code:r}]:(a.warn(e.LogTagId.O,"delete draft fail ->".concat(r,":").concat(j[r],",").concat(n)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearUnreadCountByTimestamp=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,s=t.targetId,c=t.channelId,i.info(e.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(s,",conversationType:").concat(n)),[4,a.clearUnreadCountByTimestamp(n,s,r,c)];case 1:return(d=o.sent())===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(d,",targetId:").concat(s)),[2,{code:d,msg:j[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.connect=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return e.validate("token",t,e.AssertRules.STRING,!0)&&e.validate("reconnectKickEnable",r,e.AssertRules.BOOLEAN)?(n=i.createTraceId(),i.info(e.LogTagId.A_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:r}),n),[4,a.connect(t,!!r,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return s=o.sent(),c=s.code===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_CONNECT_R,JSON.stringify({code:s.code,userId:s.userId}),n),s.code===e.ErrorCode.SUCCESS?[2,{code:s.code,data:{userId:s.userId}}]:[2,{code:s.code,msg:j[s.code]}]}}))}))}))]}))}))},exports.deleteLocalMessagesByTimestamp=function(t,r,s){return n(this,void 0,void 0,(function(){var a,i,c,d=this;return o(this,(function(u){return B("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),e.usingCppEngine()?(a=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",a,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",s,e.AssertRules.BOOLEAN)?[2,q((function(u,l){return n(d,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,u.deleteMessagesByTimestamp(a,i,r,s,c)];case 1:return n=o.sent(),l.debug(e.LogTagId.A_DELETE_MESSAGES_S,JSON.stringify({code:n,conversationType:a,targetId:i,channelId:c,timestamp:r})),n===e.ErrorCode.SUCCESS?[2,{code:n}]:(l.warn(e.LogTagId.O,"deleteLocalMessagesByTimestamp ->code:".concat(n,",targetId:").concat(t.targetId)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.deleteMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("options",r,(function(t){return e.isArray(t)&&t.length}),!0)&&!r.some((function(t){return!e.validate("options.messageUId",t.messageUId,e.AssertRules.STRING,!0)||!e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)||!e.validate("options.messageDirection",t.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"delete messages ->".concat(n)),[4,a.deleteRemoteMessage(t.conversationType,t.targetId,r,t.channelId)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"delete message fail ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.destroy=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return V?(J(),[2,F()]):[2]}))}))},exports.disconnect=function(t){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),Z((function(e){return e.disconnect(t)}))},exports.electronExtension=et,exports.forceRemoveChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&ee(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.info(e.LogTagId.O,"force remove chatroom entry ->".concat(n)),[4,a.forceRemoveChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force remove chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.forceSetChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Q(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"force set chatroom entry ->".concat(n)),[4,a.forceSetChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force set chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllChatRoomEntries=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),a.debug(e.LogTagId.O,"get all chatroom entries->".concat(n)),[4,s.getAllChatroomEntries(t)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS&&c?[2,{code:i,data:c}]:(a.warn(e.LogTagId.O,"get all chatroom entries fail ->code+:".concat(j[i],",").concat(n)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllConversationState=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,q((function(e){return e.getAllConversationState()}))]}))}))},exports.getAllUltraGroupUnreadCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadCount",[4,r.getAllUltraGroupUnreadCount()];case 1:return n=o.sent(),a=n.code,i=n.data,s.debug(e.LogTagId.O,t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:(s.warn(e.LogTagId.O,"".concat(t," fail ->").concat(a,": ").concat(j[a])),[2,{code:a,msg:j[a]}])}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadMentionedCount",!0,[4,r.getAllUltraGroupUnreadCount(true)];case 1:return n=o.sent(),a=n.code,i=n.data,s.debug(e.LogTagId.O,t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:(s.warn(e.LogTagId.O,"".concat(t," fail ->").concat(a,": ").concat(j[a])),[2,{code:a,msg:j[a]}])}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,q((function(t,n){return n.debug(e.LogTagId.O,"getAllUnreadMentionedCount"),t.getAllUnreadMentionedCount()}))]}))}))},exports.getBlacklist=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getBlacklist -> "),[4,r.getBlacklist()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS&&a?[2,{code:n,data:a}]:(s.warn(e.LogTagId.O,"getBlacklist fail -> code: ".concat(n)),[2,{code:n}])}}))}))}))]}))}))},exports.getBlacklistStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getBlacklistStatus -> userId: ".concat(t)),[4,s.getBlacklistStatus(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:0===i}]:(a.warn(e.LogTagId.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(t)),[2,{code:r}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getBlockUltraGroupList=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return[4,r.getBlockUltraGroupList()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:a}]:(s.warn(e.LogTagId.O,"get block ultragroup ->".concat(n,":").concat(j[n])),[2,{code:n,msg:j[n]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,q((function(e){return e.getBlockConversationList()}))]}))}))},exports.getChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("key",r,(function(t){return e.isString(t)&&/[\w+=-]+/.test(t)&&t.length<=128}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom entry->".concat(n)),[4,a.getChatroomEntry(t,r)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom entry fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatRoomInfo=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.order",r.order,(function(e){return[0,1,2].includes(e)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom info ->".concat(n)),[4,a.getChatroomInfo(t,r.count,r.order)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom info fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatroomHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.timestamp",r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.order",r.order,(function(e){return 0===e||1===e}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom history message->".concat(n)),[4,a.getChatRoomHistoryMessages(t,r.count,r.order,r.timestamp)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return w(e)})),[2,{code:c,data:{list:u,hasMore:!!d.hasMore}}]):(i.warn(e.LogTagId.O,"get chatroom history message fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConnectionStatus=function(){return Z((function(e){return e.getConnectionStatus()}))},exports.getConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getConversation(t.conversationType,t.targetId,t.channelId||"")];case 1:return n=o.sent(),r=n.code,i=n.data,r!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"getConversation ->code:".concat(r,", targetId:").concat(t.targetId)),[2,{code:r,msg:j[r]}]):[2,{code:r,data:i?b(i):null}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationList=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options.count",null==t?void 0:t.count,e.AssertRules.NUMBER)&&e.validate("options.startTime",null==t?void 0:t.startTime,e.AssertRules.NUMBER)&&e.validate("options.order",null==t?void 0:t.order,e.AssertRules.NUMBER)&&e.validate("channelId",r,e.AssertRules.CHANNEL_ID)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getConversationList(null==t?void 0:t.count,void 0,null==t?void 0:t.startTime,null==t?void 0:t.order,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return b(e)}))}]:(i.warn(e.LogTagId.O,"get conversation list fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=W(a,t,"getConversationNotificationLevel"),[4,s.getConversationNotificationLevel(t.conversationType,t.targetId,t.channelId)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:c}]:(a.warn(e.LogTagId.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(j[i]," , ").concat(n)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,s.getConversationNotificationStatus(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationsFromTagByPage=function(r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.validate("tagId",r,e.AssertRules.STRING,!0)&&e.validate("count",s,e.AssertRules.NUMBER,!0)&&e.validate("startTime",a,e.AssertRules.NUMBER,!0)?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u;return o(this,(function(o){switch(o.label){case 0:return d.info(e.LogTagId.O,"getConversationListByTag ->tagId:".concat(r)),[4,c.getConversationListByTag(r,a,s)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:null==u?void 0:u.map((function(e){return function(e){return t(t({},b(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(d.warn(e.LogTagId.O,"getConversationListByTag ->code:".concat(i,",tagId:").concat(r)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getCurrentUserId=function(){return Z((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return Z((function(e){return e.getDeviceId()}))},exports.getFileToken=function(t,n,o,r){return q((function(s){return new Promise((function(a){s.getFileToken(t,n,o,r).then((function(t){a({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){a({code:e,msg:j[e]})}))}))}))},exports.getFileUrl=je,exports.getFirstUnreadMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getFirstUnreadMessage(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?(c=i&&w(i)||null,[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"insertMessage ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options.timestamp",null==r?void 0:r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,e.AssertRules.NUMBER)&&e.validate("options.order",null==r?void 0:r.order,(function(e){return 0===e||1===e}))&&e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==r?void 0:r.timestamp,count:null==r?void 0:r.count}),n),[4,a.getHistoryMessage(t.conversationType,t.targetId,null==r?void 0:r.timestamp,null==r?void 0:r.count,null==r?void 0:r.order,null==t?void 0:t.channelId,"",n)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return w(e)})),i.info(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageLength:u.length}),n),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageUIds:""}),n),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("messageId",t,(function(t){return e.isNumber(t)||e.isString(t)}),!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getMessage(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:w(i)}]:(a.warn(e.LogTagId.O,"getMessage ->code:".concat(r,",messageId:").concat(t)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getMessageReader=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u;return o(this,(function(o){switch(o.label){case 0:return n="messageUId:".concat(r,",targetId:").concat(t),c.debug(e.LogTagId.O,"get message reader ->".concat(n)),[4,i.getMessageReader(t,r,s)];case 1:return a=o.sent(),d=a.code,u=a.data,d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:(c.warn(e.LogTagId.O,"get message reader fail ->".concat(d,":").concat(j[d],",").concat(n)),[2,{code:d,msg:j[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getProxy=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return[4,r.getProxy()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS?[2,{code:n,data:a}]:(s.warn(e.LogTagId.O,"getProxy ->code:".concat(n)),[2,{code:n,msg:j[n]}])}}))}))}))]}))}))},exports.getRemoteHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options.timestamp",null==r?void 0:r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,e.AssertRules.NUMBER)&&e.validate("options.order",null==r?void 0:r.order,(function(e){return 0===e||1===e}))&&e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"get history message ->".concat(n)),[4,a.getRemoteHistoryMessages(t.conversationType,t.targetId,(null==r?void 0:r.timestamp)||0,(null==r?void 0:r.count)||20,(null==r?void 0:r.order)||0,t.channelId||"")];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return w(e)})),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.O,"get history message fail ->".concat(c,":").concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getServerTime=function(){return Z((function(e){return e.getServerTime()}))},exports.getTags=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return[4,r.getTagList()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:a}]:(s.warn(e.LogTagId.O,"getTagList ->code:".concat(n)),[2,{code:n,msg:j[n]}])}}))}))}))]}))}))},exports.getTagsFromConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getTagsForConversation ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,s.getTagsForConversation(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:[2,{code:r,msg:j[r]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTextMessageDraft=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"get draft ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i||""}]:(a.warn(e.LogTagId.O,"get draft fail ->".concat(r,":").concat(j[r],",").concat(c)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTopConversationList=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversationTypes",t,e.AssertRules.ARRAY)&&!(null==t?void 0:t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))&&e.validate("channelId",r,e.AssertRules.CHANNEL_ID)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getTopConversationList(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return b(e)}))}]:(i.warn(e.LogTagId.A_GET_TOP_CONVERSATION_LIST_E,"".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCount=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("includeMuted",t,e.AssertRules.BOOLEAN,!1)&&e.validate("conversationTypes",r,e.AssertRules.ARRAY,!1)&&!(null==r?void 0:r.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.debug(e.LogTagId.O,"get total unread count -> ConversationType:".concat(JSON.stringify(r)," includeMuted:").concat(t)),[4,a.getTotalUnreadCount("",r,t)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCount fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",r,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||r.some((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getTotalUnreadCountByLevels(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCountByLevels fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]}))}))},exports.getTotalUnreadMentionedCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",r,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||r.some((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getTotalUnreadCountByLevels(t,r,!0)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]}))}))},exports.getUltraGroupDefaultNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),a.debug(e.LogTagId.O,"".concat(n," -> ").concat(r)),[4,s.getUltraGroupDefaultNotificationLevel(t.targetId,t.channelId)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:(a.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(j[c]," , ").concat(r)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)?[2,q((function(s){return n(r,void 0,void 0,(function(){var n,r,a,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,a={targetId:n,channelId:r},[4,s.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:[2,{code:c,msg:j[c]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupList=function(t){return void 0===t&&(t={}),n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!1)&&e.validate("options.channelType",t.channelType,(function(t){return void 0!==e.UltraGroupChannelType[t]}),!1)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getUltraGroupList(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:i}]:(a.warn(e.LogTagId.O,"get ultragroup ->".concat(r,":").concat(j[r])),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupMessageListByMessageUId=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("msgs",r,e.AssertRules.ARRAY,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,s=t.conversationType,c=t.channelId,d=[],r.forEach((function(e){var t=e.sendTime,n=e.messageUId;d.push({sendTime:t,messageUId:n,channelId:c})})),u={targetId:n,conversationType:s,messages:d},[4,a.getUltraGroupMessageListByMessageUId(u)];case 1:if(l=o.sent(),g=l.code,v=l.data,g===e.ErrorCode.SUCCESS){for(R in f={},v)Object.prototype.hasOwnProperty.call(v,R)&&(f[R]=v[R]?w(v[R]):void 0);return[2,{code:e.ErrorCode.SUCCESS,data:f}]}return i.warn(e.LogTagId.O,"get UltraGroup MessageList by messageUId ->".concat(g,":").concat(j[g])),[2,{code:g,msg:j[g]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",r,e.AssertRules.ARRAY)&&!(null==r?void 0:r.some((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,a.getUltraGroupUnreadCountByTargetId(t,r)];case 1:return s=o.sent(),c=s.code,d=s.data,u="targetId: ".concat(t,", levels: ").concat(JSON.stringify(r)),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(u)),c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c,": ").concat(j[c],", ").concat(u)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",r,e.AssertRules.ARRAY)&&!(null==r?void 0:r.some((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.debug(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(t,", notificationLevels: ").concat(JSON.stringify(r))),[4,a.getUltraGroupUnreadMentionedCountByTargetId(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:c}]:(i.warn(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedMessages=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)&&e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.count",t.count,(function(t){return e.isNumber(t)&&t>0&&t<=50}),!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,i=t.sentTime,c=t.count,d={targetId:n,channelId:r,sentTime:i,count:c},[4,s.getUltraGroupUnreadMentionedMessages(d)];case 1:return u=o.sent(),l=u.code,g=u.data,l===e.ErrorCode.SUCCESS?[2,{code:l,data:g}]:(a.warn(e.LogTagId.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(l,": ").concat(j[l])),[2,{code:l,msg:j[l]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadConversationList=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY)||(null==t?void 0:t.some((function(t){return!e.validate("conversationType",t,e.isTypeInConversationList)})))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,a;return o(this,(function(o){switch(o.label){case 0:return[4,s.getUnreadConversationList(t)];case 1:return n=o.sent(),r=n.code,a=n.data,r===e.ErrorCode.SUCCESS&&a?[2,{code:0,data:a.map((function(e){return b(e)}))}]:[2,{code:r,msg:j[r]}]}}))}))}))]}))}))},exports.getUnreadCount=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"get unreadCount ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.O,"get unreadCount fail ->".concat(r,":").concat(j[r],",").concat(c)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadCountByTag=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("containMuted",r,e.AssertRules.BOOLEAN,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(t)),[4,a.getUnreadCountByTag(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getUnreadCountByTag ->code:".concat(s,",tagId:").concat(t)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedCount=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(n,o){return o.debug(e.LogTagId.O,"getUnreadMentionedCount".concat(t.targetId,",channelId:").concat(t.channelId)),n.getUnreadMentionedCount(t)}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedMessages=function(t){if(!e.usingCppEngine())return{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]};var n,o=t.conversationType,r=t.targetId,s=t.channelId;return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?(n=function(t){var n=t.getUnreadMentionedMessages(o,r,s),a=[];return n&&n.length&&n.forEach((function(e){return a.push(w(e))})),{code:e.ErrorCode.SUCCESS,data:a}},V?n(V,H,k):{code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT}):{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}},exports.init=function(t){!function(t){var n,o=t.appkey,r=t.navigators;V?H.warn(e.LogTagId.A_INIT_REPEAT_O):(e.assert("options.appkey",t.appkey,e.AssertRules.STRING,!0),e.assert("options.navigators",t.navigators,(function(t){return e.isArray(t)&&(0===t.length||t.every(e.isHttpUrl))})),k=t,V=e.APIContext.init((null===(n=t.__runtimeCreator__)||void 0===n?void 0:n.call(t))||x,{appkey:t.appkey,navigators:t.navigators||[],miniCMPProxy:t.customCMP||[],logOutputLevel:t.logOutputLevel,__reportLogLevel:t.__reportLogLevel,httpInMainProcess:!!t.httpInMainProcess,logExpireTime:t.logExpireTime}),(H=V.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),H.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:o,navigators:r,version:"5.7.2",commit:"4d508a986119ce3a6cf9e528a520ae05b651446d"})),V.assignWatcher(G))}(t)},exports.insertMessage=function(t,r,s){return void 0===s&&(s={}),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return B("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("options",s,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==s?void 0:s.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==s?void 0:s.searchContent,e.AssertRules.STRING)&&e.validate("content.senderUserId",r.senderUserId,e.AssertRules.STRING,!0)&&e.validate("content.messageType",r.messageType,e.AssertRules.STRING,!0)&&e.validate("content.content",r.content,e.AssertRules.OBJECT,!0)&&e.validate("content.messageDirection",r.messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("content.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("content.expansion",r.expansion,e.AssertRules.OBJECT)&&e.validate("content.disableNotification",r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("content.sentTime",r.sentTime,e.AssertRules.NUMBER)&&e.validate("content.sentStatus",r.sentStatus,e.AssertRules.NUMBER)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g,v,f,R,E,I,p,T,h,C,m;return o(this,(function(o){switch(o.label){case 0:return n=r.senderUserId,a=r.messageType,d=r.content,u=r.messageDirection,l=r.messageUId,g=r.canIncludeExpansion,v=r.expansion,f=r.disableNotification,R=r.sentTime,E=r.sentStatus,c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),I=s.isUnread,p=s.searchContent,T={senderUserId:n,messageType:a,content:d,messageDirection:u,sentTime:R,sentStatus:E,searchContent:p,isUnread:I,messageUId:l,disableNotification:f,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,T)];case 1:return h=o.sent(),C=h.code,m=h.data,C===e.ErrorCode.SUCCESS?[2,{code:C,data:w(m)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(C,",targetId:").concat(t.targetId)),[2,{code:C,msg:j[C]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return Z((function(n){return n.install(e,t)}))},exports.joinChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:r.count,joinExist:!1}),n),[4,a.joinChatroom(t,r.count,n)];case 1:return s=o.sent(),c=s===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==e.ErrorCode.SUCCESS?[2,{code:s,msg:j[s]}]:[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.joinExistChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:r.count,joinExist:!0}),n),[4,a.joinExistChatroom(t,r.count,n)];case 1:return s=o.sent(),c=s===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==e.ErrorCode.SUCCESS?[2,{code:s,msg:j[s]}]:[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.modifyMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("content",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.senderUserId,u=r.sentTime,l=r.canIncludeExpansion,g=r.channelId,v="conversationType:".concat(n,",targetId:").concat(s,",channelId:").concat(g,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update ultragroup message expansion ->".concat(v)),f={targetId:s,channelId:g,conversationType:n,fromUserId:d,sendTime:u,canIncludeExpansion:l,messageUId:c,content:t},[4,a.modifyMessage(f)];case 1:return(R=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"modify ultraGroup message ->".concat(R,":").concat(j[R])),[2,{code:R,msg:j[R]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.onceEventListener=function(e,t,n){D.once(e,t,n)},exports.quitChatRoom=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return n=a.createTraceId(),a.info(e.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,s.quitChatroom(t)];case 1:return r=o.sent(),i=r===e.ErrorCode.SUCCESS?"info":"warn",a[i](e.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),n),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:j[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.recallMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("options.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("options.sentTime",r.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.disableNotification",null==r?void 0:r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushConfig",null==r?void 0:r.pushConfig,e.AssertRules.OBJECT)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n={user:r.user,channelId:t.channelId||"",disableNotification:null==r?void 0:r.disableNotification,pushConfig:null==r?void 0:r.pushConfig,extra:r.extra,isDelete:r.isDelete},s="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId,",messageUId:").concat(r.messageUId),i.debug(e.LogTagId.O,"recall message ->".concat(s)),[4,a.recallMessage(t.conversationType,t.targetId,r.messageUId,r.sentTime,n)];case 1:return c=o.sent(),d=c.code,u=c.data,d===e.ErrorCode.SUCCESS&&u?[2,{code:d,data:w(u)}]:d===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"recall message fail ->".concat(d,":").concat(j[d],",").concat(s)),[2,{code:d,msg:j[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.registerMessageType=function(t,n,o,r,s){return Z((function(a,i){return e.assert("messageType",t,e.AssertRules.STRING,!0),e.assert("isPersited",n,e.AssertRules.BOOLEAN,!0),e.assert("isCounted",o,e.AssertRules.BOOLEAN,!0),e.assert("isStatusMessage",s,e.AssertRules.BOOLEAN,!1),e.assert("searchProps",r,e.AssertRules.ARRAY),i.info(e.LogTagId.A_REGTYP_O,JSON.stringify({messageType:t,isCounted:o,isStatusMessage:s,isPersited:n})),a.registerMessageType(t,n,o,r,s),oe(t,n,o)}))},exports.removeAllExpansionForUltraGroupMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("message",t,e.AssertRules.OBJECT,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(i),a.debug(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(l)),g={targetId:r,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:i,removeAll:!0},[4,s.expandUltraMessage(g)];case 1:return(v=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(a.warn(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(v,":").concat(j[v])),[2,{code:v,msg:j[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntries=function(r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("targetId",r,e.AssertRules.STRING,!0)&&te(s)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(r),c.info(e.LogTagId.O,"remove chatroom entry->".concat(n)),(a=t({},s)).entries=s.entries.map((function(e){return{key:e}})),[4,i.removeChatroomEntries(r,a)];case 1:return d=o.sent(),u=d.code,l=d.data,u!==e.ErrorCode.SUCCESS?(c.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(j[u],",").concat(n)),[2,{code:u,msg:j[u],data:l}]):[2,{code:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&ee(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"remove chatroom entry->".concat(n)),[4,a.removeChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,s.removeConversation(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"destroy conversation ->".concat(r)),n!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"destroy conversation fail ->".concat(n,":").concat(j[n],",").concat(r)),[2,{code:n,msg:j[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversationsFromTag=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,a.removeTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeEventListener=function(e,t,n){D.off(e,t,n)},exports.removeEventListeners=function(e){D.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("expansion",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.sentTime,u=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(s,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove expansion for ultragroup message ->".concat(g)),v={targetId:s,channelId:l,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:c,keys:t},[4,a.expandUltraMessage(v)];case 1:return(f=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"remove expansion for ultraGroup message ->".concat(f,":").concat(j[f])),[2,{code:f,msg:j[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeFromBlacklist=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"removeFromBlacklist -> userId: ".concat(t)),[4,s.removeFromBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeMessageExpansionForKey=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("keys",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",r.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("message.targetId",r.targetId,e.AssertRules.STRING,!0)&&e.validate("message.channelId",r.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("message.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("message.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.canIncludeExpansion,u=r.channelId,l="conversationType:".concat(n,",targetId:").concat(s,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove message expansion ->".concat(l)),[4,a.sendExpansionMessage({conversationType:n,targetId:s,messageUId:c,canIncludeExpansion:d,keys:t,channelId:u})];case 1:return(g=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove message expansion fail ->".concat(g,":").concat(j[g],",").concat(l)),[2,{code:g,msg:j[g]}]):[2,{code:g}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"removeTag ->tagId:".concat(t)),[4,s.removeTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagFromConversations=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,a.removeTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagsFromConversation=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("tagIds",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("tagId",t,e.AssertRules.STRING,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagsForConversation ->tagIds:".concat(r,",targetId:").concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.removeTagsForConversation(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(r)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.saveTextMessageDraft=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("draft",r,e.AssertRules.STRING,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set draft ->".concat(n)),[4,a.saveConversationMessageDraft(t.conversationType,t.targetId,r,t.channelId)];case 1:return(s=o.sent())===e.ErrorCode.SUCCESS?[2,{code:s}]:(i.warn(e.LogTagId.O,"set draft fail ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.searchConversationByContent=function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return B("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),e.usingCppEngine()?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u;return o(this,(function(o){switch(o.label){case 0:return d.info(e.LogTagId.O,"searchConversationByContent ->keyword:".concat(t)),[4,c.searchConversationByContent(t,s,a,r)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:u}]:(d.warn(e.LogTagId.O,"searchConversationByContent ->code:".concat(i,",keyword:").concat(t)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchMessages=function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return B("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("timestamp",s,e.AssertRules.NUMBER)&&e.validate("count",a,e.AssertRules.NUMBER)?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l;return o(this,(function(o){switch(o.label){case 0:return 1,[4,c.searchMessageByContent(t.conversationType,t.targetId,r,s,a,1,t.channelId)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?(l=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return l.push(w(e))})),[2,{code:i,data:{messages:l,count:null==u?void 0:u.count}}]):(d.warn(e.LogTagId.O,"searchMessages ->code:".concat(i,",targetId:").concat(t.targetId)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.sendFileMessage=We,exports.sendHQVoiceMessage=Qe,exports.sendImageMessage=Xe,exports.sendMessage=Ke,exports.sendReadReceiptMessage=function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("timestamp",s,e.AssertRules.NUMBER,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)?[2,q((function(c){return n(i,void 0,void 0,(function(){var n,i,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.PRIVATE,channelId:a},i=new ne("RC:ReadNtf",{messageUId:r,lastMessageSendTime:s,type:1}),[4,Ke(n,i)];case 1:return c=o.sent(),d=c.code,u=c.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptRequest=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,i,d,u;return o(this,(function(o){switch(o.label){case 0:return n="messageUId:".concat(r,",targetId:").concat(t),c.debug(e.LogTagId.O,"send read receipt message ->".concat(n)),a=new ne("RC:RRReqMsg",{messageUId:r}),[4,Ke({targetId:t,conversationType:e.ConversationType.GROUP,channelId:s},a)];case 1:return i=o.sent(),d=i.code,u=i.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptResponse=function(e,t,r){return n(this,void 0,void 0,(function(){return o(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))},exports.sendReadReceiptResponseV2=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageList",r,e.AssertRules.OBJECT,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)&&!Object.keys(r).some((function(t){return!e.validate(t,r[t],e.AssertRules.ARRAY)}))?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.GROUP,channelId:s},d=i.getNaviInfoFromCache(),0!==(u=(null==d?void 0:d.grpRRVer)||0)?[3,2]:(l=new ne("RC:RRRspMsg",{receiptMessageDic:r}),[4,Ke(n,l)]);case 1:return a=o.sent(),[3,4];case 2:return 1!==u?[3,4]:(g=[],Object.keys(r).forEach((function(e){r[e].forEach((function(e){-1===g.indexOf(e)&&g.push(e)}))})),g.length?[4,i.sendReadReceiptMessage(t,g,s)]:(c.warn(e.LogTagId.O,"Error in parameter messageList."),[2,{code:e.ErrorCode.PARAMETER_ERROR}]));case 3:a=o.sent(),o.label=4;case 4:return(v=a.code)===e.ErrorCode.SUCCESS?[2,{code:v}]:(c.warn(e.LogTagId.O,"send read receipt message fail ->".concat(v,":").concat(j[v])),[2,{code:v,msg:j[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendSightMessage=$e,exports.sendSyncReadStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var n,s,a,i;return o(this,(function(o){switch(o.label){case 0:return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("lastMessageSendTime",r,e.AssertRules.NUMBER,!0)?(n=new ne("RC:SRSMsg",{lastMessageSendTime:r}),[4,Ke(t,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return s=o.sent(),a=s.code,i=s.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))},exports.sendTextMessage=function(e,t,n){return Ke(e,new de(t),n)},exports.sendTypingStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("typingContentType",r,e.AssertRules.STRING,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l;return o(this,(function(o){switch(o.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:r},isStatusMessage:!0,channelId:t.channelId},s=i.createTraceId(),i.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),s),[4,a.sendMessage(t.conversationType,t.targetId,n,void 0,s)];case 1:return c=o.sent(),d=c.code,u=c.data,l=d===e.ErrorCode.SUCCESS?"info":"warn",i[l](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:d,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),s),d===e.ErrorCode.SUCCESS?[2,{code:d,data:w(u)}]:[2,{code:d,msg:j[d]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendUltraGroupTypingStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,s.sendUltraGroupTypingStatus(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(a.warn(e.LogTagId.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(j[n])),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntries=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&$(r)?r.entries.length>10?[2,z.CHATROOM_KV_STORE_OUT_LIMIT]:[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(n)),[4,a.setChatroomEntries(t,r)];case 1:return s=o.sent(),c=s.code,d=s.data,c!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c],data:d}]):[2,{code:c}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Q(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(n)),[4,a.setChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)&&e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(e,n){return X(n,t,(function(){return e.setConversationNotificationLevel(t.conversationType,t.targetId,r,t.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationStatus=function(t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("notificationStatus",r,(function(e){return 1===e||2===e}),!0)&&e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(e,n){return X(n,t,(function(){return e.setConversationStatus(t.conversationType,t.targetId,void 0,r,t.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTop=function(t,r){return void 0===r&&(r=!0),n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("isTop",r,e.AssertRules.BOOLEAN)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set conversation status ->".concat(n)),[4,a.setConversationStatus(t.conversationType,t.targetId,r,void 0,t.channelId)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set conversation status fail ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTopInTag=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversation",r,e.AssertRules.CONVERSATION,!0)&&e.validate("status.isTop",s,e.AssertRules.BOOLEAN,!0)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return c.info(e.LogTagId.O,"setConversationStatusInTag ->tagId:".concat(t,",targetId:").concat(r.targetId,",conversationType").concat(r.conversationType)),[4,i.setConversationStatusInTag(t,r,{isTop:s})];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(c.warn(e.LogTagId.O,"setConversationStatusInTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setMessageReceivedStatus=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return B("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus ->messageId:".concat(t,",receivedStatus:").concat(r)),[4,a.setMessageReceivedStatus(t,r)];case 1:return(n=o.sent())===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.setProxy=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"setProxy: ->".concat(t)),[4,s.setProxy(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"setProxy ->code:".concat(n)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setUltraGroupDefaultNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)&&e.validate("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return n="setUltraGroupDefaultNotificationLevel",s="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(s)),[4,a.setUltraGroupDefaultNotificationLevel(t.targetId,r,t.channelId)];case 1:return(c=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:c}]:(i.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(j[c]," , ").concat(s)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.testProxy=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"testProxy: ->".concat(t)),[4,a.testProxy(t,r)];case 1:return n=o.sent(),s=n.status,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,msg:c}]:(i.warn(e.LogTagId.O,"testProxy ->code:".concat(s)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.sentTime,u=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(s,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update expansion for ultragroup message ->".concat(g)),v={targetId:s,channelId:l,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:c,expansion:t},[4,a.expandUltraMessage(v)];case 1:return(f=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"update expansion for ultragroup message ->".concat(f,":").concat(j[f])),[2,{code:f,msg:j[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateMessageExpansion=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",r.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("message.targetId",r.targetId,e.AssertRules.STRING,!0)&&e.validate("message.channelId",r.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("message.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("message.expansion",r.expansion,e.AssertRules.OBJECT)&&e.validate("message.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.canIncludeExpansion,u=r.expansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(s,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update message expansion ->".concat(g)),[4,a.sendExpansionMessage({conversationType:n,targetId:s,messageUId:c,expansion:t,canIncludeExpansion:d,originExpansion:u,channelId:l})];case 1:return(v=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"update message expansion fail ->".concat(v,":").concat(j[v],",").concat(g)),[2,{code:v,msg:j[v]}]):[2,{code:v}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"updateTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,s.updateTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"updateTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))};
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@rongcloud/engine"),t=function(){return t=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},t.apply(this,arguments)};function n(e,t,n,o){return new(n||(n=Promise))((function(r,s){function a(e){try{c(o.next(e))}catch(e){s(e)}}function i(e){try{c(o.throw(e))}catch(e){s(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,i)}c((o=o.apply(e,t||[])).next())}))}function o(e,t){var n,o,r,s,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return s={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function i(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,i[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var r=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},s=r(),a=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 i,c={tag:"browser",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,i=t.body,c=e.appendUrl(t.url,s);return new Promise((function(e){var t=a(),s="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(n,c),r&&t.setRequestHeader)for(var d in r)t.setRequestHeader(d,r[d]);if(s){t.timeout=o,t.onload=function(){e({data:t.responseText,status:t.status||200})},t.onerror=function(){e({status:t.status})},t.ontimeout=function(){e({status:t.status})};var u="object"==typeof i?JSON.stringify(i):i;t.send(u)}else t.onreadystatechange=function(){4===t.readyState&&e({data:t.responseText,status:t.status})},t.onerror=function(){e({status:t.status})},setTimeout((function(){t.abort(),e({status:t.status})}),o),t.send(i)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:s,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.NetworkType.UNKONWN;return new Promise((function(e){e(r)}))}},d=r(),u=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},l={setItem:u("setStorageSync"),getItem:u("getStorageSync"),removeItem:u("removeStorageSync"),clear:u("clearStorageSync")},g={tag:"wechat",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){wx.request({url:i,method:n,header:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:l,sessionStorage:l,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:d,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},v=r(),f=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];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:f("setStorageSync"),getItem:f("getStorageSync"),removeItem:f("removeStorageSync"),clear:f("clearStorageSync")},E={tag:"alipay",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s),c=t.dataType||"json";return new Promise((function(t){my.request({url:i,method:n,headers:r,timeout:o,data:a,dataType:c,success:function(e){t({data:e.data,status:e.status})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:R,sessionStorage:R,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:v,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(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},I=r(),p=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},T={setItem:p("setStorageSync"),getItem:p("getStorageSync"),removeItem:p("removeStorageSync"),clear:p("clearStorageSync")},h={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:I,localStorage:T,sessionStorage:T,httpReq:function(t){return new Promise((function(n){tt.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},C=r(),m=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},S={setItem:m("setStorageSync"),getItem:m("getStorageSync"),removeItem:m("removeStorageSync"),clear:m("clearStorageSync")},A={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:C,localStorage:S,sessionStorage:S,httpReq:function(t){return new Promise((function(n,o){swan.request({url:t.url,data:t.body,header:t.headers,method:t.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(t){n({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))]}))}))}},O=r(),N=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},_={setItem:N("setStorageSync"),getItem:N("getStorageSync"),removeItem:N("removeStorageSync"),clear:N("clearStorageSync")},y={tag:"jingdong",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){jd.request({url:i,method:n,headers:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:_,sessionStorage:_,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(t){jd.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},M=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},U={setItem:M("setStorageSync"),getItem:M("getStorageSync"),removeItem:M("removeStorageSync"),clear:M("clearStorageSync")},L={tag:"uniapp",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,s=t.query,a=t.body,i=e.appendUrl(t.url,s);return new Promise((function(t){uni.request({url:i,method:n,header:r,timeout:o,data:a,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:U,sessionStorage:U,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={url:e,protocols:t},o=uni.connectSocket(n);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(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))}},P=function(e){return e&&e.request&&e.getSystemInfo},x="undefined"!=typeof uni&&P(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return L;case"mp-jd":return y;case"mp-baidu":return A;case"mp-toutiao":return h;case"mp-alipay":return E;case"mp-weixin":return g;default:return c}}():"undefined"!=typeof jd&&P(jd)?y:"undefined"!=typeof my&&P(my)?E:"undefined"!=typeof tt&&P(tt)?h:"undefined"!=typeof swan&&P(swan)?A:"undefined"!=typeof wx&&P(wx)?g:c;function w(t){var n=t.conversationType,o=t.channelId,r=t.messageType,s=t.content,a=t.senderUserId,i=t.targetId,c=t.sentTime,d=t.receivedTime,u=t.messageUId,l=t.messageDirection,g=t.isPersited,v=t.isCounted,f=t.isOffLineMessage,R=t.canIncludeExpansion,E=t.expansion,I=t.receivedStatus,p=t.disableNotification,T=t.isMentioned,h=t.isStatusMessage,C=t.readReceiptInfo,m=t.pushConfig,S=t.messageId,A=t.isInterrupt,O=t.isModifyMessage,N=t.channelType,_=t.sentStatus;I||(I=e.ReceivedStatus.UNREAD);var y={messageType:r,channelId:o||"",content:s,senderUserId:a,targetId:i,conversationType:n,sentTime:c,receivedTime:d,messageUId:u,messageDirection:l,isPersited:g,isCounted:v,isMentioned:T,disableNotification:p,isStatusMessage:h,canIncludeExpansion:R,expansion:E,receivedStatus:I,readReceiptInfo:C,pushConfig:m,messageId:S,isInterrupt:A,isModifyMessage:O,sentStatus:_};return n!==e.ConversationType.ULTRA_GROUP&&(y.isOffLineMessage=f),n===e.ConversationType.ULTRA_GROUP&&e.isNumber(N)&&(y.channelType=N),y}function b(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,s=e.hasMentioned,a=e.mentionedInfo,i=e.lastUnreadTime,c=e.notificationStatus,d=e.notificationLevel,u=e.isTop,l=e.channelId,g=e.unreadMentionedCount,v=e.matchCount;return{conversationType:t,targetId:n,latestMessage:o&&w(o),unreadMessageCount:r,hasMentioned:s,mentionedInfo:s?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:i,notificationStatus:c,notificationLevel:d,isTop:u,channelId:l,unreadMentionedCount:g,matchCount:v}}function B(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}exports.Events=void 0,(i=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",i.CONNECTED="CONNECTED",i.DISCONNECT="DISCONNECT",i.SUSPEND="SUSPEND",i.MESSAGES="MESSAGES",i.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",i.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",i.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",i.CONVERSATION="CONVERSATION",i.CHATROOM="CHATROOM",i.EXPANSION="EXPANSION",i.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",i.TAG="TAG",i.CONVERSATION_TAG="CONVERSATION_TAG",i.TYPING_STATUS="TYPING_STATUS",i.MESSAGE_BLOCKED="MESSAGE_BLOCKED",i.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",i.OPERATE_STATUS="OPERATE_STATUS",i.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",i.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",i.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",i.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",i.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",i.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",i.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",i.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",i.USER_GROUP_STATUS="USER_GROUP_STATUS";var D=new e.EventEmitter,G={connection:function(t,n){switch(t){case e.RCConnectionStatus.CONNECTED:D.emit(exports.Events.CONNECTED);break;case e.RCConnectionStatus.CONNECTING:D.emit(exports.Events.CONNECTING);break;case e.RCConnectionStatus.SUSPENDED:D.emit(exports.Events.SUSPEND,n);break;case e.RCConnectionStatus.DISCONNECTED:D.emit(exports.Events.DISCONNECT,n)}},batchMessage:function(e){D.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return w(e)}))})},typingState:function(e){D.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){D.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){D.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){D.emit(exports.Events.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(t){var n=t.map((function(t){var n=t.conversationType,o={conversationType:n,latestMessage:t.latestMessage?w(t.latestMessage):null,targetId:t.targetId,unreadMessageCount:t.unreadMessageCount,unreadMentionedCount:t.unreadMentionedCount,notificationStatus:t.notificationStatus,notificationLevel:t.notificationLevel,lastUnreadTime:t.lastUnreadTime,channelId:t.channelId};return n===e.ConversationType.ULTRA_GROUP?(o.versionTime=t.versionTime,{conversation:o}):(o.hasMentioned=t.hasMentioned,o.mentionedInfo=t.mentionedInfo,o.isTop=t.isTop,{conversation:o,updatedItems:t.updatedItems})}));D.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){D.emit(exports.Events.CHATROOM,e)},expansion:function(e){D.emit(exports.Events.EXPANSION,e)},pullFinished:function(){D.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){D.emit(exports.Events.TAG)},conversationTagChanged:function(){D.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){D.emit(exports.Events.MESSAGE_BLOCKED,e)},messageDelivered:function(e){D.emit(exports.Events.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){D.emit(exports.Events.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){D.emit(exports.Events.ULTRA_GROUP_ENABLE,e.map((function(e){return b(e)})))},operateStatus:function(e){D.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){D.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return w(e)})))},ultraGroupMessageModified:function(e){D.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return w(e)})))},ultraGroupMessageRecalled:function(e){D.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return w(e)})))},ultraGroupChannelChangeType:function(e){D.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){D.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){D.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){D.emit(exports.Events.USER_GROUP_STATUS,e)}};e.VersionManage.add("imlib-next","5.7.3");var V=null,k=null,H=null;function F(){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return V?(H.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),k=null,V=null,H=null,[2]}}))}))}function Z(e){if(!V)throw new Error("Not initialized yet!");return e(V,H,k)}function q(t){return V?t(V,H,k):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function J(){D.clear()}var z={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:e.ErrorCode.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:e.ErrorCode.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},j={};for(var K in z){var Y=z[K].code;j[Y]=K}z.ROAMING_SERVICE_UNAVAILABLE.code;var W=function(t,n,o){void 0===o&&(o="");var r="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return t.debug(e.LogTagId.O,"".concat(o," -> ").concat(r)),r},X=function(t,r,s,a){return void 0===a&&(a=""),n(void 0,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return n=W(t,r,a),[4,s()];case 1:return(i=o.sent())!==e.ErrorCode.SUCCESS?(t.warn(e.LogTagId.O,"".concat(a," fail -> ").concat(i," : ").concat(j[i]," , ").concat(n)),[2,{code:i,msg:j[i]}]):[2,{code:i}]}}))}))};var Q=function(t){return!!(e.validate("options.key",t.key,e.AssertRules.STRING,!0)&&e.validate("options.value",t.value,e.AssertRules.STRING,!0)&&e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)&&e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING))},$=function(t){return t.entries.every((function(t){return e.validate("entry.key",t.key,e.AssertRules.STRING,!0)&&e.validate("entry.value",t.value,e.AssertRules.STRING,!0)}))&&e.validate("options.isAutoDelete",t.isAutoDelete,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)&&e.validate("options.isForce",t.isForce,e.AssertRules.BOOLEAN)},ee=function(t){return e.validate("options.key",t.key,e.AssertRules.STRING,!0)&&e.validate("options.isSendNotification",t.isSendNotification,e.AssertRules.BOOLEAN)&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)},te=function(t){return t.entries.every((function(t){return e.validate("key",t,e.AssertRules.STRING,!0)}))&&e.validate("options.notificationExtra",t.notificationExtra,e.AssertRules.STRING)};var ne=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function oe(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new ne(e,o,t,n)}}var re,se,ae=oe("RC:ImgMsg"),ie=oe("RC:HQVCMsg"),ce=oe("RC:SightMsg"),de=oe("RC:TxtMsg"),ue=oe("RC:CombineMsg"),le=oe("RC:FileMsg"),ge=oe("RC:GIFMsg"),ve=oe("RC:VcMsg"),fe=oe("RC:LBSMsg"),Re=oe("RC:ReferenceMsg"),Ee=oe("RC:ImgTextMsg"),Ie={qiniu:function(t,n,o,r){Z((function(s){var a=s.getNaviInfoFromCache();if(1===(null==a?void 0:a.type)&&n.chunk_size&&r.size>n.chunk_size){var i=e.getUUID();i+=r.name.substr(r.name.lastIndexOf(".")),r.uniqueName=i,Ne(r,n,o)}else Oe(t,n,o,r)}))},baidu:function(e,t,n,o){if(o.size>Te.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=t||{};t=t||se;var s=new XMLHttpRequest,a=me();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var i=a+pe[0][1]+r.bosUploadPath;pe.shift();var c=r.bosHeader||{},d={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:i,isBosRes:!0};s.upload&&t.support_options&&(s.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});s.onreadystatechange=function(){if(4===s.readyState)if(JSON.parse(s.responseText||"{}").filename=t.uniqueValue,200===s.status){n.onCompleted(d,!0)}else pe.length?Ie[pe[0][0]](e,t,n,o):n.onError("upload fail")},s.open(t.method,i,!0),s.setRequestHeader("authorization",c.bosToken),s.setRequestHeader("x-bce-date",c.bosDate),s.send(o)},aliyun:function(t,n,o,r){if(r.size>Te.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var s=new FormData;s.set("file",t.get("file")),s.set("key",t.get("key")),s.set("token",t.get("token"));var a=pe[0][1];pe.shift(),t=t||re,n=(n=n||{})||se;var i=new XMLHttpRequest,c=me(),d="".concat(c+n.ossBucketName,".").concat(a);i.upload&&n.support_options&&(i.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var t=JSON.parse(i.responseText||"{}");t.name=n.uniqueValue,t.filename=n.uploadFileName,t.uploadMethod=e.UploadMethod?e.UploadMethod.ALI:"",200===i.status?o.onCompleted(t):pe.length?Ie[pe[0][0]](s,n,o,r):o.onError("upload fail")}},i.open(n.method,d,!0),console.log("ali:url",d);var u=n.aliHeader||{};t.set("OSSAccessKeyId",u.osskeyId),t.set("policy",u.ossPolicy),t.set("Signature",u.ossSign),t.set("success_action_status",200),t.delete("key"),t.append("key",n.uploadFileName),t.delete("file"),t.append("file",r),i.send(t)},s3:function(t,n,o,r){var s=new FormData,a=new XMLHttpRequest,i=me(),c=n.contentDisposition,d=pe[0][1],u="".concat(i+n.s3BucketName,".").concat(d);console.log("uploadS3:url",u),pe.shift(),a.upload&&n.support_options&&(a.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var s=JSON.parse(a.responseText||"{}");if(s.name=n.uniqueValue,s.filename=n.uploadFileName,s.uploadMethod=e.UploadMethod.AWS,200===a.status||204===a.status)o.onCompleted(s);else if(pe.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),Ie[pe[0][0]](i,n,o,r)}else o.onError("upload fail")}},a.open(n.method,u,!0);var l=n?n.s3Header:{},g=r&&r.type;c?s.set("Content-Disposition","".concat(c,";")):s.set("Content-Disposition","text/html"===g?"inline;":"attachment;");s.set("Content-Type",g),s.set("x-amz-credential",l.s3Credential),s.set("x-amz-algorithm",l.s3Algorithm),s.set("x-amz-date",l.s3Date),s.set("policy",l.s3Policy),s.set("x-amz-signature",l.s3Signature),s.set("key",n.uploadFileName),s.set("file",r),a.send(s)},stc:function(t,n,o,r){var s=new XMLHttpRequest,a=n.contentDisposition,i=pe[0][1],c="https://".concat(i,"/").concat(n.stcBucketName,"/").concat(n.uploadFileName);pe.shift(),s.upload&&n.support_options&&(s.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)});s.onreadystatechange=function(){if(4===s.readyState){var a=JSON.parse(s.responseText||"{}");if(a.name=n.uniqueValue,a.filename=n.uploadFileName,a.uploadMethod=e.UploadMethod?e.UploadMethod.STC:"",200===s.status||204===s.status)o.onCompleted(a);else if(pe.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),Ie[pe[0][0]](i,n,o,r)}else o.onError("upload fail")}},s.open("PUT",c,!0);var d=n?n.stcHeader:{};s.setRequestHeader("Content-Type",r.type),a?s.setRequestHeader("Content-Disposition","".concat(a,";")):s.setRequestHeader("Content-Disposition","text/html"===r.type?"inline;":"attachment;");s.setRequestHeader("Authorization",d.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",d.stcContentSha256),s.setRequestHeader("x-amz-date",d.stcDate),s.send(r)}},pe=[],Te={BOS_CHUNCK_SIZE:5368709120},he="http://",Ce="https://";function me(){var e=Ce;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=he),e}var Se,Ae=(Se="RC-upload-",{get:function(e){e=Se+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=Se+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=Se+e,localStorage.removeItem(e)}});function Oe(t,n,o,r){var s=Ce+n.uploadHost.qiniu,a=(/http/.test(pe[0][1])?"":me())+pe[0][1]||s;n.isChunk||pe.shift();var i=new XMLHttpRequest;i.upload&&n.support_options&&(i.upload.onprogress=function(e){o.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var s=JSON.parse(i.responseText||"{}");s.filename=n.uniqueValue,s.uploadMethod=e.UploadMethod?e.UploadMethod.QINIU:"",200===i.status||204===i.status?o.onCompleted(s):pe.length?Ie[pe[0][0]](t,n,o,r):o.onError("upload fail")}},i.open(n.method,a,!0),o.onOpen(i),n.stream&&i.setRequestHeader("authorization","UpToken ".concat(n.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(n.headers,(function(e,t){i.setRequestHeader(e,t)})),i.send(t)}function Ne(t,n,o,r){var s=0,a=r||e.getUUID(),i=Ae.get(a);i&&(t.uniqueName=i.sessionId,s=i.offset);var c=Math.min(n.chunk_size,t.size-s),d=t.slice(s,s+c),u=t.uniqueName;n.multi_parmas.name=u,n.filesize=t.size;var l="bytes=".concat(s,"-").concat(s+c);n.headers={Range:l,"X-File-TransactionId":u,"X-File-Total-Size":t.size},n.isChunk=!0,d.name=t.name,d=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var s=t.multi_parmas[r];o.append(r,s)}return o}(d,n,t.uniqueName),Oe(d,n,{onCompleted:function(e){s+=c;var r=t.uniqueName;Ae.set(a,{offset:s,sessionId:r}),s<t.size?Ne(t,n,o,a):(s=0,Ae.remove(a),o.onCompleted(e))},onError:function(e){console.error(e),o.onError(e)},onProgress:function(e,t){var r=e+s;o.onProgress(r,n.filesize)},onOpen:function(e){o.onOpen(e)}},t)}function _e(t,n,o,r){var s,a,i=n&&n.type||"text/plain",c=i.indexOf("image")>-1?1:4,d=o.contentDisposition,u=Math.ceil(n.size/o.stc_chunk_size),l=o&&JSON.parse(o.ossConfig?o.ossConfig:"");Array.isArray(l)||(l=[]);var g=l.find((function(e){return Object.keys(e).includes("stc")})),v="uploads";t.getFileToken(c,s,"POST",v).then((function(e){s=e.fileName,a="https://".concat(g.stc,"/").concat(o.stcBucketName,"/").concat(s),console.log("uploadStcMultipart:url",a);var t=new XMLHttpRequest;t.open("POST","".concat(a,"?").concat(v),!0),d?t.setRequestHeader("Content-Disposition","".concat(d,";")):t.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),t.setRequestHeader("Authorization",e&&e.stcAuthorization),t.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),t.setRequestHeader("x-amz-date",e&&e.stcDate),t.setRequestHeader("Content-Type",i),t.send(),t.onreadystatechange=function(){if(4===t.readyState){var e=t.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===t.status||204===t.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(I(e,n));E(e,t)}(Array.isArray(e)&&e[1]):r.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));var f=[],R=new Map;function E(d,l){l&&Array.isArray(l)&&0!==l.length&&Promise.all(l).then((function(){var l="uploadId=".concat(d);if(R.size===u)t.getFileToken(c,s,"POST",l).then((function(t){console.log("onSuccess",t),console.log("onSuccess:uploadId",d);var s=new XMLHttpRequest;s.open("POST","".concat(a,"?").concat(l),!0),s.setRequestHeader("Authorization",t&&t.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",t&&t.stcContentSha256),s.setRequestHeader("x-amz-date",t&&t.stcDate),s.setRequestHeader("Content-Type",i);var c="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(R.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",u),u.forEach((function(e){c+="<Part><ETag>".concat(R.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),c+="</CompleteMultipartUpload>",s.send(c),console.log("xml",c),s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status||204===s.status){var t={name:n.name,filename:o.uploadFileName,uploadMethod:e.UploadMethod.STC};r.onCompleted(t)}else r.onError("uploadStcMultipart:upload does not end")}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));else{for(var g=[],v=0,p=f;v<p.length;v++){var T=p[v];g.push(I(d,T))}E(d,g)}}),(function(e){console.error(e),r.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,o=f;n<o.length;n++){var s=o[n];t.push(I(d,s))}E(d,t)}))}function I(e,r){return new Promise((function(d,u){var l="partNumber=".concat(r,"&uploadId=").concat(e);t.getFileToken(c,s,"PUT",l).then((function(e){console.log("signature ".concat(r," onSuccess"),e);var t=n&&n.slice((r-1)*o.stc_chunk_size,r*o.stc_chunk_size);console.log("fileChunk:size",t.size);var s=new XMLHttpRequest;s.open("PUT","".concat(a,"?").concat(l),!0),s.setRequestHeader("Authorization",e&&e.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),s.setRequestHeader("x-amz-date",e&&e.stcDate),s.setRequestHeader("Content-Type",i),s.send(t),s.onreadystatechange=function(){if(4===s.readyState)if(200===s.status||204===s.status){var e=s.getResponseHeader("etag");console.log("etag:".concat(r),e),R.set(r,e),d(e)}else f.includes(r)||f.push(r),u(r)}}),(function(e){console.log("getETags:签名验证失败"),f.includes(r)||f.push(r),u(r)}))}))}}var ye={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Me()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),Ue(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Me()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,Ue(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Me(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function Ue(e,t){for(var n in e)t(n,e[n])}var Le,Pe=0,xe=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:ye.form,genUId:Me};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;Ue(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){re=n,se=o,pe=[];var s,a=e.getNaviInfoFromCache();if(1===(null==a?void 0:a.type)&&t.uploadDomain)pe=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var i,c,d=JSON.parse(o.ossConfig),u="",l=[];d.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(u=e[n]),"s3"===n&&(i=e[n]),"stc"===n&&(c=e[n]),"p"!==n&&(l[t]=[n,e[n]])})),l.forEach((function(e){e&&pe.push(e)})),d.length!==pe.length&&(pe=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",u],["s3",i],["stc",c]])}else pe=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var g=o&&JSON.parse(o.ossConfig);Array.isArray(g)||(g=[]),s=g.find((function(e){return Object.keys(e).includes("stc")}))}if(s&&1===parseInt(s.p,10)&&n.size>=4194304)_e(e,n,o,r);else{var v=o.data(n,o);Ie[pe[0][0]](v,o,r,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(Le=e,n)?Le=Pe+e/t*(t-Pe):Pe=Le;o.onProgress(Le,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var we,be,Be={init:function(e){return new xe(e)},dataType:ye,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,s=new Image;s.src=r;var a=s.width,i=s.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var s=e.height,a=t.maxHeight||0;if(a>0&&s>a){var i=a/s;n=Math.min(n,i)}var c=t.maxSize||0,d=Math.ceil(e.size/1e3);if(d>c){var u=c/d;n=Math.min(n,u)}return n}({width:a,height:i,size:e.total},t),d=r;c<1&&(d=function(e,t,n){o.width=t,o.height=n;var r=o.getContext("2d");return r.drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(s,a*c,i*c)),n(d)}},Upload:xe},De=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),s=new Image,a="string"==typeof e;s.onload=function(a){var i=function(e,t,n){var o,r,s,a=e<t,i=0,c=0;return(a?t/e:e/t)>n.scale?(a?(r=100,c=((s=t/(o=e/100))-n.maxHeight)/2):(s=100,i=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:s,x:-i,y:-c}):(a?(o=t/n.maxHeight,s=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,s=t/o),{w:r,h:s,x:-i,y:-c})}(s.width,s.height,t);o.width=i.w>t.maxWidth?t.maxWidth:i.w,o.height=i.h>t.maxHeight?t.maxHeight:i.h,r.drawImage(s,i.x,i.y,i.w,i.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},s.src=a?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},Ge=function(e,t){var n=e.file,o=e.compress;De(n,o,t)},Ve=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=Be.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Be.init(e);t(n)}},ke=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||Ge;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},He=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){ke(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Fe=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};ke(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Ze={initFile:function(e,t){Ve(e,(function(e){var n=new He(e);t(n)}))},initImage:function(e,t){Ve(e,(function(n){var o,r,s,a,i={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(s=e.thumbnailConfig)||void 0===s?void 0:s.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new Fe(n,i);t(c)}))},dataType:Be.dataType};function qe(r,s,a,i,c,d,u){var l=this;void 0===c&&(c=e.FileType.FILE);var g=4;c===e.FileType.IMAGE&&(g=e.FileType.IMAGE);var v=r.getNaviInfoFromCache();if(!be&&(be="upload.qiniup.com",v&&v.ossConfig))try{var f=JSON.parse(v.ossConfig).find((function(e){return void 0!==e.qiniu}));f&&(be=f.qiniu)}catch(e){}var R=t({domain:be,getToken:function(e){r.getFileToken(g).then((function(t){e(t.token,t)})).catch((function(e){d.onFail(e)}))}},u),E=Ze.initFile;g===e.FileType.IMAGE&&(E=Ze.initImage),E(R,(function(s){s.upload(r,a,i,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=d.onProgress)||void 0===n||n.call(d,o)},onCompleted:function(r){return n(l,void 0,void 0,(function(){return o(this,(function(n){return 1===(null==v?void 0:v.type)?(function(n,o,r,s,a,i){var c={type:s.type,name:a.rc_url.file_name,downloadUrl:n.uploadDomain+a.rc_url.path};if(o===e.FileType.AUDIO)return void Je(s).then((function(e){i.onSuccess(t(t({},c),e))}));o===e.FileType.IMAGE&&(c.thumbnail=a.thumbnail);i.onSuccess(c)}(a,c,0,i,r,d),[2]):(function(n,o,r,s,a){je(o,s.filename,s.name,s,s.uploadMethod).then((function(i){if(0===i.code){var c=i.data;c.type=r.type,c.name=s.name||s.filename,n!==e.FileType.AUDIO?(o===e.FileType.IMAGE&&(c.thumbnail=s.thumbnail),a.onSuccess(c)):Je(r).then((function(e){a.onSuccess(t(t({},c),e))}))}else a.onFail(i)})).catch((function(e){a.onFail(e)}))}(c,g,i,r,d),[2])}))}))},onError:function(e){d.onFail(e)}})}))}function Je(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?ze(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(ze).then((function(e){t(e)}))}))}function ze(e){return we=we||new AudioContext,new Promise((function(t,n){we.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function je(t,n,o,r,s){return e.validate("fileType",t,e.isValidFileType,!0)&&e.validate("filename",n,e.AssertRules.STRING)&&e.validate("saveName",o,e.AssertRules.STRING)&&e.validate("serverType",s,e.AssertRules.NUMBER)?q((function(a){return new Promise((function(i){a.getFileUrl(t,n,o,r,s).then((function(t){i({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){i({code:e})}))}))})):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER})}function Ke(r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g,v,f,R,E,I,p,T;return o(this,(function(o){switch(o.label){case 0:return a=a||{},s instanceof ne==!1?(d.warn(e.LogTagId.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,z.ILLGAL_PARAMS]):e.validate("conversation",r,e.AssertRules.OBJECT,!0)?(n=r.conversationType,i=r.targetId,u=r.channelId,e.validate("conversation.targetId",i,e.AssertRules.STRING,!0)&&e.validate("conversation.conversationType",n,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",u,e.AssertRules.CHANNEL_ID)&&e.validate("options.isStatusMessage",null==a?void 0:a.isStatusMessage,e.AssertRules.BOOLEAN)&&e.validate("options.disableNotification",null==a?void 0:a.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushContent",null==a?void 0:a.pushContent,e.AssertRules.STRING)&&e.validate("options.pushData",null==a?void 0:a.pushData,e.AssertRules.STRING)&&e.validate("options.isMentioned",null==a?void 0:a.isMentioned,e.AssertRules.BOOLEAN)&&e.validate("options.mentionedType",null==a?void 0:a.mentionedType,e.AssertRules.NUMBER)&&e.validate("options.mentionedUserIdList",null==a?void 0:a.mentionedUserIdList,e.AssertRules.ARRAY)&&e.validate("options.directionalUserIdList",null==a?void 0:a.directionalUserIdList,e.AssertRules.ARRAY)&&e.validate("options.isVoipPush",null==a?void 0:a.isVoipPush,e.AssertRules.BOOLEAN)&&e.validate("options.canIncludeExpansion",null==a?void 0:a.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("options.expansion",null==a?void 0:a.expansion,e.AssertRules.OBJECT)&&e.validate("options.pushConfig",null==a?void 0:a.pushConfig,e.AssertRules.OBJECT)&&e.validate("options.messageId",null==a?void 0:a.messageId,e.AssertRules.NUMBER)?(l="conversationType:".concat(n,",targetId:").concat(i),d.debug(e.LogTagId.O,"send message ->".concat(l)),g=function(e,n,o){var r=e.isStatusMessage,s=e.disableNotification,a=e.pushContent,i=e.pushData,c=e.isMentioned,d=e.mentionedType,u=e.mentionedUserIdList,l=e.directionalUserIdList,g=e.isVoipPush,v=e.canIncludeExpansion,f=e.expansion,R=e.isFilerWhiteBlacklist,E=e.pushConfig,I=e.messageId,p=o.channelId;return t({isStatusMessage:r,disableNotification:s,pushContent:a,pushData:i,isMentioned:c,mentionedType:d,mentionedUserIdList:u,directionalUserIdList:l,isVoipPush:g,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:R,pushConfig:E,channelId:p||"",messageId:I},n)}(a,s,r),v={isMentioned:!!a.isMentioned,content:s.content,messageType:s.messageType,isPersited:!!s.isPersited,isCounted:!!s.isCounted,disableNotification:!!(null==a?void 0:a.disableNotification),canIncludeExpansion:!!(null==a?void 0:a.canIncludeExpansion),expansion:(null==a?void 0:a.expansion)||null,conversationType:r.conversationType,targetId:r.targetId,channelId:r.channelId,senderUserId:c.getCurrentUserId(),messageUId:"",messageDirection:e.MessageDirection.SEND,receivedTime:0,isStatusMessage:!!a.isStatusMessage,receivedStatus:e.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:null==a?void 0:a.pushConfig,sentStatus:e.SentStatus.SENDING},n!==e.ConversationType.ULTRA_GROUP&&(v.isOffLineMessage=!1),f=d.createTraceId(),R=function(t){v.messageId=t;try{(null==a?void 0:a.onSendBefore)&&a.onSendBefore(w(v))}catch(t){d.error(e.LogTagId.O,'Callback method "onSendBefore" execution error.\n'.concat(null==t?void 0:t.stack),f)}},d.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:s.messageType,conversationType:n,targetId:i,channelId:u}),f),[4,c.sendMessage(n,i,g,R,f)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=o.sent(),I=E.code,p=E.data,I===e.ErrorCode.SUCCESS?(d.info(e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:I,messageUId:p.messageUId,messageId:p.messageId}),f),T=w(p),[2,{code:I,data:T}]):(d.warn(e.LogTagId.A_SEND_MSG_R,"send message fail ->".concat(I,":").concat(j[I],",").concat(l)),v.sentTime=(null==p?void 0:p.sentTime)||0,v.sentStatus=null==p?void 0:p.sentStatus,[2,{code:I,msg:j[I],data:w(v)}])}}))}))}))]}))}))}function Ye(t,n){return function(o,r,s,a){if(!e.validate("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});var i={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(e.validate("sendOptions.maxHeight",null==c?void 0:c.maxHeight,e.AssertRules.NUMBER)&&e.validate("sendOptions.maxWidth",null==c?void 0:c.maxWidth,e.AssertRules.NUMBER)&&e.validate("sendOptions.quality",null==c?void 0:c.quality,e.AssertRules.NUMBER)&&e.validate("sendOptions.scale",null==c?void 0:c.scale,e.AssertRules.NUMBER)))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});i.thumbnailConfig=c}return q((function(c,d,u){return new Promise((function(l){var g=d.createTraceId();d.info(e.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:r.file.size,type:t}),g),qe(c,0,u,r.file,t,{onProgress:null==s?void 0:s.onProgress,onSuccess:function(t){var i,c=(null===(i=null==s?void 0:s.onComplete)||void 0===i?void 0:i.call(s,{url:t.downloadUrl}))||n(t,r);t&&t.downloadUrl&&d.info(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:t.downloadUrl,code:e.ErrorCode.SUCCESS}),g),Ke(o,c,a).then(l)},onFail:function(t){d.warn(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({code:e.ErrorCode.UPLOAD_FILE_FAILED}),g),l({code:e.ErrorCode.UPLOAD_FILE_FAILED,msg:t||e.ErrorCode[e.ErrorCode.UPLOAD_FILE_FAILED]})}},i)}))}))}}var We=Ye(e.FileType.FILE,(function(e,t){return new le({name:e.name,size:t.file.size,type:(n=e.name,o=n.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl,user:t.user,extra:t.extra});var n,o})),Xe=Ye(e.FileType.IMAGE,(function(e,t){return new ae({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),Qe=Ye(e.FileType.AUDIO,(function(e,t){return new ie({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),$e=Ye(e.FileType.SIGHT,(function(e,t){return new ce({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));Ye(e.FileType.COMBINE_HTML,(function(e,t){return new ue({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var et=Object.freeze({__proto__:null,getAllConversationList:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("channelId",t,e.AssertRules.CHANNEL_ID)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getAllConversationList -> channelId: ".concat(t)),e.isUndefined(t)?[4,s.getConversationListWithAllChannel()]:[3,2];case 1:return n=o.sent(),[3,4];case 2:return[4,s.getConversationList(void 0,void 0,void 0,void 0,t)];case 3:n=o.sent(),o.label=4;case 4:return r=n.code,i=n.data,r===e.ErrorCode.SUCCESS&&i?(c=i.map((function(e){return b(e)})),[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(t)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversationList:function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("startTime",t,e.AssertRules.NUMBER,!0)&&e.validate("count",r,e.AssertRules.NUMBER,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n="startTime: ".concat(t,", count: ").concat(r,", channelId: ").concat(s),c.info(e.LogTagId.O,"getConversationList -> ".concat(n)),e.isUndefined(s)?[4,i.getConversationListWithAllChannelByPage(t,r)]:[3,2];case 1:return a=o.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(d,t,r,s)];case 3:a=o.sent(),o.label=4;case 4:return u=a.code,l=a.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return b(e)})),[2,{code:u,data:g}]):(c.warn(e.LogTagId.O,"getConversationList fail -> code: ".concat(u," ").concat(n)),[2,{code:u,msg:j[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent:function t(r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.usingCppEngine()?e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("messageTypes",s,e.AssertRules.ARRAY,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)&&!s.some((function(t){return!e.validate("messageType",t,e.AssertRules.STRING,!0)}))?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n="keyword: ".concat(r,", messageTypes: ").concat(JSON.stringify(s),", channelId: ").concat(a),d.info(e.LogTagId.O,"searchConversationByContent -> ".concat(t)),e.isUndefined(a)?[4,c.searchConversationByContentWithAllChannel(r,s)]:[3,2];case 1:return i=o.sent(),[3,4];case 2:return[4,c.searchConversationByContent(r,s,a)];case 3:i=o.sent(),o.label=4;case 4:return u=i.code,l=i.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return b(e)})),[2,{code:u,data:g}]):(d.warn(e.LogTagId.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(n)),[2,{code:u,msg:j[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessages:function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("startTime",s,e.AssertRules.NUMBER,!0)&&e.validate("count",a,e.AssertRules.NUMBER,!0)?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l,g,v,f,R,E,I;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", keyword: ").concat(r,", timestamp: ").concat(s,", count: ").concat(a),d.info(e.LogTagId.O,"searchMessages -> ".concat(n)),i=t.targetId,u=t.conversationType,l=t.channelId,e.isUndefined(l)?[4,c.searchMessageByContentWithAllChannel(u,i,r,s,a)]:[3,2];case 1:return g=o.sent(),[3,4];case 2:return 0,[4,c.searchMessageByContent(u,i,r,s,a,0,l)];case 3:g=o.sent(),o.label=4;case 4:return v=g.code,f=g.data,v===e.ErrorCode.SUCCESS&&f?(R=f.messages,E=f.count,I=R.map((function(e){return w(e)})),[2,{code:v,data:{messages:I,count:E}}]):(d.warn(e.LogTagId.O,"searchMessages fail -> code: ".concat(v," ").concat(n)),[2,{code:v,msg:j[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",r,e.AssertRules.OBJECT,!0)&&e.validate("option.keyword",r.keyword,e.AssertRules.STRING,!0)&&e.validate("option.startTime",r.startTime,e.AssertRules.NUMBER,!0)&&e.validate("option.endTime",r.endTime,e.AssertRules.NUMBER,!0)&&e.validate("option.offset",r.offset,e.AssertRules.NUMBER)&&e.validate("option.limit",r.limit,e.AssertRules.NUMBER)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R,E;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"searchMessageInTimeRange -> ".concat(n)),s=t.conversationType,c=t.targetId,d=r.keyword,u=r.startTime,l=r.endTime,g=r.offset,v=r.limit,g=g||0,v=v||5,[4,a.searchMessageByContentInTimeRangeWithAllChannel(s,c,d,u,l,g,v)];case 1:return f=o.sent(),R=f.code,E=f.data,R===e.ErrorCode.SUCCESS&&E?[2,{code:R,data:{messages:E.messages.map((function(e){return w(e)}))}}]:(i.warn(e.LogTagId.O,"searchMessageInTimeRange fail -> code: ".concat(R,", ").concat(n)),[2,{code:R}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",r,e.AssertRules.OBJECT,!0)&&e.validate("option.count",r.count,e.AssertRules.NUMBER)&&e.validate("option.timestamp",r.timestamp,e.AssertRules.NUMBER)&&e.validate("option.order",r.order,(function(e){return[0,1].includes(e)}))&&e.validate("option.messageTypes",r.messageTypes,e.AssertRules.ARRAY,!0)&&!r.messageTypes.some((function(t){return!e.validate("option.messageType",t,e.AssertRules.STRING,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R,E,I,p,T,h;return o(this,(function(o){switch(o.label){case 0:return n=r.count,s=r.timestamp,c=r.order,d=r.messageTypes,u="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),l=t.conversationType,g=t.targetId,v=t.channelId,n||(n=20),s||(s=0),c||(c=0),v||(v=""),[4,a.getHistoryMessagesByObjectNames(l,g,s,n,d,c,v)];case 1:return f=o.sent(),R=f.code,E=f.data,R===e.ErrorCode.SUCCESS?(p=(I=E).list,T=I.hasMore,h=p.map((function(e){return w(e)})),[2,{code:R,data:{messages:h,hasMore:T,list:h}}]):(i.warn(e.LogTagId.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(R," ").concat(u)),[2,{code:R,msg:j[R]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="conversation: ".concat(JSON.stringify(t),", timestamp: ").concat(r),i.info(e.LogTagId.O,"updateSentMsgReceiptStatus -> ".concat(n)),s=t.conversationType,c=t.targetId,d=t.channelId,[4,a.setMessageStatusToRead(s,c,r,d)];case 1:return[2,o.sent()]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,(function(t){return!e.isUndefined(e.ReceivedStatus[t])}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus -> messageId: ".concat(t,", receivedStatus: ").concat(r)),[4,a.setMessageReceivedStatus(t,r)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("sentStatus",r,(function(t){return!e.isUndefined(e.SentStatus[t])}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return i.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", sentStatus: ").concat(r)),[4,a.setMessageSentStatus(t,r)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageContent:function(t,r,s){return void 0===s&&(s=""),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("content",r,e.AssertRules.OBJECT,!0)&&e.validate("messageType",s,e.AssertRules.ONLY_STRING,!0)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return c.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", messageType: ").concat(s)),[4,i.setMessageContent(t,r,s)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?!e.validate("messageIds",t,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("messageId",t,e.AssertRules.NUMBER,!0)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(s,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(t))),[4,s.deleteMessages(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,a.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,s.clearMessages(n,r,i)];case 1:return(c=o.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(a.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(t,r,s){return n(this,void 0,void 0,(function(){var a,i,c,d=this;return o(this,(function(u){return e.usingCppEngine()?(a=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",a,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",s,e.AssertRules.BOOLEAN)?[2,q((function(t,u){return n(d,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,t.deleteMessagesByTimestamp(a,i,r,s,c)];case 1:return(n=o.sent())===e.ErrorCode.SUCCESS?[2,{code:n}]:(u.warn(e.LogTagId.O,"deleteMessagesByTimestamp ->code:".concat(n,",targetId:").concat(i)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},insertMessage:function(t,r,s){return void 0===s&&(s={}),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("options",s,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==s?void 0:s.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==s?void 0:s.searchContent,e.AssertRules.STRING)&&(r instanceof ne||e.validate("message.senderUserId",r.senderUserId,e.AssertRules.STRING,!0)&&e.validate("message.messageType",r.messageType,e.AssertRules.STRING,!0)&&e.validate("message.content",r.content,e.AssertRules.OBJECT,!0)&&e.validate("message.messageDirection",r.messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("message.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("message.expansion",r.expansion,e.AssertRules.OBJECT)&&e.validate("message.disableNotification",r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("message.sentTime",r.sentTime,e.AssertRules.NUMBER)&&e.validate("message.sentStatus",r.sentStatus,e.AssertRules.NUMBER))?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g,v,f,R,E,I,p,T,h,C;return o(this,(function(o){switch(o.label){case 0:return n="",a=1,g=!1,f=r.messageType,R=r.content,r instanceof ne||(n=r.senderUserId,a=r.messageDirection,g=r.canIncludeExpansion,v=r.expansion,l=r.disableNotification,d=r.sentTime,u=r.sentStatus),c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),E=s.isUnread,I=s.searchContent,p={senderUserId:n,messageType:f,content:R,messageDirection:a,sentTime:d,sentStatus:u,searchContent:I,isUnread:E,messageUId:"",disableNotification:l,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,p)];case 1:return T=o.sent(),h=T.code,C=T.data,h===e.ErrorCode.SUCCESS?[2,{code:h,data:w(C)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(h,",targetId:").concat(t.targetId)),[2,{code:h,msg:j[h]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(t,r){var s,a;return n(this,void 0,void 0,(function(){var i,c=this;return o(this,(function(d){if(!e.usingCppEngine())return[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}];if(!e.validate("messages",t,(function(t){return e.isArray(t)&&!(t.length<=0||t.length>=500)}),!0)||!e.validate("checkDuplicate",r,e.AssertRules.BOOLEAN))return[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];for(i in t)if(!(e.validate("message",t[i],e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",t[i].conversationType,(function(t){return[e.ConversationType.PRIVATE,e.ConversationType.DISCUSSION,e.ConversationType.GROUP,e.ConversationType.CUSTOMER_SERVICE,e.ConversationType.SYSTEM,e.ConversationType.APP_PUBLIC_SERVICE,e.ConversationType.PUBLIC_SERVICE].includes(t)}),!0)&&e.validate("message.targetId",t[i].targetId,e.AssertRules.STRING,!0)&&e.validate("message.senderUserId",t[i].senderUserId,e.AssertRules.STRING,!0)&&e.validate("message.messageType",t[i].messageType,e.AssertRules.STRING,!0)&&e.validate("message.content",t[i].content,e.AssertRules.OBJECT,!0)&&e.validate("message.messageDirection",t[i].messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("message.canIncludeExpansion",t[i].canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("message.expansion",t[i].expansion,e.AssertRules.OBJECT)&&e.validate("message.disableNotification",t[i].disableNotification,e.AssertRules.BOOLEAN)&&e.validate("message.sentTime",t[i].sentTime,e.AssertRules.NUMBER)&&e.validate("message.sentStatus",t[i].sentStatus,e.AssertRules.NUMBER)&&e.validate("options.isUnread",null===(s=t[i])||void 0===s?void 0:s.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null===(a=t[i])||void 0===a?void 0:a.searchContent,e.AssertRules.STRING)))return[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,msg:String(i)}];return[2,q((function(s){return n(c,void 0,void 0,(function(){var n,a,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.batchInsertMessage(t,r)];case 1:return n=o.sent(),a=n.code,i=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:j[a]}]}}))}))}))]}))}))},getMessageCount:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?[2,q((function(s){return n(r,void 0,void 0,(function(){var n,r,a,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,a=t.channelId,[4,s.getMessageCount(n,r,a)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:[2,{code:c,msg:j[c]}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("messageUId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getPrivateMessageDeliverTime(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(t)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",r,e.AssertRules.STRING,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getGroupMessageDeliverList(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(s,", targetId:").concat(t," messageUId:").concat(r)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("enableCheck",t,e.AssertRules.BOOLEAN)?[2,q((function(e){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return[4,e.setCheckDuplicateMessage(t)];case 1:return[2,{code:n.sent().code}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return e.usingCppEngine()?[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"clearLocalData ->"),[4,r.clearData()];case 1:return t=o.sent(),n=t.code,a=t.data,[2,{code:n,data:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))}}),nt=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return e.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return e.ChatroomUserChangeType}}),Object.defineProperty(exports,"ConnectionStatus",{enumerable:!0,get:function(){return e.ConnectionStatus}}),Object.defineProperty(exports,"ConversationType",{enumerable:!0,get:function(){return e.ConversationType}}),Object.defineProperty(exports,"ErrorCode",{enumerable:!0,get:function(){return e.ErrorCode}}),Object.defineProperty(exports,"FileType",{enumerable:!0,get:function(){return e.FileType}}),Object.defineProperty(exports,"LogL",{enumerable:!0,get:function(){return e.LogL}}),Object.defineProperty(exports,"LogLevel",{enumerable:!0,get:function(){return e.LogLevel}}),Object.defineProperty(exports,"MentionedType",{enumerable:!0,get:function(){return e.MentionedType}}),Object.defineProperty(exports,"MessageBlockSourceType",{enumerable:!0,get:function(){return e.MessageBlockSourceType}}),Object.defineProperty(exports,"MessageBlockType",{enumerable:!0,get:function(){return e.MessageBlockType}}),Object.defineProperty(exports,"MessageDirection",{enumerable:!0,get:function(){return e.MessageDirection}}),Object.defineProperty(exports,"NotificationLevel",{enumerable:!0,get:function(){return e.NotificationLevel}}),Object.defineProperty(exports,"NotificationStatus",{enumerable:!0,get:function(){return e.NotificationStatus}}),Object.defineProperty(exports,"RCConnectionStatus",{enumerable:!0,get:function(){return e.RCConnectionStatus}}),Object.defineProperty(exports,"ReceivedStatus",{enumerable:!0,get:function(){return e.ReceivedStatus}}),Object.defineProperty(exports,"SentStatus",{enumerable:!0,get:function(){return e.SentStatus}}),Object.defineProperty(exports,"UltraGroupChannelChangeType",{enumerable:!0,get:function(){return e.UltraGroupChannelChangeType}}),Object.defineProperty(exports,"UltraGroupChannelType",{enumerable:!0,get:function(){return e.UltraGroupChannelType}}),Object.defineProperty(exports,"UploadMethod",{enumerable:!0,get:function(){return e.UploadMethod}}),exports.BaseMessage=ne,exports.CombineMessage=ue,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=le,exports.GIFMessage=ge,exports.HQVoiceMessage=ie,exports.ImageMessage=ae,exports.LocationMessage=fe,exports.MentionedInfoBody=nt,exports.MessageType={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"},exports.ReferenceMessage=Re,exports.RichContentMessage=Ee,exports.SightMessage=ce,exports.TextMessage=de,exports.VoiceMessage=ve,exports.__addSDKVersion=function(t,n){e.VersionManage.add(t,n)},exports.addConversationsToTag=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"addTagForConversations ->tagId:".concat(t)),[4,a.addTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addEventListener=function(e,t,n){D.on(e,t,n)},exports.addTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagId",t.tagId,(function(e){return e.length<=10}))&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"createTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,s.createTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"createTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addToBlacklist=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"addToBlacklist -> userId: ".concat(t)),[4,s.addToBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.bindRTCRoomForChatroom=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("option.chatRoomId",t.chatRoomId,e.AssertRules.STRING,!0)&&e.validate("option.rtcRoomId",t.rtcRoomId,e.AssertRules.STRING,!0)?[2,q((function(e){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,e.bindRTCRoomForChatroom(t)];case 1:return[2,{code:n=o.sent(),msg:j[n]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearAllMessagesUnreadStatus=function(){return n(this,void 0,void 0,(function(){var e=this;return o(this,(function(t){return[2,q((function(t,r){return n(e,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))},exports.clearEventListeners=J,exports.clearHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"clear message ->".concat(n)),[4,a.deleteRemoteMessageByTimestamp(t.conversationType,t.targetId,r,t.channelId)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"clear message ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearMessages=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return B("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),e.usingCppEngine()?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,a.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,s.clearMessages(n,r,i)];case 1:return(c=o.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(a.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.clearMessagesUnreadStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,s.clearUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"clear unreadMsgNum ->".concat(r)),n!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"clear unreadMsgNum fail ->".concat(n,":").concat(j[n],",").concat(r)),[2,{code:n,msg:j[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearTextMessageDraft=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"delete draft ->".concat(n)),[4,s.clearConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return(r=o.sent())===e.ErrorCode.SUCCESS?[2,{code:r}]:(a.warn(e.LogTagId.O,"delete draft fail ->".concat(r,":").concat(j[r],",").concat(n)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearUnreadCountByTimestamp=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,s=t.targetId,c=t.channelId,i.info(e.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(s,",conversationType:").concat(n)),[4,a.clearUnreadCountByTimestamp(n,s,r,c)];case 1:return(d=o.sent())===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(d,",targetId:").concat(s)),[2,{code:d,msg:j[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.connect=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return e.validate("token",t,e.AssertRules.STRING,!0)&&e.validate("reconnectKickEnable",r,e.AssertRules.BOOLEAN)?(n=i.createTraceId(),i.info(e.LogTagId.A_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:r}),n),[4,a.connect(t,!!r,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return s=o.sent(),c=s.code===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_CONNECT_R,JSON.stringify({code:s.code,userId:s.userId}),n),s.code===e.ErrorCode.SUCCESS?[2,{code:s.code,data:{userId:s.userId}}]:[2,{code:s.code,msg:j[s.code]}]}}))}))}))]}))}))},exports.deleteLocalMessagesByTimestamp=function(t,r,s){return n(this,void 0,void 0,(function(){var a,i,c,d=this;return o(this,(function(u){return B("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),e.usingCppEngine()?(a=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",a,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",s,e.AssertRules.BOOLEAN)?[2,q((function(u,l){return n(d,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,u.deleteMessagesByTimestamp(a,i,r,s,c)];case 1:return n=o.sent(),l.debug(e.LogTagId.A_DELETE_MESSAGES_S,JSON.stringify({code:n,conversationType:a,targetId:i,channelId:c,timestamp:r})),n===e.ErrorCode.SUCCESS?[2,{code:n}]:(l.warn(e.LogTagId.O,"deleteLocalMessagesByTimestamp ->code:".concat(n,",targetId:").concat(t.targetId)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.deleteMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("options",r,(function(t){return e.isArray(t)&&t.length}),!0)&&!r.some((function(t){return!e.validate("options.messageUId",t.messageUId,e.AssertRules.STRING,!0)||!e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)||!e.validate("options.messageDirection",t.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"delete messages ->".concat(n)),[4,a.deleteRemoteMessage(t.conversationType,t.targetId,r,t.channelId)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"delete message fail ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.destroy=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return V?(J(),[2,F()]):[2]}))}))},exports.disconnect=function(t){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),Z((function(e){return e.disconnect(t)}))},exports.electronExtension=et,exports.forceRemoveChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&ee(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.info(e.LogTagId.O,"force remove chatroom entry ->".concat(n)),[4,a.forceRemoveChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force remove chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.forceSetChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Q(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"force set chatroom entry ->".concat(n)),[4,a.forceSetChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force set chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllChatRoomEntries=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),a.debug(e.LogTagId.O,"get all chatroom entries->".concat(n)),[4,s.getAllChatroomEntries(t)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS&&c?[2,{code:i,data:c}]:(a.warn(e.LogTagId.O,"get all chatroom entries fail ->code+:".concat(j[i],",").concat(n)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllConversationState=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,q((function(e){return e.getAllConversationState()}))]}))}))},exports.getAllUltraGroupUnreadCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadCount",[4,r.getAllUltraGroupUnreadCount()];case 1:return n=o.sent(),a=n.code,i=n.data,s.debug(e.LogTagId.O,t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:(s.warn(e.LogTagId.O,"".concat(t," fail ->").concat(a,": ").concat(j[a])),[2,{code:a,msg:j[a]}])}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadMentionedCount",!0,[4,r.getAllUltraGroupUnreadCount(true)];case 1:return n=o.sent(),a=n.code,i=n.data,s.debug(e.LogTagId.O,t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:(s.warn(e.LogTagId.O,"".concat(t," fail ->").concat(a,": ").concat(j[a])),[2,{code:a,msg:j[a]}])}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,q((function(t,n){return n.debug(e.LogTagId.O,"getAllUnreadMentionedCount"),t.getAllUnreadMentionedCount()}))]}))}))},exports.getBlacklist=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getBlacklist -> "),[4,r.getBlacklist()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS&&a?[2,{code:n,data:a}]:(s.warn(e.LogTagId.O,"getBlacklist fail -> code: ".concat(n)),[2,{code:n}])}}))}))}))]}))}))},exports.getBlacklistStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getBlacklistStatus -> userId: ".concat(t)),[4,s.getBlacklistStatus(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:0===i}]:(a.warn(e.LogTagId.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(t)),[2,{code:r}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getBlockUltraGroupList=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return[4,r.getBlockUltraGroupList()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:a}]:(s.warn(e.LogTagId.O,"get block ultragroup ->".concat(n,":").concat(j[n])),[2,{code:n,msg:j[n]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,q((function(e){return e.getBlockConversationList()}))]}))}))},exports.getChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("key",r,(function(t){return e.isString(t)&&/[\w+=-]+/.test(t)&&t.length<=128}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom entry->".concat(n)),[4,a.getChatroomEntry(t,r)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom entry fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatRoomInfo=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.order",r.order,(function(e){return[0,1,2].includes(e)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom info ->".concat(n)),[4,a.getChatroomInfo(t,r.count,r.order)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom info fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatroomHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.timestamp",r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",r.count,e.AssertRules.NUMBER)&&e.validate("options.order",r.order,(function(e){return 0===e||1===e}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom history message->".concat(n)),[4,a.getChatRoomHistoryMessages(t,r.count,r.order,r.timestamp)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return w(e)})),[2,{code:c,data:{list:u,hasMore:!!d.hasMore}}]):(i.warn(e.LogTagId.O,"get chatroom history message fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConnectionStatus=function(){return Z((function(e){return e.getConnectionStatus()}))},exports.getConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getConversation(t.conversationType,t.targetId,t.channelId||"")];case 1:return n=o.sent(),r=n.code,i=n.data,r!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"getConversation ->code:".concat(r,", targetId:").concat(t.targetId)),[2,{code:r,msg:j[r]}]):[2,{code:r,data:i?b(i):null}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationList=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options.count",null==t?void 0:t.count,e.AssertRules.NUMBER)&&e.validate("options.startTime",null==t?void 0:t.startTime,e.AssertRules.NUMBER)&&e.validate("options.order",null==t?void 0:t.order,e.AssertRules.NUMBER)&&e.validate("channelId",r,e.AssertRules.CHANNEL_ID)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getConversationList(null==t?void 0:t.count,void 0,null==t?void 0:t.startTime,null==t?void 0:t.order,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return b(e)}))}]:(i.warn(e.LogTagId.O,"get conversation list fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return n=W(a,t,"getConversationNotificationLevel"),[4,s.getConversationNotificationLevel(t.conversationType,t.targetId,t.channelId)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:c}]:(a.warn(e.LogTagId.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(j[i]," , ").concat(n)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,s.getConversationNotificationStatus(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationsFromTagByPage=function(r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.validate("tagId",r,e.AssertRules.STRING,!0)&&e.validate("count",s,e.AssertRules.NUMBER,!0)&&e.validate("startTime",a,e.AssertRules.NUMBER,!0)?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u;return o(this,(function(o){switch(o.label){case 0:return d.info(e.LogTagId.O,"getConversationListByTag ->tagId:".concat(r)),[4,c.getConversationListByTag(r,a,s)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:null==u?void 0:u.map((function(e){return function(e){return t(t({},b(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(d.warn(e.LogTagId.O,"getConversationListByTag ->code:".concat(i,",tagId:").concat(r)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getCurrentUserId=function(){return Z((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return Z((function(e){return e.getDeviceId()}))},exports.getFileToken=function(t,n,o,r){return q((function(s){return new Promise((function(a){s.getFileToken(t,n,o,r).then((function(t){a({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){a({code:e,msg:j[e]})}))}))}))},exports.getFileUrl=je,exports.getFirstUnreadMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getFirstUnreadMessage(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?(c=i&&w(i)||null,[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"insertMessage ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options.timestamp",null==r?void 0:r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,e.AssertRules.NUMBER)&&e.validate("options.order",null==r?void 0:r.order,(function(e){return 0===e||1===e}))&&e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==r?void 0:r.timestamp,count:null==r?void 0:r.count}),n),[4,a.getHistoryMessage(t.conversationType,t.targetId,null==r?void 0:r.timestamp,null==r?void 0:r.count,null==r?void 0:r.order,null==t?void 0:t.channelId,"",n)];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return w(e)})),i.info(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageLength:u.length}),n),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageUIds:""}),n),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("messageId",t,(function(t){return e.isNumber(t)||e.isString(t)}),!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getMessage(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:w(i)}]:(a.warn(e.LogTagId.O,"getMessage ->code:".concat(r,",messageId:").concat(t)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getMessageReader=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u;return o(this,(function(o){switch(o.label){case 0:return n="messageUId:".concat(r,",targetId:").concat(t),c.debug(e.LogTagId.O,"get message reader ->".concat(n)),[4,i.getMessageReader(t,r,s)];case 1:return a=o.sent(),d=a.code,u=a.data,d===e.ErrorCode.SUCCESS?[2,{code:d,data:u}]:(c.warn(e.LogTagId.O,"get message reader fail ->".concat(d,":").concat(j[d],",").concat(n)),[2,{code:d,msg:j[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getProxy=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return[4,r.getProxy()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS?[2,{code:n,data:a}]:(s.warn(e.LogTagId.O,"getProxy ->code:".concat(n)),[2,{code:n,msg:j[n]}])}}))}))}))]}))}))},exports.getRemoteHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options.timestamp",null==r?void 0:r.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==r?void 0:r.count,e.AssertRules.NUMBER)&&e.validate("options.order",null==r?void 0:r.order,(function(e){return 0===e||1===e}))&&e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"get history message ->".concat(n)),[4,a.getRemoteHistoryMessages(t.conversationType,t.targetId,(null==r?void 0:r.timestamp)||0,(null==r?void 0:r.count)||20,(null==r?void 0:r.order)||0,t.channelId||"")];case 1:return s=o.sent(),c=s.code,d=s.data,c===e.ErrorCode.SUCCESS&&d?(u=d.list.map((function(e){return w(e)})),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.O,"get history message fail ->".concat(c,":").concat(j[c],",").concat(n)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getServerTime=function(){return Z((function(e){return e.getServerTime()}))},exports.getTags=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,q((function(r,s){return n(t,void 0,void 0,(function(){var t,n,a;return o(this,(function(o){switch(o.label){case 0:return[4,r.getTagList()];case 1:return t=o.sent(),n=t.code,a=t.data,n===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:a}]:(s.warn(e.LogTagId.O,"getTagList ->code:".concat(n)),[2,{code:n,msg:j[n]}])}}))}))}))]}))}))},exports.getTagsFromConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getTagsForConversation ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,s.getTagsForConversation(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:[2,{code:r,msg:j[r]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTextMessageDraft=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"get draft ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i||""}]:(a.warn(e.LogTagId.O,"get draft fail ->".concat(r,":").concat(j[r],",").concat(c)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTopConversationList=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversationTypes",t,e.AssertRules.ARRAY)&&!(null==t?void 0:t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))&&e.validate("channelId",r,e.AssertRules.CHANNEL_ID)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getTopConversationList(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return b(e)}))}]:(i.warn(e.LogTagId.A_GET_TOP_CONVERSATION_LIST_E,"".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCount=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("includeMuted",t,e.AssertRules.BOOLEAN,!1)&&e.validate("conversationTypes",r,e.AssertRules.ARRAY,!1)&&!(null==r?void 0:r.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.debug(e.LogTagId.O,"get total unread count -> ConversationType:".concat(JSON.stringify(r)," includeMuted:").concat(t)),[4,a.getTotalUnreadCount("",r,t)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCount fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",r,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||r.some((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getTotalUnreadCountByLevels(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCountByLevels fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]}))}))},exports.getTotalUnreadMentionedCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",r,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||r.some((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return[4,a.getTotalUnreadCountByLevels(t,r,!0)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]}))}))},exports.getUltraGroupDefaultNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),a.debug(e.LogTagId.O,"".concat(n," -> ").concat(r)),[4,s.getUltraGroupDefaultNotificationLevel(t.targetId,t.channelId)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:(a.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(j[c]," , ").concat(r)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)?[2,q((function(s){return n(r,void 0,void 0,(function(){var n,r,a,i,c,d;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,a={targetId:n,channelId:r},[4,s.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=o.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:[2,{code:c,msg:j[c]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupList=function(t){return void 0===t&&(t={}),n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!1)&&e.validate("options.channelType",t.channelType,(function(t){return void 0!==e.UltraGroupChannelType[t]}),!1)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,s.getUltraGroupList(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:i}]:(a.warn(e.LogTagId.O,"get ultragroup ->".concat(r,":").concat(j[r])),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupMessageListByMessageUId=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("msgs",r,e.AssertRules.ARRAY,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,s=t.conversationType,c=t.channelId,d=[],r.forEach((function(e){var t=e.sendTime,n=e.messageUId;d.push({sendTime:t,messageUId:n,channelId:c})})),u={targetId:n,conversationType:s,messages:d},[4,a.getUltraGroupMessageListByMessageUId(u)];case 1:if(l=o.sent(),g=l.code,v=l.data,g===e.ErrorCode.SUCCESS){for(R in f={},v)f[R]=v[R]?w(v[R]):void 0;return[2,{code:e.ErrorCode.SUCCESS,data:f}]}return i.warn(e.LogTagId.O,"get UltraGroup MessageList by messageUId ->".concat(g,":").concat(j[g])),[2,{code:g,msg:j[g]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",r,e.AssertRules.ARRAY)&&!(null==r?void 0:r.some((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,a.getUltraGroupUnreadCountByTargetId(t,r)];case 1:return s=o.sent(),c=s.code,d=s.data,u="targetId: ".concat(t,", levels: ").concat(JSON.stringify(r)),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(u)),c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c,": ").concat(j[c],", ").concat(u)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",r,e.AssertRules.ARRAY)&&!(null==r?void 0:r.some((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.debug(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(t,", notificationLevels: ").concat(JSON.stringify(r))),[4,a.getUltraGroupUnreadMentionedCountByTargetId(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:c}]:(i.warn(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(s,":").concat(j[s])),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedMessages=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)&&e.validate("options.sentTime",t.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.count",t.count,(function(t){return e.isNumber(t)&&t>0&&t<=50}),!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,i=t.sentTime,c=t.count,d={targetId:n,channelId:r,sentTime:i,count:c},[4,s.getUltraGroupUnreadMentionedMessages(d)];case 1:return u=o.sent(),l=u.code,g=u.data,l===e.ErrorCode.SUCCESS?[2,{code:l,data:g}]:(a.warn(e.LogTagId.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(l,": ").concat(j[l])),[2,{code:l,msg:j[l]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadConversationList=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY)||(null==t?void 0:t.some((function(t){return!e.validate("conversationType",t,e.isTypeInConversationList)})))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,a;return o(this,(function(o){switch(o.label){case 0:return[4,s.getUnreadConversationList(t)];case 1:return n=o.sent(),r=n.code,a=n.data,r===e.ErrorCode.SUCCESS&&a?[2,{code:0,data:a.map((function(e){return b(e)}))}]:[2,{code:r,msg:j[r]}]}}))}))}))]}))}))},exports.getUnreadCount=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r=n.code,i=n.data,c="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"get unreadCount ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(a.warn(e.LogTagId.O,"get unreadCount fail ->".concat(r,":").concat(j[r],",").concat(c)),[2,{code:r,msg:j[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadCountByTag=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("containMuted",r,e.AssertRules.BOOLEAN,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(t)),[4,a.getUnreadCountByTag(t,r)];case 1:return n=o.sent(),s=n.code,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:c}]:(i.warn(e.LogTagId.O,"getUnreadCountByTag ->code:".concat(s,",tagId:").concat(t)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedCount=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(n,o){return o.debug(e.LogTagId.O,"getUnreadMentionedCount".concat(t.targetId,",channelId:").concat(t.channelId)),n.getUnreadMentionedCount(t)}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedMessages=function(t){if(!e.usingCppEngine())return{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]};var n,o=t.conversationType,r=t.targetId,s=t.channelId;return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?(n=function(t){var n=t.getUnreadMentionedMessages(o,r,s),a=[];return n&&n.length&&n.forEach((function(e){return a.push(w(e))})),{code:e.ErrorCode.SUCCESS,data:a}},V?n(V,H,k):{code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT}):{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}},exports.init=function(t){!function(t){var n,o=t.appkey,r=t.navigators;V?H.warn(e.LogTagId.A_INIT_REPEAT_O):(e.assert("options.appkey",t.appkey,e.AssertRules.STRING,!0),e.assert("options.navigators",t.navigators,(function(t){return e.isArray(t)&&(0===t.length||t.every(e.isHttpUrl))})),k=t,V=e.APIContext.init((null===(n=t.__runtimeCreator__)||void 0===n?void 0:n.call(t))||x,{appkey:t.appkey,navigators:t.navigators||[],miniCMPProxy:t.customCMP||[],logOutputLevel:t.logOutputLevel,__reportLogLevel:t.__reportLogLevel,httpInMainProcess:!!t.httpInMainProcess,logExpireTime:t.logExpireTime}),(H=V.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),H.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:o,navigators:r,version:"5.7.3",commit:"220aab3f259b3e6bad2f34423d46543464baa635"})),V.assignWatcher(G))}(t)},exports.insertMessage=function(t,r,s){return void 0===s&&(s={}),n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return B("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("options",s,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==s?void 0:s.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==s?void 0:s.searchContent,e.AssertRules.STRING)&&e.validate("content.senderUserId",r.senderUserId,e.AssertRules.STRING,!0)&&e.validate("content.messageType",r.messageType,e.AssertRules.STRING,!0)&&e.validate("content.content",r.content,e.AssertRules.OBJECT,!0)&&e.validate("content.messageDirection",r.messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("content.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("content.expansion",r.expansion,e.AssertRules.OBJECT)&&e.validate("content.disableNotification",r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("content.sentTime",r.sentTime,e.AssertRules.NUMBER)&&e.validate("content.sentStatus",r.sentStatus,e.AssertRules.NUMBER)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g,v,f,R,E,I,p,T,h,C,m;return o(this,(function(o){switch(o.label){case 0:return n=r.senderUserId,a=r.messageType,d=r.content,u=r.messageDirection,l=r.messageUId,g=r.canIncludeExpansion,v=r.expansion,f=r.disableNotification,R=r.sentTime,E=r.sentStatus,c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),I=s.isUnread,p=s.searchContent,T={senderUserId:n,messageType:a,content:d,messageDirection:u,sentTime:R,sentStatus:E,searchContent:p,isUnread:I,messageUId:l,disableNotification:f,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,T)];case 1:return h=o.sent(),C=h.code,m=h.data,C===e.ErrorCode.SUCCESS?[2,{code:C,data:w(m)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(C,",targetId:").concat(t.targetId)),[2,{code:C,msg:j[C]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return Z((function(n){return n.install(e,t)}))},exports.joinChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:r.count,joinExist:!1}),n),[4,a.joinChatroom(t,r.count,n)];case 1:return s=o.sent(),c=s===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==e.ErrorCode.SUCCESS?[2,{code:s,msg:j[s]}]:[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.joinExistChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return n=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:r.count,joinExist:!0}),n),[4,a.joinExistChatroom(t,r.count,n)];case 1:return s=o.sent(),c=s===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==e.ErrorCode.SUCCESS?[2,{code:s,msg:j[s]}]:[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.modifyMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("content",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f,R;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.senderUserId,u=r.sentTime,l=r.canIncludeExpansion,g=r.channelId,v="conversationType:".concat(n,",targetId:").concat(s,",channelId:").concat(g,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update ultragroup message expansion ->".concat(v)),f={targetId:s,channelId:g,conversationType:n,fromUserId:d,sendTime:u,canIncludeExpansion:l,messageUId:c,content:t},[4,a.modifyMessage(f)];case 1:return(R=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"modify ultraGroup message ->".concat(R,":").concat(j[R])),[2,{code:R,msg:j[R]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.onceEventListener=function(e,t,n){D.once(e,t,n)},exports.quitChatRoom=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return n=a.createTraceId(),a.info(e.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,s.quitChatroom(t)];case 1:return r=o.sent(),i=r===e.ErrorCode.SUCCESS?"info":"warn",a[i](e.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),n),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:j[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.recallMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("options.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("options.sentTime",r.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.disableNotification",null==r?void 0:r.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushConfig",null==r?void 0:r.pushConfig,e.AssertRules.OBJECT)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n={user:r.user,channelId:t.channelId||"",disableNotification:null==r?void 0:r.disableNotification,pushConfig:null==r?void 0:r.pushConfig,extra:r.extra,isDelete:r.isDelete},s="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId,",messageUId:").concat(r.messageUId),i.debug(e.LogTagId.O,"recall message ->".concat(s)),[4,a.recallMessage(t.conversationType,t.targetId,r.messageUId,r.sentTime,n)];case 1:return c=o.sent(),d=c.code,u=c.data,d===e.ErrorCode.SUCCESS&&u?[2,{code:d,data:w(u)}]:d===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"recall message fail ->".concat(d,":").concat(j[d],",").concat(s)),[2,{code:d,msg:j[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.registerMessageType=function(t,n,o,r,s){return Z((function(a,i){return e.assert("messageType",t,e.AssertRules.STRING,!0),e.assert("isPersited",n,e.AssertRules.BOOLEAN,!0),e.assert("isCounted",o,e.AssertRules.BOOLEAN,!0),e.assert("isStatusMessage",s,e.AssertRules.BOOLEAN,!1),e.assert("searchProps",r,e.AssertRules.ARRAY),i.info(e.LogTagId.A_REGTYP_O,JSON.stringify({messageType:t,isCounted:o,isStatusMessage:s,isPersited:n})),a.registerMessageType(t,n,o,r,s),oe(t,n,o)}))},exports.removeAllExpansionForUltraGroupMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("message",t,e.AssertRules.OBJECT,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r,i,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(i),a.debug(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(l)),g={targetId:r,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:i,removeAll:!0},[4,s.expandUltraMessage(g)];case 1:return(v=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(a.warn(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(v,":").concat(j[v])),[2,{code:v,msg:j[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntries=function(r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("targetId",r,e.AssertRules.STRING,!0)&&te(s)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(r),c.info(e.LogTagId.O,"remove chatroom entry->".concat(n)),(a=t({},s)).entries=s.entries.map((function(e){return{key:e}})),[4,i.removeChatroomEntries(r,a)];case 1:return d=o.sent(),u=d.code,l=d.data,u!==e.ErrorCode.SUCCESS?(c.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(j[u],",").concat(n)),[2,{code:u,msg:j[u],data:l}]):[2,{code:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&ee(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"remove chatroom entry->".concat(n)),[4,a.removeChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,s.removeConversation(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"destroy conversation ->".concat(r)),n!==e.ErrorCode.SUCCESS?(a.warn(e.LogTagId.O,"destroy conversation fail ->".concat(n,":").concat(j[n],",").concat(r)),[2,{code:n,msg:j[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversationsFromTag=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,a.removeTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeEventListener=function(e,t,n){D.off(e,t,n)},exports.removeEventListeners=function(e){D.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("expansion",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.sentTime,u=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(s,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove expansion for ultragroup message ->".concat(g)),v={targetId:s,channelId:l,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:c,keys:t},[4,a.expandUltraMessage(v)];case 1:return(f=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"remove expansion for ultraGroup message ->".concat(f,":").concat(j[f])),[2,{code:f,msg:j[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeFromBlacklist=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"removeFromBlacklist -> userId: ".concat(t)),[4,s.removeFromBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeMessageExpansionForKey=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("keys",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",r.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("message.targetId",r.targetId,e.AssertRules.STRING,!0)&&e.validate("message.channelId",r.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("message.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("message.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.canIncludeExpansion,u=r.channelId,l="conversationType:".concat(n,",targetId:").concat(s,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove message expansion ->".concat(l)),[4,a.sendExpansionMessage({conversationType:n,targetId:s,messageUId:c,canIncludeExpansion:d,keys:t,channelId:u})];case 1:return(g=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove message expansion fail ->".concat(g,":").concat(j[g],",").concat(l)),[2,{code:g,msg:j[g]}]):[2,{code:g}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"removeTag ->tagId:".concat(t)),[4,s.removeTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagFromConversations=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,a.removeTagForConversations(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagsFromConversation=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("tagIds",r,e.AssertRules.ARRAY,!0)&&!r.some((function(t){return!e.validate("tagId",t,e.AssertRules.STRING,!0)}))?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"removeTagsForConversation ->tagIds:".concat(r,",targetId:").concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.removeTagsForConversation(t,r)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(r)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.saveTextMessageDraft=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("draft",r,e.AssertRules.STRING,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set draft ->".concat(n)),[4,a.saveConversationMessageDraft(t.conversationType,t.targetId,r,t.channelId)];case 1:return(s=o.sent())===e.ErrorCode.SUCCESS?[2,{code:s}]:(i.warn(e.LogTagId.O,"set draft fail ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.searchConversationByContent=function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return B("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),e.usingCppEngine()?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u;return o(this,(function(o){switch(o.label){case 0:return d.info(e.LogTagId.O,"searchConversationByContent ->keyword:".concat(t)),[4,c.searchConversationByContent(t,s,a,r)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:u}]:(d.warn(e.LogTagId.O,"searchConversationByContent ->code:".concat(i,",keyword:").concat(t)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchMessages=function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return B("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",r,e.AssertRules.STRING,!0)&&e.validate("timestamp",s,e.AssertRules.NUMBER)&&e.validate("count",a,e.AssertRules.NUMBER)?[2,q((function(c,d){return n(i,void 0,void 0,(function(){var n,i,u,l;return o(this,(function(o){switch(o.label){case 0:return 1,[4,c.searchMessageByContent(t.conversationType,t.targetId,r,s,a,1,t.channelId)];case 1:return n=o.sent(),i=n.code,u=n.data,i===e.ErrorCode.SUCCESS?(l=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return l.push(w(e))})),[2,{code:i,data:{messages:l,count:null==u?void 0:u.count}}]):(d.warn(e.LogTagId.O,"searchMessages ->code:".concat(i,",targetId:").concat(t.targetId)),[2,{code:i,msg:j[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.sendFileMessage=We,exports.sendHQVoiceMessage=Qe,exports.sendImageMessage=Xe,exports.sendMessage=Ke,exports.sendReadReceiptMessage=function(t,r,s,a){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("timestamp",s,e.AssertRules.NUMBER,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)?[2,q((function(c){return n(i,void 0,void 0,(function(){var n,i,c,d,u;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.PRIVATE,channelId:a},i=new ne("RC:ReadNtf",{messageUId:r,lastMessageSendTime:s,type:1}),[4,Ke(n,i)];case 1:return c=o.sent(),d=c.code,u=c.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptRequest=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("messageUId",r,e.AssertRules.STRING,!0)&&e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,i,d,u;return o(this,(function(o){switch(o.label){case 0:return n="messageUId:".concat(r,",targetId:").concat(t),c.debug(e.LogTagId.O,"send read receipt message ->".concat(n)),a=new ne("RC:RRReqMsg",{messageUId:r}),[4,Ke({targetId:t,conversationType:e.ConversationType.GROUP,channelId:s},a)];case 1:return i=o.sent(),d=i.code,u=i.msg,0===d?[2,{code:d}]:[2,{code:d,msg:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptResponse=function(e,t,r){return n(this,void 0,void 0,(function(){return o(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))},exports.sendReadReceiptResponseV2=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageList",r,e.AssertRules.OBJECT,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)&&!Object.keys(r).some((function(t){return!e.validate(t,r[t],e.AssertRules.ARRAY)}))?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n,a,d,u,l,g;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.GROUP,channelId:s},d=i.getNaviInfoFromCache(),1!==(null==d?void 0:d.grpRRVer)?[3,2]:(u=[],Object.keys(r).forEach((function(e){r[e].forEach((function(e){-1===u.indexOf(e)&&u.push(e)}))})),u.length?[4,i.sendReadReceiptMessage(t,u,s)]:(c.warn(e.LogTagId.O,"Error in parameter messageList."),[2,{code:e.ErrorCode.PARAMETER_ERROR}]));case 1:return a=o.sent(),[3,4];case 2:return l=new ne("RC:RRRspMsg",{receiptMessageDic:r}),[4,Ke(n,l)];case 3:a=o.sent(),o.label=4;case 4:return(g=a.code)===e.ErrorCode.SUCCESS?[2,{code:g}]:(c.warn(e.LogTagId.O,"send read receipt message fail ->".concat(g,":").concat(j[g])),[2,{code:g,msg:j[g]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendSightMessage=$e,exports.sendSyncReadStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var n,s,a,i;return o(this,(function(o){switch(o.label){case 0:return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("lastMessageSendTime",r,e.AssertRules.NUMBER,!0)?(n=new ne("RC:SRSMsg",{lastMessageSendTime:r}),[4,Ke(t,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return s=o.sent(),a=s.code,i=s.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))},exports.sendTextMessage=function(e,t,n){return Ke(e,new de(t),n)},exports.sendTypingStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("typingContentType",r,e.AssertRules.STRING,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l;return o(this,(function(o){switch(o.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:r},isStatusMessage:!0,channelId:t.channelId},s=i.createTraceId(),i.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),s),[4,a.sendMessage(t.conversationType,t.targetId,n,void 0,s)];case 1:return c=o.sent(),d=c.code,u=c.data,l=d===e.ErrorCode.SUCCESS?"info":"warn",i[l](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:d,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),s),d===e.ErrorCode.SUCCESS?[2,{code:d,data:w(u)}]:[2,{code:d,msg:j[d]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendUltraGroupTypingStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,s.sendUltraGroupTypingStatus(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(a.warn(e.LogTagId.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(j[n])),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntries=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&$(r)?r.entries.length>10?[2,z.CHATROOM_KV_STORE_OUT_LIMIT]:[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(n)),[4,a.setChatroomEntries(t,r)];case 1:return s=o.sent(),c=s.code,d=s.data,c!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(j[c],",").concat(n)),[2,{code:c,msg:j[c],data:d}]):[2,{code:c}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Q(r)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(n)),[4,a.setChatroomEntry(t,r)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)&&e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(e,n){return X(n,t,(function(){return e.setConversationNotificationLevel(t.conversationType,t.targetId,r,t.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationStatus=function(t,r){return n(this,void 0,void 0,(function(){return o(this,(function(n){return e.validate("notificationStatus",r,(function(e){return 1===e||2===e}),!0)&&e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,q((function(e,n){return X(n,t,(function(){return e.setConversationStatus(t.conversationType,t.targetId,void 0,r,t.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTop=function(t,r){return void 0===r&&(r=!0),n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("isTop",r,e.AssertRules.BOOLEAN)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s;return o(this,(function(o){switch(o.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set conversation status ->".concat(n)),[4,a.setConversationStatus(t.conversationType,t.targetId,r,void 0,t.channelId)];case 1:return(s=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set conversation status fail ->".concat(s,":").concat(j[s],",").concat(n)),[2,{code:s,msg:j[s]}]):[2,{code:s}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTopInTag=function(t,r,s){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(i){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversation",r,e.AssertRules.CONVERSATION,!0)&&e.validate("status.isTop",s,e.AssertRules.BOOLEAN,!0)?[2,q((function(i,c){return n(a,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return c.info(e.LogTagId.O,"setConversationStatusInTag ->tagId:".concat(t,",targetId:").concat(r.targetId,",conversationType").concat(r.conversationType)),[4,i.setConversationStatusInTag(t,r,{isTop:s})];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(c.warn(e.LogTagId.O,"setConversationStatusInTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setMessageReceivedStatus=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return B("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus ->messageId:".concat(t,",receivedStatus:").concat(r)),[4,a.setMessageReceivedStatus(t,r)];case 1:return(n=o.sent())===e.ErrorCode.SUCCESS?[2,{code:n}]:(i.warn(e.LogTagId.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(t)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:j[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.setProxy=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0)?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"setProxy: ->".concat(t)),[4,s.setProxy(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"setProxy ->code:".concat(n)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setUltraGroupDefaultNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return t.channelId=t.channelId||"",e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)&&e.validate("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return n="setUltraGroupDefaultNotificationLevel",s="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(s)),[4,a.setUltraGroupDefaultNotificationLevel(t.targetId,r,t.channelId)];case 1:return(c=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:c}]:(i.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(j[c]," , ").concat(s)),[2,{code:c,msg:j[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.testProxy=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"testProxy: ->".concat(t)),[4,a.testProxy(t,r)];case 1:return n=o.sent(),s=n.status,c=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,msg:c}]:(i.warn(e.LogTagId.O,"testProxy ->code:".concat(s)),[2,{code:s,msg:j[s]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.sentTime,u=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(s,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update expansion for ultragroup message ->".concat(g)),v={targetId:s,channelId:l,conversationType:n,sendTime:d,canIncludeExpansion:u,messageUId:c,expansion:t},[4,a.expandUltraMessage(v)];case 1:return(f=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"update expansion for ultragroup message ->".concat(f,":").concat(j[f])),[2,{code:f,msg:j[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateMessageExpansion=function(t,r){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(a){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",r.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("message.targetId",r.targetId,e.AssertRules.STRING,!0)&&e.validate("message.channelId",r.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("message.messageUId",r.messageUId,e.AssertRules.STRING,!0)&&e.validate("message.expansion",r.expansion,e.AssertRules.OBJECT)&&e.validate("message.canIncludeExpansion",r.canIncludeExpansion,e.AssertRules.BOOLEAN,!0)?[2,q((function(a,i){return n(s,void 0,void 0,(function(){var n,s,c,d,u,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,s=r.targetId,c=r.messageUId,d=r.canIncludeExpansion,u=r.expansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(s,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update message expansion ->".concat(g)),[4,a.sendExpansionMessage({conversationType:n,targetId:s,messageUId:c,expansion:t,canIncludeExpansion:d,originExpansion:u,channelId:l})];case 1:return(v=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"update message expansion fail ->".concat(v,":").concat(j[v],",").concat(g)),[2,{code:v,msg:j[v]}]):[2,{code:v}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(s){return e.validate("tag.tagId",t.tagId,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,e.AssertRules.STRING,!0)&&e.validate("tag.tagName",t.tagName,(function(e){return e.length<=15}))?[2,q((function(s,a){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"updateTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,s.updateTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"updateTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:j[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))};
|