@rongcloud/imlib-next 5.7.2 → 5.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.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 a,ConversationType as i,isNumber as s,EventEmitter as c,RCConnectionStatus as u,VersionManage as d,assert as f,AssertRules as l,isArray as g,isHttpUrl as v,APIContext as I,LogTagId as R,logger as h,validate as E,isValidConversationType as m,isValidNotificationLevel as S,NotificationLevel as T,isTypeInConversationList as p,UltraGroupChannelType as O,isString as N,getUUID as _,UploadMethod as C,isValidFileType as A,FileType as y,usingCppEngine as M,MessageDirection as U,SentStatus as P,isUndefined as L}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var w=function(){return w=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},w.apply(this,arguments)};function B(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{c(o.next(e))}catch(e){a(e)}}function s(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}c((o=o.apply(e,t||[])).next())}))}function D(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)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 i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var b=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},G=b(),x=function(){var e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return"undefined"!=typeof XMLHttpRequest&&e?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")};var V,k={tag:"browser",httpReq:function(e){var r=e.method||t.GET,a=e.timeout||n,i=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var t=x(),n="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(r,u),i&&t.setRequestHeader)for(var o in i)t.setRequestHeader(o,i[o]);if(n){t.timeout=a,t.onload=function(){e({data:t.responseText,status:t.status||200})},t.onerror=function(){e({status:t.status||0})},t.ontimeout=function(){e({status:t.status||0})};var s="object"==typeof c?JSON.stringify(c):c;t.send(s)}else t.onreadystatechange=function(){4===t.readyState&&e({data:t.responseText,status:t.status})},t.onerror=function(){e({status:t.status||0})},setTimeout((function(){t.abort(),e({status:t.status||0})}),a),t.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:G,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.UNKONWN;return new Promise((function(e){e(r)}))}},H=b(),F=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:F("setStorageSync"),getItem:F("getStorageSync"),removeItem:F("removeStorageSync"),clear:F("clearStorageSync")},q={tag:"wechat",httpReq:function(e){var a=e.method||t.GET,i=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:a,header:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Z,sessionStorage:Z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:H,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},J=b(),z=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){}}},K={setItem:z("setStorageSync"),getItem:z("getStorageSync"),removeItem:z("removeStorageSync"),clear:z("clearStorageSync")},Y={tag:"alipay",httpReq:function(e){var a=e.method||t.GET,i=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:a,headers:s,timeout:i,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:K,sessionStorage:K,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:J,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},j=b(),W=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){}}},X={setItem:W("setStorageSync"),getItem:W("getStorageSync"),removeItem:W("removeStorageSync"),clear:W("clearStorageSync")},Q={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:j,localStorage:X,sessionStorage:X,httpReq:function(e){return new Promise((function(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{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)}})}))}},$=b(),ee=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){}}},te={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},ne={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$,localStorage:te,sessionStorage:te,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{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return B(this,void 0,void 0,(function(){return D(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))]}))}))}},oe=b(),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)}}},ae={setItem:re("setStorageSync"),getItem:re("getStorageSync"),removeItem:re("removeStorageSync"),clear:re("clearStorageSync")},ie={tag:"jingdong",httpReq:function(e){var a=e.method||t.GET,i=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:a,headers:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ae,sessionStorage:ae,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:oe,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){jd.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},se=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)}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue={tag:"uniapp",httpReq:function(e){var a=e.method||t.GET,i=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:a,header:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ce,sessionStorage:ce,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},de=function(e){return e&&e.request&&e.getSystemInfo},fe="undefined"!=typeof uni&&de(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ue;case"mp-jd":return ie;case"mp-baidu":return ne;case"mp-toutiao":return Q;case"mp-alipay":return Y;case"mp-weixin":return q;default:return k}}():"undefined"!=typeof jd&&de(jd)?ie:"undefined"!=typeof my&&de(my)?Y:"undefined"!=typeof tt&&de(tt)?Q:"undefined"!=typeof swan&&de(swan)?ne:"undefined"!=typeof wx&&de(wx)?q:k;function le(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,R=e.isOffLineMessage,h=e.canIncludeExpansion,E=e.expansion,m=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,y=e.channelType,M=e.sentStatus;m||(m=a.UNREAD);var U={messageType:o,channelId:n||"",content:r,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:S,isStatusMessage:p,canIncludeExpansion:h,expansion:E,receivedStatus:m,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return t!==i.ULTRA_GROUP&&(U.isOffLineMessage=R),t===i.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function ge(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,a=e.hasMentioned,i=e.mentionedInfo,s=e.lastUnreadTime,c=e.notificationStatus,u=e.notificationLevel,d=e.isTop,f=e.channelId,l=e.unreadMentionedCount,g=e.matchCount;return{conversationType:t,targetId:n,latestMessage:o&&le(o),unreadMessageCount:r,hasMentioned:a,mentionedInfo:a?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:s,notificationStatus:c,notificationLevel:u,isTop:d,channelId:f,unreadMentionedCount:l,matchCount:g}}function ve(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"}(V||(V={}));var Ie=new c,Re={connection:function(e,t){switch(e){case u.CONNECTED:Ie.emit(V.CONNECTED);break;case u.CONNECTING:Ie.emit(V.CONNECTING);break;case u.SUSPENDED:Ie.emit(V.SUSPEND,t);break;case u.DISCONNECTED:Ie.emit(V.DISCONNECT,t)}},batchMessage:function(e){Ie.emit(V.MESSAGES,{messages:e.map((function(e){return le(e)}))})},typingState:function(e){Ie.emit(V.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){Ie.emit(V.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){Ie.emit(V.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Ie.emit(V.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?le(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===i.ULTRA_GROUP?(n.versionTime=e.versionTime,{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));Ie.emit(V.CONVERSATION,{conversationList:t})},chatroomState:function(e){Ie.emit(V.CHATROOM,e)},expansion:function(e){Ie.emit(V.EXPANSION,e)},pullFinished:function(){Ie.emit(V.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Ie.emit(V.TAG)},conversationTagChanged:function(){Ie.emit(V.CONVERSATION_TAG)},messageBlocked:function(e){Ie.emit(V.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Ie.emit(V.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Ie.emit(V.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Ie.emit(V.ULTRA_GROUP_ENABLE,e.map((function(e){return ge(e)})))},operateStatus:function(e){Ie.emit(V.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return le(e)})))},ultraGroupMessageModified:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return le(e)})))},ultraGroupMessageRecalled:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return le(e)})))},ultraGroupChannelChangeType:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_DELETE,e)}};d.add("imlib-next","5.7.2");var he=null,Ee=null,me=null;function Se(){return B(this,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return he?(me.info(R.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),Ee=null,he=null,me=null,[2]}}))}))}function Te(e){if(!he)throw new Error("Not initialized yet!");return e(he,me,Ee)}function pe(e){return he?e(he,me,Ee):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function Oe(e,t,n){Ie.on(e,t,n)}function Ne(e,t,n){Ie.once(e,t,n)}function _e(e,t,n){Ie.off(e,t,n)}function Ce(e){Ie.removeAll(e)}function Ae(){Ie.clear()}function ye(e){!function(e){var t,n=e.appkey,o=e.navigators;he?me.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,l.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(v))})),Ee=e,he=I.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||fe,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(me=he.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),me.info(R.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.7.2",commit:"4d508a986119ce3a6cf9e528a520ae05b651446d"})),he.assignWatcher(Re))}(e)}function Me(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return he?(Ae(),[2,Se()]):[2]}))}))}function Ue(){return Te((function(e){return e.getConnectionStatus()}))}function Pe(){return Te((function(e){return e.getServerTime()}))}function Le(){return Te((function(e){return e.getCurrentUserId()}))}function we(e,t){d.add(e,t)}function Be(){return Te((function(e){return e.getDeviceId()}))}function De(e,t){return Te((function(n){return n.install(e,t)}))}var be={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:r.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Ge={};for(var xe in be){var Ve=be[xe].code;Ge[Ve]=xe}function ke(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return E("token",e,l.STRING,!0)&&E("reconnectKickEnable",t,l.BOOLEAN)?(n=a.createTraceId(),a.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 i=c.sent(),s=i.code===r.SUCCESS?"info":"warn",a[s](R.A_CONNECT_R,JSON.stringify({code:i.code,userId:i.userId}),n),i.code===r.SUCCESS?[2,{code:i.code,data:{userId:i.userId}}]:[2,{code:i.code,msg:Ge[i.code]}]}}))}))}))]}))}))}function He(e){return h.info(R.A_DISCONNECT_O,{}),Te((function(t){return t.disconnect(e)}))}function Fe(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options.count",null==e?void 0:e.count,l.NUMBER)&&E("options.startTime",null==e?void 0:e.startTime,l.NUMBER)&&E("options.order",null==e?void 0:e.order,l.NUMBER)&&E("channelId",t,l.CHANNEL_ID)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(a.warn(R.O,"get conversation list fail ->".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ze(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),a=t.code,i=t.data,a!==r.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(a,", targetId:").concat(e.targetId)),[2,{code:a,msg:Ge[a]}]):[2,{code:a,data:i?ge(i):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qe(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(i){switch(i.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(a)),t!==r.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(t,":").concat(Ge[t],",").concat(a)),[2,{code:t,msg:Ge[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),a=t.code,i=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get draft ->".concat(s)),a===r.SUCCESS?[2,{code:a,data:i||""}]:(o.warn(R.O,"get draft fail ->".concat(a,":").concat(Ge[a],",").concat(s)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options",e,l.CONVERSATION,!0)&&E("draft",t,l.STRING,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(R.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())===r.SUCCESS?[2,{code:i}]:(a.warn(R.O,"set draft fail ->".concat(i,":").concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ke(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(i){switch(i.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(a=i.sent())===r.SUCCESS?[2,{code:a}]:(o.warn(R.O,"delete draft fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ye(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("includeMuted",e,l.BOOLEAN,!1)&&E("conversationTypes",t,l.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!E("conversationType",e,m)})))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return a.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(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(R.O,"getTotalUnreadCount fail ->".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!E("conversationTypes",e,l.ARRAY,!0)||!E("levels",t,l.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,m)}))||t.some((function(e){return!E("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]}))}))}function We(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!E("conversationTypes",e,l.ARRAY,!0)||!E("levels",t,l.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,m)}))||t.some((function(e){return!E("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]}))}))}function Xe(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),a=t.code,i=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get unreadCount ->".concat(s)),a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(R.O,"get unreadCount fail ->".concat(a,":").concat(Ge[a],",").concat(s)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qe(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(i){switch(i.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(a)),t!==r.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(t,":").concat(Ge[t],",").concat(a)),[2,{code:t,msg:Ge[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}be.ROAMING_SERVICE_UNAVAILABLE.code;var et=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},nt=function(e,t,n,o){return void 0===o&&(o=""),B(void 0,void 0,void 0,(function(){var a,i;return D(this,(function(s){switch(s.label){case 0:return a=et(e,t,o),[4,n()];case 1:return(i=s.sent())!==r.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(i," : ").concat(Ge[i]," , ").concat(a)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))};function ot(e,t){return B(this,void 0,void 0,(function(){return D(this,(function(n){return E("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)&&E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return nt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rt(e,t){return B(this,void 0,void 0,(function(){return D(this,(function(n){return E("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return nt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function at(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return t=et(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS?[2,{code:i,data:s}]:(o.warn(R.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(Ge[i]," , ").concat(t)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function it(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(R.O,"getConversationNotificationStatus ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function st(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getBlockConversationList()}))]}))}))}function ct(e,t){return void 0===t&&(t=!0),B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options",e,l.CONVERSATION,!0)&&E("isTop",t,l.BOOLEAN)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(R.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"set conversation status fail ->".concat(i,":").concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ut(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversationTypes",e,l.ARRAY)&&!(null==e?void 0:e.some((function(e){return!E("conversationType",e,m)})))&&E("channelId",t,l.CHANNEL_ID)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(a.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return!E("conversationTypes",e,l.ARRAY)||(null==e?void 0:e.some((function(e){return!E("conversationType",e,p)})))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,o,a;return D(this,(function(i){switch(i.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=i.sent(),o=t.code,a=t.data,o===r.SUCCESS&&a?[2,{code:0,data:a.map((function(e){return ge(e)}))}]:[2,{code:o,msg:Ge[o]}]}}))}))}))]}))}))}function ft(e){return B(this,void 0,void 0,(function(){return D(this,(function(t){return E("options",e,l.CONVERSATION,!0)?[2,pe((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 B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e,t){return t.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function gt(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getAllConversationState()}))]}))}))}function vt(e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options.targetId",e.targetId,l.STRING,!1)&&E("options.channelType",e.channelType,(function(e){return void 0!==O[e]}),!1)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(o.warn(R.O,"get ultragroup ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a;return D(this,(function(i){switch(i.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(n.warn(R.O,"get block ultragroup ->".concat(o,":").concat(Ge[o])),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Rt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(Ge[t])),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options",e,l.CONVERSATION,!0)&&E("msgs",t,l.ARRAY,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return n=e.targetId,i=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:i,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),f=d.code,l=d.data,f===r.SUCCESS){for(v in g={},l)Object.prototype.hasOwnProperty.call(l,v)&&(g[v]=l[v]?le(l[v]):void 0);return[2,{code:r.SUCCESS,data:g}]}return a.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(Ge[f])),[2,{code:f,msg:Ge[f]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("expansion",e,l.OBJECT,!0)&&E("message",t,l.OBJECT,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(s),a.debug(R.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(R.O,"update expansion for ultragroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("expansion",e,l.ARRAY,!0)&&E("message",t,l.OBJECT,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(s),a.debug(R.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(R.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("message",e,l.OBJECT,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return t=e.conversationType,a=e.targetId,i=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(u,",messageUId:").concat(i),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:a,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:i,removeAll:!0},[4,n.expandUltraMessage(f)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("content",e,l.OBJECT,!0)&&E("message",t,l.OBJECT,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,f=t.channelId,l="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(f,",messageUId:").concat(s),a.debug(R.O,"update ultragroup message expansion ->".concat(l)),g={targetId:i,channelId:f,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=I.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(R.O,"modify ultraGroup message ->".concat(v,":").concat(Ge[v])),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("notificationLevels",t,l.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,S)})))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return a.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(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:r.SUCCESS,data:s}]:(a.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ot(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options.targetId",e.targetId,l.STRING,!0)&&E("options.channelId",e.channelId,l.CHANNEL_ID)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s,c;return D(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(t," -> ").concat(a)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:(o.warn(R.O,"".concat(t," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,l.STRING,!0)&&E("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&E("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),a.debug(R.O,"".concat(n," -> ").concat(i)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===r.SUCCESS?[2,{code:s}]:(a.warn(R.O,"".concat(n," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(i)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("notificationLevels",t,l.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,S)})))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=d.sent(),s=i.code,c=i.data,u="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),a.debug(R.O,"".concat(n," -> ").concat(u)),s===r.SUCCESS?[2,{code:s,data:c}]:(a.warn(R.O,"".concat(n," fail -> ").concat(s,": ").concat(Ge[s],", ").concat(u)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a,i;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),a=o.code,i=o.data,n.debug(R.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(n.warn(R.O,"".concat(e," fail ->").concat(a,": ").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function At(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a,i;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),a=o.code,i=o.data,n.debug(R.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(n.warn(R.O,"".concat(e," fail ->").concat(a,": ").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function yt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,l.STRING,!0)&&E("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&E("options.sentTime",e.sentTime,l.NUMBER,!0)&&E("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return t=e.targetId,a=e.channelId,i=e.sentTime,s=e.count,c={targetId:t,channelId:a,sentTime:i,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===r.SUCCESS?[2,{code:d,data:f}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Ge[d])),[2,{code:d,msg:Ge[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("conversation.targetId",e.targetId,l.STRING,!0)&&E("conversation.channelId",e.channelId,l.CHANNEL_ID,!0)?[2,pe((function(n){return B(t,void 0,void 0,(function(){var t,o,a,i,s,c;return D(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,a={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Ge[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Ut=function(e){return!!(E("options.key",e.key,l.STRING,!0)&&E("options.value",e.value,l.STRING,!0)&&E("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&E("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,l.STRING))},Pt=function(e){return e.entries.every((function(e){return E("entry.key",e.key,l.STRING,!0)&&E("entry.value",e.value,l.STRING,!0)}))&&E("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,l.STRING)&&E("options.isForce",e.isForce,l.BOOLEAN)},Lt=function(e){return E("options.key",e.key,l.STRING,!0)&&E("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,l.STRING)},wt=function(e){return e.entries.every((function(e){return E("key",e,l.STRING,!0)}))&&E("options.notificationExtra",e.notificationExtra,l.STRING)};function Bt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("options.count",t.count,l.NUMBER,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return n=a.createTraceId(),a.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 i=c.sent(),s=i===r.SUCCESS?"info":"warn",a[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),n),i!==r.SUCCESS?[2,{code:i,msg:Ge[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("options.count",t.count,l.NUMBER,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return n=a.createTraceId(),a.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 i=c.sent(),s=i===r.SUCCESS?"info":"warn",a[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),n),i!==r.SUCCESS?[2,{code:i,msg:Ge[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("targetId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(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 a=s.sent(),i=a===r.SUCCESS?"info":"warn",o[i](R.A_QUIT_CHATROOM_R,JSON.stringify({code:a}),t),a!==r.SUCCESS?[2,{code:a,msg:Ge[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("options.count",t.count,l.NUMBER)&&E("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(R.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(a.warn(R.O,"get chatroom info fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&Ut(t)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&Pt(t)?t.entries.length>10?[2,be.CHATROOM_KV_STORE_OUT_LIMIT]:[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return i=u.sent(),s=i.code,c=i.data,s!==r.SUCCESS?(a.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&Ut(t)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(R.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"force set chatroom entry fail ->code+:".concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&Lt(t)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(R.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&wt(t)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),a.info(R.O,"remove chatroom entry->".concat(n)),(i=w({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,i)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==r.SUCCESS?(a.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[c],",").concat(n)),[2,{code:c,msg:Ge[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&Lt(t)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.info(R.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"force remove chatroom entry fail ->code+:".concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("key",t,(function(e){return N(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(R.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(a.warn(R.O,"get chatroom entry fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("targetId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(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 a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS&&s?[2,{code:i,data:s}]:(o.warn(R.O,"get all chatroom entries fail ->code+:".concat(Ge[i],",").concat(t)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("options.timestamp",t.timestamp,l.NUMBER)&&E("options.count",t.count,l.NUMBER)&&E("options.order",t.order,(function(e){return 0===e||1===e}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),a.debug(R.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(a.warn(R.O,"get chatroom history message fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("option.chatRoomId",e.chatRoomId,l.STRING,!0)&&E("option.rtcRoomId",e.rtcRoomId,l.STRING,!0)?[2,pe((function(n){return B(t,void 0,void 0,(function(){var t;return D(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:Ge[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("userId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){return D(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 jt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("userId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){return D(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 Wt(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a;return D(this,(function(i){switch(i.label){case 0:return n.info(R.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS&&a?[2,{code:o,data:a}]:(n.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Xt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("userId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(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(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:0===i}]:(o.warn(R.O,"getBlacklistStatus fail -> code: ".concat(a,", userId: ").concat(e)),[2,{code:a}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Qt=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 $t(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Qt(e,o,t,n)}}var en,tn,nn=$t("RC:ImgMsg"),on=$t("RC:HQVCMsg"),rn=$t("RC:SightMsg"),an=$t("RC:TxtMsg"),sn=$t("RC:CombineMsg"),cn=$t("RC:FileMsg"),un=$t("RC:GIFMsg"),dn=$t("RC:VcMsg"),fn=$t("RC:LBSMsg"),ln=$t("RC:ReferenceMsg"),gn=$t("RC:ImgTextMsg"),vn={qiniu:function(e,t,n,o){Te((function(r){var a=r.getNaviInfoFromCache();if(1===(null==a?void 0:a.type)&&t.chunk_size&&o.size>t.chunk_size){var i=_();i+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=i,On(o,t,n)}else pn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>Rn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=t||{};t=t||tn;var a=new XMLHttpRequest,i=mn();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var s=i+In[0][1]+r.bosUploadPath;In.shift();var c=r.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});a.onreadystatechange=function(){if(4===a.readyState)if(JSON.parse(a.responseText||"{}").filename=t.uniqueValue,200===a.status){n.onCompleted(u,!0)}else In.length?vn[In[0][0]](e,t,n,o):n.onError("upload fail")},a.open(t.method,s,!0),a.setRequestHeader("authorization",c.bosToken),a.setRequestHeader("x-bce-date",c.bosDate),a.send(o)},aliyun:function(e,t,n,o){if(o.size>Rn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token"));var a=In[0][1];In.shift(),e=e||en,t=(t=t||{})||tn;var i=new XMLHttpRequest,s=mn(),c="".concat(s+t.ossBucketName,".").concat(a);i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var e=JSON.parse(i.responseText||"{}");e.name=t.uniqueValue,e.filename=t.uploadFileName,e.uploadMethod=C?C.ALI:"",200===i.status?n.onCompleted(e):In.length?vn[In[0][0]](r,t,n,o):n.onError("upload fail")}},i.open(t.method,c,!0),console.log("ali:url",c);var u=t.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",t.uploadFileName),e.delete("file"),e.append("file",o),i.send(e)},s3:function(e,t,n,o){var r=new FormData,a=new XMLHttpRequest,i=mn(),s=t.contentDisposition,c=In[0][1],u="".concat(i+t.s3BucketName,".").concat(c);console.log("uploadS3:url",u),In.shift(),a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var r=JSON.parse(a.responseText||"{}");if(r.name=t.uniqueValue,r.filename=t.uploadFileName,r.uploadMethod=C.AWS,200===a.status||204===a.status)n.onCompleted(r);else if(In.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),vn[In[0][0]](i,t,n,o)}else n.onError("upload fail")}},a.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;s?r.set("Content-Disposition","".concat(s,";")):r.set("Content-Disposition","text/html"===f?"inline;":"attachment;");r.set("Content-Type",f),r.set("x-amz-credential",d.s3Credential),r.set("x-amz-algorithm",d.s3Algorithm),r.set("x-amz-date",d.s3Date),r.set("policy",d.s3Policy),r.set("x-amz-signature",d.s3Signature),r.set("key",t.uploadFileName),r.set("file",o),a.send(r)},stc:function(e,t,n,o){var r=new XMLHttpRequest,a=t.contentDisposition,i=In[0][1],s="https://".concat(i,"/").concat(t.stcBucketName,"/").concat(t.uploadFileName);In.shift(),r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");if(a.name=t.uniqueValue,a.filename=t.uploadFileName,a.uploadMethod=C?C.STC:"",200===r.status||204===r.status)n.onCompleted(a);else if(In.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),vn[In[0][0]](i,t,n,o)}else n.onError("upload fail")}},r.open("PUT",s,!0);var c=t?t.stcHeader:{};r.setRequestHeader("Content-Type",o.type),a?r.setRequestHeader("Content-Disposition","".concat(a,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");r.setRequestHeader("Authorization",c.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",c.stcContentSha256),r.setRequestHeader("x-amz-date",c.stcDate),r.send(o)}},In=[],Rn={BOS_CHUNCK_SIZE:5368709120},hn="http://",En="https://";function mn(){var e=En;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=hn),e}var Sn,Tn=(Sn="RC-upload-",{get:function(e){e=Sn+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=Sn+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=Sn+e,localStorage.removeItem(e)}});function pn(e,t,n,o){var r=En+t.uploadHost.qiniu,a=(/http/.test(In[0][1])?"":mn())+In[0][1]||r;t.isChunk||In.shift();var i=new XMLHttpRequest;i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var r=JSON.parse(i.responseText||"{}");r.filename=t.uniqueValue,r.uploadMethod=C?C.QINIU:"",200===i.status||204===i.status?n.onCompleted(r):In.length?vn[In[0][0]](e,t,n,o):n.onError("upload fail")}},i.open(t.method,a,!0),n.onOpen(i),t.stream&&i.setRequestHeader("authorization","UpToken ".concat(t.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(t.headers,(function(e,t){i.setRequestHeader(e,t)})),i.send(e)}function On(e,t,n,o){var r=0,a=o||_(),i=Tn.get(a);i&&(e.uniqueName=i.sessionId,r=i.offset);var s=Math.min(t.chunk_size,e.size-r),c=e.slice(r,r+s),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(r,"-").concat(r+s);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,c.name=e.name,c=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var a=t.multi_parmas[r];o.append(r,a)}return o}(c,t,e.uniqueName),pn(c,t,{onCompleted:function(o){r+=s;var i=e.uniqueName;Tn.set(a,{offset:r,sessionId:i}),r<e.size?On(e,t,n,a):(r=0,Tn.remove(a),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var a=e+r;n.onProgress(a,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function Nn(e,t,n,o){var r,a,i=t&&t.type||"text/plain",s=i.indexOf("image")>-1?1:4,c=n.contentDisposition,u=Math.ceil(t.size/n.stc_chunk_size),d=n&&JSON.parse(n.ossConfig?n.ossConfig:"");Array.isArray(d)||(d=[]);var f=d.find((function(e){return Object.keys(e).includes("stc")})),l="uploads";e.getFileToken(s,r,"POST",l).then((function(e){r=e.fileName,a="https://".concat(f.stc,"/").concat(n.stcBucketName,"/").concat(r),console.log("uploadStcMultipart:url",a);var s=new XMLHttpRequest;s.open("POST","".concat(a,"?").concat(l),!0),c?s.setRequestHeader("Content-Disposition","".concat(c,";")):s.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),s.setRequestHeader("Authorization",e&&e.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),s.setRequestHeader("x-amz-date",e&&e.stcDate),s.setRequestHeader("Content-Type",i),s.send(),s.onreadystatechange=function(){if(4===s.readyState){var e=s.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===s.status||204===s.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(R(e,n));I(e,t)}(Array.isArray(e)&&e[1]):o.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));var g=[],v=new Map;function I(c,d){d&&Array.isArray(d)&&0!==d.length&&Promise.all(d).then((function(){var d="uploadId=".concat(c);if(v.size===u)e.getFileToken(s,r,"POST",d).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",c);var r=new XMLHttpRequest;r.open("POST","".concat(a,"?").concat(d),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i);var s="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(v.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",u),u.forEach((function(e){s+="<Part><ETag>".concat(v.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),s+="</CompleteMultipartUpload>",r.send(s),console.log("xml",s),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e={name:t.name,filename:n.uploadFileName,uploadMethod:C.STC};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var f=[],l=0,h=g;l<h.length;l++){var E=h[l];f.push(R(c,E))}I(c,f)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,r=g;n<r.length;n++){var a=r[n];t.push(R(c,a))}I(c,t)}))}function R(o,c){return new Promise((function(u,d){var f="partNumber=".concat(c,"&uploadId=").concat(o);e.getFileToken(s,r,"PUT",f).then((function(e){console.log("signature ".concat(c," onSuccess"),e);var o=t&&t.slice((c-1)*n.stc_chunk_size,c*n.stc_chunk_size);console.log("fileChunk:size",o.size);var r=new XMLHttpRequest;r.open("PUT","".concat(a,"?").concat(f),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i),r.send(o),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e=r.getResponseHeader("etag");console.log("etag:".concat(c),e),v.set(c,e),u(e)}else g.includes(c)||g.push(c),d(c)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(c)||g.push(c),d(c)}))}))}}var _n={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Cn()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),An(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Cn()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,An(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Cn(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function An(e,t){for(var n in e)t(n,e[n])}var yn,Mn=0,Un=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:_n.form,genUId:Cn};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;An(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){en=n,tn=o,In=[];var a,i=e.getNaviInfoFromCache();if(1===(null==i?void 0:i.type)&&t.uploadDomain)In=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var s,c,u=JSON.parse(o.ossConfig),d="",f=[];u.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(d=e[n]),"s3"===n&&(s=e[n]),"stc"===n&&(c=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&In.push(e)})),u.length!==In.length&&(In=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",d],["s3",s],["stc",c]])}else In=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var l=o&&JSON.parse(o.ossConfig);Array.isArray(l)||(l=[]),a=l.find((function(e){return Object.keys(e).includes("stc")}))}if(a&&1===parseInt(a.p,10)&&n.size>=4194304)Nn(e,n,o,r);else{var g=o.data(n,o);vn[In[0][0]](g,o,r,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(yn=e,n)?yn=Mn+e/t*(t-Mn):Mn=yn;o.onProgress(yn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var Pn,Ln,wn={init:function(e){return new Un(e)},dataType:_n,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,a=new Image;a.src=r;var i=a.width,s=a.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var a=e.height,i=t.maxHeight||0;if(i>0&&a>i){var s=i/a;n=Math.min(n,s)}var c=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;n=Math.min(n,d)}return n}({width:i,height:s,size:e.total},t),u=r;c<1&&(u=function(e,t,n){o.width=t,o.height=n;var r=o.getContext("2d");return r.drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(a,i*c,s*c)),n(u)}},Upload:Un},Bn=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),a=new Image,i="string"==typeof e;a.onload=function(i){var s=function(e,t,n){var o,r,a,i=e<t,s=0,c=0;return(i?t/e:e/t)>n.scale?(i?(r=100,c=((a=t/(o=e/100))-n.maxHeight)/2):(a=100,s=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:a,x:-s,y:-c}):(i?(o=t/n.maxHeight,a=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,a=t/o),{w:r,h:a,x:-s,y:-c})}(a.width,a.height,t);o.width=s.w>t.maxWidth?t.maxWidth:s.w,o.height=s.h>t.maxHeight?t.maxHeight:s.h,r.drawImage(a,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},a.src=i?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},Dn=function(e,t){var n=e.file,o=e.compress;Bn(n,o,t)},bn=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=wn.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=wn.init(e);t(n)}},Gn=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||Dn;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},xn=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){Gn(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Vn=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};Gn(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),kn={initFile:function(e,t){bn(e,(function(e){var n=new xn(e);t(n)}))},initImage:function(e,t){bn(e,(function(n){var o,r,a,i,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.quality)||.5,scale:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.scale)||2.4},c=new Vn(n,s);t(c)}))},dataType:wn.dataType};function Hn(e,t,n,o,r,a,i){var s,c=this;void 0===r&&(r=y.FILE),s=r===y.IMAGE?y.IMAGE:y.FILE;var u=e.getNaviInfoFromCache();if(!Ln&&(Ln="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(Ln=d.qiniu)}catch(e){}var f=w({domain:Ln,getToken:function(t){e.getFileToken(s).then((function(e){t(e.token,e)})).catch((function(e){a.onFail(e)}))}},i);(s===y.IMAGE?kn.initImage:kn.initFile)(f,(function(t){t.upload(e,n,o,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=a.onProgress)||void 0===n||n.call(a,o)},onCompleted:function(e){return B(c,void 0,void 0,(function(){return D(this,(function(t){return 1===(null==u?void 0:u.type)?function(e,t,n,o,r,a){var i={type:o.type,name:r.rc_url.file_name,downloadUrl:e.uploadDomain+r.rc_url.path};if(t===y.AUDIO)return void Fn(o).then((function(e){a.onSuccess(w(w({},i),e))}));t===y.IMAGE&&(i.thumbnail=r.thumbnail);a.onSuccess(i)}(n,r,0,o,e,a):function(e,t,n,o,r){Jn(t,o.filename,o.name,o,o.uploadMethod).then((function(a){if(0===a.code){var i=a.data;i.type=n.type,i.name=o.name||o.filename,e!==y.AUDIO?(t===y.IMAGE&&(i.thumbnail=o.thumbnail),r.onSuccess(i)):Fn(n).then((function(e){r.onSuccess(w(w({},i),e))}))}else r.onFail(a)})).catch((function(e){r.onFail(e)}))}(r,s,o,e,a),[2]}))}))},onError:function(e){a.onFail(e)}})}))}function Fn(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?Zn(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(Zn).then((function(e){t(e)}))}))}function Zn(e){return Pn=Pn||new AudioContext,new Promise((function(t,n){Pn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function qn(e,t,n,o){return pe((function(a){return new Promise((function(i){a.getFileToken(e,t,n,o).then((function(e){i({code:r.SUCCESS,data:e})})).catch((function(e){i({code:e,msg:Ge[e]})}))}))}))}function Jn(e,t,n,o,a){return E("fileType",e,A,!0)&&E("filename",t,l.STRING)&&E("saveName",n,l.STRING)&&E("serverType",a,l.NUMBER)?pe((function(i){return new Promise((function(s){i.getFileUrl(e,t,n,o,a).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER})}function zn(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(s){return[2,pe((function(s,c){return B(o,void 0,void 0,(function(){var o,u,d,f,g,v,I,h,m,S,T,p,O;return D(this,(function(N){switch(N.label){case 0:return n=n||{},t instanceof Qt==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,be.ILLGAL_PARAMS]):E("conversation",e,l.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,E("conversation.targetId",u,l.STRING,!0)&&E("conversation.conversationType",o,l.NUMBER,!0)&&E("conversation.channelId",d,l.CHANNEL_ID)&&E("options.isStatusMessage",null==n?void 0:n.isStatusMessage,l.BOOLEAN)&&E("options.disableNotification",null==n?void 0:n.disableNotification,l.BOOLEAN)&&E("options.pushContent",null==n?void 0:n.pushContent,l.STRING)&&E("options.pushData",null==n?void 0:n.pushData,l.STRING)&&E("options.isMentioned",null==n?void 0:n.isMentioned,l.BOOLEAN)&&E("options.mentionedType",null==n?void 0:n.mentionedType,l.NUMBER)&&E("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,l.ARRAY)&&E("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,l.ARRAY)&&E("options.isVoipPush",null==n?void 0:n.isVoipPush,l.BOOLEAN)&&E("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,l.BOOLEAN)&&E("options.expansion",null==n?void 0:n.expansion,l.OBJECT)&&E("options.pushConfig",null==n?void 0:n.pushConfig,l.OBJECT)&&E("options.messageId",null==n?void 0:n.messageId,l.NUMBER)?(f="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(f)),g=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,a=e.pushContent,i=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,R=e.messageId,h=n.channelId;return w({isStatusMessage:o,disableNotification:r,pushContent:a,pushData:i,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,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||!1,isCounted:t.isCounted||!1,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:s.getCurrentUserId(),messageUId:"",messageDirection:U.SEND,receivedTime:0,isStatusMessage:n.isStatusMessage||!1,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:P.SENDING},o!==i.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(le(v))}catch(e){c.error(R.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(R.A_SEND_MSG_T,JSON.stringify({messageType: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 m=N.sent(),S=m.code,T=m.data,p=S===r.SUCCESS?"info":"warn",c[p](R.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:T?T.messageUId:"",messageId:T?T.messageId:""}),I),S===r.SUCCESS?(O=le(T),[2,{code:S,data:O}]):(c.warn(R.O,"send message fail ->".concat(S,":").concat(Ge[S],",").concat(f)),v.sentTime=(null==T?void 0:T.sentTime)||0,v.sentStatus=null==T?void 0:T.sentStatus,[2,{code:S,msg:Ge[S],data:le(v)}])}}))}))}))]}))}))}function Kn(e,t,n){return zn(e,new an(t),n)}function Yn(e,t){return function(n,o,a,i){if(!E("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var c=null==i?void 0:i.thumbnailConfig;if(!(E("sendOptions.maxHeight",null==c?void 0:c.maxHeight,l.NUMBER)&&E("sendOptions.maxWidth",null==c?void 0:c.maxWidth,l.NUMBER)&&E("sendOptions.quality",null==c?void 0:c.quality,l.NUMBER)&&E("sendOptions.scale",null==c?void 0:c.scale,l.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return pe((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Hn(c,0,d,o.file,e,{onProgress:null==a?void 0:a.onProgress,onSuccess:function(e){var s,c=(null===(s=null==a?void 0:a.onComplete)||void 0===s?void 0:s.call(a,{url:e.downloadUrl}))||t(e,o);e&&e.downloadUrl&&u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:r.SUCCESS}),l),zn(n,c,i).then(f)},onFail:function(e){u.warn(R.L_MEDIA_UPLOAD_R,JSON.stringify({code:r.UPLOAD_FILE_FAILED}),l),f({code:r.UPLOAD_FILE_FAILED,msg:e||r[r.UPLOAD_FILE_FAILED]})}},s)}))}))}}var jn=Yn(y.FILE,(function(e,t){return new cn({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})),Wn=Yn(y.IMAGE,(function(e,t){return new nn({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),Xn=Yn(y.AUDIO,(function(e,t){return new on({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),Qn=Yn(y.SIGHT,(function(e,t){return new rn({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 $n(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,l.NUMBER)&&E("options.count",null==t?void 0:t.count,l.NUMBER)&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,l.CONVERSATION,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n=a.createTraceId(),a.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 i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),a.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(a.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function eo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,l.NUMBER)&&E("options.count",null==t?void 0:t.count,l.NUMBER)&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,l.CONVERSATION,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.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 i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(a.warn(R.O,"get history message fail ->".concat(s,":").concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,t,n,o){return B(this,void 0,void 0,(function(){var a=this;return D(this,(function(s){return E("targetId",e,l.STRING,!0)&&E("messageUId",t,l.STRING,!0)&&E("timestamp",n,l.NUMBER,!0)&&E("channelId",o,l.CHANNEL_ID)?[2,pe((function(r){return B(a,void 0,void 0,(function(){var r,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:i.PRIVATE,channelId:o},a=new Qt("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,zn(r,a)];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 no(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return E("messageUId",t,l.STRING,!0)&&E("targetId",e,l.STRING,!0)&&E("channelId",n,l.CHANNEL_ID)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,r,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(R.O,"send read receipt message ->".concat(o)),r=new Qt("RC:RRReqMsg",{messageUId:t}),[4,zn({targetId:e,conversationType:i.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 oo(e,t,n){return B(this,void 0,void 0,(function(){return D(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function ro(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return E("targetId",e,l.STRING,!0)&&E("messageList",t,l.OBJECT,!0)&&E("channelId",n,l.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!E(e,t[e],l.ARRAY)}))?[2,pe((function(a,s){return B(o,void 0,void 0,(function(){var o,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return o={targetId:e,conversationType:i.GROUP,channelId:n},u=a.getNaviInfoFromCache(),0!==(d=(null==u?void 0:u.grpRRVer)||0)?[3,2]:(f=new Qt("RC:RRRspMsg",{receiptMessageDic:t}),[4,zn(o,f)]);case 1:return c=v.sent(),[3,4];case 2:return 1!==d?[3,4]:(l=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===l.indexOf(e)&&l.push(e)}))})),l.length?[4,a.sendReadReceiptMessage(e,l,n)]:(s.warn(R.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 3:c=v.sent(),v.label=4;case 4:return(g=c.code)===r.SUCCESS?[2,{code:g}]:(s.warn(R.O,"send read receipt message fail ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ao(e,t){return B(this,void 0,void 0,(function(){var n,o,a,i;return D(this,(function(s){switch(s.label){case 0:return E("conversation",e,l.CONVERSATION,!0)&&E("lastMessageSendTime",t,l.NUMBER,!0)?(n=new Qt("RC:SRSMsg",{lastMessageSendTime:t}),[4,zn(e,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),a=o.code,i=o.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))}function io(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversation",e,l.CONVERSATION,!0)&&E("options.messageUId",t.messageUId,l.STRING,!0)&&E("options.sentTime",t.sentTime,l.NUMBER,!0)&&E("options.disableNotification",null==t?void 0:t.disableNotification,l.BOOLEAN)&&E("options.pushConfig",null==t?void 0:t.pushConfig,l.OBJECT)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),a.debug(R.O,"recall message ->".concat(i)),[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:le(u)}]:c===r.SUCCESS?[2,{code:c}]:(a.warn(R.O,"recall message fail ->".concat(c,":").concat(Ge[c],",").concat(i)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function so(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversation",e,l.CONVERSATION,!0)&&E("options",t,(function(e){return g(e)&&e.length}),!0)&&!t.some((function(e){return!E("options.messageUId",e.messageUId,l.STRING,!0)||!E("options.sentTime",e.sentTime,l.NUMBER,!0)||!E("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(R.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"delete message fail ->".concat(i,":").concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function co(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversation",e,l.CONVERSATION,!0)&&E("timestamp",t,l.NUMBER,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(R.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"clear message ->".concat(i,":").concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function uo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("expansion",e,l.OBJECT,!0)&&E("message",t,l.OBJECT,!0)&&E("message.conversationType",t.conversationType,l.NUMBER,!0)&&E("message.targetId",t.targetId,l.STRING,!0)&&E("message.channelId",t.channelId,l.CHANNEL_ID)&&E("message.messageUId",t.messageUId,l.STRING,!0)&&E("message.expansion",t.expansion,l.OBJECT)&&E("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",messageUId:").concat(s),a.debug(R.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:n,targetId:i,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==r.SUCCESS?(a.warn(R.O,"update message expansion fail ->".concat(l,":").concat(Ge[l],",").concat(f)),[2,{code:l,msg:Ge[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("keys",e,l.ARRAY,!0)&&E("message",t,l.OBJECT,!0)&&E("message.conversationType",t.conversationType,l.NUMBER,!0)&&E("message.targetId",t.targetId,l.STRING,!0)&&E("message.channelId",t.channelId,l.CHANNEL_ID)&&E("message.messageUId",t.messageUId,l.STRING,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(i,",messageUId:").concat(s),a.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:i,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==r.SUCCESS?(a.warn(R.O,"remove message expansion fail ->".concat(f,":").concat(Ge[f],",").concat(d)),[2,{code:f,msg:Ge[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversation",e,l.CONVERSATION,!0)&&E("typingContentType",t,l.STRING,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d;return D(this,(function(f){switch(f.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},i=a.createTraceId(),a.info(R.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),i),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,i)];case 1:return s=f.sent(),c=s.code,u=s.data,d=c===r.SUCCESS?"info":"warn",a[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),i),c===r.SUCCESS?[2,{code:c,data:le(u)}]:[2,{code:c,msg:Ge[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return E("messageUId",t,l.STRING,!0)&&E("targetId",e,l.STRING,!0)&&E("channelId",n,l.CHANNEL_ID)?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(R.O,"get message reader ->".concat(o)),[4,a.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS?[2,{code:c,data:u}]:(i.warn(R.O,"get message reader fail ->".concat(c,":").concat(Ge[c],",").concat(o)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,t,n,o,r){return Te((function(a,i){return f("messageType",e,l.STRING,!0),f("isPersited",t,l.BOOLEAN,!0),f("isCounted",n,l.BOOLEAN,!0),f("isStatusMessage",r,l.BOOLEAN,!1),f("searchProps",o,l.ARRAY),i.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),a.registerMessageType(e,t,n,o,r),$t(e,t,n)}))}function Io(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?E("conversation",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),a=t.code,i=t.data,a===r.SUCCESS?(s=i&&le(i)||null,[2,{code:a,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function Ro(e,t,n){return void 0===n&&(n={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return ve("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),M()?E("conversation",e,l.CONVERSATION,!0)&&E("message",t,l.OBJECT,!0)&&E("options",n,l.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,l.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,l.STRING)&&E("content.senderUserId",t.senderUserId,l.STRING,!0)&&E("content.messageType",t.messageType,l.STRING,!0)&&E("content.content",t.content,l.OBJECT,!0)&&E("content.messageDirection",t.messageDirection,l.NUMBER,!0)&&E("content.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN)&&E("content.expansion",t.expansion,l.OBJECT)&&E("content.disableNotification",t.disableNotification,l.BOOLEAN)&&E("content.sentTime",t.sentTime,l.NUMBER)&&E("content.sentStatus",t.sentStatus,l.NUMBER)?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,E,m,S,T,p;return D(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,f=t.canIncludeExpansion,l=t.expansion,g=t.disableNotification,v=t.sentTime,I=t.sentStatus,i.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:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,m)];case 1:return S=O.sent(),T=S.code,p=S.data,T===r.SUCCESS?[2,{code:T,data:le(p)}]:(i.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:Ge[T]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function ho(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?E("messageId",e,(function(e){return s(e)||N(e)}),!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:le(i)}]:(o.warn(R.O,"getMessage ->code:".concat(a,",messageId:").concat(e)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function Eo(e){if(!M())return{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,a=e.channelId;return E("conversation",e,l.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,a),i=[];return t&&t.length&&t.forEach((function(e){return i.push(le(e))})),{code:r.SUCCESS,data:i}},he?t(he,me,Ee):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function mo(e,t,n,o){return B(this,void 0,void 0,(function(){var a=this;return D(this,(function(i){return ve("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),M()?E("conversation",e,l.CONVERSATION,!0)&&E("keyword",t,l.STRING,!0)&&E("timestamp",n,l.NUMBER)&&E("count",o,l.NUMBER)?[2,pe((function(i,s){return B(a,void 0,void 0,(function(){var a,c,u,d;return D(this,(function(f){switch(f.label){case 0:return 1,[4,i.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return a=f.sent(),c=a.code,u=a.data,c===r.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(le(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function So(e,t,n){return B(this,void 0,void 0,(function(){var o,a,i,s=this;return D(this,(function(c){return ve("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),M()?(o=e.conversationType,a=e.targetId,i=e.channelId,E("conversationType",o,l.NUMBER,!0)&&E("targetId",a,l.STRING,!0)&&E("timestamp",t,l.NUMBER,!0)&&E("cleanSpace",n,l.BOOLEAN)?[2,pe((function(c,u){return B(s,void 0,void 0,(function(){var s;return D(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,a,t,n,i)];case 1:return s=d.sent(),u.debug(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:a,channelId:i,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function To(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return ve("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),M()?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return t=e.conversationType,a=e.targetId,i=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(t)),[4,n.clearMessages(t,a,i)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function po(e,t,n,o){return B(this,void 0,void 0,(function(){var a=this;return D(this,(function(i){return ve("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),M()?[2,pe((function(i,s){return B(a,void 0,void 0,(function(){var a,c,u;return D(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,i.searchConversationByContent(e,n,o,t)];case 1:return a=d.sent(),c=a.code,u=a.data,c===r.SUCCESS?[2,{code:c,data:u}]:(s.warn(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function Oo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("timestamp",t,l.NUMBER)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c;return D(this,(function(u){switch(u.label){case 0:return n=e.conversationType,i=e.targetId,s=e.channelId,a.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(i,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,i,t,s)];case 1:return(c=u.sent())===r.SUCCESS?[2,{code:c}]:(a.warn(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(i)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function No(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return ve("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),M()?E("messageId",e,l.NUMBER,!0)&&E("receivedStatus",t,l.NUMBER,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n;return D(this,(function(i){switch(i.label){case 0:return a.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=i.sent())===r.SUCCESS?[2,{code:n}]:(a.warn(R.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function _o(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("tag.tagId",e.tagId,l.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,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.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=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("tagId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("tag.tagId",e.tagId,l.STRING,!0)&&E("tag.tagName",e.tagName,l.STRING,!0)&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.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=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a;return D(this,(function(i){switch(i.label){case 0:return[4,t.getTagList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(n.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Mo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("conversation",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:Ge[a]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("tagId",e,l.STRING,!0)&&E("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n;return D(this,(function(i){switch(i.label){case 0:return a.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(R.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Po(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("tagId",e,l.STRING,!0)&&E("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n;return D(this,(function(i){switch(i.label){case 0:return a.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversation",e,l.CONVERSATION,!0)&&E("tagIds",t,l.ARRAY,!0)&&!t.some((function(e){return!E("tagId",e,l.STRING,!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n;return D(this,(function(i){switch(i.label){case 0:return a.info(R.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(R.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("tagId",e,l.STRING,!0)&&E("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n;return D(this,(function(i){switch(i.label){case 0:return a.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bo(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return E("tagId",e,l.STRING,!0)&&E("count",t,l.NUMBER,!0)&&E("startTime",n,l.NUMBER,!0)?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o,s,c;return D(this,(function(u){switch(u.label){case 0:return i.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,a.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 w(w({},ge(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(i.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Do(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("tagId",e,l.STRING,!0)&&E("containMuted",t,l.BOOLEAN,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return a.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(R.O,"getUnreadCountByTag ->code:".concat(i,",tagId:").concat(e)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bo(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return E("tagId",e,l.STRING,!0)&&E("conversation",t,l.CONVERSATION,!0)&&E("status.isTop",n,l.BOOLEAN,!0)?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o;return D(this,(function(s){switch(s.label){case 0:return i.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,a.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===r.SUCCESS?[2,{code:o}]:(i.warn(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Ge[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}Yn(y.COMBINE_HTML,(function(e,t){return new sn({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var Go={COMET:"comet",WEBSOCKET:"websocket"},xo={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 Vo=Object.freeze({__proto__:null,getAllConversationList:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?E("channelId",e,l.CHANNEL_ID)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),L(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 a=t.code,i=t.data,a===r.SUCCESS&&i?(s=i.map((function(e){return ge(e)})),[2,{code:a,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(a," channelId: ").concat(e)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return M()?E("startTime",e,l.NUMBER,!0)&&E("count",t,l.NUMBER,!0)&&E("channelId",n,l.CHANNEL_ID)?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),i.info(R.O,"getConversationList -> ".concat(o)),L(n)?[4,a.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(c,e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===r.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(i.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return B(this,void 0,void 0,(function(){var a=this;return D(this,(function(i){return M()?E("keyword",t,l.STRING,!0)&&E("messageTypes",n,l.ARRAY,!0)&&E("channelId",o,l.CHANNEL_ID)&&!n.some((function(e){return!E("messageType",e,l.STRING,!0)}))?[2,pe((function(i,s){return B(a,void 0,void 0,(function(){var a,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return a="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),s.info(R.O,"searchConversationByContent -> ".concat(e)),L(o)?[4,i.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,i.searchConversationByContent(t,n,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===r.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(s.warn(R.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(a)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return B(this,void 0,void 0,(function(){var a=this;return D(this,(function(i){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("keyword",t,l.STRING,!0)&&E("startTime",n,l.NUMBER,!0)&&E("count",o,l.NUMBER,!0)?[2,pe((function(i,s){return B(a,void 0,void 0,(function(){var a,c,u,d,f,l,g,v,I,h;return D(this,(function(E){switch(E.label){case 0:return a="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(a)),c=e.targetId,u=e.conversationType,d=e.channelId,L(d)?[4,i.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return f=E.sent(),[3,4];case 2:return 0,[4,i.searchMessageByContent(u,c,t,n,o,0,d)];case 3:f=E.sent(),E.label=4;case 4:return l=f.code,g=f.data,l===r.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return le(e)})),[2,{code:l,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(l," ").concat(a)),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("option",t,l.OBJECT,!0)&&E("option.keyword",t.keyword,l.STRING,!0)&&E("option.startTime",t.startTime,l.NUMBER,!0)&&E("option.endTime",t.endTime,l.NUMBER,!0)&&E("option.offset",t.offset,l.NUMBER)&&E("option.limit",t.limit,l.NUMBER)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v,I;return D(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),a.info(R.O,"searchMessageInTimeRange -> ".concat(n)),i=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,f=t.offset,l=t.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(i,s,c,u,d,f,l)];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 le(e)}))}}]:(a.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:Ge[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("option",t,l.OBJECT,!0)&&E("option.count",t.count,l.NUMBER)&&E("option.timestamp",t.timestamp,l.NUMBER)&&E("option.order",t.order,(function(e){return[0,1].includes(e)}))&&E("option.messageTypes",t.messageTypes,l.ARRAY,!0)&&!t.messageTypes.some((function(e){return!E("option.messageType",e,l.STRING,!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v,I,h,E,m,S;return D(this,(function(T){switch(T.label){case 0:return n=t.count,i=t.timestamp,s=t.order,c=t.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),a.info(R.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,n||(n=20),i||(i=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,i,n,c,s,l)];case 1:return g=T.sent(),v=g.code,I=g.data,v===r.SUCCESS?(E=(h=I).list,m=h.hasMore,S=E.map((function(e){return le(e)})),[2,{code:v,data:{messages:S,hasMore:m,list:S}}]):(a.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("timestamp",t,l.NUMBER,!0)?[2,pe((function(o,r){return B(n,void 0,void 0,(function(){var n,a,i,s;return D(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)),a=e.conversationType,i=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(a,i,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("messageId",e,l.NUMBER,!0)&&E("receivedStatus",t,(function(e){return!L(a[e])}),!0)?[2,pe((function(o,r){return B(n,void 0,void 0,(function(){return D(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:Ge[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("messageId",e,l.NUMBER,!0)&&E("sentStatus",t,(function(e){return!L(P[e])}),!0)?[2,pe((function(o,r){return B(n,void 0,void 0,(function(){return D(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:Ge[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return M()?E("messageId",e,l.NUMBER,!0)&&E("content",t,l.OBJECT,!0)&&E("messageType",n,l.ONLY_STRING,!0)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){return D(this,(function(o){switch(o.label){case 0:return a.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:Ge[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?!E("messageIds",e,l.ARRAY,!0)||e.some((function(e){return!E("messageId",e,l.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(n,o){return B(t,void 0,void 0,(function(){return D(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:Ge[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return t=e.conversationType,a=e.targetId,i=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(t)),[4,n.clearMessages(t,a,i)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return B(this,void 0,void 0,(function(){var o,a,i,s=this;return D(this,(function(c){return M()?(o=e.conversationType,a=e.targetId,i=e.channelId,E("conversationType",o,l.NUMBER,!0)&&E("targetId",a,l.STRING,!0)&&E("timestamp",t,l.NUMBER,!0)&&E("cleanSpace",n,l.BOOLEAN)?[2,pe((function(e,c){return B(s,void 0,void 0,(function(){var s;return D(this,(function(u){switch(u.label){case 0:return[4,e.deleteMessagesByTimestamp(o,a,t,n,i)];case 1:return(s=u.sent())===r.SUCCESS?[2,{code:s}]:(c.warn(R.O,"deleteMessagesByTimestamp ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("message",t,l.OBJECT,!0)&&E("options",n,l.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,l.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,l.STRING)&&(t instanceof Qt||E("message.senderUserId",t.senderUserId,l.STRING,!0)&&E("message.messageType",t.messageType,l.STRING,!0)&&E("message.content",t.content,l.OBJECT,!0)&&E("message.messageDirection",t.messageDirection,l.NUMBER,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN)&&E("message.expansion",t.expansion,l.OBJECT)&&E("message.disableNotification",t.disableNotification,l.BOOLEAN)&&E("message.sentTime",t.sentTime,l.NUMBER)&&E("message.sentStatus",t.sentStatus,l.NUMBER))?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,E,m,S,T;return D(this,(function(p){switch(p.label){case 0:return o="",s=1,f=!1,g=t.messageType,v=t.content,t instanceof Qt||(o=t.senderUserId,s=t.messageDirection,f=t.canIncludeExpansion,l=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),i.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:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,E)];case 1:return m=p.sent(),S=m.code,T=m.data,S===r.SUCCESS?[2,{code:S,data:le(T)}]:(i.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:Ge[S]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return B(this,void 0,void 0,(function(){var a,s=this;return D(this,(function(c){if(!M())return[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}];if(!E("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!E("checkDuplicate",t,l.BOOLEAN))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];for(a in e)if(!(E("message",e[a],l.OBJECT,!0)&&E("message.conversationType",e[a].conversationType,(function(e){return[i.PRIVATE,i.DISCUSSION,i.GROUP,i.CUSTOMER_SERVICE,i.SYSTEM,i.APP_PUBLIC_SERVICE,i.PUBLIC_SERVICE].includes(e)}),!0)&&E("message.targetId",e[a].targetId,l.STRING,!0)&&E("message.senderUserId",e[a].senderUserId,l.STRING,!0)&&E("message.messageType",e[a].messageType,l.STRING,!0)&&E("message.content",e[a].content,l.OBJECT,!0)&&E("message.messageDirection",e[a].messageDirection,l.NUMBER,!0)&&E("message.canIncludeExpansion",e[a].canIncludeExpansion,l.BOOLEAN)&&E("message.expansion",e[a].expansion,l.OBJECT)&&E("message.disableNotification",e[a].disableNotification,l.BOOLEAN)&&E("message.sentTime",e[a].sentTime,l.NUMBER)&&E("message.sentStatus",e[a].sentStatus,l.NUMBER)&&E("options.isUnread",null===(n=e[a])||void 0===n?void 0:n.isUnread,l.BOOLEAN)&&E("options.searchContent",null===(o=e[a])||void 0===o?void 0:o.searchContent,l.STRING)))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER,msg:String(a)}];return[2,pe((function(n){return B(s,void 0,void 0,(function(){var o,a,i;return D(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),a=o.code,i=o.data,a===r.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:Ge[a]}]}}))}))}))]}))}))},getMessageCount:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?[2,pe((function(n){return B(t,void 0,void 0,(function(){var t,o,a,i,s,c;return D(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,[4,n.getMessageCount(t,o,a)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Ge[s]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?E("messageUId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(a,",messageUId:").concat(e)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("targetId",e,l.STRING,!0)&&E("messageUId",t,l.STRING,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(i,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?E("enableCheck",e,l.BOOLEAN)?[2,pe((function(n){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return M()?[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return n.info(R.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=a.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}}),ko=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};function Ho(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return!e||E("proxy.socksHost",e.socksHost,l.STRING,!0)&&E("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a;return D(this,(function(i){switch(i.label){case 0:return[4,t.getProxy()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:o,data:a}]:(n.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Zo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!e||E("proxy.socksHost",e.socksHost,l.STRING,!0)&&E("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return a.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),i=n.status,s=n.data,i===r.SUCCESS?[2,{code:i,msg:s}]:(a.warn(R.O,"testProxy ->code:".concat(i)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Qt as BaseMessage,sn as CombineMessage,Go as ConnectType,V as Events,cn as FileMessage,un as GIFMessage,on as HQVoiceMessage,nn as ImageMessage,fn as LocationMessage,ko as MentionedInfoBody,xo as MessageType,ln as ReferenceMessage,gn as RichContentMessage,rn as SightMessage,an as TextMessage,dn as VoiceMessage,we as __addSDKVersion,Uo as addConversationsToTag,Oe as addEventListener,_o as addTag,Yt as addToBlacklist,Kt as bindRTCRoomForChatroom,$e as clearAllMessagesUnreadStatus,Ae as clearEventListeners,co as clearHistoryMessages,To as clearMessages,Qe as clearMessagesUnreadStatus,Ke as clearTextMessageDraft,Oo as clearUnreadCountByTimestamp,ke as connect,So as deleteLocalMessagesByTimestamp,so as deleteMessages,Me as destroy,He as disconnect,Vo as electronExtension,Zt as forceRemoveChatRoomEntry,kt as forceSetChatRoomEntry,Jt as getAllChatRoomEntries,gt as getAllConversationState,Ct as getAllUltraGroupUnreadCount,At as getAllUltraGroupUnreadMentionedCount,lt as getAllUnreadMentionedCount,Wt as getBlacklist,Xt as getBlacklistStatus,It as getBlockUltraGroupList,st as getBlockedConversationList,qt as getChatRoomEntry,Gt as getChatRoomInfo,zt as getChatroomHistoryMessages,Ue as getConnectionStatus,Ze as getConversation,Fe as getConversationList,at as getConversationNotificationLevel,it as getConversationNotificationStatus,Bo as getConversationsFromTagByPage,Le as getCurrentUserId,Be as getDeviceId,qn as getFileToken,Jn as getFileUrl,Io as getFirstUnreadMessage,$n as getHistoryMessages,ho as getMessage,go as getMessageReader,Fo as getProxy,eo as getRemoteHistoryMessages,Pe as getServerTime,yo as getTags,Mo as getTagsFromConversation,Je as getTextMessageDraft,ut as getTopConversationList,Ye as getTotalUnreadCount,je as getTotalUnreadCountByLevels,We as getTotalUnreadMentionedCountByLevels,Ot as getUltraGroupDefaultNotificationLevel,Mt as getUltraGroupFirstUnreadMessageTimestamp,vt as getUltraGroupList,ht as getUltraGroupMessageListByMessageUId,_t as getUltraGroupUnreadCountByTargetId,pt as getUltraGroupUnreadMentionedCountByTargetId,yt as getUltraGroupUnreadMentionedMessages,dt as getUnreadConversationList,Xe as getUnreadCount,Do as getUnreadCountByTag,ft as getUnreadMentionedCount,Eo as getUnreadMentionedMessages,ye as init,Ro as insertMessage,De as installPlugin,Bt as joinChatRoom,Dt as joinExistChatRoom,Tt as modifyMessage,Ne as onceEventListener,bt as quitChatRoom,io as recallMessage,vo as registerMessageType,St as removeAllExpansionForUltraGroupMessage,Ft as removeChatRoomEntries,Ht as removeChatRoomEntry,qe as removeConversation,Po as removeConversationsFromTag,_e as removeEventListener,Ce as removeEventListeners,mt as removeExpansionForUltraGroupMessage,jt as removeFromBlacklist,fo as removeMessageExpansionForKey,Co as removeTag,wo as removeTagFromConversations,Lo as removeTagsFromConversation,ze as saveTextMessageDraft,po as searchConversationByContent,mo as searchMessages,jn as sendFileMessage,Xn as sendHQVoiceMessage,Wn as sendImageMessage,zn as sendMessage,to as sendReadReceiptMessage,no as sendReadReceiptRequest,oo as sendReadReceiptResponse,ro as sendReadReceiptResponseV2,Qn as sendSightMessage,ao as sendSyncReadStatusMessage,Kn as sendTextMessage,lo as sendTypingStatusMessage,Rt as sendUltraGroupTypingStatus,Vt as setChatRoomEntries,xt as setChatRoomEntry,ot as setConversationNotificationLevel,rt as setConversationNotificationStatus,ct as setConversationToTop,bo as setConversationToTopInTag,No as setMessageReceivedStatus,Ho as setProxy,Nt as setUltraGroupDefaultNotificationLevel,Zo as testProxy,Et as updateExpansionForUltraGroupMessage,uo as updateMessageExpansion,Ao as updateTag};
1
+ import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as r,ReceivedStatus as a,ConversationType as i,isNumber as s,EventEmitter as c,RCConnectionStatus as u,VersionManage as d,assert as f,AssertRules as l,isArray as g,isHttpUrl as v,APIContext as I,LogTagId as R,logger as h,validate as E,isValidConversationType as m,isValidNotificationLevel as S,NotificationLevel as T,isTypeInConversationList as p,UltraGroupChannelType as O,isString as N,getUUID as _,UploadMethod as C,isValidFileType as A,FileType as y,usingCppEngine as M,MessageDirection as U,SentStatus as P,isUndefined as L}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,RCConnectionStatus,ReceivedStatus,SentStatus,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var w=function(){return w=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},w.apply(this,arguments)};function B(e,t,n,o){return new(n||(n=Promise))((function(r,a){function i(e){try{c(o.next(e))}catch(e){a(e)}}function s(e){try{c(o.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}c((o=o.apply(e,t||[])).next())}))}function D(e,t){var n,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(i=0)),i;)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 i.label++,{value:s[1],done:!1};case 5:i.label++,o=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(6===s[0]&&i.label<r[1]){i.label=r[1],r=s;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(s);break}r[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],o=0}finally{n=r=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}var b=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},G=b(),x=function(){var e="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest;return"undefined"!=typeof XMLHttpRequest&&e?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")};var V,k={tag:"browser",httpReq:function(e){var r=e.method||t.GET,a=e.timeout||n,i=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var t=x(),n="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(r,u),i&&t.setRequestHeader)for(var o in i)t.setRequestHeader(o,i[o]);if(n){t.timeout=a,t.onload=function(){e({data:t.responseText,status:t.status||200})},t.onerror=function(){e({status:t.status})},t.ontimeout=function(){e({status:t.status})};var s="object"==typeof c?JSON.stringify(c):c;t.send(s)}else t.onreadystatechange=function(){4===t.readyState&&e({data:t.responseText,status:t.status})},t.onerror=function(){e({status:t.status})},setTimeout((function(){t.abort(),e({status:t.status})}),a),t.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:G,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.UNKONWN;return new Promise((function(e){e(r)}))}},H=b(),F=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:F("setStorageSync"),getItem:F("getStorageSync"),removeItem:F("removeStorageSync"),clear:F("clearStorageSync")},q={tag:"wechat",httpReq:function(e){var a=e.method||t.GET,i=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:a,header:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Z,sessionStorage:Z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:H,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},J=b(),z=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){}}},K={setItem:z("setStorageSync"),getItem:z("getStorageSync"),removeItem:z("removeStorageSync"),clear:z("clearStorageSync")},Y={tag:"alipay",httpReq:function(e){var a=e.method||t.GET,i=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:a,headers:s,timeout:i,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:K,sessionStorage:K,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:J,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},j=b(),W=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){}}},X={setItem:W("setStorageSync"),getItem:W("getStorageSync"),removeItem:W("removeStorageSync"),clear:W("clearStorageSync")},Q={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:j,localStorage:X,sessionStorage:X,httpReq:function(e){return new Promise((function(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{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)}})}))}},$=b(),ee=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){}}},te={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},ne={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:$,localStorage:te,sessionStorage:te,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{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return B(this,void 0,void 0,(function(){return D(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))]}))}))}},oe=b(),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)}}},ae={setItem:re("setStorageSync"),getItem:re("getStorageSync"),removeItem:re("removeStorageSync"),clear:re("clearStorageSync")},ie={tag:"jingdong",httpReq:function(e){var a=e.method||t.GET,i=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:a,headers:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ae,sessionStorage:ae,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:oe,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){jd.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},se=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)}}},ce={setItem:se("setStorageSync"),getItem:se("getStorageSync"),removeItem:se("removeStorageSync"),clear:se("clearStorageSync")},ue={tag:"uniapp",httpReq:function(e){var a=e.method||t.GET,i=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:a,header:s,timeout:i,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ce,sessionStorage:ce,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={url:e,protocols:t},o=uni.connectSocket(n);return{onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},de=function(e){return e&&e.request&&e.getSystemInfo},fe="undefined"!=typeof uni&&de(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ue;case"mp-jd":return ie;case"mp-baidu":return ne;case"mp-toutiao":return Q;case"mp-alipay":return Y;case"mp-weixin":return q;default:return k}}():"undefined"!=typeof jd&&de(jd)?ie:"undefined"!=typeof my&&de(my)?Y:"undefined"!=typeof tt&&de(tt)?Q:"undefined"!=typeof swan&&de(swan)?ne:"undefined"!=typeof wx&&de(wx)?q:k;function le(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,R=e.isOffLineMessage,h=e.canIncludeExpansion,E=e.expansion,m=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,y=e.channelType,M=e.sentStatus;m||(m=a.UNREAD);var U={messageType:o,channelId:n||"",content:r,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:S,isStatusMessage:p,canIncludeExpansion:h,expansion:E,receivedStatus:m,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return t!==i.ULTRA_GROUP&&(U.isOffLineMessage=R),t===i.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function ge(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,a=e.hasMentioned,i=e.mentionedInfo,s=e.lastUnreadTime,c=e.notificationStatus,u=e.notificationLevel,d=e.isTop,f=e.channelId,l=e.unreadMentionedCount,g=e.matchCount;return{conversationType:t,targetId:n,latestMessage:o&&le(o),unreadMessageCount:r,hasMentioned:a,mentionedInfo:a?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:s,notificationStatus:c,notificationLevel:u,isTop:d,channelId:f,unreadMentionedCount:l,matchCount:g}}function ve(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"}(V||(V={}));var Ie=new c,Re={connection:function(e,t){switch(e){case u.CONNECTED:Ie.emit(V.CONNECTED);break;case u.CONNECTING:Ie.emit(V.CONNECTING);break;case u.SUSPENDED:Ie.emit(V.SUSPEND,t);break;case u.DISCONNECTED:Ie.emit(V.DISCONNECT,t)}},batchMessage:function(e){Ie.emit(V.MESSAGES,{messages:e.map((function(e){return le(e)}))})},typingState:function(e){Ie.emit(V.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){Ie.emit(V.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){Ie.emit(V.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Ie.emit(V.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?le(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===i.ULTRA_GROUP?(n.versionTime=e.versionTime,{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));Ie.emit(V.CONVERSATION,{conversationList:t})},chatroomState:function(e){Ie.emit(V.CHATROOM,e)},expansion:function(e){Ie.emit(V.EXPANSION,e)},pullFinished:function(){Ie.emit(V.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Ie.emit(V.TAG)},conversationTagChanged:function(){Ie.emit(V.CONVERSATION_TAG)},messageBlocked:function(e){Ie.emit(V.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Ie.emit(V.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Ie.emit(V.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Ie.emit(V.ULTRA_GROUP_ENABLE,e.map((function(e){return ge(e)})))},operateStatus:function(e){Ie.emit(V.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return le(e)})))},ultraGroupMessageModified:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return le(e)})))},ultraGroupMessageRecalled:function(e){Ie.emit(V.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return le(e)})))},ultraGroupChannelChangeType:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Ie.emit(V.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Ie.emit(V.USER_GROUP_STATUS,e)}};d.add("imlib-next","5.7.3");var he=null,Ee=null,me=null;function Se(){return B(this,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return he?(me.info(R.A_DESTROY_O),[4,I.destroy()]):[2];case 1:return e.sent(),Ee=null,he=null,me=null,[2]}}))}))}function Te(e){if(!he)throw new Error("Not initialized yet!");return e(he,me,Ee)}function pe(e){return he?e(he,me,Ee):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function Oe(e,t,n){Ie.on(e,t,n)}function Ne(e,t,n){Ie.once(e,t,n)}function _e(e,t,n){Ie.off(e,t,n)}function Ce(e){Ie.removeAll(e)}function Ae(){Ie.clear()}function ye(e){!function(e){var t,n=e.appkey,o=e.navigators;he?me.warn(R.A_INIT_REPEAT_O):(f("options.appkey",e.appkey,l.STRING,!0),f("options.navigators",e.navigators,(function(e){return g(e)&&(0===e.length||e.every(v))})),Ee=e,he=I.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||fe,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(me=he.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),me.info(R.A_INIT_O,JSON.stringify({appkey:n,navigators:o,version:"5.7.3",commit:"220aab3f259b3e6bad2f34423d46543464baa635"})),he.assignWatcher(Re))}(e)}function Me(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return he?(Ae(),[2,Se()]):[2]}))}))}function Ue(){return Te((function(e){return e.getConnectionStatus()}))}function Pe(){return Te((function(e){return e.getServerTime()}))}function Le(){return Te((function(e){return e.getCurrentUserId()}))}function we(e,t){d.add(e,t)}function Be(){return Te((function(e){return e.getDeviceId()}))}function De(e,t){return Te((function(n){return n.install(e,t)}))}var be={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:r.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Ge={};for(var xe in be){var Ve=be[xe].code;Ge[Ve]=xe}function ke(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return E("token",e,l.STRING,!0)&&E("reconnectKickEnable",t,l.BOOLEAN)?(n=a.createTraceId(),a.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 i=c.sent(),s=i.code===r.SUCCESS?"info":"warn",a[s](R.A_CONNECT_R,JSON.stringify({code:i.code,userId:i.userId}),n),i.code===r.SUCCESS?[2,{code:i.code,data:{userId:i.userId}}]:[2,{code:i.code,msg:Ge[i.code]}]}}))}))}))]}))}))}function He(e){return h.info(R.A_DISCONNECT_O,{}),Te((function(t){return t.disconnect(e)}))}function Fe(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options.count",null==e?void 0:e.count,l.NUMBER)&&E("options.startTime",null==e?void 0:e.startTime,l.NUMBER)&&E("options.order",null==e?void 0:e.order,l.NUMBER)&&E("channelId",t,l.CHANNEL_ID)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(a.warn(R.O,"get conversation list fail ->".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ze(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),a=t.code,i=t.data,a!==r.SUCCESS?(o.warn(R.O,"getConversation ->code:".concat(a,", targetId:").concat(e.targetId)),[2,{code:a,msg:Ge[a]}]):[2,{code:a,data:i?ge(i):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qe(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(i){switch(i.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"destroy conversation ->".concat(a)),t!==r.SUCCESS?(o.warn(R.O,"destroy conversation fail ->".concat(t,":").concat(Ge[t],",").concat(a)),[2,{code:t,msg:Ge[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),a=t.code,i=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get draft ->".concat(s)),a===r.SUCCESS?[2,{code:a,data:i||""}]:(o.warn(R.O,"get draft fail ->".concat(a,":").concat(Ge[a],",").concat(s)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options",e,l.CONVERSATION,!0)&&E("draft",t,l.STRING,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(R.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())===r.SUCCESS?[2,{code:i}]:(a.warn(R.O,"set draft fail ->".concat(i,":").concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ke(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(i){switch(i.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(a=i.sent())===r.SUCCESS?[2,{code:a}]:(o.warn(R.O,"delete draft fail ->".concat(a,":").concat(Ge[a],",").concat(t)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ye(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("includeMuted",e,l.BOOLEAN,!1)&&E("conversationTypes",t,l.ARRAY,!1)&&!(null==t?void 0:t.some((function(e){return!E("conversationType",e,m)})))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return a.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(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(R.O,"getTotalUnreadCount fail ->".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!E("conversationTypes",e,l.ARRAY,!0)||!E("levels",t,l.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,m)}))||t.some((function(e){return!E("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(R.O,"getTotalUnreadCountByLevels fail ->".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]}))}))}function We(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!E("conversationTypes",e,l.ARRAY,!0)||!E("levels",t,l.ARRAY,!0)||e.some((function(e){return!E("conversationType",e,m)}))||t.some((function(e){return!E("level",e,S)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(R.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]}))}))}function Xe(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),a=t.code,i=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"get unreadCount ->".concat(s)),a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(R.O,"get unreadCount fail ->".concat(a,":").concat(Ge[a],",").concat(s)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qe(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a;return D(this,(function(i){switch(i.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(R.O,"clear unreadMsgNum ->".concat(a)),t!==r.SUCCESS?(o.warn(R.O,"clear unreadMsgNum fail ->".concat(t,":").concat(Ge[t],",").concat(a)),[2,{code:t,msg:Ge[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){return D(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}be.ROAMING_SERVICE_UNAVAILABLE.code;var et=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},nt=function(e,t,n,o){return void 0===o&&(o=""),B(void 0,void 0,void 0,(function(){var a,i;return D(this,(function(s){switch(s.label){case 0:return a=et(e,t,o),[4,n()];case 1:return(i=s.sent())!==r.SUCCESS?(e.warn(R.O,"".concat(o," fail -> ").concat(i," : ").concat(Ge[i]," , ").concat(a)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))};function ot(e,t){return B(this,void 0,void 0,(function(){return D(this,(function(n){return E("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)&&E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return nt(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rt(e,t){return B(this,void 0,void 0,(function(){return D(this,(function(n){return E("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return nt(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function at(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return t=et(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS?[2,{code:i,data:s}]:(o.warn(R.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(Ge[i]," , ").concat(t)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function it(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(R.O,"getConversationNotificationStatus ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function st(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getBlockConversationList()}))]}))}))}function ct(e,t){return void 0===t&&(t=!0),B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options",e,l.CONVERSATION,!0)&&E("isTop",t,l.BOOLEAN)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(R.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"set conversation status fail ->".concat(i,":").concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ut(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversationTypes",e,l.ARRAY)&&!(null==e?void 0:e.some((function(e){return!E("conversationType",e,m)})))&&E("channelId",t,l.CHANNEL_ID)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getTopConversationList(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ge(e)}))}]:(a.warn(R.A_GET_TOP_CONVERSATION_LIST_E,"".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return!E("conversationTypes",e,l.ARRAY)||(null==e?void 0:e.some((function(e){return!E("conversationType",e,p)})))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,o,a;return D(this,(function(i){switch(i.label){case 0:return[4,n.getUnreadConversationList(e)];case 1:return t=i.sent(),o=t.code,a=t.data,o===r.SUCCESS&&a?[2,{code:0,data:a.map((function(e){return ge(e)}))}]:[2,{code:o,msg:Ge[o]}]}}))}))}))]}))}))}function ft(e){return B(this,void 0,void 0,(function(){return D(this,(function(t){return E("options",e,l.CONVERSATION,!0)?[2,pe((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 B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e,t){return t.debug(R.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function gt(){return B(this,void 0,void 0,(function(){return D(this,(function(e){return[2,pe((function(e){return e.getAllConversationState()}))]}))}))}function vt(e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options.targetId",e.targetId,l.STRING,!1)&&E("options.channelType",e.channelType,(function(e){return void 0!==O[e]}),!1)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(o.warn(R.O,"get ultragroup ->".concat(a,":").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a;return D(this,(function(i){switch(i.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(n.warn(R.O,"get block ultragroup ->".concat(o,":").concat(Ge[o])),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Rt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(R.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(Ge[t])),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options",e,l.CONVERSATION,!0)&&E("msgs",t,l.ARRAY,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return n=e.targetId,i=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:i,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:if(d=I.sent(),f=d.code,l=d.data,f===r.SUCCESS){for(v in g={},l)g[v]=l[v]?le(l[v]):void 0;return[2,{code:r.SUCCESS,data:g}]}return a.warn(R.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(Ge[f])),[2,{code:f,msg:Ge[f]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Et(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("expansion",e,l.OBJECT,!0)&&E("message",t,l.OBJECT,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(s),a.debug(R.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(R.O,"update expansion for ultragroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("expansion",e,l.ARRAY,!0)&&E("message",t,l.OBJECT,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g;return D(this,(function(v){switch(v.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(s),a.debug(R.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(R.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(Ge[g])),[2,{code:g,msg:Ge[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function St(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("message",e,l.OBJECT,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return t=e.conversationType,a=e.targetId,i=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(a,",channelId:").concat(u,",messageUId:").concat(i),o.debug(R.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:a,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:i,removeAll:!0},[4,n.expandUltraMessage(f)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(R.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("content",e,l.OBJECT,!0)&&E("message",t,l.OBJECT,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v;return D(this,(function(I){switch(I.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,f=t.channelId,l="conversationType:".concat(n,",targetId:").concat(i,",channelId:").concat(f,",messageUId:").concat(s),a.debug(R.O,"update ultragroup message expansion ->".concat(l)),g={targetId:i,channelId:f,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=I.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(R.O,"modify ultraGroup message ->".concat(v,":").concat(Ge[v])),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("notificationLevels",t,l.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,S)})))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return a.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(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:r.SUCCESS,data:s}]:(a.warn(R.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(i,":").concat(Ge[i])),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ot(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("options.targetId",e.targetId,l.STRING,!0)&&E("options.channelId",e.channelId,l.CHANNEL_ID)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s,c;return D(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(R.O,"".concat(t," -> ").concat(a)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:(o.warn(R.O,"".concat(t," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Nt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,l.STRING,!0)&&E("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&E("notificationLevel",t,(function(e){return void 0!==T[e]}),!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),a.debug(R.O,"".concat(n," -> ").concat(i)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===r.SUCCESS?[2,{code:s}]:(a.warn(R.O,"".concat(n," fail -> ").concat(s," : ").concat(Ge[s]," , ").concat(i)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("notificationLevels",t,l.ARRAY)&&!(null==t?void 0:t.some((function(e){return!E("notificationLevel",e,S)})))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return i=d.sent(),s=i.code,c=i.data,u="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),a.debug(R.O,"".concat(n," -> ").concat(u)),s===r.SUCCESS?[2,{code:s,data:c}]:(a.warn(R.O,"".concat(n," fail -> ").concat(s,": ").concat(Ge[s],", ").concat(u)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a,i;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),a=o.code,i=o.data,n.debug(R.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(n.warn(R.O,"".concat(e," fail ->").concat(a,": ").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function At(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a,i;return D(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),a=o.code,i=o.data,n.debug(R.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(n.warn(R.O,"".concat(e," fail ->").concat(a,": ").concat(Ge[a])),[2,{code:a,msg:Ge[a]}])}}))}))}))]}))}))}function yt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return e.channelId=e.channelId||"",E("options.targetId",e.targetId,l.STRING,!0)&&E("options.channelId",e.channelId,l.CHANNEL_ID,!0)&&E("options.sentTime",e.sentTime,l.NUMBER,!0)&&E("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return t=e.targetId,a=e.channelId,i=e.sentTime,s=e.count,c={targetId:t,channelId:a,sentTime:i,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===r.SUCCESS?[2,{code:d,data:f}]:(o.warn(R.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Ge[d])),[2,{code:d,msg:Ge[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("conversation.targetId",e.targetId,l.STRING,!0)&&E("conversation.channelId",e.channelId,l.CHANNEL_ID,!0)?[2,pe((function(n){return B(t,void 0,void 0,(function(){var t,o,a,i,s,c;return D(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,a={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Ge[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Ut=function(e){return!!(E("options.key",e.key,l.STRING,!0)&&E("options.value",e.value,l.STRING,!0)&&E("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&E("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,l.STRING))},Pt=function(e){return e.entries.every((function(e){return E("entry.key",e.key,l.STRING,!0)&&E("entry.value",e.value,l.STRING,!0)}))&&E("options.isAutoDelete",e.isAutoDelete,l.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,l.STRING)&&E("options.isForce",e.isForce,l.BOOLEAN)},Lt=function(e){return E("options.key",e.key,l.STRING,!0)&&E("options.isSendNotification",e.isSendNotification,l.BOOLEAN)&&E("options.notificationExtra",e.notificationExtra,l.STRING)},wt=function(e){return e.entries.every((function(e){return E("key",e,l.STRING,!0)}))&&E("options.notificationExtra",e.notificationExtra,l.STRING)};function Bt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("options.count",t.count,l.NUMBER,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return n=a.createTraceId(),a.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 i=c.sent(),s=i===r.SUCCESS?"info":"warn",a[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),n),i!==r.SUCCESS?[2,{code:i,msg:Ge[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("options.count",t.count,l.NUMBER,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return n=a.createTraceId(),a.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 i=c.sent(),s=i===r.SUCCESS?"info":"warn",a[s](R.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),n),i!==r.SUCCESS?[2,{code:i,msg:Ge[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("targetId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(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 a=s.sent(),i=a===r.SUCCESS?"info":"warn",o[i](R.A_QUIT_CHATROOM_R,JSON.stringify({code:a}),t),a!==r.SUCCESS?[2,{code:a,msg:Ge[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("options.count",t.count,l.NUMBER)&&E("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(R.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(a.warn(R.O,"get chatroom info fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&Ut(t)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&Pt(t)?t.entries.length>10?[2,be.CHATROOM_KV_STORE_OUT_LIMIT]:[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(R.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return i=u.sent(),s=i.code,c=i.data,s!==r.SUCCESS?(a.warn(R.O,"set chatroom entry fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&Ut(t)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(R.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"force set chatroom entry fail ->code+:".concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ht(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&Lt(t)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.debug(R.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ft(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&wt(t)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),a.info(R.O,"remove chatroom entry->".concat(n)),(i=w({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,i)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==r.SUCCESS?(a.warn(R.O,"remove chatroom entry fail ->code+:".concat(Ge[c],",").concat(n)),[2,{code:c,msg:Ge[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&Lt(t)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),a.info(R.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"force remove chatroom entry fail ->code+:".concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("key",t,(function(e){return N(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c;return D(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),a.debug(R.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(a.warn(R.O,"get chatroom entry fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("targetId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(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 a=c.sent(),i=a.code,s=a.data,i===r.SUCCESS&&s?[2,{code:i,data:s}]:(o.warn(R.O,"get all chatroom entries fail ->code+:".concat(Ge[i],",").concat(t)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zt(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("targetId",e,l.STRING,!0)&&E("options.timestamp",t.timestamp,l.NUMBER)&&E("options.count",t.count,l.NUMBER)&&E("options.order",t.order,(function(e){return 0===e||1===e}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),a.debug(R.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(a.warn(R.O,"get chatroom history message fail ->code+:".concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("option.chatRoomId",e.chatRoomId,l.STRING,!0)&&E("option.rtcRoomId",e.rtcRoomId,l.STRING,!0)?[2,pe((function(n){return B(t,void 0,void 0,(function(){var t;return D(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:Ge[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("userId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){return D(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 jt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("userId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){return D(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 Wt(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a;return D(this,(function(i){switch(i.label){case 0:return n.info(R.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS&&a?[2,{code:o,data:a}]:(n.warn(R.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Xt(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("userId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(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(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:0===i}]:(o.warn(R.O,"getBlacklistStatus fail -> code: ".concat(a,", userId: ").concat(e)),[2,{code:a}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Qt=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 $t(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Qt(e,o,t,n)}}var en,tn,nn=$t("RC:ImgMsg"),on=$t("RC:HQVCMsg"),rn=$t("RC:SightMsg"),an=$t("RC:TxtMsg"),sn=$t("RC:CombineMsg"),cn=$t("RC:FileMsg"),un=$t("RC:GIFMsg"),dn=$t("RC:VcMsg"),fn=$t("RC:LBSMsg"),ln=$t("RC:ReferenceMsg"),gn=$t("RC:ImgTextMsg"),vn={qiniu:function(e,t,n,o){Te((function(r){var a=r.getNaviInfoFromCache();if(1===(null==a?void 0:a.type)&&t.chunk_size&&o.size>t.chunk_size){var i=_();i+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=i,On(o,t,n)}else pn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>Rn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=t||{};t=t||tn;var a=new XMLHttpRequest,i=mn();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var s=i+In[0][1]+r.bosUploadPath;In.shift();var c=r.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});a.onreadystatechange=function(){if(4===a.readyState)if(JSON.parse(a.responseText||"{}").filename=t.uniqueValue,200===a.status){n.onCompleted(u,!0)}else In.length?vn[In[0][0]](e,t,n,o):n.onError("upload fail")},a.open(t.method,s,!0),a.setRequestHeader("authorization",c.bosToken),a.setRequestHeader("x-bce-date",c.bosDate),a.send(o)},aliyun:function(e,t,n,o){if(o.size>Rn.BOS_CHUNCK_SIZE)throw new Error("the file size is over 5GB!");var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token"));var a=In[0][1];In.shift(),e=e||en,t=(t=t||{})||tn;var i=new XMLHttpRequest,s=mn(),c="".concat(s+t.ossBucketName,".").concat(a);i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var e=JSON.parse(i.responseText||"{}");e.name=t.uniqueValue,e.filename=t.uploadFileName,e.uploadMethod=C?C.ALI:"",200===i.status?n.onCompleted(e):In.length?vn[In[0][0]](r,t,n,o):n.onError("upload fail")}},i.open(t.method,c,!0),console.log("ali:url",c);var u=t.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",t.uploadFileName),e.delete("file"),e.append("file",o),i.send(e)},s3:function(e,t,n,o){var r=new FormData,a=new XMLHttpRequest,i=mn(),s=t.contentDisposition,c=In[0][1],u="".concat(i+t.s3BucketName,".").concat(c);console.log("uploadS3:url",u),In.shift(),a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var r=JSON.parse(a.responseText||"{}");if(r.name=t.uniqueValue,r.filename=t.uploadFileName,r.uploadMethod=C.AWS,200===a.status||204===a.status)n.onCompleted(r);else if(In.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),vn[In[0][0]](i,t,n,o)}else n.onError("upload fail")}},a.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;s?r.set("Content-Disposition","".concat(s,";")):r.set("Content-Disposition","text/html"===f?"inline;":"attachment;");r.set("Content-Type",f),r.set("x-amz-credential",d.s3Credential),r.set("x-amz-algorithm",d.s3Algorithm),r.set("x-amz-date",d.s3Date),r.set("policy",d.s3Policy),r.set("x-amz-signature",d.s3Signature),r.set("key",t.uploadFileName),r.set("file",o),a.send(r)},stc:function(e,t,n,o){var r=new XMLHttpRequest,a=t.contentDisposition,i=In[0][1],s="https://".concat(i,"/").concat(t.stcBucketName,"/").concat(t.uploadFileName);In.shift(),r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");if(a.name=t.uniqueValue,a.filename=t.uploadFileName,a.uploadMethod=C?C.STC:"",200===r.status||204===r.status)n.onCompleted(a);else if(In.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),vn[In[0][0]](i,t,n,o)}else n.onError("upload fail")}},r.open("PUT",s,!0);var c=t?t.stcHeader:{};r.setRequestHeader("Content-Type",o.type),a?r.setRequestHeader("Content-Disposition","".concat(a,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");r.setRequestHeader("Authorization",c.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",c.stcContentSha256),r.setRequestHeader("x-amz-date",c.stcDate),r.send(o)}},In=[],Rn={BOS_CHUNCK_SIZE:5368709120},hn="http://",En="https://";function mn(){var e=En;return"http:"!==location.protocol&&"file:"!==location.protocol||(e=hn),e}var Sn,Tn=(Sn="RC-upload-",{get:function(e){e=Sn+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=Sn+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=Sn+e,localStorage.removeItem(e)}});function pn(e,t,n,o){var r=En+t.uploadHost.qiniu,a=(/http/.test(In[0][1])?"":mn())+In[0][1]||r;t.isChunk||In.shift();var i=new XMLHttpRequest;i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var r=JSON.parse(i.responseText||"{}");r.filename=t.uniqueValue,r.uploadMethod=C?C.QINIU:"",200===i.status||204===i.status?n.onCompleted(r):In.length?vn[In[0][0]](e,t,n,o):n.onError("upload fail")}},i.open(t.method,a,!0),n.onOpen(i),t.stream&&i.setRequestHeader("authorization","UpToken ".concat(t.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(t.headers,(function(e,t){i.setRequestHeader(e,t)})),i.send(e)}function On(e,t,n,o){var r=0,a=o||_(),i=Tn.get(a);i&&(e.uniqueName=i.sessionId,r=i.offset);var s=Math.min(t.chunk_size,e.size-r),c=e.slice(r,r+s),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(r,"-").concat(r+s);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,c.name=e.name,c=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var a=t.multi_parmas[r];o.append(r,a)}return o}(c,t,e.uniqueName),pn(c,t,{onCompleted:function(o){r+=s;var i=e.uniqueName;Tn.set(a,{offset:r,sessionId:i}),r<e.size?On(e,t,n,a):(r=0,Tn.remove(a),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var a=e+r;n.onProgress(a,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function Nn(e,t,n,o){var r,a,i=t&&t.type||"text/plain",s=i.indexOf("image")>-1?1:4,c=n.contentDisposition,u=Math.ceil(t.size/n.stc_chunk_size),d=n&&JSON.parse(n.ossConfig?n.ossConfig:"");Array.isArray(d)||(d=[]);var f=d.find((function(e){return Object.keys(e).includes("stc")})),l="uploads";e.getFileToken(s,r,"POST",l).then((function(e){r=e.fileName,a="https://".concat(f.stc,"/").concat(n.stcBucketName,"/").concat(r),console.log("uploadStcMultipart:url",a);var s=new XMLHttpRequest;s.open("POST","".concat(a,"?").concat(l),!0),c?s.setRequestHeader("Content-Disposition","".concat(c,";")):s.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),s.setRequestHeader("Authorization",e&&e.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),s.setRequestHeader("x-amz-date",e&&e.stcDate),s.setRequestHeader("Content-Type",i),s.send(),s.onreadystatechange=function(){if(4===s.readyState){var e=s.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===s.status||204===s.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(R(e,n));I(e,t)}(Array.isArray(e)&&e[1]):o.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));var g=[],v=new Map;function I(c,d){d&&Array.isArray(d)&&0!==d.length&&Promise.all(d).then((function(){var d="uploadId=".concat(c);if(v.size===u)e.getFileToken(s,r,"POST",d).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",c);var r=new XMLHttpRequest;r.open("POST","".concat(a,"?").concat(d),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i);var s="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(v.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",u),u.forEach((function(e){s+="<Part><ETag>".concat(v.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),s+="</CompleteMultipartUpload>",r.send(s),console.log("xml",s),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e={name:t.name,filename:n.uploadFileName,uploadMethod:C.STC};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var f=[],l=0,h=g;l<h.length;l++){var E=h[l];f.push(R(c,E))}I(c,f)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,r=g;n<r.length;n++){var a=r[n];t.push(R(c,a))}I(c,t)}))}function R(o,c){return new Promise((function(u,d){var f="partNumber=".concat(c,"&uploadId=").concat(o);e.getFileToken(s,r,"PUT",f).then((function(e){console.log("signature ".concat(c," onSuccess"),e);var o=t&&t.slice((c-1)*n.stc_chunk_size,c*n.stc_chunk_size);console.log("fileChunk:size",o.size);var r=new XMLHttpRequest;r.open("PUT","".concat(a,"?").concat(f),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i),r.send(o),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e=r.getResponseHeader("etag");console.log("etag:".concat(c),e),v.set(c,e),u(e)}else g.includes(c)||g.push(c),d(c)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(c)||g.push(c),d(c)}))}))}}var _n={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Cn()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),An(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=Cn()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,An(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function Cn(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function An(e,t){for(var n in e)t(n,e[n])}var yn,Mn=0,Un=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:_n.form,genUId:Cn};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;An(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){en=n,tn=o,In=[];var a,i=e.getNaviInfoFromCache();if(1===(null==i?void 0:i.type)&&t.uploadDomain)In=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var s,c,u=JSON.parse(o.ossConfig),d="",f=[];u.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(d=e[n]),"s3"===n&&(s=e[n]),"stc"===n&&(c=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&In.push(e)})),u.length!==In.length&&(In=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",d],["s3",s],["stc",c]])}else In=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var l=o&&JSON.parse(o.ossConfig);Array.isArray(l)||(l=[]),a=l.find((function(e){return Object.keys(e).includes("stc")}))}if(a&&1===parseInt(a.p,10)&&n.size>=4194304)Nn(e,n,o,r);else{var g=o.data(n,o);vn[In[0][0]](g,o,r,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(yn=e,n)?yn=Mn+e/t*(t-Mn):Mn=yn;o.onProgress(yn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var Pn,Ln,wn={init:function(e){return new Un(e)},dataType:_n,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,a=new Image;a.src=r;var i=a.width,s=a.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var a=e.height,i=t.maxHeight||0;if(i>0&&a>i){var s=i/a;n=Math.min(n,s)}var c=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;n=Math.min(n,d)}return n}({width:i,height:s,size:e.total},t),u=r;c<1&&(u=function(e,t,n){o.width=t,o.height=n;var r=o.getContext("2d");return r.drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(a,i*c,s*c)),n(u)}},Upload:Un},Bn=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),a=new Image,i="string"==typeof e;a.onload=function(i){var s=function(e,t,n){var o,r,a,i=e<t,s=0,c=0;return(i?t/e:e/t)>n.scale?(i?(r=100,c=((a=t/(o=e/100))-n.maxHeight)/2):(a=100,s=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:a,x:-s,y:-c}):(i?(o=t/n.maxHeight,a=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,a=t/o),{w:r,h:a,x:-s,y:-c})}(a.width,a.height,t);o.width=s.w>t.maxWidth?t.maxWidth:s.w,o.height=s.h>t.maxHeight?t.maxHeight:s.h,r.drawImage(a,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},a.src=i?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},Dn=function(e,t){var n=e.file,o=e.compress;Bn(n,o,t)},bn=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=wn.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=wn.init(e);t(n)}},Gn=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||Dn;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},xn=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){Gn(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Vn=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};Gn(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),kn={initFile:function(e,t){bn(e,(function(e){var n=new xn(e);t(n)}))},initImage:function(e,t){bn(e,(function(n){var o,r,a,i,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.quality)||.5,scale:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.scale)||2.4},c=new Vn(n,s);t(c)}))},dataType:wn.dataType};function Hn(e,t,n,o,r,a,i){var s=this;void 0===r&&(r=y.FILE);var c=4;r===y.IMAGE&&(c=y.IMAGE);var u=e.getNaviInfoFromCache();if(!Ln&&(Ln="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(Ln=d.qiniu)}catch(e){}var f=w({domain:Ln,getToken:function(t){e.getFileToken(c).then((function(e){t(e.token,e)})).catch((function(e){a.onFail(e)}))}},i),l=kn.initFile;c===y.IMAGE&&(l=kn.initImage),l(f,(function(t){t.upload(e,n,o,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=a.onProgress)||void 0===n||n.call(a,o)},onCompleted:function(e){return B(s,void 0,void 0,(function(){return D(this,(function(t){return 1===(null==u?void 0:u.type)?(function(e,t,n,o,r,a){var i={type:o.type,name:r.rc_url.file_name,downloadUrl:e.uploadDomain+r.rc_url.path};if(t===y.AUDIO)return void Fn(o).then((function(e){a.onSuccess(w(w({},i),e))}));t===y.IMAGE&&(i.thumbnail=r.thumbnail);a.onSuccess(i)}(n,r,0,o,e,a),[2]):(function(e,t,n,o,r){Jn(t,o.filename,o.name,o,o.uploadMethod).then((function(a){if(0===a.code){var i=a.data;i.type=n.type,i.name=o.name||o.filename,e!==y.AUDIO?(t===y.IMAGE&&(i.thumbnail=o.thumbnail),r.onSuccess(i)):Fn(n).then((function(e){r.onSuccess(w(w({},i),e))}))}else r.onFail(a)})).catch((function(e){r.onFail(e)}))}(r,c,o,e,a),[2])}))}))},onError:function(e){a.onFail(e)}})}))}function Fn(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?Zn(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(Zn).then((function(e){t(e)}))}))}function Zn(e){return Pn=Pn||new AudioContext,new Promise((function(t,n){Pn.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function qn(e,t,n,o){return pe((function(a){return new Promise((function(i){a.getFileToken(e,t,n,o).then((function(e){i({code:r.SUCCESS,data:e})})).catch((function(e){i({code:e,msg:Ge[e]})}))}))}))}function Jn(e,t,n,o,a){return E("fileType",e,A,!0)&&E("filename",t,l.STRING)&&E("saveName",n,l.STRING)&&E("serverType",a,l.NUMBER)?pe((function(i){return new Promise((function(s){i.getFileUrl(e,t,n,o,a).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER})}function zn(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(s){return[2,pe((function(s,c){return B(o,void 0,void 0,(function(){var o,u,d,f,g,v,I,h,m,S,T,p;return D(this,(function(O){switch(O.label){case 0:return n=n||{},t instanceof Qt==!1?(c.warn(R.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,be.ILLGAL_PARAMS]):E("conversation",e,l.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,E("conversation.targetId",u,l.STRING,!0)&&E("conversation.conversationType",o,l.NUMBER,!0)&&E("conversation.channelId",d,l.CHANNEL_ID)&&E("options.isStatusMessage",null==n?void 0:n.isStatusMessage,l.BOOLEAN)&&E("options.disableNotification",null==n?void 0:n.disableNotification,l.BOOLEAN)&&E("options.pushContent",null==n?void 0:n.pushContent,l.STRING)&&E("options.pushData",null==n?void 0:n.pushData,l.STRING)&&E("options.isMentioned",null==n?void 0:n.isMentioned,l.BOOLEAN)&&E("options.mentionedType",null==n?void 0:n.mentionedType,l.NUMBER)&&E("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,l.ARRAY)&&E("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,l.ARRAY)&&E("options.isVoipPush",null==n?void 0:n.isVoipPush,l.BOOLEAN)&&E("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,l.BOOLEAN)&&E("options.expansion",null==n?void 0:n.expansion,l.OBJECT)&&E("options.pushConfig",null==n?void 0:n.pushConfig,l.OBJECT)&&E("options.messageId",null==n?void 0:n.messageId,l.NUMBER)?(f="conversationType:".concat(o,",targetId:").concat(u),c.debug(R.O,"send message ->".concat(f)),g=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,a=e.pushContent,i=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,R=e.messageId,h=n.channelId;return w({isStatusMessage:o,disableNotification:r,pushContent:a,pushData:i,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,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:U.SEND,receivedTime:0,isStatusMessage:!!n.isStatusMessage,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig,sentStatus:P.SENDING},o!==i.ULTRA_GROUP&&(v.isOffLineMessage=!1),I=c.createTraceId(),h=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(le(v))}catch(e){c.error(R.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},c.info(R.A_SEND_MSG_T,JSON.stringify({messageType: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 m=O.sent(),S=m.code,T=m.data,S===r.SUCCESS?(c.info(R.A_SEND_MSG_R,JSON.stringify({code:S,messageUId:T.messageUId,messageId:T.messageId}),I),p=le(T),[2,{code:S,data:p}]):(c.warn(R.A_SEND_MSG_R,"send message fail ->".concat(S,":").concat(Ge[S],",").concat(f)),v.sentTime=(null==T?void 0:T.sentTime)||0,v.sentStatus=null==T?void 0:T.sentStatus,[2,{code:S,msg:Ge[S],data:le(v)}])}}))}))}))]}))}))}function Kn(e,t,n){return zn(e,new an(t),n)}function Yn(e,t){return function(n,o,a,i){if(!E("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var c=null==i?void 0:i.thumbnailConfig;if(!(E("sendOptions.maxHeight",null==c?void 0:c.maxHeight,l.NUMBER)&&E("sendOptions.maxWidth",null==c?void 0:c.maxWidth,l.NUMBER)&&E("sendOptions.quality",null==c?void 0:c.quality,l.NUMBER)&&E("sendOptions.scale",null==c?void 0:c.scale,l.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return pe((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(R.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Hn(c,0,d,o.file,e,{onProgress:null==a?void 0:a.onProgress,onSuccess:function(e){var s,c=(null===(s=null==a?void 0:a.onComplete)||void 0===s?void 0:s.call(a,{url:e.downloadUrl}))||t(e,o);e&&e.downloadUrl&&u.info(R.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:r.SUCCESS}),l),zn(n,c,i).then(f)},onFail:function(e){u.warn(R.L_MEDIA_UPLOAD_R,JSON.stringify({code:r.UPLOAD_FILE_FAILED}),l),f({code:r.UPLOAD_FILE_FAILED,msg:e||r[r.UPLOAD_FILE_FAILED]})}},s)}))}))}}var jn=Yn(y.FILE,(function(e,t){return new cn({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})),Wn=Yn(y.IMAGE,(function(e,t){return new nn({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),Xn=Yn(y.AUDIO,(function(e,t){return new on({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),Qn=Yn(y.SIGHT,(function(e,t){return new rn({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 $n(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,l.NUMBER)&&E("options.count",null==t?void 0:t.count,l.NUMBER)&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,l.CONVERSATION,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n=a.createTraceId(),a.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 i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),a.info(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(a.warn(R.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function eo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("options.timestamp",null==t?void 0:t.timestamp,l.NUMBER)&&E("options.count",null==t?void 0:t.count,l.NUMBER)&&E("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&E("conversation",e,l.CONVERSATION,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.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 i=d.sent(),s=i.code,c=i.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return le(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(a.warn(R.O,"get history message fail ->".concat(s,":").concat(Ge[s],",").concat(n)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,t,n,o){return B(this,void 0,void 0,(function(){var a=this;return D(this,(function(s){return E("targetId",e,l.STRING,!0)&&E("messageUId",t,l.STRING,!0)&&E("timestamp",n,l.NUMBER,!0)&&E("channelId",o,l.CHANNEL_ID)?[2,pe((function(r){return B(a,void 0,void 0,(function(){var r,a,s,c,u;return D(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:i.PRIVATE,channelId:o},a=new Qt("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,zn(r,a)];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 no(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return E("messageUId",t,l.STRING,!0)&&E("targetId",e,l.STRING,!0)&&E("channelId",n,l.CHANNEL_ID)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){var o,r,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(R.O,"send read receipt message ->".concat(o)),r=new Qt("RC:RRReqMsg",{messageUId:t}),[4,zn({targetId:e,conversationType:i.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 oo(e,t,n){return B(this,void 0,void 0,(function(){return D(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function ro(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return E("targetId",e,l.STRING,!0)&&E("messageList",t,l.OBJECT,!0)&&E("channelId",n,l.CHANNEL_ID)&&!Object.keys(t).some((function(e){return!E(e,t[e],l.ARRAY)}))?[2,pe((function(a,s){return B(o,void 0,void 0,(function(){var o,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return o={targetId:e,conversationType:i.GROUP,channelId:n},u=a.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,a.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 f=new Qt("RC:RRRspMsg",{receiptMessageDic:t}),[4,zn(o,f)];case 3:c=g.sent(),g.label=4;case 4:return(l=c.code)===r.SUCCESS?[2,{code:l}]:(s.warn(R.O,"send read receipt message fail ->".concat(l,":").concat(Ge[l])),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ao(e,t){return B(this,void 0,void 0,(function(){var n,o,a,i;return D(this,(function(s){switch(s.label){case 0:return E("conversation",e,l.CONVERSATION,!0)&&E("lastMessageSendTime",t,l.NUMBER,!0)?(n=new Qt("RC:SRSMsg",{lastMessageSendTime:t}),[4,zn(e,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),a=o.code,i=o.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))}function io(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversation",e,l.CONVERSATION,!0)&&E("options.messageUId",t.messageUId,l.STRING,!0)&&E("options.sentTime",t.sentTime,l.NUMBER,!0)&&E("options.disableNotification",null==t?void 0:t.disableNotification,l.BOOLEAN)&&E("options.pushConfig",null==t?void 0:t.pushConfig,l.OBJECT)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u;return D(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),a.debug(R.O,"recall message ->".concat(i)),[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:le(u)}]:c===r.SUCCESS?[2,{code:c}]:(a.warn(R.O,"recall message fail ->".concat(c,":").concat(Ge[c],",").concat(i)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function so(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversation",e,l.CONVERSATION,!0)&&E("options",t,(function(e){return g(e)&&e.length}),!0)&&!t.some((function(e){return!E("options.messageUId",e.messageUId,l.STRING,!0)||!E("options.sentTime",e.sentTime,l.NUMBER,!0)||!E("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(R.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"delete message fail ->".concat(i,":").concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function co(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversation",e,l.CONVERSATION,!0)&&E("timestamp",t,l.NUMBER,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i;return D(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(R.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(i=s.sent())!==r.SUCCESS?(a.warn(R.O,"clear message ->".concat(i,":").concat(Ge[i],",").concat(n)),[2,{code:i,msg:Ge[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function uo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("expansion",e,l.OBJECT,!0)&&E("message",t,l.OBJECT,!0)&&E("message.conversationType",t.conversationType,l.NUMBER,!0)&&E("message.targetId",t.targetId,l.STRING,!0)&&E("message.channelId",t.channelId,l.CHANNEL_ID)&&E("message.messageUId",t.messageUId,l.STRING,!0)&&E("message.expansion",t.expansion,l.OBJECT)&&E("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l;return D(this,(function(g){switch(g.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(i,",messageUId:").concat(s),a.debug(R.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:n,targetId:i,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==r.SUCCESS?(a.warn(R.O,"update message expansion fail ->".concat(l,":").concat(Ge[l],",").concat(f)),[2,{code:l,msg:Ge[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function fo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("keys",e,l.ARRAY,!0)&&E("message",t,l.OBJECT,!0)&&E("message.conversationType",t.conversationType,l.NUMBER,!0)&&E("message.targetId",t.targetId,l.STRING,!0)&&E("message.channelId",t.channelId,l.CHANNEL_ID)&&E("message.messageUId",t.messageUId,l.STRING,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return n=t.conversationType,i=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(i,",messageUId:").concat(s),a.debug(R.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:i,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==r.SUCCESS?(a.warn(R.O,"remove message expansion fail ->".concat(f,":").concat(Ge[f],",").concat(d)),[2,{code:f,msg:Ge[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversation",e,l.CONVERSATION,!0)&&E("typingContentType",t,l.STRING,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d;return D(this,(function(f){switch(f.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},i=a.createTraceId(),a.info(R.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),i),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,i)];case 1:return s=f.sent(),c=s.code,u=s.data,d=c===r.SUCCESS?"info":"warn",a[d](R.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),i),c===r.SUCCESS?[2,{code:c,data:le(u)}]:[2,{code:c,msg:Ge[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function go(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return E("messageUId",t,l.STRING,!0)&&E("targetId",e,l.STRING,!0)&&E("channelId",n,l.CHANNEL_ID)?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o,s,c,u;return D(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(R.O,"get message reader ->".concat(o)),[4,a.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS?[2,{code:c,data:u}]:(i.warn(R.O,"get message reader fail ->".concat(c,":").concat(Ge[c],",").concat(o)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vo(e,t,n,o,r){return Te((function(a,i){return f("messageType",e,l.STRING,!0),f("isPersited",t,l.BOOLEAN,!0),f("isCounted",n,l.BOOLEAN,!0),f("isStatusMessage",r,l.BOOLEAN,!1),f("searchProps",o,l.ARRAY),i.info(R.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),a.registerMessageType(e,t,n,o,r),$t(e,t,n)}))}function Io(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?E("conversation",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),a=t.code,i=t.data,a===r.SUCCESS?(s=i&&le(i)||null,[2,{code:a,data:s}]):(o.warn(R.O,"insertMessage ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function Ro(e,t,n){return void 0===n&&(n={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return ve("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),M()?E("conversation",e,l.CONVERSATION,!0)&&E("message",t,l.OBJECT,!0)&&E("options",n,l.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,l.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,l.STRING)&&E("content.senderUserId",t.senderUserId,l.STRING,!0)&&E("content.messageType",t.messageType,l.STRING,!0)&&E("content.content",t.content,l.OBJECT,!0)&&E("content.messageDirection",t.messageDirection,l.NUMBER,!0)&&E("content.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN)&&E("content.expansion",t.expansion,l.OBJECT)&&E("content.disableNotification",t.disableNotification,l.BOOLEAN)&&E("content.sentTime",t.sentTime,l.NUMBER)&&E("content.sentStatus",t.sentStatus,l.NUMBER)?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,E,m,S,T,p;return D(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,f=t.canIncludeExpansion,l=t.expansion,g=t.disableNotification,v=t.sentTime,I=t.sentStatus,i.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:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,m)];case 1:return S=O.sent(),T=S.code,p=S.data,T===r.SUCCESS?[2,{code:T,data:le(p)}]:(i.warn(R.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:Ge[T]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function ho(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?E("messageId",e,(function(e){return s(e)||N(e)}),!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:le(i)}]:(o.warn(R.O,"getMessage ->code:".concat(a,",messageId:").concat(e)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function Eo(e){if(!M())return{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,a=e.channelId;return E("conversation",e,l.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,a),i=[];return t&&t.length&&t.forEach((function(e){return i.push(le(e))})),{code:r.SUCCESS,data:i}},he?t(he,me,Ee):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function mo(e,t,n,o){return B(this,void 0,void 0,(function(){var a=this;return D(this,(function(i){return ve("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),M()?E("conversation",e,l.CONVERSATION,!0)&&E("keyword",t,l.STRING,!0)&&E("timestamp",n,l.NUMBER)&&E("count",o,l.NUMBER)?[2,pe((function(i,s){return B(a,void 0,void 0,(function(){var a,c,u,d;return D(this,(function(f){switch(f.label){case 0:return 1,[4,i.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return a=f.sent(),c=a.code,u=a.data,c===r.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(le(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(R.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function So(e,t,n){return B(this,void 0,void 0,(function(){var o,a,i,s=this;return D(this,(function(c){return ve("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),M()?(o=e.conversationType,a=e.targetId,i=e.channelId,E("conversationType",o,l.NUMBER,!0)&&E("targetId",a,l.STRING,!0)&&E("timestamp",t,l.NUMBER,!0)&&E("cleanSpace",n,l.BOOLEAN)?[2,pe((function(c,u){return B(s,void 0,void 0,(function(){var s;return D(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,a,t,n,i)];case 1:return s=d.sent(),u.debug(R.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:a,channelId:i,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(R.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function To(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return ve("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),M()?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return t=e.conversationType,a=e.targetId,i=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(t)),[4,n.clearMessages(t,a,i)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function po(e,t,n,o){return B(this,void 0,void 0,(function(){var a=this;return D(this,(function(i){return ve("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),M()?[2,pe((function(i,s){return B(a,void 0,void 0,(function(){var a,c,u;return D(this,(function(d){switch(d.label){case 0:return s.info(R.O,"searchConversationByContent ->keyword:".concat(e)),[4,i.searchConversationByContent(e,n,o,t)];case 1:return a=d.sent(),c=a.code,u=a.data,c===r.SUCCESS?[2,{code:c,data:u}]:(s.warn(R.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function Oo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("timestamp",t,l.NUMBER)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c;return D(this,(function(u){switch(u.label){case 0:return n=e.conversationType,i=e.targetId,s=e.channelId,a.info(R.O,"clearUnreadCountByTimestamp ->targetId:".concat(i,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,i,t,s)];case 1:return(c=u.sent())===r.SUCCESS?[2,{code:c}]:(a.warn(R.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(i)),[2,{code:c,msg:Ge[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function No(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return ve("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),M()?E("messageId",e,l.NUMBER,!0)&&E("receivedStatus",t,l.NUMBER,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n;return D(this,(function(i){switch(i.label){case 0:return a.info(R.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=i.sent())===r.SUCCESS?[2,{code:n}]:(a.warn(R.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}function _o(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("tag.tagId",e.tagId,l.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,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.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=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("tagId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return o.info(R.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ao(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("tag.tagId",e.tagId,l.STRING,!0)&&E("tag.tagName",e.tagName,l.STRING,!0)&&E("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.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=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a;return D(this,(function(i){switch(i.label){case 0:return[4,t.getTagList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(n.warn(R.O,"getTagList ->code:".concat(o)),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Mo(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return E("conversation",e,l.CONVERSATION,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return o.info(R.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:Ge[a]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Uo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("tagId",e,l.STRING,!0)&&E("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n;return D(this,(function(i){switch(i.label){case 0:return a.info(R.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(R.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Po(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("tagId",e,l.STRING,!0)&&E("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n;return D(this,(function(i){switch(i.label){case 0:return a.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("conversation",e,l.CONVERSATION,!0)&&E("tagIds",t,l.ARRAY,!0)&&!t.some((function(e){return!E("tagId",e,l.STRING,!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n;return D(this,(function(i){switch(i.label){case 0:return a.info(R.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(R.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("tagId",e,l.STRING,!0)&&E("conversations",t,l.ARRAY,!0)&&!t.some((function(e){return!E("conversation",e,l.CONVERSATION,!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n;return D(this,(function(i){switch(i.label){case 0:return a.info(R.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=i.sent().code)===r.SUCCESS?[2,{code:n}]:(a.warn(R.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ge[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bo(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return E("tagId",e,l.STRING,!0)&&E("count",t,l.NUMBER,!0)&&E("startTime",n,l.NUMBER,!0)?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o,s,c;return D(this,(function(u){switch(u.label){case 0:return i.info(R.O,"getConversationListByTag ->tagId:".concat(e)),[4,a.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 w(w({},ge(e)),{isTopInTag:e.isTopInTag})}(e)}))}]:(i.warn(R.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Do(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return E("tagId",e,l.STRING,!0)&&E("containMuted",t,l.BOOLEAN,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return a.info(R.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(R.O,"getUnreadCountByTag ->code:".concat(i,",tagId:").concat(e)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bo(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return E("tagId",e,l.STRING,!0)&&E("conversation",t,l.CONVERSATION,!0)&&E("status.isTop",n,l.BOOLEAN,!0)?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o;return D(this,(function(s){switch(s.label){case 0:return i.info(R.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,a.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===r.SUCCESS?[2,{code:o}]:(i.warn(R.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Ge[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}Yn(y.COMBINE_HTML,(function(e,t){return new sn({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var Go={COMET:"comet",WEBSOCKET:"websocket"},xo={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 Vo=Object.freeze({__proto__:null,getAllConversationList:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?E("channelId",e,l.CHANNEL_ID)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return o.info(R.O,"getAllConversationList -> channelId: ".concat(e)),L(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 a=t.code,i=t.data,a===r.SUCCESS&&i?(s=i.map((function(e){return ge(e)})),[2,{code:a,data:s}]):(o.warn(R.O,"getAllConversationList fail -> code: ".concat(a," channelId: ").concat(e)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return M()?E("startTime",e,l.NUMBER,!0)&&E("count",t,l.NUMBER,!0)&&E("channelId",n,l.CHANNEL_ID)?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),i.info(R.O,"getConversationList -> ".concat(o)),L(n)?[4,a.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(c,e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===r.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(i.warn(R.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return B(this,void 0,void 0,(function(){var a=this;return D(this,(function(i){return M()?E("keyword",t,l.STRING,!0)&&E("messageTypes",n,l.ARRAY,!0)&&E("channelId",o,l.CHANNEL_ID)&&!n.some((function(e){return!E("messageType",e,l.STRING,!0)}))?[2,pe((function(i,s){return B(a,void 0,void 0,(function(){var a,c,u,d,f;return D(this,(function(l){switch(l.label){case 0:return a="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),s.info(R.O,"searchConversationByContent -> ".concat(e)),L(o)?[4,i.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,i.searchConversationByContent(t,n,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===r.SUCCESS&&d?(f=d.map((function(e){return ge(e)})),[2,{code:u,data:f}]):(s.warn(R.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(a)),[2,{code:u,msg:Ge[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return B(this,void 0,void 0,(function(){var a=this;return D(this,(function(i){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("keyword",t,l.STRING,!0)&&E("startTime",n,l.NUMBER,!0)&&E("count",o,l.NUMBER,!0)?[2,pe((function(i,s){return B(a,void 0,void 0,(function(){var a,c,u,d,f,l,g,v,I,h;return D(this,(function(E){switch(E.label){case 0:return a="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(R.O,"searchMessages -> ".concat(a)),c=e.targetId,u=e.conversationType,d=e.channelId,L(d)?[4,i.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return f=E.sent(),[3,4];case 2:return 0,[4,i.searchMessageByContent(u,c,t,n,o,0,d)];case 3:f=E.sent(),E.label=4;case 4:return l=f.code,g=f.data,l===r.SUCCESS&&g?(v=g.messages,I=g.count,h=v.map((function(e){return le(e)})),[2,{code:l,data:{messages:h,count:I}}]):(s.warn(R.O,"searchMessages fail -> code: ".concat(l," ").concat(a)),[2,{code:l,msg:Ge[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("option",t,l.OBJECT,!0)&&E("option.keyword",t.keyword,l.STRING,!0)&&E("option.startTime",t.startTime,l.NUMBER,!0)&&E("option.endTime",t.endTime,l.NUMBER,!0)&&E("option.offset",t.offset,l.NUMBER)&&E("option.limit",t.limit,l.NUMBER)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v,I;return D(this,(function(h){switch(h.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),a.info(R.O,"searchMessageInTimeRange -> ".concat(n)),i=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,f=t.offset,l=t.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(i,s,c,u,d,f,l)];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 le(e)}))}}]:(a.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:Ge[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("option",t,l.OBJECT,!0)&&E("option.count",t.count,l.NUMBER)&&E("option.timestamp",t.timestamp,l.NUMBER)&&E("option.order",t.order,(function(e){return[0,1].includes(e)}))&&E("option.messageTypes",t.messageTypes,l.ARRAY,!0)&&!t.messageTypes.some((function(e){return!E("option.messageType",e,l.STRING,!0)}))?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s,c,u,d,f,l,g,v,I,h,E,m,S;return D(this,(function(T){switch(T.label){case 0:return n=t.count,i=t.timestamp,s=t.order,c=t.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),a.info(R.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,n||(n=20),i||(i=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,i,n,c,s,l)];case 1:return g=T.sent(),v=g.code,I=g.data,v===r.SUCCESS?(E=(h=I).list,m=h.hasMore,S=E.map((function(e){return le(e)})),[2,{code:v,data:{messages:S,hasMore:m,list:S}}]):(a.warn(R.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:Ge[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("timestamp",t,l.NUMBER,!0)?[2,pe((function(o,r){return B(n,void 0,void 0,(function(){var n,a,i,s;return D(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)),a=e.conversationType,i=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(a,i,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("messageId",e,l.NUMBER,!0)&&E("receivedStatus",t,(function(e){return!L(a[e])}),!0)?[2,pe((function(o,r){return B(n,void 0,void 0,(function(){return D(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:Ge[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("messageId",e,l.NUMBER,!0)&&E("sentStatus",t,(function(e){return!L(P[e])}),!0)?[2,pe((function(o,r){return B(n,void 0,void 0,(function(){return D(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:Ge[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return M()?E("messageId",e,l.NUMBER,!0)&&E("content",t,l.OBJECT,!0)&&E("messageType",n,l.ONLY_STRING,!0)?[2,pe((function(r,a){return B(o,void 0,void 0,(function(){return D(this,(function(o){switch(o.label){case 0:return a.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:Ge[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?!E("messageIds",e,l.ARRAY,!0)||e.some((function(e){return!E("messageId",e,l.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,pe((function(n,o){return B(t,void 0,void 0,(function(){return D(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:Ge[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i,s;return D(this,(function(c){switch(c.label){case 0:return t=e.conversationType,a=e.targetId,i=e.channelId,o.info(R.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(t)),[4,n.clearMessages(t,a,i)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(R.O,"clearMessages ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return B(this,void 0,void 0,(function(){var o,a,i,s=this;return D(this,(function(c){return M()?(o=e.conversationType,a=e.targetId,i=e.channelId,E("conversationType",o,l.NUMBER,!0)&&E("targetId",a,l.STRING,!0)&&E("timestamp",t,l.NUMBER,!0)&&E("cleanSpace",n,l.BOOLEAN)?[2,pe((function(e,c){return B(s,void 0,void 0,(function(){var s;return D(this,(function(u){switch(u.label){case 0:return[4,e.deleteMessagesByTimestamp(o,a,t,n,i)];case 1:return(s=u.sent())===r.SUCCESS?[2,{code:s}]:(c.warn(R.O,"deleteMessagesByTimestamp ->code:".concat(s,",targetId:").concat(a)),[2,{code:s,msg:Ge[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),B(this,void 0,void 0,(function(){var o=this;return D(this,(function(a){return M()?E("conversation",e,l.CONVERSATION,!0)&&E("message",t,l.OBJECT,!0)&&E("options",n,l.OBJECT)&&E("options.isUnread",null==n?void 0:n.isUnread,l.BOOLEAN)&&E("options.searchContent",null==n?void 0:n.searchContent,l.STRING)&&(t instanceof Qt||E("message.senderUserId",t.senderUserId,l.STRING,!0)&&E("message.messageType",t.messageType,l.STRING,!0)&&E("message.content",t.content,l.OBJECT,!0)&&E("message.messageDirection",t.messageDirection,l.NUMBER,!0)&&E("message.canIncludeExpansion",t.canIncludeExpansion,l.BOOLEAN)&&E("message.expansion",t.expansion,l.OBJECT)&&E("message.disableNotification",t.disableNotification,l.BOOLEAN)&&E("message.sentTime",t.sentTime,l.NUMBER)&&E("message.sentStatus",t.sentStatus,l.NUMBER))?[2,pe((function(a,i){return B(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,I,h,E,m,S,T;return D(this,(function(p){switch(p.label){case 0:return o="",s=1,f=!1,g=t.messageType,v=t.content,t instanceof Qt||(o=t.senderUserId,s=t.messageDirection,f=t.canIncludeExpansion,l=t.expansion,d=t.disableNotification,c=t.sentTime,u=t.sentStatus),i.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:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,E)];case 1:return m=p.sent(),S=m.code,T=m.data,S===r.SUCCESS?[2,{code:S,data:le(T)}]:(i.warn(R.O,"insertMessage ->code:".concat(S,",targetId:").concat(e.targetId)),[2,{code:S,msg:Ge[S]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){var n,o;return B(this,void 0,void 0,(function(){var a,s=this;return D(this,(function(c){if(!M())return[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}];if(!E("messages",e,(function(e){return g(e)&&!(e.length<=0||e.length>=500)}),!0)||!E("checkDuplicate",t,l.BOOLEAN))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];for(a in e)if(!(E("message",e[a],l.OBJECT,!0)&&E("message.conversationType",e[a].conversationType,(function(e){return[i.PRIVATE,i.DISCUSSION,i.GROUP,i.CUSTOMER_SERVICE,i.SYSTEM,i.APP_PUBLIC_SERVICE,i.PUBLIC_SERVICE].includes(e)}),!0)&&E("message.targetId",e[a].targetId,l.STRING,!0)&&E("message.senderUserId",e[a].senderUserId,l.STRING,!0)&&E("message.messageType",e[a].messageType,l.STRING,!0)&&E("message.content",e[a].content,l.OBJECT,!0)&&E("message.messageDirection",e[a].messageDirection,l.NUMBER,!0)&&E("message.canIncludeExpansion",e[a].canIncludeExpansion,l.BOOLEAN)&&E("message.expansion",e[a].expansion,l.OBJECT)&&E("message.disableNotification",e[a].disableNotification,l.BOOLEAN)&&E("message.sentTime",e[a].sentTime,l.NUMBER)&&E("message.sentStatus",e[a].sentStatus,l.NUMBER)&&E("options.isUnread",null===(n=e[a])||void 0===n?void 0:n.isUnread,l.BOOLEAN)&&E("options.searchContent",null===(o=e[a])||void 0===o?void 0:o.searchContent,l.STRING)))return[2,{code:r.BIZ_ERROR_INVALID_PARAMETER,msg:String(a)}];return[2,pe((function(n){return B(s,void 0,void 0,(function(){var o,a,i;return D(this,(function(s){switch(s.label){case 0:return[4,n.batchInsertMessage(e,t)];case 1:return o=s.sent(),a=o.code,i=o.data,a===r.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:Ge[a]}]}}))}))}))]}))}))},getMessageCount:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?[2,pe((function(n){return B(t,void 0,void 0,(function(){var t,o,a,i,s,c;return D(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,[4,n.getMessageCount(t,o,a)];case 1:return i=u.sent(),s=i.code,c=i.data,s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Ge[s]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?E("messageUId",e,l.STRING,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t,a,i;return D(this,(function(s){switch(s.label){case 0:return[4,n.getPrivateMessageDeliverTime(e)];case 1:return t=s.sent(),a=t.code,i=t.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(R.A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E,"code:".concat(a,",messageUId:").concat(e)),[2,{code:a,msg:Ge[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return M()?E("targetId",e,l.STRING,!0)&&E("messageUId",t,l.STRING,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return[4,o.getGroupMessageDeliverList(e,t)];case 1:return n=c.sent(),i=n.code,s=n.data,i===r.SUCCESS?[2,{code:i,data:s}]:(a.warn(R.A_GET_GROUP_MESSAGE_DELIVER_LIST_E,"code:".concat(i,", targetId:").concat(e," messageUId:").concat(t)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return M()?E("enableCheck",e,l.BOOLEAN)?[2,pe((function(n){return B(t,void 0,void 0,(function(){return D(this,(function(t){switch(t.label){case 0:return[4,n.setCheckDuplicateMessage(e)];case 1:return[2,{code:t.sent().code}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return M()?[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,r;return D(this,(function(a){switch(a.label){case 0:return n.info(R.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=a.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ge[r.NOT_SUPPORT]}]}))}))}}),ko=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};function Ho(e){return B(this,void 0,void 0,(function(){var t=this;return D(this,(function(n){return!e||E("proxy.socksHost",e.socksHost,l.STRING,!0)&&E("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,pe((function(n,o){return B(t,void 0,void 0,(function(){var t;return D(this,(function(a){switch(a.label){case 0:return o.info(R.O,"setProxy: ->".concat(e)),[4,n.setProxy(e)];case 1:return(t=a.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(R.O,"setProxy ->code:".concat(t)),[2,{code:t,msg:Ge[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fo(){return B(this,void 0,void 0,(function(){var e=this;return D(this,(function(t){return[2,pe((function(t,n){return B(e,void 0,void 0,(function(){var e,o,a;return D(this,(function(i){switch(i.label){case 0:return[4,t.getProxy()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:o,data:a}]:(n.warn(R.O,"getProxy ->code:".concat(o)),[2,{code:o,msg:Ge[o]}])}}))}))}))]}))}))}function Zo(e,t){return B(this,void 0,void 0,(function(){var n=this;return D(this,(function(o){return!e||E("proxy.socksHost",e.socksHost,l.STRING,!0)&&E("proxy.socksPort",e.socksPort,l.NUMBER,!0)?[2,pe((function(o,a){return B(n,void 0,void 0,(function(){var n,i,s;return D(this,(function(c){switch(c.label){case 0:return a.info(R.O,"testProxy: ->".concat(e)),[4,o.testProxy(e,t)];case 1:return n=c.sent(),i=n.status,s=n.data,i===r.SUCCESS?[2,{code:i,msg:s}]:(a.warn(R.O,"testProxy ->code:".concat(i)),[2,{code:i,msg:Ge[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}export{Qt as BaseMessage,sn as CombineMessage,Go as ConnectType,V as Events,cn as FileMessage,un as GIFMessage,on as HQVoiceMessage,nn as ImageMessage,fn as LocationMessage,ko as MentionedInfoBody,xo as MessageType,ln as ReferenceMessage,gn as RichContentMessage,rn as SightMessage,an as TextMessage,dn as VoiceMessage,we as __addSDKVersion,Uo as addConversationsToTag,Oe as addEventListener,_o as addTag,Yt as addToBlacklist,Kt as bindRTCRoomForChatroom,$e as clearAllMessagesUnreadStatus,Ae as clearEventListeners,co as clearHistoryMessages,To as clearMessages,Qe as clearMessagesUnreadStatus,Ke as clearTextMessageDraft,Oo as clearUnreadCountByTimestamp,ke as connect,So as deleteLocalMessagesByTimestamp,so as deleteMessages,Me as destroy,He as disconnect,Vo as electronExtension,Zt as forceRemoveChatRoomEntry,kt as forceSetChatRoomEntry,Jt as getAllChatRoomEntries,gt as getAllConversationState,Ct as getAllUltraGroupUnreadCount,At as getAllUltraGroupUnreadMentionedCount,lt as getAllUnreadMentionedCount,Wt as getBlacklist,Xt as getBlacklistStatus,It as getBlockUltraGroupList,st as getBlockedConversationList,qt as getChatRoomEntry,Gt as getChatRoomInfo,zt as getChatroomHistoryMessages,Ue as getConnectionStatus,Ze as getConversation,Fe as getConversationList,at as getConversationNotificationLevel,it as getConversationNotificationStatus,Bo as getConversationsFromTagByPage,Le as getCurrentUserId,Be as getDeviceId,qn as getFileToken,Jn as getFileUrl,Io as getFirstUnreadMessage,$n as getHistoryMessages,ho as getMessage,go as getMessageReader,Fo as getProxy,eo as getRemoteHistoryMessages,Pe as getServerTime,yo as getTags,Mo as getTagsFromConversation,Je as getTextMessageDraft,ut as getTopConversationList,Ye as getTotalUnreadCount,je as getTotalUnreadCountByLevels,We as getTotalUnreadMentionedCountByLevels,Ot as getUltraGroupDefaultNotificationLevel,Mt as getUltraGroupFirstUnreadMessageTimestamp,vt as getUltraGroupList,ht as getUltraGroupMessageListByMessageUId,_t as getUltraGroupUnreadCountByTargetId,pt as getUltraGroupUnreadMentionedCountByTargetId,yt as getUltraGroupUnreadMentionedMessages,dt as getUnreadConversationList,Xe as getUnreadCount,Do as getUnreadCountByTag,ft as getUnreadMentionedCount,Eo as getUnreadMentionedMessages,ye as init,Ro as insertMessage,De as installPlugin,Bt as joinChatRoom,Dt as joinExistChatRoom,Tt as modifyMessage,Ne as onceEventListener,bt as quitChatRoom,io as recallMessage,vo as registerMessageType,St as removeAllExpansionForUltraGroupMessage,Ft as removeChatRoomEntries,Ht as removeChatRoomEntry,qe as removeConversation,Po as removeConversationsFromTag,_e as removeEventListener,Ce as removeEventListeners,mt as removeExpansionForUltraGroupMessage,jt as removeFromBlacklist,fo as removeMessageExpansionForKey,Co as removeTag,wo as removeTagFromConversations,Lo as removeTagsFromConversation,ze as saveTextMessageDraft,po as searchConversationByContent,mo as searchMessages,jn as sendFileMessage,Xn as sendHQVoiceMessage,Wn as sendImageMessage,zn as sendMessage,to as sendReadReceiptMessage,no as sendReadReceiptRequest,oo as sendReadReceiptResponse,ro as sendReadReceiptResponseV2,Qn as sendSightMessage,ao as sendSyncReadStatusMessage,Kn as sendTextMessage,lo as sendTypingStatusMessage,Rt as sendUltraGroupTypingStatus,Vt as setChatRoomEntries,xt as setChatRoomEntry,ot as setConversationNotificationLevel,rt as setConversationNotificationStatus,ct as setConversationToTop,bo as setConversationToTopInTag,No as setMessageReceivedStatus,Ho as setProxy,Nt as setUltraGroupDefaultNotificationLevel,Zo as testProxy,Et as updateExpansionForUltraGroupMessage,uo as updateMessageExpansion,Ao as updateTag};