@rongcloud/imlib-next 5.9.8 → 5.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1 +1 @@
1
- import{httpRequest as e,NetworkType as t,HttpMethod as n,HTTP_TIMEOUT as i,appendUrl as o,ErrorCode as r,ReceivedStatus as a,ConversationType as s,EventEmitter as c,RCConnectionStatus as d,VersionManage as u,assert as l,AssertRules as v,isArray as f,isHttpUrl as g,APIContext as S,LogTagId as h,logger as I,ValidatorManage as T,validate as _,isValidConversationType as m,isValidNotificationLevel as p,NotificationLevel as N,UltraGroupChannelType as E,isNumber as y,isString as R,MessageType as C,MAX_UPLOAD_FILE_SIZE as O,UPLOAD_FILE_CHUNK_SIZE as A,UploadMethod as U,fixUrlProtocol as w,FileType as M,getUUID as P,MAX_MESSAGE_CONTENT_BYTES as b,isValidFileType as L,usingCppEngine as G,isLimitedArray as J,isValidTargetId as D,MessageDirection as B,SentStatus as k,isUndefined as x,notEmptyString as H,transformReceivedStatusFlag as V,isInteger as F,SubscribeType as Y}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,InterruptionLevel,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OnlineStatus,OperateStatus,PlatformInfo,PushImportanceHonor,RCConnectionStatus,ReceivedStatus,SentStatus,SubscribeOperationType,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var q=function(e,t){return q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},q(e,t)};function K(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}q(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var z=function(){return z=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},z.apply(this,arguments)};function j(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function W(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}"function"==typeof SuppressedError&&SuppressedError;var Q=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,i=t.length;n<i;n++)if(!e[t[n]])return!1;return!0}(uni))},X=Q();var Z=null,$=function(e){return j(void 0,void 0,void 0,(function(){var t;return W(this,(function(n){switch(n.label){case 0:return[4,ee.getNetworkType()];case 1:return t=n.sent(),Z({status:"online"===e.type,type:t}),[2]}}))}))};var ee={tag:"browser",httpReq:function(t){return e(t).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:X,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,i=t.reason;e(n,i)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,i=e.effectiveType,o=n||i||t.UNKONWN;return Promise.resolve(o)},setNetworkStatusListener:function(e){Z=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",$),window.addEventListener("online",$))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",$),window.removeEventListener("online",$)),Z=null}},te=Q(),ne=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)}}},ie={setItem:ne("setStorageSync"),getItem:ne("getStorageSync"),removeItem:ne("removeStorageSync"),clear:ne("clearStorageSync")},oe=null,re=function(e){var t=e.isConnected,n=e.networkType;oe({status:t,type:n})};var ae={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){wx.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ie,sessionStorage:ie,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:te,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){oe=e,wx.onNetworkStatusChange(re)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(re),oe=null}},se=Q(),ce=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 i=my[e]({key:t[0]}).data;return i?JSON.stringify(i):i}catch(e){}}},de={setItem:ce("setStorageSync"),getItem:ce("getStorageSync"),removeItem:ce("removeStorageSync"),clear:ce("clearStorageSync")},ue=null,le=function(e){var t=e.isConnected,n=e.networkType;ue({status:t,type:n})};var ve={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:u,method:t,headers:s,timeout:a,data:d,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:de,sessionStorage:de,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:se,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ue=e,my.onNetworkStatusChange(le)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(le),ue=null}},fe=Q(),ge=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},Se={setItem:ge("setStorageSync"),getItem:ge("getStorageSync"),removeItem:ge("removeStorageSync"),clear:ge("clearStorageSync")},he=null,Ie=function(e){var t=e.isConnected,n=e.networkType;he({status:t,type:n})};var Te={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:fe,localStorage:Se,sessionStorage:Se,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},i={data:JSON.stringify(n),status:e.statusCode};t(i)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){he=e,tt.onNetworkStatusChange(Ie)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Ie),he=null}},_e=Q(),me=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){}}},pe={setItem:me("setStorageSync"),getItem:me("getStorageSync"),removeItem:me("removeStorageSync"),clear:me("clearStorageSync")},Ne=null,Ee=function(e){var t=e.isConnected,n=e.networkType;Ne({status:t,type:n})};var ye={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:_e,localStorage:pe,sessionStorage:pe,httpReq:function(e){return new Promise((function(t){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)||{},i={data:JSON.stringify(n),status:e.statusCode};t(i)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return j(this,void 0,void 0,(function(){return W(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Ne=e,swan.onNetworkStatusChange(Ee)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Ee),Ne=null}},Re=Q(),Ce=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)}}},Oe={setItem:Ce("setStorageSync"),getItem:Ce("getStorageSync"),removeItem:Ce("removeStorageSync"),clear:Ce("clearStorageSync")},Ae=null,Ue=function(e){var t=e.isConnected,n=e.networkType;Ae({status:t,type:n})};var we={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){jd.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Oe,sessionStorage:Oe,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Re,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ae=e,jd.onNetworkStatusChange(Ue)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(Ue),Ae=null}},Me=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},Pe={setItem:Me("setStorageSync"),getItem:Me("getStorageSync"),removeItem:Me("removeStorageSync"),clear:Me("clearStorageSync")},be=null,Le=function(e){var t=e.isConnected,n=e.networkType;be({status:t,type:n})};var Ge,Je={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){uni.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Pe,sessionStorage:Pe,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},i=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){i.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){i.onError((function(t){e(t.errMsg)}))},onMessage:function(e){i.onMessage((function(t){e(t.data)}))},onOpen:function(e){i.onOpen(e)},send:function(e){i.send({data:e})},close:function(e,t){i.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){be=e,uni.onNetworkStatusChange(Le)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Le),be=null}},De=function(e){return e&&e.request&&e.getSystemInfo},Be="undefined"!=typeof uni&&De(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return Je;case"mp-jd":return we;case"mp-baidu":return ye;case"mp-toutiao":return Te;case"mp-alipay":return ve;case"mp-weixin":return ae;default:return ee}}():"undefined"!=typeof jd&&De(jd)?we:"undefined"!=typeof my&&De(my)?ve:"undefined"!=typeof tt&&De(tt)?Te:"undefined"!=typeof swan&&De(swan)?ye:"undefined"!=typeof wx&&De(wx)?ae:ee;function ke(e){var t=e.conversationType,n=e.channelId,i=e.messageType,o=e.content,r=e.senderUserId,s=e.targetId,c=e.sentTime,d=e.receivedTime,u=e.messageUId,l=e.messageDirection,v=e.isPersited,f=e.isCounted,g=e.isOffLineMessage,S=e.canIncludeExpansion,h=e.expansion,I=e.receivedStatus,T=e.receivedStatusInfo,_=e.disableNotification,m=e.isMentioned,p=e.isStatusMessage,N=e.readReceiptInfo,E=e.pushConfig,y=e.messageId,R=e.isInterrupt,C=e.isModifyMessage,O=e.channelType,A=e.sentStatus,U=e.directedUserIds;return I||(I=a.UNREAD),{messageType:i,channelId:n||"",content:o,senderUserId:r,targetId:s,conversationType:t,sentTime:c,receivedTime:d,messageUId:u,messageDirection:l,isPersited:v,isCounted:f,isMentioned:m,disableNotification:_,isStatusMessage:p,canIncludeExpansion:S,expansion:h,receivedStatus:I,receivedStatusInfo:T,readReceiptInfo:N,pushConfig:E,messageId:y,isInterrupt:R,isModifyMessage:C,sentStatus:A,isOffLineMessage:g,channelType:O,directedUserIds:U}}function xe(e){var t=e.conversationType,n=e.targetId,i=e.latestMessage,o=e.unreadMessageCount,r=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,d=e.notificationStatus,u=e.notificationLevel,l=e.isTop,v=e.channelId,f=e.unreadMentionedCount,g=e.matchCount;e.unreadMentionedMeCount;var S=e.operationTime,h=e.draft,I={conversationType:t,targetId:n,latestMessage:i&&ke(i),unreadMessageCount:o,hasMentioned:r,mentionedInfo:r?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:d,notificationLevel:u,isTop:l,channelId:v,unreadMentionedCount:f,matchCount:g,operationTime:S,draft:h||""};return I.conversationType===s.ULTRA_GROUP&&(I.firstUnreadMessage=e.firstUnreadMessage,I.channelType=e.channelType,I.unreadMentionedMeCount=e.unreadMentionedMeCount),I}function He(e,t){null===console||void 0===console||console.warn("Method '"+e+"' is deprecated, please use '"+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.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",e.SYNC_READ_STATUS="SYNC_READ_STATUS",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",e.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",e.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",e.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED"}(Ge||(Ge={}));var Ve,Fe="A-add_to_blacklist-T",Ye="A-add_to_blacklist-R",qe="A-remove_from_blacklist-T",Ke="A-remove_from_blacklist-R",ze="A-get_blacklist-T",je="A-get_blacklist-R",We="A-get_blacklist_status-T",Qe="A-get_blacklist_status-R",Xe="A-get_chatroom_info-T",Ze="A-get_chatroom_info-R",$e="A-set_chatroom_entry-T",et="A-set_chatroom_entry-R",nt="A-set_chatroom_entries-T",it="A-set_chatroom_entries-R",ot="A-force_set_chatroom_entry-T",rt="A-force_set_chatroom_entry-R",at="A-remove_chatroom_entry-T",st="A-remove_chatroom_entry-R",ct="A-remove_chatroom_entries-T",dt="A-remove_chatroom_entries-R",ut="A-force_remove_chatroom_entry-T",lt="A-force_remove_chatroom_entry-R",vt="A-get_chatroom_entry-T",ft="A-get_chatroom_entry-R",gt="A-get_all_chatroom_entries-T",St="A-get_all_chatroom_entries-R",ht="A-get_chatroom_history_messages-T",It="A-get_chatroom_history_messages-R",Tt="A-bind_rtc_room_for_chatroom-T",_t="A-bind_rtc_room_for_chatroom-R",mt="A-get_top_conversation_list-R",pt="A-get_top_conversation_list-T",Nt="A-get_conversation_list-T",Et="A-get_conversation_list-R",yt="A-get_conversation-T",Rt="A-get_conversation-R",Ct="A-remove_conversation-T",Ot="A-remove_conversation-R",At="A-get_conversation_message_draft-T",Ut="A-get_conversation_message_draft-R",wt="A-save_conversation_message_draft-T",Mt="A-save_conversation_message_draft-R",Pt="A-clear_conversation_message_draft-T",bt="A-clear_conversation_message_draft-R",Lt="A-get_total_unread_count-T",Gt="A-get_total_unread_count-R",Jt="A-get_total_unread_count_by_levels-T",Dt="A-get_total_unread_count_by_levels-R",Bt="A-get_unread_count-T",kt="A-get_unread_count-R",xt="A-clear_unread_count-T",Ht="A-clear_unread_count-R",Vt="A-clear_all_unread_count-O",Ft="A-set_conversation_notification_level-T",Yt="A-set_conversation_notification_level-R",qt="A-set_conversation_status-T",Kt="A-set_conversation_status-R",zt="A-get_conversation_notification_level-T",jt="A-get_conversation_notification_level-R",Wt="A-get_conversation_notification_status-T",Qt="A-get_conversation_notification_status-R",Xt="A-set_conversation_notification_status-T",Zt="A-set_conversation_notification_status-R",$t="A-get_unread_conversation_list-T",en="A-get_unread_conversation_list-R",tn="A-get_unread_mentioned_count-T",nn="A-get_unread_mentioned_count-R",on="A-get_all_unread_mentioned_count-T",rn="A-get_all_unread_mentioned_count-R",an="A-get_all_conversation-state-T",sn="A-e_get_all_conversation_list-T",cn="A-e_get_all_conversation_list-R",dn="A-e_get_conversation_list-T",un="A-e_get_conversation_list-R",ln="A-e_search_conversation_by_content-T",vn="A-e_search_conversation_by_content-R",fn="A-e_search_messages-T",gn="A-e_search_messages-R",Sn="A-e_search_message_in_time_range-T",hn="A-e_search_message_in_time_range-R",In="A-e_search_messages_by_user-T",Tn="A-e_search_messages_by_user-R",_n="A-e_get_history_messages_by_message_types-T",mn="A-e_get_history_messages_by_message_types-R",pn="A-e_get_continuous_messages-T",Nn="A-e_get_continuous_messages-R",En="A-e_set_message_status_to_read-T",yn="A-e_set_message_status_to_read-R",Rn="A-e_set_message_received_status-T",Cn="A-e_set_message_received_status-R",On="A-e_set_message_sent_status-T",An="A-e_set_message_sent_status-R",Un="A-e_set_message_sent_status_info-T",wn="A-e_set_message_sent_status_info-R",Mn="A-e_set_message_content-T",Pn="A-e_set_message_content-R",bn="A-e_delete_messages-T",Ln="A-e_delete_messages-R",Gn="A-e_clear_messages-T",Jn="A-e_clear_messages-R",Dn="A-e_delete_messages_by_timestamp-T",Bn="A-e_delete_messages_by_timestamp-R",kn="A-e_insert_message-T",xn="A-e_insert_message-R",Hn="A-e_batch_insert_message-T",Vn="A-e_batch_insert_message-R",Fn="A-e_get_message_count-T",Yn="A-e_get_message_count-R",qn="A-e_get_private_message_deliver_time-T",Kn="A-e_get_private_message_deliver_time-R",zn="A-e_get_group_message_deliver_list-T",jn="A-e_get_group_message_deliver_list-R",Wn="A-e_set_check_duplicate_message-T",Qn="A-e_set_check_duplicate_message-R",Xn="A-batch_Remove_conversation-T",Zn="A-batch_Remove_conversation-R",$n="A-batch_set_con_notifi_level-T",ei="A-batch_set_con_notifi_level-R",ti="A-batch_set_con_to_top-T",ni="A-batch_set_con_to_top-R",ii="A-batch_clear_remote_msg-T",oi="A-batch_clear_remote_msg-R",ri="A-batch_clear_msg-T",ai="A-batch_clear_msg-R",si="A-get_remote_history_messages-T",ci="A-get_remote_history_messages-R",di="A-recall_message-T",ui="A-recall_message-R",li="A-delete_remote_message-T",vi="A-delete_remote_message-R",fi="A-delete_remote_message_by_timestamp-T",gi="A-delete_remote_message_by_timestamp-R",Si="A-update_message_expansion-T",hi="A-update_message_expansion-R",Ii="A-remove_message_expansion_for_key-T",Ti="A-remove_message_expansion_for_key-R",_i="A-get_message_reader-T",mi="A-get_message_reader-R",pi="A-get_first_unread_message-T",Ni="A-get_first_unread_message-R",Ei="A-get_first_unread_message_info-T",yi="A-get_first_unread_message_info-R",Ri="A-insert_message-T",Ci="A-insert_message-R",Oi="A-get_message-T",Ai="A-get_message-R",Ui="A-get_unread_mentioned_messages-T",wi="A-get_unread_mentioned_messages-R",Mi="A-delete_local_messages_by_timestamp-T",Pi="A-delete_local_messages_by_timestamp-R",bi="A-clear_messages-T",Li="A-clear_messages-R",Gi="A-search_conversation_by_content-T",Ji="A-search_conversation_by_content-R",Di="A-clear_unread_count_by_timestamp-T",Bi="A-clear_unread_count_by_timestamp-R",ki="A-set_message_received_status-T",xi="A-set_message_received_status-R",Hi="A-set_proxy-T",Vi="A-set_proxy-R",Fi="A-get_proxy-T",Yi="A-get_proxy-R",qi="A-test_proxy-T",Ki="A-test_proxy-R",zi="A-add_tag-T",ji="A-add_tag-R",Wi="A-remove_tag-T",Qi="A-remove_tag-R",Xi="A-update_tag-T",Zi="A-update_tag-R",$i="A-get_tags-T",eo="A-get_tags-R",to="A-get_tags_for_conversation-T",no="A-get_tags_for_conversation-R",io="A-add_tag_for_conversations-T",oo="A-add_tag_for_conversations-R",ro="A-remove_conversations_from_tag-T",ao="A-remove_conversations_from_tag-R",so="A-remove_tags_from_conversation-T",co="A-remove_tags_from_conversation-R",uo="A-remove_tag_from_conversations-T",lo="A-remove_tag_from_conversations-R",vo="A-get_conversations_from_tag_by_page-T",fo="A-get_conversations_from_tag_by_page-R",go="A-get_unread_count_by_tag-T",So="A-get_unread_count_by_tag-R",ho="A-set_conversation_status_in_tag-R",Io="A-get_ultra_group_list-T",To="A-get_ultra_group_list-R",_o="A-get_block_ultra_group_list-T",mo="A-get_block_ultra_group_list-R",po="A-send_ultra_group_typing_status-T",No="A-send_ultra_group_typing_status-R",Eo="A-get_ultra_group_message_list_by_message_uid-T",yo="A-get_ultra_group_message_list_by_message_uid-R",Ro="A-update_expansion_for_ultra_group_message-T",Co="A-update_expansion_for_ultra_group_message-R",Oo="A-remove_expansion_for_ultra_group_message-T",Ao="A-remove_expansion_for_ultra_group_message-R",Uo="A-remove_all_expansion_for_ultra_group_message-T",wo="A-remove_all_expansion_for_ultra_group_message-R",Mo="A-modify_message-T",Po="A-modify_message-R",bo="A-get_ultra_group_unread_mentioned_count_by_target_id-T",Lo="A-get_ultra_group_unread_mentioned_count_by_target_id-R",Go="A-get_ultra_group_default_notification_level-T",Jo="A-get_ultra_group_default_notification_level-R",Do="A-set_ultra_group_default_notification_level-T",Bo="A-set_ultra_group_default_notification_level-R",ko="A-get_ultra_group_unread_count_by_target_id-T",xo="A-get_ultra_group_unread_count_by_target_id-R",Ho="A-get_all_ultra_group_unread_count-T",Vo="A-get_all_ultra_group_unread_count-R",Fo="A-get_all_ultra_group_unread_mentioned_count-T",Yo="A-get_all_ultra_group_unread_mentioned_count-R",qo="A-get_ultra_group_unread_mentioned_messages-T",Ko="A-get_ultra_group_unread_mentioned_messages-R",zo="A-get_ultra_group_first_unread_message_timestamp-T",jo="A-get_ultra_group_first_unread_message_timestamp-R",Wo="A-get_ultra_group_unread_info_list-T",Qo="A-get_ultra_group_unread_info_list-R",Xo="A-subscribe_user_status-T",Zo="A-subscribe_user_status-R",$o="A-unsubscribe_user_status-T",er="A-unsubscribe_user_status-R",tr="A-get_subscribe_user_status-T",nr="A-get_subscribe_user_status-R",ir="A-get_subscribe_user_status_list-T",or="A-get_subscribe_user_status_list-R",rr="A-get_message_by_timestamp-T",ar="A-get_message_by_timestamp-R";!function(e){e[e.DISALLOW=0]="DISALLOW",e[e.ALLOW=1]="ALLOW"}(Ve||(Ve={}));var sr=new c,cr={connection:function(e,t){switch(e){case d.CONNECTED:sr.emit(Ge.CONNECTED);break;case d.CONNECTING:sr.emit(Ge.CONNECTING);break;case d.SUSPENDED:sr.emit(Ge.SUSPEND,t);break;case d.DISCONNECTED:sr.emit(Ge.DISCONNECT,t)}},batchMessage:function(e){sr.emit(Ge.MESSAGES,{messages:e.map((function(e){return ke(e)}))})},typingState:function(e){sr.emit(Ge.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n,i){sr.emit(Ge.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:i})},messageReceiptRequest:function(e,t,n){sr.emit(Ge.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){sr.emit(Ge.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?ke(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=dr(e.unreadMessageCount||0),n.unreadMentionedCount=dr(e.unreadMentionedCount||0),n.unreadMentionedMeCount=dr(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));sr.emit(Ge.CONVERSATION,{conversationList:t})},chatroomState:function(e){sr.emit(Ge.CHATROOM,e)},expansion:function(e){sr.emit(Ge.EXPANSION,e)},pullFinished:function(){sr.emit(Ge.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){sr.emit(Ge.TAG)},conversationTagChanged:function(){sr.emit(Ge.CONVERSATION_TAG)},messageBlocked:function(e){sr.emit(Ge.MESSAGE_BLOCKED,e)},messageDelivered:function(e){sr.emit(Ge.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){sr.emit(Ge.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){sr.emit(Ge.ULTRA_GROUP_ENABLE,e.map((function(e){return xe(e)})))},operateStatus:function(e){sr.emit(Ge.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){sr.emit(Ge.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return ke(e)})))},ultraGroupMessageModified:function(e){sr.emit(Ge.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return ke(e)})))},ultraGroupMessageRecalled:function(e){sr.emit(Ge.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return ke(e)})))},ultraGroupChannelChangeType:function(e){sr.emit(Ge.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){sr.emit(Ge.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){sr.emit(Ge.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){sr.emit(Ge.USER_GROUP_STATUS,e)},messageReadReceipt:function(e){sr.emit(Ge.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:function(e){sr.emit(Ge.SYNC_READ_STATUS,e)},subscribedUserStatusChange:function(e){sr.emit(Ge.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:function(e){sr.emit(Ge.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:function(){sr.emit(Ge.SYNC_SUBSCRIBED_USER_STATUS_FINISHED)}};function dr(e){return e>999?999:e}u.add("imlib-next","5.9.8");var ur=null,lr=null,vr=null;function fr(){return j(this,void 0,void 0,(function(){return W(this,(function(e){switch(e.label){case 0:return ur?(vr.info(h.A_DESTROY_O),[4,S.destroy()]):[2];case 1:return e.sent(),lr=null,ur=null,vr=null,[2]}}))}))}function gr(e){if(!ur)throw new Error("Not initialized yet!");return e(ur,vr,lr)}function Sr(e){return ur?e(ur,vr,lr):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function hr(e,t,n){sr.on(e,t,n)}function Ir(e,t,n){sr.once(e,t,n)}function Tr(e,t,n){sr.off(e,t,n)}function _r(e){sr.removeAll(e)}function mr(){sr.clear()}function pr(e){!function(e){var t,n=e.appkey,i=e.navigators;ur?vr.warn(h.A_INIT_REPEAT_O):(l("options.appkey",e.appkey,v.STRING,!0),l("options.navigators",e.navigators,(function(e){return f(e)&&(0===e.length||e.every(g))})),lr=e,ur=S.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||Be,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,uploadDomain:e.uploadDomain}),(vr=ur.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),vr.info(h.A_INIT_O,JSON.stringify({appkey:n,navigators:i,version:"5.9.8",commit:"818915a24854e2a6959314debabd4999590e5f0d"})),ur.assignWatcher(cr),I.init(vr))}(e)}function Nr(){return j(this,void 0,void 0,(function(){return W(this,(function(e){return ur?(mr(),[2,fr()]):[2]}))}))}function Er(){return gr((function(e){return e.getConnectionStatus()}))}function yr(){return gr((function(e){return e.getServerTime()}))}function Rr(){return gr((function(e){return e.getCurrentUserId()}))}function Cr(e,t){u.add(e,t)}function Or(){return gr((function(e){return e.getDeviceId()}))}function Ar(e,t){return gr((function(n){return n.install(e,t)}))}var Ur={TIMEOUT:{code:-1,msg:"Network timeout"},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!"}},wr={};for(var Mr in Ur){var Pr=Ur[Mr].code;wr[Pr]=Mr}function br(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(h.A_CONNECT_T,h.A_CONNECT_R).validate("token",e,v.STRING,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(h.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,i.connect(e,!!t,n)];case 1:return a=c.sent(),s=a.code===r.SUCCESS?"info":"warn",o[s](h.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===r.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:wr[a.code]}]}}))}))}))]}))}))}function Lr(e){return I.info(h.A_DISCONNECT_O,{}),gr((function(t){return t.disconnect(e)}))}function Gr(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(Nt,Et).validate("count",null==e?void 0:e.count,v.NUMBER).validate("startTime",null==e?void 0:e.startTime,v.NUMBER).validate("order",null==e?void 0:e.order,v.NUMBER).validate("channelId",t,v.CHANNEL_ID).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(Nt,JSON.stringify({count:null==e?void 0:e.count,startTime:null==e?void 0:e.startTime,order:null==e?void 0:e.order,channelId:t}),n),[4,i.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 a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=c.map((function(e){return xe(e)})),o.info(Et,JSON.stringify({code:s,list:d.length}),n),[2,{code:0,data:d}]):(o.warn(Et,JSON.stringify({code:s})),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function Jr(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(yt,Rt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(yt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversation(t,o,a||"")];case 1:return c=v.sent(),d=c.code,u=c.data,l=d===r.SUCCESS?"info":"warn",i[l](Rt,JSON.stringify({code:d}),s),d!==r.SUCCESS?[2,{code:d,msg:wr[d]}]:[2,{code:d,data:u?xe(u):null}]}}))}))}))]}))}))}function Dr(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Ct,Ot).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ct,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.removeConversation(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Ot,JSON.stringify({code:c}),s),c!==r.SUCCESS?[2,{code:c,msg:wr[c]}]:[2,{code:c}]}}))}))}))]}))}))}function Br(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Xn,Zn).validate("conversations",e,(function(t){if(!_("conversations",t,v.ARRAY,!0))return!1;if(t.length>20||0===t.length)return!1;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(!(_("conversations",o,v.OBJECT,!0)&&_("conversations.targetId",o.targetId,v.STRING,!0)&&_("conversations.conversationType",o.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(Zn,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",o.channelId,v.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a;return W(this,(function(s){switch(s.label){case 0:return t=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),o=i.createTraceId(),i.info(Xn,"conversations: "+JSON.stringify(t),o),[4,n.batchRemoveConversation(t)];case 1:return a=s.sent(),i[r.SUCCESS===a?"info":"warn"](Zn,"code: "+a,o),[2,{code:a}]}}))}))}))]}))}))}function kr(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(At,Ut).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(At,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationMessageDraft(t,o,a)];case 1:return c=v.sent(),d=c.code,u=c.data,l=d===r.SUCCESS?"info":"warn",i[l](Ut,JSON.stringify({code:d,data:u}),s),d===r.SUCCESS?[2,{code:d,data:u||""}]:[2,{code:d,msg:wr[d]}]}}))}))}))]}))}))}function xr(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(wt,Mt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("draft",t,v.STRING,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(wt,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,draft:t}),n),[4,i.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Mt,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:wr[a]}]}}))}))}))]}))}))}function Hr(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Pt,bt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Pt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearConversationMessageDraft(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](bt,JSON.stringify({code:c}),s),c===r.SUCCESS?[2,{code:c}]:[2,{code:c,msg:wr[c]}]}}))}))}))]}))}))}function Vr(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(Lt,Gt).validate("conversationTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!1).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c;return W(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Lt,JSON.stringify({conversationTypes:t,includeMuted:e}),n),[4,i.getTotalUnreadCount("",t,e)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Gt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Gt,JSON.stringify({code:s}),n),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function Fr(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(Jt,Dt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!0).validate("levels",t,(function(e){return!!f(t)&&!e.some((function(e){return!p(e)}))}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c;return W(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Jt,JSON.stringify({conversationTypes:e,levels:t,isMentioned:!1}),n),[4,i.getTotalUnreadCountByLevels(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Dt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Dt,JSON.stringify({code:s}),n),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function Yr(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(Jt,Dt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!0).validate("levels",t,(function(e){return!!f(e)&&!e.some((function(e){return!p(e)}))}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c;return W(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Jt,JSON.stringify({conversationTypes:e,levels:t,isMentioned:!0}),n),[4,i.getTotalUnreadCountByLevels(e,t,!0)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Dt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Dt,JSON.stringify({code:s}),n),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function qr(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Bt,kt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Bt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getUnreadCount(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(kt,JSON.stringify({code:d,data:u})),[2,{code:d,data:u}]):(i.warn(kt,JSON.stringify({code:d})),[2,{code:d,msg:wr[d]}])}}))}))}))]}))}))}function Kr(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(xt,Ht).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(xt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearUnreadCount(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Ht,JSON.stringify({code:c}),s),c!==r.SUCCESS?[2,{code:c,msg:wr[c]}]:[2,{code:c}]}}))}))}))]}))}))}function zr(){return j(this,void 0,void 0,(function(){var e=this;return W(this,(function(t){return[2,new T("","").ifReady((function(t,n){return j(e,void 0,void 0,(function(){var e;return W(this,(function(i){switch(i.label){case 0:return e=n.createTraceId(),n.info(Vt,"",e),[4,t.clearAllUnreadCount()];case 1:return[2,{code:i.sent()}]}}))}))}))]}))}))}Ur.ROAMING_SERVICE_UNAVAILABLE.code;var jr=function(e,t,n,i){return void 0===i&&(i=""),j(void 0,void 0,void 0,(function(){var o,a;return W(this,(function(s){switch(s.label){case 0:return o=function(e,t,n){void 0===n&&(n="");var i="conversationType:"+t.conversationType+",targetId:"+t.targetId;return e.debug(h.O,n+" -> "+i),i}(e,t,i),[4,n()];case 1:return(a=s.sent())!==r.SUCCESS?(e.warn(h.O,i+" fail -> "+a+" : "+wr[a]+" , "+o),[2,{code:a,msg:wr[a]}]):[2,{code:a}]}}))}))};function Wr(e,t){return j(this,void 0,void 0,(function(){return W(this,(function(n){return[2,new T(Ft,Yt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationLevel",t,(function(e){return void 0!==N[e]}),!0).ifReady((function(n,i){return jr(i,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]}))}))}function Qr(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T($n,ei).validate("conversations",e,(function(e){if(!_("conversations",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("conversations",i,v.OBJECT,!0)&&_("conversations.targetId",i.targetId,v.STRING,!0)&&_("conversations.conversationType",i.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(Zn,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).validate("notificationLevel",t,(function(e){return[-1,0,1,2,3,4,5].includes(e)}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),a=o.createTraceId(),o.info($n,"conversations: "+JSON.stringify(n),a),[4,i.batchSetConversationNotificationLevel(n,t)];case 1:return s=c.sent(),o[r.SUCCESS===s?"info":"warn"](ei,"code: "+s,a),[2,{code:s}]}}))}))}))]}))}))}function Xr(e,t){return j(this,void 0,void 0,(function(){return W(this,(function(n){return[2,new T(Xt,Zt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationStatus",t,(function(e){return 1===e||2===e}),!0).ifReady((function(n,i){return jr(i,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]}))}))}function Zr(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(jt,jt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(zt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationNotificationLevel(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(jt,JSON.stringify({code:d,data:u}),s),[2,{code:d,data:u}]):(i.warn(jt,JSON.stringify({code:d}),s),[2,{code:d,msg:wr[d]}])}}))}))}))]}))}))}function $r(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Wt,Qt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Wt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationNotificationStatus(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Qt,JSON.stringify({code:d,data:u}),s),[2,{code:d,data:u}]):(i.warn(Qt,JSON.stringify({code:d}),s),[2,{code:d,msg:wr[d]}])}}))}))}))]}))}))}function ea(){return j(this,void 0,void 0,(function(){return W(this,(function(e){return[2,new T("","").ifReady((function(e){return e.getBlockConversationList()}))]}))}))}function ta(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(qt,Kt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("isTop",t,v.BOOLEAN).validate("isUpdateTime",n,v.BOOLEAN).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:return i=e.conversationType,s=e.targetId,c=e.channelId,d=a.createTraceId(),a.info(qt,JSON.stringify({conversationType:i,targetId:s,channelId:c,isTop:t}),d),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId,n)];case 1:return u=v.sent(),l=u===r.SUCCESS?"info":"warn",a[l](Kt,JSON.stringify({code:u}),d),u!==r.SUCCESS?[2,{code:u,msg:wr[u]}]:[2,{code:u}]}}))}))}))]}))}))}function na(e,t,n){return j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(ti,ni).validate("conversations",e,(function(e){if(!_("conversations",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("conversations",i,v.OBJECT,!0)&&_("conversations.targetId",i.targetId,v.STRING,!0)&&_("conversations.conversationType",i.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(Zn,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).validate("isTop",t,v.BOOLEAN,!0).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,s,c;return W(this,(function(d){switch(d.label){case 0:return i=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),s=a.createTraceId(),a.info(ti,"conversations: "+JSON.stringify(i),s),[4,o.batchSetConversationToTop(i,t,n)];case 1:return c=d.sent(),a[r.SUCCESS===c?"info":"warn"](ni,"code: "+c,s),[2,{code:c}]}}))}))}))]}))}))}function ia(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(pt,mt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))})).validate("channelId",t,v.CHANNEL_ID).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(pt,JSON.stringify({conversationTypes:e,channelId:t}),n),[4,i.getTopConversationList(e,t)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.map((function(e){return d.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId}),xe(e)})),o.info(mt,JSON.stringify({code:s,list:d}),n),[2,{code:0,data:u}]):(o.warn(h.A_GET_TOP_CONVERSATION_LIST_E,JSON.stringify({code:s}),n),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function oa(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T($t,en).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))})).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return t=i.createTraceId(),i.info($t,JSON.stringify({conversationTypes:e}),t),[4,n.getUnreadConversationList(e)];case 1:return o=u.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(c=[],d=s.map((function(e){return c.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,unreadMessageCount:e.unreadMessageCount}),xe(e)})),i.info(en,JSON.stringify({code:a,list:c}),t),[2,{code:0,data:d}]):(i.warn(en,JSON.stringify({code:a}),t),[2,{code:a,msg:wr[a]}])}}))}))}))]}))}))}function ra(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Wt,Qt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s;return W(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(tn,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),t),[4,n.getUnreadMentionedCount(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(nn,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(nn,JSON.stringify({code:a}),t),[2,{code:a}])}}))}))}))]}))}))}function aa(){return j(this,void 0,void 0,(function(){var e=this;return W(this,(function(t){return[2,new T("","").ifReady((function(t,n){return j(e,void 0,void 0,(function(){var e,i,o,a;return W(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(on,"",e),[4,t.getAllUnreadMentionedCount()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.warn(rn,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):[2,{code:o}]}}))}))}))]}))}))}function sa(){return j(this,void 0,void 0,(function(){var e=this;return W(this,(function(t){return[2,new T("","").ifReady((function(t,n){return j(e,void 0,void 0,(function(){var e,i,o,a,s;return W(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(an,"",e),[4,t.getAllConversationState()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Kt,JSON.stringify({code:o}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o}]}}))}))}))]}))}))}function ca(e){return void 0===e&&(e={}),j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Io,To).validate("targetId",null==e?void 0:e.targetId,v.STRING,!1).validate("channelType",null==e?void 0:e.channelType,(function(e){return void 0!==E[e]}),!1).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s;return W(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Io,JSON.stringify({targetId:e.targetId,channelType:e.channelType}),t),[4,n.getUltraGroupList(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(To,JSON.stringify({code:a,length:null==s?void 0:s.length}),t),[2,{code:r.SUCCESS,data:s}]):(i.warn(To,JSON.stringify({code:a}),t),[2,{code:a,msg:wr[a]}])}}))}))}))]}))}))}function da(){return j(this,void 0,void 0,(function(){var e=this;return W(this,(function(t){return[2,new T("","").ifReady((function(t,n){return j(e,void 0,void 0,(function(){var e,i,o,a;return W(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(_o,"",e),[4,t.getBlockUltraGroupList()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.info(mo,JSON.stringify({code:o,length:null==a?void 0:a.length}),e),[2,{code:r.SUCCESS,data:a}]):(n.warn(mo,JSON.stringify({code:o}),e),[2,{code:o,msg:wr[o]}])}}))}))}))]}))}))}function ua(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(po,No).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a;return W(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(po,JSON.stringify({targetId:e.targetId,channelId:e.channelId}),t),[4,n.sendUltraGroupTypingStatus(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](No,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:o,msg:wr[o]}]}}))}))}))]}))}))}function la(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(Eo,yo).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messages",t,v.ARRAY,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h;return W(this,(function(I){switch(I.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),d={targetId:n,conversationType:a,messages:c},u=o.createTraceId(),o.info(Eo,JSON.stringify(d),u),[4,i.getUltraGroupMessageListByMessageUId(d)];case 1:if(l=I.sent(),v=l.code,f=l.data,v===r.SUCCESS){for(h in g={},S=[],f)S.push(h),g[h]=f[h]?ke(f[h]):void 0;return o.info(yo,JSON.stringify({code:v,messageUIds:S}),u),[2,{code:r.SUCCESS,data:g}]}return o.warn(yo,JSON.stringify({code:v}),u),[2,{code:v,msg:wr[v]}]}}))}))}))]}))}))}function va(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(Ro,Co).validate("expansion",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g;return W(this,(function(S){switch(S.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l=o.createTraceId(),o.info(Ro,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:u}),l),v={targetId:a,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:s,expansion:e},[4,i.expandUltraMessage(v)];case 1:return f=S.sent().code,g=f===r.SUCCESS?"info":"warn",o[g](Co,JSON.stringify({code:f}),l),f===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:f,msg:wr[f]}]}}))}))}))]}))}))}function fa(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(Oo,Ao).validate("expansion",e,v.ARRAY,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g;return W(this,(function(S){switch(S.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l=o.createTraceId(),o.info(Oo,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:u}),l),v={targetId:a,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:s,keys:e},[4,i.expandUltraMessage(v)];case 1:return f=S.sent().code,g=f===r.SUCCESS?"info":"warn",o[g](Ao,JSON.stringify({code:f}),l),f===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:f,msg:wr[f]}]}}))}))}))]}))}))}function ga(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Uo,wo).validate("message",e,v.OBJECT,!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,v,f;return W(this,(function(g){switch(g.label){case 0:return t=e.conversationType,o=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,d=e.channelId,u=i.createTraceId(),i.info(Uo,JSON.stringify({conversationType:t,targetId:o,messageUId:a,channelId:d}),u),l={targetId:o,channelId:d,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return v=g.sent().code,f=v===r.SUCCESS?"info":"warn",i[f](wo,JSON.stringify({code:v}),u),v===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:v,msg:wr[v]}]}}))}))}))]}))}))}function Sa(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(Po,Po).validate("content",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S;return W(this,(function(h){switch(h.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,d=t.sentTime,u=t.canIncludeExpansion,l=t.channelId,v=o.createTraceId(),o.info(Mo,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:l}),v),f={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:d,canIncludeExpansion:u,messageUId:s,content:e},[4,i.modifyMessage(f)];case 1:return g=h.sent().code,S=g===r.SUCCESS?"info":"warn",o[S](Po,JSON.stringify({code:g}),v),g===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:g,msg:wr[g]}]}}))}))}))]}))}))}function ha(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(bo,bo).validate("targetId",e,v.STRING,!0).validate("notificationLevels",t,v.ARRAY).validate("notificationLevels",t,(function(e){return!(null==t?void 0:t.some((function(e){return!p(e)})))})).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c;return W(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(bo,JSON.stringify({targetId:e,notificationLevels:t}),n),[4,i.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Lo,JSON.stringify({code:s,data:c}),e),[2,{code:r.SUCCESS,data:c}]):(o.warn(Lo,JSON.stringify({code:s}),n),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function Ia(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Go,Jo).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s;return W(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Go,JSON.stringify({targetId:e.targetId,channelId:e.channelId}),t),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Jo,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(Jo,JSON.stringify({code:a}),t),[2,{code:a,msg:wr[a]}])}}))}))}))]}))}))}function Ta(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return e.channelId=e.channelId||"",[2,new T(Do,Bo).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationLevel",t,(function(e){return void 0!==N[e]}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(Do,JSON.stringify({targetId:e.targetId,channelId:e.channelId,notificationLevel:t}),n),[4,i.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](Bo,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:wr[a]}]}}))}))}))]}))}))}function _a(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(ko,xo).validate("targetId",e,v.STRING,!0).validate("notificationLevels",t,v.ARRAY).validate("notificationLevels",t,(function(e){return!(null==t?void 0:t.some((function(e){return!p(e)})))})).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(ko,JSON.stringify({targetId:e,notificationLevels:t}),n),[4,i.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](xo,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]}}))}))}))]}))}))}function ma(){return j(this,void 0,void 0,(function(){var e=this;return W(this,(function(t){return[2,new T(Ho,Vo).ifReady((function(t,n){return j(e,void 0,void 0,(function(){var e,i,o,a,s;return W(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(Ho,"getAllUltraGroupUnreadCount",e),[4,t.getAllUltraGroupUnreadCount()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Vo,JSON.stringify({code:o,data:a}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o,msg:wr[o]}]}}))}))}))]}))}))}function pa(){return j(this,void 0,void 0,(function(){var e=this;return W(this,(function(t){return[2,new T(Fo,Yo).ifReady((function(t,n){return j(e,void 0,void 0,(function(){var e,i,o,a,s;return W(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(Fo,"getAllUltraGroupUnreadCount",e),!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Yo,JSON.stringify({code:o,data:a}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o,msg:wr[o]}]}}))}))}))]}))}))}function Na(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return e.channelId=e.channelId||"",[2,new T(qo,Ko).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("sentTime",null==e?void 0:e.sentTime,v.NUMBER,!0).validate("count",null==e?void 0:e.count,(function(e){return y(e)&&e>0&&e<=50}),!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,v;return W(this,(function(f){switch(f.label){case 0:return t=e.targetId,o=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:o,sentTime:a,count:s},d=i.createTraceId(),i.info(qo,JSON.stringify(c),d),[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),l=u.code,v=u.data,l===r.SUCCESS?(i.info(Ko,JSON.stringify({code:l,data:null==v?void 0:v.map((function(e){return e.messageUId}))}),d),[2,{code:l,data:v}]):(i.warn(Ko,JSON.stringify({code:l}),d),[2,{code:l,msg:wr[l]}])}}))}))}))]}))}))}function Ea(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(qo,Ko).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID,!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return t=e.targetId,o=e.channelId,a={targetId:t,channelId:o},s=i.createTraceId(),i.info(zo,JSON.stringify(a),s),[4,n.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(jo,JSON.stringify({code:d,sentTime:null==u?void 0:u.sentTime}),s),[2,{code:d,data:u}]):(i.warn(jo,JSON.stringify({code:d}),s),[2,{code:d,msg:wr[d]}])}}))}))}))]}))}))}function ya(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Wo,Qo).validate("targetIds",e,(function(t){return!!_("targetIds",e,v.ARRAY,!0)&&(!(t.length<=0||t.length>20)&&!e.some((function(e){return!R(e)})))})).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return t=e.filter((function(t,n){return e.indexOf(t)===n})),o=i.createTraceId(),i.info(Wo,JSON.stringify({targetIds:e}),o),[4,n.getUltraGroupUnreadInfoList(t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",i[d](Qo,JSON.stringify({code:s}),o),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:wr[s]}]}}))}))}))]}))}))}function Ra(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(h.A_JOIN_CHATROOM_T,h.A_JOIN_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",t,v.OBJECT,!0).validate("count",null==t?void 0:t.count,v.NUMBER,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,i.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:wr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function Ca(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(h.A_JOIN_CHATROOM_T,h.A_JOIN_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",null==t?void 0:t.count,v.NUMBER,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,i.joinExistChatroom(e,t.count,n)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](h.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==r.SUCCESS?[2,{code:s,msg:wr[s]}]:[2,{code:s,data:c}]}}))}))}))]}))}))}function Oa(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(h.A_QUIT_CHATROOM_T,h.A_QUIT_CHATROOM_R).validate("targetId",e,v.STRING,!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a;return W(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(h.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](h.A_QUIT_CHATROOM_R,JSON.stringify({code:o}),t),o!==r.SUCCESS?[2,{code:o,msg:wr[o]}]:[2,{code:o}]}}))}))}))]}))}))}function Aa(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(h.A_QUIT_CHATROOM_T,h.A_QUIT_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",null==t?void 0:t.count,v.NUMBER).validate("order",null==t?void 0:t.order,(function(e){return[0,1,2].includes(e)})).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(Xe,JSON.stringify({chatroomId:e,count:null==t?void 0:t.count,order:null==t?void 0:t.order}),n),[4,i.getChatroomInfo(e,null==t?void 0:t.count,null==t?void 0:t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](Ze,JSON.stringify({code:s}),n),s===r.SUCCESS&&c?[2,{code:s,data:c}]:[2,{code:s,msg:wr[s]}]}}))}))}))]}))}))}function Ua(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T($e,et).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("value",null==t?void 0:t.value,v.STRING,!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info($e,JSON.stringify({chatroomId:e,key:t.key,value:t.value,isSendNotification:t.isSendNotification,isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra}),n),[4,i.setChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](et,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:wr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function wa(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(nt,it).validate("targetId",e,v.STRING,!0).validate("entries",null==t?void 0:t.entries,(function(e){return!!_("entry.key",e,v.ARRAY,!0)&&t.entries.every((function(e){return _("entry.key",e.key,v.STRING,!0)&&_("entry.value",e.value,v.STRING,!0)}))}),!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isForce",null==t?void 0:t.isForce,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return t.entries.length>10?[2,Ur.CHATROOM_KV_STORE_OUT_LIMIT]:(n=o.createTraceId(),o.info(nt,JSON.stringify({chatroomId:e,entries:t.entries.map((function(e){return{key:e.key,value:e.value}})),isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra,isForce:t.isForce}),n),[4,i.setChatroomEntries(e,t)]);case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](it,JSON.stringify({code:s}),n),s!==r.SUCCESS?[2,{code:s,msg:wr[s],data:c}]:[2,{code:s}]}}))}))}))]}))}))}function Ma(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(ot,rt).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("value",null==t?void 0:t.value,v.STRING,!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ot,JSON.stringify({chatroomId:e,key:t.key,value:t.value,isSendNotification:t.isSendNotification,isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra}),n),[4,i.forceSetChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](rt,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:wr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function Pa(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(at,st).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(at,JSON.stringify({chatroomId:e,key:t.key,isSendNotification:t.isSendNotification,notificationExtra:t.notificationExtra}),n),[4,i.removeChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](st,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:wr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function ba(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(ct,dt).validate("targetId",e,v.STRING,!0).validate("entries",null==t?void 0:t.entries,(function(e){return!!_("entry.key",e,v.ARRAY,!0)&&t.entries.every((function(e){return _("key",e,v.STRING,!0)}))}),!0).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return n=t.entries.map((function(e){return{key:e}})),a=o.createTraceId(),o.info(ct,JSON.stringify({chatroomId:e,notificationExtra:t.notificationExtra,entries:n}),a),[4,i.removeChatroomEntries(e,{entries:n,notificationExtra:t.notificationExtra})];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",o[u](dt,JSON.stringify({code:c}),a),c!==r.SUCCESS?[2,{code:c,msg:wr[c],data:d}]:[2,{code:c}]}}))}))}))]}))}))}function La(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(ut,lt).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ut,JSON.stringify({chatroomId:e,key:t.key,isSendNotification:t.isSendNotification,notificationExtra:t.notificationExtra}),n),[4,i.forceRemoveChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](lt,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:wr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function Ga(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(vt,ft).validate("targetId",e,v.STRING,!0).validate("key",t,(function(e){return R(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c;return W(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(vt,JSON.stringify({chatroomId:e,key:t}),n),[4,i.getChatroomEntry(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(o.info(ft,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(ft,JSON.stringify({code:s}),n),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function Ja(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(gt,St).validate("targetId",e,v.STRING,!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s;return W(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(gt,JSON.stringify({chatroomId:e}),t),[4,n.getAllChatroomEntries(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(i.info(St,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(St,JSON.stringify({code:a}),t),[2,{code:a,msg:wr[a]}])}}))}))}))]}))}))}function Da(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(ht,It).validate("targetId",e,v.STRING,!0).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(ht,JSON.stringify({chatroomId:e,timestamp:t.timestamp,count:t.count,order:t.order}),n),[4,i.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),ke(e)})),o.info(It,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(o.warn(It,JSON.stringify({code:s}),n),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function Ba(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Tt,_t).validate("targetId",null==e?void 0:e.chatRoomId,v.STRING,!0).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,v.STRING,!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a;return W(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Tt,JSON.stringify({chatRoomId:e.chatRoomId,rtcRoomId:e.rtcRoomId}),t),[4,n.bindRTCRoomForChatroom(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](_t,JSON.stringify({code:o}),t),[2,{code:o,msg:wr[o]}]}}))}))}))]}))}))}function ka(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Fe,Ye).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a;return W(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Fe,JSON.stringify({userId:e}),t),[4,n.addToBlacklist(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](Ye,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]}))}))}function xa(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(qe,Ke).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a;return W(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(qe,JSON.stringify({userId:e}),t),[4,n.removeFromBlacklist(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](Ke,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]}))}))}function Ha(){return j(this,void 0,void 0,(function(){var e=this;return W(this,(function(t){return[2,new T(ze,je).ifReady((function(t,n){return j(e,void 0,void 0,(function(){var e,i,o,a;return W(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(ze,"getBlacklist -> ",e),[4,t.getBlacklist()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS&&a?(n.info(je,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):(n.warn(je,JSON.stringify({code:o}),e),[2,{code:o}])}}))}))}))]}))}))}function Va(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(We,Qe).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s;return W(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(We,JSON.stringify({userId:e}),t),[4,n.getBlacklistStatus(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Qe,JSON.stringify({code:a,data:0===s}),t),[2,{code:a,data:0===s}]):(i.warn(Qe,JSON.stringify({code:a}),t),[2,{code:a}])}}))}))}))]}))}))}var Fa=function(e,t,n,i){void 0===n&&(n=!0),void 0===i&&(i=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=i};function Ya(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(i){return new Fa(e,i,t,n)}}var qa,Ka=Ya("RC:ImgMsg"),za=Ya("RC:HQVCMsg"),ja=Ya("RC:SightMsg"),Wa=Ya("RC:TxtMsg"),Qa=Ya("RC:CombineMsg"),Xa=Ya(C.COMBINE_V2),Za=Ya("RC:FileMsg"),$a=Ya("RC:GIFMsg"),es=Ya("RC:VcMsg"),ts=Ya("RC:LBSMsg"),ns=Ya("RC:ReferenceMsg"),is=Ya("RC:ImgTextMsg"),os=Ya("RC:CmdMsg"),rs=Ya("RC:InfoNtf"),as=Ya("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(qa||(qa={}));var ss,cs=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._isAbort=!1,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.isAbort=function(){return this._isAbort},e.prototype.abort=function(){this._isAbort=!0,this._abortHandler()},e.prototype.upload=function(e){return e.file.size>O?Promise.resolve({code:r.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>A&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),ds=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return K(n,t),n.prototype.commonUpload=function(t){return j(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),this._promise=e({url:w(this._url),headers:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.QINIU}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return j(this,void 0,void 0,(function(){return W(this,(function(e){throw new Error("Method not implemented.")}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(cs),us=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return K(n,t),n.prototype.commonUpload=function(t){return j(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=w(a.ossBucketName+"."+this._url),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),this._promise=e({url:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.ALI}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(cs),ls=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return K(n,t),n.prototype.commonUpload=function(t){return j(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,a=t.contentDisposition,v.label=1;case 1:return v.trys.push([1,3,,4]),[4,this._getFileToken(o<=M.FILE?o:M.FILE)];case 2:return s=v.sent(),[3,4];case 3:return[2,{code:v.sent()}];case 4:return c=a||("text/html"===n.type?"inline":"attachment"),d={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":c+"; filename="+encodeURIComponent(n.name)+";"},u=w(""+this._url+s.path),this._promise=e({url:u,headers:d,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:n,timeout:0}),[4,this._promise.result()];case 5:return l=v.sent().status,this._promise=null,200===l||204===l?[2,{code:r.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:u}}]:[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(cs),vs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return K(n,t),n.prototype.commonUpload=function(t){return j(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=w(this._url+"/"+a.minioBucketName+"/"+a.fileName),c=this.getBaseHeaders(n,a,t),this._promise=e({url:s,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return j(this,void 0,void 0,(function(){var i,o,a,s,c,d,u,l,v,f,g,S,h,I,T,_;return W(this,(function(m){switch(m.label){case 0:i=t.file,o=t.fileType,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,this._getFileToken(o,i.name,"POST","uploads")];case 2:return a=m.sent(),[3,4];case 3:return[2,{code:m.sent()}];case 4:return s=w(this._url+"/"+a.minioBucketName+"/"+a.fileName),c=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploads",headers:c,method:"POST"}),[4,this._promise.result()];case 5:return d=m.sent(),u=d.status,l=d.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!v?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,i,v,a.fileName,t,f)]);case 6:if(g=m.sent(),S=g.code,h=g.msg,S!==r.SUCCESS)return[2,{code:S,msg:h}];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=m.sent(),[3,10];case 9:return[2,{code:m.sent()}];case 10:return I=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),I="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+I+"</CompleteMultipartUpload>",T=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploadId="+v,headers:T,method:"POST",body:I,timeout:0}),[4,this._promise.result()];case 11:return _=m.sent().status,this._promise=null,200===_||204===_?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,i,o,a,s,c,d){return void 0===c&&(c=1),void 0===d&&(d=0),j(this,void 0,void 0,(function(){var u,l,v,f,g,S,h,I,T;return W(this,(function(_){switch(_.label){case 0:if(d>=5)return[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];u=(c-1)*A,l=Math.min(A,n.size-u),v="partNumber="+c+"&uploadId="+i,_.label=1;case 1:return _.trys.push([1,3,,4]),[4,this._getFileToken(a.fileType,o,"PUT",v)];case 2:return f=_.sent(),[3,4];case 3:return[2,{code:_.sent()}];case 4:return g=n.slice(u,c*A),S=this.getBaseHeaders(n,f,a),this._promise=e({url:t+"?"+v,headers:S,method:"PUT",body:g,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,u+e.loaded,n.size)}}),[4,this._promise.result()];case 5:return h=_.sent(),I=h.status,T=h.xhr,this._promise=null,200===I||204===I?(s.push((null==T?void 0:T.getResponseHeader("ETag"))||""),u+l<n.size?[2,this.requestUploadPart(t,n,i,o,a,s,c+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(t,n,i,o,a,s,c,d+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(cs),fs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e._promise=null,e}return K(n,t),n.prototype.commonUpload=function(t){return j(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l,v,f;return W(this,(function(g){switch(g.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,g.label=1;case 1:return g.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=g.sent(),[3,4];case 3:return[2,{code:g.sent()}];case 4:return s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),d=w(this._url),this._promise=e({url:d,headers:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return u=g.sent(),l=u.status,v=u.data,this._promise=null,200!==l&&204!==l||!v?[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]:(f=JSON.parse(v),[2,{code:r.SUCCESS,data:{uniqueName:f.rc_url.file_name,downloadUrl:d+"/"+f.rc_url.path}}])}}))}))},n.prototype.multipartUpload=function(e){return j(this,void 0,void 0,(function(){var t,n,i,o,r;return W(this,(function(a){switch(a.label){case 0:t=e.file,n=e.onProgress,i=e.fileType,o=P(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this._getFileToken(i,t.name)];case 2:return r=a.sent(),[3,4];case 3:return[2,{code:a.sent()}];case 4:return[2,this._requestUploadPart(o,t,r.token,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,i,o,a){return void 0===a&&(a=0),j(this,void 0,void 0,(function(){var s,c,d,u,l,v,f,g,S,h;return W(this,(function(I){switch(I.label){case 0:return s=Math.min(A,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),d={Range:"bytes="+a+"-"+(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},u=n.slice(a,a+s),(l=new FormData).set("file",u,n.name),l.set("key",c),l.set("name",c),l.set("token",i),v=w(this._url),this._promise=e({url:v,headers:d,onProgress:function(e){return null==o?void 0:o(a+e.loaded,n.size)},method:"POST",body:l,timeout:0}),[4,this._promise.result()];case 1:return f=I.sent(),g=f.status,S=f.data,this._promise=null,200===g||204===g?a+s<n.size?[2,this._requestUploadPart(t,n,i,o,a+s)]:(h=JSON.parse(S),[2,{code:r.SUCCESS,data:{uniqueName:h.rc_url.file_name,downloadUrl:v+"/"+h.rc_url.path}}]):[2,{code:r.UPLOAD_FAIL,msg:g.toString()}]}}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(cs),gs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return K(n,t),n.prototype.commonUpload=function(t){return j(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l,v;return W(this,(function(f){switch(f.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,a=t.contentDisposition,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return s=f.sent(),[3,4];case 3:return[2,{code:f.sent()}];case 4:return c={},d=w(s.s3BucketName+"."+this._url),u=new FormData,a?u.set("Content-Disposition",a):u.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),u.set("Content-Type",n.type),u.set("x-amz-credential",s.s3Credential),u.set("x-amz-algorithm",s.s3Algorithm),u.set("x-amz-date",s.s3Date),u.set("policy",s.s3Policy),u.set("x-amz-signature",s.s3Signature),u.set("key",s.fileName),u.set("file",n),this._promise=e({url:d,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:u,timeout:0}),[4,this._promise.result()];case 5:return l=f.sent(),v=l.status,l.data,this._promise=null,200===v||204===v?[2,{code:r.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:U.AWS}}]:[2,{code:r.UPLOAD_FAIL,msg:v.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(cs),Ss=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return K(n,t),n.prototype.commonUpload=function(t){return j(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=w(this._url+"/"+a.stcBucketName+"/"+a.fileName),c=this.getBaseHeaders(n,a,t),this._promise=e({url:s,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.STC}}]:[2,{code:r.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return j(this,void 0,void 0,(function(){var i,o,a,s,c,d,u,l,v,f,g,S,h,I,T,_;return W(this,(function(m){switch(m.label){case 0:i=t.file,t.onProgress,o=t.fileType,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,this._getFileToken(o,i.name,"POST","uploads")];case 2:return a=m.sent(),[3,4];case 3:return[2,{code:m.sent()}];case 4:return s=w(this._url+"/"+a.stcBucketName+"/"+a.fileName),c=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploads",headers:c,method:"POST"}),[4,this._promise.result()];case 5:return d=m.sent(),u=d.status,l=d.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!v?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,i,v,a.fileName,t,f)]);case 6:if(g=m.sent(),S=g.code,h=g.msg,S!==r.SUCCESS)return[2,{code:S,msg:h}];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=m.sent(),[3,10];case 9:return[2,{code:m.sent()}];case 10:return I=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),I="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+I+"</CompleteMultipartUpload>",T=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploadId="+v,headers:T,method:"POST",body:I}),[4,this._promise.result()];case 11:return _=m.sent().status,this._promise=null,200===_||204===_?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.STC}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,i,o,a,s,c,d){return void 0===c&&(c=1),void 0===d&&(d=0),j(this,void 0,void 0,(function(){var u,l,v,f,g,S,h,I,T;return W(this,(function(_){switch(_.label){case 0:if(d>=5)return[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];u=(c-1)*A,l=Math.min(A,n.size-u),v="partNumber="+c+"&uploadId="+i,_.label=1;case 1:return _.trys.push([1,3,,4]),[4,this._getFileToken(a.fileType,o,"PUT",v)];case 2:return f=_.sent(),[3,4];case 3:return[2,{code:_.sent()}];case 4:return g=n.slice(u,c*A),S=this.getBaseHeaders(n,f,a),this._promise=e({url:t+"?"+v,headers:S,method:"PUT",body:g,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,u+e.loaded,n.size)},timeout:0}),[4,this._promise.result()];case 5:return h=_.sent(),I=h.status,h.data,T=h.xhr,this._promise=null,200===I||204===I?(s.push((null==T?void 0:T.getResponseHeader("ETag"))||""),u+l<n.size?[2,this.requestUploadPart(t,n,i,o,a,s,c+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(t,n,i,o,a,s,c,d+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(cs);var hs=((ss={})[qa.QINIU]=ds,ss[qa.ALIYUN]=us,ss[qa.BAIDU]=ls,ss[qa.S3]=gs,ss[qa.STC]=Ss,ss[qa.MINIO]=vs,ss[qa.RCX]=fs,ss);function Is(e,t,n,i){var o=document.createElement("canvas"),a=o.getContext("2d"),s=new Image;s.onload=function(t){var c=i||{},d=c.maxHeight,u=void 0===d?160:d,l=c.maxWidth,v=void 0===l?160:l,f=c.quality,g=void 0===f?.7:f,S=c.scale,h=void 0===S?1:S,I=_s(s.width,s.height,{maxHeight:u,maxWidth:v,scale:h});o.width=Math.min(I.w,v),o.height=Math.min(I.h,u),a.drawImage(s,I.x,I.y,I.w,I.h);var T=Ts(o,g);T=T.replace(/data:image\/[^;]+;base64,/,""),e({code:r.SUCCESS,data:z(z({},n),{thumbnail:T,width:I.w,height:I.h})})},s.onerror=function(t){e({code:r.UPLOAD_FAIL,msg:"get image info fail:"+JSON.stringify(t)})},s.src=(window.URL||window.webkitURL).createObjectURL(t)}function Ts(e,t){var n=e.toDataURL("image/jpeg",t);return n.length>b-10240?Ts(e,t-.1):n}var _s=function(e,t,n){var i,o,r=n.maxHeight,a=void 0===r?160:r,s=n.maxWidth,c=void 0===s?160:s,d=n.scale,u=e<t,l=0,v=0;return(u?t/e:e/t)>(void 0===d?1:d)?(u?(i=100,v=((o=t/(e/100))-a)/2):(o=100,l=((i=e/(t/100))-c)/2),{w:i,h:o,x:-l,y:-v}):(u?(o=a,i=e/(t/a)):(i=c,o=t/(e/c)),{w:i,h:o,x:-l,y:-v})},ms=0,ps=function(){function e(e,t){this._client=null,this.id=++ms,this._promise=this._handleUpload(e,t)}return e.prototype.abort=function(){var e;this._resolve({code:r.UPLOAD_FAIL,msg:"upload abort"}),null===(e=this._client)||void 0===e||e.abort()},e.prototype._uploadInLoop=function(e,t,n,i,o){return void 0===o&&(o=[]),j(this,void 0,void 0,(function(){var a,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:a=0,v.label=1;case 1:return a<e.length?(s=e[a],this._client=new hs[s.type](s.url,n,i),[4,this._client.upload(t)]):[3,4];case 2:if(c=v.sent(),d=c.code,u=c.data,l=c.msg,d===r.SUCCESS)return[2,{code:d,data:u}];if(this._client.isAbort())return this._client=null,[2,{code:d,data:u,msg:l}];this._client=null,o.push({type:s.type,url:s.url,code:d,msg:l}),v.label=3;case 3:return a++,[3,1];case 4:return[2,{code:r.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: "+JSON.stringify(o)}]}}))}))},e.prototype._handleUpload=function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new Promise((function(i){return j(n,void 0,void 0,(function(){var n,o,a,s,c,d,u,l,v,f,g,S,h,I,T,_,m,p,N;return W(this,(function(E){switch(E.label){case 0:return this._resolve=i,n=t.getFileToken,o=t.serverType,a=t.customDomain,s=t.ossConfig,c=t.uploadServer,d=t.bosAddr,u=e.file,l=e.fileType,v=e.thumbnailConfig,f=function(e,t,n,i,o){if(n)return[{type:qa.RCX,url:n,p:"1"}];if(e)return JSON.parse(e).map((function(e){var t={type:qa.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}));var r=[];return i&&r.push({type:qa.QINIU,url:i,p:"1"}),o&&r.push({type:qa.BAIDU,url:o,p:"2"}),r}(s,0,a,c,d),0===f.length?(i({code:r.INVALID_PARAMETER_MEDIA_URL,msg:"uploadUrlList is empty"}),[2]):[4,this._uploadInLoop(f,e,n,o)];case 1:if(g=E.sent(),S=g.code,h=g.data,I=g.msg,S!==r.SUCCESS||!h)return i({code:S,msg:I}),[2];if(T=h.downloadUrl)return[3,5];E.label=2;case 2:return E.trys.push([2,4,,5]),[4,t.getFileUrl(l,h.uniqueName,u.name,void 0,h.uploadMethod)];case 3:return _=E.sent(),T=_.downloadUrl,[3,5];case 4:return m=E.sent(),i({code:m,msg:"Get download url fail"}),[3,5];case 5:return T?(p={downloadUrl:T,uniqueName:(null==h?void 0:h.uniqueName)||"",name:u.name,size:u.size,type:u.type},l!==M.AUDIO?[3,7]:[4,u.arrayBuffer()]):(i({code:r.UPLOAD_FAIL,msg:"Get download url fail"}),[2]);case 6:return N=E.sent(),function(e,t,n){(new AudioContext).decodeAudioData(t,(function(t){e({code:r.SUCCESS,data:z(z({},n),{duration:t.duration,length:t.length})})}),(function(t){e({code:r.UPLOAD_FAIL,msg:"get audio info fail:"+JSON.stringify(t)})}))}(i,N,p),[2];case 7:return l===M.IMAGE?(Is(i,u,p,v),[2]):(i({code:S,data:p}),[2])}}))}))}))]}))}))},e.prototype.awaitResult=function(){return j(this,void 0,void 0,(function(){return W(this,(function(e){return[2,this._promise]}))}))},e}(),Ns={};function Es(e,t){var n=new ps(e,t);return function(e){j(this,void 0,void 0,(function(){return W(this,(function(t){switch(t.label){case 0:return Ns[e.id]=e,[4,e.awaitResult()];case 1:return t.sent(),delete Ns[e.id],[2]}}))}))}(n),n}function ys(e){var t=Ns[e];return!!t&&(t.abort(),!0)}var Rs=function(e,t){var n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t.uploadDomain||"",serverType:null==n?void 0:n.type,ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer,bosAddr:null==n?void 0:n.bosAddr}};function Cs(e){return j(this,void 0,void 0,(function(){var t,n,i;return W(this,(function(o){return t=e.contentDisposition,n=e.fileType,i=e.file,[2,new T("","").validate("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",n,(function(e){return!!M[e]}),!0).validate("file",i,(function(e){return e instanceof File&&(!(n===M.IMAGE&&!e.type.match(/^image\//))&&!(n===M.AUDIO&&!e.type.match(/^audio\//)))}),!0).ifReadySync((function(t,n,i){var o=Es(e,Rs(t,i));return{code:r.SUCCESS,data:o}}))]}))}))}function Os(e){return j(this,void 0,void 0,(function(){return W(this,(function(t){return[2,{code:r.SUCCESS,data:ys(e)}]}))}))}function As(e){return j(this,void 0,void 0,(function(){var t,n,i;return W(this,(function(o){return t=e.contentDisposition,n=e.fileType,i=e.file,[2,new T("","").validate("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",n,(function(e){return!!M[e]}),!0).validate("file",i,(function(e){return e instanceof File&&(!(n===M.IMAGE&&!e.type.match(/^image\//))&&!(n===M.AUDIO&&!e.type.match(/^audio\//)))}),!0).ifReady((function(t,n,i){return function(e,t){return j(this,void 0,void 0,(function(){return W(this,(function(n){return[2,new ps(e,t).awaitResult()]}))}))}(e,Rs(t,i))}))]}))}))}function Us(e,t,n,i){return Sr((function(o){return new Promise((function(a){o.getFileToken(e,t,n,i).then((function(e){a({code:r.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:wr[e]})}))}))}))}function ws(e){return new T("","").validate("mediaUrl",e,v.STRING,!0).ifReady((function(t){return new Promise((function(n){t.getFileToken(1,void 0,void 0,void 0,e).then((function(e){var t=e.token,i=e.downloadAuthInfo,o=e.deadline;n({code:r.SUCCESS,data:{token:t,downloadAuthInfo:i,deadline:o}})})).catch((function(e){n({code:e,msg:wr[e]})}))}))}))}function Ms(e,t,n,i,o){return new T("","").validate("fileType",e,L,!0).validate("filename",t,v.STRING).validate("saveName",n,v.STRING).validate("serverType",o,v.NUMBER).ifReady((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,i,o).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))}))}function Ps(e,t,n){return j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("message",t,(function(){return t instanceof Fa}),!0).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("isStatusMessage",null==n?void 0:n.isStatusMessage,v.BOOLEAN).validate("disableNotification",null==n?void 0:n.disableNotification,v.BOOLEAN).validate("pushContent",null==n?void 0:n.pushContent,v.STRING).validate("pushData",null==n?void 0:n.pushData,v.STRING).validate("isMentioned",null==n?void 0:n.isMentioned,v.BOOLEAN).validate("mentionedType",null==n?void 0:n.mentionedType,v.NUMBER).validate("mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,J({itemValidator:D})).validate("directionalUserIdList",null==n?void 0:n.directionalUserIdList,J({maxLength:300,itemValidator:D})).validate("isVoipPush",null==n?void 0:n.isVoipPush,v.BOOLEAN).validate("canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,v.BOOLEAN).validate("expansion",null==n?void 0:n.expansion,v.OBJECT).validate("pushConfig",null==n?void 0:n.pushConfig,v.OBJECT).validate("messageId",null==n?void 0:n.messageId,v.NUMBER).ifReady((function(o,c){return j(i,void 0,void 0,(function(){var i,d,u,l,v,f,g,S,I,T,_,m,p,N,E,y,R,C,O,A,U;return W(this,(function(w){switch(w.label){case 0:return d=(i=n||{}).disableNotification,u=i.isMentioned,l=i.directionalUserIdList,v=i.canIncludeExpansion,f=i.onSendBefore,g=i.expansion,S=i.pushConfig,I=i.isStatusMessage,T=c.createTraceId(),_=e.conversationType,m=e.targetId,p=e.channelId,l&&l.length>0&&![3,10].includes(_)?[2,{code:r.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE}]:(N=function(e,t,n){var i=e.isStatusMessage,o=e.disableNotification,r=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,d=e.mentionedUserIdList,u=e.directionalUserIdList,l=e.isVoipPush,v=e.canIncludeExpansion,f=e.expansion,g=e.isFilerWhiteBlacklist,S=e.pushConfig,h=e.messageId,I=n.channelId;return z({isStatusMessage:i,disableNotification:o,pushContent:r,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:d,directionalUserIdList:u,isVoipPush:l,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:g,pushConfig:S,channelId:I||"",messageId:h},t)}(n||{},t,e),E={isMentioned:!!u,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!d,canIncludeExpansion:!!v,expansion:g||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:o.getCurrentUserId(),messageUId:"",messageDirection:B.SEND,receivedTime:0,isStatusMessage:!!I,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:S,sentStatus:k.SENDING,sentTime:0,directedUserIds:l||[]},_!==s.ULTRA_GROUP&&(E.isOffLineMessage=!1),y=function(e){E.messageId=e;try{f&&f(ke(E))}catch(e){c.error(h.A_SEND_MSG_T,'Callback method "onSendBefore" execution error.\n'+(null==e?void 0:e.stack),T)}},c.info(h.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:_,targetId:m,channelId:p}),T),[4,o.sendMessage(_,m,N,y,T)]);case 1:return R=w.sent(),C=R.code,O=R.data,A=R.msg,C===r.SUCCESS?(c.info(h.A_SEND_MSG_R,JSON.stringify({code:C,messageUId:O.messageUId,messageId:O.messageId}),T),U=ke(O),[2,{code:C,data:U}]):(c.warn(h.A_SEND_MSG_R,JSON.stringify({code:C}),T),E.sentTime=(null==O?void 0:O.sentTime)||0,E.sentStatus=null==O?void 0:O.sentStatus,[2,{code:C,msg:A||wr[C],data:ke(E)}])}}))}))}))]}))}))}function bs(e,t,n){return Ps(e,new Wa(t),n)}function Ls(e,t){return function(n,i,o,a){var s;if(!_("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.INVALID_PARAMETER_SENDOPTIONS});var c={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var d=null===(s=a)||void 0===s?void 0:s.thumbnailConfig;if(!(_("sendOptions.maxHeight",null==d?void 0:d.maxHeight,v.NUMBER)&&_("sendOptions.maxWidth",null==d?void 0:d.maxWidth,v.NUMBER)&&_("sendOptions.quality",null==d?void 0:d.quality,v.NUMBER)&&_("sendOptions.scale",null==d?void 0:d.scale,v.NUMBER)))return Promise.resolve({code:r.INVALID_PARAMETER_SENDOPTIONS});c.thumbnailConfig=d}return Sr((function(s,d,u){return new Promise((function(s){var u=d.createTraceId();d.info(h.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:e}),u),As({file:i.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==o?void 0:o.onProgress)||void 0===n||n.call(o,Math.floor(e/t*100))},contentDisposition:c.contentDisposition,thumbnailConfig:c.thumbnailConfig}).then((function(e){var c,l=e.code,v=e.data,f=e.msg;if(l===r.SUCCESS&&v){var g=(null===(c=null==o?void 0:o.onComplete)||void 0===c?void 0:c.call(o,z({url:v.downloadUrl},v)))||t(v,i);return d.info(h.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:v.downloadUrl,code:r.SUCCESS}),u),void Ps(n,g,a).then(s)}s({code:l,msg:f})}))}))}))}}var Gs=Ls(M.FILE,(function(e,t){var n,i,o={name:e.name,size:t.file.size,type:(n=e.name,i=n.match(/\.(\w+)$/),i?i[1]:"bin"),fileUrl:e.downloadUrl};return t.user&&(o.user=t.user),t.extra&&(o.extra=t.extra),t.mentionedInfo&&(o.mentionedInfo=t.mentionedInfo),new Za(o)})),Js=Ls(M.IMAGE,(function(e,t){var n={content:e.thumbnail,imageUri:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new Ka(n)})),Ds=Ls(M.IMAGE,(function(e,t){var n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new $a(n)})),Bs=Ls(M.AUDIO,(function(e,t){var n={remoteUrl:e.downloadUrl,duration:e.duration,type:e.type};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new za(n)})),ks=Ls(M.SIGHT,(function(e,t){var n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new ja(n)}));function xs(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(h.A_GET_HISTORY_MSG_T,h.A_GET_HISTORY_MSG_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){if(G())return!0;var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(h.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,i.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),ke(e)})),o.info(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:d}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(o.warn(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function Hs(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(si,ci).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(si,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,order:null==t?void 0:t.order}),n),[4,i.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),ke(e)})),o.info(ci,JSON.stringify({code:s,messageUIds:d})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(o.warn(ci,JSON.stringify({code:s})),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function Vs(e,t,n,i){return j(this,void 0,void 0,(function(){var o=this;return W(this,(function(r){return[2,new T(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).validate("timestamp",n,v.NUMBER,!0).validate("channelId",i,v.CHANNEL_ID).ifReady((function(r){return j(o,void 0,void 0,(function(){var o,r,a,c,d;return W(this,(function(u){switch(u.label){case 0:return o={targetId:e,conversationType:s.PRIVATE,channelId:i},r=new Fa("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,Ps(o,r)];case 1:return a=u.sent(),c=a.code,d=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:d}]}}))}))}))]}))}))}function Fs(e,t,n){return j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,r){return j(i,void 0,void 0,(function(){var i,o,a,c,d;return W(this,(function(u){switch(u.label){case 0:return i="messageUId:"+t+",targetId:"+e,r.debug(h.A_SEND_MSG_T,"send read receipt message ->"+i),o=new Fa("RC:RRReqMsg",{messageUId:t}),[4,Ps({targetId:e,conversationType:s.GROUP,channelId:n},o)];case 1:return a=u.sent(),c=a.code,d=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:d}]}}))}))}))]}))}))}function Ys(e,t,n){return j(this,void 0,void 0,(function(){return W(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}Ls(M.COMBINE_HTML,(function(e,t){var n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new Qa(n)}));var qs=function(e,t,n,i){return j(void 0,void 0,void 0,(function(){var o,a;return W(this,(function(s){switch(s.label){case 0:return!_("messageList",i,v.OBJECT,!0)||Object.keys(i).some((function(e){return!_(e,i[e],v.ARRAY)}))?[2,Promise.resolve({code:r.MSG_LIMIT_ERROR})]:(o=[],Object.keys(i).forEach((function(e){i[e].forEach((function(e){-1===o.indexOf(e)&&o.push(e)}))})),o.length?[4,e.sendReadReceiptMessage(n.targetId,o,n.channelId)]:(t.warn(h.A_SEND_MSG_R,JSON.stringify({code:r.MSG_LIMIT_ERROR,msg:"Error in parameter messageList."})),[2,Promise.resolve({code:r.MSG_LIMIT_ERROR})]));case 1:return a=s.sent().code,[2,Promise.resolve({code:a})]}}))}))};function Ks(e,t,n){return j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,c,d,u,l;return W(this,(function(f){switch(f.label){case 0:return i={targetId:e,conversationType:s.GROUP,channelId:n},d=o.getNaviInfoFromCache(),1!==(null==d?void 0:d.grpRRVer)?[3,2]:[4,qs(o,a,i,t)];case 1:return c=f.sent(),[3,4];case 2:return!_("messageList",t,v.OBJECT,!1)||t&&Object.keys(t).some((function(e){return!_(e,t[e],v.ARRAY)}))?[2,{code:r.MSG_LIMIT_ERROR}]:(u=new Fa("RC:RRRspMsg",{receiptMessageDic:t}),[4,Ps(i,u)]);case 3:c=f.sent(),f.label=4;case 4:return(l=c.code)===r.SUCCESS?[2,{code:l}]:[2,{code:l,msg:wr[l]}]}}))}))}))]}))}))}function zs(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(h.A_SYNC_READ_STATUS_T,h.A_SYNC_READ_STATUS_R).validate("timestamp",t,v.NUMBER,!0).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP||e===s.PRIVATE}),!0,"It should be ConversationType.GROUP or ConversationType.PRIVATE").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", timestamp:"+t,a=o.createTraceId(),o.info(h.A_SYNC_READ_STATUS_T,n,a),1!==(null==(s=i.getNaviInfoFromCache())?void 0:s.sesDriven)?[3,2]:[4,i.updateConversationReadTime(e,t)];case 1:return c=v.sent(),[3,4];case 2:return d=new Fa("RC:SRSMsg",{timestamp:t}),[4,Ps(e,d)];case 3:c=v.sent(),v.label=4;case 4:return u=c.code,l=c.msg,o[u===r.SUCCESS?"info":"warn"](h.A_SYNC_READ_STATUS_R,"code: "+u+", msg: "+l,a),[2,{code:u,msg:l}]}}))}))}))]}))}))}function js(e,t,n){return void 0===n&&(n=""),j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(h.A_SEND_MESSAGE_READ_RECEIPT_V4_T,h.A_SEND_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP||e===s.PRIVATE}),!0,"It should be ConversationType.GROUP or ConversationType.PRIVATE").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("startMsgUId",n,v.ONLY_STRING,!0).validate("endMsgUId",t,v.STRING,!0).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:return i=a.createTraceId(),s="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", startMsgUId:"+n+", endMsgUId: "+t,a.info(h.A_SEND_MESSAGE_READ_RECEIPT_V4_T,s,i),3!==(null==(c=o.getNaviInfoFromCache())?void 0:c.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,o.sendReadReceiptMessageV4(e,n,t)];case 1:return d=v.sent(),u=d.code,l=d.msg,a[u===r.SUCCESS?"info":"warn"](h.A_SEND_MESSAGE_READ_RECEIPT_V4_R,"code: "+u+", msg: "+l,i),[2,{code:u,msg:l}]}}))}))}))]}))}))}function Ws(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(h.A_GET_MESSAGE_READ_RECEIPT_V4_T,h.A_GET_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t,v.STRING,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", messageUid:"+t,a=o.createTraceId(),o.info(h.A_GET_MESSAGE_READ_RECEIPT_V4_T,n,a),3!==(null==(s=i.getNaviInfoFromCache())?void 0:s.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,i.getMessageReadReceiptV4(e,t)];case 1:return c=v.sent(),d=c.code,u=c.msg,l=c.data,o[d===r.SUCCESS?"info":"warn"](h.A_GET_MESSAGE_READ_RECEIPT_V4_R,"code: "+d+", msg: "+u,a),d===r.SUCCESS&&l?[2,{code:d,data:l}]:[2,{code:d,msg:u}]}}))}))}))]}))}))}function Qs(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t,(function(e){return!!_("messageUIds",e,v.ARRAY,!0)&&!e.some((function(e){return!R(e)}))}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", messageUid:"+t.toString(),a=o.createTraceId(),o.info(h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,n,a),3!==(null==(s=i.getNaviInfoFromCache())?void 0:s.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,i.batchGetMessageReadReceiptInfoV4(e,t)];case 1:return c=v.sent(),d=c.code,u=c.msg,l=c.data,o[d===r.SUCCESS?"info":"warn"](h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R,"code: "+d+", msg: "+u,a),d===r.SUCCESS?[2,{code:d,data:l}]:[2,{code:d,msg:u}]}}))}))}))]}))}))}function Xs(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(di,ui).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t.messageUId,v.STRING,!0).validate("sentTime",t.sentTime,v.NUMBER,!0).validate("disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN).validate("pushConfig",null==t?void 0:t.pushConfig,v.OBJECT).validate("directionalUserIdList",null==t?void 0:t.directionalUserIdList,J({maxLength:300,minLength:1,itemValidator:function(e){return R(e)}})).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d;return W(this,(function(u){switch(u.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,directionalUserIdList:t.directionalUserIdList},a=o.createTraceId(),o.info(di,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,messageUId:t.messageUId}),a),[4,i.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=u.sent(),c=s.code,d=s.data,c===r.SUCCESS&&d?(o.info(ui,JSON.stringify({code:c,messageUId:d.messageUId}),a),[2,{code:c,data:ke(d)}]):c===r.SUCCESS?[2,{code:c}]:(o.warn(ui,JSON.stringify({code:c}),a),[2,{code:c,msg:wr[c]}])}}))}))}))]}))}))}function Zs(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(li,vi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messages",t,(function(e){return f(e)&&e.length}),!0).validate("messages",t,(function(e){return!(!e||!f(e))&&!e.some((function(e){return!R(null==e?void 0:e.messageUId)||!y(null==e?void 0:e.sentTime)||!_("options.messageDirection",null==e?void 0:e.messageDirection,(function(e){return 1===e||2===e}),!0)}))}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(li,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,messages:t.map((function(e){return e.messageUId}))}),n),[4,i.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](vi,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:wr[a]}]:[2,{code:r.SUCCESS}]}}))}))}))]}))}))}function $s(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(fi,gi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(fi,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:t}),n),[4,i.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](gi,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:wr[a]}]:[2,{code:r.SUCCESS}]}}))}))}))]}))}))}function ec(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(ii,oi).validate("clearMessageOption",e,(function(e){if(!_("clearMessageOption",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("options",i,v.OBJECT,!0)&&_("options.targetId",i.targetId,v.STRING,!0)&&_("options.conversationType",i.conversationType,(function(e){return[s.PRIVATE,s.GROUP,s.CHATROOM,s.SYSTEM].includes(e)}),!0)&&_("options.timestamp",i.timestamp,v.NUMBER,!0)&&_("options.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),a=o.createTraceId(),o.info(ii,"options: "+JSON.stringify(n)+", isDeleteLocal: "+!!t,a),[4,i.batchClearRemoteHistoryMessages(n,!!t)];case 1:return s=c.sent(),o[r.SUCCESS===s?"info":"warn"](oi,"code: "+s,a),[2,{code:s}]}}))}))}))]}))}))}function tc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(Si,hi).validate("expansion",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,v.NUMBER,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).validate("messageUId",null==t?void 0:t.messageUId,v.STRING,!0).validate("expansion",null==t?void 0:t.expansion,v.OBJECT).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f;return W(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,d=t.expansion,u=t.channelId,l=o.createTraceId(),o.info(Si,JSON.stringify({targetId:a,channelId:u,conversationType:n,messageUId:s,canIncludeExpansion:c}),l),[4,i.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:d,channelId:u})];case 1:return v=g.sent().code,f=v===r.SUCCESS?"info":"warn",o[f](hi,JSON.stringify({code:v}),l),v!==r.SUCCESS?[2,{code:v,msg:wr[v]}]:[2,{code:v}]}}))}))}))]}))}))}function nc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(Ii,Ti).validate("keys",e,v.ARRAY,!0).validate("message",t,v.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,v.NUMBER,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).validate("messageUId",null==t?void 0:t.messageUId,v.STRING,!0).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v;return W(this,(function(f){switch(f.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,d=t.channelId,u=o.createTraceId(),o.info(Ii,JSON.stringify({targetId:a,channelId:d,conversationType:n,messageUId:s,canIncludeExpansion:c}),u),[4,i.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:d})];case 1:return l=f.sent().code,v=l===r.SUCCESS?"info":"warn",o[v](Ti,JSON.stringify({code:l}),u),l!==r.SUCCESS?[2,{code:l,msg:wr[l]}]:[2,{code:l}]}}))}))}))]}))}))}function ic(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageType",t,v.STRING,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=o.createTraceId(),o.info(h.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,i.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",o[u](h.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:d?d.messageUId:"",messageId:d?d.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:ke(d)}]:[2,{code:c,msg:wr[c]}]}}))}))}))]}))}))}function oc(e,t,n){return j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(_i,mi).validate("messageUId",t,v.STRING,!0).validate("targetId",e,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,s,c,d;return W(this,(function(u){switch(u.label){case 0:return i=a.createTraceId(),a.info(_i,JSON.stringify({targetId:e,messageUId:t,channelId:n}),i),[4,o.getMessageReader(e,t,n)];case 1:return s=u.sent(),c=s.code,d=s.data,c===r.SUCCESS?(a.info(mi,JSON.stringify({code:c,totalMemberCount:null==d?void 0:d.totalMemberCount}),i),[2,{code:c,data:d}]):(a.warn(mi,JSON.stringify({code:c})),[2,{code:c,msg:wr[c]}])}}))}))}))]}))}))}function rc(e,t,n,i,o){return gr((function(r,a){return l("messageType",e,v.STRING,!0),l("isPersited",t,v.BOOLEAN,!0),l("isCounted",n,v.BOOLEAN,!0),l("isStatusMessage",o,v.BOOLEAN,!1),l("searchProps",i,v.ARRAY),a.info(h.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:o,isPersited:t})),r.registerMessageType(e,t,n,i,o),Ya(e,t,n)}))}function ac(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return G()?[2,new T(pi,Ni).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(pi,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getFirstUnreadMessage(t,o,a)];case 1:return c=v.sent(),d=c.code,u=c.data,d===r.SUCCESS?(l=u&&ke(u)||null,i.info(Ni,JSON.stringify({code:d,messageUId:null==u?void 0:u.messageUId}),s),[2,{code:d,data:l}]):(i.warn(Ni,JSON.stringify({code:d}),s),[2,{code:d,msg:wr[d]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))}function sc(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Ei,yi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ei,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getFirstUnreadMessageInfo(t,o,a||"")];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(yi,JSON.stringify({code:d,messageUId:null==u?void 0:u.messageUId,sentTime:null==u?void 0:u.sentTime}),s),[2,{code:d,data:u}]):(i.warn(yi,JSON.stringify({code:d}),s),[2,{code:d,msg:wr[d]}])}}))}))}))]}))}))}function cc(e,t,n){return void 0===n&&(n={}),j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return He("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),G()?[2,new T(Ri,Ci).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("searchContent",null==n?void 0:n.searchContent,v.STRING).validate("senderUserId",null==t?void 0:t.senderUserId,v.STRING,!0).validate("messageType",null==t?void 0:t.messageType,v.STRING,!0).validate("content",null==t?void 0:t.content,v.OBJECT,!0).validate("messageDirection",null==t?void 0:t.messageDirection,v.NUMBER,!0).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN).validate("expansion",null==t?void 0:t.expansion,v.OBJECT).validate("disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN).validate("sentTime",null==t?void 0:t.sentTime,v.NUMBER).validate("sentStatus",null==t?void 0:t.sentStatus,v.NUMBER).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,s,c,d,u,l,v,f,g,S,h,I,T,_,m,p,N;return W(this,(function(E){switch(E.label){case 0:return i=t.senderUserId,s=t.messageType,c=t.content,d=t.messageDirection,u=t.messageUId,l=t.canIncludeExpansion,v=t.expansion,f=t.disableNotification,g=t.sentTime,S=t.sentStatus,h=a.createTraceId(),a.info(Ri,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),h),I=n.isUnread,T=n.searchContent,_={senderUserId:i,messageType:s,content:c,messageDirection:d,sentTime:g,sentStatus:S,searchContent:T,isUnread:!!I,messageUId:u,disableNotification:f,canIncludeExpansion:l,expansionMsg:JSON.stringify(v),channelId:e.channelId||""},[4,o.insertMessage(e.conversationType,e.targetId,_)];case 1:return m=E.sent(),p=m.code,N=m.data,p===r.SUCCESS?(a.info(Ci,JSON.stringify({code:p,messageId:null==N?void 0:N.messageId}),h),[2,{code:p,data:ke(N)}]):(a.warn(Ci,JSON.stringify({code:p}),h),[2,{code:p,msg:wr[p]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))}function dc(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return G()?[2,new T(Oi,Ai).validate("messageId",e,(function(e){return y(e)||R(e)}),!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s;return W(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Oi,JSON.stringify({messageId:e}),t),[4,n.getMessage(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Ai,JSON.stringify({code:a,messageUId:null==s?void 0:s.messageUId,messageId:null==s?void 0:s.messageId})),[2,{code:a,data:ke(s)}]):(i.warn(Ai,JSON.stringify({code:a})),[2,{code:a,msg:wr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))}function uc(e){return G()?new T(Ui,wi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReadySync((function(t,n){var i=e.conversationType,o=e.targetId,a=e.channelId,s=n.createTraceId();n.info(Ui,JSON.stringify({conversationType:i,targetId:o,channelId:a}),s);var c=t.getUnreadMentionedMessages(i,o,a),d=[];return c&&c.length&&c.forEach((function(e){return d.push(ke(e))})),n.info(wi,JSON.stringify({code:r.SUCCESS,count:d.length}),s),{code:r.SUCCESS,data:d}})):{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}}function lc(e,t,n,i){return j(this,void 0,void 0,(function(){var o=this;return W(this,(function(a){return He("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),G()?[2,new T("A-search_messages-T","A-search_messages-R").validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("keyword",t,v.STRING,!0).validate("timestamp",n,v.NUMBER).validate("count",i,v.NUMBER).ifReady((function(a,s){return j(o,void 0,void 0,(function(){var o,c,d,u;return W(this,(function(l){switch(l.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,i,1,e.channelId)];case 1:return o=l.sent(),c=o.code,d=o.data,c===r.SUCCESS?(u=[],(null==d?void 0:d.messages)&&d.messages.length&&d.messages.forEach((function(e){return u.push(ke(e))})),[2,{code:c,data:{messages:u,count:null==d?void 0:d.count}}]):(s.warn(h.O,"searchMessages ->code:"+c+",targetId:"+e.targetId),[2,{code:c,msg:wr[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))}function vc(e,t,n){return j(this,void 0,void 0,(function(){var i,o,a,s=this;return W(this,(function(c){return He("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),G()?(i=e.conversationType,o=e.targetId,a=e.channelId,[2,new T(Mi,Pi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).validate("cleanSpace",n,v.BOOLEAN).ifReady((function(e,c){return j(s,void 0,void 0,(function(){var s,d,u;return W(this,(function(l){switch(l.label){case 0:return s=c.createTraceId(),c.info(Mi,JSON.stringify({conversationType:i,targetId:o,channelId:a,timestamp:t,cleanSpace:n}),s),[4,e.deleteMessagesByTimestamp(i,o,t,n,a)];case 1:return d=l.sent(),c.debug(h.A_DELETE_MESSAGES_S,JSON.stringify({code:d,conversationType:i,targetId:o,channelId:a,timestamp:t})),u=d===r.SUCCESS?"info":"warn",c[u](Pi,JSON.stringify({code:d}),s),d===r.SUCCESS?[2,{code:d}]:[2,{code:d,msg:wr[d]}]}}))}))}))]):[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))}function fc(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return He("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),G()?[2,new T(bi,Li).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(bi,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearMessages(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Li,JSON.stringify({code:c}),s),c===r.SUCCESS?[2,{code:c}]:[2,{code:c,msg:wr[c]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))}function gc(e,t,n,i){return j(this,void 0,void 0,(function(){var o=this;return W(this,(function(a){return He("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),G()?[2,new T(Gi,Ji).validate("keyword",e,v.STRING,!0).validate("conversationTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!1).validate("messageTypes",n,(function(e){return!!f(e)&&!(null==n?void 0:n.some((function(e){return!R(e)})))}),!1).validate("channelId",i,v.STRING).ifReady((function(a,s){return j(o,void 0,void 0,(function(){var o,c,d,u;return W(this,(function(l){switch(l.label){case 0:return o=s.createTraceId(),s.info(Gi,JSON.stringify({keyword:e,conversationTypes:t,messageTypes:n,channelId:i}),o),[4,a.searchConversationByContent(e,n,i,t)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(s.info(Ji,JSON.stringify({code:d,count:null==u?void 0:u.length}),o),[2,{code:d,data:u}]):(s.warn(Ji,JSON.stringify({code:d}),o),[2,{code:d,msg:wr[d]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))}function Sc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return G()?[2,new T(Di,Bi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,c=o.createTraceId(),o.info(Di,JSON.stringify({conversationType:n,targetId:a,channelId:s,timestamp:t}),c),[4,i.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return d=l.sent(),u=d===r.SUCCESS?"info":"warn",o[u](Bi,JSON.stringify({code:d}),c),d===r.SUCCESS?[2,{code:d}]:[2,{code:d,msg:wr[d]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))}function hc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return He("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),G()?[2,new T(ki,xi).validate("messageId",e,v.NUMBER,!0).validate("receivedStatus",t,v.NUMBER,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ki,JSON.stringify({messageId:e,receivedStatus:t}),n),[4,i.setMessageReceivedStatus(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](xi,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:wr[a]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))}function Ic(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(zi,ji).validate("tagId",null==e?void 0:e.tagId,v.STRING,!0).validate("tagId",null==e?void 0:e.tagId,(function(e){return!!e&&e.length<=10})).validate("tagName",null==e?void 0:e.tagName,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a;return W(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(zi,JSON.stringify({tagId:e.tagId,tagName:e.tagName}),t),[4,n.createTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](ji,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:wr[o]}]}}))}))}))]}))}))}function Tc(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Wi,Qi).validate("tagId",e,v.STRING,!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a;return W(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Wi,JSON.stringify({tagId:e}),t),[4,n.removeTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](Qi,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:wr[o]}]}}))}))}))]}))}))}function _c(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Xi,Zi).validate("tagId",null==e?void 0:e.tagId,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a;return W(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Xi,JSON.stringify({tagId:e.tagId,tagName:e.tagName}),t),[4,n.updateTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](Zi,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:wr[o]}]}}))}))}))]}))}))}function mc(){return j(this,void 0,void 0,(function(){var e=this;return W(this,(function(t){return[2,new T("","").ifReady((function(t,n){return j(e,void 0,void 0,(function(){var e,i,o,a,s;return W(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info($i,"",e),[4,t.getTagList()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](eo,JSON.stringify({code:o}),e),[2,{code:r.SUCCESS,data:a}]}}))}))}))]}))}))}function pc(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(to,no).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c;return W(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(to,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),t),[4,n.getTagsForConversation(e)];case 1:return o=d.sent(),a=o.code,s=o.data,c=a===r.SUCCESS?"info":"warn",i[c](no,JSON.stringify({code:a}),t),a===r.SUCCESS?[2,{code:a,data:s}]:[2,{code:a,msg:wr[a]}]}}))}))}))]}))}))}function Nc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(io,oo).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(io,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.addTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](oo,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:wr[a]}]}}))}))}))]}))}))}function Ec(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(ro,ao).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ro,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.removeTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](ao,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:wr[a]}]}}))}))}))]}))}))}function yc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(so,co).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("tagIds",t,(function(e){return!!_("tagIds",e,v.ARRAY,!0)&&!e.some((function(e){return!R(e)}))}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(so,JSON.stringify({tagIds:t,targetId:e.targetId,conversationType:e.conversationType}),n),[4,i.removeTagsForConversation(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](co,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:wr[a]}]}}))}))}))]}))}))}function Rc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(uo,lo).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(uo,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.removeTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](lo,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:wr[a]}]}}))}))}))]}))}))}function Cc(e,t,n){return j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(vo,fo).validate("tagId",e,v.STRING,!0).validate("count",t,v.NUMBER,!0).validate("startTime",n,v.NUMBER,!0).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(vo,JSON.stringify({tagId:e,count:t,startTime:n}),i),[4,o.getConversationListByTag(e,n,t)];case 1:return s=l.sent(),c=s.code,d=s.data,c===r.SUCCESS?(u=null==d?void 0:d.map((function(e){return function(e){return z(z({},xe(e)),{isTopInTag:e.isTopInTag})}(e)})),a.info(fo,JSON.stringify({code:c,length:null==u?void 0:u.length}),i),[2,{code:c,data:u}]):(a.warn(fo,JSON.stringify({code:c}),i),[2,{code:c,msg:wr[c]}])}}))}))}))]}))}))}function Oc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(go,So).validate("tagId",e,v.STRING,!0).validate("containMuted",t,v.BOOLEAN,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(go,JSON.stringify({tagId:e,containMuted:t}),n),[4,i.getUnreadCountByTag(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](go,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]}}))}))}))]}))}))}function Ac(e,t,n){return j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(go,So).validate("tagId",e,v.STRING,!0).validate("isTop",n,v.BOOLEAN,!0).validate("conversationType",null==t?void 0:t.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,s,c;return W(this,(function(d){switch(d.label){case 0:return i=a.createTraceId(),a.info(go,JSON.stringify({tagId:e,targetId:t.targetId,conversationType:t.conversationType,isTop:n}),i),[4,o.setConversationStatusInTag(e,t,{isTop:n})];case 1:return s=d.sent().code,c=s===r.SUCCESS?"info":"warn",a[c](ho,JSON.stringify({code:s}),i),s===r.SUCCESS?[2,{code:s}]:[2,{code:s,msg:wr[s]}]}}))}))}))]}))}))}var Uc={COMET:"comet",WEBSOCKET:"websocket"},wc={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",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var Mc=Object.freeze({__proto__:null,getAllConversationList:function(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return G()?[2,new T(sn,cn).validate("channelId",e,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s,c;return W(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(sn,JSON.stringify({channelId:e}),t),x(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return o=d.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:o=d.sent(),d.label=4;case 4:return a=o.code,s=o.data,i.info(cn,JSON.stringify({code:a,length:null==s?void 0:s.length}),t),a===r.SUCCESS&&s?(c=s.map((function(e){return xe(e)})),[2,{code:a,data:c}]):(i.warn(cn,JSON.stringify({code:a}),t),[2,{code:a,msg:wr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n,i){return j(this,void 0,void 0,(function(){var o=this;return W(this,(function(a){return G()?[2,new T(dn,un).validate("startTime",e,v.NUMBER,!0).validate("count",t,v.NUMBER,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(a,s){return j(o,void 0,void 0,(function(){var o,c,d,u,l,v;return W(this,(function(f){switch(f.label){case 0:return o=s.createTraceId(),s.info(dn,JSON.stringify({startTime:e,count:t,channelId:n}),o),x(n)?[4,a.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return c=f.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(d,e,t,n,!!i)];case 3:c=f.sent(),f.label=4;case 4:return u=c.code,l=c.data,u===r.SUCCESS&&l?(v=l.map((function(e){return xe(e)})),s.info(un,JSON.stringify({code:u,length:v.length}),o),[2,{code:u,data:v}]):(s.warn(un,JSON.stringify({code:u}),o),[2,{code:u,msg:wr[u]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return G()?[2,new T(ln,vn).validate("keyword",e,v.STRING,!0).validate("messageTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!H(e)}))}),!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(ln,JSON.stringify({keyword:e,messageTypes:t,channelId:n}),i),x(n)?[4,o.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,o.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,d=s.data,c===r.SUCCESS&&d?(u=d.map((function(e){return xe(e)})),a.info(vn,JSON.stringify({code:c,length:u.length}),i),[2,{code:c,data:u}]):(a.warn(vn,JSON.stringify({code:c}),i),[2,{code:c,msg:wr[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,i,o){return j(this,void 0,void 0,(function(){var a=this;return W(this,(function(s){return G()?[2,new T(fn,gn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("keyword",t,v.STRING,!0).validate("startTime",n,v.NUMBER,!0).validate("count",i,v.NUMBER,!0).validate("messageTypes",o,J({itemValidator:H})).ifReady((function(s,c){return j(a,void 0,void 0,(function(){var a,d,u,l,v,f,g,S,h,I,T;return W(this,(function(_){switch(_.label){case 0:return a=e.targetId,d=e.conversationType,u=e.channelId,l=c.createTraceId(),c.info(fn,JSON.stringify({targetId:a,conversationType:d,channelId:u,keyword:t,startTime:n,count:i}),l),o?[4,s.searchMessageByContentAndMessageType(d,a,t,n,i,o,u)]:[3,2];case 1:return v=_.sent(),[3,6];case 2:return x(u)?[4,s.searchMessageByContentWithAllChannel(d,a,t,n,i)]:[3,4];case 3:return v=_.sent(),[3,6];case 4:return 0,[4,s.searchMessageByContent(d,a,t,n,i,0,u)];case 5:v=_.sent(),_.label=6;case 6:return f=v.code,g=v.data,f===r.SUCCESS&&g?(S=g.messages,h=g.count,I=[],T=S.map((function(e){return I.push(e.messageUId),ke(e)})),c.info(gn,JSON.stringify({code:f,list:I}),l),[2,{code:f,data:{messages:T,count:h}}]):(c.warn(gn,JSON.stringify({code:f}),l),[2,{code:f,msg:wr[f]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return G()?[2,new T(Sn,hn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("startTime",null==t?void 0:t.startTime,v.NUMBER,!0).validate("endTime",null==t?void 0:t.endTime,v.NUMBER,!0).validate("offset",null==t?void 0:t.offset,v.NUMBER).validate("limit",null==t?void 0:t.limit,v.NUMBER).validate("keyword",null==t?void 0:t.keyword,v.STRING,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S;return W(this,(function(h){switch(h.label){case 0:return n=e.conversationType,a=e.targetId,s=t.keyword,c=t.startTime,d=t.endTime,u=t.offset,l=t.limit,u=u||0,l=l||5,v=o.createTraceId(),o.info(Sn,JSON.stringify({targetId:a,conversationType:n,keyword:s,startTime:c,endTime:d,offset:u,limit:l}),v),[4,i.searchMessageByContentInTimeRangeWithAllChannel(n,a,s,c,d,u,l)];case 1:return f=h.sent(),g=f.code,S=f.data,g===r.SUCCESS&&S?[2,{code:g,data:{messages:S.messages.map((function(e){return ke(e)}))}}]:(o.warn(hn,JSON.stringify({code:g}),v),[2,{code:g}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,i){return j(this,void 0,void 0,(function(){var o=this;return W(this,(function(a){return G()?[2,new T(In,Tn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("userId",t,v.STRING,!0).validate("startTime",n,v.NUMBER,!0).validate("count",i,v.NUMBER,!0).ifReady((function(a,s){return j(o,void 0,void 0,(function(){var o,c,d,u,l,v,f;return W(this,(function(g){switch(g.label){case 0:return o=e.conversationType,c=e.targetId,d=e.channelId,u=s.createTraceId(),s.info(In,JSON.stringify({targetId:c,conversationType:o,channelId:d,startTime:n,userId:t,count:i}),u),[4,a.searchMessagesByUser(o,c,t,n,i,d)];case 1:return l=g.sent(),v=l.code,f=l.data,v===r.SUCCESS&&f?[2,{code:v,data:{messages:f.messages.map((function(e){return ke(e)}))}}]:(s.warn(Tn,JSON.stringify({code:v})),[2,{code:v}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return G()?[2,new T(_n,mn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t})).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("order",null==t?void 0:t.order,(function(e){return[0,1].includes(e)})).validate("messageTypes",null==t?void 0:t.messageTypes,(function(e){return!!f(e)&&!e.some((function(e){return!H(e)}))}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h,I,T,_,m,p,N,E;return W(this,(function(y){switch(y.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,d=t.order,u=void 0===d?0:d,l=t.messageTypes,v=e.conversationType,f=e.targetId,g=e.channelId,S=void 0===g?"":g,h=o.createTraceId(),o.info(_n,JSON.stringify({targetId:f,conversationType:v,channelId:S,count:a,timestamp:c,messageTypes:l}),h),[4,i.getHistoryMessagesByObjectNames(v,f,c,a,l,u,S)];case 1:return I=y.sent(),T=I.code,_=I.data,T===r.SUCCESS?(p=(m=_).list,N=m.hasMore,E=p.map((function(e){return ke(e)})),[2,{code:T,data:{messages:E,hasMore:N,list:E}}]):(o.warn(mn,JSON.stringify({code:T})),[2,{code:T,msg:wr[T]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},getContinuousMessages:function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return G()?[2,new T(pn,Nn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h,I,T,_;return W(this,(function(m){switch(m.label){case 0:return n=t.count,a=t.timestamp,s=t.order,c=e.conversationType,d=e.targetId,u=e.channelId,l=o.createTraceId(),o.info(pn,JSON.stringify({targetId:d,conversationType:c,channelId:u,count:n,timestamp:a}),l),(i.getNaviInfoFromCache()||{}).historyMsg?[4,i.getContinuousMessages(c,d,a||0,n||20,s||0,u||"")]:[2,{code:r.MESSAGE_STORAGE_SERVICE_UNAVAILABLE}];case 1:return v=m.sent(),f=v.code,g=v.data,f===r.SUCCESS?(h=(S=g).list,I=S.timestamp,T=S.hasMore,_=h.map((function(e){return ke(e)})),[2,{code:f,data:{list:_,timestamp:I,hasMore:T}}]):(o.warn(Nn,JSON.stringify({code:f})),[2,{code:f,msg:wr[f]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return G()?[2,new T(En,yn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,r,a,s,c;return W(this,(function(d){switch(d.label){case 0:return n=e.conversationType,r=e.targetId,a=e.channelId,s=o.createTraceId(),o.info(En,JSON.stringify({targetId:r,conversationType:n,channelId:a,timestamp:t}),s),[4,i.setMessageStatusToRead(n,r,t,a)];case 1:return c=d.sent(),o.info(yn,JSON.stringify(c),s),[2,c]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return console.warn("`setMessageSentStatus` has being deprecated, use `setMessageReceivedStatusInfo` instead."),G()?[2,new T(Rn,Cn).validate("messageId",e,v.NUMBER,!0).validate("receivedStatus",t,(function(e){return!x(a[e])}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,r;return W(this,(function(a){switch(a.label){case 0:return n=o.createTraceId(),o.info(Rn,JSON.stringify({messageId:e,receivedStatus:t}),n),[4,i.setMessageReceivedStatus(e,t)];case 1:return r=a.sent(),o.info(Cn,JSON.stringify({code:r}),n),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatusInfo:function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return G()?[2,new T(Un,wn).validate("messageId",e,v.NUMBER,!0).validate("receivedStatusInfo",t,v.OBJECT,!0).validate("receivedStatusInfo",null==t?void 0:t.isRead,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isListened,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isDownload,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isRetrieved,v.BOOLEAN).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,r,a;return W(this,(function(s){switch(s.label){case 0:return n=V(t),r=o.createTraceId(),o.info(Un,JSON.stringify({messageId:e,sentStatus:n}),r),[4,i.setMessageReceivedStatus(e,n)];case 1:return a=s.sent(),o.info(wn,JSON.stringify({code:a}),r),[2,{code:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return G()?[2,new T(On,On).validate("messageId",e,v.NUMBER,!0).validate("sentStatus",t,(function(e){return!x(k[e])}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,r;return W(this,(function(a){switch(a.label){case 0:return n=o.createTraceId(),o.info(On,JSON.stringify({messageId:e,sentStatus:t}),n),[4,i.setMessageSentStatus(e,t)];case 1:return r=a.sent(),o.info(An,JSON.stringify({code:r}),n),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return G()?[2,new T(Mn,Pn).validate("messageId",e,v.NUMBER,!0).validate("content",t,v.OBJECT,!0).validate("messageType",n,v.ONLY_STRING,!0).ifReady((function(o,r){return j(i,void 0,void 0,(function(){var i,a;return W(this,(function(s){switch(s.label){case 0:return i=r.createTraceId(),r.info(Mn,JSON.stringify({messageId:e,messageType:n}),i),[4,o.setMessageContent(e,t,n)];case 1:return a=s.sent(),r.info(Pn,JSON.stringify({code:a}),i),[2,{code:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return G()?[2,new T(bn,Ln).validate("messageIds",e,(function(e){return!!f(e)&&!e.some((function(e){return!y(e)}))}),!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o;return W(this,(function(r){switch(r.label){case 0:return t=i.createTraceId(),i.info(bn,JSON.stringify({messageIds:e}),t),[4,n.deleteMessages(e)];case 1:return o=r.sent(),i.info(Ln,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return G()?[2,new T(Gn,Jn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,r,a,s;return W(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,a=i.createTraceId(),i.info(Gn,JSON.stringify({conversationType:t,targetId:o,channelId:r}),a),[4,n.clearMessages(t,o,r)];case 1:return s=c.sent(),i.info(Jn,JSON.stringify({code:s}),a),[2,{code:s}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return j(this,void 0,void 0,(function(){var i,o,a,s=this;return W(this,(function(c){return G()?(i=e.conversationType,o=e.targetId,a=e.channelId,[2,new T(Dn,Bn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).validate("cleanSpace",n,v.BOOLEAN).ifReady((function(e,c){return j(s,void 0,void 0,(function(){var s,d,u;return W(this,(function(l){switch(l.label){case 0:return s=c.createTraceId(),c.info(Dn,JSON.stringify({conversationType:i,targetId:o,channelId:a,timestamp:t,cleanSpace:n}),s),[4,e.deleteMessagesByTimestamp(i,o,t,n,a)];case 1:return d=l.sent(),u=d===r.SUCCESS?"info":"warn",c[u](Bn,JSON.stringify({code:d}),s),[2,{code:d}]}}))}))}))]):[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},batchClearMessagesByTimestamp:function(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return G()?[2,new T(ri,ai).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,c;return W(this,(function(d){switch(d.label){case 0:return t=function(e,t){if(!_("options",e,v.ARRAY,!0)||!_("options",e,(function(n){return!(e.length>20||0===e.length)||(t.error(ai,"conversations length should not be greater than 20 and not be equal to 0"),!1)}),!0))return r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(!(_("options",o,v.OBJECT,!0)&&_("options.targetId",o.targetId,v.STRING,!0)&&_("options.conversationType",o.conversationType,(function(e){var n=[s.PRIVATE,s.GROUP,s.CHATROOM,s.SYSTEM].includes(e);return n||t.error(ai,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.CHATROOM,\n ConversationType.SYSTEM,\n "),n}),!0)&&_("options.timestamp",o.timestamp,v.NUMBER,!0)&&_("options.channelId",o.channelId,v.ONLY_STRING)))return r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}}(e,i),t?[2,{code:r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}]:(o=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),a=i.createTraceId(),i.info(ri,"options: "+JSON.stringify(o),a),[4,n.batchClearMessagesByTimestamp(o)]);case 1:return c=d.sent(),i[r.SUCCESS===c?"info":"warn"](ai,"code: "+c,a),[2,{code:c}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return G()?[2,new T(kn,xn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("userId",t,(function(e){return e instanceof Fa||_("message.senderUserId",null==e?void 0:e.senderUserId,v.STRING,!0)}),!0).validate("messageType",null==t?void 0:t.messageType,v.STRING,!0).validate("content",null==t?void 0:t.content,v.OBJECT,!0).validate("messageDirection",t,(function(e){return e instanceof Fa||_("message.messageDirection",null==e?void 0:e.messageDirection,v.NUMBER,!0)}),!0).validate("canIncludeExpansion",t,(function(e){return e instanceof Fa||_("message.canIncludeExpansion",null==e?void 0:e.canIncludeExpansion,v.BOOLEAN)})).validate("expansion",t,(function(e){return e instanceof Fa||_("message.expansion",null==e?void 0:e.expansion,v.OBJECT)})).validate("disableNotification",t,(function(e){return e instanceof Fa||_("message.expansion",null==e?void 0:e.disableNotification,v.BOOLEAN)})).validate("timestamp",t,(function(e){return e instanceof Fa||_("message.sentTime",null==e?void 0:e.sentTime,v.NUMBER)})).validate("sentStatus",t,(function(e){return e instanceof Fa||_("message.sentStatus",null==e?void 0:e.sentStatus,v.NUMBER)})).validate("receivedStatus",t,(function(e){return e instanceof Fa||_("message.receivedStatus",null==e?void 0:e.receivedStatus,v.NUMBER)})).validate("receivedStatusInfo",t,(function(e){return e instanceof Fa||_("message.receivedStatusInfo",null==e?void 0:e.receivedStatusInfo,v.OBJECT)})).validate("directedUserIds",t,(function(e){return e instanceof Fa||!(null==e?void 0:e.directedUserIds)||!(!(null==e?void 0:e.directedUserIds)||!f(null==e?void 0:e.directedUserIds))&&(!e.directedUserIds.some((function(e){return!R(e)}))&&e.directedUserIds.length<300)})).validate("searchContent",null==n?void 0:n.searchContent,v.STRING).ifReady((function(o,s){return j(i,void 0,void 0,(function(){var i,c,d,u,l,v,f,g,S,h,I,T,_,m,p,N,E,y,R,C;return W(this,(function(O){switch(O.label){case 0:return i="",c=1,v=!1,g=a.UNREAD,I=t.messageType,T=t.content,t instanceof Fa||(i=t.senderUserId,c=t.messageDirection,v=t.canIncludeExpansion,f=t.expansion,l=t.disableNotification,d=t.sentTime,u=t.sentStatus,g=t.receivedStatus,S=t.receivedStatusInfo,h=t.directedUserIds),_=s.createTraceId(),s.info(kn,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,messageType:I,sentTime:d}),_),m=n.isUnread,p=n.searchContent,N=g,S&&(N=V(S)),E={senderUserId:i,messageType:I,content:T,messageDirection:c,sentTime:d,sentStatus:u,searchContent:p,isUnread:!!m,messageUId:"",disableNotification:l,canIncludeExpansion:v,expansionMsg:JSON.stringify(f),channelId:e.channelId||"",readStatus:N,directedUserIds:h},[4,o.insertMessage(e.conversationType,e.targetId,E)];case 1:return y=O.sent(),R=y.code,C=y.data,R===r.SUCCESS?(s.info(xn,JSON.stringify({code:R,messageId:null==C?void 0:C.messageId}),_),[2,{code:R,data:ke(C)}]):(s.warn(xn,JSON.stringify({code:R}),_),[2,{code:R,msg:wr[R]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return G()?[2,new T(Vn,Vn).validate("messages",e,(function(e){var t,n,i,o;if(!_("messages",e,v.ARRAY,!0))return!1;if(e.length<=0||e.length>=500)return!1;for(var r in e)if(!_("message",e[r],v.OBJECT,!0)||!_("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)||!_("message.targetId",e[r].targetId,v.STRING,!0)||!_("message.senderUserId",e[r].senderUserId,v.STRING,!0)||!_("message.messageType",e[r].messageType,v.STRING,!0)||!_("message.content",e[r].content,v.OBJECT,!0)||!_("message.messageDirection",e[r].messageDirection,v.NUMBER,!0)||!_("message.canIncludeExpansion",e[r].canIncludeExpansion,v.BOOLEAN)||!_("message.expansion",e[r].expansion,v.OBJECT)||!_("message.disableNotification",e[r].disableNotification,v.BOOLEAN)||!_("message.sentTime",e[r].sentTime,v.NUMBER)||!_("message.sentStatus",e[r].sentStatus,v.NUMBER)||!_("options.isUnread",null===(t=e[r])||void 0===t?void 0:t.isUnread,v.BOOLEAN)||!_("options.searchContent",null===(n=e[r])||void 0===n?void 0:n.searchContent,v.STRING)||!_("options.receivedStatus",null===(i=e[r])||void 0===i?void 0:i.receivedStatus,v.NUMBER)||!_("options.receivedStatusInfo",null===(o=e[r])||void 0===o?void 0:o.receivedStatusInfo,v.OBJECT)||e[r].directedUserIds&&e[r].directedUserIds.some((function(e){return!_("userId",e,v.STRING,!0)}))&&e[r].directedUserIds.length<300)return console.warn("then "+r+" index message validation failed"),!1;return!0}),!0).validate("checkDuplicate",t,v.BOOLEAN).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c;return W(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Hn,JSON.stringify({checkDuplicate:t,length:e.length}),n),[4,i.batchInsertMessage(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Vn,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Vn,JSON.stringify({code:s}),n),[2,{code:s,msg:wr[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},getMessageCount:function(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return G()?[2,new T(Fn,Yn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,r,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,a=i.createTraceId(),i.info(Fn,JSON.stringify({conversationType:t,targetId:o,channelId:r}),a),[4,n.getMessageCount(t,o,r)];case 1:return s=u.sent(),c=s.code,d=s.data,i.info(Yn,JSON.stringify({code:c,data:d}),a),[2,{code:c,data:d}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return G()?[2,new T(qn,Kn).validate("messageUId",e,v.STRING,!0).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a,s;return W(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(qn,JSON.stringify({messageUId:e}),t),[4,n.getPrivateMessageDeliverTime(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Kn,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(Kn,JSON.stringify({code:a}),t),[2,{code:a,msg:wr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return G()?[2,new T(zn,jn).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(zn,JSON.stringify({targetId:e,messageUId:t}),n),[4,i.getGroupMessageDeliverList(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](jn,JSON.stringify({code:s}),n),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:wr[s]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return G()?[2,new T(Wn,Qn).validate("checkDuplicate",e,v.BOOLEAN).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,r,a;return W(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Wn,JSON.stringify({checkDuplicate:e}),t),[4,n.setCheckDuplicateMessage(!!e)];case 1:return o=s.sent(),r=o.code,a=o.data,i.info(Qn,JSON.stringify({code:r,data:a}),t),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},getMessagesAroundTimestamp:function(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return G()?[2,new T(rr,ar).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,D,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,F({min:0}),!0).validate("beforeCount",null==t?void 0:t.beforeCount,F({min:0}),!0).validate("afterCount",null==t?void 0:t.afterCount,F({min:0}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return W(this,(function(v){switch(v.label){case 0:return n=o.createTraceId(),o.info(rr,JSON.stringify({option:t,conversation:e}),n),a=t.timestamp,s=t.beforeCount,c=t.afterCount,[4,i.getMessagesByTimestamp(e,a,s,c)];case 1:return d=v.sent(),u=d.code,l=d.data,u===r.SUCCESS?(o.info(ar,JSON.stringify({code:u,data:l}),n),[2,{code:u,data:null==l?void 0:l.map((function(e){return ke(e)}))}]):(o.warn(ar,JSON.stringify({code:u}),n),[2,{code:u,msg:wr[u]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return j(this,void 0,void 0,(function(){var e=this;return W(this,(function(t){return G()?[2,Sr((function(t,n){return j(e,void 0,void 0,(function(){var e,i,o,a,s;return W(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(Wn,"clearLocalData ->",e),[4,t.clearData()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Qn,JSON.stringify({code:o}),e),[2,{code:o,data:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:wr[r.NOT_SUPPORT]}]}))}))},enable:function(){return G()}});function Pc(e){return j(this,void 0,void 0,(function(){var t=this;return W(this,(function(n){return[2,new T(Hi,Vi).validate("set.proxy",e,(function(t){return!!(!e||_("proxy.socksHost",e.socksHost,v.STRING,!0)&&_("proxy.socksPort",e.socksPort,v.NUMBER,!0))})).ifReady((function(n,i){return j(t,void 0,void 0,(function(){var t,o,a;return W(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Hi,JSON.stringify({socksHost:null==e?void 0:e.socksHost,socksPort:null==e?void 0:e.socksPort}),t),[4,n.setProxy(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](Vi,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:wr[o]}]}}))}))}))]}))}))}function bc(){return j(this,void 0,void 0,(function(){var e=this;return W(this,(function(t){return[2,new T(Fi,Yi).ifReady((function(t,n){return j(e,void 0,void 0,(function(){var e,i,o,a;return W(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(Fi,"",e),[4,t.getProxy()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.info(Yi,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):(n.warn(Yi,JSON.stringify({code:o}),e),[2,{code:o,msg:wr[o]}])}}))}))}))]}))}))}function Lc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T(qi,Ki).validate("test.proxy",e,v.OBJECT,!0).validate("test.proxy.socksHost",null==e?void 0:e.socksHost,v.STRING,!0).validate("test.proxy.socksPort",null==e?void 0:e.socksPort,v.NUMBER,!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c;return W(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(qi,JSON.stringify({socksHost:null==e?void 0:e.socksHost,socksPort:null==e?void 0:e.socksPort}),n),[4,i.testProxy(e,t)];case 1:return a=d.sent(),s=a.status,c=a.data,s===r.SUCCESS?[2,{code:s,msg:c}]:(o.warn(Ki,JSON.stringify({status:s}),n),[2,{code:s,msg:wr[s]}])}}))}))}))]}))}))}function Gc(e,t,n){return j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(Xo,Zo).validate("subscribeUserIds",e,J({maxLength:200,minLength:1,itemValidator:D}),!0).validate("subscribeType",t,(function(e){return e===Y.ONLINE_STATUS}),!0).validate("expiry",n,F({min:60,max:2592e3}),!0).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(Xo,JSON.stringify({userIds:e,subscribeType:t,expiry:n}),i),[4,o.subscribeUser(e,t,n)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",a[u](Zo,JSON.stringify({code:c,data:d}),i),[2,{code:c,data:d}]}}))}))}))]}))}))}function Jc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T($o,er).validate("subscribeUserIds",e,J({maxLength:200,minLength:1,itemValidator:D}),!0).validate("subscribeType",t,(function(e){return e===Y.ONLINE_STATUS}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s;return W(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info($o,JSON.stringify({userIds:e,subscribeType:t}),n),[4,i.unSubscribeUser(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](er,JSON.stringify({code:a}),n),[2,{code:a}]}}))}))}))]}))}))}function Dc(e,t,n){return j(this,void 0,void 0,(function(){var i=this;return W(this,(function(o){return[2,new T(ir,or).validate("subscribeType",e,(function(e){return e===Y.ONLINE_STATUS}),!0).validate("subscribePageSize",t,F({min:1,max:200}),!0).validate("offset",n,F({min:0}),!0).ifReady((function(o,a){return j(i,void 0,void 0,(function(){var i,s,c,d,u;return W(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(ir,JSON.stringify({pageSize:t,offset:n}),i),[4,o.getSubscribeUserList(e,t,n)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",a[u](or,JSON.stringify({code:c,data:d}),i),c===r.SUCCESS?[2,{code:c,data:d}]:[2,{code:c}]}}))}))}))]}))}))}function Bc(e,t){return j(this,void 0,void 0,(function(){var n=this;return W(this,(function(i){return[2,new T($o,er).validate("subscribeType",e,(function(e){return e===Y.ONLINE_STATUS}),!0).validate("subscribeUserIds",t,J({maxLength:200,minLength:1,itemValidator:D}),!0).ifReady((function(i,o){return j(n,void 0,void 0,(function(){var n,a,s,c,d;return W(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(tr,JSON.stringify({userIds:t}),n),[4,i.getSubscribeUserStatus(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](nr,JSON.stringify({code:s}),n),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s}]}}))}))}))]}))}))}export{Fa as BaseMessage,Qa as CombineMessage,Xa as CombineV2Message,os as CommandMessage,Uc as ConnectType,Ge as Events,Za as FileMessage,$a as GIFMessage,as as GroupNotificationMessage,za as HQVoiceMessage,Ka as ImageMessage,rs as InformationNotificationMessage,ts as LocationMessage,wc as MessageType,ns as ReferenceMessage,is as RichContentMessage,ja as SightMessage,Wa as TextMessage,ps as UploadTask,es as VoiceMessage,Cr as __addSDKVersion,Nc as addConversationsToTag,hr as addEventListener,Ic as addTag,ka as addToBlacklist,ec as batchClearRemoteHistoryMessages,Qs as batchGetMessageReadReceiptInfoV4,Br as batchRemoveConversation,Qr as batchSetConversationNotificationLevel,na as batchSetConversationToTop,Ba as bindRTCRoomForChatroom,zr as clearAllMessagesUnreadStatus,mr as clearEventListeners,$s as clearHistoryMessages,fc as clearMessages,Kr as clearMessagesUnreadStatus,Hr as clearTextMessageDraft,Sc as clearUnreadCountByTimestamp,br as connect,Cs as createUploadTask,vc as deleteLocalMessagesByTimestamp,Zs as deleteMessages,Nr as destroy,Lr as disconnect,Mc as electronExtension,La as forceRemoveChatRoomEntry,Ma as forceSetChatRoomEntry,Ja as getAllChatRoomEntries,sa as getAllConversationState,ma as getAllUltraGroupUnreadCount,pa as getAllUltraGroupUnreadMentionedCount,aa as getAllUnreadMentionedCount,Ha as getBlacklist,Va as getBlacklistStatus,da as getBlockUltraGroupList,ea as getBlockedConversationList,Ga as getChatRoomEntry,Aa as getChatRoomInfo,Da as getChatroomHistoryMessages,Er as getConnectionStatus,Jr as getConversation,Gr as getConversationList,Zr as getConversationNotificationLevel,$r as getConversationNotificationStatus,Cc as getConversationsFromTagByPage,Rr as getCurrentUserId,Or as getDeviceId,ws as getDownloadAuth,Us as getFileToken,Ms as getFileUrl,ac as getFirstUnreadMessage,sc as getFirstUnreadMessageInfo,xs as getHistoryMessages,dc as getMessage,Ws as getMessageReadReceiptV4,oc as getMessageReader,bc as getProxy,Hs as getRemoteHistoryMessages,yr as getServerTime,Dc as getSubscribeUserList,Bc as getSubscribeUserStatus,mc as getTags,pc as getTagsFromConversation,kr as getTextMessageDraft,ia as getTopConversationList,Vr as getTotalUnreadCount,Fr as getTotalUnreadCountByLevels,Yr as getTotalUnreadMentionedCountByLevels,Ia as getUltraGroupDefaultNotificationLevel,Ea as getUltraGroupFirstUnreadMessageTimestamp,ca as getUltraGroupList,la as getUltraGroupMessageListByMessageUId,_a as getUltraGroupUnreadCountByTargetId,ya as getUltraGroupUnreadInfoList,ha as getUltraGroupUnreadMentionedCountByTargetId,Na as getUltraGroupUnreadMentionedMessages,oa as getUnreadConversationList,qr as getUnreadCount,Oc as getUnreadCountByTag,ra as getUnreadMentionedCount,uc as getUnreadMentionedMessages,pr as init,cc as insertMessage,Ar as installPlugin,Ra as joinChatRoom,Ca as joinExistChatRoom,Sa as modifyMessage,Ir as onceEventListener,Oa as quitChatRoom,Xs as recallMessage,rc as registerMessageType,ga as removeAllExpansionForUltraGroupMessage,ba as removeChatRoomEntries,Pa as removeChatRoomEntry,Dr as removeConversation,Ec as removeConversationsFromTag,Tr as removeEventListener,_r as removeEventListeners,fa as removeExpansionForUltraGroupMessage,xa as removeFromBlacklist,nc as removeMessageExpansionForKey,Tc as removeTag,Rc as removeTagFromConversations,yc as removeTagsFromConversation,xr as saveTextMessageDraft,gc as searchConversationByContent,lc as searchMessages,Gs as sendFileMessage,Ds as sendGIFMessage,Bs as sendHQVoiceMessage,Js as sendImageMessage,Ps as sendMessage,Vs as sendReadReceiptMessage,js as sendReadReceiptMessageV4,Fs as sendReadReceiptRequest,Ys as sendReadReceiptResponse,Ks as sendReadReceiptResponseV2,ks as sendSightMessage,zs as sendSyncReadStatusMessage,bs as sendTextMessage,ic as sendTypingStatusMessage,ua as sendUltraGroupTypingStatus,wa as setChatRoomEntries,Ua as setChatRoomEntry,Wr as setConversationNotificationLevel,Xr as setConversationNotificationStatus,ta as setConversationToTop,Ac as setConversationToTopInTag,hc as setMessageReceivedStatus,Pc as setProxy,Ta as setUltraGroupDefaultNotificationLevel,Os as stopUploadTask,Gc as subscribeUserStatus,Lc as testProxy,Jc as unSubscribeUserStatus,va as updateExpansionForUltraGroupMessage,tc as updateMessageExpansion,_c as updateTag,As as upload};
1
+ import{httpRequest as e,NetworkType as t,HttpMethod as n,HTTP_TIMEOUT as i,appendUrl as o,ErrorCode as r,ReceivedStatus as a,ConversationType as s,EventEmitter as c,RCConnectionStatus as d,VersionManage as u,assert as l,AssertRules as v,isArray as f,isHttpUrl as g,APIContext as S,LogTagId as h,logger as T,ValidatorManage as I,validate as _,isValidConversationType as m,isValidNotificationLevel as p,NotificationLevel as N,UltraGroupChannelType as E,isNumber as y,isString as R,MessageType as C,MAX_UPLOAD_FILE_SIZE as O,UPLOAD_FILE_CHUNK_SIZE as A,UploadMethod as U,fixUrlProtocol as w,FileType as P,getUUID as M,MAX_MESSAGE_CONTENT_BYTES as b,isValidFileType as L,usingCppEngine as G,isLimitedArray as J,isValidTargetId as D,MessageDirection as B,SentStatus as k,isUndefined as x,notEmptyString as H,isValidConversation as V,transformReceivedStatusFlag as F,isInteger as Y,SubscribeType as q}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ErrorCode,FileType,InterruptionLevel,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,OnlineStatus,OperateStatus,PlatformInfo,PushImportanceHonor,RCConnectionStatus,ReceivedStatus,SentStatus,SubscribeOperationType,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var K=function(e,t){return K=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},K(e,t)};function z(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}K(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var j=function(){return j=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},j.apply(this,arguments)};function W(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function Q(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;r&&(r=0,s[0]&&(a=0)),a;)try{if(n=1,i&&(o=2&s[0]?i.return:s[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;switch(i=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}"function"==typeof SuppressedError&&SuppressedError;var X=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,i=t.length;n<i;n++)if(!e[t[n]])return!1;return!0}(uni))},Z=X();var $=null,ee=function(e){return W(void 0,void 0,void 0,(function(){var t;return Q(this,(function(n){switch(n.label){case 0:return[4,te.getNetworkType()];case 1:return t=n.sent(),$({status:"online"===e.type,type:t}),[2]}}))}))};var te={tag:"browser",httpReq:function(t){return e(t).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:Z,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,i=t.reason;e(n,i)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,i=e.effectiveType,o=n||i||t.UNKONWN;return Promise.resolve(o)},setNetworkStatusListener:function(e){$=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",ee),window.addEventListener("online",ee))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",ee),window.removeEventListener("online",ee)),$=null}},ne=X(),ie=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)}}},oe={setItem:ie("setStorageSync"),getItem:ie("getStorageSync"),removeItem:ie("removeStorageSync"),clear:ie("clearStorageSync")},re=null,ae=function(e){var t=e.isConnected,n=e.networkType;re({status:t,type:n})};var se={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){wx.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:oe,sessionStorage:oe,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ne,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){re=e,wx.onNetworkStatusChange(ae)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(ae),re=null}},ce=X(),de=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 i=my[e]({key:t[0]}).data;return i?JSON.stringify(i):i}catch(e){}}},ue={setItem:de("setStorageSync"),getItem:de("getStorageSync"),removeItem:de("removeStorageSync"),clear:de("clearStorageSync")},le=null,ve=function(e){var t=e.isConnected,n=e.networkType;le({status:t,type:n})};var fe={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:u,method:t,headers:s,timeout:a,data:d,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ue,sessionStorage:ue,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ce,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){le=e,my.onNetworkStatusChange(ve)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(ve),le=null}},ge=X(),Se=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){}}},he={setItem:Se("setStorageSync"),getItem:Se("getStorageSync"),removeItem:Se("removeStorageSync"),clear:Se("clearStorageSync")},Te=null,Ie=function(e){var t=e.isConnected,n=e.networkType;Te({status:t,type:n})};var _e={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:ge,localStorage:he,sessionStorage:he,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)||{},i={data:JSON.stringify(n),status:e.statusCode};t(i)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Te=e,tt.onNetworkStatusChange(Ie)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(Ie),Te=null}},me=X(),pe=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){}}},Ne={setItem:pe("setStorageSync"),getItem:pe("getStorageSync"),removeItem:pe("removeStorageSync"),clear:pe("clearStorageSync")},Ee=null,ye=function(e){var t=e.isConnected,n=e.networkType;Ee({status:t,type:n})};var Re={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:me,localStorage:Ne,sessionStorage:Ne,httpReq:function(e){return new Promise((function(t){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)||{},i={data:JSON.stringify(n),status:e.statusCode};t(i)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return W(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Ee=e,swan.onNetworkStatusChange(ye)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(ye),Ee=null}},Ce=X(),Oe=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:Oe("setStorageSync"),getItem:Oe("getStorageSync"),removeItem:Oe("removeStorageSync"),clear:Oe("clearStorageSync")},Ue=null,we=function(e){var t=e.isConnected,n=e.networkType;Ue({status:t,type:n})};var Pe={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){jd.request({url:u,method:t,header:s,timeout:a,data:d,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:Ce,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Ue=e,jd.onNetworkStatusChange(we)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(we),Ue=null}},Me=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},be={setItem:Me("setStorageSync"),getItem:Me("getStorageSync"),removeItem:Me("removeStorageSync"),clear:Me("clearStorageSync")},Le=null,Ge=function(e){var t=e.isConnected,n=e.networkType;Le({status:t,type:n})};var Je,De={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){uni.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:be,sessionStorage:be,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},i=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){i.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){i.onError((function(t){e(t.errMsg)}))},onMessage:function(e){i.onMessage((function(t){e(t.data)}))},onOpen:function(e){i.onOpen(e)},send:function(e){i.send({data:e})},close:function(e,t){i.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Le=e,uni.onNetworkStatusChange(Ge)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Ge),Le=null}},Be=function(e){return e&&e.request&&e.getSystemInfo},ke="undefined"!=typeof uni&&Be(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return De;case"mp-jd":return Pe;case"mp-baidu":return Re;case"mp-toutiao":return _e;case"mp-alipay":return fe;case"mp-weixin":return se;default:return te}}():"undefined"!=typeof jd&&Be(jd)?Pe:"undefined"!=typeof my&&Be(my)?fe:"undefined"!=typeof tt&&Be(tt)?_e:"undefined"!=typeof swan&&Be(swan)?Re:"undefined"!=typeof wx&&Be(wx)?se:te;function xe(e){var t=e.conversationType,n=e.channelId,i=e.messageType,o=e.content,r=e.senderUserId,s=e.targetId,c=e.sentTime,d=e.receivedTime,u=e.messageUId,l=e.messageDirection,v=e.isPersited,f=e.isCounted,g=e.isOffLineMessage,S=e.canIncludeExpansion,h=e.expansion,T=e.receivedStatus,I=e.receivedStatusInfo,_=e.disableNotification,m=e.isMentioned,p=e.isStatusMessage,N=e.readReceiptInfo,E=e.pushConfig,y=e.messageId,R=e.isInterrupt,C=e.isModifyMessage,O=e.channelType,A=e.sentStatus,U=e.directedUserIds;return T||(T=a.UNREAD),{messageType:i,channelId:n||"",content:o,senderUserId:r,targetId:s,conversationType:t,sentTime:c,receivedTime:d,messageUId:u,messageDirection:l,isPersited:v,isCounted:f,isMentioned:m,disableNotification:_,isStatusMessage:p,canIncludeExpansion:S,expansion:h,receivedStatus:T,receivedStatusInfo:I,readReceiptInfo:N,pushConfig:E,messageId:y,isInterrupt:R,isModifyMessage:C,sentStatus:A,isOffLineMessage:g,channelType:O,directedUserIds:U}}function He(e){var t=e.conversationType,n=e.targetId,i=e.latestMessage,o=e.unreadMessageCount,r=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,d=e.notificationStatus,u=e.notificationLevel,l=e.isTop,v=e.channelId,f=e.unreadMentionedCount,g=e.matchCount;e.unreadMentionedMeCount;var S=e.operationTime,h=e.draft,T={conversationType:t,targetId:n,latestMessage:i&&xe(i),unreadMessageCount:o,hasMentioned:r,mentionedInfo:r?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:d,notificationLevel:u,isTop:l,channelId:v,unreadMentionedCount:f,matchCount:g,operationTime:S,draft:h||""};return T.conversationType===s.ULTRA_GROUP&&(T.firstUnreadMessage=e.firstUnreadMessage,T.channelType=e.channelType,T.unreadMentionedMeCount=e.unreadMentionedMeCount),T}function Ve(e,t){null===console||void 0===console||console.warn("Method '"+e+"' is deprecated, please use '"+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.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",e.SYNC_READ_STATUS="SYNC_READ_STATUS",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",e.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",e.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",e.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED"}(Je||(Je={}));var Fe,Ye="A-add_to_blacklist-T",qe="A-add_to_blacklist-R",Ke="A-remove_from_blacklist-T",ze="A-remove_from_blacklist-R",je="A-get_blacklist-T",We="A-get_blacklist-R",Qe="A-get_blacklist_status-T",Xe="A-get_blacklist_status-R",Ze="A-get_chatroom_info-T",$e="A-get_chatroom_info-R",et="A-set_chatroom_entry-T",nt="A-set_chatroom_entry-R",it="A-set_chatroom_entries-T",ot="A-set_chatroom_entries-R",rt="A-force_set_chatroom_entry-T",at="A-force_set_chatroom_entry-R",st="A-remove_chatroom_entry-T",ct="A-remove_chatroom_entry-R",dt="A-remove_chatroom_entries-T",ut="A-remove_chatroom_entries-R",lt="A-force_remove_chatroom_entry-T",vt="A-force_remove_chatroom_entry-R",ft="A-get_chatroom_entry-T",gt="A-get_chatroom_entry-R",St="A-get_all_chatroom_entries-T",ht="A-get_all_chatroom_entries-R",Tt="A-get_chatroom_history_messages-T",It="A-get_chatroom_history_messages-R",_t="A-bind_rtc_room_for_chatroom-T",mt="A-bind_rtc_room_for_chatroom-R",pt="A-get_top_conversation_list-R",Nt="A-get_top_conversation_list-T",Et="A-get_conversation_list-T",yt="A-get_conversation_list-R",Rt="A-get_conversation-T",Ct="A-get_conversation-R",Ot="A-remove_conversation-T",At="A-remove_conversation-R",Ut="A-get_conversation_message_draft-T",wt="A-get_conversation_message_draft-R",Pt="A-save_conversation_message_draft-T",Mt="A-save_conversation_message_draft-R",bt="A-clear_conversation_message_draft-T",Lt="A-clear_conversation_message_draft-R",Gt="A-get_total_unread_count-T",Jt="A-get_total_unread_count-R",Dt="A-get_total_unread_count_by_levels-T",Bt="A-get_total_unread_count_by_levels-R",kt="A-get_unread_count-T",xt="A-get_unread_count-R",Ht="A-clear_unread_count-T",Vt="A-clear_unread_count-R",Ft="A-clear_all_unread_count-O",Yt="A-set_conversation_notification_level-T",qt="A-set_conversation_notification_level-R",Kt="A-set_conversation_status-T",zt="A-set_conversation_status-R",jt="A-get_conversation_notification_level-T",Wt="A-get_conversation_notification_level-R",Qt="A-get_conversation_notification_status-T",Xt="A-get_conversation_notification_status-R",Zt="A-set_conversation_notification_status-T",$t="A-set_conversation_notification_status-R",en="A-get_unread_conversation_list-T",tn="A-get_unread_conversation_list-R",nn="A-get_unread_mentioned_count-T",on="A-get_unread_mentioned_count-R",rn="A-get_all_unread_mentioned_count-T",an="A-get_all_unread_mentioned_count-R",sn="A-get_all_conversation-state-T",cn="A-e_get_all_conversation_list-T",dn="A-e_get_all_conversation_list-R",un="A-e_get_conversation_list-T",ln="A-e_get_conversation_list-R",vn="A-e_search_conversation_by_content-T",fn="A-e_search_conversation_by_content-R",gn="A-e_search_messages-T",Sn="A-e_search_messages-R",hn="A-e_search_message_in_time_range-T",Tn="A-e_search_message_in_time_range-R",In="A-e_search_messages_by_user-T",_n="A-e_search_messages_by_user-R",mn="A-e_get_history_messages_by_message_types-T",pn="A-e_get_history_messages_by_message_types-R",Nn="A-e_get_continuous_messages-T",En="A-e_get_continuous_messages-R",yn="A-e_set_message_status_to_read-T",Rn="A-e_set_message_status_to_read-R",Cn="A-e_set_message_received_status-T",On="A-e_set_message_received_status-R",An="A-e_set_message_sent_status-T",Un="A-e_set_message_sent_status-R",wn="A-e_set_message_sent_status_info-T",Pn="A-e_set_message_sent_status_info-R",Mn="A-e_set_message_content-T",bn="A-e_set_message_content-R",Ln="A-e_delete_messages-T",Gn="A-e_delete_messages-R",Jn="A-e_clear_messages-T",Dn="A-e_clear_messages-R",Bn="A-e_delete_messages_by_timestamp-T",kn="A-e_delete_messages_by_timestamp-R",xn="A-e_insert_message-T",Hn="A-e_insert_message-R",Vn="A-e_batch_insert_message-T",Fn="A-e_batch_insert_message-R",Yn="A-e_get_message_count-T",qn="A-e_get_message_count-R",Kn="A-e_get_private_message_deliver_time-T",zn="A-e_get_private_message_deliver_time-R",jn="A-e_get_group_message_deliver_list-T",Wn="A-e_get_group_message_deliver_list-R",Qn="A-e_set_check_duplicate_message-T",Xn="A-e_set_check_duplicate_message-R",Zn="A-e_set_check_duplicate_message-T",$n="A-e_set_check_duplicate_message-R",ei="A-batch_Remove_conversation-T",ti="A-batch_Remove_conversation-R",ni="A-batch_set_con_notifi_level-T",ii="A-batch_set_con_notifi_level-R",oi="A-batch_set_con_to_top-T",ri="A-batch_set_con_to_top-R",ai="A-batch_clear_remote_msg-T",si="A-batch_clear_remote_msg-R",ci="A-batch_clear_msg-T",di="A-batch_clear_msg-R",ui="A-get_remote_history_messages-T",li="A-get_remote_history_messages-R",vi="A-recall_message-T",fi="A-recall_message-R",gi="A-delete_remote_message-T",Si="A-delete_remote_message-R",hi="A-delete_remote_message_by_timestamp-T",Ti="A-delete_remote_message_by_timestamp-R",Ii="A-update_message_expansion-T",_i="A-update_message_expansion-R",mi="A-remove_message_expansion_for_key-T",pi="A-remove_message_expansion_for_key-R",Ni="A-get_message_reader-T",Ei="A-get_message_reader-R",yi="A-get_first_unread_message-T",Ri="A-get_first_unread_message-R",Ci="A-get_first_unread_message_info-T",Oi="A-get_first_unread_message_info-R",Ai="A-insert_message-T",Ui="A-insert_message-R",wi="A-get_message-T",Pi="A-get_message-R",Mi="A-get_unread_mentioned_messages-T",bi="A-get_unread_mentioned_messages-R",Li="A-delete_local_messages_by_timestamp-T",Gi="A-delete_local_messages_by_timestamp-R",Ji="A-clear_messages-T",Di="A-clear_messages-R",Bi="A-search_conversation_by_content-T",ki="A-search_conversation_by_content-R",xi="A-clear_unread_count_by_timestamp-T",Hi="A-clear_unread_count_by_timestamp-R",Vi="A-set_message_received_status-T",Fi="A-set_message_received_status-R",Yi="A-set_proxy-T",qi="A-set_proxy-R",Ki="A-get_proxy-T",zi="A-get_proxy-R",ji="A-test_proxy-T",Wi="A-test_proxy-R",Qi="A-add_tag-T",Xi="A-add_tag-R",Zi="A-remove_tag-T",$i="A-remove_tag-R",eo="A-update_tag-T",to="A-update_tag-R",no="A-get_tags-T",io="A-get_tags-R",oo="A-get_tags_for_conversation-T",ro="A-get_tags_for_conversation-R",ao="A-add_tag_for_conversations-T",so="A-add_tag_for_conversations-R",co="A-remove_conversations_from_tag-T",uo="A-remove_conversations_from_tag-R",lo="A-remove_tags_from_conversation-T",vo="A-remove_tags_from_conversation-R",fo="A-remove_tag_from_conversations-T",go="A-remove_tag_from_conversations-R",So="A-get_conversations_from_tag_by_page-T",ho="A-get_conversations_from_tag_by_page-R",To="A-get_unread_count_by_tag-T",Io="A-get_unread_count_by_tag-R",_o="A-set_conversation_status_in_tag-R",mo="A-get_ultra_group_list-T",po="A-get_ultra_group_list-R",No="A-get_block_ultra_group_list-T",Eo="A-get_block_ultra_group_list-R",yo="A-send_ultra_group_typing_status-T",Ro="A-send_ultra_group_typing_status-R",Co="A-get_ultra_group_message_list_by_message_uid-T",Oo="A-get_ultra_group_message_list_by_message_uid-R",Ao="A-update_expansion_for_ultra_group_message-T",Uo="A-update_expansion_for_ultra_group_message-R",wo="A-remove_expansion_for_ultra_group_message-T",Po="A-remove_expansion_for_ultra_group_message-R",Mo="A-remove_all_expansion_for_ultra_group_message-T",bo="A-remove_all_expansion_for_ultra_group_message-R",Lo="A-modify_message-T",Go="A-modify_message-R",Jo="A-get_ultra_group_unread_mentioned_count_by_target_id-T",Do="A-get_ultra_group_unread_mentioned_count_by_target_id-R",Bo="A-get_ultra_group_default_notification_level-T",ko="A-get_ultra_group_default_notification_level-R",xo="A-set_ultra_group_default_notification_level-T",Ho="A-set_ultra_group_default_notification_level-R",Vo="A-get_ultra_group_unread_count_by_target_id-T",Fo="A-get_ultra_group_unread_count_by_target_id-R",Yo="A-get_all_ultra_group_unread_count-T",qo="A-get_all_ultra_group_unread_count-R",Ko="A-get_all_ultra_group_unread_mentioned_count-T",zo="A-get_all_ultra_group_unread_mentioned_count-R",jo="A-get_ultra_group_unread_mentioned_messages-T",Wo="A-get_ultra_group_unread_mentioned_messages-R",Qo="A-get_ultra_group_first_unread_message_timestamp-T",Xo="A-get_ultra_group_first_unread_message_timestamp-R",Zo="A-get_ultra_group_unread_info_list-T",$o="A-get_ultra_group_unread_info_list-R",er="A-subscribe_user_status-T",tr="A-subscribe_user_status-R",nr="A-unsubscribe_user_status-T",ir="A-unsubscribe_user_status-R",or="A-get_subscribe_user_status-T",rr="A-get_subscribe_user_status-R",ar="A-get_subscribe_user_status_list-T",sr="A-get_subscribe_user_status_list-R",cr="A-get_message_by_timestamp-T",dr="A-get_message_by_timestamp-R",ur="A-get_conversations-T",lr="A-get_conversations-R";!function(e){e[e.DISALLOW=0]="DISALLOW",e[e.ALLOW=1]="ALLOW"}(Fe||(Fe={}));var vr=new c,fr={connection:function(e,t){switch(e){case d.CONNECTED:vr.emit(Je.CONNECTED);break;case d.CONNECTING:vr.emit(Je.CONNECTING);break;case d.SUSPENDED:vr.emit(Je.SUSPEND,t);break;case d.DISCONNECTED:vr.emit(Je.DISCONNECT,t)}},batchMessage:function(e){vr.emit(Je.MESSAGES,{messages:e.map((function(e){return xe(e)}))})},typingState:function(e){vr.emit(Je.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n,i){vr.emit(Je.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:i})},messageReceiptRequest:function(e,t,n){vr.emit(Je.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){vr.emit(Je.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?xe(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=gr(e.unreadMessageCount||0),n.unreadMentionedCount=gr(e.unreadMentionedCount||0),n.unreadMentionedMeCount=gr(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));vr.emit(Je.CONVERSATION,{conversationList:t})},chatroomState:function(e){vr.emit(Je.CHATROOM,e)},expansion:function(e){vr.emit(Je.EXPANSION,e)},pullFinished:function(){vr.emit(Je.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){vr.emit(Je.TAG)},conversationTagChanged:function(){vr.emit(Je.CONVERSATION_TAG)},messageBlocked:function(e){vr.emit(Je.MESSAGE_BLOCKED,e)},messageDelivered:function(e){vr.emit(Je.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){vr.emit(Je.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){vr.emit(Je.ULTRA_GROUP_ENABLE,e.map((function(e){return He(e)})))},operateStatus:function(e){vr.emit(Je.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){vr.emit(Je.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return xe(e)})))},ultraGroupMessageModified:function(e){vr.emit(Je.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return xe(e)})))},ultraGroupMessageRecalled:function(e){vr.emit(Je.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return xe(e)})))},ultraGroupChannelChangeType:function(e){vr.emit(Je.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){vr.emit(Je.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){vr.emit(Je.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){vr.emit(Je.USER_GROUP_STATUS,e)},messageReadReceipt:function(e){vr.emit(Je.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:function(e){vr.emit(Je.SYNC_READ_STATUS,e)},subscribedUserStatusChange:function(e){vr.emit(Je.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:function(e){vr.emit(Je.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:function(){vr.emit(Je.SYNC_SUBSCRIBED_USER_STATUS_FINISHED)}};function gr(e){return e>999?999:e}u.add("imlib-next","5.9.9");var Sr=null,hr=null,Tr=null;function Ir(){return W(this,void 0,void 0,(function(){return Q(this,(function(e){switch(e.label){case 0:return Sr?(Tr.info(h.A_DESTROY_O),[4,S.destroy()]):[2];case 1:return e.sent(),hr=null,Sr=null,Tr=null,[2]}}))}))}function _r(e){if(!Sr)throw new Error("Not initialized yet!");return e(Sr,Tr,hr)}function mr(e){return Sr?e(Sr,Tr,hr):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function pr(e,t,n){vr.on(e,t,n)}function Nr(e,t,n){vr.once(e,t,n)}function Er(e,t,n){vr.off(e,t,n)}function yr(e){vr.removeAll(e)}function Rr(){vr.clear()}function Cr(e){!function(e){var t,n,i=e.appkey,o=e.navigators;Sr?Tr.warn(h.A_INIT_REPEAT_O):(l("options.appkey",e.appkey,v.STRING,!0),l("options.navigators",e.navigators,(function(e){return f(e)&&(0===e.length||e.every(g))})),hr=e,Sr=S.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||ke,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,uploadDomain:e.uploadDomain,environment:null!==(n=e.environment)&&void 0!==n?n:"default"}),(Tr=Sr.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Tr.info(h.A_INIT_O,JSON.stringify({appkey:i,navigators:o,version:"5.9.9",commit:"ac04313edeb4b97f5b9015d75bbe9396b2781d95"})),Sr.assignWatcher(fr),T.init(Tr))}(e)}function Or(){return W(this,void 0,void 0,(function(){return Q(this,(function(e){return Sr?(Rr(),[2,Ir()]):[2]}))}))}function Ar(){return _r((function(e){return e.getConnectionStatus()}))}function Ur(){return _r((function(e){return e.getServerTime()}))}function wr(){return _r((function(e){return e.getCurrentUserId()}))}function Pr(e,t){u.add(e,t)}function Mr(){return _r((function(e){return e.getDeviceId()}))}function br(e,t){return _r((function(n){return n.install(e,t)}))}var Lr={TIMEOUT:{code:-1,msg:"Network timeout"},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!"}},Gr={};for(var Jr in Lr){var Dr=Lr[Jr].code;Gr[Dr]=Jr}function Br(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(h.A_CONNECT_T,h.A_CONNECT_R).validate("token",e,v.STRING,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(h.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,i.connect(e,!!t,n)];case 1:return a=c.sent(),s=a.code===r.SUCCESS?"info":"warn",o[s](h.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===r.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:Gr[a.code]}]}}))}))}))]}))}))}function kr(e){return T.info(h.A_DISCONNECT_O,{}),_r((function(t){return t.disconnect(e)}))}function xr(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Et,yt).validate("count",null==e?void 0:e.count,v.NUMBER).validate("startTime",null==e?void 0:e.startTime,v.NUMBER).validate("order",null==e?void 0:e.order,v.NUMBER).validate("channelId",t,v.CHANNEL_ID).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(Et,JSON.stringify({count:null==e?void 0:e.count,startTime:null==e?void 0:e.startTime,order:null==e?void 0:e.order,channelId:t}),n),[4,i.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 a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=c.map((function(e){return He(e)})),o.info(yt,JSON.stringify({code:s,list:d.length}),n),[2,{code:0,data:d}]):(o.warn(yt,JSON.stringify({code:s})),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function Hr(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Rt,Ct).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Rt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversation(t,o,a||"")];case 1:return c=v.sent(),d=c.code,u=c.data,l=d===r.SUCCESS?"info":"warn",i[l](Ct,JSON.stringify({code:d}),s),d!==r.SUCCESS?[2,{code:d,msg:Gr[d]}]:[2,{code:d,data:u?He(u):null}]}}))}))}))]}))}))}function Vr(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Ot,At).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ot,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.removeConversation(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](At,JSON.stringify({code:c}),s),c!==r.SUCCESS?[2,{code:c,msg:Gr[c]}]:[2,{code:c}]}}))}))}))]}))}))}function Fr(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(ei,ti).validate("conversations",e,(function(t){if(!_("conversations",t,v.ARRAY,!0))return!1;if(t.length>20||0===t.length)return!1;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(!(_("conversations",o,v.OBJECT,!0)&&_("conversations.targetId",o.targetId,v.STRING,!0)&&_("conversations.conversationType",o.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(ti,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",o.channelId,v.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return t=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),o=i.createTraceId(),i.info(ei,"conversations: "+JSON.stringify(t),o),[4,n.batchRemoveConversation(t)];case 1:return a=s.sent(),i[r.SUCCESS===a?"info":"warn"](ti,"code: "+a,o),[2,{code:a}]}}))}))}))]}))}))}function Yr(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Ut,wt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ut,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationMessageDraft(t,o,a)];case 1:return c=v.sent(),d=c.code,u=c.data,l=d===r.SUCCESS?"info":"warn",i[l](wt,JSON.stringify({code:d,data:u}),s),d===r.SUCCESS?[2,{code:d,data:u||""}]:[2,{code:d,msg:Gr[d]}]}}))}))}))]}))}))}function qr(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Pt,Mt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("draft",t,v.STRING,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(Pt,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,draft:t}),n),[4,i.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Mt,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Gr[a]}]}}))}))}))]}))}))}function Kr(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(bt,Lt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(bt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearConversationMessageDraft(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Lt,JSON.stringify({code:c}),s),c===r.SUCCESS?[2,{code:c}]:[2,{code:c,msg:Gr[c]}]}}))}))}))]}))}))}function zr(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Gt,Jt).validate("conversationTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!1).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Gt,JSON.stringify({conversationTypes:t,includeMuted:e}),n),[4,i.getTotalUnreadCount("",t,e)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Jt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Jt,JSON.stringify({code:s}),n),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function jr(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Dt,Bt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!0).validate("levels",t,(function(e){return!!f(t)&&!e.some((function(e){return!p(e)}))}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Dt,JSON.stringify({conversationTypes:e,levels:t,isMentioned:!1}),n),[4,i.getTotalUnreadCountByLevels(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Bt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Bt,JSON.stringify({code:s}),n),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function Wr(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Dt,Bt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!0).validate("levels",t,(function(e){return!!f(e)&&!e.some((function(e){return!p(e)}))}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Dt,JSON.stringify({conversationTypes:e,levels:t,isMentioned:!0}),n),[4,i.getTotalUnreadCountByLevels(e,t,!0)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Bt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Bt,JSON.stringify({code:s}),n),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function Qr(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(kt,xt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(kt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getUnreadCount(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(xt,JSON.stringify({code:d,data:u})),[2,{code:d,data:u}]):(i.warn(xt,JSON.stringify({code:d})),[2,{code:d,msg:Gr[d]}])}}))}))}))]}))}))}function Xr(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Ht,Vt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ht,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearUnreadCount(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Vt,JSON.stringify({code:c}),s),c!==r.SUCCESS?[2,{code:c,msg:Gr[c]}]:[2,{code:c}]}}))}))}))]}))}))}function Zr(){return W(this,void 0,void 0,(function(){var e=this;return Q(this,(function(t){return[2,new I("","").ifReady((function(t,n){return W(e,void 0,void 0,(function(){var e;return Q(this,(function(i){switch(i.label){case 0:return e=n.createTraceId(),n.info(Ft,"",e),[4,t.clearAllUnreadCount()];case 1:return[2,{code:i.sent()}]}}))}))}))]}))}))}Lr.ROAMING_SERVICE_UNAVAILABLE.code;var $r=function(e,t,n,i){return void 0===i&&(i=""),W(void 0,void 0,void 0,(function(){var o,a;return Q(this,(function(s){switch(s.label){case 0:return o=function(e,t,n){void 0===n&&(n="");var i="conversationType:"+t.conversationType+",targetId:"+t.targetId;return e.debug(h.O,n+" -> "+i),i}(e,t,i),[4,n()];case 1:return(a=s.sent())!==r.SUCCESS?(e.warn(h.O,i+" fail -> "+a+" : "+Gr[a]+" , "+o),[2,{code:a,msg:Gr[a]}]):[2,{code:a}]}}))}))};function ea(e,t){return W(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,new I(Yt,qt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationLevel",t,(function(e){return void 0!==N[e]}),!0).ifReady((function(n,i){return $r(i,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]}))}))}function ta(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(ni,ii).validate("conversations",e,(function(e){if(!_("conversations",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("conversations",i,v.OBJECT,!0)&&_("conversations.targetId",i.targetId,v.STRING,!0)&&_("conversations.conversationType",i.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(ti,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).validate("notificationLevel",t,(function(e){return[-1,0,1,2,3,4,5].includes(e)}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),a=o.createTraceId(),o.info(ni,"conversations: "+JSON.stringify(n),a),[4,i.batchSetConversationNotificationLevel(n,t)];case 1:return s=c.sent(),o[r.SUCCESS===s?"info":"warn"](ii,"code: "+s,a),[2,{code:s}]}}))}))}))]}))}))}function na(e,t){return W(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,new I(Zt,$t).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationStatus",t,(function(e){return 1===e||2===e}),!0).ifReady((function(n,i){return $r(i,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]}))}))}function ia(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Wt,Wt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(jt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationNotificationLevel(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Wt,JSON.stringify({code:d,data:u}),s),[2,{code:d,data:u}]):(i.warn(Wt,JSON.stringify({code:d}),s),[2,{code:d,msg:Gr[d]}])}}))}))}))]}))}))}function oa(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Qt,Xt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Qt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationNotificationStatus(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Xt,JSON.stringify({code:d,data:u}),s),[2,{code:d,data:u}]):(i.warn(Xt,JSON.stringify({code:d}),s),[2,{code:d,msg:Gr[d]}])}}))}))}))]}))}))}function ra(){return W(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,new I("","").ifReady((function(e){return e.getBlockConversationList()}))]}))}))}function aa(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return _("conversationType",e,(function(){return[s.PRIVATE,s.GROUP,s.SYSTEM,s.PUBLIC_SERVICE,s.APP_PUBLIC_SERVICE,s.ULTRA_GROUP].includes(e)}))&&_("level",t,p)?[2,mr((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return o.info(h.O,"setConversationTypeNotificationLevel ->conversationType:"+e+",level:"+t),[4,i.setConversationTypeNotificationLevel(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(o.warn(h.O,"setConversationTypeNotificationLevel ->conversationType:"+e+",level:"+t),[2,{code:a,msg:Gr[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sa(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return _("conversationType",e,(function(){return[s.PRIVATE,s.GROUP,s.SYSTEM,s.PUBLIC_SERVICE,s.APP_PUBLIC_SERVICE,s.ULTRA_GROUP].includes(e)}))?[2,mr((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return i.info(h.O,"getConversationTypeNotificationLevel ->conversationType:"+e),[4,n.getConversationTypeNotificationLevel(e)];case 1:return t=s.sent(),o=t.code,a=t.data,o===r.SUCCESS?[2,{code:o,data:a}]:(i.warn(h.O,"getConversationTypeNotificationLevel ->conversationType:"+e),[2,{code:o,msg:Gr[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ca(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(Kt,zt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("isTop",t,v.BOOLEAN).validate("isUpdateTime",n,v.BOOLEAN).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:return i=e.conversationType,s=e.targetId,c=e.channelId,d=a.createTraceId(),a.info(Kt,JSON.stringify({conversationType:i,targetId:s,channelId:c,isTop:t}),d),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId,n)];case 1:return u=v.sent(),l=u===r.SUCCESS?"info":"warn",a[l](zt,JSON.stringify({code:u}),d),u!==r.SUCCESS?[2,{code:u,msg:Gr[u]}]:[2,{code:u}]}}))}))}))]}))}))}function da(e,t,n){return W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(oi,ri).validate("conversations",e,(function(e){if(!_("conversations",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("conversations",i,v.OBJECT,!0)&&_("conversations.targetId",i.targetId,v.STRING,!0)&&_("conversations.conversationType",i.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(ti,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).validate("isTop",t,v.BOOLEAN,!0).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,s,c;return Q(this,(function(d){switch(d.label){case 0:return i=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),s=a.createTraceId(),a.info(oi,"conversations: "+JSON.stringify(i),s),[4,o.batchSetConversationToTop(i,t,n)];case 1:return c=d.sent(),a[r.SUCCESS===c?"info":"warn"](ri,"code: "+c,s),[2,{code:c}]}}))}))}))]}))}))}function ua(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Nt,pt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))})).validate("channelId",t,v.CHANNEL_ID).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(Nt,JSON.stringify({conversationTypes:e,channelId:t}),n),[4,i.getTopConversationList(e,t)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.map((function(e){return d.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId}),He(e)})),o.info(pt,JSON.stringify({code:s,list:d}),n),[2,{code:0,data:u}]):(o.warn(h.A_GET_TOP_CONVERSATION_LIST_E,JSON.stringify({code:s}),n),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function la(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(en,tn).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))})).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return t=i.createTraceId(),i.info(en,JSON.stringify({conversationTypes:e}),t),[4,n.getUnreadConversationList(e)];case 1:return o=u.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(c=[],d=s.map((function(e){return c.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,unreadMessageCount:e.unreadMessageCount}),He(e)})),i.info(tn,JSON.stringify({code:a,list:c}),t),[2,{code:0,data:d}]):(i.warn(tn,JSON.stringify({code:a}),t),[2,{code:a,msg:Gr[a]}])}}))}))}))]}))}))}function va(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Qt,Xt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(nn,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),t),[4,n.getUnreadMentionedCount(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(on,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(on,JSON.stringify({code:a}),t),[2,{code:a}])}}))}))}))]}))}))}function fa(){return W(this,void 0,void 0,(function(){var e=this;return Q(this,(function(t){return[2,new I("","").ifReady((function(t,n){return W(e,void 0,void 0,(function(){var e,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(rn,"",e),[4,t.getAllUnreadMentionedCount()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.warn(an,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):[2,{code:o}]}}))}))}))]}))}))}function ga(){return W(this,void 0,void 0,(function(){var e=this;return Q(this,(function(t){return[2,new I("","").ifReady((function(t,n){return W(e,void 0,void 0,(function(){var e,i,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(sn,"",e),[4,t.getAllConversationState()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](zt,JSON.stringify({code:o}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o}]}}))}))}))]}))}))}function Sa(e){return void 0===e&&(e={}),W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(mo,po).validate("targetId",null==e?void 0:e.targetId,v.STRING,!1).validate("channelType",null==e?void 0:e.channelType,(function(e){return void 0!==E[e]}),!1).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(mo,JSON.stringify({targetId:e.targetId,channelType:e.channelType}),t),[4,n.getUltraGroupList(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(po,JSON.stringify({code:a,length:null==s?void 0:s.length}),t),[2,{code:r.SUCCESS,data:s}]):(i.warn(po,JSON.stringify({code:a}),t),[2,{code:a,msg:Gr[a]}])}}))}))}))]}))}))}function ha(){return W(this,void 0,void 0,(function(){var e=this;return Q(this,(function(t){return[2,new I("","").ifReady((function(t,n){return W(e,void 0,void 0,(function(){var e,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(No,"",e),[4,t.getBlockUltraGroupList()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.info(Eo,JSON.stringify({code:o,length:null==a?void 0:a.length}),e),[2,{code:r.SUCCESS,data:a}]):(n.warn(Eo,JSON.stringify({code:o}),e),[2,{code:o,msg:Gr[o]}])}}))}))}))]}))}))}function Ta(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(yo,Ro).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(yo,JSON.stringify({targetId:e.targetId,channelId:e.channelId}),t),[4,n.sendUltraGroupTypingStatus(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](Ro,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:o,msg:Gr[o]}]}}))}))}))]}))}))}function Ia(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Co,Oo).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messages",t,v.ARRAY,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h;return Q(this,(function(T){switch(T.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),d={targetId:n,conversationType:a,messages:c},u=o.createTraceId(),o.info(Co,JSON.stringify(d),u),[4,i.getUltraGroupMessageListByMessageUId(d)];case 1:if(l=T.sent(),v=l.code,f=l.data,v===r.SUCCESS){for(h in g={},S=[],f)S.push(h),g[h]=f[h]?xe(f[h]):void 0;return o.info(Oo,JSON.stringify({code:v,messageUIds:S}),u),[2,{code:r.SUCCESS,data:g}]}return o.warn(Oo,JSON.stringify({code:v}),u),[2,{code:v,msg:Gr[v]}]}}))}))}))]}))}))}function _a(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Ao,Uo).validate("expansion",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g;return Q(this,(function(S){switch(S.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l=o.createTraceId(),o.info(Ao,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:u}),l),v={targetId:a,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:s,expansion:e},[4,i.expandUltraMessage(v)];case 1:return f=S.sent().code,g=f===r.SUCCESS?"info":"warn",o[g](Uo,JSON.stringify({code:f}),l),f===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:f,msg:Gr[f]}]}}))}))}))]}))}))}function ma(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(wo,Po).validate("expansion",e,v.ARRAY,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g;return Q(this,(function(S){switch(S.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l=o.createTraceId(),o.info(wo,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:u}),l),v={targetId:a,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:s,keys:e},[4,i.expandUltraMessage(v)];case 1:return f=S.sent().code,g=f===r.SUCCESS?"info":"warn",o[g](Po,JSON.stringify({code:f}),l),f===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:f,msg:Gr[f]}]}}))}))}))]}))}))}function pa(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Mo,bo).validate("message",e,v.OBJECT,!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,v,f;return Q(this,(function(g){switch(g.label){case 0:return t=e.conversationType,o=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,d=e.channelId,u=i.createTraceId(),i.info(Mo,JSON.stringify({conversationType:t,targetId:o,messageUId:a,channelId:d}),u),l={targetId:o,channelId:d,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return v=g.sent().code,f=v===r.SUCCESS?"info":"warn",i[f](bo,JSON.stringify({code:v}),u),v===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:v,msg:Gr[v]}]}}))}))}))]}))}))}function Na(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Go,Go).validate("content",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S;return Q(this,(function(h){switch(h.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,d=t.sentTime,u=t.canIncludeExpansion,l=t.channelId,v=o.createTraceId(),o.info(Lo,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:l}),v),f={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:d,canIncludeExpansion:u,messageUId:s,content:e},[4,i.modifyMessage(f)];case 1:return g=h.sent().code,S=g===r.SUCCESS?"info":"warn",o[S](Go,JSON.stringify({code:g}),v),g===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:g,msg:Gr[g]}]}}))}))}))]}))}))}function Ea(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Jo,Jo).validate("targetId",e,v.STRING,!0).validate("notificationLevels",t,v.ARRAY).validate("notificationLevels",t,(function(e){return!(null==t?void 0:t.some((function(e){return!p(e)})))})).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Jo,JSON.stringify({targetId:e,notificationLevels:t}),n),[4,i.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Do,JSON.stringify({code:s,data:c}),e),[2,{code:r.SUCCESS,data:c}]):(o.warn(Do,JSON.stringify({code:s}),n),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function ya(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Bo,ko).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Bo,JSON.stringify({targetId:e.targetId,channelId:e.channelId}),t),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(ko,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(ko,JSON.stringify({code:a}),t),[2,{code:a,msg:Gr[a]}])}}))}))}))]}))}))}function Ra(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return e.channelId=e.channelId||"",[2,new I(xo,Ho).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationLevel",t,(function(e){return void 0!==N[e]}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(xo,JSON.stringify({targetId:e.targetId,channelId:e.channelId,notificationLevel:t}),n),[4,i.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](Ho,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Gr[a]}]}}))}))}))]}))}))}function Ca(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Vo,Fo).validate("targetId",e,v.STRING,!0).validate("notificationLevels",t,v.ARRAY).validate("notificationLevels",t,(function(e){return!(null==t?void 0:t.some((function(e){return!p(e)})))})).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(Vo,JSON.stringify({targetId:e,notificationLevels:t}),n),[4,i.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](Fo,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]}}))}))}))]}))}))}function Oa(){return W(this,void 0,void 0,(function(){var e=this;return Q(this,(function(t){return[2,new I(Yo,qo).ifReady((function(t,n){return W(e,void 0,void 0,(function(){var e,i,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(Yo,"getAllUltraGroupUnreadCount",e),[4,t.getAllUltraGroupUnreadCount()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](qo,JSON.stringify({code:o,data:a}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o,msg:Gr[o]}]}}))}))}))]}))}))}function Aa(){return W(this,void 0,void 0,(function(){var e=this;return Q(this,(function(t){return[2,new I(Ko,zo).ifReady((function(t,n){return W(e,void 0,void 0,(function(){var e,i,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(Ko,"getAllUltraGroupUnreadCount",e),!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](zo,JSON.stringify({code:o,data:a}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o,msg:Gr[o]}]}}))}))}))]}))}))}function Ua(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return e.channelId=e.channelId||"",[2,new I(jo,Wo).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("sentTime",null==e?void 0:e.sentTime,v.NUMBER,!0).validate("count",null==e?void 0:e.count,(function(e){return y(e)&&e>0&&e<=50}),!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,v;return Q(this,(function(f){switch(f.label){case 0:return t=e.targetId,o=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:o,sentTime:a,count:s},d=i.createTraceId(),i.info(jo,JSON.stringify(c),d),[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),l=u.code,v=u.data,l===r.SUCCESS?(i.info(Wo,JSON.stringify({code:l,data:null==v?void 0:v.map((function(e){return e.messageUId}))}),d),[2,{code:l,data:v}]):(i.warn(Wo,JSON.stringify({code:l}),d),[2,{code:l,msg:Gr[l]}])}}))}))}))]}))}))}function wa(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(jo,Wo).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID,!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return t=e.targetId,o=e.channelId,a={targetId:t,channelId:o},s=i.createTraceId(),i.info(Qo,JSON.stringify(a),s),[4,n.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Xo,JSON.stringify({code:d,sentTime:null==u?void 0:u.sentTime}),s),[2,{code:d,data:u}]):(i.warn(Xo,JSON.stringify({code:d}),s),[2,{code:d,msg:Gr[d]}])}}))}))}))]}))}))}function Pa(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Zo,$o).validate("targetIds",e,(function(t){return!!_("targetIds",e,v.ARRAY,!0)&&(!(t.length<=0||t.length>20)&&!e.some((function(e){return!R(e)})))})).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return t=e.filter((function(t,n){return e.indexOf(t)===n})),o=i.createTraceId(),i.info(Zo,JSON.stringify({targetIds:e}),o),[4,n.getUltraGroupUnreadInfoList(t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",i[d]($o,JSON.stringify({code:s}),o),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Gr[s]}]}}))}))}))]}))}))}function Ma(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(h.A_JOIN_CHATROOM_T,h.A_JOIN_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",t,v.OBJECT,!0).validate("count",null==t?void 0:t.count,v.NUMBER,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,i.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Gr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function ba(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(h.A_JOIN_CHATROOM_T,h.A_JOIN_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",null==t?void 0:t.count,v.NUMBER,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,i.joinExistChatroom(e,t.count,n)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](h.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==r.SUCCESS?[2,{code:s,msg:Gr[s]}]:[2,{code:s,data:c}]}}))}))}))]}))}))}function La(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(h.A_QUIT_CHATROOM_T,h.A_QUIT_CHATROOM_R).validate("targetId",e,v.STRING,!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(h.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](h.A_QUIT_CHATROOM_R,JSON.stringify({code:o}),t),o!==r.SUCCESS?[2,{code:o,msg:Gr[o]}]:[2,{code:o}]}}))}))}))]}))}))}function Ga(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(h.A_QUIT_CHATROOM_T,h.A_QUIT_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",null==t?void 0:t.count,v.NUMBER).validate("order",null==t?void 0:t.order,(function(e){return[0,1,2].includes(e)})).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(Ze,JSON.stringify({chatroomId:e,count:null==t?void 0:t.count,order:null==t?void 0:t.order}),n),[4,i.getChatroomInfo(e,null==t?void 0:t.count,null==t?void 0:t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d]($e,JSON.stringify({code:s}),n),s===r.SUCCESS&&c?[2,{code:s,data:c}]:[2,{code:s,msg:Gr[s]}]}}))}))}))]}))}))}function Ja(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(et,nt).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("value",null==t?void 0:t.value,v.STRING,!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(et,JSON.stringify({chatroomId:e,key:t.key,value:t.value,isSendNotification:t.isSendNotification,isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra}),n),[4,i.setChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](nt,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Gr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function Da(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(it,ot).validate("targetId",e,v.STRING,!0).validate("entries",null==t?void 0:t.entries,(function(e){return!!_("entry.key",e,v.ARRAY,!0)&&t.entries.every((function(e){return _("entry.key",e.key,v.STRING,!0)&&_("entry.value",e.value,v.STRING,!0)}))}),!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isForce",null==t?void 0:t.isForce,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return t.entries.length>10?[2,Lr.CHATROOM_KV_STORE_OUT_LIMIT]:(n=o.createTraceId(),o.info(it,JSON.stringify({chatroomId:e,entries:t.entries.map((function(e){return{key:e.key,value:e.value}})),isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra,isForce:t.isForce}),n),[4,i.setChatroomEntries(e,t)]);case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](ot,JSON.stringify({code:s}),n),s!==r.SUCCESS?[2,{code:s,msg:Gr[s],data:c}]:[2,{code:s}]}}))}))}))]}))}))}function Ba(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(rt,at).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("value",null==t?void 0:t.value,v.STRING,!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(rt,JSON.stringify({chatroomId:e,key:t.key,value:t.value,isSendNotification:t.isSendNotification,isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra}),n),[4,i.forceSetChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](at,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Gr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function ka(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(st,ct).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(st,JSON.stringify({chatroomId:e,key:t.key,isSendNotification:t.isSendNotification,notificationExtra:t.notificationExtra}),n),[4,i.removeChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](ct,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Gr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function xa(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(dt,ut).validate("targetId",e,v.STRING,!0).validate("entries",null==t?void 0:t.entries,(function(e){return!!_("entry.key",e,v.ARRAY,!0)&&t.entries.every((function(e){return _("key",e,v.STRING,!0)}))}),!0).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return n=t.entries.map((function(e){return{key:e}})),a=o.createTraceId(),o.info(dt,JSON.stringify({chatroomId:e,notificationExtra:t.notificationExtra,entries:n}),a),[4,i.removeChatroomEntries(e,{entries:n,notificationExtra:t.notificationExtra})];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",o[u](ut,JSON.stringify({code:c}),a),c!==r.SUCCESS?[2,{code:c,msg:Gr[c],data:d}]:[2,{code:c}]}}))}))}))]}))}))}function Ha(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(lt,vt).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,v.STRING).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(lt,JSON.stringify({chatroomId:e,key:t.key,isSendNotification:t.isSendNotification,notificationExtra:t.notificationExtra}),n),[4,i.forceRemoveChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](vt,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Gr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function Va(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(ft,gt).validate("targetId",e,v.STRING,!0).validate("key",t,(function(e){return R(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(ft,JSON.stringify({chatroomId:e,key:t}),n),[4,i.getChatroomEntry(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(o.info(gt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(gt,JSON.stringify({code:s}),n),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function Fa(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(St,ht).validate("targetId",e,v.STRING,!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(St,JSON.stringify({chatroomId:e}),t),[4,n.getAllChatroomEntries(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(i.info(ht,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(ht,JSON.stringify({code:a}),t),[2,{code:a,msg:Gr[a]}])}}))}))}))]}))}))}function Ya(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Tt,It).validate("targetId",e,v.STRING,!0).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(Tt,JSON.stringify({chatroomId:e,timestamp:t.timestamp,count:t.count,order:t.order}),n),[4,i.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),xe(e)})),o.info(It,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(o.warn(It,JSON.stringify({code:s}),n),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function qa(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(_t,mt).validate("targetId",null==e?void 0:e.chatRoomId,v.STRING,!0).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,v.STRING,!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(_t,JSON.stringify({chatRoomId:e.chatRoomId,rtcRoomId:e.rtcRoomId}),t),[4,n.bindRTCRoomForChatroom(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](mt,JSON.stringify({code:o}),t),[2,{code:o,msg:Gr[o]}]}}))}))}))]}))}))}function Ka(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Ye,qe).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Ye,JSON.stringify({userId:e}),t),[4,n.addToBlacklist(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](qe,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]}))}))}function za(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Ke,ze).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Ke,JSON.stringify({userId:e}),t),[4,n.removeFromBlacklist(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](ze,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]}))}))}function ja(){return W(this,void 0,void 0,(function(){var e=this;return Q(this,(function(t){return[2,new I(je,We).ifReady((function(t,n){return W(e,void 0,void 0,(function(){var e,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(je,"getBlacklist -> ",e),[4,t.getBlacklist()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS&&a?(n.info(We,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):(n.warn(We,JSON.stringify({code:o}),e),[2,{code:o}])}}))}))}))]}))}))}function Wa(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Qe,Xe).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Qe,JSON.stringify({userId:e}),t),[4,n.getBlacklistStatus(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Xe,JSON.stringify({code:a,data:0===s}),t),[2,{code:a,data:0===s}]):(i.warn(Xe,JSON.stringify({code:a}),t),[2,{code:a}])}}))}))}))]}))}))}var Qa=function(e,t,n,i){void 0===n&&(n=!0),void 0===i&&(i=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=i};function Xa(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(i){return new Qa(e,i,t,n)}}var Za,$a=Xa("RC:ImgMsg"),es=Xa("RC:HQVCMsg"),ts=Xa("RC:SightMsg"),ns=Xa("RC:TxtMsg"),is=Xa("RC:CombineMsg"),os=Xa(C.COMBINE_V2),rs=Xa("RC:FileMsg"),as=Xa("RC:GIFMsg"),ss=Xa("RC:VcMsg"),cs=Xa("RC:LBSMsg"),ds=Xa("RC:ReferenceMsg"),us=Xa("RC:ImgTextMsg"),ls=Xa("RC:CmdMsg"),vs=Xa("RC:InfoNtf"),fs=Xa("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(Za||(Za={}));var gs,Ss=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._isAbort=!1,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.isAbort=function(){return this._isAbort},e.prototype.abort=function(){this._isAbort=!0,this._abortHandler()},e.prototype.upload=function(e){return e.file.size>O?Promise.resolve({code:r.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>A&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),hs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return z(n,t),n.prototype.commonUpload=function(t){return W(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),this._promise=e({url:w(this._url),headers:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.QINIU}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return W(this,void 0,void 0,(function(){return Q(this,(function(e){throw new Error("Method not implemented.")}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ss),Ts=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return z(n,t),n.prototype.commonUpload=function(t){return W(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=w(a.ossBucketName+"."+this._url),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),this._promise=e({url:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.ALI}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Ss),Is=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return z(n,t),n.prototype.commonUpload=function(t){return W(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,a=t.contentDisposition,v.label=1;case 1:return v.trys.push([1,3,,4]),[4,this._getFileToken(o<=P.FILE?o:P.FILE)];case 2:return s=v.sent(),[3,4];case 3:return[2,{code:v.sent()}];case 4:return c=a||("text/html"===n.type?"inline":"attachment"),d={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":c+"; filename="+encodeURIComponent(n.name)+";"},u=w(""+this._url+s.path),this._promise=e({url:u,headers:d,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:n,timeout:0}),[4,this._promise.result()];case 5:return l=v.sent().status,this._promise=null,200===l||204===l?[2,{code:r.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:u}}]:[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ss),_s=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return z(n,t),n.prototype.commonUpload=function(t){return W(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=w(this._url+"/"+a.minioBucketName+"/"+a.fileName),c=this.getBaseHeaders(n,a,t),this._promise=e({url:s,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return W(this,void 0,void 0,(function(){var i,o,a,s,c,d,u,l,v,f,g,S,h,T,I,_;return Q(this,(function(m){switch(m.label){case 0:i=t.file,o=t.fileType,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,this._getFileToken(o,i.name,"POST","uploads")];case 2:return a=m.sent(),[3,4];case 3:return[2,{code:m.sent()}];case 4:return s=w(this._url+"/"+a.minioBucketName+"/"+a.fileName),c=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploads",headers:c,method:"POST"}),[4,this._promise.result()];case 5:return d=m.sent(),u=d.status,l=d.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!v?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,i,v,a.fileName,t,f)]);case 6:if(g=m.sent(),S=g.code,h=g.msg,S!==r.SUCCESS)return[2,{code:S,msg:h}];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=m.sent(),[3,10];case 9:return[2,{code:m.sent()}];case 10:return T=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),T="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+T+"</CompleteMultipartUpload>",I=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploadId="+v,headers:I,method:"POST",body:T,timeout:0}),[4,this._promise.result()];case 11:return _=m.sent().status,this._promise=null,200===_||204===_?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,i,o,a,s,c,d){return void 0===c&&(c=1),void 0===d&&(d=0),W(this,void 0,void 0,(function(){var u,l,v,f,g,S,h,T,I;return Q(this,(function(_){switch(_.label){case 0:if(d>=5)return[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];u=(c-1)*A,l=Math.min(A,n.size-u),v="partNumber="+c+"&uploadId="+i,_.label=1;case 1:return _.trys.push([1,3,,4]),[4,this._getFileToken(a.fileType,o,"PUT",v)];case 2:return f=_.sent(),[3,4];case 3:return[2,{code:_.sent()}];case 4:return g=n.slice(u,c*A),S=this.getBaseHeaders(n,f,a),this._promise=e({url:t+"?"+v,headers:S,method:"PUT",body:g,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,u+e.loaded,n.size)}}),[4,this._promise.result()];case 5:return h=_.sent(),T=h.status,I=h.xhr,this._promise=null,200===T||204===T?(s.push((null==I?void 0:I.getResponseHeader("ETag"))||""),u+l<n.size?[2,this.requestUploadPart(t,n,i,o,a,s,c+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(t,n,i,o,a,s,c,d+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ss),ms=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e._promise=null,e}return z(n,t),n.prototype.commonUpload=function(t){return W(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l,v,f;return Q(this,(function(g){switch(g.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,g.label=1;case 1:return g.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=g.sent(),[3,4];case 3:return[2,{code:g.sent()}];case 4:return s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),d=w(this._url),this._promise=e({url:d,headers:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return u=g.sent(),l=u.status,v=u.data,this._promise=null,200!==l&&204!==l||!v?[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]:(f=JSON.parse(v),[2,{code:r.SUCCESS,data:{uniqueName:f.rc_url.file_name,downloadUrl:d+"/"+f.rc_url.path}}])}}))}))},n.prototype.multipartUpload=function(e){return W(this,void 0,void 0,(function(){var t,n,i,o,r;return Q(this,(function(a){switch(a.label){case 0:t=e.file,n=e.onProgress,i=e.fileType,o=M(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this._getFileToken(i,t.name)];case 2:return r=a.sent(),[3,4];case 3:return[2,{code:a.sent()}];case 4:return[2,this._requestUploadPart(o,t,r.token,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,i,o,a){return void 0===a&&(a=0),W(this,void 0,void 0,(function(){var s,c,d,u,l,v,f,g,S,h;return Q(this,(function(T){switch(T.label){case 0:return s=Math.min(A,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),d={Range:"bytes="+a+"-"+(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},u=n.slice(a,a+s),(l=new FormData).set("file",u,n.name),l.set("key",c),l.set("name",c),l.set("token",i),v=w(this._url),this._promise=e({url:v,headers:d,onProgress:function(e){return null==o?void 0:o(a+e.loaded,n.size)},method:"POST",body:l,timeout:0}),[4,this._promise.result()];case 1:return f=T.sent(),g=f.status,S=f.data,this._promise=null,200===g||204===g?a+s<n.size?[2,this._requestUploadPart(t,n,i,o,a+s)]:(h=JSON.parse(S),[2,{code:r.SUCCESS,data:{uniqueName:h.rc_url.file_name,downloadUrl:v+"/"+h.rc_url.path}}]):[2,{code:r.UPLOAD_FAIL,msg:g.toString()}]}}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ss),ps=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return z(n,t),n.prototype.commonUpload=function(t){return W(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l,v;return Q(this,(function(f){switch(f.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,a=t.contentDisposition,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return s=f.sent(),[3,4];case 3:return[2,{code:f.sent()}];case 4:return c={},d=w(s.s3BucketName+"."+this._url),u=new FormData,a?u.set("Content-Disposition",a):u.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),u.set("Content-Type",n.type),u.set("x-amz-credential",s.s3Credential),u.set("x-amz-algorithm",s.s3Algorithm),u.set("x-amz-date",s.s3Date),u.set("policy",s.s3Policy),u.set("x-amz-signature",s.s3Signature),u.set("key",s.fileName),u.set("file",n),this._promise=e({url:d,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:u,timeout:0}),[4,this._promise.result()];case 5:return l=f.sent(),v=l.status,l.data,this._promise=null,200===v||204===v?[2,{code:r.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:U.AWS}}]:[2,{code:r.UPLOAD_FAIL,msg:v.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ss),Ns=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return z(n,t),n.prototype.commonUpload=function(t){return W(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=w(this._url+"/"+a.stcBucketName+"/"+a.fileName),c=this.getBaseHeaders(n,a,t),this._promise=e({url:s,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.STC}}]:[2,{code:r.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return W(this,void 0,void 0,(function(){var i,o,a,s,c,d,u,l,v,f,g,S,h,T,I,_;return Q(this,(function(m){switch(m.label){case 0:i=t.file,t.onProgress,o=t.fileType,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,this._getFileToken(o,i.name,"POST","uploads")];case 2:return a=m.sent(),[3,4];case 3:return[2,{code:m.sent()}];case 4:return s=w(this._url+"/"+a.stcBucketName+"/"+a.fileName),c=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploads",headers:c,method:"POST"}),[4,this._promise.result()];case 5:return d=m.sent(),u=d.status,l=d.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!v?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,i,v,a.fileName,t,f)]);case 6:if(g=m.sent(),S=g.code,h=g.msg,S!==r.SUCCESS)return[2,{code:S,msg:h}];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=m.sent(),[3,10];case 9:return[2,{code:m.sent()}];case 10:return T=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),T="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+T+"</CompleteMultipartUpload>",I=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploadId="+v,headers:I,method:"POST",body:T}),[4,this._promise.result()];case 11:return _=m.sent().status,this._promise=null,200===_||204===_?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:U.STC}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,i,o,a,s,c,d){return void 0===c&&(c=1),void 0===d&&(d=0),W(this,void 0,void 0,(function(){var u,l,v,f,g,S,h,T,I;return Q(this,(function(_){switch(_.label){case 0:if(d>=5)return[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];u=(c-1)*A,l=Math.min(A,n.size-u),v="partNumber="+c+"&uploadId="+i,_.label=1;case 1:return _.trys.push([1,3,,4]),[4,this._getFileToken(a.fileType,o,"PUT",v)];case 2:return f=_.sent(),[3,4];case 3:return[2,{code:_.sent()}];case 4:return g=n.slice(u,c*A),S=this.getBaseHeaders(n,f,a),this._promise=e({url:t+"?"+v,headers:S,method:"PUT",body:g,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,u+e.loaded,n.size)},timeout:0}),[4,this._promise.result()];case 5:return h=_.sent(),T=h.status,h.data,I=h.xhr,this._promise=null,200===T||204===T?(s.push((null==I?void 0:I.getResponseHeader("ETag"))||""),u+l<n.size?[2,this.requestUploadPart(t,n,i,o,a,s,c+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(t,n,i,o,a,s,c,d+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ss);var Es=((gs={})[Za.QINIU]=hs,gs[Za.ALIYUN]=Ts,gs[Za.BAIDU]=Is,gs[Za.S3]=ps,gs[Za.STC]=Ns,gs[Za.MINIO]=_s,gs[Za.RCX]=ms,gs);function ys(e,t,n,i){var o=document.createElement("canvas"),a=o.getContext("2d"),s=new Image;s.onload=function(t){var c=i||{},d=c.maxHeight,u=void 0===d?160:d,l=c.maxWidth,v=void 0===l?160:l,f=c.quality,g=void 0===f?.7:f,S=c.scale,h=void 0===S?1:S,T=Cs(s.width,s.height,{maxHeight:u,maxWidth:v,scale:h});o.width=Math.min(T.w,v),o.height=Math.min(T.h,u),a.drawImage(s,T.x,T.y,T.w,T.h);var I=Rs(o,g);I=I.replace(/data:image\/[^;]+;base64,/,""),e({code:r.SUCCESS,data:j(j({},n),{thumbnail:I,width:T.w,height:T.h})})},s.onerror=function(t){e({code:r.UPLOAD_FAIL,msg:"get image info fail:"+JSON.stringify(t)})},s.src=(window.URL||window.webkitURL).createObjectURL(t)}function Rs(e,t){var n=e.toDataURL("image/jpeg",t);return n.length>b-10240?Rs(e,t-.1):n}var Cs=function(e,t,n){var i,o,r=n.maxHeight,a=void 0===r?160:r,s=n.maxWidth,c=void 0===s?160:s,d=n.scale,u=e<t,l=0,v=0;return(u?t/e:e/t)>(void 0===d?1:d)?(u?(i=100,v=((o=t/(e/100))-a)/2):(o=100,l=((i=e/(t/100))-c)/2),{w:i,h:o,x:-l,y:-v}):(u?(o=a,i=e/(t/a)):(i=c,o=t/(e/c)),{w:i,h:o,x:-l,y:-v})},Os=0,As=function(){function e(e,t){this._client=null,this.id=++Os,this._promise=this._handleUpload(e,t)}return e.prototype.abort=function(){var e;this._resolve({code:r.UPLOAD_FAIL,msg:"upload abort"}),null===(e=this._client)||void 0===e||e.abort()},e.prototype._uploadInLoop=function(e,t,n,i,o){return void 0===o&&(o=[]),W(this,void 0,void 0,(function(){var a,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:a=0,v.label=1;case 1:return a<e.length?(s=e[a],this._client=new Es[s.type](s.url,n,i),[4,this._client.upload(t)]):[3,4];case 2:if(c=v.sent(),d=c.code,u=c.data,l=c.msg,d===r.SUCCESS)return[2,{code:d,data:u}];if(this._client.isAbort())return this._client=null,[2,{code:d,data:u,msg:l}];this._client=null,o.push({type:s.type,url:s.url,code:d,msg:l}),v.label=3;case 3:return a++,[3,1];case 4:return[2,{code:r.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: "+JSON.stringify(o)}]}}))}))},e.prototype._handleUpload=function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new Promise((function(i){return W(n,void 0,void 0,(function(){var n,o,a,s,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N;return Q(this,(function(E){switch(E.label){case 0:return this._resolve=i,n=t.getFileToken,o=t.serverType,a=t.customDomain,s=t.ossConfig,c=t.uploadServer,d=t.bosAddr,u=e.file,l=e.fileType,v=e.thumbnailConfig,f=function(e,t,n,i,o){if(n)return[{type:Za.RCX,url:n,p:"1"}];if(e)return JSON.parse(e).map((function(e){var t={type:Za.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}));var r=[];return i&&r.push({type:Za.QINIU,url:i,p:"1"}),o&&r.push({type:Za.BAIDU,url:o,p:"2"}),r}(s,0,a,c,d),0===f.length?(i({code:r.INVALID_PARAMETER_MEDIA_URL,msg:"uploadUrlList is empty"}),[2]):[4,this._uploadInLoop(f,e,n,o)];case 1:if(g=E.sent(),S=g.code,h=g.data,T=g.msg,S!==r.SUCCESS||!h)return i({code:S,msg:T}),[2];if(I=h.downloadUrl)return[3,5];E.label=2;case 2:return E.trys.push([2,4,,5]),[4,t.getFileUrl(l,h.uniqueName,u.name,void 0,h.uploadMethod)];case 3:return _=E.sent(),I=_.downloadUrl,[3,5];case 4:return m=E.sent(),i({code:m,msg:"Get download url fail"}),[3,5];case 5:return I?(p={downloadUrl:I,uniqueName:(null==h?void 0:h.uniqueName)||"",name:u.name,size:u.size,type:u.type},l!==P.AUDIO?[3,7]:[4,u.arrayBuffer()]):(i({code:r.UPLOAD_FAIL,msg:"Get download url fail"}),[2]);case 6:return N=E.sent(),function(e,t,n){(new AudioContext).decodeAudioData(t,(function(t){e({code:r.SUCCESS,data:j(j({},n),{duration:t.duration,length:t.length})})}),(function(t){e({code:r.UPLOAD_FAIL,msg:"get audio info fail:"+JSON.stringify(t)})}))}(i,N,p),[2];case 7:return l===P.IMAGE?(ys(i,u,p,v),[2]):(i({code:S,data:p}),[2])}}))}))}))]}))}))},e.prototype.awaitResult=function(){return W(this,void 0,void 0,(function(){return Q(this,(function(e){return[2,this._promise]}))}))},e}(),Us={};function ws(e,t){var n=new As(e,t);return function(e){W(this,void 0,void 0,(function(){return Q(this,(function(t){switch(t.label){case 0:return Us[e.id]=e,[4,e.awaitResult()];case 1:return t.sent(),delete Us[e.id],[2]}}))}))}(n),n}function Ps(e){var t=Us[e];return!!t&&(t.abort(),!0)}var Ms=function(e,t){var n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t.uploadDomain||"",serverType:null==n?void 0:n.type,ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer,bosAddr:null==n?void 0:n.bosAddr}};function bs(e){return W(this,void 0,void 0,(function(){var t,n,i;return Q(this,(function(o){return t=e.contentDisposition,n=e.fileType,i=e.file,[2,new I("","").validate("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",n,(function(e){return!!P[e]}),!0).validate("file",i,(function(e){return e instanceof File&&(!(n===P.IMAGE&&!e.type.match(/^image\//))&&!(n===P.AUDIO&&!e.type.match(/^audio\//)))}),!0).ifReadySync((function(t,n,i){var o=ws(e,Ms(t,i));return{code:r.SUCCESS,data:o}}))]}))}))}function Ls(e){return W(this,void 0,void 0,(function(){return Q(this,(function(t){return[2,{code:r.SUCCESS,data:Ps(e)}]}))}))}function Gs(e){return W(this,void 0,void 0,(function(){var t,n,i;return Q(this,(function(o){return t=e.contentDisposition,n=e.fileType,i=e.file,[2,new I("","").validate("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",n,(function(e){return!!P[e]}),!0).validate("file",i,(function(e){return e instanceof File&&(!(n===P.IMAGE&&!e.type.match(/^image\//))&&!(n===P.AUDIO&&!e.type.match(/^audio\//)))}),!0).ifReady((function(t,n,i){return function(e,t){return W(this,void 0,void 0,(function(){return Q(this,(function(n){return[2,new As(e,t).awaitResult()]}))}))}(e,Ms(t,i))}))]}))}))}function Js(e,t,n,i){return mr((function(o){return new Promise((function(a){o.getFileToken(e,t,n,i).then((function(e){a({code:r.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:Gr[e]})}))}))}))}function Ds(e){return new I("","").validate("mediaUrl",e,v.STRING,!0).ifReady((function(t){return new Promise((function(n){t.getFileToken(1,void 0,void 0,void 0,e).then((function(e){var t=e.token,i=e.downloadAuthInfo,o=e.deadline;n({code:r.SUCCESS,data:{token:t,downloadAuthInfo:i,deadline:o}})})).catch((function(e){n({code:e,msg:Gr[e]})}))}))}))}function Bs(e,t,n,i,o){return new I("","").validate("fileType",e,L,!0).validate("filename",t,v.STRING).validate("saveName",n,v.STRING).validate("serverType",o,v.NUMBER).ifReady((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,i,o).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))}))}function ks(e,t,n){return W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("message",t,(function(){return t instanceof Qa}),!0).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("isStatusMessage",null==n?void 0:n.isStatusMessage,v.BOOLEAN).validate("disableNotification",null==n?void 0:n.disableNotification,v.BOOLEAN).validate("pushContent",null==n?void 0:n.pushContent,v.STRING).validate("pushData",null==n?void 0:n.pushData,v.STRING).validate("isMentioned",null==n?void 0:n.isMentioned,v.BOOLEAN).validate("mentionedType",null==n?void 0:n.mentionedType,v.NUMBER).validate("mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,J({itemValidator:D})).validate("directionalUserIdList",null==n?void 0:n.directionalUserIdList,J({maxLength:300,itemValidator:D})).validate("isVoipPush",null==n?void 0:n.isVoipPush,v.BOOLEAN).validate("canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,v.BOOLEAN).validate("expansion",null==n?void 0:n.expansion,v.OBJECT).validate("pushConfig",null==n?void 0:n.pushConfig,v.OBJECT).validate("messageId",null==n?void 0:n.messageId,v.NUMBER).ifReady((function(o,c){return W(i,void 0,void 0,(function(){var i,d,u,l,v,f,g,S,T,I,_,m,p,N,E,y,R,C,O,A,U;return Q(this,(function(w){switch(w.label){case 0:return d=(i=n||{}).disableNotification,u=i.isMentioned,l=i.directionalUserIdList,v=i.canIncludeExpansion,f=i.onSendBefore,g=i.expansion,S=i.pushConfig,T=i.isStatusMessage,I=c.createTraceId(),_=e.conversationType,m=e.targetId,p=e.channelId,l&&l.length>0&&![3,10].includes(_)?[2,{code:r.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE}]:(N=function(e,t,n){var i=e.isStatusMessage,o=e.disableNotification,r=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,d=e.mentionedUserIdList,u=e.directionalUserIdList,l=e.isVoipPush,v=e.canIncludeExpansion,f=e.expansion,g=e.isFilerWhiteBlacklist,S=e.pushConfig,h=e.messageId,T=n.channelId;return j({isStatusMessage:i,disableNotification:o,pushContent:r,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:d,directionalUserIdList:u,isVoipPush:l,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:g,pushConfig:S,channelId:T||"",messageId:h},t)}(n||{},t,e),E={isMentioned:!!u,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!d,canIncludeExpansion:!!v,expansion:g||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:o.getCurrentUserId(),messageUId:"",messageDirection:B.SEND,receivedTime:0,isStatusMessage:!!T,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:S,sentStatus:k.SENDING,sentTime:0,directedUserIds:l||[]},_!==s.ULTRA_GROUP&&(E.isOffLineMessage=!1),y=function(e){E.messageId=e;try{f&&f(xe(E))}catch(e){c.error(h.A_SEND_MSG_T,'Callback method "onSendBefore" execution error.\n'+(null==e?void 0:e.stack),I)}},c.info(h.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:_,targetId:m,channelId:p}),I),[4,o.sendMessage(_,m,N,y,I)]);case 1:return R=w.sent(),C=R.code,O=R.data,A=R.msg,C===r.SUCCESS?(c.info(h.A_SEND_MSG_R,JSON.stringify({code:C,messageUId:O.messageUId,messageId:O.messageId}),I),U=xe(O),[2,{code:C,data:U}]):(c.warn(h.A_SEND_MSG_R,JSON.stringify({code:C}),I),E.sentTime=(null==O?void 0:O.sentTime)||0,E.sentStatus=null==O?void 0:O.sentStatus,[2,{code:C,msg:A||Gr[C],data:xe(E)}])}}))}))}))]}))}))}function xs(e,t,n){return ks(e,new ns(t),n)}function Hs(e,t){return function(n,i,o,a){var s;if(!_("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.INVALID_PARAMETER_SENDOPTIONS});var c={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var d=null===(s=a)||void 0===s?void 0:s.thumbnailConfig;if(!(_("sendOptions.maxHeight",null==d?void 0:d.maxHeight,v.NUMBER)&&_("sendOptions.maxWidth",null==d?void 0:d.maxWidth,v.NUMBER)&&_("sendOptions.quality",null==d?void 0:d.quality,v.NUMBER)&&_("sendOptions.scale",null==d?void 0:d.scale,v.NUMBER)))return Promise.resolve({code:r.INVALID_PARAMETER_SENDOPTIONS});c.thumbnailConfig=d}return mr((function(s,d,u){return new Promise((function(s){var u=d.createTraceId();d.info(h.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:e}),u),Gs({file:i.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==o?void 0:o.onProgress)||void 0===n||n.call(o,Math.floor(e/t*100))},contentDisposition:c.contentDisposition,thumbnailConfig:c.thumbnailConfig}).then((function(e){var c,l=e.code,v=e.data,f=e.msg;if(l===r.SUCCESS&&v){var g=(null===(c=null==o?void 0:o.onComplete)||void 0===c?void 0:c.call(o,j({url:v.downloadUrl},v)))||t(v,i);return d.info(h.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:v.downloadUrl,code:r.SUCCESS}),u),void ks(n,g,a).then(s)}s({code:l,msg:f})}))}))}))}}var Vs=Hs(P.FILE,(function(e,t){var n,i,o={name:e.name,size:t.file.size,type:(n=e.name,i=n.match(/\.(\w+)$/),i?i[1]:"bin"),fileUrl:e.downloadUrl};return t.user&&(o.user=t.user),t.extra&&(o.extra=t.extra),t.mentionedInfo&&(o.mentionedInfo=t.mentionedInfo),new rs(o)})),Fs=Hs(P.IMAGE,(function(e,t){var n={content:e.thumbnail,imageUri:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new $a(n)})),Ys=Hs(P.IMAGE,(function(e,t){var n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new as(n)})),qs=Hs(P.AUDIO,(function(e,t){var n={remoteUrl:e.downloadUrl,duration:e.duration,type:e.type};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new es(n)})),Ks=Hs(P.SIGHT,(function(e,t){var n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new ts(n)}));function zs(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(h.A_GET_HISTORY_MSG_T,h.A_GET_HISTORY_MSG_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){if(G())return!0;var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(h.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,i.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),xe(e)})),o.info(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:d}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(o.warn(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function js(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(ui,li).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(ui,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,order:null==t?void 0:t.order}),n),[4,i.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),xe(e)})),o.info(li,JSON.stringify({code:s,messageUIds:d})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(o.warn(li,JSON.stringify({code:s})),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function Ws(e,t,n,i){return W(this,void 0,void 0,(function(){var o=this;return Q(this,(function(r){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).validate("timestamp",n,v.NUMBER,!0).validate("channelId",i,v.CHANNEL_ID).ifReady((function(r){return W(o,void 0,void 0,(function(){var o,r,a,c,d;return Q(this,(function(u){switch(u.label){case 0:return o={targetId:e,conversationType:s.PRIVATE,channelId:i},r=new Qa("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,ks(o,r)];case 1:return a=u.sent(),c=a.code,d=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:d}]}}))}))}))]}))}))}function Qs(e,t,n){return W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,r){return W(i,void 0,void 0,(function(){var i,o,a,c,d;return Q(this,(function(u){switch(u.label){case 0:return i="messageUId:"+t+",targetId:"+e,r.debug(h.A_SEND_MSG_T,"send read receipt message ->"+i),o=new Qa("RC:RRReqMsg",{messageUId:t}),[4,ks({targetId:e,conversationType:s.GROUP,channelId:n},o)];case 1:return a=u.sent(),c=a.code,d=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:d}]}}))}))}))]}))}))}function Xs(e,t,n){return W(this,void 0,void 0,(function(){return Q(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}Hs(P.COMBINE_HTML,(function(e,t){var n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new is(n)}));var Zs=function(e,t,n,i){return W(void 0,void 0,void 0,(function(){var o,a;return Q(this,(function(s){switch(s.label){case 0:return!_("messageList",i,v.OBJECT,!0)||Object.keys(i).some((function(e){return!_(e,i[e],v.ARRAY)}))?[2,Promise.resolve({code:r.MSG_LIMIT_ERROR})]:(o=[],Object.keys(i).forEach((function(e){i[e].forEach((function(e){-1===o.indexOf(e)&&o.push(e)}))})),o.length?[4,e.sendReadReceiptMessage(n.targetId,o,n.channelId)]:(t.warn(h.A_SEND_MSG_R,JSON.stringify({code:r.MSG_LIMIT_ERROR,msg:"Error in parameter messageList."})),[2,Promise.resolve({code:r.MSG_LIMIT_ERROR})]));case 1:return a=s.sent().code,[2,Promise.resolve({code:a})]}}))}))};function $s(e,t,n){return W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,c,d,u,l;return Q(this,(function(f){switch(f.label){case 0:return i={targetId:e,conversationType:s.GROUP,channelId:n},d=o.getNaviInfoFromCache(),1!==(null==d?void 0:d.grpRRVer)?[3,2]:[4,Zs(o,a,i,t)];case 1:return c=f.sent(),[3,4];case 2:return!_("messageList",t,v.OBJECT,!1)||t&&Object.keys(t).some((function(e){return!_(e,t[e],v.ARRAY)}))?[2,{code:r.MSG_LIMIT_ERROR}]:(u=new Qa("RC:RRRspMsg",{receiptMessageDic:t}),[4,ks(i,u)]);case 3:c=f.sent(),f.label=4;case 4:return(l=c.code)===r.SUCCESS?[2,{code:l}]:[2,{code:l,msg:Gr[l]}]}}))}))}))]}))}))}function ec(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(h.A_SYNC_READ_STATUS_T,h.A_SYNC_READ_STATUS_R).validate("timestamp",t,v.NUMBER,!0).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return[s.GROUP,s.PRIVATE,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE,s.SYSTEM].includes(e)}),!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", timestamp:"+t,a=o.createTraceId(),o.info(h.A_SYNC_READ_STATUS_T,n,a),1!==(null==(s=i.getNaviInfoFromCache())?void 0:s.sesDriven)?[3,2]:[4,i.updateConversationReadTime(e,t)];case 1:return c=v.sent(),[3,4];case 2:return d=new Qa("RC:SRSMsg",{timestamp:t}),[4,ks(e,d)];case 3:c=v.sent(),v.label=4;case 4:return u=c.code,l=c.msg,o[u===r.SUCCESS?"info":"warn"](h.A_SYNC_READ_STATUS_R,"code: "+u+", msg: "+l,a),[2,{code:u,msg:l}]}}))}))}))]}))}))}function tc(e,t,n){return void 0===n&&(n=""),W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(h.A_SEND_MESSAGE_READ_RECEIPT_V4_T,h.A_SEND_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP||e===s.PRIVATE}),!0,"It should be ConversationType.GROUP or ConversationType.PRIVATE").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("startMsgUId",n,v.ONLY_STRING,!0).validate("endMsgUId",t,v.STRING,!0).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:return i=a.createTraceId(),s="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", startMsgUId:"+n+", endMsgUId: "+t,a.info(h.A_SEND_MESSAGE_READ_RECEIPT_V4_T,s,i),3!==(null==(c=o.getNaviInfoFromCache())?void 0:c.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,o.sendReadReceiptMessageV4(e,n,t)];case 1:return d=v.sent(),u=d.code,l=d.msg,a[u===r.SUCCESS?"info":"warn"](h.A_SEND_MESSAGE_READ_RECEIPT_V4_R,"code: "+u+", msg: "+l,i),[2,{code:u,msg:l}]}}))}))}))]}))}))}function nc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(h.A_GET_MESSAGE_READ_RECEIPT_V4_T,h.A_GET_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t,v.STRING,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", messageUid:"+t,a=o.createTraceId(),o.info(h.A_GET_MESSAGE_READ_RECEIPT_V4_T,n,a),3!==(null==(s=i.getNaviInfoFromCache())?void 0:s.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,i.getMessageReadReceiptV4(e,t)];case 1:return c=v.sent(),d=c.code,u=c.msg,l=c.data,o[d===r.SUCCESS?"info":"warn"](h.A_GET_MESSAGE_READ_RECEIPT_V4_R,"code: "+d+", msg: "+u,a),d===r.SUCCESS&&l?[2,{code:d,data:l}]:[2,{code:d,msg:u}]}}))}))}))]}))}))}function ic(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t,(function(e){return!!_("messageUIds",e,v.ARRAY,!0)&&!e.some((function(e){return!R(e)}))}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", messageUid:"+t.toString(),a=o.createTraceId(),o.info(h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,n,a),3!==(null==(s=i.getNaviInfoFromCache())?void 0:s.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,i.batchGetMessageReadReceiptInfoV4(e,t)];case 1:return c=v.sent(),d=c.code,u=c.msg,l=c.data,o[d===r.SUCCESS?"info":"warn"](h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R,"code: "+d+", msg: "+u,a),d===r.SUCCESS?[2,{code:d,data:l}]:[2,{code:d,msg:u}]}}))}))}))]}))}))}function oc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(vi,fi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t.messageUId,v.STRING,!0).validate("sentTime",t.sentTime,v.NUMBER,!0).validate("disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN).validate("pushConfig",null==t?void 0:t.pushConfig,v.OBJECT).validate("directionalUserIdList",null==t?void 0:t.directionalUserIdList,J({maxLength:300,minLength:1,itemValidator:function(e){return R(e)}})).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d;return Q(this,(function(u){switch(u.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,directionalUserIdList:t.directionalUserIdList},a=o.createTraceId(),o.info(vi,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,messageUId:t.messageUId}),a),[4,i.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=u.sent(),c=s.code,d=s.data,c===r.SUCCESS&&d?(o.info(fi,JSON.stringify({code:c,messageUId:d.messageUId}),a),[2,{code:c,data:xe(d)}]):c===r.SUCCESS?[2,{code:c}]:(o.warn(fi,JSON.stringify({code:c}),a),[2,{code:c,msg:Gr[c]}])}}))}))}))]}))}))}function rc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(gi,Si).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messages",t,(function(e){return f(e)&&e.length}),!0).validate("messages",t,(function(e){return!(!e||!f(e))&&!e.some((function(e){return!R(null==e?void 0:e.messageUId)||!y(null==e?void 0:e.sentTime)||!_("options.messageDirection",null==e?void 0:e.messageDirection,(function(e){return 1===e||2===e}),!0)}))}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(gi,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,messages:t.map((function(e){return e.messageUId}))}),n),[4,i.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Si,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Gr[a]}]:[2,{code:r.SUCCESS}]}}))}))}))]}))}))}function ac(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(hi,Ti).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(hi,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:t}),n),[4,i.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Ti,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Gr[a]}]:[2,{code:r.SUCCESS}]}}))}))}))]}))}))}function sc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(ai,si).validate("clearMessageOption",e,(function(e){if(!_("clearMessageOption",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("options",i,v.OBJECT,!0)&&_("options.targetId",i.targetId,v.STRING,!0)&&_("options.conversationType",i.conversationType,(function(e){return[s.PRIVATE,s.GROUP,s.CHATROOM,s.SYSTEM].includes(e)}),!0)&&_("options.timestamp",i.timestamp,v.NUMBER,!0)&&_("options.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),a=o.createTraceId(),o.info(ai,"options: "+JSON.stringify(n)+", isDeleteLocal: "+!!t,a),[4,i.batchClearRemoteHistoryMessages(n,!!t)];case 1:return s=c.sent(),o[r.SUCCESS===s?"info":"warn"](si,"code: "+s,a),[2,{code:s}]}}))}))}))]}))}))}function cc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(Ii,_i).validate("expansion",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,v.NUMBER,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).validate("messageUId",null==t?void 0:t.messageUId,v.STRING,!0).validate("expansion",null==t?void 0:t.expansion,v.OBJECT).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f;return Q(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,d=t.expansion,u=t.channelId,l=o.createTraceId(),o.info(Ii,JSON.stringify({targetId:a,channelId:u,conversationType:n,messageUId:s,canIncludeExpansion:c}),l),[4,i.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:d,channelId:u})];case 1:return v=g.sent().code,f=v===r.SUCCESS?"info":"warn",o[f](_i,JSON.stringify({code:v}),l),v!==r.SUCCESS?[2,{code:v,msg:Gr[v]}]:[2,{code:v}]}}))}))}))]}))}))}function dc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(mi,pi).validate("keys",e,v.ARRAY,!0).validate("message",t,v.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,v.NUMBER,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).validate("messageUId",null==t?void 0:t.messageUId,v.STRING,!0).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v;return Q(this,(function(f){switch(f.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,d=t.channelId,u=o.createTraceId(),o.info(mi,JSON.stringify({targetId:a,channelId:d,conversationType:n,messageUId:s,canIncludeExpansion:c}),u),[4,i.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:d})];case 1:return l=f.sent().code,v=l===r.SUCCESS?"info":"warn",o[v](pi,JSON.stringify({code:l}),u),l!==r.SUCCESS?[2,{code:l,msg:Gr[l]}]:[2,{code:l}]}}))}))}))]}))}))}function uc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageType",t,v.STRING,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=o.createTraceId(),o.info(h.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,i.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",o[u](h.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:d?d.messageUId:"",messageId:d?d.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:xe(d)}]:[2,{code:c,msg:Gr[c]}]}}))}))}))]}))}))}function lc(e,t,n){return W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(Ni,Ei).validate("messageUId",t,v.STRING,!0).validate("targetId",e,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return i=a.createTraceId(),a.info(Ni,JSON.stringify({targetId:e,messageUId:t,channelId:n}),i),[4,o.getMessageReader(e,t,n)];case 1:return s=u.sent(),c=s.code,d=s.data,c===r.SUCCESS?(a.info(Ei,JSON.stringify({code:c,totalMemberCount:null==d?void 0:d.totalMemberCount}),i),[2,{code:c,data:d}]):(a.warn(Ei,JSON.stringify({code:c})),[2,{code:c,msg:Gr[c]}])}}))}))}))]}))}))}function vc(e,t,n,i,o){return _r((function(r,a){return l("messageType",e,v.STRING,!0),l("isPersited",t,v.BOOLEAN,!0),l("isCounted",n,v.BOOLEAN,!0),l("isStatusMessage",o,v.BOOLEAN,!1),l("searchProps",i,v.ARRAY),a.info(h.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:o,isPersited:t})),r.registerMessageType(e,t,n,i,o),Xa(e,t,n)}))}function fc(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(yi,Ri).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(yi,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getFirstUnreadMessage(t,o,a)];case 1:return c=v.sent(),d=c.code,u=c.data,d===r.SUCCESS?(l=u&&xe(u)||null,i.info(Ri,JSON.stringify({code:d,messageUId:null==u?void 0:u.messageUId}),s),[2,{code:d,data:l}]):(i.warn(Ri,JSON.stringify({code:d}),s),[2,{code:d,msg:Gr[d]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))}function gc(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Ci,Oi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ci,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getFirstUnreadMessageInfo(t,o,a||"")];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Oi,JSON.stringify({code:d,messageUId:null==u?void 0:u.messageUId,sentTime:null==u?void 0:u.sentTime}),s),[2,{code:d,data:u}]):(i.warn(Oi,JSON.stringify({code:d}),s),[2,{code:d,msg:Gr[d]}])}}))}))}))]}))}))}function Sc(e,t,n){return void 0===n&&(n={}),W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return Ve("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),G()?[2,new I(Ai,Ui).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("searchContent",null==n?void 0:n.searchContent,v.STRING).validate("senderUserId",null==t?void 0:t.senderUserId,v.STRING,!0).validate("messageType",null==t?void 0:t.messageType,v.STRING,!0).validate("content",null==t?void 0:t.content,v.OBJECT,!0).validate("messageDirection",null==t?void 0:t.messageDirection,v.NUMBER,!0).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN).validate("expansion",null==t?void 0:t.expansion,v.OBJECT).validate("disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN).validate("sentTime",null==t?void 0:t.sentTime,v.NUMBER).validate("sentStatus",null==t?void 0:t.sentStatus,v.NUMBER).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,s,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N;return Q(this,(function(E){switch(E.label){case 0:return i=t.senderUserId,s=t.messageType,c=t.content,d=t.messageDirection,u=t.messageUId,l=t.canIncludeExpansion,v=t.expansion,f=t.disableNotification,g=t.sentTime,S=t.sentStatus,h=a.createTraceId(),a.info(Ai,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),h),T=n.isUnread,I=n.searchContent,_={senderUserId:i,messageType:s,content:c,messageDirection:d,sentTime:g,sentStatus:S,searchContent:I,isUnread:!!T,messageUId:u,disableNotification:f,canIncludeExpansion:l,expansionMsg:JSON.stringify(v),channelId:e.channelId||""},[4,o.insertMessage(e.conversationType,e.targetId,_)];case 1:return m=E.sent(),p=m.code,N=m.data,p===r.SUCCESS?(a.info(Ui,JSON.stringify({code:p,messageId:null==N?void 0:N.messageId}),h),[2,{code:p,data:xe(N)}]):(a.warn(Ui,JSON.stringify({code:p}),h),[2,{code:p,msg:Gr[p]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))}function hc(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(wi,Pi).validate("messageId",e,(function(e){return y(e)||R(e)}),!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(wi,JSON.stringify({messageId:e}),t),[4,n.getMessage(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Pi,JSON.stringify({code:a,messageUId:null==s?void 0:s.messageUId,messageId:null==s?void 0:s.messageId})),[2,{code:a,data:xe(s)}]):(i.warn(Pi,JSON.stringify({code:a})),[2,{code:a,msg:Gr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))}function Tc(e){return G()?new I(Mi,bi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReadySync((function(t,n){var i=e.conversationType,o=e.targetId,a=e.channelId,s=n.createTraceId();n.info(Mi,JSON.stringify({conversationType:i,targetId:o,channelId:a}),s);var c=t.getUnreadMentionedMessages(i,o,a),d=[];return c&&c.length&&c.forEach((function(e){return d.push(xe(e))})),n.info(bi,JSON.stringify({code:r.SUCCESS,count:d.length}),s),{code:r.SUCCESS,data:d}})):{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}}function Ic(e,t,n,i){return W(this,void 0,void 0,(function(){var o=this;return Q(this,(function(a){return Ve("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),G()?[2,new I("A-search_messages-T","A-search_messages-R").validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("keyword",t,v.STRING,!0).validate("timestamp",n,v.NUMBER).validate("count",i,v.NUMBER).ifReady((function(a,s){return W(o,void 0,void 0,(function(){var o,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,i,1,e.channelId)];case 1:return o=l.sent(),c=o.code,d=o.data,c===r.SUCCESS?(u=[],(null==d?void 0:d.messages)&&d.messages.length&&d.messages.forEach((function(e){return u.push(xe(e))})),[2,{code:c,data:{messages:u,count:null==d?void 0:d.count}}]):(s.warn(h.O,"searchMessages ->code:"+c+",targetId:"+e.targetId),[2,{code:c,msg:Gr[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))}function _c(e,t,n){return W(this,void 0,void 0,(function(){var i,o,a,s=this;return Q(this,(function(c){return Ve("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),G()?(i=e.conversationType,o=e.targetId,a=e.channelId,[2,new I(Li,Gi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).validate("cleanSpace",n,v.BOOLEAN).ifReady((function(e,c){return W(s,void 0,void 0,(function(){var s,d,u;return Q(this,(function(l){switch(l.label){case 0:return s=c.createTraceId(),c.info(Li,JSON.stringify({conversationType:i,targetId:o,channelId:a,timestamp:t,cleanSpace:n}),s),[4,e.deleteMessagesByTimestamp(i,o,t,n,a)];case 1:return d=l.sent(),c.debug(h.A_DELETE_MESSAGES_S,JSON.stringify({code:d,conversationType:i,targetId:o,channelId:a,timestamp:t})),u=d===r.SUCCESS?"info":"warn",c[u](Gi,JSON.stringify({code:d}),s),d===r.SUCCESS?[2,{code:d}]:[2,{code:d,msg:Gr[d]}]}}))}))}))]):[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))}function mc(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return Ve("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),G()?[2,new I(Ji,Di).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ji,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearMessages(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Di,JSON.stringify({code:c}),s),c===r.SUCCESS?[2,{code:c}]:[2,{code:c,msg:Gr[c]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))}function pc(e,t,n,i){return W(this,void 0,void 0,(function(){var o=this;return Q(this,(function(a){return Ve("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),G()?[2,new I(Bi,ki).validate("keyword",e,v.STRING,!0).validate("conversationTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!1).validate("messageTypes",n,(function(e){return!!f(e)&&!(null==n?void 0:n.some((function(e){return!R(e)})))}),!1).validate("channelId",i,v.STRING).ifReady((function(a,s){return W(o,void 0,void 0,(function(){var o,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return o=s.createTraceId(),s.info(Bi,JSON.stringify({keyword:e,conversationTypes:t,messageTypes:n,channelId:i}),o),[4,a.searchConversationByContent(e,n,i,t)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(s.info(ki,JSON.stringify({code:d,count:null==u?void 0:u.length}),o),[2,{code:d,data:u}]):(s.warn(ki,JSON.stringify({code:d}),o),[2,{code:d,msg:Gr[d]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))}function Nc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return G()?[2,new I(xi,Hi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,c=o.createTraceId(),o.info(xi,JSON.stringify({conversationType:n,targetId:a,channelId:s,timestamp:t}),c),[4,i.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return d=l.sent(),u=d===r.SUCCESS?"info":"warn",o[u](Hi,JSON.stringify({code:d}),c),d===r.SUCCESS?[2,{code:d}]:[2,{code:d,msg:Gr[d]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))}function Ec(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return Ve("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),G()?[2,new I(Vi,Fi).validate("messageId",e,v.NUMBER,!0).validate("receivedStatus",t,v.NUMBER,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(Vi,JSON.stringify({messageId:e,receivedStatus:t}),n),[4,i.setMessageReceivedStatus(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Fi,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Gr[a]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))}function yc(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Qi,Xi).validate("tagId",null==e?void 0:e.tagId,v.STRING,!0).validate("tagId",null==e?void 0:e.tagId,(function(e){return!!e&&e.length<=10})).validate("tagName",null==e?void 0:e.tagName,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Qi,JSON.stringify({tagId:e.tagId,tagName:e.tagName}),t),[4,n.createTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](Xi,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Gr[o]}]}}))}))}))]}))}))}function Rc(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Zi,$i).validate("tagId",e,v.STRING,!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Zi,JSON.stringify({tagId:e}),t),[4,n.removeTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a]($i,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Gr[o]}]}}))}))}))]}))}))}function Cc(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(eo,to).validate("tagId",null==e?void 0:e.tagId,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(eo,JSON.stringify({tagId:e.tagId,tagName:e.tagName}),t),[4,n.updateTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](to,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Gr[o]}]}}))}))}))]}))}))}function Oc(){return W(this,void 0,void 0,(function(){var e=this;return Q(this,(function(t){return[2,new I("","").ifReady((function(t,n){return W(e,void 0,void 0,(function(){var e,i,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(no,"",e),[4,t.getTagList()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](io,JSON.stringify({code:o}),e),[2,{code:r.SUCCESS,data:a}]}}))}))}))]}))}))}function Ac(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(oo,ro).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(oo,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),t),[4,n.getTagsForConversation(e)];case 1:return o=d.sent(),a=o.code,s=o.data,c=a===r.SUCCESS?"info":"warn",i[c](ro,JSON.stringify({code:a}),t),a===r.SUCCESS?[2,{code:a,data:s}]:[2,{code:a,msg:Gr[a]}]}}))}))}))]}))}))}function Uc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(ao,so).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ao,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.addTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](so,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Gr[a]}]}}))}))}))]}))}))}function wc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(co,uo).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(co,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.removeTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](uo,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Gr[a]}]}}))}))}))]}))}))}function Pc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(lo,vo).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("tagIds",t,(function(e){return!!_("tagIds",e,v.ARRAY,!0)&&!e.some((function(e){return!R(e)}))}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(lo,JSON.stringify({tagIds:t,targetId:e.targetId,conversationType:e.conversationType}),n),[4,i.removeTagsForConversation(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](vo,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Gr[a]}]}}))}))}))]}))}))}function Mc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(fo,go).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(fo,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.removeTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](go,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Gr[a]}]}}))}))}))]}))}))}function bc(e,t,n){return W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(So,ho).validate("tagId",e,v.STRING,!0).validate("count",t,v.NUMBER,!0).validate("startTime",n,v.NUMBER,!0).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(So,JSON.stringify({tagId:e,count:t,startTime:n}),i),[4,o.getConversationListByTag(e,n,t)];case 1:return s=l.sent(),c=s.code,d=s.data,c===r.SUCCESS?(u=null==d?void 0:d.map((function(e){return function(e){return j(j({},He(e)),{isTopInTag:e.isTopInTag})}(e)})),a.info(ho,JSON.stringify({code:c,length:null==u?void 0:u.length}),i),[2,{code:c,data:u}]):(a.warn(ho,JSON.stringify({code:c}),i),[2,{code:c,msg:Gr[c]}])}}))}))}))]}))}))}function Lc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(To,Io).validate("tagId",e,v.STRING,!0).validate("containMuted",t,v.BOOLEAN,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(To,JSON.stringify({tagId:e,containMuted:t}),n),[4,i.getUnreadCountByTag(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](To,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]}}))}))}))]}))}))}function Gc(e,t,n){return W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(To,Io).validate("tagId",e,v.STRING,!0).validate("isTop",n,v.BOOLEAN,!0).validate("conversationType",null==t?void 0:t.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,s,c;return Q(this,(function(d){switch(d.label){case 0:return i=a.createTraceId(),a.info(To,JSON.stringify({tagId:e,targetId:t.targetId,conversationType:t.conversationType,isTop:n}),i),[4,o.setConversationStatusInTag(e,t,{isTop:n})];case 1:return s=d.sent().code,c=s===r.SUCCESS?"info":"warn",a[c](_o,JSON.stringify({code:s}),i),s===r.SUCCESS?[2,{code:s}]:[2,{code:s,msg:Gr[s]}]}}))}))}))]}))}))}var Jc={COMET:"comet",WEBSOCKET:"websocket"},Dc={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",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var Bc=Object.freeze({__proto__:null,getAllConversationList:function(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(cn,dn).validate("channelId",e,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(cn,JSON.stringify({channelId:e}),t),x(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return o=d.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:o=d.sent(),d.label=4;case 4:return a=o.code,s=o.data,i.info(dn,JSON.stringify({code:a,length:null==s?void 0:s.length}),t),a===r.SUCCESS&&s?(c=s.map((function(e){return He(e)})),[2,{code:a,data:c}]):(i.warn(dn,JSON.stringify({code:a}),t),[2,{code:a,msg:Gr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n,i){return W(this,void 0,void 0,(function(){var o=this;return Q(this,(function(a){return G()?[2,new I(un,ln).validate("startTime",e,v.NUMBER,!0).validate("count",t,v.NUMBER,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(a,s){return W(o,void 0,void 0,(function(){var o,c,d,u,l,v;return Q(this,(function(f){switch(f.label){case 0:return o=s.createTraceId(),s.info(un,JSON.stringify({startTime:e,count:t,channelId:n}),o),x(n)?[4,a.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return c=f.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(d,e,t,n,!!i)];case 3:c=f.sent(),f.label=4;case 4:return u=c.code,l=c.data,u===r.SUCCESS&&l?(v=l.map((function(e){return He(e)})),s.info(ln,JSON.stringify({code:u,length:v.length}),o),[2,{code:u,data:v}]):(s.warn(ln,JSON.stringify({code:u}),o),[2,{code:u,msg:Gr[u]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return G()?[2,new I(vn,fn).validate("keyword",e,v.STRING,!0).validate("messageTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!H(e)}))}),!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(vn,JSON.stringify({keyword:e,messageTypes:t,channelId:n}),i),x(n)?[4,o.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,o.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,d=s.data,c===r.SUCCESS&&d?(u=d.map((function(e){return He(e)})),a.info(fn,JSON.stringify({code:c,length:u.length}),i),[2,{code:c,data:u}]):(a.warn(fn,JSON.stringify({code:c}),i),[2,{code:c,msg:Gr[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},getConversations:function(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(ur,lr).validate("conversationList",e,J({maxLength:100,minLength:1,itemValidator:function(e){return V(e,[s.PRIVATE,s.GROUP,s.SYSTEM])}}),!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(ur,JSON.stringify({conversations:e}),t),[4,n.getConversations(e)];case 1:return o=d.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(c=s.map((function(e){return He(e)})),i.info(lr,JSON.stringify({code:a,length:c.length}),t),[2,{code:a,data:c}]):(i.warn(lr,JSON.stringify({code:a}),t),[2,{code:a,msg:Gr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,i,o){return W(this,void 0,void 0,(function(){var a=this;return Q(this,(function(s){return G()?[2,new I(gn,Sn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("keyword",t,v.STRING,!0).validate("startTime",n,v.NUMBER,!0).validate("count",i,v.NUMBER,!0).validate("messageTypes",o,J({itemValidator:H})).ifReady((function(s,c){return W(a,void 0,void 0,(function(){var a,d,u,l,v,f,g,S,h,T,I;return Q(this,(function(_){switch(_.label){case 0:return a=e.targetId,d=e.conversationType,u=e.channelId,l=c.createTraceId(),c.info(gn,JSON.stringify({targetId:a,conversationType:d,channelId:u,keyword:t,startTime:n,count:i}),l),o?[4,s.searchMessageByContentAndMessageType(d,a,t,n,i,o,u)]:[3,2];case 1:return v=_.sent(),[3,6];case 2:return x(u)?[4,s.searchMessageByContentWithAllChannel(d,a,t,n,i)]:[3,4];case 3:return v=_.sent(),[3,6];case 4:return 0,[4,s.searchMessageByContent(d,a,t,n,i,0,u)];case 5:v=_.sent(),_.label=6;case 6:return f=v.code,g=v.data,f===r.SUCCESS&&g?(S=g.messages,h=g.count,T=[],I=S.map((function(e){return T.push(e.messageUId),xe(e)})),c.info(Sn,JSON.stringify({code:f,list:T}),l),[2,{code:f,data:{messages:I,count:h}}]):(c.warn(Sn,JSON.stringify({code:f}),l),[2,{code:f,msg:Gr[f]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return G()?[2,new I(hn,Tn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("startTime",null==t?void 0:t.startTime,v.NUMBER,!0).validate("endTime",null==t?void 0:t.endTime,v.NUMBER,!0).validate("offset",null==t?void 0:t.offset,v.NUMBER).validate("limit",null==t?void 0:t.limit,v.NUMBER).validate("keyword",null==t?void 0:t.keyword,v.STRING,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S;return Q(this,(function(h){switch(h.label){case 0:return n=e.conversationType,a=e.targetId,s=t.keyword,c=t.startTime,d=t.endTime,u=t.offset,l=t.limit,u=u||0,l=l||5,v=o.createTraceId(),o.info(hn,JSON.stringify({targetId:a,conversationType:n,keyword:s,startTime:c,endTime:d,offset:u,limit:l}),v),[4,i.searchMessageByContentInTimeRangeWithAllChannel(n,a,s,c,d,u,l)];case 1:return f=h.sent(),g=f.code,S=f.data,g===r.SUCCESS&&S?[2,{code:g,data:{messages:S.messages.map((function(e){return xe(e)}))}}]:(o.warn(Tn,JSON.stringify({code:g}),v),[2,{code:g}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,i){return W(this,void 0,void 0,(function(){var o=this;return Q(this,(function(a){return G()?[2,new I(In,_n).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("userId",t,v.STRING,!0).validate("startTime",n,v.NUMBER,!0).validate("count",i,v.NUMBER,!0).ifReady((function(a,s){return W(o,void 0,void 0,(function(){var o,c,d,u,l,v,f;return Q(this,(function(g){switch(g.label){case 0:return o=e.conversationType,c=e.targetId,d=e.channelId,u=s.createTraceId(),s.info(In,JSON.stringify({targetId:c,conversationType:o,channelId:d,startTime:n,userId:t,count:i}),u),[4,a.searchMessagesByUser(o,c,t,n,i,d)];case 1:return l=g.sent(),v=l.code,f=l.data,v===r.SUCCESS&&f?[2,{code:v,data:{messages:f.messages.map((function(e){return xe(e)}))}}]:(s.warn(_n,JSON.stringify({code:v})),[2,{code:v}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return G()?[2,new I(mn,pn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t})).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("order",null==t?void 0:t.order,(function(e){return[0,1].includes(e)})).validate("messageTypes",null==t?void 0:t.messageTypes,(function(e){return!!f(e)&&!e.some((function(e){return!H(e)}))}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N,E;return Q(this,(function(y){switch(y.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,d=t.order,u=void 0===d?0:d,l=t.messageTypes,v=e.conversationType,f=e.targetId,g=e.channelId,S=void 0===g?"":g,h=o.createTraceId(),o.info(mn,JSON.stringify({targetId:f,conversationType:v,channelId:S,count:a,timestamp:c,messageTypes:l}),h),[4,i.getHistoryMessagesByObjectNames(v,f,c,a,l,u,S)];case 1:return T=y.sent(),I=T.code,_=T.data,I===r.SUCCESS?(p=(m=_).list,N=m.hasMore,E=p.map((function(e){return xe(e)})),[2,{code:I,data:{messages:E,hasMore:N,list:E}}]):(o.warn(pn,JSON.stringify({code:I})),[2,{code:I,msg:Gr[I]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},getContinuousMessages:function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return G()?[2,new I(Nn,En).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h,T,I,_;return Q(this,(function(m){switch(m.label){case 0:return n=t.count,a=t.timestamp,s=t.order,c=e.conversationType,d=e.targetId,u=e.channelId,l=o.createTraceId(),o.info(Nn,JSON.stringify({targetId:d,conversationType:c,channelId:u,count:n,timestamp:a}),l),(i.getNaviInfoFromCache()||{}).historyMsg?[4,i.getContinuousMessages(c,d,a||0,n||20,s||0,u||"")]:[2,{code:r.MESSAGE_STORAGE_SERVICE_UNAVAILABLE}];case 1:return v=m.sent(),f=v.code,g=v.data,f===r.SUCCESS?(h=(S=g).list,T=S.timestamp,I=S.hasMore,_=h.map((function(e){return xe(e)})),[2,{code:f,data:{list:_,timestamp:T,hasMore:I}}]):(o.warn(En,JSON.stringify({code:f})),[2,{code:f,msg:Gr[f]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return G()?[2,new I(yn,Rn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,r,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return n=e.conversationType,r=e.targetId,a=e.channelId,s=o.createTraceId(),o.info(yn,JSON.stringify({targetId:r,conversationType:n,channelId:a,timestamp:t}),s),[4,i.setMessageStatusToRead(n,r,t,a)];case 1:return c=d.sent(),o.info(Rn,JSON.stringify(c),s),[2,c]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return console.warn("`setMessageSentStatus` has being deprecated, use `setMessageReceivedStatusInfo` instead."),G()?[2,new I(Cn,On).validate("messageId",e,v.NUMBER,!0).validate("receivedStatus",t,(function(e){return!x(a[e])}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,r;return Q(this,(function(a){switch(a.label){case 0:return n=o.createTraceId(),o.info(Cn,JSON.stringify({messageId:e,receivedStatus:t}),n),[4,i.setMessageReceivedStatus(e,t)];case 1:return r=a.sent(),o.info(On,JSON.stringify({code:r}),n),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatusInfo:function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return G()?[2,new I(wn,Pn).validate("messageId",e,v.NUMBER,!0).validate("receivedStatusInfo",t,v.OBJECT,!0).validate("receivedStatusInfo",null==t?void 0:t.isRead,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isListened,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isDownload,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isRetrieved,v.BOOLEAN).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,r,a;return Q(this,(function(s){switch(s.label){case 0:return n=F(t),r=o.createTraceId(),o.info(wn,JSON.stringify({messageId:e,sentStatus:n}),r),[4,i.setMessageReceivedStatus(e,n)];case 1:return a=s.sent(),o.info(Pn,JSON.stringify({code:a}),r),[2,{code:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return G()?[2,new I(An,An).validate("messageId",e,v.NUMBER,!0).validate("sentStatus",t,(function(e){return!x(k[e])}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,r;return Q(this,(function(a){switch(a.label){case 0:return n=o.createTraceId(),o.info(An,JSON.stringify({messageId:e,sentStatus:t}),n),[4,i.setMessageSentStatus(e,t)];case 1:return r=a.sent(),o.info(Un,JSON.stringify({code:r}),n),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return G()?[2,new I(Mn,bn).validate("messageId",e,v.NUMBER,!0).validate("content",t,v.OBJECT,!0).validate("messageType",n,v.ONLY_STRING,!0).ifReady((function(o,r){return W(i,void 0,void 0,(function(){var i,a;return Q(this,(function(s){switch(s.label){case 0:return i=r.createTraceId(),r.info(Mn,JSON.stringify({messageId:e,messageType:n}),i),[4,o.setMessageContent(e,t,n)];case 1:return a=s.sent(),r.info(bn,JSON.stringify({code:a}),i),[2,{code:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(Ln,Gn).validate("messageIds",e,(function(e){return!!f(e)&&!e.some((function(e){return!y(e)}))}),!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o;return Q(this,(function(r){switch(r.label){case 0:return t=i.createTraceId(),i.info(Ln,JSON.stringify({messageIds:e}),t),[4,n.deleteMessages(e)];case 1:return o=r.sent(),i.info(Gn,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(Jn,Dn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,r,a,s;return Q(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,a=i.createTraceId(),i.info(Jn,JSON.stringify({conversationType:t,targetId:o,channelId:r}),a),[4,n.clearMessages(t,o,r)];case 1:return s=c.sent(),i.info(Dn,JSON.stringify({code:s}),a),[2,{code:s}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return W(this,void 0,void 0,(function(){var i,o,a,s=this;return Q(this,(function(c){return G()?(i=e.conversationType,o=e.targetId,a=e.channelId,[2,new I(Bn,kn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).validate("cleanSpace",n,v.BOOLEAN).ifReady((function(e,c){return W(s,void 0,void 0,(function(){var s,d,u;return Q(this,(function(l){switch(l.label){case 0:return s=c.createTraceId(),c.info(Bn,JSON.stringify({conversationType:i,targetId:o,channelId:a,timestamp:t,cleanSpace:n}),s),[4,e.deleteMessagesByTimestamp(i,o,t,n,a)];case 1:return d=l.sent(),u=d===r.SUCCESS?"info":"warn",c[u](kn,JSON.stringify({code:d}),s),[2,{code:d}]}}))}))}))]):[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},batchClearMessagesByTimestamp:function(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(ci,di).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,c;return Q(this,(function(d){switch(d.label){case 0:return t=function(e,t){if(!_("options",e,v.ARRAY,!0)||!_("options",e,(function(n){return!(e.length>20||0===e.length)||(t.error(di,"conversations length should not be greater than 20 and not be equal to 0"),!1)}),!0))return r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(!(_("options",o,v.OBJECT,!0)&&_("options.targetId",o.targetId,v.STRING,!0)&&_("options.conversationType",o.conversationType,(function(e){var n=[s.PRIVATE,s.GROUP,s.CHATROOM,s.SYSTEM].includes(e);return n||t.error(di,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.CHATROOM,\n ConversationType.SYSTEM,\n "),n}),!0)&&_("options.timestamp",o.timestamp,v.NUMBER,!0)&&_("options.channelId",o.channelId,v.ONLY_STRING)))return r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}}(e,i),t?[2,{code:r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}]:(o=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),a=i.createTraceId(),i.info(ci,"options: "+JSON.stringify(o),a),[4,n.batchClearMessagesByTimestamp(o)]);case 1:return c=d.sent(),i[r.SUCCESS===c?"info":"warn"](di,"code: "+c,a),[2,{code:c}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return G()?[2,new I(xn,Hn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("userId",t,(function(e){return e instanceof Qa||_("message.senderUserId",null==e?void 0:e.senderUserId,v.STRING,!0)}),!0).validate("messageType",null==t?void 0:t.messageType,v.STRING,!0).validate("content",null==t?void 0:t.content,v.OBJECT,!0).validate("messageDirection",t,(function(e){return e instanceof Qa||_("message.messageDirection",null==e?void 0:e.messageDirection,v.NUMBER,!0)}),!0).validate("canIncludeExpansion",t,(function(e){return e instanceof Qa||_("message.canIncludeExpansion",null==e?void 0:e.canIncludeExpansion,v.BOOLEAN)})).validate("expansion",t,(function(e){return e instanceof Qa||_("message.expansion",null==e?void 0:e.expansion,v.OBJECT)})).validate("disableNotification",t,(function(e){return e instanceof Qa||_("message.expansion",null==e?void 0:e.disableNotification,v.BOOLEAN)})).validate("timestamp",t,(function(e){return e instanceof Qa||_("message.sentTime",null==e?void 0:e.sentTime,v.NUMBER)})).validate("sentStatus",t,(function(e){return e instanceof Qa||_("message.sentStatus",null==e?void 0:e.sentStatus,v.NUMBER)})).validate("receivedStatus",t,(function(e){return e instanceof Qa||_("message.receivedStatus",null==e?void 0:e.receivedStatus,v.NUMBER)})).validate("receivedStatusInfo",t,(function(e){return e instanceof Qa||_("message.receivedStatusInfo",null==e?void 0:e.receivedStatusInfo,v.OBJECT)})).validate("directedUserIds",t,(function(e){return e instanceof Qa||!(null==e?void 0:e.directedUserIds)||!(!(null==e?void 0:e.directedUserIds)||!f(null==e?void 0:e.directedUserIds))&&(!e.directedUserIds.some((function(e){return!R(e)}))&&e.directedUserIds.length<300)})).validate("searchContent",null==n?void 0:n.searchContent,v.STRING).ifReady((function(o,s){return W(i,void 0,void 0,(function(){var i,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N,E,y,R,C;return Q(this,(function(O){switch(O.label){case 0:return i="",c=1,v=!1,g=a.UNREAD,T=t.messageType,I=t.content,t instanceof Qa||(i=t.senderUserId,c=t.messageDirection,v=t.canIncludeExpansion,f=t.expansion,l=t.disableNotification,d=t.sentTime,u=t.sentStatus,g=t.receivedStatus,S=t.receivedStatusInfo,h=t.directedUserIds),_=s.createTraceId(),s.info(xn,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,messageType:T,sentTime:d}),_),m=n.isUnread,p=n.searchContent,N=g,S&&(N=F(S)),E={senderUserId:i,messageType:T,content:I,messageDirection:c,sentTime:d,sentStatus:u,searchContent:p,isUnread:!!m,messageUId:"",disableNotification:l,canIncludeExpansion:v,expansionMsg:JSON.stringify(f),channelId:e.channelId||"",readStatus:N,directedUserIds:h},[4,o.insertMessage(e.conversationType,e.targetId,E)];case 1:return y=O.sent(),R=y.code,C=y.data,R===r.SUCCESS?(s.info(Hn,JSON.stringify({code:R,messageId:null==C?void 0:C.messageId}),_),[2,{code:R,data:xe(C)}]):(s.warn(Hn,JSON.stringify({code:R}),_),[2,{code:R,msg:Gr[R]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return G()?[2,new I(Fn,Fn).validate("messages",e,(function(e){var t,n,i,o;if(!_("messages",e,v.ARRAY,!0))return!1;if(e.length<=0||e.length>=500)return!1;for(var r in e)if(!_("message",e[r],v.OBJECT,!0)||!_("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)||!_("message.targetId",e[r].targetId,v.STRING,!0)||!_("message.senderUserId",e[r].senderUserId,v.STRING,!0)||!_("message.messageType",e[r].messageType,v.STRING,!0)||!_("message.content",e[r].content,v.OBJECT,!0)||!_("message.messageDirection",e[r].messageDirection,v.NUMBER,!0)||!_("message.canIncludeExpansion",e[r].canIncludeExpansion,v.BOOLEAN)||!_("message.expansion",e[r].expansion,v.OBJECT)||!_("message.disableNotification",e[r].disableNotification,v.BOOLEAN)||!_("message.sentTime",e[r].sentTime,v.NUMBER)||!_("message.sentStatus",e[r].sentStatus,v.NUMBER)||!_("options.isUnread",null===(t=e[r])||void 0===t?void 0:t.isUnread,v.BOOLEAN)||!_("options.searchContent",null===(n=e[r])||void 0===n?void 0:n.searchContent,v.STRING)||!_("options.receivedStatus",null===(i=e[r])||void 0===i?void 0:i.receivedStatus,v.NUMBER)||!_("options.receivedStatusInfo",null===(o=e[r])||void 0===o?void 0:o.receivedStatusInfo,v.OBJECT)||e[r].directedUserIds&&e[r].directedUserIds.some((function(e){return!_("userId",e,v.STRING,!0)}))&&e[r].directedUserIds.length<300)return console.warn("then "+r+" index message validation failed"),!1;return!0}),!0).validate("checkDuplicate",t,v.BOOLEAN).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Vn,JSON.stringify({checkDuplicate:t,length:e.length}),n),[4,i.batchInsertMessage(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Fn,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Fn,JSON.stringify({code:s}),n),[2,{code:s,msg:Gr[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},getMessageCount:function(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(Yn,qn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,r,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,a=i.createTraceId(),i.info(Yn,JSON.stringify({conversationType:t,targetId:o,channelId:r}),a),[4,n.getMessageCount(t,o,r)];case 1:return s=u.sent(),c=s.code,d=s.data,i.info(qn,JSON.stringify({code:c,data:d}),a),[2,{code:c,data:d}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(Kn,zn).validate("messageUId",e,v.STRING,!0).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Kn,JSON.stringify({messageUId:e}),t),[4,n.getPrivateMessageDeliverTime(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(zn,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(zn,JSON.stringify({code:a}),t),[2,{code:a,msg:Gr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return G()?[2,new I(jn,Wn).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(jn,JSON.stringify({targetId:e,messageUId:t}),n),[4,i.getGroupMessageDeliverList(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](Wn,JSON.stringify({code:s}),n),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Gr[s]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(Qn,Xn).validate("checkDuplicate",e,v.BOOLEAN).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,r,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Qn,JSON.stringify({checkDuplicate:e}),t),[4,n.setCheckDuplicateMessage(!!e)];case 1:return o=s.sent(),r=o.code,a=o.data,i.info(Xn,JSON.stringify({code:r,data:a}),t),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},setCheckChatRoomDuplicateMessage:function(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return G()?[2,new I(Zn,$n).validate("checkDuplicate",e,v.BOOLEAN).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,r,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Zn,JSON.stringify({checkDuplicate:e}),t),[4,n.setCheckChatRoomDuplicateMessage(!!e)];case 1:return o=s.sent(),r=o.code,a=o.data,i.info($n,JSON.stringify({code:r,data:a}),t),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},getMessagesAroundTimestamp:function(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return G()?[2,new I(cr,dr).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,D,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,Y({min:0}),!0).validate("beforeCount",null==t?void 0:t.beforeCount,Y({min:0}),!0).validate("afterCount",null==t?void 0:t.afterCount,Y({min:0}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return Q(this,(function(v){switch(v.label){case 0:return n=o.createTraceId(),o.info(cr,JSON.stringify({option:t,conversation:e}),n),a=t.timestamp,s=t.beforeCount,c=t.afterCount,[4,i.getMessagesByTimestamp(e,a,s,c)];case 1:return d=v.sent(),u=d.code,l=d.data,u===r.SUCCESS?(o.info(dr,JSON.stringify({code:u,data:l}),n),[2,{code:u,data:null==l?void 0:l.map((function(e){return xe(e)}))}]):(o.warn(dr,JSON.stringify({code:u}),n),[2,{code:u,msg:Gr[u]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return W(this,void 0,void 0,(function(){var e=this;return Q(this,(function(t){return G()?[2,mr((function(t,n){return W(e,void 0,void 0,(function(){var e,i,o,a,s;return Q(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(Qn,"clearLocalData ->",e),[4,t.clearData()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Xn,JSON.stringify({code:o}),e),[2,{code:o,data:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Gr[r.NOT_SUPPORT]}]}))}))},enable:function(){return G()}});function kc(e){return W(this,void 0,void 0,(function(){var t=this;return Q(this,(function(n){return[2,new I(Yi,qi).validate("set.proxy",e,(function(t){return!!(!e||_("proxy.socksHost",e.socksHost,v.STRING,!0)&&_("proxy.socksPort",e.socksPort,v.NUMBER,!0))})).ifReady((function(n,i){return W(t,void 0,void 0,(function(){var t,o,a;return Q(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Yi,JSON.stringify({socksHost:null==e?void 0:e.socksHost,socksPort:null==e?void 0:e.socksPort}),t),[4,n.setProxy(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](qi,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Gr[o]}]}}))}))}))]}))}))}function xc(){return W(this,void 0,void 0,(function(){var e=this;return Q(this,(function(t){return[2,new I(Ki,zi).ifReady((function(t,n){return W(e,void 0,void 0,(function(){var e,i,o,a;return Q(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(Ki,"",e),[4,t.getProxy()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.info(zi,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):(n.warn(zi,JSON.stringify({code:o}),e),[2,{code:o,msg:Gr[o]}])}}))}))}))]}))}))}function Hc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(ji,Wi).validate("test.proxy",e,v.OBJECT,!0).validate("test.proxy.socksHost",null==e?void 0:e.socksHost,v.STRING,!0).validate("test.proxy.socksPort",null==e?void 0:e.socksPort,v.NUMBER,!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c;return Q(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(ji,JSON.stringify({socksHost:null==e?void 0:e.socksHost,socksPort:null==e?void 0:e.socksPort}),n),[4,i.testProxy(e,t)];case 1:return a=d.sent(),s=a.status,c=a.data,s===r.SUCCESS?[2,{code:s,msg:c}]:(o.warn(Wi,JSON.stringify({status:s}),n),[2,{code:s,msg:Gr[s]}])}}))}))}))]}))}))}function Vc(e,t,n){return W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(er,tr).validate("subscribeUserIds",e,J({maxLength:200,minLength:1,itemValidator:D}),!0).validate("subscribeType",t,(function(e){return e===q.ONLINE_STATUS}),!0).validate("expiry",n,Y({min:60,max:2592e3}),!0).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(er,JSON.stringify({userIds:e,subscribeType:t,expiry:n}),i),[4,o.subscribeUser(e,t,n)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",a[u](tr,JSON.stringify({code:c,data:d}),i),[2,{code:c,data:d}]}}))}))}))]}))}))}function Fc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(nr,ir).validate("subscribeUserIds",e,J({maxLength:200,minLength:1,itemValidator:D}),!0).validate("subscribeType",t,(function(e){return e===q.ONLINE_STATUS}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s;return Q(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(nr,JSON.stringify({userIds:e,subscribeType:t}),n),[4,i.unSubscribeUser(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](ir,JSON.stringify({code:a}),n),[2,{code:a}]}}))}))}))]}))}))}function Yc(e,t,n){return W(this,void 0,void 0,(function(){var i=this;return Q(this,(function(o){return[2,new I(ar,sr).validate("subscribeType",e,(function(e){return e===q.ONLINE_STATUS}),!0).validate("subscribePageSize",t,Y({min:1,max:200}),!0).validate("offset",n,Y({min:0}),!0).ifReady((function(o,a){return W(i,void 0,void 0,(function(){var i,s,c,d,u;return Q(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(ar,JSON.stringify({pageSize:t,offset:n}),i),[4,o.getSubscribeUserList(e,t,n)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",a[u](sr,JSON.stringify({code:c,data:d}),i),c===r.SUCCESS?[2,{code:c,data:d}]:[2,{code:c}]}}))}))}))]}))}))}function qc(e,t){return W(this,void 0,void 0,(function(){var n=this;return Q(this,(function(i){return[2,new I(nr,ir).validate("subscribeType",e,(function(e){return e===q.ONLINE_STATUS}),!0).validate("subscribeUserIds",t,J({maxLength:200,minLength:1,itemValidator:D}),!0).ifReady((function(i,o){return W(n,void 0,void 0,(function(){var n,a,s,c,d;return Q(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(or,JSON.stringify({userIds:t}),n),[4,i.getSubscribeUserStatus(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](rr,JSON.stringify({code:s}),n),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s}]}}))}))}))]}))}))}export{Qa as BaseMessage,is as CombineMessage,os as CombineV2Message,ls as CommandMessage,Jc as ConnectType,Je as Events,rs as FileMessage,as as GIFMessage,fs as GroupNotificationMessage,es as HQVoiceMessage,$a as ImageMessage,vs as InformationNotificationMessage,cs as LocationMessage,Dc as MessageType,ds as ReferenceMessage,us as RichContentMessage,ts as SightMessage,ns as TextMessage,As as UploadTask,ss as VoiceMessage,Pr as __addSDKVersion,Uc as addConversationsToTag,pr as addEventListener,yc as addTag,Ka as addToBlacklist,sc as batchClearRemoteHistoryMessages,ic as batchGetMessageReadReceiptInfoV4,Fr as batchRemoveConversation,ta as batchSetConversationNotificationLevel,da as batchSetConversationToTop,qa as bindRTCRoomForChatroom,Zr as clearAllMessagesUnreadStatus,Rr as clearEventListeners,ac as clearHistoryMessages,mc as clearMessages,Xr as clearMessagesUnreadStatus,Kr as clearTextMessageDraft,Nc as clearUnreadCountByTimestamp,Br as connect,bs as createUploadTask,_c as deleteLocalMessagesByTimestamp,rc as deleteMessages,Or as destroy,kr as disconnect,Bc as electronExtension,Ha as forceRemoveChatRoomEntry,Ba as forceSetChatRoomEntry,Fa as getAllChatRoomEntries,ga as getAllConversationState,Oa as getAllUltraGroupUnreadCount,Aa as getAllUltraGroupUnreadMentionedCount,fa as getAllUnreadMentionedCount,ja as getBlacklist,Wa as getBlacklistStatus,ha as getBlockUltraGroupList,ra as getBlockedConversationList,Va as getChatRoomEntry,Ga as getChatRoomInfo,Ya as getChatroomHistoryMessages,Ar as getConnectionStatus,Hr as getConversation,xr as getConversationList,ia as getConversationNotificationLevel,oa as getConversationNotificationStatus,sa as getConversationTypeNotificationLevel,bc as getConversationsFromTagByPage,wr as getCurrentUserId,Mr as getDeviceId,Ds as getDownloadAuth,Js as getFileToken,Bs as getFileUrl,fc as getFirstUnreadMessage,gc as getFirstUnreadMessageInfo,zs as getHistoryMessages,hc as getMessage,nc as getMessageReadReceiptV4,lc as getMessageReader,xc as getProxy,js as getRemoteHistoryMessages,Ur as getServerTime,Yc as getSubscribeUserList,qc as getSubscribeUserStatus,Oc as getTags,Ac as getTagsFromConversation,Yr as getTextMessageDraft,ua as getTopConversationList,zr as getTotalUnreadCount,jr as getTotalUnreadCountByLevels,Wr as getTotalUnreadMentionedCountByLevels,ya as getUltraGroupDefaultNotificationLevel,wa as getUltraGroupFirstUnreadMessageTimestamp,Sa as getUltraGroupList,Ia as getUltraGroupMessageListByMessageUId,Ca as getUltraGroupUnreadCountByTargetId,Pa as getUltraGroupUnreadInfoList,Ea as getUltraGroupUnreadMentionedCountByTargetId,Ua as getUltraGroupUnreadMentionedMessages,la as getUnreadConversationList,Qr as getUnreadCount,Lc as getUnreadCountByTag,va as getUnreadMentionedCount,Tc as getUnreadMentionedMessages,Cr as init,Sc as insertMessage,br as installPlugin,Ma as joinChatRoom,ba as joinExistChatRoom,Na as modifyMessage,Nr as onceEventListener,La as quitChatRoom,oc as recallMessage,vc as registerMessageType,pa as removeAllExpansionForUltraGroupMessage,xa as removeChatRoomEntries,ka as removeChatRoomEntry,Vr as removeConversation,wc as removeConversationsFromTag,Er as removeEventListener,yr as removeEventListeners,ma as removeExpansionForUltraGroupMessage,za as removeFromBlacklist,dc as removeMessageExpansionForKey,Rc as removeTag,Mc as removeTagFromConversations,Pc as removeTagsFromConversation,qr as saveTextMessageDraft,pc as searchConversationByContent,Ic as searchMessages,Vs as sendFileMessage,Ys as sendGIFMessage,qs as sendHQVoiceMessage,Fs as sendImageMessage,ks as sendMessage,Ws as sendReadReceiptMessage,tc as sendReadReceiptMessageV4,Qs as sendReadReceiptRequest,Xs as sendReadReceiptResponse,$s as sendReadReceiptResponseV2,Ks as sendSightMessage,ec as sendSyncReadStatusMessage,xs as sendTextMessage,uc as sendTypingStatusMessage,Ta as sendUltraGroupTypingStatus,Da as setChatRoomEntries,Ja as setChatRoomEntry,ea as setConversationNotificationLevel,na as setConversationNotificationStatus,ca as setConversationToTop,Gc as setConversationToTopInTag,aa as setConversationTypeNotificationLevel,Ec as setMessageReceivedStatus,kc as setProxy,Ra as setUltraGroupDefaultNotificationLevel,Ls as stopUploadTask,Vc as subscribeUserStatus,Hc as testProxy,Fc as unSubscribeUserStatus,_a as updateExpansionForUltraGroupMessage,cc as updateMessageExpansion,Cc as updateTag,Gs as upload};