@rongcloud/imlib-next 5.6.0-beem → 5.6.0-beem-enterprise

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 n,HTTP_TIMEOUT as t,appendUrl as o,ErrorCode as r,ReceivedStatus as a,ConversationType as i,isNumber as c,EventEmitter as s,VersionManage as u,assert as d,isArray as f,isHttpUrl as l,APIContext as g,LogTagId as v,logger as I,validate as h,AssertRules as R,isValidConversationType as p,isValidNotificationLevel as m,NotificationLevel as E,UltraGroupChannelType as T,isString as S,getUUID as O,UploadMethod as N,isValidFileType as _,FileType as C,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 n,t=1,o=arguments.length;t<o;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},U.apply(this,arguments)};function L(e,n,t,o){return new(t||(t=Promise))((function(r,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function c(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(i,c)}s((o=o.apply(e,n||[])).next())}))}function P(e,n){var t,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=n.call(e,i)}catch(e){a=[6,e],o=0}finally{t=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}var w=function(){return!("undefined"==typeof uni||!function(e){for(var n=["request","getSystemInfo"],t=0,o=n.length;t<o;t++)if(!e[n[t]])return!1;return!0}(uni))},b=w();var D,B,G={tag:"browser",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,i=e.headers,c=e.query,s=e.body,u=o(e.url,c);return new Promise((function(e){var n,t=(n="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&n?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),o="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(r,u),i&&t.setRequestHeader)for(var c in i)t.setRequestHeader(c,i[c]);if(o){t.timeout=a,t.onload=function(){e({data:t.responseText,status:t.status||200})},t.onerror=function(){e({status:t.status||0})},t.ontimeout=function(){e({status:t.status||0})};var d="object"==typeof s?JSON.stringify(s):s;t.send(d)}else t.onreadystatechange=function(){4===t.readyState&&e({data:t.responseText,status:t.status})},t.onerror=function(){e({status:t.status||0})},setTimeout((function(){t.abort(),e({status:t.status||0})}),a),t.send(s)}))},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,n){var t=new WebSocket(e,n);return t.binaryType="arraybuffer",{onClose:function(e){t.onclose=function(n){var t=n.code,o=n.reason;e(t,o)}},onError:function(e){t.onerror=e},onMessage:function(e){t.onmessage=function(n){e(n.data)}},onOpen:function(e){t.onopen=e},send:function(e){t.send(e)},close:function(e,n){t.close()}}},getNetworkType:function(){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t=n.type,o=n.effectiveType,r=t||o||e.UNKONWN;return new Promise((function(e){e(r)}))}},x=w(),k=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return wx[e].apply(wx,n)}catch(e){null===console||void 0===console||console.error(e)}}},H={setItem:k("setStorageSync"),getItem:k("getStorageSync"),removeItem:k("removeStorageSync"),clear:k("clearStorageSync")},V={tag:"wechat",httpReq:function(e){var a=e.method||n.GET,i=e.timeout||t,c=e.headers,s=e.query,u=e.body,d=o(e.url,s);return new Promise((function(e){wx.request({url:d,method:a,header:c,timeout:i,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:H,sessionStorage:H,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,createWebSocket:function(e,n){var t=wx.connectSocket({url:e,protocols:n});return{onClose:function(e){t.onClose((function(n){e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){e(n.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){wx.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},F=w(),q=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{if("setStorageSync"===e)return my[e]({key:n[0],data:JSON.parse(n[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:n[0]});var o=my[e]({key:n[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},Z={setItem:q("setStorageSync"),getItem:q("getStorageSync"),removeItem:q("removeStorageSync"),clear:q("clearStorageSync")},J={tag:"alipay",httpReq:function(e){var a=e.method||n.GET,i=e.timeout||t,c=e.headers,s=e.query,u=e.body,d=o(e.url,s),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:a,headers:c,timeout:i,data:u,dataType:f,success:function(n){e({data:n.data,status:n.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(n){e(n.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(n){n.isBuffer?e(my.base64ToArrayBuffer(n.data)):e(n.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(n){my.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},z=w(),K=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return tt[e].apply(tt,n)}catch(e){}}},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(n){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,n){var t=tt.connectSocket({url:e,protocols:n});return{onOpen:function(e){t.onOpen(e)},onClose:function(e){t.onClose((function(n){return e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){return e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){return e(n.data)}))},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){tt.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},X=w(),j=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return swan[e].apply(swan,n)}catch(e){}}},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(n,t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,n){var t=swan.connectSocket({url:e,protocols:n});return{onOpen:function(e){t.onOpen(e)},onClose:function(e){t.onClose((function(n){return e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){return e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){return e(n.data)}))},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return L(this,void 0,void 0,(function(){return P(this,(function(n){return[2,new Promise((function(n){swan.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))]}))}))}},ee=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return uni[e].apply(uni,n)}catch(e){null===console||void 0===console||console.error(e)}}},ne={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},te={tag:"uniapp",httpReq:function(e){var a=e.method||n.GET,i=e.timeout||t,c=e.headers,s=e.query,u=e.body,d=o(e.url,s);return new Promise((function(e){uni.request({url:d,method:a,header:c,timeout:i,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ne,sessionStorage:ne,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,n){var t={complete:function(){},url:e,protocols:n},o=uni.connectSocket(t);return{onClose:function(e){o.onClose((function(n){e(n.code,n.reason)}))},onError:function(e){o.onError((function(n){e(n.errMsg)}))},onMessage:function(e){o.onMessage((function(n){e(n.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,n){o.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){uni.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},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 te;case"mp-baidu":return $;case"mp-toutiao":return W;case"mp-alipay":return J;case"mp-weixin":return V;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)?V:G;function ae(e){var n=e.conversationType,t=e.channelId,o=e.messageType,r=e.content,s=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,p=e.expansion,m=e.receivedStatus,E=e.disableNotification,T=e.isMentioned,S=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;m||(m=a.UNREAD);var U={messageType:o,channelId:t||"",content:r,senderUserId:s,targetId:u,conversationType:n,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:E,isStatusMessage:S,canIncludeExpansion:R,expansion:p,receivedStatus:m,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return n!==i.ULTRA_GROUP&&(U.isOffLineMessage=h),n===i.ULTRA_GROUP&&c(y)&&(U.channelType=y),U}function ie(e){var n=e.conversationType,t=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,a=e.hasMentioned,i=e.mentionedInfo,c=e.lastUnreadTime,s=e.notificationStatus,u=e.notificationLevel,d=e.isTop,f=e.channelId,l=e.unreadMentionedCount;return{conversationType:n,targetId:t,latestMessage:o&&ae(o),unreadMessageCount:r,hasMentioned:a,mentionedInfo:a?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:c,notificationStatus:s,notificationLevel:u,isTop:d,channelId:f,unreadMentionedCount:l}}function ce(e,n){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(n,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED"}(D||(D={})),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"}(B||(B={}));var se=new s,ue={onConnecting:function(){se.emit(D.CONNECTING)},onConnected:function(){se.emit(D.CONNECTED)},onDisconnect:function(e){se.emit(D.DISCONNECT,e)},onSuspend:function(e){se.emit(D.SUSPEND,e)},batchMessage:function(e){se.emit(D.MESSAGES,{messages:e.map((function(e){return ae(e)}))})},typingState:function(e){se.emit(D.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,n,t){se.emit(D.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:n,sentTime:t})},messageReceiptRequest:function(e,n,t){se.emit(D.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:n,senderUserId:t})},messageReceiptResponse:function(e,n,t){se.emit(D.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:n,messageUIdList:t})},conversationState:function(e){var n=e.map((function(e){var n=e.conversationType,t={conversationType:n,latestMessage:e.latestMessage?ae(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return n===i.ULTRA_GROUP?(t.versionTime=e.versionTime,{conversation:t}):(t.hasMentioned=e.hasMentioned,t.mentionedInfo=e.mentionedInfo,t.isTop=e.isTop,{conversation:t,updatedItems:e.updatedItems})}));se.emit(D.CONVERSATION,{conversationList:n})},chatroomState:function(e){se.emit(D.CHATROOM,e)},expansion:function(e){se.emit(D.EXPANSION,e)},pullFinished:function(){se.emit(D.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){se.emit(D.TAG)},conversationTagChanged:function(){se.emit(D.CONVERSATION_TAG)},messageBlocked:function(e){se.emit(D.MESSAGE_BLOCKED,e)},ultraGroupEnable:function(e){se.emit(D.ULTRA_GROUP_ENABLE,e)},operateStatus:function(e){se.emit(D.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){se.emit(D.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e)},ultraGroupMessageModified:function(e){se.emit(D.ULTRA_GROUP_MESSAGE_MODIFIED,e)},ultraGroupMessageRecalled:function(e){se.emit(D.ULTRA_GROUP_MESSAGE_RECALLED,e)},ultraGroupChannelChangeType:function(e){se.emit(D.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){se.emit(D.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){se.emit(D.ULTRA_GROUP_CHANNEL_DELETE,e)}};u.add("imlib-next","5.6.0-beem");var de=null,fe=null,le=null;function ge(){return L(this,void 0,void 0,(function(){return P(this,(function(e){switch(e.label){case 0:return de?(le.info(v.A_DESTROY_O),[4,g.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,n,t){se.on(e,n,t)}function Re(e,n,t){se.once(e,n,t)}function pe(e,n,t){se.off(e,n,t)}function me(e){se.removeAll(e)}function Ee(){se.clear()}function Te(e){!function(e){var n=e.appkey,t=e.navigators;de?le.warn(v.A_INIT_REPEAT_O):(d("options.navigators",e.navigators,(function(e){return f(e)&&(0===e.length||e.every(l))})),fe=e,de=g.init(re,{appkey:e.appkey,apiVersion:"5.6.0-beem",navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,checkCA:e.checkCA,httpInMainProcess:!!e.httpInMainProcess}),(le=de.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),le.info(v.A_INIT_O,JSON.stringify({appkey:n,navigators:t,version:"5.6.0-beem",commit:"57efb06c458b49111c091895c5758817d00ce033"})),de.assignWatcher(ue))}(e)}function Se(){return L(this,void 0,void 0,(function(){return P(this,(function(e){return de?(Ee(),[2,ge()]):[2]}))}))}function Oe(){return ve((function(e){return e.getConnectionStatus()}))}function Ne(){return ve((function(e){return e.getServerTime()}))}function _e(){return ve((function(e){return e.getCurrentUserId()}))}function Ce(e,n){u.add(e,n)}function Ae(){return ve((function(e){return e.getDeviceId()}))}function ye(e,n){return ve((function(t){return t.install(e,n)}))}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 Le in Me){var Pe=Me[Le].code;Ue[Pe]=Le}function we(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return h("token",e,R.STRING,!0)&&h("reconnectKickEnable",n,R.BOOLEAN)?(t=a.createTraceId(),a.info(v.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:n}),t),[4,o.connect(e,!1,n,t)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return i=s.sent(),c=i.code===r.SUCCESS?"info":"warn",a[c](v.A_CONNECT_R,JSON.stringify({code:i.code,userId:i.userId}),t),i.code===r.SUCCESS?[2,{code:i.code,data:{userId:i.userId}}]:[2,{code:i.code,msg:Ue[i.code]}]}}))}))}))]}))}))}function be(){return I.info(v.A_DISCONNECT_O,{}),ve((function(e){return e.disconnect()}))}function De(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,n)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return ie(e)}))}]:(a.warn(v.O,"get conversation list fail ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function Be(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return[4,t.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return n=c.sent(),a=n.code,i=n.data,a!==r.SUCCESS?(o.warn(v.O,"getConversation ->code:".concat(a,", targetId:").concat(e.targetId)),[2,{code:a,msg:Ue[a]}]):[2,{code:a,data:i?ie(i):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ge(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a;return P(this,(function(i){switch(i.label){case 0:return[4,t.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return n=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(v.O,"destroy conversation ->".concat(a)),n!==r.SUCCESS?(o.warn(v.O,"destroy conversation fail ->".concat(n,":").concat(Ue[n],",").concat(a)),[2,{code:n,msg:Ue[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xe(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return[4,t.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return n=s.sent(),a=n.code,i=n.data,c="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(v.O,"get draft ->".concat(c)),a===r.SUCCESS?[2,{code:a,data:i||""}]:(o.warn(v.O,"get draft fail ->".concat(a,":").concat(Ue[a],",").concat(c)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ke(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)&&h("draft",n,R.STRING,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(v.O,"set draft ->".concat(t)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,n,e.channelId)];case 1:return(i=c.sent())===r.SUCCESS?[2,{code:i}]:(a.warn(v.O,"set 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){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a;return P(this,(function(i){switch(i.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(v.O,"delete draft ->".concat(n)),[4,t.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(a=i.sent())===r.SUCCESS?[2,{code:a}]:(o.warn(v.O,"delete draft fail ->".concat(a,":").concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ve(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("includeMuted",e,R.BOOLEAN,!1)&&h("conversationTypes",n,R.ARRAY,!1)&&!(null==n?void 0:n.every((function(e){return!h("conversationType",e,p)})))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return a.debug(v.O,"get total unread count -> ConversationType:".concat(JSON.stringify(n)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",n,e)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS?[2,{code:i,data:c}]:(a.warn(v.O,"getTotalUnreadCount fail ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fe(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return!h("conversationTypes",e,R.ARRAY,!0)||!h("levels",n,R.ARRAY,!0)||e.every((function(e){return!h("conversationType",e,p)}))||n.every((function(e){return!h("level",e,m)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,n)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS?[2,{code:i,data:c}]:(a.warn(v.O,"getTotalUnreadCountByLevels fail ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function qe(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return!h("conversationTypes",e,R.ARRAY,!0)||!h("levels",n,R.ARRAY,!0)||e.every((function(e){return!h("conversationType",e,p)}))||n.every((function(e){return!h("level",e,m)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,n,!0)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS?[2,{code:i,data:c}]:(a.warn(v.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function Ze(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return[4,t.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return n=s.sent(),a=n.code,i=n.data,c="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(v.O,"get unreadCount ->".concat(c)),a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(v.O,"get unreadCount fail ->".concat(a,":").concat(Ue[a],",").concat(c)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a;return P(this,(function(i){switch(i.label){case 0:return[4,t.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return n=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(v.O,"clear unreadMsgNum ->".concat(a)),n!==r.SUCCESS?(o.warn(v.O,"clear unreadMsgNum fail ->".concat(n,":").concat(Ue[n],",").concat(a)),[2,{code:n,msg:Ue[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){return P(this,(function(e){switch(e.label){case 0:return[4,n.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}Me.ROAMING_SERVICE_UNAVAILABLE.code;var Ke=function(e){return!(!h("options.conversationType",e.conversationType,p,!0)||!h("options.targetId",e.targetId,R.STRING,!0)||!h("options.channelId",e.channelId,R.CHANNEL_ID))},Ye=function(e,n,t){void 0===t&&(t="");var o="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return e.debug(v.O,"".concat(t," -> ").concat(o)),o},We=function(e,n,t,o){return void 0===o&&(o=""),L(void 0,void 0,void 0,(function(){var a,i;return P(this,(function(c){switch(c.label){case 0:return a=Ye(e,n,o),[4,t()];case 1:return(i=c.sent())!==r.SUCCESS?(e.warn(v.O,"".concat(o," fail -> ").concat(i," : ").concat(Ue[i]," , ").concat(a)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))};function Xe(e,n){return L(this,void 0,void 0,(function(){return P(this,(function(t){return h("notificationLevel",n,(function(e){return void 0!==E[e]}),!0)&&Ke(e)?[2,Ie((function(t,o){return We(o,e,(function(){return t.setConversationNotificationLevel(e.conversationType,e.targetId,n,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e,n){return L(this,void 0,void 0,(function(){return P(this,(function(t){return h("notificationStatus",n,(function(e){return 1===e||2===e}),!0)&&Ke(e)?[2,Ie((function(t,o){return We(o,e,(function(){return t.setConversationStatus(e.conversationType,e.targetId,void 0,n,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qe(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return Ke(e)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return n=Ye(o,e,"getConversationNotificationLevel"),[4,t.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return a=s.sent(),i=a.code,c=a.data,i===r.SUCCESS?[2,{code:i,data:c}]:(o.warn(v.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(Ue[i]," , ").concat(n)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return o.info(v.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,t.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(v.O,"getConversationNotificationStatus ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function en(){return L(this,void 0,void 0,(function(){return P(this,(function(e){return[2,Ie((function(e){return e.getBlockConversationList()}))]}))}))}function nn(e,n){return void 0===n&&(n=!0),L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.type",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(v.O,"set conversation status ->".concat(t)),[4,o.setConversationStatus(e.conversationType,e.targetId,n,void 0,e.channelId)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"set conversation status fail ->".concat(i,":").concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function tn(){return L(this,void 0,void 0,(function(){return P(this,(function(e){return[2,Ie((function(e){return e.getTopConversationList()}))]}))}))}function on(e){return L(this,void 0,void 0,(function(){return P(this,(function(n){return h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(n,t){return t.debug(v.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),n.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(){return L(this,void 0,void 0,(function(){return P(this,(function(e){return[2,Ie((function(e,n){return n.debug(v.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function an(){return L(this,void 0,void 0,(function(){return P(this,(function(e){return[2,Ie((function(e){return e.getAllConversationState()}))]}))}))}function cn(e){return void 0===e&&(e={}),L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.targetId",e.targetId,R.STRING,!1)&&h("options.channelType",e.channelType,(function(e){return void 0!==T[e]}),!1)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return[4,t.getUltraGroupList(e)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(o.warn(v.O,"get ultragroup ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,a;return P(this,(function(i){switch(i.label){case 0:return[4,n.getBlockUltraGroupList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(t.warn(v.O,"get block ultragroup ->".concat(o,":").concat(Ue[o])),[2,{code:o,msg:Ue[o]}])}}))}))}))]}))}))}function un(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)&&h("options.conversationType",e.conversationType,p,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n;return P(this,(function(a){switch(a.label){case 0:return[4,t.sendUltraGroupTypingStatus(e)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(v.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(Ue[n])),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)&&h("options.conversationType",e.conversationType,p,!0)&&h("msgs",n,R.ARRAY,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l;return P(this,(function(g){switch(g.label){case 0:return t=e.targetId,i=e.conversationType,c=e.channelId,s=[],n.forEach((function(e){var n=e.sendTime,t=e.messageUId;s.push({sendTime:n,messageUId:t,channelId:c})})),u={targetId:t,conversationType:i,messages:s},[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}]:(a.warn(v.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 fn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("expansion",e,R.OBJECT,!0)&&h("message",n,R.OBJECT,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l,g;return P(this,(function(I){switch(I.label){case 0:return t=n.conversationType,i=n.targetId,c=n.messageUId,s=n.sentTime,u=n.canIncludeExpansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(c),a.debug(v.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:t,sendTime:s,canIncludeExpansion:u,messageUId:c,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=I.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(v.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 ln(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("expansion",e,R.ARRAY,!0)&&h("message",n,R.OBJECT,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l,g;return P(this,(function(I){switch(I.label){case 0:return t=n.conversationType,i=n.targetId,c=n.messageUId,s=n.sentTime,u=n.canIncludeExpansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(c),a.debug(v.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:t,sendTime:s,canIncludeExpansion:u,messageUId:c,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=I.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(v.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 gn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("message",e,R.OBJECT,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c,s,u,d,f,l;return P(this,(function(g){switch(g.label){case 0:return n=e.conversationType,a=e.targetId,i=e.messageUId,c=e.sentTime,s=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(u,",messageUId:").concat(i),o.debug(v.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:a,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:s,messageUId:i,removeAll:!0},[4,t.expandUltraMessage(f)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(v.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 vn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("content",e,R.OBJECT,!0)&&h("message",n,R.OBJECT,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l,g,I;return P(this,(function(h){switch(h.label){case 0:return t=n.conversationType,i=n.targetId,c=n.messageUId,s=n.senderUserId,u=n.sentTime,d=n.canIncludeExpansion,f=n.channelId,l="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(f,",messageUId:").concat(c),a.debug(v.O,"update ultragroup message expansion ->".concat(l)),g={targetId:i,channelId:f,conversationType:t,fromUserId:s,sendTime:u,canIncludeExpansion:d,messageUId:c,content:e},[4,o.modifyMessage(g)];case 1:return(I=h.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(v.O,"modify ultraGroup message ->".concat(I,":").concat(Ue[I])),[2,{code:I,msg:Ue[I]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&h("notificationLevels",n,R.ARRAY)&&!(null==n?void 0:n.every((function(e){return!h("notificationLevel",e,m)})))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return a.debug(v.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(n))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,n)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS?[2,{code:r.SUCCESS,data:c}]:(a.warn(v.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c,s;return P(this,(function(u){switch(u.label){case 0:return n="getUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(v.O,"".concat(n," -> ").concat(a)),[4,t.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return i=u.sent(),c=i.code,s=i.data,c===r.SUCCESS?[2,{code:c,data:s}]:(o.warn(v.O,"".concat(n," fail -> ").concat(c," : ").concat(Ue[c]," , ").concat(a)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return e.channelId=e.channelId||"",h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.ONLY_STRING,!0)&&h("notificationLevel",n,(function(e){return void 0!==E[e]}),!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return t="setUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),a.debug(v.O,"".concat(t," -> ").concat(i)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,n,e.channelId)];case 1:return(c=s.sent().code)===r.SUCCESS?[2,{code:c}]:(a.warn(v.O,"".concat(t," fail -> ").concat(c," : ").concat(Ue[c]," , ").concat(i)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&h("notificationLevels",n,R.ARRAY)&&!(null==n?void 0:n.every((function(e){return!h("notificationLevel",e,m)})))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,n)];case 1:return i=d.sent(),c=i.code,s=i.data,u="targetId: ".concat(e,", levels: ").concat(JSON.stringify(n)),a.debug(v.O,"".concat(t," -> ").concat(u)),c===r.SUCCESS?[2,{code:c,data:s}]:(a.warn(v.O,"".concat(t," fail -> ").concat(c,": ").concat(Ue[c],", ").concat(u)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,a,i;return P(this,(function(c){switch(c.label){case 0:return e="getAllUltraGroupUnreadCount",[4,n.getAllUltraGroupUnreadCount()];case 1:return o=c.sent(),a=o.code,i=o.data,t.debug(v.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(t.warn(v.O,"".concat(e," fail ->").concat(a,": ").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]}))}))}function En(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,a,i;return P(this,(function(c){switch(c.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,n.getAllUltraGroupUnreadCount(true)];case 1:return o=c.sent(),a=o.code,i=o.data,t.debug(v.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(t.warn(v.O,"".concat(e," fail ->").concat(a,": ").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]}))}))}function Tn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return e.channelId=e.channelId||"",h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.ONLY_STRING,!0)&&h("options.sentTime",e.sentTime,R.NUMBER,!0)&&h("options.count",e.count,(function(e){return c(e)&&e>0&&e<=50}),!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c,s,u,d,f;return P(this,(function(l){switch(l.label){case 0:return n=e.targetId,a=e.channelId,i=e.sentTime,c=e.count,s={targetId:n,channelId:a,sentTime:i,count:c},[4,t.getUltraGroupUnreadMentionedMessages(s)];case 1:return u=l.sent(),d=u.code,f=u.data,d===r.SUCCESS?[2,{code:d,data:f}]:(o.warn(v.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Ue[d])),[2,{code:d,msg:Ue[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Sn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("conversation.targetId",e.targetId,R.STRING,!0)&&h("conversation.channelId",e.channelId,R.ONLY_STRING,!0)?[2,Ie((function(t){return L(n,void 0,void 0,(function(){var n,o,a,i,c,s;return P(this,(function(u){switch(u.label){case 0:return n=e.targetId,o=e.channelId,a={targetId:n,channelId:o},[4,t.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=u.sent(),c=i.code,s=i.data,c===r.SUCCESS?[2,{code:c,data:s}]:[2,{code:c,msg:Ue[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var On=function(e){return!!(h("options.key",e.key,R.STRING,!0)&&h("options.value",e.value,R.STRING,!0)&&h("options.isAutoDelete",e.isAutoDelete,R.BOOLEAN)&&h("options.isSendNotification",e.isSendNotification,R.BOOLEAN)&&h("options.notificationExtra",e.notificationExtra,R.STRING))},Nn=function(e){return!(!h("options.key",e.key,R.STRING,!0)||!h("options.isSendNotification",e.isSendNotification,R.BOOLEAN)||!h("options.notificationExtra",e.notificationExtra,R.STRING))};function _n(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.count",n.count,R.NUMBER,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return t=a.createTraceId(),a.info(v.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:n.count,joinExist:!1}),t),[4,o.joinChatroom(e,n.count,t)];case 1:return i=s.sent(),c=i===r.SUCCESS?"info":"warn",a[c](v.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),t),i!==r.SUCCESS?[2,{code:i,msg:Ue[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Cn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.count",n.count,R.NUMBER,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return t=a.createTraceId(),a.info(v.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:n.count,joinExist:!0}),t),[4,o.joinExistChatroom(e,n.count,t)];case 1:return i=s.sent(),c=i===r.SUCCESS?"info":"warn",a[c](v.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),t),i!==r.SUCCESS?[2,{code:i,msg:Ue[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function An(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(v.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),n),[4,t.quitChatroom(e)];case 1:return a=c.sent(),i=a===r.SUCCESS?"info":"warn",o[i](v.A_QUIT_CHATROOM_R,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Ue[a]}]:[2,{code:a}]}}))}))}))]}))}))}function yn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.count",n.count,R.NUMBER)&&h("options.order",n.order,(function(e){return[0,1,2].includes(e)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s;return P(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),a.debug(v.O,"get chatroom info ->".concat(t)),[4,o.getChatroomInfo(e,n.count,n.order)];case 1:return i=u.sent(),c=i.code,s=i.data,c===r.SUCCESS&&s?[2,{code:c,data:s}]:(a.warn(v.O,"get chatroom info fail ->code+:".concat(Ue[c],",").concat(t)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&On(n)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),a.debug(v.O,"set chatroom entry->".concat(t)),[4,o.setChatroomEntry(e,n)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"set chatroom entry fail ->code+:".concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Un(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!h("entry.key",e.key,R.STRING,!0)||!h("entry.value",e.value,R.STRING,!0)}))||!h("options.isAutoDelete",e.isAutoDelete,R.BOOLEAN)||!h("options.notificationExtra",e.notificationExtra,R.STRING)||!h("options.isForce",e.isForce,R.BOOLEAN))}(n)?n.entries.length>10?[2,Me.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s;return P(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),a.debug(v.O,"set chatroom entry->".concat(t)),[4,o.setChatroomEntries(e,n)];case 1:return i=u.sent(),c=i.code,s=i.data,c!==r.SUCCESS?(a.warn(v.O,"set chatroom entry fail ->code+:".concat(Ue[c],",").concat(t)),[2,{code:c,msg:Ue[c],data:s}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ln(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&On(n)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),a.debug(v.O,"force set chatroom entry ->".concat(t)),[4,o.forceSetChatroomEntry(e,n)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"force set chatroom entry fail ->code+:".concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&Nn(n)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),a.debug(v.O,"remove chatroom entry->".concat(t)),[4,o.removeChatroomEntry(e,n)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"remove chatroom entry fail ->code+:".concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!h("key",e,R.STRING,!0)}))||!h("options.notificationExtra",e.notificationExtra,R.STRING))}(n)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t="id:".concat(e),a.info(v.O,"remove chatroom entry->".concat(t)),(i=U({},n)).entries=n.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,i)];case 1:return c=d.sent(),s=c.code,u=c.data,s!==r.SUCCESS?(a.warn(v.O,"remove chatroom entry fail ->code+:".concat(Ue[s],",").concat(t)),[2,{code:s,msg:Ue[s],data:u}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&Nn(n)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),a.info(v.O,"force remove chatroom entry ->".concat(t)),[4,o.forceRemoveChatroomEntry(e,n)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"force remove chatroom entry fail ->code+:".concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("key",n,(function(e){return S(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s;return P(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),a.debug(v.O,"get chatroom entry->".concat(t)),[4,o.getChatroomEntry(e,n)];case 1:return i=u.sent(),c=i.code,s=i.data,c===r.SUCCESS&&s?[2,{code:c,data:s}]:(a.warn(v.O,"get chatroom entry fail ->code+:".concat(Ue[c],",").concat(t)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),o.debug(v.O,"get all chatroom entries->".concat(n)),[4,t.getAllChatroomEntries(e)];case 1:return a=s.sent(),i=a.code,c=a.data,i===r.SUCCESS&&c?[2,{code:i,data:c}]:(o.warn(v.O,"get all chatroom entries fail ->code+:".concat(Ue[i],",").concat(n)),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function Gn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.timestamp",n.timestamp,R.NUMBER)&&h("options.count",n.count,R.NUMBER)&&h("options.order",n.order,(function(e){return 0===e||1===e}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t="id:".concat(e),a.debug(v.O,"get chatroom history message->".concat(t)),[4,o.getChatRoomHistoryMessages(e,n.count,n.order,n.timestamp)];case 1:return i=d.sent(),c=i.code,s=i.data,c===r.SUCCESS&&s?(u=s.list.map((function(e){return ae(e)})),[2,{code:c,data:{list:u,hasMore:!!s.hasMore}}]):(a.warn(v.O,"get chatroom history message fail ->code+:".concat(Ue[c],",").concat(t)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return[2,Ie((function(t){return L(n,void 0,void 0,(function(){var n;return P(this,(function(o){switch(o.label){case 0:return[4,t.bindRTCRoomForChatroom(e)];case 1:return[2,{code:n=o.sent(),msg:Ue[n]}]}}))}))}))]}))}))}function kn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("userId",e,R.STRING,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){return P(this,(function(n){switch(n.label){case 0:return o.info(v.O,"addToBlacklist -> userId: ".concat(e)),[4,t.addToBlacklist(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Hn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("userId",e,R.STRING,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){return P(this,(function(n){switch(n.label){case 0:return o.info("removeFromBlacklist -> userId: ".concat(e)),[4,t.removeFromBlacklist(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vn(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,a;return P(this,(function(i){switch(i.label){case 0:return t.info(v.O,"getBlacklist -> "),[4,n.getBlacklist()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS&&a?[2,{code:o,data:a}]:(t.warn(v.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Fn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("userId",e,R.STRING,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return o.info(v.O,"getBlacklistStatus -> userId: ".concat(e)),[4,t.getBlacklistStatus(e)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:a,data:0===i}]:(o.warn(v.O,"getBlacklistStatus fail -> code: ".concat(a,", userId: ").concat(e)),[2,{code:a}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var qn=function(e,n,t,o){void 0===t&&(t=!0),void 0===o&&(o=!0),this.messageType=e,this.content=n,this.isPersited=t,this.isCounted=o};function Zn(e,n,t){void 0===n&&(n=!0),void 0===t&&(t=!0);return function(o){return new qn(e,o,n,t)}}var Jn,zn,Kn=Zn("RC:ImgMsg"),Yn=Zn("RC:HQVCMsg"),Wn=Zn("RC:SightMsg"),Xn=Zn("RC:TxtMsg"),jn=Zn("RC:CombineMsg"),Qn=Zn("RC:FileMsg"),$n=Zn("RC:GIFMsg"),et=Zn("RC:VcMsg"),nt=Zn("RC:LBSMsg"),ot=Zn("RC:ReferenceMsg"),rt=Zn("RC:ImgTextMsg"),at={qiniu:function(e,n,t,o){ve((function(r){var a=r.getInfoFromCache();if(1===(null==a?void 0:a.type)&&n.chunk_size&&o.size>n.chunk_size){var i=O();i+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=i,lt(o,n,t)}else ft(e,n,t,o)}))},baidu:function(e,n,t,o){if(o.size>ct)throw new Error("the file size is over 5GB!");var r=n||{};n=n||zn;var a=new XMLHttpRequest,i=st();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var c=i+it[0][1]+r.bosUploadPath;it.shift();var s=r.bosHeader||{},u={filename:n.uniqueValue||o.uniqueName,name:o.name,downloadUrl:c,isBosRes:!0};a.upload&&n.support_options&&(a.upload.onprogress=function(e){t.onProgress(e.loaded,e.total,!0)});a.onreadystatechange=function(){if(4===a.readyState)if(JSON.parse(a.responseText||"{}").filename=n.uniqueValue,200===a.status){t.onCompleted(u,!0)}else it.length?at[it[0][0]](e,n,t,o):t.onError("upload fail")},a.open(n.method,c,!0),a.setRequestHeader("authorization",s.bosToken),a.setRequestHeader("x-bce-date",s.bosDate),a.send(o)},aliyun:function(e,n,t,o){if(o.size>ct)throw new Error("the file size is over 5GB!");var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token"));var a=it[0][1];it.shift(),e=e||Jn,n=(n=n||{})||zn;var i=new XMLHttpRequest,c=st(),s="".concat(c+n.ossBucketName,".").concat(a);i.upload&&n.support_options&&(i.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var e=JSON.parse(i.responseText||"{}");e.name=n.uniqueValue,e.filename=n.uploadFileName,e.uploadMethod=N?N.ALI:"",200===i.status?t.onCompleted(e):it.length?at[it[0][0]](r,n,t,o):t.onError("upload fail")}},i.open(n.method,s,!0),console.log("ali:url",s);var u=n.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",n.uploadFileName),e.delete("file"),e.append("file",o),i.send(e)},s3:function(e,n,t,o){var r=new FormData,a=new XMLHttpRequest,i=st(),c=n.contentDisposition,s=it[0][1],u="".concat(i+n.s3BucketName,".").concat(s);console.log("uploadS3:url",u),it.shift(),a.upload&&n.support_options&&(a.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var r=JSON.parse(a.responseText||"{}");if(r.name=n.uniqueValue,r.filename=n.uploadFileName,r.uploadMethod=N.AWS,200===a.status||204===a.status)t.onCompleted(r);else if(it.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),at[it[0][0]](i,n,t,o)}else t.onError("upload fail")}},a.open(n.method,u,!0);var d=n?n.s3Header:{},f=o&&o.type;c?r.set("Content-Disposition","".concat(c,";")):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",n.uploadFileName),r.set("file",o),a.send(r)},stc:function(e,n,t,o){var r=new XMLHttpRequest,a=n.contentDisposition,i=it[0][1],c="https://".concat(i,"/").concat(n.stcBucketName,"/").concat(n.uploadFileName);it.shift(),r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");if(a.name=n.uniqueValue,a.filename=n.uploadFileName,a.uploadMethod=N?N.STC:"",200===r.status||204===r.status)t.onCompleted(a);else if(it.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),at[it[0][0]](i,n,t,o)}else t.onError("upload fail")}},r.open("PUT",c,!0);var s=n?n.stcHeader:{};r.setRequestHeader("Content-Type",o.type),a?r.setRequestHeader("Content-Disposition","".concat(a,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");r.setRequestHeader("Authorization",s.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",s.stcContentSha256),r.setRequestHeader("x-amz-date",s.stcDate),r.send(o)}},it=[],ct=5368709120;function st(){var e="https://";return"http:"!==location.protocol&&"file:"!==location.protocol||(e="http://"),e}var ut,dt=(ut="RC-upload-",{get:function(e){e=ut+e;var n=localStorage.getItem(e);if(n)return null!==(n=JSON.parse(n||"{}"))&&n.type&&n.data?n.data:null},set:function(e,n){var t=localStorage;e=ut+e,n={data:n,type:typeof n,updateTime:Date.now()},t.setItem(e,JSON.stringify(n))},remove:function(e){e=ut+e,localStorage.removeItem(e)}});function ft(e,n,t,o){var r="https://"+n.uploadHost.qiniu,a=(/http/.test(it[0][1])?"":st())+it[0][1]||r;n.isChunk||it.shift();var i=new XMLHttpRequest;i.upload&&n.support_options&&(i.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var r=JSON.parse(i.responseText||"{}");r.filename=n.uniqueValue,r.uploadMethod=N?N.QINIU:"",200===i.status||204===i.status?t.onCompleted(r):it.length?at[it[0][0]](e,n,t,o):t.onError("upload fail")}},i.open(n.method,a,!0),t.onOpen(i),n.stream&&i.setRequestHeader("authorization","UpToken ".concat(n.multi_parmas.token)),function(e,n){for(var t in e)n(t,e[t])}(n.headers,(function(e,n){i.setRequestHeader(e,n)})),i.send(e)}function lt(e,n,t,o){var r=0,a=o||O(),i=dt.get(a);i&&(e.uniqueName=i.sessionId,r=i.offset);var c=Math.min(n.chunk_size,e.size-r),s=e.slice(r,r+c),u=e.uniqueName;n.multi_parmas.name=u,n.filesize=e.size;var d="bytes=".concat(r,"-").concat(r+c);n.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},n.isChunk=!0,s.name=e.name,s=function(e,n,t){var o=new FormData;for(var r in n.unique_key&&o.append(n.unique_key,t),o.append(n.file_data_name,e,e.name),n.multi_parmas){var a=n.multi_parmas[r];o.append(r,a)}return o}(s,n,e.uniqueName),ft(s,n,{onCompleted:function(o){r+=c;var i=e.uniqueName;dt.set(a,{offset:r,sessionId:i}),r<e.size?lt(e,n,t,a):(r=0,dt.remove(a),t.onCompleted(o))},onError:function(e){console.error(e),t.onError(e)},onProgress:function(e,o){var a=e+r;t.onProgress(a,n.filesize)},onOpen:function(e){t.onOpen(e)}},e)}function gt(e,n,t,o){var r,a,i=n&&n.type||"text/plain",c=i.indexOf("image")>-1?1:4,s=t.contentDisposition,u=Math.ceil(n.size/t.stc_chunk_size),d=t&&JSON.parse(t.ossConfig?t.ossConfig:"");Array.isArray(d)||(d=[]);var f=d.find((function(e){return Object.keys(e).includes("stc")})),l="uploads";e.getFileToken(c,r,"POST",l).then((function(e){r=e.fileName,a="https://".concat(f.stc,"/").concat(t.stcBucketName,"/").concat(r),console.log("uploadStcMultipart:url",a);var c=new XMLHttpRequest;c.open("POST","".concat(a,"?").concat(l),!0),s?c.setRequestHeader("Content-Disposition","".concat(s,";")):c.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),c.setRequestHeader("Authorization",e&&e.stcAuthorization),c.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),c.setRequestHeader("x-amz-date",e&&e.stcDate),c.setRequestHeader("Content-Type",i),c.send(),c.onreadystatechange=function(){if(4===c.readyState){var e=c.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===c.status||204===c.status?function(e){for(var n=[],t=1;t<=u;t++)n.push(h(e,t));I(e,n)}(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(s,d){d&&Array.isArray(d)&&0!==d.length&&Promise.all(d).then((function(){var d="uploadId=".concat(s);if(v.size===u)e.getFileToken(c,r,"POST",d).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",s);var r=new XMLHttpRequest;r.open("POST","".concat(a,"?").concat(d),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i);var c="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(v.keys()||[]).sort((function(e,n){return e-n}));console.log("keys",u),u.forEach((function(e){c+="<Part><ETag>".concat(v.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),c+="</CompleteMultipartUpload>",r.send(c),console.log("xml",c),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e={name:n.name,filename:t.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 p=R[l];f.push(h(s,p))}I(s,f)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var n=[],t=0,r=g;t<r.length;t++){var a=r[t];n.push(h(s,a))}I(s,n)}))}function h(o,s){return new Promise((function(u,d){var f="partNumber=".concat(s,"&uploadId=").concat(o);e.getFileToken(c,r,"PUT",f).then((function(e){console.log("signature ".concat(s," onSuccess"),e);var o=n&&n.slice((s-1)*t.stc_chunk_size,s*t.stc_chunk_size);console.log("fileChunk:size",o.size);var r=new XMLHttpRequest;r.open("PUT","".concat(a,"?").concat(f),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i),r.send(o),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e=r.getResponseHeader("etag");console.log("etag:".concat(s),e),v.set(s,e),u(e)}else g.includes(s)||g.push(s),d(s)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(s)||g.push(s),d(s)}))}))}}var vt={form:function(e,n){var t=new FormData;if(n.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=It()+o;t.append(n.unique_key,r),n.uniqueValue=r}return t.append(n.file_data_name,e),ht(n.multi_parmas,(function(e,n){t.append(e,n)})),t},json:function(e,n){var t={};if(n.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=It()+o;t[n.unique_key]=r,n.uniqueValue=r}return t[n.file_data_name]=e,ht(n.multi_parmas,(function(e,n){t[e]=n})),JSON.stringify(t)},data:function(e,n){return e}};function It(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(n){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===n?t:3&t|8).toString(16)}))}function ht(e,n){for(var t in e)n(t,e[t])}var Rt,pt=0,mt=function(){function e(e){this.options=function(e){var n={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:vt.form,genUId:It};if(!e||!e.domain)throw new Error("domain is null");for(var t in e)n[t]=e[t];return n}(e)}return e.prototype.setOptions=function(e){var n=this;ht(e,(function(e,t){n.options[e]=t}))},e.prototype.upload=function(e,n,t,o){if(t){var r=this;!function(e,n,t,o,r){Jn=t,zn=o,it=[];var a,i=e.getInfoFromCache();if(1===(null==i?void 0:i.type)&&n.uploadDomain)it=[["qiniu",n.uploadDomain]];else if(o.ossConfig){var c,s,u=JSON.parse(o.ossConfig),d="",f=[];u.forEach((function(e){var n=Number(e.p)-1;for(var t in e)"aliyun"===t&&(d=e[t]),"s3"===t&&(c=e[t]),"stc"===t&&(s=e[t]),"p"!==t&&(f[n]=[t,e[t]])})),f.forEach((function(e){e&&it.push(e)})),u.length!==it.length&&(it=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",d],["s3",c],["stc",s]])}else it=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var l=o&&JSON.parse(o.ossConfig);Array.isArray(l)||(l=[]),a=l.find((function(e){return Object.keys(e).includes("stc")}))}if(a&&1===parseInt(a.p,10)&&t.size>=4194304)gt(e,t,o,r);else{var g=o.data(t,o);at[it[0][0]](g,o,r,t)}}(e,n,t,this.options,{onProgress:function(e,n,t){(Rt=e,t)?Rt=pt+e/n*(n-pt):pt=Rt;o.onProgress(Rt,n)},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 Et,Tt,St={init:function(e){return new mt(e)},dataType:vt,resize:function(e,n,t){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,a=new Image;a.src=r;var i=a.width,c=a.height,s=function(e,n){var t=1,o=e.width,r=n.maxWidth||0;r>0&&o>r&&(t=r/o);var a=e.height,i=n.maxHeight||0;if(i>0&&a>i){var c=i/a;t=Math.min(t,c)}var s=n.maxSize||0,u=Math.ceil(e.size/1e3);if(u>s){var d=s/u;t=Math.min(t,d)}return t}({width:i,height:c,size:e.total},n),u=r;s<1&&(u=function(e,n,t){return o.width=n,o.height=t,o.getContext("2d").drawImage(e,0,0,n,t),o.toDataURL("image/jpg")}(a,i*s,c*s)),t(u)}},Upload:mt},Ot=function(e,n,t){var o=document.createElement("canvas"),r=o.getContext("2d"),a=new Image,i="string"==typeof e;a.onload=function(i){var c=function(e,n,t){var o,r,a,i=e<n,c=0,s=0;return(i?n/e:e/n)>t.scale?(i?(r=100,s=((a=n/(o=e/100))-t.maxHeight)/2):(a=100,c=((r=e/(o=n/100))-t.maxWidth)/2),{w:r,h:a,x:-c,y:-s}):(i?(o=n/t.maxHeight,a=t.maxHeight,r=e/o):(o=e/t.maxWidth,r=t.maxWidth,a=n/o),{w:r,h:a,x:-c,y:-s})}(a.width,a.height,n);o.width=c.w>n.maxWidth?n.maxWidth:c.w,o.height=c.h>n.maxHeight?n.maxHeight:c.h,r.drawImage(a,c.x,c.y,c.w,c.h);var s=o.toDataURL("string"==typeof e?"image/jpg":e.type,n.quality);s=s.replace(/data:image\/[^;]+;base64,/,""),t(s)},a.src=i?"data:image/jpg;base64,".concat(e):function(e){var n=window.URL||window.webkitURL;return n?n.createObjectURL(e):""}(e)},Nt=function(e,n){var t=e.file,o=e.compress;Ot(t,o,n)},_t=function(e,n){if(e.getToken)e.getToken((function(t,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=t,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(t));var r=St.init(e);n(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var t=St.init(e);n(t)}},Ct=function(e,n,t,o,r){o.upload(e,n,t.file,{onError:function(e){r.onError(e)},onProgress:function(e,n){r.onProgress(e,n)},onCompleted:function(e){e.filename=e.filename||e.hash;var n=t.compressThumbnail||Nt;t.compress?n(t,(function(n){e.thumbnail=n,r.onCompleted(e)})):r.onCompleted(e)}})},At=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,n,t,o){Ct(e,n,{file:t},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),yt=function(){function e(e,n){this.instance=e,this.cfg=n}return e.prototype.upload=function(e,n,t,o){var r={file:t,compress:this.cfg};Ct(e,n,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Mt=function(e,n){_t(e,(function(e){var t=new At(e);n(t)}))},Ut=function(e,n){_t(e,(function(t){var o,r,a,i,c={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.quality)||.5,scale:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.scale)||2.4},s=new yt(t,c);n(s)}))};St.dataType;function Lt(e,n,t,o,r,a,i){var c,s=this;void 0===r&&(r=C.FILE),c=r===C.IMAGE?C.IMAGE:C.FILE;var u=e.getInfoFromCache();if(!Tt&&(Tt="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(Tt=d.qiniu)}catch(e){}var f=U({domain:Tt,getToken:function(n){e.getFileToken(c).then((function(e){n(e.token,e)})).catch((function(e){a.onFail(e)}))}},i);(c===C.IMAGE?Ut:Mt)(f,(function(n){n.upload(e,t,o,{onProgress:function(e,n){var t,o=Math.floor(e/n*100);null===(t=a.onProgress)||void 0===t||t.call(a,o)},onCompleted:function(e){return L(s,void 0,void 0,(function(){return P(this,(function(n){return 1===(null==u?void 0:u.type)?function(e,n,t,o,r,a){var i={type:o.type,name:r.rc_url.file_name,downloadUrl:e.uploadDomain+r.rc_url.path};if(n===C.AUDIO)return void Pt(o).then((function(e){a.onSuccess(U(U({},i),e))}));n===C.IMAGE&&(i.thumbnail=r.thumbnail);a.onSuccess(i)}(t,r,0,o,e,a):function(e,n,t,o,r){Dt(n,o.filename,o.name,o,o.uploadMethod).then((function(a){if(0===a.code){var i=a.data;i.type=t.type,i.name=o.name||o.filename,e!==C.AUDIO?(n===C.IMAGE&&(i.thumbnail=o.thumbnail),r.onSuccess(i)):Pt(t).then((function(e){r.onSuccess(U(U({},i),e))}))}else r.onFail(a)})).catch((function(e){r.onFail(e)}))}(r,c,o,e,a),[2]}))}))},onError:function(e){a.onFail(e)}})}))}function Pt(e){return new Promise((function(n){if("function"!=typeof e.arrayBuffer){var t=new FileReader;t.onload=function(){t.result?wt(t.result).then((function(e){n(e)}),(function(){n({})})):n({})},t.onerror=function(){n({duration:0})},t.readAsArrayBuffer(e)}else e.arrayBuffer().then(wt).then((function(e){n(e)}))}))}function wt(e){return Et=Et||new AudioContext,new Promise((function(n,t){Et.decodeAudioData(e,(function(e){n({duration:e.duration,length:e.length})}),t)}))}function bt(e,n,t,o){return Ie((function(a){return new Promise((function(i){a.getFileToken(e,n,t,o).then((function(e){i({code:r.SUCCESS,data:e})})).catch((function(e){i({code:e,msg:Ue[e]})}))}))}))}function Dt(e,n,t,o,a){return h("fileType",e,_,!0)&&h("filename",n,R.STRING)&&h("saveName",t,R.STRING)&&h("serverType",a,R.NUMBER)?Ie((function(i){return new Promise((function(c){i.getFileUrl(e,n,t,o,a).then((function(e){c({code:r.SUCCESS,data:e})})).catch((function(e){c({code:e})}))}))})):Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER})}function Bt(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(c){return[2,Ie((function(c,s){return L(o,void 0,void 0,(function(){var o,u,d,f,l,g,I,p,m,E,T,S,O;return P(this,(function(N){switch(N.label){case 0:return t=t||{},n instanceof qn==!1?(s.warn(v.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,Me.ILLGAL_PARAMS]):h("conversation",e,R.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,h("conversation.targetId",u,R.STRING,!0)&&h("conversation.conversationType",o,R.NUMBER)&&h("conversation.channelId",d,R.CHANNEL_ID)&&h("options.isStatusMessage",null==t?void 0:t.isStatusMessage,R.BOOLEAN)&&h("options.disableNotification",null==t?void 0:t.disableNotification,R.BOOLEAN)&&h("options.pushContent",null==t?void 0:t.pushContent,R.STRING)&&h("options.pushData",null==t?void 0:t.pushData,R.STRING)&&h("options.isMentioned",null==t?void 0:t.isMentioned,R.BOOLEAN)&&h("options.mentionedType",null==t?void 0:t.mentionedType,R.NUMBER)&&h("options.mentionedUserIdList",null==t?void 0:t.mentionedUserIdList,R.ARRAY)&&h("options.directionalUserIdList",null==t?void 0:t.directionalUserIdList,R.ARRAY)&&h("options.isVoipPush",null==t?void 0:t.isVoipPush,R.BOOLEAN)&&h("options.canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,R.BOOLEAN)&&h("options.expansion",null==t?void 0:t.expansion,R.OBJECT)&&h("options.pushConfig",null==t?void 0:t.pushConfig,R.OBJECT)&&h("options.messageId",null==t?void 0:t.messageId,R.NUMBER)?(f="conversationType:".concat(o,",targetId:").concat(u),s.debug(v.O,"send message ->".concat(f)),l=function(e,n,t){var o=e.isStatusMessage,r=e.disableNotification,a=e.pushContent,i=e.pushData,c=e.isMentioned,s=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=t.channelId;return U({isStatusMessage:o,disableNotification:r,pushContent:a,pushData:i,isMentioned:c,mentionedType:s,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:R||"",messageId:h},n)}(t,n,e),g={isMentioned:!!t.isMentioned,content:n.content,messageType:n.messageType,isPersited:n.isPersited||!1,isCounted:n.isCounted||!1,disableNotification:!!(null==t?void 0:t.disableNotification),canIncludeExpansion:!!(null==t?void 0:t.canIncludeExpansion),expansion:(null==t?void 0:t.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:c.getCurrentUserId(),messageUId:"",messageDirection:y.SEND,receivedTime:0,isStatusMessage:t.isStatusMessage||!1,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==t?void 0:t.pushConfig},o!==i.ULTRA_GROUP&&(g.isOffLineMessage=!1),I=s.createTraceId(),p=function(e){g.messageId=e;try{(null==t?void 0:t.onSendBefore)&&t.onSendBefore(ae(g))}catch(e){s.error(v.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},s.info(v.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,c.sendMessage(o,u,l,p,I)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return m=N.sent(),E=m.code,T=m.data,S=E===r.SUCCESS?"info":"warn",s[S](v.A_SEND_MSG_R,JSON.stringify({code:E,messageUId:T?T.messageUId:"",messageId:T?T.messageId:""}),I),E===r.SUCCESS?(O=ae(T),[2,{code:E,data:O}]):(s.warn(v.O,"send message fail ->".concat(E,":").concat(Ue[E],",").concat(f)),g.sentTime=(null==T?void 0:T.sentTime)||0,[2,{code:E,msg:Ue[E],data:ae(g)}])}}))}))}))]}))}))}function Gt(e,n,t){return Bt(e,new Xn(n),t)}function xt(e,n){return function(t,o,a,i){if(!h("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});var c={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var s=null==i?void 0:i.thumbnailConfig;if(!(h("sendOptions.maxHeight",null==s?void 0:s.maxHeight,R.NUMBER)&&h("sendOptions.maxWidth",null==s?void 0:s.maxWidth,R.NUMBER)&&h("sendOptions.quality",null==s?void 0:s.quality,R.NUMBER)&&h("sendOptions.scale",null==s?void 0:s.scale,R.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});c.thumbnailConfig=s}return Ie((function(s,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(v.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Lt(s,0,d,o.file,e,{onProgress:null==a?void 0:a.onProgress,onSuccess:function(e){var c,s=(null===(c=null==a?void 0:a.onComplete)||void 0===c?void 0:c.call(a,{url:e.downloadUrl}))||n(e,o);e&&e.downloadUrl&&u.info(v.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:r.SUCCESS}),l),Bt(t,s,i).then(f)},onFail:function(e){u.warn(v.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]})}},c)}))}))}}var kt=xt(C.FILE,(function(e,n){return new Qn({name:e.name,size:n.file.size,type:n.file.type,fileUrl:e.downloadUrl,user:n.user,extra:n.extra})})),Ht=xt(C.IMAGE,(function(e,n){return new Kn({content:e.thumbnail,imageUri:e.downloadUrl,user:n.user,extra:n.extra})})),Vt=xt(C.AUDIO,(function(e,n){return new Yn({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:n.user,extra:n.extra})})),Ft=xt(C.SIGHT,(function(e,n){return new Wn({sightUrl:e.downloadUrl,content:n.thumbnail,duration:n.duration,size:n.file.size||e.size,name:n.name||e.name,user:n.user,extra:n.extra})}));function qt(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.timestamp",null==n?void 0:n.timestamp,R.NUMBER)&&h("options.count",null==n?void 0:n.count,R.NUMBER)&&h("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t=a.createTraceId(),a.info(v.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count}),t),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==n?void 0:n.timestamp,null==n?void 0:n.count,null==n?void 0:n.order,null==e?void 0:e.channelId,"",t)];case 1:return i=d.sent(),c=i.code,s=i.data,c===r.SUCCESS&&s?(u=s.list.map((function(e){return ae(e)})),a.info(v.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageLength:u.length}),t),[2,{code:c,data:{list:u,hasMore:s.hasMore}}]):(a.warn(v.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageUIds:""}),t),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.timestamp",null==n?void 0:n.timestamp,R.NUMBER)&&h("options.count",null==n?void 0:n.count,R.NUMBER)&&h("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(v.O,"get history message ->".concat(t)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==n?void 0:n.timestamp)||0,(null==n?void 0:n.count)||20,(null==n?void 0:n.order)||0,e.channelId||"")];case 1:return i=d.sent(),c=i.code,s=i.data,c===r.SUCCESS&&s?(u=s.list.map((function(e){return ae(e)})),[2,{code:c,data:{list:u,hasMore:s.hasMore}}]):(a.warn(v.O,"get history message fail ->".concat(c,":").concat(Ue[c],",").concat(t)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e,n,t,o){return L(this,void 0,void 0,(function(){var r=this;return P(this,(function(a){return[2,Ie((function(a){return L(r,void 0,void 0,(function(){var r,a,c,s,u;return P(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:i.PRIVATE,channelId:o},a=new qn("RC:ReadNtf",{messageUId:n,lastMessageSendTime:t,type:1}),[4,Bt(r,a)];case 1:return c=d.sent(),s=c.code,u=c.msg,0===s?[2,{code:s}]:[2,{code:s,msg:u}]}}))}))}))]}))}))}function zt(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return h("messageUId",n,R.STRING,!0)&&h("channelId",t,R.CHANNEL_ID)?[2,Ie((function(r,a){return L(o,void 0,void 0,(function(){var o,r,c,s,u;return P(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(n,",targetId:").concat(e),a.debug(v.O,"send read receipt message ->".concat(o)),r=new qn("RC:RRReqMsg",{messageUId:n}),[4,Bt({targetId:e,conversationType:i.GROUP,channelId:t},r)];case 1:return c=d.sent(),s=c.code,u=c.msg,0===s?[2,{code:s}]:[2,{code:s,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kt(e,n,t){return L(this,void 0,void 0,(function(){return P(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Yt(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return h("targetId",e,R.STRING,!0)&&h("messageList",n,R.OBJECT,!0)&&h("channelId",t,R.CHANNEL_ID)&&!Object.keys(n).every((function(e){return!h(e,n[e],R.ARRAY)}))?[2,Ie((function(a,c){return L(o,void 0,void 0,(function(){var o,s,u,d,f,l,g;return P(this,(function(I){switch(I.label){case 0:return o={targetId:e,conversationType:i.GROUP,channelId:t},u=a.getInfoFromCache(),0!==(d=(null==u?void 0:u.grpRRVer)||0)?[3,2]:(f=new qn("RC:RRRspMsg",{receiptMessageDic:n}),[4,Bt(o,f)]);case 1:return s=I.sent(),[3,4];case 2:return 1!==d?[3,4]:(l=[],Object.keys(n).forEach((function(e){n[e].forEach((function(e){-1===l.indexOf(e)&&l.push(e)}))})),l.length?[4,a.sendReadReceiptMessage(e,l,t)]:(c.warn(v.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 3:s=I.sent(),I.label=4;case 4:return(g=s.code)===r.SUCCESS?[2,{code:g}]:(c.warn(v.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 Wt(e,n){return L(this,void 0,void 0,(function(){var t,o,a,i;return P(this,(function(c){switch(c.label){case 0:return h("conversation.type",e.conversationType,R.NUMBER,!0)&&h("conversation.targetId",e.targetId,R.STRING,!0)&&h("lastMessageSendTime",n,R.NUMBER,!0)&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?(t=new qn("RC:SRSMsg",{lastMessageSendTime:n}),[4,Bt(e,t)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=c.sent(),a=o.code,i=o.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))}function Xt(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.messageUId",n.messageUId,R.STRING,!0)&&h("options.sentTime",n.sentTime,R.NUMBER,!0)&&h("options.disableNotification",null==n?void 0:n.disableNotification,R.BOOLEAN)&&h("options.pushConfig",null==n?void 0:n.pushConfig,R.OBJECT)&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t={user:n.user,channelId:e.channelId||"",disableNotification:null==n?void 0:n.disableNotification,pushConfig:null==n?void 0:n.pushConfig,extra:n.extra,isDelete:n.isDelete},i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(n.messageUId),a.debug(v.O,"recall message ->".concat(i)),[4,o.recallMessage(e.conversationType,e.targetId,n.messageUId,n.sentTime,t)];case 1:return c=d.sent(),s=c.code,u=c.data,s===r.SUCCESS&&u?[2,{code:s,data:ae(u)}]:s===r.SUCCESS?[2,{code:s}]:(a.warn(v.O,"recall message fail ->".concat(s,":").concat(Ue[s],",").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options",n,(function(e){return f(e)&&e.length}),!0)&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)&&!n.every((function(e){return!h("options.messageUId",e.messageUId,R.STRING,!0)||!h("options.sentTime",e.sentTime,R.NUMBER,!0)||!h("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(v.O,"delete messages ->".concat(t)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,n,e.channelId)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"delete message fail ->".concat(i,":").concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qt(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.timestamp",n,R.NUMBER,!0)&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(v.O,"clear message ->".concat(t)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,n,e.channelId)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"clear message ->".concat(i,":").concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $t(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("expansion",e,R.OBJECT,!0)&&h("message",n,R.OBJECT,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l;return P(this,(function(g){switch(g.label){case 0:return t=n.conversationType,i=n.targetId,c=n.messageUId,s=n.canIncludeExpansion,u=n.expansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(i,",messageUId:").concat(c),a.debug(v.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:t,targetId:i,messageUId:c,expansion:e,canIncludeExpansion:s,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==r.SUCCESS?(a.warn(v.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 eo(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("keys",e,R.ARRAY,!0)&&h("message",n,R.OBJECT,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f;return P(this,(function(l){switch(l.label){case 0:return t=n.conversationType,i=n.targetId,c=n.messageUId,s=n.canIncludeExpansion,u=n.channelId,d="conversationType:".concat(t,",targetId:").concat(i,",messageUId:").concat(c),a.debug(v.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:t,targetId:i,messageUId:c,canIncludeExpansion:s,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==r.SUCCESS?(a.warn(v.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 no(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("typingContentType",n,R.STRING,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d;return P(this,(function(f){switch(f.label){case 0:return t={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:e.channelId},i=a.createTraceId(),a.info(v.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),i),[4,o.sendMessage(e.conversationType,e.targetId,t,void 0,i)];case 1:return c=f.sent(),s=c.code,u=c.data,d=s===r.SUCCESS?"info":"warn",a[d](v.A_SEND_MSG_R,JSON.stringify({code:s,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),i),s===r.SUCCESS?[2,{code:s,data:ae(u)}]:[2,{code:s,msg:Ue[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return h("messageUId",n,R.STRING,!0)?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o,c,s,u;return P(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(n,",targetId:").concat(e),i.debug(v.O,"get message reader ->".concat(o)),[4,a.getMessageReader(e,n,t)];case 1:return c=d.sent(),s=c.code,u=c.data,s===r.SUCCESS?[2,{code:s,data:u}]:(i.warn(v.O,"get message reader fail ->".concat(s,":").concat(Ue[s],",").concat(o)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,n,t,o,r){return ve((function(a,i){return d("messageType",e,R.STRING,!0),d("isPersited",n,R.BOOLEAN,!0),d("isCounted",t,R.BOOLEAN,!0),d("isStatusMessage",r,R.BOOLEAN,!1),i.info(v.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:t,isStatusMessage:r,isPersited:n})),a.registerMessageType(e,n,t,o,r),Zn(e,n,t)}))}function ro(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return A()?h("conversation.conversationType",e.conversationType,R.NUMBER,!0)&&h("conversation.targetId",e.targetId,R.STRING,!0)&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return[4,t.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(v.O,"insertMessage ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function ao(e,n,t){return void 0===t&&(t={}),L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return ce("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),A()?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o,c,s,u,d,f,l,g,I,h,R,p,m,E,T,S;return P(this,(function(O){switch(O.label){case 0:return o=n.senderUserId,c=n.messageType,s=n.content,u=n.messageDirection,d=n.messageUId,f=n.canIncludeExpansion,l=n.expansion,g=n.disableNotification,I=n.sentTime,h=n.sentStatus,i.info(v.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),R=t.isUnread,p=t.searchContent,m={senderUserId:o,messageType:c,content:s,messageDirection:u,sentTime:I,sentStatus:h,searchContent:p,isUnread:R,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=O.sent(),T=E.code,S=E.data,T===r.SUCCESS?[2,{code:T,data:ae(S)}]:(i.warn(v.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 L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return A()?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return[4,t.getMessage(e)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:a,data:ae(i)}]:(o.warn(v.O,"getMessage ->code:".concat(a,",messageId:").concat(e)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function co(e){if(!A())return{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]};var n,t=e.conversationType,o=e.targetId;return h("conversationType",t,R.NUMBER,!0)&&h("targetId",o,R.STRING,!0)?(n=function(e){var n=e.getUnreadMentionedMessages(t,o),a=[];return n&&n.length&&n.forEach((function(e){return a.push(ae(e))})),{code:r.SUCCESS,data:a}},de?n(de,le,fe):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function so(e,n,t,o){return L(this,void 0,void 0,(function(){var a=this;return P(this,(function(i){return ce("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),A()?h("conversationType",e.conversationType,R.NUMBER,!0)&&h("targetId",e.targetId,R.STRING,!0)&&h("keyword",n,R.STRING,!0)&&h("timestamp",t,R.NUMBER)&&h("count",o,R.NUMBER)?[2,Ie((function(i,c){return L(a,void 0,void 0,(function(){var a,s,u,d;return P(this,(function(f){switch(f.label){case 0:return 1,[4,i.searchMessageByContent(e.conversationType,e.targetId,n,t,o,1,e.channelId)];case 1:return a=f.sent(),s=a.code,u=a.data,s===r.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(ae(e))})),[2,{code:s,data:{messages:d,count:null==u?void 0:u.count}}]):(c.warn(v.O,"searchMessages ->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,n,t){return L(this,void 0,void 0,(function(){var o,a,i,c=this;return P(this,(function(s){return ce("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),A()?(o=e.conversationType,a=e.targetId,i=e.channelId,h("conversationType",o,R.NUMBER,!0)&&h("targetId",a,R.STRING,!0)&&h("timestamp",n,R.NUMBER,!0)&&h("cleanSpace",t,R.BOOLEAN)?[2,Ie((function(s,u){return L(c,void 0,void 0,(function(){var c;return P(this,(function(d){switch(d.label){case 0:return[4,s.deleteMessagesByTimestamp(o,a,n,t,i)];case 1:return c=d.sent(),u.debug(v.A_DELETE_MESSAGES_S,JSON.stringify({code:c,conversationType:o,targetId:a,channelId:i,timestamp:n})),c===r.SUCCESS?[2,{code:c}]:(u.warn(v.O,"deleteLocalMessagesByTimestamp ->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 fo(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return ce("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),A()?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return n=e.conversationType,a=e.targetId,i=e.channelId,o.info(v.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(n)),[4,t.clearMessages(n,a,i)];case 1:return(c=s.sent())===r.SUCCESS?[2,{code:c}]:(o.warn(v.O,"clearMessages ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function lo(e,n,t,o){return L(this,void 0,void 0,(function(){var a=this;return P(this,(function(i){return ce("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),A()?[2,Ie((function(i,c){return L(a,void 0,void 0,(function(){var a,s,u;return P(this,(function(d){switch(d.label){case 0:return c.info(v.O,"searchConversationByContent ->keyword:".concat(e)),[4,i.searchConversationByContent(e,t,o,n)];case 1:return a=d.sent(),s=a.code,u=a.data,s===r.SUCCESS?[2,{code:s,data:u}]:(c.warn(v.O,"searchConversationByContent ->code:".concat(s,",keyword:").concat(e)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function go(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s;return P(this,(function(u){switch(u.label){case 0:return t=e.conversationType,i=e.targetId,c=e.channelId,a.info(v.O,"clearUnreadCountByTimestamp ->targetId:".concat(i,",conversationType:").concat(t)),[4,o.clearUnreadCountByTimestamp(t,i,n,c)];case 1:return(s=u.sent())===r.SUCCESS?[2,{code:s}]:(a.warn(v.O,"clearUnreadCountByTimestamp ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function vo(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return ce("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),A()?h("messageId",e,R.NUMBER,!0)&&h("receivedStatus",n,R.NUMBER,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t;return P(this,(function(i){switch(i.label){case 0:return a.info(v.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(n)),[4,o.setMessageReceivedStatus(e,n)];case 1:return(t=i.sent())===r.SUCCESS?[2,{code:t}]:(a.warn(v.O,"setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function Io(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("tag.tagId",e.tagId,R.STRING,!0)&&h("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&h("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&h("tag.tagName",e.tagName,R.STRING,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n;return P(this,(function(a){switch(a.label){case 0:return o.info(v.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,t.createTag(e)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(o.warn(v.O,"createTag ->code:".concat(n,",tagId:").concat(e.tagId)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("tagId",e,R.STRING,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n;return P(this,(function(a){switch(a.label){case 0:return o.info(v.O,"removeTag ->tagId:".concat(e)),[4,t.removeTag(e)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(o.warn(v.O,"removeTag ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("tag.tagId",e.tagId,R.STRING,!0)&&h("tag.tagName",e.tagName,R.STRING,!0)&&h("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n;return P(this,(function(a){switch(a.label){case 0:return o.info(v.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,t.updateTag(e)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(o.warn(v.O,"updateTag ->code:".concat(n,",tagId:").concat(e.tagId)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,a;return P(this,(function(i){switch(i.label){case 0:return[4,n.getTagList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(t.warn(v.O,"getTagList ->code:".concat(o)),[2,{code:o,msg:Ue[o]}])}}))}))}))]}))}))}function mo(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("conversationType",e.conversationType,R.NUMBER)&&h("targetId",e.targetId,R.STRING)&&h("channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return o.info(v.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,t.getTagsForConversation(e)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:Ue[a]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("tagId",e,R.STRING,!0)&&h("conversations",n,R.ARRAY,!0)&&!n.every((function(e){return!h("conversation.conversationType",e.conversationType,R.NUMBER,!0)||!h("conversation.targetId",e.targetId,R.STRING,!0)||!h("conversation.channelId",e.channelId,R.CHANNEL_ID)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t;return P(this,(function(i){switch(i.label){case 0:return a.info(v.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,n)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(a.warn(v.O,"addTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("tagId",e,R.STRING,!0)&&h("conversations",n,R.ARRAY,!0)&&!n.every((function(e){return!h("conversation.conversationType",e.conversationType,R.NUMBER,!0)||!h("conversation.targetId",e.targetId,R.STRING,!0)||!h("conversation.channelId",e.channelId,R.CHANNEL_ID)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t;return P(this,(function(i){switch(i.label){case 0:return a.info(v.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,n)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(a.warn(v.O,"removeTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("conversation.conversationType",e.conversationType,R.NUMBER,!0)&&h("conversation.targetId",e.targetId,R.STRING,!0)&&h("conversation.channelId",e.channelId,R.CHANNEL_ID)&&h("tagIds",n,R.ARRAY,!0)&&!n.every((function(e){return!h("tagId",e,R.STRING,!0)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t;return P(this,(function(i){switch(i.label){case 0:return a.info(v.O,"removeTagsForConversation ->tagIds:".concat(n,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,n)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(a.warn(v.O,"removeTagsForConversation ->code:".concat(t,",tagIds:").concat(n)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("tagId",e,R.STRING,!0)&&h("conversations",n,R.ARRAY,!0)&&!n.every((function(e){return!h("conversation.conversationType",e.conversationType,R.NUMBER,!0)||!h("conversation.targetId",e.targetId,R.STRING,!0)||!h("conversation.channelId",e.channelId,R.CHANNEL_ID)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t;return P(this,(function(i){switch(i.label){case 0:return a.info(v.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,n)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(a.warn(v.O,"removeTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return h("tagId",e,R.STRING,!0)&&h("count",n,R.NUMBER,!0)&&h("startTime",t,R.NUMBER,!0)?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o,c,s;return P(this,(function(u){switch(u.label){case 0:return i.info(v.O,"getConversationListByTag ->tagId:".concat(e)),[4,a.getConversationListByTag(e,t,n)];case 1:return o=u.sent(),c=o.code,s=o.data,c===r.SUCCESS?[2,{code:c,data:s}]:(i.warn(v.O,"getConversationListByTag ->code:".concat(c,",tagId:").concat(e)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("tagId",e,R.STRING,!0)&&h("containMuted",n,R.BOOLEAN,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return a.info(v.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,n)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS?[2,{code:i,data:c}]:(a.warn(v.O,"getUnreadCountByTag ->code:".concat(i,",tagId:").concat(e)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return h("tagId",e,R.STRING,!0)&&h("conversation.targetId",n.targetId,R.STRING,!0)&&h("conversation.conversationType",n.conversationType,R.NUMBER,!0)&&h("conversation.channelId",n.channelId,R.CHANNEL_ID)&&h("status.isTop",t,R.BOOLEAN,!0)?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o;return P(this,(function(c){switch(c.label){case 0:return i.info(v.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(n.targetId,",conversationType").concat(n.conversationType)),[4,a.setConversationStatusInTag(e,n,{isTop:t})];case 1:return(o=c.sent().code)===r.SUCCESS?[2,{code:o}]:(i.warn(v.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Ue[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}xt(C.COMBINE_HTML,(function(e,n){return new jn({remoteUrl:e.downloadUrl,nameList:n.nameList,summaryList:n.summaryList,conversationType:n.conversationType,user:n.user,extra:n.extra})}));var Ao={COMET:"comet",WEBSOCKET:"websocket"},yo={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var Mo=Object.freeze({__proto__:null,getAllConversationList:function(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return A()?h("channelId",e,R.ONLY_STRING)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return o.info(v.O,"getAllConversationList -> channelId: ".concat(e)),M(e)?[4,t.getConversationListWithAllChannel()]:[3,2];case 1:return n=s.sent(),[3,4];case 2:return[4,t.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:n=s.sent(),s.label=4;case 4:return a=n.code,i=n.data,a===r.SUCCESS&&i?(c=i.map((function(e){return ie(e)})),[2,{code:a,data:c}]):(o.warn(v.O,"getAllConversationList fail -> code: ".concat(a," channelId: ").concat(e)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return A()?h("startTime",e,R.NUMBER,!0)&&h("count",n,R.NUMBER,!0)&&h("channelId",t,R.ONLY_STRING)?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o,c,s,u,d,f;return P(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(n,", channelId: ").concat(t),i.info(v.O,"getConversationList -> ".concat(o)),M(t)?[4,a.getConversationListWithAllChannelByPage(e,n)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return s=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(s,e,n,t)];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 ie(e)})),[2,{code:u,data:f}]):(i.warn(v.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(n,t,o){return L(this,void 0,void 0,(function(){var a=this;return P(this,(function(i){return A()?h("keyword",n,R.STRING,!0)&&h("messageTypes",t,R.ARRAY,!0)&&h("channelId",o,R.ONLY_STRING)&&!t.every((function(e){return!h("messageType",e,R.STRING,!0)}))?[2,Ie((function(i,c){return L(a,void 0,void 0,(function(){var a,s,u,d,f;return P(this,(function(l){switch(l.label){case 0:return a="keyword: ".concat(n,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(o),c.info(v.O,"searchConversationByContent -> ".concat(e)),M(o)?[4,i.searchConversationByContentWithAllChannel(n,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,i.searchConversationByContent(n,t,o)];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 ie(e)})),[2,{code:u,data:f}]):(c.warn(v.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(a)),[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,n,t,o){return L(this,void 0,void 0,(function(){var a=this;return P(this,(function(i){return A()?h("conversation",e,R.CONVERSATION,!0)&&h("keyword",n,R.STRING,!0)&&h("startTime",t,R.NUMBER,!0)&&h("count",o,R.NUMBER,!0)?[2,Ie((function(i,c){return L(a,void 0,void 0,(function(){var a,s,u,d,f,l,g,I,h,R;return P(this,(function(p){switch(p.label){case 0:return a="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(n,", timestamp: ").concat(t,", count: ").concat(o),c.info(v.O,"searchMessages -> ".concat(a)),s=e.targetId,u=e.conversationType,d=e.channelId,M(d)?[4,i.searchMessageByContentWithAllChannel(u,s,n,t,o)]:[3,2];case 1:return f=p.sent(),[3,4];case 2:return 0,[4,i.searchMessageByContent(u,s,n,t,o,0,d)];case 3:f=p.sent(),p.label=4;case 4:return l=f.code,g=f.data,l===r.SUCCESS&&g?(I=g.messages,h=g.count,R=I.map((function(e){return ae(e)})),[2,{code:l,data:{messages:R,count:h}}]):(c.warn(v.O,"searchMessages fail -> code: ".concat(l," ").concat(a)),[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,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?h("conversation",e,R.CONVERSATION,!0)&&h("option",n,R.OBJECT,!0)&&h("option.keyword",n.keyword,R.STRING,!0)&&h("option.startTime",n.startTime,R.NUMBER,!0)&&h("option.endTime",n.endTime,R.NUMBER,!0)&&h("option.offset",n.offset,R.NUMBER)&&h("option.limit",n.limit,R.NUMBER)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l,g,I,h;return P(this,(function(R){switch(R.label){case 0:return t="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(n)),a.info(v.O,"searchMessageInTimeRange -> ".concat(t)),i=e.conversationType,c=e.targetId,s=n.keyword,u=n.startTime,d=n.endTime,f=n.offset,l=n.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(i,c,s,u,d,f,l)];case 1:return g=R.sent(),I=g.code,h=g.data,I===r.SUCCESS&&h?[2,{code:I,data:{messages:h.messages.map((function(e){return ae(e)}))}}]:(a.warn(v.O,"searchMessageInTimeRange fail -> code: ".concat(I,", ").concat(t)),[2,{code:I}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?h("conversation",e,R.CONVERSATION,!0)&&h("option",n,R.OBJECT,!0)&&h("option.count",n.count,R.NUMBER)&&h("option.timestamp",n.timestamp,R.NUMBER)&&h("option.order",n.order,(function(e){return[0,1].includes(e)}))&&h("option.messageTypes",n.messageTypes,R.ARRAY,!0)&&!n.messageTypes.every((function(e){return!h("option.messageType",e,R.STRING,!0)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l,g,I,h,R,p,m,E;return P(this,(function(T){switch(T.label){case 0:return t=n.count,i=n.timestamp,c=n.order,s=n.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(n)),a.info(v.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,t||(t=20),i||(i=0),c||(c=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,i,t,s,c,l)];case 1:return g=T.sent(),I=g.code,h=g.data,I===r.SUCCESS?(p=(R=h).list,m=R.hasMore,E=p.map((function(e){return ae(e)})),[2,{code:I,data:{messages:E,hasMore:m}}]):(a.warn(v.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(I," ").concat(u)),[2,{code:I,msg:Ue[I]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?h("conversation",e,R.CONVERSATION,!0)&&h("timestamp",n,R.NUMBER,!0)?[2,Ie((function(o,r){return L(t,void 0,void 0,(function(){var t,a,i,c;return P(this,(function(s){switch(s.label){case 0:return t="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(n),r.info(v.O,"updateSentMsgReceiptStatus -> ".concat(t)),a=e.conversationType,i=e.targetId,c=e.channelId,[4,o.setMessageStatusToRead(a,i,n,c)];case 1:return[2,s.sent()]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?h("messageId",e,R.NUMBER,!0)&&h("receivedStatus",n,(function(e){return!M(a[e])}),!0)?[2,Ie((function(o,r){return L(t,void 0,void 0,(function(){return P(this,(function(t){switch(t.label){case 0:return r.info(v.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(n)),[4,o.setMessageReceivedStatus(e,n)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?h("messageId",e,R.NUMBER,!0)&&h("sentStatus",n,(function(e){return!M(B[e])}),!0)?[2,Ie((function(o,r){return L(t,void 0,void 0,(function(){return P(this,(function(t){switch(t.label){case 0:return r.info(v.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(n)),[4,o.setMessageSentStatus(e,n)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,n,t){return void 0===t&&(t=""),L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return A()?h("messageId",e,R.NUMBER,!0)&&h("content",n,R.OBJECT,!0)&&h("messageType",t,R.ONLY_STRING,!0)?[2,Ie((function(r,a){return L(o,void 0,void 0,(function(){return P(this,(function(o){switch(o.label){case 0:return a.info(v.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(t)),[4,r.setMessageContent(e,n,t)];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 L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return A()?!h("messageIds",e,R.ARRAY,!0)||e.every((function(e){return!h("messageId",e,R.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){return P(this,(function(n){switch(n.label){case 0:return o.info(v.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,t.deleteMessages(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return A()?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return n=e.conversationType,a=e.targetId,i=e.channelId,o.info(v.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(n)),[4,t.clearMessages(n,a,i)];case 1:return(c=s.sent())===r.SUCCESS?[2,{code:c}]:(o.warn(v.O,"clearMessages ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,n,t){return L(this,void 0,void 0,(function(){var o,a,i,c=this;return P(this,(function(s){return A()?(o=e.conversationType,a=e.targetId,i=e.channelId,h("conversationType",o,R.NUMBER,!0)&&h("targetId",a,R.STRING,!0)&&h("timestamp",n,R.NUMBER,!0)&&h("cleanSpace",t,R.BOOLEAN)?[2,Ie((function(e,s){return L(c,void 0,void 0,(function(){var c;return P(this,(function(u){switch(u.label){case 0:return[4,e.deleteMessagesByTimestamp(o,a,n,t,i)];case 1:return(c=u.sent())===r.SUCCESS?[2,{code:c}]:(s.warn(v.O,"deleteMessagesByTimestamp ->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]}]}))}))},insertMessage:function(e,n,t){return void 0===t&&(t={}),L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return A()?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o,c,s,u,d,f,l,g,I,h,R,p,m,E,T;return P(this,(function(S){switch(S.label){case 0:return o=n.senderUserId,c=n.messageType,s=n.content,u=n.messageDirection,n.messageUId,d=n.canIncludeExpansion,f=n.expansion,l=n.disableNotification,g=n.sentTime,I=n.sentStatus,i.info(v.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=t.isUnread,R=t.searchContent,p={senderUserId:o,messageType:c,content:s,messageDirection:u,sentTime:g,sentStatus:I,searchContent:R,isUnread:h,messageUId:"",disableNotification:l,canIncludeExpansion:d,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,p)];case 1:return m=S.sent(),E=m.code,T=m.data,E===r.SUCCESS?[2,{code:E,data:ae(T)}]:(i.warn(v.O,"insertMessage ->code:".concat(E,",targetId:").concat(e.targetId)),[2,{code:E,msg:Ue[E]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return A()?[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,r;return P(this,(function(a){switch(a.label){case 0:return t.info(v.O,"clearLocalData ->"),[4,n.clearData()];case 1:return e=a.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}}),Uo=function(e,n,t){this.type=e,this.userIdList=n,this.mentionedContent=t};export{qn as BaseMessage,jn as CombineMessage,Ao as ConnectType,D as Events,Qn as FileMessage,$n as GIFMessage,Yn as HQVoiceMessage,Kn as ImageMessage,nt as LocationMessage,Uo as MentionedInfoBody,yo as MessageType,ot as ReferenceMessage,rt as RichContentMessage,B as SentStatus,Wn as SightMessage,Xn as TextMessage,et as VoiceMessage,Ce as __addSDKVersion,Eo as addConversationsToTag,he as addEventListener,Io as addTag,kn as addToBlacklist,xn as bindRTCRoomForChatroom,ze as clearAllMessagesUnreadStatus,Ee as clearEventListeners,Qt as clearHistoryMessages,fo as clearMessages,Je as clearMessagesUnreadStatus,He as clearTextMessageDraft,go as clearUnreadCountByTimestamp,we as connect,uo as deleteLocalMessagesByTimestamp,jt as deleteMessages,Se as destroy,be as disconnect,Mo as electronExtension,bn as forceRemoveChatRoomEntry,Ln as forceSetChatRoomEntry,Bn as getAllChatRoomEntries,an as getAllConversationState,mn as getAllUltraGroupUnreadCount,En as getAllUltraGroupUnreadMentionedCount,rn as getAllUnreadMentionedCount,Vn as getBlacklist,Fn as getBlacklistStatus,sn as getBlockUltraGroupList,en as getBlockedConversationList,Dn as getChatRoomEntry,yn as getChatRoomInfo,Gn as getChatroomHistoryMessages,Oe as getConnectionStatus,Be as getConversation,De as getConversationList,Qe as getConversationNotificationLevel,$e as getConversationNotificationStatus,No as getConversationsFromTagByPage,_e as getCurrentUserId,Ae as getDeviceId,bt as getFileToken,Dt as getFileUrl,ro as getFirstUnreadMessage,qt as getHistoryMessages,io as getMessage,to as getMessageReader,Zt as getRemoteHistoryMessages,Ne as getServerTime,po as getTags,mo as getTagsFromConversation,xe as getTextMessageDraft,tn as getTopConversationList,Ve as getTotalUnreadCount,Fe as getTotalUnreadCountByLevels,qe as getTotalUnreadMentionedCountByLevels,hn as getUltraGroupDefaultNotificationLevel,Sn as getUltraGroupFirstUnreadMessageTimestamp,cn as getUltraGroupList,dn as getUltraGroupMessageListByMessageUId,pn as getUltraGroupUnreadCountByTargetId,In as getUltraGroupUnreadMentionedCountByTargetId,Tn as getUltraGroupUnreadMentionedMessages,Ze as getUnreadCount,_o as getUnreadCountByTag,on as getUnreadMentionedCount,co as getUnreadMentionedMessages,Te as init,ao as insertMessage,ye as installPlugin,_n as joinChatRoom,Cn as joinExistChatRoom,vn as modifyMessage,Re as onceEventListener,An as quitChatRoom,Xt as recallMessage,oo as registerMessageType,gn as removeAllExpansionForUltraGroupMessage,wn as removeChatRoomEntries,Pn as removeChatRoomEntry,Ge as removeConversation,To as removeConversationsFromTag,pe as removeEventListener,me as removeEventListeners,ln as removeExpansionForUltraGroupMessage,Hn as removeFromBlacklist,eo as removeMessageExpansionForKey,ho as removeTag,Oo as removeTagFromConversations,So as removeTagsFromConversation,ke as saveTextMessageDraft,lo as searchConversationByContent,so as searchMessages,kt as sendFileMessage,Vt as sendHQVoiceMessage,Ht as sendImageMessage,Bt as sendMessage,Jt as sendReadReceiptMessage,zt as sendReadReceiptRequest,Kt as sendReadReceiptResponse,Yt as sendReadReceiptResponseV2,Ft as sendSightMessage,Wt as sendSyncReadStatusMessage,Gt as sendTextMessage,no as sendTypingStatusMessage,un as sendUltraGroupTypingStatus,Un as setChatRoomEntries,Mn as setChatRoomEntry,Xe as setConversationNotificationLevel,je as setConversationNotificationStatus,nn as setConversationToTop,Co as setConversationToTopInTag,vo as setMessageReceivedStatus,Rn as setUltraGroupDefaultNotificationLevel,fn as updateExpansionForUltraGroupMessage,$t as updateMessageExpansion,Ro as updateTag};
1
+ import{NetworkType as e,HttpMethod as n,HTTP_TIMEOUT as t,appendUrl as o,ErrorCode as r,ReceivedStatus as a,ConversationType as i,isNumber as c,EventEmitter as s,VersionManage as u,assert as d,isArray as f,isHttpUrl as l,APIContext as g,LogTagId as v,logger as I,validate as h,AssertRules as R,isValidConversationType as p,isValidNotificationLevel as m,NotificationLevel as E,UltraGroupChannelType as T,isString as S,getUUID as O,UploadMethod as N,isValidFileType as _,FileType as C,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 n,t=1,o=arguments.length;t<o;t++)for(var r in n=arguments[t])Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);return e},U.apply(this,arguments)};function L(e,n,t,o){return new(t||(t=Promise))((function(r,a){function i(e){try{s(o.next(e))}catch(e){a(e)}}function c(e){try{s(o.throw(e))}catch(e){a(e)}}function s(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(i,c)}s((o=o.apply(e,n||[])).next())}))}function P(e,n){var t,o,r,a,i={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function c(a){return function(c){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,o&&(r=2&a[0]?o.return:a[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,a[1])).done)return r;switch(o=0,r&&(a=[2&a[0],r.value]),a[0]){case 0:case 1:r=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,o=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(r=i.trys,(r=r.length>0&&r[r.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!r||a[1]>r[0]&&a[1]<r[3])){i.label=a[1];break}if(6===a[0]&&i.label<r[1]){i.label=r[1],r=a;break}if(r&&i.label<r[2]){i.label=r[2],i.ops.push(a);break}r[2]&&i.ops.pop(),i.trys.pop();continue}a=n.call(e,i)}catch(e){a=[6,e],o=0}finally{t=r=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}var w=function(){return!("undefined"==typeof uni||!function(e){for(var n=["request","getSystemInfo"],t=0,o=n.length;t<o;t++)if(!e[n[t]])return!1;return!0}(uni))},b=w();var D,B,G={tag:"browser",httpReq:function(e){var r=e.method||n.GET,a=e.timeout||t,i=e.headers,c=e.query,s=e.body,u=o(e.url,c);return new Promise((function(e){var n,t=(n="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest,"undefined"!=typeof XMLHttpRequest&&n?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:new ActiveXObject("Microsoft.XMLHTTP")),o="[object XDomainRequest]"===Object.prototype.toString.call(t);if(t.open(r,u),i&&t.setRequestHeader)for(var c in i)t.setRequestHeader(c,i[c]);if(o){t.timeout=a,t.onload=function(){e({data:t.responseText,status:t.status||200})},t.onerror=function(){e({status:t.status||0})},t.ontimeout=function(){e({status:t.status||0})};var d="object"==typeof s?JSON.stringify(s):s;t.send(d)}else t.onreadystatechange=function(){4===t.readyState&&e({data:t.responseText,status:t.status})},t.onerror=function(){e({status:t.status||0})},setTimeout((function(){t.abort(),e({status:t.status||0})}),a),t.send(s)}))},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,n){var t=new WebSocket(e,n);return t.binaryType="arraybuffer",{onClose:function(e){t.onclose=function(n){var t=n.code,o=n.reason;e(t,o)}},onError:function(e){t.onerror=e},onMessage:function(e){t.onmessage=function(n){e(n.data)}},onOpen:function(e){t.onopen=e},send:function(e){t.send(e)},close:function(e,n){t.close()}}},getNetworkType:function(){var n=navigator.connection||navigator.mozConnection||navigator.webkitConnection,t=n.type,o=n.effectiveType,r=t||o||e.UNKONWN;return new Promise((function(e){e(r)}))}},x=w(),k=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return wx[e].apply(wx,n)}catch(e){null===console||void 0===console||console.error(e)}}},H={setItem:k("setStorageSync"),getItem:k("getStorageSync"),removeItem:k("removeStorageSync"),clear:k("clearStorageSync")},V={tag:"wechat",httpReq:function(e){var a=e.method||n.GET,i=e.timeout||t,c=e.headers,s=e.query,u=e.body,d=o(e.url,s);return new Promise((function(e){wx.request({url:d,method:a,header:c,timeout:i,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:H,sessionStorage:H,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:x,createWebSocket:function(e,n){var t=wx.connectSocket({url:e,protocols:n});return{onClose:function(e){t.onClose((function(n){e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){e(n.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){wx.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},F=w(),q=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{if("setStorageSync"===e)return my[e]({key:n[0],data:JSON.parse(n[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:n[0]});var o=my[e]({key:n[0]}).data;return o?JSON.stringify(o):o}catch(e){}}},Z={setItem:q("setStorageSync"),getItem:q("getStorageSync"),removeItem:q("removeStorageSync"),clear:q("clearStorageSync")},J={tag:"alipay",httpReq:function(e){var a=e.method||n.GET,i=e.timeout||t,c=e.headers,s=e.query,u=e.body,d=o(e.url,s),f=e.dataType||"json";return new Promise((function(e){my.request({url:d,method:a,headers:c,timeout:i,data:u,dataType:f,success:function(n){e({data:n.data,status:n.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(n){e(n.errMsg)}))},onMessage:function(e){my.onSocketMessage((function(n){n.isBuffer?e(my.base64ToArrayBuffer(n.data)):e(n.data)}))},onOpen:function(e){my.onSocketOpen(e)},send:function(e){my.sendSocketMessage({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){my.closeSocket()}}},getNetworkType:function(){return new Promise((function(n){my.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},z=w(),K=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return tt[e].apply(tt,n)}catch(e){}}},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(n){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,n){var t=tt.connectSocket({url:e,protocols:n});return{onOpen:function(e){t.onOpen(e)},onClose:function(e){t.onClose((function(n){return e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){return e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){return e(n.data)}))},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){tt.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},X=w(),j=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return swan[e].apply(swan,n)}catch(e){}}},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(n,t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var t=(null==e?void 0:e.data)||{},o={data:JSON.stringify(t),status:e.statusCode};n(o)},fail:function(e){n({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,n){var t=swan.connectSocket({url:e,protocols:n});return{onOpen:function(e){t.onOpen(e)},onClose:function(e){t.onClose((function(n){return e(n.code,n.reason)}))},onError:function(e){t.onError((function(n){return e(n.errMsg)}))},onMessage:function(e){t.onMessage((function(n){return e(n.data)}))},send:function(e){t.send({data:e})},close:function(e,n){t.close({code:e,reason:n})}}},getNetworkType:function(){return L(this,void 0,void 0,(function(){return P(this,(function(n){return[2,new Promise((function(n){swan.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))]}))}))}},ee=function(e){return function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];try{return uni[e].apply(uni,n)}catch(e){null===console||void 0===console||console.error(e)}}},ne={setItem:ee("setStorageSync"),getItem:ee("getStorageSync"),removeItem:ee("removeStorageSync"),clear:ee("clearStorageSync")},te={tag:"uniapp",httpReq:function(e){var a=e.method||n.GET,i=e.timeout||t,c=e.headers,s=e.query,u=e.body,d=o(e.url,s);return new Promise((function(e){uni.request({url:d,method:a,header:c,timeout:i,data:u,success:function(n){e({data:n.data,status:n.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:ne,sessionStorage:ne,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,n){var t={complete:function(){},url:e,protocols:n},o=uni.connectSocket(t);return{onClose:function(e){o.onClose((function(n){e(n.code,n.reason)}))},onError:function(e){o.onError((function(n){e(n.errMsg)}))},onMessage:function(e){o.onMessage((function(n){e(n.data)}))},onOpen:function(e){o.onOpen(e)},send:function(e){o.send({data:e})},close:function(e,n){o.close({code:e,reason:n})}}},getNetworkType:function(){return new Promise((function(n){uni.getNetworkType({success:function(e){var t=e.networkType;n(t)},fail:function(){n(e.UNKONWN)}})}))}},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 te;case"mp-baidu":return $;case"mp-toutiao":return W;case"mp-alipay":return J;case"mp-weixin":return V;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)?V:G;function ae(e){var n=e.conversationType,t=e.channelId,o=e.messageType,r=e.content,s=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,p=e.expansion,m=e.receivedStatus,E=e.disableNotification,T=e.isMentioned,S=e.isStatusMessage,O=e.readReceiptInfo,N=e.pushConfig,_=e.messageId,C=e.isInterrupt,A=e.isModifyMessage,y=e.channelType,M=e.sentStatus;m||(m=a.UNREAD);var U={messageType:o,channelId:t||"",content:r,senderUserId:s,targetId:u,conversationType:n,sentTime:d,receivedTime:f,messageUId:l,messageDirection:g,isPersited:v,isCounted:I,isMentioned:T,disableNotification:E,isStatusMessage:S,canIncludeExpansion:R,expansion:p,receivedStatus:m,readReceiptInfo:O,pushConfig:N,messageId:_,isInterrupt:C,isModifyMessage:A,sentStatus:M};return n!==i.ULTRA_GROUP&&(U.isOffLineMessage=h),n===i.ULTRA_GROUP&&c(y)&&(U.channelType=y),U}function ie(e){var n=e.conversationType,t=e.targetId,o=e.latestMessage,r=e.unreadMessageCount,a=e.hasMentioned,i=e.mentionedInfo,c=e.lastUnreadTime,s=e.notificationStatus,u=e.notificationLevel,d=e.isTop,f=e.channelId,l=e.unreadMentionedCount;return{conversationType:n,targetId:t,latestMessage:o&&ae(o),unreadMessageCount:r,hasMentioned:a,mentionedInfo:a?{type:null==i?void 0:i.type,userIdList:null==i?void 0:i.userIdList}:void 0,lastUnreadTime:c,notificationStatus:s,notificationLevel:u,isTop:d,channelId:f,unreadMentionedCount:l}}function ce(e,n){null===console||void 0===console||console.warn("Method '".concat(e,"' is deprecated, please use '").concat(n,"' instead"))}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED"}(D||(D={})),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"}(B||(B={}));var se=new s,ue={onConnecting:function(){se.emit(D.CONNECTING)},onConnected:function(){se.emit(D.CONNECTED)},onDisconnect:function(e){se.emit(D.DISCONNECT,e)},onSuspend:function(e){se.emit(D.SUSPEND,e)},batchMessage:function(e){se.emit(D.MESSAGES,{messages:e.map((function(e){return ae(e)}))})},typingState:function(e){se.emit(D.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,n,t){se.emit(D.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:n,sentTime:t})},messageReceiptRequest:function(e,n,t){se.emit(D.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:n,senderUserId:t})},messageReceiptResponse:function(e,n,t){se.emit(D.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:n,messageUIdList:t})},conversationState:function(e){var n=e.map((function(e){var n=e.conversationType,t={conversationType:n,latestMessage:e.latestMessage?ae(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return n===i.ULTRA_GROUP?(t.versionTime=e.versionTime,{conversation:t}):(t.hasMentioned=e.hasMentioned,t.mentionedInfo=e.mentionedInfo,t.isTop=e.isTop,{conversation:t,updatedItems:e.updatedItems})}));se.emit(D.CONVERSATION,{conversationList:n})},chatroomState:function(e){se.emit(D.CHATROOM,e)},expansion:function(e){se.emit(D.EXPANSION,e)},pullFinished:function(){se.emit(D.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){se.emit(D.TAG)},conversationTagChanged:function(){se.emit(D.CONVERSATION_TAG)},messageBlocked:function(e){se.emit(D.MESSAGE_BLOCKED,e)},ultraGroupEnable:function(e){se.emit(D.ULTRA_GROUP_ENABLE,e)},operateStatus:function(e){se.emit(D.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){se.emit(D.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e)},ultraGroupMessageModified:function(e){se.emit(D.ULTRA_GROUP_MESSAGE_MODIFIED,e)},ultraGroupMessageRecalled:function(e){se.emit(D.ULTRA_GROUP_MESSAGE_RECALLED,e)},ultraGroupChannelChangeType:function(e){se.emit(D.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){se.emit(D.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){se.emit(D.ULTRA_GROUP_CHANNEL_DELETE,e)}};u.add("imlib-next","5.6.0-beem-enterprise");var de=null,fe=null,le=null;function ge(){return L(this,void 0,void 0,(function(){return P(this,(function(e){switch(e.label){case 0:return de?(le.info(v.A_DESTROY_O),[4,g.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,n,t){se.on(e,n,t)}function Re(e,n,t){se.once(e,n,t)}function pe(e,n,t){se.off(e,n,t)}function me(e){se.removeAll(e)}function Ee(){se.clear()}function Te(e){!function(e){var n=e.appkey,t=e.navigators;de?le.warn(v.A_INIT_REPEAT_O):(d("options.navigators",e.navigators,(function(e){return f(e)&&(0===e.length||e.every(l))})),fe=e,de=g.init(re,{appkey:e.appkey,apiVersion:"5.6.0-beem-enterprise",navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,checkCA:e.checkCA,httpInMainProcess:!!e.httpInMainProcess}),(le=de.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),le.info(v.A_INIT_O,JSON.stringify({appkey:n,navigators:t,version:"5.6.0-beem-enterprise",commit:"57efb06c458b49111c091895c5758817d00ce033"})),de.assignWatcher(ue))}(e)}function Se(){return L(this,void 0,void 0,(function(){return P(this,(function(e){return de?(Ee(),[2,ge()]):[2]}))}))}function Oe(){return ve((function(e){return e.getConnectionStatus()}))}function Ne(){return ve((function(e){return e.getServerTime()}))}function _e(){return ve((function(e){return e.getCurrentUserId()}))}function Ce(e,n){u.add(e,n)}function Ae(){return ve((function(e){return e.getDeviceId()}))}function ye(e,n){return ve((function(t){return t.install(e,n)}))}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 Le in Me){var Pe=Me[Le].code;Ue[Pe]=Le}function we(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return h("token",e,R.STRING,!0)&&h("reconnectKickEnable",n,R.BOOLEAN)?(t=a.createTraceId(),a.info(v.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:n}),t),[4,o.connect(e,!1,n,t)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return i=s.sent(),c=i.code===r.SUCCESS?"info":"warn",a[c](v.A_CONNECT_R,JSON.stringify({code:i.code,userId:i.userId}),t),i.code===r.SUCCESS?[2,{code:i.code,data:{userId:i.userId}}]:[2,{code:i.code,msg:Ue[i.code]}]}}))}))}))]}))}))}function be(){return I.info(v.A_DISCONNECT_O,{}),ve((function(e){return e.disconnect()}))}function De(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return[4,o.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,n)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS&&c?[2,{code:0,data:c.map((function(e){return ie(e)}))}]:(a.warn(v.O,"get conversation list fail ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function Be(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return[4,t.getConversation(e.conversationType,e.targetId,e.channelId||"")];case 1:return n=c.sent(),a=n.code,i=n.data,a!==r.SUCCESS?(o.warn(v.O,"getConversation ->code:".concat(a,", targetId:").concat(e.targetId)),[2,{code:a,msg:Ue[a]}]):[2,{code:a,data:i?ie(i):null}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ge(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a;return P(this,(function(i){switch(i.label){case 0:return[4,t.removeConversation(e.conversationType,e.targetId,e.channelId)];case 1:return n=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(v.O,"destroy conversation ->".concat(a)),n!==r.SUCCESS?(o.warn(v.O,"destroy conversation fail ->".concat(n,":").concat(Ue[n],",").concat(a)),[2,{code:n,msg:Ue[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xe(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return[4,t.getConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return n=s.sent(),a=n.code,i=n.data,c="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(v.O,"get draft ->".concat(c)),a===r.SUCCESS?[2,{code:a,data:i||""}]:(o.warn(v.O,"get draft fail ->".concat(a,":").concat(Ue[a],",").concat(c)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ke(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)&&h("draft",n,R.STRING,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(v.O,"set draft ->".concat(t)),[4,o.saveConversationMessageDraft(e.conversationType,e.targetId,n,e.channelId)];case 1:return(i=c.sent())===r.SUCCESS?[2,{code:i}]:(a.warn(v.O,"set 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){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a;return P(this,(function(i){switch(i.label){case 0:return n="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(v.O,"delete draft ->".concat(n)),[4,t.clearConversationMessageDraft(e.conversationType,e.targetId,e.channelId)];case 1:return(a=i.sent())===r.SUCCESS?[2,{code:a}]:(o.warn(v.O,"delete draft fail ->".concat(a,":").concat(Ue[a],",").concat(n)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ve(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("includeMuted",e,R.BOOLEAN,!1)&&h("conversationTypes",n,R.ARRAY,!1)&&!(null==n?void 0:n.every((function(e){return!h("conversationType",e,p)})))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return a.debug(v.O,"get total unread count -> ConversationType:".concat(JSON.stringify(n)," includeMuted:").concat(e)),[4,o.getTotalUnreadCount("",n,e)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS?[2,{code:i,data:c}]:(a.warn(v.O,"getTotalUnreadCount fail ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Fe(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return!h("conversationTypes",e,R.ARRAY,!0)||!h("levels",n,R.ARRAY,!0)||e.every((function(e){return!h("conversationType",e,p)}))||n.every((function(e){return!h("level",e,m)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,n)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS?[2,{code:i,data:c}]:(a.warn(v.O,"getTotalUnreadCountByLevels fail ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function qe(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return!h("conversationTypes",e,R.ARRAY,!0)||!h("levels",n,R.ARRAY,!0)||e.every((function(e){return!h("conversationType",e,p)}))||n.every((function(e){return!h("level",e,m)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return[4,o.getTotalUnreadCountByLevels(e,n,!0)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS?[2,{code:i,data:c}]:(a.warn(v.O,"getTotalUnreadMentionedCountByLevels fail ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function Ze(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return[4,t.getUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return n=s.sent(),a=n.code,i=n.data,c="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(v.O,"get unreadCount ->".concat(c)),a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(v.O,"get unreadCount fail ->".concat(a,":").concat(Ue[a],",").concat(c)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Je(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a;return P(this,(function(i){switch(i.label){case 0:return[4,t.clearUnreadCount(e.conversationType,e.targetId,e.channelId)];case 1:return n=i.sent(),a="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),o.debug(v.O,"clear unreadMsgNum ->".concat(a)),n!==r.SUCCESS?(o.warn(v.O,"clear unreadMsgNum fail ->".concat(n,":").concat(Ue[n],",").concat(a)),[2,{code:n,msg:Ue[n]}]):[2,{code:n}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ze(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){return P(this,(function(e){switch(e.label){case 0:return[4,n.clearAllUnreadCount()];case 1:return[2,{code:e.sent()}]}}))}))}))]}))}))}Me.ROAMING_SERVICE_UNAVAILABLE.code;var Ke=function(e){return!(!h("options.conversationType",e.conversationType,p,!0)||!h("options.targetId",e.targetId,R.STRING,!0)||!h("options.channelId",e.channelId,R.CHANNEL_ID))},Ye=function(e,n,t){void 0===t&&(t="");var o="conversationType:".concat(n.conversationType,",targetId:").concat(n.targetId);return e.debug(v.O,"".concat(t," -> ").concat(o)),o},We=function(e,n,t,o){return void 0===o&&(o=""),L(void 0,void 0,void 0,(function(){var a,i;return P(this,(function(c){switch(c.label){case 0:return a=Ye(e,n,o),[4,t()];case 1:return(i=c.sent())!==r.SUCCESS?(e.warn(v.O,"".concat(o," fail -> ").concat(i," : ").concat(Ue[i]," , ").concat(a)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))};function Xe(e,n){return L(this,void 0,void 0,(function(){return P(this,(function(t){return h("notificationLevel",n,(function(e){return void 0!==E[e]}),!0)&&Ke(e)?[2,Ie((function(t,o){return We(o,e,(function(){return t.setConversationNotificationLevel(e.conversationType,e.targetId,n,e.channelId)}),"setConversationNotificationLevel")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function je(e,n){return L(this,void 0,void 0,(function(){return P(this,(function(t){return h("notificationStatus",n,(function(e){return 1===e||2===e}),!0)&&Ke(e)?[2,Ie((function(t,o){return We(o,e,(function(){return t.setConversationStatus(e.conversationType,e.targetId,void 0,n,e.channelId)}),"setConversationNotificationStatus")}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qe(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return Ke(e)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return n=Ye(o,e,"getConversationNotificationLevel"),[4,t.getConversationNotificationLevel(e.conversationType,e.targetId,e.channelId)];case 1:return a=s.sent(),i=a.code,c=a.data,i===r.SUCCESS?[2,{code:i,data:c}]:(o.warn(v.O,"getConversationNotificationLevel fail -> ".concat(i," : ").concat(Ue[i]," , ").concat(n)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $e(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.conversationType",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return o.info(v.O,"getConversationNotificationStatus ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,t.getConversationNotificationStatus(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(v.O,"getConversationNotificationStatus ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function en(){return L(this,void 0,void 0,(function(){return P(this,(function(e){return[2,Ie((function(e){return e.getBlockConversationList()}))]}))}))}function nn(e,n){return void 0===n&&(n=!0),L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.type",e.conversationType,p,!0)&&h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(v.O,"set conversation status ->".concat(t)),[4,o.setConversationStatus(e.conversationType,e.targetId,n,void 0,e.channelId)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"set conversation status fail ->".concat(i,":").concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function tn(){return L(this,void 0,void 0,(function(){return P(this,(function(e){return[2,Ie((function(e){return e.getTopConversationList()}))]}))}))}function on(e){return L(this,void 0,void 0,(function(){return P(this,(function(n){return h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(n,t){return t.debug(v.O,"getUnreadMentionedCount".concat(e.targetId,",channelId:").concat(e.channelId)),n.getUnreadMentionedCount(e)}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function rn(){return L(this,void 0,void 0,(function(){return P(this,(function(e){return[2,Ie((function(e,n){return n.debug(v.O,"getAllUnreadMentionedCount"),e.getAllUnreadMentionedCount()}))]}))}))}function an(){return L(this,void 0,void 0,(function(){return P(this,(function(e){return[2,Ie((function(e){return e.getAllConversationState()}))]}))}))}function cn(e){return void 0===e&&(e={}),L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.targetId",e.targetId,R.STRING,!1)&&h("options.channelType",e.channelType,(function(e){return void 0!==T[e]}),!1)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return[4,t.getUltraGroupList(e)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:r.SUCCESS,data:i}]:(o.warn(v.O,"get ultragroup ->".concat(a,":").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function sn(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,a;return P(this,(function(i){switch(i.label){case 0:return[4,n.getBlockUltraGroupList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(t.warn(v.O,"get block ultragroup ->".concat(o,":").concat(Ue[o])),[2,{code:o,msg:Ue[o]}])}}))}))}))]}))}))}function un(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)&&h("options.conversationType",e.conversationType,p,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n;return P(this,(function(a){switch(a.label){case 0:return[4,t.sendUltraGroupTypingStatus(e)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(v.O,"send ultraGroup OperateStatus ->".concat(n,":").concat(Ue[n])),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function dn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)&&h("options.conversationType",e.conversationType,p,!0)&&h("msgs",n,R.ARRAY,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l;return P(this,(function(g){switch(g.label){case 0:return t=e.targetId,i=e.conversationType,c=e.channelId,s=[],n.forEach((function(e){var n=e.sendTime,t=e.messageUId;s.push({sendTime:n,messageUId:t,channelId:c})})),u={targetId:t,conversationType:i,messages:s},[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}]:(a.warn(v.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 fn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("expansion",e,R.OBJECT,!0)&&h("message",n,R.OBJECT,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l,g;return P(this,(function(I){switch(I.label){case 0:return t=n.conversationType,i=n.targetId,c=n.messageUId,s=n.sentTime,u=n.canIncludeExpansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(c),a.debug(v.O,"update expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:t,sendTime:s,canIncludeExpansion:u,messageUId:c,expansion:e},[4,o.expandUltraMessage(l)];case 1:return(g=I.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(v.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 ln(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("expansion",e,R.ARRAY,!0)&&h("message",n,R.OBJECT,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l,g;return P(this,(function(I){switch(I.label){case 0:return t=n.conversationType,i=n.targetId,c=n.messageUId,s=n.sentTime,u=n.canIncludeExpansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(d,",messageUId:").concat(c),a.debug(v.O,"remove expansion for ultragroup message ->".concat(f)),l={targetId:i,channelId:d,conversationType:t,sendTime:s,canIncludeExpansion:u,messageUId:c,keys:e},[4,o.expandUltraMessage(l)];case 1:return(g=I.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(v.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 gn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("message",e,R.OBJECT,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c,s,u,d,f,l;return P(this,(function(g){switch(g.label){case 0:return n=e.conversationType,a=e.targetId,i=e.messageUId,c=e.sentTime,s=e.canIncludeExpansion,u=e.channelId,d="conversationType:".concat(n,",targetId:").concat(a,",channelId:").concat(u,",messageUId:").concat(i),o.debug(v.O,"remove all expansion for ultraGroup message ->".concat(d)),f={targetId:a,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:s,messageUId:i,removeAll:!0},[4,t.expandUltraMessage(f)];case 1:return(l=g.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(o.warn(v.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 vn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("content",e,R.OBJECT,!0)&&h("message",n,R.OBJECT,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l,g,I;return P(this,(function(h){switch(h.label){case 0:return t=n.conversationType,i=n.targetId,c=n.messageUId,s=n.senderUserId,u=n.sentTime,d=n.canIncludeExpansion,f=n.channelId,l="conversationType:".concat(t,",targetId:").concat(i,",channelId:").concat(f,",messageUId:").concat(c),a.debug(v.O,"update ultragroup message expansion ->".concat(l)),g={targetId:i,channelId:f,conversationType:t,fromUserId:s,sendTime:u,canIncludeExpansion:d,messageUId:c,content:e},[4,o.modifyMessage(g)];case 1:return(I=h.sent().code)===r.SUCCESS?[2,{code:r.SUCCESS}]:(a.warn(v.O,"modify ultraGroup message ->".concat(I,":").concat(Ue[I])),[2,{code:I,msg:Ue[I]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function In(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&h("notificationLevels",n,R.ARRAY)&&!(null==n?void 0:n.every((function(e){return!h("notificationLevel",e,m)})))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return a.debug(v.O,"get UltraGroup unreadMentionedCount by targetId: ".concat(e,", notificationLevels: ").concat(JSON.stringify(n))),[4,o.getUltraGroupUnreadMentionedCountByTargetId(e,n)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS?[2,{code:r.SUCCESS,data:c}]:(a.warn(v.O,"get UltraGroup unreadMentionedCount by targetId error ->".concat(i,":").concat(Ue[i])),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function hn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c,s;return P(this,(function(u){switch(u.label){case 0:return n="getUltraGroupDefaultNotificationLevel",a="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),o.debug(v.O,"".concat(n," -> ").concat(a)),[4,t.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return i=u.sent(),c=i.code,s=i.data,c===r.SUCCESS?[2,{code:c,data:s}]:(o.warn(v.O,"".concat(n," fail -> ").concat(c," : ").concat(Ue[c]," , ").concat(a)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Rn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return e.channelId=e.channelId||"",h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.ONLY_STRING,!0)&&h("notificationLevel",n,(function(e){return void 0!==E[e]}),!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return t="setUltraGroupDefaultNotificationLevel",i="targetId: ".concat(e.targetId,", channelId: ").concat(e.channelId),a.debug(v.O,"".concat(t," -> ").concat(i)),[4,o.setUltraGroupDefaultNotificationLevel(e.targetId,n,e.channelId)];case 1:return(c=s.sent().code)===r.SUCCESS?[2,{code:c}]:(a.warn(v.O,"".concat(t," fail -> ").concat(c," : ").concat(Ue[c]," , ").concat(i)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function pn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&h("notificationLevels",n,R.ARRAY)&&!(null==n?void 0:n.every((function(e){return!h("notificationLevel",e,m)})))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t="getUltraGroupUnreadCountByTargetId",[4,o.getUltraGroupUnreadCountByTargetId(e,n)];case 1:return i=d.sent(),c=i.code,s=i.data,u="targetId: ".concat(e,", levels: ").concat(JSON.stringify(n)),a.debug(v.O,"".concat(t," -> ").concat(u)),c===r.SUCCESS?[2,{code:c,data:s}]:(a.warn(v.O,"".concat(t," fail -> ").concat(c,": ").concat(Ue[c],", ").concat(u)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function mn(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,a,i;return P(this,(function(c){switch(c.label){case 0:return e="getAllUltraGroupUnreadCount",[4,n.getAllUltraGroupUnreadCount()];case 1:return o=c.sent(),a=o.code,i=o.data,t.debug(v.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(t.warn(v.O,"".concat(e," fail ->").concat(a,": ").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]}))}))}function En(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,a,i;return P(this,(function(c){switch(c.label){case 0:return e="getAllUltraGroupUnreadMentionedCount",!0,[4,n.getAllUltraGroupUnreadCount(true)];case 1:return o=c.sent(),a=o.code,i=o.data,t.debug(v.O,e),a===r.SUCCESS?[2,{code:a,data:i}]:(t.warn(v.O,"".concat(e," fail ->").concat(a,": ").concat(Ue[a])),[2,{code:a,msg:Ue[a]}])}}))}))}))]}))}))}function Tn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return e.channelId=e.channelId||"",h("options.targetId",e.targetId,R.STRING,!0)&&h("options.channelId",e.channelId,R.ONLY_STRING,!0)&&h("options.sentTime",e.sentTime,R.NUMBER,!0)&&h("options.count",e.count,(function(e){return c(e)&&e>0&&e<=50}),!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c,s,u,d,f;return P(this,(function(l){switch(l.label){case 0:return n=e.targetId,a=e.channelId,i=e.sentTime,c=e.count,s={targetId:n,channelId:a,sentTime:i,count:c},[4,t.getUltraGroupUnreadMentionedMessages(s)];case 1:return u=l.sent(),d=u.code,f=u.data,d===r.SUCCESS?[2,{code:d,data:f}]:(o.warn(v.O,"getUltraGroupUnreadMentionedMessages fail ->".concat(d,": ").concat(Ue[d])),[2,{code:d,msg:Ue[d]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Sn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("conversation.targetId",e.targetId,R.STRING,!0)&&h("conversation.channelId",e.channelId,R.ONLY_STRING,!0)?[2,Ie((function(t){return L(n,void 0,void 0,(function(){var n,o,a,i,c,s;return P(this,(function(u){switch(u.label){case 0:return n=e.targetId,o=e.channelId,a={targetId:n,channelId:o},[4,t.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return i=u.sent(),c=i.code,s=i.data,c===r.SUCCESS?[2,{code:c,data:s}]:[2,{code:c,msg:Ue[c]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var On=function(e){return!!(h("options.key",e.key,R.STRING,!0)&&h("options.value",e.value,R.STRING,!0)&&h("options.isAutoDelete",e.isAutoDelete,R.BOOLEAN)&&h("options.isSendNotification",e.isSendNotification,R.BOOLEAN)&&h("options.notificationExtra",e.notificationExtra,R.STRING))},Nn=function(e){return!(!h("options.key",e.key,R.STRING,!0)||!h("options.isSendNotification",e.isSendNotification,R.BOOLEAN)||!h("options.notificationExtra",e.notificationExtra,R.STRING))};function _n(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.count",n.count,R.NUMBER,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return t=a.createTraceId(),a.info(v.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:n.count,joinExist:!1}),t),[4,o.joinChatroom(e,n.count,t)];case 1:return i=s.sent(),c=i===r.SUCCESS?"info":"warn",a[c](v.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),t),i!==r.SUCCESS?[2,{code:i,msg:Ue[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Cn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.count",n.count,R.NUMBER,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return t=a.createTraceId(),a.info(v.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:n.count,joinExist:!0}),t),[4,o.joinExistChatroom(e,n.count,t)];case 1:return i=s.sent(),c=i===r.SUCCESS?"info":"warn",a[c](v.A_JOIN_CHATROOM_R,JSON.stringify({code:i,timestamp:(new Date).getTime()}),t),i!==r.SUCCESS?[2,{code:i,msg:Ue[i]}]:[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function An(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(v.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),n),[4,t.quitChatroom(e)];case 1:return a=c.sent(),i=a===r.SUCCESS?"info":"warn",o[i](v.A_QUIT_CHATROOM_R,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Ue[a]}]:[2,{code:a}]}}))}))}))]}))}))}function yn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.count",n.count,R.NUMBER)&&h("options.order",n.order,(function(e){return[0,1,2].includes(e)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s;return P(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),a.debug(v.O,"get chatroom info ->".concat(t)),[4,o.getChatroomInfo(e,n.count,n.order)];case 1:return i=u.sent(),c=i.code,s=i.data,c===r.SUCCESS&&s?[2,{code:c,data:s}]:(a.warn(v.O,"get chatroom info fail ->code+:".concat(Ue[c],",").concat(t)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Mn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&On(n)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),a.debug(v.O,"set chatroom entry->".concat(t)),[4,o.setChatroomEntry(e,n)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"set chatroom entry fail ->code+:".concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Un(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!h("entry.key",e.key,R.STRING,!0)||!h("entry.value",e.value,R.STRING,!0)}))||!h("options.isAutoDelete",e.isAutoDelete,R.BOOLEAN)||!h("options.notificationExtra",e.notificationExtra,R.STRING)||!h("options.isForce",e.isForce,R.BOOLEAN))}(n)?n.entries.length>10?[2,Me.CHATROOM_KV_STORE_OUT_LIMIT]:[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s;return P(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),a.debug(v.O,"set chatroom entry->".concat(t)),[4,o.setChatroomEntries(e,n)];case 1:return i=u.sent(),c=i.code,s=i.data,c!==r.SUCCESS?(a.warn(v.O,"set chatroom entry fail ->code+:".concat(Ue[c],",").concat(t)),[2,{code:c,msg:Ue[c],data:s}]):[2,{code:c}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ln(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&On(n)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),a.debug(v.O,"force set chatroom entry ->".concat(t)),[4,o.forceSetChatroomEntry(e,n)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"force set chatroom entry fail ->code+:".concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Pn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&Nn(n)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),a.debug(v.O,"remove chatroom entry->".concat(t)),[4,o.removeChatroomEntry(e,n)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"remove chatroom entry fail ->code+:".concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function wn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&function(e){return!(e.entries.every((function(e){return!h("key",e,R.STRING,!0)}))||!h("options.notificationExtra",e.notificationExtra,R.STRING))}(n)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t="id:".concat(e),a.info(v.O,"remove chatroom entry->".concat(t)),(i=U({},n)).entries=n.entries.map((function(e){return{key:e}})),[4,o.removeChatroomEntries(e,i)];case 1:return c=d.sent(),s=c.code,u=c.data,s!==r.SUCCESS?(a.warn(v.O,"remove chatroom entry fail ->code+:".concat(Ue[s],",").concat(t)),[2,{code:s,msg:Ue[s],data:u}]):[2,{code:s}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function bn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("targetId",e,R.STRING,!0)&&Nn(n)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="id:".concat(e),a.info(v.O,"force remove chatroom entry ->".concat(t)),[4,o.forceRemoveChatroomEntry(e,n)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"force remove chatroom entry fail ->code+:".concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:i}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Dn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("key",n,(function(e){return S(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s;return P(this,(function(u){switch(u.label){case 0:return t="id:".concat(e),a.debug(v.O,"get chatroom entry->".concat(t)),[4,o.getChatroomEntry(e,n)];case 1:return i=u.sent(),c=i.code,s=i.data,c===r.SUCCESS&&s?[2,{code:c,data:s}]:(a.warn(v.O,"get chatroom entry fail ->code+:".concat(Ue[c],",").concat(t)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Bn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return n="id:".concat(e),o.debug(v.O,"get all chatroom entries->".concat(n)),[4,t.getAllChatroomEntries(e)];case 1:return a=s.sent(),i=a.code,c=a.data,i===r.SUCCESS&&c?[2,{code:i,data:c}]:(o.warn(v.O,"get all chatroom entries fail ->code+:".concat(Ue[i],",").concat(n)),[2,{code:i,msg:Ue[i]}])}}))}))}))]}))}))}function Gn(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.timestamp",n.timestamp,R.NUMBER)&&h("options.count",n.count,R.NUMBER)&&h("options.order",n.order,(function(e){return 0===e||1===e}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t="id:".concat(e),a.debug(v.O,"get chatroom history message->".concat(t)),[4,o.getChatRoomHistoryMessages(e,n.count,n.order,n.timestamp)];case 1:return i=d.sent(),c=i.code,s=i.data,c===r.SUCCESS&&s?(u=s.list.map((function(e){return ae(e)})),[2,{code:c,data:{list:u,hasMore:!!s.hasMore}}]):(a.warn(v.O,"get chatroom history message fail ->code+:".concat(Ue[c],",").concat(t)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function xn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return[2,Ie((function(t){return L(n,void 0,void 0,(function(){var n;return P(this,(function(o){switch(o.label){case 0:return[4,t.bindRTCRoomForChatroom(e)];case 1:return[2,{code:n=o.sent(),msg:Ue[n]}]}}))}))}))]}))}))}function kn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("userId",e,R.STRING,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){return P(this,(function(n){switch(n.label){case 0:return o.info(v.O,"addToBlacklist -> userId: ".concat(e)),[4,t.addToBlacklist(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Hn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("userId",e,R.STRING,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){return P(this,(function(n){switch(n.label){case 0:return o.info("removeFromBlacklist -> userId: ".concat(e)),[4,t.removeFromBlacklist(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Vn(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,a;return P(this,(function(i){switch(i.label){case 0:return t.info(v.O,"getBlacklist -> "),[4,n.getBlacklist()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS&&a?[2,{code:o,data:a}]:(t.warn(v.O,"getBlacklist fail -> code: ".concat(o)),[2,{code:o}])}}))}))}))]}))}))}function Fn(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("userId",e,R.STRING,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return o.info(v.O,"getBlacklistStatus -> userId: ".concat(e)),[4,t.getBlacklistStatus(e)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:a,data:0===i}]:(o.warn(v.O,"getBlacklistStatus fail -> code: ".concat(a,", userId: ").concat(e)),[2,{code:a}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}var qn=function(e,n,t,o){void 0===t&&(t=!0),void 0===o&&(o=!0),this.messageType=e,this.content=n,this.isPersited=t,this.isCounted=o};function Zn(e,n,t){void 0===n&&(n=!0),void 0===t&&(t=!0);return function(o){return new qn(e,o,n,t)}}var Jn,zn,Kn=Zn("RC:ImgMsg"),Yn=Zn("RC:HQVCMsg"),Wn=Zn("RC:SightMsg"),Xn=Zn("RC:TxtMsg"),jn=Zn("RC:CombineMsg"),Qn=Zn("RC:FileMsg"),$n=Zn("RC:GIFMsg"),et=Zn("RC:VcMsg"),nt=Zn("RC:LBSMsg"),ot=Zn("RC:ReferenceMsg"),rt=Zn("RC:ImgTextMsg"),at={qiniu:function(e,n,t,o){ve((function(r){var a=r.getInfoFromCache();if(1===(null==a?void 0:a.type)&&n.chunk_size&&o.size>n.chunk_size){var i=O();i+=o.name.substr(o.name.lastIndexOf(".")),o.uniqueName=i,lt(o,n,t)}else ft(e,n,t,o)}))},baidu:function(e,n,t,o){if(o.size>ct)throw new Error("the file size is over 5GB!");var r=n||{};n=n||zn;var a=new XMLHttpRequest,i=st();if(!r.uploadHost.bos&&!r.bosUploadPath)return;var c=i+it[0][1]+r.bosUploadPath;it.shift();var s=r.bosHeader||{},u={filename:n.uniqueValue||o.uniqueName,name:o.name,downloadUrl:c,isBosRes:!0};a.upload&&n.support_options&&(a.upload.onprogress=function(e){t.onProgress(e.loaded,e.total,!0)});a.onreadystatechange=function(){if(4===a.readyState)if(JSON.parse(a.responseText||"{}").filename=n.uniqueValue,200===a.status){t.onCompleted(u,!0)}else it.length?at[it[0][0]](e,n,t,o):t.onError("upload fail")},a.open(n.method,c,!0),a.setRequestHeader("authorization",s.bosToken),a.setRequestHeader("x-bce-date",s.bosDate),a.send(o)},aliyun:function(e,n,t,o){if(o.size>ct)throw new Error("the file size is over 5GB!");var r=new FormData;r.set("file",e.get("file")),r.set("key",e.get("key")),r.set("token",e.get("token"));var a=it[0][1];it.shift(),e=e||Jn,n=(n=n||{})||zn;var i=new XMLHttpRequest,c=st(),s="".concat(c+n.ossBucketName,".").concat(a);i.upload&&n.support_options&&(i.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});i.onreadystatechange=function(){if(4===i.readyState){var e=JSON.parse(i.responseText||"{}");e.name=n.uniqueValue,e.filename=n.uploadFileName,e.uploadMethod=N?N.ALI:"",200===i.status?t.onCompleted(e):it.length?at[it[0][0]](r,n,t,o):t.onError("upload fail")}},i.open(n.method,s,!0),console.log("ali:url",s);var u=n.aliHeader||{};e.set("OSSAccessKeyId",u.osskeyId),e.set("policy",u.ossPolicy),e.set("Signature",u.ossSign),e.set("success_action_status",200),e.delete("key"),e.append("key",n.uploadFileName),e.delete("file"),e.append("file",o),i.send(e)},s3:function(e,n,t,o){var r=new FormData,a=new XMLHttpRequest,i=st(),c=n.contentDisposition,s=it[0][1],u="".concat(i+n.s3BucketName,".").concat(s);console.log("uploadS3:url",u),it.shift(),a.upload&&n.support_options&&(a.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});a.onreadystatechange=function(){if(4===a.readyState){var r=JSON.parse(a.responseText||"{}");if(r.name=n.uniqueValue,r.filename=n.uploadFileName,r.uploadMethod=N.AWS,200===a.status||204===a.status)t.onCompleted(r);else if(it.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),at[it[0][0]](i,n,t,o)}else t.onError("upload fail")}},a.open(n.method,u,!0);var d=n?n.s3Header:{},f=o&&o.type;c?r.set("Content-Disposition","".concat(c,";")):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",n.uploadFileName),r.set("file",o),a.send(r)},stc:function(e,n,t,o){var r=new XMLHttpRequest,a=n.contentDisposition,i=it[0][1],c="https://".concat(i,"/").concat(n.stcBucketName,"/").concat(n.uploadFileName);it.shift(),r.upload&&n.support_options&&(r.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)});r.onreadystatechange=function(){if(4===r.readyState){var a=JSON.parse(r.responseText||"{}");if(a.name=n.uniqueValue,a.filename=n.uploadFileName,a.uploadMethod=N?N.STC:"",200===r.status||204===r.status)t.onCompleted(a);else if(it.length){var i=new FormData;i.set("file",e.get("file")),i.set("key",e.get("key")),i.set("token",e.get("token")),at[it[0][0]](i,n,t,o)}else t.onError("upload fail")}},r.open("PUT",c,!0);var s=n?n.stcHeader:{};r.setRequestHeader("Content-Type",o.type),a?r.setRequestHeader("Content-Disposition","".concat(a,";")):r.setRequestHeader("Content-Disposition","text/html"===o.type?"inline;":"attachment;");r.setRequestHeader("Authorization",s.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",s.stcContentSha256),r.setRequestHeader("x-amz-date",s.stcDate),r.send(o)}},it=[],ct=5368709120;function st(){var e="https://";return"http:"!==location.protocol&&"file:"!==location.protocol||(e="http://"),e}var ut,dt=(ut="RC-upload-",{get:function(e){e=ut+e;var n=localStorage.getItem(e);if(n)return null!==(n=JSON.parse(n||"{}"))&&n.type&&n.data?n.data:null},set:function(e,n){var t=localStorage;e=ut+e,n={data:n,type:typeof n,updateTime:Date.now()},t.setItem(e,JSON.stringify(n))},remove:function(e){e=ut+e,localStorage.removeItem(e)}});function ft(e,n,t,o){var r="https://"+n.uploadHost.qiniu,a=(/http/.test(it[0][1])?"":st())+it[0][1]||r;n.isChunk||it.shift();var i=new XMLHttpRequest;i.upload&&n.support_options&&(i.upload.onprogress=function(e){t.onProgress(e.loaded,e.total)}),i.onreadystatechange=function(){if(4===i.readyState){var r=JSON.parse(i.responseText||"{}");r.filename=n.uniqueValue,r.uploadMethod=N?N.QINIU:"",200===i.status||204===i.status?t.onCompleted(r):it.length?at[it[0][0]](e,n,t,o):t.onError("upload fail")}},i.open(n.method,a,!0),t.onOpen(i),n.stream&&i.setRequestHeader("authorization","UpToken ".concat(n.multi_parmas.token)),function(e,n){for(var t in e)n(t,e[t])}(n.headers,(function(e,n){i.setRequestHeader(e,n)})),i.send(e)}function lt(e,n,t,o){var r=0,a=o||O(),i=dt.get(a);i&&(e.uniqueName=i.sessionId,r=i.offset);var c=Math.min(n.chunk_size,e.size-r),s=e.slice(r,r+c),u=e.uniqueName;n.multi_parmas.name=u,n.filesize=e.size;var d="bytes=".concat(r,"-").concat(r+c);n.headers={Range:d,"X-File-TransactionId":u,"X-File-Total-Size":e.size},n.isChunk=!0,s.name=e.name,s=function(e,n,t){var o=new FormData;for(var r in n.unique_key&&o.append(n.unique_key,t),o.append(n.file_data_name,e,e.name),n.multi_parmas){var a=n.multi_parmas[r];o.append(r,a)}return o}(s,n,e.uniqueName),ft(s,n,{onCompleted:function(o){r+=c;var i=e.uniqueName;dt.set(a,{offset:r,sessionId:i}),r<e.size?lt(e,n,t,a):(r=0,dt.remove(a),t.onCompleted(o))},onError:function(e){console.error(e),t.onError(e)},onProgress:function(e,o){var a=e+r;t.onProgress(a,n.filesize)},onOpen:function(e){t.onOpen(e)}},e)}function gt(e,n,t,o){var r,a,i=n&&n.type||"text/plain",c=i.indexOf("image")>-1?1:4,s=t.contentDisposition,u=Math.ceil(n.size/t.stc_chunk_size),d=t&&JSON.parse(t.ossConfig?t.ossConfig:"");Array.isArray(d)||(d=[]);var f=d.find((function(e){return Object.keys(e).includes("stc")})),l="uploads";e.getFileToken(c,r,"POST",l).then((function(e){r=e.fileName,a="https://".concat(f.stc,"/").concat(t.stcBucketName,"/").concat(r),console.log("uploadStcMultipart:url",a);var c=new XMLHttpRequest;c.open("POST","".concat(a,"?").concat(l),!0),s?c.setRequestHeader("Content-Disposition","".concat(s,";")):c.setRequestHeader("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),c.setRequestHeader("Authorization",e&&e.stcAuthorization),c.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),c.setRequestHeader("x-amz-date",e&&e.stcDate),c.setRequestHeader("Content-Type",i),c.send(),c.onreadystatechange=function(){if(4===c.readyState){var e=c.response.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/);console.log("uploadId",e),200===c.status||204===c.status?function(e){for(var n=[],t=1;t<=u;t++)n.push(h(e,t));I(e,n)}(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(s,d){d&&Array.isArray(d)&&0!==d.length&&Promise.all(d).then((function(){var d="uploadId=".concat(s);if(v.size===u)e.getFileToken(c,r,"POST",d).then((function(e){console.log("onSuccess",e),console.log("onSuccess:uploadId",s);var r=new XMLHttpRequest;r.open("POST","".concat(a,"?").concat(d),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i);var c="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>",u=Array.from(v.keys()||[]).sort((function(e,n){return e-n}));console.log("keys",u),u.forEach((function(e){c+="<Part><ETag>".concat(v.get(e),"</ETag><PartNumber>").concat(e,"</PartNumber></Part>")})),c+="</CompleteMultipartUpload>",r.send(c),console.log("xml",c),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e={name:n.name,filename:t.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 p=R[l];f.push(h(s,p))}I(s,f)}}),(function(e){console.error(e),o.onError("uploadStcMultipart: chunkFiles upload failed and those will reupload");for(var n=[],t=0,r=g;t<r.length;t++){var a=r[t];n.push(h(s,a))}I(s,n)}))}function h(o,s){return new Promise((function(u,d){var f="partNumber=".concat(s,"&uploadId=").concat(o);e.getFileToken(c,r,"PUT",f).then((function(e){console.log("signature ".concat(s," onSuccess"),e);var o=n&&n.slice((s-1)*t.stc_chunk_size,s*t.stc_chunk_size);console.log("fileChunk:size",o.size);var r=new XMLHttpRequest;r.open("PUT","".concat(a,"?").concat(f),!0),r.setRequestHeader("Authorization",e&&e.stcAuthorization),r.setRequestHeader("x-amz-content-sha256",e&&e.stcContentSha256),r.setRequestHeader("x-amz-date",e&&e.stcDate),r.setRequestHeader("Content-Type",i),r.send(o),r.onreadystatechange=function(){if(4===r.readyState)if(200===r.status||204===r.status){var e=r.getResponseHeader("etag");console.log("etag:".concat(s),e),v.set(s,e),u(e)}else g.includes(s)||g.push(s),d(s)}}),(function(e){console.log("getETags:签名验证失败"),g.includes(s)||g.push(s),d(s)}))}))}}var vt={form:function(e,n){var t=new FormData;if(n.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=It()+o;t.append(n.unique_key,r),n.uniqueValue=r}return t.append(n.file_data_name,e),ht(n.multi_parmas,(function(e,n){t.append(e,n)})),t},json:function(e,n){var t={};if(n.unique_key){var o=e.name.substr(e.name.lastIndexOf(".")),r=It()+o;t[n.unique_key]=r,n.uniqueValue=r}return t[n.file_data_name]=e,ht(n.multi_parmas,(function(e,n){t[e]=n})),JSON.stringify(t)},data:function(e,n){return e}};function It(){var e=(new Date).getTime();return"xxxxxx4xxxyxxxxxxx".replace(/[xy]/g,(function(n){var t=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===n?t:3&t|8).toString(16)}))}function ht(e,n){for(var t in e)n(t,e[t])}var Rt,pt=0,mt=function(){function e(e){this.options=function(e){var n={domain:"",method:"POST",file_data_name:"file",unique_key:"key",base64_size:4194304,chunk_size:4194304,bos_chunk_size:4294967296,stc_chunk_size:10485760,headers:{},multi_parmas:{},query:{},support_options:!0,data:vt.form,genUId:It};if(!e||!e.domain)throw new Error("domain is null");for(var t in e)n[t]=e[t];return n}(e)}return e.prototype.setOptions=function(e){var n=this;ht(e,(function(e,t){n.options[e]=t}))},e.prototype.upload=function(e,n,t,o){if(t){var r=this;!function(e,n,t,o,r){Jn=t,zn=o,it=[];var a,i=e.getInfoFromCache();if(1===(null==i?void 0:i.type)&&n.uploadDomain)it=[["qiniu",n.uploadDomain]];else if(o.ossConfig){var c,s,u=JSON.parse(o.ossConfig),d="",f=[];u.forEach((function(e){var n=Number(e.p)-1;for(var t in e)"aliyun"===t&&(d=e[t]),"s3"===t&&(c=e[t]),"stc"===t&&(s=e[t]),"p"!==t&&(f[n]=[t,e[t]])})),f.forEach((function(e){e&&it.push(e)})),u.length!==it.length&&(it=[["qiniu",o.domain],["baidu",o.uploadHost.bos],["aliyun",d],["s3",c],["stc",s]])}else it=[["qiniu",o.domain],["baidu",o.uploadHost.bos]];if(o.ossConfig){var l=o&&JSON.parse(o.ossConfig);Array.isArray(l)||(l=[]),a=l.find((function(e){return Object.keys(e).includes("stc")}))}if(a&&1===parseInt(a.p,10)&&t.size>=4194304)gt(e,t,o,r);else{var g=o.data(t,o);at[it[0][0]](g,o,r,t)}}(e,n,t,this.options,{onProgress:function(e,n,t){(Rt=e,t)?Rt=pt+e/n*(n-pt):pt=Rt;o.onProgress(Rt,n)},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 Et,Tt,St={init:function(e){return new mt(e)},dataType:vt,resize:function(e,n,t){e.type;var o=document.createElement("canvas"),r=new FileReader;r.readAsDataURL(e),r.onload=function(e){var r=e.target.result,a=new Image;a.src=r;var i=a.width,c=a.height,s=function(e,n){var t=1,o=e.width,r=n.maxWidth||0;r>0&&o>r&&(t=r/o);var a=e.height,i=n.maxHeight||0;if(i>0&&a>i){var c=i/a;t=Math.min(t,c)}var s=n.maxSize||0,u=Math.ceil(e.size/1e3);if(u>s){var d=s/u;t=Math.min(t,d)}return t}({width:i,height:c,size:e.total},n),u=r;s<1&&(u=function(e,n,t){return o.width=n,o.height=t,o.getContext("2d").drawImage(e,0,0,n,t),o.toDataURL("image/jpg")}(a,i*s,c*s)),t(u)}},Upload:mt},Ot=function(e,n,t){var o=document.createElement("canvas"),r=o.getContext("2d"),a=new Image,i="string"==typeof e;a.onload=function(i){var c=function(e,n,t){var o,r,a,i=e<n,c=0,s=0;return(i?n/e:e/n)>t.scale?(i?(r=100,s=((a=n/(o=e/100))-t.maxHeight)/2):(a=100,c=((r=e/(o=n/100))-t.maxWidth)/2),{w:r,h:a,x:-c,y:-s}):(i?(o=n/t.maxHeight,a=t.maxHeight,r=e/o):(o=e/t.maxWidth,r=t.maxWidth,a=n/o),{w:r,h:a,x:-c,y:-s})}(a.width,a.height,n);o.width=c.w>n.maxWidth?n.maxWidth:c.w,o.height=c.h>n.maxHeight?n.maxHeight:c.h,r.drawImage(a,c.x,c.y,c.w,c.h);var s=o.toDataURL("string"==typeof e?"image/jpg":e.type,n.quality);s=s.replace(/data:image\/[^;]+;base64,/,""),t(s)},a.src=i?"data:image/jpg;base64,".concat(e):function(e){var n=window.URL||window.webkitURL;return n?n.createObjectURL(e):""}(e)},Nt=function(e,n){var t=e.file,o=e.compress;Ot(t,o,n)},_t=function(e,n){if(e.getToken)e.getToken((function(t,o){o=o||{},e.multi_parmas=e.multi_parmas||{},e.multi_parmas.token=t,e.uploadHost=e.uploadHost||{},e.uploadHost.bos=o.bos,e.ossConfig=o.ossConfig,e.bosHeader=e.bosHeader||{},e.bosHeader.bosDate=o.bosDate,e.bosHeader.bosToken=o.bosToken,e.bosUploadPath=o.path,e.aliHeader={},e.aliHeader.osskeyId=o.osskeyId,e.aliHeader.ossPolicy=o.ossPolicy,e.aliHeader.ossSign=o.ossSign,e.ossBucketName=o.ossBucketName,e.uploadFileName=o.fileName,e.s3Header={},e.s3Header.s3Credential=o.s3Credential,e.s3Header.s3Algorithm=o.s3Algorithm,e.s3Header.s3Date=o.s3Date,e.s3Header.s3Policy=o.s3Policy,e.s3Header.s3Signature=o.s3Signature,e.s3BucketName=o.s3BucketName,e.stcHeader={},e.stcHeader.stcAuthorization=o.stcAuthorization,e.stcHeader.stcContentSha256=o.stcContentSha256,e.stcHeader.stcDate=o.stcDate,e.stcBucketName=o.stcBucketName,e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream",e.headers.Authorization="UpToken ".concat(t));var r=St.init(e);n(r)}));else{e.headers=e.headers||{},e.base64&&(e.headers["Content-type"]="application/octet-stream");var t=St.init(e);n(t)}},Ct=function(e,n,t,o,r){o.upload(e,n,t.file,{onError:function(e){r.onError(e)},onProgress:function(e,n){r.onProgress(e,n)},onCompleted:function(e){e.filename=e.filename||e.hash;var n=t.compressThumbnail||Nt;t.compress?n(t,(function(n){e.thumbnail=n,r.onCompleted(e)})):r.onCompleted(e)}})},At=function(){function e(e){this.instance=e}return e.prototype.upload=function(e,n,t,o){Ct(e,n,{file:t},this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),yt=function(){function e(e,n){this.instance=e,this.cfg=n}return e.prototype.upload=function(e,n,t,o){var r={file:t,compress:this.cfg};Ct(e,n,r,this.instance,o)},e.prototype.cancel=function(){this.instance.cancel()},e}(),Mt=function(e,n){_t(e,(function(e){var t=new At(e);n(t)}))},Ut=function(e,n){_t(e,(function(t){var o,r,a,i,c={maxHeight:(null===(o=e.thumbnailConfig)||void 0===o?void 0:o.maxHeight)||160,maxWidth:(null===(r=e.thumbnailConfig)||void 0===r?void 0:r.maxWidth)||160,quality:(null===(a=e.thumbnailConfig)||void 0===a?void 0:a.quality)||.5,scale:(null===(i=e.thumbnailConfig)||void 0===i?void 0:i.scale)||2.4},s=new yt(t,c);n(s)}))};St.dataType;function Lt(e,n,t,o,r,a,i){var c,s=this;void 0===r&&(r=C.FILE),c=r===C.IMAGE?C.IMAGE:C.FILE;var u=e.getInfoFromCache();if(!Tt&&(Tt="upload.qiniup.com",u&&u.ossConfig))try{var d=JSON.parse(u.ossConfig).find((function(e){return void 0!==e.qiniu}));d&&(Tt=d.qiniu)}catch(e){}var f=U({domain:Tt,getToken:function(n){e.getFileToken(c).then((function(e){n(e.token,e)})).catch((function(e){a.onFail(e)}))}},i);(c===C.IMAGE?Ut:Mt)(f,(function(n){n.upload(e,t,o,{onProgress:function(e,n){var t,o=Math.floor(e/n*100);null===(t=a.onProgress)||void 0===t||t.call(a,o)},onCompleted:function(e){return L(s,void 0,void 0,(function(){return P(this,(function(n){return 1===(null==u?void 0:u.type)?function(e,n,t,o,r,a){var i={type:o.type,name:r.rc_url.file_name,downloadUrl:e.uploadDomain+r.rc_url.path};if(n===C.AUDIO)return void Pt(o).then((function(e){a.onSuccess(U(U({},i),e))}));n===C.IMAGE&&(i.thumbnail=r.thumbnail);a.onSuccess(i)}(t,r,0,o,e,a):function(e,n,t,o,r){Dt(n,o.filename,o.name,o,o.uploadMethod).then((function(a){if(0===a.code){var i=a.data;i.type=t.type,i.name=o.name||o.filename,e!==C.AUDIO?(n===C.IMAGE&&(i.thumbnail=o.thumbnail),r.onSuccess(i)):Pt(t).then((function(e){r.onSuccess(U(U({},i),e))}))}else r.onFail(a)})).catch((function(e){r.onFail(e)}))}(r,c,o,e,a),[2]}))}))},onError:function(e){a.onFail(e)}})}))}function Pt(e){return new Promise((function(n){if("function"!=typeof e.arrayBuffer){var t=new FileReader;t.onload=function(){t.result?wt(t.result).then((function(e){n(e)}),(function(){n({})})):n({})},t.onerror=function(){n({duration:0})},t.readAsArrayBuffer(e)}else e.arrayBuffer().then(wt).then((function(e){n(e)}))}))}function wt(e){return Et=Et||new AudioContext,new Promise((function(n,t){Et.decodeAudioData(e,(function(e){n({duration:e.duration,length:e.length})}),t)}))}function bt(e,n,t,o){return Ie((function(a){return new Promise((function(i){a.getFileToken(e,n,t,o).then((function(e){i({code:r.SUCCESS,data:e})})).catch((function(e){i({code:e,msg:Ue[e]})}))}))}))}function Dt(e,n,t,o,a){return h("fileType",e,_,!0)&&h("filename",n,R.STRING)&&h("saveName",t,R.STRING)&&h("serverType",a,R.NUMBER)?Ie((function(i){return new Promise((function(c){i.getFileUrl(e,n,t,o,a).then((function(e){c({code:r.SUCCESS,data:e})})).catch((function(e){c({code:e})}))}))})):Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER})}function Bt(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(c){return[2,Ie((function(c,s){return L(o,void 0,void 0,(function(){var o,u,d,f,l,g,I,p,m,E,T,S,O;return P(this,(function(N){switch(N.label){case 0:return t=t||{},n instanceof qn==!1?(s.warn(v.O,"send message fail -> message parameter is not an instance of BaseMessage"),[2,Me.ILLGAL_PARAMS]):h("conversation",e,R.OBJECT,!0)?(o=e.conversationType,u=e.targetId,d=e.channelId,h("conversation.targetId",u,R.STRING,!0)&&h("conversation.conversationType",o,R.NUMBER)&&h("conversation.channelId",d,R.CHANNEL_ID)&&h("options.isStatusMessage",null==t?void 0:t.isStatusMessage,R.BOOLEAN)&&h("options.disableNotification",null==t?void 0:t.disableNotification,R.BOOLEAN)&&h("options.pushContent",null==t?void 0:t.pushContent,R.STRING)&&h("options.pushData",null==t?void 0:t.pushData,R.STRING)&&h("options.isMentioned",null==t?void 0:t.isMentioned,R.BOOLEAN)&&h("options.mentionedType",null==t?void 0:t.mentionedType,R.NUMBER)&&h("options.mentionedUserIdList",null==t?void 0:t.mentionedUserIdList,R.ARRAY)&&h("options.directionalUserIdList",null==t?void 0:t.directionalUserIdList,R.ARRAY)&&h("options.isVoipPush",null==t?void 0:t.isVoipPush,R.BOOLEAN)&&h("options.canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,R.BOOLEAN)&&h("options.expansion",null==t?void 0:t.expansion,R.OBJECT)&&h("options.pushConfig",null==t?void 0:t.pushConfig,R.OBJECT)&&h("options.messageId",null==t?void 0:t.messageId,R.NUMBER)?(f="conversationType:".concat(o,",targetId:").concat(u),s.debug(v.O,"send message ->".concat(f)),l=function(e,n,t){var o=e.isStatusMessage,r=e.disableNotification,a=e.pushContent,i=e.pushData,c=e.isMentioned,s=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=t.channelId;return U({isStatusMessage:o,disableNotification:r,pushContent:a,pushData:i,isMentioned:c,mentionedType:s,mentionedUserIdList:u,directionalUserIdList:d,isVoipPush:f,canIncludeExpansion:l,expansion:g,isFilerWhiteBlacklist:v,pushConfig:I,channelId:R||"",messageId:h},n)}(t,n,e),g={isMentioned:!!t.isMentioned,content:n.content,messageType:n.messageType,isPersited:n.isPersited||!1,isCounted:n.isCounted||!1,disableNotification:!!(null==t?void 0:t.disableNotification),canIncludeExpansion:!!(null==t?void 0:t.canIncludeExpansion),expansion:(null==t?void 0:t.expansion)||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:c.getCurrentUserId(),messageUId:"",messageDirection:y.SEND,receivedTime:0,isStatusMessage:t.isStatusMessage||!1,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:null==t?void 0:t.pushConfig},o!==i.ULTRA_GROUP&&(g.isOffLineMessage=!1),I=s.createTraceId(),p=function(e){g.messageId=e;try{(null==t?void 0:t.onSendBefore)&&t.onSendBefore(ae(g))}catch(e){s.error(v.O,'Callback method "onSendBefore" execution error.\n'.concat(null==e?void 0:e.stack),I)}},s.info(v.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:o,targetId:u,channelId:d}),I),[4,c.sendMessage(o,u,l,p,I)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return m=N.sent(),E=m.code,T=m.data,S=E===r.SUCCESS?"info":"warn",s[S](v.A_SEND_MSG_R,JSON.stringify({code:E,messageUId:T?T.messageUId:"",messageId:T?T.messageId:""}),I),E===r.SUCCESS?(O=ae(T),[2,{code:E,data:O}]):(s.warn(v.O,"send message fail ->".concat(E,":").concat(Ue[E],",").concat(f)),g.sentTime=(null==T?void 0:T.sentTime)||0,[2,{code:E,msg:Ue[E],data:ae(g)}])}}))}))}))]}))}))}function Gt(e,n,t){return Bt(e,new Xn(n),t)}function xt(e,n){return function(t,o,a,i){if(!h("sendOptions.contentDisposition",null==i?void 0:i.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});var c={contentDisposition:null==i?void 0:i.contentDisposition};if(i&&"thumbnailConfig"in i){var s=null==i?void 0:i.thumbnailConfig;if(!(h("sendOptions.maxHeight",null==s?void 0:s.maxHeight,R.NUMBER)&&h("sendOptions.maxWidth",null==s?void 0:s.maxWidth,R.NUMBER)&&h("sendOptions.quality",null==s?void 0:s.quality,R.NUMBER)&&h("sendOptions.scale",null==s?void 0:s.scale,R.NUMBER)))return Promise.resolve({code:r.BIZ_ERROR_INVALID_PARAMETER});c.thumbnailConfig=s}return Ie((function(s,u,d){return new Promise((function(f){var l=u.createTraceId();u.info(v.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:o.file.size,type:e}),l),Lt(s,0,d,o.file,e,{onProgress:null==a?void 0:a.onProgress,onSuccess:function(e){var c,s=(null===(c=null==a?void 0:a.onComplete)||void 0===c?void 0:c.call(a,{url:e.downloadUrl}))||n(e,o);e&&e.downloadUrl&&u.info(v.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:e.downloadUrl,code:r.SUCCESS}),l),Bt(t,s,i).then(f)},onFail:function(e){u.warn(v.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]})}},c)}))}))}}var kt=xt(C.FILE,(function(e,n){return new Qn({name:e.name,size:n.file.size,type:n.file.type,fileUrl:e.downloadUrl,user:n.user,extra:n.extra})})),Ht=xt(C.IMAGE,(function(e,n){return new Kn({content:e.thumbnail,imageUri:e.downloadUrl,user:n.user,extra:n.extra})})),Vt=xt(C.AUDIO,(function(e,n){return new Yn({remoteUrl:e.downloadUrl,duration:e.duration,type:e.type,user:n.user,extra:n.extra})})),Ft=xt(C.SIGHT,(function(e,n){return new Wn({sightUrl:e.downloadUrl,content:n.thumbnail,duration:n.duration,size:n.file.size||e.size,name:n.name||e.name,user:n.user,extra:n.extra})}));function qt(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.timestamp",null==n?void 0:n.timestamp,R.NUMBER)&&h("options.count",null==n?void 0:n.count,R.NUMBER)&&h("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t=a.createTraceId(),a.info(v.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==n?void 0:n.timestamp,count:null==n?void 0:n.count}),t),[4,o.getHistoryMessage(e.conversationType,e.targetId,null==n?void 0:n.timestamp,null==n?void 0:n.count,null==n?void 0:n.order,null==e?void 0:e.channelId,"",t)];case 1:return i=d.sent(),c=i.code,s=i.data,c===r.SUCCESS&&s?(u=s.list.map((function(e){return ae(e)})),a.info(v.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageLength:u.length}),t),[2,{code:c,data:{list:u,hasMore:s.hasMore}}]):(a.warn(v.A_GET_HISTORY_MSG_R,JSON.stringify({code:c,messageUIds:""}),t),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Zt(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.timestamp",null==n?void 0:n.timestamp,R.NUMBER)&&h("options.count",null==n?void 0:n.count,R.NUMBER)&&h("options.order",null==n?void 0:n.order,(function(e){return 0===e||1===e}))&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(v.O,"get history message ->".concat(t)),[4,o.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==n?void 0:n.timestamp)||0,(null==n?void 0:n.count)||20,(null==n?void 0:n.order)||0,e.channelId||"")];case 1:return i=d.sent(),c=i.code,s=i.data,c===r.SUCCESS&&s?(u=s.list.map((function(e){return ae(e)})),[2,{code:c,data:{list:u,hasMore:s.hasMore}}]):(a.warn(v.O,"get history message fail ->".concat(c,":").concat(Ue[c],",").concat(t)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Jt(e,n,t,o){return L(this,void 0,void 0,(function(){var r=this;return P(this,(function(a){return[2,Ie((function(a){return L(r,void 0,void 0,(function(){var r,a,c,s,u;return P(this,(function(d){switch(d.label){case 0:return r={targetId:e,conversationType:i.PRIVATE,channelId:o},a=new qn("RC:ReadNtf",{messageUId:n,lastMessageSendTime:t,type:1}),[4,Bt(r,a)];case 1:return c=d.sent(),s=c.code,u=c.msg,0===s?[2,{code:s}]:[2,{code:s,msg:u}]}}))}))}))]}))}))}function zt(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return h("messageUId",n,R.STRING,!0)&&h("channelId",t,R.CHANNEL_ID)?[2,Ie((function(r,a){return L(o,void 0,void 0,(function(){var o,r,c,s,u;return P(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(n,",targetId:").concat(e),a.debug(v.O,"send read receipt message ->".concat(o)),r=new qn("RC:RRReqMsg",{messageUId:n}),[4,Bt({targetId:e,conversationType:i.GROUP,channelId:t},r)];case 1:return c=d.sent(),s=c.code,u=c.msg,0===s?[2,{code:s}]:[2,{code:s,msg:u}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Kt(e,n,t){return L(this,void 0,void 0,(function(){return P(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function Yt(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return h("targetId",e,R.STRING,!0)&&h("messageList",n,R.OBJECT,!0)&&h("channelId",t,R.CHANNEL_ID)&&!Object.keys(n).every((function(e){return!h(e,n[e],R.ARRAY)}))?[2,Ie((function(a,c){return L(o,void 0,void 0,(function(){var o,s,u,d,f,l,g;return P(this,(function(I){switch(I.label){case 0:return o={targetId:e,conversationType:i.GROUP,channelId:t},u=a.getInfoFromCache(),0!==(d=(null==u?void 0:u.grpRRVer)||0)?[3,2]:(f=new qn("RC:RRRspMsg",{receiptMessageDic:n}),[4,Bt(o,f)]);case 1:return s=I.sent(),[3,4];case 2:return 1!==d?[3,4]:(l=[],Object.keys(n).forEach((function(e){n[e].forEach((function(e){-1===l.indexOf(e)&&l.push(e)}))})),l.length?[4,a.sendReadReceiptMessage(e,l,t)]:(c.warn(v.O,"Error in parameter messageList."),[2,{code:r.PARAMETER_ERROR}]));case 3:s=I.sent(),I.label=4;case 4:return(g=s.code)===r.SUCCESS?[2,{code:g}]:(c.warn(v.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 Wt(e,n){return L(this,void 0,void 0,(function(){var t,o,a,i;return P(this,(function(c){switch(c.label){case 0:return h("conversation.type",e.conversationType,R.NUMBER,!0)&&h("conversation.targetId",e.targetId,R.STRING,!0)&&h("lastMessageSendTime",n,R.NUMBER,!0)&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?(t=new qn("RC:SRSMsg",{lastMessageSendTime:n}),[4,Bt(e,t)]):[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}];case 1:return o=c.sent(),a=o.code,i=o.msg,0===a?[2,{code:a}]:[2,{code:a,msg:i}]}}))}))}function Xt(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.messageUId",n.messageUId,R.STRING,!0)&&h("options.sentTime",n.sentTime,R.NUMBER,!0)&&h("options.disableNotification",null==n?void 0:n.disableNotification,R.BOOLEAN)&&h("options.pushConfig",null==n?void 0:n.pushConfig,R.OBJECT)&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u;return P(this,(function(d){switch(d.label){case 0:return t={user:n.user,channelId:e.channelId||"",disableNotification:null==n?void 0:n.disableNotification,pushConfig:null==n?void 0:n.pushConfig,extra:n.extra,isDelete:n.isDelete},i="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId,",messageUId:").concat(n.messageUId),a.debug(v.O,"recall message ->".concat(i)),[4,o.recallMessage(e.conversationType,e.targetId,n.messageUId,n.sentTime,t)];case 1:return c=d.sent(),s=c.code,u=c.data,s===r.SUCCESS&&u?[2,{code:s,data:ae(u)}]:s===r.SUCCESS?[2,{code:s}]:(a.warn(v.O,"recall message fail ->".concat(s,":").concat(Ue[s],",").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function jt(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options",n,(function(e){return f(e)&&e.length}),!0)&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)&&!n.every((function(e){return!h("options.messageUId",e.messageUId,R.STRING,!0)||!h("options.sentTime",e.sentTime,R.NUMBER,!0)||!h("options.messageDirection",e.messageDirection,(function(e){return 1===e||2===e}),!0)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(v.O,"delete messages ->".concat(t)),[4,o.deleteRemoteMessage(e.conversationType,e.targetId,n,e.channelId)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"delete message fail ->".concat(i,":").concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Qt(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("options.timestamp",n,R.NUMBER,!0)&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i;return P(this,(function(c){switch(c.label){case 0:return t="conversationType:".concat(e.conversationType,",targetId:").concat(e.targetId),a.debug(v.O,"clear message ->".concat(t)),[4,o.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,n,e.channelId)];case 1:return(i=c.sent())!==r.SUCCESS?(a.warn(v.O,"clear message ->".concat(i,":").concat(Ue[i],",").concat(t)),[2,{code:i,msg:Ue[i]}]):[2,{code:r.SUCCESS}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function $t(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("expansion",e,R.OBJECT,!0)&&h("message",n,R.OBJECT,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l;return P(this,(function(g){switch(g.label){case 0:return t=n.conversationType,i=n.targetId,c=n.messageUId,s=n.canIncludeExpansion,u=n.expansion,d=n.channelId,f="conversationType:".concat(t,",targetId:").concat(i,",messageUId:").concat(c),a.debug(v.O,"update message expansion ->".concat(f)),[4,o.sendExpansionMessage({conversationType:t,targetId:i,messageUId:c,expansion:e,canIncludeExpansion:s,originExpansion:u,channelId:d})];case 1:return(l=g.sent().code)!==r.SUCCESS?(a.warn(v.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 eo(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("keys",e,R.ARRAY,!0)&&h("message",n,R.OBJECT,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f;return P(this,(function(l){switch(l.label){case 0:return t=n.conversationType,i=n.targetId,c=n.messageUId,s=n.canIncludeExpansion,u=n.channelId,d="conversationType:".concat(t,",targetId:").concat(i,",messageUId:").concat(c),a.debug(v.O,"remove message expansion ->".concat(d)),[4,o.sendExpansionMessage({conversationType:t,targetId:i,messageUId:c,canIncludeExpansion:s,keys:e,channelId:u})];case 1:return(f=l.sent().code)!==r.SUCCESS?(a.warn(v.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 no(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("typingContentType",n,R.STRING,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d;return P(this,(function(f){switch(f.label){case 0:return t={messageType:"RC:TypSts",content:{typingContentType:n},isStatusMessage:!0,channelId:e.channelId},i=a.createTraceId(),a.info(v.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),i),[4,o.sendMessage(e.conversationType,e.targetId,t,void 0,i)];case 1:return c=f.sent(),s=c.code,u=c.data,d=s===r.SUCCESS?"info":"warn",a[d](v.A_SEND_MSG_R,JSON.stringify({code:s,messageUId:u?u.messageUId:"",messageId:u?u.messageId:""}),i),s===r.SUCCESS?[2,{code:s,data:ae(u)}]:[2,{code:s,msg:Ue[s]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function to(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return h("messageUId",n,R.STRING,!0)?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o,c,s,u;return P(this,(function(d){switch(d.label){case 0:return o="messageUId:".concat(n,",targetId:").concat(e),i.debug(v.O,"get message reader ->".concat(o)),[4,a.getMessageReader(e,n,t)];case 1:return c=d.sent(),s=c.code,u=c.data,s===r.SUCCESS?[2,{code:s,data:u}]:(i.warn(v.O,"get message reader fail ->".concat(s,":").concat(Ue[s],",").concat(o)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function oo(e,n,t,o,r){return ve((function(a,i){return d("messageType",e,R.STRING,!0),d("isPersited",n,R.BOOLEAN,!0),d("isCounted",t,R.BOOLEAN,!0),d("isStatusMessage",r,R.BOOLEAN,!1),i.info(v.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:t,isStatusMessage:r,isPersited:n})),a.registerMessageType(e,n,t,o,r),Zn(e,n,t)}))}function ro(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return A()?h("conversation.conversationType",e.conversationType,R.NUMBER,!0)&&h("conversation.targetId",e.targetId,R.STRING,!0)&&h("conversation.channelId",null==e?void 0:e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return[4,t.getFirstUnreadMessage(e.conversationType,e.targetId,e.channelId)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:a,data:i}]:(o.warn(v.O,"insertMessage ->code:".concat(a,",targetId:").concat(e.targetId)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function ao(e,n,t){return void 0===t&&(t={}),L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return ce("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),A()?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o,c,s,u,d,f,l,g,I,h,R,p,m,E,T,S;return P(this,(function(O){switch(O.label){case 0:return o=n.senderUserId,c=n.messageType,s=n.content,u=n.messageDirection,d=n.messageUId,f=n.canIncludeExpansion,l=n.expansion,g=n.disableNotification,I=n.sentTime,h=n.sentStatus,i.info(v.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),R=t.isUnread,p=t.searchContent,m={senderUserId:o,messageType:c,content:s,messageDirection:u,sentTime:I,sentStatus:h,searchContent:p,isUnread:R,messageUId:d,disableNotification:g,canIncludeExpansion:f,expansionMsg:JSON.stringify(l),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,m)];case 1:return E=O.sent(),T=E.code,S=E.data,T===r.SUCCESS?[2,{code:T,data:ae(S)}]:(i.warn(v.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 L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return A()?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return[4,t.getMessage(e)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:a,data:ae(i)}]:(o.warn(v.O,"getMessage ->code:".concat(a,",messageId:").concat(e)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function co(e){if(!A())return{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]};var n,t=e.conversationType,o=e.targetId;return h("conversationType",t,R.NUMBER,!0)&&h("targetId",o,R.STRING,!0)?(n=function(e){var n=e.getUnreadMentionedMessages(t,o),a=[];return n&&n.length&&n.forEach((function(e){return a.push(ae(e))})),{code:r.SUCCESS,data:a}},de?n(de,le,fe):{code:r.BIZ_ERROR_CLIENT_NOT_INIT}):{code:r.BIZ_ERROR_INVALID_PARAMETER}}function so(e,n,t,o){return L(this,void 0,void 0,(function(){var a=this;return P(this,(function(i){return ce("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),A()?h("conversationType",e.conversationType,R.NUMBER,!0)&&h("targetId",e.targetId,R.STRING,!0)&&h("keyword",n,R.STRING,!0)&&h("timestamp",t,R.NUMBER)&&h("count",o,R.NUMBER)?[2,Ie((function(i,c){return L(a,void 0,void 0,(function(){var a,s,u,d;return P(this,(function(f){switch(f.label){case 0:return 1,[4,i.searchMessageByContent(e.conversationType,e.targetId,n,t,o,1,e.channelId)];case 1:return a=f.sent(),s=a.code,u=a.data,s===r.SUCCESS?(d=[],(null==u?void 0:u.messages)&&u.messages.length&&u.messages.forEach((function(e){return d.push(ae(e))})),[2,{code:s,data:{messages:d,count:null==u?void 0:u.count}}]):(c.warn(v.O,"searchMessages ->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,n,t){return L(this,void 0,void 0,(function(){var o,a,i,c=this;return P(this,(function(s){return ce("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),A()?(o=e.conversationType,a=e.targetId,i=e.channelId,h("conversationType",o,R.NUMBER,!0)&&h("targetId",a,R.STRING,!0)&&h("timestamp",n,R.NUMBER,!0)&&h("cleanSpace",t,R.BOOLEAN)?[2,Ie((function(s,u){return L(c,void 0,void 0,(function(){var c;return P(this,(function(d){switch(d.label){case 0:return[4,s.deleteMessagesByTimestamp(o,a,n,t,i)];case 1:return c=d.sent(),u.debug(v.A_DELETE_MESSAGES_S,JSON.stringify({code:c,conversationType:o,targetId:a,channelId:i,timestamp:n})),c===r.SUCCESS?[2,{code:c}]:(u.warn(v.O,"deleteLocalMessagesByTimestamp ->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 fo(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return ce("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),A()?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return n=e.conversationType,a=e.targetId,i=e.channelId,o.info(v.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(n)),[4,t.clearMessages(n,a,i)];case 1:return(c=s.sent())===r.SUCCESS?[2,{code:c}]:(o.warn(v.O,"clearMessages ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function lo(e,n,t,o){return L(this,void 0,void 0,(function(){var a=this;return P(this,(function(i){return ce("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),A()?[2,Ie((function(i,c){return L(a,void 0,void 0,(function(){var a,s,u;return P(this,(function(d){switch(d.label){case 0:return c.info(v.O,"searchConversationByContent ->keyword:".concat(e)),[4,i.searchConversationByContent(e,t,o,n)];case 1:return a=d.sent(),s=a.code,u=a.data,s===r.SUCCESS?[2,{code:s,data:u}]:(c.warn(v.O,"searchConversationByContent ->code:".concat(s,",keyword:").concat(e)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function go(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s;return P(this,(function(u){switch(u.label){case 0:return t=e.conversationType,i=e.targetId,c=e.channelId,a.info(v.O,"clearUnreadCountByTimestamp ->targetId:".concat(i,",conversationType:").concat(t)),[4,o.clearUnreadCountByTimestamp(t,i,n,c)];case 1:return(s=u.sent())===r.SUCCESS?[2,{code:s}]:(a.warn(v.O,"clearUnreadCountByTimestamp ->code:".concat(s,",targetId:").concat(i)),[2,{code:s,msg:Ue[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function vo(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return ce("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),A()?h("messageId",e,R.NUMBER,!0)&&h("receivedStatus",n,R.NUMBER,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t;return P(this,(function(i){switch(i.label){case 0:return a.info(v.O,"setMessageReceivedStatus ->messageId:".concat(e,",receivedStatus:").concat(n)),[4,o.setMessageReceivedStatus(e,n)];case 1:return(t=i.sent())===r.SUCCESS?[2,{code:t}]:(a.warn(v.O,"setMessageReceivedStatus ->code:".concat(t,",messageId:").concat(e)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}function Io(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("tag.tagId",e.tagId,R.STRING,!0)&&h("tag.tagId",e.tagId,(function(e){return e.length<=10}))&&h("tag.tagName",e.tagName,(function(e){return e.length<=15}))&&h("tag.tagName",e.tagName,R.STRING,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n;return P(this,(function(a){switch(a.label){case 0:return o.info(v.O,"createTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,t.createTag(e)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(o.warn(v.O,"createTag ->code:".concat(n,",tagId:").concat(e.tagId)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ho(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("tagId",e,R.STRING,!0)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n;return P(this,(function(a){switch(a.label){case 0:return o.info(v.O,"removeTag ->tagId:".concat(e)),[4,t.removeTag(e)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(o.warn(v.O,"removeTag ->code:".concat(n,",tagId:").concat(e)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ro(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("tag.tagId",e.tagId,R.STRING,!0)&&h("tag.tagName",e.tagName,R.STRING,!0)&&h("tag.tagName",e.tagName,(function(e){return e.length<=15}))?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n;return P(this,(function(a){switch(a.label){case 0:return o.info(v.O,"updateTag ->tagId:".concat(e.tagId,",tagName:").concat(e.tagName)),[4,t.updateTag(e)];case 1:return(n=a.sent().code)===r.SUCCESS?[2,{code:n}]:(o.warn(v.O,"updateTag ->code:".concat(n,",tagId:").concat(e.tagId)),[2,{code:n,msg:Ue[n]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function po(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,a;return P(this,(function(i){switch(i.label){case 0:return[4,n.getTagList()];case 1:return e=i.sent(),o=e.code,a=e.data,o===r.SUCCESS?[2,{code:r.SUCCESS,data:a}]:(t.warn(v.O,"getTagList ->code:".concat(o)),[2,{code:o,msg:Ue[o]}])}}))}))}))]}))}))}function mo(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return h("conversationType",e.conversationType,R.NUMBER)&&h("targetId",e.targetId,R.STRING)&&h("channelId",e.channelId,R.CHANNEL_ID)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i;return P(this,(function(c){switch(c.label){case 0:return o.info(v.O,"getTagsForConversation ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,t.getTagsForConversation(e)];case 1:return n=c.sent(),a=n.code,i=n.data,a===r.SUCCESS?[2,{code:a,data:i}]:[2,{code:a,msg:Ue[a]}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Eo(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("tagId",e,R.STRING,!0)&&h("conversations",n,R.ARRAY,!0)&&!n.every((function(e){return!h("conversation.conversationType",e.conversationType,R.NUMBER,!0)||!h("conversation.targetId",e.targetId,R.STRING,!0)||!h("conversation.channelId",e.channelId,R.CHANNEL_ID)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t;return P(this,(function(i){switch(i.label){case 0:return a.info(v.O,"addTagForConversations ->tagId:".concat(e)),[4,o.addTagForConversations(e,n)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(a.warn(v.O,"addTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function To(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("tagId",e,R.STRING,!0)&&h("conversations",n,R.ARRAY,!0)&&!n.every((function(e){return!h("conversation.conversationType",e.conversationType,R.NUMBER,!0)||!h("conversation.targetId",e.targetId,R.STRING,!0)||!h("conversation.channelId",e.channelId,R.CHANNEL_ID)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t;return P(this,(function(i){switch(i.label){case 0:return a.info(v.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,n)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(a.warn(v.O,"removeTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function So(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("conversation.conversationType",e.conversationType,R.NUMBER,!0)&&h("conversation.targetId",e.targetId,R.STRING,!0)&&h("conversation.channelId",e.channelId,R.CHANNEL_ID)&&h("tagIds",n,R.ARRAY,!0)&&!n.every((function(e){return!h("tagId",e,R.STRING,!0)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t;return P(this,(function(i){switch(i.label){case 0:return a.info(v.O,"removeTagsForConversation ->tagIds:".concat(n,",targetId:").concat(e.targetId,",conversationType:").concat(e.conversationType)),[4,o.removeTagsForConversation(e,n)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(a.warn(v.O,"removeTagsForConversation ->code:".concat(t,",tagIds:").concat(n)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Oo(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("tagId",e,R.STRING,!0)&&h("conversations",n,R.ARRAY,!0)&&!n.every((function(e){return!h("conversation.conversationType",e.conversationType,R.NUMBER,!0)||!h("conversation.targetId",e.targetId,R.STRING,!0)||!h("conversation.channelId",e.channelId,R.CHANNEL_ID)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t;return P(this,(function(i){switch(i.label){case 0:return a.info(v.O,"removeTagForConversations ->tagId:".concat(e)),[4,o.removeTagForConversations(e,n)];case 1:return(t=i.sent().code)===r.SUCCESS?[2,{code:t}]:(a.warn(v.O,"removeTagForConversations ->code:".concat(t,",tagId:").concat(e)),[2,{code:t,msg:Ue[t]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function No(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return h("tagId",e,R.STRING,!0)&&h("count",n,R.NUMBER,!0)&&h("startTime",t,R.NUMBER,!0)?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o,c,s;return P(this,(function(u){switch(u.label){case 0:return i.info(v.O,"getConversationListByTag ->tagId:".concat(e)),[4,a.getConversationListByTag(e,t,n)];case 1:return o=u.sent(),c=o.code,s=o.data,c===r.SUCCESS?[2,{code:c,data:s}]:(i.warn(v.O,"getConversationListByTag ->code:".concat(c,",tagId:").concat(e)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function _o(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return h("tagId",e,R.STRING,!0)&&h("containMuted",n,R.BOOLEAN,!0)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c;return P(this,(function(s){switch(s.label){case 0:return a.info(v.O,"getUnreadCountByTag ->tagId:".concat(e)),[4,o.getUnreadCountByTag(e,n)];case 1:return t=s.sent(),i=t.code,c=t.data,i===r.SUCCESS?[2,{code:i,data:c}]:(a.warn(v.O,"getUnreadCountByTag ->code:".concat(i,",tagId:").concat(e)),[2,{code:i,msg:Ue[i]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Co(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return h("tagId",e,R.STRING,!0)&&h("conversation.targetId",n.targetId,R.STRING,!0)&&h("conversation.conversationType",n.conversationType,R.NUMBER,!0)&&h("conversation.channelId",n.channelId,R.CHANNEL_ID)&&h("status.isTop",t,R.BOOLEAN,!0)?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o;return P(this,(function(c){switch(c.label){case 0:return i.info(v.O,"setConversationStatusInTag ->tagId:".concat(e,",targetId:").concat(n.targetId,",conversationType").concat(n.conversationType)),[4,a.setConversationStatusInTag(e,n,{isTop:t})];case 1:return(o=c.sent().code)===r.SUCCESS?[2,{code:o}]:(i.warn(v.O,"setConversationStatusInTag ->code:".concat(o,",tagId:").concat(e)),[2,{code:o,msg:Ue[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}xt(C.COMBINE_HTML,(function(e,n){return new jn({remoteUrl:e.downloadUrl,nameList:n.nameList,summaryList:n.summaryList,conversationType:n.conversationType,user:n.user,extra:n.extra})}));var Ao={COMET:"comet",WEBSOCKET:"websocket"},yo={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var Mo=Object.freeze({__proto__:null,getAllConversationList:function(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return A()?h("channelId",e,R.ONLY_STRING)?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return o.info(v.O,"getAllConversationList -> channelId: ".concat(e)),M(e)?[4,t.getConversationListWithAllChannel()]:[3,2];case 1:return n=s.sent(),[3,4];case 2:return[4,t.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:n=s.sent(),s.label=4;case 4:return a=n.code,i=n.data,a===r.SUCCESS&&i?(c=i.map((function(e){return ie(e)})),[2,{code:a,data:c}]):(o.warn(v.O,"getAllConversationList fail -> code: ".concat(a," channelId: ").concat(e)),[2,{code:a,msg:Ue[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,n,t){return L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return A()?h("startTime",e,R.NUMBER,!0)&&h("count",n,R.NUMBER,!0)&&h("channelId",t,R.ONLY_STRING)?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o,c,s,u,d,f;return P(this,(function(l){switch(l.label){case 0:return o="startTime: ".concat(e,", count: ").concat(n,", channelId: ").concat(t),i.info(v.O,"getConversationList -> ".concat(o)),M(t)?[4,a.getConversationListWithAllChannelByPage(e,n)]:[3,2];case 1:return c=l.sent(),[3,4];case 2:return s=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(s,e,n,t)];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 ie(e)})),[2,{code:u,data:f}]):(i.warn(v.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(n,t,o){return L(this,void 0,void 0,(function(){var a=this;return P(this,(function(i){return A()?h("keyword",n,R.STRING,!0)&&h("messageTypes",t,R.ARRAY,!0)&&h("channelId",o,R.ONLY_STRING)&&!t.every((function(e){return!h("messageType",e,R.STRING,!0)}))?[2,Ie((function(i,c){return L(a,void 0,void 0,(function(){var a,s,u,d,f;return P(this,(function(l){switch(l.label){case 0:return a="keyword: ".concat(n,", messageTypes: ").concat(JSON.stringify(t),", channelId: ").concat(o),c.info(v.O,"searchConversationByContent -> ".concat(e)),M(o)?[4,i.searchConversationByContentWithAllChannel(n,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,i.searchConversationByContent(n,t,o)];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 ie(e)})),[2,{code:u,data:f}]):(c.warn(v.O,"searchConversationByContent fail -> code: ".concat(u," ").concat(a)),[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,n,t,o){return L(this,void 0,void 0,(function(){var a=this;return P(this,(function(i){return A()?h("conversation",e,R.CONVERSATION,!0)&&h("keyword",n,R.STRING,!0)&&h("startTime",t,R.NUMBER,!0)&&h("count",o,R.NUMBER,!0)?[2,Ie((function(i,c){return L(a,void 0,void 0,(function(){var a,s,u,d,f,l,g,I,h,R;return P(this,(function(p){switch(p.label){case 0:return a="conversation: ".concat(JSON.stringify(e),", keyword: ").concat(n,", timestamp: ").concat(t,", count: ").concat(o),c.info(v.O,"searchMessages -> ".concat(a)),s=e.targetId,u=e.conversationType,d=e.channelId,M(d)?[4,i.searchMessageByContentWithAllChannel(u,s,n,t,o)]:[3,2];case 1:return f=p.sent(),[3,4];case 2:return 0,[4,i.searchMessageByContent(u,s,n,t,o,0,d)];case 3:f=p.sent(),p.label=4;case 4:return l=f.code,g=f.data,l===r.SUCCESS&&g?(I=g.messages,h=g.count,R=I.map((function(e){return ae(e)})),[2,{code:l,data:{messages:R,count:h}}]):(c.warn(v.O,"searchMessages fail -> code: ".concat(l," ").concat(a)),[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,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?h("conversation",e,R.CONVERSATION,!0)&&h("option",n,R.OBJECT,!0)&&h("option.keyword",n.keyword,R.STRING,!0)&&h("option.startTime",n.startTime,R.NUMBER,!0)&&h("option.endTime",n.endTime,R.NUMBER,!0)&&h("option.offset",n.offset,R.NUMBER)&&h("option.limit",n.limit,R.NUMBER)?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l,g,I,h;return P(this,(function(R){switch(R.label){case 0:return t="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(n)),a.info(v.O,"searchMessageInTimeRange -> ".concat(t)),i=e.conversationType,c=e.targetId,s=n.keyword,u=n.startTime,d=n.endTime,f=n.offset,l=n.limit,f=f||0,l=l||5,[4,o.searchMessageByContentInTimeRangeWithAllChannel(i,c,s,u,d,f,l)];case 1:return g=R.sent(),I=g.code,h=g.data,I===r.SUCCESS&&h?[2,{code:I,data:{messages:h.messages.map((function(e){return ae(e)}))}}]:(a.warn(v.O,"searchMessageInTimeRange fail -> code: ".concat(I,", ").concat(t)),[2,{code:I}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?h("conversation",e,R.CONVERSATION,!0)&&h("option",n,R.OBJECT,!0)&&h("option.count",n.count,R.NUMBER)&&h("option.timestamp",n.timestamp,R.NUMBER)&&h("option.order",n.order,(function(e){return[0,1].includes(e)}))&&h("option.messageTypes",n.messageTypes,R.ARRAY,!0)&&!n.messageTypes.every((function(e){return!h("option.messageType",e,R.STRING,!0)}))?[2,Ie((function(o,a){return L(t,void 0,void 0,(function(){var t,i,c,s,u,d,f,l,g,I,h,R,p,m,E;return P(this,(function(T){switch(T.label){case 0:return t=n.count,i=n.timestamp,c=n.order,s=n.messageTypes,u="conversation: ".concat(JSON.stringify(e),", option: ").concat(JSON.stringify(n)),a.info(v.O,"getHistoryMessagesByMessageTypes -> ".concat(u)),d=e.conversationType,f=e.targetId,l=e.channelId,t||(t=20),i||(i=0),c||(c=0),l||(l=""),[4,o.getHistoryMessagesByObjectNames(d,f,i,t,s,c,l)];case 1:return g=T.sent(),I=g.code,h=g.data,I===r.SUCCESS?(p=(R=h).list,m=R.hasMore,E=p.map((function(e){return ae(e)})),[2,{code:I,data:{messages:E,hasMore:m}}]):(a.warn(v.O,"getHistoryMessagesByMessageTypes fail -> code: ".concat(I," ").concat(u)),[2,{code:I,msg:Ue[I]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?h("conversation",e,R.CONVERSATION,!0)&&h("timestamp",n,R.NUMBER,!0)?[2,Ie((function(o,r){return L(t,void 0,void 0,(function(){var t,a,i,c;return P(this,(function(s){switch(s.label){case 0:return t="conversation: ".concat(JSON.stringify(e),", timestamp: ").concat(n),r.info(v.O,"updateSentMsgReceiptStatus -> ".concat(t)),a=e.conversationType,i=e.targetId,c=e.channelId,[4,o.setMessageStatusToRead(a,i,n,c)];case 1:return[2,s.sent()]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?h("messageId",e,R.NUMBER,!0)&&h("receivedStatus",n,(function(e){return!M(a[e])}),!0)?[2,Ie((function(o,r){return L(t,void 0,void 0,(function(){return P(this,(function(t){switch(t.label){case 0:return r.info(v.O,"setMessageReceivedStatus -> messageId: ".concat(e,", receivedStatus: ").concat(n)),[4,o.setMessageReceivedStatus(e,n)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,n){return L(this,void 0,void 0,(function(){var t=this;return P(this,(function(o){return A()?h("messageId",e,R.NUMBER,!0)&&h("sentStatus",n,(function(e){return!M(B[e])}),!0)?[2,Ie((function(o,r){return L(t,void 0,void 0,(function(){return P(this,(function(t){switch(t.label){case 0:return r.info(v.O,"setMessageSentStatus ->messageId: ".concat(e,", sentStatus: ").concat(n)),[4,o.setMessageSentStatus(e,n)];case 1:return[2,{code:t.sent()}]}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,n,t){return void 0===t&&(t=""),L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return A()?h("messageId",e,R.NUMBER,!0)&&h("content",n,R.OBJECT,!0)&&h("messageType",t,R.ONLY_STRING,!0)?[2,Ie((function(r,a){return L(o,void 0,void 0,(function(){return P(this,(function(o){switch(o.label){case 0:return a.info(v.O,"setMessageSentStatus ->messageId: ".concat(e,", messageType: ").concat(t)),[4,r.setMessageContent(e,n,t)];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 L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return A()?!h("messageIds",e,R.ARRAY,!0)||e.every((function(e){return!h("messageId",e,R.NUMBER,!0)}))?[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]:[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){return P(this,(function(n){switch(n.label){case 0:return o.info(v.O,"deleteMessages ->messageIds: ".concat(JSON.stringify(e))),[4,t.deleteMessages(e)];case 1:return[2,{code:n.sent()}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return L(this,void 0,void 0,(function(){var n=this;return P(this,(function(t){return A()?[2,Ie((function(t,o){return L(n,void 0,void 0,(function(){var n,a,i,c;return P(this,(function(s){switch(s.label){case 0:return n=e.conversationType,a=e.targetId,i=e.channelId,o.info(v.O,"clearMessages ->targetId:".concat(a,",conversationType:").concat(n)),[4,t.clearMessages(n,a,i)];case 1:return(c=s.sent())===r.SUCCESS?[2,{code:c}]:(o.warn(v.O,"clearMessages ->code:".concat(c,",targetId:").concat(a)),[2,{code:c,msg:Ue[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,n,t){return L(this,void 0,void 0,(function(){var o,a,i,c=this;return P(this,(function(s){return A()?(o=e.conversationType,a=e.targetId,i=e.channelId,h("conversationType",o,R.NUMBER,!0)&&h("targetId",a,R.STRING,!0)&&h("timestamp",n,R.NUMBER,!0)&&h("cleanSpace",t,R.BOOLEAN)?[2,Ie((function(e,s){return L(c,void 0,void 0,(function(){var c;return P(this,(function(u){switch(u.label){case 0:return[4,e.deleteMessagesByTimestamp(o,a,n,t,i)];case 1:return(c=u.sent())===r.SUCCESS?[2,{code:c}]:(s.warn(v.O,"deleteMessagesByTimestamp ->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]}]}))}))},insertMessage:function(e,n,t){return void 0===t&&(t={}),L(this,void 0,void 0,(function(){var o=this;return P(this,(function(a){return A()?[2,Ie((function(a,i){return L(o,void 0,void 0,(function(){var o,c,s,u,d,f,l,g,I,h,R,p,m,E,T;return P(this,(function(S){switch(S.label){case 0:return o=n.senderUserId,c=n.messageType,s=n.content,u=n.messageDirection,n.messageUId,d=n.canIncludeExpansion,f=n.expansion,l=n.disableNotification,g=n.sentTime,I=n.sentStatus,i.info(v.O,"insertMessage ->targetId:".concat(e.targetId,",conversationType:").concat(e.conversationType)),h=t.isUnread,R=t.searchContent,p={senderUserId:o,messageType:c,content:s,messageDirection:u,sentTime:g,sentStatus:I,searchContent:R,isUnread:h,messageUId:"",disableNotification:l,canIncludeExpansion:d,expansionMsg:JSON.stringify(f),channelId:e.channelId||""},[4,a.insertMessage(e.conversationType,e.targetId,p)];case 1:return m=S.sent(),E=m.code,T=m.data,E===r.SUCCESS?[2,{code:E,data:ae(T)}]:(i.warn(v.O,"insertMessage ->code:".concat(E,",targetId:").concat(e.targetId)),[2,{code:E,msg:Ue[E]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return L(this,void 0,void 0,(function(){var e=this;return P(this,(function(n){return A()?[2,Ie((function(n,t){return L(e,void 0,void 0,(function(){var e,o,r;return P(this,(function(a){switch(a.label){case 0:return t.info(v.O,"clearLocalData ->"),[4,n.clearData()];case 1:return e=a.sent(),o=e.code,r=e.data,[2,{code:o,data:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Ue[r.NOT_SUPPORT]}]}))}))}}),Uo=function(e,n,t){this.type=e,this.userIdList=n,this.mentionedContent=t};export{qn as BaseMessage,jn as CombineMessage,Ao as ConnectType,D as Events,Qn as FileMessage,$n as GIFMessage,Yn as HQVoiceMessage,Kn as ImageMessage,nt as LocationMessage,Uo as MentionedInfoBody,yo as MessageType,ot as ReferenceMessage,rt as RichContentMessage,B as SentStatus,Wn as SightMessage,Xn as TextMessage,et as VoiceMessage,Ce as __addSDKVersion,Eo as addConversationsToTag,he as addEventListener,Io as addTag,kn as addToBlacklist,xn as bindRTCRoomForChatroom,ze as clearAllMessagesUnreadStatus,Ee as clearEventListeners,Qt as clearHistoryMessages,fo as clearMessages,Je as clearMessagesUnreadStatus,He as clearTextMessageDraft,go as clearUnreadCountByTimestamp,we as connect,uo as deleteLocalMessagesByTimestamp,jt as deleteMessages,Se as destroy,be as disconnect,Mo as electronExtension,bn as forceRemoveChatRoomEntry,Ln as forceSetChatRoomEntry,Bn as getAllChatRoomEntries,an as getAllConversationState,mn as getAllUltraGroupUnreadCount,En as getAllUltraGroupUnreadMentionedCount,rn as getAllUnreadMentionedCount,Vn as getBlacklist,Fn as getBlacklistStatus,sn as getBlockUltraGroupList,en as getBlockedConversationList,Dn as getChatRoomEntry,yn as getChatRoomInfo,Gn as getChatroomHistoryMessages,Oe as getConnectionStatus,Be as getConversation,De as getConversationList,Qe as getConversationNotificationLevel,$e as getConversationNotificationStatus,No as getConversationsFromTagByPage,_e as getCurrentUserId,Ae as getDeviceId,bt as getFileToken,Dt as getFileUrl,ro as getFirstUnreadMessage,qt as getHistoryMessages,io as getMessage,to as getMessageReader,Zt as getRemoteHistoryMessages,Ne as getServerTime,po as getTags,mo as getTagsFromConversation,xe as getTextMessageDraft,tn as getTopConversationList,Ve as getTotalUnreadCount,Fe as getTotalUnreadCountByLevels,qe as getTotalUnreadMentionedCountByLevels,hn as getUltraGroupDefaultNotificationLevel,Sn as getUltraGroupFirstUnreadMessageTimestamp,cn as getUltraGroupList,dn as getUltraGroupMessageListByMessageUId,pn as getUltraGroupUnreadCountByTargetId,In as getUltraGroupUnreadMentionedCountByTargetId,Tn as getUltraGroupUnreadMentionedMessages,Ze as getUnreadCount,_o as getUnreadCountByTag,on as getUnreadMentionedCount,co as getUnreadMentionedMessages,Te as init,ao as insertMessage,ye as installPlugin,_n as joinChatRoom,Cn as joinExistChatRoom,vn as modifyMessage,Re as onceEventListener,An as quitChatRoom,Xt as recallMessage,oo as registerMessageType,gn as removeAllExpansionForUltraGroupMessage,wn as removeChatRoomEntries,Pn as removeChatRoomEntry,Ge as removeConversation,To as removeConversationsFromTag,pe as removeEventListener,me as removeEventListeners,ln as removeExpansionForUltraGroupMessage,Hn as removeFromBlacklist,eo as removeMessageExpansionForKey,ho as removeTag,Oo as removeTagFromConversations,So as removeTagsFromConversation,ke as saveTextMessageDraft,lo as searchConversationByContent,so as searchMessages,kt as sendFileMessage,Vt as sendHQVoiceMessage,Ht as sendImageMessage,Bt as sendMessage,Jt as sendReadReceiptMessage,zt as sendReadReceiptRequest,Kt as sendReadReceiptResponse,Yt as sendReadReceiptResponseV2,Ft as sendSightMessage,Wt as sendSyncReadStatusMessage,Gt as sendTextMessage,no as sendTypingStatusMessage,un as sendUltraGroupTypingStatus,Un as setChatRoomEntries,Mn as setChatRoomEntry,Xe as setConversationNotificationLevel,je as setConversationNotificationStatus,nn as setConversationToTop,Co as setConversationToTopInTag,vo as setMessageReceivedStatus,Rn as setUltraGroupDefaultNotificationLevel,fn as updateExpansionForUltraGroupMessage,$t as updateMessageExpansion,Ro as updateTag};