@rongcloud/imlib-next 5.7.8 → 5.7.9
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 +17 -2
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{NetworkType as e,HttpMethod as n,HTTP_TIMEOUT as t,appendUrl as o,ErrorCode as i,ReceivedStatus as r,ConversationType as a,isNumber as s,EventEmitter as c,RCConnectionStatus as u,VersionManage as d,assert as f,AssertRules as l,isArray as g,isHttpUrl as v,APIContext as I,LogTagId as R,logger as h,validate as m,isValidConversationType as E,isValidNotificationLevel as T,NotificationLevel as S,isTypeInConversationList as p,UltraGroupChannelType as O,isString as N,UploadMethod as _,getUUID as C,isValidFileType as A,FileType as y,usingCppEngine as M,MessageDirection as U,SentStatus as P,isUndefined as L}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var w=function(){return w=Object.assign||function(e){for(var n,t=1,o=arguments.length;t<o;t++)for(var i in n=arguments[t])Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i]);return e},w.apply(this,arguments)};function B(e,n,t,o){return new(t||(t=Promise))((function(i,r){function a(e){try{c(o.next(e))}catch(e){r(e)}}function s(e){try{c(o.throw(e))}catch(e){r(e)}}function c(e){var n;e.done?i(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,s)}c((o=o.apply(e,n||[])).next())}))}function D(e,n){var t,o,i,r,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(t)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(t=1,o&&(i=2&s[0]?o.return:s[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;switch(o=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=n.call(e,a)}catch(e){s=[6,e],o=0}finally{t=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var b=function(){return!("undefined"==typeof uni||!function(e){for(var n=["request","getSystemInfo"],t=0,o=n.length;t<o;t++)if(!e[n[t]])return!1;return!0}(uni))},G=b(),x=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 V,k={tag:"browser",httpReq:function(e){var i=e.method||n.GET,r=e.timeout||t,a=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var n=x(),t="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(i,u),a&&n.setRequestHeader)for(var o in a)n.setRequestHeader(o,a[o]);if(t){n.timeout=r,n.onload=function(){e({data:n.responseText,status:n.status||200})},n.onerror=function(){e({status:n.status})},n.ontimeout=function(){e({status:n.status})};var s="object"==typeof c?JSON.stringify(c):c;n.send(s)}else n.onreadystatechange=function(){4===n.readyState&&e({data:n.responseText,status:n.status})},n.onerror=function(){e({status:n.status})},setTimeout((function(){n.abort(),e({status:n.status})}),r),n.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:G,createWebSocket:function(e,n){var t=new WebSocket(e,n);return t.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){t.onclose=function(n){var t=n.code,o=n.reason;e(t,o)}},onError:function(e){t.onerror=e},onMessage:function(e){t.onmessage=function(n){e(n.data)}},onOpen:function(e){t.onopen=e},send:function(e){t.send(e)},close:function(e,n){t.close()}}},getNetworkType:function(){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t=n.type,o=n.effectiveType,i=t||o||e.UNKONWN;return Promise.resolve(i)}},H=b(),F=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return wx[e].apply(wx,n)}catch(e){null===console||void 0===console||console.error(e)}}},Z={setItem:F("setStorageSync"),getItem:F("getStorageSync"),removeItem:F("removeStorageSync"),clear:F("clearStorageSync")},q={tag:"wechat",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){wx.request({url:d,method:r,header:s,timeout:a,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Z,sessionStorage:Z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:H,createWebSocket:function(e,n){var t=wx.connectSocket({url:e,protocols:n});return{id:Date.now(),onClose:function(e){t.onClose((function(n){e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){e(n.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){wx.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},J=b(),z=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{if("setStorageSync"===e)return my[e]({key:n[0],data:JSON.parse(n[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:n[0]});var o=my[e]({key:n[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},K={setItem:z("setStorageSync"),getItem:z("getStorageSync"),removeItem:z("removeStorageSync"),clear:z("clearStorageSync")},Y={tag:"alipay",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:r,headers:s,timeout:a,data:u,dataType:f,success:function(n){e({data:n.data,status:n.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:K,sessionStorage:K,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:J,createWebSocket:function(e){return my.connectSocket({url:e}),{id:Date.now(),onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(n){e(n.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(n){n.isBuffer?e(my.base64ToArrayBuffer(n.data)):e(n.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(n){my.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},j=b(),W=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return tt[e].apply(tt,n)}catch(e){}}},X={setItem:W("setStorageSync"),getItem:W("getStorageSync"),removeItem:W("removeStorageSync"),clear:W("clearStorageSync")},Q={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:j,localStorage:X,sessionStorage:X,httpReq:function(e){return new Promise((function(n){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,n){var t=tt.connectSocket({url:e,protocols:n});return{id:Date.now(),onOpen:function(e){t.onOpen(e)},onClose:function(e){t.onClose((function(n){return e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){return e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){return e(n.data)}))},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){tt.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},$=b(),ee=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return swan[e].apply(swan,n)}catch(e){}}},ne={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},te={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$,localStorage:ne,sessionStorage:ne,httpReq:function(e){return new Promise((function(n,t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:i.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,n){var t=swan.connectSocket({url:e,protocols:n});return{id:Date.now(),onOpen:function(e){t.onOpen(e)},onClose:function(e){t.onClose((function(n){return e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){return e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){return e(n.data)}))},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return B(this,void 0,void 0,(function(){return D(this,(function(n){return[2,new Promise((function(n){swan.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))]}))}))}},oe=b(),ie=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return jd[e].apply(jd,n)}catch(e){null===console||void 0===console||console.error(e)}}},re={setItem:ie("setStorageSync"),getItem:ie("getStorageSync"),removeItem:ie("removeStorageSync"),clear:ie("clearStorageSync")},ae={tag:"jingdong",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){jd.request({url:d,method:r,headers:s,timeout:a,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:re,sessionStorage:re,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:oe,createWebSocket:function(e,n){return jd.connectSocket({url:e,protocols:n}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(n){e(n.code,n.reason)}))},onError:function(e){jd.onSocketError((function(n){e(n.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(n){e(n.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,n){jd.closeSocket({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){jd.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},se=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return uni[e].apply(uni,n)}catch(e){null===console||void 0===console||console.error(e)}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue={tag:"uniapp",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){uni.request({url:d,method:r,header:s,timeout:a,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:ce,sessionStorage:ce,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,n){var t={complete:function(){},url:e,protocols:n},o=uni.connectSocket(t);return{id:Date.now(),onClose:function(e){o.onClose((function(n){e(n.code,n.reason)}))},onError:function(e){o.onError((function(n){e(n.errMsg)}))},onMessage:function(e){o.onMessage((function(n){e(n.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,n){o.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){uni.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},de=function(e){return e&&e.request&&e.getSystemInfo},fe="undefined"!=typeof uni&&de(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ue;case"mp-jd":return ae;case"mp-baidu":return te;case"mp-toutiao":return Q;case"mp-alipay":return Y;case"mp-weixin":return q;default:return k}}():"undefined"!=typeof jd&&de(jd)?ae:"undefined"!=typeof my&&de(my)?Y:"undefined"!=typeof tt&&de(tt)?Q:"undefined"!=typeof swan&&de(swan)?te:"undefined"!=typeof wx&&de(wx)?q:k;function le(e){var n=e.conversationType,t=e.channelId,o=e.messageType,i=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,R=e.isOffLineMessage,h=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,T=e.disableNotification,S=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;E||(E=r.UNREAD);var U={messageType:o,channelId:t||"",content:i,senderUserId:c,targetId:u,conversationType:n,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:S,disableNotification:T,isStatusMessage:p,canIncludeExpansion:h,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return n!==a.ULTRA_GROUP&&(U.isOffLineMessage=R),n===a.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function ge(e){var n=e.conversationType,t=e.targetId,o=e.latestMessage,i=e.unreadMessageCount,r=e.hasMentioned,s=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,f=e.isTop,l=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,I={conversationType:n,targetId:t,latestMessage:o&&le(o),unreadMessageCount:i,hasMentioned:r,mentionedInfo:r?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:f,channelId:l,unreadMentionedCount:g,matchCount:v};return I.conversationType===a.ULTRA_GROUP&&(I.firstUnreadMessage=e.firstUnreadMessage,I.channelType=e.channelType),I}function ve(e,n){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(n,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS"}(V||(V={}));var Ie=new c,Re={connection:function(e,n){switch(e){case u.CONNECTED:Ie.emit(V.CONNECTED);break;case u.CONNECTING:Ie.emit(V.CONNECTING);break;case u.SUSPENDED:Ie.emit(V.SUSPEND,n);break;case u.DISCONNECTED:Ie.emit(V.DISCONNECT,n)}},batchMessage:function(e){Ie.emit(V.MESSAGES,{messages:e.map((function(e){return le(e)}))})},typingState:function(e){Ie.emit(V.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,n,t){Ie.emit(V.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:n,sentTime:t})},messageReceiptRequest:function(e,n,t){Ie.emit(V.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:n,senderUserId:t})},messageReceiptResponse:function(e,n,t){Ie.emit(V.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:n,messageUIdList:t})},conversationState:function(e){var n=e.map((function(e){var n=e.conversationType,t={conversationType:n,latestMessage:e.latestMessage?le(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return n===a.ULTRA_GROUP?(t.versionTime=e.versionTime,{conversation:t}):(t.hasMentioned=e.hasMentioned,t.mentionedInfo=e.mentionedInfo,t.isTop=e.isTop,{conversation:t,updatedItems:e.updatedItems})}));Ie.emit(V.CONVERSATION,{conversationList:n})},chatroomState:function(e){Ie.emit(V.CHATROOM,e)},expansion:function(e){Ie.emit(V.EXPANSION,e)},pullFinished:function(){Ie.emit(V.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Ie.emit(V.TAG)},conversationTagChanged:function(){Ie.emit(V.CONVERSATION_TAG)},messageBlocked:function(e){Ie.emit(V.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Ie.emit(V.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Ie.emit(V.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Ie.emit(V.ULTRA_GROUP_ENABLE,e.map((function(e){return ge(e)})))},operateStatus:function(e){Ie.emit(V.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return le(e)})))},ultraGroupMessageModified:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return le(e)})))},ultraGroupMessageRecalled:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return le(e)})))},ultraGroupChannelChangeType:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Ie.emit(V.USER_GROUP_STATUS,e)}};d.add("imlib-next","5.7.8");var he=null,me=null,Ee=null;function Te(){return B(this,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return he?(Ee.info(R.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),me=null,he=null,Ee=null,[2]}}))}))}function Se(e){if(!he)throw new Error("Not initialized yet!");return e(he,Ee,me)}function pe(e){return he?e(he,Ee,me):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function Oe(e,n,t){Ie.on(e,n,t)}function Ne(e,n,t){Ie.once(e,n,t)}function _e(e,n,t){Ie.off(e,n,t)}function Ce(e){Ie.removeAll(e)}function Ae(){Ie.clear()}function ye(e){!function(e){var n,t=e.appkey,o=e.navigators;he?Ee.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,l.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(v))})),me=e,he=I.init((null===(n=e.__runtimeCreator__)||void 0===n?void 0:n.call(e))||fe,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(Ee=he.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Ee.info(R.A_INIT_O,JSON.stringify({appkey:t,navigators:o,version:"5.7.8",commit:"a8c6bdefd42b849d4ba9a105ecf5c00403c17522"})),he.assignWatcher(Re),h.init(Ee))}(e)}function Me(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return he?(Ae(),[2,Te()]):[2]}))}))}function Ue(){return Se((function(e){return e.getConnectionStatus()}))}function Pe(){return Se((function(e){return e.getServerTime()}))}function Le(){return Se((function(e){return e.getCurrentUserId()}))}function we(e,n){d.add(e,n)}function Be(){return Se((function(e){return e.getDeviceId()}))}function De(e,n){return Se((function(t){return t.install(e,n)}))}var be={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:i.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:i.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Ge={};for(var xe in be){var Ve=be[xe].code;Ge[Ve]=xe}function ke(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return m("token",e,l.STRING,!0)&&m("reconnectKickEnable",n,l.BOOLEAN)?(t=r.createTraceId(),r.info(R.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:n}),t),[4,o.connect(e,!!n,t)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===i.SUCCESS?"info":"warn",r[s](R.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),t),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:Ge[a.code]}]}}))}))}))]}))}))}function He(e){return h.info(R.A_DISCONNECT_O,{}),Se((function(n){return n.disconnect(e)}))}function Fe(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options.count",null==e?void 0:e.count,l.NUMBER)&&m("options.startTime",null==e?void 0:e.startTime,l.NUMBER)&&m("options.order",null==e?void 0:e.order,l.NUMBER)&&m("channelId",n,l.CHANNEL_ID)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(r.warn(R.O,"get conversation list fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ze(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return n=s.sent(),r=n.code,a=n.data,r!==i.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}]):[2,{code:r,data:a?ge(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qe(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return n=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(r)),n!==i.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(n,":").concat(Ge[n],",").concat(r)),[2,{code:n,msg:Ge[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,t.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),r=n.code,a=n.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get draft ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a||""}]:(o.warn(R.O,"get draft fail ->".concat(r,":").concat(Ge[r],",").concat(s)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("draft",n,l.STRING,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set draft ->".concat(t)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,n,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(R.O,"set draft fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ke(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r;return D(this,(function(a){switch(a.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"delete draft ->".concat(n)),[4,t.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(r=a.sent())===i.SUCCESS?[2,{code:r}]:(o.warn(R.O,"delete draft fail ->".concat(r,":").concat(Ge[r],",").concat(n)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ye(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("includeMuted",e,l.BOOLEAN,!1)&&m("conversationTypes",n,l.ARRAY,!1)&&!(null==n?void 0:n.some((function(e){return!m("conversationType",e,E)})))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get total unread count -> ConversationType:".concat(JSON.stringify(n)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",n,e)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return!m("conversationTypes",e,l.ARRAY,!0)||!m("levels",n,l.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,E)}))||n.some((function(e){return!m("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function We(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return!m("conversationTypes",e,l.ARRAY,!0)||!m("levels",n,l.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,E)}))||n.some((function(e){return!m("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,n,!0)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function Xe(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,t.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),r=n.code,a=n.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get unreadCount ->".concat(s)),r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"get unreadCount fail ->".concat(r,":").concat(Ge[r],",").concat(s)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qe(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return n=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(r)),n!==i.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(n,":").concat(Ge[n],",").concat(r)),[2,{code:n,msg:Ge[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return[4,n.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}be.ROAMING_SERVICE_UNAVAILABLE.code;var en=function(e,n,t){void 0===t&&(t="");var o="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return e.debug(R.O,"".concat(t," -> ").concat(o)),o},nn=function(e,n,t,o){return void 0===o&&(o=""),B(void 0,void 0,void 0,(function(){var r,a;return D(this,(function(s){switch(s.label){case 0:return r=en(e,n,o),[4,t()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(a," : ").concat(Ge[a]," , ").concat(r)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))};function tn(e,n){return B(this,void 0,void 0,(function(){return D(this,(function(t){return m("notificationLevel",n,(function(e){return void 0!==S[e]}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return nn(o,e,(function(){return t.setConversationNotificationLevel(e.conversationType,e.targetId,n,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,n){return B(this,void 0,void 0,(function(){return D(this,(function(t){return m("notificationStatus",n,(function(e){return 1===e||2===e}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return nn(o,e,(function(){return t.setConversationStatus(e.conversationType,e.targetId,void 0,n,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n=en(o,e,"getConversationNotificationLevel"),[4,t.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS?[2,{code:a,data:s}]:(o.warn(R.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(Ge[a]," , ").concat(n)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,t.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.O,"getConversationNotificationStatus ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getBlockConversationList()}))]}))}))}function cn(e,n){return void 0===n&&(n=!0),B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("isTop",n,l.BOOLEAN)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set conversation status ->".concat(t)),[4,o.setConversationStatus(e.conversationType,e.targetId,n,void 0,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set conversation status fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversationTypes",e,l.ARRAY)&&!(null==e?void 0:e.some((function(e){return!m("conversationType",e,E)})))&&m("channelId",n,l.CHANNEL_ID)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(r.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return!m("conversationTypes",e,l.ARRAY)||(null==e?void 0:e.some((function(e){return!m("conversationType",e,p)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,t.getUnreadConversationList(e)];case 1:return n=a.sent(),o=n.code,r=n.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return ge(e)}))}]:[2,{code:o,msg:Ge[o]}]}}))}))}))]}))}))}function fn(e){return B(this,void 0,void 0,(function(){return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(n,t){return t.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),n.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e,n){return n.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function gn(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getAllConversationState()}))]}))}))}function vn(e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options.targetId",e.targetId,l.STRING,!1)&&m("options.channelType",e.channelType,(function(e){return void 0!==O[e]}),!1)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getUltraGroupList(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(R.O,"get ultragroup ->".concat(r,":").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,n.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(t.warn(R.O,"get block ultragroup ->".concat(o,":").concat(Ge[o])),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Rn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return[4,t.sendUltraGroupTypingStatus(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(Ge[n])),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("msgs",n,l.ARRAY,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return t=e.targetId,a=e.conversationType,s=e.channelId,c=[],n.forEach((function(e){var n=e.sendTime,t=e.messageUId;c.push({sendTime:n,messageUId:t,channelId:s})})),u={targetId:t,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),f=d.code,l=d.data,f===i.SUCCESS){for(v in g={},l)g[v]=l[v]?le(l[v]):void 0;return[2,{code:i.SUCCESS,data:g}]}return r.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(Ge[f])),[2,{code:f,msg:Ge[f]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("expansion",e,l.OBJECT,!0)&&m("message",n,l.OBJECT,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.sentTime,u=n.canIncludeExpansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:t,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"update expansion for ultragroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function En(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("expansion",e,l.ARRAY,!0)&&m("message",n,l.OBJECT,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.sentTime,u=n.canIncludeExpansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:t,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("message",e,l.OBJECT,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return n=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(n,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:r,channelId:u,conversationType:n,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,t.expandUltraMessage(f)];case 1:return(l=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Sn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("content",e,l.OBJECT,!0)&&m("message",n,l.OBJECT,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.senderUserId,u=n.sentTime,d=n.canIncludeExpansion,f=n.channelId,l="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(f,",messageUId:").concat(s),r.debug(R.O,"update ultragroup message expansion ->".concat(l)),g={targetId:a,channelId:f,conversationType:t,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=I.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(r.warn(R.O,"modify ultraGroup message ->".concat(v,":").concat(Ge[v])),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("notificationLevels",n,l.ARRAY)&&!(null==n?void 0:n.some((function(e){return!m("notificationLevel",e,T)})))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return r.debug(R.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(n))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function On(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(n," -> ").concat(r)),[4,t.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:(o.warn(R.O,"".concat(n," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(r)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&m("notificationLevel",n,(function(e){return void 0!==S[e]}),!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return t="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(R.O,"".concat(t," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,n,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(R.O,"".concat(t," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _n(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("notificationLevels",n,l.ARRAY)&&!(null==n?void 0:n.some((function(e){return!m("notificationLevel",e,T)})))?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){var t,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,n)];case 1:return r=u.sent(),a=r.code,s=r.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(n)),i.debug(R.O,"".concat(t," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Cn(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r,a;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,n.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,t.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(t.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]}))}))}function An(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r,a;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,n.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,t.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(t.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(Ge[r])),[2,{code:r,msg:Ge[r]}])}}))}))}))]}))}))}function yn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&m("options.sentTime",e.sentTime,l.NUMBER,!0)&&m("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return n=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:n,channelId:r,sentTime:a,count:s},[4,t.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===i.SUCCESS?[2,{code:d,data:f}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Ge[d])),[2,{code:d,msg:Ge[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("conversation.targetId",e.targetId,l.STRING,!0)&&m("conversation.channelId",e.channelId,l.CHANNEL_ID,!0)?[2,pe((function(t){return B(n,void 0,void 0,(function(){var n,o,r,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n=e.targetId,o=e.channelId,r={targetId:n,channelId:o},[4,t.getUltraGroupFirstUnreadMessageTimestamp(r)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Ge[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Un=function(e){return!!(m("options.key",e.key,l.STRING,!0)&&m("options.value",e.value,l.STRING,!0)&&m("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&m("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING))},Pn=function(e){return e.entries.every((function(e){return m("entry.key",e.key,l.STRING,!0)&&m("entry.value",e.value,l.STRING,!0)}))&&m("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING)&&m("options.isForce",e.isForce,l.BOOLEAN)},Ln=function(e){return m("options.key",e.key,l.STRING,!0)&&m("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING)},wn=function(e){return e.entries.every((function(e){return m("key",e,l.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,l.STRING)};function Bn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",n.count,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return t=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:n.count,joinExist:!1}),t),[4,o.joinChatroom(e,n.count,t)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),t),a!==i.SUCCESS?[2,{code:a,msg:Ge[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",n.count,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return t=r.createTraceId(),r.info(R.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:n.count,joinExist:!0}),t),[4,o.joinExistChatroom(e,n.count,t)];case 1:return a=c.sent(),s=a===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),t),a!==i.SUCCESS?[2,{code:a,msg:Ge[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("targetId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return n=o.createTraceId(),o.info(R.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),n),[4,t.quitChatroom(e)];case 1:return r=s.sent(),a=r===i.SUCCESS?"info":"warn",o[a](R.A_QUIT_CHATROOM_R,JSON.stringify({code:r}),n),r!==i.SUCCESS?[2,{code:r,msg:Ge[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",n.count,l.NUMBER)&&m("options.order",n.order,(function(e){return[0,1,2].includes(e)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),r.debug(R.O,"get chatroom info ->".concat(t)),[4,o.getChatroomInfo(e,n.count,n.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom info fail ->code+:".concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Un(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(t)),[4,o.setChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Pn(n)?n.entries.length>10?[2,be.CHATROOM_KV_STORE_OUT_LIMIT]:[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(t)),[4,o.setChatroomEntries(e,n)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Un(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.debug(R.O,"force set chatroom entry ->".concat(t)),[4,o.forceSetChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force set chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Hn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Ln(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.debug(R.O,"remove chatroom entry->".concat(t)),[4,o.removeChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&wn(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t="id:".concat(e),r.info(R.O,"remove chatroom entry->".concat(t)),(a=w({},n)).entries=n.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[c],",").concat(t)),[2,{code:c,msg:Ge[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Ln(n)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="id:".concat(e),r.info(R.O,"force remove chatroom entry ->".concat(t)),[4,o.forceRemoveChatroomEntry(e,n)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force remove chatroom entry fail ->code+:".concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("key",n,(function(e){return N(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),r.debug(R.O,"get chatroom entry->".concat(t)),[4,o.getChatroomEntry(e,n)];case 1:return a=u.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom entry fail ->code+:".concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("targetId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n="id:".concat(e),o.debug(R.O,"get all chatroom entries->".concat(n)),[4,t.getAllChatroomEntries(e)];case 1:return r=c.sent(),a=r.code,s=r.data,a===i.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(R.O,"get all chatroom entries fail ->code+:".concat(Ge[a],",").concat(n)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zn(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.timestamp",n.timestamp,l.NUMBER)&&m("options.count",n.count,l.NUMBER)&&m("options.count",n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),n}))&&m("options.order",n.order,(function(e){return 0===e||1===e}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t="id:".concat(e),r.debug(R.O,"get chatroom history message->".concat(t)),[4,o.getChatRoomHistoryMessages(e,n.count,n.order,n.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(R.O,"get chatroom history message fail ->code+:".concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("option.chatRoomId",e.chatRoomId,l.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,l.STRING,!0)?[2,pe((function(t){return B(n,void 0,void 0,(function(){var n;return D(this,(function(o){switch(o.label){case 0:return[4,t.bindRTCRoomForChatroom(e)];case 1:return[2,{code:n=o.sent(),msg:Ge[n]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("userId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,t.addToBlacklist(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("userId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,t.removeFromBlacklist(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wn(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return t.info(R.O,"getBlacklist -> "),[4,n.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(t.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Xn(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("userId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getBlacklistStatus -> userId: ".concat(e)),[4,t.getBlacklistStatus(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:0===a}]:(o.warn(R.O,"getBlacklistStatus fail -> code: ".concat(r,", userId: ").concat(e)),[2,{code:r}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Qn=function(e,n,t,o){void 0===t&&(t=!0),void 0===o&&(o=!0),this.messageType=e,this.content=n,this.isPersited=t,this.isCounted=o};function $n(e,n,t){void 0===n&&(n=!0),void 0===t&&(t=!0);return function(o){return new Qn(e,o,n,t)}}var et,nt,ot=$n("RC:ImgMsg"),it=$n("RC:HQVCMsg"),rt=$n("RC:SightMsg"),at=$n("RC:TxtMsg"),st=$n("RC:CombineMsg"),ct=$n("RC:FileMsg"),ut=$n("RC:GIFMsg"),dt=$n("RC:VcMsg"),ft=$n("RC:LBSMsg"),lt=$n("RC:ReferenceMsg"),gt=$n("RC:ImgTextMsg"),vt={qiniu:function(e,n,t,o){Se((function(i){var r=i.getNaviInfoFromCache();if(1===(null==r?void 0:r.type)&&n.chunk_size&&o.size>n.chunk_size){var a=C();a+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=a,Ot(o,n,t)}else pt(e,n,t,o)}))},baidu:function(e,n,t,o){if(o.size>Rt.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var i=n||{};n=n||nt;var r=new XMLHttpRequest,a=Et();if(!i.uploadHost.bos&&!i.bosUploadPath)return;var s=a+It[0][1]+i.bosUploadPath;It.shift();var c=i.bosHeader||{},u={filename:n.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total,!0)});r.onreadystatechange=function(){if(4===r.readyState)if(JSON.parse(r.responseText||"{}").filename=n.uniqueValue,200===r.status){t.onCompleted(u,!0)}else It.length?vt[It[0][0]](e,n,t,o):t.onError("upload fail")},r.open(n.method,s,!0),r.setRequestHeader("authorization",c.bosToken),r.setRequestHeader("x-bce-date",c.bosDate),r.send(o)},aliyun:function(e,n,t,o){if(o.size>Rt.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token"));var r=It[0][1];It.shift(),e=e||et,n=(n=n||{})||nt;var a=new XMLHttpRequest,s=Et(),c="".concat(s+n.ossBucketName,".").concat(r);a.upload&&n.support_options&&(a.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var e=JSON.parse(a.responseText||"{}");e.name=n.uniqueValue,e.filename=n.uploadFileName,e.uploadMethod=_?_.ALI:"",200===a.status?t.onCompleted(e):It.length?vt[It[0][0]](i,n,t,o):t.onError("upload fail")}},a.open(n.method,c,!0),console.log("ali:url",c);var u=n.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",n.uploadFileName),e.delete("file"),e.append("file",o),a.send(e)},s3:function(e,n,t,o){var i=new FormData,r=new XMLHttpRequest,a=Et(),s=n.contentDisposition,c=It[0][1],u="".concat(a+n.s3BucketName,".").concat(c);console.log("uploadS3:url",u),It.shift(),r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var i=JSON.parse(r.responseText||"{}");if(i.name=n.uniqueValue,i.filename=n.uploadFileName,i.uploadMethod=_.AWS,200===r.status||204===r.status)t.onCompleted(i);else if(It.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),vt[It[0][0]](a,n,t,o)}else t.onError("upload fail")}},r.open(n.method,u,!0);var d=n?n.s3Header:{},f=o&&o.type;s?i.set("Content-Disposition","".concat(s,";")):i.set("Content-Disposition","text/html"===f?"inline;":"attachment;");i.set("Content-Type",f),i.set("x-amz-credential",d.s3Credential),i.set("x-amz-algorithm",d.s3Algorithm),i.set("x-amz-date",d.s3Date),i.set("policy",d.s3Policy),i.set("x-amz-signature",d.s3Signature),i.set("key",n.uploadFileName),i.set("file",o),r.send(i)},stc:Nt,minio:Nt},It=[],Rt={BOS_CHUNCK_SIZE:5368709120},ht="http://",mt="https://";function Et(){var e=mt;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=ht),e}var Tt,St=(Tt="RC-upload-",{get:function(e){e=Tt+e;var n=localStorage.getItem(e);if(n)return null!==(n=JSON.parse(n||"{}"))&&n.type&&n.data?n.data:null},set:function(e,n){var t=localStorage;e=Tt+e,n={data:n,type:typeof n,updateTime:Date.now()},t.setItem(e,JSON.stringify(n))},remove:function(e){e=Tt+e,localStorage.removeItem(e)}});function pt(e,n,t,o){var i=mt+n.uploadHost.qiniu,r=(/http/.test(It[0][1])?"":Et())+It[0][1]||i;n.isChunk||It.shift();var a=new XMLHttpRequest;a.upload&&n.support_options&&(a.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)}),a.onreadystatechange=function(){if(4===a.readyState){var i=JSON.parse(a.responseText||"{}");i.filename=n.uniqueValue,i.uploadMethod=_?_.QINIU:"",200===a.status||204===a.status?t.onCompleted(i):It.length?vt[It[0][0]](e,n,t,o):t.onError("upload fail")}},a.open(n.method,r,!0),t.onOpen(a),n.stream&&a.setRequestHeader("authorization","UpToken ".concat(n.multi_parmas.token)),function(e,n){for(var t in e)n(t,e[t])}(n.headers,(function(e,n){a.setRequestHeader(e,n)})),a.send(e)}function Ot(e,n,t,o){var i=0,r=o||C(),a=St.get(r);a&&(e.uniqueName=a.sessionId,i=a.offset);var s=Math.min(n.chunk_size,e.size-i),c=e.slice(i,i+s),u=e.uniqueName;n.multi_parmas.name=u,n.filesize=e.size;var d="bytes=".concat(i,"-").concat(i+s);n.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},n.isChunk=!0,c.name=e.name,c=function(e,n,t){var o=new FormData;for(var i in n.unique_key&&o.append(n.unique_key,t),o.append(n.file_data_name,e,e.name),n.multi_parmas){var r=n.multi_parmas[i];o.append(i,r)}return o}(c,n,e.uniqueName),pt(c,n,{onCompleted:function(o){i+=s;var a=e.uniqueName;St.set(r,{offset:i,sessionId:a}),i<e.size?Ot(e,n,t,r):(i=0,St.remove(r),t.onCompleted(o))},onError:function(e){console.error(e),t.onError(e)},onProgress:function(e,o){var r=e+i;t.onProgress(r,n.filesize)},onOpen:function(e){t.onOpen(e)}},e)}function Nt(e,n,t,o,i){var r=new XMLHttpRequest,a=n.contentDisposition,s=It[0][1],c=i===_.STC?n.stcBucketName:n.minioBucketName,u="https://".concat(s,"/").concat(c,"/").concat(n.uploadFileName);It.shift(),r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)}),r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");if(a.name=n.uniqueValue,a.filename=n.uploadFileName,a.uploadMethod=i,200===r.status||204===r.status)t.onCompleted(a);else if(It.length){var s=new FormData;s.set("file",e.get("file")),s.set("key",e.get("key")),s.set("token",e.get("token")),vt[It[0][0]](s,n,t,o)}else t.onError("upload fail")}},r.open("PUT",u,!0);var d=n.stcHeader.stcAuthorization,f=n.stcHeader.stcContentSha256,l=n.stcHeader.stcDate;i===_.MINIO&&(d=n.minioHeader.minioAuthorization,f=n.minioHeader.minioContentSha256,l=n.minioHeader.minioDate),r.setRequestHeader("Content-Type",o.type),a?r.setRequestHeader("Content-Disposition","".concat(a,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;"),r.setRequestHeader("Authorization",d),r.setRequestHeader("x-amz-content-sha256",f),r.setRequestHeader("x-amz-date",l),r.send(o)}function _t(e,n,t,o,i,r){var a,s,c=n&&n.type||"text/plain",u=c.indexOf("image")>-1?1:4,d=t.contentDisposition,f=Math.ceil(n.size/t.stc_chunk_size),l=i===_.STC?t.stcBucketName:t.minioBucketName,g="uploads";e.getFileToken(u,n.name,"POST",g).then((function(e){a=e.fileName,s="https://".concat(r,"/").concat(l,"/").concat(a),console.log("uploadStcMultipart:url",s);var t=new XMLHttpRequest;t.open("POST","".concat(s,"?").concat(g),!0),d?t.setRequestHeader("Content-Disposition","".concat(d,";")):t.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;");var u=e.stcAuthorization,v=e.stcContentSha256,I=e.stcDate;i===_.MINIO&&(u=e.minioAuthorization,v=e.minioContentSha256,I=e.minioDate),t.setRequestHeader("Authorization",u),t.setRequestHeader("x-amz-content-sha256",v),t.setRequestHeader("x-amz-date",I),t.setRequestHeader("Content-Type",c),t.send(),t.onreadystatechange=function(){if(4===t.readyState){var e=t.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===t.status||204===t.status?function(e){for(var n=[],t=1;t<=f;t++)n.push(h(e,t));R(e,n)}(Array.isArray(e)&&e[1]):o.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));var v=[],I=new Map;function R(t,r){r&&Array.isArray(r)&&0!==r.length&&Promise.all(r).then((function(){var r="uploadId=".concat(t);if(I.size===f)e.getFileToken(u,a,"POST",r).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",t);var u=e.stcAuthorization,d=e.stcContentSha256,f=e.stcDate;i===_.MINIO&&(u=e.minioAuthorization,d=e.minioContentSha256,f=e.minioDate);var l=new XMLHttpRequest;l.open("POST","".concat(s,"?").concat(r),!0),l.setRequestHeader("Authorization",u),l.setRequestHeader("x-amz-content-sha256",d),l.setRequestHeader("x-amz-date",f),l.setRequestHeader("Content-Type",c);var g="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",v=Array.from(I.keys()||[]).sort((function(e,n){return e-n}));console.log("keys",v),v.forEach((function(e){g+="<Part><ETag>".concat(I.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),g+="</CompleteMultipartUpload>",l.send(g),console.log("xml",g),l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status||204===l.status){var e={name:n.name,filename:a,uploadMethod:i};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var d=[],l=0,g=v;l<g.length;l++){var m=g[l];d.push(h(t,m))}R(t,d)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var n=[],i=0,r=v;i<r.length;i++){var a=r[i];n.push(h(t,a))}R(t,n)}))}function h(o,r){return new Promise((function(d,f){var l="partNumber=".concat(r,"&uploadId=").concat(o);e.getFileToken(u,a,"PUT",l).then((function(e){console.log("signature ".concat(r," onSuccess"),e);var o=n&&n.slice((r-1)*t.stc_chunk_size,r*t.stc_chunk_size);console.log("fileChunk:size",o.size);var a=e.stcAuthorization,u=e.stcContentSha256,g=e.stcDate;i===_.MINIO&&(a=e.minioAuthorization,u=e.minioContentSha256,g=e.minioDate);var R=new XMLHttpRequest;R.open("PUT","".concat(s,"?").concat(l),!0),R.setRequestHeader("Authorization",a),R.setRequestHeader("x-amz-content-sha256",u),R.setRequestHeader("x-amz-date",g),R.setRequestHeader("Content-Type",c),R.send(o),R.onreadystatechange=function(){if(4===R.readyState)if(200===R.status||204===R.status){var e=R.getResponseHeader("etag");console.log("etag:".concat(r),e),I.set(r,e),d(e)}else v.includes(r)||v.push(r),f(r)}}),(function(e){console.log("getETags:签名验证失败"),v.includes(r)||v.push(r),f(r)}))}))}}var Ct={form:function(e,n){var t=new FormData;if(n.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),i=At()+o;t.append(n.unique_key,i),n.uniqueValue=i}return t.append(n.file_data_name,e),yt(n.multi_parmas,(function(e,n){t.append(e,n)})),t},json:function(e,n){var t={};if(n.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),i=At()+o;t[n.unique_key]=i,n.uniqueValue=i}return t[n.file_data_name]=e,yt(n.multi_parmas,(function(e,n){t[e]=n})),JSON.stringify(t)},data:function(e,n){return e}};function At(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(n){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===n?t:3&t|8).toString(16)}))}function yt(e,n){for(var t in e)n(t,e[t])}var Mt,Ut=0,Pt=function(){function e(e){this.options=function(e){var n={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:Ct.form,genUId:At};if(!e||!e.domain)throw new Error("domain is null");for(var t in e)n[t]=e[t];return n}(e)}return e.prototype.setOptions=function(e){var n=this;yt(e,(function(e,t){n.options[e]=t}))},e.prototype.upload=function(e,n,t,o){if(t){var i=this;!function(e,n,t,o,i){et=t,nt=o,It=[];var r,a,s=e.getNaviInfoFromCache();if(1===(null==s?void 0:s.type)&&n.uploadDomain&&!o.ossConfig)It=[["qiniu",n.uploadDomain]];else if(o.ossConfig){var c,u,d,f=JSON.parse(o.ossConfig),l="",g=[];f.forEach((function(e){var n=Number(e.p)-1;for(var t in e)"aliyun"===t&&(l=e[t]),"s3"===t&&(c=e[t]),"stc"===t&&(u=e[t]),"minio"===t&&(d=e[t]),"p"!==t&&(g[n]=[t,e[t]])})),g.forEach((function(e){e&&It.push(e)})),f.length!==It.length&&(It=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",l],["s3",c],["stc",u],["minio",d]])}else It=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var v=o&&JSON.parse(o.ossConfig);Array.isArray(v)||(v=[]),r=v.find((function(e){return Object.keys(e).includes("stc")})),a=v.find((function(e){return Object.keys(e).includes("minio")}))}if(r&&1===parseInt(r.p,10)&&t.size>=4194304)_t(e,t,o,i,_.STC,r.stc);else if(a&&1===parseInt(a.p,10)&&t.size>=4194304)_t(e,t,o,i,_.MINIO,a.minio);else{var I=o.data(t,o);vt[It[0][0]](I,o,i,t,_.MINIO)}}(e,n,t,this.options,{onProgress:function(e,n,t){(Mt=e,t)?Mt=Ut+e/n*(n-Ut):Ut=Mt;o.onProgress(Mt,n)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){i.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var Lt,wt,Bt={init:function(e){return new Pt(e)},dataType:Ct,resize:function(e,n,t){var o=document.createElement("canvas"),i=new FileReader;i.readAsDataURL(e),i.onload=function(e){var i=e.target.result,r=new Image;r.src=i;var a=r.width,s=r.height,c=function(e,n){var t=1,o=e.width,i=n.maxWidth||0;i>0&&o>i&&(t=i/o);var r=e.height,a=n.maxHeight||0;if(a>0&&r>a){var s=a/r;t=Math.min(t,s)}var c=n.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;t=Math.min(t,d)}return t}({width:a,height:s,size:e.total},n),u=i;c<1&&(u=function(e,n,t){o.width=n,o.height=t;var i=o.getContext("2d");return i.drawImage(e,0,0,n,t),o.toDataURL("image/jpg")}(r,a*c,s*c)),t(u)}},Upload:Pt},Dt=function(e,n,t){var o=document.createElement("canvas"),i=o.getContext("2d"),r=new Image,a="string"==typeof e;r.onload=function(a){var s=function(e,n,t){var o,i,r,a=e<n,s=0,c=0;return(a?n/e:e/n)>t.scale?(a?(i=100,c=((r=n/(o=e/100))-t.maxHeight)/2):(r=100,s=((i=e/(o=n/100))-t.maxWidth)/2),{w:i,h:r,x:-s,y:-c}):(a?(o=n/t.maxHeight,r=t.maxHeight,i=e/o):(o=e/t.maxWidth,i=t.maxWidth,r=n/o),{w:i,h:r,x:-s,y:-c})}(r.width,r.height,n);o.width=s.w>n.maxWidth?n.maxWidth:s.w,o.height=s.h>n.maxHeight?n.maxHeight:s.h,i.drawImage(r,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,n.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),t(c)},r.src=a?"data:image/jpg;base64,".concat(e):function(e){var n=window.URL||window.webkitURL;return n?n.createObjectURL(e):""}(e)},bt=function(e,n){var t=e.file,o=e.compress;Dt(t,o,n)},Gt=function(e,n){if(e.getToken)e.getToken((function(t,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=t,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(t));var i=Bt.init(e);n(i)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var t=Bt.init(e);n(t)}},xt=function(e,n,t,o,i){o.upload(e,n,t.file,{onError:function(e){i.onError(e)},onProgress:function(e,n){i.onProgress(e,n)},onCompleted:function(e){e.filename=e.filename||e.hash;var n=t.compressThumbnail||bt;t.compress?n(t,(function(n){e.thumbnail=n,i.onCompleted(e)})):i.onCompleted(e)}})},Vt=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,n,t,o){xt(e,n,{file:t},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),kt=function(){function e(e,n){this.instance=e,this.cfg=n}return e.prototype.upload=function(e,n,t,o){var i={file:t,compress:this.cfg};xt(e,n,i,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Ht={initFile:function(e,n){Gt(e,(function(e){var t=new Vt(e);n(t)}))},initImage:function(e,n){Gt(e,(function(t){var o,i,r,a,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.maxWidth)||160,quality:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new kt(t,s);n(c)}))},dataType:Bt.dataType};function Ft(e,n,t,o,i,r,a){var s=this;void 0===a&&(a=y.FILE);var c=y.FILE;a===y.IMAGE&&(c=y.IMAGE);var u=e.getNaviInfoFromCache();if(!wt&&(wt="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(wt=d.qiniu)}catch(e){}var f=w({domain:wt,getToken:function(n){e.getFileToken(c,o.name).then((function(e){n(e.token,e)})).catch((function(e){i.onFail(e)}))}},r),l=Ht.initFile;c===y.IMAGE&&(l=Ht.initImage),l(f,(function(n){n.upload(e,t,o,{onProgress:function(e,n){var t,o=Math.floor(e/n*100);null===(t=i.onProgress)||void 0===t||t.call(i,o)},onCompleted:function(e){return B(s,void 0,void 0,(function(){return D(this,(function(n){return 1!==(null==u?void 0:u.type)||(null==u?void 0:u.ossConfig)?(function(e,n,t,o,i){zt(n,o.filename,o.name,o,o.uploadMethod).then((function(r){if(0===r.code){var a=r.data;a.type=t.type,a.name=o.name||o.filename,e!==y.AUDIO?(n===y.IMAGE&&(a.thumbnail=o.thumbnail,a.width=o.w,a.height=o.h,a.size=o.size),i.onSuccess(a)):Zt(t).then((function(e){i.onSuccess(w(w({},a),e))}))}else i.onFail(r)})).catch((function(e){i.onFail(e)}))}(a,c,o,e,i),[2]):(function(e,n,t,o,i,r){var a={type:o.type,name:i.rc_url.file_name,downloadUrl:e.uploadDomain+i.rc_url.path};if(n===y.AUDIO)return void Zt(o).then((function(e){r.onSuccess(w(w({},a),e))}));n===y.IMAGE&&(a.thumbnail=i.thumbnail,a.width=i.w,a.height=i.h,a.size=i.size);r.onSuccess(a)}(t,a,0,o,e,i),[2])}))}))},onError:function(e){i.onFail(e)}})}))}function Zt(e){return new Promise((function(n){if("function"!=typeof e.arrayBuffer){var t=new FileReader;t.onload=function(){t.result?qt(t.result).then((function(e){n(e)}),(function(){n({})})):n({})},t.onerror=function(){n({duration:0})},t.readAsArrayBuffer(e)}else e.arrayBuffer().then(qt).then((function(e){n(e)}))}))}function qt(e){return Lt=Lt||new AudioContext,new Promise((function(n,t){Lt.decodeAudioData(e,(function(e){n({duration:e.duration,length:e.length})}),t)}))}function Jt(e,n,t,o){return pe((function(r){return new Promise((function(a){r.getFileToken(e,n,t,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:Ge[e]})}))}))}))}function zt(e,n,t,o,r){return m("fileType",e,A,!0)&&m("filename",n,l.STRING)&&m("saveName",t,l.STRING)&&m("serverType",r,l.NUMBER)?pe((function(a){return new Promise((function(s){a.getFileUrl(e,n,t,o,r).then((function(e){s({code:i.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER})}function Kt(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(s){return[2,pe((function(s,c){return B(o,void 0,void 0,(function(){var o,u,d,f,g,v,I,h,E,T,S,p;return D(this,(function(O){switch(O.label){case 0:return t=t||{},n instanceof Qn==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,be.ILLGAL_PARAMS]):m("conversation",e,l.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,m("conversation.targetId",u,l.STRING,!0)&&m("conversation.conversationType",o,l.NUMBER,!0)&&m("conversation.channelId",d,l.CHANNEL_ID)&&m("options.isStatusMessage",null==t?void 0:t.isStatusMessage,l.BOOLEAN)&&m("options.disableNotification",null==t?void 0:t.disableNotification,l.BOOLEAN)&&m("options.pushContent",null==t?void 0:t.pushContent,l.STRING)&&m("options.pushData",null==t?void 0:t.pushData,l.STRING)&&m("options.isMentioned",null==t?void 0:t.isMentioned,l.BOOLEAN)&&m("options.mentionedType",null==t?void 0:t.mentionedType,l.NUMBER)&&m("options.mentionedUserIdList",null==t?void 0:t.mentionedUserIdList,l.ARRAY)&&m("options.directionalUserIdList",null==t?void 0:t.directionalUserIdList,l.ARRAY)&&m("options.isVoipPush",null==t?void 0:t.isVoipPush,l.BOOLEAN)&&m("options.canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,l.BOOLEAN)&&m("options.expansion",null==t?void 0:t.expansion,l.OBJECT)&&m("options.pushConfig",null==t?void 0:t.pushConfig,l.OBJECT)&&m("options.messageId",null==t?void 0:t.messageId,l.NUMBER)?(f="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(f)),g=function(e,n,t){var o=e.isStatusMessage,i=e.disableNotification,r=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,R=e.messageId,h=t.channelId;return w({isStatusMessage:o,disableNotification:i,pushContent:r,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:h||"",messageId:R},n)}(t,n,e),v={isMentioned:!!t.isMentioned,content:n.content,messageType:n.messageType,isPersited:!!n.isPersited,isCounted:!!n.isCounted,disableNotification:!!(null==t?void 0:t.disableNotification),canIncludeExpansion:!!(null==t?void 0:t.canIncludeExpansion),expansion:(null==t?void 0:t.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:s.getCurrentUserId(),messageUId:"",messageDirection:U.SEND,receivedTime:0,isStatusMessage:!!t.isStatusMessage,receivedStatus:r.UNREAD,isOffLineMessage:!1,pushConfig:null==t?void 0:t.pushConfig,sentStatus:P.SENDING},o!==a.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){v.messageId=e;try{(null==t?void 0:t.onSendBefore)&&t.onSendBefore(le(v))}catch(e){c.error(R.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(R.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,s.sendMessage(o,u,g,h,I)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),T=E.code,S=E.data,T===i.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:T,messageUId:S.messageUId,messageId:S.messageId}),I),p=le(S),[2,{code:T,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(T,":").concat(Ge[T],",").concat(f)),v.sentTime=(null==S?void 0:S.sentTime)||0,v.sentStatus=null==S?void 0:S.sentStatus,[2,{code:T,msg:Ge[T],data:le(v)}])}}))}))}))]}))}))}function Yt(e,n,t){return Kt(e,new at(n),t)}function jt(e,n){return function(t,o,r,a){if(!m("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(m("sendOptions.maxHeight",null==c?void 0:c.maxHeight,l.NUMBER)&&m("sendOptions.maxWidth",null==c?void 0:c.maxWidth,l.NUMBER)&&m("sendOptions.quality",null==c?void 0:c.quality,l.NUMBER)&&m("sendOptions.scale",null==c?void 0:c.scale,l.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return pe((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Ft(c,0,d,o.file,{onProgress:null==r?void 0:r.onProgress,onSuccess:function(e){var s,c=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,w({url:e.downloadUrl},e)))||n(e,o);e&&e.downloadUrl&&u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:i.SUCCESS}),l),Kt(t,c,a).then(f)},onFail:function(e){u.warn(R.L_MEDIA_UPLOAD_R,JSON.stringify({code:i.UPLOAD_FILE_FAILED}),l),f({code:i.UPLOAD_FILE_FAILED,msg:e||i[i.UPLOAD_FILE_FAILED]})}},s,e)}))}))}}var Wt=jt(y.FILE,(function(e,n){return new ct({name:e.name,size:n.file.size,type:(t=e.name,o=t.match(/\.(\w+)$/),o?o[1]:"bin"),fileUrl:e.downloadUrl,user:n.user,extra:n.extra});var t,o})),Xt=jt(y.IMAGE,(function(e,n){return new ot({content:e.thumbnail,imageUri:e.downloadUrl,user:n.user,extra:n.extra})})),Qt=jt(y.IMAGE,(function(e,n){return new ut({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:n.user,extra:n.extra})})),$t=jt(y.AUDIO,(function(e,n){return new it({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:n.user,extra:n.extra})})),eo=jt(y.SIGHT,(function(e,n){return new rt({sightUrl:e.downloadUrl,content:n.thumbnail,duration:n.duration,size:n.file.size||e.size,name:n.name||e.name,user:n.user,extra:n.extra})}));function no(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options.timestamp",null==n?void 0:n.timestamp,l.NUMBER)&&m("options.count",null==n?void 0:n.count,l.NUMBER)&&(M()||m("options.count",null==n?void 0:n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),n})))&&m("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t=r.createTraceId(),r.info(R.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count}),t),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==n?void 0:n.timestamp,null==n?void 0:n.count,null==n?void 0:n.order,null==e?void 0:e.channelId,"",t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),r.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),t),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),t),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("options.timestamp",null==n?void 0:n.timestamp,l.NUMBER)&&m("options.count",null==n?void 0:n.count,l.NUMBER)&&m("options.count",null==n?void 0:n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error("options.count is invalid, It should be greater than 0 and less than 100"),n}))&&m("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"get history message ->".concat(t)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==n?void 0:n.timestamp)||0,(null==n?void 0:n.count)||20,(null==n?void 0:n.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===i.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.O,"get history message fail ->".concat(s,":").concat(Ge[s],",").concat(t)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(s){return m("targetId",e,l.STRING,!0)&&m("messageUId",n,l.STRING,!0)&&m("timestamp",t,l.NUMBER,!0)&&m("channelId",o,l.CHANNEL_ID)?[2,pe((function(i){return B(r,void 0,void 0,(function(){var i,r,s,c,u;return D(this,(function(d){switch(d.label){case 0:return i={targetId:e,conversationType:a.PRIVATE,channelId:o},r=new Qn("RC:ReadNtf",{messageUId:n,lastMessageSendTime:t,type:1}),[4,Kt(i,r)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function io(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("messageUId",n,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",t,l.CHANNEL_ID)?[2,pe((function(i,r){return B(o,void 0,void 0,(function(){var o,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(n,",targetId:").concat(e),r.debug(R.O,"send read receipt message ->".concat(o)),i=new Qn("RC:RRReqMsg",{messageUId:n}),[4,Kt({targetId:e,conversationType:a.GROUP,channelId:t},i)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ro(e,n,t){return B(this,void 0,void 0,(function(){return D(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function ao(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("targetId",e,l.STRING,!0)&&m("messageList",n,l.OBJECT,!0)&&m("channelId",t,l.CHANNEL_ID)&&!Object.keys(n).some((function(e){return!m(e,n[e],l.ARRAY)}))?[2,pe((function(r,s){return B(o,void 0,void 0,(function(){var o,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:a.GROUP,channelId:t},u=r.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(n).forEach((function(e){n[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,r.sendReadReceiptMessage(e,d,t)]:(s.warn(R.O,"Error in parameter messageList."),[2,{code:i.PARAMETER_ERROR}]));case 1:return c=g.sent(),[3,4];case 2:return f=new Qn("RC:RRRspMsg",{receiptMessageDic:n}),[4,Kt(o,f)];case 3:c=g.sent(),g.label=4;case 4:return(l=c.code)===i.SUCCESS?[2,{code:l}]:(s.warn(R.O,"send read receipt message fail ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function so(e,n){return B(this,void 0,void 0,(function(){var t,o,r,a;return D(this,(function(s){switch(s.label){case 0:return m("conversation",e,l.CONVERSATION,!0)&&m("lastMessageSendTime",n,l.NUMBER,!0)?(t=new Qn("RC:SRSMsg",{lastMessageSendTime:n}),[4,Kt(e,t)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),r=o.code,a=o.msg,0===r?[2,{code:r}]:[2,{code:r,msg:a}]}}))}))}function co(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("options.messageUId",n.messageUId,l.STRING,!0)&&m("options.sentTime",n.sentTime,l.NUMBER,!0)&&m("options.disableNotification",null==n?void 0:n.disableNotification,l.BOOLEAN)&&m("options.pushConfig",null==n?void 0:n.pushConfig,l.OBJECT)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return t={user:n.user,channelId:e.channelId||"",disableNotification:null==n?void 0:n.disableNotification,pushConfig:null==n?void 0:n.pushConfig,extra:n.extra,isDelete:n.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(n.messageUId),r.debug(R.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,n.messageUId,n.sentTime,t)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS&&u?[2,{code:c,data:le(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"recall message fail ->".concat(c,":").concat(Ge[c],",").concat(a)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function uo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("options",n,(function(e){return g(e)&&e.length}),!0)&&!n.some((function(e){return!m("options.messageUId",e.messageUId,l.STRING,!0)||!m("options.sentTime",e.sentTime,l.NUMBER,!0)||!m("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"delete messages ->".concat(t)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,n,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"delete message fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",n,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(s){switch(s.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"clear message ->".concat(t)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,n,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"clear message ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("expansion",e,l.OBJECT,!0)&&m("message",n,l.OBJECT,!0)&&m("message.conversationType",n.conversationType,l.NUMBER,!0)&&m("message.targetId",n.targetId,l.STRING,!0)&&m("message.channelId",n.channelId,l.CHANNEL_ID)&&m("message.messageUId",n.messageUId,l.STRING,!0)&&m("message.expansion",n.expansion,l.OBJECT)&&m("message.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.canIncludeExpansion,u=n.expansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:t,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==i.SUCCESS?(r.warn(R.O,"update message expansion fail ->".concat(l,":").concat(Ge[l],",").concat(f)),[2,{code:l,msg:Ge[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("keys",e,l.ARRAY,!0)&&m("message",n,l.OBJECT,!0)&&m("message.conversationType",n.conversationType,l.NUMBER,!0)&&m("message.targetId",n.targetId,l.STRING,!0)&&m("message.channelId",n.channelId,l.CHANNEL_ID)&&m("message.messageUId",n.messageUId,l.STRING,!0)&&m("message.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return t=n.conversationType,a=n.targetId,s=n.messageUId,c=n.canIncludeExpansion,u=n.channelId,d="conversationType:".concat(t,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:t,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==i.SUCCESS?(r.warn(R.O,"remove message expansion fail ->".concat(f,":").concat(Ge[f],",").concat(d)),[2,{code:f,msg:Ge[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("typingContentType",n,l.STRING,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d;return D(this,(function(f){switch(f.label){case 0:return t={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:e.channelId},a=r.createTraceId(),r.info(R.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,t,void 0,a)];case 1:return s=f.sent(),c=s.code,u=s.data,d=c===i.SUCCESS?"info":"warn",r[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===i.SUCCESS?[2,{code:c,data:le(u)}]:[2,{code:c,msg:Ge[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("messageUId",n,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",t,l.CHANNEL_ID)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(n,",targetId:").concat(e),a.debug(R.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,n,t)];case 1:return s=d.sent(),c=s.code,u=s.data,c===i.SUCCESS?[2,{code:c,data:u}]:(a.warn(R.O,"get message reader fail ->".concat(c,":").concat(Ge[c],",").concat(o)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,n,t,o,i){return Se((function(r,a){return f("messageType",e,l.STRING,!0),f("isPersited",n,l.BOOLEAN,!0),f("isCounted",t,l.BOOLEAN,!0),f("isStatusMessage",i,l.BOOLEAN,!1),f("searchProps",o,l.ARRAY),a.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:t,isStatusMessage:i,isPersited:n})),r.registerMessageType(e,n,t,o,i),$n(e,n,t)}))}function ho(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,t.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),r=n.code,a=n.data,r===i.SUCCESS?(s=a&&le(a)||null,[2,{code:r,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function mo(e,n,t){return void 0===t&&(t={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return ve("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",n,l.OBJECT,!0)&&m("options",t,l.OBJECT)&&m("options.isUnread",null==t?void 0:t.isUnread,l.BOOLEAN)&&m("options.searchContent",null==t?void 0:t.searchContent,l.STRING)&&m("content.senderUserId",n.senderUserId,l.STRING,!0)&&m("content.messageType",n.messageType,l.STRING,!0)&&m("content.content",n.content,l.OBJECT,!0)&&m("content.messageDirection",n.messageDirection,l.NUMBER,!0)&&m("content.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN)&&m("content.expansion",n.expansion,l.OBJECT)&&m("content.disableNotification",n.disableNotification,l.BOOLEAN)&&m("content.sentTime",n.sentTime,l.NUMBER)&&m("content.sentStatus",n.sentStatus,l.NUMBER)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,m,E,T,S,p;return D(this,(function(O){switch(O.label){case 0:return o=n.senderUserId,s=n.messageType,c=n.content,u=n.messageDirection,d=n.messageUId,f=n.canIncludeExpansion,l=n.expansion,g=n.disableNotification,v=n.sentTime,I=n.sentStatus,a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=t.isUnread,m=t.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:I,searchContent:m,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return T=O.sent(),S=T.code,p=T.data,S===i.SUCCESS?[2,{code:S,data:le(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:Ge[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Eo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("messageId",e,(function(e){return s(e)||N(e)}),!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getMessage(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:le(a)}]:(o.warn(R.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function To(e){if(!M())return{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]};var n,t=e.conversationType,o=e.targetId,r=e.channelId;return m("conversation",e,l.CONVERSATION,!0)?(n=function(e){var n=e.getUnreadMentionedMessages(t,o,r),a=[];return n&&n.length&&n.forEach((function(e){return a.push(le(e))})),{code:i.SUCCESS,data:a}},he?n(he,Ee,me):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function So(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return ve("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",n,l.STRING,!0)&&m("timestamp",t,l.NUMBER)&&m("count",o,l.NUMBER)?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d;return D(this,(function(f){switch(f.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,n,t,o,1,e.channelId)];case 1:return r=f.sent(),c=r.code,u=r.data,c===i.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(le(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function po(e,n,t){return B(this,void 0,void 0,(function(){var o,r,a,s=this;return D(this,(function(c){return ve("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),M()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",r,l.STRING,!0)&&m("timestamp",n,l.NUMBER,!0)&&m("cleanSpace",t,l.BOOLEAN)?[2,pe((function(c,u){return B(s,void 0,void 0,(function(){var s;return D(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,n,t,a)];case 1:return s=d.sent(),u.debug(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:r,channelId:a,timestamp:n})),s===i.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Oo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return ve("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),M()?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n=e.conversationType,r=e.targetId,a=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(n)),[4,t.clearMessages(n,r,a)];case 1:return(s=c.sent())===i.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(r)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function No(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return ve("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),M()?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u;return D(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,t,o,n)];case 1:return r=d.sent(),c=r.code,u=r.data,c===i.SUCCESS?[2,{code:c,data:u}]:(s.warn(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function _o(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",n,l.NUMBER)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t=e.conversationType,a=e.targetId,s=e.channelId,r.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(t)),[4,o.clearUnreadCountByTimestamp(t,a,n,s)];case 1:return(c=u.sent())===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Co(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return ve("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",n,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(n)),[4,o.setMessageReceivedStatus(e,n)];case 1:return(t=a.sent())===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}function Ao(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("tag.tagId",e.tagId,l.STRING,!0)&&m("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&m("tag.tagName",e.tagName,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,t.createTag(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"createTag ->code:".concat(n,",tagId:").concat(e.tagId)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("tagId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,t.removeTag(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"removeTag ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("tag.tagId",e.tagId,l.STRING,!0)&&m("tag.tagName",e.tagName,l.STRING,!0)&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,t.updateTag(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"updateTag ->code:".concat(n,",tagId:").concat(e.tagId)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,n.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,t.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:i.SUCCESS,data:r}]}}))}))}))]}))}))}function Po(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return m("conversation",e,l.CONVERSATION,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,t.getTagsForConversation(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:Ge[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",n,l.ARRAY,!0)&&!n.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"addTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",n,l.ARRAY,!0)&&!n.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("tagIds",n,l.ARRAY,!0)&&!n.some((function(e){return!m("tagId",e,l.STRING,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagsForConversation ->tagIds:".concat(n,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"removeTagsForConversation ->code:".concat(t,",tagIds:").concat(n)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Do(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",n,l.ARRAY,!0)&&!n.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,n)];case 1:return(t=a.sent().code)===i.SUCCESS?[2,{code:t}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bo(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("tagId",e,l.STRING,!0)&&m("count",n,l.NUMBER,!0)&&m("startTime",t,l.NUMBER,!0)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c;return D(this,(function(u){switch(u.label){case 0:return a.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,t,n)];case 1:return o=u.sent(),s=o.code,c=o.data,s===i.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return w(w({},ge(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Go(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("containMuted",n,l.BOOLEAN,!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){var t,r,a;return D(this,(function(s){switch(s.label){case 0:return i.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,n)];case 1:return t=s.sent(),r=t.code,a=t.data,[2,{code:r,data:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xo(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return m("tagId",e,l.STRING,!0)&&m("conversation",n,l.CONVERSATION,!0)&&m("status.isTop",t,l.BOOLEAN,!0)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o;return D(this,(function(s){switch(s.label){case 0:return a.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(n.targetId,",conversationType").concat(n.conversationType)),[4,r.setConversationStatusInTag(e,n,{isTop:t})];case 1:return(o=s.sent().code)===i.SUCCESS?[2,{code:o}]:(a.warn(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Ge[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}jt(y.COMBINE_HTML,(function(e,n){return new st({remoteUrl:e.downloadUrl,nameList:n.nameList,summaryList:n.summaryList,conversationType:n.conversationType,user:n.user,extra:n.extra})}));var Vo={COMET:"comet",WEBSOCKET:"websocket"},ko={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"};var Ho=Object.freeze({__proto__:null,getAllConversationList:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("channelId",e,l.CHANNEL_ID)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a,s;return D(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),L(e)?[4,t.getConversationListWithAllChannel()]:[3,2];case 1:return n=c.sent(),[3,4];case 2:return[4,t.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:n=c.sent(),c.label=4;case 4:return r=n.code,a=n.data,r===i.SUCCESS&&a?(s=a.map((function(e){return ge(e)})),[2,{code:r,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,n,t){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return M()?m("startTime",e,l.NUMBER,!0)&&m("count",n,l.NUMBER,!0)&&m("channelId",t,l.CHANNEL_ID)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(n,", channelId: ").concat(t),a.info(R.O,"getConversationList -> ".concat(o)),L(t)?[4,r.getConversationListWithAllChannelByPage(e,n)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,r.getConversationsByPage(c,e,n,t)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===i.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return M()?m("keyword",n,l.STRING,!0)&&m("messageTypes",t,l.ARRAY,!0)&&m("channelId",o,l.CHANNEL_ID)&&!t.some((function(e){return!m("messageType",e,l.STRING,!0)}))?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return r="keyword: ".concat(n,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(o),s.info(R.O,"searchConversationByContent -> ".concat(e)),L(o)?[4,a.searchConversationByContentWithAllChannel(n,t)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,a.searchConversationByContent(n,t,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===i.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(s.warn(R.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(r)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchMessages:function(e,n,t,o){return B(this,void 0,void 0,(function(){var r=this;return D(this,(function(a){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",n,l.STRING,!0)&&m("startTime",t,l.NUMBER,!0)&&m("count",o,l.NUMBER,!0)?[2,pe((function(a,s){return B(r,void 0,void 0,(function(){var r,c,u,d,f,l,g,v,I,h;return D(this,(function(m){switch(m.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(n,", timestamp: ").concat(t,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(r)),c=e.targetId,u=e.conversationType,d=e.channelId,L(d)?[4,a.searchMessageByContentWithAllChannel(u,c,n,t,o)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,n,t,o,0,d)];case 3:f=m.sent(),m.label=4;case 4:return l=f.code,g=f.data,l===i.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return le(e)})),[2,{code:l,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(l," ").concat(r)),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("option",n,l.OBJECT,!0)&&m("option.keyword",n.keyword,l.STRING,!0)&&m("option.startTime",n.startTime,l.NUMBER,!0)&&m("option.endTime",n.endTime,l.NUMBER,!0)&&m("option.offset",n.offset,l.NUMBER)&&m("option.limit",n.limit,l.NUMBER)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v,I;return D(this,(function(h){switch(h.label){case 0:return t="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(n)),r.info(R.O,"searchMessageInTimeRange -> ".concat(t)),a=e.conversationType,s=e.targetId,c=n.keyword,u=n.startTime,d=n.endTime,f=n.offset,l=n.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,f,l)];case 1:return g=h.sent(),v=g.code,I=g.data,v===i.SUCCESS&&I?[2,{code:v,data:{messages:I.messages.map((function(e){return le(e)}))}}]:(r.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(t)),[2,{code:v}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("option",n,l.OBJECT,!0)&&m("option.count",n.count,l.NUMBER)&&m("options.count",n.count,(function(e){var n=e>0&&e<=100;return n||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),n}))&&m("option.timestamp",n.timestamp,l.NUMBER)&&m("option.order",n.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",n.messageTypes,l.ARRAY,!0)&&!n.messageTypes.some((function(e){return!m("option.messageType",e,l.STRING,!0)}))?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s,c,u,d,f,l,g,v,I,h,m,E,T;return D(this,(function(S){switch(S.label){case 0:return t=n.count,a=n.timestamp,s=n.order,c=n.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(n)),r.info(R.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,t||(t=20),a||(a=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,a,t,c,s,l)];case 1:return g=S.sent(),v=g.code,I=g.data,v===i.SUCCESS?(m=(h=I).list,E=h.hasMore,T=m.map((function(e){return le(e)})),[2,{code:v,data:{messages:T,hasMore:E,list:T}}]):(r.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",n,l.NUMBER,!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){var t,r,a,s;return D(this,(function(c){switch(c.label){case 0:return t="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(n),i.info(R.O,"updateSentMsgReceiptStatus -> ".concat(t)),r=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(r,a,n,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",n,(function(e){return!L(r[e])}),!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return i.info(R.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(n)),[4,o.setMessageReceivedStatus(e,n)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("messageId",e,l.NUMBER,!0)&&m("sentStatus",n,(function(e){return!L(P[e])}),!0)?[2,pe((function(o,i){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return i.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(n)),[4,o.setMessageSentStatus(e,n)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,n,t){return void 0===t&&(t=""),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return M()?m("messageId",e,l.NUMBER,!0)&&m("content",n,l.OBJECT,!0)&&m("messageType",t,l.ONLY_STRING,!0)?[2,pe((function(i,r){return B(o,void 0,void 0,(function(){return D(this,(function(o){switch(o.label){case 0:return r.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(t)),[4,i.setMessageContent(e,n,t)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?!m("messageIds",e,l.ARRAY,!0)||e.some((function(e){return!m("messageId",e,l.NUMBER,!0)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(t,o){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,t.deleteMessages(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,i,r;return D(this,(function(a){switch(a.label){case 0:return n=e.conversationType,i=e.targetId,r=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(n)),[4,t.clearMessages(n,i,r)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,n,t){return B(this,void 0,void 0,(function(){var o,r,a,s=this;return D(this,(function(c){return M()?(o=e.conversationType,r=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",r,l.STRING,!0)&&m("timestamp",n,l.NUMBER,!0)&&m("cleanSpace",t,l.BOOLEAN)?[2,pe((function(e,i){return B(s,void 0,void 0,(function(){return D(this,(function(i){switch(i.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,n,t,a)];case 1:return[2,{code:i.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},insertMessage:function(e,n,t){return void 0===t&&(t={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(r){return console.log(M()),M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",n,l.OBJECT,!0)&&m("options",t,l.OBJECT)&&m("options.isUnread",null==t?void 0:t.isUnread,l.BOOLEAN)&&m("options.searchContent",null==t?void 0:t.searchContent,l.STRING)&&(n instanceof Qn||m("message.senderUserId",n.senderUserId,l.STRING,!0)&&m("message.messageType",n.messageType,l.STRING,!0)&&m("message.content",n.content,l.OBJECT,!0)&&m("message.messageDirection",n.messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",n.canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",n.expansion,l.OBJECT)&&m("message.disableNotification",n.disableNotification,l.BOOLEAN)&&m("message.sentTime",n.sentTime,l.NUMBER)&&m("message.sentStatus",n.sentStatus,l.NUMBER))?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,m,E,T,S;return D(this,(function(p){switch(p.label){case 0:return o="",s=1,f=!1,g=n.messageType,v=n.content,n instanceof Qn||(o=n.senderUserId,s=n.messageDirection,f=n.canIncludeExpansion,l=n.expansion,d=n.disableNotification,c=n.sentTime,u=n.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=t.isUnread,h=t.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=p.sent(),T=E.code,S=E.data,T===i.SUCCESS?[2,{code:T,data:le(S)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:Ge[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,n){var t,o;return B(this,void 0,void 0,(function(){var r,s=this;return D(this,(function(c){if(!M())return[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}];if(!m("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!m("checkDuplicate",n,l.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(m("message",e[r],l.OBJECT,!0)&&m("message.conversationType",e[r].conversationType,(function(e){return[a.PRIVATE,a.DISCUSSION,a.GROUP,a.CUSTOMER_SERVICE,a.SYSTEM,a.APP_PUBLIC_SERVICE,a.PUBLIC_SERVICE].includes(e)}),!0)&&m("message.targetId",e[r].targetId,l.STRING,!0)&&m("message.senderUserId",e[r].senderUserId,l.STRING,!0)&&m("message.messageType",e[r].messageType,l.STRING,!0)&&m("message.content",e[r].content,l.OBJECT,!0)&&m("message.messageDirection",e[r].messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",e[r].canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",e[r].expansion,l.OBJECT)&&m("message.disableNotification",e[r].disableNotification,l.BOOLEAN)&&m("message.sentTime",e[r].sentTime,l.NUMBER)&&m("message.sentStatus",e[r].sentStatus,l.NUMBER)&&m("options.isUnread",null===(t=e[r])||void 0===t?void 0:t.isUnread,l.BOOLEAN)&&m("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,l.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,pe((function(t){return B(s,void 0,void 0,(function(){var o,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.batchInsertMessage(e,n)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:Ge[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?[2,pe((function(t){return B(n,void 0,void 0,(function(){var n,o,i,r,a,s;return D(this,(function(c){switch(c.label){case 0:return n=e.conversationType,o=e.targetId,i=e.channelId,[4,t.getMessageCount(n,o,i)];case 1:return r=c.sent(),a=r.code,s=r.data,[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("messageUId",e,l.STRING,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n,r,a;return D(this,(function(s){switch(s.label){case 0:return[4,t.getPrivateMessageDeliverTime(e)];case 1:return n=s.sent(),r=n.code,a=n.data,r===i.SUCCESS?[2,{code:r,data:a}]:(o.warn(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(r,",messageUId:").concat(e)),[2,{code:r,msg:Ge[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return M()?m("targetId",e,l.STRING,!0)&&m("messageUId",n,l.STRING,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,n)];case 1:return t=c.sent(),a=t.code,s=t.data,a===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(n)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return M()?m("enableCheck",e,l.BOOLEAN)?[2,pe((function(t){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return[4,t.setCheckDuplicateMessage(e)];case 1:return[2,{code:n.sent().code}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return M()?[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,i;return D(this,(function(r){switch(r.label){case 0:return t.info(R.O,"clearLocalData ->"),[4,n.clearData()];case 1:return e=r.sent(),o=e.code,i=e.data,[2,{code:o,data:i}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:Ge[i.NOT_SUPPORT]}]}))}))}}),Fo=function(e,n,t){this.type=e,this.userIdList=n,this.mentionedContent=t};function Zo(e){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(t){return!e||m("proxy.socksHost",e.socksHost,l.STRING,!0)&&m("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,pe((function(t,o){return B(n,void 0,void 0,(function(){var n;return D(this,(function(r){switch(r.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,t.setProxy(e)];case 1:return(n=r.sent().code)===i.SUCCESS?[2,{code:n}]:(o.warn(R.O,"setProxy ->code:".concat(n)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(n){return[2,pe((function(n,t){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return[4,n.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(t.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Jo(e,n){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(o){return!e||m("proxy.socksHost",e.socksHost,l.STRING,!0)&&m("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,pe((function(o,r){return B(t,void 0,void 0,(function(){var t,a,s;return D(this,(function(c){switch(c.label){case 0:return r.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,n)];case 1:return t=c.sent(),a=t.status,s=t.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Qn as BaseMessage,st as CombineMessage,Vo as ConnectType,V as Events,ct as FileMessage,ut as GIFMessage,it as HQVoiceMessage,ot as ImageMessage,ft as LocationMessage,Fo as MentionedInfoBody,ko as MessageType,lt as ReferenceMessage,gt as RichContentMessage,rt as SightMessage,at as TextMessage,dt as VoiceMessage,we as __addSDKVersion,Lo as addConversationsToTag,Oe as addEventListener,Ao as addTag,Yn as addToBlacklist,Kn as bindRTCRoomForChatroom,$e as clearAllMessagesUnreadStatus,Ae as clearEventListeners,fo as clearHistoryMessages,Oo as clearMessages,Qe as clearMessagesUnreadStatus,Ke as clearTextMessageDraft,_o as clearUnreadCountByTimestamp,ke as connect,po as deleteLocalMessagesByTimestamp,uo as deleteMessages,Me as destroy,He as disconnect,Ho as electronExtension,Zn as forceRemoveChatRoomEntry,kn as forceSetChatRoomEntry,Jn as getAllChatRoomEntries,gn as getAllConversationState,Cn as getAllUltraGroupUnreadCount,An as getAllUltraGroupUnreadMentionedCount,ln as getAllUnreadMentionedCount,Wn as getBlacklist,Xn as getBlacklistStatus,In as getBlockUltraGroupList,sn as getBlockedConversationList,qn as getChatRoomEntry,Gn as getChatRoomInfo,zn as getChatroomHistoryMessages,Ue as getConnectionStatus,Ze as getConversation,Fe as getConversationList,rn as getConversationNotificationLevel,an as getConversationNotificationStatus,bo as getConversationsFromTagByPage,Le as getCurrentUserId,Be as getDeviceId,Jt as getFileToken,zt as getFileUrl,ho as getFirstUnreadMessage,no as getHistoryMessages,Eo as getMessage,Io as getMessageReader,qo as getProxy,to as getRemoteHistoryMessages,Pe as getServerTime,Uo as getTags,Po as getTagsFromConversation,Je as getTextMessageDraft,un as getTopConversationList,Ye as getTotalUnreadCount,je as getTotalUnreadCountByLevels,We as getTotalUnreadMentionedCountByLevels,On as getUltraGroupDefaultNotificationLevel,Mn as getUltraGroupFirstUnreadMessageTimestamp,vn as getUltraGroupList,hn as getUltraGroupMessageListByMessageUId,_n as getUltraGroupUnreadCountByTargetId,pn as getUltraGroupUnreadMentionedCountByTargetId,yn as getUltraGroupUnreadMentionedMessages,dn as getUnreadConversationList,Xe as getUnreadCount,Go as getUnreadCountByTag,fn as getUnreadMentionedCount,To as getUnreadMentionedMessages,ye as init,mo as insertMessage,De as installPlugin,Bn as joinChatRoom,Dn as joinExistChatRoom,Sn as modifyMessage,Ne as onceEventListener,bn as quitChatRoom,co as recallMessage,Ro as registerMessageType,Tn as removeAllExpansionForUltraGroupMessage,Fn as removeChatRoomEntries,Hn as removeChatRoomEntry,qe as removeConversation,wo as removeConversationsFromTag,_e as removeEventListener,Ce as removeEventListeners,En as removeExpansionForUltraGroupMessage,jn as removeFromBlacklist,go as removeMessageExpansionForKey,yo as removeTag,Do as removeTagFromConversations,Bo as removeTagsFromConversation,ze as saveTextMessageDraft,No as searchConversationByContent,So as searchMessages,Wt as sendFileMessage,Qt as sendGIFMessage,$t as sendHQVoiceMessage,Xt as sendImageMessage,Kt as sendMessage,oo as sendReadReceiptMessage,io as sendReadReceiptRequest,ro as sendReadReceiptResponse,ao as sendReadReceiptResponseV2,eo as sendSightMessage,so as sendSyncReadStatusMessage,Yt as sendTextMessage,vo as sendTypingStatusMessage,Rn as sendUltraGroupTypingStatus,Vn as setChatRoomEntries,xn as setChatRoomEntry,tn as setConversationNotificationLevel,on as setConversationNotificationStatus,cn as setConversationToTop,xo as setConversationToTopInTag,Co as setMessageReceivedStatus,Zo as setProxy,Nn as setUltraGroupDefaultNotificationLevel,Jo as testProxy,mn as updateExpansionForUltraGroupMessage,lo as updateMessageExpansion,Mo as updateTag};
|
|
1
|
+
import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as r,ReceivedStatus as i,ConversationType as a,isNumber as s,EventEmitter as c,RCConnectionStatus as u,VersionManage as d,assert as f,AssertRules as l,isArray as g,isHttpUrl as v,APIContext as I,LogTagId as h,logger as R,validate as m,isValidConversationType as E,isValidNotificationLevel as S,NotificationLevel as p,isTypeInConversationList as T,UltraGroupChannelType as O,isString as N,UploadMethod as _,getUUID as C,isValidFileType as A,FileType as y,usingCppEngine as M,MessageDirection as U,SentStatus as P,isUndefined as w}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var L=function(){return L=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},L.apply(this,arguments)};function B(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(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,s)}c((o=o.apply(e,t||[])).next())}))}function D(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,o&&(r=2&s[0]?o.return:s[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,s[1])).done)return r;switch(o=0,r&&(s=[2&s[0],r.value]),s[0]){case 0:case 1:r=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,o=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){a.label=s[1];break}if(6===s[0]&&a.label<r[1]){a.label=r[1],r=s;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(s);break}r[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var b=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))},G=b(),k=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 x=null,V=function(e){return B(void 0,void 0,void 0,(function(){var t;return D(this,(function(n){switch(n.label){case 0:return[4,H.getNetworkType()];case 1:return t=n.sent(),x({status:"online"===e.type,type:"online"===e.type?t:"none"}),[2]}}))}))};var H={tag:"browser",httpReq:function(e){var r=e.method||t.GET,i=e.timeout||n,a=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var t=k(),n="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(r,u),a&&t.setRequestHeader)for(var o in a)t.setRequestHeader(o,a[o]);if(n){t.timeout=i,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 s="object"==typeof c?JSON.stringify(c):c;t.send(s)}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})}),i),t.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:G,createWebSocket:function(e,t){var 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.UNKONWN},n=t.type,o=t.effectiveType,r=n||o||e.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){x=e,window.addEventListener("offline",V),window.addEventListener("online",V)},removeNetworkStatusListener:function(){window.removeEventListener("offline",V),window.removeEventListener("online",V),x=null}},F=b(),Z=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)}}},q={setItem:Z("setStorageSync"),getItem:Z("getStorageSync"),removeItem:Z("removeStorageSync"),clear:Z("clearStorageSync")},J=null,z=function(e){var t=e.isConnected,n=e.networkType;J({status:t,type:n})};var K={tag:"wechat",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){wx.request({url:d,method:i,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:q,sessionStorage:q,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:F,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.UNKONWN)}})}))},setNetworkStatusListener:function(e){J=e,wx.onNetworkStatusChange(z)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(z),J=null}},Y=b(),j=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){}}},W={setItem:j("setStorageSync"),getItem:j("getStorageSync"),removeItem:j("removeStorageSync"),clear:j("clearStorageSync")},X=null,Q=function(e){var t=e.isConnected,n=e.networkType;X({status:t,type:n})};var $={tag:"alipay",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:i,headers:s,timeout:a,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:W,sessionStorage:W,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Y,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.UNKONWN)}})}))},setNetworkStatusListener:function(e){X=e,my.onNetworkStatusChange(Q)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Q),X=null}},ee=b(),te=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){}}},ne={setItem:te("setStorageSync"),getItem:te("getStorageSync"),removeItem:te("removeStorageSync"),clear:te("clearStorageSync")},oe=null,re=function(e){var t=e.isConnected,n=e.networkType;oe({status:t,type:n})};var ie={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ee,localStorage:ne,sessionStorage:ne,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:r.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.UNKONWN)}})}))},setNetworkStatusListener:function(e){oe=e,tt.onNetworkStatusChange(re)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(re),oe=null}},ae=b(),se=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){}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue=null,de=function(e){var t=e.isConnected,n=e.networkType;ue({status:t,type:n})};var fe={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ae,localStorage:ce,sessionStorage:ce,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:r.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 B(this,void 0,void 0,(function(){return D(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){ue=e,swan.onNetworkStatusChange(de)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(de),ue=null}},le=b(),ge=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)}}},ve={setItem:ge("setStorageSync"),getItem:ge("getStorageSync"),removeItem:ge("removeStorageSync"),clear:ge("clearStorageSync")},Ie=null,he=function(e){var t=e.isConnected,n=e.networkType;Ie({status:t,type:n})};var Re={tag:"jingdong",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){jd.request({url:d,method:i,headers:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ve,sessionStorage:ve,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:le,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.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ie=e,jd.onNetworkStatusChange(he)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(he),Ie=null}},me=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)}}},Ee={setItem:me("setStorageSync"),getItem:me("getStorageSync"),removeItem:me("removeStorageSync"),clear:me("clearStorageSync")},Se=null,pe=function(e){var t=e.isConnected,n=e.networkType;Se({status:t,type:n})};var Te,Oe={tag:"uniapp",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){uni.request({url:d,method:i,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Ee,sessionStorage:Ee,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.UNKONWN)}})}))},setNetworkStatusListener:function(e){Se=e,uni.onNetworkStatusChange(pe)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(pe),Se=null}},Ne=function(e){return e&&e.request&&e.getSystemInfo},_e="undefined"!=typeof uni&&Ne(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Oe;case"mp-jd":return Re;case"mp-baidu":return fe;case"mp-toutiao":return ie;case"mp-alipay":return $;case"mp-weixin":return K;default:return H}}():"undefined"!=typeof jd&&Ne(jd)?Re:"undefined"!=typeof my&&Ne(my)?$:"undefined"!=typeof tt&&Ne(tt)?ie:"undefined"!=typeof swan&&Ne(swan)?fe:"undefined"!=typeof wx&&Ne(wx)?K:H;function Ce(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,h=e.isOffLineMessage,R=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,S=e.disableNotification,p=e.isMentioned,T=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;E||(E=i.UNREAD);var U={messageType:o,channelId:n||"",content:r,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:p,disableNotification:S,isStatusMessage:T,canIncludeExpansion:R,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return t!==a.ULTRA_GROUP&&(U.isOffLineMessage=h),t===a.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function Ae(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,s=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,f=e.isTop,l=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,I=e.unreadMentionedMeCount,h={conversationType:t,targetId:n,latestMessage:o&&Ce(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:f,channelId:l,unreadMentionedCount:g,matchCount:v,unreadMentionedMeCount:I};return h.conversationType===a.ULTRA_GROUP&&(h.firstUnreadMessage=e.firstUnreadMessage,h.channelType=e.channelType),h}function ye(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS"}(Te||(Te={}));var Me=new c,Ue={connection:function(e,t){switch(e){case u.CONNECTED:Me.emit(Te.CONNECTED);break;case u.CONNECTING:Me.emit(Te.CONNECTING);break;case u.SUSPENDED:Me.emit(Te.SUSPEND,t);break;case u.DISCONNECTED:Me.emit(Te.DISCONNECT,t)}},batchMessage:function(e){Me.emit(Te.MESSAGES,{messages:e.map((function(e){return Ce(e)}))})},typingState:function(e){Me.emit(Te.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){Me.emit(Te.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){Me.emit(Te.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Me.emit(Te.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?Ce(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===a.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=Pe(e.unreadMessageCount||0),n.unreadMentionedCount=Pe(e.unreadMentionedCount||0),n.unreadMentionedMeCount=Pe(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));Me.emit(Te.CONVERSATION,{conversationList:t})},chatroomState:function(e){Me.emit(Te.CHATROOM,e)},expansion:function(e){Me.emit(Te.EXPANSION,e)},pullFinished:function(){Me.emit(Te.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Me.emit(Te.TAG)},conversationTagChanged:function(){Me.emit(Te.CONVERSATION_TAG)},messageBlocked:function(e){Me.emit(Te.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Me.emit(Te.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Me.emit(Te.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Me.emit(Te.ULTRA_GROUP_ENABLE,e.map((function(e){return Ae(e)})))},operateStatus:function(e){Me.emit(Te.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Me.emit(Te.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Ce(e)})))},ultraGroupMessageModified:function(e){Me.emit(Te.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Ce(e)})))},ultraGroupMessageRecalled:function(e){Me.emit(Te.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Ce(e)})))},ultraGroupChannelChangeType:function(e){Me.emit(Te.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Me.emit(Te.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Me.emit(Te.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Me.emit(Te.USER_GROUP_STATUS,e)}};function Pe(e){return e>999?999:e}d.add("imlib-next","5.7.9");var we=null,Le=null,Be=null;function De(){return B(this,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return we?(Be.info(h.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),Le=null,we=null,Be=null,[2]}}))}))}function be(e){if(!we)throw new Error("Not initialized yet!");return e(we,Be,Le)}function Ge(e){return we?e(we,Be,Le):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function ke(e,t,n){Me.on(e,t,n)}function xe(e,t,n){Me.once(e,t,n)}function Ve(e,t,n){Me.off(e,t,n)}function He(e){Me.removeAll(e)}function Fe(){Me.clear()}function Ze(e){!function(e){var t,n=e.appkey,o=e.navigators;we?Be.warn(h.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,l.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(v))})),Le=e,we=I.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||_e,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl}),(Be=we.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Be.info(h.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.7.9",commit:"c429b5ad576697400ce20f472ec7631c27c18cab"})),we.assignWatcher(Ue),R.init(Be))}(e)}function qe(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return we?(Fe(),[2,De()]):[2]}))}))}function Je(){return be((function(e){return e.getConnectionStatus()}))}function ze(){return be((function(e){return e.getServerTime()}))}function Ke(){return be((function(e){return e.getCurrentUserId()}))}function Ye(e,t){d.add(e,t)}function je(){return be((function(e){return e.getDeviceId()}))}function We(e,t){return be((function(n){return n.install(e,t)}))}var Xe={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:r.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:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Qe={};for(var $e in Xe){var et=Xe[$e].code;Qe[et]=$e}function nt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return m("token",e,l.STRING,!0)&&m("reconnectKickEnable",t,l.BOOLEAN)?(n=i.createTraceId(),i.info(h.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!!t,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===r.SUCCESS?"info":"warn",i[s](h.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===r.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:Qe[a.code]}]}}))}))}))]}))}))}function ot(e){return R.info(h.A_DISCONNECT_O,{}),be((function(t){return t.disconnect(e)}))}function rt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options.count",null==e?void 0:e.count,l.NUMBER)&&m("options.startTime",null==e?void 0:e.startTime,l.NUMBER)&&m("options.order",null==e?void 0:e.order,l.NUMBER)&&m("channelId",t,l.CHANNEL_ID)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Ae(e)}))}]:(i.warn(h.O,"get conversation list fail ->".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function it(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),i=t.code,a=t.data,i!==r.SUCCESS?(o.warn(h.O,"getConversation ->code:".concat(i,", targetId:").concat(e.targetId)),[2,{code:i,msg:Qe[i]}]):[2,{code:i,data:a?Ae(a):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function at(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i;return D(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"destroy conversation ->".concat(i)),t!==r.SUCCESS?(o.warn(h.O,"destroy conversation fail ->".concat(t,":").concat(Qe[t],",").concat(i)),[2,{code:t,msg:Qe[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function st(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),i=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"get draft ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a||""}]:(o.warn(h.O,"get draft fail ->".concat(i,":").concat(Qe[i],",").concat(s)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ct(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("draft",t,l.STRING,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(h.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===r.SUCCESS?[2,{code:a}]:(i.warn(h.O,"set draft fail ->".concat(a,":").concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ut(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i;return D(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(i=a.sent())===r.SUCCESS?[2,{code:i}]:(o.warn(h.O,"delete draft fail ->".concat(i,":").concat(Qe[i],",").concat(t)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("includeMuted",e,l.BOOLEAN,!1)&&m("conversationTypes",t,l.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!m("conversationType",e,E)})))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return i.debug(h.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(h.O,"getTotalUnreadCount fail ->".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!m("conversationTypes",e,l.ARRAY,!0)||!m("levels",t,l.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,E)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(h.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]}))}))}function lt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!m("conversationTypes",e,l.ARRAY,!0)||!m("levels",t,l.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,E)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(h.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]}))}))}function gt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),i=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"get unreadCount ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(h.O,"get unreadCount fail ->".concat(i,":").concat(Qe[i],",").concat(s)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i;return D(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(h.O,"clear unreadMsgNum ->".concat(i)),t!==r.SUCCESS?(o.warn(h.O,"clear unreadMsgNum fail ->".concat(t,":").concat(Qe[t],",").concat(i)),[2,{code:t,msg:Qe[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}Xe.ROAMING_SERVICE_UNAVAILABLE.code;var ht=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(h.O,"".concat(n," -> ").concat(o)),o},Rt=function(e,t,n,o){return void 0===o&&(o=""),B(void 0,void 0,void 0,(function(){var i,a;return D(this,(function(s){switch(s.label){case 0:return i=ht(e,t,o),[4,n()];case 1:return(a=s.sent())!==r.SUCCESS?(e.warn(h.O,"".concat(o," fail -> ").concat(a," : ").concat(Qe[a]," , ").concat(i)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))};function mt(e,t){return B(this,void 0,void 0,(function(){return D(this,(function(n){return m("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return Rt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(e,t){return B(this,void 0,void 0,(function(){return D(this,(function(n){return m("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return Rt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return t=ht(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return i=c.sent(),a=i.code,s=i.data,a===r.SUCCESS?[2,{code:a,data:s}]:(o.warn(h.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(Qe[a]," , ").concat(t)),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(h.O,"getConversationNotificationStatus ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,Ge((function(e){return e.getBlockConversationList()}))]}))}))}function Ot(e,t){return void 0===t&&(t=!0),B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("isTop",t,l.BOOLEAN)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(h.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"set conversation status fail ->".concat(a,":").concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversationTypes",e,l.ARRAY)&&!(null==e?void 0:e.some((function(e){return!m("conversationType",e,E)})))&&m("channelId",t,l.CHANNEL_ID)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Ae(e)}))}]:(i.warn(h.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return!m("conversationTypes",e,l.ARRAY)||(null==e?void 0:e.some((function(e){return!m("conversationType",e,T)})))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,o,i;return D(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=a.sent(),o=t.code,i=t.data,o===r.SUCCESS&&i?[2,{code:0,data:i.map((function(e){return Ae(e)}))}]:[2,{code:o,msg:Qe[o]}]}}))}))}))]}))}))}function Ct(e){return B(this,void 0,void 0,(function(){return D(this,(function(t){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(t,n){return n.debug(h.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,Ge((function(e,t){return t.debug(h.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function yt(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,Ge((function(e){return e.getAllConversationState()}))]}))}))}function Mt(e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options.targetId",e.targetId,l.STRING,!1)&&m("options.channelType",e.channelType,(function(e){return void 0!==O[e]}),!1)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(o.warn(h.O,"get ultragroup ->".concat(i,":").concat(Qe[i])),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ut(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i;return D(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(n.warn(h.O,"get block ultragroup ->".concat(o,":").concat(Qe[o])),[2,{code:o,msg:Qe[o]}])}}))}))}))]}))}))}function Pt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(i){switch(i.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(h.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(Qe[t])),[2,{code:t,msg:Qe[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options",e,l.CONVERSATION,!0)&&m("msgs",t,l.ARRAY,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),f=d.code,l=d.data,f===r.SUCCESS){for(v in g={},l)g[v]=l[v]?Ce(l[v]):void 0;return[2,{code:r.SUCCESS,data:g}]}return i.warn(h.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(Qe[f])),[2,{code:f,msg:Qe[f]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("expansion",e,l.OBJECT,!0)&&m("message",t,l.OBJECT,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),i.debug(h.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(h.O,"update expansion for ultragroup message ->".concat(g,":").concat(Qe[g])),[2,{code:g,msg:Qe[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("expansion",e,l.ARRAY,!0)&&m("message",t,l.OBJECT,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),i.debug(h.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(h.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(Qe[g])),[2,{code:g,msg:Qe[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("message",e,l.OBJECT,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return t=e.conversationType,i=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(u,",messageUId:").concat(a),o.debug(h.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:i,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(f)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(h.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(Qe[l])),[2,{code:l,msg:Qe[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("content",e,l.OBJECT,!0)&&m("message",t,l.OBJECT,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,f=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(f,",messageUId:").concat(s),i.debug(h.O,"update ultragroup message expansion ->".concat(l)),g={targetId:a,channelId:f,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=I.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(h.O,"modify ultraGroup message ->".concat(v,":").concat(Qe[v])),[2,{code:v,msg:Qe[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("notificationLevels",t,l.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return i.debug(h.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:r.SUCCESS,data:s}]:(i.warn(h.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(Qe[a])),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(h.O,"".concat(t," -> ").concat(i)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS?[2,{code:s,data:c}]:(o.warn(h.O,"".concat(t," fail -> ").concat(s," : ").concat(Qe[s]," , ").concat(i)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&m("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),i.debug(h.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===r.SUCCESS?[2,{code:s}]:(i.warn(h.O,"".concat(n," fail -> ").concat(s," : ").concat(Qe[s]," , ").concat(a)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("notificationLevels",t,l.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,Ge((function(o,r){return B(n,void 0,void 0,(function(){var n,i,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=u.sent(),a=i.code,s=i.data,c="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),r.debug(h.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i,a;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),i=o.code,a=o.data,n.debug(h.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(h.O,"".concat(e," fail ->").concat(i,": ").concat(Qe[i])),[2,{code:i,msg:Qe[i]}])}}))}))}))]}))}))}function Ft(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i,a;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),i=o.code,a=o.data,n.debug(h.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(h.O,"".concat(e," fail ->").concat(i,": ").concat(Qe[i])),[2,{code:i,msg:Qe[i]}])}}))}))}))]}))}))}function Zt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,l.STRING,!0)&&m("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&m("options.sentTime",e.sentTime,l.NUMBER,!0)&&m("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return t=e.targetId,i=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:i,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===r.SUCCESS?[2,{code:d,data:f}]:(o.warn(h.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Qe[d])),[2,{code:d,msg:Qe[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("conversation.targetId",e.targetId,l.STRING,!0)&&m("conversation.channelId",e.channelId,l.CHANNEL_ID,!0)?[2,Ge((function(n){return B(t,void 0,void 0,(function(){var t,o,i,a,s,c;return D(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,i={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(i)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Qe[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Jt=function(e){return!!(m("options.key",e.key,l.STRING,!0)&&m("options.value",e.value,l.STRING,!0)&&m("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&m("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING))},zt=function(e){return e.entries.every((function(e){return m("entry.key",e.key,l.STRING,!0)&&m("entry.value",e.value,l.STRING,!0)}))&&m("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING)&&m("options.isForce",e.isForce,l.BOOLEAN)},Kt=function(e){return m("options.key",e.key,l.STRING,!0)&&m("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,l.STRING)},Yt=function(e){return e.entries.every((function(e){return m("key",e,l.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,l.STRING)};function jt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",t.count,l.NUMBER,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",i[s](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Qe[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",t.count,l.NUMBER,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",i[s](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Qe[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("targetId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(h.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return i=s.sent(),a=i===r.SUCCESS?"info":"warn",o[a](h.A_QUIT_CHATROOM_R,JSON.stringify({code:i}),t),i!==r.SUCCESS?[2,{code:i,msg:Qe[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.count",t.count,l.NUMBER)&&m("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(h.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(i.warn(h.O,"get chatroom info fail ->code+:".concat(Qe[s],",").concat(n)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $t(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Jt(t)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(h.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"set chatroom entry fail ->code+:".concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function en(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&zt(t)?t.entries.length>10?[2,Xe.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(h.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==r.SUCCESS?(i.warn(h.O,"set chatroom entry fail ->code+:".concat(Qe[s],",").concat(n)),[2,{code:s,msg:Qe[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function tn(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Jt(t)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(h.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"force set chatroom entry fail ->code+:".concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nn(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Kt(t)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(h.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"remove chatroom entry fail ->code+:".concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Yt(t)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.info(h.O,"remove chatroom entry->".concat(n)),(a=L({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==r.SUCCESS?(i.warn(h.O,"remove chatroom entry fail ->code+:".concat(Qe[c],",").concat(n)),[2,{code:c,msg:Qe[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&Kt(t)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.info(h.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"force remove chatroom entry fail ->code+:".concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("key",t,(function(e){return N(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(h.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(i.warn(h.O,"get chatroom entry fail ->code+:".concat(Qe[s],",").concat(n)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("targetId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(h.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return i=c.sent(),a=i.code,s=i.data,a===r.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(h.O,"get all chatroom entries fail ->code+:".concat(Qe[a],",").concat(t)),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("targetId",e,l.STRING,!0)&&m("options.timestamp",t.timestamp,l.NUMBER)&&m("options.count",t.count,l.NUMBER)&&m("options.count",t.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}))&&m("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.debug(h.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return Ce(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(i.warn(h.O,"get chatroom history message fail ->code+:".concat(Qe[s],",").concat(n)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("option.chatRoomId",e.chatRoomId,l.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,l.STRING,!0)?[2,Ge((function(n){return B(t,void 0,void 0,(function(){var t;return D(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:Qe[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("userId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return o.info(h.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("userId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return o.info(h.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i;return D(this,(function(a){switch(a.label){case 0:return n.info(h.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS&&i?[2,{code:o,data:i}]:(n.warn(h.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function gn(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("userId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:0===a}]:(o.warn(h.O,"getBlacklistStatus fail -> code: ".concat(i,", userId: ").concat(e)),[2,{code:i}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var vn=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 In(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new vn(e,o,t,n)}}var hn,Rn,mn=In("RC:ImgMsg"),En=In("RC:HQVCMsg"),Sn=In("RC:SightMsg"),pn=In("RC:TxtMsg"),Tn=In("RC:CombineMsg"),On=In("RC:FileMsg"),Nn=In("RC:GIFMsg"),_n=In("RC:VcMsg"),Cn=In("RC:LBSMsg"),An=In("RC:ReferenceMsg"),yn=In("RC:ImgTextMsg"),Mn={qiniu:function(e,t,n,o){be((function(r){var i=r.getNaviInfoFromCache();if(1===(null==i?void 0:i.type)&&t.chunk_size&&o.size>t.chunk_size){var a=C();a+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=a,kn(o,t,n)}else Gn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>Pn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=t||{};t=t||Rn;var i=new XMLHttpRequest,a=Bn();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var s=a+Un[0][1]+r.bosUploadPath;Un.shift();var c=r.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});i.onreadystatechange=function(){if(4===i.readyState)if(JSON.parse(i.responseText||"{}").filename=t.uniqueValue,200===i.status){n.onCompleted(u,!0)}else Un.length?Mn[Un[0][0]](e,t,n,o):n.onError("upload fail")},i.open(t.method,s,!0),i.setRequestHeader("authorization",c.bosToken),i.setRequestHeader("x-bce-date",c.bosDate),i.send(o)},aliyun:function(e,t,n,o){if(o.size>Pn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token"));var i=Un[0][1];Un.shift(),e=e||hn,t=(t=t||{})||Rn;var a=new XMLHttpRequest,s=Bn(),c="".concat(s+t.ossBucketName,".").concat(i);a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var e=JSON.parse(a.responseText||"{}");e.name=t.uniqueValue,e.filename=t.uploadFileName,e.uploadMethod=_?_.ALI:"",200===a.status?n.onCompleted(e):Un.length?Mn[Un[0][0]](r,t,n,o):n.onError("upload fail")}},a.open(t.method,c,!0),console.log("ali:url",c);var u=t.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",t.uploadFileName),e.delete("file"),e.append("file",o),a.send(e)},s3:function(e,t,n,o){var r=new FormData,i=new XMLHttpRequest,a=Bn(),s=t.contentDisposition,c=Un[0][1],u="".concat(a+t.s3BucketName,".").concat(c);console.log("uploadS3:url",u),Un.shift(),i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var r=JSON.parse(i.responseText||"{}");if(r.name=t.uniqueValue,r.filename=t.uploadFileName,r.uploadMethod=_.AWS,200===i.status||204===i.status)n.onCompleted(r);else if(Un.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),Mn[Un[0][0]](a,t,n,o)}else n.onError("upload fail")}},i.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;s?r.set("Content-Disposition","".concat(s,";")):r.set("Content-Disposition","text/html"===f?"inline;":"attachment;");r.set("Content-Type",f),r.set("x-amz-credential",d.s3Credential),r.set("x-amz-algorithm",d.s3Algorithm),r.set("x-amz-date",d.s3Date),r.set("policy",d.s3Policy),r.set("x-amz-signature",d.s3Signature),r.set("key",t.uploadFileName),r.set("file",o),i.send(r)},stc:xn,minio:xn},Un=[],Pn={BOS_CHUNCK_SIZE:5368709120},wn="http://",Ln="https://";function Bn(){var e=Ln;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=wn),e}var Dn,bn=(Dn="RC-upload-",{get:function(e){e=Dn+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=Dn+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=Dn+e,localStorage.removeItem(e)}});function Gn(e,t,n,o){var r=Ln+t.uploadHost.qiniu,i=(/http/.test(Un[0][1])?"":Bn())+Un[0][1]||r;t.isChunk||Un.shift();var a=new XMLHttpRequest;a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),a.onreadystatechange=function(){if(4===a.readyState){var r=JSON.parse(a.responseText||"{}");r.filename=t.uniqueValue,r.uploadMethod=_?_.QINIU:"",200===a.status||204===a.status?n.onCompleted(r):Un.length?Mn[Un[0][0]](e,t,n,o):n.onError("upload fail")}},a.open(t.method,i,!0),n.onOpen(a),t.stream&&a.setRequestHeader("authorization","UpToken ".concat(t.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(t.headers,(function(e,t){a.setRequestHeader(e,t)})),a.send(e)}function kn(e,t,n,o){var r=0,i=o||C(),a=bn.get(i);a&&(e.uniqueName=a.sessionId,r=a.offset);var s=Math.min(t.chunk_size,e.size-r),c=e.slice(r,r+s),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(r,"-").concat(r+s);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,c.name=e.name,c=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 i=t.multi_parmas[r];o.append(r,i)}return o}(c,t,e.uniqueName),Gn(c,t,{onCompleted:function(o){r+=s;var a=e.uniqueName;bn.set(i,{offset:r,sessionId:a}),r<e.size?kn(e,t,n,i):(r=0,bn.remove(i),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var i=e+r;n.onProgress(i,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function xn(e,t,n,o,r){var i=new XMLHttpRequest,a=t.contentDisposition,s=Un[0][1],c=r===_.STC?t.stcBucketName:t.minioBucketName,u="https://".concat(s,"/").concat(c,"/").concat(t.uploadFileName);Un.shift(),i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var a=JSON.parse(i.responseText||"{}");if(a.name=t.uniqueValue,a.filename=t.uploadFileName,a.uploadMethod=r,200===i.status||204===i.status)n.onCompleted(a);else if(Un.length){var s=new FormData;s.set("file",e.get("file")),s.set("key",e.get("key")),s.set("token",e.get("token")),Mn[Un[0][0]](s,t,n,o)}else n.onError("upload fail")}},i.open("PUT",u,!0);var d=t.stcHeader.stcAuthorization,f=t.stcHeader.stcContentSha256,l=t.stcHeader.stcDate;r===_.MINIO&&(d=t.minioHeader.minioAuthorization,f=t.minioHeader.minioContentSha256,l=t.minioHeader.minioDate),i.setRequestHeader("Content-Type",o.type),a?i.setRequestHeader("Content-Disposition","".concat(a,";")):i.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;"),i.setRequestHeader("Authorization",d),i.setRequestHeader("x-amz-content-sha256",f),i.setRequestHeader("x-amz-date",l),i.send(o)}function Vn(e,t,n,o,r,i){var a,s,c=t&&t.type||"text/plain",u=c.indexOf("image")>-1?1:4,d=n.contentDisposition,f=Math.ceil(t.size/n.stc_chunk_size),l=r===_.STC?n.stcBucketName:n.minioBucketName,g="uploads";e.getFileToken(u,t.name,"POST",g).then((function(e){a=e.fileName,s="https://".concat(i,"/").concat(l,"/").concat(a),console.log("uploadStcMultipart:url",s);var n=new XMLHttpRequest;n.open("POST","".concat(s,"?").concat(g),!0),d?n.setRequestHeader("Content-Disposition","".concat(d,";")):n.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;");var u=e.stcAuthorization,v=e.stcContentSha256,I=e.stcDate;r===_.MINIO&&(u=e.minioAuthorization,v=e.minioContentSha256,I=e.minioDate),n.setRequestHeader("Authorization",u),n.setRequestHeader("x-amz-content-sha256",v),n.setRequestHeader("x-amz-date",I),n.setRequestHeader("Content-Type",c),n.send(),n.onreadystatechange=function(){if(4===n.readyState){var e=n.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===n.status||204===n.status?function(e){for(var t=[],n=1;n<=f;n++)t.push(R(e,n));h(e,t)}(Array.isArray(e)&&e[1]):o.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));var v=[],I=new Map;function h(n,i){i&&Array.isArray(i)&&0!==i.length&&Promise.all(i).then((function(){var i="uploadId=".concat(n);if(I.size===f)e.getFileToken(u,a,"POST",i).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",n);var u=e.stcAuthorization,d=e.stcContentSha256,f=e.stcDate;r===_.MINIO&&(u=e.minioAuthorization,d=e.minioContentSha256,f=e.minioDate);var l=new XMLHttpRequest;l.open("POST","".concat(s,"?").concat(i),!0),l.setRequestHeader("Authorization",u),l.setRequestHeader("x-amz-content-sha256",d),l.setRequestHeader("x-amz-date",f),l.setRequestHeader("Content-Type",c);var g="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",v=Array.from(I.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",v),v.forEach((function(e){g+="<Part><ETag>".concat(I.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),g+="</CompleteMultipartUpload>",l.send(g),console.log("xml",g),l.onreadystatechange=function(){if(4===l.readyState)if(200===l.status||204===l.status){var e={name:t.name,filename:a,uploadMethod:r};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var d=[],l=0,g=v;l<g.length;l++){var m=g[l];d.push(R(n,m))}h(n,d)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],r=0,i=v;r<i.length;r++){var a=i[r];t.push(R(n,a))}h(n,t)}))}function R(o,i){return new Promise((function(d,f){var l="partNumber=".concat(i,"&uploadId=").concat(o);e.getFileToken(u,a,"PUT",l).then((function(e){console.log("signature ".concat(i," onSuccess"),e);var o=t&&t.slice((i-1)*n.stc_chunk_size,i*n.stc_chunk_size);console.log("fileChunk:size",o.size);var a=e.stcAuthorization,u=e.stcContentSha256,g=e.stcDate;r===_.MINIO&&(a=e.minioAuthorization,u=e.minioContentSha256,g=e.minioDate);var h=new XMLHttpRequest;h.open("PUT","".concat(s,"?").concat(l),!0),h.setRequestHeader("Authorization",a),h.setRequestHeader("x-amz-content-sha256",u),h.setRequestHeader("x-amz-date",g),h.setRequestHeader("Content-Type",c),h.send(o),h.onreadystatechange=function(){if(4===h.readyState)if(200===h.status||204===h.status){var e=h.getResponseHeader("etag");console.log("etag:".concat(i),e),I.set(i,e),d(e)}else v.includes(i)||v.push(i),f(i)}}),(function(e){console.log("getETags: Signature verification failure"),v.includes(i)||v.push(i),f(i)}))}))}}var Hn={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Fn()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),Zn(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=Fn()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,Zn(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Fn(){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 Zn(e,t){for(var n in e)t(n,e[n])}var qn,Jn=0,zn=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:Hn.form,genUId:Fn};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;Zn(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){hn=n,Rn=o,Un=[];var i,a,s=e.getNaviInfoFromCache();if(1===(null==s?void 0:s.type)&&t.uploadDomain&&!o.ossConfig)Un=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var c,u,d,f=JSON.parse(o.ossConfig),l="",g=[];f.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(l=e[n]),"s3"===n&&(c=e[n]),"stc"===n&&(u=e[n]),"minio"===n&&(d=e[n]),"p"!==n&&(g[t]=[n,e[n]])})),g.forEach((function(e){e&&Un.push(e)})),f.length!==Un.length&&(Un=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",l],["s3",c],["stc",u],["minio",d]])}else Un=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var v=o&&JSON.parse(o.ossConfig);Array.isArray(v)||(v=[]),i=v.find((function(e){return Object.keys(e).includes("stc")})),a=v.find((function(e){return Object.keys(e).includes("minio")}))}if(i&&1===parseInt(i.p,10)&&n.size>=4194304)Vn(e,n,o,r,_.STC,i.stc);else if(a&&1===parseInt(a.p,10)&&n.size>=4194304)Vn(e,n,o,r,_.MINIO,a.minio);else{var I=o.data(n,o);Mn[Un[0][0]](I,o,r,n,_.MINIO)}}(e,t,n,this.options,{onProgress:function(e,t,n){(qn=e,n)?qn=Jn+e/t*(t-Jn):Jn=qn;o.onProgress(qn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var Kn,Yn,jn={init:function(e){return new zn(e)},dataType:Hn,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,i=new Image;i.src=r;var a=i.width,s=i.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var i=e.height,a=t.maxHeight||0;if(a>0&&i>a){var s=a/i;n=Math.min(n,s)}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:a,height:s,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")}(i,a*c,s*c)),n(u)}},Upload:zn},Wn=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),i=new Image,a="string"==typeof e;i.onload=function(a){var s=function(e,t,n){var o,r,i,a=e<t,s=0,c=0;return(a?t/e:e/t)>n.scale?(a?(r=100,c=((i=t/(o=e/100))-n.maxHeight)/2):(i=100,s=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:i,x:-s,y:-c}):(a?(o=t/n.maxHeight,i=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,i=t/o),{w:r,h:i,x:-s,y:-c})}(i.width,i.height,t);o.width=s.w>t.maxWidth?t.maxWidth:s.w,o.height=s.h>t.maxHeight?t.maxHeight:s.h,r.drawImage(i,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},i.src=a?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},Xn=function(e,t){var n=e.file,o=e.compress;Wn(n,o,t)},Qn=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=jn.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=jn.init(e);t(n)}},$n=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||Xn;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},eo=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){$n(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),to=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};$n(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),no={initFile:function(e,t){Qn(e,(function(e){var n=new eo(e);t(n)}))},initImage:function(e,t){Qn(e,(function(n){var o,r,i,a,s={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===(i=e.thumbnailConfig)||void 0===i?void 0:i.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new to(n,s);t(c)}))},dataType:jn.dataType};function oo(e,t,n,o,r,i,a){var s=this;void 0===a&&(a=y.FILE);var c=y.FILE;a===y.IMAGE&&(c=y.IMAGE);var u=e.getNaviInfoFromCache();if(!Yn&&(Yn="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(Yn=d.qiniu)}catch(e){}var f=L({domain:Yn,getToken:function(t){e.getFileToken(c,o.name).then((function(e){t(e.token,e)})).catch((function(e){r.onFail(e)}))}},i),l=no.initFile;c===y.IMAGE&&(l=no.initImage),l(f,(function(t){t.upload(e,n,o,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=r.onProgress)||void 0===n||n.call(r,o)},onCompleted:function(e){return B(s,void 0,void 0,(function(){return D(this,(function(t){return 1!==(null==u?void 0:u.type)||(null==u?void 0:u.ossConfig)?(function(e,t,n,o,r){so(t,o.filename,o.name,o,o.uploadMethod).then((function(i){if(0===i.code){var a=i.data;a.type=n.type,a.name=o.name||o.filename,e!==y.AUDIO?(t===y.IMAGE&&(a.thumbnail=o.thumbnail,a.width=o.w,a.height=o.h,a.size=o.size),r.onSuccess(a)):ro(n).then((function(e){r.onSuccess(L(L({},a),e))}))}else r.onFail(i)})).catch((function(e){r.onFail(e)}))}(a,c,o,e,r),[2]):(function(e,t,n,o,r,i){var a={type:o.type,name:r.rc_url.file_name,downloadUrl:e.uploadDomain+r.rc_url.path};if(t===y.AUDIO)return void ro(o).then((function(e){i.onSuccess(L(L({},a),e))}));t===y.IMAGE&&(a.thumbnail=r.thumbnail,a.width=r.w,a.height=r.h,a.size=r.size);i.onSuccess(a)}(n,a,0,o,e,r),[2])}))}))},onError:function(e){r.onFail(e)}})}))}function ro(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?io(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(io).then((function(e){t(e)}))}))}function io(e){return Kn=Kn||new AudioContext,new Promise((function(t,n){Kn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function ao(e,t,n,o){return Ge((function(i){return new Promise((function(a){i.getFileToken(e,t,n,o).then((function(e){a({code:r.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:Qe[e]})}))}))}))}function so(e,t,n,o,i){return m("fileType",e,A,!0)&&m("filename",t,l.STRING)&&m("saveName",n,l.STRING)&&m("serverType",i,l.NUMBER)?Ge((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,i).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER})}function co(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(s){return[2,Ge((function(s,c){return B(o,void 0,void 0,(function(){var o,u,d,f,g,v,I,R,E,S,p,T;return D(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof vn==!1?(c.warn(h.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,Xe.ILLGAL_PARAMS]):m("conversation",e,l.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,m("conversation.targetId",u,l.STRING,!0)&&m("conversation.conversationType",o,l.NUMBER,!0)&&m("conversation.channelId",d,l.CHANNEL_ID)&&m("options.isStatusMessage",null==n?void 0:n.isStatusMessage,l.BOOLEAN)&&m("options.disableNotification",null==n?void 0:n.disableNotification,l.BOOLEAN)&&m("options.pushContent",null==n?void 0:n.pushContent,l.STRING)&&m("options.pushData",null==n?void 0:n.pushData,l.STRING)&&m("options.isMentioned",null==n?void 0:n.isMentioned,l.BOOLEAN)&&m("options.mentionedType",null==n?void 0:n.mentionedType,l.NUMBER)&&m("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,l.ARRAY)&&m("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,l.ARRAY)&&m("options.isVoipPush",null==n?void 0:n.isVoipPush,l.BOOLEAN)&&m("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,l.BOOLEAN)&&m("options.expansion",null==n?void 0:n.expansion,l.OBJECT)&&m("options.pushConfig",null==n?void 0:n.pushConfig,l.OBJECT)&&m("options.messageId",null==n?void 0:n.messageId,l.NUMBER)?(f="conversationType:".concat(o,",targetId:").concat(u),c.debug(h.O,"send message ->".concat(f)),g=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,i=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return L({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:R||"",messageId:h},t)}(n,t,e),v={isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:s.getCurrentUserId(),messageUId:"",messageDirection:U.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:i.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:P.SENDING},o!==a.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),R=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Ce(v))}catch(e){c.error(h.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(h.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,s.sendMessage(o,u,g,R,I)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),S=E.code,p=E.data,S===r.SUCCESS?(c.info(h.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:p.messageUId,messageId:p.messageId}),I),T=Ce(p),[2,{code:S,data:T}]):(c.warn(h.A_SEND_MSG_R,"send message fail ->".concat(S,":").concat(Qe[S],",").concat(f)),v.sentTime=(null==p?void 0:p.sentTime)||0,v.sentStatus=null==p?void 0:p.sentStatus,[2,{code:S,msg:Qe[S],data:Ce(v)}])}}))}))}))]}))}))}function uo(e,t,n){return co(e,new pn(t),n)}function fo(e,t){return function(n,o,i,a){if(!m("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(m("sendOptions.maxHeight",null==c?void 0:c.maxHeight,l.NUMBER)&&m("sendOptions.maxWidth",null==c?void 0:c.maxWidth,l.NUMBER)&&m("sendOptions.quality",null==c?void 0:c.quality,l.NUMBER)&&m("sendOptions.scale",null==c?void 0:c.scale,l.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return Ge((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(h.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),oo(c,0,d,o.file,{onProgress:null==i?void 0:i.onProgress,onSuccess:function(e){var s,c=(null===(s=null==i?void 0:i.onComplete)||void 0===s?void 0:s.call(i,L({url:e.downloadUrl},e)))||t(e,o);e&&e.downloadUrl&&u.info(h.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:r.SUCCESS}),l),co(n,c,a).then(f)},onFail:function(e){u.warn(h.L_MEDIA_UPLOAD_R,JSON.stringify({code:r.UPLOAD_FILE_FAILED}),l),f({code:r.UPLOAD_FILE_FAILED,msg:e||r[r.UPLOAD_FILE_FAILED]})}},s,e)}))}))}}var lo=fo(y.FILE,(function(e,t){return new On({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})),go=fo(y.IMAGE,(function(e,t){return new mn({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),vo=fo(y.IMAGE,(function(e,t){return new Nn({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),Io=fo(y.AUDIO,(function(e,t){return new En({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),ho=fo(y.SIGHT,(function(e,t){return new Sn({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})}));function Ro(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,l.NUMBER)&&m("options.count",null==t?void 0:t.count,l.NUMBER)&&(M()||m("options.count",null==t?void 0:t.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})))&&m("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&m("conversation",e,l.CONVERSATION,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n=i.createTraceId(),i.info(h.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return Ce(e)})),i.info(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,l.NUMBER)&&m("options.count",null==t?void 0:t.count,l.NUMBER)&&m("options.count",null==t?void 0:t.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}))&&m("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&m("conversation",e,l.CONVERSATION,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(h.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return Ce(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(h.O,"get history message fail ->".concat(s,":").concat(Qe[s],",").concat(n)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,t,n,o){return B(this,void 0,void 0,(function(){var i=this;return D(this,(function(s){return m("targetId",e,l.STRING,!0)&&m("messageUId",t,l.STRING,!0)&&m("timestamp",n,l.NUMBER,!0)&&m("channelId",o,l.CHANNEL_ID)?[2,Ge((function(r){return B(i,void 0,void 0,(function(){var r,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:a.PRIVATE,channelId:o},i=new vn("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,co(r,i)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return m("messageUId",t,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",n,l.CHANNEL_ID)?[2,Ge((function(r,i){return B(o,void 0,void 0,(function(){var o,r,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(h.O,"send read receipt message ->".concat(o)),r=new vn("RC:RRReqMsg",{messageUId:t}),[4,co({targetId:e,conversationType:a.GROUP,channelId:n},r)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e,t,n){return B(this,void 0,void 0,(function(){return D(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function To(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return m("targetId",e,l.STRING,!0)&&m("messageList",t,l.OBJECT,!0)&&m("channelId",n,l.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!m(e,t[e],l.ARRAY)}))?[2,Ge((function(i,s){return B(o,void 0,void 0,(function(){var o,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:a.GROUP,channelId:n},u=i.getNaviInfoFromCache(),1!==(null==u?void 0:u.grpRRVer)?[3,2]:(d=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===d.indexOf(e)&&d.push(e)}))})),d.length?[4,i.sendReadReceiptMessage(e,d,n)]:(s.warn(h.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 1:return c=g.sent(),[3,4];case 2:return f=new vn("RC:RRRspMsg",{receiptMessageDic:t}),[4,co(o,f)];case 3:c=g.sent(),g.label=4;case 4:return(l=c.code)===r.SUCCESS?[2,{code:l}]:(s.warn(h.O,"send read receipt message fail ->".concat(l,":").concat(Qe[l])),[2,{code:l,msg:Qe[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t){return B(this,void 0,void 0,(function(){var n,o,i,a;return D(this,(function(s){switch(s.label){case 0:return m("conversation",e,l.CONVERSATION,!0)&&m("lastMessageSendTime",t,l.NUMBER,!0)?(n=new vn("RC:SRSMsg",{lastMessageSendTime:t}),[4,co(e,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),i=o.code,a=o.msg,0===i?[2,{code:i}]:[2,{code:i,msg:a}]}}))}))}function No(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("options.messageUId",t.messageUId,l.STRING,!0)&&m("options.sentTime",t.sentTime,l.NUMBER,!0)&&m("options.disableNotification",null==t?void 0:t.disableNotification,l.BOOLEAN)&&m("options.pushConfig",null==t?void 0:t.pushConfig,l.OBJECT)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),i.debug(h.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS&&u?[2,{code:c,data:Ce(u)}]:c===r.SUCCESS?[2,{code:c}]:(i.warn(h.O,"recall message fail ->".concat(c,":").concat(Qe[c],",").concat(a)),[2,{code:c,msg:Qe[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("options",t,(function(e){return g(e)&&e.length}),!0)&&!t.some((function(e){return!m("options.messageUId",e.messageUId,l.STRING,!0)||!m("options.sentTime",e.sentTime,l.NUMBER,!0)||!m("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(h.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"delete message fail ->".concat(a,":").concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",t,l.NUMBER,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(h.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(h.O,"clear message ->".concat(a,":").concat(Qe[a],",").concat(n)),[2,{code:a,msg:Qe[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("expansion",e,l.OBJECT,!0)&&m("message",t,l.OBJECT,!0)&&m("message.conversationType",t.conversationType,l.NUMBER,!0)&&m("message.targetId",t.targetId,l.STRING,!0)&&m("message.channelId",t.channelId,l.CHANNEL_ID)&&m("message.messageUId",t.messageUId,l.STRING,!0)&&m("message.expansion",t.expansion,l.OBJECT)&&m("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),i.debug(h.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==r.SUCCESS?(i.warn(h.O,"update message expansion fail ->".concat(l,":").concat(Qe[l],",").concat(f)),[2,{code:l,msg:Qe[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("keys",e,l.ARRAY,!0)&&m("message",t,l.OBJECT,!0)&&m("message.conversationType",t.conversationType,l.NUMBER,!0)&&m("message.targetId",t.targetId,l.STRING,!0)&&m("message.channelId",t.channelId,l.CHANNEL_ID)&&m("message.messageUId",t.messageUId,l.STRING,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),i.debug(h.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==r.SUCCESS?(i.warn(h.O,"remove message expansion fail ->".concat(f,":").concat(Qe[f],",").concat(d)),[2,{code:f,msg:Qe[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("typingContentType",t,l.STRING,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d;return D(this,(function(f){switch(f.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=i.createTraceId(),i.info(h.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=f.sent(),c=s.code,u=s.data,d=c===r.SUCCESS?"info":"warn",i[d](h.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:Ce(u)}]:[2,{code:c,msg:Qe[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return m("messageUId",t,l.STRING,!0)&&m("targetId",e,l.STRING,!0)&&m("channelId",n,l.CHANNEL_ID)?[2,Ge((function(i,a){return B(o,void 0,void 0,(function(){var o,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(h.O,"get message reader ->".concat(o)),[4,i.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS?[2,{code:c,data:u}]:(a.warn(h.O,"get message reader fail ->".concat(c,":").concat(Qe[c],",").concat(o)),[2,{code:c,msg:Qe[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Po(e,t,n,o,r){return be((function(i,a){return f("messageType",e,l.STRING,!0),f("isPersited",t,l.BOOLEAN,!0),f("isCounted",n,l.BOOLEAN,!0),f("isStatusMessage",r,l.BOOLEAN,!1),f("searchProps",o,l.ARRAY),a.info(h.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),In(e,t,n)}))}function wo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("conversation",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),i=t.code,a=t.data,i===r.SUCCESS?(s=a&&Ce(a)||null,[2,{code:i,data:s}]):(o.warn(h.O,"insertMessage ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Lo(e,t,n){return void 0===n&&(n={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return ye("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",t,l.OBJECT,!0)&&m("options",n,l.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,l.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,l.STRING)&&m("content.senderUserId",t.senderUserId,l.STRING,!0)&&m("content.messageType",t.messageType,l.STRING,!0)&&m("content.content",t.content,l.OBJECT,!0)&&m("content.messageDirection",t.messageDirection,l.NUMBER,!0)&&m("content.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN)&&m("content.expansion",t.expansion,l.OBJECT)&&m("content.disableNotification",t.disableNotification,l.BOOLEAN)&&m("content.sentTime",t.sentTime,l.NUMBER)&&m("content.sentStatus",t.sentStatus,l.NUMBER)?[2,Ge((function(i,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,R,m,E,S,p,T;return D(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,f=t.canIncludeExpansion,l=t.expansion,g=t.disableNotification,v=t.sentTime,I=t.sentStatus,a.info(h.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),R=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:I,searchContent:m,isUnread:R,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,E)];case 1:return S=O.sent(),p=S.code,T=S.data,p===r.SUCCESS?[2,{code:p,data:Ce(T)}]:(a.warn(h.O,"insertMessage ->code:".concat(p,",targetId:").concat(e.targetId)),[2,{code:p,msg:Qe[p]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Bo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("messageId",e,(function(e){return s(e)||N(e)}),!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:Ce(a)}]:(o.warn(h.O,"getMessage ->code:".concat(i,",messageId:").concat(e)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Do(e){if(!M())return{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,i=e.channelId;return m("conversation",e,l.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,i),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Ce(e))})),{code:r.SUCCESS,data:a}},we?t(we,Be,Le):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function bo(e,t,n,o){return B(this,void 0,void 0,(function(){var i=this;return D(this,(function(a){return ye("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",t,l.STRING,!0)&&m("timestamp",n,l.NUMBER)&&m("count",o,l.NUMBER)?[2,Ge((function(a,s){return B(i,void 0,void 0,(function(){var i,c,u,d;return D(this,(function(f){switch(f.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return i=f.sent(),c=i.code,u=i.data,c===r.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(Ce(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(h.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Qe[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Go(e,t,n){return B(this,void 0,void 0,(function(){var o,i,a,s=this;return D(this,(function(c){return ye("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),M()?(o=e.conversationType,i=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",i,l.STRING,!0)&&m("timestamp",t,l.NUMBER,!0)&&m("cleanSpace",n,l.BOOLEAN)?[2,Ge((function(c,u){return B(s,void 0,void 0,(function(){var s;return D(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,i,t,n,a)];case 1:return s=d.sent(),u.debug(h.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:i,channelId:a,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(h.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function ko(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return ye("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),M()?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return t=e.conversationType,i=e.targetId,a=e.channelId,o.info(h.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(t)),[4,n.clearMessages(t,i,a)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(h.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function xo(e,t,n,o){return B(this,void 0,void 0,(function(){var i=this;return D(this,(function(a){return ye("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),M()?[2,Ge((function(a,s){return B(i,void 0,void 0,(function(){var i,c,u;return D(this,(function(d){switch(d.label){case 0:return s.info(h.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return i=d.sent(),c=i.code,u=i.data,c===r.SUCCESS?[2,{code:c,data:u}]:(s.warn(h.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Qe[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Vo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",t,l.NUMBER)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c;return D(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,i.info(h.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===r.SUCCESS?[2,{code:c}]:(i.warn(h.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Qe[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Ho(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return ye("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",t,l.NUMBER,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return i.info(h.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===r.SUCCESS?[2,{code:n}]:(i.warn(h.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:Qe[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}function Fo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("tag.tagId",e.tagId,l.STRING,!0)&&m("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&m("tag.tagName",e.tagName,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(i){switch(i.label){case 0:return o.info(h.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(h.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Qe[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("tagId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(i){switch(i.label){case 0:return o.info(h.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(h.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Qe[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("tag.tagId",e.tagId,l.STRING,!0)&&m("tag.tagName",e.tagName,l.STRING,!0)&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(i){switch(i.label){case 0:return o.info(h.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(h.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Qe[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i;return D(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,i=e.data,n.warn(h.O,"getTagList ->code:".concat(o)),[2,{code:r.SUCCESS,data:i}]}}))}))}))]}))}))}function zo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return m("conversation",e,l.CONVERSATION,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return o.info(h.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:[2,{code:i,msg:Qe[i]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ko(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return i.info(h.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(h.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Qe[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return i.info(h.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(h.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Qe[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("conversation",e,l.CONVERSATION,!0)&&m("tagIds",t,l.ARRAY,!0)&&!t.some((function(e){return!m("tagId",e,l.STRING,!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return i.info(h.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(h.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:Qe[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Wo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,l.CONVERSATION,!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n;return D(this,(function(a){switch(a.label){case 0:return i.info(h.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(h.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Qe[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xo(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return m("tagId",e,l.STRING,!0)&&m("count",t,l.NUMBER,!0)&&m("startTime",n,l.NUMBER,!0)?[2,Ge((function(i,a){return B(o,void 0,void 0,(function(){var o,s,c;return D(this,(function(u){switch(u.label){case 0:return a.info(h.O,"getConversationListByTag ->tagId:".concat(e)),[4,i.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===r.SUCCESS?[2,{code:s,data:null==c?void 0:c.map((function(e){return function(e){return L(L({},Ae(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(h.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:Qe[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return m("tagId",e,l.STRING,!0)&&m("containMuted",t,l.BOOLEAN,!0)?[2,Ge((function(o,r){return B(n,void 0,void 0,(function(){var n,i,a;return D(this,(function(s){switch(s.label){case 0:return r.info(h.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=s.sent(),i=n.code,a=n.data,[2,{code:i,data:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $o(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return m("tagId",e,l.STRING,!0)&&m("conversation",t,l.CONVERSATION,!0)&&m("status.isTop",n,l.BOOLEAN,!0)?[2,Ge((function(i,a){return B(o,void 0,void 0,(function(){var o;return D(this,(function(s){switch(s.label){case 0:return a.info(h.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,i.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===r.SUCCESS?[2,{code:o}]:(a.warn(h.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Qe[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}fo(y.COMBINE_HTML,(function(e,t){return new Tn({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var er={COMET:"comet",WEBSOCKET:"websocket"},tr={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"};var nr=Object.freeze({__proto__:null,getAllConversationList:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("channelId",e,l.CHANNEL_ID)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a,s;return D(this,(function(c){switch(c.label){case 0:return o.info(h.O,"getAllConversationList -> channelId: ".concat(e)),w(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=c.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=c.sent(),c.label=4;case 4:return i=t.code,a=t.data,i===r.SUCCESS&&a?(s=a.map((function(e){return Ae(e)})),[2,{code:i,data:s}]):(o.warn(h.O,"getAllConversationList fail -> code: ".concat(i," channelId: ").concat(e)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return M()?m("startTime",e,l.NUMBER,!0)&&m("count",t,l.NUMBER,!0)&&m("channelId",n,l.CHANNEL_ID)?[2,Ge((function(i,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(h.O,"getConversationList -> ".concat(o)),w(n)?[4,i.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(c,e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===r.SUCCESS&&d?(f=d.map((function(e){return Ae(e)})),[2,{code:u,data:f}]):(a.warn(h.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:Qe[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return B(this,void 0,void 0,(function(){var i=this;return D(this,(function(a){return M()?m("keyword",t,l.STRING,!0)&&m("messageTypes",n,l.ARRAY,!0)&&m("channelId",o,l.CHANNEL_ID)&&!n.some((function(e){return!m("messageType",e,l.STRING,!0)}))?[2,Ge((function(a,s){return B(i,void 0,void 0,(function(){var i,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return i="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),s.info(h.O,"searchConversationByContent -> ".concat(e)),w(o)?[4,a.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,a.searchConversationByContent(t,n,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===r.SUCCESS&&d?(f=d.map((function(e){return Ae(e)})),[2,{code:u,data:f}]):(s.warn(h.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(i)),[2,{code:u,msg:Qe[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return B(this,void 0,void 0,(function(){var i=this;return D(this,(function(a){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("keyword",t,l.STRING,!0)&&m("startTime",n,l.NUMBER,!0)&&m("count",o,l.NUMBER,!0)?[2,Ge((function(a,s){return B(i,void 0,void 0,(function(){var i,c,u,d,f,l,g,v,I,R;return D(this,(function(m){switch(m.label){case 0:return i="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(h.O,"searchMessages -> ".concat(i)),c=e.targetId,u=e.conversationType,d=e.channelId,w(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:f=m.sent(),m.label=4;case 4:return l=f.code,g=f.data,l===r.SUCCESS&&g?(v=g.messages,I=g.count,R=v.map((function(e){return Ce(e)})),[2,{code:l,data:{messages:R,count:I}}]):(s.warn(h.O,"searchMessages fail -> code: ".concat(l," ").concat(i)),[2,{code:l,msg:Qe[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("option",t,l.OBJECT,!0)&&m("option.keyword",t.keyword,l.STRING,!0)&&m("option.startTime",t.startTime,l.NUMBER,!0)&&m("option.endTime",t.endTime,l.NUMBER,!0)&&m("option.offset",t.offset,l.NUMBER)&&m("option.limit",t.limit,l.NUMBER)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v,I;return D(this,(function(R){switch(R.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(h.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,f=t.offset,l=t.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,f,l)];case 1:return g=R.sent(),v=g.code,I=g.data,v===r.SUCCESS&&I?[2,{code:v,data:{messages:I.messages.map((function(e){return Ce(e)}))}}]:(i.warn(h.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("option",t,l.OBJECT,!0)&&m("option.count",t.count,l.NUMBER)&&m("options.count",t.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}))&&m("option.timestamp",t.timestamp,l.NUMBER)&&m("option.order",t.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",t.messageTypes,l.ARRAY,!0)&&!t.messageTypes.some((function(e){return!m("option.messageType",e,l.STRING,!0)}))?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v,I,R,m,E,S;return D(this,(function(p){switch(p.label){case 0:return n=t.count,a=t.timestamp,s=t.order,c=t.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(h.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,n||(n=20),a||(a=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,a,n,c,s,l)];case 1:return g=p.sent(),v=g.code,I=g.data,v===r.SUCCESS?(m=(R=I).list,E=R.hasMore,S=m.map((function(e){return Ce(e)})),[2,{code:v,data:{messages:S,hasMore:E,list:S}}]):(i.warn(h.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:Qe[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("timestamp",t,l.NUMBER,!0)?[2,Ge((function(o,r){return B(n,void 0,void 0,(function(){var n,i,a,s;return D(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(h.O,"updateSentMsgReceiptStatus -> ".concat(n)),i=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(i,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("messageId",e,l.NUMBER,!0)&&m("receivedStatus",t,(function(e){return!w(i[e])}),!0)?[2,Ge((function(o,r){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return r.info(h.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("messageId",e,l.NUMBER,!0)&&m("sentStatus",t,(function(e){return!w(P[e])}),!0)?[2,Ge((function(o,r){return B(n,void 0,void 0,(function(){return D(this,(function(n){switch(n.label){case 0:return r.info(h.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return M()?m("messageId",e,l.NUMBER,!0)&&m("content",t,l.OBJECT,!0)&&m("messageType",n,l.ONLY_STRING,!0)?[2,Ge((function(r,i){return B(o,void 0,void 0,(function(){return D(this,(function(o){switch(o.label){case 0:return i.info(h.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?!m("messageIds",e,l.ARRAY,!0)||e.some((function(e){return!m("messageId",e,l.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return o.info(h.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,r,i;return D(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(h.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,i)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return B(this,void 0,void 0,(function(){var o,i,a,s=this;return D(this,(function(c){return M()?(o=e.conversationType,i=e.targetId,a=e.channelId,m("conversationType",o,l.NUMBER,!0)&&m("targetId",i,l.STRING,!0)&&m("timestamp",t,l.NUMBER,!0)&&m("cleanSpace",n,l.BOOLEAN)?[2,Ge((function(e,r){return B(s,void 0,void 0,(function(){return D(this,(function(r){switch(r.label){case 0:return[4,e.deleteMessagesByTimestamp(o,i,t,n,a)];case 1:return[2,{code:r.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(i){return M()?m("conversation",e,l.CONVERSATION,!0)&&m("message",t,l.OBJECT,!0)&&m("options",n,l.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,l.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,l.STRING)&&(t instanceof vn||m("message.senderUserId",t.senderUserId,l.STRING,!0)&&m("message.messageType",t.messageType,l.STRING,!0)&&m("message.content",t.content,l.OBJECT,!0)&&m("message.messageDirection",t.messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",t.expansion,l.OBJECT)&&m("message.disableNotification",t.disableNotification,l.BOOLEAN)&&m("message.sentTime",t.sentTime,l.NUMBER)&&m("message.sentStatus",t.sentStatus,l.NUMBER))?[2,Ge((function(i,a){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,R,m,E,S,p;return D(this,(function(T){switch(T.label){case 0:return o="",s=1,f=!1,g=t.messageType,v=t.content,t instanceof vn||(o=t.senderUserId,s=t.messageDirection,f=t.canIncludeExpansion,l=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(h.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,R=n.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:R,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=T.sent(),S=E.code,p=E.data,S===r.SUCCESS?[2,{code:S,data:Ce(p)}]:(a.warn(h.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:Qe[S]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return B(this,void 0,void 0,(function(){var i,s=this;return D(this,(function(c){if(!M())return[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}];if(!m("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!m("checkDuplicate",t,l.BOOLEAN))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];for(i in e)if(!(m("message",e[i],l.OBJECT,!0)&&m("message.conversationType",e[i].conversationType,(function(e){return[a.PRIVATE,a.DISCUSSION,a.GROUP,a.CUSTOMER_SERVICE,a.SYSTEM,a.APP_PUBLIC_SERVICE,a.PUBLIC_SERVICE].includes(e)}),!0)&&m("message.targetId",e[i].targetId,l.STRING,!0)&&m("message.senderUserId",e[i].senderUserId,l.STRING,!0)&&m("message.messageType",e[i].messageType,l.STRING,!0)&&m("message.content",e[i].content,l.OBJECT,!0)&&m("message.messageDirection",e[i].messageDirection,l.NUMBER,!0)&&m("message.canIncludeExpansion",e[i].canIncludeExpansion,l.BOOLEAN)&&m("message.expansion",e[i].expansion,l.OBJECT)&&m("message.disableNotification",e[i].disableNotification,l.BOOLEAN)&&m("message.sentTime",e[i].sentTime,l.NUMBER)&&m("message.sentStatus",e[i].sentStatus,l.NUMBER)&&m("options.isUnread",null===(n=e[i])||void 0===n?void 0:n.isUnread,l.BOOLEAN)&&m("options.searchContent",null===(o=e[i])||void 0===o?void 0:o.searchContent,l.STRING)))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER,msg:String(i)}];return[2,Ge((function(n){return B(s,void 0,void 0,(function(){var o,i,a;return D(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),i=o.code,a=o.data,i===r.SUCCESS?[2,{code:i,data:a}]:[2,{code:i,msg:Qe[i]}]}}))}))}))]}))}))},getMessageCount:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?[2,Ge((function(n){return B(t,void 0,void 0,(function(){var t,o,r,i,a,s;return D(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,[4,n.getMessageCount(t,o,r)];case 1:return i=c.sent(),a=i.code,s=i.data,[2,{code:a,data:s}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("messageUId",e,l.STRING,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t,i,a;return D(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(h.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(i,",messageUId:").concat(e)),[2,{code:i,msg:Qe[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?m("targetId",e,l.STRING,!0)&&m("messageUId",t,l.STRING,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(h.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?m("enableCheck",e,l.BOOLEAN)?[2,Ge((function(n){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return M()?[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(i){switch(i.label){case 0:return n.info(h.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qe[r.NOT_SUPPORT]}]}))}))}}),or=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};function rr(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return!e||m("proxy.socksHost",e.socksHost,l.STRING,!0)&&m("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,Ge((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(i){switch(i.label){case 0:return o.info(h.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(h.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:Qe[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ir(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,Ge((function(t,n){return B(e,void 0,void 0,(function(){var e,o,i;return D(this,(function(a){switch(a.label){case 0:return[4,t.getProxy()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS?[2,{code:o,data:i}]:(n.warn(h.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:Qe[o]}])}}))}))}))]}))}))}function ar(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!e||m("proxy.socksHost",e.socksHost,l.STRING,!0)&&m("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,Ge((function(o,i){return B(n,void 0,void 0,(function(){var n,a,s;return D(this,(function(c){switch(c.label){case 0:return i.info(h.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),a=n.status,s=n.data,a===r.SUCCESS?[2,{code:a,msg:s}]:(i.warn(h.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:Qe[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{vn as BaseMessage,Tn as CombineMessage,er as ConnectType,Te as Events,On as FileMessage,Nn as GIFMessage,En as HQVoiceMessage,mn as ImageMessage,Cn as LocationMessage,or as MentionedInfoBody,tr as MessageType,An as ReferenceMessage,yn as RichContentMessage,Sn as SightMessage,pn as TextMessage,_n as VoiceMessage,Ye as __addSDKVersion,Ko as addConversationsToTag,ke as addEventListener,Fo as addTag,dn as addToBlacklist,un as bindRTCRoomForChatroom,It as clearAllMessagesUnreadStatus,Fe as clearEventListeners,Co as clearHistoryMessages,ko as clearMessages,vt as clearMessagesUnreadStatus,ut as clearTextMessageDraft,Vo as clearUnreadCountByTimestamp,nt as connect,Go as deleteLocalMessagesByTimestamp,_o as deleteMessages,qe as destroy,ot as disconnect,nr as electronExtension,rn as forceRemoveChatRoomEntry,tn as forceSetChatRoomEntry,sn as getAllChatRoomEntries,yt as getAllConversationState,Ht as getAllUltraGroupUnreadCount,Ft as getAllUltraGroupUnreadMentionedCount,At as getAllUnreadMentionedCount,ln as getBlacklist,gn as getBlacklistStatus,Ut as getBlockUltraGroupList,Tt as getBlockedConversationList,an as getChatRoomEntry,Qt as getChatRoomInfo,cn as getChatroomHistoryMessages,Je as getConnectionStatus,it as getConversation,rt as getConversationList,St as getConversationNotificationLevel,pt as getConversationNotificationStatus,Xo as getConversationsFromTagByPage,Ke as getCurrentUserId,je as getDeviceId,ao as getFileToken,so as getFileUrl,wo as getFirstUnreadMessage,Ro as getHistoryMessages,Bo as getMessage,Uo as getMessageReader,ir as getProxy,mo as getRemoteHistoryMessages,ze as getServerTime,Jo as getTags,zo as getTagsFromConversation,st as getTextMessageDraft,Nt as getTopConversationList,dt as getTotalUnreadCount,ft as getTotalUnreadCountByLevels,lt as getTotalUnreadMentionedCountByLevels,kt as getUltraGroupDefaultNotificationLevel,qt as getUltraGroupFirstUnreadMessageTimestamp,Mt as getUltraGroupList,wt as getUltraGroupMessageListByMessageUId,Vt as getUltraGroupUnreadCountByTargetId,Gt as getUltraGroupUnreadMentionedCountByTargetId,Zt as getUltraGroupUnreadMentionedMessages,_t as getUnreadConversationList,gt as getUnreadCount,Qo as getUnreadCountByTag,Ct as getUnreadMentionedCount,Do as getUnreadMentionedMessages,Ze as init,Lo as insertMessage,We as installPlugin,jt as joinChatRoom,Wt as joinExistChatRoom,bt as modifyMessage,xe as onceEventListener,Xt as quitChatRoom,No as recallMessage,Po as registerMessageType,Dt as removeAllExpansionForUltraGroupMessage,on as removeChatRoomEntries,nn as removeChatRoomEntry,at as removeConversation,Yo as removeConversationsFromTag,Ve as removeEventListener,He as removeEventListeners,Bt as removeExpansionForUltraGroupMessage,fn as removeFromBlacklist,yo as removeMessageExpansionForKey,Zo as removeTag,Wo as removeTagFromConversations,jo as removeTagsFromConversation,ct as saveTextMessageDraft,xo as searchConversationByContent,bo as searchMessages,lo as sendFileMessage,vo as sendGIFMessage,Io as sendHQVoiceMessage,go as sendImageMessage,co as sendMessage,Eo as sendReadReceiptMessage,So as sendReadReceiptRequest,po as sendReadReceiptResponse,To as sendReadReceiptResponseV2,ho as sendSightMessage,Oo as sendSyncReadStatusMessage,uo as sendTextMessage,Mo as sendTypingStatusMessage,Pt as sendUltraGroupTypingStatus,en as setChatRoomEntries,$t as setChatRoomEntry,mt as setConversationNotificationLevel,Et as setConversationNotificationStatus,Ot as setConversationToTop,$o as setConversationToTopInTag,Ho as setMessageReceivedStatus,rr as setProxy,xt as setUltraGroupDefaultNotificationLevel,ar as testProxy,Lt as updateExpansionForUltraGroupMessage,Ao as updateMessageExpansion,qo as updateTag};
|