@rongcloud/imlib-next 5.7.9 → 5.7.10
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 +24 -7
- 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,a){function s(e){try{c(o.next(e))}catch(e){a(e)}}function i(e){try{c(o.throw(e))}catch(e){a(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(s,i)}c((o=o.apply(e,t||[])).next())}))}function o(e,t){var n,o,r,a,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(i){return function(c){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,i[0]&&(s=0)),s;)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 s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}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))},a=r(),s=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=null,c=function(e){return n(void 0,void 0,void 0,(function(){var t;return o(this,(function(n){switch(n.label){case 0:return[4,u.getNetworkType()];case 1:return t=n.sent(),i({status:"online"===e.type,type:"online"===e.type?t:"none"}),[2]}}))}))};var u={tag:"browser",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,i=t.body,c=e.appendUrl(t.url,a);return new Promise((function(e){var t=s(),a="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(n,c),r&&t.setRequestHeader)for(var u in r)t.setRequestHeader(u,r[u]);if(a){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 d="object"==typeof i?JSON.stringify(i):i;t.send(d)}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:a,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),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||{effectiveType:e.NetworkType.UNKONWN},n=t.type,o=t.effectiveType,r=n||o||e.NetworkType.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){i=e,window.addEventListener("offline",c),window.addEventListener("online",c)},removeNetworkStatusListener:function(){window.removeEventListener("offline",c),window.removeEventListener("online",c),i=null}},d=r(),l=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)}}},g={setItem:l("setStorageSync"),getItem:l("getStorageSync"),removeItem:l("removeStorageSync"),clear:l("clearStorageSync")},v=null,f=function(e){var t=e.isConnected,n=e.networkType;v({status:t,type:n})};var R={tag:"wechat",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.url,a);return new Promise((function(t){wx.request({url:i,method:n,header:r,timeout:o,data:s,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:g,sessionStorage:g,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:d,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),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)}})}))},setNetworkStatusListener:function(e){v=e,wx.onNetworkStatusChange(f)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(f),v=null}},E=r(),I=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){}}},p={setItem:I("setStorageSync"),getItem:I("getStorageSync"),removeItem:I("removeStorageSync"),clear:I("clearStorageSync")},T=null,h=function(e){var t=e.isConnected,n=e.networkType;T({status:t,type:n})};var m={tag:"alipay",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.url,a),c=t.dataType||"json";return new Promise((function(t){my.request({url:i,method:n,headers:r,timeout:o,data:s,dataType:c,success:function(e){t({data:e.data,status:e.status})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:p,sessionStorage:p,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:E,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onSocketClose(e)},onError:function(e){t.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onSocketMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onSocketOpen(e)},send:function(e){t.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.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)}})}))},setNetworkStatusListener:function(e){T=e,my.onNetworkStatusChange(h)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(h),T=null}},C=r(),S=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){}}},A={setItem:S("setStorageSync"),getItem:S("getStorageSync"),removeItem:S("removeStorageSync"),clear:S("clearStorageSync")},O=null,N=function(e){var t=e.isConnected,n=e.networkType;O({status:t,type:n})};var _={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:C,localStorage:A,sessionStorage:A,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{id:Date.now(),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)}})}))},setNetworkStatusListener:function(e){O=e,tt.onNetworkStatusChange(N)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(N),O=null}},y=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){}}},U={setItem:M("setStorageSync"),getItem:M("getStorageSync"),removeItem:M("removeStorageSync"),clear:M("clearStorageSync")},L=null,P=function(e){var t=e.isConnected,n=e.networkType;L({status:t,type:n})};var w={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:y,localStorage:U,sessionStorage:U,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{id:Date.now(),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)}})}))]}))}))},setNetworkStatusListener:function(e){L=e,swan.onNetworkStatusChange(P)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(P),L=null}},x=r(),b=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)}}},B={setItem:b("setStorageSync"),getItem:b("getStorageSync"),removeItem:b("removeStorageSync"),clear:b("clearStorageSync")},D=null,G=function(e){var t=e.isConnected,n=e.networkType;D({status:t,type:n})};var k={tag:"jingdong",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.url,a);return new Promise((function(t){jd.request({url:i,method:n,headers:r,timeout:o,data:s,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:B,sessionStorage:B,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){jd.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){D=e,jd.onNetworkStatusChange(G)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(G),D=null}},V=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)}}},H={setItem:V("setStorageSync"),getItem:V("getStorageSync"),removeItem:V("removeStorageSync"),clear:V("clearStorageSync")},F=null,Z=function(e){var t=e.isConnected,n=e.networkType;F({status:t,type:n})};var q,J={tag:"uniapp",httpReq:function(t){var n=t.method||e.HttpMethod.GET,o=t.timeout||e.HTTP_TIMEOUT,r=t.headers,a=t.query,s=t.body,i=e.appendUrl(t.url,a);return new Promise((function(t){uni.request({url:i,method:n,header:r,timeout:o,data:s,success:function(e){t({data:e.data,status:e.statusCode})},fail:function(){t({status:e.ErrorCode.RC_HTTP_REQ_FAIL})}})}))},localStorage:H,sessionStorage:H,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){F=e,uni.onNetworkStatusChange(Z)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Z),F=null}},z=function(e){return e&&e.request&&e.getSystemInfo},j="undefined"!=typeof uni&&z(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return J;case"mp-jd":return k;case"mp-baidu":return w;case"mp-toutiao":return _;case"mp-alipay":return m;case"mp-weixin":return R;default:return u}}():"undefined"!=typeof jd&&z(jd)?k:"undefined"!=typeof my&&z(my)?m:"undefined"!=typeof tt&&z(tt)?_:"undefined"!=typeof swan&&z(swan)?w:"undefined"!=typeof wx&&z(wx)?R:u;function K(t){var n=t.conversationType,o=t.channelId,r=t.messageType,a=t.content,s=t.senderUserId,i=t.targetId,c=t.sentTime,u=t.receivedTime,d=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,m=t.readReceiptInfo,C=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:a,senderUserId:s,targetId:i,conversationType:n,sentTime:c,receivedTime:u,messageUId:d,messageDirection:l,isPersited:g,isCounted:v,isMentioned:T,disableNotification:p,isStatusMessage:h,canIncludeExpansion:R,expansion:E,receivedStatus:I,readReceiptInfo:m,pushConfig:C,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 Y(t){var n=t.conversationType,o=t.targetId,r=t.latestMessage,a=t.unreadMessageCount,s=t.hasMentioned,i=t.mentionedInfo,c=t.lastUnreadTime,u=t.notificationStatus,d=t.notificationLevel,l=t.isTop,g=t.channelId,v=t.unreadMentionedCount,f=t.matchCount,R=t.unreadMentionedMeCount,E={conversationType:n,targetId:o,latestMessage:r&&K(r),unreadMessageCount:a,hasMentioned:s,mentionedInfo:s?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:l,channelId:g,unreadMentionedCount:v,matchCount:f,unreadMentionedMeCount:R};return E.conversationType===e.ConversationType.ULTRA_GROUP&&(E.firstUnreadMessage=t.firstUnreadMessage,E.channelType=t.channelType),E}function W(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}exports.Events=void 0,(q=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",q.CONNECTED="CONNECTED",q.DISCONNECT="DISCONNECT",q.SUSPEND="SUSPEND",q.MESSAGES="MESSAGES",q.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",q.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",q.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",q.CONVERSATION="CONVERSATION",q.CHATROOM="CHATROOM",q.EXPANSION="EXPANSION",q.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",q.TAG="TAG",q.CONVERSATION_TAG="CONVERSATION_TAG",q.TYPING_STATUS="TYPING_STATUS",q.MESSAGE_BLOCKED="MESSAGE_BLOCKED",q.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",q.OPERATE_STATUS="OPERATE_STATUS",q.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",q.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",q.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",q.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",q.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",q.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",q.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",q.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",q.USER_GROUP_STATUS="USER_GROUP_STATUS";var X=new e.EventEmitter,Q={connection:function(t,n){switch(t){case e.RCConnectionStatus.CONNECTED:X.emit(exports.Events.CONNECTED);break;case e.RCConnectionStatus.CONNECTING:X.emit(exports.Events.CONNECTING);break;case e.RCConnectionStatus.SUSPENDED:X.emit(exports.Events.SUSPEND,n);break;case e.RCConnectionStatus.DISCONNECTED:X.emit(exports.Events.DISCONNECT,n)}},batchMessage:function(e){X.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return K(e)}))})},typingState:function(e){X.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){X.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){X.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){X.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?K(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,o.unreadMessageCount=$(t.unreadMessageCount||0),o.unreadMentionedCount=$(t.unreadMentionedCount||0),o.unreadMentionedMeCount=$(t.unreadMentionedMeCount||0),{conversation:o}):(o.hasMentioned=t.hasMentioned,o.mentionedInfo=t.mentionedInfo,o.isTop=t.isTop,{conversation:o,updatedItems:t.updatedItems})}));X.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){X.emit(exports.Events.CHATROOM,e)},expansion:function(e){X.emit(exports.Events.EXPANSION,e)},pullFinished:function(){X.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){X.emit(exports.Events.TAG)},conversationTagChanged:function(){X.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){X.emit(exports.Events.MESSAGE_BLOCKED,e)},messageDelivered:function(e){X.emit(exports.Events.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){X.emit(exports.Events.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){X.emit(exports.Events.ULTRA_GROUP_ENABLE,e.map((function(e){return Y(e)})))},operateStatus:function(e){X.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){X.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return K(e)})))},ultraGroupMessageModified:function(e){X.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return K(e)})))},ultraGroupMessageRecalled:function(e){X.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return K(e)})))},ultraGroupChannelChangeType:function(e){X.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){X.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){X.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){X.emit(exports.Events.USER_GROUP_STATUS,e)}};function $(e){return e>999?999:e}e.VersionManage.add("imlib-next","5.7.9");var ee=null,te=null,ne=null;function oe(){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return ee?(ne.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),te=null,ee=null,ne=null,[2]}}))}))}function re(e){if(!ee)throw new Error("Not initialized yet!");return e(ee,ne,te)}function ae(t){return ee?t(ee,ne,te):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function se(){X.clear()}var ie={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!"}},ce={};for(var ue in ie){var de=ie[ue].code;ce[de]=ue}ie.ROAMING_SERVICE_UNAVAILABLE.code;var le=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},ge=function(t,r,a,s){return void 0===s&&(s=""),n(void 0,void 0,void 0,(function(){var n,i;return o(this,(function(o){switch(o.label){case 0:return n=le(t,r,s),[4,a()];case 1:return(i=o.sent())!==e.ErrorCode.SUCCESS?(t.warn(e.LogTagId.O,"".concat(s," fail -> ").concat(i," : ").concat(ce[i]," , ").concat(n)),[2,{code:i,msg:ce[i]}]):[2,{code:i}]}}))}))};var ve=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))},fe=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)},Re=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)},Ee=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 Ie=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 pe(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Ie(e,o,t,n)}}var Te,he,me=pe("RC:ImgMsg"),Ce=pe("RC:HQVCMsg"),Se=pe("RC:SightMsg"),Ae=pe("RC:TxtMsg"),Oe=pe("RC:CombineMsg"),Ne=pe("RC:FileMsg"),_e=pe("RC:GIFMsg"),ye=pe("RC:VcMsg"),Me=pe("RC:LBSMsg"),Ue=pe("RC:ReferenceMsg"),Le=pe("RC:ImgTextMsg"),Pe={qiniu:function(t,n,o,r){re((function(a){var s=a.getNaviInfoFromCache();if(1===(null==s?void 0:s.type)&&n.chunk_size&&r.size>n.chunk_size){var i=e.getUUID();i+=r.name.substr(r.name.lastIndexOf(".")),r.uniqueName=i,He(r,n,o)}else Ve(t,n,o,r)}))},baidu:function(e,t,n,o){if(o.size>xe.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=t||{};t=t||he;var a=new XMLHttpRequest,s=De();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var i=s+we[0][1]+r.bosUploadPath;we.shift();var c=r.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:i,isBosRes:!0};a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});a.onreadystatechange=function(){if(4===a.readyState)if(JSON.parse(a.responseText||"{}").filename=t.uniqueValue,200===a.status){n.onCompleted(u,!0)}else we.length?Pe[we[0][0]](e,t,n,o):n.onError("upload fail")},a.open(t.method,i,!0),a.setRequestHeader("authorization",c.bosToken),a.setRequestHeader("x-bce-date",c.bosDate),a.send(o)},aliyun:function(t,n,o,r){if(r.size>xe.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var a=new FormData;a.set("file",t.get("file")),a.set("key",t.get("key")),a.set("token",t.get("token"));var s=we[0][1];we.shift(),t=t||Te,n=(n=n||{})||he;var i=new XMLHttpRequest,c=De(),u="".concat(c+n.ossBucketName,".").concat(s);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):we.length?Pe[we[0][0]](a,n,o,r):o.onError("upload fail")}},i.open(n.method,u,!0),console.log("ali:url",u);var d=n.aliHeader||{};t.set("OSSAccessKeyId",d.osskeyId),t.set("policy",d.ossPolicy),t.set("Signature",d.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 a=new FormData,s=new XMLHttpRequest,i=De(),c=n.contentDisposition,u=we[0][1],d="".concat(i+n.s3BucketName,".").concat(u);console.log("uploadS3:url",d),we.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.AWS,200===s.status||204===s.status)o.onCompleted(a);else if(we.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),Pe[we[0][0]](i,n,o,r)}else o.onError("upload fail")}},s.open(n.method,d,!0);var l=n?n.s3Header:{},g=r&&r.type;c?a.set("Content-Disposition","".concat(c,";")):a.set("Content-Disposition","text/html"===g?"inline;":"attachment;");a.set("Content-Type",g),a.set("x-amz-credential",l.s3Credential),a.set("x-amz-algorithm",l.s3Algorithm),a.set("x-amz-date",l.s3Date),a.set("policy",l.s3Policy),a.set("x-amz-signature",l.s3Signature),a.set("key",n.uploadFileName),a.set("file",r),s.send(a)},stc:Fe,minio:Fe},we=[],xe={BOS_CHUNCK_SIZE:5368709120},be="http://",Be="https://";function De(){var e=Be;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=be),e}var Ge,ke=(Ge="RC-upload-",{get:function(e){e=Ge+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=Ge+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=Ge+e,localStorage.removeItem(e)}});function Ve(t,n,o,r){var a=Be+n.uploadHost.qiniu,s=(/http/.test(we[0][1])?"":De())+we[0][1]||a;n.isChunk||we.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 a=JSON.parse(i.responseText||"{}");a.filename=n.uniqueValue,a.uploadMethod=e.UploadMethod?e.UploadMethod.QINIU:"",200===i.status||204===i.status?o.onCompleted(a):we.length?Pe[we[0][0]](t,n,o,r):o.onError("upload fail")}},i.open(n.method,s,!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 He(t,n,o,r){var a=0,s=r||e.getUUID(),i=ke.get(s);i&&(t.uniqueName=i.sessionId,a=i.offset);var c=Math.min(n.chunk_size,t.size-a),u=t.slice(a,a+c),d=t.uniqueName;n.multi_parmas.name=d,n.filesize=t.size;var l="bytes=".concat(a,"-").concat(a+c);n.headers={Range:l,"X-File-TransactionId":d,"X-File-Total-Size":t.size},n.isChunk=!0,u.name=t.name,u=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 a=t.multi_parmas[r];o.append(r,a)}return o}(u,n,t.uniqueName),Ve(u,n,{onCompleted:function(e){a+=c;var r=t.uniqueName;ke.set(s,{offset:a,sessionId:r}),a<t.size?He(t,n,o,s):(a=0,ke.remove(s),o.onCompleted(e))},onError:function(e){console.error(e),o.onError(e)},onProgress:function(e,t){var r=e+a;o.onProgress(r,n.filesize)},onOpen:function(e){o.onOpen(e)}},t)}function Fe(t,n,o,r,a){var s=new XMLHttpRequest,i=n.contentDisposition,c=we[0][1],u=a===e.UploadMethod.STC?n.stcBucketName:n.minioBucketName,d="https://".concat(c,"/").concat(u,"/").concat(n.uploadFileName);we.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 e=JSON.parse(s.responseText||"{}");if(e.name=n.uniqueValue,e.filename=n.uploadFileName,e.uploadMethod=a,200===s.status||204===s.status)o.onCompleted(e);else if(we.length){var i=new FormData;i.set("file",t.get("file")),i.set("key",t.get("key")),i.set("token",t.get("token")),Pe[we[0][0]](i,n,o,r)}else o.onError("upload fail")}},s.open("PUT",d,!0);var l=n.stcHeader.stcAuthorization,g=n.stcHeader.stcContentSha256,v=n.stcHeader.stcDate;a===e.UploadMethod.MINIO&&(l=n.minioHeader.minioAuthorization,g=n.minioHeader.minioContentSha256,v=n.minioHeader.minioDate),s.setRequestHeader("Content-Type",r.type),i?s.setRequestHeader("Content-Disposition","".concat(i,";")):s.setRequestHeader("Content-Disposition","text/html"===r.type?"inline;":"attachment;"),s.setRequestHeader("Authorization",l),s.setRequestHeader("x-amz-content-sha256",g),s.setRequestHeader("x-amz-date",v),s.send(r)}function Ze(t,n,o,r,a,s){var i,c,u=n&&n.type||"text/plain",d=u.indexOf("image")>-1?1:4,l=o.contentDisposition,g=Math.ceil(n.size/o.stc_chunk_size),v=a===e.UploadMethod.STC?o.stcBucketName:o.minioBucketName,f="uploads";t.getFileToken(d,n.name,"POST",f).then((function(t){i=t.fileName,c="https://".concat(s,"/").concat(v,"/").concat(i),console.log("uploadStcMultipart:url",c);var o=new XMLHttpRequest;o.open("POST","".concat(c,"?").concat(f),!0),l?o.setRequestHeader("Content-Disposition","".concat(l,";")):o.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;");var d=t.stcAuthorization,R=t.stcContentSha256,E=t.stcDate;a===e.UploadMethod.MINIO&&(d=t.minioAuthorization,R=t.minioContentSha256,E=t.minioDate),o.setRequestHeader("Authorization",d),o.setRequestHeader("x-amz-content-sha256",R),o.setRequestHeader("x-amz-date",E),o.setRequestHeader("Content-Type",u),o.send(),o.onreadystatechange=function(){if(4===o.readyState){var e=o.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===o.status||204===o.status?function(e){for(var t=[],n=1;n<=g;n++)t.push(p(e,n));I(e,t)}(Array.isArray(e)&&e[1]):r.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));var R=[],E=new Map;function I(o,s){s&&Array.isArray(s)&&0!==s.length&&Promise.all(s).then((function(){var s="uploadId=".concat(o);if(E.size===g)t.getFileToken(d,i,"POST",s).then((function(t){console.log("onSuccess",t),console.log("onSuccess:uploadId",o);var d=t.stcAuthorization,l=t.stcContentSha256,g=t.stcDate;a===e.UploadMethod.MINIO&&(d=t.minioAuthorization,l=t.minioContentSha256,g=t.minioDate);var v=new XMLHttpRequest;v.open("POST","".concat(c,"?").concat(s),!0),v.setRequestHeader("Authorization",d),v.setRequestHeader("x-amz-content-sha256",l),v.setRequestHeader("x-amz-date",g),v.setRequestHeader("Content-Type",u);var f="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",R=Array.from(E.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",R),R.forEach((function(e){f+="<Part><ETag>".concat(E.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),f+="</CompleteMultipartUpload>",v.send(f),console.log("xml",f),v.onreadystatechange=function(){if(4===v.readyState)if(200===v.status||204===v.status){var e={name:n.name,filename:i,uploadMethod:a};r.onCompleted(e)}else r.onError("uploadStcMultipart:upload does not end")}}),(function(e){r.onError("uploadStcMultipart:".concat(e))}));else{for(var l=[],v=0,f=R;v<f.length;v++){var T=f[v];l.push(p(o,T))}I(o,l)}}),(function(e){console.error(e),r.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,a=R;n<a.length;n++){var s=a[n];t.push(p(o,s))}I(o,t)}))}function p(r,s){return new Promise((function(l,g){var v="partNumber=".concat(s,"&uploadId=").concat(r);t.getFileToken(d,i,"PUT",v).then((function(t){console.log("signature ".concat(s," onSuccess"),t);var r=n&&n.slice((s-1)*o.stc_chunk_size,s*o.stc_chunk_size);console.log("fileChunk:size",r.size);var i=t.stcAuthorization,d=t.stcContentSha256,f=t.stcDate;a===e.UploadMethod.MINIO&&(i=t.minioAuthorization,d=t.minioContentSha256,f=t.minioDate);var I=new XMLHttpRequest;I.open("PUT","".concat(c,"?").concat(v),!0),I.setRequestHeader("Authorization",i),I.setRequestHeader("x-amz-content-sha256",d),I.setRequestHeader("x-amz-date",f),I.setRequestHeader("Content-Type",u),I.send(r),I.onreadystatechange=function(){if(4===I.readyState)if(200===I.status||204===I.status){var e=I.getResponseHeader("etag");console.log("etag:".concat(s),e),E.set(s,e),l(e)}else R.includes(s)||R.push(s),g(s)}}),(function(e){console.log("getETags: Signature verification failure"),R.includes(s)||R.push(s),g(s)}))}))}}var qe={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Je()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),ze(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=Je()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,ze(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Je(){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 ze(e,t){for(var n in e)t(n,e[n])}var je,Ke=0,Ye=function(){function t(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:qe.form,genUId:Je};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return t.prototype.setOptions=function(e){var t=this;ze(e,(function(e,n){t.options[e]=n}))},t.prototype.upload=function(t,n,o,r){if(o){var a=this;!function(t,n,o,r,a){Te=o,he=r,we=[];var s,i,c=t.getNaviInfoFromCache();if(1===(null==c?void 0:c.type)&&n.uploadDomain&&!r.ossConfig)we=[["qiniu",n.uploadDomain]];else if(r.ossConfig){var u,d,l,g=JSON.parse(r.ossConfig),v="",f=[];g.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(v=e[n]),"s3"===n&&(u=e[n]),"stc"===n&&(d=e[n]),"minio"===n&&(l=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&we.push(e)})),g.length!==we.length&&(we=[["qiniu",r.domain],["baidu",r.uploadHost.bos],["aliyun",v],["s3",u],["stc",d],["minio",l]])}else we=[["qiniu",r.domain],["baidu",r.uploadHost.bos]];if(r.ossConfig){var R=r&&JSON.parse(r.ossConfig);Array.isArray(R)||(R=[]),s=R.find((function(e){return Object.keys(e).includes("stc")})),i=R.find((function(e){return Object.keys(e).includes("minio")}))}if(s&&1===parseInt(s.p,10)&&o.size>=4194304)Ze(t,o,r,a,e.UploadMethod.STC,s.stc);else if(i&&1===parseInt(i.p,10)&&o.size>=4194304)Ze(t,o,r,a,e.UploadMethod.MINIO,i.minio);else{var E=r.data(o,r);Pe[we[0][0]](E,r,a,o,e.UploadMethod.MINIO)}}(t,n,o,this.options,{onProgress:function(e,t,n){(je=e,n)?je=Ke+e/t*(t-Ke):Ke=je;r.onProgress(je,t)},onCompleted:function(e){r.onCompleted(e)},onError:function(e){r.onError(e)},onOpen:function(e){a.xhr=e}})}else r.onError("upload file is null.")},t.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},t}();var We,Xe,Qe={init:function(e){return new Ye(e)},dataType:qe,resize:function(e,t,n){var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,a=new Image;a.src=r;var s=a.width,i=a.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var a=e.height,s=t.maxHeight||0;if(s>0&&a>s){var i=s/a;n=Math.min(n,i)}var c=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;n=Math.min(n,d)}return n}({width:s,height:i,size:e.total},t),u=r;c<1&&(u=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")}(a,s*c,i*c)),n(u)}},Upload:Ye},$e=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),a=new Image,s="string"==typeof e;a.onload=function(s){var i=function(e,t,n){var o,r,a,s=e<t,i=0,c=0;return(s?t/e:e/t)>n.scale?(s?(r=100,c=((a=t/(o=e/100))-n.maxHeight)/2):(a=100,i=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:a,x:-i,y:-c}):(s?(o=t/n.maxHeight,a=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,a=t/o),{w:r,h:a,x:-i,y:-c})}(a.width,a.height,t);o.width=i.w>t.maxWidth?t.maxWidth:i.w,o.height=i.h>t.maxHeight?t.maxHeight:i.h,r.drawImage(a,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)},a.src=s?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},et=function(e,t){var n=e.file,o=e.compress;$e(n,o,t)},nt=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.minioHeader={},e.minioHeader.minioAuthorization=o.minioAuthorization,e.minioHeader.minioContentSha256=o.minioContentSha256,e.minioHeader.minioDate=o.minioDate,e.minioBucketName=o.minioBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=Qe.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Qe.init(e);t(n)}},ot=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||et;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},rt=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){ot(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),at=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};ot(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),st={initFile:function(e,t){nt(e,(function(e){var n=new rt(e);t(n)}))},initImage:function(e,t){nt(e,(function(n){var o,r,a,s,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===(a=e.thumbnailConfig)||void 0===a?void 0:a.quality)||.5,scale:(null===(s=e.thumbnailConfig)||void 0===s?void 0:s.scale)||2.4},c=new at(n,i);t(c)}))},dataType:Qe.dataType};function it(r,a,s,i,c,u,d){var l=this;void 0===d&&(d=e.FileType.FILE);var g=e.FileType.FILE;d===e.FileType.IMAGE&&(g=e.FileType.IMAGE);var v=r.getNaviInfoFromCache();if(!Xe&&(Xe="upload.qiniup.com",v&&v.ossConfig))try{var f=JSON.parse(v.ossConfig).find((function(e){return void 0!==e.qiniu}));f&&(Xe=f.qiniu)}catch(e){}var R=t({domain:Xe,getToken:function(e){r.getFileToken(g,i.name).then((function(t){e(t.token,t)})).catch((function(e){c.onFail(e)}))}},u),E=st.initFile;g===e.FileType.IMAGE&&(E=st.initImage),E(R,(function(a){a.upload(r,s,i,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=c.onProgress)||void 0===n||n.call(c,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)||(null==v?void 0:v.ossConfig)?(function(n,o,r,a,s){dt(o,a.filename,a.name,a,a.uploadMethod).then((function(i){if(0===i.code){var c=i.data;c.type=r.type,c.name=a.name||a.filename,n!==e.FileType.AUDIO?(o===e.FileType.IMAGE&&(c.thumbnail=a.thumbnail,c.width=a.w,c.height=a.h,c.size=a.size),s.onSuccess(c)):ct(r).then((function(e){s.onSuccess(t(t({},c),e))}))}else s.onFail(i)})).catch((function(e){s.onFail(e)}))}(d,g,i,r,c),[2]):(function(n,o,r,a,s,i){var c={type:a.type,name:s.rc_url.file_name,downloadUrl:n.uploadDomain+s.rc_url.path};if(o===e.FileType.AUDIO)return void ct(a).then((function(e){i.onSuccess(t(t({},c),e))}));o===e.FileType.IMAGE&&(c.thumbnail=s.thumbnail,c.width=s.w,c.height=s.h,c.size=s.size);i.onSuccess(c)}(s,d,0,i,r,c),[2])}))}))},onError:function(e){c.onFail(e)}})}))}function ct(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?ut(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(ut).then((function(e){t(e)}))}))}function ut(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 dt(t,n,o,r,a){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",a,e.AssertRules.NUMBER)?ae((function(s){return new Promise((function(i){s.getFileUrl(t,n,o,r,a).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 lt(r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return[2,ae((function(c,u){return n(i,void 0,void 0,(function(){var n,i,d,l,g,v,f,R,E,I,p,T;return o(this,(function(o){switch(o.label){case 0:return s=s||{},a instanceof Ie==!1?(u.warn(e.LogTagId.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,ie.ILLGAL_PARAMS]):e.validate("conversation",r,e.AssertRules.OBJECT,!0)?(n=r.conversationType,i=r.targetId,d=r.channelId,e.validate("conversation.targetId",i,e.AssertRules.STRING,!0)&&e.validate("conversation.conversationType",n,e.AssertRules.NUMBER,!0)&&e.validate("conversation.channelId",d,e.AssertRules.CHANNEL_ID)&&e.validate("options.isStatusMessage",null==s?void 0:s.isStatusMessage,e.AssertRules.BOOLEAN)&&e.validate("options.disableNotification",null==s?void 0:s.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushContent",null==s?void 0:s.pushContent,e.AssertRules.STRING)&&e.validate("options.pushData",null==s?void 0:s.pushData,e.AssertRules.STRING)&&e.validate("options.isMentioned",null==s?void 0:s.isMentioned,e.AssertRules.BOOLEAN)&&e.validate("options.mentionedType",null==s?void 0:s.mentionedType,e.AssertRules.NUMBER)&&e.validate("options.mentionedUserIdList",null==s?void 0:s.mentionedUserIdList,e.AssertRules.ARRAY)&&e.validate("options.directionalUserIdList",null==s?void 0:s.directionalUserIdList,e.AssertRules.ARRAY)&&e.validate("options.isVoipPush",null==s?void 0:s.isVoipPush,e.AssertRules.BOOLEAN)&&e.validate("options.canIncludeExpansion",null==s?void 0:s.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("options.expansion",null==s?void 0:s.expansion,e.AssertRules.OBJECT)&&e.validate("options.pushConfig",null==s?void 0:s.pushConfig,e.AssertRules.OBJECT)&&e.validate("options.messageId",null==s?void 0:s.messageId,e.AssertRules.NUMBER)?(l="conversationType:".concat(n,",targetId:").concat(i),u.debug(e.LogTagId.O,"send message ->".concat(l)),g=function(e,n,o){var r=e.isStatusMessage,a=e.disableNotification,s=e.pushContent,i=e.pushData,c=e.isMentioned,u=e.mentionedType,d=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:a,pushContent:s,pushData:i,isMentioned:c,mentionedType:u,mentionedUserIdList:d,directionalUserIdList:l,isVoipPush:g,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:R,pushConfig:E,channelId:p||"",messageId:I},n)}(s,a,r),v={isMentioned:!!s.isMentioned,content:a.content,messageType:a.messageType,isPersited:!!a.isPersited,isCounted:!!a.isCounted,disableNotification:!!(null==s?void 0:s.disableNotification),canIncludeExpansion:!!(null==s?void 0:s.canIncludeExpansion),expansion:(null==s?void 0:s.expansion)||null,conversationType:r.conversationType,targetId:r.targetId,channelId:r.channelId,senderUserId:c.getCurrentUserId(),messageUId:"",messageDirection:e.MessageDirection.SEND,receivedTime:0,isStatusMessage:!!s.isStatusMessage,receivedStatus:e.ReceivedStatus.UNREAD,isOffLineMessage:!1,pushConfig:null==s?void 0:s.pushConfig,sentStatus:e.SentStatus.SENDING},n!==e.ConversationType.ULTRA_GROUP&&(v.isOffLineMessage=!1),f=u.createTraceId(),R=function(t){v.messageId=t;try{(null==s?void 0:s.onSendBefore)&&s.onSendBefore(K(v))}catch(t){u.error(e.LogTagId.O,'Callback method "onSendBefore" execution error.\n'.concat(null==t?void 0:t.stack),f)}},u.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:a.messageType,conversationType:n,targetId:i,channelId:d}),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?(u.info(e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:I,messageUId:p.messageUId,messageId:p.messageId}),f),T=K(p),[2,{code:I,data:T}]):(u.warn(e.LogTagId.A_SEND_MSG_R,"send message fail ->".concat(I,":").concat(ce[I],",").concat(l)),v.sentTime=(null==p?void 0:p.sentTime)||0,v.sentStatus=null==p?void 0:p.sentStatus,[2,{code:I,msg:ce[I],data:K(v)}])}}))}))}))]}))}))}function gt(n,o){return function(r,a,s,i){if(!e.validate("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});var c={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var u=null==i?void 0:i.thumbnailConfig;if(!(e.validate("sendOptions.maxHeight",null==u?void 0:u.maxHeight,e.AssertRules.NUMBER)&&e.validate("sendOptions.maxWidth",null==u?void 0:u.maxWidth,e.AssertRules.NUMBER)&&e.validate("sendOptions.quality",null==u?void 0:u.quality,e.AssertRules.NUMBER)&&e.validate("sendOptions.scale",null==u?void 0:u.scale,e.AssertRules.NUMBER)))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});c.thumbnailConfig=u}return ae((function(u,d,l){return new Promise((function(g){var v=d.createTraceId();d.info(e.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:a.file.size,type:n}),v),it(u,0,l,a.file,{onProgress:null==s?void 0:s.onProgress,onSuccess:function(n){var c,u=(null===(c=null==s?void 0:s.onComplete)||void 0===c?void 0:c.call(s,t({url:n.downloadUrl},n)))||o(n,a);n&&n.downloadUrl&&d.info(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:n.downloadUrl,code:e.ErrorCode.SUCCESS}),v),lt(r,u,i).then(g)},onFail:function(t){d.warn(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({code:e.ErrorCode.UPLOAD_FILE_FAILED}),v),g({code:e.ErrorCode.UPLOAD_FILE_FAILED,msg:t||e.ErrorCode[e.ErrorCode.UPLOAD_FILE_FAILED]})}},c,n)}))}))}}var vt=gt(e.FileType.FILE,(function(e,t){return new Ne({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})),ft=gt(e.FileType.IMAGE,(function(e,t){return new me({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),Rt=gt(e.FileType.IMAGE,(function(e,t){return new _e({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),Et=gt(e.FileType.AUDIO,(function(e,t){return new Ce({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),It=gt(e.FileType.SIGHT,(function(e,t){return new Se({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})}));gt(e.FileType.COMBINE_HTML,(function(e,t){return new Oe({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var pt=Object.freeze({__proto__:null,getAllConversationList:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("channelId",t,e.AssertRules.CHANNEL_ID)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getAllConversationList -> channelId: ".concat(t)),e.isUndefined(t)?[4,a.getConversationListWithAllChannel()]:[3,2];case 1:return n=o.sent(),[3,4];case 2:return[4,a.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 Y(e)})),[2,{code:r,data:c}]):(s.warn(e.LogTagId.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(t)),[2,{code:r,msg:ce[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversationList:function(t,r,a){return n(this,void 0,void 0,(function(){var s=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",a,e.AssertRules.CHANNEL_ID)?[2,ae((function(i,c){return n(s,void 0,void 0,(function(){var n,s,u,d,l,g;return o(this,(function(o){switch(o.label){case 0:return n="startTime: ".concat(t,", count: ").concat(r,", channelId: ").concat(a),c.info(e.LogTagId.O,"getConversationList -> ".concat(n)),e.isUndefined(a)?[4,i.getConversationListWithAllChannelByPage(t,r)]:[3,2];case 1:return s=o.sent(),[3,4];case 2:return u=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(u,t,r,a)];case 3:s=o.sent(),o.label=4;case 4:return d=s.code,l=s.data,d===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return Y(e)})),[2,{code:d,data:g}]):(c.warn(e.LogTagId.O,"getConversationList fail -> code: ".concat(d," ").concat(n)),[2,{code:d,msg:ce[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent:function t(r,a,s){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",a,e.AssertRules.ARRAY,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)&&!a.some((function(t){return!e.validate("messageType",t,e.AssertRules.STRING,!0)}))?[2,ae((function(c,u){return n(i,void 0,void 0,(function(){var n,i,d,l,g;return o(this,(function(o){switch(o.label){case 0:return n="keyword: ".concat(r,", messageTypes: ").concat(JSON.stringify(a),", channelId: ").concat(s),u.info(e.LogTagId.O,"searchConversationByContent -> ".concat(t)),e.isUndefined(s)?[4,c.searchConversationByContentWithAllChannel(r,a)]:[3,2];case 1:return i=o.sent(),[3,4];case 2:return[4,c.searchConversationByContent(r,a,s)];case 3:i=o.sent(),o.label=4;case 4:return d=i.code,l=i.data,d===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return Y(e)})),[2,{code:d,data:g}]):(u.warn(e.LogTagId.O,"searchConversationByContent fail -> code: ".concat(d," ").concat(n)),[2,{code:d,msg:ce[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessages:function(t,r,a,s){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",a,e.AssertRules.NUMBER,!0)&&e.validate("count",s,e.AssertRules.NUMBER,!0)?[2,ae((function(c,u){return n(i,void 0,void 0,(function(){var n,i,d,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(a,", count: ").concat(s),u.info(e.LogTagId.O,"searchMessages -> ".concat(n)),i=t.targetId,d=t.conversationType,l=t.channelId,e.isUndefined(l)?[4,c.searchMessageByContentWithAllChannel(d,i,r,a,s)]:[3,2];case 1:return g=o.sent(),[3,4];case 2:return 0,[4,c.searchMessageByContent(d,i,r,a,s,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 K(e)})),[2,{code:v,data:{messages:I,count:E}}]):(u.warn(e.LogTagId.O,"searchMessages fail -> code: ".concat(v," ").concat(n)),[2,{code:v,msg:ce[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d,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)),a=t.conversationType,c=t.targetId,u=r.keyword,d=r.startTime,l=r.endTime,g=r.offset,v=r.limit,g=g||0,v=v||5,[4,s.searchMessageByContentInTimeRangeWithAllChannel(a,c,u,d,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 K(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:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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("options.count",r.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d,l,g,v,f,R,E,I,p,T,h;return o(this,(function(o){switch(o.label){case 0:return n=r.count,a=r.timestamp,c=r.order,u=r.messageTypes,d="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(r)),i.info(e.LogTagId.O,"getHistoryMessagesByMessageTypes -> ".concat(d)),l=t.conversationType,g=t.targetId,v=t.channelId,n||(n=20),a||(a=0),c||(c=0),v||(v=""),[4,s.getHistoryMessagesByObjectNames(l,g,a,n,u,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 K(e)})),[2,{code:R,data:{messages:h,hasMore:T,list:h}}]):(i.warn(e.LogTagId.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(R," ").concat(d)),[2,{code:R,msg:ce[R]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u;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)),a=t.conversationType,c=t.targetId,u=t.channelId,[4,s.setMessageStatusToRead(a,c,r,u)];case 1:return[2,o.sent()]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,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,s.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:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,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,s.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:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageContent:function(t,r,a){return void 0===a&&(a=""),n(this,void 0,void 0,(function(){var s=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",a,e.AssertRules.ONLY_STRING,!0)?[2,ae((function(i,c){return n(s,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(a)),[4,i.setMessageContent(t,r,a)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){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,ae((function(a,s){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return s.info(e.LogTagId.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(t))),[4,a.deleteMessages(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearMessages:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,i=t.channelId,s.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,a.clearMessages(n,r,i)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(t,r,a){return n(this,void 0,void 0,(function(){var s,i,c,u=this;return o(this,(function(d){return e.usingCppEngine()?(s=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",s,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",a,e.AssertRules.BOOLEAN)?[2,ae((function(e,t){return n(u,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,e.deleteMessagesByTimestamp(s,i,r,a,c)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},insertMessage:function(t,r,a){return void 0===a&&(a={}),n(this,void 0,void 0,(function(){var s=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",a,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==a?void 0:a.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==a?void 0:a.searchContent,e.AssertRules.STRING)&&(r instanceof Ie||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,ae((function(i,c){return n(s,void 0,void 0,(function(){var n,s,u,d,l,g,v,f,R,E,I,p,T,h,m;return o(this,(function(o){switch(o.label){case 0:return n="",s=1,g=!1,f=r.messageType,R=r.content,r instanceof Ie||(n=r.senderUserId,s=r.messageDirection,g=r.canIncludeExpansion,v=r.expansion,l=r.disableNotification,u=r.sentTime,d=r.sentStatus),c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),E=a.isUnread,I=a.searchContent,p={senderUserId:n,messageType:f,content:R,messageDirection:s,sentTime:u,sentStatus:d,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,m=T.data,h===e.ErrorCode.SUCCESS?[2,{code:h,data:K(m)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(h,",targetId:").concat(t.targetId)),[2,{code:h,msg:ce[h]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(t,r){var a,s;return n(this,void 0,void 0,(function(){var i,c=this;return o(this,(function(u){if(!e.usingCppEngine())return[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[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===(a=t[i])||void 0===a?void 0:a.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null===(s=t[i])||void 0===s?void 0:s.searchContent,e.AssertRules.STRING)))return[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,msg:String(i)}];return[2,ae((function(a){return n(c,void 0,void 0,(function(){var n,s,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.batchInsertMessage(t,r)];case 1:return n=o.sent(),s=n.code,i=n.data,s===e.ErrorCode.SUCCESS?[2,{code:s,data:i}]:[2,{code:s,msg:ce[s]}]}}))}))}))]}))}))},getMessageCount:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?[2,ae((function(e){return n(r,void 0,void 0,(function(){var n,r,a,s,i,c;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,r=t.targetId,a=t.channelId,[4,e.getMessageCount(n,r,a)];case 1:return s=o.sent(),i=s.code,c=s.data,[2,{code:i,data:c}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("messageUId",t,e.AssertRules.STRING,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getPrivateMessageDeliverTime(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(s.warn(e.LogTagId.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(t)),[2,{code:r,msg:ce[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",r,e.AssertRules.STRING,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getGroupMessageDeliverList(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:c}]:(i.warn(e.LogTagId.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(t," messageUId:").concat(r)),[2,{code:a,msg:ce[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("enableCheck",t,e.AssertRules.BOOLEAN)?[2,ae((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:ce[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,ae((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"clearLocalData ->"),[4,r.clearData()];case 1:return t=o.sent(),n=t.code,s=t.data,[2,{code:n,data:s}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))}}),Tt=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,"OperateStatus",{enumerable:!0,get:function(){return e.OperateStatus}}),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=Ie,exports.CombineMessage=Oe,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=Ne,exports.GIFMessage=_e,exports.HQVoiceMessage=Ce,exports.ImageMessage=me,exports.LocationMessage=Me,exports.MentionedInfoBody=Tt,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=Ue,exports.RichContentMessage=Le,exports.SightMessage=Se,exports.TextMessage=Ae,exports.VoiceMessage=ye,exports.__addSDKVersion=function(t,n){e.VersionManage.add(t,n)},exports.addConversationsToTag=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,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,s.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:ce[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addEventListener=function(e,t,n){X.on(e,t,n)},exports.addTag=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){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,ae((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"createTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,a.createTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(s.warn(e.LogTagId.O,"createTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:ce[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(a){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return s.info(e.LogTagId.O,"addToBlacklist -> userId: ".concat(t)),[4,a.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(a){return e.validate("option.chatRoomId",t.chatRoomId,e.AssertRules.STRING,!0)&&e.validate("option.rtcRoomId",t.rtcRoomId,e.AssertRules.STRING,!0)?[2,ae((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:ce[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,ae((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=se,exports.clearHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a;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,s.deleteRemoteMessageByTimestamp(t.conversationType,t.targetId,r,t.channelId)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"clear message ->".concat(a,":").concat(ce[a],",").concat(n)),[2,{code:a,msg:ce[a]}]):[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(a){return W("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),e.usingCppEngine()?[2,ae((function(a,s){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,s.info(e.LogTagId.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,a.clearMessages(n,r,i)];case 1:return(c=o.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(s.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:ce[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.clearMessagesUnreadStatus=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,a.clearUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"clear unreadMsgNum ->".concat(r)),n!==e.ErrorCode.SUCCESS?(s.warn(e.LogTagId.O,"clear unreadMsgNum fail ->".concat(n,":").concat(ce[n],",").concat(r)),[2,{code:n,msg:ce[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(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){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),s.debug(e.LogTagId.O,"delete draft ->".concat(n)),[4,a.clearConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return(r=o.sent())===e.ErrorCode.SUCCESS?[2,{code:r}]:(s.warn(e.LogTagId.O,"delete draft fail ->".concat(r,":").concat(ce[r],",").concat(n)),[2,{code:r,msg:ce[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearUnreadCountByTimestamp=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u;return o(this,(function(o){switch(o.label){case 0:return n=t.conversationType,a=t.targetId,c=t.channelId,i.info(e.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,s.clearUnreadCountByTimestamp(n,a,r,c)];case 1:return(u=o.sent())===e.ErrorCode.SUCCESS?[2,{code:u}]:(i.warn(e.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(u,",targetId:").concat(a)),[2,{code:u,msg:ce[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.connect=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,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,s.connect(t,!!r,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=o.sent(),c=a.code===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===e.ErrorCode.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:ce[a.code]}]}}))}))}))]}))}))},exports.deleteLocalMessagesByTimestamp=function(t,r,a){return n(this,void 0,void 0,(function(){var s,i,c,u=this;return o(this,(function(d){return W("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),e.usingCppEngine()?(s=t.conversationType,i=t.targetId,c=t.channelId,e.validate("conversationType",s,e.AssertRules.NUMBER,!0)&&e.validate("targetId",i,e.AssertRules.STRING,!0)&&e.validate("timestamp",r,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",a,e.AssertRules.BOOLEAN)?[2,ae((function(d,l){return n(u,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,d.deleteMessagesByTimestamp(s,i,r,a,c)];case 1:return n=o.sent(),l.debug(e.LogTagId.A_DELETE_MESSAGES_S,JSON.stringify({code:n,conversationType:s,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:ce[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.deleteMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a;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,s.deleteRemoteMessage(t.conversationType,t.targetId,r,t.channelId)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"delete message fail ->".concat(a,":").concat(ce[a],",").concat(n)),[2,{code:a,msg:ce[a]}]):[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 ee?(se(),[2,oe()]):[2]}))}))},exports.disconnect=function(t){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),re((function(e){return e.disconnect(t)}))},exports.electronExtension=pt,exports.forceRemoveChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Re(r)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a;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,s.forceRemoveChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force remove chatroom entry fail ->code+:".concat(ce[a],",").concat(n)),[2,{code:a,msg:ce[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.forceSetChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&ve(r)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a;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,s.forceSetChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force set chatroom entry fail ->code+:".concat(ce[a],",").concat(n)),[2,{code:a,msg:ce[a]}]):[2,{code:a}]}}))}))}))]:[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(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,ae((function(a,s){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),s.debug(e.LogTagId.O,"get all chatroom entries->".concat(n)),[4,a.getAllChatroomEntries(t)];case 1:return r=o.sent(),i=r.code,c=r.data,i===e.ErrorCode.SUCCESS&&c?[2,{code:i,data:c}]:(s.warn(e.LogTagId.O,"get all chatroom entries fail ->code+:".concat(ce[i],",").concat(n)),[2,{code:i,msg:ce[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,ae((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,ae((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s,i;return o(this,(function(o){switch(o.label){case 0:return t="getAllUltraGroupUnreadCount",[4,r.getAllUltraGroupUnreadCount()];case 1:return n=o.sent(),s=n.code,i=n.data,a.debug(e.LogTagId.O,t),s===e.ErrorCode.SUCCESS?[2,{code:s,data:i}]:(a.warn(e.LogTagId.O,"".concat(t," fail ->").concat(s,": ").concat(ce[s])),[2,{code:s,msg:ce[s]}])}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){var t=this;return o(this,(function(r){return[2,ae((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s,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(),s=n.code,i=n.data,a.debug(e.LogTagId.O,t),s===e.ErrorCode.SUCCESS?[2,{code:s,data:i}]:(a.warn(e.LogTagId.O,"".concat(t," fail ->").concat(s,": ").concat(ce[s])),[2,{code:s,msg:ce[s]}])}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,ae((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,ae((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return a.info(e.LogTagId.O,"getBlacklist -> "),[4,r.getBlacklist()];case 1:return t=o.sent(),n=t.code,s=t.data,n===e.ErrorCode.SUCCESS&&s?[2,{code:n,data:s}]:(a.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(a){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getBlacklistStatus -> userId: ".concat(t)),[4,a.getBlacklistStatus(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:0===i}]:(s.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,ae((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return[4,r.getBlockUltraGroupList()];case 1:return t=o.sent(),n=t.code,s=t.data,n===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:s}]:(a.warn(e.LogTagId.O,"get block ultragroup ->".concat(n,":").concat(ce[n])),[2,{code:n,msg:ce[n]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){return[2,ae((function(e){return e.getBlockConversationList()}))]}))}))},exports.getChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u;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,s.getChatroomEntry(t,r)];case 1:return a=o.sent(),c=a.code,u=a.data,c===e.ErrorCode.SUCCESS&&u?[2,{code:c,data:u}]:(i.warn(e.LogTagId.O,"get chatroom entry fail ->code+:".concat(ce[c],",").concat(n)),[2,{code:c,msg:ce[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatRoomInfo=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u;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,s.getChatroomInfo(t,r.count,r.order)];case 1:return a=o.sent(),c=a.code,u=a.data,c===e.ErrorCode.SUCCESS&&u?[2,{code:c,data:u}]:(i.warn(e.LogTagId.O,"get chatroom info fail ->code+:".concat(ce[c],",").concat(n)),[2,{code:c,msg:ce[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatroomHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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.count",r.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&e.validate("options.order",r.order,(function(e){return 0===e||1===e}))?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d;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,s.getChatRoomHistoryMessages(t,r.count,r.order,r.timestamp)];case 1:return a=o.sent(),c=a.code,u=a.data,c===e.ErrorCode.SUCCESS&&u?(d=u.list.map((function(e){return K(e)})),[2,{code:c,data:{list:d,hasMore:!!u.hasMore}}]):(i.warn(e.LogTagId.O,"get chatroom history message fail ->code+:".concat(ce[c],",").concat(n)),[2,{code:c,msg:ce[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConnectionStatus=function(){return re((function(e){return e.getConnectionStatus()}))},exports.getConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getConversation(t.conversationType,t.targetId,t.channelId||"")];case 1:return n=o.sent(),r=n.code,i=n.data,r!==e.ErrorCode.SUCCESS?(s.warn(e.LogTagId.O,"getConversation ->code:".concat(r,", targetId:").concat(t.targetId)),[2,{code:r,msg:ce[r]}]):[2,{code:r,data:i?Y(i):null}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationList=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.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(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return Y(e)}))}]:(i.warn(e.LogTagId.O,"get conversation list fail ->".concat(a,":").concat(ce[a])),[2,{code:a,msg:ce[a]}])}}))}))}))]:[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(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){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=le(s,t,"getConversationNotificationLevel"),[4,a.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}]:(s.warn(e.LogTagId.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(ce[i]," , ").concat(n)),[2,{code:i,msg:ce[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(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.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}]:(s.warn(e.LogTagId.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:ce[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationsFromTagByPage=function(r,a,s){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",a,e.AssertRules.NUMBER,!0)&&e.validate("startTime",s,e.AssertRules.NUMBER,!0)?[2,ae((function(c,u){return n(i,void 0,void 0,(function(){var n,i,d;return o(this,(function(o){switch(o.label){case 0:return u.info(e.LogTagId.O,"getConversationListByTag ->tagId:".concat(r)),[4,c.getConversationListByTag(r,s,a)];case 1:return n=o.sent(),i=n.code,d=n.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:null==d?void 0:d.map((function(e){return function(e){return t(t({},Y(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(u.warn(e.LogTagId.O,"getConversationListByTag ->code:".concat(i,",tagId:").concat(r)),[2,{code:i,msg:ce[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getCurrentUserId=function(){return re((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return re((function(e){return e.getDeviceId()}))},exports.getFileToken=function(t,n,o,r){return ae((function(a){return new Promise((function(s){a.getFileToken(t,n,o,r).then((function(t){s({code:e.ErrorCode.SUCCESS,data:t})})).catch((function(e){s({code:e,msg:ce[e]})}))}))}))},exports.getFileUrl=dt,exports.getFirstUnreadMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){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,a.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&&K(i)||null,[2,{code:r,data:c}]):(s.warn(e.LogTagId.O,"insertMessage ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:ce[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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.usingCppEngine()||e.validate("options.count",null==r?void 0:r.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d;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,s.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 a=o.sent(),c=a.code,u=a.data,c===e.ErrorCode.SUCCESS&&u?(d=u.list.map((function(e){return K(e)})),i.info(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageLength:d.length}),n),[2,{code:c,data:{list:d,hasMore:u.hasMore}}]):(i.warn(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageUIds:""}),n),[2,{code:c,msg:ce[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(a){return e.usingCppEngine()?e.validate("messageId",t,(function(t){return e.isNumber(t)||e.isString(t)}),!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.getMessage(t)];case 1:return n=o.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:K(i)}]:(s.warn(e.LogTagId.O,"getMessage ->code:".concat(r,",messageId:").concat(t)),[2,{code:r,msg:ce[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getMessageReader=function(t,r,a){return n(this,void 0,void 0,(function(){var s=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",a,e.AssertRules.CHANNEL_ID)?[2,ae((function(i,c){return n(s,void 0,void 0,(function(){var n,s,u,d;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,a)];case 1:return s=o.sent(),u=s.code,d=s.data,u===e.ErrorCode.SUCCESS?[2,{code:u,data:d}]:(c.warn(e.LogTagId.O,"get message reader fail ->".concat(u,":").concat(ce[u],",").concat(n)),[2,{code:u,msg:ce[u]}])}}))}))}))]:[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,ae((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return[4,r.getProxy()];case 1:return t=o.sent(),n=t.code,s=t.data,n===e.ErrorCode.SUCCESS?[2,{code:n,data:s}]:(a.warn(e.LogTagId.O,"getProxy ->code:".concat(n)),[2,{code:n,msg:ce[n]}])}}))}))}))]}))}))},exports.getRemoteHistoryMessages=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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.count",null==r?void 0:r.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d;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,s.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 a=o.sent(),c=a.code,u=a.data,c===e.ErrorCode.SUCCESS&&u?(d=u.list.map((function(e){return K(e)})),[2,{code:c,data:{list:d,hasMore:u.hasMore}}]):(i.warn(e.LogTagId.O,"get history message fail ->".concat(c,":").concat(ce[c],",").concat(n)),[2,{code:c,msg:ce[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getServerTime=function(){return re((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,ae((function(r,a){return n(t,void 0,void 0,(function(){var t,n,s;return o(this,(function(o){switch(o.label){case 0:return[4,r.getTagList()];case 1:return t=o.sent(),n=t.code,s=t.data,a.warn(e.LogTagId.O,"getTagList ->code:".concat(n)),[2,{code:e.ErrorCode.SUCCESS,data:s}]}}))}))}))]}))}))},exports.getTagsFromConversation=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"getTagsForConversation ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.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:ce[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(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){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,a.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),s.debug(e.LogTagId.O,"get draft ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i||""}]:(s.warn(e.LogTagId.O,"get draft fail ->".concat(r,":").concat(ce[r],",").concat(c)),[2,{code:r,msg:ce[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTopConversationList=function(t,r){return n(this,void 0,void 0,(function(){var a=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.isValidConversationType)})))&&e.validate("channelId",r,e.AssertRules.CHANNEL_ID)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getTopConversationList(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return Y(e)}))}]:(i.warn(e.LogTagId.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(ce[a])),[2,{code:a,msg:ce[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCount=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,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,s.getTotalUnreadCount("",r,t)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCount fail ->".concat(a,":").concat(ce[a])),[2,{code:a,msg:ce[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getTotalUnreadCountByLevels(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(ce[a])),[2,{code:a,msg:ce[a]}])}}))}))}))]}))}))},exports.getTotalUnreadMentionedCountByLevels=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return[4,s.getTotalUnreadCountByLevels(t,r,!0)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(ce[a])),[2,{code:a,msg:ce[a]}])}}))}))}))]}))}))},exports.getUltraGroupDefaultNotificationLevel=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c,u;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),s.debug(e.LogTagId.O,"".concat(n," -> ").concat(r)),[4,a.getUltraGroupDefaultNotificationLevel(t.targetId,t.channelId)];case 1:return i=o.sent(),c=i.code,u=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:u}]:(s.warn(e.LogTagId.O,"".concat(n," fail -> ").concat(c," : ").concat(ce[c]," , ").concat(r)),[2,{code:c,msg:ce[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(a){return e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)?[2,ae((function(a){return n(r,void 0,void 0,(function(){var n,r,s,i,c,u;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,r=t.channelId,s={targetId:n,channelId:r},[4,a.getUltraGroupFirstUnreadMessageTimestamp(s)];case 1:return i=o.sent(),c=i.code,u=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:u}]:[2,{code:c,msg:ce[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(a){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,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return[4,a.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}]:(s.warn(e.LogTagId.O,"get ultragroup ->".concat(r,":").concat(ce[r])),[2,{code:r,msg:ce[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupMessageListByMessageUId=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("msgs",r,e.AssertRules.ARRAY,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d,l,g,v,f,R;return o(this,(function(o){switch(o.label){case 0:return n=t.targetId,a=t.conversationType,c=t.channelId,u=[],r.forEach((function(e){var t=e.sendTime,n=e.messageUId;u.push({sendTime:t,messageUId:n,channelId:c})})),d={targetId:n,conversationType:a,messages:u},[4,s.getUltraGroupMessageListByMessageUId(d)];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]?K(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(ce[g])),[2,{code:g,msg:ce[g]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d;return o(this,(function(o){switch(o.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,s.getUltraGroupUnreadCountByTargetId(t,r)];case 1:return a=o.sent(),c=a.code,u=a.data,d="targetId: ".concat(t,", levels: ").concat(JSON.stringify(r)),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(d)),[2,{code:c,data:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,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,s.getUltraGroupUnreadMentionedCountByTargetId(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:c}]:(i.warn(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(ce[a])),[2,{code:a,msg:ce[a]}])}}))}))}))]:[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(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("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,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c,u,d,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,u={targetId:n,channelId:r,sentTime:i,count:c},[4,a.getUltraGroupUnreadMentionedMessages(u)];case 1:return d=o.sent(),l=d.code,g=d.data,l===e.ErrorCode.SUCCESS?[2,{code:l,data:g}]:(s.warn(e.LogTagId.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(l,": ").concat(ce[l])),[2,{code:l,msg:ce[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(a){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,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,s;return o(this,(function(o){switch(o.label){case 0:return[4,a.getUnreadConversationList(t)];case 1:return n=o.sent(),r=n.code,s=n.data,r===e.ErrorCode.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Y(e)}))}]:[2,{code:r,msg:ce[r]}]}}))}))}))]}))}))},exports.getUnreadCount=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){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,a.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),s.debug(e.LogTagId.O,"get unreadCount ->".concat(c)),r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:(s.warn(e.LogTagId.O,"get unreadCount fail ->".concat(r,":").concat(ce[r],",").concat(c)),[2,{code:r,msg:ce[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadCountByTag=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("containMuted",r,e.AssertRules.BOOLEAN,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(t)),[4,s.getUnreadCountByTag(t,r)];case 1:return n=o.sent(),a=n.code,c=n.data,[2,{code:a,data:c}]}}))}))}))]:[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,ae((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:ce[e.ErrorCode.NOT_SUPPORT]};var n,o=t.conversationType,r=t.targetId,a=t.channelId;return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?(n=function(t){var n=t.getUnreadMentionedMessages(o,r,a),s=[];return n&&n.length&&n.forEach((function(e){return s.push(K(e))})),{code:e.ErrorCode.SUCCESS,data:s}},ee?n(ee,ne,te):{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;ee?ne.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))})),te=t,ee=e.APIContext.init((null===(n=t.__runtimeCreator__)||void 0===n?void 0:n.call(t))||j,{appkey:t.appkey,navigators:t.navigators||[],miniCMPProxy:t.customCMP||[],logOutputLevel:t.logOutputLevel,__reportLogLevel:t.__reportLogLevel,httpInMainProcess:!!t.httpInMainProcess,logExpireTime:t.logExpireTime,areaCode:t.areaCode,logServerUrl:t.logServerUrl}),(ne=ee.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),ne.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:o,navigators:r,version:"5.7.9",commit:"c429b5ad576697400ce20f472ec7631c27c18cab"})),ee.assignWatcher(Q),e.logger.init(ne))}(t)},exports.insertMessage=function(t,r,a){return void 0===a&&(a={}),n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return W("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",a,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==a?void 0:a.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==a?void 0:a.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,ae((function(i,c){return n(s,void 0,void 0,(function(){var n,s,u,d,l,g,v,f,R,E,I,p,T,h,m,C;return o(this,(function(o){switch(o.label){case 0:return n=r.senderUserId,s=r.messageType,u=r.content,d=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=a.isUnread,p=a.searchContent,T={senderUserId:n,messageType:s,content:u,messageDirection:d,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(),m=h.code,C=h.data,m===e.ErrorCode.SUCCESS?[2,{code:m,data:K(C)}]:(c.warn(e.LogTagId.O,"insertMessage ->code:".concat(m,",targetId:").concat(t.targetId)),[2,{code:m,msg:ce[m]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return re((function(n){return n.install(e,t)}))},exports.joinChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,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,s.joinChatroom(t,r.count,n)];case 1:return a=o.sent(),c=a===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==e.ErrorCode.SUCCESS?[2,{code:a,msg:ce[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.joinExistChatRoom=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",r.count,e.AssertRules.NUMBER,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,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,s.joinExistChatroom(t,r.count,n)];case 1:return a=o.sent(),c=a===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==e.ErrorCode.SUCCESS?[2,{code:a,msg:ce[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.modifyMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("content",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d,l,g,v,f,R;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,u=r.senderUserId,d=r.sentTime,l=r.canIncludeExpansion,g=r.channelId,v="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(g,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update ultragroup message expansion ->".concat(v)),f={targetId:a,channelId:g,conversationType:n,fromUserId:u,sendTime:d,canIncludeExpansion:l,messageUId:c,content:t},[4,s.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(ce[R])),[2,{code:R,msg:ce[R]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.onceEventListener=function(e,t,n){X.once(e,t,n)},exports.quitChatRoom=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i;return o(this,(function(o){switch(o.label){case 0:return n=s.createTraceId(),s.info(e.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,a.quitChatroom(t)];case 1:return r=o.sent(),i=r===e.ErrorCode.SUCCESS?"info":"warn",s[i](e.LogTagId.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),n),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:ce[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 a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d;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},a="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId,",messageUId:").concat(r.messageUId),i.debug(e.LogTagId.O,"recall message ->".concat(a)),[4,s.recallMessage(t.conversationType,t.targetId,r.messageUId,r.sentTime,n)];case 1:return c=o.sent(),u=c.code,d=c.data,u===e.ErrorCode.SUCCESS&&d?[2,{code:u,data:K(d)}]:u===e.ErrorCode.SUCCESS?[2,{code:u}]:(i.warn(e.LogTagId.O,"recall message fail ->".concat(u,":").concat(ce[u],",").concat(a)),[2,{code:u,msg:ce[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.registerMessageType=function(t,n,o,r,a){return re((function(s,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",a,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:a,isPersited:n})),s.registerMessageType(t,n,o,r,a),pe(t,n,o)}))},exports.removeAllExpansionForUltraGroupMessage=function(t){return n(this,void 0,void 0,(function(){var r=this;return o(this,(function(a){return e.validate("message",t,e.AssertRules.OBJECT,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r,i,c,u,d,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,u=t.canIncludeExpansion,d=t.channelId,l="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(d,",messageUId:").concat(i),s.debug(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(l)),g={targetId:r,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:i,removeAll:!0},[4,a.expandUltraMessage(g)];case 1:return(v=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(s.warn(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(v,":").concat(ce[v])),[2,{code:v,msg:ce[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntries=function(r,a){return n(this,void 0,void 0,(function(){var s=this;return o(this,(function(i){return e.validate("targetId",r,e.AssertRules.STRING,!0)&&Ee(a)?[2,ae((function(i,c){return n(s,void 0,void 0,(function(){var n,s,u,d,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)),(s=t({},a)).entries=a.entries.map((function(e){return{key:e}})),[4,i.removeChatroomEntries(r,s)];case 1:return u=o.sent(),d=u.code,l=u.data,d!==e.ErrorCode.SUCCESS?(c.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(ce[d],",").concat(n)),[2,{code:d,msg:ce[d],data:l}]):[2,{code:d}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntry=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Re(r)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a;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,s.removeChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(ce[a],",").concat(n)),[2,{code:a,msg:ce[a]}]):[2,{code:a}]}}))}))}))]:[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(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n,r;return o(this,(function(o){switch(o.label){case 0:return[4,a.removeConversation(t.conversationType,t.targetId,t.channelId)];case 1:return n=o.sent(),r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),s.debug(e.LogTagId.O,"destroy conversation ->".concat(r)),n!==e.ErrorCode.SUCCESS?(s.warn(e.LogTagId.O,"destroy conversation fail ->".concat(n,":").concat(ce[n],",").concat(r)),[2,{code:n,msg:ce[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 a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,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,s.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:ce[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeEventListener=function(e,t,n){X.off(e,t,n)},exports.removeEventListeners=function(e){X.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("expansion",t,e.AssertRules.ARRAY,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,u=r.sentTime,d=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove expansion for ultragroup message ->".concat(g)),v={targetId:a,channelId:l,conversationType:n,sendTime:u,canIncludeExpansion:d,messageUId:c,keys:t},[4,s.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(ce[f])),[2,{code:f,msg:ce[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(a){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){return o(this,(function(n){switch(n.label){case 0:return s.info(e.LogTagId.O,"removeFromBlacklist -> userId: ".concat(t)),[4,a.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 a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d,l,g;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,u=r.canIncludeExpansion,d=r.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove message expansion ->".concat(l)),[4,s.sendExpansionMessage({conversationType:n,targetId:a,messageUId:c,canIncludeExpansion:u,keys:t,channelId:d})];case 1:return(g=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove message expansion fail ->".concat(g,":").concat(ce[g],",").concat(l)),[2,{code:g,msg:ce[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(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"removeTag ->tagId:".concat(t)),[4,a.removeTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(s.warn(e.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:ce[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagFromConversations=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,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,s.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:ce[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagsFromConversation=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,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,s.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:ce[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.saveTextMessageDraft=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("draft",r,e.AssertRules.STRING,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a;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,s.saveConversationMessageDraft(t.conversationType,t.targetId,r,t.channelId)];case 1:return(a=o.sent())===e.ErrorCode.SUCCESS?[2,{code:a}]:(i.warn(e.LogTagId.O,"set draft fail ->".concat(a,":").concat(ce[a],",").concat(n)),[2,{code:a,msg:ce[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.searchConversationByContent=function(t,r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return W("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),e.usingCppEngine()?[2,ae((function(c,u){return n(i,void 0,void 0,(function(){var n,i,d;return o(this,(function(o){switch(o.label){case 0:return u.info(e.LogTagId.O,"searchConversationByContent ->keyword:".concat(t)),[4,c.searchConversationByContent(t,a,s,r)];case 1:return n=o.sent(),i=n.code,d=n.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:d}]:(u.warn(e.LogTagId.O,"searchConversationByContent ->code:".concat(i,",keyword:").concat(t)),[2,{code:i,msg:ce[i]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchMessages=function(t,r,a,s){return n(this,void 0,void 0,(function(){var i=this;return o(this,(function(c){return W("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",a,e.AssertRules.NUMBER)&&e.validate("count",s,e.AssertRules.NUMBER)?[2,ae((function(c,u){return n(i,void 0,void 0,(function(){var n,i,d,l;return o(this,(function(o){switch(o.label){case 0:return 1,[4,c.searchMessageByContent(t.conversationType,t.targetId,r,a,s,1,t.channelId)];case 1:return n=o.sent(),i=n.code,d=n.data,i===e.ErrorCode.SUCCESS?(l=[],(null==d?void 0:d.messages)&&d.messages.length&&d.messages.forEach((function(e){return l.push(K(e))})),[2,{code:i,data:{messages:l,count:null==d?void 0:d.count}}]):(u.warn(e.LogTagId.O,"searchMessages ->code:".concat(i,",targetId:").concat(t.targetId)),[2,{code:i,msg:ce[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.sendFileMessage=vt,exports.sendGIFMessage=Rt,exports.sendHQVoiceMessage=Et,exports.sendImageMessage=ft,exports.sendMessage=lt,exports.sendReadReceiptMessage=function(t,r,a,s){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",a,e.AssertRules.NUMBER,!0)&&e.validate("channelId",s,e.AssertRules.CHANNEL_ID)?[2,ae((function(c){return n(i,void 0,void 0,(function(){var n,i,c,u,d;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.PRIVATE,channelId:s},i=new Ie("RC:ReadNtf",{messageUId:r,lastMessageSendTime:a,type:1}),[4,lt(n,i)];case 1:return c=o.sent(),u=c.code,d=c.msg,0===u?[2,{code:u}]:[2,{code:u,msg:d}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendReadReceiptRequest=function(t,r,a){return n(this,void 0,void 0,(function(){var s=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",a,e.AssertRules.CHANNEL_ID)?[2,ae((function(i,c){return n(s,void 0,void 0,(function(){var n,s,i,u,d;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)),s=new Ie("RC:RRReqMsg",{messageUId:r}),[4,lt({targetId:t,conversationType:e.ConversationType.GROUP,channelId:a},s)];case 1:return i=o.sent(),u=i.code,d=i.msg,0===u?[2,{code:u}]:[2,{code:u,msg:d}]}}))}))}))]:[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,a){return n(this,void 0,void 0,(function(){var s=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",a,e.AssertRules.CHANNEL_ID)&&!Object.keys(r).some((function(t){return!e.validate(t,r[t],e.AssertRules.ARRAY)}))?[2,ae((function(i,c){return n(s,void 0,void 0,(function(){var n,s,u,d,l,g;return o(this,(function(o){switch(o.label){case 0:return n={targetId:t,conversationType:e.ConversationType.GROUP,channelId:a},u=i.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(r).forEach((function(e){r[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,i.sendReadReceiptMessage(t,d,a)]:(c.warn(e.LogTagId.O,"Error in parameter messageList."),[2,{code:e.ErrorCode.PARAMETER_ERROR}]));case 1:return s=o.sent(),[3,4];case 2:return l=new Ie("RC:RRRspMsg",{receiptMessageDic:r}),[4,lt(n,l)];case 3:s=o.sent(),o.label=4;case 4:return(g=s.code)===e.ErrorCode.SUCCESS?[2,{code:g}]:(c.warn(e.LogTagId.O,"send read receipt message fail ->".concat(g,":").concat(ce[g])),[2,{code:g,msg:ce[g]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendSightMessage=It,exports.sendSyncReadStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var n,a,s,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 Ie("RC:SRSMsg",{lastMessageSendTime:r}),[4,lt(t,n)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=o.sent(),s=a.code,i=a.msg,0===s?[2,{code:s}]:[2,{code:s,msg:i}]}}))}))},exports.sendTextMessage=function(e,t,n){return lt(e,new Ae(t),n)},exports.sendTypingStatusMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("typingContentType",r,e.AssertRules.STRING,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d,l;return o(this,(function(o){switch(o.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:r},isStatusMessage:!0,channelId:t.channelId},a=i.createTraceId(),i.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),a),[4,s.sendMessage(t.conversationType,t.targetId,n,void 0,a)];case 1:return c=o.sent(),u=c.code,d=c.data,l=u===e.ErrorCode.SUCCESS?"info":"warn",i[l](e.LogTagId.A_SEND_MSG_R,JSON.stringify({code:u,messageUId:d?d.messageUId:"",messageId:d?d.messageId:""}),a),u===e.ErrorCode.SUCCESS?[2,{code:u,data:K(d)}]:[2,{code:u,msg:ce[u]}]}}))}))}))]:[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(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ae((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return[4,a.sendUltraGroupTypingStatus(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(s.warn(e.LogTagId.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(ce[n])),[2,{code:n,msg:ce[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntries=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&fe(r)?r.entries.length>10?[2,ie.CHATROOM_KV_STORE_OUT_LIMIT]:[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u;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,s.setChatroomEntries(t,r)];case 1:return a=o.sent(),c=a.code,u=a.data,c!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(ce[c],",").concat(n)),[2,{code:c,msg:ce[c],data:u}]):[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 a=this;return o(this,(function(s){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&ve(r)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a;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,s.setChatroomEntry(t,r)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(ce[a],",").concat(n)),[2,{code:a,msg:ce[a]}]):[2,{code:a}]}}))}))}))]:[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,ae((function(e,n){return ge(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,ae((function(e,n){return ge(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 a=this;return o(this,(function(s){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("isTop",r,e.AssertRules.BOOLEAN)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a;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,s.setConversationStatus(t.conversationType,t.targetId,r,void 0,t.channelId)];case 1:return(a=o.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set conversation status fail ->".concat(a,":").concat(ce[a],",").concat(n)),[2,{code:a,msg:ce[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTopInTag=function(t,r,a){return n(this,void 0,void 0,(function(){var s=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",a,e.AssertRules.BOOLEAN,!0)?[2,ae((function(i,c){return n(s,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:a})];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:ce[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setMessageReceivedStatus=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return W("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",r,e.AssertRules.NUMBER,!0)?[2,ae((function(s,i){return n(a,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,s.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:ce[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ce[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.setProxy=function(t){return n(this,void 0,void 0,(function(){var r=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,ae((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"setProxy: ->".concat(t)),[4,a.setProxy(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(s.warn(e.LogTagId.O,"setProxy ->code:".concat(n)),[2,{code:n,msg:ce[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setUltraGroupDefaultNotificationLevel=function(t,r){return n(this,void 0,void 0,(function(){var a=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("notificationLevel",r,(function(t){return void 0!==e.NotificationLevel[t]}),!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),i.debug(e.LogTagId.O,"".concat(n," -> ").concat(a)),[4,s.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(ce[c]," , ").concat(a)),[2,{code:c,msg:ce[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.testProxy=function(t,r){return n(this,void 0,void 0,(function(){var a=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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c;return o(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"testProxy: ->".concat(t)),[4,s.testProxy(t,r)];case 1:return n=o.sent(),a=n.status,c=n.data,a===e.ErrorCode.SUCCESS?[2,{code:a,msg:c}]:(i.warn(e.LogTagId.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:ce[a]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateExpansionForUltraGroupMessage=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",r,e.AssertRules.OBJECT,!0)?[2,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d,l,g,v,f;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,u=r.sentTime,d=r.canIncludeExpansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update expansion for ultragroup message ->".concat(g)),v={targetId:a,channelId:l,conversationType:n,sendTime:u,canIncludeExpansion:d,messageUId:c,expansion:t},[4,s.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(ce[f])),[2,{code:f,msg:ce[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateMessageExpansion=function(t,r){return n(this,void 0,void 0,(function(){var a=this;return o(this,(function(s){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,ae((function(s,i){return n(a,void 0,void 0,(function(){var n,a,c,u,d,l,g,v;return o(this,(function(o){switch(o.label){case 0:return n=r.conversationType,a=r.targetId,c=r.messageUId,u=r.canIncludeExpansion,d=r.expansion,l=r.channelId,g="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update message expansion ->".concat(g)),[4,s.sendExpansionMessage({conversationType:n,targetId:a,messageUId:c,expansion:t,canIncludeExpansion:u,originExpansion:d,channelId:l})];case 1:return(v=o.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"update message expansion fail ->".concat(v,":").concat(ce[v],",").concat(g)),[2,{code:v,msg:ce[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(a){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,ae((function(a,s){return n(r,void 0,void 0,(function(){var n;return o(this,(function(o){switch(o.label){case 0:return s.info(e.LogTagId.O,"updateTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,a.updateTag(t)];case 1:return(n=o.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(s.warn(e.LogTagId.O,"updateTag ->code:".concat(n,",tagId:").concat(t.tagId)),[2,{code:n,msg:ce[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(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},t(e,n)};function n(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}var o=function(){return o=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},o.apply(this,arguments)};function r(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 s(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 a=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))},i=a(),c=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 d=null,u=function(e){return r(void 0,void 0,void 0,(function(){var t;return s(this,(function(n){switch(n.label){case 0:return[4,l.getNetworkType()];case 1:return t=n.sent(),d({status:"online"===e.type,type:t}),[2]}}))}))};var l={tag:"browser",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(e){var s=c(),d="[object XDomainRequest]"===Object.prototype.toString.call(s);if(s.open(n,i),r&&s.setRequestHeader)for(var u in r)s.setRequestHeader(u,r[u]);if(d){0!==t.timeout&&(s.timeout=o),s.onload=function(){e({data:s.responseText,status:s.status||200})},s.onerror=function(){e({status:s.status})},s.ontimeout=function(){e({status:s.status})};var l="object"==typeof a?JSON.stringify(a):a;s.send(l)}else s.onreadystatechange=function(){4===s.readyState&&e({data:s.responseText,status:s.status,xhr:s})},s.onerror=function(){e({status:s.status})},t.onProgress&&(s.upload.onprogress=function(e){return t.onProgress&&t.onProgress(e)}),0!==t.timeout&&setTimeout((function(){s.abort(),e({status:s.status})}),o),s.send(a)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:i,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),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||{effectiveType:e.NetworkType.UNKONWN},n=t.type,o=t.effectiveType,r=n||o||e.NetworkType.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){d=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",u),window.addEventListener("online",u))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",u),window.removeEventListener("online",u)),d=null}},g=a(),v=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)}}},f={setItem:v("setStorageSync"),getItem:v("getStorageSync"),removeItem:v("removeStorageSync"),clear:v("clearStorageSync")},E=null,R=function(e){var t=e.isConnected,n=e.networkType;E({status:t,type:n})};var I={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:f,sessionStorage:f,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:g,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),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)}})}))},setNetworkStatusListener:function(e){E=e,wx.onNetworkStatusChange(R)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(R),E=null}},p=a(),T=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){}}},h={setItem:T("setStorageSync"),getItem:T("getStorageSync"),removeItem:T("removeStorageSync"),clear:T("clearStorageSync")},C=null,m=function(e){var t=e.isConnected,n=e.networkType;C({status:t,type:n})};var S={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:h,sessionStorage:h,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:p,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onSocketClose(e)},onError:function(e){t.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onSocketMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onSocketOpen(e)},send:function(e){t.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.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)}})}))},setNetworkStatusListener:function(e){C=e,my.onNetworkStatusChange(m)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(m),C=null}},A=a(),O=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){}}},N={setItem:O("setStorageSync"),getItem:O("getStorageSync"),removeItem:O("removeStorageSync"),clear:O("clearStorageSync")},_=null,y=function(e){var t=e.isConnected,n=e.networkType;_({status:t,type:n})};var U={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:A,localStorage:N,sessionStorage:N,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{id:Date.now(),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)}})}))},setNetworkStatusListener:function(e){_=e,tt.onNetworkStatusChange(y)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(y),_=null}},L=a(),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){}}},P={setItem:M("setStorageSync"),getItem:M("getStorageSync"),removeItem:M("removeStorageSync"),clear:M("clearStorageSync")},w=null,x=function(e){var t=e.isConnected,n=e.networkType;w({status:t,type:n})};var b={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:L,localStorage:P,sessionStorage:P,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{id:Date.now(),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 r(this,void 0,void 0,(function(){return s(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)}})}))]}))}))},setNetworkStatusListener:function(e){w=e,swan.onNetworkStatusChange(x)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(x),w=null}},B=a(),D=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)}}},G={setItem:D("setStorageSync"),getItem:D("getStorageSync"),removeItem:D("removeStorageSync"),clear:D("clearStorageSync")},V=null,k=function(e){var t=e.isConnected,n=e.networkType;V({status:t,type:n})};var F={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:G,sessionStorage:G,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:B,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){jd.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){V=e,jd.onNetworkStatusChange(k)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(k),V=null}},H=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)}}},Z={setItem:H("setStorageSync"),getItem:H("getStorageSync"),removeItem:H("removeStorageSync"),clear:H("clearStorageSync")},q=null,J=function(e){var t=e.isConnected,n=e.networkType;q({status:t,type:n})};var j,K={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:Z,sessionStorage:Z,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.NetworkType.UNKONWN)}})}))},setNetworkStatusListener:function(e){q=e,uni.onNetworkStatusChange(J)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(J),q=null}},Y=function(e){return e&&e.request&&e.getSystemInfo},z="undefined"!=typeof uni&&Y(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return K;case"mp-jd":return F;case"mp-baidu":return b;case"mp-toutiao":return U;case"mp-alipay":return S;case"mp-weixin":return I;default:return l}}():"undefined"!=typeof jd&&Y(jd)?F:"undefined"!=typeof my&&Y(my)?S:"undefined"!=typeof tt&&Y(tt)?U:"undefined"!=typeof swan&&Y(swan)?b:"undefined"!=typeof wx&&Y(wx)?I:l;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,E=t.canIncludeExpansion,R=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:E,expansion:R,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 X(t){var n=t.conversationType,o=t.targetId,r=t.latestMessage,s=t.unreadMessageCount,a=t.hasMentioned,i=t.mentionedInfo,c=t.lastUnreadTime,d=t.notificationStatus,u=t.notificationLevel,l=t.isTop,g=t.channelId,v=t.unreadMentionedCount,f=t.matchCount,E=t.unreadMentionedMeCount,R={conversationType:n,targetId:o,latestMessage:r&&W(r),unreadMessageCount:s,hasMentioned:a,mentionedInfo:a?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:c,notificationStatus:d,notificationLevel:u,isTop:l,channelId:g,unreadMentionedCount:v,matchCount:f,unreadMentionedMeCount:E};return R.conversationType===e.ConversationType.ULTRA_GROUP&&(R.firstUnreadMessage=t.firstUnreadMessage,R.channelType=t.channelType),R}function Q(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}exports.Events=void 0,(j=exports.Events||(exports.Events={})).CONNECTING="CONNECTING",j.CONNECTED="CONNECTED",j.DISCONNECT="DISCONNECT",j.SUSPEND="SUSPEND",j.MESSAGES="MESSAGES",j.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",j.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",j.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",j.CONVERSATION="CONVERSATION",j.CHATROOM="CHATROOM",j.EXPANSION="EXPANSION",j.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",j.TAG="TAG",j.CONVERSATION_TAG="CONVERSATION_TAG",j.TYPING_STATUS="TYPING_STATUS",j.MESSAGE_BLOCKED="MESSAGE_BLOCKED",j.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",j.OPERATE_STATUS="OPERATE_STATUS",j.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",j.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",j.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",j.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",j.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",j.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",j.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",j.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",j.USER_GROUP_STATUS="USER_GROUP_STATUS";var $=new e.EventEmitter,ee={connection:function(t,n){switch(t){case e.RCConnectionStatus.CONNECTED:$.emit(exports.Events.CONNECTED);break;case e.RCConnectionStatus.CONNECTING:$.emit(exports.Events.CONNECTING);break;case e.RCConnectionStatus.SUSPENDED:$.emit(exports.Events.SUSPEND,n);break;case e.RCConnectionStatus.DISCONNECTED:$.emit(exports.Events.DISCONNECT,n)}},batchMessage:function(e){$.emit(exports.Events.MESSAGES,{messages:e.map((function(e){return W(e)}))})},typingState:function(e){$.emit(exports.Events.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){$.emit(exports.Events.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){$.emit(exports.Events.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){$.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,o.unreadMessageCount=te(t.unreadMessageCount||0),o.unreadMentionedCount=te(t.unreadMentionedCount||0),o.unreadMentionedMeCount=te(t.unreadMentionedMeCount||0),{conversation:o}):(o.hasMentioned=t.hasMentioned,o.mentionedInfo=t.mentionedInfo,o.isTop=t.isTop,{conversation:o,updatedItems:t.updatedItems})}));$.emit(exports.Events.CONVERSATION,{conversationList:n})},chatroomState:function(e){$.emit(exports.Events.CHATROOM,e)},expansion:function(e){$.emit(exports.Events.EXPANSION,e)},pullFinished:function(){$.emit(exports.Events.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){$.emit(exports.Events.TAG)},conversationTagChanged:function(){$.emit(exports.Events.CONVERSATION_TAG)},messageBlocked:function(e){$.emit(exports.Events.MESSAGE_BLOCKED,e)},messageDelivered:function(e){$.emit(exports.Events.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){$.emit(exports.Events.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){$.emit(exports.Events.ULTRA_GROUP_ENABLE,e.map((function(e){return X(e)})))},operateStatus:function(e){$.emit(exports.Events.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){$.emit(exports.Events.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return W(e)})))},ultraGroupMessageModified:function(e){$.emit(exports.Events.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return W(e)})))},ultraGroupMessageRecalled:function(e){$.emit(exports.Events.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return W(e)})))},ultraGroupChannelChangeType:function(e){$.emit(exports.Events.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){$.emit(exports.Events.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){$.emit(exports.Events.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){$.emit(exports.Events.USER_GROUP_STATUS,e)}};function te(e){return e>999?999:e}e.VersionManage.add("imlib-next","5.7.10");var ne=null,oe=null,re=null;function se(){return r(this,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return ne?(re.info(e.LogTagId.A_DESTROY_O),[4,e.APIContext.destroy()]):[2];case 1:return t.sent(),oe=null,ne=null,re=null,[2]}}))}))}function ae(e){if(!ne)throw new Error("Not initialized yet!");return e(ne,re,oe)}function ie(t){return ne?t(ne,re,oe):Promise.resolve({code:e.ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT})}function ce(){$.clear()}var de={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!"}},ue={};for(var le in de){var ge=de[le].code;ue[ge]=le}de.ROAMING_SERVICE_UNAVAILABLE.code;var ve=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},fe=function(t,n,o,a){return void 0===a&&(a=""),r(void 0,void 0,void 0,(function(){var r,i;return s(this,(function(s){switch(s.label){case 0:return r=ve(t,n,a),[4,o()];case 1:return(i=s.sent())!==e.ErrorCode.SUCCESS?(t.warn(e.LogTagId.O,"".concat(a," fail -> ").concat(i," : ").concat(ue[i]," , ").concat(r)),[2,{code:i,msg:ue[i]}]):[2,{code:i}]}}))}))};var Ee=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))},Re=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)},Ie=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)},pe=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 Te=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 he(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Te(e,o,t,n)}}var Ce,me=he("RC:ImgMsg"),Se=he("RC:HQVCMsg"),Ae=he("RC:SightMsg"),Oe=he("RC:TxtMsg"),Ne=he("RC:CombineMsg"),_e=he("RC:FileMsg"),ye=he("RC:GIFMsg"),Ue=he("RC:VcMsg"),Le=he("RC:LBSMsg"),Me=he("RC:ReferenceMsg"),Pe=he("RC:ImgTextMsg");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(Ce||(Ce={}));var we,xe,be=function(){function t(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._url=e,this._getFileToken=t,this._serverType=n}return t.prototype.upload=function(t){return t.file.size>e.MAX_UPLOAD_FILE_SIZE?Promise.resolve({code:e.ErrorCode.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):t.file.size>e.UPLOAD_FILE_CHUNK_SIZE&&this.isSupportMultipart?this.multipartUpload(t):this.commonUpload(t)},t}(),Be=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=s.sent(),i={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),[4,z.httpReq({url:/http/.test(this._url)?this._url:"https://".concat(this._url),headers:i,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(d=s.sent().status)||204===d?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.QINIU}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:d.toString()}]}}))}))},o.prototype.multipartUpload=function(e){return r(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("Method not implemented.")}))}))},o}(be),De=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=s.sent(),i="https://".concat(a.ossBucketName,".").concat(this._url),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),[4,z.httpReq({url:i,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(d=s.sent().status)||204===d?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.ALI}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:d.toString()}]}}))}))},o.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},o}(be),Ge=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d,u,l;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r<=e.FileType.FILE?r:e.FileType.FILE)];case 1:return i=s.sent(),c=a||("text/html"===n.type?"inline":"attachment"),d={authorization:i.bosToken,"x-bce-date":i.bosDate,"Content-Disposition":"".concat(c,"; filename=").concat(encodeURIComponent(n.name),";")},u=(/http/.test(this._url)?this._url:"https://".concat(this._url))+i.path,[4,z.httpReq({url:u,headers:d,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:n,timeout:0})];case 2:return 200===(l=s.sent().status)||204===l?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:i.fileName,downloadUrl:u}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:l.toString()}]}}))}))},o.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},o}(be),Ve=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d,u,l,g;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r,n.name)];case 1:return i=s.sent(),c={},d="https://".concat(i.s3BucketName,".").concat(this._url),u=new FormData,a?u.set("Content-Disposition",a):u.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),u.set("Content-Type",n.type),u.set("x-amz-credential",i.s3Credential),u.set("x-amz-algorithm",i.s3Algorithm),u.set("x-amz-date",i.s3Date),u.set("policy",i.s3Policy),u.set("x-amz-signature",i.s3Signature),u.set("key",i.fileName),u.set("file",n),[4,z.httpReq({url:d,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:u,timeout:0})];case 2:return l=s.sent(),g=l.status,l.data,200===g||204===g?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:e.UploadMethod.AWS}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:g.toString()}]}}))}))},o.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},o}(be),ke=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=s.sent(),i="https://".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(n,a,t),[4,z.httpReq({url:i,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(d=s.sent().status)||204===d?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.MINIO}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL}]}}))}))},o.prototype.multipartUpload=function(t){var n;return r(this,void 0,void 0,(function(){var o,r,a,i,c,d,u,l,g,v,f,E,R,I,p,T,h;return s(this,(function(s){switch(s.label){case 0:return o=t.file,t.onProgress,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=s.sent(),i="https://".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(o,a,t),[4,z.httpReq({url:"".concat(i,"?uploads"),headers:c,method:"POST"})];case 2:return d=s.sent(),u=d.status,l=d.data,g=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!g?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(i,o,g,a.fileName,t,v)]);case 3:return f=s.sent(),E=f.code,R=f.msg,E!==e.ErrorCode.SUCCESS?[2,{code:E,msg:R}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(g))];case 4:return I=s.sent(),p=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),p="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(p,"</CompleteMultipartUpload>"),T=this.getBaseHeaders(o,I,t),[4,z.httpReq({url:"".concat(i,"?uploadId=").concat(g),headers:T,method:"POST",body:p})];case 5:return 200===(h=s.sent().status)||204===h?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.STC}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},o.prototype.requestUploadPart=function(t,n,o,a,i,c,d,u){return void 0===d&&(d=1),void 0===u&&(u=0),r(this,void 0,void 0,(function(){var r,l,g,v,f,E,R,I,p;return s(this,(function(s){switch(s.label){case 0:return u>=5?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(r=(d-1)*e.UPLOAD_FILE_CHUNK_SIZE,l=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-r),g="partNumber=".concat(d,"&uploadId=").concat(o),[4,this._getFileToken(i.fileType,a,"PUT",g)]);case 1:return v=s.sent(),f=n.slice(r,d*e.UPLOAD_FILE_CHUNK_SIZE),E=this.getBaseHeaders(n,v,i),[4,z.httpReq({url:"".concat(t,"?").concat(g),headers:E,method:"PUT",body:f,onProgress:function(e){var t;return null===(t=null==i?void 0:i.onProgress)||void 0===t?void 0:t.call(i,r+e.loaded,n.size)},timeout:0})];case 2:return R=s.sent(),I=R.status,R.data,p=R.xhr,200===I||204===I?(c.push((null==p?void 0:p.getResponseHeader("ETag"))||""),r+l<n.size?[2,this.requestUploadPart(t,n,o,a,i,c,d+1,0)]:[2,{code:e.ErrorCode.SUCCESS}]):[2,this.requestUploadPart(t,n,o,a,i,c,d,u+1)]}}))}))},o.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},o}(be),Fe=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=s.sent(),i="https://".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(n,a,t),[4,z.httpReq({url:i,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(d=s.sent().status)||204===d?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.MINIO}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:d.toString()}]}}))}))},o.prototype.multipartUpload=function(t){var n;return r(this,void 0,void 0,(function(){var o,r,a,i,c,d,u,l,g,v,f,E,R,I,p,T,h;return s(this,(function(s){switch(s.label){case 0:return o=t.file,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=s.sent(),i="https://".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(o,a,t),[4,z.httpReq({url:"".concat(i,"?uploads"),headers:c,method:"POST"})];case 2:return d=s.sent(),u=d.status,l=d.data,g=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!g?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"start upload fail"}]:(v=[],[4,this.requestUploadPart(i,o,g,a.fileName,t,v)]);case 3:return f=s.sent(),E=f.code,R=f.msg,E!==e.ErrorCode.SUCCESS?[2,{code:E,msg:R}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(g))];case 4:return I=s.sent(),p=v.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),p="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(p,"</CompleteMultipartUpload>"),T=this.getBaseHeaders(o,I,t),[4,z.httpReq({url:"".concat(i,"?uploadId=").concat(g),headers:T,method:"POST",body:p,timeout:0})];case 5:return 200===(h=s.sent().status)||204===h?[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:e.UploadMethod.MINIO}}]:[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},o.prototype.requestUploadPart=function(t,n,o,a,i,c,d,u){return void 0===d&&(d=1),void 0===u&&(u=0),r(this,void 0,void 0,(function(){var r,l,g,v,f,E,R,I,p;return s(this,(function(s){switch(s.label){case 0:return u>=5?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(r=(d-1)*e.UPLOAD_FILE_CHUNK_SIZE,l=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-r),g="partNumber=".concat(d,"&uploadId=").concat(o),[4,this._getFileToken(i.fileType,a,"PUT",g)]);case 1:return v=s.sent(),f=n.slice(r,d*e.UPLOAD_FILE_CHUNK_SIZE),E=this.getBaseHeaders(n,v,i),[4,z.httpReq({url:"".concat(t,"?").concat(g),headers:E,method:"PUT",body:f,timeout:0,onProgress:function(e){var t;return null===(t=null==i?void 0:i.onProgress)||void 0===t?void 0:t.call(i,r+e.loaded,n.size)}})];case 2:return R=s.sent(),I=R.status,p=R.xhr,200===I||204===I?(c.push((null==p?void 0:p.getResponseHeader("ETag"))||""),r+l<n.size?[2,this.requestUploadPart(t,n,o,a,i,c,d+1,0)]:[2,{code:e.ErrorCode.SUCCESS}]):[2,this.requestUploadPart(t,n,o,a,i,c,d,u+1)]}}))}))},o.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},o}(be),He=function(t){function o(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return n(o,t),o.prototype.commonUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i,c,d,u,l,g,v;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=s.sent(),i={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),d=/http/.test(this._url)?this._url:"https://".concat(this._url),[4,z.httpReq({url:d,headers:i,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return u=s.sent(),l=u.status,g=u.data,200!==l&&204!==l||!g?[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:l.toString()}]:(v=JSON.parse(g),[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:v.rc_url.file_name,downloadUrl:"".concat(d,"/").concat(v.rc_url.path)}}])}}))}))},o.prototype.multipartUpload=function(t){return r(this,void 0,void 0,(function(){var n,o,r,a,i;return s(this,(function(s){switch(s.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=e.getUUID(),[4,this._getFileToken(r,n.name)];case 1:return i=s.sent().token,[2,this._requestUploadPart(a,n,i,o)]}}))}))},o.prototype._requestUploadPart=function(t,n,o,a,i){return void 0===i&&(i=0),r(this,void 0,void 0,(function(){var r,c,d,u,l,g,v,f,E,R;return s(this,(function(s){switch(s.label){case 0:return r=Math.min(e.UPLOAD_FILE_CHUNK_SIZE,n.size-i),c=t+n.name.substring(n.name.lastIndexOf(".")),d={Range:"bytes=".concat(i,"-").concat(i+r),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},u=n.slice(i,i+r),(l=new FormData).set("file",u,n.name),l.set("key",c),l.set("name",c),l.set("token",o),g=/http/.test(this._url)?this._url:"https://".concat(this._url),[4,z.httpReq({url:g,headers:d,onProgress:function(e){return null==a?void 0:a(i+e.loaded,n.size)},method:"POST",body:l,timeout:0})];case 1:return v=s.sent(),f=v.status,E=v.data,200===f||204===f?i+r<n.size?[2,this._requestUploadPart(t,n,o,a,i+r)]:(R=JSON.parse(E),[2,{code:e.ErrorCode.SUCCESS,data:{uniqueName:R.rc_url.file_name,downloadUrl:"".concat(g,"/").concat(R.rc_url.path)}}]):[2,{code:e.ErrorCode.UPLOAD_FAIL,msg:f.toString()}]}}))}))},o}(be);function Ze(t,n){return r(this,void 0,void 0,(function(){var r,a,i,c,d,u,l,g,v,f,E,R,I,p,T,h,C,m,S,A,O,N,_,y;return s(this,(function(s){switch(s.label){case 0:return r=n.getFileToken,a=n.serverType,i=n.customDomain,c=n.ossConfig,d=n.uploadServer,u=n.bosAddr,l=t.file,g=t.fileType,v=t.thumbnailConfig,f=function(e,t,n,o,r){if(n)return[{type:Ce.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:Ce.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var s=[];o&&s.push({type:Ce.QINIU,url:o,p:"1"});r&&s.push({type:Ce.BAIDU,url:r,p:"2"});return s}(c,0,i,d,u),0===f.length?[2,Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,Ke(f,t,r,a)];case 1:return E=s.sent(),R=E.code,I=E.data,p=E.msg,R===e.ErrorCode.SUCCESS&&I?[4,qe(t,n,I)]:[2,{code:R,msg:p}];case 2:return T=s.sent(),h={downloadUrl:T,uniqueName:(null==I?void 0:I.uniqueName)||"",name:l.name,size:l.size,type:l.type},g!==e.FileType.AUDIO?[3,5]:[4,l.arrayBuffer()];case 3:return[4,Je(s.sent())];case 4:return C=s.sent(),m=C.duration,S=C.length,y=o(o({},h),{duration:m,length:S}),[2,{code:R,data:y}];case 5:return g!==e.FileType.IMAGE?[3,7]:[4,Ye(l,v)];case 6:return A=s.sent(),O=A.thumbnail,N=A.width,_=A.height,y=o(o({},h),{thumbnail:O,width:N,height:_}),[2,{code:R,data:y}];case 7:return[2,{code:R,data:h}]}}))}))}function qe(e,t,n){return r(this,void 0,void 0,(function(){var o,r,a,i,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o=t.getFileUrl,r=e.fileType,a=e.file,i=n.uploadMethod,c=n.downloadUrl,d=n.uniqueName,(u=c)?[3,2]:[4,o(r,d,a.name,void 0,i)];case 1:u=s.sent().downloadUrl,s.label=2;case 2:return[2,u]}}))}))}function Je(e){return xe=xe||new AudioContext,new Promise((function(t,n){xe.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}var je=((we={})[Ce.QINIU]=Be,we[Ce.ALIYUN]=De,we[Ce.BAIDU]=Ge,we[Ce.S3]=Ve,we[Ce.STC]=ke,we[Ce.MINIO]=Fe,we[Ce.RCX]=He,we);function Ke(t,n,o,a,i){return void 0===i&&(i=[]),r(this,void 0,void 0,(function(){var r,c,d,u,l;return s(this,(function(s){switch(s.label){case 0:return 0===t.length?[2,Promise.resolve({code:e.ErrorCode.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(i))})]:(r=t.shift(),[4,new je[r.type](r.url,o,a).upload(n)]);case 1:return c=s.sent(),d=c.code,u=c.data,l=c.msg,d!==e.ErrorCode.SUCCESS?(i.push({type:r.type,url:r.url,code:d,msg:l}),[2,Ke(t,n,o,a,i)]):[2,{code:d,data:u}]}}))}))}function Ye(e,t){return new Promise((function(n,o){var r=document.createElement("canvas"),s=r.getContext("2d"),a=new Image;a.onload=function(o){var i=t||{},c=i.maxHeight,d=void 0===c?160:c,u=i.maxWidth,l=void 0===u?160:u,g=i.quality,v=void 0===g?.7:g,f=i.scale,E=void 0===f?1:f,R=ze(a.width,a.height,{maxHeight:d,maxWidth:l,scale:E});r.width=Math.min(R.w,l),r.height=Math.min(R.h,d),s.drawImage(a,R.x,R.y,R.w,R.h);var I=r.toDataURL("string"==typeof e?"image/jpg":e.type,v);I=I.replace(/data:image\/[^;]+;base64,/,""),n({thumbnail:I,width:R.w,height:R.h})},a.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var ze=function(e,t,n){var o,r,s=n.maxHeight,a=void 0===s?160:s,i=n.maxWidth,c=void 0===i?160:i,d=n.scale,u=e<t,l=0,g=0;return(u?t/e:e/t)>(void 0===d?1:d)?(u?(o=100,g=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-g}):(u?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-g})};function We(t,n,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u,l,g,v,f,E,R,I,p,T;return s(this,(function(s){switch(s.label){case 0:return a=a||{},n instanceof Te==!1?(d.warn(e.LogTagId.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,de.ILLGAL_PARAMS]):e.validate("conversation",t,e.AssertRules.OBJECT,!0)?(r=t.conversationType,i=t.targetId,u=t.channelId,e.validate("conversation.targetId",i,e.AssertRules.STRING,!0)&&e.validate("conversation.conversationType",r,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(r,",targetId:").concat(i),d.debug(e.LogTagId.O,"send message ->".concat(l)),g=function(e,t,n){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,E=e.isFilerWhiteBlacklist,R=e.pushConfig,I=e.messageId,p=n.channelId;return o({isStatusMessage:r,disableNotification:s,pushContent:a,pushData:i,isMentioned:c,mentionedType:d,mentionedUserIdList:u,directionalUserIdList:l,isVoipPush:g,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:E,pushConfig:R,channelId:p||"",messageId:I},t)}(a,n,t),v={isMentioned:!!a.isMentioned,content:n.content,messageType:n.messageType,isPersited:!!n.isPersited,isCounted:!!n.isCounted,disableNotification:!!(null==a?void 0:a.disableNotification),canIncludeExpansion:!!(null==a?void 0:a.canIncludeExpansion),expansion:(null==a?void 0:a.expansion)||null,conversationType:t.conversationType,targetId:t.targetId,channelId:t.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},r!==e.ConversationType.ULTRA_GROUP&&(v.isOffLineMessage=!1),f=d.createTraceId(),E=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:n.messageType,conversationType:r,targetId:i,channelId:u}),f),[4,c.sendMessage(r,i,g,E,f)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return R=s.sent(),I=R.code,p=R.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(ue[I],",").concat(l)),v.sentTime=(null==p?void 0:p.sentTime)||0,v.sentStatus=null==p?void 0:p.sentStatus,[2,{code:I,msg:ue[I],data:W(v)}])}}))}))}))]}))}))}function Xe(t,n){return function(r,s,a,i){if(!e.validate("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});var c={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var d=null==i?void 0:i.thumbnailConfig;if(!(e.validate("sendOptions.maxHeight",null==d?void 0:d.maxHeight,e.AssertRules.NUMBER)&&e.validate("sendOptions.maxWidth",null==d?void 0:d.maxWidth,e.AssertRules.NUMBER)&&e.validate("sendOptions.quality",null==d?void 0:d.quality,e.AssertRules.NUMBER)&&e.validate("sendOptions.scale",null==d?void 0:d.scale,e.AssertRules.NUMBER)))return Promise.resolve({code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER});c.thumbnailConfig=d}return ie((function(d,u,l){return new Promise((function(d){var l,g=u.createTraceId();u.info(e.LogTagId.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:s.file.size,type:t}),g),(l={file:s.file,fileType:t,onProgress:function(e,t){var n;null===(n=null==a?void 0:a.onProgress)||void 0===n||n.call(a,Math.floor(e/t*100))},contentDisposition:c.contentDisposition,thumbnailConfig:c.thumbnailConfig},ie((function(e,t,n){return new Promise((function(t){var o=e.getNaviInfoFromCache();Ze(l,{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:n.uploadDomain||"",serverType:null==o?void 0:o.type,ossConfig:null==o?void 0:o.ossConfig,uploadServer:null==o?void 0:o.uploadServer,bosAddr:null==o?void 0:o.bosAddr}).then((function(e){t(e)}))}))}))).then((function(t){var c,l=t.code,v=t.data,f=t.msg;if(l===e.ErrorCode.SUCCESS&&v){var E=(null===(c=null==a?void 0:a.onComplete)||void 0===c?void 0:c.call(a,o({url:v.downloadUrl},v)))||n(v,s);return u.info(e.LogTagId.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:v.downloadUrl,code:e.ErrorCode.SUCCESS}),g),void We(r,E,i).then(d)}d({code:l,msg:f})}))}))}))}}var Qe=Xe(e.FileType.FILE,(function(e,t){return new _e({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})),$e=Xe(e.FileType.IMAGE,(function(e,t){return new me({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),et=Xe(e.FileType.IMAGE,(function(e,t){return new ye({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),nt=Xe(e.FileType.AUDIO,(function(e,t){return new Se({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),ot=Xe(e.FileType.SIGHT,(function(e,t){return new Ae({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})}));Xe(e.FileType.COMBINE_HTML,(function(e,t){return new Ne({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var rt=Object.freeze({__proto__:null,getAllConversationList:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?e.validate("channelId",t,e.AssertRules.CHANNEL_ID)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return a.info(e.LogTagId.O,"getAllConversationList -> channelId: ".concat(t)),e.isUndefined(t)?[4,o.getConversationListWithAllChannel()]:[3,2];case 1:return n=s.sent(),[3,4];case 2:return[4,o.getConversationList(void 0,void 0,void 0,void 0,t)];case 3:n=s.sent(),s.label=4;case 4:return r=n.code,i=n.data,r===e.ErrorCode.SUCCESS&&i?(c=i.map((function(e){return X(e)})),[2,{code:r,data:c}]):(a.warn(e.LogTagId.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(t)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},getConversationList:function(t,n,o){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.usingCppEngine()?e.validate("startTime",t,e.AssertRules.NUMBER,!0)&&e.validate("count",n,e.AssertRules.NUMBER,!0)&&e.validate("channelId",o,e.AssertRules.CHANNEL_ID)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u,l,g;return s(this,(function(s){switch(s.label){case 0:return r="startTime: ".concat(t,", count: ").concat(n,", channelId: ").concat(o),c.info(e.LogTagId.O,"getConversationList -> ".concat(r)),e.isUndefined(o)?[4,i.getConversationListWithAllChannelByPage(t,n)]:[3,2];case 1:return a=s.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(d,t,n,o)];case 3:a=s.sent(),s.label=4;case 4:return u=a.code,l=a.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return X(e)})),[2,{code:u,data:g}]):(c.warn(e.LogTagId.O,"getConversationList fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:ue[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchConversationByContent:function t(n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return e.usingCppEngine()?e.validate("keyword",n,e.AssertRules.STRING,!0)&&e.validate("messageTypes",o,e.AssertRules.ARRAY,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)&&!o.some((function(t){return!e.validate("messageType",t,e.AssertRules.STRING,!0)}))?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u,l,g;return s(this,(function(s){switch(s.label){case 0:return r="keyword: ".concat(n,", messageTypes: ").concat(JSON.stringify(o),", channelId: ").concat(a),d.info(e.LogTagId.O,"searchConversationByContent -> ".concat(t)),e.isUndefined(a)?[4,c.searchConversationByContentWithAllChannel(n,o)]:[3,2];case 1:return i=s.sent(),[3,4];case 2:return[4,c.searchConversationByContent(n,o,a)];case 3:i=s.sent(),s.label=4;case 4:return u=i.code,l=i.data,u===e.ErrorCode.SUCCESS&&l?(g=l.map((function(e){return X(e)})),[2,{code:u,data:g}]):(d.warn(e.LogTagId.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:ue[u]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessages:function(t,n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",n,e.AssertRules.STRING,!0)&&e.validate("startTime",o,e.AssertRules.NUMBER,!0)&&e.validate("count",a,e.AssertRules.NUMBER,!0)?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u,l,g,v,f,E,R,I;return s(this,(function(s){switch(s.label){case 0:return r="conversation: ".concat(JSON.stringify(t),", keyword: ").concat(n,", timestamp: ").concat(o,", count: ").concat(a),d.info(e.LogTagId.O,"searchMessages -> ".concat(r)),i=t.targetId,u=t.conversationType,l=t.channelId,e.isUndefined(l)?[4,c.searchMessageByContentWithAllChannel(u,i,n,o,a)]:[3,2];case 1:return g=s.sent(),[3,4];case 2:return 0,[4,c.searchMessageByContent(u,i,n,o,a,0,l)];case 3:g=s.sent(),s.label=4;case 4:return v=g.code,f=g.data,v===e.ErrorCode.SUCCESS&&f?(E=f.messages,R=f.count,I=E.map((function(e){return W(e)})),[2,{code:v,data:{messages:I,count:R}}]):(d.warn(e.LogTagId.O,"searchMessages fail -> code: ".concat(v," ").concat(r)),[2,{code:v,msg:ue[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",n,e.AssertRules.OBJECT,!0)&&e.validate("option.keyword",n.keyword,e.AssertRules.STRING,!0)&&e.validate("option.startTime",n.startTime,e.AssertRules.NUMBER,!0)&&e.validate("option.endTime",n.endTime,e.AssertRules.NUMBER,!0)&&e.validate("option.offset",n.offset,e.AssertRules.NUMBER)&&e.validate("option.limit",n.limit,e.AssertRules.NUMBER)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f,E,R;return s(this,(function(s){switch(s.label){case 0:return o="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(n)),i.info(e.LogTagId.O,"searchMessageInTimeRange -> ".concat(o)),r=t.conversationType,c=t.targetId,d=n.keyword,u=n.startTime,l=n.endTime,g=n.offset,v=n.limit,g=g||0,v=v||5,[4,a.searchMessageByContentInTimeRangeWithAllChannel(r,c,d,u,l,g,v)];case 1:return f=s.sent(),E=f.code,R=f.data,E===e.ErrorCode.SUCCESS&&R?[2,{code:E,data:{messages:R.messages.map((function(e){return W(e)}))}}]:(i.warn(e.LogTagId.O,"searchMessageInTimeRange fail -> code: ".concat(E,", ").concat(o)),[2,{code:E}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(t,n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("userId",n,e.AssertRules.STRING,!0)&&e.validate("startTime",o,e.AssertRules.NUMBER,!0)&&e.validate("count",a,e.AssertRules.NUMBER,!0)?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u,l,g,v,f;return s(this,(function(s){switch(s.label){case 0:return r="conversation: ".concat(JSON.stringify(t),", keyword: ").concat(n,", timestamp: ").concat(o,", count: ").concat(a),d.info(e.LogTagId.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(r)),i=t.conversationType,u=t.targetId,l=t.channelId,[4,c.searchMessagesByUser(i,u,n,o,a,l)];case 1:return g=s.sent(),v=g.code,f=g.data,v===e.ErrorCode.SUCCESS&&f?[2,{code:v,data:{messages:f.messages.map((function(e){return W(e)}))}}]:(d.warn(e.LogTagId.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(v,", ").concat(r)),[2,{code:v}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("option",n,e.AssertRules.OBJECT,!0)&&e.validate("option.count",n.count,e.AssertRules.NUMBER)&&e.validate("options.count",n.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t}))&&e.validate("option.timestamp",n.timestamp,e.AssertRules.NUMBER)&&e.validate("option.order",n.order,(function(e){return[0,1].includes(e)}))&&e.validate("option.messageTypes",n.messageTypes,e.AssertRules.ARRAY,!0)&&!n.messageTypes.some((function(t){return!e.validate("option.messageType",t,e.AssertRules.STRING,!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f,E,R,I,p,T,h;return s(this,(function(s){switch(s.label){case 0:return o=n.count,r=n.timestamp,c=n.order,d=n.messageTypes,u="conversation: ".concat(JSON.stringify(t),", option: ").concat(JSON.stringify(n)),i.info(e.LogTagId.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),l=t.conversationType,g=t.targetId,v=t.channelId,o||(o=20),r||(r=0),c||(c=0),v||(v=""),[4,a.getHistoryMessagesByObjectNames(l,g,r,o,d,c,v)];case 1:return f=s.sent(),E=f.code,R=f.data,E===e.ErrorCode.SUCCESS?(p=(I=R).list,T=I.hasMore,h=p.map((function(e){return W(e)})),[2,{code:E,data:{messages:h,hasMore:T,list:h}}]):(i.warn(e.LogTagId.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(E," ").concat(u)),[2,{code:E,msg:ue[E]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",n,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d;return s(this,(function(s){switch(s.label){case 0:return o="conversation: ".concat(JSON.stringify(t),", timestamp: ").concat(n),i.info(e.LogTagId.O,"updateSentMsgReceiptStatus -> ".concat(o)),r=t.conversationType,c=t.targetId,d=t.channelId,[4,a.setMessageStatusToRead(r,c,n,d)];case 1:return[2,s.sent()]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",n,(function(t){return!e.isUndefined(e.ReceivedStatus[t])}),!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus -> messageId: ".concat(t,", receivedStatus: ").concat(n)),[4,a.setMessageReceivedStatus(t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("sentStatus",n,(function(t){return!e.isUndefined(e.SentStatus[t])}),!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){return s(this,(function(o){switch(o.label){case 0:return i.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", sentStatus: ").concat(n)),[4,a.setMessageSentStatus(t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},setMessageContent:function(t,n,o){return void 0===o&&(o=""),r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("content",n,e.AssertRules.OBJECT,!0)&&e.validate("messageType",o,e.AssertRules.ONLY_STRING,!0)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){return s(this,(function(r){switch(r.label){case 0:return c.info(e.LogTagId.O,"setMessageSentStatus ->messageId: ".concat(t,", messageType: ").concat(o)),[4,i.setMessageContent(t,n,o)];case 1:return[2,{code:r.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessages:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){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,ie((function(o,a){return r(n,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(t))),[4,o.deleteMessages(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearMessages:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.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,o.clearMessages(n,r,i)];case 1:return[2,{code:s.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(t,n,o){return r(this,void 0,void 0,(function(){var a,i,c,d=this;return s(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",n,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",o,e.AssertRules.BOOLEAN)?[2,ie((function(e,t){return r(d,void 0,void 0,(function(){return s(this,(function(t){switch(t.label){case 0:return[4,e.deleteMessagesByTimestamp(a,i,n,o,c)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},insertMessage:function(t,n,o){return void 0===o&&(o={}),r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)&&e.validate("options",o,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==o?void 0:o.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==o?void 0:o.searchContent,e.AssertRules.STRING)&&(n instanceof Te||e.validate("message.senderUserId",n.senderUserId,e.AssertRules.STRING,!0)&&e.validate("message.messageType",n.messageType,e.AssertRules.STRING,!0)&&e.validate("message.content",n.content,e.AssertRules.OBJECT,!0)&&e.validate("message.messageDirection",n.messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("message.canIncludeExpansion",n.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("message.expansion",n.expansion,e.AssertRules.OBJECT)&&e.validate("message.disableNotification",n.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("message.sentTime",n.sentTime,e.AssertRules.NUMBER)&&e.validate("message.sentStatus",n.sentStatus,e.AssertRules.NUMBER))?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u,l,g,v,f,E,R,I,p,T,h,C;return s(this,(function(s){switch(s.label){case 0:return r="",a=1,g=!1,f=n.messageType,E=n.content,n instanceof Te||(r=n.senderUserId,a=n.messageDirection,g=n.canIncludeExpansion,v=n.expansion,l=n.disableNotification,d=n.sentTime,u=n.sentStatus),c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),R=o.isUnread,I=o.searchContent,p={senderUserId:r,messageType:f,content:E,messageDirection:a,sentTime:d,sentStatus:u,searchContent:I,isUnread:R,messageUId:"",disableNotification:l,canIncludeExpansion:g,expansionMsg:JSON.stringify(v),channelId:t.channelId||""},[4,i.insertMessage(t.conversationType,t.targetId,p)];case 1:return T=s.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:ue[h]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(t,n){var o,a;return r(this,void 0,void 0,(function(){var i,c=this;return s(this,(function(d){if(!e.usingCppEngine())return[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[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",n,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===(o=t[i])||void 0===o?void 0:o.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,ie((function(o){return r(c,void 0,void 0,(function(){var r,a,i;return s(this,(function(s){switch(s.label){case 0:return[4,o.batchInsertMessage(t,n)];case 1:return r=s.sent(),a=r.code,i=r.data,a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:ue[a]}]}}))}))}))]}))}))},getMessageCount:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?[2,ie((function(e){return r(n,void 0,void 0,(function(){var n,o,r,a,i,c;return s(this,(function(s){switch(s.label){case 0:return n=t.conversationType,o=t.targetId,r=t.channelId,[4,e.getMessageCount(n,o,r)];case 1:return a=s.sent(),i=a.code,c=a.data,[2,{code:i,data:c}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?e.validate("messageUId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return[4,o.getPrivateMessageDeliverTime(t)];case 1:return n=s.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:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",n,e.AssertRules.STRING,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return[4,a.getGroupMessageDeliverList(t,n)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:c}]:(i.warn(e.LogTagId.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(r,", targetId:").concat(t," messageUId:").concat(n)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?e.validate("enableCheck",t,e.AssertRules.BOOLEAN)?[2,ie((function(e){return r(n,void 0,void 0,(function(){return s(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:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return e.usingCppEngine()?[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a;return s(this,(function(s){switch(s.label){case 0:return o.info(e.LogTagId.O,"clearLocalData ->"),[4,n.clearData()];case 1:return t=s.sent(),r=t.code,a=t.data,[2,{code:r,data:a}]}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))}}),st=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};Object.defineProperty(exports,"AreaCode",{enumerable:!0,get:function(){return e.AreaCode}}),Object.defineProperty(exports,"ChatroomEntryType",{enumerable:!0,get:function(){return e.ChatroomEntryType}}),Object.defineProperty(exports,"ChatroomSyncStatusReason",{enumerable:!0,get:function(){return e.ChatroomSyncStatusReason}}),Object.defineProperty(exports,"ChatroomUserChangeType",{enumerable:!0,get:function(){return e.ChatroomUserChangeType}}),Object.defineProperty(exports,"ChrmMemBanType",{enumerable:!0,get:function(){return e.ChrmMemBanType}}),Object.defineProperty(exports,"ChrmMemOperateType",{enumerable:!0,get:function(){return e.ChrmMemOperateType}}),Object.defineProperty(exports,"ChrmSyncStatus",{enumerable:!0,get:function(){return e.ChrmSyncStatus}}),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,"OperateStatus",{enumerable:!0,get:function(){return e.OperateStatus}}),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=Te,exports.CombineMessage=Ne,exports.ConnectType={COMET:"comet",WEBSOCKET:"websocket"},exports.FileMessage=_e,exports.GIFMessage=ye,exports.HQVoiceMessage=Se,exports.ImageMessage=me,exports.LocationMessage=Le,exports.MentionedInfoBody=st,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=Me,exports.RichContentMessage=Pe,exports.SightMessage=Ae,exports.TextMessage=Oe,exports.VoiceMessage=Ue,exports.__addSDKVersion=function(t,n){e.VersionManage.add(t,n)},exports.addConversationsToTag=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",n,e.AssertRules.ARRAY,!0)&&!n.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o;return s(this,(function(r){switch(r.label){case 0:return i.info(e.LogTagId.O,"addTagForConversations ->tagId:".concat(t)),[4,a.addTagForConversations(t,n)];case 1:return(o=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:o}]:(i.warn(e.LogTagId.O,"addTagForConversations ->code:".concat(o,",tagId:").concat(t)),[2,{code:o,msg:ue[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addEventListener=function(e,t,n){$.on(e,t,n)},exports.addTag=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){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,ie((function(o,a){return r(n,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return a.info(e.LogTagId.O,"createTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,o.createTag(t)];case 1:return(n=r.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:ue[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.addToBlacklist=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"addToBlacklist -> userId: ".concat(t)),[4,o.addToBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.bindRTCRoomForChatroom=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("option.chatRoomId",t.chatRoomId,e.AssertRules.STRING,!0)&&e.validate("option.rtcRoomId",t.rtcRoomId,e.AssertRules.STRING,!0)?[2,ie((function(e){return r(n,void 0,void 0,(function(){var n;return s(this,(function(o){switch(o.label){case 0:return[4,e.bindRTCRoomForChatroom(t)];case 1:return[2,{code:n=o.sent(),msg:ue[n]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearAllMessagesUnreadStatus=function(){return r(this,void 0,void 0,(function(){var e=this;return s(this,(function(t){return[2,ie((function(t,n){return r(e,void 0,void 0,(function(){return s(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))},exports.clearEventListeners=ce,exports.clearHistoryMessages=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",n,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"clear message ->".concat(o)),[4,a.deleteRemoteMessageByTimestamp(t.conversationType,t.targetId,n,t.channelId)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"clear message ->".concat(r,":").concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearMessages=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return Q("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),e.usingCppEngine()?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.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,o.clearMessages(n,r,i)];case 1:return(c=s.sent())===e.ErrorCode.SUCCESS?[2,{code:c}]:(a.warn(e.LogTagId.O,"clearMessages ->code:".concat(c,",targetId:").concat(r)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.clearMessagesUnreadStatus=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r;return s(this,(function(s){switch(s.label){case 0:return[4,o.clearUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.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(ue[n],",").concat(r)),[2,{code:n,msg:ue[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearTextMessageDraft=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r;return s(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),a.debug(e.LogTagId.O,"delete draft ->".concat(n)),[4,o.clearConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return(r=s.sent())===e.ErrorCode.SUCCESS?[2,{code:r}]:(a.warn(e.LogTagId.O,"delete draft fail ->".concat(r,":").concat(ue[r],",").concat(n)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.clearUnreadCountByTimestamp=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("timestamp",n,e.AssertRules.NUMBER)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d;return s(this,(function(s){switch(s.label){case 0:return o=t.conversationType,r=t.targetId,c=t.channelId,i.info(e.LogTagId.O,"clearUnreadCountByTimestamp ->targetId:".concat(r,",conversationType:").concat(o)),[4,a.clearUnreadCountByTimestamp(o,r,n,c)];case 1:return(d=s.sent())===e.ErrorCode.SUCCESS?[2,{code:d}]:(i.warn(e.LogTagId.O,"clearUnreadCountByTimestamp ->code:".concat(d,",targetId:").concat(r)),[2,{code:d,msg:ue[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.connect=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return e.validate("token",t,e.AssertRules.STRING,!0)&&e.validate("reconnectKickEnable",n,e.AssertRules.BOOLEAN)?(o=i.createTraceId(),i.info(e.LogTagId.A_CONNECT_T,JSON.stringify({token:t,reconnectKickEnable:n}),o),[4,a.connect(t,!!n,o)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return r=s.sent(),c=r.code===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_CONNECT_R,JSON.stringify({code:r.code,userId:r.userId}),o),r.code===e.ErrorCode.SUCCESS?[2,{code:r.code,data:{userId:r.userId}}]:[2,{code:r.code,msg:ue[r.code]}]}}))}))}))]}))}))},exports.deleteLocalMessagesByTimestamp=function(t,n,o){return r(this,void 0,void 0,(function(){var a,i,c,d=this;return s(this,(function(u){return Q("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",n,e.AssertRules.NUMBER,!0)&&e.validate("cleanSpace",o,e.AssertRules.BOOLEAN)?[2,ie((function(u,l){return r(d,void 0,void 0,(function(){var r;return s(this,(function(s){switch(s.label){case 0:return[4,u.deleteMessagesByTimestamp(a,i,n,o,c)];case 1:return r=s.sent(),l.debug(e.LogTagId.A_DELETE_MESSAGES_S,JSON.stringify({code:r,conversationType:a,targetId:i,channelId:c,timestamp:n})),r===e.ErrorCode.SUCCESS?[2,{code:r}]:(l.warn(e.LogTagId.O,"deleteLocalMessagesByTimestamp ->code:".concat(r,",targetId:").concat(t.targetId)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.deleteMessages=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("options",n,(function(t){return e.isArray(t)&&t.length}),!0)&&!n.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,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"delete messages ->".concat(o)),[4,a.deleteRemoteMessage(t.conversationType,t.targetId,n,t.channelId)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"delete message fail ->".concat(r,":").concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:e.ErrorCode.SUCCESS}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.destroy=function(){return r(this,void 0,void 0,(function(){return s(this,(function(e){return ne?(ce(),[2,se()]):[2]}))}))},exports.disconnect=function(t){return e.logger.info(e.LogTagId.A_DISCONNECT_O,{}),ae((function(e){return e.disconnect(t)}))},exports.electronExtension=rt,exports.forceRemoveChatRoomEntry=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Ie(n)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.info(e.LogTagId.O,"force remove chatroom entry ->".concat(o)),[4,a.forceRemoveChatroomEntry(t,n)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force remove chatroom entry fail ->code+:".concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.forceSetChatRoomEntry=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Ee(n)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"force set chatroom entry ->".concat(o)),[4,a.forceSetChatroomEntry(t,n)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"force set chatroom entry fail ->code+:".concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllChatRoomEntries=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return n="id:".concat(t),a.debug(e.LogTagId.O,"get all chatroom entries->".concat(n)),[4,o.getAllChatroomEntries(t)];case 1:return r=s.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(ue[i],",").concat(n)),[2,{code:i,msg:ue[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getAllConversationState=function(){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ie((function(e){return e.getAllConversationState()}))]}))}))},exports.getAllUltraGroupUnreadCount=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a,i;return s(this,(function(s){switch(s.label){case 0:return t="getAllUltraGroupUnreadCount",[4,n.getAllUltraGroupUnreadCount()];case 1:return r=s.sent(),a=r.code,i=r.data,o.debug(e.LogTagId.O,t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:(o.warn(e.LogTagId.O,"".concat(t," fail ->").concat(a,": ").concat(ue[a])),[2,{code:a,msg:ue[a]}])}}))}))}))]}))}))},exports.getAllUltraGroupUnreadMentionedCount=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a,i;return s(this,(function(s){switch(s.label){case 0:return t="getAllUltraGroupUnreadMentionedCount",!0,[4,n.getAllUltraGroupUnreadCount(true)];case 1:return r=s.sent(),a=r.code,i=r.data,o.debug(e.LogTagId.O,t),a===e.ErrorCode.SUCCESS?[2,{code:a,data:i}]:(o.warn(e.LogTagId.O,"".concat(t," fail ->").concat(a,": ").concat(ue[a])),[2,{code:a,msg:ue[a]}])}}))}))}))]}))}))},exports.getAllUnreadMentionedCount=function(){return r(this,void 0,void 0,(function(){return s(this,(function(t){return[2,ie((function(t,n){return n.debug(e.LogTagId.O,"getAllUnreadMentionedCount"),t.getAllUnreadMentionedCount()}))]}))}))},exports.getBlacklist=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a;return s(this,(function(s){switch(s.label){case 0:return o.info(e.LogTagId.O,"getBlacklist -> "),[4,n.getBlacklist()];case 1:return t=s.sent(),r=t.code,a=t.data,r===e.ErrorCode.SUCCESS&&a?[2,{code:r,data:a}]:(o.warn(e.LogTagId.O,"getBlacklist fail -> code: ".concat(r)),[2,{code:r}])}}))}))}))]}))}))},exports.getBlacklistStatus=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return a.info(e.LogTagId.O,"getBlacklistStatus -> userId: ".concat(t)),[4,o.getBlacklistStatus(t)];case 1:return n=s.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 r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a;return s(this,(function(s){switch(s.label){case 0:return[4,n.getBlockUltraGroupList()];case 1:return t=s.sent(),r=t.code,a=t.data,r===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:a}]:(o.warn(e.LogTagId.O,"get block ultragroup ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]}))}))},exports.getBlockedConversationList=function(){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,ie((function(e){return e.getBlockConversationList()}))]}))}))},exports.getChatRoomEntry=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("key",n,(function(t){return e.isString(t)&&/[\w+=-]+/.test(t)&&t.length<=128}),!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom entry->".concat(o)),[4,a.getChatroomEntry(t,n)];case 1:return r=s.sent(),c=r.code,d=r.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom entry fail ->code+:".concat(ue[c],",").concat(o)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatRoomInfo=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",n.count,e.AssertRules.NUMBER)&&e.validate("options.order",n.order,(function(e){return[0,1,2].includes(e)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom info ->".concat(o)),[4,a.getChatroomInfo(t,n.count,n.order)];case 1:return r=s.sent(),c=r.code,d=r.data,c===e.ErrorCode.SUCCESS&&d?[2,{code:c,data:d}]:(i.warn(e.LogTagId.O,"get chatroom info fail ->code+:".concat(ue[c],",").concat(o)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getChatroomHistoryMessages=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.timestamp",n.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",n.count,e.AssertRules.NUMBER)&&e.validate("options.count",n.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t}))&&e.validate("options.order",n.order,(function(e){return 0===e||1===e}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"get chatroom history message->".concat(o)),[4,a.getChatRoomHistoryMessages(t,n.count,n.order,n.timestamp)];case 1:return r=s.sent(),c=r.code,d=r.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(ue[c],",").concat(o)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConnectionStatus=function(){return ae((function(e){return e.getConnectionStatus()}))},exports.getConversation=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return[4,o.getConversation(t.conversationType,t.targetId,t.channelId||"")];case 1:return n=s.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:ue[r]}]):[2,{code:r,data:i?X(i):null}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationList=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(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",n,e.AssertRules.CHANNEL_ID)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.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,n)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return X(e)}))}]:(i.warn(e.LogTagId.O,"get conversation list fail ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationLevel=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return n=ve(a,t,"getConversationNotificationLevel"),[4,o.getConversationNotificationLevel(t.conversationType,t.targetId,t.channelId)];case 1:return r=s.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(ue[i]," , ").concat(n)),[2,{code:i,msg:ue[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationNotificationStatus=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return a.info(e.LogTagId.O,"getConversationNotificationStatus ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,o.getConversationNotificationStatus(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.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:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getConversationsFromTagByPage=function(t,n,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("count",n,e.AssertRules.NUMBER,!0)&&e.validate("startTime",a,e.AssertRules.NUMBER,!0)?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u;return s(this,(function(s){switch(s.label){case 0:return d.info(e.LogTagId.O,"getConversationListByTag ->tagId:".concat(t)),[4,c.getConversationListByTag(t,a,n)];case 1:return r=s.sent(),i=r.code,u=r.data,i===e.ErrorCode.SUCCESS?[2,{code:i,data:null==u?void 0:u.map((function(e){return function(e){return o(o({},X(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(d.warn(e.LogTagId.O,"getConversationListByTag ->code:".concat(i,",tagId:").concat(t)),[2,{code:i,msg:ue[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getCurrentUserId=function(){return ae((function(e){return e.getCurrentUserId()}))},exports.getDeviceId=function(){return ae((function(e){return e.getDeviceId()}))},exports.getFileToken=function(t,n,o,r){return ie((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:ue[e]})}))}))}))},exports.getFileUrl=function(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)?ie((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})},exports.getFirstUnreadMessage=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return[4,o.getFirstUnreadMessage(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.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:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getHistoryMessages=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options.timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==n?void 0:n.count,e.AssertRules.NUMBER)&&(e.usingCppEngine()||e.validate("options.count",null==n?void 0:n.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})))&&e.validate("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o=i.createTraceId(),i.info(e.LogTagId.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:t.targetId,conversationType:t.conversationType,channelId:t.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count}),o),[4,a.getHistoryMessage(t.conversationType,t.targetId,null==n?void 0:n.timestamp,null==n?void 0:n.count,null==n?void 0:n.order,null==t?void 0:t.channelId,"",o)];case 1:return r=s.sent(),c=r.code,d=r.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}),o),[2,{code:c,data:{list:u,hasMore:d.hasMore}}]):(i.warn(e.LogTagId.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageUIds:""}),o),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getMessage=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.usingCppEngine()?e.validate("messageId",t,(function(t){return e.isNumber(t)||e.isString(t)}),!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return[4,o.getMessage(t)];case 1:return n=s.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:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.getMessageReader=function(t,n,o){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.validate("messageUId",n,e.AssertRules.STRING,!0)&&e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("channelId",o,e.AssertRules.CHANNEL_ID)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u;return s(this,(function(s){switch(s.label){case 0:return r="messageUId:".concat(n,",targetId:").concat(t),c.debug(e.LogTagId.O,"get message reader ->".concat(r)),[4,i.getMessageReader(t,n,o)];case 1:return a=s.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(ue[d],",").concat(r)),[2,{code:d,msg:ue[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getProxy=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a;return s(this,(function(s){switch(s.label){case 0:return[4,n.getProxy()];case 1:return t=s.sent(),r=t.code,a=t.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:a}]:(o.warn(e.LogTagId.O,"getProxy ->code:".concat(r)),[2,{code:r,msg:ue[r]}])}}))}))}))]}))}))},exports.getRemoteHistoryMessages=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options.timestamp",null==n?void 0:n.timestamp,e.AssertRules.NUMBER)&&e.validate("options.count",null==n?void 0:n.count,e.AssertRules.NUMBER)&&e.validate("options.count",null==n?void 0:n.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),t}))&&e.validate("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"get history message ->".concat(o)),[4,a.getRemoteHistoryMessages(t.conversationType,t.targetId,(null==n?void 0:n.timestamp)||0,(null==n?void 0:n.count)||20,(null==n?void 0:n.order)||0,t.channelId||"")];case 1:return r=s.sent(),c=r.code,d=r.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(ue[c],",").concat(o)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getServerTime=function(){return ae((function(e){return e.getServerTime()}))},exports.getTags=function(){return r(this,void 0,void 0,(function(){var t=this;return s(this,(function(n){return[2,ie((function(n,o){return r(t,void 0,void 0,(function(){var t,r,a;return s(this,(function(s){switch(s.label){case 0:return[4,n.getTagList()];case 1:return t=s.sent(),r=t.code,a=t.data,o.warn(e.LogTagId.O,"getTagList ->code:".concat(r)),[2,{code:e.ErrorCode.SUCCESS,data:a}]}}))}))}))]}))}))},exports.getTagsFromConversation=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return a.info(e.LogTagId.O,"getTagsForConversation ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,o.getTagsForConversation(t)];case 1:return n=s.sent(),r=n.code,i=n.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:i}]:[2,{code:r,msg:ue[r]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTextMessageDraft=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return[4,o.getConversationMessageDraft(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.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(ue[r],",").concat(c)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTopConversationList=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(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",n,e.AssertRules.CHANNEL_ID)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return[4,a.getTopConversationList(t,n)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return X(e)}))}]:(i.warn(e.LogTagId.A_GET_TOP_CONVERSATION_LIST_E,"".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCount=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("includeMuted",t,e.AssertRules.BOOLEAN,!1)&&e.validate("conversationTypes",n,e.AssertRules.ARRAY,!1)&&!(null==n?void 0:n.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)})))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return i.debug(e.LogTagId.O,"get total unread count -> ConversationType:".concat(JSON.stringify(n)," includeMuted:").concat(t)),[4,a.getTotalUnreadCount("",n,t)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCount fail ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getTotalUnreadCountByLevels=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",n,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||n.some((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return[4,a.getTotalUnreadCountByLevels(t,n)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadCountByLevels fail ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]}))}))},exports.getTotalUnreadMentionedCountByLevels=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return!e.validate("conversationTypes",t,e.AssertRules.ARRAY,!0)||!e.validate("levels",n,e.AssertRules.ARRAY,!0)||t.some((function(t){return!e.validate("conversationType",t,e.isValidConversationType)}))||n.some((function(t){return!e.validate("level",t,e.isValidNotificationLevel)}))?[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return[4,a.getTotalUnreadCountByLevels(t,n,!0)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:c}]:(i.warn(e.LogTagId.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]}))}))},exports.getUltraGroupDefaultNotificationLevel=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("options.channelId",t.channelId,e.AssertRules.CHANNEL_ID)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c,d;return s(this,(function(s){switch(s.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,o.getUltraGroupDefaultNotificationLevel(t.targetId,t.channelId)];case 1:return i=s.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(ue[c]," , ").concat(r)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupFirstUnreadMessageTimestamp=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("conversation.targetId",t.targetId,e.AssertRules.STRING,!0)&&e.validate("conversation.channelId",t.channelId,e.AssertRules.CHANNEL_ID,!0)?[2,ie((function(o){return r(n,void 0,void 0,(function(){var n,r,a,i,c,d;return s(this,(function(s){switch(s.label){case 0:return n=t.targetId,r=t.channelId,a={targetId:n,channelId:r},[4,o.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=s.sent(),c=i.code,d=i.data,c===e.ErrorCode.SUCCESS?[2,{code:c,data:d}]:[2,{code:c,msg:ue[c]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupList=function(t){return void 0===t&&(t={}),r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){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,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return[4,o.getUltraGroupList(t)];case 1:return n=s.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(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupMessageListByMessageUId=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("msgs",n,e.AssertRules.ARRAY,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f,E;return s(this,(function(s){switch(s.label){case 0:return o=t.targetId,r=t.conversationType,c=t.channelId,d=[],n.forEach((function(e){var t=e.sendTime,n=e.messageUId;d.push({sendTime:t,messageUId:n,channelId:c})})),u={targetId:o,conversationType:r,messages:d},[4,a.getUltraGroupMessageListByMessageUId(u)];case 1:if(l=s.sent(),g=l.code,v=l.data,g===e.ErrorCode.SUCCESS){for(E in f={},v)f[E]=v[E]?W(v[E]):void 0;return[2,{code:e.ErrorCode.SUCCESS,data:f}]}return i.warn(e.LogTagId.O,"get UltraGroup MessageList by messageUId ->".concat(g,":").concat(ue[g])),[2,{code:g,msg:ue[g]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadCountByTargetId=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",n,e.AssertRules.ARRAY)&&!(null==n?void 0:n.some((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o="getUltraGroupUnreadCountByTargetId",[4,a.getUltraGroupUnreadCountByTargetId(t,n)];case 1:return r=s.sent(),c=r.code,d=r.data,u="targetId: ".concat(t,", levels: ").concat(JSON.stringify(n)),i.debug(e.LogTagId.O,"".concat(o," -> ").concat(u)),[2,{code:c,data:d}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadInfoList=function(t){return r(this,void 0,void 0,(function(){var n,o=this;return s(this,(function(a){return e.validate("targetIds",t,e.AssertRules.ARRAY,!0)&&e.validate("targetIds.length",t,(function(e){return e.length>0&&e.length<20}))&&!t.some((function(t){return!e.validate("targetId",t,e.AssertRules.STRING)}))?(n=t.filter((function(e,n){return t.indexOf(e)===n})),[2,ie((function(t){return r(o,void 0,void 0,(function(){var o,r,a;return s(this,(function(s){switch(s.label){case 0:return[4,t.getUltraGroupUnreadInfoList(n)];case 1:return o=s.sent(),r=o.code,a=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:ue[r]}]}}))}))}))]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedCountByTargetId=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("notificationLevels",n,e.AssertRules.ARRAY)&&!(null==n?void 0:n.some((function(t){return!e.validate("notificationLevel",t,e.isValidNotificationLevel)})))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return i.debug(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(t,", notificationLevels: ").concat(JSON.stringify(n))),[4,a.getUltraGroupUnreadMentionedCountByTargetId(t,n)];case 1:return o=s.sent(),r=o.code,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS,data:c}]:(i.warn(e.LogTagId.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(r,":").concat(ue[r])),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUltraGroupUnreadMentionedMessages=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){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,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c,d,u,l,g;return s(this,(function(s){switch(s.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,o.getUltraGroupUnreadMentionedMessages(d)];case 1:return u=s.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(ue[l])),[2,{code:l,msg:ue[l]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadConversationList=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){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,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,a;return s(this,(function(s){switch(s.label){case 0:return[4,o.getUnreadConversationList(t)];case 1:return n=s.sent(),r=n.code,a=n.data,r===e.ErrorCode.SUCCESS&&a?[2,{code:0,data:a.map((function(e){return X(e)}))}]:[2,{code:r,msg:ue[r]}]}}))}))}))]}))}))},exports.getUnreadCount=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c;return s(this,(function(s){switch(s.label){case 0:return[4,o.getUnreadCount(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.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(ue[r],",").concat(c)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadCountByTag=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("containMuted",n,e.AssertRules.BOOLEAN,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return i.info(e.LogTagId.O,"getUnreadCountByTag ->tagId:".concat(t)),[4,a.getUnreadCountByTag(t,n)];case 1:return o=s.sent(),r=o.code,c=o.data,[2,{code:r,data:c}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.getUnreadMentionedCount=function(t){return r(this,void 0,void 0,(function(){return s(this,(function(n){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((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:ue[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}},ne?n(ne,re,oe):{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;ne?re.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))})),oe=t,ne=e.APIContext.init((null===(n=t.__runtimeCreator__)||void 0===n?void 0:n.call(t))||z,{appkey:t.appkey,navigators:t.navigators||[],miniCMPProxy:t.customCMP||[],logOutputLevel:t.logOutputLevel,__reportLogLevel:t.__reportLogLevel,httpInMainProcess:!!t.httpInMainProcess,logExpireTime:t.logExpireTime,areaCode:t.areaCode,logServerUrl:t.logServerUrl}),(re=ne.createLogger("RC-IM","IM")).setOutputLevel(t.logOutputLevel),re.info(e.LogTagId.A_INIT_O,JSON.stringify({appkey:o,navigators:r,version:"5.7.10",commit:"8733f13c4f051f4e58aedf9b86db72639c36ecbb"})),ne.assignWatcher(ee),e.logger.init(re))}(t)},exports.insertMessage=function(t,n,o){return void 0===o&&(o={}),r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return Q("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)&&e.validate("options",o,e.AssertRules.OBJECT)&&e.validate("options.isUnread",null==o?void 0:o.isUnread,e.AssertRules.BOOLEAN)&&e.validate("options.searchContent",null==o?void 0:o.searchContent,e.AssertRules.STRING)&&e.validate("content.senderUserId",n.senderUserId,e.AssertRules.STRING,!0)&&e.validate("content.messageType",n.messageType,e.AssertRules.STRING,!0)&&e.validate("content.content",n.content,e.AssertRules.OBJECT,!0)&&e.validate("content.messageDirection",n.messageDirection,e.AssertRules.NUMBER,!0)&&e.validate("content.canIncludeExpansion",n.canIncludeExpansion,e.AssertRules.BOOLEAN)&&e.validate("content.expansion",n.expansion,e.AssertRules.OBJECT)&&e.validate("content.disableNotification",n.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("content.sentTime",n.sentTime,e.AssertRules.NUMBER)&&e.validate("content.sentStatus",n.sentStatus,e.AssertRules.NUMBER)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u,l,g,v,f,E,R,I,p,T,h,C,m;return s(this,(function(s){switch(s.label){case 0:return r=n.senderUserId,a=n.messageType,d=n.content,u=n.messageDirection,l=n.messageUId,g=n.canIncludeExpansion,v=n.expansion,f=n.disableNotification,E=n.sentTime,R=n.sentStatus,c.info(e.LogTagId.O,"insertMessage ->targetId:".concat(t.targetId,",conversationType:").concat(t.conversationType)),I=o.isUnread,p=o.searchContent,T={senderUserId:r,messageType:a,content:d,messageDirection:u,sentTime:E,sentStatus:R,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=s.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:ue[C]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.installPlugin=function(e,t){return ae((function(n){return n.install(e,t)}))},exports.joinChatRoom=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",n.count,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return o=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:n.count,joinExist:!1}),o),[4,a.joinChatroom(t,n.count,o)];case 1:return r=s.sent(),c=r===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:r,timestamp:(new Date).getTime()}),o),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:ue[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.joinExistChatRoom=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("options.count",n.count,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return o=i.createTraceId(),i.info(e.LogTagId.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:t,count:n.count,joinExist:!0}),o),[4,a.joinExistChatroom(t,n.count,o)];case 1:return r=s.sent(),c=r===e.ErrorCode.SUCCESS?"info":"warn",i[c](e.LogTagId.A_JOIN_CHATROOM_R,JSON.stringify({code:r,timestamp:(new Date).getTime()}),o),r!==e.ErrorCode.SUCCESS?[2,{code:r,msg:ue[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.modifyMessage=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("content",t,e.AssertRules.OBJECT,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f,E;return s(this,(function(s){switch(s.label){case 0:return o=n.conversationType,r=n.targetId,c=n.messageUId,d=n.senderUserId,u=n.sentTime,l=n.canIncludeExpansion,g=n.channelId,v="conversationType:".concat(o,",targetId:").concat(r,",channelId:").concat(g,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update ultragroup message expansion ->".concat(v)),f={targetId:r,channelId:g,conversationType:o,fromUserId:d,sendTime:u,canIncludeExpansion:l,messageUId:c,content:t},[4,a.modifyMessage(f)];case 1:return(E=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"modify ultraGroup message ->".concat(E,":").concat(ue[E])),[2,{code:E,msg:ue[E]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.onceEventListener=function(e,t,n){$.once(e,t,n)},exports.quitChatRoom=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("targetId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i;return s(this,(function(s){switch(s.label){case 0:return n=a.createTraceId(),a.info(e.LogTagId.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:t}),n),[4,o.quitChatroom(t)];case 1:return r=s.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:ue[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.recallMessage=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("options.messageUId",n.messageUId,e.AssertRules.STRING,!0)&&e.validate("options.sentTime",n.sentTime,e.AssertRules.NUMBER,!0)&&e.validate("options.disableNotification",null==n?void 0:n.disableNotification,e.AssertRules.BOOLEAN)&&e.validate("options.pushConfig",null==n?void 0:n.pushConfig,e.AssertRules.OBJECT)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u;return s(this,(function(s){switch(s.label){case 0:return o={user:n.user,channelId:t.channelId||"",disableNotification:null==n?void 0:n.disableNotification,pushConfig:null==n?void 0:n.pushConfig,extra:n.extra,isDelete:n.isDelete},r="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId,",messageUId:").concat(n.messageUId),i.debug(e.LogTagId.O,"recall message ->".concat(r)),[4,a.recallMessage(t.conversationType,t.targetId,n.messageUId,n.sentTime,o)];case 1:return c=s.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(ue[d],",").concat(r)),[2,{code:d,msg:ue[d]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.registerMessageType=function(t,n,o,r,s){return ae((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),he(t,n,o)}))},exports.removeAllExpansionForUltraGroupMessage=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("message",t,e.AssertRules.OBJECT,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r,i,c,d,u,l,g,v;return s(this,(function(s){switch(s.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,o.expandUltraMessage(g)];case 1:return(v=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(a.warn(e.LogTagId.O,"remove all expansion for ultraGroup message ->".concat(v,":").concat(ue[v])),[2,{code:v,msg:ue[v]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntries=function(t,n){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&pe(n)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u,l;return s(this,(function(s){switch(s.label){case 0:return r="id:".concat(t),c.info(e.LogTagId.O,"remove chatroom entry->".concat(r)),(a=o({},n)).entries=n.entries.map((function(e){return{key:e}})),[4,i.removeChatroomEntries(t,a)];case 1:return d=s.sent(),u=d.code,l=d.data,u!==e.ErrorCode.SUCCESS?(c.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(ue[u],",").concat(r)),[2,{code:u,msg:ue[u],data:l}]):[2,{code:u}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeChatRoomEntry=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Ie(n)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"remove chatroom entry->".concat(o)),[4,a.removeChatroomEntry(t,n)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove chatroom entry fail ->code+:".concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversation=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n,r;return s(this,(function(s){switch(s.label){case 0:return[4,o.removeConversation(t.conversationType,t.targetId,t.channelId)];case 1:return n=s.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(ue[n],",").concat(r)),[2,{code:n,msg:ue[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeConversationsFromTag=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",n,e.AssertRules.ARRAY,!0)&&!n.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o;return s(this,(function(r){switch(r.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,a.removeTagForConversations(t,n)];case 1:return(o=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:o}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(o,",tagId:").concat(t)),[2,{code:o,msg:ue[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeEventListener=function(e,t,n){$.off(e,t,n)},exports.removeEventListeners=function(e){$.removeAll(e)},exports.removeExpansionForUltraGroupMessage=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("expansion",t,e.AssertRules.ARRAY,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f;return s(this,(function(s){switch(s.label){case 0:return o=n.conversationType,r=n.targetId,c=n.messageUId,d=n.sentTime,u=n.canIncludeExpansion,l=n.channelId,g="conversationType:".concat(o,",targetId:").concat(r,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove expansion for ultragroup message ->".concat(g)),v={targetId:r,channelId:l,conversationType:o,sendTime:d,canIncludeExpansion:u,messageUId:c,keys:t},[4,a.expandUltraMessage(v)];case 1:return(f=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"remove expansion for ultraGroup message ->".concat(f,":").concat(ue[f])),[2,{code:f,msg:ue[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeFromBlacklist=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("userId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){return s(this,(function(n){switch(n.label){case 0:return a.info(e.LogTagId.O,"removeFromBlacklist -> userId: ".concat(t)),[4,o.removeFromBlacklist(t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeMessageExpansionForKey=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("keys",t,e.AssertRules.ARRAY,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",n.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("message.targetId",n.targetId,e.AssertRules.STRING,!0)&&e.validate("message.channelId",n.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("message.messageUId",n.messageUId,e.AssertRules.STRING,!0)&&e.validate("message.canIncludeExpansion",n.canIncludeExpansion,e.AssertRules.BOOLEAN,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g;return s(this,(function(s){switch(s.label){case 0:return o=n.conversationType,r=n.targetId,c=n.messageUId,d=n.canIncludeExpansion,u=n.channelId,l="conversationType:".concat(o,",targetId:").concat(r,",messageUId:").concat(c),i.debug(e.LogTagId.O,"remove message expansion ->".concat(l)),[4,a.sendExpansionMessage({conversationType:o,targetId:r,messageUId:c,canIncludeExpansion:d,keys:t,channelId:u})];case 1:return(g=s.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"remove message expansion fail ->".concat(g,":").concat(ue[g],",").concat(l)),[2,{code:g,msg:ue[g]}]):[2,{code:g}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTag=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("tagId",t,e.AssertRules.STRING,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return a.info(e.LogTagId.O,"removeTag ->tagId:".concat(t)),[4,o.removeTag(t)];case 1:return(n=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"removeTag ->code:".concat(n,",tagId:").concat(t)),[2,{code:n,msg:ue[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagFromConversations=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversations",n,e.AssertRules.ARRAY,!0)&&!n.some((function(t){return!e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o;return s(this,(function(r){switch(r.label){case 0:return i.info(e.LogTagId.O,"removeTagForConversations ->tagId:".concat(t)),[4,a.removeTagForConversations(t,n)];case 1:return(o=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:o}]:(i.warn(e.LogTagId.O,"removeTagForConversations ->code:".concat(o,",tagId:").concat(t)),[2,{code:o,msg:ue[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.removeTagsFromConversation=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("tagIds",n,e.AssertRules.ARRAY,!0)&&!n.some((function(t){return!e.validate("tagId",t,e.AssertRules.STRING,!0)}))?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o;return s(this,(function(r){switch(r.label){case 0:return i.info(e.LogTagId.O,"removeTagsForConversation ->tagIds:".concat(n,",targetId:").concat(t.targetId,",conversationType:").concat(t.conversationType)),[4,a.removeTagsForConversation(t,n)];case 1:return(o=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:o}]:(i.warn(e.LogTagId.O,"removeTagsForConversation ->code:".concat(o,",tagIds:").concat(n)),[2,{code:o,msg:ue[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.saveTextMessageDraft=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("draft",n,e.AssertRules.STRING,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set draft ->".concat(o)),[4,a.saveConversationMessageDraft(t.conversationType,t.targetId,n,t.channelId)];case 1:return(r=s.sent())===e.ErrorCode.SUCCESS?[2,{code:r}]:(i.warn(e.LogTagId.O,"set draft fail ->".concat(r,":").concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.searchConversationByContent=function(t,n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return Q("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),e.usingCppEngine()?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u;return s(this,(function(s){switch(s.label){case 0:return d.info(e.LogTagId.O,"searchConversationByContent ->keyword:".concat(t)),[4,c.searchConversationByContent(t,o,a,n)];case 1:return r=s.sent(),i=r.code,u=r.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:ue[i]}])}}))}))}))]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.searchMessages=function(t,n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return Q("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),e.usingCppEngine()?e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("keyword",n,e.AssertRules.STRING,!0)&&e.validate("timestamp",o,e.AssertRules.NUMBER)&&e.validate("count",a,e.AssertRules.NUMBER)?[2,ie((function(c,d){return r(i,void 0,void 0,(function(){var r,i,u,l;return s(this,(function(s){switch(s.label){case 0:return 1,[4,c.searchMessageByContent(t.conversationType,t.targetId,n,o,a,1,t.channelId)];case 1:return r=s.sent(),i=r.code,u=r.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:ue[i]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.sendFileMessage=Qe,exports.sendGIFMessage=et,exports.sendHQVoiceMessage=nt,exports.sendImageMessage=$e,exports.sendMessage=We,exports.sendReadReceiptMessage=function(t,n,o,a){return r(this,void 0,void 0,(function(){var i=this;return s(this,(function(c){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageUId",n,e.AssertRules.STRING,!0)&&e.validate("timestamp",o,e.AssertRules.NUMBER,!0)&&e.validate("channelId",a,e.AssertRules.CHANNEL_ID)?[2,ie((function(c){return r(i,void 0,void 0,(function(){var r,i,c,d,u;return s(this,(function(s){switch(s.label){case 0:return r={targetId:t,conversationType:e.ConversationType.PRIVATE,channelId:a},i=new Te("RC:ReadNtf",{messageUId:n,lastMessageSendTime:o,type:1}),[4,We(r,i)];case 1:return c=s.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,n,o){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.validate("messageUId",n,e.AssertRules.STRING,!0)&&e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("channelId",o,e.AssertRules.CHANNEL_ID)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,i,d,u;return s(this,(function(s){switch(s.label){case 0:return r="messageUId:".concat(n,",targetId:").concat(t),c.debug(e.LogTagId.O,"send read receipt message ->".concat(r)),a=new Te("RC:RRReqMsg",{messageUId:n}),[4,We({targetId:t,conversationType:e.ConversationType.GROUP,channelId:o},a)];case 1:return i=s.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,n){return r(this,void 0,void 0,(function(){return s(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))},exports.sendReadReceiptResponseV2=function(t,n,o){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&e.validate("messageList",n,e.AssertRules.OBJECT,!0)&&e.validate("channelId",o,e.AssertRules.CHANNEL_ID)&&!Object.keys(n).some((function(t){return!e.validate(t,n[t],e.AssertRules.ARRAY)}))?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r,a,d,u,l,g;return s(this,(function(s){switch(s.label){case 0:return r={targetId:t,conversationType:e.ConversationType.GROUP,channelId:o},d=i.getNaviInfoFromCache(),1!==(null==d?void 0:d.grpRRVer)?[3,2]:(u=[],Object.keys(n).forEach((function(e){n[e].forEach((function(e){-1===u.indexOf(e)&&u.push(e)}))})),u.length?[4,i.sendReadReceiptMessage(t,u,o)]:(c.warn(e.LogTagId.O,"Error in parameter messageList."),[2,{code:e.ErrorCode.PARAMETER_ERROR}]));case 1:return a=s.sent(),[3,4];case 2:return l=new Te("RC:RRRspMsg",{receiptMessageDic:n}),[4,We(r,l)];case 3:a=s.sent(),s.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(ue[g])),[2,{code:g,msg:ue[g]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendSightMessage=ot,exports.sendSyncReadStatusMessage=function(t,n){return r(this,void 0,void 0,(function(){var o,r,a,i;return s(this,(function(s){switch(s.label){case 0:return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("lastMessageSendTime",n,e.AssertRules.NUMBER,!0)?(o=new Te("RC:SRSMsg",{lastMessageSendTime:n}),[4,We(t,o)]):[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}];case 1:return r=s.sent(),a=r.code,i=r.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))},exports.sendTextMessage=function(e,t,n){return We(e,new Oe(t),n)},exports.sendTypingStatusMessage=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("conversation",t,e.AssertRules.CONVERSATION,!0)&&e.validate("typingContentType",n,e.AssertRules.STRING,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l;return s(this,(function(s){switch(s.label){case 0:return o={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:t.channelId},r=i.createTraceId(),i.info(e.LogTagId.A_SEND_MSG_T,JSON.stringify({messageType:o.messageType,conversationType:t.conversationType,targetId:t.targetId,channelId:t.channelId}),r),[4,a.sendMessage(t.conversationType,t.targetId,o,void 0,r)];case 1:return c=s.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:""}),r),d===e.ErrorCode.SUCCESS?[2,{code:d,data:W(u)}]:[2,{code:d,msg:ue[d]}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.sendUltraGroupTypingStatus=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return[4,o.sendUltraGroupTypingStatus(t)];case 1:return(n=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(a.warn(e.LogTagId.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(ue[n])),[2,{code:n,msg:ue[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntries=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Re(n)?n.entries.length>10?[2,de.CHATROOM_KV_STORE_OUT_LIMIT]:[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(o)),[4,a.setChatroomEntries(t,n)];case 1:return r=s.sent(),c=r.code,d=r.data,c!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(ue[c],",").concat(o)),[2,{code:c,msg:ue[c],data:d}]):[2,{code:c}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setChatRoomEntry=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("targetId",t,e.AssertRules.STRING,!0)&&Ee(n)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="id:".concat(t),i.debug(e.LogTagId.O,"set chatroom entry->".concat(o)),[4,a.setChatroomEntry(t,n)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set chatroom entry fail ->code+:".concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationLevel=function(t,n){return r(this,void 0,void 0,(function(){return s(this,(function(o){return e.validate("notificationLevel",n,(function(t){return void 0!==e.NotificationLevel[t]}),!0)&&e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(e,o){return fe(o,t,(function(){return e.setConversationNotificationLevel(t.conversationType,t.targetId,n,t.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationNotificationStatus=function(t,n){return r(this,void 0,void 0,(function(){return s(this,(function(o){return e.validate("notificationStatus",n,(function(e){return 1===e||2===e}),!0)&&e.validate("options",t,e.AssertRules.CONVERSATION,!0)?[2,ie((function(e,o){return fe(o,t,(function(){return e.setConversationStatus(t.conversationType,t.targetId,void 0,n,t.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTop=function(t,n){return void 0===n&&(n=!0),r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("options",t,e.AssertRules.CONVERSATION,!0)&&e.validate("isTop",n,e.AssertRules.BOOLEAN)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r;return s(this,(function(s){switch(s.label){case 0:return o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId),i.debug(e.LogTagId.O,"set conversation status ->".concat(o)),[4,a.setConversationStatus(t.conversationType,t.targetId,n,void 0,t.channelId)];case 1:return(r=s.sent())!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"set conversation status fail ->".concat(r,":").concat(ue[r],",").concat(o)),[2,{code:r,msg:ue[r]}]):[2,{code:r}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setConversationToTopInTag=function(t,n,o){return r(this,void 0,void 0,(function(){var a=this;return s(this,(function(i){return e.validate("tagId",t,e.AssertRules.STRING,!0)&&e.validate("conversation",n,e.AssertRules.CONVERSATION,!0)&&e.validate("status.isTop",o,e.AssertRules.BOOLEAN,!0)?[2,ie((function(i,c){return r(a,void 0,void 0,(function(){var r;return s(this,(function(s){switch(s.label){case 0:return c.info(e.LogTagId.O,"setConversationStatusInTag ->tagId:".concat(t,",targetId:").concat(n.targetId,",conversationType").concat(n.conversationType)),[4,i.setConversationStatusInTag(t,n,{isTop:o})];case 1:return(r=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:r}]:(c.warn(e.LogTagId.O,"setConversationStatusInTag ->code:".concat(r,",tagId:").concat(t)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setMessageReceivedStatus=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return Q("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),e.usingCppEngine()?e.validate("messageId",t,e.AssertRules.NUMBER,!0)&&e.validate("receivedStatus",n,e.AssertRules.NUMBER,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o;return s(this,(function(r){switch(r.label){case 0:return i.info(e.LogTagId.O,"setMessageReceivedStatus ->messageId:".concat(t,",receivedStatus:").concat(n)),[4,a.setMessageReceivedStatus(t,n)];case 1:return(o=r.sent())===e.ErrorCode.SUCCESS?[2,{code:o}]:(i.warn(e.LogTagId.O,"setMessageReceivedStatus ->code:".concat(o,",messageId:").concat(t)),[2,{code:o,msg:ue[o]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:e.ErrorCode.NOT_SUPPORT,msg:ue[e.ErrorCode.NOT_SUPPORT]}]}))}))},exports.setProxy=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){return!t||e.validate("proxy.socksHost",t.socksHost,e.AssertRules.STRING,!0)&&e.validate("proxy.socksPort",t.socksPort,e.AssertRules.NUMBER,!0)?[2,ie((function(o,a){return r(n,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return a.info(e.LogTagId.O,"setProxy: ->".concat(t)),[4,o.setProxy(t)];case 1:return(n=r.sent().code)===e.ErrorCode.SUCCESS?[2,{code:n}]:(a.warn(e.LogTagId.O,"setProxy ->code:".concat(n)),[2,{code:n,msg:ue[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.setUltraGroupDefaultNotificationLevel=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(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",n,(function(t){return void 0!==e.NotificationLevel[t]}),!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return o="setUltraGroupDefaultNotificationLevel",r="targetId: ".concat(t.targetId,", channelId: ").concat(t.channelId),i.debug(e.LogTagId.O,"".concat(o," -> ").concat(r)),[4,a.setUltraGroupDefaultNotificationLevel(t.targetId,n,t.channelId)];case 1:return(c=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:c}]:(i.warn(e.LogTagId.O,"".concat(o," fail -> ").concat(c," : ").concat(ue[c]," , ").concat(r)),[2,{code:c,msg:ue[c]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.testProxy=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(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,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c;return s(this,(function(s){switch(s.label){case 0:return i.info(e.LogTagId.O,"testProxy: ->".concat(t)),[4,a.testProxy(t,n)];case 1:return o=s.sent(),r=o.status,c=o.data,r===e.ErrorCode.SUCCESS?[2,{code:r,msg:c}]:(i.warn(e.LogTagId.O,"testProxy ->code:".concat(r)),[2,{code:r,msg:ue[r]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateExpansionForUltraGroupMessage=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v,f;return s(this,(function(s){switch(s.label){case 0:return o=n.conversationType,r=n.targetId,c=n.messageUId,d=n.sentTime,u=n.canIncludeExpansion,l=n.channelId,g="conversationType:".concat(o,",targetId:").concat(r,",channelId:").concat(l,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update expansion for ultragroup message ->".concat(g)),v={targetId:r,channelId:l,conversationType:o,sendTime:d,canIncludeExpansion:u,messageUId:c,expansion:t},[4,a.expandUltraMessage(v)];case 1:return(f=s.sent().code)===e.ErrorCode.SUCCESS?[2,{code:e.ErrorCode.SUCCESS}]:(i.warn(e.LogTagId.O,"update expansion for ultragroup message ->".concat(f,":").concat(ue[f])),[2,{code:f,msg:ue[f]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateMessageExpansion=function(t,n){return r(this,void 0,void 0,(function(){var o=this;return s(this,(function(a){return e.validate("expansion",t,e.AssertRules.OBJECT,!0)&&e.validate("message",n,e.AssertRules.OBJECT,!0)&&e.validate("message.conversationType",n.conversationType,e.AssertRules.NUMBER,!0)&&e.validate("message.targetId",n.targetId,e.AssertRules.STRING,!0)&&e.validate("message.channelId",n.channelId,e.AssertRules.CHANNEL_ID)&&e.validate("message.messageUId",n.messageUId,e.AssertRules.STRING,!0)&&e.validate("message.expansion",n.expansion,e.AssertRules.OBJECT)&&e.validate("message.canIncludeExpansion",n.canIncludeExpansion,e.AssertRules.BOOLEAN,!0)?[2,ie((function(a,i){return r(o,void 0,void 0,(function(){var o,r,c,d,u,l,g,v;return s(this,(function(s){switch(s.label){case 0:return o=n.conversationType,r=n.targetId,c=n.messageUId,d=n.canIncludeExpansion,u=n.expansion,l=n.channelId,g="conversationType:".concat(o,",targetId:").concat(r,",messageUId:").concat(c),i.debug(e.LogTagId.O,"update message expansion ->".concat(g)),[4,a.sendExpansionMessage({conversationType:o,targetId:r,messageUId:c,expansion:t,canIncludeExpansion:d,originExpansion:u,channelId:l})];case 1:return(v=s.sent().code)!==e.ErrorCode.SUCCESS?(i.warn(e.LogTagId.O,"update message expansion fail ->".concat(v,":").concat(ue[v],",").concat(g)),[2,{code:v,msg:ue[v]}]):[2,{code:v}]}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))},exports.updateTag=function(t){return r(this,void 0,void 0,(function(){var n=this;return s(this,(function(o){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,ie((function(o,a){return r(n,void 0,void 0,(function(){var n;return s(this,(function(r){switch(r.label){case 0:return a.info(e.LogTagId.O,"updateTag ->tagId:".concat(t.tagId,",tagName:").concat(t.tagName)),[4,o.updateTag(t)];case 1:return(n=r.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:ue[n]}])}}))}))}))]:[2,{code:e.ErrorCode.BIZ_ERROR_INVALID_PARAMETER}]}))}))};
|