@rongcloud/imlib-next 5.6.2-beem.1 → 5.6.2-beem.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1 +1 @@
1
- import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as r,ReceivedStatus as i,ConversationType as a,isNumber as s,EventEmitter as c,VersionManage as u,assert as d,AssertRules as f,isArray as l,isHttpUrl as g,APIContext as v,LogTagId as I,logger as h,validate as R,isValidConversationType as m,isValidNotificationLevel as E,NotificationLevel as p,UltraGroupChannelType as T,isString as S,getUUID as O,UploadMethod as N,isValidFileType as C,FileType as _,usingCppEngine as A,MessageDirection as y,isUndefined as M}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,ReceivedStatus,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var U=function(){return U=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},U.apply(this,arguments)};function P(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function L(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var w=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},b=w();var B,D,G={tag:"browser",httpReq:function(e){var r=e.method||t.GET,i=e.timeout||n,a=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var t,n=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),o="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(r,u),a&&n.setRequestHeader)for(var s in a)n.setRequestHeader(s,a[s]);if(o){n.timeout=i,n.onload=function(){e({data:n.responseText,status:n.status||200})},n.onerror=function(){e({status:n.status||0})},n.ontimeout=function(){e({status:n.status||0})};var d="object"==typeof c?JSON.stringify(c):c;n.send(d)}else n.onreadystatechange=function(){4===n.readyState&&e({data:n.responseText,status:n.status})},n.onerror=function(){e({status:n.status||0})},setTimeout((function(){n.abort(),e({status:n.status||0})}),i),n.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:b,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.UNKONWN;return new Promise((function(e){e(r)}))}},x=w(),V=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},k={setItem:V("setStorageSync"),getItem:V("getStorageSync"),removeItem:V("removeStorageSync"),clear:V("clearStorageSync")},H={tag:"wechat",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){wx.request({url:d,method:i,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:k,sessionStorage:k,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},F=w(),q=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},Z={setItem:q("setStorageSync"),getItem:q("getStorageSync"),removeItem:q("removeStorageSync"),clear:q("clearStorageSync")},J={tag:"alipay",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:i,headers:s,timeout:a,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Z,sessionStorage:Z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:F,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},z=w(),K=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){}}},Y={setItem:K("setStorageSync"),getItem:K("getStorageSync"),removeItem:K("removeStorageSync"),clear:K("clearStorageSync")},W={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:z,localStorage:Y,sessionStorage:Y,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},X=w(),j=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){}}},Q={setItem:j("setStorageSync"),getItem:j("getStorageSync"),removeItem:j("removeStorageSync"),clear:j("clearStorageSync")},$={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:X,localStorage:Q,sessionStorage:Q,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return P(this,void 0,void 0,(function(){return L(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))]}))}))}},ee=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)}}},te={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},ne={tag:"uniapp",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){uni.request({url:d,method:i,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:te,sessionStorage:te,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},oe=function(e){return e&&e.request&&e.getSystemInfo},re="undefined"!=typeof uni&&oe(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ne;case"mp-baidu":return $;case"mp-toutiao":return W;case"mp-alipay":return J;case"mp-weixin":return H;default:return G}}():"undefined"!=typeof my&&oe(my)?J:"undefined"!=typeof tt&&oe(tt)?W:"undefined"!=typeof swan&&oe(swan)?$:"undefined"!=typeof wx&&oe(wx)?H:G;function ie(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,h=e.isOffLineMessage,R=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,p=e.disableNotification,T=e.isMentioned,S=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,C=e.messageId,_=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;E||(E=i.UNREAD);var U={messageType:o,channelId:n||"",content:r,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:p,isStatusMessage:S,canIncludeExpansion:R,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:C,isInterrupt:_,isModifyMessage:A,sentStatus:M};return t!==a.ULTRA_GROUP&&(U.isOffLineMessage=h),t===a.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function ae(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,a=e.mentionedInfo,s=e.lastUnreadTime,c=e.notificationStatus,u=e.notificationLevel,d=e.isTop,f=e.channelId,l=e.unreadMentionedCount;return{conversationType:t,targetId:n,latestMessage:o&&ie(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:s,notificationStatus:c,notificationLevel:u,isTop:d,channelId:f,unreadMentionedCount:l}}function se(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED"}(B||(B={})),function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(D||(D={}));var ce=new c,ue={onConnecting:function(){ce.emit(B.CONNECTING)},onConnected:function(){ce.emit(B.CONNECTED)},onDisconnect:function(e){ce.emit(B.DISCONNECT,e)},onSuspend:function(e){ce.emit(B.SUSPEND,e)},batchMessage:function(e){ce.emit(B.MESSAGES,{messages:e.map((function(e){return ie(e)}))})},typingState:function(e){ce.emit(B.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){ce.emit(B.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){ce.emit(B.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){ce.emit(B.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?ie(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===a.ULTRA_GROUP?(n.versionTime=e.versionTime,{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));ce.emit(B.CONVERSATION,{conversationList:t})},chatroomState:function(e){ce.emit(B.CHATROOM,e)},expansion:function(e){ce.emit(B.EXPANSION,e)},pullFinished:function(){ce.emit(B.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){ce.emit(B.TAG)},conversationTagChanged:function(){ce.emit(B.CONVERSATION_TAG)},messageBlocked:function(e){ce.emit(B.MESSAGE_BLOCKED,e)},ultraGroupEnable:function(e){ce.emit(B.ULTRA_GROUP_ENABLE,e)},operateStatus:function(e){ce.emit(B.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){ce.emit(B.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e)},ultraGroupMessageModified:function(e){ce.emit(B.ULTRA_GROUP_MESSAGE_MODIFIED,e)},ultraGroupMessageRecalled:function(e){ce.emit(B.ULTRA_GROUP_MESSAGE_RECALLED,e)},ultraGroupChannelChangeType:function(e){ce.emit(B.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){ce.emit(B.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){ce.emit(B.ULTRA_GROUP_CHANNEL_DELETE,e)}};u.add("imlib-next","5.6.2-beem.1");var de=null,fe=null,le=null;function ge(){return P(this,void 0,void 0,(function(){return L(this,(function(e){switch(e.label){case 0:return de?(le.info(I.A_DESTROY_O),[4,v.destroy()]):[2];case 1:return e.sent(),fe=null,de=null,le=null,[2]}}))}))}function ve(e){if(!de)throw new Error("Not initialized yet!");return e(de,le,fe)}function Ie(e){return de?e(de,le,fe):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function he(e,t,n){ce.on(e,t,n)}function Re(e,t,n){ce.once(e,t,n)}function me(e,t,n){ce.off(e,t,n)}function Ee(e){ce.removeAll(e)}function pe(){ce.clear()}function Te(e){!function(e){var t=e.appkey,n=e.navigators;de?le.warn(I.A_INIT_REPEAT_O):(d("options.appkey",e.appkey,f.STRING,!0),d("options.navigators",e.navigators,(function(e){return l(e)&&(0===e.length||e.every(g))})),fe=e,de=v.init(re,{appkey:e.appkey,apiVersion:"5.6.2-beem.1",navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,checkCA:e.checkCA,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(le=de.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),le.info(I.A_INIT_O,JSON.stringify({appkey:t,navigators:n,version:"5.6.2-beem.1",commit:"95e6bb218bb8a82803c04d162208272b9289d66b"})),de.assignWatcher(ue))}(e)}function Se(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return de?(pe(),[2,ge()]):[2]}))}))}function Oe(){return ve((function(e){return e.getConnectionStatus()}))}function Ne(){return ve((function(e){return e.getServerTime()}))}function Ce(){return ve((function(e){return e.getCurrentUserId()}))}function _e(e,t){u.add(e,t)}function Ae(){return ve((function(e){return e.getDeviceId()}))}function ye(e,t){return ve((function(n){return n.install(e,t)}))}var Me={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:r.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Ue={};for(var Pe in Me){var Le=Me[Pe].code;Ue[Le]=Pe}function we(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return R("token",e,f.STRING,!0)&&R("reconnectKickEnable",t,f.BOOLEAN)?(n=i.createTraceId(),i.info(I.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!1,t,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===r.SUCCESS?"info":"warn",i[s](I.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:Ue[a.code]}]}}))}))}))]}))}))}function be(){return h.info(I.A_DISCONNECT_O,{}),ve((function(e){return e.disconnect()}))}function Be(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options.count",null==e?void 0:e.count,f.NUMBER)&&R("options.startTime",null==e?void 0:e.startTime,f.NUMBER)&&R("options.order",null==e?void 0:e.order,f.NUMBER)&&R("channelId",t,f.CHANNEL_ID)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ae(e)}))}]:(i.warn(I.O,"get conversation list fail ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function De(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),i=t.code,a=t.data,i!==r.SUCCESS?(o.warn(I.O,"getConversation ->code:".concat(i,", targetId:").concat(e.targetId)),[2,{code:i,msg:Ue[i]}]):[2,{code:i,data:a?ae(a):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ge(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i;return L(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"destroy conversation ->".concat(i)),t!==r.SUCCESS?(o.warn(I.O,"destroy conversation fail ->".concat(t,":").concat(Ue[t],",").concat(i)),[2,{code:t,msg:Ue[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xe(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),i=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"get draft ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a||""}]:(o.warn(I.O,"get draft fail ->".concat(i,":").concat(Ue[i],",").concat(s)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ve(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options",e,f.CONVERSATION,!0)&&R("draft",t,f.STRING,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===r.SUCCESS?[2,{code:a}]:(i.warn(I.O,"set draft fail ->".concat(a,":").concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ke(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i;return L(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(i=a.sent())===r.SUCCESS?[2,{code:i}]:(o.warn(I.O,"delete draft fail ->".concat(i,":").concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function He(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("includeMuted",e,f.BOOLEAN,!1)&&R("conversationTypes",t,f.ARRAY,!1)&&!(null==t?void 0:t.every((function(e){return!R("conversationType",e,m)})))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return i.debug(I.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getTotalUnreadCount fail ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fe(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return!R("conversationTypes",e,f.ARRAY,!0)||!R("levels",t,f.ARRAY,!0)||e.every((function(e){return!R("conversationType",e,m)}))||t.every((function(e){return!R("level",e,E)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]}))}))}function qe(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return!R("conversationTypes",e,f.ARRAY,!0)||!R("levels",t,f.ARRAY,!0)||e.every((function(e){return!R("conversationType",e,m)}))||t.every((function(e){return!R("level",e,E)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]}))}))}function Ze(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),i=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"get unreadCount ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(I.O,"get unreadCount fail ->".concat(i,":").concat(Ue[i],",").concat(s)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i;return L(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"clear unreadMsgNum ->".concat(i)),t!==r.SUCCESS?(o.warn(I.O,"clear unreadMsgNum fail ->".concat(t,":").concat(Ue[t],",").concat(i)),[2,{code:t,msg:Ue[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){return L(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}Me.ROAMING_SERVICE_UNAVAILABLE.code;var Ke=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(I.O,"".concat(n," -> ").concat(o)),o},Ye=function(e,t,n,o){return void 0===o&&(o=""),P(void 0,void 0,void 0,(function(){var i,a;return L(this,(function(s){switch(s.label){case 0:return i=Ke(e,t,o),[4,n()];case 1:return(a=s.sent())!==r.SUCCESS?(e.warn(I.O,"".concat(o," fail -> ").concat(a," : ").concat(Ue[a]," , ").concat(i)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))};function We(e,t){return P(this,void 0,void 0,(function(){return L(this,(function(n){return R("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return Ye(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xe(e,t){return P(this,void 0,void 0,(function(){return L(this,(function(n){return R("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return Ye(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return t=Ke(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return i=c.sent(),a=i.code,s=i.data,a===r.SUCCESS?[2,{code:a,data:s}]:(o.warn(I.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(Ue[a]," , ").concat(t)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qe(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(I.O,"getConversationNotificationStatus ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ie((function(e){return e.getBlockConversationList()}))]}))}))}function et(e,t){return void 0===t&&(t=!0),P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options",e,f.CONVERSATION,!0)&&R("isTop",t,f.BOOLEAN)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"set conversation status fail ->".concat(a,":").concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nt(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ie((function(e){return e.getTopConversationList()}))]}))}))}function ot(e){return P(this,void 0,void 0,(function(){return L(this,(function(t){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(t,n){return n.debug(I.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rt(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ie((function(e,t){return t.debug(I.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function it(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ie((function(e){return e.getAllConversationState()}))]}))}))}function at(e){return void 0===e&&(e={}),P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options.targetId",e.targetId,f.STRING,!1)&&R("options.channelType",e.channelType,(function(e){return void 0!==T[e]}),!1)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(o.warn(I.O,"get ultragroup ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function st(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,i;return L(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(n.warn(I.O,"get block ultragroup ->".concat(o,":").concat(Ue[o])),[2,{code:o,msg:Ue[o]}])}}))}))}))]}))}))}function ct(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(i){switch(i.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(I.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(Ue[t])),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ut(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options",e,f.CONVERSATION,!0)&&R("msgs",t,f.ARRAY,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:return d=g.sent(),f=d.code,l=d.data,f===r.SUCCESS?[2,{code:r.SUCCESS,data:l}]:(i.warn(I.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(Ue[f])),[2,{code:f,msg:Ue[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("expansion",e,f.OBJECT,!0)&&R("message",t,f.OBJECT,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),i.debug(I.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(I.O,"update expansion for ultragroup message ->".concat(g,":").concat(Ue[g])),[2,{code:g,msg:Ue[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("expansion",e,f.ARRAY,!0)&&R("message",t,f.OBJECT,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),i.debug(I.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(I.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(Ue[g])),[2,{code:g,msg:Ue[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("message",e,f.OBJECT,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return t=e.conversationType,i=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(u,",messageUId:").concat(a),o.debug(I.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:i,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(f)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(I.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(Ue[l])),[2,{code:l,msg:Ue[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("content",e,f.OBJECT,!0)&&R("message",t,f.OBJECT,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v;return L(this,(function(h){switch(h.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,f=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(f,",messageUId:").concat(s),i.debug(I.O,"update ultragroup message expansion ->".concat(l)),g={targetId:a,channelId:f,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=h.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(I.O,"modify ultraGroup message ->".concat(v,":").concat(Ue[v])),[2,{code:v,msg:Ue[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.every((function(e){return!R("notificationLevel",e,E)})))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return i.debug(I.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:r.SUCCESS,data:s}]:(i.warn(I.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options.targetId",e.targetId,f.STRING,!0)&&R("options.channelId",e.channelId,f.CHANNEL_ID)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s,c;return L(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(I.O,"".concat(t," -> ").concat(i)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS?[2,{code:s,data:c}]:(o.warn(I.O,"".concat(t," fail -> ").concat(s," : ").concat(Ue[s]," , ").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return e.channelId=e.channelId||"",R("options.targetId",e.targetId,f.STRING,!0)&&R("options.channelId",e.channelId,f.ONLY_STRING,!0)&&R("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),i.debug(I.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===r.SUCCESS?[2,{code:s}]:(i.warn(I.O,"".concat(n," fail -> ").concat(s," : ").concat(Ue[s]," , ").concat(a)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.every((function(e){return!R("notificationLevel",e,E)})))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,u="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),i.debug(I.O,"".concat(n," -> ").concat(u)),s===r.SUCCESS?[2,{code:s,data:c}]:(i.warn(I.O,"".concat(n," fail -> ").concat(s,": ").concat(Ue[s],", ").concat(u)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,i,a;return L(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),i=o.code,a=o.data,n.debug(I.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(I.O,"".concat(e," fail ->").concat(i,": ").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function Et(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,i,a;return L(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),i=o.code,a=o.data,n.debug(I.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(I.O,"".concat(e," fail ->").concat(i,": ").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function pt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return e.channelId=e.channelId||"",R("options.targetId",e.targetId,f.STRING,!0)&&R("options.channelId",e.channelId,f.ONLY_STRING,!0)&&R("options.sentTime",e.sentTime,f.NUMBER,!0)&&R("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return t=e.targetId,i=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:i,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===r.SUCCESS?[2,{code:d,data:f}]:(o.warn(I.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Ue[d])),[2,{code:d,msg:Ue[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("conversation.targetId",e.targetId,f.STRING,!0)&&R("conversation.channelId",e.channelId,f.ONLY_STRING,!0)?[2,Ie((function(n){return P(t,void 0,void 0,(function(){var t,o,i,a,s,c;return L(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,i={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(i)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Ue[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var St=function(e){return!!(R("options.key",e.key,f.STRING,!0)&&R("options.value",e.value,f.STRING,!0)&&R("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)&&R("options.isSendNotification",e.isSendNotification,f.BOOLEAN)&&R("options.notificationExtra",e.notificationExtra,f.STRING))},Ot=function(e){return!(!R("options.key",e.key,f.STRING,!0)||!R("options.isSendNotification",e.isSendNotification,f.BOOLEAN)||!R("options.notificationExtra",e.notificationExtra,f.STRING))};function Nt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("options.count",t.count,f.NUMBER,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(I.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",i[s](I.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Ue[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("options.count",t.count,f.NUMBER,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(I.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",i[s](I.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Ue[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("targetId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(I.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return i=s.sent(),a=i===r.SUCCESS?"info":"warn",o[a](I.A_QUIT_CHATROOM_R,JSON.stringify({code:i}),t),i!==r.SUCCESS?[2,{code:i,msg:Ue[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("options.count",t.count,f.NUMBER)&&R("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(I.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(i.warn(I.O,"get chatroom info fail ->code+:".concat(Ue[s],",").concat(n)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&St(t)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(I.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"set chatroom entry fail ->code+:".concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!R("entry.key",e.key,f.STRING,!0)||!R("entry.value",e.value,f.STRING,!0)}))||!R("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)||!R("options.notificationExtra",e.notificationExtra,f.STRING)||!R("options.isForce",e.isForce,f.BOOLEAN))}(t)?t.entries.length>10?[2,Me.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(I.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==r.SUCCESS?(i.warn(I.O,"set chatroom entry fail ->code+:".concat(Ue[s],",").concat(n)),[2,{code:s,msg:Ue[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ut(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&St(t)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(I.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"force set chatroom entry fail ->code+:".concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&Ot(t)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(I.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"remove chatroom entry fail ->code+:".concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!R("key",e,f.STRING,!0)}))||!R("options.notificationExtra",e.notificationExtra,f.STRING))}(t)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.info(I.O,"remove chatroom entry->".concat(n)),(a=U({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==r.SUCCESS?(i.warn(I.O,"remove chatroom entry fail ->code+:".concat(Ue[c],",").concat(n)),[2,{code:c,msg:Ue[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&Ot(t)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.info(I.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"force remove chatroom entry fail ->code+:".concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("key",t,(function(e){return S(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(I.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(i.warn(I.O,"get chatroom entry fail ->code+:".concat(Ue[s],",").concat(n)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("targetId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(I.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return i=c.sent(),a=i.code,s=i.data,a===r.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(I.O,"get all chatroom entries fail ->code+:".concat(Ue[a],",").concat(t)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("options.timestamp",t.timestamp,f.NUMBER)&&R("options.count",t.count,f.NUMBER)&&R("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.debug(I.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ie(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(i.warn(I.O,"get chatroom history message fail ->code+:".concat(Ue[s],",").concat(n)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("option.chatRoomId",e.chatRoomId,f.STRING,!0)&&R("option.rtcRoomId",e.rtcRoomId,f.STRING,!0)?[2,Ie((function(n){return P(t,void 0,void 0,(function(){var t;return L(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:Ue[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("userId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("userId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,i;return L(this,(function(a){switch(a.label){case 0:return n.info(I.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS&&i?[2,{code:o,data:i}]:(n.warn(I.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Ht(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("userId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:0===a}]:(o.warn(I.O,"getBlacklistStatus fail -> code: ".concat(i,", userId: ").concat(e)),[2,{code:i}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Ft=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function qt(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Ft(e,o,t,n)}}var Zt,Jt,zt=qt("RC:ImgMsg"),Kt=qt("RC:HQVCMsg"),Yt=qt("RC:SightMsg"),Wt=qt("RC:TxtMsg"),Xt=qt("RC:CombineMsg"),jt=qt("RC:FileMsg"),Qt=qt("RC:GIFMsg"),$t=qt("RC:VcMsg"),en=qt("RC:LBSMsg"),tn=qt("RC:ReferenceMsg"),nn=qt("RC:ImgTextMsg"),on={qiniu:function(e,t,n,o){ve((function(r){var i=r.getInfoFromCache();if(1===(null==i?void 0:i.type)&&t.chunk_size&&o.size>t.chunk_size){var a=O();a+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=a,fn(o,t,n)}else dn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>an)throw new Error("the file size is over 5GB!");var r=t||{};t=t||Jt;var i=new XMLHttpRequest,a=sn();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var s=a+rn[0][1]+r.bosUploadPath;rn.shift();var c=r.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});i.onreadystatechange=function(){if(4===i.readyState)if(JSON.parse(i.responseText||"{}").filename=t.uniqueValue,200===i.status){n.onCompleted(u,!0)}else rn.length?on[rn[0][0]](e,t,n,o):n.onError("upload fail")},i.open(t.method,s,!0),i.setRequestHeader("authorization",c.bosToken),i.setRequestHeader("x-bce-date",c.bosDate),i.send(o)},aliyun:function(e,t,n,o){if(o.size>an)throw new Error("the file size is over 5GB!");var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token"));var i=rn[0][1];rn.shift(),e=e||Zt,t=(t=t||{})||Jt;var a=new XMLHttpRequest,s=sn(),c="".concat(s+t.ossBucketName,".").concat(i);a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var e=JSON.parse(a.responseText||"{}");e.name=t.uniqueValue,e.filename=t.uploadFileName,e.uploadMethod=N?N.ALI:"",200===a.status?n.onCompleted(e):rn.length?on[rn[0][0]](r,t,n,o):n.onError("upload fail")}},a.open(t.method,c,!0),console.log("ali:url",c);var u=t.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",t.uploadFileName),e.delete("file"),e.append("file",o),a.send(e)},s3:function(e,t,n,o){var r=new FormData,i=new XMLHttpRequest,a=sn(),s=t.contentDisposition,c=rn[0][1],u="".concat(a+t.s3BucketName,".").concat(c);console.log("uploadS3:url",u),rn.shift(),i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var r=JSON.parse(i.responseText||"{}");if(r.name=t.uniqueValue,r.filename=t.uploadFileName,r.uploadMethod=N.AWS,200===i.status||204===i.status)n.onCompleted(r);else if(rn.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),on[rn[0][0]](a,t,n,o)}else n.onError("upload fail")}},i.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;s?r.set("Content-Disposition","".concat(s,";")):r.set("Content-Disposition","text/html"===f?"inline;":"attachment;");r.set("Content-Type",f),r.set("x-amz-credential",d.s3Credential),r.set("x-amz-algorithm",d.s3Algorithm),r.set("x-amz-date",d.s3Date),r.set("policy",d.s3Policy),r.set("x-amz-signature",d.s3Signature),r.set("key",t.uploadFileName),r.set("file",o),i.send(r)},stc:function(e,t,n,o){var r=new XMLHttpRequest,i=t.contentDisposition,a=rn[0][1],s="https://".concat(a,"/").concat(t.stcBucketName,"/").concat(t.uploadFileName);rn.shift(),r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var i=JSON.parse(r.responseText||"{}");if(i.name=t.uniqueValue,i.filename=t.uploadFileName,i.uploadMethod=N?N.STC:"",200===r.status||204===r.status)n.onCompleted(i);else if(rn.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),on[rn[0][0]](a,t,n,o)}else n.onError("upload fail")}},r.open("PUT",s,!0);var c=t?t.stcHeader:{};r.setRequestHeader("Content-Type",o.type),i?r.setRequestHeader("Content-Disposition","".concat(i,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");r.setRequestHeader("Authorization",c.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",c.stcContentSha256),r.setRequestHeader("x-amz-date",c.stcDate),r.send(o)}},rn=[],an=5368709120;function sn(){var e="https://";return"http:"!==location.protocol&&"file:"!==location.protocol||(e="http://"),e}var cn,un=(cn="RC-upload-",{get:function(e){e=cn+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=cn+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=cn+e,localStorage.removeItem(e)}});function dn(e,t,n,o){var r="https://"+t.uploadHost.qiniu,i=(/http/.test(rn[0][1])?"":sn())+rn[0][1]||r;t.isChunk||rn.shift();var a=new XMLHttpRequest;a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),a.onreadystatechange=function(){if(4===a.readyState){var r=JSON.parse(a.responseText||"{}");r.filename=t.uniqueValue,r.uploadMethod=N?N.QINIU:"",200===a.status||204===a.status?n.onCompleted(r):rn.length?on[rn[0][0]](e,t,n,o):n.onError("upload fail")}},a.open(t.method,i,!0),n.onOpen(a),t.stream&&a.setRequestHeader("authorization","UpToken ".concat(t.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(t.headers,(function(e,t){a.setRequestHeader(e,t)})),a.send(e)}function fn(e,t,n,o){var r=0,i=o||O(),a=un.get(i);a&&(e.uniqueName=a.sessionId,r=a.offset);var s=Math.min(t.chunk_size,e.size-r),c=e.slice(r,r+s),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(r,"-").concat(r+s);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,c.name=e.name,c=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var i=t.multi_parmas[r];o.append(r,i)}return o}(c,t,e.uniqueName),dn(c,t,{onCompleted:function(o){r+=s;var a=e.uniqueName;un.set(i,{offset:r,sessionId:a}),r<e.size?fn(e,t,n,i):(r=0,un.remove(i),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var i=e+r;n.onProgress(i,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function ln(e,t,n,o){var r,i,a=t&&t.type||"text/plain",s=a.indexOf("image")>-1?1:4,c=n.contentDisposition,u=Math.ceil(t.size/n.stc_chunk_size),d=n&&JSON.parse(n.ossConfig?n.ossConfig:"");Array.isArray(d)||(d=[]);var f=d.find((function(e){return Object.keys(e).includes("stc")})),l="uploads";e.getFileToken(s,r,"POST",l).then((function(e){r=e.fileName,i="https://".concat(f.stc,"/").concat(n.stcBucketName,"/").concat(r),console.log("uploadStcMultipart:url",i);var s=new XMLHttpRequest;s.open("POST","".concat(i,"?").concat(l),!0),c?s.setRequestHeader("Content-Disposition","".concat(c,";")):s.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),s.setRequestHeader("Authorization",e&&e.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),s.setRequestHeader("x-amz-date",e&&e.stcDate),s.setRequestHeader("Content-Type",a),s.send(),s.onreadystatechange=function(){if(4===s.readyState){var e=s.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===s.status||204===s.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(h(e,n));I(e,t)}(Array.isArray(e)&&e[1]):o.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));var g=[],v=new Map;function I(c,d){d&&Array.isArray(d)&&0!==d.length&&Promise.all(d).then((function(){var d="uploadId=".concat(c);if(v.size===u)e.getFileToken(s,r,"POST",d).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",c);var r=new XMLHttpRequest;r.open("POST","".concat(i,"?").concat(d),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",a);var s="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(v.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",u),u.forEach((function(e){s+="<Part><ETag>".concat(v.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),s+="</CompleteMultipartUpload>",r.send(s),console.log("xml",s),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e={name:t.name,filename:n.uploadFileName,uploadMethod:N.STC};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var f=[],l=0,R=g;l<R.length;l++){var m=R[l];f.push(h(c,m))}I(c,f)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,r=g;n<r.length;n++){var i=r[n];t.push(h(c,i))}I(c,t)}))}function h(o,c){return new Promise((function(u,d){var f="partNumber=".concat(c,"&uploadId=").concat(o);e.getFileToken(s,r,"PUT",f).then((function(e){console.log("signature ".concat(c," onSuccess"),e);var o=t&&t.slice((c-1)*n.stc_chunk_size,c*n.stc_chunk_size);console.log("fileChunk:size",o.size);var r=new XMLHttpRequest;r.open("PUT","".concat(i,"?").concat(f),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",a),r.send(o),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e=r.getResponseHeader("etag");console.log("etag:".concat(c),e),v.set(c,e),u(e)}else g.includes(c)||g.push(c),d(c)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(c)||g.push(c),d(c)}))}))}}var gn={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=vn()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),In(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=vn()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,In(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function vn(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function In(e,t){for(var n in e)t(n,e[n])}var hn,Rn=0,mn=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:gn.form,genUId:vn};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;In(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){Zt=n,Jt=o,rn=[];var i,a=e.getInfoFromCache();if(1===(null==a?void 0:a.type)&&t.uploadDomain)rn=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var s,c,u=JSON.parse(o.ossConfig),d="",f=[];u.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(d=e[n]),"s3"===n&&(s=e[n]),"stc"===n&&(c=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&rn.push(e)})),u.length!==rn.length&&(rn=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",d],["s3",s],["stc",c]])}else rn=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var l=o&&JSON.parse(o.ossConfig);Array.isArray(l)||(l=[]),i=l.find((function(e){return Object.keys(e).includes("stc")}))}if(i&&1===parseInt(i.p,10)&&n.size>=4194304)ln(e,n,o,r);else{var g=o.data(n,o);on[rn[0][0]](g,o,r,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(hn=e,n)?hn=Rn+e/t*(t-Rn):Rn=hn;o.onProgress(hn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var En,pn,Tn={init:function(e){return new mn(e)},dataType:gn,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,i=new Image;i.src=r;var a=i.width,s=i.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var i=e.height,a=t.maxHeight||0;if(a>0&&i>a){var s=a/i;n=Math.min(n,s)}var c=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;n=Math.min(n,d)}return n}({width:a,height:s,size:e.total},t),u=r;c<1&&(u=function(e,t,n){return o.width=t,o.height=n,o.getContext("2d").drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(i,a*c,s*c)),n(u)}},Upload:mn},Sn=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),i=new Image,a="string"==typeof e;i.onload=function(a){var s=function(e,t,n){var o,r,i,a=e<t,s=0,c=0;return(a?t/e:e/t)>n.scale?(a?(r=100,c=((i=t/(o=e/100))-n.maxHeight)/2):(i=100,s=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:i,x:-s,y:-c}):(a?(o=t/n.maxHeight,i=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,i=t/o),{w:r,h:i,x:-s,y:-c})}(i.width,i.height,t);o.width=s.w>t.maxWidth?t.maxWidth:s.w,o.height=s.h>t.maxHeight?t.maxHeight:s.h,r.drawImage(i,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},i.src=a?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},On=function(e,t){var n=e.file,o=e.compress;Sn(n,o,t)},Nn=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=Tn.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Tn.init(e);t(n)}},Cn=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||On;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},_n=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){Cn(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),An=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};Cn(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),yn=function(e,t){Nn(e,(function(e){var n=new _n(e);t(n)}))},Mn=function(e,t){Nn(e,(function(n){var o,r,i,a,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new An(n,s);t(c)}))};Tn.dataType;function Un(e,t,n,o,r,i,a){var s,c=this;void 0===r&&(r=_.FILE),s=r===_.IMAGE?_.IMAGE:_.FILE;var u=e.getInfoFromCache();if(!pn&&(pn="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(pn=d.qiniu)}catch(e){}var f=U({domain:pn,getToken:function(t){e.getFileToken(s).then((function(e){t(e.token,e)})).catch((function(e){i.onFail(e)}))}},a);(s===_.IMAGE?Mn:yn)(f,(function(t){t.upload(e,n,o,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=i.onProgress)||void 0===n||n.call(i,o)},onCompleted:function(e){return P(c,void 0,void 0,(function(){return L(this,(function(t){return 1===(null==u?void 0:u.type)?function(e,t,n,o,r,i){var a={type:o.type,name:r.rc_url.file_name,downloadUrl:e.uploadDomain+r.rc_url.path};if(t===_.AUDIO)return void Pn(o).then((function(e){i.onSuccess(U(U({},a),e))}));t===_.IMAGE&&(a.thumbnail=r.thumbnail);i.onSuccess(a)}(n,r,0,o,e,i):function(e,t,n,o,r){bn(t,o.filename,o.name,o,o.uploadMethod).then((function(i){if(0===i.code){var a=i.data;a.type=n.type,a.name=o.name||o.filename,e!==_.AUDIO?(t===_.IMAGE&&(a.thumbnail=o.thumbnail),r.onSuccess(a)):Pn(n).then((function(e){r.onSuccess(U(U({},a),e))}))}else r.onFail(i)})).catch((function(e){r.onFail(e)}))}(r,s,o,e,i),[2]}))}))},onError:function(e){i.onFail(e)}})}))}function Pn(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?Ln(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(Ln).then((function(e){t(e)}))}))}function Ln(e){return En=En||new AudioContext,new Promise((function(t,n){En.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function wn(e,t,n,o){return Ie((function(i){return new Promise((function(a){i.getFileToken(e,t,n,o).then((function(e){a({code:r.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:Ue[e]})}))}))}))}function bn(e,t,n,o,i){return R("fileType",e,C,!0)&&R("filename",t,f.STRING)&&R("saveName",n,f.STRING)&&R("serverType",i,f.NUMBER)?Ie((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,i).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER})}function Bn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(s){return[2,Ie((function(s,c){return P(o,void 0,void 0,(function(){var o,u,d,l,g,v,h,m,E,p,T,S,O;return L(this,(function(N){switch(N.label){case 0:return n=n||{},t instanceof Ft==!1?(c.warn(I.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,Me.ILLGAL_PARAMS]):R("conversation",e,f.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,R("conversation.targetId",u,f.STRING,!0)&&R("conversation.conversationType",o,f.NUMBER,!0)&&R("conversation.channelId",d,f.CHANNEL_ID)&&R("options.isStatusMessage",null==n?void 0:n.isStatusMessage,f.BOOLEAN)&&R("options.disableNotification",null==n?void 0:n.disableNotification,f.BOOLEAN)&&R("options.pushContent",null==n?void 0:n.pushContent,f.STRING)&&R("options.pushData",null==n?void 0:n.pushData,f.STRING)&&R("options.isMentioned",null==n?void 0:n.isMentioned,f.BOOLEAN)&&R("options.mentionedType",null==n?void 0:n.mentionedType,f.NUMBER)&&R("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,f.ARRAY)&&R("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,f.ARRAY)&&R("options.isVoipPush",null==n?void 0:n.isVoipPush,f.BOOLEAN)&&R("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,f.BOOLEAN)&&R("options.expansion",null==n?void 0:n.expansion,f.OBJECT)&&R("options.pushConfig",null==n?void 0:n.pushConfig,f.OBJECT)&&R("options.messageId",null==n?void 0:n.messageId,f.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(I.O,"send message ->".concat(l)),g=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,i=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return U({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:R||"",messageId:h},t)}(n,t,e),v={isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:t.isPersited||!1,isCounted:t.isCounted||!1,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:s.getCurrentUserId(),messageUId:"",messageDirection:y.SEND,receivedTime:0,isStatusMessage:n.isStatusMessage||!1,receivedStatus:i.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig},o!==a.ULTRA_GROUP&&(v.isOffLineMessage=!1),h=c.createTraceId(),m=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(ie(v))}catch(e){c.error(I.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),h)}},c.info(I.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),h),[4,s.sendMessage(o,u,g,m,h)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=N.sent(),p=E.code,T=E.data,S=p===r.SUCCESS?"info":"warn",c[S](I.A_SEND_MSG_R,JSON.stringify({code:p,messageUId:T?T.messageUId:"",messageId:T?T.messageId:""}),h),p===r.SUCCESS?(O=ie(T),[2,{code:p,data:O}]):(c.warn(I.O,"send message fail ->".concat(p,":").concat(Ue[p],",").concat(l)),v.sentTime=(null==T?void 0:T.sentTime)||0,[2,{code:p,msg:Ue[p],data:ie(v)}])}}))}))}))]}))}))}function Dn(e,t,n){return Bn(e,new Wt(t),n)}function Gn(e,t){return function(n,o,i,a){if(!R("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(R("sendOptions.maxHeight",null==c?void 0:c.maxHeight,f.NUMBER)&&R("sendOptions.maxWidth",null==c?void 0:c.maxWidth,f.NUMBER)&&R("sendOptions.quality",null==c?void 0:c.quality,f.NUMBER)&&R("sendOptions.scale",null==c?void 0:c.scale,f.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return Ie((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(I.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Un(c,0,d,o.file,e,{onProgress:null==i?void 0:i.onProgress,onSuccess:function(e){var s,c=(null===(s=null==i?void 0:i.onComplete)||void 0===s?void 0:s.call(i,{url:e.downloadUrl}))||t(e,o);e&&e.downloadUrl&&u.info(I.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:r.SUCCESS}),l),Bn(n,c,a).then(f)},onFail:function(e){u.warn(I.L_MEDIA_UPLOAD_R,JSON.stringify({code:r.UPLOAD_FILE_FAILED}),l),f({code:r.UPLOAD_FILE_FAILED,msg:e||r[r.UPLOAD_FILE_FAILED]})}},s)}))}))}}var xn=Gn(_.FILE,(function(e,t){return new jt({name:e.name,size:t.file.size,type:t.file.type,fileUrl:e.downloadUrl,user:t.user,extra:t.extra})})),Vn=Gn(_.IMAGE,(function(e,t){return new zt({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),kn=Gn(_.AUDIO,(function(e,t){return new Kt({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),Hn=Gn(_.SIGHT,(function(e,t){return new Yt({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));function Fn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&R("options.count",null==t?void 0:t.count,f.NUMBER)&&R("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&R("conversation",e,f.CONVERSATION,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n=i.createTraceId(),i.info(I.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ie(e)})),i.info(I.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(I.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&R("options.count",null==t?void 0:t.count,f.NUMBER)&&R("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&R("conversation",e,f.CONVERSATION,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ie(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(I.O,"get history message fail ->".concat(s,":").concat(Ue[s],",").concat(n)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zn(e,t,n,o){return P(this,void 0,void 0,(function(){var i=this;return L(this,(function(s){return R("targetId",e,f.STRING,!0)&&R("messageUId",t,f.STRING,!0)&&R("timestamp",n,f.NUMBER,!0)&&R("channelId",o,f.STRING)?[2,Ie((function(r){return P(i,void 0,void 0,(function(){var r,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:a.PRIVATE,channelId:o},i=new Ft("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,Bn(r,i)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return R("messageUId",t,f.STRING,!0)&&R("targetId",e,f.STRING,!0)&&R("channelId",n,f.CHANNEL_ID)?[2,Ie((function(r,i){return P(o,void 0,void 0,(function(){var o,r,s,c,u;return L(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(I.O,"send read receipt message ->".concat(o)),r=new Ft("RC:RRReqMsg",{messageUId:t}),[4,Bn({targetId:e,conversationType:a.GROUP,channelId:n},r)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zn(e,t,n){return P(this,void 0,void 0,(function(){return L(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Kn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return R("targetId",e,f.STRING,!0)&&R("messageList",t,f.OBJECT,!0)&&R("channelId",n,f.CHANNEL_ID)&&!Object.keys(t).every((function(e){return!R(e,t[e],f.ARRAY)}))?[2,Ie((function(i,s){return P(o,void 0,void 0,(function(){var o,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return o={targetId:e,conversationType:a.GROUP,channelId:n},u=i.getInfoFromCache(),0!==(d=(null==u?void 0:u.grpRRVer)||0)?[3,2]:(f=new Ft("RC:RRRspMsg",{receiptMessageDic:t}),[4,Bn(o,f)]);case 1:return c=v.sent(),[3,4];case 2:return 1!==d?[3,4]:(l=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===l.indexOf(e)&&l.push(e)}))})),l.length?[4,i.sendReadReceiptMessage(e,l,n)]:(s.warn(I.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 3:c=v.sent(),v.label=4;case 4:return(g=c.code)===r.SUCCESS?[2,{code:g}]:(s.warn(I.O,"send read receipt message fail ->".concat(g,":").concat(Ue[g])),[2,{code:g,msg:Ue[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yn(e,t){return P(this,void 0,void 0,(function(){var n,o,i,a;return L(this,(function(s){switch(s.label){case 0:return R("conversation",e,f.CONVERSATION,!0)&&R("lastMessageSendTime",t,f.NUMBER,!0)?(n=new Ft("RC:SRSMsg",{lastMessageSendTime:t}),[4,Bn(e,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),i=o.code,a=o.msg,0===i?[2,{code:i}]:[2,{code:i,msg:a}]}}))}))}function Wn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("conversation",e,f.CONVERSATION,!0)&&R("options.messageUId",t.messageUId,f.STRING,!0)&&R("options.sentTime",t.sentTime,f.NUMBER,!0)&&R("options.disableNotification",null==t?void 0:t.disableNotification,f.BOOLEAN)&&R("options.pushConfig",null==t?void 0:t.pushConfig,f.OBJECT)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),i.debug(I.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS&&u?[2,{code:c,data:ie(u)}]:c===r.SUCCESS?[2,{code:c}]:(i.warn(I.O,"recall message fail ->".concat(c,":").concat(Ue[c],",").concat(a)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("conversation",e,f.CONVERSATION,!0)&&R("options",t,(function(e){return l(e)&&e.length}),!0)&&!t.every((function(e){return!R("options.messageUId",e.messageUId,f.STRING,!0)||!R("options.sentTime",e.sentTime,f.NUMBER,!0)||!R("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"delete message fail ->".concat(a,":").concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("conversation",e,f.CONVERSATION,!0)&&R("timestamp",t,f.NUMBER,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"clear message ->".concat(a,":").concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("expansion",e,f.OBJECT,!0)&&R("message",t,f.OBJECT,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),i.debug(I.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==r.SUCCESS?(i.warn(I.O,"update message expansion fail ->".concat(l,":").concat(Ue[l],",").concat(f)),[2,{code:l,msg:Ue[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $n(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("keys",e,f.ARRAY,!0)&&R("message",t,f.OBJECT,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),i.debug(I.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==r.SUCCESS?(i.warn(I.O,"remove message expansion fail ->".concat(f,":").concat(Ue[f],",").concat(d)),[2,{code:f,msg:Ue[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function eo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("conversation",e,f.CONVERSATION,!0)&&R("typingContentType",t,f.STRING,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d;return L(this,(function(f){switch(f.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=i.createTraceId(),i.info(I.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=f.sent(),c=s.code,u=s.data,d=c===r.SUCCESS?"info":"warn",i[d](I.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:ie(u)}]:[2,{code:c,msg:Ue[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return R("messageUId",t,f.STRING,!0)&&R("targetId",e,f.STRING,!0)&&R("channelId",n,f.STRING)?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o,s,c,u;return L(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(I.O,"get message reader ->".concat(o)),[4,i.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS?[2,{code:c,data:u}]:(a.warn(I.O,"get message reader fail ->".concat(c,":").concat(Ue[c],",").concat(o)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function no(e,t,n,o,r){return ve((function(i,a){return d("messageType",e,f.STRING,!0),d("isPersited",t,f.BOOLEAN,!0),d("isCounted",n,f.BOOLEAN,!0),d("isStatusMessage",r,f.BOOLEAN,!1),d("searchProps",o,f.ARRAY),a.info(I.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),qt(e,t,n)}))}function oo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?R("conversation",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(I.O,"insertMessage ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function ro(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return se("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),A()?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,h,R,m,E,p,T,S;return L(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,f=t.canIncludeExpansion,l=t.expansion,g=t.disableNotification,v=t.sentTime,h=t.sentStatus,a.info(I.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),R=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:h,searchContent:m,isUnread:R,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,E)];case 1:return p=O.sent(),T=p.code,S=p.data,T===r.SUCCESS?[2,{code:T,data:ie(S)}]:(a.warn(I.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:Ue[T]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function io(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:ie(a)}]:(o.warn(I.O,"getMessage ->code:".concat(i,",messageId:").concat(e)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function ao(e){if(!A())return{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,i=e.channelId;return R("conversation",e,f.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,i),a=[];return t&&t.length&&t.forEach((function(e){return a.push(ie(e))})),{code:r.SUCCESS,data:a}},de?t(de,le,fe):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function so(e,t,n,o){return P(this,void 0,void 0,(function(){var i=this;return L(this,(function(a){return se("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),A()?R("conversation",e,f.CONVERSATION,!0)&&R("keyword",t,f.STRING,!0)&&R("timestamp",n,f.NUMBER)&&R("count",o,f.NUMBER)?[2,Ie((function(a,s){return P(i,void 0,void 0,(function(){var i,c,u,d;return L(this,(function(f){switch(f.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return i=f.sent(),c=i.code,u=i.data,c===r.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(ie(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(I.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function co(e,t,n){return P(this,void 0,void 0,(function(){var o,i,a,s=this;return L(this,(function(c){return se("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),A()?(o=e.conversationType,i=e.targetId,a=e.channelId,R("conversationType",o,f.NUMBER,!0)&&R("targetId",i,f.STRING,!0)&&R("timestamp",t,f.NUMBER,!0)&&R("cleanSpace",n,f.BOOLEAN)?[2,Ie((function(c,u){return P(s,void 0,void 0,(function(){var s;return L(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,i,t,n,a)];case 1:return s=d.sent(),u.debug(I.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:i,channelId:a,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(I.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function uo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return se("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),A()?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return t=e.conversationType,i=e.targetId,a=e.channelId,o.info(I.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(t)),[4,n.clearMessages(t,i,a)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(I.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function fo(e,t,n,o){return P(this,void 0,void 0,(function(){var i=this;return L(this,(function(a){return se("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),A()?[2,Ie((function(a,s){return P(i,void 0,void 0,(function(){var i,c,u;return L(this,(function(d){switch(d.label){case 0:return s.info(I.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return i=d.sent(),c=i.code,u=i.data,c===r.SUCCESS?[2,{code:c,data:u}]:(s.warn(I.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function lo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("timestamp",t,f.NUMBER)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c;return L(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,i.info(I.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===r.SUCCESS?[2,{code:c}]:(i.warn(I.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function go(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return se("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),A()?R("messageId",e,f.NUMBER,!0)&&R("receivedStatus",t,f.NUMBER,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n;return L(this,(function(a){switch(a.label){case 0:return i.info(I.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function vo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("tag.tagId",e.tagId,f.STRING,!0)&&R("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&R("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&R("tag.tagName",e.tagName,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(i){switch(i.label){case 0:return o.info(I.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("tagId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(i){switch(i.label){case 0:return o.info(I.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("tag.tagId",e.tagId,f.STRING,!0)&&R("tag.tagName",e.tagName,f.STRING,!0)&&R("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(i){switch(i.label){case 0:return o.info(I.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,i;return L(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(n.warn(I.O,"getTagList ->code:".concat(o)),[2,{code:o,msg:Ue[o]}])}}))}))}))]}))}))}function mo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("conversation",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:[2,{code:i,msg:Ue[i]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("tagId",e,f.STRING,!0)&&R("conversations",t,f.ARRAY,!0)&&!t.every((function(e){return!R("conversation",e,f.CONVERSATION,!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n;return L(this,(function(a){switch(a.label){case 0:return i.info(I.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("tagId",e,f.STRING,!0)&&R("conversations",t,f.ARRAY,!0)&&!t.every((function(e){return!R("conversation",e,f.CONVERSATION,!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n;return L(this,(function(a){switch(a.label){case 0:return i.info(I.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("conversation",e,f.CONVERSATION,!0)&&R("tagIds",t,f.ARRAY,!0)&&!t.every((function(e){return!R("tagId",e,f.STRING,!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n;return L(this,(function(a){switch(a.label){case 0:return i.info(I.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("tagId",e,f.STRING,!0)&&R("conversations",t,f.ARRAY,!0)&&!t.every((function(e){return!R("conversation",e,f.CONVERSATION,!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n;return L(this,(function(a){switch(a.label){case 0:return i.info(I.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return R("tagId",e,f.STRING,!0)&&R("count",t,f.NUMBER,!0)&&R("startTime",n,f.NUMBER,!0)?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o,s,c;return L(this,(function(u){switch(u.label){case 0:return a.info(I.O,"getConversationListByTag ->tagId:".concat(e)),[4,i.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===r.SUCCESS?[2,{code:s,data:c}]:(a.warn(I.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("tagId",e,f.STRING,!0)&&R("containMuted",t,f.BOOLEAN,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return i.info(I.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getUnreadCountByTag ->code:".concat(a,",tagId:").concat(e)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return R("tagId",e,f.STRING,!0)&&R("conversation",t,f.CONVERSATION,!0)&&R("status.isTop",n,f.BOOLEAN,!0)?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o;return L(this,(function(s){switch(s.label){case 0:return a.info(I.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,i.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===r.SUCCESS?[2,{code:o}]:(a.warn(I.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Ue[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}Gn(_.COMBINE_HTML,(function(e,t){return new Xt({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var _o={COMET:"comet",WEBSOCKET:"websocket"},Ao={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var yo=Object.freeze({__proto__:null,getAllConversationList:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?R("channelId",e,f.ONLY_STRING)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return o.info(I.O,"getAllConversationList -> channelId: ".concat(e)),M(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=c.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=c.sent(),c.label=4;case 4:return i=t.code,a=t.data,i===r.SUCCESS&&a?(s=a.map((function(e){return ae(e)})),[2,{code:i,data:s}]):(o.warn(I.O,"getAllConversationList fail -> code: ".concat(i," channelId: ").concat(e)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return A()?R("startTime",e,f.NUMBER,!0)&&R("count",t,f.NUMBER,!0)&&R("channelId",n,f.ONLY_STRING)?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(I.O,"getConversationList -> ".concat(o)),M(n)?[4,i.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(c,e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===r.SUCCESS&&d?(f=d.map((function(e){return ae(e)})),[2,{code:u,data:f}]):(a.warn(I.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:Ue[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return P(this,void 0,void 0,(function(){var i=this;return L(this,(function(a){return A()?R("keyword",t,f.STRING,!0)&&R("messageTypes",n,f.ARRAY,!0)&&R("channelId",o,f.ONLY_STRING)&&!n.every((function(e){return!R("messageType",e,f.STRING,!0)}))?[2,Ie((function(a,s){return P(i,void 0,void 0,(function(){var i,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return i="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),s.info(I.O,"searchConversationByContent -> ".concat(e)),M(o)?[4,a.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,a.searchConversationByContent(t,n,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===r.SUCCESS&&d?(f=d.map((function(e){return ae(e)})),[2,{code:u,data:f}]):(s.warn(I.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(i)),[2,{code:u,msg:Ue[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return P(this,void 0,void 0,(function(){var i=this;return L(this,(function(a){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("keyword",t,f.STRING,!0)&&R("startTime",n,f.NUMBER,!0)&&R("count",o,f.NUMBER,!0)?[2,Ie((function(a,s){return P(i,void 0,void 0,(function(){var i,c,u,d,f,l,g,v,h,R;return L(this,(function(m){switch(m.label){case 0:return i="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(I.O,"searchMessages -> ".concat(i)),c=e.targetId,u=e.conversationType,d=e.channelId,M(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:f=m.sent(),m.label=4;case 4:return l=f.code,g=f.data,l===r.SUCCESS&&g?(v=g.messages,h=g.count,R=v.map((function(e){return ie(e)})),[2,{code:l,data:{messages:R,count:h}}]):(s.warn(I.O,"searchMessages fail -> code: ".concat(l," ").concat(i)),[2,{code:l,msg:Ue[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("option",t,f.OBJECT,!0)&&R("option.keyword",t.keyword,f.STRING,!0)&&R("option.startTime",t.startTime,f.NUMBER,!0)&&R("option.endTime",t.endTime,f.NUMBER,!0)&&R("option.offset",t.offset,f.NUMBER)&&R("option.limit",t.limit,f.NUMBER)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v,h;return L(this,(function(R){switch(R.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(I.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,f=t.offset,l=t.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,f,l)];case 1:return g=R.sent(),v=g.code,h=g.data,v===r.SUCCESS&&h?[2,{code:v,data:{messages:h.messages.map((function(e){return ie(e)}))}}]:(i.warn(I.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("option",t,f.OBJECT,!0)&&R("option.count",t.count,f.NUMBER)&&R("option.timestamp",t.timestamp,f.NUMBER)&&R("option.order",t.order,(function(e){return[0,1].includes(e)}))&&R("option.messageTypes",t.messageTypes,f.ARRAY,!0)&&!t.messageTypes.every((function(e){return!R("option.messageType",e,f.STRING,!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v,h,R,m,E,p;return L(this,(function(T){switch(T.label){case 0:return n=t.count,a=t.timestamp,s=t.order,c=t.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(I.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,n||(n=20),a||(a=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,a,n,c,s,l)];case 1:return g=T.sent(),v=g.code,h=g.data,v===r.SUCCESS?(m=(R=h).list,E=R.hasMore,p=m.map((function(e){return ie(e)})),[2,{code:v,data:{messages:p,hasMore:E}}]):(i.warn(I.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:Ue[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("timestamp",t,f.NUMBER,!0)?[2,Ie((function(o,r){return P(n,void 0,void 0,(function(){var n,i,a,s;return L(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(I.O,"updateSentMsgReceiptStatus -> ".concat(n)),i=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(i,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("messageId",e,f.NUMBER,!0)&&R("receivedStatus",t,(function(e){return!M(i[e])}),!0)?[2,Ie((function(o,r){return P(n,void 0,void 0,(function(){return L(this,(function(n){switch(n.label){case 0:return r.info(I.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("messageId",e,f.NUMBER,!0)&&R("sentStatus",t,(function(e){return!M(D[e])}),!0)?[2,Ie((function(o,r){return P(n,void 0,void 0,(function(){return L(this,(function(n){switch(n.label){case 0:return r.info(I.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return A()?R("messageId",e,f.NUMBER,!0)&&R("content",t,f.OBJECT,!0)&&R("messageType",n,f.ONLY_STRING,!0)?[2,Ie((function(r,i){return P(o,void 0,void 0,(function(){return L(this,(function(o){switch(o.label){case 0:return i.info(I.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?!R("messageIds",e,f.ARRAY,!0)||e.every((function(e){return!R("messageId",e,f.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return t=e.conversationType,i=e.targetId,a=e.channelId,o.info(I.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(t)),[4,n.clearMessages(t,i,a)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(I.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return P(this,void 0,void 0,(function(){var o,i,a,s=this;return L(this,(function(c){return A()?(o=e.conversationType,i=e.targetId,a=e.channelId,R("conversationType",o,f.NUMBER,!0)&&R("targetId",i,f.STRING,!0)&&R("timestamp",t,f.NUMBER,!0)&&R("cleanSpace",n,f.BOOLEAN)?[2,Ie((function(e,c){return P(s,void 0,void 0,(function(){var s;return L(this,(function(u){switch(u.label){case 0:return[4,e.deleteMessagesByTimestamp(o,i,t,n,a)];case 1:return(s=u.sent())===r.SUCCESS?[2,{code:s}]:(c.warn(I.O,"deleteMessagesByTimestamp ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("message",t,f.OBJECT,!0)&&R("options",n,f.OBJECT)&&R("message.senderUserId",t.senderUserId,f.STRING,!0)&&R("message.messageType",t.messageType,f.STRING,!0)&&R("message.content",t.content,f.OBJECT,!0)&&R("message.messageDirection",t.messageDirection,f.NUMBER,!0)&&R("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN,!0)&&R("message.expansion",t.expansion,f.OBJECT)&&R("message.disableNotification",t.disableNotification,f.BOOLEAN)&&R("message.sentTime",t.sentTime,f.NUMBER,!0)&&R("message.sentStatus",t.sentStatus,f.NUMBER,!0)&&R("options.sentStatus",null==n?void 0:n.isUnread,f.BOOLEAN)&&R("options.searchContent",null==n?void 0:n.searchContent,f.STRING)?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,h,R,m,E,p,T;return L(this,(function(S){switch(S.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,t.messageUId,d=t.canIncludeExpansion,f=t.expansion,l=t.disableNotification,g=t.sentTime,v=t.sentStatus,a.info(I.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,R=n.searchContent,m={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:g,sentStatus:v,searchContent:R,isUnread:h,messageUId:"",disableNotification:l,canIncludeExpansion:d,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=S.sent(),p=E.code,T=E.data,p===r.SUCCESS?[2,{code:p,data:ie(T)}]:(a.warn(I.O,"insertMessage ->code:".concat(p,",targetId:").concat(e.targetId)),[2,{code:p,msg:Ue[p]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return A()?[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,r;return L(this,(function(i){switch(i.label){case 0:return n.info(I.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}}),Mo=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};export{Ft as BaseMessage,Xt as CombineMessage,_o as ConnectType,B as Events,jt as FileMessage,Qt as GIFMessage,Kt as HQVoiceMessage,zt as ImageMessage,en as LocationMessage,Mo as MentionedInfoBody,Ao as MessageType,tn as ReferenceMessage,nn as RichContentMessage,D as SentStatus,Yt as SightMessage,Wt as TextMessage,$t as VoiceMessage,_e as __addSDKVersion,Eo as addConversationsToTag,he as addEventListener,vo as addTag,xt as addToBlacklist,Gt as bindRTCRoomForChatroom,ze as clearAllMessagesUnreadStatus,pe as clearEventListeners,jn as clearHistoryMessages,uo as clearMessages,Je as clearMessagesUnreadStatus,ke as clearTextMessageDraft,lo as clearUnreadCountByTimestamp,we as connect,co as deleteLocalMessagesByTimestamp,Xn as deleteMessages,Se as destroy,be as disconnect,yo as electronExtension,wt as forceRemoveChatRoomEntry,Ut as forceSetChatRoomEntry,Bt as getAllChatRoomEntries,it as getAllConversationState,mt as getAllUltraGroupUnreadCount,Et as getAllUltraGroupUnreadMentionedCount,rt as getAllUnreadMentionedCount,kt as getBlacklist,Ht as getBlacklistStatus,st as getBlockUltraGroupList,$e as getBlockedConversationList,bt as getChatRoomEntry,At as getChatRoomInfo,Dt as getChatroomHistoryMessages,Oe as getConnectionStatus,De as getConversation,Be as getConversationList,je as getConversationNotificationLevel,Qe as getConversationNotificationStatus,Oo as getConversationsFromTagByPage,Ce as getCurrentUserId,Ae as getDeviceId,wn as getFileToken,bn as getFileUrl,oo as getFirstUnreadMessage,Fn as getHistoryMessages,io as getMessage,to as getMessageReader,qn as getRemoteHistoryMessages,Ne as getServerTime,Ro as getTags,mo as getTagsFromConversation,xe as getTextMessageDraft,nt as getTopConversationList,He as getTotalUnreadCount,Fe as getTotalUnreadCountByLevels,qe as getTotalUnreadMentionedCountByLevels,It as getUltraGroupDefaultNotificationLevel,Tt as getUltraGroupFirstUnreadMessageTimestamp,at as getUltraGroupList,ut as getUltraGroupMessageListByMessageUId,Rt as getUltraGroupUnreadCountByTargetId,vt as getUltraGroupUnreadMentionedCountByTargetId,pt as getUltraGroupUnreadMentionedMessages,Ze as getUnreadCount,No as getUnreadCountByTag,ot as getUnreadMentionedCount,ao as getUnreadMentionedMessages,Te as init,ro as insertMessage,ye as installPlugin,Nt as joinChatRoom,Ct as joinExistChatRoom,gt as modifyMessage,Re as onceEventListener,_t as quitChatRoom,Wn as recallMessage,no as registerMessageType,lt as removeAllExpansionForUltraGroupMessage,Lt as removeChatRoomEntries,Pt as removeChatRoomEntry,Ge as removeConversation,po as removeConversationsFromTag,me as removeEventListener,Ee as removeEventListeners,ft as removeExpansionForUltraGroupMessage,Vt as removeFromBlacklist,$n as removeMessageExpansionForKey,Io as removeTag,So as removeTagFromConversations,To as removeTagsFromConversation,Ve as saveTextMessageDraft,fo as searchConversationByContent,so as searchMessages,xn as sendFileMessage,kn as sendHQVoiceMessage,Vn as sendImageMessage,Bn as sendMessage,Zn as sendReadReceiptMessage,Jn as sendReadReceiptRequest,zn as sendReadReceiptResponse,Kn as sendReadReceiptResponseV2,Hn as sendSightMessage,Yn as sendSyncReadStatusMessage,Dn as sendTextMessage,eo as sendTypingStatusMessage,ct as sendUltraGroupTypingStatus,Mt as setChatRoomEntries,yt as setChatRoomEntry,We as setConversationNotificationLevel,Xe as setConversationNotificationStatus,et as setConversationToTop,Co as setConversationToTopInTag,go as setMessageReceivedStatus,ht as setUltraGroupDefaultNotificationLevel,dt as updateExpansionForUltraGroupMessage,Qn as updateMessageExpansion,ho as updateTag};
1
+ import{NetworkType as e,HttpMethod as t,HTTP_TIMEOUT as n,appendUrl as o,ErrorCode as r,ReceivedStatus as i,ConversationType as a,isNumber as s,EventEmitter as c,VersionManage as u,assert as d,AssertRules as f,isArray as l,isHttpUrl as g,APIContext as v,LogTagId as I,logger as h,validate as R,isValidConversationType as m,isValidNotificationLevel as E,NotificationLevel as p,UltraGroupChannelType as T,isString as S,getUUID as O,UploadMethod as N,isValidFileType as C,FileType as _,usingCppEngine as A,MessageDirection as y,isUndefined as M}from"@rongcloud/engine";export{ChatroomEntryType,ChatroomUserChangeType,ConnectionStatus,ConversationType,ErrorCode,FileType,LogL,LogLevel,MentionedType,MessageBlockSourceType,MessageBlockType,MessageDirection,NotificationLevel,NotificationStatus,ReceivedStatus,UltraGroupChannelType,UploadMethod}from"@rongcloud/engine";var U=function(){return U=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},U.apply(this,arguments)};function P(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))}function L(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=a.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}var w=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,o=t.length;n<o;n++)if(!e[t[n]])return!1;return!0}(uni))},b=w();var B,D,G={tag:"browser",httpReq:function(e){var r=e.method||t.GET,i=e.timeout||n,a=e.headers,s=e.query,c=e.body,u=o(e.url,s);return new Promise((function(e){var t,n=(t="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&t?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),o="[object XDomainRequest]"===Object.prototype.toString.call(n);if(n.open(r,u),a&&n.setRequestHeader)for(var s in a)n.setRequestHeader(s,a[s]);if(o){n.timeout=i,n.onload=function(){e({data:n.responseText,status:n.status||200})},n.onerror=function(){e({status:n.status||0})},n.ontimeout=function(){e({status:n.status||0})};var d="object"==typeof c?JSON.stringify(c):c;n.send(d)}else n.onreadystatechange=function(){4===n.readyState&&e({data:n.responseText,status:n.status})},n.onerror=function(){e({status:n.status||0})},setTimeout((function(){n.abort(),e({status:n.status||0})}),i),n.send(c)}))},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:b,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{onClose:function(e){n.onclose=function(t){var n=t.code,o=t.reason;e(n,o)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var t=navigator.connection||navigator.mozConnection||navigator.webkitConnection,n=t.type,o=t.effectiveType,r=n||o||e.UNKONWN;return new Promise((function(e){e(r)}))}},x=w(),V=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},k={setItem:V("setStorageSync"),getItem:V("getStorageSync"),removeItem:V("removeStorageSync"),clear:V("clearStorageSync")},H={tag:"wechat",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){wx.request({url:d,method:i,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:k,sessionStorage:k,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){wx.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},F=w(),q=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var o=my[e]({key:t[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},Z={setItem:q("setStorageSync"),getItem:q("getStorageSync"),removeItem:q("removeStorageSync"),clear:q("clearStorageSync")},J={tag:"alipay",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:i,headers:s,timeout:a,data:u,dataType:f,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Z,sessionStorage:Z,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:F,createWebSocket:function(e){return my.connectSocket({url:e}),{onClose:function(e){my.onSocketClose(e)},onError:function(e){my.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(t){t.isBuffer?e(my.base64ToArrayBuffer(t.data)):e(t.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(t){my.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},z=w(),K=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){}}},Y={setItem:K("setStorageSync"),getItem:K("getStorageSync"),removeItem:K("removeStorageSync"),clear:K("clearStorageSync")},W={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:z,localStorage:Y,sessionStorage:Y,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){tt.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},X=w(),j=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){}}},Q={setItem:j("setStorageSync"),getItem:j("getStorageSync"),removeItem:j("removeStorageSync"),clear:j("clearStorageSync")},$={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:X,localStorage:Q,sessionStorage:Q,httpReq:function(e){return new Promise((function(t,n){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},o={data:JSON.stringify(n),status:e.statusCode};t(o)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return P(this,void 0,void 0,(function(){return L(this,(function(t){return[2,new Promise((function(t){swan.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))]}))}))}},ee=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)}}},te={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},ne={tag:"uniapp",httpReq:function(e){var i=e.method||t.GET,a=e.timeout||n,s=e.headers,c=e.query,u=e.body,d=o(e.url,c);return new Promise((function(e){uni.request({url:d,method:i,header:s,timeout:a,data:u,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:te,sessionStorage:te,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},o=uni.connectSocket(n);return{onClose:function(e){o.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){o.onError((function(t){e(t.errMsg)}))},onMessage:function(e){o.onMessage((function(t){e(t.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,t){o.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(t){uni.getNetworkType({success:function(e){var n=e.networkType;t(n)},fail:function(){t(e.UNKONWN)}})}))}},oe=function(e){return e&&e.request&&e.getSystemInfo},re="undefined"!=typeof uni&&oe(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ne;case"mp-baidu":return $;case"mp-toutiao":return W;case"mp-alipay":return J;case"mp-weixin":return H;default:return G}}():"undefined"!=typeof my&&oe(my)?J:"undefined"!=typeof tt&&oe(tt)?W:"undefined"!=typeof swan&&oe(swan)?$:"undefined"!=typeof wx&&oe(wx)?H:G;function ie(e){var t=e.conversationType,n=e.channelId,o=e.messageType,r=e.content,c=e.senderUserId,u=e.targetId,d=e.sentTime,f=e.receivedTime,l=e.messageUId,g=e.messageDirection,v=e.isPersited,I=e.isCounted,h=e.isOffLineMessage,R=e.canIncludeExpansion,m=e.expansion,E=e.receivedStatus,p=e.disableNotification,T=e.isMentioned,S=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,C=e.messageId,_=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;E||(E=i.UNREAD);var U={messageType:o,channelId:n||"",content:r,senderUserId:c,targetId:u,conversationType:t,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:p,isStatusMessage:S,canIncludeExpansion:R,expansion:m,receivedStatus:E,readReceiptInfo:O,pushConfig:N,messageId:C,isInterrupt:_,isModifyMessage:A,sentStatus:M};return t!==a.ULTRA_GROUP&&(U.isOffLineMessage=h),t===a.ULTRA_GROUP&&s(y)&&(U.channelType=y),U}function ae(e){var t=e.conversationType,n=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,i=e.hasMentioned,a=e.mentionedInfo,s=e.lastUnreadTime,c=e.notificationStatus,u=e.notificationLevel,d=e.isTop,f=e.channelId,l=e.unreadMentionedCount;return{conversationType:t,targetId:n,latestMessage:o&&ie(o),unreadMessageCount:r,hasMentioned:i,mentionedInfo:i?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:s,notificationStatus:c,notificationLevel:u,isTop:d,channelId:f,unreadMentionedCount:l}}function se(e,t){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(t,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED"}(B||(B={})),function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(D||(D={}));var ce=new c,ue={onConnecting:function(){ce.emit(B.CONNECTING)},onConnected:function(){ce.emit(B.CONNECTED)},onDisconnect:function(e){ce.emit(B.DISCONNECT,e)},onSuspend:function(e){ce.emit(B.SUSPEND,e)},batchMessage:function(e){ce.emit(B.MESSAGES,{messages:e.map((function(e){return ie(e)}))})},typingState:function(e){ce.emit(B.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n){ce.emit(B.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n})},messageReceiptRequest:function(e,t,n){ce.emit(B.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){ce.emit(B.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?ie(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===a.ULTRA_GROUP?(n.versionTime=e.versionTime,{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));ce.emit(B.CONVERSATION,{conversationList:t})},chatroomState:function(e){ce.emit(B.CHATROOM,e)},expansion:function(e){ce.emit(B.EXPANSION,e)},pullFinished:function(){ce.emit(B.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){ce.emit(B.TAG)},conversationTagChanged:function(){ce.emit(B.CONVERSATION_TAG)},messageBlocked:function(e){ce.emit(B.MESSAGE_BLOCKED,e)},ultraGroupEnable:function(e){ce.emit(B.ULTRA_GROUP_ENABLE,e)},operateStatus:function(e){ce.emit(B.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){ce.emit(B.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e)},ultraGroupMessageModified:function(e){ce.emit(B.ULTRA_GROUP_MESSAGE_MODIFIED,e)},ultraGroupMessageRecalled:function(e){ce.emit(B.ULTRA_GROUP_MESSAGE_RECALLED,e)},ultraGroupChannelChangeType:function(e){ce.emit(B.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){ce.emit(B.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){ce.emit(B.ULTRA_GROUP_CHANNEL_DELETE,e)}};u.add("imlib-next","5.6.2-beem.2");var de=null,fe=null,le=null;function ge(){return P(this,void 0,void 0,(function(){return L(this,(function(e){switch(e.label){case 0:return de?(le.info(I.A_DESTROY_O),[4,v.destroy()]):[2];case 1:return e.sent(),fe=null,de=null,le=null,[2]}}))}))}function ve(e){if(!de)throw new Error("Not initialized yet!");return e(de,le,fe)}function Ie(e){return de?e(de,le,fe):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function he(e,t,n){ce.on(e,t,n)}function Re(e,t,n){ce.once(e,t,n)}function me(e,t,n){ce.off(e,t,n)}function Ee(e){ce.removeAll(e)}function pe(){ce.clear()}function Te(e){!function(e){var t=e.appkey,n=e.navigators;de?le.warn(I.A_INIT_REPEAT_O):(d("options.appkey",e.appkey,f.STRING,!0),d("options.navigators",e.navigators,(function(e){return l(e)&&(0===e.length||e.every(g))})),fe=e,de=v.init(re,{appkey:e.appkey,apiVersion:"5.6.2-beem.2",navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,checkCA:e.checkCA,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime}),(le=de.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),le.info(I.A_INIT_O,JSON.stringify({appkey:t,navigators:n,version:"5.6.2-beem.2",commit:"36047b6fa06d646873e32eab37c7f0ea8704a7bc"})),de.assignWatcher(ue))}(e)}function Se(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return de?(pe(),[2,ge()]):[2]}))}))}function Oe(){return ve((function(e){return e.getConnectionStatus()}))}function Ne(){return ve((function(e){return e.getServerTime()}))}function Ce(){return ve((function(e){return e.getCurrentUserId()}))}function _e(e,t){u.add(e,t)}function Ae(){return ve((function(e){return e.getDeviceId()}))}function ye(e,t){return ve((function(n){return n.install(e,t)}))}var Me={TIMEOUT:{code:-1,msg:"Network timeout"},SDK_INTERNAL_ERROR:{code:-2,msg:"SDK internal error"},PARAMETER_ERROR:{code:-3,msg:"Please check the parameters, the {param} expected a value of {expect} but received {current}"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:r.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Ue={};for(var Pe in Me){var Le=Me[Pe].code;Ue[Le]=Pe}function we(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return R("token",e,f.STRING,!0)&&R("reconnectKickEnable",t,f.BOOLEAN)?(n=i.createTraceId(),i.info(I.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,o.connect(e,!1,t,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return a=c.sent(),s=a.code===r.SUCCESS?"info":"warn",i[s](I.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:Ue[a.code]}]}}))}))}))]}))}))}function be(){return h.info(I.A_DISCONNECT_O,{}),ve((function(e){return e.disconnect()}))}function Be(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options.count",null==e?void 0:e.count,f.NUMBER)&&R("options.startTime",null==e?void 0:e.startTime,f.NUMBER)&&R("options.order",null==e?void 0:e.order,f.NUMBER)&&R("channelId",t,f.CHANNEL_ID)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS&&s?[2,{code:0,data:s.map((function(e){return ae(e)}))}]:(i.warn(I.O,"get conversation list fail ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function De(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return[4,n.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return t=s.sent(),i=t.code,a=t.data,i!==r.SUCCESS?(o.warn(I.O,"getConversation ->code:".concat(i,", targetId:").concat(e.targetId)),[2,{code:i,msg:Ue[i]}]):[2,{code:i,data:a?ae(a):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ge(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i;return L(this,(function(a){switch(a.label){case 0:return[4,n.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"destroy conversation ->".concat(i)),t!==r.SUCCESS?(o.warn(I.O,"destroy conversation fail ->".concat(t,":").concat(Ue[t],",").concat(i)),[2,{code:t,msg:Ue[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xe(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return[4,n.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),i=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"get draft ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a||""}]:(o.warn(I.O,"get draft fail ->".concat(i,":").concat(Ue[i],",").concat(s)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ve(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options",e,f.CONVERSATION,!0)&&R("draft",t,f.STRING,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"set draft ->".concat(n)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())===r.SUCCESS?[2,{code:a}]:(i.warn(I.O,"set draft fail ->".concat(a,":").concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ke(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i;return L(this,(function(a){switch(a.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"delete draft ->".concat(t)),[4,n.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(i=a.sent())===r.SUCCESS?[2,{code:i}]:(o.warn(I.O,"delete draft fail ->".concat(i,":").concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function He(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("includeMuted",e,f.BOOLEAN,!1)&&R("conversationTypes",t,f.ARRAY,!1)&&!(null==t?void 0:t.every((function(e){return!R("conversationType",e,m)})))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return i.debug(I.O,"get total unread count -> ConversationType:".concat(JSON.stringify(t)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",t,e)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getTotalUnreadCount fail ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fe(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return!R("conversationTypes",e,f.ARRAY,!0)||!R("levels",t,f.ARRAY,!0)||e.every((function(e){return!R("conversationType",e,m)}))||t.every((function(e){return!R("level",e,E)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getTotalUnreadCountByLevels fail ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]}))}))}function qe(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return!R("conversationTypes",e,f.ARRAY,!0)||!R("levels",t,f.ARRAY,!0)||e.every((function(e){return!R("conversationType",e,m)}))||t.every((function(e){return!R("level",e,E)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,t,!0)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]}))}))}function Ze(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return[4,n.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=c.sent(),i=t.code,a=t.data,s="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"get unreadCount ->".concat(s)),i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(I.O,"get unreadCount fail ->".concat(i,":").concat(Ue[i],",").concat(s)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i;return L(this,(function(a){switch(a.label){case 0:return[4,n.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return t=a.sent(),i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(I.O,"clear unreadMsgNum ->".concat(i)),t!==r.SUCCESS?(o.warn(I.O,"clear unreadMsgNum fail ->".concat(t,":").concat(Ue[t],",").concat(i)),[2,{code:t,msg:Ue[t]}]):[2,{code:t}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){return L(this,(function(e){switch(e.label){case 0:return[4,t.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}Me.ROAMING_SERVICE_UNAVAILABLE.code;var Ke=function(e,t,n){void 0===n&&(n="");var o="conversationType:".concat(t.conversationType,",targetId:").concat(t.targetId);return e.debug(I.O,"".concat(n," -> ").concat(o)),o},Ye=function(e,t,n,o){return void 0===o&&(o=""),P(void 0,void 0,void 0,(function(){var i,a;return L(this,(function(s){switch(s.label){case 0:return i=Ke(e,t,o),[4,n()];case 1:return(a=s.sent())!==r.SUCCESS?(e.warn(I.O,"".concat(o," fail -> ").concat(a," : ").concat(Ue[a]," , ").concat(i)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))};function We(e,t){return P(this,void 0,void 0,(function(){return L(this,(function(n){return R("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)&&R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return Ye(o,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xe(e,t){return P(this,void 0,void 0,(function(){return L(this,(function(n){return R("notificationStatus",t,(function(e){return 1===e||2===e}),!0)&&R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return Ye(o,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return t=Ke(o,e,"getConversationNotificationLevel"),[4,n.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return i=c.sent(),a=i.code,s=i.data,a===r.SUCCESS?[2,{code:a,data:s}]:(o.warn(I.O,"getConversationNotificationLevel fail -> ".concat(a," : ").concat(Ue[a]," , ").concat(t)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qe(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(I.O,"getConversationNotificationStatus ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ie((function(e){return e.getBlockConversationList()}))]}))}))}function et(e,t){return void 0===t&&(t=!0),P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options",e,f.CONVERSATION,!0)&&R("isTop",t,f.BOOLEAN)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"set conversation status ->".concat(n)),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"set conversation status fail ->".concat(a,":").concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function nt(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ie((function(e){return e.getTopConversationList()}))]}))}))}function ot(e){return P(this,void 0,void 0,(function(){return L(this,(function(t){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(t,n){return n.debug(I.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),t.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rt(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ie((function(e,t){return t.debug(I.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function it(){return P(this,void 0,void 0,(function(){return L(this,(function(e){return[2,Ie((function(e){return e.getAllConversationState()}))]}))}))}function at(e){return void 0===e&&(e={}),P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options.targetId",e.targetId,f.STRING,!1)&&R("options.channelType",e.channelType,(function(e){return void 0!==T[e]}),!1)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return[4,n.getUltraGroupList(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(o.warn(I.O,"get ultragroup ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function st(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,i;return L(this,(function(a){switch(a.label){case 0:return[4,t.getBlockUltraGroupList()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(n.warn(I.O,"get block ultragroup ->".concat(o,":").concat(Ue[o])),[2,{code:o,msg:Ue[o]}])}}))}))}))]}))}))}function ct(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(i){switch(i.label){case 0:return[4,n.sendUltraGroupTypingStatus(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(I.O,"send ultraGroup OperateStatus ->".concat(t,":").concat(Ue[t])),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ut(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options",e,f.CONVERSATION,!0)&&R("msgs",t,f.ARRAY,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),u={targetId:n,conversationType:a,messages:c},[4,o.getUltraGroupMessageListByMessageUId(u)];case 1:return d=g.sent(),f=d.code,l=d.data,f===r.SUCCESS?[2,{code:r.SUCCESS,data:l}]:(i.warn(I.O,"get UltraGroup MessageList by messageUId ->".concat(f,":").concat(Ue[f])),[2,{code:f,msg:Ue[f]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("expansion",e,f.OBJECT,!0)&&R("message",t,f.OBJECT,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),i.debug(I.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(I.O,"update expansion for ultragroup message ->".concat(g,":").concat(Ue[g])),[2,{code:g,msg:Ue[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ft(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("expansion",e,f.ARRAY,!0)&&R("message",t,f.OBJECT,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,u=t.canIncludeExpansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(d,",messageUId:").concat(s),i.debug(I.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:a,channelId:d,conversationType:n,sendTime:c,canIncludeExpansion:u,messageUId:s,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=v.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(I.O,"remove expansion for ultraGroup message ->".concat(g,":").concat(Ue[g])),[2,{code:g,msg:Ue[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function lt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("message",e,f.OBJECT,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return t=e.conversationType,i=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(u,",messageUId:").concat(a),o.debug(I.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:i,channelId:u,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(f)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(I.O,"remove all expansion for ultraGroup message ->".concat(l,":").concat(Ue[l])),[2,{code:l,msg:Ue[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function gt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("content",e,f.OBJECT,!0)&&R("message",t,f.OBJECT,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v;return L(this,(function(h){switch(h.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,u=t.sentTime,d=t.canIncludeExpansion,f=t.channelId,l="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(f,",messageUId:").concat(s),i.debug(I.O,"update ultragroup message expansion ->".concat(l)),g={targetId:a,channelId:f,conversationType:n,fromUserId:c,sendTime:u,canIncludeExpansion:d,messageUId:s,content:e},[4,o.modifyMessage(g)];case 1:return(v=h.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(i.warn(I.O,"modify ultraGroup message ->".concat(v,":").concat(Ue[v])),[2,{code:v,msg:Ue[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function vt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.every((function(e){return!R("notificationLevel",e,E)})))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return i.debug(I.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(t))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:r.SUCCESS,data:s}]:(i.warn(I.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function It(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("options.targetId",e.targetId,f.STRING,!0)&&R("options.channelId",e.channelId,f.CHANNEL_ID)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s,c;return L(this,(function(u){switch(u.label){case 0:return t="getUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(I.O,"".concat(t," -> ").concat(i)),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS?[2,{code:s,data:c}]:(o.warn(I.O,"".concat(t," fail -> ").concat(s," : ").concat(Ue[s]," , ").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ht(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return e.channelId=e.channelId||"",R("options.targetId",e.targetId,f.STRING,!0)&&R("options.channelId",e.channelId,f.ONLY_STRING,!0)&&R("notificationLevel",t,(function(e){return void 0!==p[e]}),!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return n="setUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),i.debug(I.O,"".concat(n," -> ").concat(a)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return(s=c.sent().code)===r.SUCCESS?[2,{code:s}]:(i.warn(I.O,"".concat(n," fail -> ").concat(s," : ").concat(Ue[s]," , ").concat(a)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("notificationLevels",t,f.ARRAY)&&!(null==t?void 0:t.every((function(e){return!R("notificationLevel",e,E)})))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,u="targetId: ".concat(e,", levels: ").concat(JSON.stringify(t)),i.debug(I.O,"".concat(n," -> ").concat(u)),s===r.SUCCESS?[2,{code:s,data:c}]:(i.warn(I.O,"".concat(n," fail -> ").concat(s,": ").concat(Ue[s],", ").concat(u)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mt(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,i,a;return L(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadCount",[4,t.getAllUltraGroupUnreadCount()];case 1:return o=s.sent(),i=o.code,a=o.data,n.debug(I.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(I.O,"".concat(e," fail ->").concat(i,": ").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function Et(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,i,a;return L(this,(function(s){switch(s.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,t.getAllUltraGroupUnreadCount(true)];case 1:return o=s.sent(),i=o.code,a=o.data,n.debug(I.O,e),i===r.SUCCESS?[2,{code:i,data:a}]:(n.warn(I.O,"".concat(e," fail ->").concat(i,": ").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function pt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return e.channelId=e.channelId||"",R("options.targetId",e.targetId,f.STRING,!0)&&R("options.channelId",e.channelId,f.ONLY_STRING,!0)&&R("options.sentTime",e.sentTime,f.NUMBER,!0)&&R("options.count",e.count,(function(e){return s(e)&&e>0&&e<=50}),!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return t=e.targetId,i=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:i,sentTime:a,count:s},[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=l.sent(),d=u.code,f=u.data,d===r.SUCCESS?[2,{code:d,data:f}]:(o.warn(I.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Ue[d])),[2,{code:d,msg:Ue[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Tt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("conversation.targetId",e.targetId,f.STRING,!0)&&R("conversation.channelId",e.channelId,f.ONLY_STRING,!0)?[2,Ie((function(n){return P(t,void 0,void 0,(function(){var t,o,i,a,s,c;return L(this,(function(u){switch(u.label){case 0:return t=e.targetId,o=e.channelId,i={targetId:t,channelId:o},[4,n.getUltraGroupFirstUnreadMessageTimestamp(i)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Ue[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var St=function(e){return!!(R("options.key",e.key,f.STRING,!0)&&R("options.value",e.value,f.STRING,!0)&&R("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)&&R("options.isSendNotification",e.isSendNotification,f.BOOLEAN)&&R("options.notificationExtra",e.notificationExtra,f.STRING))},Ot=function(e){return!(!R("options.key",e.key,f.STRING,!0)||!R("options.isSendNotification",e.isSendNotification,f.BOOLEAN)||!R("options.notificationExtra",e.notificationExtra,f.STRING))};function Nt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("options.count",t.count,f.NUMBER,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(I.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,o.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",i[s](I.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Ue[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ct(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("options.count",t.count,f.NUMBER,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return n=i.createTraceId(),i.info(I.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,o.joinExistChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",i[s](I.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Ue[a]}]:[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _t(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("targetId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return t=o.createTraceId(),o.info(I.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return i=s.sent(),a=i===r.SUCCESS?"info":"warn",o[a](I.A_QUIT_CHATROOM_R,JSON.stringify({code:i}),t),i!==r.SUCCESS?[2,{code:i,msg:Ue[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function At(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("options.count",t.count,f.NUMBER)&&R("options.order",t.order,(function(e){return[0,1,2].includes(e)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(I.O,"get chatroom info ->".concat(n)),[4,o.getChatroomInfo(e,t.count,t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(i.warn(I.O,"get chatroom info fail ->code+:".concat(Ue[s],",").concat(n)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function yt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&St(t)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(I.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"set chatroom entry fail ->code+:".concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!R("entry.key",e.key,f.STRING,!0)||!R("entry.value",e.value,f.STRING,!0)}))||!R("options.isAutoDelete",e.isAutoDelete,f.BOOLEAN)||!R("options.notificationExtra",e.notificationExtra,f.STRING)||!R("options.isForce",e.isForce,f.BOOLEAN))}(t)?t.entries.length>10?[2,Me.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(I.O,"set chatroom entry->".concat(n)),[4,o.setChatroomEntries(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s!==r.SUCCESS?(i.warn(I.O,"set chatroom entry fail ->code+:".concat(Ue[s],",").concat(n)),[2,{code:s,msg:Ue[s],data:c}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ut(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&St(t)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(I.O,"force set chatroom entry ->".concat(n)),[4,o.forceSetChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"force set chatroom entry fail ->code+:".concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&Ot(t)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.debug(I.O,"remove chatroom entry->".concat(n)),[4,o.removeChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"remove chatroom entry fail ->code+:".concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Lt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!R("key",e,f.STRING,!0)}))||!R("options.notificationExtra",e.notificationExtra,f.STRING))}(t)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.info(I.O,"remove chatroom entry->".concat(n)),(a=U({},t)).entries=t.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,a)];case 1:return s=d.sent(),c=s.code,u=s.data,c!==r.SUCCESS?(i.warn(I.O,"remove chatroom entry fail ->code+:".concat(Ue[c],",").concat(n)),[2,{code:c,msg:Ue[c],data:u}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&Ot(t)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),i.info(I.O,"force remove chatroom entry ->".concat(n)),[4,o.forceRemoveChatroomEntry(e,t)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"force remove chatroom entry fail ->code+:".concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:a}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("key",t,(function(e){return S(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c;return L(this,(function(u){switch(u.label){case 0:return n="id:".concat(e),i.debug(I.O,"get chatroom entry->".concat(n)),[4,o.getChatroomEntry(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?[2,{code:s,data:c}]:(i.warn(I.O,"get chatroom entry fail ->code+:".concat(Ue[s],",").concat(n)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("targetId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),o.debug(I.O,"get all chatroom entries->".concat(t)),[4,n.getAllChatroomEntries(e)];case 1:return i=c.sent(),a=i.code,s=i.data,a===r.SUCCESS&&s?[2,{code:a,data:s}]:(o.warn(I.O,"get all chatroom entries fail ->code+:".concat(Ue[a],",").concat(t)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dt(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("targetId",e,f.STRING,!0)&&R("options.timestamp",t.timestamp,f.NUMBER)&&R("options.count",t.count,f.NUMBER)&&R("options.order",t.order,(function(e){return 0===e||1===e}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="id:".concat(e),i.debug(I.O,"get chatroom history message->".concat(n)),[4,o.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ie(e)})),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(i.warn(I.O,"get chatroom history message fail ->code+:".concat(Ue[s],",").concat(n)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Gt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("option.chatRoomId",e.chatRoomId,f.STRING,!0)&&R("option.rtcRoomId",e.rtcRoomId,f.STRING,!0)?[2,Ie((function(n){return P(t,void 0,void 0,(function(){var t;return L(this,(function(o){switch(o.label){case 0:return[4,n.bindRTCRoomForChatroom(e)];case 1:return[2,{code:t=o.sent(),msg:Ue[t]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("userId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"addToBlacklist -> userId: ".concat(e)),[4,n.addToBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vt(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("userId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"removeFromBlacklist -> userId: ".concat(e)),[4,n.removeFromBlacklist(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function kt(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,i;return L(this,(function(a){switch(a.label){case 0:return n.info(I.O,"getBlacklist -> "),[4,t.getBlacklist()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS&&i?[2,{code:o,data:i}]:(n.warn(I.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Ht(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("userId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getBlacklistStatus -> userId: ".concat(e)),[4,n.getBlacklistStatus(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:0===a}]:(o.warn(I.O,"getBlacklistStatus fail -> code: ".concat(i,", userId: ").concat(e)),[2,{code:i}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var Ft=function(e,t,n,o){void 0===n&&(n=!0),void 0===o&&(o=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=o};function qt(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(o){return new Ft(e,o,t,n)}}var Zt,Jt,zt=qt("RC:ImgMsg"),Kt=qt("RC:HQVCMsg"),Yt=qt("RC:SightMsg"),Wt=qt("RC:TxtMsg"),Xt=qt("RC:CombineMsg"),jt=qt("RC:FileMsg"),Qt=qt("RC:GIFMsg"),$t=qt("RC:VcMsg"),en=qt("RC:LBSMsg"),tn=qt("RC:ReferenceMsg"),nn=qt("RC:ImgTextMsg"),on={qiniu:function(e,t,n,o){ve((function(r){var i=r.getInfoFromCache();if(1===(null==i?void 0:i.type)&&t.chunk_size&&o.size>t.chunk_size){var a=O();a+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=a,fn(o,t,n)}else dn(e,t,n,o)}))},baidu:function(e,t,n,o){if(o.size>an)throw new Error("the file size is over 5GB!");var r=t||{};t=t||Jt;var i=new XMLHttpRequest,a=sn();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var s=a+rn[0][1]+r.bosUploadPath;rn.shift();var c=r.bosHeader||{},u={filename:t.uniqueValue||o.uniqueName,name:o.name,downloadUrl:s,isBosRes:!0};i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total,!0)});i.onreadystatechange=function(){if(4===i.readyState)if(JSON.parse(i.responseText||"{}").filename=t.uniqueValue,200===i.status){n.onCompleted(u,!0)}else rn.length?on[rn[0][0]](e,t,n,o):n.onError("upload fail")},i.open(t.method,s,!0),i.setRequestHeader("authorization",c.bosToken),i.setRequestHeader("x-bce-date",c.bosDate),i.send(o)},aliyun:function(e,t,n,o){if(o.size>an)throw new Error("the file size is over 5GB!");var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token"));var i=rn[0][1];rn.shift(),e=e||Zt,t=(t=t||{})||Jt;var a=new XMLHttpRequest,s=sn(),c="".concat(s+t.ossBucketName,".").concat(i);a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var e=JSON.parse(a.responseText||"{}");e.name=t.uniqueValue,e.filename=t.uploadFileName,e.uploadMethod=N?N.ALI:"",200===a.status?n.onCompleted(e):rn.length?on[rn[0][0]](r,t,n,o):n.onError("upload fail")}},a.open(t.method,c,!0),console.log("ali:url",c);var u=t.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",t.uploadFileName),e.delete("file"),e.append("file",o),a.send(e)},s3:function(e,t,n,o){var r=new FormData,i=new XMLHttpRequest,a=sn(),s=t.contentDisposition,c=rn[0][1],u="".concat(a+t.s3BucketName,".").concat(c);console.log("uploadS3:url",u),rn.shift(),i.upload&&t.support_options&&(i.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var r=JSON.parse(i.responseText||"{}");if(r.name=t.uniqueValue,r.filename=t.uploadFileName,r.uploadMethod=N.AWS,200===i.status||204===i.status)n.onCompleted(r);else if(rn.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),on[rn[0][0]](a,t,n,o)}else n.onError("upload fail")}},i.open(t.method,u,!0);var d=t?t.s3Header:{},f=o&&o.type;s?r.set("Content-Disposition","".concat(s,";")):r.set("Content-Disposition","text/html"===f?"inline;":"attachment;");r.set("Content-Type",f),r.set("x-amz-credential",d.s3Credential),r.set("x-amz-algorithm",d.s3Algorithm),r.set("x-amz-date",d.s3Date),r.set("policy",d.s3Policy),r.set("x-amz-signature",d.s3Signature),r.set("key",t.uploadFileName),r.set("file",o),i.send(r)},stc:function(e,t,n,o){var r=new XMLHttpRequest,i=t.contentDisposition,a=rn[0][1],s="https://".concat(a,"/").concat(t.stcBucketName,"/").concat(t.uploadFileName);rn.shift(),r.upload&&t.support_options&&(r.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var i=JSON.parse(r.responseText||"{}");if(i.name=t.uniqueValue,i.filename=t.uploadFileName,i.uploadMethod=N?N.STC:"",200===r.status||204===r.status)n.onCompleted(i);else if(rn.length){var a=new FormData;a.set("file",e.get("file")),a.set("key",e.get("key")),a.set("token",e.get("token")),on[rn[0][0]](a,t,n,o)}else n.onError("upload fail")}},r.open("PUT",s,!0);var c=t?t.stcHeader:{};r.setRequestHeader("Content-Type",o.type),i?r.setRequestHeader("Content-Disposition","".concat(i,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");r.setRequestHeader("Authorization",c.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",c.stcContentSha256),r.setRequestHeader("x-amz-date",c.stcDate),r.send(o)}},rn=[],an=5368709120;function sn(){var e="https://";return"http:"!==location.protocol&&"file:"!==location.protocol||(e="http://"),e}var cn,un=(cn="RC-upload-",{get:function(e){e=cn+e;var t=localStorage.getItem(e);if(t)return null!==(t=JSON.parse(t||"{}"))&&t.type&&t.data?t.data:null},set:function(e,t){var n=localStorage;e=cn+e,t={data:t,type:typeof t,updateTime:Date.now()},n.setItem(e,JSON.stringify(t))},remove:function(e){e=cn+e,localStorage.removeItem(e)}});function dn(e,t,n,o){var r="https://"+t.uploadHost.qiniu,i=(/http/.test(rn[0][1])?"":sn())+rn[0][1]||r;t.isChunk||rn.shift();var a=new XMLHttpRequest;a.upload&&t.support_options&&(a.upload.onprogress=function(e){n.onProgress(e.loaded,e.total)}),a.onreadystatechange=function(){if(4===a.readyState){var r=JSON.parse(a.responseText||"{}");r.filename=t.uniqueValue,r.uploadMethod=N?N.QINIU:"",200===a.status||204===a.status?n.onCompleted(r):rn.length?on[rn[0][0]](e,t,n,o):n.onError("upload fail")}},a.open(t.method,i,!0),n.onOpen(a),t.stream&&a.setRequestHeader("authorization","UpToken ".concat(t.multi_parmas.token)),function(e,t){for(var n in e)t(n,e[n])}(t.headers,(function(e,t){a.setRequestHeader(e,t)})),a.send(e)}function fn(e,t,n,o){var r=0,i=o||O(),a=un.get(i);a&&(e.uniqueName=a.sessionId,r=a.offset);var s=Math.min(t.chunk_size,e.size-r),c=e.slice(r,r+s),u=e.uniqueName;t.multi_parmas.name=u,t.filesize=e.size;var d="bytes=".concat(r,"-").concat(r+s);t.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},t.isChunk=!0,c.name=e.name,c=function(e,t,n){var o=new FormData;for(var r in t.unique_key&&o.append(t.unique_key,n),o.append(t.file_data_name,e,e.name),t.multi_parmas){var i=t.multi_parmas[r];o.append(r,i)}return o}(c,t,e.uniqueName),dn(c,t,{onCompleted:function(o){r+=s;var a=e.uniqueName;un.set(i,{offset:r,sessionId:a}),r<e.size?fn(e,t,n,i):(r=0,un.remove(i),n.onCompleted(o))},onError:function(e){console.error(e),n.onError(e)},onProgress:function(e,o){var i=e+r;n.onProgress(i,t.filesize)},onOpen:function(e){n.onOpen(e)}},e)}function ln(e,t,n,o){var r,i,a=t&&t.type||"text/plain",s=a.indexOf("image")>-1?1:4,c=n.contentDisposition,u=Math.ceil(t.size/n.stc_chunk_size),d=n&&JSON.parse(n.ossConfig?n.ossConfig:"");Array.isArray(d)||(d=[]);var f=d.find((function(e){return Object.keys(e).includes("stc")})),l="uploads";e.getFileToken(s,r,"POST",l).then((function(e){r=e.fileName,i="https://".concat(f.stc,"/").concat(n.stcBucketName,"/").concat(r),console.log("uploadStcMultipart:url",i);var s=new XMLHttpRequest;s.open("POST","".concat(i,"?").concat(l),!0),c?s.setRequestHeader("Content-Disposition","".concat(c,";")):s.setRequestHeader("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),s.setRequestHeader("Authorization",e&&e.stcAuthorization),s.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),s.setRequestHeader("x-amz-date",e&&e.stcDate),s.setRequestHeader("Content-Type",a),s.send(),s.onreadystatechange=function(){if(4===s.readyState){var e=s.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===s.status||204===s.status?function(e){for(var t=[],n=1;n<=u;n++)t.push(h(e,n));I(e,t)}(Array.isArray(e)&&e[1]):o.onError("uploadStcMultipart:did not get uploadId")}}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));var g=[],v=new Map;function I(c,d){d&&Array.isArray(d)&&0!==d.length&&Promise.all(d).then((function(){var d="uploadId=".concat(c);if(v.size===u)e.getFileToken(s,r,"POST",d).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",c);var r=new XMLHttpRequest;r.open("POST","".concat(i,"?").concat(d),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",a);var s="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(v.keys()||[]).sort((function(e,t){return e-t}));console.log("keys",u),u.forEach((function(e){s+="<Part><ETag>".concat(v.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),s+="</CompleteMultipartUpload>",r.send(s),console.log("xml",s),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e={name:t.name,filename:n.uploadFileName,uploadMethod:N.STC};o.onCompleted(e)}else o.onError("uploadStcMultipart:upload does not end")}}),(function(e){o.onError("uploadStcMultipart:".concat(e))}));else{for(var f=[],l=0,R=g;l<R.length;l++){var m=R[l];f.push(h(c,m))}I(c,f)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var t=[],n=0,r=g;n<r.length;n++){var i=r[n];t.push(h(c,i))}I(c,t)}))}function h(o,c){return new Promise((function(u,d){var f="partNumber=".concat(c,"&uploadId=").concat(o);e.getFileToken(s,r,"PUT",f).then((function(e){console.log("signature ".concat(c," onSuccess"),e);var o=t&&t.slice((c-1)*n.stc_chunk_size,c*n.stc_chunk_size);console.log("fileChunk:size",o.size);var r=new XMLHttpRequest;r.open("PUT","".concat(i,"?").concat(f),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",a),r.send(o),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e=r.getResponseHeader("etag");console.log("etag:".concat(c),e),v.set(c,e),u(e)}else g.includes(c)||g.push(c),d(c)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(c)||g.push(c),d(c)}))}))}}var gn={form:function(e,t){var n=new FormData;if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=vn()+o;n.append(t.unique_key,r),t.uniqueValue=r}return n.append(t.file_data_name,e),In(t.multi_parmas,(function(e,t){n.append(e,t)})),n},json:function(e,t){var n={};if(t.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=vn()+o;n[t.unique_key]=r,t.uniqueValue=r}return n[t.file_data_name]=e,In(t.multi_parmas,(function(e,t){n[e]=t})),JSON.stringify(n)},data:function(e,t){return e}};function vn(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))}function In(e,t){for(var n in e)t(n,e[n])}var hn,Rn=0,mn=function(){function e(e){this.options=function(e){var t={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:gn.form,genUId:vn};if(!e||!e.domain)throw new Error("domain is null");for(var n in e)t[n]=e[n];return t}(e)}return e.prototype.setOptions=function(e){var t=this;In(e,(function(e,n){t.options[e]=n}))},e.prototype.upload=function(e,t,n,o){if(n){var r=this;!function(e,t,n,o,r){Zt=n,Jt=o,rn=[];var i,a=e.getInfoFromCache();if(1===(null==a?void 0:a.type)&&t.uploadDomain)rn=[["qiniu",t.uploadDomain]];else if(o.ossConfig){var s,c,u=JSON.parse(o.ossConfig),d="",f=[];u.forEach((function(e){var t=Number(e.p)-1;for(var n in e)"aliyun"===n&&(d=e[n]),"s3"===n&&(s=e[n]),"stc"===n&&(c=e[n]),"p"!==n&&(f[t]=[n,e[n]])})),f.forEach((function(e){e&&rn.push(e)})),u.length!==rn.length&&(rn=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",d],["s3",s],["stc",c]])}else rn=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var l=o&&JSON.parse(o.ossConfig);Array.isArray(l)||(l=[]),i=l.find((function(e){return Object.keys(e).includes("stc")}))}if(i&&1===parseInt(i.p,10)&&n.size>=4194304)ln(e,n,o,r);else{var g=o.data(n,o);on[rn[0][0]](g,o,r,n)}}(e,t,n,this.options,{onProgress:function(e,t,n){(hn=e,n)?hn=Rn+e/t*(t-Rn):Rn=hn;o.onProgress(hn,t)},onCompleted:function(e){o.onCompleted(e)},onError:function(e){o.onError(e)},onOpen:function(e){r.xhr=e}})}else o.onError("upload file is null.")},e.prototype.cancel=function(){var e;null===(e=this.xhr)||void 0===e||e.abort()},e}();var En,pn,Tn={init:function(e){return new mn(e)},dataType:gn,resize:function(e,t,n){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,i=new Image;i.src=r;var a=i.width,s=i.height,c=function(e,t){var n=1,o=e.width,r=t.maxWidth||0;r>0&&o>r&&(n=r/o);var i=e.height,a=t.maxHeight||0;if(a>0&&i>a){var s=a/i;n=Math.min(n,s)}var c=t.maxSize||0,u=Math.ceil(e.size/1e3);if(u>c){var d=c/u;n=Math.min(n,d)}return n}({width:a,height:s,size:e.total},t),u=r;c<1&&(u=function(e,t,n){return o.width=t,o.height=n,o.getContext("2d").drawImage(e,0,0,t,n),o.toDataURL("image/jpg")}(i,a*c,s*c)),n(u)}},Upload:mn},Sn=function(e,t,n){var o=document.createElement("canvas"),r=o.getContext("2d"),i=new Image,a="string"==typeof e;i.onload=function(a){var s=function(e,t,n){var o,r,i,a=e<t,s=0,c=0;return(a?t/e:e/t)>n.scale?(a?(r=100,c=((i=t/(o=e/100))-n.maxHeight)/2):(i=100,s=((r=e/(o=t/100))-n.maxWidth)/2),{w:r,h:i,x:-s,y:-c}):(a?(o=t/n.maxHeight,i=n.maxHeight,r=e/o):(o=e/n.maxWidth,r=n.maxWidth,i=t/o),{w:r,h:i,x:-s,y:-c})}(i.width,i.height,t);o.width=s.w>t.maxWidth?t.maxWidth:s.w,o.height=s.h>t.maxHeight?t.maxHeight:s.h,r.drawImage(i,s.x,s.y,s.w,s.h);var c=o.toDataURL("string"==typeof e?"image/jpg":e.type,t.quality);c=c.replace(/data:image\/[^;]+;base64,/,""),n(c)},i.src=a?"data:image/jpg;base64,".concat(e):function(e){var t=window.URL||window.webkitURL;return t?t.createObjectURL(e):""}(e)},On=function(e,t){var n=e.file,o=e.compress;Sn(n,o,t)},Nn=function(e,t){if(e.getToken)e.getToken((function(n,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=n,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(n));var r=Tn.init(e);t(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var n=Tn.init(e);t(n)}},Cn=function(e,t,n,o,r){o.upload(e,t,n.file,{onError:function(e){r.onError(e)},onProgress:function(e,t){r.onProgress(e,t)},onCompleted:function(e){e.filename=e.filename||e.hash;var t=n.compressThumbnail||On;n.compress?t(n,(function(t){e.thumbnail=t,r.onCompleted(e)})):r.onCompleted(e)}})},_n=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,t,n,o){Cn(e,t,{file:n},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),An=function(){function e(e,t){this.instance=e,this.cfg=t}return e.prototype.upload=function(e,t,n,o){var r={file:n,compress:this.cfg};Cn(e,t,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),yn=function(e,t){Nn(e,(function(e){var n=new _n(e);t(n)}))},Mn=function(e,t){Nn(e,(function(n){var o,r,i,a,s={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.quality)||.5,scale:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.scale)||2.4},c=new An(n,s);t(c)}))};Tn.dataType;function Un(e,t,n,o,r,i,a){var s,c=this;void 0===r&&(r=_.FILE),s=r===_.IMAGE?_.IMAGE:_.FILE;var u=e.getInfoFromCache();if(!pn&&(pn="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(pn=d.qiniu)}catch(e){}var f=U({domain:pn,getToken:function(t){e.getFileToken(s).then((function(e){t(e.token,e)})).catch((function(e){i.onFail(e)}))}},a);(s===_.IMAGE?Mn:yn)(f,(function(t){t.upload(e,n,o,{onProgress:function(e,t){var n,o=Math.floor(e/t*100);null===(n=i.onProgress)||void 0===n||n.call(i,o)},onCompleted:function(e){return P(c,void 0,void 0,(function(){return L(this,(function(t){return 1===(null==u?void 0:u.type)?function(e,t,n,o,r,i){var a={type:o.type,name:r.rc_url.file_name,downloadUrl:e.uploadDomain+r.rc_url.path};if(t===_.AUDIO)return void Pn(o).then((function(e){i.onSuccess(U(U({},a),e))}));t===_.IMAGE&&(a.thumbnail=r.thumbnail);i.onSuccess(a)}(n,r,0,o,e,i):function(e,t,n,o,r){bn(t,o.filename,o.name,o,o.uploadMethod).then((function(i){if(0===i.code){var a=i.data;a.type=n.type,a.name=o.name||o.filename,e!==_.AUDIO?(t===_.IMAGE&&(a.thumbnail=o.thumbnail),r.onSuccess(a)):Pn(n).then((function(e){r.onSuccess(U(U({},a),e))}))}else r.onFail(i)})).catch((function(e){r.onFail(e)}))}(r,s,o,e,i),[2]}))}))},onError:function(e){i.onFail(e)}})}))}function Pn(e){return new Promise((function(t){if("function"!=typeof e.arrayBuffer){var n=new FileReader;n.onload=function(){n.result?Ln(n.result).then((function(e){t(e)}),(function(){t({})})):t({})},n.onerror=function(){t({duration:0})},n.readAsArrayBuffer(e)}else e.arrayBuffer().then(Ln).then((function(e){t(e)}))}))}function Ln(e){return En=En||new AudioContext,new Promise((function(t,n){En.decodeAudioData(e,(function(e){t({duration:e.duration,length:e.length})}),n)}))}function wn(e,t,n,o){return Ie((function(i){return new Promise((function(a){i.getFileToken(e,t,n,o).then((function(e){a({code:r.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:Ue[e]})}))}))}))}function bn(e,t,n,o,i){return R("fileType",e,C,!0)&&R("filename",t,f.STRING)&&R("saveName",n,f.STRING)&&R("serverType",i,f.NUMBER)?Ie((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,o,i).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))})):Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER})}function Bn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(s){return[2,Ie((function(s,c){return P(o,void 0,void 0,(function(){var o,u,d,l,g,v,h,m,E,p,T,S,O;return L(this,(function(N){switch(N.label){case 0:return n=n||{},t instanceof Ft==!1?(c.warn(I.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,Me.ILLGAL_PARAMS]):R("conversation",e,f.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,R("conversation.targetId",u,f.STRING,!0)&&R("conversation.conversationType",o,f.NUMBER,!0)&&R("conversation.channelId",d,f.CHANNEL_ID)&&R("options.isStatusMessage",null==n?void 0:n.isStatusMessage,f.BOOLEAN)&&R("options.disableNotification",null==n?void 0:n.disableNotification,f.BOOLEAN)&&R("options.pushContent",null==n?void 0:n.pushContent,f.STRING)&&R("options.pushData",null==n?void 0:n.pushData,f.STRING)&&R("options.isMentioned",null==n?void 0:n.isMentioned,f.BOOLEAN)&&R("options.mentionedType",null==n?void 0:n.mentionedType,f.NUMBER)&&R("options.mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,f.ARRAY)&&R("options.directionalUserIdList",null==n?void 0:n.directionalUserIdList,f.ARRAY)&&R("options.isVoipPush",null==n?void 0:n.isVoipPush,f.BOOLEAN)&&R("options.canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,f.BOOLEAN)&&R("options.expansion",null==n?void 0:n.expansion,f.OBJECT)&&R("options.pushConfig",null==n?void 0:n.pushConfig,f.OBJECT)&&R("options.messageId",null==n?void 0:n.messageId,f.NUMBER)?(l="conversationType:".concat(o,",targetId:").concat(u),c.debug(I.O,"send message ->".concat(l)),g=function(e,t,n){var o=e.isStatusMessage,r=e.disableNotification,i=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,u=e.mentionedUserIdList,d=e.directionalUserIdList,f=e.isVoipPush,l=e.canIncludeExpansion,g=e.expansion,v=e.isFilerWhiteBlacklist,I=e.pushConfig,h=e.messageId,R=n.channelId;return U({isStatusMessage:o,disableNotification:r,pushContent:i,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:R||"",messageId:h},t)}(n,t,e),v={isMentioned:!!n.isMentioned,content:t.content,messageType:t.messageType,isPersited:t.isPersited||!1,isCounted:t.isCounted||!1,disableNotification:!!(null==n?void 0:n.disableNotification),canIncludeExpansion:!!(null==n?void 0:n.canIncludeExpansion),expansion:(null==n?void 0:n.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:s.getCurrentUserId(),messageUId:"",messageDirection:y.SEND,receivedTime:0,isStatusMessage:n.isStatusMessage||!1,receivedStatus:i.UNREAD,isOffLineMessage:!1,pushConfig:null==n?void 0:n.pushConfig},o!==a.ULTRA_GROUP&&(v.isOffLineMessage=!1),h=c.createTraceId(),m=function(e){v.messageId=e;try{(null==n?void 0:n.onSendBefore)&&n.onSendBefore(ie(v))}catch(e){c.error(I.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),h)}},c.info(I.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:o,targetId:u,channelId:d}),h),[4,s.sendMessage(o,u,g,m,h)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return E=N.sent(),p=E.code,T=E.data,S=p===r.SUCCESS?"info":"warn",c[S](I.A_SEND_MSG_R,JSON.stringify({code:p,messageUId:T?T.messageUId:"",messageId:T?T.messageId:""}),h),p===r.SUCCESS?(O=ie(T),[2,{code:p,data:O}]):(c.warn(I.O,"send message fail ->".concat(p,":").concat(Ue[p],",").concat(l)),v.sentTime=(null==T?void 0:T.sentTime)||0,[2,{code:p,msg:Ue[p],data:ie(v)}])}}))}))}))]}))}))}function Dn(e,t,n){return Bn(e,new Wt(t),n)}function Gn(e,t){return function(n,o,i,a){if(!R("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});var s={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var c=null==a?void 0:a.thumbnailConfig;if(!(R("sendOptions.maxHeight",null==c?void 0:c.maxHeight,f.NUMBER)&&R("sendOptions.maxWidth",null==c?void 0:c.maxWidth,f.NUMBER)&&R("sendOptions.quality",null==c?void 0:c.quality,f.NUMBER)&&R("sendOptions.scale",null==c?void 0:c.scale,f.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});s.thumbnailConfig=c}return Ie((function(c,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(I.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Un(c,0,d,o.file,e,{onProgress:null==i?void 0:i.onProgress,onSuccess:function(e){var s,c=(null===(s=null==i?void 0:i.onComplete)||void 0===s?void 0:s.call(i,{url:e.downloadUrl}))||t(e,o);e&&e.downloadUrl&&u.info(I.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:r.SUCCESS}),l),Bn(n,c,a).then(f)},onFail:function(e){u.warn(I.L_MEDIA_UPLOAD_R,JSON.stringify({code:r.UPLOAD_FILE_FAILED}),l),f({code:r.UPLOAD_FILE_FAILED,msg:e||r[r.UPLOAD_FILE_FAILED]})}},s)}))}))}}var xn=Gn(_.FILE,(function(e,t){return new jt({name:e.name,size:t.file.size,type:t.file.type,fileUrl:e.downloadUrl,user:t.user,extra:t.extra})})),Vn=Gn(_.IMAGE,(function(e,t){return new zt({content:e.thumbnail,imageUri:e.downloadUrl,user:t.user,extra:t.extra})})),kn=Gn(_.AUDIO,(function(e,t){return new Kt({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:t.user,extra:t.extra})})),Hn=Gn(_.SIGHT,(function(e,t){return new Yt({sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name,user:t.user,extra:t.extra})}));function Fn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&R("options.count",null==t?void 0:t.count,f.NUMBER)&&R("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&R("conversation",e,f.CONVERSATION,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n=i.createTraceId(),i.info(I.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ie(e)})),i.info(I.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageLength:u.length}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(I.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function qn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("options.timestamp",null==t?void 0:t.timestamp,f.NUMBER)&&R("options.count",null==t?void 0:t.count,f.NUMBER)&&R("options.order",null==t?void 0:t.order,(function(e){return 0===e||1===e}))&&R("conversation",e,f.CONVERSATION,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"get history message ->".concat(n)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(u=c.list.map((function(e){return ie(e)})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(i.warn(I.O,"get history message fail ->".concat(s,":").concat(Ue[s],",").concat(n)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zn(e,t,n,o){return P(this,void 0,void 0,(function(){var i=this;return L(this,(function(s){return R("targetId",e,f.STRING,!0)&&R("messageUId",t,f.STRING,!0)&&R("timestamp",n,f.NUMBER,!0)&&R("channelId",o,f.STRING)?[2,Ie((function(r){return P(i,void 0,void 0,(function(){var r,i,s,c,u;return L(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:a.PRIVATE,channelId:o},i=new Ft("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,Bn(r,i)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return R("messageUId",t,f.STRING,!0)&&R("targetId",e,f.STRING,!0)&&R("channelId",n,f.CHANNEL_ID)?[2,Ie((function(r,i){return P(o,void 0,void 0,(function(){var o,r,s,c,u;return L(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),i.debug(I.O,"send read receipt message ->".concat(o)),r=new Ft("RC:RRReqMsg",{messageUId:t}),[4,Bn({targetId:e,conversationType:a.GROUP,channelId:n},r)];case 1:return s=d.sent(),c=s.code,u=s.msg,0===c?[2,{code:c}]:[2,{code:c,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function zn(e,t,n){return P(this,void 0,void 0,(function(){return L(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Kn(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return R("targetId",e,f.STRING,!0)&&R("messageList",t,f.OBJECT,!0)&&R("channelId",n,f.CHANNEL_ID)&&!Object.keys(t).every((function(e){return!R(e,t[e],f.ARRAY)}))?[2,Ie((function(i,s){return P(o,void 0,void 0,(function(){var o,c,u,d,f,l,g;return L(this,(function(v){switch(v.label){case 0:return o={targetId:e,conversationType:a.GROUP,channelId:n},u=i.getInfoFromCache(),0!==(d=(null==u?void 0:u.grpRRVer)||0)?[3,2]:(f=new Ft("RC:RRRspMsg",{receiptMessageDic:t}),[4,Bn(o,f)]);case 1:return c=v.sent(),[3,4];case 2:return 1!==d?[3,4]:(l=[],Object.keys(t).forEach((function(e){t[e].forEach((function(e){-1===l.indexOf(e)&&l.push(e)}))})),l.length?[4,i.sendReadReceiptMessage(e,l,n)]:(s.warn(I.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 3:c=v.sent(),v.label=4;case 4:return(g=c.code)===r.SUCCESS?[2,{code:g}]:(s.warn(I.O,"send read receipt message fail ->".concat(g,":").concat(Ue[g])),[2,{code:g,msg:Ue[g]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Yn(e,t){return P(this,void 0,void 0,(function(){var n,o,i,a;return L(this,(function(s){switch(s.label){case 0:return R("conversation",e,f.CONVERSATION,!0)&&R("lastMessageSendTime",t,f.NUMBER,!0)?(n=new Ft("RC:SRSMsg",{lastMessageSendTime:t}),[4,Bn(e,n)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=s.sent(),i=o.code,a=o.msg,0===i?[2,{code:i}]:[2,{code:i,msg:a}]}}))}))}function Wn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("conversation",e,f.CONVERSATION,!0)&&R("options.messageUId",t.messageUId,f.STRING,!0)&&R("options.sentTime",t.sentTime,f.NUMBER,!0)&&R("options.disableNotification",null==t?void 0:t.disableNotification,f.BOOLEAN)&&R("options.pushConfig",null==t?void 0:t.pushConfig,f.OBJECT)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u;return L(this,(function(d){switch(d.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete},a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(t.messageUId),i.debug(I.O,"recall message ->".concat(a)),[4,o.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS&&u?[2,{code:c,data:ie(u)}]:c===r.SUCCESS?[2,{code:c}]:(i.warn(I.O,"recall message fail ->".concat(c,":").concat(Ue[c],",").concat(a)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Xn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("conversation",e,f.CONVERSATION,!0)&&R("options",t,(function(e){return l(e)&&e.length}),!0)&&!t.every((function(e){return!R("options.messageUId",e.messageUId,f.STRING,!0)||!R("options.sentTime",e.sentTime,f.NUMBER,!0)||!R("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"delete messages ->".concat(n)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"delete message fail ->".concat(a,":").concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("conversation",e,f.CONVERSATION,!0)&&R("timestamp",t,f.NUMBER,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a;return L(this,(function(s){switch(s.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),i.debug(I.O,"clear message ->".concat(n)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return(a=s.sent())!==r.SUCCESS?(i.warn(I.O,"clear message ->".concat(a,":").concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qn(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("expansion",e,f.OBJECT,!0)&&R("message",t,f.OBJECT,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l;return L(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.expansion,d=t.channelId,f="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),i.debug(I.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==r.SUCCESS?(i.warn(I.O,"update message expansion fail ->".concat(l,":").concat(Ue[l],",").concat(f)),[2,{code:l,msg:Ue[l]}]):[2,{code:l}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $n(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("keys",e,f.ARRAY,!0)&&R("message",t,f.OBJECT,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,u=t.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",messageUId:").concat(s),i.debug(I.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==r.SUCCESS?(i.warn(I.O,"remove message expansion fail ->".concat(f,":").concat(Ue[f],",").concat(d)),[2,{code:f,msg:Ue[f]}]):[2,{code:f}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function eo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("conversation",e,f.CONVERSATION,!0)&&R("typingContentType",t,f.STRING,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d;return L(this,(function(f){switch(f.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=i.createTraceId(),i.info(I.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,o.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=f.sent(),c=s.code,u=s.data,d=c===r.SUCCESS?"info":"warn",i[d](I.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:ie(u)}]:[2,{code:c,msg:Ue[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return R("messageUId",t,f.STRING,!0)&&R("targetId",e,f.STRING,!0)&&R("channelId",n,f.STRING)?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o,s,c,u;return L(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(t,",targetId:").concat(e),a.debug(I.O,"get message reader ->".concat(o)),[4,i.getMessageReader(e,t,n)];case 1:return s=d.sent(),c=s.code,u=s.data,c===r.SUCCESS?[2,{code:c,data:u}]:(a.warn(I.O,"get message reader fail ->".concat(c,":").concat(Ue[c],",").concat(o)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function no(e,t,n,o,r){return ve((function(i,a){return d("messageType",e,f.STRING,!0),d("isPersited",t,f.BOOLEAN,!0),d("isCounted",n,f.BOOLEAN,!0),d("isStatusMessage",r,f.BOOLEAN,!1),d("searchProps",o,f.ARRAY),a.info(I.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:r,isPersited:t})),i.registerMessageType(e,t,n,o,r),qt(e,t,n)}))}function oo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?R("conversation",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return[4,n.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:(o.warn(I.O,"insertMessage ->code:".concat(i,",targetId:").concat(e.targetId)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function ro(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return se("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),A()?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,h,R,m,E,p,T,S;return L(this,(function(O){switch(O.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,d=t.messageUId,f=t.canIncludeExpansion,l=t.expansion,g=t.disableNotification,v=t.sentTime,h=t.sentStatus,a.info(I.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),R=n.isUnread,m=n.searchContent,E={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:v,sentStatus:h,searchContent:m,isUnread:R,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,E)];case 1:return p=O.sent(),T=p.code,S=p.data,T===r.SUCCESS?[2,{code:T,data:ie(S)}]:(a.warn(I.O,"insertMessage ->code:".concat(T,",targetId:").concat(e.targetId)),[2,{code:T,msg:Ue[T]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function io(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return[4,n.getMessage(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:ie(a)}]:(o.warn(I.O,"getMessage ->code:".concat(i,",messageId:").concat(e)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function ao(e){if(!A())return{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]};var t,n=e.conversationType,o=e.targetId,i=e.channelId;return R("conversation",e,f.CONVERSATION,!0)?(t=function(e){var t=e.getUnreadMentionedMessages(n,o,i),a=[];return t&&t.length&&t.forEach((function(e){return a.push(ie(e))})),{code:r.SUCCESS,data:a}},de?t(de,le,fe):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function so(e,t,n,o){return P(this,void 0,void 0,(function(){var i=this;return L(this,(function(a){return se("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),A()?R("conversation",e,f.CONVERSATION,!0)&&R("keyword",t,f.STRING,!0)&&R("timestamp",n,f.NUMBER)&&R("count",o,f.NUMBER)?[2,Ie((function(a,s){return P(i,void 0,void 0,(function(){var i,c,u,d;return L(this,(function(f){switch(f.label){case 0:return 1,[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,o,1,e.channelId)];case 1:return i=f.sent(),c=i.code,u=i.data,c===r.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(ie(e))})),[2,{code:c,data:{messages:d,count:null==u?void 0:u.count}}]):(s.warn(I.O,"searchMessages ->code:".concat(c,",targetId:").concat(e.targetId)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function co(e,t,n){return P(this,void 0,void 0,(function(){var o,i,a,s=this;return L(this,(function(c){return se("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),A()?(o=e.conversationType,i=e.targetId,a=e.channelId,R("conversationType",o,f.NUMBER,!0)&&R("targetId",i,f.STRING,!0)&&R("timestamp",t,f.NUMBER,!0)&&R("cleanSpace",n,f.BOOLEAN)?[2,Ie((function(c,u){return P(s,void 0,void 0,(function(){var s;return L(this,(function(d){switch(d.label){case 0:return[4,c.deleteMessagesByTimestamp(o,i,t,n,a)];case 1:return s=d.sent(),u.debug(I.A_DELETE_MESSAGES_S,JSON.stringify({code:s,conversationType:o,targetId:i,channelId:a,timestamp:t})),s===r.SUCCESS?[2,{code:s}]:(u.warn(I.O,"deleteLocalMessagesByTimestamp ->code:".concat(s,",targetId:").concat(e.targetId)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function uo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return se("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),A()?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return t=e.conversationType,i=e.targetId,a=e.channelId,o.info(I.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(t)),[4,n.clearMessages(t,i,a)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(I.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function fo(e,t,n,o){return P(this,void 0,void 0,(function(){var i=this;return L(this,(function(a){return se("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),A()?[2,Ie((function(a,s){return P(i,void 0,void 0,(function(){var i,c,u;return L(this,(function(d){switch(d.label){case 0:return s.info(I.O,"searchConversationByContent ->keyword:".concat(e)),[4,a.searchConversationByContent(e,n,o,t)];case 1:return i=d.sent(),c=i.code,u=i.data,c===r.SUCCESS?[2,{code:c,data:u}]:(s.warn(I.O,"searchConversationByContent ->code:".concat(c,",keyword:").concat(e)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function lo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("timestamp",t,f.NUMBER)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c;return L(this,(function(u){switch(u.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,i.info(I.O,"clearUnreadCountByTimestamp ->targetId:".concat(a,",conversationType:").concat(n)),[4,o.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return(c=u.sent())===r.SUCCESS?[2,{code:c}]:(i.warn(I.O,"clearUnreadCountByTimestamp ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function go(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return se("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),A()?R("messageId",e,f.NUMBER,!0)&&R("receivedStatus",t,f.NUMBER,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n;return L(this,(function(a){switch(a.label){case 0:return i.info(I.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return(n=a.sent())===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"setMessageReceivedStatus ->code:".concat(n,",messageId:").concat(e)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function vo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("tag.tagId",e.tagId,f.STRING,!0)&&R("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&R("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&R("tag.tagName",e.tagName,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(i){switch(i.label){case 0:return o.info(I.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.createTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"createTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Io(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("tagId",e,f.STRING,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(i){switch(i.label){case 0:return o.info(I.O,"removeTag ->tagId:".concat(e)),[4,n.removeTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"removeTag ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("tag.tagId",e.tagId,f.STRING,!0)&&R("tag.tagName",e.tagName,f.STRING,!0)&&R("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t;return L(this,(function(i){switch(i.label){case 0:return o.info(I.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,n.updateTag(e)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(o.warn(I.O,"updateTag ->code:".concat(t,",tagId:").concat(e.tagId)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,i;return L(this,(function(a){switch(a.label){case 0:return[4,t.getTagList()];case 1:return e=a.sent(),o=e.code,i=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(n.warn(I.O,"getTagList ->code:".concat(o)),[2,{code:o,msg:Ue[o]}])}}))}))}))]}))}))}function mo(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return R("conversation",e,f.CONVERSATION,!0)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a;return L(this,(function(s){switch(s.label){case 0:return o.info(I.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,n.getTagsForConversation(e)];case 1:return t=s.sent(),i=t.code,a=t.data,i===r.SUCCESS?[2,{code:i,data:a}]:[2,{code:i,msg:Ue[i]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("tagId",e,f.STRING,!0)&&R("conversations",t,f.ARRAY,!0)&&!t.every((function(e){return!R("conversation",e,f.CONVERSATION,!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n;return L(this,(function(a){switch(a.label){case 0:return i.info(I.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"addTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("tagId",e,f.STRING,!0)&&R("conversations",t,f.ARRAY,!0)&&!t.every((function(e){return!R("conversation",e,f.CONVERSATION,!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n;return L(this,(function(a){switch(a.label){case 0:return i.info(I.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("conversation",e,f.CONVERSATION,!0)&&R("tagIds",t,f.ARRAY,!0)&&!t.every((function(e){return!R("tagId",e,f.STRING,!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n;return L(this,(function(a){switch(a.label){case 0:return i.info(I.O,"removeTagsForConversation ->tagIds:".concat(t,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"removeTagsForConversation ->code:".concat(n,",tagIds:").concat(t)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("tagId",e,f.STRING,!0)&&R("conversations",t,f.ARRAY,!0)&&!t.every((function(e){return!R("conversation",e,f.CONVERSATION,!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n;return L(this,(function(a){switch(a.label){case 0:return i.info(I.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,t)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(i.warn(I.O,"removeTagForConversations ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return R("tagId",e,f.STRING,!0)&&R("count",t,f.NUMBER,!0)&&R("startTime",n,f.NUMBER,!0)?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o,s,c;return L(this,(function(u){switch(u.label){case 0:return a.info(I.O,"getConversationListByTag ->tagId:".concat(e)),[4,i.getConversationListByTag(e,n,t)];case 1:return o=u.sent(),s=o.code,c=o.data,s===r.SUCCESS?[2,{code:s,data:c}]:(a.warn(I.O,"getConversationListByTag ->code:".concat(s,",tagId:").concat(e)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return R("tagId",e,f.STRING,!0)&&R("containMuted",t,f.BOOLEAN,!0)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s;return L(this,(function(c){switch(c.label){case 0:return i.info(I.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(i.warn(I.O,"getUnreadCountByTag ->code:".concat(a,",tagId:").concat(e)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return R("tagId",e,f.STRING,!0)&&R("conversation",t,f.CONVERSATION,!0)&&R("status.isTop",n,f.BOOLEAN,!0)?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o;return L(this,(function(s){switch(s.label){case 0:return a.info(I.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(t.targetId,",conversationType").concat(t.conversationType)),[4,i.setConversationStatusInTag(e,t,{isTop:n})];case 1:return(o=s.sent().code)===r.SUCCESS?[2,{code:o}]:(a.warn(I.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Ue[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}Gn(_.COMBINE_HTML,(function(e,t){return new Xt({remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType,user:t.user,extra:t.extra})}));var _o={COMET:"comet",WEBSOCKET:"websocket"},Ao={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var yo=Object.freeze({__proto__:null,getAllConversationList:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?R("channelId",e,f.ONLY_STRING)?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return o.info(I.O,"getAllConversationList -> channelId: ".concat(e)),M(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return t=c.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:t=c.sent(),c.label=4;case 4:return i=t.code,a=t.data,i===r.SUCCESS&&a?(s=a.map((function(e){return ae(e)})),[2,{code:i,data:s}]):(o.warn(I.O,"getAllConversationList fail -> code: ".concat(i," channelId: ").concat(e)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n){return P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return A()?R("startTime",e,f.NUMBER,!0)&&R("count",t,f.NUMBER,!0)&&R("channelId",n,f.ONLY_STRING)?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(t,", channelId: ").concat(n),a.info(I.O,"getConversationList -> ".concat(o)),M(n)?[4,i.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return c=[1,2,3,5,6,7,8],[4,i.getConversationsByPage(c,e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return u=s.code,d=s.data,u===r.SUCCESS&&d?(f=d.map((function(e){return ae(e)})),[2,{code:u,data:f}]):(a.warn(I.O,"getConversationList fail -> code: ".concat(u," ").concat(o)),[2,{code:u,msg:Ue[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function e(t,n,o){return P(this,void 0,void 0,(function(){var i=this;return L(this,(function(a){return A()?R("keyword",t,f.STRING,!0)&&R("messageTypes",n,f.ARRAY,!0)&&R("channelId",o,f.ONLY_STRING)&&!n.every((function(e){return!R("messageType",e,f.STRING,!0)}))?[2,Ie((function(a,s){return P(i,void 0,void 0,(function(){var i,c,u,d,f;return L(this,(function(l){switch(l.label){case 0:return i="keyword: ".concat(t,", messageTypes: ").concat(JSON.stringify(n),", channelId: ").concat(o),s.info(I.O,"searchConversationByContent -> ".concat(e)),M(o)?[4,a.searchConversationByContentWithAllChannel(t,n)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return[4,a.searchConversationByContent(t,n,o)];case 3:c=l.sent(),l.label=4;case 4:return u=c.code,d=c.data,u===r.SUCCESS&&d?(f=d.map((function(e){return ae(e)})),[2,{code:u,data:f}]):(s.warn(I.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(i)),[2,{code:u,msg:Ue[u]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,o){return P(this,void 0,void 0,(function(){var i=this;return L(this,(function(a){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("keyword",t,f.STRING,!0)&&R("startTime",n,f.NUMBER,!0)&&R("count",o,f.NUMBER,!0)?[2,Ie((function(a,s){return P(i,void 0,void 0,(function(){var i,c,u,d,f,l,g,v,h,R;return L(this,(function(m){switch(m.label){case 0:return i="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(t,", timestamp: ").concat(n,", count: ").concat(o),s.info(I.O,"searchMessages -> ".concat(i)),c=e.targetId,u=e.conversationType,d=e.channelId,M(d)?[4,a.searchMessageByContentWithAllChannel(u,c,t,n,o)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return 0,[4,a.searchMessageByContent(u,c,t,n,o,0,d)];case 3:f=m.sent(),m.label=4;case 4:return l=f.code,g=f.data,l===r.SUCCESS&&g?(v=g.messages,h=g.count,R=v.map((function(e){return ie(e)})),[2,{code:l,data:{messages:R,count:h}}]):(s.warn(I.O,"searchMessages fail -> code: ".concat(l," ").concat(i)),[2,{code:l,msg:Ue[l]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("option",t,f.OBJECT,!0)&&R("option.keyword",t.keyword,f.STRING,!0)&&R("option.startTime",t.startTime,f.NUMBER,!0)&&R("option.endTime",t.endTime,f.NUMBER,!0)&&R("option.offset",t.offset,f.NUMBER)&&R("option.limit",t.limit,f.NUMBER)?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v,h;return L(this,(function(R){switch(R.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(I.O,"searchMessageInTimeRange -> ".concat(n)),a=e.conversationType,s=e.targetId,c=t.keyword,u=t.startTime,d=t.endTime,f=t.offset,l=t.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(a,s,c,u,d,f,l)];case 1:return g=R.sent(),v=g.code,h=g.data,v===r.SUCCESS&&h?[2,{code:v,data:{messages:h.messages.map((function(e){return ie(e)}))}}]:(i.warn(I.O,"searchMessageInTimeRange fail -> code: ".concat(v,", ").concat(n)),[2,{code:v}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("option",t,f.OBJECT,!0)&&R("option.count",t.count,f.NUMBER)&&R("option.timestamp",t.timestamp,f.NUMBER)&&R("option.order",t.order,(function(e){return[0,1].includes(e)}))&&R("option.messageTypes",t.messageTypes,f.ARRAY,!0)&&!t.messageTypes.every((function(e){return!R("option.messageType",e,f.STRING,!0)}))?[2,Ie((function(o,i){return P(n,void 0,void 0,(function(){var n,a,s,c,u,d,f,l,g,v,h,R,m,E,p;return L(this,(function(T){switch(T.label){case 0:return n=t.count,a=t.timestamp,s=t.order,c=t.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(t)),i.info(I.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,n||(n=20),a||(a=0),s||(s=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,a,n,c,s,l)];case 1:return g=T.sent(),v=g.code,h=g.data,v===r.SUCCESS?(m=(R=h).list,E=R.hasMore,p=m.map((function(e){return ie(e)})),[2,{code:v,data:{messages:p,hasMore:E}}]):(i.warn(I.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(v," ").concat(u)),[2,{code:v,msg:Ue[v]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("timestamp",t,f.NUMBER,!0)?[2,Ie((function(o,r){return P(n,void 0,void 0,(function(){var n,i,a,s;return L(this,(function(c){switch(c.label){case 0:return n="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(t),r.info(I.O,"updateSentMsgReceiptStatus -> ".concat(n)),i=e.conversationType,a=e.targetId,s=e.channelId,[4,o.setMessageStatusToRead(i,a,t,s)];case 1:return[2,c.sent()]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("messageId",e,f.NUMBER,!0)&&R("receivedStatus",t,(function(e){return!M(i[e])}),!0)?[2,Ie((function(o,r){return P(n,void 0,void 0,(function(){return L(this,(function(n){switch(n.label){case 0:return r.info(I.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(t)),[4,o.setMessageReceivedStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return P(this,void 0,void 0,(function(){var n=this;return L(this,(function(o){return A()?R("messageId",e,f.NUMBER,!0)&&R("sentStatus",t,(function(e){return!M(D[e])}),!0)?[2,Ie((function(o,r){return P(n,void 0,void 0,(function(){return L(this,(function(n){switch(n.label){case 0:return r.info(I.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(t)),[4,o.setMessageSentStatus(e,t)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return A()?R("messageId",e,f.NUMBER,!0)&&R("content",t,f.OBJECT,!0)&&R("messageType",n,f.ONLY_STRING,!0)?[2,Ie((function(r,i){return P(o,void 0,void 0,(function(){return L(this,(function(o){switch(o.label){case 0:return i.info(I.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(n)),[4,r.setMessageContent(e,t,n)];case 1:return[2,{code:o.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?!R("messageIds",e,f.ARRAY,!0)||e.every((function(e){return!R("messageId",e,f.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){return L(this,(function(t){switch(t.label){case 0:return o.info(I.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,n.deleteMessages(e)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return P(this,void 0,void 0,(function(){var t=this;return L(this,(function(n){return A()?[2,Ie((function(n,o){return P(t,void 0,void 0,(function(){var t,i,a,s;return L(this,(function(c){switch(c.label){case 0:return t=e.conversationType,i=e.targetId,a=e.channelId,o.info(I.O,"clearMessages ->targetId:".concat(i,",conversationType:").concat(t)),[4,n.clearMessages(t,i,a)];case 1:return(s=c.sent())===r.SUCCESS?[2,{code:s}]:(o.warn(I.O,"clearMessages ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return P(this,void 0,void 0,(function(){var o,i,a,s=this;return L(this,(function(c){return A()?(o=e.conversationType,i=e.targetId,a=e.channelId,R("conversationType",o,f.NUMBER,!0)&&R("targetId",i,f.STRING,!0)&&R("timestamp",t,f.NUMBER,!0)&&R("cleanSpace",n,f.BOOLEAN)?[2,Ie((function(e,c){return P(s,void 0,void 0,(function(){var s;return L(this,(function(u){switch(u.label){case 0:return[4,e.deleteMessagesByTimestamp(o,i,t,n,a)];case 1:return(s=u.sent())===r.SUCCESS?[2,{code:s}]:(c.warn(I.O,"deleteMessagesByTimestamp ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),P(this,void 0,void 0,(function(){var o=this;return L(this,(function(i){return A()?R("conversation",e,f.CONVERSATION,!0)&&R("message",t,f.OBJECT,!0)&&R("options",n,f.OBJECT)&&R("message.senderUserId",t.senderUserId,f.STRING,!0)&&R("message.messageType",t.messageType,f.STRING,!0)&&R("message.content",t.content,f.OBJECT,!0)&&R("message.messageDirection",t.messageDirection,f.NUMBER,!0)&&R("message.canIncludeExpansion",t.canIncludeExpansion,f.BOOLEAN,!0)&&R("message.expansion",t.expansion,f.OBJECT)&&R("message.disableNotification",t.disableNotification,f.BOOLEAN)&&R("message.sentTime",t.sentTime,f.NUMBER,!0)&&R("message.sentStatus",t.sentStatus,f.NUMBER,!0)&&R("options.sentStatus",null==n?void 0:n.isUnread,f.BOOLEAN)&&R("options.searchContent",null==n?void 0:n.searchContent,f.STRING)?[2,Ie((function(i,a){return P(o,void 0,void 0,(function(){var o,s,c,u,d,f,l,g,v,h,R,m,E,p,T;return L(this,(function(S){switch(S.label){case 0:return o=t.senderUserId,s=t.messageType,c=t.content,u=t.messageDirection,t.messageUId,d=t.canIncludeExpansion,f=t.expansion,l=t.disableNotification,g=t.sentTime,v=t.sentStatus,a.info(I.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=n.isUnread,R=n.searchContent,m={senderUserId:o,messageType:s,content:c,messageDirection:u,sentTime:g,sentStatus:v,searchContent:R,isUnread:h,messageUId:"",disableNotification:l,canIncludeExpansion:d,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,i.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=S.sent(),p=E.code,T=E.data,p===r.SUCCESS?[2,{code:p,data:ie(T)}]:(a.warn(I.O,"insertMessage ->code:".concat(p,",targetId:").concat(e.targetId)),[2,{code:p,msg:Ue[p]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return P(this,void 0,void 0,(function(){var e=this;return L(this,(function(t){return A()?[2,Ie((function(t,n){return P(e,void 0,void 0,(function(){var e,o,r;return L(this,(function(i){switch(i.label){case 0:return n.info(I.O,"clearLocalData ->"),[4,t.clearData()];case 1:return e=i.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}}),Mo=function(e,t,n){this.type=e,this.userIdList=t,this.mentionedContent=n};export{Ft as BaseMessage,Xt as CombineMessage,_o as ConnectType,B as Events,jt as FileMessage,Qt as GIFMessage,Kt as HQVoiceMessage,zt as ImageMessage,en as LocationMessage,Mo as MentionedInfoBody,Ao as MessageType,tn as ReferenceMessage,nn as RichContentMessage,D as SentStatus,Yt as SightMessage,Wt as TextMessage,$t as VoiceMessage,_e as __addSDKVersion,Eo as addConversationsToTag,he as addEventListener,vo as addTag,xt as addToBlacklist,Gt as bindRTCRoomForChatroom,ze as clearAllMessagesUnreadStatus,pe as clearEventListeners,jn as clearHistoryMessages,uo as clearMessages,Je as clearMessagesUnreadStatus,ke as clearTextMessageDraft,lo as clearUnreadCountByTimestamp,we as connect,co as deleteLocalMessagesByTimestamp,Xn as deleteMessages,Se as destroy,be as disconnect,yo as electronExtension,wt as forceRemoveChatRoomEntry,Ut as forceSetChatRoomEntry,Bt as getAllChatRoomEntries,it as getAllConversationState,mt as getAllUltraGroupUnreadCount,Et as getAllUltraGroupUnreadMentionedCount,rt as getAllUnreadMentionedCount,kt as getBlacklist,Ht as getBlacklistStatus,st as getBlockUltraGroupList,$e as getBlockedConversationList,bt as getChatRoomEntry,At as getChatRoomInfo,Dt as getChatroomHistoryMessages,Oe as getConnectionStatus,De as getConversation,Be as getConversationList,je as getConversationNotificationLevel,Qe as getConversationNotificationStatus,Oo as getConversationsFromTagByPage,Ce as getCurrentUserId,Ae as getDeviceId,wn as getFileToken,bn as getFileUrl,oo as getFirstUnreadMessage,Fn as getHistoryMessages,io as getMessage,to as getMessageReader,qn as getRemoteHistoryMessages,Ne as getServerTime,Ro as getTags,mo as getTagsFromConversation,xe as getTextMessageDraft,nt as getTopConversationList,He as getTotalUnreadCount,Fe as getTotalUnreadCountByLevels,qe as getTotalUnreadMentionedCountByLevels,It as getUltraGroupDefaultNotificationLevel,Tt as getUltraGroupFirstUnreadMessageTimestamp,at as getUltraGroupList,ut as getUltraGroupMessageListByMessageUId,Rt as getUltraGroupUnreadCountByTargetId,vt as getUltraGroupUnreadMentionedCountByTargetId,pt as getUltraGroupUnreadMentionedMessages,Ze as getUnreadCount,No as getUnreadCountByTag,ot as getUnreadMentionedCount,ao as getUnreadMentionedMessages,Te as init,ro as insertMessage,ye as installPlugin,Nt as joinChatRoom,Ct as joinExistChatRoom,gt as modifyMessage,Re as onceEventListener,_t as quitChatRoom,Wn as recallMessage,no as registerMessageType,lt as removeAllExpansionForUltraGroupMessage,Lt as removeChatRoomEntries,Pt as removeChatRoomEntry,Ge as removeConversation,po as removeConversationsFromTag,me as removeEventListener,Ee as removeEventListeners,ft as removeExpansionForUltraGroupMessage,Vt as removeFromBlacklist,$n as removeMessageExpansionForKey,Io as removeTag,So as removeTagFromConversations,To as removeTagsFromConversation,Ve as saveTextMessageDraft,fo as searchConversationByContent,so as searchMessages,xn as sendFileMessage,kn as sendHQVoiceMessage,Vn as sendImageMessage,Bn as sendMessage,Zn as sendReadReceiptMessage,Jn as sendReadReceiptRequest,zn as sendReadReceiptResponse,Kn as sendReadReceiptResponseV2,Hn as sendSightMessage,Yn as sendSyncReadStatusMessage,Dn as sendTextMessage,eo as sendTypingStatusMessage,ct as sendUltraGroupTypingStatus,Mt as setChatRoomEntries,yt as setChatRoomEntry,We as setConversationNotificationLevel,Xe as setConversationNotificationStatus,et as setConversationToTop,Co as setConversationToTopInTag,go as setMessageReceivedStatus,ht as setUltraGroupDefaultNotificationLevel,dt as updateExpansionForUltraGroupMessage,Qn as updateMessageExpansion,ho as updateTag};