@rongcloud/imlib-next 5.8.0 → 5.8.2

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.esm.js CHANGED
@@ -1 +1 @@
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 l,AssertRules as f,isArray as g,isHttpUrl as v,APIContext as I,LogTagId as R,logger as h,ErrorCodes as E,validate as m,isValidConversationType as T,isValidNotificationLevel as S,NotificationLevel as p,isTypeInConversationList as O,UltraGroupChannelType as N,isString as _,MAX_UPLOAD_FILE_SIZE as C,UPLOAD_FILE_CHUNK_SIZE as A,UploadMethod as U,FileType as y,getUUID as M,isValidFileType as P,usingCppEngine as L,MessageDirection as w,SentStatus as B,isUndefined as D}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var b=function(e,t){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},b(e,t)};function G(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var V=function(){return V=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},V.apply(this,arguments)};function k(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 x(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 F=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))},H=F(),Z=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 J=null,q=function(e){return k(void 0,void 0,void 0,(function(){var t;return x(this,(function(n){switch(n.label){case 0:return[4,Y.getNetworkType()];case 1:return t=n.sent(),J({status:"online"===e.type,type:t}),[2]}}))}))};var Y={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(t){var n=Z(),o="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(r,u),a&&n.setRequestHeader)for(var s in a)n.setRequestHeader(s,a[s]);if(o){0!==e.timeout&&(n.timeout=i),n.onload=function(){t({data:n.responseText,status:n.status||200})},n.onerror=function(){t({status:n.status})},n.ontimeout=function(){t({status:n.status})};var d="object"==typeof c?JSON.stringify(c):c;n.send(d)}else n.onreadystatechange=function(){4===n.readyState&&t({data:n.responseText,status:n.status,xhr:n})},n.onerror=function(){t({status:n.status})},e.onProgress&&(n.upload.onprogress=function(t){return e.onProgress&&e.onProgress(t)}),0!==e.timeout&&setTimeout((function(){n.abort(),t({status:n.status})}),i),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:H,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){J=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",q),window.addEventListener("online",q))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",q),window.removeEventListener("online",q)),J=null}},K=F(),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)}}},j={setItem:z("setStorageSync"),getItem:z("getStorageSync"),removeItem:z("removeStorageSync"),clear:z("clearStorageSync")},X=null,W=function(e){var t=e.isConnected,n=e.networkType;X({status:t,type:n})};var Q={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:j,sessionStorage:j,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:K,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){X=e,wx.onNetworkStatusChange(W)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(W),X=null}},$=F(),ee=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){}}},te={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},ne=null,oe=function(e){var t=e.isConnected,n=e.networkType;ne({status:t,type:n})};var re={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),l=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:i,headers:s,timeout:a,data:u,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:te,sessionStorage:te,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$,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){ne=e,my.onNetworkStatusChange(oe)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(oe),ne=null}},ie=F(),ae=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){}}},se={setItem:ae("setStorageSync"),getItem:ae("getStorageSync"),removeItem:ae("removeStorageSync"),clear:ae("clearStorageSync")},ce=null,ue=function(e){var t=e.isConnected,n=e.networkType;ce({status:t,type:n})};var de={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ie,localStorage:se,sessionStorage:se,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){ce=e,tt.onNetworkStatusChange(ue)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(ue),ce=null}},le=F(),fe=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){}}},ge={setItem:fe("setStorageSync"),getItem:fe("getStorageSync"),removeItem:fe("removeStorageSync"),clear:fe("clearStorageSync")},ve=null,Ie=function(e){var t=e.isConnected,n=e.networkType;ve({status:t,type:n})};var Re={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:le,localStorage:ge,sessionStorage:ge,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 k(this,void 0,void 0,(function(){return x(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){ve=e,swan.onNetworkStatusChange(Ie)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Ie),ve=null}},he=F(),Ee=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)}}},me={setItem:Ee("setStorageSync"),getItem:Ee("getStorageSync"),removeItem:Ee("removeStorageSync"),clear:Ee("clearStorageSync")},Te=null,Se=function(e){var t=e.isConnected,n=e.networkType;Te({status:t,type:n})};var pe={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:me,sessionStorage:me,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:he,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){Te=e,jd.onNetworkStatusChange(Se)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Se),Te=null}},Oe=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)}}},Ne={setItem:Oe("setStorageSync"),getItem:Oe("getStorageSync"),removeItem:Oe("removeStorageSync"),clear:Oe("clearStorageSync")},_e=null,Ce=function(e){var t=e.isConnected,n=e.networkType;_e({status:t,type:n})};var Ae,Ue={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:Ne,sessionStorage:Ne,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){_e=e,uni.onNetworkStatusChange(Ce)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Ce),_e=null}},ye=function(e){return e&&e.request&&e.getSystemInfo},Me="undefined"!=typeof uni&&ye(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Ue;case"mp-jd":return pe;case"mp-baidu":return Re;case"mp-toutiao":return de;case"mp-alipay":return re;case"mp-weixin":return Q;default:return Y}}():"undefined"!=typeof jd&&ye(jd)?pe:"undefined"!=typeof my&&ye(my)?re:"undefined"!=typeof tt&&ye(tt)?de:"undefined"!=typeof swan&&ye(swan)?Re:"undefined"!=typeof wx&&ye(wx)?Q:Y;function Pe(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,l=e.receivedTime,f=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,R=e.isOffLineMessage,h=e.canIncludeExpansion,E=e.expansion,m=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,U=e.channelType,y=e.sentStatus;m||(m=i.UNREAD);var M={messageType:o,channelId:n||"",content:r,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:l,messageUId:f,messageDirection:g,isPersited:v,isCounted:I,isMentioned:S,disableNotification:T,isStatusMessage:p,canIncludeExpansion:h,expansion:E,receivedStatus:m,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:y};return t!==a.ULTRA_GROUP&&(M.isOffLineMessage=R),t===a.ULTRA_GROUP&&s(U)&&(M.channelType=U),M}function Le(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,l=e.isTop,f=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,I=e.unreadMentionedMeCount,R={conversationType:t,targetId:n,latestMessage:o&&Pe(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:l,channelId:f,unreadMentionedCount:g,matchCount:v,unreadMentionedMeCount:I};return R.conversationType===a.ULTRA_GROUP&&(R.firstUnreadMessage=e.firstUnreadMessage,R.channelType=e.channelType),R}function we(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"}(Ae||(Ae={}));var Be=new c,De={connection:function(e,t){switch(e){case u.CONNECTED:Be.emit(Ae.CONNECTED);break;case u.CONNECTING:Be.emit(Ae.CONNECTING);break;case u.SUSPENDED:Be.emit(Ae.SUSPEND,t);break;case u.DISCONNECTED:Be.emit(Ae.DISCONNECT,t)}},batchMessage:function(e){Be.emit(Ae.MESSAGES,{messages:e.map((function(e){return Pe(e)}))})},typingState:function(e){Be.emit(Ae.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){Be.emit(Ae.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){Be.emit(Ae.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Be.emit(Ae.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?Pe(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=be(e.unreadMessageCount||0),n.unreadMentionedCount=be(e.unreadMentionedCount||0),n.unreadMentionedMeCount=be(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));Be.emit(Ae.CONVERSATION,{conversationList:t})},chatroomState:function(e){Be.emit(Ae.CHATROOM,e)},expansion:function(e){Be.emit(Ae.EXPANSION,e)},pullFinished:function(){Be.emit(Ae.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Be.emit(Ae.TAG)},conversationTagChanged:function(){Be.emit(Ae.CONVERSATION_TAG)},messageBlocked:function(e){Be.emit(Ae.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Be.emit(Ae.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Be.emit(Ae.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Be.emit(Ae.ULTRA_GROUP_ENABLE,e.map((function(e){return Le(e)})))},operateStatus:function(e){Be.emit(Ae.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Pe(e)})))},ultraGroupMessageModified:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Pe(e)})))},ultraGroupMessageRecalled:function(e){Be.emit(Ae.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Pe(e)})))},ultraGroupChannelChangeType:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Be.emit(Ae.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Be.emit(Ae.USER_GROUP_STATUS,e)}};function be(e){return e>999?999:e}d.add("imlib-next","5.8.0");var Ge=null,Ve=null,ke=null;function xe(){return k(this,void 0,void 0,(function(){return x(this,(function(e){switch(e.label){case 0:return Ge?(ke.info(R.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),Ve=null,Ge=null,ke=null,[2]}}))}))}function Fe(e){if(!Ge)throw new Error("Not initialized yet!");return e(Ge,ke,Ve)}function He(e){return Ge?e(Ge,ke,Ve):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function Ze(e,t,n){Be.on(e,t,n)}function Je(e,t,n){Be.once(e,t,n)}function qe(e,t,n){Be.off(e,t,n)}function Ye(e){Be.removeAll(e)}function Ke(){Be.clear()}function ze(e){!function(e){var t,n=e.appkey,o=e.navigators;Ge?ke.warn(R.A_INIT_REPEAT_O):(l("options.appkey",e.appkey,f.STRING,!0),l("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(v))})),Ve=e,Ge=I.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||Me,{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}),(ke=Ge.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),ke.info(R.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.8.0",commit:"99986f10b8ff686903159afcffe9be7d7e8642df"})),Ge.assignWatcher(De),h.init(ke))}(e)}function je(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return Ge?(Ke(),[2,xe()]):[2]}))}))}function Xe(){return Fe((function(e){return e.getConnectionStatus()}))}function We(){return Fe((function(e){return e.getServerTime()}))}function Qe(){return Fe((function(e){return e.getCurrentUserId()}))}function $e(e,t){d.add(e,t)}function et(){return Fe((function(e){return e.getDeviceId()}))}function nt(e,t){return Fe((function(n){return n.install(e,t)}))}var ot={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:E.REJECTED_BY_BLACKLIST,msg:"Blacklisted by the other party"},MESSAGE_SENT_OVER_FREQUENCY:{code:E.MESSAGE_SENT_OVER_FREQUENCY,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:E.NOT_IN_GROUP,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:E.FORBIDDEN_IN_GROUP,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:E.NOT_IN_CHATROOM,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:E.FORBIDDEN_IN_CHATROOM,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:E.KICKED_FROM_CHATROOM,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:E.CHATROOM_NOT_EXIST,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:E.CHATROOM_IS_FULL,msg:"ChatRoom members exceeded"},CHATROOM_PARAMETER_INVALID:{code:E.CHATROOM_PARAMETER_INVALID,msg:"Invalid chatRoom parameters"},CHATROOM_ROAMING_SERVICE_UNAVAILABLE:{code:E.CHATROOM_ROAMING_SERVICE_UNAVAILABLE,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:E.RECALL_MESSAGE_PARAMETER_INVALID,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:E.MESSAGE_BLOCKED_BY_SENSITIVE_WORD,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:E.MESSAGE_SENSITIVE_WORD_REPLACED,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:E.CONNECTION_RELEASED,msg:"Please connect successfully first"},NAVIGATION_RESOURCE_ERROR:{code:E.NAVIGATION_RESOURCE_ERROR,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:E.CONNECTION_CREATED_ERROR,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:E.IDENTIFIER_REJECTED,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:E.SERVER_UNAVAILABLE,msg:"Mini program service is not open, Please go to the developer to open this service"},CONNECTION_ACK_TIMEOUT:{code:E.CONNECTION_ACK_TIMEOUT,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:E.TOKEN_INCORRECT,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:E.APP_NOT_AUTHORIZED,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},APP_BLOCKED_OR_DELETED:{code:E.APP_BLOCKED_OR_DELETED,msg:"AppKey is banned or deleted"},USER_BLOCKED:{code:E.USER_BLOCKED,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},PROTOCOL_MESSAGE_STORAGE_SERVICE_UNAVAILABLE:{code:E.PROTOCOL_MESSAGE_STORAGE_SERVICE_UNAVAILABLE,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},CONNECTION_EXIST:{code:E.CONNECTION_EXIST,msg:"Connection already exists"},CHATROOM_PROPERTY_OVERSIZE:{code:E.CHATROOM_PROPERTY_OVERSIZE,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_PROPERTY_EXISTED:{code:E.CHATROOM_PROPERTY_EXISTED,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:E.CHATROOM_PROPERTY_SERVICE_UNAVAILABLE,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_PROPERTY_NOT_EXIST:{code:E.CHATROOM_PROPERTY_NOT_EXIST,msg:"ChatRoom key does not exist"},MESSAGE_NOT_EXPANDABLE:{code:E.MESSAGE_NOT_EXPANDABLE,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:E.MESSAGE_EXPANSION_OVERSIZE,msg:"The message expansion size is beyond the limit"},PROTOCOL_PARAMETER_INVALID:{code:E.PROTOCOL_PARAMETER_INVALID,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_PROPERTY_NOT_ALL_SET:{code:E.CHATROOM_PROPERTY_NOT_ALL_SET,msg:"Chatroom kv store not all success"},CHATROOM_PROPERTY_BATCH_SET_OVERSIZE:{code:E.CHATROOM_PROPERTY_BATCH_SET_OVERSIZE,msg:"Chatroom kv's length is out of limit"},TAG_ALREADY_EXISTS:{code:E.TAG_ALREADY_EXISTS,msg:"The tag already exists"},TAG_NOT_EXIST:{code:E.TAG_NOT_EXIST,msg:"The tag does not exist"},NOT_SUPPORT:{code:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},rt={};for(var it in ot){var at=ot[it].code;rt[at]=it}function st(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return m("token",e,f.STRING,!0)&&m("reconnectKickEnable",t,f.BOOLEAN)?(n=i.createTraceId(),i.info(R.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](R.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:rt[a.code]}]}}))}))}))]}))}))}function ct(e){return h.info(R.A_DISCONNECT_O,{}),Fe((function(t){return t.disconnect(e)}))}function ut(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("options.count",null==e?void 0:e.count,f.NUMBER)&&m("options.startTime",null==e?void 0:e.startTime,f.NUMBER)&&m("options.order",null==e?void 0:e.order,f.NUMBER)&&m("channelId",t,f.CHANNEL_ID)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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 Le(e)}))}]:(i.warn(R.O,"get conversation list fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(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(R.O,"getConversation ->code:".concat(i,", targetId:").concat(e.targetId)),[2,{code:i,msg:rt[i]}]):[2,{code:i,data:a?Le(a):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i;return x(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(R.O,"destroy conversation ->".concat(i)),t!==r.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(t,":").concat(rt[t],",").concat(i)),[2,{code:t,msg:rt[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(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(R.O,"get draft ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a||""}]:(o.warn(R.O,"get draft fail ->".concat(i,":").concat(rt[i],",").concat(s)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("options",e,f.CONVERSATION,!0)&&m("draft",t,f.STRING,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(R.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(R.O,"set draft fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i;return x(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.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(R.O,"delete draft fail ->".concat(i,":").concat(rt[i],",").concat(t)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("includeMuted",e,f.BOOLEAN,!1)&&m("conversationTypes",t,f.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!m("conversationType",e,T)})))?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return i.debug(R.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(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return!m("conversationTypes",e,f.ARRAY,!0)||!m("levels",t,f.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,T)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]}))}))}function ht(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return!m("conversationTypes",e,f.ARRAY,!0)||!m("levels",t,f.ARRAY,!0)||e.some((function(e){return!m("conversationType",e,T)}))||t.some((function(e){return!m("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]}))}))}function Et(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(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(R.O,"get unreadCount ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(R.O,"get unreadCount fail ->".concat(i,":").concat(rt[i],",").concat(s)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i;return x(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(R.O,"clear unreadMsgNum ->".concat(i)),t!==r.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(t,":").concat(rt[t],",").concat(i)),[2,{code:t,msg:rt[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){return x(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}ot.PROTOCOL_MESSAGE_STORAGE_SERVICE_UNAVAILABLE.code;var St=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(R.O,"".concat(n," -> ").concat(o)),o},pt=function(e,t,n,o){return void 0===o&&(o=""),k(void 0,void 0,void 0,(function(){var i,a;return x(this,(function(s){switch(s.label){case 0:return i=St(e,t,o),[4,n()];case 1:return(a=s.sent())!==r.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(a," : ").concat(rt[a]," , ").concat(i)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))};function Ot(e,t){return k(this,void 0,void 0,(function(){return x(this,(function(n){return m("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return pt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nt(e,t){return k(this,void 0,void 0,(function(){return x(this,(function(n){return m("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return pt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(this,(function(c){switch(c.label){case 0:return t=St(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(R.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(rt[a]," , ").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(this,(function(s){switch(s.label){case 0:return o.info(R.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(R.O,"getConversationNotificationStatus ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return[2,He((function(e){return e.getBlockConversationList()}))]}))}))}function Ut(e,t){return void 0===t&&(t=!0),k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("options",e,f.CONVERSATION,!0)&&m("isTop",t,f.BOOLEAN)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(R.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(R.O,"set conversation status fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("conversationTypes",e,f.ARRAY)&&!(null==e?void 0:e.some((function(e){return!m("conversationType",e,T)})))&&m("channelId",t,f.CHANNEL_ID)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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 Le(e)}))}]:(i.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return!m("conversationTypes",e,f.ARRAY)||(null==e?void 0:e.some((function(e){return!m("conversationType",e,O)})))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,o,i;return x(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 Le(e)}))}]:[2,{code:o,msg:rt[o]}]}}))}))}))]}))}))}function Pt(e){return k(this,void 0,void 0,(function(){return x(this,(function(t){return m("options",e,f.CONVERSATION,!0)?[2,He((function(t,n){return n.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return[2,He((function(e,t){return t.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function wt(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return[2,He((function(e){return e.getAllConversationState()}))]}))}))}function Bt(e){return void 0===e&&(e={}),k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options.targetId",e.targetId,f.STRING,!1)&&m("options.channelType",e.channelType,(function(e){return void 0!==N[e]}),!1)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(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(R.O,"get ultragroup ->".concat(i,":").concat(rt[i])),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i;return x(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(R.O,"get block ultragroup ->".concat(o,":").concat(rt[o])),[2,{code:o,msg:rt[o]}])}}))}))}))]}))}))}function bt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(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(R.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(rt[t])),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("options",e,f.CONVERSATION,!0)&&m("msgs",t,f.ARRAY,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return x(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(),l=d.code,f=d.data,l===r.SUCCESS){for(v in g={},f)g[v]=f[v]?Pe(f[v]):void 0;return[2,{code:r.SUCCESS,data:g}]}return i.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(l,":").concat(rt[l])),[2,{code:l,msg:rt[l]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("expansion",e,f.OBJECT,!0)&&m("message",t,f.OBJECT,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return x(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,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),i.debug(R.O,"update expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(f)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(R.O,"update expansion for ultragroup message ->".concat(g,":").concat(rt[g])),[2,{code:g,msg:rt[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("expansion",e,f.ARRAY,!0)&&m("message",t,f.OBJECT,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return x(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,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),i.debug(R.O,"remove expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(f)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(R.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(rt[g])),[2,{code:g,msg:rt[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("message",e,f.OBJECT,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,l,f;return x(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(R.O,"remove all expansion for ultraGroup message ->".concat(d)),l={targetId:i,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return(f=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(f,":").concat(rt[f])),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("content",e,f.OBJECT,!0)&&m("message",t,f.OBJECT,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return x(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,l=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(s),i.debug(R.O,"update ultragroup message expansion ->".concat(f)),g={targetId:a,channelId:l,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(R.O,"modify ultraGroup message ->".concat(v,":").concat(rt[v])),[2,{code:v,msg:rt[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return i.debug(R.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(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(rt[a])),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("options.targetId",e.targetId,f.STRING,!0)&&m("options.channelId",e.channelId,f.CHANNEL_ID)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s,c;return x(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.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(R.O,"".concat(t," fail -> ").concat(s," : ").concat(rt[s]," , ").concat(i)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,f.STRING,!0)&&m("options.channelId",e.channelId,f.CHANNEL_ID,!0)&&m("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),i.debug(R.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(R.O,"".concat(n," fail -> ").concat(s," : ").concat(rt[s]," , ").concat(a)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.some((function(e){return!m("notificationLevel",e,S)})))?[2,He((function(o,r){return k(n,void 0,void 0,(function(){var n,i,a,s,c;return x(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(R.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i,a;return x(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(R.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(i,": ").concat(rt[i])),[2,{code:i,msg:rt[i]}])}}))}))}))]}))}))}function Kt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i,a;return x(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(R.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(i,": ").concat(rt[i])),[2,{code:i,msg:rt[i]}])}}))}))}))]}))}))}function zt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return e.channelId=e.channelId||"",m("options.targetId",e.targetId,f.STRING,!0)&&m("options.channelId",e.channelId,f.CHANNEL_ID,!0)&&m("options.sentTime",e.sentTime,f.NUMBER,!0)&&m("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,l;return x(this,(function(f){switch(f.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=f.sent(),d=u.code,l=u.data,d===r.SUCCESS?[2,{code:d,data:l}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(rt[d])),[2,{code:d,msg:rt[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("conversation.targetId",e.targetId,f.STRING,!0)&&m("conversation.channelId",e.channelId,f.CHANNEL_ID,!0)?[2,He((function(n){return k(t,void 0,void 0,(function(){var t,o,i,a,s,c;return x(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:rt[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xt(e){return k(this,void 0,void 0,(function(){var t,n=this;return x(this,(function(o){return m("targetIds",e,f.ARRAY,!0)&&m("targetIds.length",e,(function(e){return e.length>0&&e.length<20}))&&!e.some((function(e){return!m("targetId",e,f.STRING)}))?(t=e.filter((function(t,n){return e.indexOf(t)===n})),[2,He((function(e){return k(n,void 0,void 0,(function(){var n,o,i;return x(this,(function(a){switch(a.label){case 0:return[4,e.getUltraGroupUnreadInfoList(t)];case 1:return n=a.sent(),o=n.code,i=n.data,o===r.SUCCESS?[2,{code:o,data:i}]:[2,{code:o,msg:rt[o]}]}}))}))}))]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Wt=function(e){return!!(m("options.key",e.key,f.STRING,!0)&&m("options.value",e.value,f.STRING,!0)&&m("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)&&m("options.isSendNotification",e.isSendNotification,f.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,f.STRING))},Qt=function(e){return e.entries.every((function(e){return m("entry.key",e.key,f.STRING,!0)&&m("entry.value",e.value,f.STRING,!0)}))&&m("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,f.STRING)&&m("options.isForce",e.isForce,f.BOOLEAN)},$t=function(e){return m("options.key",e.key,f.STRING,!0)&&m("options.isSendNotification",e.isSendNotification,f.BOOLEAN)&&m("options.notificationExtra",e.notificationExtra,f.STRING)},en=function(e){return e.entries.every((function(e){return m("key",e,f.STRING,!0)}))&&m("options.notificationExtra",e.notificationExtra,f.STRING)};function tn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("options.count",t.count,f.NUMBER,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(R.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](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:rt[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("options.count",t.count,f.NUMBER,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(R.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](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:rt[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("targetId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(R.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](R.A_QUIT_CHATROOM_R,JSON.stringify({code:i}),t),i!==r.SUCCESS?[2,{code:i,msg:rt[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("options.count",t.count,f.NUMBER)&&m("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(R.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(R.O,"get chatroom info fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&Wt(t)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(R.O,"set chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&Qt(t)?t.entries.length>10?[2,ot.CHATROOM_KV_STORE_OUT_LIMIT]:[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(R.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(R.O,"set chatroom entry fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&Wt(t)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(R.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(R.O,"force set chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&$t(t)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(R.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(R.O,"remove chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&en(t)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.info(R.O,"remove chatroom entry->".concat(n)),(a=V({},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(R.O,"remove chatroom entry fail ->code+:".concat(rt[c],",").concat(n)),[2,{code:c,msg:rt[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&$t(t)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.info(R.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(R.O,"force remove chatroom entry fail ->code+:".concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(R.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(R.O,"get chatroom entry fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("targetId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(R.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(R.O,"get all chatroom entries fail ->code+:".concat(rt[a],",").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("targetId",e,f.STRING,!0)&&m("options.timestamp",t.timestamp,f.NUMBER)&&m("options.count",t.count,f.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,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.debug(R.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 Pe(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(i.warn(R.O,"get chatroom history message fail ->code+:".concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("option.chatRoomId",e.chatRoomId,f.STRING,!0)&&m("option.rtcRoomId",e.rtcRoomId,f.STRING,!0)?[2,He((function(n){return k(t,void 0,void 0,(function(){var t;return x(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:rt[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("userId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("userId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function En(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i;return x(this,(function(a){switch(a.label){case 0:return n.info(R.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(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function mn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("userId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(this,(function(s){switch(s.label){case 0:return o.info(R.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(R.O,"getBlacklistStatus fail -> code: ".concat(i,", userId: ").concat(e)),[2,{code:i}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Tn=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 Sn(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Tn(e,o,t,n)}}var pn,On=Sn("RC:ImgMsg"),Nn=Sn("RC:HQVCMsg"),_n=Sn("RC:SightMsg"),Cn=Sn("RC:TxtMsg"),An=Sn("RC:CombineMsg"),Un=Sn("RC:FileMsg"),yn=Sn("RC:GIFMsg"),Mn=Sn("RC:VcMsg"),Pn=Sn("RC:LBSMsg"),Ln=Sn("RC:ReferenceMsg"),wn=Sn("RC:ImgTextMsg");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(pn||(pn={}));var Bn,Dn,bn=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.upload=function(e){return e.file.size>C?Promise.resolve({code:r.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>A&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),Gn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return x(this,(function(u){switch(u.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,[4,this._getFileToken(o,t.name)];case 1:return i=u.sent(),a={},(s=new FormData).set("token",i.token),s.set("key",i.fileName),s.set("file",t),[4,Me.httpReq({url:/http/.test(this._url)?this._url:"https://".concat(this._url),headers:a,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"POST",body:s,timeout:0})];case 2:return 200===(c=u.sent().status)||204===c?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:U.QINIU}}]:[2,{code:r.UPLOAD_FAIL,msg:c.toString()}]}}))}))},t.prototype.multipartUpload=function(e){return k(this,void 0,void 0,(function(){return x(this,(function(e){throw new Error("Method not implemented.")}))}))},t}(bn),Vn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return x(this,(function(u){switch(u.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,[4,this._getFileToken(o)];case 1:return i=u.sent(),a="https://".concat(i.ossBucketName,".").concat(this._url),(s=new FormData).set("token",i.token),s.set("OSSAccessKeyId",i.osskeyId),s.set("policy",i.ossPolicy),s.set("Signature",i.ossSign),s.set("success_action_status","200"),s.set("key",i.fileName),s.set("file",t),[4,Me.httpReq({url:a,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"POST",body:s,timeout:0})];case 2:return 200===(c=u.sent().status)||204===c?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:U.ALI}}]:[2,{code:r.UPLOAD_FAIL,msg:c.toString()}]}}))}))},t.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},t}(bn),kn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c,u,d;return x(this,(function(l){switch(l.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,i=e.contentDisposition,[4,this._getFileToken(o<=y.FILE?o:y.FILE)];case 1:return a=l.sent(),s=i||("text/html"===t.type?"inline":"attachment"),c={authorization:a.bosToken,"x-bce-date":a.bosDate,"Content-Disposition":"".concat(s,"; filename=").concat(encodeURIComponent(t.name),";")},u=(/http/.test(this._url)?this._url:"https://".concat(this._url))+a.path,[4,Me.httpReq({url:u,headers:c,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"POST",body:t,timeout:0})];case 2:return 200===(d=l.sent().status)||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,downloadUrl:u}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},t.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},t}(bn),xn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c,u,d,l;return x(this,(function(f){switch(f.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,i=e.contentDisposition,[4,this._getFileToken(o,t.name)];case 1:return a=f.sent(),s={},c="https://".concat(a.s3BucketName,".").concat(this._url),u=new FormData,i?u.set("Content-Disposition",i):u.set("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),u.set("Content-Type",t.type),u.set("x-amz-credential",a.s3Credential),u.set("x-amz-algorithm",a.s3Algorithm),u.set("x-amz-date",a.s3Date),u.set("policy",a.s3Policy),u.set("x-amz-signature",a.s3Signature),u.set("key",a.fileName),u.set("file",t),[4,Me.httpReq({url:c,headers:s,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"POST",body:u,timeout:0})];case 2:return d=f.sent(),l=d.status,d.data,200===l||204===l?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.AWS}}]:[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]}}))}))},t.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},t}(bn),Fn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isSupportMultipart=!0,t}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return x(this,(function(u){switch(u.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,[4,this._getFileToken(o)];case 1:return i=u.sent(),a="https://".concat(this._url,"/").concat(i.minioBucketName,"/").concat(i.fileName),s=this.getBaseHeaders(t,i,e),[4,Me.httpReq({url:a,headers:s,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"PUT",body:t,timeout:0})];case 2:return 200===(c=u.sent().status)||204===c?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:U.MINIO}}]:[2,{code:r.UPLOAD_FAIL}]}}))}))},t.prototype.multipartUpload=function(e){var t;return k(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,d,l,f,g,v,I,R,h,E,m;return x(this,(function(T){switch(T.label){case 0:return n=e.file,e.onProgress,o=e.fileType,[4,this._getFileToken(o,n.name,"POST","uploads")];case 1:return i=T.sent(),a="https://".concat(this._url,"/").concat(i.stcBucketName,"/").concat(i.fileName),s=this.getBaseHeaders(n,i,e),[4,Me.httpReq({url:"".concat(a,"?uploads"),headers:s,method:"POST"})];case 2:return c=T.sent(),u=c.status,d=c.data,l=null===(t=null==d?void 0:d.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===t?void 0:t[1],200!==u&&204!==u||!l?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(a,n,l,i.fileName,e,f)]);case 3:return g=T.sent(),v=g.code,I=g.msg,v!==r.SUCCESS?[2,{code:v,msg:I}]:[4,this._getFileToken(o,i.fileName,"POST","uploadId=".concat(l))];case 4:return R=T.sent(),h=f.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),h="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(h,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(n,R,e),[4,Me.httpReq({url:"".concat(a,"?uploadId=").concat(l),headers:E,method:"POST",body:h})];case 5:return 200===(m=T.sent().status)||204===m?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:U.STC}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},t.prototype.requestUploadPart=function(e,t,n,o,i,a,s,c){return void 0===s&&(s=1),void 0===c&&(c=0),k(this,void 0,void 0,(function(){var u,d,l,f,g,v,I,R,h;return x(this,(function(E){switch(E.label){case 0:return c>=5?[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(u=(s-1)*A,d=Math.min(A,t.size-u),l="partNumber=".concat(s,"&uploadId=").concat(n),[4,this._getFileToken(i.fileType,o,"PUT",l)]);case 1:return f=E.sent(),g=t.slice(u,s*A),v=this.getBaseHeaders(t,f,i),[4,Me.httpReq({url:"".concat(e,"?").concat(l),headers:v,method:"PUT",body:g,onProgress:function(e){var n;return null===(n=null==i?void 0:i.onProgress)||void 0===n?void 0:n.call(i,u+e.loaded,t.size)},timeout:0})];case 2:return I=E.sent(),R=I.status,I.data,h=I.xhr,200===R||204===R?(a.push((null==h?void 0:h.getResponseHeader("ETag"))||""),u+d<t.size?[2,this.requestUploadPart(e,t,n,o,i,a,s+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(e,t,n,o,i,a,s,c+1)]}}))}))},t.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},t}(bn),Hn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isSupportMultipart=!0,t}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c;return x(this,(function(u){switch(u.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,[4,this._getFileToken(o)];case 1:return i=u.sent(),a="https://".concat(this._url,"/").concat(i.minioBucketName,"/").concat(i.fileName),s=this.getBaseHeaders(t,i,e),[4,Me.httpReq({url:a,headers:s,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"PUT",body:t,timeout:0})];case 2:return 200===(c=u.sent().status)||204===c?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:U.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:c.toString()}]}}))}))},t.prototype.multipartUpload=function(e){var t;return k(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,d,l,f,g,v,I,R,h,E,m;return x(this,(function(T){switch(T.label){case 0:return n=e.file,o=e.fileType,[4,this._getFileToken(o,n.name,"POST","uploads")];case 1:return i=T.sent(),a="https://".concat(this._url,"/").concat(i.minioBucketName,"/").concat(i.fileName),s=this.getBaseHeaders(n,i,e),[4,Me.httpReq({url:"".concat(a,"?uploads"),headers:s,method:"POST"})];case 2:return c=T.sent(),u=c.status,d=c.data,l=null===(t=null==d?void 0:d.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===t?void 0:t[1],200!==u&&204!==u||!l?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(a,n,l,i.fileName,e,f)]);case 3:return g=T.sent(),v=g.code,I=g.msg,v!==r.SUCCESS?[2,{code:v,msg:I}]:[4,this._getFileToken(o,i.fileName,"POST","uploadId=".concat(l))];case 4:return R=T.sent(),h=f.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),h="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(h,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(n,R,e),[4,Me.httpReq({url:"".concat(a,"?uploadId=").concat(l),headers:E,method:"POST",body:h,timeout:0})];case 5:return 200===(m=T.sent().status)||204===m?[2,{code:r.SUCCESS,data:{uniqueName:i.fileName,uploadMethod:U.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},t.prototype.requestUploadPart=function(e,t,n,o,i,a,s,c){return void 0===s&&(s=1),void 0===c&&(c=0),k(this,void 0,void 0,(function(){var u,d,l,f,g,v,I,R,h;return x(this,(function(E){switch(E.label){case 0:return c>=5?[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(u=(s-1)*A,d=Math.min(A,t.size-u),l="partNumber=".concat(s,"&uploadId=").concat(n),[4,this._getFileToken(i.fileType,o,"PUT",l)]);case 1:return f=E.sent(),g=t.slice(u,s*A),v=this.getBaseHeaders(t,f,i),[4,Me.httpReq({url:"".concat(e,"?").concat(l),headers:v,method:"PUT",body:g,timeout:0,onProgress:function(e){var n;return null===(n=null==i?void 0:i.onProgress)||void 0===n?void 0:n.call(i,u+e.loaded,t.size)}})];case 2:return I=E.sent(),R=I.status,h=I.xhr,200===R||204===R?(a.push((null==h?void 0:h.getResponseHeader("ETag"))||""),u+d<t.size?[2,this.requestUploadPart(e,t,n,o,i,a,s+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(e,t,n,o,i,a,s,c+1)]}}))}))},t.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},t}(bn),Zn=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isSupportMultipart=!0,t}return G(t,e),t.prototype.commonUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,i,a,s,c,u,d,l,f;return x(this,(function(g){switch(g.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,[4,this._getFileToken(o,t.name)];case 1:return i=g.sent(),a={},(s=new FormData).set("token",i.token),s.set("key",i.fileName),s.set("file",t),c=/http/.test(this._url)?this._url:"https://".concat(this._url),[4,Me.httpReq({url:c,headers:a,onProgress:function(e){return null==n?void 0:n(e.loaded,e.total)},method:"POST",body:s,timeout:0})];case 2:return u=g.sent(),d=u.status,l=u.data,200!==d&&204!==d||!l?[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]:(f=JSON.parse(l),[2,{code:r.SUCCESS,data:{uniqueName:f.rc_url.file_name,downloadUrl:"".concat(c,"/").concat(f.rc_url.path)}}])}}))}))},t.prototype.multipartUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,r,i;return x(this,(function(a){switch(a.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,r=M(),[4,this._getFileToken(o,t.name)];case 1:return i=a.sent().token,[2,this._requestUploadPart(r,t,i,n)]}}))}))},t.prototype._requestUploadPart=function(e,t,n,o,i){return void 0===i&&(i=0),k(this,void 0,void 0,(function(){var a,s,c,u,d,l,f,g,v,I;return x(this,(function(R){switch(R.label){case 0:return a=Math.min(A,t.size-i),s=e+t.name.substring(t.name.lastIndexOf(".")),c={Range:"bytes=".concat(i,"-").concat(i+a),"X-File-TransactionId":s,"X-File-Total-Size":t.size.toString()},u=t.slice(i,i+a),(d=new FormData).set("file",u,t.name),d.set("key",s),d.set("name",s),d.set("token",n),l=/http/.test(this._url)?this._url:"https://".concat(this._url),[4,Me.httpReq({url:l,headers:c,onProgress:function(e){return null==o?void 0:o(i+e.loaded,t.size)},method:"POST",body:d,timeout:0})];case 1:return f=R.sent(),g=f.status,v=f.data,200===g||204===g?i+a<t.size?[2,this._requestUploadPart(e,t,n,o,i+a)]:(I=JSON.parse(v),[2,{code:r.SUCCESS,data:{uniqueName:I.rc_url.file_name,downloadUrl:"".concat(l,"/").concat(I.rc_url.path)}}]):[2,{code:r.UPLOAD_FAIL,msg:g.toString()}]}}))}))},t}(bn);function Jn(e,t){return k(this,void 0,void 0,(function(){var n,o,i,a,s,c,u,d,l,f,g,v,I,R,h,E,m,T,S,p,O,N,_,C;return x(this,(function(A){switch(A.label){case 0:return n=t.getFileToken,o=t.serverType,i=t.customDomain,a=t.ossConfig,s=t.uploadServer,c=t.bosAddr,u=e.file,d=e.fileType,l=e.thumbnailConfig,f=function(e,t,n,o,r){if(n)return[{type:pn.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:pn.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var i=[];o&&i.push({type:pn.QINIU,url:o,p:"1"});r&&i.push({type:pn.BAIDU,url:r,p:"2"});return i}(a,0,i,s,c),0===f.length?[2,Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,zn(f,e,n,o)];case 1:return g=A.sent(),v=g.code,I=g.data,R=g.msg,v===r.SUCCESS&&I?[4,qn(e,t,I)]:[2,{code:v,msg:R}];case 2:return h=A.sent(),E={downloadUrl:h,uniqueName:(null==I?void 0:I.uniqueName)||"",name:u.name,size:u.size,type:u.type},d!==y.AUDIO?[3,5]:[4,u.arrayBuffer()];case 3:return[4,Yn(A.sent())];case 4:return m=A.sent(),T=m.duration,S=m.length,C=V(V({},E),{duration:T,length:S}),[2,{code:v,data:C}];case 5:return d!==y.IMAGE?[3,7]:[4,jn(u,l)];case 6:return p=A.sent(),O=p.thumbnail,N=p.width,_=p.height,C=V(V({},E),{thumbnail:O,width:N,height:_}),[2,{code:v,data:C}];case 7:return[2,{code:v,data:E}]}}))}))}function qn(e,t,n){return k(this,void 0,void 0,(function(){var o,r,i,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return o=t.getFileUrl,r=e.fileType,i=e.file,a=n.uploadMethod,s=n.downloadUrl,c=n.uniqueName,(u=s)?[3,2]:[4,o(r,c,i.name,void 0,a)];case 1:u=d.sent().downloadUrl,d.label=2;case 2:return[2,u]}}))}))}function Yn(e){return Dn=Dn||new AudioContext,new Promise((function(t,n){Dn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}var Kn=((Bn={})[pn.QINIU]=Gn,Bn[pn.ALIYUN]=Vn,Bn[pn.BAIDU]=kn,Bn[pn.S3]=xn,Bn[pn.STC]=Fn,Bn[pn.MINIO]=Hn,Bn[pn.RCX]=Zn,Bn);function zn(e,t,n,o,i){return void 0===i&&(i=[]),k(this,void 0,void 0,(function(){var a,s,c,u,d;return x(this,(function(l){switch(l.label){case 0:return 0===e.length?[2,Promise.resolve({code:r.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(i))})]:(a=e.shift(),[4,new Kn[a.type](a.url,n,o).upload(t)]);case 1:return s=l.sent(),c=s.code,u=s.data,d=s.msg,c!==r.SUCCESS?(i.push({type:a.type,url:a.url,code:c,msg:d}),[2,zn(e,t,n,o,i)]):[2,{code:c,data:u}]}}))}))}function jn(e,t){return new Promise((function(n,o){var r=document.createElement("canvas"),i=r.getContext("2d"),a=new Image;a.onload=function(o){var s=t||{},c=s.maxHeight,u=void 0===c?160:c,d=s.maxWidth,l=void 0===d?160:d,f=s.quality,g=void 0===f?.7:f,v=s.scale,I=void 0===v?1:v,R=Xn(a.width,a.height,{maxHeight:u,maxWidth:l,scale:I});r.width=Math.min(R.w,l),r.height=Math.min(R.h,u),i.drawImage(a,R.x,R.y,R.w,R.h);var h=r.toDataURL("string"==typeof e?"image/jpg":e.type,g);h=h.replace(/data:image\/[^;]+;base64,/,""),n({thumbnail:h,width:R.w,height:R.h})},a.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var Xn=function(e,t,n){var o,r,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,c=void 0===s?160:s,u=n.scale,d=e<t,l=0,f=0;return(d?t/e:e/t)>(void 0===u?1:u)?(d?(o=100,f=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-f}):(d?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-f})};function Wn(e,t,n,o){return He((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:rt[e]})}))}))}))}function Qn(e,t,n,o,i){return m("fileType",e,P,!0)&&m("filename",t,f.STRING)&&m("saveName",n,f.STRING)&&m("serverType",i,f.NUMBER)?He((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 $n(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(s){return[2,He((function(s,c){return k(o,void 0,void 0,(function(){var o,u,d,l,g,v,I,h,E,T,S,p;return x(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof Tn==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,ot.ILLGAL_PARAMS]):m("conversation",e,f.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,m("conversation.targetId",u,f.STRING,!0)&&m("conversation.conversationType",o,f.NUMBER,!0)&&m("conversation.channelId",d,f.CHANNEL_ID)&&m("options.isStatusMessage",null==n?void 0:n.isStatusMessage,f.BOOLEAN)&&m("options.disableNotification",null==n?void 0:n.disableNotification,f.BOOLEAN)&&m("options.pushContent",null==n?void 0:n.pushContent,f.STRING)&&m("options.pushData",null==n?void 0:n.pushData,f.STRING)&&m("options.isMentioned",null==n?void 0:n.isMentioned,f.BOOLEAN)&&m("options.mentionedType",null==n?void 0:n.mentionedType,f.NUMBER)&&m("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,f.ARRAY)&&m("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,f.ARRAY)&&m("options.isVoipPush",null==n?void 0:n.isVoipPush,f.BOOLEAN)&&m("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,f.BOOLEAN)&&m("options.expansion",null==n?void 0:n.expansion,f.OBJECT)&&m("options.pushConfig",null==n?void 0:n.pushConfig,f.OBJECT)&&m("options.messageId",null==n?void 0:n.messageId,f.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(l)),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,l=e.isVoipPush,f=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,R=e.messageId,h=n.channelId;return V({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:l,canIncludeExpansion:f,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:h||"",messageId:R},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:w.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:i.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:B.SENDING},o!==a.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Pe(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:t.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,s.sendMessage(o,u,g,h,I)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=O.sent(),T=E.code,S=E.data,T===r.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:T,messageUId:S.messageUId,messageId:S.messageId}),I),p=Pe(S),[2,{code:T,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(T,":").concat(rt[T],",").concat(l)),v.sentTime=(null==S?void 0:S.sentTime)||0,v.sentStatus=null==S?void 0:S.sentStatus,[2,{code:T,msg:rt[T],data:Pe(v)}])}}))}))}))]}))}))}function eo(e,t,n){return $n(e,new Cn(t),n)}function to(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,f.NUMBER)&&m("sendOptions.maxWidth",null==c?void 0:c.maxWidth,f.NUMBER)&&m("sendOptions.quality",null==c?void 0:c.quality,f.NUMBER)&&m("sendOptions.scale",null==c?void 0:c.scale,f.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return He((function(c,u,d){return new Promise((function(c){var d,l=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),(d={file:o.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==i?void 0:i.onProgress)||void 0===n||n.call(i,Math.floor(e/t*100))},contentDisposition:s.contentDisposition,thumbnailConfig:s.thumbnailConfig},He((function(e,t,n){return new Promise((function(t){var o=e.getNaviInfoFromCache();Jn(d,{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:n.uploadDomain||"",serverType:null==o?void 0:o.type,ossConfig:null==o?void 0:o.ossConfig,uploadServer:null==o?void 0:o.uploadServer,bosAddr:null==o?void 0:o.bosAddr}).then((function(e){t(e)}))}))}))).then((function(e){var s,d=e.code,f=e.data,g=e.msg;if(d===r.SUCCESS&&f){var v=(null===(s=null==i?void 0:i.onComplete)||void 0===s?void 0:s.call(i,V({url:f.downloadUrl},f)))||t(f,o);return u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:r.SUCCESS}),l),void $n(n,v,a).then(c)}c({code:d,msg:g})}))}))}))}}var no=to(y.FILE,(function(e,t){return new Un({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})),oo=to(y.IMAGE,(function(e,t){return new On({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),ro=to(y.IMAGE,(function(e,t){return new yn({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),io=to(y.AUDIO,(function(e,t){return new Nn({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),ao=to(y.SIGHT,(function(e,t){return new _n({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 so(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&m("options.count",null==t?void 0:t.count,f.NUMBER)&&(L()||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,f.CONVERSATION,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n=i.createTraceId(),i.info(R.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 Pe(e)})),i.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function co(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&m("options.count",null==t?void 0:t.count,f.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,f.CONVERSATION,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(R.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 Pe(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(R.O,"get history message fail ->".concat(s,":").concat(rt[s],",").concat(n)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function uo(e,t,n,o){return k(this,void 0,void 0,(function(){var i=this;return x(this,(function(s){return m("targetId",e,f.STRING,!0)&&m("messageUId",t,f.STRING,!0)&&m("timestamp",n,f.NUMBER,!0)&&m("channelId",o,f.CHANNEL_ID)?[2,He((function(r){return k(i,void 0,void 0,(function(){var r,i,s,c,u;return x(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:a.PRIVATE,channelId:o},i=new Tn("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,$n(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 lo(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return m("messageUId",t,f.STRING,!0)&&m("targetId",e,f.STRING,!0)&&m("channelId",n,f.CHANNEL_ID)?[2,He((function(r,i){return k(o,void 0,void 0,(function(){var o,r,s,c,u;return x(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(R.O,"send read receipt message ->".concat(o)),r=new Tn("RC:RRReqMsg",{messageUId:t}),[4,$n({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 fo(e,t,n){return k(this,void 0,void 0,(function(){return x(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function go(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return m("targetId",e,f.STRING,!0)&&m("messageList",t,f.OBJECT,!0)&&m("channelId",n,f.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!m(e,t[e],f.ARRAY)}))?[2,He((function(i,s){return k(o,void 0,void 0,(function(){var o,c,u,d,l,f;return x(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(R.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 1:return c=g.sent(),[3,4];case 2:return l=new Tn("RC:RRRspMsg",{receiptMessageDic:t}),[4,$n(o,l)];case 3:c=g.sent(),g.label=4;case 4:return(f=c.code)===r.SUCCESS?[2,{code:f}]:(s.warn(R.O,"send read receipt message fail ->".concat(f,":").concat(rt[f])),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,t){return k(this,void 0,void 0,(function(){var n,o,i,a;return x(this,(function(s){switch(s.label){case 0:return m("conversation",e,f.CONVERSATION,!0)&&m("lastMessageSendTime",t,f.NUMBER,!0)?(n=new Tn("RC:SRSMsg",{lastMessageSendTime:t}),[4,$n(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 Io(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("options.messageUId",t.messageUId,f.STRING,!0)&&m("options.sentTime",t.sentTime,f.NUMBER,!0)&&m("options.disableNotification",null==t?void 0:t.disableNotification,f.BOOLEAN)&&m("options.pushConfig",null==t?void 0:t.pushConfig,f.OBJECT)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(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(R.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:Pe(u)}]:c===r.SUCCESS?[2,{code:c}]:(i.warn(R.O,"recall message fail ->".concat(c,":").concat(rt[c],",").concat(a)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("options",t,(function(e){return g(e)&&e.length}),!0)&&!t.some((function(e){return!m("options.messageUId",e.messageUId,f.STRING,!0)||!m("options.sentTime",e.sentTime,f.NUMBER,!0)||!m("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(R.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(R.O,"delete message fail ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("timestamp",t,f.NUMBER,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(R.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(R.O,"clear message ->".concat(a,":").concat(rt[a],",").concat(n)),[2,{code:a,msg:rt[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("expansion",e,f.OBJECT,!0)&&m("message",t,f.OBJECT,!0)&&m("message.conversationType",t.conversationType,f.NUMBER,!0)&&m("message.targetId",t.targetId,f.STRING,!0)&&m("message.channelId",t.channelId,f.CHANNEL_ID)&&m("message.messageUId",t.messageUId,f.STRING,!0)&&m("message.expansion",t.expansion,f.OBJECT)&&m("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f;return x(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,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),i.debug(R.O,"update message expansion ->".concat(l)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(f=g.sent().code)!==r.SUCCESS?(i.warn(R.O,"update message expansion fail ->".concat(f,":").concat(rt[f],",").concat(l)),[2,{code:f,msg:rt[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("keys",e,f.ARRAY,!0)&&m("message",t,f.OBJECT,!0)&&m("message.conversationType",t.conversationType,f.NUMBER,!0)&&m("message.targetId",t.targetId,f.STRING,!0)&&m("message.channelId",t.channelId,f.CHANNEL_ID)&&m("message.messageUId",t.messageUId,f.STRING,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l;return x(this,(function(f){switch(f.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(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(l=f.sent().code)!==r.SUCCESS?(i.warn(R.O,"remove message expansion fail ->".concat(l,":").concat(rt[l],",").concat(d)),[2,{code:l,msg:rt[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("typingContentType",t,f.STRING,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d;return x(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=i.createTraceId(),i.info(R.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=l.sent(),c=s.code,u=s.data,d=c===r.SUCCESS?"info":"warn",i[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:Pe(u)}]:[2,{code:c,msg:rt[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return m("messageUId",t,f.STRING,!0)&&m("targetId",e,f.STRING,!0)&&m("channelId",n,f.CHANNEL_ID)?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c,u;return x(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(R.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(R.O,"get message reader fail ->".concat(c,":").concat(rt[c],",").concat(o)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e,t,n,o,r){return Fe((function(i,a){return l("messageType",e,f.STRING,!0),l("isPersited",t,f.BOOLEAN,!0),l("isCounted",n,f.BOOLEAN,!0),l("isStatusMessage",r,f.BOOLEAN,!1),l("searchProps",o,f.ARRAY),a.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),Sn(e,t,n)}))}function Oo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?m("conversation",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(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&&Pe(a)||null,[2,{code:i,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function No(e,t,n){return void 0===n&&(n={}),k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return we("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),L()?m("conversation",e,f.CONVERSATION,!0)&&m("message",t,f.OBJECT,!0)&&m("options",n,f.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,f.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,f.STRING)&&m("content.senderUserId",t.senderUserId,f.STRING,!0)&&m("content.messageType",t.messageType,f.STRING,!0)&&m("content.content",t.content,f.OBJECT,!0)&&m("content.messageDirection",t.messageDirection,f.NUMBER,!0)&&m("content.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN)&&m("content.expansion",t.expansion,f.OBJECT)&&m("content.disableNotification",t.disableNotification,f.BOOLEAN)&&m("content.sentTime",t.sentTime,f.NUMBER)&&m("content.sentStatus",t.sentStatus,f.NUMBER)?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,I,h,E,m,T,S,p;return x(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,l=t.canIncludeExpansion,f=t.expansion,g=t.disableNotification,v=t.sentTime,I=t.sentStatus,a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,E=n.searchContent,m={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:I,searchContent:E,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,m)];case 1:return T=O.sent(),S=T.code,p=T.data,S===r.SUCCESS?[2,{code:S,data:Pe(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:rt[S]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function _o(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?m("messageId",e,(function(e){return s(e)||_(e)}),!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(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:Pe(a)}]:(o.warn(R.O,"getMessage ->code:".concat(i,",messageId:").concat(e)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function Co(e){if(!L())return{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,i=e.channelId;return m("conversation",e,f.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,i),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Pe(e))})),{code:r.SUCCESS,data:a}},Ge?t(Ge,ke,Ve):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function Ao(e,t,n,o){return k(this,void 0,void 0,(function(){var i=this;return x(this,(function(a){return we("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),L()?m("conversation",e,f.CONVERSATION,!0)&&m("keyword",t,f.STRING,!0)&&m("timestamp",n,f.NUMBER)&&m("count",o,f.NUMBER)?[2,He((function(a,s){return k(i,void 0,void 0,(function(){var i,c,u,d;return x(this,(function(l){switch(l.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return i=l.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(Pe(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:rt[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function Uo(e,t,n){return k(this,void 0,void 0,(function(){var o,i,a,s=this;return x(this,(function(c){return we("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),L()?(o=e.conversationType,i=e.targetId,a=e.channelId,m("conversationType",o,f.NUMBER,!0)&&m("targetId",i,f.STRING,!0)&&m("timestamp",t,f.NUMBER,!0)&&m("cleanSpace",n,f.BOOLEAN)?[2,He((function(c,u){return k(s,void 0,void 0,(function(){var s;return x(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(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:i,channelId:a,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function yo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return we("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),L()?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(this,(function(c){switch(c.label){case 0:return t=e.conversationType,i=e.targetId,a=e.channelId,o.info(R.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(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function Mo(e,t,n,o){return k(this,void 0,void 0,(function(){var i=this;return x(this,(function(a){return we("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),L()?[2,He((function(a,s){return k(i,void 0,void 0,(function(){var i,c,u;return x(this,(function(d){switch(d.label){case 0:return s.info(R.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(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function Po(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("conversation",e,f.CONVERSATION,!0)&&m("timestamp",t,f.NUMBER)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,i.info(R.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(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function Lo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return we("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),L()?m("messageId",e,f.NUMBER,!0)&&m("receivedStatus",t,f.NUMBER,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return i.info(R.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(R.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))}function wo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("tag.tagId",e.tagId,f.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,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(i){switch(i.label){case 0:return o.info(R.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(R.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("tagId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(i){switch(i.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Do(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("tag.tagId",e.tagId,f.STRING,!0)&&m("tag.tagName",e.tagName,f.STRING,!0)&&m("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(i){switch(i.label){case 0:return o.info(R.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(R.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bo(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i;return x(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(R.O,"getTagList ->code:".concat(o)),[2,{code:r.SUCCESS,data:i}]}}))}))}))]}))}))}function Go(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return m("conversation",e,f.CONVERSATION,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(this,(function(s){switch(s.label){case 0:return o.info(R.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:rt[i]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("tagId",e,f.STRING,!0)&&m("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,f.CONVERSATION,!0)}))?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return i.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(R.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ko(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("tagId",e,f.STRING,!0)&&m("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,f.CONVERSATION,!0)}))?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return i.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("conversation",e,f.CONVERSATION,!0)&&m("tagIds",t,f.ARRAY,!0)&&!t.some((function(e){return!m("tagId",e,f.STRING,!0)}))?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return i.info(R.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(R.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("tagId",e,f.STRING,!0)&&m("conversations",t,f.ARRAY,!0)&&!t.some((function(e){return!m("conversation",e,f.CONVERSATION,!0)}))?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return i.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:rt[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ho(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return m("tagId",e,f.STRING,!0)&&m("count",t,f.NUMBER,!0)&&m("startTime",n,f.NUMBER,!0)?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c;return x(this,(function(u){switch(u.label){case 0:return a.info(R.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 V(V({},Le(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:rt[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return m("tagId",e,f.STRING,!0)&&m("containMuted",t,f.BOOLEAN,!0)?[2,He((function(o,r){return k(n,void 0,void 0,(function(){var n,i,a;return x(this,(function(s){switch(s.label){case 0:return r.info(R.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 Jo(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return m("tagId",e,f.STRING,!0)&&m("conversation",t,f.CONVERSATION,!0)&&m("status.isTop",n,f.BOOLEAN,!0)?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o;return x(this,(function(s){switch(s.label){case 0:return a.info(R.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(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:rt[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}to(y.COMBINE_HTML,(function(e,t){return new An({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var qo={COMET:"comet",WEBSOCKET:"websocket"},Yo={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 Ko=Object.freeze({__proto__:null,getAllConversationList:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?m("channelId",e,f.CHANNEL_ID)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a,s;return x(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),D(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 Le(e)})),[2,{code:i,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(i," channelId: ").concat(e)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return L()?m("startTime",e,f.NUMBER,!0)&&m("count",t,f.NUMBER,!0)&&m("channelId",n,f.CHANNEL_ID)?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d,l;return x(this,(function(f){switch(f.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(R.O,"getConversationList -> ".concat(o)),D(n)?[4,i.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=f.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(c,e,t,n)];case 3:s=f.sent(),f.label=4;case 4:return u=s.code,d=s.data,u===r.SUCCESS&&d?(l=d.map((function(e){return Le(e)})),[2,{code:u,data:l}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:rt[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return L()?m("keyword",e,f.STRING,!0)&&m("messageTypes",t,f.ARRAY,!0)&&m("channelId",n,f.CHANNEL_ID)&&!t.some((function(e){return!m("messageType",e,f.STRING,!0)}))?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d;return x(this,(function(l){switch(l.label){case 0:return o="keyword: ".concat(e,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(n),a.info(R.O,"searchConversationByContent -> ".concat(o)),D(n)?[4,i.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,i.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,u=s.data,c===r.SUCCESS&&u?(d=u.map((function(e){return Le(e)})),[2,{code:c,data:d}]):(a.warn(R.O,"searchConversationByContent fail -> code: ".concat(c," ").concat(o)),[2,{code:c,msg:rt[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return k(this,void 0,void 0,(function(){var i=this;return x(this,(function(a){return L()?m("conversation",e,f.CONVERSATION,!0)&&m("keyword",t,f.STRING,!0)&&m("startTime",n,f.NUMBER,!0)&&m("count",o,f.NUMBER,!0)?[2,He((function(a,s){return k(i,void 0,void 0,(function(){var i,c,u,d,l,f,g,v,I,h;return x(this,(function(E){switch(E.label){case 0:return i="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(i)),c=e.targetId,u=e.conversationType,d=e.channelId,D(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return l=E.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:l=E.sent(),E.label=4;case 4:return f=l.code,g=l.data,f===r.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return Pe(e)})),[2,{code:f,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(f," ").concat(i)),[2,{code:f,msg:rt[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("conversation",e,f.CONVERSATION,!0)&&m("option",t,f.OBJECT,!0)&&m("option.keyword",t.keyword,f.STRING,!0)&&m("option.startTime",t.startTime,f.NUMBER,!0)&&m("option.endTime",t.endTime,f.NUMBER,!0)&&m("option.offset",t.offset,f.NUMBER)&&m("option.limit",t.limit,f.NUMBER)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,I;return x(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(R.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,l=t.offset,f=t.limit,l=l||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,l,f)];case 1:return g=h.sent(),v=g.code,I=g.data,v===r.SUCCESS&&I?[2,{code:v,data:{messages:I.messages.map((function(e){return Pe(e)}))}}]:(i.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,o){return k(this,void 0,void 0,(function(){var i=this;return x(this,(function(a){return L()?m("conversation",e,f.CONVERSATION,!0)&&m("userId",t,f.STRING,!0)&&m("startTime",n,f.NUMBER,!0)&&m("count",o,f.NUMBER,!0)?[2,He((function(a,s){return k(i,void 0,void 0,(function(){var i,c,u,d,l,f,g;return x(this,(function(v){switch(v.label){case 0:return i="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(i)),c=e.conversationType,u=e.targetId,d=e.channelId,[4,a.searchMessagesByUser(c,u,t,n,o,d)];case 1:return l=v.sent(),f=l.code,g=l.data,f===r.SUCCESS&&g?[2,{code:f,data:{messages:g.messages.map((function(e){return Pe(e)}))}}]:(s.warn(R.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(f,", ").concat(i)),[2,{code:f}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("conversation",e,f.CONVERSATION,!0)&&m("option",t,f.OBJECT,!0)&&m("option.count",t.count,f.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,f.NUMBER)&&m("option.order",t.order,(function(e){return[0,1].includes(e)}))&&m("option.messageTypes",t.messageTypes,f.ARRAY,!0)&&!t.messageTypes.some((function(e){return!m("option.messageType",e,f.STRING,!0)}))?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,I,h,E,m,T;return x(this,(function(S){switch(S.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(R.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,l=e.targetId,f=e.channelId,n||(n=20),a||(a=0),s||(s=0),f||(f=""),[4,o.getHistoryMessagesByObjectNames(d,l,a,n,c,s,f)];case 1:return g=S.sent(),v=g.code,I=g.data,v===r.SUCCESS?(E=(h=I).list,m=h.hasMore,T=E.map((function(e){return Pe(e)})),[2,{code:v,data:{messages:T,hasMore:m,list:T}}]):(i.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:rt[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("conversation",e,f.CONVERSATION,!0)&&m("timestamp",t,f.NUMBER,!0)?[2,He((function(o,r){return k(n,void 0,void 0,(function(){var n,i,a,s;return x(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(R.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:rt[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("messageId",e,f.NUMBER,!0)&&m("receivedStatus",t,(function(e){return!D(i[e])}),!0)?[2,He((function(o,r){return k(n,void 0,void 0,(function(){return x(this,(function(n){switch(n.label){case 0:return r.info(R.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:rt[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("messageId",e,f.NUMBER,!0)&&m("sentStatus",t,(function(e){return!D(B[e])}),!0)?[2,He((function(o,r){return k(n,void 0,void 0,(function(){return x(this,(function(n){switch(n.label){case 0:return r.info(R.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:rt[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return L()?m("messageId",e,f.NUMBER,!0)&&m("content",t,f.OBJECT,!0)&&m("messageType",n,f.ONLY_STRING,!0)?[2,He((function(r,i){return k(o,void 0,void 0,(function(){return x(this,(function(o){switch(o.label){case 0:return i.info(R.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:rt[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?!m("messageIds",e,f.ARRAY,!0)||e.some((function(e){return!m("messageId",e,f.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,He((function(n,o){return k(t,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,r,i;return x(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(R.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:rt[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return k(this,void 0,void 0,(function(){var o,i,a,s=this;return x(this,(function(c){return L()?(o=e.conversationType,i=e.targetId,a=e.channelId,m("conversationType",o,f.NUMBER,!0)&&m("targetId",i,f.STRING,!0)&&m("timestamp",t,f.NUMBER,!0)&&m("cleanSpace",n,f.BOOLEAN)?[2,He((function(e,r){return k(s,void 0,void 0,(function(){return x(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:rt[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),k(this,void 0,void 0,(function(){var o=this;return x(this,(function(i){return L()?m("conversation",e,f.CONVERSATION,!0)&&m("message",t,f.OBJECT,!0)&&m("options",n,f.OBJECT)&&m("options.isUnread",null==n?void 0:n.isUnread,f.BOOLEAN)&&m("options.searchContent",null==n?void 0:n.searchContent,f.STRING)&&(t instanceof Tn||m("message.senderUserId",t.senderUserId,f.STRING,!0)&&m("message.messageType",t.messageType,f.STRING,!0)&&m("message.content",t.content,f.OBJECT,!0)&&m("message.messageDirection",t.messageDirection,f.NUMBER,!0)&&m("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN)&&m("message.expansion",t.expansion,f.OBJECT)&&m("message.disableNotification",t.disableNotification,f.BOOLEAN)&&m("message.sentTime",t.sentTime,f.NUMBER)&&m("message.sentStatus",t.sentStatus,f.NUMBER))?[2,He((function(i,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,I,h,E,m,T,S;return x(this,(function(p){switch(p.label){case 0:return o="",s=1,l=!1,g=t.messageType,v=t.content,t instanceof Tn||(o=t.senderUserId,s=t.messageDirection,l=t.canIncludeExpansion,f=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,h=n.searchContent,E={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,E)];case 1:return m=p.sent(),T=m.code,S=m.data,T===r.SUCCESS?[2,{code:T,data:Pe(S)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:rt[T]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return k(this,void 0,void 0,(function(){var i,s=this;return x(this,(function(c){if(!L())return[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}];if(!m("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!m("checkDuplicate",t,f.BOOLEAN))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];for(i in e)if(!(m("message",e[i],f.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,f.STRING,!0)&&m("message.senderUserId",e[i].senderUserId,f.STRING,!0)&&m("message.messageType",e[i].messageType,f.STRING,!0)&&m("message.content",e[i].content,f.OBJECT,!0)&&m("message.messageDirection",e[i].messageDirection,f.NUMBER,!0)&&m("message.canIncludeExpansion",e[i].canIncludeExpansion,f.BOOLEAN)&&m("message.expansion",e[i].expansion,f.OBJECT)&&m("message.disableNotification",e[i].disableNotification,f.BOOLEAN)&&m("message.sentTime",e[i].sentTime,f.NUMBER)&&m("message.sentStatus",e[i].sentStatus,f.NUMBER)&&m("options.isUnread",null===(n=e[i])||void 0===n?void 0:n.isUnread,f.BOOLEAN)&&m("options.searchContent",null===(o=e[i])||void 0===o?void 0:o.searchContent,f.STRING)))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER,msg:String(i)}];return[2,He((function(n){return k(s,void 0,void 0,(function(){var o,i,a;return x(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:rt[i]}]}}))}))}))]}))}))},getMessageCount:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?[2,He((function(n){return k(t,void 0,void 0,(function(){var t,o,r,i,a,s;return x(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:rt[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?m("messageUId",e,f.STRING,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t,i,a;return x(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(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(i,",messageUId:").concat(e)),[2,{code:i,msg:rt[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?m("targetId",e,f.STRING,!0)&&m("messageUId",t,f.STRING,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(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(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(a,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:rt[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?m("enableCheck",e,f.BOOLEAN)?[2,He((function(n){return k(t,void 0,void 0,(function(){return x(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:rt[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return L()?[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,r;return x(this,(function(i){switch(i.label){case 0:return n.info(R.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:rt[r.NOT_SUPPORT]}]}))}))}}),zo=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};function jo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return!e||m("proxy.socksHost",e.socksHost,f.STRING,!0)&&m("proxy.socksPort",e.socksPort,f.NUMBER,!0)?[2,He((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(i){switch(i.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:rt[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xo(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,He((function(t,n){return k(e,void 0,void 0,(function(){var e,o,i;return x(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(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:rt[o]}])}}))}))}))]}))}))}function Wo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return!e||m("proxy.socksHost",e.socksHost,f.STRING,!0)&&m("proxy.socksPort",e.socksPort,f.NUMBER,!0)?[2,He((function(o,i){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return i.info(R.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(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:rt[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Tn as BaseMessage,An as CombineMessage,qo as ConnectType,Ae as Events,Un as FileMessage,yn as GIFMessage,Nn as HQVoiceMessage,On as ImageMessage,Pn as LocationMessage,zo as MentionedInfoBody,Yo as MessageType,Ln as ReferenceMessage,wn as RichContentMessage,_n as SightMessage,Cn as TextMessage,Mn as VoiceMessage,$e as __addSDKVersion,Vo as addConversationsToTag,Ze as addEventListener,wo as addTag,Rn as addToBlacklist,In as bindRTCRoomForChatroom,Tt as clearAllMessagesUnreadStatus,Ke as clearEventListeners,ho as clearHistoryMessages,yo as clearMessages,mt as clearMessagesUnreadStatus,vt as clearTextMessageDraft,Po as clearUnreadCountByTimestamp,st as connect,Uo as deleteLocalMessagesByTimestamp,Ro as deleteMessages,je as destroy,ct as disconnect,Ko as electronExtension,ln as forceRemoveChatRoomEntry,cn as forceSetChatRoomEntry,gn as getAllChatRoomEntries,wt as getAllConversationState,Yt as getAllUltraGroupUnreadCount,Kt as getAllUltraGroupUnreadMentionedCount,Lt as getAllUnreadMentionedCount,En as getBlacklist,mn as getBlacklistStatus,Dt as getBlockUltraGroupList,At as getBlockedConversationList,fn as getChatRoomEntry,rn as getChatRoomInfo,vn as getChatroomHistoryMessages,Xe as getConnectionStatus,dt as getConversation,ut as getConversationList,_t as getConversationNotificationLevel,Ct as getConversationNotificationStatus,Ho as getConversationsFromTagByPage,Qe as getCurrentUserId,et as getDeviceId,Wn as getFileToken,Qn as getFileUrl,Oo as getFirstUnreadMessage,so as getHistoryMessages,_o as getMessage,So as getMessageReader,Xo as getProxy,co as getRemoteHistoryMessages,We as getServerTime,bo as getTags,Go as getTagsFromConversation,ft as getTextMessageDraft,yt as getTopConversationList,It as getTotalUnreadCount,Rt as getTotalUnreadCountByLevels,ht as getTotalUnreadMentionedCountByLevels,Zt as getUltraGroupDefaultNotificationLevel,jt as getUltraGroupFirstUnreadMessageTimestamp,Bt as getUltraGroupList,Gt as getUltraGroupMessageListByMessageUId,qt as getUltraGroupUnreadCountByTargetId,Xt as getUltraGroupUnreadInfoList,Ht as getUltraGroupUnreadMentionedCountByTargetId,zt as getUltraGroupUnreadMentionedMessages,Mt as getUnreadConversationList,Et as getUnreadCount,Zo as getUnreadCountByTag,Pt as getUnreadMentionedCount,Co as getUnreadMentionedMessages,ze as init,No as insertMessage,nt as installPlugin,tn as joinChatRoom,nn as joinExistChatRoom,Ft as modifyMessage,Je as onceEventListener,on as quitChatRoom,Io as recallMessage,po as registerMessageType,xt as removeAllExpansionForUltraGroupMessage,dn as removeChatRoomEntries,un as removeChatRoomEntry,lt as removeConversation,ko as removeConversationsFromTag,qe as removeEventListener,Ye as removeEventListeners,kt as removeExpansionForUltraGroupMessage,hn as removeFromBlacklist,mo as removeMessageExpansionForKey,Bo as removeTag,Fo as removeTagFromConversations,xo as removeTagsFromConversation,gt as saveTextMessageDraft,Mo as searchConversationByContent,Ao as searchMessages,no as sendFileMessage,ro as sendGIFMessage,io as sendHQVoiceMessage,oo as sendImageMessage,$n as sendMessage,uo as sendReadReceiptMessage,lo as sendReadReceiptRequest,fo as sendReadReceiptResponse,go as sendReadReceiptResponseV2,ao as sendSightMessage,vo as sendSyncReadStatusMessage,eo as sendTextMessage,To as sendTypingStatusMessage,bt as sendUltraGroupTypingStatus,sn as setChatRoomEntries,an as setChatRoomEntry,Ot as setConversationNotificationLevel,Nt as setConversationNotificationStatus,Ut as setConversationToTop,Jo as setConversationToTopInTag,Lo as setMessageReceivedStatus,jo as setProxy,Jt as setUltraGroupDefaultNotificationLevel,Wo as testProxy,Vt as updateExpansionForUltraGroupMessage,Eo as updateMessageExpansion,Do as updateTag};
1
+ import{httpRequest as e,NetworkType as t,HttpMethod as n,HTTP_TIMEOUT as o,appendUrl as r,ErrorCode as i,ReceivedStatus as a,ConversationType as s,isNumber as c,EventEmitter as u,RCConnectionStatus as d,VersionManage as l,assert as f,AssertRules as g,isArray as v,isHttpUrl as I,APIContext as h,LogTagId as R,logger as m,validate as E,isValidConversationType as S,isValidNotificationLevel as T,NotificationLevel as p,isTypeInConversationList as O,UltraGroupChannelType as N,isString as _,MAX_UPLOAD_FILE_SIZE as C,UPLOAD_FILE_CHUNK_SIZE as A,UploadMethod as U,FileType as y,getUUID as M,isValidFileType as P,usingCppEngine as L,MessageDirection as w,SentStatus as B,isUndefined as D}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OperateStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var b=function(e,t){return b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},b(e,t)};function G(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}b(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var V=function(){return V=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},V.apply(this,arguments)};function k(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 x(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 F=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))},Z=F();var H=null,J=function(e){return k(void 0,void 0,void 0,(function(){var t;return x(this,(function(n){switch(n.label){case 0:return[4,q.getNetworkType()];case 1:return t=n.sent(),H({status:"online"===e.type,type:t}),[2]}}))}))};var q={tag:"browser",httpReq:e,localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:Z,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 e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,o=e.effectiveType,r=n||o||t.UNKONWN;return Promise.resolve(r)},setNetworkStatusListener:function(e){H=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",J),window.addEventListener("online",J))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",J),window.removeEventListener("online",J)),H=null}},K=F(),Y=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)}}},z={setItem:Y("setStorageSync"),getItem:Y("getStorageSync"),removeItem:Y("removeStorageSync"),clear:Y("clearStorageSync")},j=null,W=function(e){var t=e.isConnected,n=e.networkType;j({status:t,type:n})};var Q={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){wx.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:z,sessionStorage:z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:K,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(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){j=e,wx.onNetworkStatusChange(W)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(W),j=null}},X=F(),$=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},ee={setItem:$("setStorageSync"),getItem:$("getStorageSync"),removeItem:$("removeStorageSync"),clear:$("clearStorageSync")},te=null,ne=function(e){var t=e.isConnected,n=e.networkType;te({status:t,type:n})};var oe={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:t,headers:s,timeout:a,data:u,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:ee,sessionStorage:ee,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:X,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){te=e,my.onNetworkStatusChange(ne)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(ne),te=null}},re=F(),ie=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){}}},ae={setItem:ie("setStorageSync"),getItem:ie("getStorageSync"),removeItem:ie("removeStorageSync"),clear:ie("clearStorageSync")},se=null,ce=function(e){var t=e.isConnected,n=e.networkType;se({status:t,type:n})};var ue={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:re,localStorage:ae,sessionStorage:ae,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:i.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(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){se=e,tt.onNetworkStatusChange(ce)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(ce),se=null}},de=F(),le=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){}}},fe={setItem:le("setStorageSync"),getItem:le("getStorageSync"),removeItem:le("removeStorageSync"),clear:le("clearStorageSync")},ge=null,ve=function(e){var t=e.isConnected,n=e.networkType;ge({status:t,type:n})};var Ie={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:de,localStorage:fe,sessionStorage:fe,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:i.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 k(this,void 0,void 0,(function(){return x(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){ge=e,swan.onNetworkStatusChange(ve)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(ve),ge=null}},he=F(),Re=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)}}},me={setItem:Re("setStorageSync"),getItem:Re("getStorageSync"),removeItem:Re("removeStorageSync"),clear:Re("clearStorageSync")},Ee=null,Se=function(e){var t=e.isConnected,n=e.networkType;Ee({status:t,type:n})};var Te={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){jd.request({url:d,method:t,headers:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:me,sessionStorage:me,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:he,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ee=e,jd.onNetworkStatusChange(Se)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Se),Ee=null}},pe=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)}}},Oe={setItem:pe("setStorageSync"),getItem:pe("getStorageSync"),removeItem:pe("removeStorageSync"),clear:pe("clearStorageSync")},Ne=null,_e=function(e){var t=e.isConnected,n=e.networkType;Ne({status:t,type:n})};var Ce,Ae={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||o,s=e.headers,c=e.query,u=e.body,d=r(e.url,c);return new Promise((function(e){uni.request({url:d,method:t,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:i.RC_HTTP_REQ_FAIL})}})}))},localStorage:Oe,sessionStorage:Oe,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(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ne=e,uni.onNetworkStatusChange(_e)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(_e),Ne=null}},Ue=function(e){return e&&e.request&&e.getSystemInfo},ye="undefined"!=typeof uni&&Ue(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Ae;case"mp-jd":return Te;case"mp-baidu":return Ie;case"mp-toutiao":return ue;case"mp-alipay":return oe;case"mp-weixin":return Q;default:return q}}():"undefined"!=typeof jd&&Ue(jd)?Te:"undefined"!=typeof my&&Ue(my)?oe:"undefined"!=typeof tt&&Ue(tt)?ue:"undefined"!=typeof swan&&Ue(swan)?Ie:"undefined"!=typeof wx&&Ue(wx)?Q:q;function Me(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,i=e.senderUserId,u=e.targetId,d=e.sentTime,l=e.receivedTime,f=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,T=e.isMentioned,p=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,U=e.channelType,y=e.sentStatus;E||(E=a.UNREAD);var M={messageType:o,channelId:n||"",content:r,senderUserId:i,targetId:u,conversationType:t,sentTime:d,receivedTime:l,messageUId:f,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:S,isStatusMessage:p,canIncludeExpansion:R,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:y};return t!==s.ULTRA_GROUP&&(M.isOffLineMessage=h),t===s.ULTRA_GROUP&&c(U)&&(M.channelType=U),M}function Pe(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,u=e.notificationStatus,d=e.notificationLevel,l=e.isTop,f=e.channelId,g=e.unreadMentionedCount,v=e.matchCount,I=e.unreadMentionedMeCount,h={conversationType:t,targetId:n,latestMessage:o&&Me(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:u,notificationLevel:d,isTop:l,channelId:f,unreadMentionedCount:g,matchCount:v,unreadMentionedMeCount:I};return h.conversationType===s.ULTRA_GROUP&&(h.firstUnreadMessage=e.firstUnreadMessage,h.channelType=e.channelType),h}function Le(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"}(Ce||(Ce={}));var we=new u,Be={connection:function(e,t){switch(e){case d.CONNECTED:we.emit(Ce.CONNECTED);break;case d.CONNECTING:we.emit(Ce.CONNECTING);break;case d.SUSPENDED:we.emit(Ce.SUSPEND,t);break;case d.DISCONNECTED:we.emit(Ce.DISCONNECT,t)}},batchMessage:function(e){we.emit(Ce.MESSAGES,{messages:e.map((function(e){return Me(e)}))})},typingState:function(e){we.emit(Ce.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){we.emit(Ce.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){we.emit(Ce.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){we.emit(Ce.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?Me(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===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=De(e.unreadMessageCount||0),n.unreadMentionedCount=De(e.unreadMentionedCount||0),n.unreadMentionedMeCount=De(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));we.emit(Ce.CONVERSATION,{conversationList:t})},chatroomState:function(e){we.emit(Ce.CHATROOM,e)},expansion:function(e){we.emit(Ce.EXPANSION,e)},pullFinished:function(){we.emit(Ce.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){we.emit(Ce.TAG)},conversationTagChanged:function(){we.emit(Ce.CONVERSATION_TAG)},messageBlocked:function(e){we.emit(Ce.MESSAGE_BLOCKED,e)},messageDelivered:function(e){we.emit(Ce.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){we.emit(Ce.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){we.emit(Ce.ULTRA_GROUP_ENABLE,e.map((function(e){return Pe(e)})))},operateStatus:function(e){we.emit(Ce.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){we.emit(Ce.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Me(e)})))},ultraGroupMessageModified:function(e){we.emit(Ce.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Me(e)})))},ultraGroupMessageRecalled:function(e){we.emit(Ce.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Me(e)})))},ultraGroupChannelChangeType:function(e){we.emit(Ce.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){we.emit(Ce.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){we.emit(Ce.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){we.emit(Ce.USER_GROUP_STATUS,e)}};function De(e){return e>999?999:e}l.add("imlib-next","5.8.2");var be=null,Ge=null,Ve=null;function ke(){return k(this,void 0,void 0,(function(){return x(this,(function(e){switch(e.label){case 0:return be?(Ve.info(R.A_DESTROY_O),[4,h.destroy()]):[2];case 1:return e.sent(),Ge=null,be=null,Ve=null,[2]}}))}))}function xe(e){if(!be)throw new Error("Not initialized yet!");return e(be,Ve,Ge)}function Fe(e){return be?e(be,Ve,Ge):Promise.resolve({code:i.BIZ_ERROR_CLIENT_NOT_INIT})}function Ze(e,t,n){we.on(e,t,n)}function He(e,t,n){we.once(e,t,n)}function Je(e,t,n){we.off(e,t,n)}function qe(e){we.removeAll(e)}function Ke(){we.clear()}function Ye(e){!function(e){var t,n=e.appkey,o=e.navigators;be?Ve.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,g.STRING,!0),f("options.navigators",e.navigators,(function(e){return v(e)&&(0===e.length||e.every(I))})),Ge=e,be=h.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||ye,{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}),(Ve=be.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Ve.info(R.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.8.2",commit:"8abcc96cfe3eaaf7e6f4b6e67a1580a41af234d5"})),be.assignWatcher(Be),m.init(Ve))}(e)}function ze(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return be?(Ke(),[2,ke()]):[2]}))}))}function je(){return xe((function(e){return e.getConnectionStatus()}))}function We(){return xe((function(e){return e.getServerTime()}))}function Qe(){return xe((function(e){return e.getCurrentUserId()}))}function Xe(e,t){l.add(e,t)}function $e(){return xe((function(e){return e.getDeviceId()}))}function et(e,t){return xe((function(n){return n.install(e,t)}))}var nt={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!"}},ot={};for(var rt in nt){var it=nt[rt].code;ot[it]=rt}function at(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return E("token",e,g.STRING,!0)&&E("reconnectKickEnable",t,g.BOOLEAN)?(n=r.createTraceId(),r.info(R.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!!t,n)]):[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}),n),a.code===i.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:ot[a.code]}]}}))}))}))]}))}))}function st(e){return m.info(R.A_DISCONNECT_O,{}),xe((function(t){return t.disconnect(e)}))}function ct(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("options.count",null==e?void 0:e.count,g.NUMBER)&&E("options.startTime",null==e?void 0:e.startTime,g.NUMBER)&&E("options.order",null==e?void 0:e.order,g.NUMBER)&&E("channelId",t,g.CHANNEL_ID)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(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===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Pe(e)}))}]:(r.warn(R.O,"get conversation list fail ->".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ut(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a;return x(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),r=t.code,a=t.data,r!==i.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(r,", targetId:").concat(e.targetId)),[2,{code:r,msg:ot[r]}]):[2,{code:r,data:a?Pe(a):null}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r;return x(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(t,":").concat(ot[t],",").concat(r)),[2,{code:t,msg:ot[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a,s;return x(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.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(ot[r],",").concat(s)),[2,{code:r,msg:ot[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("options",e,g.CONVERSATION,!0)&&E("draft",t,g.STRING,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===i.SUCCESS?[2,{code:a}]:(r.warn(R.O,"set draft fail ->".concat(a,":").concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r;return x(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"delete draft ->".concat(t)),[4,n.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(ot[r],",").concat(t)),[2,{code:r,msg:ot[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("includeMuted",e,g.BOOLEAN,!1)&&E("conversationTypes",t,g.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!E("conversationType",e,S)})))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return r.debug(R.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===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCount fail ->".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return!E("conversationTypes",e,g.ARRAY,!0)||!E("levels",t,g.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,S)}))||t.some((function(e){return!E("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(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===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]}))}))}function ht(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return!E("conversationTypes",e,g.ARRAY,!0)||!E("levels",t,g.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,S)}))||t.some((function(e){return!E("level",e,T)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(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===i.SUCCESS?[2,{code:a,data:s}]:(r.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]}))}))}function Rt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a,s;return x(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.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(ot[r],",").concat(s)),[2,{code:r,msg:ot[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r;return x(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),r="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(r)),t!==i.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(t,":").concat(ot[t],",").concat(r)),[2,{code:t,msg:ot[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,Fe((function(t,n){return k(e,void 0,void 0,(function(){return x(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}nt.ROAMING_SERVICE_UNAVAILABLE.code;var St=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(R.O,"".concat(n," -> ").concat(o)),o},Tt=function(e,t,n,o){return void 0===o&&(o=""),k(void 0,void 0,void 0,(function(){var r,a;return x(this,(function(s){switch(s.label){case 0:return r=St(e,t,o),[4,n()];case 1:return(a=s.sent())!==i.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(a," : ").concat(ot[a]," , ").concat(r)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))};function pt(e,t){return k(this,void 0,void 0,(function(){return x(this,(function(n){return E("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return Tt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ot(e,t){return k(this,void 0,void 0,(function(){return x(this,(function(n){return E("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return Tt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a,s;return x(this,(function(c){switch(c.label){case 0:return t=St(o,e,"getConversationNotificationLevel"),[4,n.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(ot[a]," , ").concat(t)),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a;return x(this,(function(s){switch(s.label){case 0:return o.info(R.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(),r=t.code,a=t.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:ot[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return[2,Fe((function(e){return e.getBlockConversationList()}))]}))}))}function At(e,t){return void 0===t&&(t=!0),k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("options",e,g.CONVERSATION,!0)&&E("isTop",t,g.BOOLEAN)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set conversation status fail ->".concat(a,":").concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ut(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("conversationTypes",e,g.ARRAY)&&!(null==e?void 0:e.some((function(e){return!E("conversationType",e,S)})))&&E("channelId",t,g.CHANNEL_ID)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(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===i.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return Pe(e)}))}]:(r.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return!E("conversationTypes",e,g.ARRAY)||(null==e?void 0:e.some((function(e){return!E("conversationType",e,O)})))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,o,r;return x(this,(function(a){switch(a.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=a.sent(),o=t.code,r=t.data,o===i.SUCCESS&&r?[2,{code:0,data:r.map((function(e){return Pe(e)}))}]:[2,{code:o,msg:ot[o]}]}}))}))}))]}))}))}function Mt(e){return k(this,void 0,void 0,(function(){return x(this,(function(t){return E("options",e,g.CONVERSATION,!0)?[2,Fe((function(t,n){return n.debug(R.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return[2,Fe((function(e,t){return t.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function Lt(){return k(this,void 0,void 0,(function(){return x(this,(function(e){return[2,Fe((function(e){return e.getAllConversationState()}))]}))}))}function wt(e){return void 0===e&&(e={}),k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options.targetId",e.targetId,g.STRING,!1)&&E("options.channelType",e.channelType,(function(e){return void 0!==N[e]}),!1)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a;return x(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:i.SUCCESS,data:a}]:(o.warn(R.O,"get ultragroup ->".concat(r,":").concat(ot[r])),[2,{code:r,msg:ot[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,Fe((function(t,n){return k(e,void 0,void 0,(function(){var e,o,r;return x(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:i.SUCCESS,data:r}]:(n.warn(R.O,"get block ultragroup ->".concat(o,":").concat(ot[o])),[2,{code:o,msg:ot[o]}])}}))}))}))]}))}))}function Dt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(r){switch(r.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(ot[t])),[2,{code:t,msg:ot[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("options",e,g.CONVERSATION,!0)&&E("msgs",t,g.ARRAY,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return x(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(),l=d.code,f=d.data,l===i.SUCCESS){for(v in g={},f)g[v]=f[v]?Me(f[v]):void 0;return[2,{code:i.SUCCESS,data:g}]}return r.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(l,":").concat(ot[l])),[2,{code:l,msg:ot[l]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("expansion",e,g.OBJECT,!0)&&E("message",t,g.OBJECT,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return x(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,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"update expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(f)];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(ot[g])),[2,{code:g,msg:ot[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("expansion",e,g.ARRAY,!0)&&E("message",t,g.OBJECT,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g;return x(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,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),r.debug(R.O,"remove expansion for ultragroup message ->".concat(l)),f={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(f)];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(ot[g])),[2,{code:g,msg:ot[g]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("message",e,g.OBJECT,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l,f;return x(this,(function(g){switch(g.label){case 0:return t=e.conversationType,r=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(r,",channelId:").concat(u,",messageUId:").concat(a),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),l={targetId:r,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return(f=g.sent().code)===i.SUCCESS?[2,{code:i.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(f,":").concat(ot[f])),[2,{code:f,msg:ot[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("content",e,g.OBJECT,!0)&&E("message",t,g.OBJECT,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v;return x(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,l=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(l,",messageUId:").concat(s),r.debug(R.O,"update ultragroup message expansion ->".concat(f)),g={targetId:a,channelId:l,conversationType:n,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(ot[v])),[2,{code:v,msg:ot[v]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("notificationLevels",t,g.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,T)})))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return r.debug(R.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===i.SUCCESS?[2,{code:i.SUCCESS,data:s}]:(r.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(ot[a])),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("options.targetId",e.targetId,g.STRING,!0)&&E("options.channelId",e.channelId,g.CHANNEL_ID)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a,s,c;return x(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",r="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(t," -> ").concat(r)),[4,n.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(t," fail -> ").concat(s," : ").concat(ot[s]," , ").concat(r)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,g.STRING,!0)&&E("options.channelId",e.channelId,g.CHANNEL_ID,!0)&&E("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),r.debug(R.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===i.SUCCESS?[2,{code:s}]:(r.warn(R.O,"".concat(n," fail -> ").concat(s," : ").concat(ot[s]," , ").concat(a)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("notificationLevels",t,g.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,T)})))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,i,a,s,c;return x(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(R.O,"".concat(n," -> ").concat(c)),[2,{code:a,data:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,Fe((function(t,n){return k(e,void 0,void 0,(function(){var e,o,r,a;return x(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(ot[r])),[2,{code:r,msg:ot[r]}])}}))}))}))]}))}))}function Kt(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,Fe((function(t,n){return k(e,void 0,void 0,(function(){var e,o,r,a;return x(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),r=o.code,a=o.data,n.debug(R.O,e),r===i.SUCCESS?[2,{code:r,data:a}]:(n.warn(R.O,"".concat(e," fail ->").concat(r,": ").concat(ot[r])),[2,{code:r,msg:ot[r]}])}}))}))}))]}))}))}function Yt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,g.STRING,!0)&&E("options.channelId",e.channelId,g.CHANNEL_ID,!0)&&E("options.sentTime",e.sentTime,g.NUMBER,!0)&&E("options.count",e.count,(function(e){return c(e)&&e>0&&e<=50}),!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a,s,c,u,d,l;return x(this,(function(f){switch(f.label){case 0:return t=e.targetId,r=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:r,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),d=u.code,l=u.data,d===i.SUCCESS?[2,{code:d,data:l}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(ot[d])),[2,{code:d,msg:ot[d]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zt(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("conversation.targetId",e.targetId,g.STRING,!0)&&E("conversation.channelId",e.channelId,g.CHANNEL_ID,!0)?[2,Fe((function(n){return k(t,void 0,void 0,(function(){var t,o,r,a,s,c;return x(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,r={targetId:t,channelId:o},[4,n.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:ot[s]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(e){return k(this,void 0,void 0,(function(){var t,n=this;return x(this,(function(o){return E("targetIds",e,g.ARRAY,!0)&&E("targetIds.length",e,(function(e){return e.length>0&&e.length<20}))&&!e.some((function(e){return!E("targetId",e,g.STRING)}))?(t=e.filter((function(t,n){return e.indexOf(t)===n})),[2,Fe((function(e){return k(n,void 0,void 0,(function(){var n,o,r;return x(this,(function(a){switch(a.label){case 0:return[4,e.getUltraGroupUnreadInfoList(t)];case 1:return n=a.sent(),o=n.code,r=n.data,o===i.SUCCESS?[2,{code:o,data:r}]:[2,{code:o,msg:ot[o]}]}}))}))}))]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Wt=function(e){return!!(E("options.key",e.key,g.STRING,!0)&&E("options.value",e.value,g.STRING,!0)&&E("options.isAutoDelete",e.isAutoDelete,g.BOOLEAN)&&E("options.isSendNotification",e.isSendNotification,g.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,g.STRING))},Qt=function(e){return e.entries.every((function(e){return E("entry.key",e.key,g.STRING,!0)&&E("entry.value",e.value,g.STRING,!0)}))&&E("options.isAutoDelete",e.isAutoDelete,g.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,g.STRING)&&E("options.isForce",e.isForce,g.BOOLEAN)},Xt=function(e){return E("options.key",e.key,g.STRING,!0)&&E("options.isSendNotification",e.isSendNotification,g.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,g.STRING)},$t=function(e){return e.entries.every((function(e){return E("key",e,g.STRING,!0)}))&&E("options.notificationExtra",e.notificationExtra,g.STRING)};function en(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.count",t.count,g.NUMBER,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(R.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===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:ot[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function tn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.count",t.count,g.NUMBER,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return n=r.createTraceId(),r.info(R.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===i.SUCCESS?"info":"warn",r[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==i.SUCCESS?[2,{code:a,msg:ot[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("targetId",e,g.STRING,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a;return x(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(R.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.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}),t),r!==i.SUCCESS?[2,{code:r,msg:ot[r]}]:[2,{code:r}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function on(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.count",t.count,g.NUMBER)&&E("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.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===i.SUCCESS&&c?[2,{code:s,data:c}]:(r.warn(R.O,"get chatroom info fail ->code+:".concat(ot[s],",").concat(n)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&Wt(t)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"set chatroom entry fail ->code+:".concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function an(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&Qt(t)?t.entries.length>10?[2,nt.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];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(ot[s],",").concat(n)),[2,{code:s,msg:ot[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&Wt(t)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force set chatroom entry fail ->code+:".concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function cn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&Xt(t)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.debug(R.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function un(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&$t(t)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.info(R.O,"remove chatroom entry->".concat(n)),(a=V({},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!==i.SUCCESS?(r.warn(R.O,"remove chatroom entry fail ->code+:".concat(ot[c],",").concat(n)),[2,{code:c,msg:ot[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&Xt(t)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),r.info(R.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"force remove chatroom entry fail ->code+:".concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ln(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("key",t,(function(e){return _(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),r.debug(R.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];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(ot[s],",").concat(n)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("targetId",e,g.STRING,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a,s;return x(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(R.O,"get all chatroom entries->".concat(t)),[4,n.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(ot[a],",").concat(t)),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gn(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("targetId",e,g.STRING,!0)&&E("options.timestamp",t.timestamp,g.NUMBER)&&E("options.count",t.count,g.NUMBER)&&E("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}))&&E("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),r.debug(R.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===i.SUCCESS&&c?(u=c.list.map((function(e){return Me(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(r.warn(R.O,"get chatroom history message fail ->code+:".concat(ot[s],",").concat(n)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("option.chatRoomId",e.chatRoomId,g.STRING,!0)&&E("option.rtcRoomId",e.rtcRoomId,g.STRING,!0)?[2,Fe((function(n){return k(t,void 0,void 0,(function(){var t;return x(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:ot[t]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("userId",e,g.STRING,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return o.info(R.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("userId",e,g.STRING,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return o.info(R.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,Fe((function(t,n){return k(e,void 0,void 0,(function(){var e,o,r;return x(this,(function(a){switch(a.label){case 0:return n.info(R.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS&&r?[2,{code:o,data:r}]:(n.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function mn(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("userId",e,g.STRING,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a;return x(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),r=t.code,a=t.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 En=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 Sn(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new En(e,o,t,n)}}var Tn,pn=Sn("RC:ImgMsg"),On=Sn("RC:HQVCMsg"),Nn=Sn("RC:SightMsg"),_n=Sn("RC:TxtMsg"),Cn=Sn("RC:CombineMsg"),An=Sn("RC:FileMsg"),Un=Sn("RC:GIFMsg"),yn=Sn("RC:VcMsg"),Mn=Sn("RC:LBSMsg"),Pn=Sn("RC:ReferenceMsg"),Ln=Sn("RC:ImgTextMsg"),wn=Sn("RC:CmdMsg"),Bn=Sn("RC:InfoNtf"),Dn=Sn("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(Tn||(Tn={}));var bn,Gn,Vn=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.upload=function(e){return e.file.size>C?Promise.resolve({code:i.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>A&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),kn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return G(n,t),n.prototype.commonUpload=function(t){return k(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=d.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),[4,e({url:/http/.test(this._url)?this._url:"https://".concat(this._url),headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.QINIU}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return k(this,void 0,void 0,(function(){return x(this,(function(e){throw new Error("Method not implemented.")}))}))},n}(Vn),xn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return G(n,t),n.prototype.commonUpload=function(t){return k(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s="https://".concat(a.ossBucketName,".").concat(this._url),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),[4,e({url:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.ALI}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Vn),Fn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return G(n,t),n.prototype.commonUpload=function(t){return k(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l;return x(this,(function(f){switch(f.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r<=y.FILE?r:y.FILE)];case 1:return s=f.sent(),c=a||("text/html"===n.type?"inline":"attachment"),u={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":"".concat(c,"; filename=").concat(encodeURIComponent(n.name),";")},d=(/http/.test(this._url)?this._url:"https://".concat(this._url))+s.path,[4,e({url:d,headers:u,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:n,timeout:0})];case 2:return 200===(l=f.sent().status)||204===l?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:d}}]:[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Vn),Zn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return G(n,t),n.prototype.commonUpload=function(t){return k(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f;return x(this,(function(g){switch(g.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,a=t.contentDisposition,[4,this._getFileToken(r,n.name)];case 1:return s=g.sent(),c={},u="https://".concat(s.s3BucketName,".").concat(this._url),d=new FormData,a?d.set("Content-Disposition",a):d.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),d.set("Content-Type",n.type),d.set("x-amz-credential",s.s3Credential),d.set("x-amz-algorithm",s.s3Algorithm),d.set("x-amz-date",s.s3Date),d.set("policy",s.s3Policy),d.set("x-amz-signature",s.s3Signature),d.set("key",s.fileName),d.set("file",n),[4,e({url:u,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:d,timeout:0})];case 2:return l=g.sent(),f=l.status,l.data,200===f||204===f?[2,{code:i.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:U.AWS}}]:[2,{code:i.UPLOAD_FAIL,msg:f.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Vn),Hn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return G(n,t),n.prototype.commonUpload=function(t){return k(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s="https://".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:i.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return k(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,g,v,I,h,R,m,E,S;return x(this,(function(T){switch(T.label){case 0:return o=t.file,t.onProgress,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=T.sent(),s="https://".concat(this._url,"/").concat(a.stcBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=T.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(g=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,g)]);case 3:return v=T.sent(),I=v.code,h=v.msg,I!==i.SUCCESS?[2,{code:I,msg:h}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return R=T.sent(),m=g.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),m="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(m,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(o,R,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:E,method:"POST",body:m})];case 5:return 200===(S=T.sent().status)||204===S?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.STC}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),k(this,void 0,void 0,(function(){var d,l,f,g,v,I,h,R,m;return x(this,(function(E){switch(E.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*A,l=Math.min(A,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return g=E.sent(),v=n.slice(d,c*A),I=this.getBaseHeaders(n,g,a),[4,e({url:"".concat(t,"?").concat(f),headers:I,method:"PUT",body:v,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)},timeout:0})];case 2:return h=E.sent(),R=h.status,h.data,m=h.xhr,200===R||204===R?(s.push((null==m?void 0:m.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n}(Vn),Jn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return G(n,t),n.prototype.commonUpload=function(t){return k(this,void 0,void 0,(function(){var n,o,r,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r)];case 1:return a=d.sent(),s="https://".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(n,a,t),[4,e({url:s,headers:c,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"PUT",body:n,timeout:0})];case 2:return 200===(u=d.sent().status)||204===u?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:u.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return k(this,void 0,void 0,(function(){var o,r,a,s,c,u,d,l,f,g,v,I,h,R,m,E,S;return x(this,(function(T){switch(T.label){case 0:return o=t.file,r=t.fileType,[4,this._getFileToken(r,o.name,"POST","uploads")];case 1:return a=T.sent(),s="https://".concat(this._url,"/").concat(a.minioBucketName,"/").concat(a.fileName),c=this.getBaseHeaders(o,a,t),[4,e({url:"".concat(s,"?uploads"),headers:c,method:"POST"})];case 2:return u=T.sent(),d=u.status,l=u.data,f=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==d&&204!==d||!f?[2,{code:i.UPLOAD_FAIL,msg:"start upload fail"}]:(g=[],[4,this.requestUploadPart(s,o,f,a.fileName,t,g)]);case 3:return v=T.sent(),I=v.code,h=v.msg,I!==i.SUCCESS?[2,{code:I,msg:h}]:[4,this._getFileToken(r,a.fileName,"POST","uploadId=".concat(f))];case 4:return R=T.sent(),m=g.map((function(e,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(e,"</ETag></Part>")})).join(""),m="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(m,"</CompleteMultipartUpload>"),E=this.getBaseHeaders(o,R,t),[4,e({url:"".concat(s,"?uploadId=").concat(f),headers:E,method:"POST",body:m,timeout:0})];case 5:return 200===(S=T.sent().status)||204===S?[2,{code:i.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:i.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,o,r,a,s,c,u){return void 0===c&&(c=1),void 0===u&&(u=0),k(this,void 0,void 0,(function(){var d,l,f,g,v,I,h,R,m;return x(this,(function(E){switch(E.label){case 0:return u>=5?[2,{code:i.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}]:(d=(c-1)*A,l=Math.min(A,n.size-d),f="partNumber=".concat(c,"&uploadId=").concat(o),[4,this._getFileToken(a.fileType,r,"PUT",f)]);case 1:return g=E.sent(),v=n.slice(d,c*A),I=this.getBaseHeaders(n,g,a),[4,e({url:"".concat(t,"?").concat(f),headers:I,method:"PUT",body:v,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,d+e.loaded,n.size)}})];case 2:return h=E.sent(),R=h.status,m=h.xhr,200===R||204===R?(s.push((null==m?void 0:m.getResponseHeader("ETag"))||""),d+l<n.size?[2,this.requestUploadPart(t,n,o,r,a,s,c+1,0)]:[2,{code:i.SUCCESS}]):[2,this.requestUploadPart(t,n,o,r,a,s,c,u+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){var o=n.contentDisposition||("text/html"===e.type?"inline":"attachment");return{"Content-Disposition":"".concat(o,"; filename=").concat(encodeURIComponent(e.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n}(Vn),qn=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e}return G(n,t),n.prototype.commonUpload=function(t){return k(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,g;return x(this,(function(v){switch(v.label){case 0:return n=t.file,o=t.onProgress,r=t.fileType,[4,this._getFileToken(r,n.name)];case 1:return a=v.sent(),s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),u=/http/.test(this._url)?this._url:"https://".concat(this._url),[4,e({url:u,headers:s,onProgress:function(e){return null==o?void 0:o(e.loaded,e.total)},method:"POST",body:c,timeout:0})];case 2:return d=v.sent(),l=d.status,f=d.data,200!==l&&204!==l||!f?[2,{code:i.UPLOAD_FAIL,msg:l.toString()}]:(g=JSON.parse(f),[2,{code:i.SUCCESS,data:{uniqueName:g.rc_url.file_name,downloadUrl:"".concat(u,"/").concat(g.rc_url.path)}}])}}))}))},n.prototype.multipartUpload=function(e){return k(this,void 0,void 0,(function(){var t,n,o,r,i;return x(this,(function(a){switch(a.label){case 0:return t=e.file,n=e.onProgress,o=e.fileType,r=M(),[4,this._getFileToken(o,t.name)];case 1:return i=a.sent().token,[2,this._requestUploadPart(r,t,i,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,o,r,a){return void 0===a&&(a=0),k(this,void 0,void 0,(function(){var s,c,u,d,l,f,g,v,I,h;return x(this,(function(R){switch(R.label){case 0:return s=Math.min(A,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),u={Range:"bytes=".concat(a,"-").concat(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},d=n.slice(a,a+s),(l=new FormData).set("file",d,n.name),l.set("key",c),l.set("name",c),l.set("token",o),f=/http/.test(this._url)?this._url:"https://".concat(this._url),[4,e({url:f,headers:u,onProgress:function(e){return null==r?void 0:r(a+e.loaded,n.size)},method:"POST",body:l,timeout:0})];case 1:return g=R.sent(),v=g.status,I=g.data,200===v||204===v?a+s<n.size?[2,this._requestUploadPart(t,n,o,r,a+s)]:(h=JSON.parse(I),[2,{code:i.SUCCESS,data:{uniqueName:h.rc_url.file_name,downloadUrl:"".concat(f,"/").concat(h.rc_url.path)}}]):[2,{code:i.UPLOAD_FAIL,msg:v.toString()}]}}))}))},n}(Vn);function Kn(e,t){return k(this,void 0,void 0,(function(){var n,o,r,a,s,c,u,d,l,f,g,v,I,h,R,m,E,S,T,p,O,N,_,C;return x(this,(function(A){switch(A.label){case 0:return n=t.getFileToken,o=t.serverType,r=t.customDomain,a=t.ossConfig,s=t.uploadServer,c=t.bosAddr,u=e.file,d=e.fileType,l=e.thumbnailConfig,f=function(e,t,n,o,r){if(n)return[{type:Tn.RCX,url:n,p:"1"}];if(e){return JSON.parse(e).map((function(e){var t={type:Tn.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}))}var i=[];o&&i.push({type:Tn.QINIU,url:o,p:"1"});r&&i.push({type:Tn.BAIDU,url:r,p:"2"});return i}(a,0,r,s,c),0===f.length?[2,Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER,msg:"uploadUrlList is empty"})]:[4,Wn(f,e,n,o)];case 1:return g=A.sent(),v=g.code,I=g.data,h=g.msg,v===i.SUCCESS&&I?[4,Yn(e,t,I)]:[2,{code:v,msg:h}];case 2:return R=A.sent(),m={downloadUrl:R,uniqueName:(null==I?void 0:I.uniqueName)||"",name:u.name,size:u.size,type:u.type},d!==y.AUDIO?[3,5]:[4,u.arrayBuffer()];case 3:return[4,zn(A.sent())];case 4:return E=A.sent(),S=E.duration,T=E.length,C=V(V({},m),{duration:S,length:T}),[2,{code:v,data:C}];case 5:return d!==y.IMAGE?[3,7]:[4,Qn(u,l)];case 6:return p=A.sent(),O=p.thumbnail,N=p.width,_=p.height,C=V(V({},m),{thumbnail:O,width:N,height:_}),[2,{code:v,data:C}];case 7:return[2,{code:v,data:m}]}}))}))}function Yn(e,t,n){return k(this,void 0,void 0,(function(){var o,r,i,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return o=t.getFileUrl,r=e.fileType,i=e.file,a=n.uploadMethod,s=n.downloadUrl,c=n.uniqueName,(u=s)?[3,2]:[4,o(r,c,i.name,void 0,a)];case 1:u=d.sent().downloadUrl,d.label=2;case 2:return[2,u]}}))}))}function zn(e){return Gn=Gn||new AudioContext,new Promise((function(t,n){Gn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}var jn=((bn={})[Tn.QINIU]=kn,bn[Tn.ALIYUN]=xn,bn[Tn.BAIDU]=Fn,bn[Tn.S3]=Zn,bn[Tn.STC]=Hn,bn[Tn.MINIO]=Jn,bn[Tn.RCX]=qn,bn);function Wn(e,t,n,o,r){return void 0===r&&(r=[]),k(this,void 0,void 0,(function(){var a,s,c,u,d;return x(this,(function(l){switch(l.label){case 0:return 0===e.length?[2,Promise.resolve({code:i.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: ".concat(JSON.stringify(r))})]:(a=e.shift(),[4,new jn[a.type](a.url,n,o).upload(t)]);case 1:return s=l.sent(),c=s.code,u=s.data,d=s.msg,c!==i.SUCCESS?(r.push({type:a.type,url:a.url,code:c,msg:d}),[2,Wn(e,t,n,o,r)]):[2,{code:c,data:u}]}}))}))}function Qn(e,t){return new Promise((function(n,o){var r=document.createElement("canvas"),i=r.getContext("2d"),a=new Image;a.onload=function(o){var s=t||{},c=s.maxHeight,u=void 0===c?160:c,d=s.maxWidth,l=void 0===d?160:d,f=s.quality,g=void 0===f?.7:f,v=s.scale,I=void 0===v?1:v,h=Xn(a.width,a.height,{maxHeight:u,maxWidth:l,scale:I});r.width=Math.min(h.w,l),r.height=Math.min(h.h,u),i.drawImage(a,h.x,h.y,h.w,h.h);var R=r.toDataURL("string"==typeof e?"image/jpg":e.type,g);R=R.replace(/data:image\/[^;]+;base64,/,""),n({thumbnail:R,width:h.w,height:h.h})},a.src=(window.URL||window.webkitURL).createObjectURL(e)}))}var Xn=function(e,t,n){var o,r,i=n.maxHeight,a=void 0===i?160:i,s=n.maxWidth,c=void 0===s?160:s,u=n.scale,d=e<t,l=0,f=0;return(d?t/e:e/t)>(void 0===u?1:u)?(d?(o=100,f=((r=t/(e/100))-a)/2):(r=100,l=((o=e/(t/100))-c)/2),{w:o,h:r,x:-l,y:-f}):(d?(r=a,o=e/(t/a)):(o=c,r=t/(e/c)),{w:o,h:r,x:-l,y:-f})};function $n(e,t,n,o){return Fe((function(r){return new Promise((function(a){r.getFileToken(e,t,n,o).then((function(e){a({code:i.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:ot[e]})}))}))}))}function eo(e,t,n,o,r){return E("fileType",e,P,!0)&&E("filename",t,g.STRING)&&E("saveName",n,g.STRING)&&E("serverType",r,g.NUMBER)?Fe((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,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 to(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return[2,Fe((function(r,c){return k(o,void 0,void 0,(function(){var o,u,d,l,f,v,I,h,m,S,T,p;return x(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof En==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,nt.ILLGAL_PARAMS]):E("conversation",e,g.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,E("conversation.targetId",u,g.STRING,!0)&&E("conversation.conversationType",o,g.NUMBER,!0)&&E("conversation.channelId",d,g.CHANNEL_ID)&&E("options.isStatusMessage",null==n?void 0:n.isStatusMessage,g.BOOLEAN)&&E("options.disableNotification",null==n?void 0:n.disableNotification,g.BOOLEAN)&&E("options.pushContent",null==n?void 0:n.pushContent,g.STRING)&&E("options.pushData",null==n?void 0:n.pushData,g.STRING)&&E("options.isMentioned",null==n?void 0:n.isMentioned,g.BOOLEAN)&&E("options.mentionedType",null==n?void 0:n.mentionedType,g.NUMBER)&&E("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,g.ARRAY)&&E("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,g.ARRAY)&&E("options.isVoipPush",null==n?void 0:n.isVoipPush,g.BOOLEAN)&&E("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,g.BOOLEAN)&&E("options.expansion",null==n?void 0:n.expansion,g.OBJECT)&&E("options.pushConfig",null==n?void 0:n.pushConfig,g.OBJECT)&&E("options.messageId",null==n?void 0:n.messageId,g.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(l)),f=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,l=e.isVoipPush,f=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return V({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:l,canIncludeExpansion:f,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:r.getCurrentUserId(),messageUId:"",messageDirection:w.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:B.SENDING},o!==s.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(Me(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:t.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,r.sendMessage(o,u,f,h,I)]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];case 1:return m=O.sent(),S=m.code,T=m.data,S===i.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:T.messageUId,messageId:T.messageId}),I),p=Me(T),[2,{code:S,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(S,":").concat(ot[S],",").concat(l)),v.sentTime=(null==T?void 0:T.sentTime)||0,v.sentStatus=null==T?void 0:T.sentStatus,[2,{code:S,msg:ot[S],data:Me(v)}])}}))}))}))]}))}))}function no(e,t,n){return to(e,new _n(t),n)}function oo(e,t){return function(n,o,r,a){if(!E("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(!(E("sendOptions.maxHeight",null==c?void 0:c.maxHeight,g.NUMBER)&&E("sendOptions.maxWidth",null==c?void 0:c.maxWidth,g.NUMBER)&&E("sendOptions.quality",null==c?void 0:c.quality,g.NUMBER)&&E("sendOptions.scale",null==c?void 0:c.scale,g.NUMBER)))return Promise.resolve({code:i.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return Fe((function(c,u,d){return new Promise((function(c){var d,l=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),(d={file:o.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==r?void 0:r.onProgress)||void 0===n||n.call(r,Math.floor(e/t*100))},contentDisposition:s.contentDisposition,thumbnailConfig:s.thumbnailConfig},Fe((function(e,t,n){return new Promise((function(t){var o=e.getNaviInfoFromCache();Kn(d,{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:n.uploadDomain||"",serverType:null==o?void 0:o.type,ossConfig:null==o?void 0:o.ossConfig,uploadServer:null==o?void 0:o.uploadServer,bosAddr:null==o?void 0:o.bosAddr}).then((function(e){t(e)}))}))}))).then((function(e){var s,d=e.code,f=e.data,g=e.msg;if(d===i.SUCCESS&&f){var v=(null===(s=null==r?void 0:r.onComplete)||void 0===s?void 0:s.call(r,V({url:f.downloadUrl},f)))||t(f,o);return u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:f.downloadUrl,code:i.SUCCESS}),l),void to(n,v,a).then(c)}c({code:d,msg:g})}))}))}))}}var ro=oo(y.FILE,(function(e,t){return new An({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})),io=oo(y.IMAGE,(function(e,t){return new pn({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),ao=oo(y.IMAGE,(function(e,t){return new Un({gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height,user:t.user,extra:t.extra})})),so=oo(y.AUDIO,(function(e,t){return new On({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),co=oo(y.SIGHT,(function(e,t){return new Nn({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 uo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,g.NUMBER)&&E("options.count",null==t?void 0:t.count,g.NUMBER)&&(L()||E("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})))&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,g.CONVERSATION,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n=r.createTraceId(),r.info(R.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===i.SUCCESS&&c?(u=c.list.map((function(e){return Me(e)})),r.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,g.NUMBER)&&E("options.count",null==t?void 0:t.count,g.NUMBER)&&E("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}))&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,g.CONVERSATION,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.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===i.SUCCESS&&c?(u=c.list.map((function(e){return Me(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(r.warn(R.O,"get history message fail ->".concat(s,":").concat(ot[s],",").concat(n)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fo(e,t,n,o){return k(this,void 0,void 0,(function(){var r=this;return x(this,(function(a){return E("targetId",e,g.STRING,!0)&&E("messageUId",t,g.STRING,!0)&&E("timestamp",n,g.NUMBER,!0)&&E("channelId",o,g.CHANNEL_ID)?[2,Fe((function(i){return k(r,void 0,void 0,(function(){var r,i,a,c,u;return x(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:s.PRIVATE,channelId:o},i=new En("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,to(r,i)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return E("messageUId",t,g.STRING,!0)&&E("targetId",e,g.STRING,!0)&&E("channelId",n,g.CHANNEL_ID)?[2,Fe((function(r,i){return k(o,void 0,void 0,(function(){var o,r,a,c,u;return x(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(R.O,"send read receipt message ->".concat(o)),r=new En("RC:RRReqMsg",{messageUId:t}),[4,to({targetId:e,conversationType:s.GROUP,channelId:n},r)];case 1:return a=d.sent(),c=a.code,u=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,t,n){return k(this,void 0,void 0,(function(){return x(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Io(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return E("targetId",e,g.STRING,!0)&&E("messageList",t,g.OBJECT,!0)&&E("channelId",n,g.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!E(e,t[e],g.ARRAY)}))?[2,Fe((function(r,a){return k(o,void 0,void 0,(function(){var o,c,u,d,l,f;return x(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:s.GROUP,channelId:n},u=r.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,r.sendReadReceiptMessage(e,d,n)]:(a.warn(R.O,"Error in parameter messageList."),[2,{code:i.PARAMETER_ERROR}]));case 1:return c=g.sent(),[3,4];case 2:return l=new En("RC:RRRspMsg",{receiptMessageDic:t}),[4,to(o,l)];case 3:c=g.sent(),g.label=4;case 4:return(f=c.code)===i.SUCCESS?[2,{code:f}]:(a.warn(R.O,"send read receipt message fail ->".concat(f,":").concat(ot[f])),[2,{code:f,msg:ot[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e,t){return k(this,void 0,void 0,(function(){var n,o,r,a;return x(this,(function(s){switch(s.label){case 0:return E("conversation",e,g.CONVERSATION,!0)&&E("lastMessageSendTime",t,g.NUMBER,!0)?(n=new En("RC:SRSMsg",{lastMessageSendTime:t}),[4,to(e,n)]):[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 Ro(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("options.messageUId",t.messageUId,g.STRING,!0)&&E("options.sentTime",t.sentTime,g.NUMBER,!0)&&E("options.disableNotification",null==t?void 0:t.disableNotification,g.BOOLEAN)&&E("options.pushConfig",null==t?void 0:t.pushConfig,g.OBJECT)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u;return x(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),r.debug(R.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===i.SUCCESS&&u?[2,{code:c,data:Me(u)}]:c===i.SUCCESS?[2,{code:c}]:(r.warn(R.O,"recall message fail ->".concat(c,":").concat(ot[c],",").concat(a)),[2,{code:c,msg:ot[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("options",t,(function(e){return v(e)&&e.length}),!0)&&!t.some((function(e){return!E("options.messageUId",e.messageUId,g.STRING,!0)||!E("options.sentTime",e.sentTime,g.NUMBER,!0)||!E("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"delete message fail ->".concat(a,":").concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("timestamp",t,g.NUMBER,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a;return x(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),r.debug(R.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==i.SUCCESS?(r.warn(R.O,"clear message ->".concat(a,":").concat(ot[a],",").concat(n)),[2,{code:a,msg:ot[a]}]):[2,{code:i.SUCCESS}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("expansion",e,g.OBJECT,!0)&&E("message",t,g.OBJECT,!0)&&E("message.conversationType",t.conversationType,g.NUMBER,!0)&&E("message.targetId",t.targetId,g.STRING,!0)&&E("message.channelId",t.channelId,g.CHANNEL_ID)&&E("message.messageUId",t.messageUId,g.STRING,!0)&&E("message.expansion",t.expansion,g.OBJECT)&&E("message.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f;return x(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,l="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),r.debug(R.O,"update message expansion ->".concat(l)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(f=g.sent().code)!==i.SUCCESS?(r.warn(R.O,"update message expansion fail ->".concat(f,":").concat(ot[f],",").concat(l)),[2,{code:f,msg:ot[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("keys",e,g.ARRAY,!0)&&E("message",t,g.OBJECT,!0)&&E("message.conversationType",t.conversationType,g.NUMBER,!0)&&E("message.targetId",t.targetId,g.STRING,!0)&&E("message.channelId",t.channelId,g.CHANNEL_ID)&&E("message.messageUId",t.messageUId,g.STRING,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l;return x(this,(function(f){switch(f.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),r.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(l=f.sent().code)!==i.SUCCESS?(r.warn(R.O,"remove message expansion fail ->".concat(l,":").concat(ot[l],",").concat(d)),[2,{code:l,msg:ot[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("typingContentType",t,g.STRING,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d;return x(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=r.createTraceId(),r.info(R.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=l.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:Me(u)}]:[2,{code:c,msg:ot[c]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return E("messageUId",t,g.STRING,!0)&&E("targetId",e,g.STRING,!0)&&E("channelId",n,g.CHANNEL_ID)?[2,Fe((function(r,a){return k(o,void 0,void 0,(function(){var o,s,c,u;return x(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(R.O,"get message reader ->".concat(o)),[4,r.getMessageReader(e,t,n)];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(ot[c],",").concat(o)),[2,{code:c,msg:ot[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t,n,o,r){return xe((function(i,a){return f("messageType",e,g.STRING,!0),f("isPersited",t,g.BOOLEAN,!0),f("isCounted",n,g.BOOLEAN,!0),f("isStatusMessage",r,g.BOOLEAN,!1),f("searchProps",o,g.ARRAY),a.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),Sn(e,t,n)}))}function _o(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?E("conversation",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a,s;return x(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),r=t.code,a=t.data,r===i.SUCCESS?(s=a&&Me(a)||null,[2,{code:r,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(r,",targetId:").concat(e.targetId)),[2,{code:r,msg:ot[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))}function Co(e,t,n){return void 0===n&&(n={}),k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return Le("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),L()?E("conversation",e,g.CONVERSATION,!0)&&E("message",t,g.OBJECT,!0)&&E("options",n,g.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,g.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,g.STRING)&&E("content.senderUserId",t.senderUserId,g.STRING,!0)&&E("content.messageType",t.messageType,g.STRING,!0)&&E("content.content",t.content,g.OBJECT,!0)&&E("content.messageDirection",t.messageDirection,g.NUMBER,!0)&&E("content.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN)&&E("content.expansion",t.expansion,g.OBJECT)&&E("content.disableNotification",t.disableNotification,g.BOOLEAN)&&E("content.sentTime",t.sentTime,g.NUMBER)&&E("content.sentStatus",t.sentStatus,g.NUMBER)?[2,Fe((function(r,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,I,h,m,E,S,T,p;return x(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,l=t.canIncludeExpansion,f=t.expansion,g=t.disableNotification,v=t.sentTime,I=t.sentStatus,a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:I,searchContent:m,isUnread:h,messageUId:d,disableNotification:g,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,E)];case 1:return S=O.sent(),T=S.code,p=S.data,T===i.SUCCESS?[2,{code:T,data:Me(p)}]:(a.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:ot[T]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))}function Ao(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?E("messageId",e,(function(e){return c(e)||_(e)}),!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a;return x(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:Me(a)}]:(o.warn(R.O,"getMessage ->code:".concat(r,",messageId:").concat(e)),[2,{code:r,msg:ot[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))}function Uo(e){if(!L())return{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,r=e.channelId;return E("conversation",e,g.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,r),a=[];return t&&t.length&&t.forEach((function(e){return a.push(Me(e))})),{code:i.SUCCESS,data:a}},be?t(be,Ve,Ge):{code:i.BIZ_ERROR_CLIENT_NOT_INIT}):{code:i.BIZ_ERROR_INVALID_PARAMETER}}function yo(e,t,n,o){return k(this,void 0,void 0,(function(){var r=this;return x(this,(function(a){return Le("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),L()?E("conversation",e,g.CONVERSATION,!0)&&E("keyword",t,g.STRING,!0)&&E("timestamp",n,g.NUMBER)&&E("count",o,g.NUMBER)?[2,Fe((function(a,s){return k(r,void 0,void 0,(function(){var r,c,u,d;return x(this,(function(l){switch(l.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return r=l.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(Me(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:ot[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))}function Mo(e,t,n){return k(this,void 0,void 0,(function(){var o,r,a,s=this;return x(this,(function(c){return Le("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),L()?(o=e.conversationType,r=e.targetId,a=e.channelId,E("conversationType",o,g.NUMBER,!0)&&E("targetId",r,g.STRING,!0)&&E("timestamp",t,g.NUMBER,!0)&&E("cleanSpace",n,g.BOOLEAN)?[2,Fe((function(c,u){return k(s,void 0,void 0,(function(){var s;return x(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,r,t,n,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:t})),s===i.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))}function Po(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return Le("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),L()?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a,s;return x(this,(function(c){switch(c.label){case 0:return t=e.conversationType,r=e.targetId,a=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,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:ot[s]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))}function Lo(e,t,n,o){return k(this,void 0,void 0,(function(){var r=this;return x(this,(function(a){return Le("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),L()?[2,Fe((function(a,s){return k(r,void 0,void 0,(function(){var r,c,u;return x(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];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:ot[c]}])}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))}function wo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?E("conversation",e,g.CONVERSATION,!0)&&E("timestamp",t,g.NUMBER)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c;return x(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,r.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,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:ot[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))}function Bo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return Le("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),L()?E("messageId",e,g.NUMBER,!0)&&E("receivedStatus",t,g.NUMBER,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return r.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:ot[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))}function Do(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("tag.tagId",e.tagId,g.STRING,!0)&&E("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&E("tag.tagName",e.tagName,g.STRING,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(r){switch(r.label){case 0:return o.info(R.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:ot[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("tagId",e,g.STRING,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(r){switch(r.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:ot[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Go(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("tag.tagId",e.tagId,g.STRING,!0)&&E("tag.tagName",e.tagName,g.STRING,!0)&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(r){switch(r.label){case 0:return o.info(R.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:ot[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vo(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,Fe((function(t,n){return k(e,void 0,void 0,(function(){var e,o,r;return x(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,r=e.data,n.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:i.SUCCESS,data:r}]}}))}))}))]}))}))}function ko(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return E("conversation",e,g.CONVERSATION,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a;return x(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),r=t.code,a=t.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:ot[r]}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("conversations",t,g.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,g.CONVERSATION,!0)}))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return r.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:ot[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("conversations",t,g.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,g.CONVERSATION,!0)}))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:ot[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("conversation",e,g.CONVERSATION,!0)&&E("tagIds",t,g.ARRAY,!0)&&!t.some((function(e){return!E("tagId",e,g.STRING,!0)}))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return r.info(R.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)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:ot[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ho(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("conversations",t,g.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,g.CONVERSATION,!0)}))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n;return x(this,(function(a){switch(a.label){case 0:return r.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===i.SUCCESS?[2,{code:n}]:(r.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:ot[n]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jo(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return E("tagId",e,g.STRING,!0)&&E("count",t,g.NUMBER,!0)&&E("startTime",n,g.NUMBER,!0)?[2,Fe((function(r,a){return k(o,void 0,void 0,(function(){var o,s,c;return x(this,(function(u){switch(u.label){case 0:return a.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,r.getConversationListByTag(e,n,t)];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 V(V({},Pe(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(a.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:ot[s]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return E("tagId",e,g.STRING,!0)&&E("containMuted",t,g.BOOLEAN,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,i,a;return x(this,(function(s){switch(s.label){case 0:return r.info(R.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:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ko(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return E("tagId",e,g.STRING,!0)&&E("conversation",t,g.CONVERSATION,!0)&&E("status.isTop",n,g.BOOLEAN,!0)?[2,Fe((function(r,a){return k(o,void 0,void 0,(function(){var o;return x(this,(function(s){switch(s.label){case 0:return a.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,r.setConversationStatusInTag(e,t,{isTop:n})];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:ot[o]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}oo(y.COMBINE_HTML,(function(e,t){return new Cn({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var Yo={COMET:"comet",WEBSOCKET:"websocket"},zo={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 jo=Object.freeze({__proto__:null,getAllConversationList:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?E("channelId",e,g.CHANNEL_ID)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a,s;return x(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),D(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 r=t.code,a=t.data,r===i.SUCCESS&&a?(s=a.map((function(e){return Pe(e)})),[2,{code:r,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(r," channelId: ").concat(e)),[2,{code:r,msg:ot[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return L()?E("startTime",e,g.NUMBER,!0)&&E("count",t,g.NUMBER,!0)&&E("channelId",n,g.CHANNEL_ID)?[2,Fe((function(r,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d,l;return x(this,(function(f){switch(f.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(R.O,"getConversationList -> ".concat(o)),D(n)?[4,r.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=f.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,r.getConversationsByPage(c,e,t,n)];case 3:s=f.sent(),f.label=4;case 4:return u=s.code,d=s.data,u===i.SUCCESS&&d?(l=d.map((function(e){return Pe(e)})),[2,{code:u,data:l}]):(a.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:ot[u]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return L()?E("keyword",e,g.STRING,!0)&&E("messageTypes",t,g.ARRAY,!0)&&E("channelId",n,g.CHANNEL_ID)&&!t.some((function(e){return!E("messageType",e,g.STRING,!0)}))?[2,Fe((function(r,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d;return x(this,(function(l){switch(l.label){case 0:return o="keyword: ".concat(e,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(n),a.info(R.O,"searchConversationByContent -> ".concat(o)),D(n)?[4,r.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,r.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,u=s.data,c===i.SUCCESS&&u?(d=u.map((function(e){return Pe(e)})),[2,{code:c,data:d}]):(a.warn(R.O,"searchConversationByContent fail -> code: ".concat(c," ").concat(o)),[2,{code:c,msg:ot[c]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return k(this,void 0,void 0,(function(){var r=this;return x(this,(function(a){return L()?E("conversation",e,g.CONVERSATION,!0)&&E("keyword",t,g.STRING,!0)&&E("startTime",n,g.NUMBER,!0)&&E("count",o,g.NUMBER,!0)?[2,Fe((function(a,s){return k(r,void 0,void 0,(function(){var r,c,u,d,l,f,g,v,I,h;return x(this,(function(m){switch(m.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(r)),c=e.targetId,u=e.conversationType,d=e.channelId,D(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return l=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:l=m.sent(),m.label=4;case 4:return f=l.code,g=l.data,f===i.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return Me(e)})),[2,{code:f,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(f," ").concat(r)),[2,{code:f,msg:ot[f]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?E("conversation",e,g.CONVERSATION,!0)&&E("option",t,g.OBJECT,!0)&&E("option.keyword",t.keyword,g.STRING,!0)&&E("option.startTime",t.startTime,g.NUMBER,!0)&&E("option.endTime",t.endTime,g.NUMBER,!0)&&E("option.offset",t.offset,g.NUMBER)&&E("option.limit",t.limit,g.NUMBER)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,I;return x(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,l=t.offset,f=t.limit,l=l||0,f=f||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,l,f)];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 Me(e)}))}}]:(r.warn(R.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,o){return k(this,void 0,void 0,(function(){var r=this;return x(this,(function(a){return L()?E("conversation",e,g.CONVERSATION,!0)&&E("userId",t,g.STRING,!0)&&E("startTime",n,g.NUMBER,!0)&&E("count",o,g.NUMBER,!0)?[2,Fe((function(a,s){return k(r,void 0,void 0,(function(){var r,c,u,d,l,f,g;return x(this,(function(v){switch(v.label){case 0:return r="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.A_SEARCH_MESSAGE_BY_USER_T,"searchMessagesByUser -> ".concat(r)),c=e.conversationType,u=e.targetId,d=e.channelId,[4,a.searchMessagesByUser(c,u,t,n,o,d)];case 1:return l=v.sent(),f=l.code,g=l.data,f===i.SUCCESS&&g?[2,{code:f,data:{messages:g.messages.map((function(e){return Me(e)}))}}]:(s.warn(R.A_SEARCH_MESSAGE_BY_USER_R,"searchMessagesByUser fail -> code: ".concat(f,", ").concat(r)),[2,{code:f}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?E("conversation",e,g.CONVERSATION,!0)&&E("option",t,g.OBJECT,!0)&&E("option.count",t.count,g.NUMBER)&&E("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}))&&E("option.timestamp",t.timestamp,g.NUMBER)&&E("option.order",t.order,(function(e){return[0,1].includes(e)}))&&E("option.messageTypes",t.messageTypes,g.ARRAY,!0)&&!t.messageTypes.some((function(e){return!E("option.messageType",e,g.STRING,!0)}))?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s,c,u,d,l,f,g,v,I,h,m,E,S,T,p,O,N;return x(this,(function(_){switch(_.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,u=t.order,d=void 0===u?0:u,l=t.messageTypes,f="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),r.info(R.O,"getHistoryMessagesByMessageTypes -> ".concat(f)),g=e.conversationType,v=e.targetId,I=e.channelId,h=void 0===I?"":I,[4,o.getHistoryMessagesByObjectNames(g,v,c,a,l,d,h)];case 1:return m=_.sent(),E=m.code,S=m.data,E===i.SUCCESS?(p=(T=S).list,O=T.hasMore,N=p.map((function(e){return Me(e)})),[2,{code:E,data:{messages:N,hasMore:O,list:N}}]):(r.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(E," ").concat(f)),[2,{code:E,msg:ot[E]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?E("conversation",e,g.CONVERSATION,!0)&&E("timestamp",t,g.NUMBER,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,i,a,s;return x(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(R.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:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?E("messageId",e,g.NUMBER,!0)&&E("receivedStatus",t,(function(e){return!D(a[e])}),!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){return x(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?E("messageId",e,g.NUMBER,!0)&&E("sentStatus",t,(function(e){return!D(B[e])}),!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){return x(this,(function(n){switch(n.label){case 0:return r.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return L()?E("messageId",e,g.NUMBER,!0)&&E("content",t,g.OBJECT,!0)&&E("messageType",n,g.ONLY_STRING,!0)?[2,Fe((function(r,i){return k(o,void 0,void 0,(function(){return x(this,(function(o){switch(o.label){case 0:return i.info(R.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?!E("messageIds",e,g.ARRAY,!0)||e.some((function(e){return!E("messageId",e,g.NUMBER,!0)}))?[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return o.info(R.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,i;return x(this,(function(a){switch(a.label){case 0:return t=e.conversationType,r=e.targetId,i=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(r,",conversationType:").concat(t)),[4,n.clearMessages(t,r,i)];case 1:return[2,{code:a.sent()}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return k(this,void 0,void 0,(function(){var o,r,a,s=this;return x(this,(function(c){return L()?(o=e.conversationType,r=e.targetId,a=e.channelId,E("conversationType",o,g.NUMBER,!0)&&E("targetId",r,g.STRING,!0)&&E("timestamp",t,g.NUMBER,!0)&&E("cleanSpace",n,g.BOOLEAN)?[2,Fe((function(e,i){return k(s,void 0,void 0,(function(){return x(this,(function(i){switch(i.label){case 0:return[4,e.deleteMessagesByTimestamp(o,r,t,n,a)];case 1:return[2,{code:i.sent()}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),k(this,void 0,void 0,(function(){var o=this;return x(this,(function(r){return L()?E("conversation",e,g.CONVERSATION,!0)&&E("message",t,g.OBJECT,!0)&&E("options",n,g.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,g.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,g.STRING)&&(t instanceof En||E("message.senderUserId",t.senderUserId,g.STRING,!0)&&E("message.messageType",t.messageType,g.STRING,!0)&&E("message.content",t.content,g.OBJECT,!0)&&E("message.messageDirection",t.messageDirection,g.NUMBER,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,g.BOOLEAN)&&E("message.expansion",t.expansion,g.OBJECT)&&E("message.disableNotification",t.disableNotification,g.BOOLEAN)&&E("message.sentTime",t.sentTime,g.NUMBER)&&E("message.sentStatus",t.sentStatus,g.NUMBER))?[2,Fe((function(r,a){return k(o,void 0,void 0,(function(){var o,s,c,u,d,l,f,g,v,I,h,m,E,S,T;return x(this,(function(p){switch(p.label){case 0:return o="",s=1,l=!1,g=t.messageType,v=t.content,t instanceof En||(o=t.senderUserId,s=t.messageDirection,l=t.canIncludeExpansion,f=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),a.info(R.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),I=n.isUnread,h=n.searchContent,m={senderUserId:o,messageType:g,content:v,messageDirection:s,sentTime:c,sentStatus:u,searchContent:h,isUnread:I,messageUId:"",disableNotification:d,canIncludeExpansion:l,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,r.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=p.sent(),S=E.code,T=E.data,S===i.SUCCESS?[2,{code:S,data:Me(T)}]:(a.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:ot[S]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return k(this,void 0,void 0,(function(){var r,a=this;return x(this,(function(c){if(!L())return[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}];if(!E("messages",e,(function(e){return v(e)&&!(e.length<=0||e.length>=500)}),!0)||!E("checkDuplicate",t,g.BOOLEAN))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}];for(r in e)if(!(E("message",e[r],g.OBJECT,!0)&&E("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)&&E("message.targetId",e[r].targetId,g.STRING,!0)&&E("message.senderUserId",e[r].senderUserId,g.STRING,!0)&&E("message.messageType",e[r].messageType,g.STRING,!0)&&E("message.content",e[r].content,g.OBJECT,!0)&&E("message.messageDirection",e[r].messageDirection,g.NUMBER,!0)&&E("message.canIncludeExpansion",e[r].canIncludeExpansion,g.BOOLEAN)&&E("message.expansion",e[r].expansion,g.OBJECT)&&E("message.disableNotification",e[r].disableNotification,g.BOOLEAN)&&E("message.sentTime",e[r].sentTime,g.NUMBER)&&E("message.sentStatus",e[r].sentStatus,g.NUMBER)&&E("options.isUnread",null===(n=e[r])||void 0===n?void 0:n.isUnread,g.BOOLEAN)&&E("options.searchContent",null===(o=e[r])||void 0===o?void 0:o.searchContent,g.STRING)))return[2,{code:i.BIZ_ERROR_INVALID_PARAMETER,msg:String(r)}];return[2,Fe((function(n){return k(a,void 0,void 0,(function(){var o,r,a;return x(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),r=o.code,a=o.data,r===i.SUCCESS?[2,{code:r,data:a}]:[2,{code:r,msg:ot[r]}]}}))}))}))]}))}))},getMessageCount:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?[2,Fe((function(n){return k(t,void 0,void 0,(function(){var t,o,r,i,a,s;return x(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:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?E("messageUId",e,g.STRING,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t,r,a;return x(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),r=t.code,a=t.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:ot[r]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return L()?E("targetId",e,g.STRING,!0)&&E("messageUId",t,g.STRING,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(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===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(t)),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return L()?E("enableCheck",e,g.BOOLEAN)?[2,Fe((function(n){return k(t,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return L()?[2,Fe((function(t,n){return k(e,void 0,void 0,(function(){var e,o,r;return x(this,(function(i){switch(i.label){case 0:return n.info(R.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:i.NOT_SUPPORT,msg:ot[i.NOT_SUPPORT]}]}))}))}});function Wo(e){return k(this,void 0,void 0,(function(){var t=this;return x(this,(function(n){return!e||E("proxy.socksHost",e.socksHost,g.STRING,!0)&&E("proxy.socksPort",e.socksPort,g.NUMBER,!0)?[2,Fe((function(n,o){return k(t,void 0,void 0,(function(){var t;return x(this,(function(r){switch(r.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=r.sent().code)===i.SUCCESS?[2,{code:t}]:(o.warn(R.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:ot[t]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qo(){return k(this,void 0,void 0,(function(){var e=this;return x(this,(function(t){return[2,Fe((function(t,n){return k(e,void 0,void 0,(function(){var e,o,r;return x(this,(function(a){switch(a.label){case 0:return[4,t.getProxy()];case 1:return e=a.sent(),o=e.code,r=e.data,o===i.SUCCESS?[2,{code:o,data:r}]:(n.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:ot[o]}])}}))}))}))]}))}))}function Xo(e,t){return k(this,void 0,void 0,(function(){var n=this;return x(this,(function(o){return!e||E("proxy.socksHost",e.socksHost,g.STRING,!0)&&E("proxy.socksPort",e.socksPort,g.NUMBER,!0)?[2,Fe((function(o,r){return k(n,void 0,void 0,(function(){var n,a,s;return x(this,(function(c){switch(c.label){case 0:return r.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),a=n.status,s=n.data,a===i.SUCCESS?[2,{code:a,msg:s}]:(r.warn(R.O,"testProxy ->code:".concat(a)),[2,{code:a,msg:ot[a]}])}}))}))}))]:[2,{code:i.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{En as BaseMessage,Cn as CombineMessage,wn as CommandMessage,Yo as ConnectType,Ce as Events,An as FileMessage,Un as GIFMessage,Dn as GroupNotificationMessage,On as HQVoiceMessage,pn as ImageMessage,Bn as InformationNotificationMessage,Mn as LocationMessage,zo as MessageType,Pn as ReferenceMessage,Ln as RichContentMessage,Nn as SightMessage,_n as TextMessage,yn as VoiceMessage,Xe as __addSDKVersion,xo as addConversationsToTag,Ze as addEventListener,Do as addTag,In as addToBlacklist,vn as bindRTCRoomForChatroom,Et as clearAllMessagesUnreadStatus,Ke as clearEventListeners,Eo as clearHistoryMessages,Po as clearMessages,mt as clearMessagesUnreadStatus,gt as clearTextMessageDraft,wo as clearUnreadCountByTimestamp,at as connect,Mo as deleteLocalMessagesByTimestamp,mo as deleteMessages,ze as destroy,st as disconnect,jo as electronExtension,dn as forceRemoveChatRoomEntry,sn as forceSetChatRoomEntry,fn as getAllChatRoomEntries,Lt as getAllConversationState,qt as getAllUltraGroupUnreadCount,Kt as getAllUltraGroupUnreadMentionedCount,Pt as getAllUnreadMentionedCount,Rn as getBlacklist,mn as getBlacklistStatus,Bt as getBlockUltraGroupList,Ct as getBlockedConversationList,ln as getChatRoomEntry,on as getChatRoomInfo,gn as getChatroomHistoryMessages,je as getConnectionStatus,ut as getConversation,ct as getConversationList,Nt as getConversationNotificationLevel,_t as getConversationNotificationStatus,Jo as getConversationsFromTagByPage,Qe as getCurrentUserId,$e as getDeviceId,$n as getFileToken,eo as getFileUrl,_o as getFirstUnreadMessage,uo as getHistoryMessages,Ao as getMessage,Oo as getMessageReader,Qo as getProxy,lo as getRemoteHistoryMessages,We as getServerTime,Vo as getTags,ko as getTagsFromConversation,lt as getTextMessageDraft,Ut as getTopConversationList,vt as getTotalUnreadCount,It as getTotalUnreadCountByLevels,ht as getTotalUnreadMentionedCountByLevels,Zt as getUltraGroupDefaultNotificationLevel,zt as getUltraGroupFirstUnreadMessageTimestamp,wt as getUltraGroupList,bt as getUltraGroupMessageListByMessageUId,Jt as getUltraGroupUnreadCountByTargetId,jt as getUltraGroupUnreadInfoList,Ft as getUltraGroupUnreadMentionedCountByTargetId,Yt as getUltraGroupUnreadMentionedMessages,yt as getUnreadConversationList,Rt as getUnreadCount,qo as getUnreadCountByTag,Mt as getUnreadMentionedCount,Uo as getUnreadMentionedMessages,Ye as init,Co as insertMessage,et as installPlugin,en as joinChatRoom,tn as joinExistChatRoom,xt as modifyMessage,He as onceEventListener,nn as quitChatRoom,Ro as recallMessage,No as registerMessageType,kt as removeAllExpansionForUltraGroupMessage,un as removeChatRoomEntries,cn as removeChatRoomEntry,dt as removeConversation,Fo as removeConversationsFromTag,Je as removeEventListener,qe as removeEventListeners,Vt as removeExpansionForUltraGroupMessage,hn as removeFromBlacklist,To as removeMessageExpansionForKey,bo as removeTag,Ho as removeTagFromConversations,Zo as removeTagsFromConversation,ft as saveTextMessageDraft,Lo as searchConversationByContent,yo as searchMessages,ro as sendFileMessage,ao as sendGIFMessage,so as sendHQVoiceMessage,io as sendImageMessage,to as sendMessage,fo as sendReadReceiptMessage,go as sendReadReceiptRequest,vo as sendReadReceiptResponse,Io as sendReadReceiptResponseV2,co as sendSightMessage,ho as sendSyncReadStatusMessage,no as sendTextMessage,po as sendTypingStatusMessage,Dt as sendUltraGroupTypingStatus,an as setChatRoomEntries,rn as setChatRoomEntry,pt as setConversationNotificationLevel,Ot as setConversationNotificationStatus,At as setConversationToTop,Ko as setConversationToTopInTag,Bo as setMessageReceivedStatus,Wo as setProxy,Ht as setUltraGroupDefaultNotificationLevel,Xo as testProxy,Gt as updateExpansionForUltraGroupMessage,So as updateMessageExpansion,Go as updateTag};