@rongcloud/imlib-next 5.10.1 → 5.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -12,4 +12,4 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var j=function(e,t){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},j(e,t)};function Q(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var X=function(){return X=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},X.apply(this,arguments)};function Z(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function $(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}var ee=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,i=t.length;n<i;n++)if(!e[t[n]])return!1;return!0}(uni))},te=ee();var ne=null,ie=function(e){return Z(void 0,void 0,void 0,(function(){var t;return $(this,(function(n){switch(n.label){case 0:return[4,oe.getNetworkType()];case 1:return t=n.sent(),ne({status:"online"===e.type,type:t}),[2]}}))}))};var oe={tag:"browser",httpReq:function(t){return e(t).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:te,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,i=t.reason;e(n,i)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,i=e.effectiveType,o=n||i||t.UNKONWN;return Promise.resolve(o)},setNetworkStatusListener:function(e){ne=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",ie),window.addEventListener("online",ie))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",ie),window.removeEventListener("online",ie)),ne=null}},re=ee(),ae=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},se={setItem:ae("setStorageSync"),getItem:ae("getStorageSync"),removeItem:ae("removeStorageSync"),clear:ae("clearStorageSync")},ce=null,de=function(e){var t=e.isConnected,n=e.networkType;ce({status:t,type:n})};var ue={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){wx.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:se,sessionStorage:se,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:re,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ce=e,wx.onNetworkStatusChange(de)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(de),ce=null}},le=ee(),ve=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var i=my[e]({key:t[0]}).data;return i?JSON.stringify(i):i}catch(e){}}},fe={setItem:ve("setStorageSync"),getItem:ve("getStorageSync"),removeItem:ve("removeStorageSync"),clear:ve("clearStorageSync")},ge=null,Se=function(e){var t=e.isConnected,n=e.networkType;ge({status:t,type:n})};var he={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:u,method:t,headers:s,timeout:a,data:d,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:fe,sessionStorage:fe,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:le,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ge=e,my.onNetworkStatusChange(Se)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Se),ge=null}},Te=ee(),Ie=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},_e={setItem:Ie("setStorageSync"),getItem:Ie("getStorageSync"),removeItem:Ie("removeStorageSync"),clear:Ie("clearStorageSync")},me=null,pe=function(e){var t=e.isConnected,n=e.networkType;me({status:t,type:n})};var Ne={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Te,localStorage:_e,sessionStorage:_e,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},i={data:JSON.stringify(n),status:e.statusCode};t(i)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){me=e,tt.onNetworkStatusChange(pe)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(pe),me=null}},Ee=ee(),ye=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},Re={setItem:ye("setStorageSync"),getItem:ye("getStorageSync"),removeItem:ye("removeStorageSync"),clear:ye("clearStorageSync")},Ce=null,Oe=function(e){var t=e.isConnected,n=e.networkType;Ce({status:t,type:n})};var Ae={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ee,localStorage:Re,sessionStorage:Re,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},i={data:JSON.stringify(n),status:e.statusCode};t(i)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return Z(this,void 0,void 0,(function(){return $(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Ce=e,swan.onNetworkStatusChange(Oe)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Oe),Ce=null}},Ue=ee(),we=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},Pe={setItem:we("setStorageSync"),getItem:we("getStorageSync"),removeItem:we("removeStorageSync"),clear:we("clearStorageSync")},Me=null,be=function(e){var t=e.isConnected,n=e.networkType;Me({status:t,type:n})};var Le={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){jd.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Pe,sessionStorage:Pe,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ue,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Me=e,jd.onNetworkStatusChange(be)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(be),Me=null}},Ge=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},Je={setItem:Ge("setStorageSync"),getItem:Ge("getStorageSync"),removeItem:Ge("removeStorageSync"),clear:Ge("clearStorageSync")},De=null,Be=function(e){var t=e.isConnected,n=e.networkType;De({status:t,type:n})};var xe,ke={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){uni.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Je,sessionStorage:Je,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},i=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){i.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){i.onError((function(t){e(t.errMsg)}))},onMessage:function(e){i.onMessage((function(t){e(t.data)}))},onOpen:function(e){i.onOpen(e)},send:function(e){i.send({data:e})},close:function(e,t){i.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){De=e,uni.onNetworkStatusChange(Be)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Be),De=null}},Ve=function(e){return e&&e.request&&e.getSystemInfo},He="undefined"!=typeof uni&&Ve(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ke;case"mp-jd":return Le;case"mp-baidu":return Ae;case"mp-toutiao":return Ne;case"mp-alipay":return he;case"mp-weixin":return ue;default:return oe}}():"undefined"!=typeof jd&&Ve(jd)?Le:"undefined"!=typeof my&&Ve(my)?he:"undefined"!=typeof tt&&Ve(tt)?Ne:"undefined"!=typeof swan&&Ve(swan)?Ae:"undefined"!=typeof wx&&Ve(wx)?ue:oe;function Fe(e){var t=e.conversationType,n=e.channelId,i=e.messageType,o=e.content,r=e.senderUserId,s=e.targetId,c=e.sentTime,d=e.receivedTime,u=e.messageUId,l=e.messageDirection,v=e.isPersited,f=e.isCounted,g=e.isOffLineMessage,S=e.canIncludeExpansion,h=e.expansion,T=e.receivedStatus,I=e.receivedStatusInfo,_=e.disableNotification,m=e.isMentioned,p=e.isStatusMessage,N=e.readReceiptInfo,E=e.pushConfig,y=e.messageId,R=e.isInterrupt,C=e.isModifyMessage,O=e.channelType,A=e.sentStatus,U=e.directedUserIds;return T||(T=a.UNREAD),{messageType:i,channelId:n||"",content:o,senderUserId:r,targetId:s,conversationType:t,sentTime:c,receivedTime:d,messageUId:u,messageDirection:l,isPersited:v,isCounted:f,isMentioned:m,disableNotification:_,isStatusMessage:p,canIncludeExpansion:S,expansion:h,receivedStatus:T,receivedStatusInfo:I,readReceiptInfo:N,pushConfig:E,messageId:y,isInterrupt:R,isModifyMessage:C,sentStatus:A,isOffLineMessage:g,channelType:O,directedUserIds:U}}function Ye(e){var t=e.conversationType,n=e.targetId,i=e.latestMessage,o=e.unreadMessageCount,r=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,d=e.notificationStatus,u=e.notificationLevel,l=e.isTop,v=e.channelId,f=e.unreadMentionedCount,g=e.matchCount,S=e.operationTime,h=e.draft,T={conversationType:t,targetId:n,latestMessage:i&&Fe(i),unreadMessageCount:o,hasMentioned:r,mentionedInfo:r?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:d,notificationLevel:u,isTop:l,channelId:v,unreadMentionedCount:f,matchCount:g,operationTime:S,draft:h||""};return T.conversationType===s.ULTRA_GROUP&&(T.firstUnreadMessage=e.firstUnreadMessage,T.channelType=e.channelType,T.unreadMentionedMeCount=e.unreadMentionedMeCount),T}function qe(e,t){null===console||void 0===console||console.warn("Method '"+e+"' is deprecated, please use '"+t+"' instead")}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",e.SYNC_READ_STATUS="SYNC_READ_STATUS",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS",e.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",e.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",e.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED",e.OWN_USER_PROFILE_CHANGED="OWN_USER_PROFILE_CHANGED"}(xe||(xe={}));var Ke,ze="A-add_to_blacklist-T",We="A-add_to_blacklist-R",je="A-remove_from_blacklist-T",Qe="A-remove_from_blacklist-R",Xe="A-get_blacklist-T",Ze="A-get_blacklist-R",$e="A-get_blacklist_status-T",et="A-get_blacklist_status-R",nt="A-get_chatroom_info-T",it="A-get_chatroom_info-R",ot="A-set_chatroom_entry-T",rt="A-set_chatroom_entry-R",at="A-set_chatroom_entries-T",st="A-set_chatroom_entries-R",ct="A-force_set_chatroom_entry-T",dt="A-force_set_chatroom_entry-R",ut="A-remove_chatroom_entry-T",lt="A-remove_chatroom_entry-R",vt="A-remove_chatroom_entries-T",ft="A-remove_chatroom_entries-R",gt="A-force_remove_chatroom_entry-T",St="A-force_remove_chatroom_entry-R",ht="A-get_chatroom_entry-T",Tt="A-get_chatroom_entry-R",It="A-get_all_chatroom_entries-T",_t="A-get_all_chatroom_entries-R",mt="A-get_chatroom_history_messages-T",pt="A-get_chatroom_history_messages-R",Nt="A-bind_rtc_room_for_chatroom-T",Et="A-bind_rtc_room_for_chatroom-R",yt="A-get_top_conversation_list-R",Rt="A-get_top_conversation_list-T",Ct="A-get_conversation_list-T",Ot="A-get_conversation_list-R",At="A-get_conversation-T",Ut="A-get_conversation-R",wt="A-remove_conversation-T",Pt="A-remove_conversation-R",Mt="A-get_conversation_message_draft-T",bt="A-get_conversation_message_draft-R",Lt="A-save_conversation_message_draft-T",Gt="A-save_conversation_message_draft-R",Jt="A-clear_conversation_message_draft-T",Dt="A-clear_conversation_message_draft-R",Bt="A-get_total_unread_count-T",xt="A-get_total_unread_count-R",kt="A-get_total_unread_count_by_levels-T",Vt="A-get_total_unread_count_by_levels-R",Ht="A-get_unread_count-T",Ft="A-get_unread_count-R",Yt="A-clear_unread_count-T",qt="A-clear_unread_count-R",Kt="A-clear_all_unread_count-O",zt="A-set_conversation_notification_level-T",Wt="A-set_conversation_notification_level-R",jt="A-set_conversation_status-T",Qt="A-set_conversation_status-R",Xt="A-get_conversation_notification_level-T",Zt="A-get_conversation_notification_level-R",$t="A-get_conversation_notification_status-T",en="A-get_conversation_notification_status-R",tn="A-set_conversation_notification_status-T",nn="A-set_conversation_notification_status-R",on="A-get_unread_conversation_list-T",rn="A-get_unread_conversation_list-R",an="A-get_unread_mentioned_count-T",sn="A-get_unread_mentioned_count-R",cn="A-get_all_unread_mentioned_count-T",dn="A-get_all_unread_mentioned_count-R",un="A-get_all_conversation-state-T",ln="A-e_get_all_conversation_list-T",vn="A-e_get_all_conversation_list-R",fn="A-e_get_conversation_list-T",gn="A-e_get_conversation_list-R",Sn="A-e_search_conversation_by_content-T",hn="A-e_search_conversation_by_content-R",Tn="A-get_conversations-T",In="A-get_conversations-R",_n="A-e_search_messages-T",mn="A-e_search_messages-R",pn="A-e_search_message_in_time_range-T",Nn="A-e_search_message_in_time_range-R",En="A-e_search_messages_by_user-T",yn="A-e_search_messages_by_user-R",Rn="A-e_get_history_messages_by_message_types-T",Cn="A-e_get_history_messages_by_message_types-R",On="A-e_get_continuous_messages-T",An="A-e_get_continuous_messages-R",Un="A-e_set_message_status_to_read-T",wn="A-e_set_message_status_to_read-R",Pn="A-e_set_message_received_status-T",Mn="A-e_set_message_received_status-R",bn="A-e_set_message_sent_status-T",Ln="A-e_set_message_sent_status-R",Gn="A-e_set_message_sent_status_info-T",Jn="A-e_set_message_sent_status_info-R",Dn="A-e_set_message_content-T",Bn="A-e_set_message_content-R",xn="A-e_delete_messages-T",kn="A-e_delete_messages-R",Vn="A-e_clear_messages-T",Hn="A-e_clear_messages-R",Fn="A-e_delete_messages_by_timestamp-T",Yn="A-e_delete_messages_by_timestamp-R",qn="A-e_insert_message-T",Kn="A-e_insert_message-R",zn="A-e_batch_insert_message-T",Wn="A-e_batch_insert_message-R",jn="A-e_get_message_count-T",Qn="A-e_get_message_count-R",Xn="A-e_get_private_message_deliver_time-T",Zn="A-e_get_private_message_deliver_time-R",$n="A-e_get_group_message_deliver_list-T",ei="A-e_get_group_message_deliver_list-R",ti="A-e_set_check_duplicate_message-T",ni="A-e_set_check_duplicate_message-R",ii="A-e_set_check_duplicate_message-T",oi="A-e_set_check_duplicate_message-R",ri="A-batch_Remove_conversation-T",ai="A-batch_Remove_conversation-R",si="A-batch_set_con_notifi_level-T",ci="A-batch_set_con_notifi_level-R",di="A-batch_set_con_to_top-T",ui="A-batch_set_con_to_top-R",li="A-batch_clear_remote_msg-T",vi="A-batch_clear_remote_msg-R",fi="A-batch_clear_msg-T",gi="A-batch_clear_msg-R",Si="A-get_remote_history_messages-T",hi="A-get_remote_history_messages-R",Ti="A-recall_message-T",Ii="A-recall_message-R",_i="A-delete_remote_message-T",mi="A-delete_remote_message-R",pi="A-delete_remote_message_by_timestamp-T",Ni="A-delete_remote_message_by_timestamp-R",Ei="A-update_message_expansion-T",yi="A-update_message_expansion-R",Ri="A-remove_message_expansion_for_key-T",Ci="A-remove_message_expansion_for_key-R",Oi="A-get_message_reader-T",Ai="A-get_message_reader-R",Ui="A-get_first_unread_message-T",wi="A-get_first_unread_message-R",Pi="A-get_first_unread_message_info-T",Mi="A-get_first_unread_message_info-R",bi="A-insert_message-T",Li="A-insert_message-R",Gi="A-get_message-T",Ji="A-get_message-R",Di="A-get_unread_mentioned_messages-T",Bi="A-get_unread_mentioned_messages-R",xi="A-delete_local_messages_by_timestamp-T",ki="A-delete_local_messages_by_timestamp-R",Vi="A-clear_messages-T",Hi="A-clear_messages-R",Fi="A-search_conversation_by_content-T",Yi="A-search_conversation_by_content-R",qi="A-clear_unread_count_by_timestamp-T",Ki="A-clear_unread_count_by_timestamp-R",zi="A-set_message_received_status-T",Wi="A-set_message_received_status-R",ji="A-set_proxy-T",Qi="A-set_proxy-R",Xi="A-get_proxy-T",Zi="A-get_proxy-R",$i="A-test_proxy-T",eo="A-test_proxy-R",to="A-add_tag-T",no="A-add_tag-R",io="A-remove_tag-T",oo="A-remove_tag-R",ro="A-update_tag-T",ao="A-update_tag-R",so="A-get_tags-T",co="A-get_tags-R",uo="A-get_tags_for_conversation-T",lo="A-get_tags_for_conversation-R",vo="A-add_tag_for_conversations-T",fo="A-add_tag_for_conversations-R",go="A-remove_conversations_from_tag-T",So="A-remove_conversations_from_tag-R",ho="A-remove_tags_from_conversation-T",To="A-remove_tags_from_conversation-R",Io="A-remove_tag_from_conversations-T",_o="A-remove_tag_from_conversations-R",mo="A-get_conversations_from_tag_by_page-T",po="A-get_conversations_from_tag_by_page-R",No="A-get_unread_count_by_tag-T",Eo="A-get_unread_count_by_tag-R",yo="A-set_conversation_status_in_tag-R",Ro="A-get_ultra_group_list-T",Co="A-get_ultra_group_list-R",Oo="A-get_block_ultra_group_list-T",Ao="A-get_block_ultra_group_list-R",Uo="A-send_ultra_group_typing_status-T",wo="A-send_ultra_group_typing_status-R",Po="A-get_ultra_group_message_list_by_message_uid-T",Mo="A-get_ultra_group_message_list_by_message_uid-R",bo="A-update_expansion_for_ultra_group_message-T",Lo="A-update_expansion_for_ultra_group_message-R",Go="A-remove_expansion_for_ultra_group_message-T",Jo="A-remove_expansion_for_ultra_group_message-R",Do="A-remove_all_expansion_for_ultra_group_message-T",Bo="A-remove_all_expansion_for_ultra_group_message-R",xo="A-modify_message-T",ko="A-modify_message-R",Vo="A-get_ultra_group_unread_mentioned_count_by_target_id-T",Ho="A-get_ultra_group_unread_mentioned_count_by_target_id-R",Fo="A-get_ultra_group_default_notification_level-T",Yo="A-get_ultra_group_default_notification_level-R",qo="A-set_ultra_group_default_notification_level-T",Ko="A-set_ultra_group_default_notification_level-R",zo="A-get_ultra_group_unread_count_by_target_id-T",Wo="A-get_ultra_group_unread_count_by_target_id-R",jo="A-get_all_ultra_group_unread_count-T",Qo="A-get_all_ultra_group_unread_count-R",Xo="A-get_all_ultra_group_unread_mentioned_count-T",Zo="A-get_all_ultra_group_unread_mentioned_count-R",$o="A-get_ultra_group_unread_mentioned_messages-T",er="A-get_ultra_group_unread_mentioned_messages-R",tr="A-get_ultra_group_first_unread_message_timestamp-T",nr="A-get_ultra_group_first_unread_message_timestamp-R",ir="A-get_ultra_group_unread_info_list-T",or="A-get_ultra_group_unread_info_list-R",rr="A-subscribe_user_status-T",ar="A-subscribe_user_status-R",sr="A-unsubscribe_user_status-T",cr="A-unsubscribe_user_status-R",dr="A-get_subscribe_user_status-T",ur="A-get_subscribe_user_status-R",lr="A-get_subscribe_user_status_list-T",vr="A-get_subscribe_user_status_list-R",fr="A-get_message_by_timestamp-T",gr="A-get_message_by_timestamp-R",Sr="A-update_my_user_profile-T",hr="A-update_my_user_profile-R",Tr="A-get_user_profiles-T",Ir="A-get_user_profiles-R",_r="A-get_my_user_profile-T",mr="A-get_my_user_profile-R",pr="A-update_my_user_profile_visibility-T",Nr="A-update_my_user_profile_visibility-R",Er="A-get_my_user_profile_visibility-T",yr="A-get_my_user_profile_visibility-R",Rr="A-search_user_profile_by_unique_id-T",Cr="A-search_user_profile_by_unique_id-R";!function(e){e[e.DISALLOW=0]="DISALLOW",e[e.ALLOW=1]="ALLOW"}(Ke||(Ke={}));var Or=new c,Ar={connection:function(e,t){switch(e){case d.CONNECTED:Or.emit(xe.CONNECTED);break;case d.CONNECTING:Or.emit(xe.CONNECTING);break;case d.SUSPENDED:Or.emit(xe.SUSPEND,t);break;case d.DISCONNECTED:Or.emit(xe.DISCONNECT,t)}},batchMessage:function(e){Or.emit(xe.MESSAGES,{messages:e.map((function(e){return Fe(e)}))})},typingState:function(e){Or.emit(xe.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n,i){Or.emit(xe.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:i})},messageReceiptRequest:function(e,t,n){Or.emit(xe.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Or.emit(xe.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?Fe(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=Ur(e.unreadMessageCount||0),n.unreadMentionedCount=Ur(e.unreadMentionedCount||0),n.unreadMentionedMeCount=Ur(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));Or.emit(xe.CONVERSATION,{conversationList:t})},chatroomState:function(e){Or.emit(xe.CHATROOM,e)},expansion:function(e){Or.emit(xe.EXPANSION,e)},pullFinished:function(){Or.emit(xe.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Or.emit(xe.TAG)},conversationTagChanged:function(){Or.emit(xe.CONVERSATION_TAG)},messageBlocked:function(e){Or.emit(xe.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Or.emit(xe.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Or.emit(xe.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Or.emit(xe.ULTRA_GROUP_ENABLE,e.map((function(e){return Ye(e)})))},operateStatus:function(e){Or.emit(xe.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Or.emit(xe.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Fe(e)})))},ultraGroupMessageModified:function(e){Or.emit(xe.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Fe(e)})))},ultraGroupMessageRecalled:function(e){Or.emit(xe.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Fe(e)})))},ultraGroupChannelChangeType:function(e){Or.emit(xe.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Or.emit(xe.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Or.emit(xe.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Or.emit(xe.USER_GROUP_STATUS,e)},messageReadReceipt:function(e){Or.emit(xe.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:function(e){Or.emit(xe.SYNC_READ_STATUS,e)},subscribedUserStatusChange:function(e){Or.emit(xe.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:function(e){Or.emit(xe.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:function(e){Or.emit(xe.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:function(e){Or.emit(xe.OWN_USER_PROFILE_CHANGED,e)}};function Ur(e){return e>999?999:e}u.add("imlib-next","5.10.1");var wr=null,Pr=null,Mr=null;function br(){return Z(this,void 0,void 0,(function(){return $(this,(function(e){switch(e.label){case 0:return wr?(Mr.info(h.A_DESTROY_O),[4,S.destroy()]):[2];case 1:return e.sent(),Pr=null,wr=null,Mr=null,[2]}}))}))}function Lr(e){if(!wr)throw new Error("Not initialized yet!");return e(wr,Mr,Pr)}function Gr(e){return wr?e(wr,Mr,Pr):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function Jr(e,t,n){Or.on(e,t,n)}function Dr(e,t,n){Or.once(e,t,n)}function Br(e,t,n){Or.off(e,t,n)}function xr(e){Or.removeAll(e)}function kr(){Or.clear()}function Vr(e){!function(e){var t,n,i=e.appkey,o=e.navigators;wr?Mr.warn(h.A_INIT_REPEAT_O):(l("options.appkey",e.appkey,v.STRING,!0),l("options.navigators",e.navigators,(function(e){return f(e)&&(0===e.length||e.every(g))})),Pr=e,wr=S.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||He,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,uploadDomain:e.uploadDomain,environment:null!==(n=e.environment)&&void 0!==n?n:"default"}),(Mr=wr.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Mr.info(h.A_INIT_O,JSON.stringify({appkey:i,navigators:o,version:"5.10.1",commit:"c863d58ce595dbc99e3d31482cd46eb818a0ead1"})),wr.assignWatcher(Ar),T.init(Mr))}(e)}function Hr(){return Z(this,void 0,void 0,(function(){return $(this,(function(e){return wr?(kr(),[2,br()]):[2]}))}))}function Fr(){return Lr((function(e){return e.getConnectionStatus()}))}function Yr(){return Lr((function(e){return e.getServerTime()}))}function qr(){return Lr((function(e){return e.getCurrentUserId()}))}function Kr(e,t){u.add(e,t)}function zr(){return Lr((function(e){return e.getDeviceId()}))}function Wr(e,t){return Lr((function(n){return n.install(e,t)}))}var jr={TIMEOUT:{code:-1,msg:"Network timeout"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:r.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Qr={},Xr={};for(var Zr in jr){var $r=jr[Zr],ea=$r.code;Qr[ea]=Zr,Xr[ea]=$r}function ta(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_CONNECT_T,h.A_CONNECT_R).validate("token",e,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(h.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,i.connect(e,!!t,n)];case 1:return a=c.sent(),s=a.code===r.SUCCESS?"info":"warn",o[s](h.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===r.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:Qr[a.code]}]}}))}))}))]}))}))}function na(e){return T.info(h.A_DISCONNECT_O,{}),Lr((function(t){return t.disconnect(e)}))}function ia(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Ct,Ot).validate("count",null==e?void 0:e.count,v.NUMBER).validate("startTime",null==e?void 0:e.startTime,v.NUMBER).validate("order",null==e?void 0:e.order,v.NUMBER).validate("channelId",t,v.CHANNEL_ID).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(Ct,JSON.stringify({count:null==e?void 0:e.count,startTime:null==e?void 0:e.startTime,order:null==e?void 0:e.order,channelId:t}),n),[4,i.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=c.map((function(e){return Ye(e)})),o.info(Ot,JSON.stringify({code:s,list:d.length}),n),[2,{code:0,data:d}]):(o.warn(Ot,JSON.stringify({code:s})),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function oa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(At,Ut).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(At,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversation(t,o,a||"")];case 1:return c=v.sent(),d=c.code,u=c.data,l=d===r.SUCCESS?"info":"warn",i[l](Ut,JSON.stringify({code:d}),s),d!==r.SUCCESS?[2,{code:d,msg:Qr[d]}]:[2,{code:d,data:u?Ye(u):null}]}}))}))}))]}))}))}function ra(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(wt,Pt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(wt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.removeConversation(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Pt,JSON.stringify({code:c}),s),c!==r.SUCCESS?[2,{code:c,msg:Qr[c]}]:[2,{code:c}]}}))}))}))]}))}))}function aa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(ri,ai).validate("conversations",e,(function(t){if(!_("conversations",t,v.ARRAY,!0))return!1;if(t.length>20||0===t.length)return!1;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(!(_("conversations",o,v.OBJECT,!0)&&_("conversations.targetId",o.targetId,v.STRING,!0)&&_("conversations.conversationType",o.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(ai,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",o.channelId,v.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),o=i.createTraceId(),i.info(ri,"conversations: "+JSON.stringify(t),o),[4,n.batchRemoveConversation(t)];case 1:return a=s.sent(),i[r.SUCCESS===a?"info":"warn"](ai,"code: "+a,o),[2,{code:a}]}}))}))}))]}))}))}function sa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Mt,bt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Mt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationMessageDraft(t,o,a)];case 1:return c=v.sent(),d=c.code,u=c.data,l=d===r.SUCCESS?"info":"warn",i[l](bt,JSON.stringify({code:d,data:u}),s),d===r.SUCCESS?[2,{code:d,data:u||""}]:[2,{code:d,msg:Qr[d]}]}}))}))}))]}))}))}function ca(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Lt,Gt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("draft",t,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(Lt,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,draft:t}),n),[4,i.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Gt,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function da(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Jt,Dt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Jt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearConversationMessageDraft(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Dt,JSON.stringify({code:c}),s),c===r.SUCCESS?[2,{code:c}]:[2,{code:c,msg:Qr[c]}]}}))}))}))]}))}))}function ua(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Bt,xt).validate("conversationTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!1).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Bt,JSON.stringify({conversationTypes:t,includeMuted:e}),n),[4,i.getTotalUnreadCount("",t,e)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(xt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(xt,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function la(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(kt,Vt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!0).validate("levels",t,(function(e){return!!f(t)&&!e.some((function(e){return!p(e)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(kt,JSON.stringify({conversationTypes:e,levels:t,isMentioned:!1}),n),[4,i.getTotalUnreadCountByLevels(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Vt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Vt,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function va(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(kt,Vt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!0).validate("levels",t,(function(e){return!!f(e)&&!e.some((function(e){return!p(e)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(kt,JSON.stringify({conversationTypes:e,levels:t,isMentioned:!0}),n),[4,i.getTotalUnreadCountByLevels(e,t,!0)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Vt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Vt,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function fa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Ht,Ft).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ht,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getUnreadCount(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Ft,JSON.stringify({code:d,data:u})),[2,{code:d,data:u}]):(i.warn(Ft,JSON.stringify({code:d})),[2,{code:d,msg:Qr[d]}])}}))}))}))]}))}))}function ga(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Yt,qt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Yt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearUnreadCount(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](qt,JSON.stringify({code:c}),s),c!==r.SUCCESS?[2,{code:c,msg:Qr[c]}]:[2,{code:c}]}}))}))}))]}))}))}function Sa(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I("","").ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e;return $(this,(function(i){switch(i.label){case 0:return e=n.createTraceId(),n.info(Kt,"",e),[4,t.clearAllUnreadCount()];case 1:return[2,{code:i.sent()}]}}))}))}))]}))}))}jr.ROAMING_SERVICE_UNAVAILABLE.code;var ha=function(e,t,n,i){return void 0===i&&(i=""),Z(void 0,void 0,void 0,(function(){var o,a;return $(this,(function(s){switch(s.label){case 0:return o=function(e,t,n){void 0===n&&(n="");var i="conversationType:"+t.conversationType+",targetId:"+t.targetId;return e.debug(h.O,n+" -> "+i),i}(e,t,i),[4,n()];case 1:return(a=s.sent())!==r.SUCCESS?(e.warn(h.O,i+" fail -> "+a+" : "+Qr[a]+" , "+o),[2,{code:a,msg:Qr[a]}]):[2,{code:a}]}}))}))};function Ta(e,t){return Z(this,void 0,void 0,(function(){return $(this,(function(n){return[2,new I(zt,Wt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationLevel",t,(function(e){return void 0!==N[e]}),!0).ifReady((function(n,i){return ha(i,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]}))}))}function Ia(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(si,ci).validate("conversations",e,(function(e){if(!_("conversations",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("conversations",i,v.OBJECT,!0)&&_("conversations.targetId",i.targetId,v.STRING,!0)&&_("conversations.conversationType",i.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(ai,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).validate("notificationLevel",t,(function(e){return[-1,0,1,2,3,4,5].includes(e)}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),a=o.createTraceId(),o.info(si,"conversations: "+JSON.stringify(n),a),[4,i.batchSetConversationNotificationLevel(n,t)];case 1:return s=c.sent(),o[r.SUCCESS===s?"info":"warn"](ci,"code: "+s,a),[2,{code:s}]}}))}))}))]}))}))}function _a(e,t){return Z(this,void 0,void 0,(function(){return $(this,(function(n){return[2,new I(tn,nn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationStatus",t,(function(e){return 1===e||2===e}),!0).ifReady((function(n,i){return ha(i,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]}))}))}function ma(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Zt,Zt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Xt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationNotificationLevel(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Zt,JSON.stringify({code:d,data:u}),s),[2,{code:d,data:u}]):(i.warn(Zt,JSON.stringify({code:d}),s),[2,{code:d,msg:Qr[d]}])}}))}))}))]}))}))}function pa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I($t,en).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info($t,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationNotificationStatus(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(en,JSON.stringify({code:d,data:u}),s),[2,{code:d,data:u}]):(i.warn(en,JSON.stringify({code:d}),s),[2,{code:d,msg:Qr[d]}])}}))}))}))]}))}))}function Na(){return Z(this,void 0,void 0,(function(){return $(this,(function(e){return[2,new I("","").ifReady((function(e){return e.getBlockConversationList()}))]}))}))}function Ea(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return _("conversationType",e,(function(){return[s.PRIVATE,s.GROUP,s.SYSTEM,s.PUBLIC_SERVICE,s.APP_PUBLIC_SERVICE,s.ULTRA_GROUP].includes(e)}))&&_("level",t,p)?[2,Gr((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return o.info(h.O,"setConversationTypeNotificationLevel ->conversationType:"+e+",level:"+t),[4,i.setConversationTypeNotificationLevel(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(o.warn(h.O,"setConversationTypeNotificationLevel ->conversationType:"+e+",level:"+t),[2,{code:a,msg:Qr[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ya(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return _("conversationType",e,(function(){return[s.PRIVATE,s.GROUP,s.SYSTEM,s.PUBLIC_SERVICE,s.APP_PUBLIC_SERVICE,s.ULTRA_GROUP].includes(e)}))?[2,Gr((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return i.info(h.O,"getConversationTypeNotificationLevel ->conversationType:"+e),[4,n.getConversationTypeNotificationLevel(e)];case 1:return t=s.sent(),o=t.code,a=t.data,o===r.SUCCESS?[2,{code:o,data:a}]:(i.warn(h.O,"getConversationTypeNotificationLevel ->conversationType:"+e),[2,{code:o,msg:Qr[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ra(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(jt,Qt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("isTop",t,v.BOOLEAN).validate("isUpdateTime",n,v.BOOLEAN).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return i=e.conversationType,s=e.targetId,c=e.channelId,d=a.createTraceId(),a.info(jt,JSON.stringify({conversationType:i,targetId:s,channelId:c,isTop:t}),d),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId,n)];case 1:return u=v.sent(),l=u===r.SUCCESS?"info":"warn",a[l](Qt,JSON.stringify({code:u}),d),u!==r.SUCCESS?[2,{code:u,msg:Qr[u]}]:[2,{code:u}]}}))}))}))]}))}))}function Ca(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(di,ui).validate("conversations",e,(function(e){if(!_("conversations",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("conversations",i,v.OBJECT,!0)&&_("conversations.targetId",i.targetId,v.STRING,!0)&&_("conversations.conversationType",i.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(ai,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).validate("isTop",t,v.BOOLEAN,!0).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c;return $(this,(function(d){switch(d.label){case 0:return i=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),s=a.createTraceId(),a.info(di,"conversations: "+JSON.stringify(i),s),[4,o.batchSetConversationToTop(i,t,n)];case 1:return c=d.sent(),a[r.SUCCESS===c?"info":"warn"](ui,"code: "+c,s),[2,{code:c}]}}))}))}))]}))}))}function Oa(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Rt,yt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))})).validate("channelId",t,v.CHANNEL_ID).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(Rt,JSON.stringify({conversationTypes:e,channelId:t}),n),[4,i.getTopConversationList(e,t)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.map((function(e){return d.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId}),Ye(e)})),o.info(yt,JSON.stringify({code:s,list:d}),n),[2,{code:0,data:u}]):(o.warn(h.A_GET_TOP_CONVERSATION_LIST_E,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function Aa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(on,rn).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=i.createTraceId(),i.info(on,JSON.stringify({conversationTypes:e}),t),[4,n.getUnreadConversationList(e)];case 1:return o=u.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(c=[],d=s.map((function(e){return c.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,unreadMessageCount:e.unreadMessageCount}),Ye(e)})),i.info(rn,JSON.stringify({code:a,list:c}),t),[2,{code:0,data:d}]):(i.warn(rn,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]}))}))}function Ua(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I($t,en).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(an,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),t),[4,n.getUnreadMentionedCount(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(sn,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(sn,JSON.stringify({code:a}),t),[2,{code:a}])}}))}))}))]}))}))}function wa(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I("","").ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a;return $(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(cn,"",e),[4,t.getAllUnreadMentionedCount()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.warn(dn,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):[2,{code:o}]}}))}))}))]}))}))}function Pa(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I("","").ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(un,"",e),[4,t.getAllConversationState()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Qt,JSON.stringify({code:o}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o}]}}))}))}))]}))}))}function Ma(e){return void 0===e&&(e={}),Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Ro,Co).validate("targetId",null==e?void 0:e.targetId,v.STRING,!1).validate("channelType",null==e?void 0:e.channelType,(function(e){return void 0!==E[e]}),!1).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Ro,JSON.stringify({targetId:e.targetId,channelType:e.channelType}),t),[4,n.getUltraGroupList(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Co,JSON.stringify({code:a,length:null==s?void 0:s.length}),t),[2,{code:r.SUCCESS,data:s}]):(i.warn(Co,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]}))}))}function ba(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I("","").ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a;return $(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(Oo,"",e),[4,t.getBlockUltraGroupList()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.info(Ao,JSON.stringify({code:o,length:null==a?void 0:a.length}),e),[2,{code:r.SUCCESS,data:a}]):(n.warn(Ao,JSON.stringify({code:o}),e),[2,{code:o,msg:Qr[o]}])}}))}))}))]}))}))}function La(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Uo,wo).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Uo,JSON.stringify({targetId:e.targetId,channelId:e.channelId}),t),[4,n.sendUltraGroupTypingStatus(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](wo,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function Ga(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Po,Mo).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messages",t,v.ARRAY,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h;return $(this,(function(T){switch(T.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),d={targetId:n,conversationType:a,messages:c},u=o.createTraceId(),o.info(Po,JSON.stringify(d),u),[4,i.getUltraGroupMessageListByMessageUId(d)];case 1:if(l=T.sent(),v=l.code,f=l.data,v===r.SUCCESS){for(h in g={},S=[],f)S.push(h),g[h]=f[h]?Fe(f[h]):void 0;return o.info(Mo,JSON.stringify({code:v,messageUIds:S}),u),[2,{code:r.SUCCESS,data:g}]}return o.warn(Mo,JSON.stringify({code:v}),u),[2,{code:v,msg:Qr[v]}]}}))}))}))]}))}))}function Ja(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(bo,Lo).validate("expansion",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g;return $(this,(function(S){switch(S.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l=o.createTraceId(),o.info(bo,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:u}),l),v={targetId:a,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:s,expansion:e},[4,i.expandUltraMessage(v)];case 1:return f=S.sent().code,g=f===r.SUCCESS?"info":"warn",o[g](Lo,JSON.stringify({code:f}),l),f===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:f,msg:Qr[f]}]}}))}))}))]}))}))}function Da(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Go,Jo).validate("expansion",e,v.ARRAY,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g;return $(this,(function(S){switch(S.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l=o.createTraceId(),o.info(Go,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:u}),l),v={targetId:a,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:s,keys:e},[4,i.expandUltraMessage(v)];case 1:return f=S.sent().code,g=f===r.SUCCESS?"info":"warn",o[g](Jo,JSON.stringify({code:f}),l),f===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:f,msg:Qr[f]}]}}))}))}))]}))}))}function Ba(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Do,Bo).validate("message",e,v.OBJECT,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,v,f;return $(this,(function(g){switch(g.label){case 0:return t=e.conversationType,o=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,d=e.channelId,u=i.createTraceId(),i.info(Do,JSON.stringify({conversationType:t,targetId:o,messageUId:a,channelId:d}),u),l={targetId:o,channelId:d,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return v=g.sent().code,f=v===r.SUCCESS?"info":"warn",i[f](Bo,JSON.stringify({code:v}),u),v===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:v,msg:Qr[v]}]}}))}))}))]}))}))}function xa(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ko,ko).validate("content",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S;return $(this,(function(h){switch(h.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,d=t.sentTime,u=t.canIncludeExpansion,l=t.channelId,v=o.createTraceId(),o.info(xo,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:l}),v),f={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:d,canIncludeExpansion:u,messageUId:s,content:e},[4,i.modifyMessage(f)];case 1:return g=h.sent().code,S=g===r.SUCCESS?"info":"warn",o[S](ko,JSON.stringify({code:g}),v),g===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:g,msg:Qr[g]}]}}))}))}))]}))}))}function ka(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Vo,Vo).validate("targetId",e,v.STRING,!0).validate("notificationLevels",t,v.ARRAY).validate("notificationLevels",t,(function(e){return!(null==t?void 0:t.some((function(e){return!p(e)})))})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Vo,JSON.stringify({targetId:e,notificationLevels:t}),n),[4,i.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Ho,JSON.stringify({code:s,data:c}),e),[2,{code:r.SUCCESS,data:c}]):(o.warn(Ho,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function Va(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Fo,Yo).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Fo,JSON.stringify({targetId:e.targetId,channelId:e.channelId}),t),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Yo,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(Yo,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]}))}))}function Ha(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return e.channelId=e.channelId||"",[2,new I(qo,Ko).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationLevel",t,(function(e){return void 0!==N[e]}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(qo,JSON.stringify({targetId:e.targetId,channelId:e.channelId,notificationLevel:t}),n),[4,i.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](Ko,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function Fa(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(zo,Wo).validate("targetId",e,v.STRING,!0).validate("notificationLevels",t,v.ARRAY).validate("notificationLevels",t,(function(e){return!(null==t?void 0:t.some((function(e){return!p(e)})))})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(zo,JSON.stringify({targetId:e,notificationLevels:t}),n),[4,i.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](Wo,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]}}))}))}))]}))}))}function Ya(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I(jo,Qo).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(jo,"getAllUltraGroupUnreadCount",e),[4,t.getAllUltraGroupUnreadCount()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Qo,JSON.stringify({code:o,data:a}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function qa(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I(Xo,Zo).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(Xo,"getAllUltraGroupUnreadCount",e),[4,t.getAllUltraGroupUnreadCount(true)];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Zo,JSON.stringify({code:o,data:a}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function Ka(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return e.channelId=e.channelId||"",[2,new I($o,er).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("sentTime",null==e?void 0:e.sentTime,v.NUMBER,!0).validate("count",null==e?void 0:e.count,(function(e){return y(e)&&e>0&&e<=50}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,v;return $(this,(function(f){switch(f.label){case 0:return t=e.targetId,o=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:o,sentTime:a,count:s},d=i.createTraceId(),i.info($o,JSON.stringify(c),d),[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),l=u.code,v=u.data,l===r.SUCCESS?(i.info(er,JSON.stringify({code:l,data:null==v?void 0:v.map((function(e){return e.messageUId}))}),d),[2,{code:l,data:v}]):(i.warn(er,JSON.stringify({code:l}),d),[2,{code:l,msg:Qr[l]}])}}))}))}))]}))}))}function za(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I($o,er).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=e.targetId,o=e.channelId,a={targetId:t,channelId:o},s=i.createTraceId(),i.info(tr,JSON.stringify(a),s),[4,n.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(nr,JSON.stringify({code:d,sentTime:null==u?void 0:u.sentTime}),s),[2,{code:d,data:u}]):(i.warn(nr,JSON.stringify({code:d}),s),[2,{code:d,msg:Qr[d]}])}}))}))}))]}))}))}function Wa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(ir,or).validate("targetIds",e,(function(t){return!!_("targetIds",e,v.ARRAY,!0)&&(!(t.length<=0||t.length>20)&&!e.some((function(e){return!R(e)})))})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.filter((function(t,n){return e.indexOf(t)===n})),o=i.createTraceId(),i.info(ir,JSON.stringify({targetIds:e}),o),[4,n.getUltraGroupUnreadInfoList(t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",i[d](or,JSON.stringify({code:s}),o),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Qr[s]}]}}))}))}))]}))}))}function ja(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_JOIN_CHATROOM_T,h.A_JOIN_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",t,v.OBJECT,!0).validate("count",null==t?void 0:t.count,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,i.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function Qa(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_JOIN_CHATROOM_T,h.A_JOIN_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",null==t?void 0:t.count,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,i.joinExistChatroom(e,t.count,n)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](h.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==r.SUCCESS?[2,{code:s,msg:Qr[s]}]:[2,{code:s,data:c}]}}))}))}))]}))}))}function Xa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(h.A_QUIT_CHATROOM_T,h.A_QUIT_CHATROOM_R).validate("targetId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(h.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](h.A_QUIT_CHATROOM_R,JSON.stringify({code:o}),t),o!==r.SUCCESS?[2,{code:o,msg:Qr[o]}]:[2,{code:o}]}}))}))}))]}))}))}function Za(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_QUIT_CHATROOM_T,h.A_QUIT_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",null==t?void 0:t.count,v.NUMBER).validate("order",null==t?void 0:t.order,(function(e){return[0,1,2].includes(e)})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(nt,JSON.stringify({chatroomId:e,count:null==t?void 0:t.count,order:null==t?void 0:t.order}),n),[4,i.getChatroomInfo(e,null==t?void 0:t.count,null==t?void 0:t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](it,JSON.stringify({code:s}),n),s===r.SUCCESS&&c?[2,{code:s,data:c}]:[2,{code:s,msg:Qr[s]}]}}))}))}))]}))}))}function $a(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ot,rt).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("value",null==t?void 0:t.value,v.STRING,!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ot,JSON.stringify({chatroomId:e,key:t.key,value:t.value,isSendNotification:t.isSendNotification,isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra}),n),[4,i.setChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](rt,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function es(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(at,st).validate("targetId",e,v.STRING,!0).validate("entries",null==t?void 0:t.entries,(function(e){return!!_("entry.key",e,v.ARRAY,!0)&&t.entries.every((function(e){return _("entry.key",e.key,v.STRING,!0)&&_("entry.value",e.value,v.STRING,!0)}))}),!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isForce",null==t?void 0:t.isForce,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t.entries.length>10?[2,jr.CHATROOM_KV_STORE_OUT_LIMIT]:(n=o.createTraceId(),o.info(at,JSON.stringify({chatroomId:e,entries:t.entries.map((function(e){return{key:e.key,value:e.value}})),isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra,isForce:t.isForce}),n),[4,i.setChatroomEntries(e,t)]);case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](st,JSON.stringify({code:s}),n),s!==r.SUCCESS?[2,{code:s,msg:Qr[s],data:c}]:[2,{code:s}]}}))}))}))]}))}))}function ts(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ct,dt).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("value",null==t?void 0:t.value,v.STRING,!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ct,JSON.stringify({chatroomId:e,key:t.key,value:t.value,isSendNotification:t.isSendNotification,isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra}),n),[4,i.forceSetChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](dt,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function ns(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ut,lt).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ut,JSON.stringify({chatroomId:e,key:t.key,isSendNotification:t.isSendNotification,notificationExtra:t.notificationExtra}),n),[4,i.removeChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](lt,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function is(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(vt,ft).validate("targetId",e,v.STRING,!0).validate("entries",null==t?void 0:t.entries,(function(e){return!!_("entry.key",e,v.ARRAY,!0)&&t.entries.every((function(e){return _("key",e,v.STRING,!0)}))}),!0).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=t.entries.map((function(e){return{key:e}})),a=o.createTraceId(),o.info(vt,JSON.stringify({chatroomId:e,notificationExtra:t.notificationExtra,entries:n}),a),[4,i.removeChatroomEntries(e,{entries:n,notificationExtra:t.notificationExtra})];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",o[u](ft,JSON.stringify({code:c}),a),c!==r.SUCCESS?[2,{code:c,msg:Qr[c],data:d}]:[2,{code:c}]}}))}))}))]}))}))}function os(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(gt,St).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(gt,JSON.stringify({chatroomId:e,key:t.key,isSendNotification:t.isSendNotification,notificationExtra:t.notificationExtra}),n),[4,i.forceRemoveChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](St,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function rs(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ht,Tt).validate("targetId",e,v.STRING,!0).validate("key",t,(function(e){return R(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(ht,JSON.stringify({chatroomId:e,key:t}),n),[4,i.getChatroomEntry(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(o.info(Tt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Tt,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function as(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(It,_t).validate("targetId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(It,JSON.stringify({chatroomId:e}),t),[4,n.getAllChatroomEntries(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(i.info(_t,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(_t,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]}))}))}function ss(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(mt,pt).validate("targetId",e,v.STRING,!0).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(mt,JSON.stringify({chatroomId:e,timestamp:t.timestamp,count:t.count,order:t.order}),n),[4,i.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),Fe(e)})),o.info(pt,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(o.warn(pt,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function cs(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Nt,Et).validate("targetId",null==e?void 0:e.chatRoomId,v.STRING,!0).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Nt,JSON.stringify({chatRoomId:e.chatRoomId,rtcRoomId:e.rtcRoomId}),t),[4,n.bindRTCRoomForChatroom(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](Et,JSON.stringify({code:o}),t),[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function ds(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(ze,We).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(ze,JSON.stringify({userId:e}),t),[4,n.addToBlacklist(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](We,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]}))}))}function us(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(je,Qe).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(je,JSON.stringify({userId:e}),t),[4,n.removeFromBlacklist(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](Qe,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]}))}))}function ls(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I(Xe,Ze).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a;return $(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(Xe,"getBlacklist -> ",e),[4,t.getBlacklist()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS&&a?(n.info(Ze,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):(n.warn(Ze,JSON.stringify({code:o}),e),[2,{code:o}])}}))}))}))]}))}))}function vs(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I($e,et).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info($e,JSON.stringify({userId:e}),t),[4,n.getBlacklistStatus(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(et,JSON.stringify({code:a,data:0===s}),t),[2,{code:a,data:0===s}]):(i.warn(et,JSON.stringify({code:a}),t),[2,{code:a}])}}))}))}))]}))}))}var fs=function(e,t,n,i){void 0===n&&(n=!0),void 0===i&&(i=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=i};function gs(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(i){return new fs(e,i,t,n)}}var Ss,hs=gs("RC:ImgMsg"),Ts=gs("RC:HQVCMsg"),Is=gs("RC:SightMsg"),_s=gs("RC:TxtMsg"),ms=gs("RC:CombineMsg"),ps=gs(A.COMBINE_V2),Ns=gs("RC:FileMsg"),Es=gs("RC:GIFMsg"),ys=gs("RC:VcMsg"),Rs=gs("RC:LBSMsg"),Cs=gs("RC:ReferenceMsg"),Os=gs("RC:ImgTextMsg"),As=gs("RC:CmdMsg"),Us=gs("RC:InfoNtf"),ws=gs("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(Ss||(Ss={}));var Ps,Ms=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._isAbort=!1,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.isAbort=function(){return this._isAbort},e.prototype.abort=function(){this._isAbort=!0,this._abortHandler()},e.prototype.upload=function(e){return e.file.size>U?Promise.resolve({code:r.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>w&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),bs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),this._promise=e({url:M(this._url),headers:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.QINIU}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return Z(this,void 0,void 0,(function(){return $(this,(function(e){throw new Error("Method not implemented.")}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms),Ls=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=M(a.ossBucketName+"."+this._url),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),this._promise=e({url:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.ALI}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Ms),Gs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,a=t.contentDisposition,v.label=1;case 1:return v.trys.push([1,3,,4]),[4,this._getFileToken(o<=b.FILE?o:b.FILE)];case 2:return s=v.sent(),[3,4];case 3:return[2,{code:v.sent()}];case 4:return c=a||("text/html"===n.type?"inline":"attachment"),d={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":c+"; filename="+encodeURIComponent(n.name)+";"},u=M(""+this._url+s.path),this._promise=e({url:u,headers:d,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:n,timeout:0}),[4,this._promise.result()];case 5:return l=v.sent().status,this._promise=null,200===l||204===l?[2,{code:r.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:u}}]:[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms),Js=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=M(this._url+"/"+a.minioBucketName+"/"+a.fileName),c=this.getBaseHeaders(n,a,t),this._promise=e({url:s,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return Z(this,void 0,void 0,(function(){var i,o,a,s,c,d,u,l,v,f,g,S,h,T,I,_;return $(this,(function(m){switch(m.label){case 0:i=t.file,o=t.fileType,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,this._getFileToken(o,i.name,"POST","uploads")];case 2:return a=m.sent(),[3,4];case 3:return[2,{code:m.sent()}];case 4:return s=M(this._url+"/"+a.minioBucketName+"/"+a.fileName),c=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploads",headers:c,method:"POST"}),[4,this._promise.result()];case 5:return d=m.sent(),u=d.status,l=d.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!v?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,i,v,a.fileName,t,f)]);case 6:if(g=m.sent(),S=g.code,h=g.msg,S!==r.SUCCESS)return[2,{code:S,msg:h}];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=m.sent(),[3,10];case 9:return[2,{code:m.sent()}];case 10:return T=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),T="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+T+"</CompleteMultipartUpload>",I=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploadId="+v,headers:I,method:"POST",body:T,timeout:0}),[4,this._promise.result()];case 11:return _=m.sent().status,this._promise=null,200===_||204===_?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,i,o,a,s,c,d){return void 0===c&&(c=1),void 0===d&&(d=0),Z(this,void 0,void 0,(function(){var u,l,v,f,g,S,h,T,I;return $(this,(function(_){switch(_.label){case 0:if(d>=5)return[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];u=(c-1)*w,l=Math.min(w,n.size-u),v="partNumber="+c+"&uploadId="+i,_.label=1;case 1:return _.trys.push([1,3,,4]),[4,this._getFileToken(a.fileType,o,"PUT",v)];case 2:return f=_.sent(),[3,4];case 3:return[2,{code:_.sent()}];case 4:return g=n.slice(u,c*w),S=this.getBaseHeaders(n,f,a),this._promise=e({url:t+"?"+v,headers:S,method:"PUT",body:g,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,u+e.loaded,n.size)}}),[4,this._promise.result()];case 5:return h=_.sent(),T=h.status,I=h.xhr,this._promise=null,200===T||204===T?(s.push((null==I?void 0:I.getResponseHeader("ETag"))||""),u+l<n.size?[2,this.requestUploadPart(t,n,i,o,a,s,c+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(t,n,i,o,a,s,c,d+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms),Ds=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e._promise=null,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l,v,f;return $(this,(function(g){switch(g.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,g.label=1;case 1:return g.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=g.sent(),[3,4];case 3:return[2,{code:g.sent()}];case 4:return s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),d=M(this._url),this._promise=e({url:d,headers:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return u=g.sent(),l=u.status,v=u.data,this._promise=null,200!==l&&204!==l||!v?[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]:(f=JSON.parse(v),[2,{code:r.SUCCESS,data:{uniqueName:f.rc_url.file_name,downloadUrl:d+"/"+f.rc_url.path}}])}}))}))},n.prototype.multipartUpload=function(e){return Z(this,void 0,void 0,(function(){var t,n,i,o,r;return $(this,(function(a){switch(a.label){case 0:t=e.file,n=e.onProgress,i=e.fileType,o=L(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this._getFileToken(i,t.name)];case 2:return r=a.sent(),[3,4];case 3:return[2,{code:a.sent()}];case 4:return[2,this._requestUploadPart(o,t,r.token,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,i,o,a){return void 0===a&&(a=0),Z(this,void 0,void 0,(function(){var s,c,d,u,l,v,f,g,S,h;return $(this,(function(T){switch(T.label){case 0:return s=Math.min(w,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),d={Range:"bytes="+a+"-"+(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},u=n.slice(a,a+s),(l=new FormData).set("file",u,n.name),l.set("key",c),l.set("name",c),l.set("token",i),v=M(this._url),this._promise=e({url:v,headers:d,onProgress:function(e){return null==o?void 0:o(a+e.loaded,n.size)},method:"POST",body:l,timeout:0}),[4,this._promise.result()];case 1:return f=T.sent(),g=f.status,S=f.data,this._promise=null,200===g||204===g?a+s<n.size?[2,this._requestUploadPart(t,n,i,o,a+s)]:(h=JSON.parse(S),[2,{code:r.SUCCESS,data:{uniqueName:h.rc_url.file_name,downloadUrl:v+"/"+h.rc_url.path}}]):[2,{code:r.UPLOAD_FAIL,msg:g.toString()}]}}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms),Bs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l,v;return $(this,(function(f){switch(f.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,a=t.contentDisposition,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return s=f.sent(),[3,4];case 3:return[2,{code:f.sent()}];case 4:return c={},d=M(s.s3BucketName+"."+this._url),u=new FormData,a?u.set("Content-Disposition",a):u.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),u.set("Content-Type",n.type),u.set("x-amz-credential",s.s3Credential),u.set("x-amz-algorithm",s.s3Algorithm),u.set("x-amz-date",s.s3Date),u.set("policy",s.s3Policy),u.set("x-amz-signature",s.s3Signature),u.set("key",s.fileName),u.set("file",n),this._promise=e({url:d,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:u,timeout:0}),[4,this._promise.result()];case 5:return l=f.sent(),v=l.status,this._promise=null,200===v||204===v?[2,{code:r.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:P.AWS}}]:[2,{code:r.UPLOAD_FAIL,msg:v.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms),xs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=M(this._url+"/"+a.stcBucketName+"/"+a.fileName),c=this.getBaseHeaders(n,a,t),this._promise=e({url:s,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.STC}}]:[2,{code:r.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return Z(this,void 0,void 0,(function(){var i,o,a,s,c,d,u,l,v,f,g,S,h,T,I,_;return $(this,(function(m){switch(m.label){case 0:i=t.file,o=t.fileType,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,this._getFileToken(o,i.name,"POST","uploads")];case 2:return a=m.sent(),[3,4];case 3:return[2,{code:m.sent()}];case 4:return s=M(this._url+"/"+a.stcBucketName+"/"+a.fileName),c=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploads",headers:c,method:"POST"}),[4,this._promise.result()];case 5:return d=m.sent(),u=d.status,l=d.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!v?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,i,v,a.fileName,t,f)]);case 6:if(g=m.sent(),S=g.code,h=g.msg,S!==r.SUCCESS)return[2,{code:S,msg:h}];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=m.sent(),[3,10];case 9:return[2,{code:m.sent()}];case 10:return T=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),T="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+T+"</CompleteMultipartUpload>",I=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploadId="+v,headers:I,method:"POST",body:T}),[4,this._promise.result()];case 11:return _=m.sent().status,this._promise=null,200===_||204===_?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.STC}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,i,o,a,s,c,d){return void 0===c&&(c=1),void 0===d&&(d=0),Z(this,void 0,void 0,(function(){var u,l,v,f,g,S,h,T,I;return $(this,(function(_){switch(_.label){case 0:if(d>=5)return[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];u=(c-1)*w,l=Math.min(w,n.size-u),v="partNumber="+c+"&uploadId="+i,_.label=1;case 1:return _.trys.push([1,3,,4]),[4,this._getFileToken(a.fileType,o,"PUT",v)];case 2:return f=_.sent(),[3,4];case 3:return[2,{code:_.sent()}];case 4:return g=n.slice(u,c*w),S=this.getBaseHeaders(n,f,a),this._promise=e({url:t+"?"+v,headers:S,method:"PUT",body:g,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,u+e.loaded,n.size)},timeout:0}),[4,this._promise.result()];case 5:return h=_.sent(),T=h.status,I=h.xhr,this._promise=null,200===T||204===T?(s.push((null==I?void 0:I.getResponseHeader("ETag"))||""),u+l<n.size?[2,this.requestUploadPart(t,n,i,o,a,s,c+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(t,n,i,o,a,s,c,d+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms);var ks=((Ps={})[Ss.QINIU]=bs,Ps[Ss.ALIYUN]=Ls,Ps[Ss.BAIDU]=Gs,Ps[Ss.S3]=Bs,Ps[Ss.STC]=xs,Ps[Ss.MINIO]=Js,Ps[Ss.RCX]=Ds,Ps);function Vs(e,t,n,i){var o=document.createElement("canvas"),a=o.getContext("2d"),s=new Image;s.onload=function(t){var c=i||{},d=c.maxHeight,u=void 0===d?160:d,l=c.maxWidth,v=void 0===l?160:l,f=c.quality,g=void 0===f?.7:f,S=c.scale,h=void 0===S?1:S,T=Fs(s.width,s.height,{maxHeight:u,maxWidth:v,scale:h});o.width=Math.min(T.w,v),o.height=Math.min(T.h,u),a.drawImage(s,T.x,T.y,T.w,T.h);var I=Hs(o,g);I=I.replace(/data:image\/[^;]+;base64,/,""),e({code:r.SUCCESS,data:X(X({},n),{thumbnail:I,width:T.w,height:T.h})})},s.onerror=function(t){e({code:r.UPLOAD_FAIL,msg:"get image info fail:"+JSON.stringify(t)})},s.src=(window.URL||window.webkitURL).createObjectURL(t)}function Hs(e,t){var n=e.toDataURL("image/jpeg",t);return n.length>G-10240?Hs(e,t-.1):n}var Fs=function(e,t,n){var i,o,r=n.maxHeight,a=void 0===r?160:r,s=n.maxWidth,c=void 0===s?160:s,d=n.scale,u=e<t,l=0,v=0;return(u?t/e:e/t)>(void 0===d?1:d)?(u?(i=100,v=((o=t/(e/100))-a)/2):(o=100,l=((i=e/(t/100))-c)/2),{w:i,h:o,x:-l,y:-v}):(u?(o=a,i=e/(t/a)):(i=c,o=t/(e/c)),{w:i,h:o,x:-l,y:-v})},Ys=0,qs=function(){function e(e,t){this._client=null,this.id=++Ys,this._promise=this._handleUpload(e,t)}return e.prototype.abort=function(){var e;this._resolve({code:r.UPLOAD_FAIL,msg:"upload abort"}),null===(e=this._client)||void 0===e||e.abort()},e.prototype._uploadInLoop=function(e,t,n,i,o){return void 0===o&&(o=[]),Z(this,void 0,void 0,(function(){var a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:a=0,v.label=1;case 1:return a<e.length?(s=e[a],this._client=new ks[s.type](s.url,n,i),[4,this._client.upload(t)]):[3,4];case 2:if(c=v.sent(),d=c.code,u=c.data,l=c.msg,d===r.SUCCESS)return[2,{code:d,data:u}];if(this._client.isAbort())return this._client=null,[2,{code:d,data:u,msg:l}];this._client=null,o.push({type:s.type,url:s.url,code:d,msg:l}),v.label=3;case 3:return a++,[3,1];case 4:return[2,{code:r.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: "+JSON.stringify(o)}]}}))}))},e.prototype._handleUpload=function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new Promise((function(i){return Z(n,void 0,void 0,(function(){var n,o,a,s,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N;return $(this,(function(E){switch(E.label){case 0:return this._resolve=i,n=t.getFileToken,o=t.serverType,a=t.customDomain,s=t.ossConfig,c=t.uploadServer,d=t.bosAddr,u=e.file,l=e.fileType,v=e.thumbnailConfig,f=function(e,t,n,i,o){if(n)return[{type:Ss.RCX,url:n,p:"1"}];if(e)return JSON.parse(e).map((function(e){var t={type:Ss.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}));var r=[];return i&&r.push({type:Ss.QINIU,url:i,p:"1"}),o&&r.push({type:Ss.BAIDU,url:o,p:"2"}),r}(s,0,a,c,d),0===f.length?(i({code:r.INVALID_PARAMETER_MEDIA_URL,msg:"uploadUrlList is empty"}),[2]):[4,this._uploadInLoop(f,e,n,o)];case 1:if(g=E.sent(),S=g.code,h=g.data,T=g.msg,S!==r.SUCCESS||!h)return i({code:S,msg:T}),[2];if(I=h.downloadUrl)return[3,5];E.label=2;case 2:return E.trys.push([2,4,,5]),[4,t.getFileUrl(l,h.uniqueName,u.name,void 0,h.uploadMethod)];case 3:return _=E.sent(),I=_.downloadUrl,[3,5];case 4:return m=E.sent(),i({code:m,msg:"Get download url fail"}),[3,5];case 5:return I?(p={downloadUrl:I,uniqueName:(null==h?void 0:h.uniqueName)||"",name:u.name,size:u.size,type:u.type},l!==b.AUDIO?[3,7]:[4,u.arrayBuffer()]):(i({code:r.UPLOAD_FAIL,msg:"Get download url fail"}),[2]);case 6:return N=E.sent(),function(e,t,n){(new AudioContext).decodeAudioData(t,(function(t){e({code:r.SUCCESS,data:X(X({},n),{duration:t.duration,length:t.length})})}),(function(t){e({code:r.UPLOAD_FAIL,msg:"get audio info fail:"+JSON.stringify(t)})}))}(i,N,p),[2];case 7:return l===b.IMAGE?(Vs(i,u,p,v),[2]):(i({code:S,data:p}),[2])}}))}))}))]}))}))},e.prototype.awaitResult=function(){return Z(this,void 0,void 0,(function(){return $(this,(function(e){return[2,this._promise]}))}))},e}(),Ks={};function zs(e,t){var n=new qs(e,t);return function(e){Z(this,void 0,void 0,(function(){return $(this,(function(t){switch(t.label){case 0:return Ks[e.id]=e,[4,e.awaitResult()];case 1:return t.sent(),delete Ks[e.id],[2]}}))}))}(n),n}function Ws(e){var t=Ks[e];return!!t&&(t.abort(),!0)}var js=function(e,t){var n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t.uploadDomain||"",serverType:null==n?void 0:n.type,ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer,bosAddr:null==n?void 0:n.bosAddr}};function Qs(e){return Z(this,void 0,void 0,(function(){var t,n,i;return $(this,(function(o){return t=e.contentDisposition,n=e.fileType,i=e.file,[2,new I("","").validate("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",n,(function(e){return!!b[e]}),!0).validate("file",i,(function(e){return e instanceof File&&(!(n===b.IMAGE&&!e.type.match(/^image\//))&&!(n===b.AUDIO&&!e.type.match(/^audio\//)))}),!0).ifReadySync((function(t,n,i){var o=zs(e,js(t,i));return{code:r.SUCCESS,data:o}}))]}))}))}function Xs(e){return Z(this,void 0,void 0,(function(){return $(this,(function(t){return[2,{code:r.SUCCESS,data:Ws(e)}]}))}))}function Zs(e){return Z(this,void 0,void 0,(function(){var t,n,i;return $(this,(function(o){return t=e.contentDisposition,n=e.fileType,i=e.file,[2,new I("","").validate("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",n,(function(e){return!!b[e]}),!0).validate("file",i,(function(e){return e instanceof File&&(!(n===b.IMAGE&&!e.type.match(/^image\//))&&!(n===b.AUDIO&&!e.type.match(/^audio\//)))}),!0).ifReady((function(t,n,i){return function(e,t){return Z(this,void 0,void 0,(function(){return $(this,(function(n){return[2,new qs(e,t).awaitResult()]}))}))}(e,js(t,i))}))]}))}))}function $s(e,t,n,i){return Gr((function(o){return new Promise((function(a){o.getFileToken(e,t,n,i).then((function(e){a({code:r.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:Qr[e]})}))}))}))}function ec(e){return new I("","").validate("mediaUrl",e,v.STRING,!0).ifReady((function(t){return new Promise((function(n){t.getFileToken(1,void 0,void 0,void 0,e).then((function(e){var t=e.token,i=e.downloadAuthInfo,o=e.deadline;n({code:r.SUCCESS,data:{token:t,downloadAuthInfo:i,deadline:o}})})).catch((function(e){n({code:e,msg:Qr[e]})}))}))}))}function tc(e,t,n,i,o){return new I("","").validate("fileType",e,J,!0).validate("filename",t,v.STRING).validate("saveName",n,v.STRING).validate("serverType",o,v.NUMBER).ifReady((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,i,o).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))}))}function nc(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("message",t,(function(){return t instanceof fs}),!0).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("isStatusMessage",null==n?void 0:n.isStatusMessage,v.BOOLEAN).validate("disableNotification",null==n?void 0:n.disableNotification,v.BOOLEAN).validate("pushContent",null==n?void 0:n.pushContent,v.STRING).validate("pushData",null==n?void 0:n.pushData,v.STRING).validate("isMentioned",null==n?void 0:n.isMentioned,v.BOOLEAN).validate("mentionedType",null==n?void 0:n.mentionedType,v.NUMBER).validate("mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,B({itemValidator:x})).validate("directionalUserIdList",null==n?void 0:n.directionalUserIdList,B({maxLength:300,itemValidator:x})).validate("isVoipPush",null==n?void 0:n.isVoipPush,v.BOOLEAN).validate("canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,v.BOOLEAN).validate("expansion",null==n?void 0:n.expansion,v.OBJECT).validate("pushConfig",null==n?void 0:n.pushConfig,v.OBJECT).validate("messageId",null==n?void 0:n.messageId,v.NUMBER).ifReady((function(o,c){return Z(i,void 0,void 0,(function(){var i,d,u,l,v,f,g,S,T,I,_,m,p,N,E,y,R,C,O,A,U;return $(this,(function(w){switch(w.label){case 0:return d=(i=n||{}).disableNotification,u=i.isMentioned,l=i.directionalUserIdList,v=i.canIncludeExpansion,f=i.onSendBefore,g=i.expansion,S=i.pushConfig,T=i.isStatusMessage,I=c.createTraceId(),_=e.conversationType,m=e.targetId,p=e.channelId,l&&l.length>0&&![3,10].includes(_)?[2,{code:r.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE}]:(N=function(e,t,n){var i=e.isStatusMessage,o=e.disableNotification,r=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,d=e.mentionedUserIdList,u=e.directionalUserIdList,l=e.isVoipPush,v=e.canIncludeExpansion,f=e.expansion,g=e.isFilerWhiteBlacklist,S=e.pushConfig,h=e.messageId,T=n.channelId;return X({isStatusMessage:i,disableNotification:o,pushContent:r,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:d,directionalUserIdList:u,isVoipPush:l,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:g,pushConfig:S,channelId:T||"",messageId:h},t)}(n||{},t,e),E={isMentioned:!!u,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!d,canIncludeExpansion:!!v,expansion:g||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:o.getCurrentUserId(),messageUId:"",messageDirection:k.SEND,receivedTime:0,isStatusMessage:!!T,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:S,sentStatus:V.SENDING,sentTime:0,directedUserIds:l||[]},_!==s.ULTRA_GROUP&&(E.isOffLineMessage=!1),y=function(e){E.messageId=e;try{f&&f(Fe(E))}catch(e){c.error(h.A_SEND_MSG_T,'Callback method "onSendBefore" execution error.\n'+(null==e?void 0:e.stack),I)}},c.info(h.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:_,targetId:m,channelId:p}),I),[4,o.sendMessage(_,m,N,y,I)]);case 1:return R=w.sent(),C=R.code,O=R.data,A=R.msg,C===r.SUCCESS?(c.info(h.A_SEND_MSG_R,JSON.stringify({code:C,messageUId:O.messageUId,messageId:O.messageId}),I),U=Fe(O),[2,{code:C,data:U}]):(c.warn(h.A_SEND_MSG_R,JSON.stringify({code:C}),I),E.sentTime=(null==O?void 0:O.sentTime)||0,E.sentStatus=null==O?void 0:O.sentStatus,[2,{code:C,msg:A||Qr[C],data:Fe(E)}])}}))}))}))]}))}))}function ic(e,t,n){return nc(e,new _s(t),n)}function oc(e,t){return function(n,i,o,a){var s;if(!_("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.INVALID_PARAMETER_SENDOPTIONS});var c={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var d=null===(s=a)||void 0===s?void 0:s.thumbnailConfig;if(!(_("sendOptions.maxHeight",null==d?void 0:d.maxHeight,v.NUMBER)&&_("sendOptions.maxWidth",null==d?void 0:d.maxWidth,v.NUMBER)&&_("sendOptions.quality",null==d?void 0:d.quality,v.NUMBER)&&_("sendOptions.scale",null==d?void 0:d.scale,v.NUMBER)))return Promise.resolve({code:r.INVALID_PARAMETER_SENDOPTIONS});c.thumbnailConfig=d}return Gr((function(s,d,u){return new Promise((function(s){var u=d.createTraceId();d.info(h.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:e}),u),Zs({file:i.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==o?void 0:o.onProgress)||void 0===n||n.call(o,Math.floor(e/t*100))},contentDisposition:c.contentDisposition,thumbnailConfig:c.thumbnailConfig}).then((function(e){var c,l=e.code,v=e.data,f=e.msg;if(l===r.SUCCESS&&v){var g=(null===(c=null==o?void 0:o.onComplete)||void 0===c?void 0:c.call(o,X({url:v.downloadUrl},v)))||t(v,i);return d.info(h.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:v.downloadUrl,code:r.SUCCESS}),u),void nc(n,g,a).then(s)}s({code:l,msg:f})}))}))}))}}var rc=oc(b.FILE,(function(e,t){var n,i,o={name:e.name,size:t.file.size,type:(n=e.name,i=n.match(/\.(\w+)$/),i?i[1]:"bin"),fileUrl:e.downloadUrl};return t.user&&(o.user=t.user),t.extra&&(o.extra=t.extra),t.mentionedInfo&&(o.mentionedInfo=t.mentionedInfo),new Ns(o)})),ac=oc(b.IMAGE,(function(e,t){var n={content:e.thumbnail,imageUri:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new hs(n)})),sc=oc(b.IMAGE,(function(e,t){var n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new Es(n)})),cc=oc(b.AUDIO,(function(e,t){var n={remoteUrl:e.downloadUrl,duration:e.duration,type:e.type};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new Ts(n)})),dc=oc(b.SIGHT,(function(e,t){var n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new Is(n)}));function uc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_GET_HISTORY_MSG_T,h.A_GET_HISTORY_MSG_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){if(D())return!0;var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(h.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,i.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),Fe(e)})),o.info(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:d}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(o.warn(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function lc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Si,hi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){return e>0&&e<=100})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(Si,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count,order:null==t?void 0:t.order}),n),[4,i.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),Fe(e)})),o.info(hi,JSON.stringify({code:s,messageUIds:d})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(o.warn(hi,JSON.stringify({code:s})),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function vc(e,t,n,i){return Z(this,void 0,void 0,(function(){var o=this;return $(this,(function(r){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).validate("timestamp",n,v.NUMBER,!0).validate("channelId",i,v.CHANNEL_ID).ifReady((function(r){return Z(o,void 0,void 0,(function(){var o,r,a,c,d;return $(this,(function(u){switch(u.label){case 0:return o={targetId:e,conversationType:s.PRIVATE,channelId:i},r=new fs("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,nc(o,r)];case 1:return a=u.sent(),c=a.code,d=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:d}]}}))}))}))]}))}))}function fc(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,r){return Z(i,void 0,void 0,(function(){var i,o,a,c,d;return $(this,(function(u){switch(u.label){case 0:return i="messageUId:"+t+",targetId:"+e,r.debug(h.A_SEND_MSG_T,"send read receipt message ->"+i),o=new fs("RC:RRReqMsg",{messageUId:t}),[4,nc({targetId:e,conversationType:s.GROUP,channelId:n},o)];case 1:return a=u.sent(),c=a.code,d=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:d}]}}))}))}))]}))}))}function gc(e,t,n){return Z(this,void 0,void 0,(function(){return $(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}oc(b.COMBINE_HTML,(function(e,t){var n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new ms(n)}));var Sc=function(e,t,n,i){return Z(void 0,void 0,void 0,(function(){var o,a;return $(this,(function(s){switch(s.label){case 0:return!_("messageList",i,v.OBJECT,!0)||Object.keys(i).some((function(e){return!_(e,i[e],v.ARRAY)}))?[2,Promise.resolve({code:r.MSG_LIMIT_ERROR})]:(o=[],Object.keys(i).forEach((function(e){i[e].forEach((function(e){-1===o.indexOf(e)&&o.push(e)}))})),o.length?[4,e.sendReadReceiptMessage(n.targetId,o,n.channelId)]:(t.warn(h.A_SEND_MSG_R,JSON.stringify({code:r.MSG_LIMIT_ERROR,msg:"Error in parameter messageList."})),[2,Promise.resolve({code:r.MSG_LIMIT_ERROR})]));case 1:return a=s.sent().code,[2,Promise.resolve({code:a})]}}))}))};function hc(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,c,d,u,l;return $(this,(function(f){switch(f.label){case 0:return i={targetId:e,conversationType:s.GROUP,channelId:n},d=o.getNaviInfoFromCache(),1!==(null==d?void 0:d.grpRRVer)?[3,2]:[4,Sc(o,a,i,t)];case 1:return c=f.sent(),[3,4];case 2:return!_("messageList",t,v.OBJECT,!1)||t&&Object.keys(t).some((function(e){return!_(e,t[e],v.ARRAY)}))?[2,{code:r.MSG_LIMIT_ERROR}]:(u=new fs("RC:RRRspMsg",{receiptMessageDic:t}),[4,nc(i,u)]);case 3:c=f.sent(),f.label=4;case 4:return(l=c.code)===r.SUCCESS?[2,{code:l}]:[2,{code:l,msg:Qr[l]}]}}))}))}))]}))}))}function Tc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_SYNC_READ_STATUS_T,h.A_SYNC_READ_STATUS_R).validate("timestamp",t,v.NUMBER,!0).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return[s.GROUP,s.PRIVATE,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE,s.SYSTEM].includes(e)}),!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", timestamp:"+t,a=o.createTraceId(),o.info(h.A_SYNC_READ_STATUS_T,n,a),1!==(null==(s=i.getNaviInfoFromCache())?void 0:s.sesDriven)?[3,2]:[4,i.updateConversationReadTime(e,t)];case 1:return c=v.sent(),[3,4];case 2:return d=new fs("RC:SRSMsg",{lastMessageSendTime:t}),[4,nc(e,d)];case 3:c=v.sent(),v.label=4;case 4:return u=c.code,l=c.msg,o[u===r.SUCCESS?"info":"warn"](h.A_SYNC_READ_STATUS_R,"code: "+u+", msg: "+l,a),[2,{code:u,msg:l}]}}))}))}))]}))}))}function Ic(e,t,n){return void 0===n&&(n=""),Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(h.A_SEND_MESSAGE_READ_RECEIPT_V4_T,h.A_SEND_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP||e===s.PRIVATE}),!0,"It should be ConversationType.GROUP or ConversationType.PRIVATE").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("startMsgUId",n,v.ONLY_STRING,!0).validate("endMsgUId",t,v.STRING,!0).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return i=a.createTraceId(),s="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", startMsgUId:"+n+", endMsgUId: "+t,a.info(h.A_SEND_MESSAGE_READ_RECEIPT_V4_T,s,i),3!==(null==(c=o.getNaviInfoFromCache())?void 0:c.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,o.sendReadReceiptMessageV4(e,n,t)];case 1:return d=v.sent(),u=d.code,l=d.msg,a[u===r.SUCCESS?"info":"warn"](h.A_SEND_MESSAGE_READ_RECEIPT_V4_R,"code: "+u+", msg: "+l,i),[2,{code:u,msg:l}]}}))}))}))]}))}))}function _c(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_GET_MESSAGE_READ_RECEIPT_V4_T,h.A_GET_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", messageUid:"+t,a=o.createTraceId(),o.info(h.A_GET_MESSAGE_READ_RECEIPT_V4_T,n,a),3!==(null==(s=i.getNaviInfoFromCache())?void 0:s.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,i.getMessageReadReceiptV4(e,t)];case 1:return c=v.sent(),d=c.code,u=c.msg,l=c.data,o[d===r.SUCCESS?"info":"warn"](h.A_GET_MESSAGE_READ_RECEIPT_V4_R,"code: "+d+", msg: "+u,a),d===r.SUCCESS&&l?[2,{code:d,data:l}]:[2,{code:d,msg:u}]}}))}))}))]}))}))}function mc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t,(function(e){return!!_("messageUIds",e,v.ARRAY,!0)&&!e.some((function(e){return!R(e)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", messageUid:"+t.toString(),a=o.createTraceId(),o.info(h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,n,a),3!==(null==(s=i.getNaviInfoFromCache())?void 0:s.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,i.batchGetMessageReadReceiptInfoV4(e,t)];case 1:return c=v.sent(),d=c.code,u=c.msg,l=c.data,o[d===r.SUCCESS?"info":"warn"](h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R,"code: "+d+", msg: "+u,a),d===r.SUCCESS?[2,{code:d,data:l}]:[2,{code:d,msg:u}]}}))}))}))]}))}))}function pc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Ti,Ii).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t.messageUId,v.STRING,!0).validate("sentTime",t.sentTime,v.NUMBER,!0).validate("disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN).validate("pushConfig",null==t?void 0:t.pushConfig,v.OBJECT).validate("directionalUserIdList",null==t?void 0:t.directionalUserIdList,B({maxLength:300,minLength:1,itemValidator:function(e){return R(e)}})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete,directionalUserIdList:t.directionalUserIdList},a=o.createTraceId(),o.info(Ti,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,messageUId:t.messageUId}),a),[4,i.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=u.sent(),c=s.code,d=s.data,c===r.SUCCESS&&d?(o.info(Ii,JSON.stringify({code:c,messageUId:d.messageUId}),a),[2,{code:c,data:Fe(d)}]):c===r.SUCCESS?[2,{code:c}]:(o.warn(Ii,JSON.stringify({code:c}),a),[2,{code:c,msg:Qr[c]}])}}))}))}))]}))}))}function Nc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(_i,mi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messages",t,(function(e){return f(e)&&e.length}),!0).validate("messages",t,(function(e){return!(!e||!f(e))&&!e.some((function(e){return!R(null==e?void 0:e.messageUId)||!y(null==e?void 0:e.sentTime)||!_("options.messageDirection",null==e?void 0:e.messageDirection,(function(e){return 1===e||2===e}),!0)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(_i,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,messages:t.map((function(e){return e.messageUId}))}),n),[4,i.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](mi,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:r.SUCCESS}]}}))}))}))]}))}))}function Ec(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(pi,Ni).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(pi,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:t}),n),[4,i.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Ni,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:r.SUCCESS}]}}))}))}))]}))}))}function yc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(li,vi).validate("clearMessageOption",e,(function(e){if(!_("clearMessageOption",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("options",i,v.OBJECT,!0)&&_("options.targetId",i.targetId,v.STRING,!0)&&_("options.conversationType",i.conversationType,(function(e){return[s.PRIVATE,s.GROUP,s.CHATROOM,s.SYSTEM].includes(e)}),!0)&&_("options.timestamp",i.timestamp,v.NUMBER,!0)&&_("options.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),a=o.createTraceId(),o.info(li,"options: "+JSON.stringify(n)+", isDeleteLocal: "+!!t,a),[4,i.batchClearRemoteHistoryMessages(n,!!t)];case 1:return s=c.sent(),o[r.SUCCESS===s?"info":"warn"](vi,"code: "+s,a),[2,{code:s}]}}))}))}))]}))}))}function Rc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Ei,yi).validate("expansion",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,v.NUMBER,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).validate("messageUId",null==t?void 0:t.messageUId,v.STRING,!0).validate("expansion",null==t?void 0:t.expansion,v.OBJECT).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f;return $(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,d=t.expansion,u=t.channelId,l=o.createTraceId(),o.info(Ei,JSON.stringify({targetId:a,channelId:u,conversationType:n,messageUId:s,canIncludeExpansion:c}),l),[4,i.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:d,channelId:u})];case 1:return v=g.sent().code,f=v===r.SUCCESS?"info":"warn",o[f](yi,JSON.stringify({code:v}),l),v!==r.SUCCESS?[2,{code:v,msg:Qr[v]}]:[2,{code:v}]}}))}))}))]}))}))}function Cc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Ri,Ci).validate("keys",e,v.ARRAY,!0).validate("message",t,v.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,v.NUMBER,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).validate("messageUId",null==t?void 0:t.messageUId,v.STRING,!0).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v;return $(this,(function(f){switch(f.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,d=t.channelId,u=o.createTraceId(),o.info(Ri,JSON.stringify({targetId:a,channelId:d,conversationType:n,messageUId:s,canIncludeExpansion:c}),u),[4,i.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:d})];case 1:return l=f.sent().code,v=l===r.SUCCESS?"info":"warn",o[v](Ci,JSON.stringify({code:l}),u),l!==r.SUCCESS?[2,{code:l,msg:Qr[l]}]:[2,{code:l}]}}))}))}))]}))}))}function Oc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageType",t,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=o.createTraceId(),o.info(h.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,i.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",o[u](h.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:d?d.messageUId:"",messageId:d?d.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:Fe(d)}]:[2,{code:c,msg:Qr[c]}]}}))}))}))]}))}))}function Ac(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(Oi,Ai).validate("messageUId",t,v.STRING,!0).validate("targetId",e,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d;return $(this,(function(u){switch(u.label){case 0:return i=a.createTraceId(),a.info(Oi,JSON.stringify({targetId:e,messageUId:t,channelId:n}),i),[4,o.getMessageReader(e,t,n)];case 1:return s=u.sent(),c=s.code,d=s.data,c===r.SUCCESS?(a.info(Ai,JSON.stringify({code:c,totalMemberCount:null==d?void 0:d.totalMemberCount}),i),[2,{code:c,data:d}]):(a.warn(Ai,JSON.stringify({code:c})),[2,{code:c,msg:Qr[c]}])}}))}))}))]}))}))}function Uc(e,t,n,i,o){return Lr((function(r,a){return l("messageType",e,v.STRING,!0),l("isPersited",t,v.BOOLEAN,!0),l("isCounted",n,v.BOOLEAN,!0),l("isStatusMessage",o,v.BOOLEAN,!1),l("searchProps",i,v.ARRAY),a.info(h.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:o,isPersited:t})),r.registerMessageType(e,t,n,i,o),gs(e,t,n)}))}function wc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(Ui,wi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ui,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getFirstUnreadMessage(t,o,a)];case 1:return c=v.sent(),d=c.code,u=c.data,d===r.SUCCESS?(l=u&&Fe(u)||null,i.info(wi,JSON.stringify({code:d,messageUId:null==u?void 0:u.messageUId}),s),[2,{code:d,data:l}]):(i.warn(wi,JSON.stringify({code:d}),s),[2,{code:d,msg:Qr[d]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Pc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Pi,Mi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Pi,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getFirstUnreadMessageInfo(t,o,a||"")];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Mi,JSON.stringify({code:d,messageUId:null==u?void 0:u.messageUId,sentTime:null==u?void 0:u.sentTime}),s),[2,{code:d,data:u}]):(i.warn(Mi,JSON.stringify({code:d}),s),[2,{code:d,msg:Qr[d]}])}}))}))}))]}))}))}function Mc(e,t,n){return void 0===n&&(n={}),Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return qe("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),D()?[2,new I(bi,Li).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("searchContent",null==n?void 0:n.searchContent,v.STRING).validate("senderUserId",null==t?void 0:t.senderUserId,v.STRING,!0).validate("messageType",null==t?void 0:t.messageType,v.STRING,!0).validate("content",null==t?void 0:t.content,v.OBJECT,!0).validate("messageDirection",null==t?void 0:t.messageDirection,v.NUMBER,!0).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN).validate("expansion",null==t?void 0:t.expansion,v.OBJECT).validate("disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN).validate("sentTime",null==t?void 0:t.sentTime,v.NUMBER).validate("sentStatus",null==t?void 0:t.sentStatus,v.NUMBER).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N;return $(this,(function(E){switch(E.label){case 0:return i=t.senderUserId,s=t.messageType,c=t.content,d=t.messageDirection,u=t.messageUId,l=t.canIncludeExpansion,v=t.expansion,f=t.disableNotification,g=t.sentTime,S=t.sentStatus,h=a.createTraceId(),a.info(bi,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),h),T=n.isUnread,I=n.searchContent,_={senderUserId:i,messageType:s,content:c,messageDirection:d,sentTime:g,sentStatus:S,searchContent:I,isUnread:!!T,messageUId:u,disableNotification:f,canIncludeExpansion:l,expansionMsg:JSON.stringify(v),channelId:e.channelId||""},[4,o.insertMessage(e.conversationType,e.targetId,_)];case 1:return m=E.sent(),p=m.code,N=m.data,p===r.SUCCESS?(a.info(Li,JSON.stringify({code:p,messageId:null==N?void 0:N.messageId}),h),[2,{code:p,data:Fe(N)}]):(a.warn(Li,JSON.stringify({code:p}),h),[2,{code:p,msg:Qr[p]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function bc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(Gi,Ji).validate("messageId",e,(function(e){return y(e)||R(e)}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Gi,JSON.stringify({messageId:e}),t),[4,n.getMessage(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Ji,JSON.stringify({code:a,messageUId:null==s?void 0:s.messageUId,messageId:null==s?void 0:s.messageId})),[2,{code:a,data:Fe(s)}]):(i.warn(Ji,JSON.stringify({code:a})),[2,{code:a,msg:Qr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Lc(e){return D()?new I(Di,Bi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReadySync((function(t,n){var i=e.conversationType,o=e.targetId,a=e.channelId,s=n.createTraceId();n.info(Di,JSON.stringify({conversationType:i,targetId:o,channelId:a}),s);var c=t.getUnreadMentionedMessages(i,o,a),d=[];return c&&c.length&&c.forEach((function(e){return d.push(Fe(e))})),n.info(Bi,JSON.stringify({code:r.SUCCESS,count:d.length}),s),{code:r.SUCCESS,data:d}})):{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}}function Gc(e,t,n,i){return Z(this,void 0,void 0,(function(){var o=this;return $(this,(function(a){return qe("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),D()?[2,new I("A-search_messages-T","A-search_messages-R").validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("keyword",t,v.STRING,!0).validate("timestamp",n,v.NUMBER).validate("count",i,v.NUMBER).ifReady((function(a,s){return Z(o,void 0,void 0,(function(){var o,c,d,u;return $(this,(function(l){switch(l.label){case 0:return[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,i,1,e.channelId)];case 1:return o=l.sent(),c=o.code,d=o.data,c===r.SUCCESS?(u=[],(null==d?void 0:d.messages)&&d.messages.length&&d.messages.forEach((function(e){return u.push(Fe(e))})),[2,{code:c,data:{messages:u,count:null==d?void 0:d.count}}]):(s.warn(h.O,"searchMessages ->code:"+c+",targetId:"+e.targetId),[2,{code:c,msg:Qr[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Jc(e,t,n){return Z(this,void 0,void 0,(function(){var i,o,a,s=this;return $(this,(function(c){return qe("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),D()?(i=e.conversationType,o=e.targetId,a=e.channelId,[2,new I(xi,ki).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).validate("cleanSpace",n,v.BOOLEAN).ifReady((function(e,c){return Z(s,void 0,void 0,(function(){var s,d,u;return $(this,(function(l){switch(l.label){case 0:return s=c.createTraceId(),c.info(xi,JSON.stringify({conversationType:i,targetId:o,channelId:a,timestamp:t,cleanSpace:n}),s),[4,e.deleteMessagesByTimestamp(i,o,t,n,a)];case 1:return d=l.sent(),c.debug(h.A_DELETE_MESSAGES_S,JSON.stringify({code:d,conversationType:i,targetId:o,channelId:a,timestamp:t})),u=d===r.SUCCESS?"info":"warn",c[u](ki,JSON.stringify({code:d}),s),d===r.SUCCESS?[2,{code:d}]:[2,{code:d,msg:Qr[d]}]}}))}))}))]):[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Dc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return qe("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),D()?[2,new I(Vi,Hi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Vi,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearMessages(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Hi,JSON.stringify({code:c}),s),c===r.SUCCESS?[2,{code:c}]:[2,{code:c,msg:Qr[c]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Bc(e,t,n,i){return Z(this,void 0,void 0,(function(){var o=this;return $(this,(function(a){return qe("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),D()?[2,new I(Fi,Yi).validate("keyword",e,v.STRING,!0).validate("conversationTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!1).validate("messageTypes",n,(function(e){return!!f(e)&&!(null==n?void 0:n.some((function(e){return!R(e)})))}),!1).validate("channelId",i,v.STRING).ifReady((function(a,s){return Z(o,void 0,void 0,(function(){var o,c,d,u;return $(this,(function(l){switch(l.label){case 0:return o=s.createTraceId(),s.info(Fi,JSON.stringify({keyword:e,conversationTypes:t,messageTypes:n,channelId:i}),o),[4,a.searchConversationByContent(e,n,i,t)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(s.info(Yi,JSON.stringify({code:d,count:null==u?void 0:u.length}),o),[2,{code:d,data:u}]):(s.warn(Yi,JSON.stringify({code:d}),o),[2,{code:d,msg:Qr[d]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function xc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(qi,Ki).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,c=o.createTraceId(),o.info(qi,JSON.stringify({conversationType:n,targetId:a,channelId:s,timestamp:t}),c),[4,i.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return d=l.sent(),u=d===r.SUCCESS?"info":"warn",o[u](Ki,JSON.stringify({code:d}),c),d===r.SUCCESS?[2,{code:d}]:[2,{code:d,msg:Qr[d]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function kc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return qe("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),D()?[2,new I(zi,Wi).validate("messageId",e,v.NUMBER,!0).validate("receivedStatus",t,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(zi,JSON.stringify({messageId:e,receivedStatus:t}),n),[4,i.setMessageReceivedStatus(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Wi,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Vc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(to,no).validate("tagId",null==e?void 0:e.tagId,v.STRING,!0).validate("tagId",null==e?void 0:e.tagId,(function(e){return!!e&&e.length<=10})).validate("tagName",null==e?void 0:e.tagName,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(to,JSON.stringify({tagId:e.tagId,tagName:e.tagName}),t),[4,n.createTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](no,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function Hc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(io,oo).validate("tagId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(io,JSON.stringify({tagId:e}),t),[4,n.removeTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](oo,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function Fc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(ro,ao).validate("tagId",null==e?void 0:e.tagId,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(ro,JSON.stringify({tagId:e.tagId,tagName:e.tagName}),t),[4,n.updateTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](ao,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function Yc(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I("","").ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(so,"",e),[4,t.getTagList()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](co,JSON.stringify({code:o}),e),[2,{code:r.SUCCESS,data:a}]}}))}))}))]}))}))}function qc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(uo,lo).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(uo,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),t),[4,n.getTagsForConversation(e)];case 1:return o=d.sent(),a=o.code,s=o.data,c=a===r.SUCCESS?"info":"warn",i[c](lo,JSON.stringify({code:a}),t),a===r.SUCCESS?[2,{code:a,data:s}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function Kc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(vo,fo).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(vo,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.addTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](fo,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function zc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(go,So).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(go,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.removeTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](So,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function Wc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ho,To).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("tagIds",t,(function(e){return!!_("tagIds",e,v.ARRAY,!0)&&!e.some((function(e){return!R(e)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ho,JSON.stringify({tagIds:t,targetId:e.targetId,conversationType:e.conversationType}),n),[4,i.removeTagsForConversation(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](To,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function jc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Io,_o).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(Io,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.removeTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](_o,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function Qc(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(mo,po).validate("tagId",e,v.STRING,!0).validate("count",t,v.NUMBER,!0).validate("startTime",n,v.NUMBER,!0).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(mo,JSON.stringify({tagId:e,count:t,startTime:n}),i),[4,o.getConversationListByTag(e,n,t)];case 1:return s=l.sent(),c=s.code,d=s.data,c===r.SUCCESS?(u=null==d?void 0:d.map((function(e){return function(e){return X(X({},Ye(e)),{isTopInTag:e.isTopInTag})}(e)})),a.info(po,JSON.stringify({code:c,length:null==u?void 0:u.length}),i),[2,{code:c,data:u}]):(a.warn(po,JSON.stringify({code:c}),i),[2,{code:c,msg:Qr[c]}])}}))}))}))]}))}))}function Xc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(No,Eo).validate("tagId",e,v.STRING,!0).validate("containMuted",t,v.BOOLEAN,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(No,JSON.stringify({tagId:e,containMuted:t}),n),[4,i.getUnreadCountByTag(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](No,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]}}))}))}))]}))}))}function Zc(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(No,Eo).validate("tagId",e,v.STRING,!0).validate("isTop",n,v.BOOLEAN,!0).validate("conversationType",null==t?void 0:t.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c;return $(this,(function(d){switch(d.label){case 0:return i=a.createTraceId(),a.info(No,JSON.stringify({tagId:e,targetId:t.targetId,conversationType:t.conversationType,isTop:n}),i),[4,o.setConversationStatusInTag(e,t,{isTop:n})];case 1:return s=d.sent().code,c=s===r.SUCCESS?"info":"warn",a[c](yo,JSON.stringify({code:s}),i),s===r.SUCCESS?[2,{code:s}]:[2,{code:s,msg:Qr[s]}]}}))}))}))]}))}))}var $c={COMET:"comet",WEBSOCKET:"websocket"},ed={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var td=Object.freeze({__proto__:null,getAllConversationList:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(ln,vn).validate("channelId",e,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(ln,JSON.stringify({channelId:e}),t),H(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return o=d.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:o=d.sent(),d.label=4;case 4:return a=o.code,s=o.data,i.info(vn,JSON.stringify({code:a,length:null==s?void 0:s.length}),t),a===r.SUCCESS&&s?(c=s.map((function(e){return Ye(e)})),[2,{code:a,data:c}]):(i.warn(vn,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n,i){return Z(this,void 0,void 0,(function(){var o=this;return $(this,(function(a){return D()?[2,new I(fn,gn).validate("startTime",e,v.NUMBER,!0).validate("count",t,v.NUMBER,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(a,s){return Z(o,void 0,void 0,(function(){var o,c,d,u,l,v;return $(this,(function(f){switch(f.label){case 0:return o=s.createTraceId(),s.info(fn,JSON.stringify({startTime:e,count:t,channelId:n}),o),H(n)?[4,a.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return c=f.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(d,e,t,n,!!i)];case 3:c=f.sent(),f.label=4;case 4:return u=c.code,l=c.data,u===r.SUCCESS&&l?(v=l.map((function(e){return Ye(e)})),s.info(gn,JSON.stringify({code:u,length:v.length}),o),[2,{code:u,data:v}]):(s.warn(gn,JSON.stringify({code:u}),o),[2,{code:u,msg:Qr[u]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return D()?[2,new I(Sn,hn).validate("keyword",e,v.STRING,!0).validate("messageTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!F(e)}))}),!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(Sn,JSON.stringify({keyword:e,messageTypes:t,channelId:n}),i),H(n)?[4,o.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,o.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,d=s.data,c===r.SUCCESS&&d?(u=d.map((function(e){return Ye(e)})),a.info(hn,JSON.stringify({code:c,length:u.length}),i),[2,{code:c,data:u}]):(a.warn(hn,JSON.stringify({code:c}),i),[2,{code:c,msg:Qr[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getConversations:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(Tn,In).validate("conversationList",e,B({maxLength:100,minLength:1,itemValidator:function(e){return Y(e,[s.PRIVATE,s.GROUP,s.SYSTEM])}}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(Tn,JSON.stringify({conversations:e}),t),[4,n.getConversations(e)];case 1:return o=d.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(c=s.map((function(e){return Ye(e)})),i.info(In,JSON.stringify({code:a,length:c.length}),t),[2,{code:a,data:c}]):(i.warn(In,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,i,o){return Z(this,void 0,void 0,(function(){var a=this;return $(this,(function(s){return D()?[2,new I(_n,mn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("keyword",t,v.STRING,!0).validate("startTime",n,v.NUMBER,!0).validate("count",i,v.NUMBER,!0).validate("messageTypes",o,B({itemValidator:F})).ifReady((function(s,c){return Z(a,void 0,void 0,(function(){var a,d,u,l,v,f,g,S,h,T,I;return $(this,(function(_){switch(_.label){case 0:return a=e.targetId,d=e.conversationType,u=e.channelId,l=c.createTraceId(),c.info(_n,JSON.stringify({targetId:a,conversationType:d,channelId:u,keyword:t,startTime:n,count:i}),l),o?[4,s.searchMessageByContentAndMessageType(d,a,t,n,i,o,u)]:[3,2];case 1:return v=_.sent(),[3,6];case 2:return H(u)?[4,s.searchMessageByContentWithAllChannel(d,a,t,n,i)]:[3,4];case 3:return v=_.sent(),[3,6];case 4:return[4,s.searchMessageByContent(d,a,t,n,i,0,u)];case 5:v=_.sent(),_.label=6;case 6:return f=v.code,g=v.data,f===r.SUCCESS&&g?(S=g.messages,h=g.count,T=[],I=S.map((function(e){return T.push(e.messageUId),Fe(e)})),c.info(mn,JSON.stringify({code:f,list:T}),l),[2,{code:f,data:{messages:I,count:h}}]):(c.warn(mn,JSON.stringify({code:f}),l),[2,{code:f,msg:Qr[f]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(pn,Nn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("startTime",null==t?void 0:t.startTime,v.NUMBER,!0).validate("endTime",null==t?void 0:t.endTime,v.NUMBER,!0).validate("offset",null==t?void 0:t.offset,v.NUMBER).validate("limit",null==t?void 0:t.limit,v.NUMBER).validate("keyword",null==t?void 0:t.keyword,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S;return $(this,(function(h){switch(h.label){case 0:return n=e.conversationType,a=e.targetId,s=t.keyword,c=t.startTime,d=t.endTime,u=t.offset,l=t.limit,u=u||0,l=l||5,v=o.createTraceId(),o.info(pn,JSON.stringify({targetId:a,conversationType:n,keyword:s,startTime:c,endTime:d,offset:u,limit:l}),v),[4,i.searchMessageByContentInTimeRangeWithAllChannel(n,a,s,c,d,u,l)];case 1:return f=h.sent(),g=f.code,S=f.data,g===r.SUCCESS&&S?[2,{code:g,data:{messages:S.messages.map((function(e){return Fe(e)}))}}]:(o.warn(Nn,JSON.stringify({code:g}),v),[2,{code:g}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,i){return Z(this,void 0,void 0,(function(){var o=this;return $(this,(function(a){return D()?[2,new I(En,yn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("userId",t,v.STRING,!0).validate("startTime",n,v.NUMBER,!0).validate("count",i,v.NUMBER,!0).ifReady((function(a,s){return Z(o,void 0,void 0,(function(){var o,c,d,u,l,v,f;return $(this,(function(g){switch(g.label){case 0:return o=e.conversationType,c=e.targetId,d=e.channelId,u=s.createTraceId(),s.info(En,JSON.stringify({targetId:c,conversationType:o,channelId:d,startTime:n,userId:t,count:i}),u),[4,a.searchMessagesByUser(o,c,t,n,i,d)];case 1:return l=g.sent(),v=l.code,f=l.data,v===r.SUCCESS&&f?[2,{code:v,data:{messages:f.messages.map((function(e){return Fe(e)}))}}]:(s.warn(yn,JSON.stringify({code:v})),[2,{code:v}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(Rn,Cn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t})).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("order",null==t?void 0:t.order,(function(e){return[0,1].includes(e)})).validate("messageTypes",null==t?void 0:t.messageTypes,(function(e){return!!f(e)&&!e.some((function(e){return!F(e)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N,E;return $(this,(function(y){switch(y.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,d=t.order,u=void 0===d?0:d,l=t.messageTypes,v=e.conversationType,f=e.targetId,g=e.channelId,S=void 0===g?"":g,h=o.createTraceId(),o.info(Rn,JSON.stringify({targetId:f,conversationType:v,channelId:S,count:a,timestamp:c,messageTypes:l}),h),[4,i.getHistoryMessagesByObjectNames(v,f,c,a,l,u,S)];case 1:return T=y.sent(),I=T.code,_=T.data,I===r.SUCCESS?(p=(m=_).list,N=m.hasMore,E=p.map((function(e){return Fe(e)})),[2,{code:I,data:{messages:E,hasMore:N,list:E}}]):(o.warn(Cn,JSON.stringify({code:I})),[2,{code:I,msg:Qr[I]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getContinuousMessages:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(On,An).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h,T,I,_;return $(this,(function(m){switch(m.label){case 0:return n=t.count,a=t.timestamp,s=t.order,c=e.conversationType,d=e.targetId,u=e.channelId,l=o.createTraceId(),o.info(On,JSON.stringify({targetId:d,conversationType:c,channelId:u,count:n,timestamp:a}),l),(i.getNaviInfoFromCache()||{}).historyMsg?[4,i.getContinuousMessages(c,d,a||0,n||20,s||0,u||"")]:[2,{code:r.MESSAGE_STORAGE_SERVICE_UNAVAILABLE}];case 1:return v=m.sent(),f=v.code,g=v.data,f===r.SUCCESS?(h=(S=g).list,T=S.timestamp,I=S.hasMore,_=h.map((function(e){return Fe(e)})),[2,{code:f,data:{list:_,timestamp:T,hasMore:I}}]):(o.warn(An,JSON.stringify({code:f})),[2,{code:f,msg:Qr[f]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(Un,wn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,r,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=e.conversationType,r=e.targetId,a=e.channelId,s=o.createTraceId(),o.info(Un,JSON.stringify({targetId:r,conversationType:n,channelId:a,timestamp:t}),s),[4,i.setMessageStatusToRead(n,r,t,a)];case 1:return c=d.sent(),o.info(wn,JSON.stringify(c),s),[2,c]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return console.warn("`setMessageSentStatus` has being deprecated, use `setMessageReceivedStatusInfo` instead."),D()?[2,new I(Pn,Mn).validate("messageId",e,v.NUMBER,!0).validate("receivedStatus",t,(function(e){return!H(a[e])}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,r;return $(this,(function(a){switch(a.label){case 0:return n=o.createTraceId(),o.info(Pn,JSON.stringify({messageId:e,receivedStatus:t}),n),[4,i.setMessageReceivedStatus(e,t)];case 1:return r=a.sent(),o.info(Mn,JSON.stringify({code:r}),n),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatusInfo:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(Gn,Jn).validate("messageId",e,v.NUMBER,!0).validate("receivedStatusInfo",t,v.OBJECT,!0).validate("receivedStatusInfo",null==t?void 0:t.isRead,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isListened,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isDownload,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isRetrieved,v.BOOLEAN).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,r,a;return $(this,(function(s){switch(s.label){case 0:return n=q(t),r=o.createTraceId(),o.info(Gn,JSON.stringify({messageId:e,sentStatus:n}),r),[4,i.setMessageReceivedStatus(e,n)];case 1:return a=s.sent(),o.info(Jn,JSON.stringify({code:a}),r),[2,{code:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(bn,bn).validate("messageId",e,v.NUMBER,!0).validate("sentStatus",t,(function(e){return!H(V[e])}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,r;return $(this,(function(a){switch(a.label){case 0:return n=o.createTraceId(),o.info(bn,JSON.stringify({messageId:e,sentStatus:t}),n),[4,i.setMessageSentStatus(e,t)];case 1:return r=a.sent(),o.info(Ln,JSON.stringify({code:r}),n),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return D()?[2,new I(Dn,Bn).validate("messageId",e,v.NUMBER,!0).validate("content",t,v.OBJECT,!0).validate("messageType",n,v.ONLY_STRING,!0).ifReady((function(o,r){return Z(i,void 0,void 0,(function(){var i,a;return $(this,(function(s){switch(s.label){case 0:return i=r.createTraceId(),r.info(Dn,JSON.stringify({messageId:e,messageType:n}),i),[4,o.setMessageContent(e,t,n)];case 1:return a=s.sent(),r.info(Bn,JSON.stringify({code:a}),i),[2,{code:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(xn,kn).validate("messageIds",e,(function(e){return!!f(e)&&!e.some((function(e){return!y(e)}))}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o;return $(this,(function(r){switch(r.label){case 0:return t=i.createTraceId(),i.info(xn,JSON.stringify({messageIds:e}),t),[4,n.deleteMessages(e)];case 1:return o=r.sent(),i.info(kn,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(Vn,Hn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,r,a,s;return $(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,a=i.createTraceId(),i.info(Vn,JSON.stringify({conversationType:t,targetId:o,channelId:r}),a),[4,n.clearMessages(t,o,r)];case 1:return s=c.sent(),i.info(Hn,JSON.stringify({code:s}),a),[2,{code:s}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return Z(this,void 0,void 0,(function(){var i,o,a,s=this;return $(this,(function(c){return D()?(i=e.conversationType,o=e.targetId,a=e.channelId,[2,new I(Fn,Yn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).validate("cleanSpace",n,v.BOOLEAN).ifReady((function(e,c){return Z(s,void 0,void 0,(function(){var s,d,u;return $(this,(function(l){switch(l.label){case 0:return s=c.createTraceId(),c.info(Fn,JSON.stringify({conversationType:i,targetId:o,channelId:a,timestamp:t,cleanSpace:n}),s),[4,e.deleteMessagesByTimestamp(i,o,t,n,a)];case 1:return d=l.sent(),u=d===r.SUCCESS?"info":"warn",c[u](Yn,JSON.stringify({code:d}),s),[2,{code:d}]}}))}))}))]):[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},batchClearMessagesByTimestamp:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(fi,gi).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,c;return $(this,(function(d){switch(d.label){case 0:return t=function(e,t){if(!_("options",e,v.ARRAY,!0)||!_("options",e,(function(n){return!(e.length>20||0===e.length)||(t.error(gi,"conversations length should not be greater than 20 and not be equal to 0"),!1)}),!0))return r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(!(_("options",o,v.OBJECT,!0)&&_("options.targetId",o.targetId,v.STRING,!0)&&_("options.conversationType",o.conversationType,(function(e){var n=[s.PRIVATE,s.GROUP,s.CHATROOM,s.SYSTEM].includes(e);return n||t.error(gi,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.CHATROOM,\n ConversationType.SYSTEM,\n "),n}),!0)&&_("options.timestamp",o.timestamp,v.NUMBER,!0)&&_("options.channelId",o.channelId,v.ONLY_STRING)))return r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}}(e,i),t?[2,{code:r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}]:(o=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),a=i.createTraceId(),i.info(fi,"options: "+JSON.stringify(o),a),[4,n.batchClearMessagesByTimestamp(o)]);case 1:return c=d.sent(),i[r.SUCCESS===c?"info":"warn"](gi,"code: "+c,a),[2,{code:c}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return D()?[2,new I(qn,Kn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("userId",t,(function(e){return e instanceof fs||_("message.senderUserId",null==e?void 0:e.senderUserId,v.STRING,!0)}),!0).validate("messageType",null==t?void 0:t.messageType,v.STRING,!0).validate("content",null==t?void 0:t.content,v.OBJECT,!0).validate("messageDirection",t,(function(e){return e instanceof fs||_("message.messageDirection",null==e?void 0:e.messageDirection,v.NUMBER,!0)}),!0).validate("canIncludeExpansion",t,(function(e){return e instanceof fs||_("message.canIncludeExpansion",null==e?void 0:e.canIncludeExpansion,v.BOOLEAN)})).validate("expansion",t,(function(e){return e instanceof fs||_("message.expansion",null==e?void 0:e.expansion,v.OBJECT)})).validate("disableNotification",t,(function(e){return e instanceof fs||_("message.expansion",null==e?void 0:e.disableNotification,v.BOOLEAN)})).validate("timestamp",t,(function(e){return e instanceof fs||_("message.sentTime",null==e?void 0:e.sentTime,v.NUMBER)})).validate("sentStatus",t,(function(e){return e instanceof fs||_("message.sentStatus",null==e?void 0:e.sentStatus,v.NUMBER)})).validate("receivedStatus",t,(function(e){return e instanceof fs||_("message.receivedStatus",null==e?void 0:e.receivedStatus,v.NUMBER)})).validate("receivedStatusInfo",t,(function(e){return e instanceof fs||_("message.receivedStatusInfo",null==e?void 0:e.receivedStatusInfo,v.OBJECT)})).validate("directedUserIds",t,(function(e){return e instanceof fs||!(null==e?void 0:e.directedUserIds)||!(!(null==e?void 0:e.directedUserIds)||!f(null==e?void 0:e.directedUserIds))&&(!e.directedUserIds.some((function(e){return!R(e)}))&&e.directedUserIds.length<300)})).validate("searchContent",null==n?void 0:n.searchContent,v.STRING).ifReady((function(o,s){return Z(i,void 0,void 0,(function(){var i,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N,E,y,R,C;return $(this,(function(O){switch(O.label){case 0:return i="",c=1,v=!1,g=a.UNREAD,T=t.messageType,I=t.content,t instanceof fs||(i=t.senderUserId,c=t.messageDirection,v=t.canIncludeExpansion,f=t.expansion,l=t.disableNotification,d=t.sentTime,u=t.sentStatus,g=t.receivedStatus,S=t.receivedStatusInfo,h=t.directedUserIds),_=s.createTraceId(),s.info(qn,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,messageType:T,sentTime:d}),_),m=n.isUnread,p=n.searchContent,N=g,S&&(N=q(S)),E={senderUserId:i,messageType:T,content:I,messageDirection:c,sentTime:d,sentStatus:u,searchContent:p,isUnread:!!m,messageUId:"",disableNotification:l,canIncludeExpansion:v,expansionMsg:JSON.stringify(f),channelId:e.channelId||"",readStatus:N,directedUserIds:h},[4,o.insertMessage(e.conversationType,e.targetId,E)];case 1:return y=O.sent(),R=y.code,C=y.data,R===r.SUCCESS?(s.info(Kn,JSON.stringify({code:R,messageId:null==C?void 0:C.messageId}),_),[2,{code:R,data:Fe(C)}]):(s.warn(Kn,JSON.stringify({code:R}),_),[2,{code:R,msg:Qr[R]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(Wn,Wn).validate("messages",e,(function(e){var t,n,i,o;if(!_("messages",e,v.ARRAY,!0))return!1;if(e.length<=0||e.length>=500)return!1;for(var r in e)if(!_("message",e[r],v.OBJECT,!0)||!_("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)||!_("message.targetId",e[r].targetId,v.STRING,!0)||!_("message.senderUserId",e[r].senderUserId,v.STRING,!0)||!_("message.messageType",e[r].messageType,v.STRING,!0)||!_("message.content",e[r].content,v.OBJECT,!0)||!_("message.messageDirection",e[r].messageDirection,v.NUMBER,!0)||!_("message.canIncludeExpansion",e[r].canIncludeExpansion,v.BOOLEAN)||!_("message.expansion",e[r].expansion,v.OBJECT)||!_("message.disableNotification",e[r].disableNotification,v.BOOLEAN)||!_("message.sentTime",e[r].sentTime,v.NUMBER)||!_("message.sentStatus",e[r].sentStatus,v.NUMBER)||!_("options.isUnread",null===(t=e[r])||void 0===t?void 0:t.isUnread,v.BOOLEAN)||!_("options.searchContent",null===(n=e[r])||void 0===n?void 0:n.searchContent,v.STRING)||!_("options.receivedStatus",null===(i=e[r])||void 0===i?void 0:i.receivedStatus,v.NUMBER)||!_("options.receivedStatusInfo",null===(o=e[r])||void 0===o?void 0:o.receivedStatusInfo,v.OBJECT)||e[r].directedUserIds&&e[r].directedUserIds.some((function(e){return!_("userId",e,v.STRING,!0)}))&&e[r].directedUserIds.length<300)return console.warn("then "+r+" index message validation failed"),!1;return!0}),!0).validate("checkDuplicate",t,v.BOOLEAN).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(zn,JSON.stringify({checkDuplicate:t,length:e.length}),n),[4,i.batchInsertMessage(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Wn,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Wn,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getMessageCount:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(jn,Qn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,r,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,a=i.createTraceId(),i.info(jn,JSON.stringify({conversationType:t,targetId:o,channelId:r}),a),[4,n.getMessageCount(t,o,r)];case 1:return s=u.sent(),c=s.code,d=s.data,i.info(Qn,JSON.stringify({code:c,data:d}),a),[2,{code:c,data:d}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(Xn,Zn).validate("messageUId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Xn,JSON.stringify({messageUId:e}),t),[4,n.getPrivateMessageDeliverTime(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Zn,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(Zn,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I($n,ei).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info($n,JSON.stringify({targetId:e,messageUId:t}),n),[4,i.getGroupMessageDeliverList(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](ei,JSON.stringify({code:s}),n),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Qr[s]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(ti,ni).validate("checkDuplicate",e,v.BOOLEAN).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,r,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(ti,JSON.stringify({checkDuplicate:e}),t),[4,n.setCheckDuplicateMessage(!!e)];case 1:return o=s.sent(),r=o.code,a=o.data,i.info(ni,JSON.stringify({code:r,data:a}),t),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setCheckChatRoomDuplicateMessage:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(ii,oi).validate("checkDuplicate",e,v.BOOLEAN).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,r,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(ii,JSON.stringify({checkDuplicate:e}),t),[4,n.setCheckChatRoomDuplicateMessage(!!e)];case 1:return o=s.sent(),r=o.code,a=o.data,i.info(oi,JSON.stringify({code:r,data:a}),t),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getMessagesAroundTimestamp:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(fr,gr).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,x,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,K({min:0}),!0).validate("beforeCount",null==t?void 0:t.beforeCount,K({min:0}),!0).validate("afterCount",null==t?void 0:t.afterCount,K({min:0}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return n=o.createTraceId(),o.info(fr,JSON.stringify({option:t,conversation:e}),n),a=t.timestamp,s=t.beforeCount,c=t.afterCount,[4,i.getMessagesByTimestamp(e,a,s,c)];case 1:return d=v.sent(),u=d.code,l=d.data,u===r.SUCCESS?(o.info(gr,JSON.stringify({code:u,data:l}),n),[2,{code:u,data:null==l?void 0:l.map((function(e){return Fe(e)}))}]):(o.warn(gr,JSON.stringify({code:u}),n),[2,{code:u,msg:Qr[u]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return D()?[2,Gr((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(ti,"clearLocalData ->",e),[4,t.clearData()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](ni,JSON.stringify({code:o}),e),[2,{code:o,data:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},enable:function(){return D()}});function nd(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(ji,Qi).validate("set.proxy",e,(function(t){return!!(!e||_("proxy.socksHost",e.socksHost,v.STRING,!0)&&_("proxy.socksPort",e.socksPort,v.NUMBER,!0))})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(ji,JSON.stringify({socksHost:null==e?void 0:e.socksHost,socksPort:null==e?void 0:e.socksPort}),t),[4,n.setProxy(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](Qi,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function id(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I(Xi,Zi).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a;return $(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(Xi,"",e),[4,t.getProxy()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.info(Zi,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):(n.warn(Zi,JSON.stringify({code:o}),e),[2,{code:o,msg:Qr[o]}])}}))}))}))]}))}))}function od(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I($i,eo).validate("test.proxy",e,v.OBJECT,!0).validate("test.proxy.socksHost",null==e?void 0:e.socksHost,v.STRING,!0).validate("test.proxy.socksPort",null==e?void 0:e.socksPort,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info($i,JSON.stringify({socksHost:null==e?void 0:e.socksHost,socksPort:null==e?void 0:e.socksPort}),n),[4,i.testProxy(e,t)];case 1:return a=d.sent(),s=a.status,c=a.data,s===r.SUCCESS?[2,{code:s,msg:c}]:(o.warn(eo,JSON.stringify({status:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function rd(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(rr,ar).validate("subscribeUserIds",e,B({maxLength:200,minLength:1,itemValidator:x}),!0).validate("subscribeType",t,(function(e){return[W.ONLINE_STATUS,W.USER_PROFILE].includes(e)}),!0).validate("expiry",n,K({min:60,max:2592e3}),!0).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(rr,JSON.stringify({userIds:e,subscribeType:t,expiry:n}),i),[4,o.subscribeUser(e,t,n)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",a[u](ar,JSON.stringify({code:c,data:d}),i),[2,{code:c,data:d}]}}))}))}))]}))}))}function ad(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(sr,cr).validate("subscribeUserIds",e,B({maxLength:200,minLength:1,itemValidator:x}),!0).validate("subscribeType",t,(function(e){return[W.ONLINE_STATUS,W.USER_PROFILE].includes(e)}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(sr,JSON.stringify({userIds:e,subscribeType:t}),n),[4,i.unSubscribeUser(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](cr,JSON.stringify({code:a}),n),[2,{code:a}]}}))}))}))]}))}))}function sd(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(lr,vr).validate("subscribeType",e,(function(e){return[W.ONLINE_STATUS,W.USER_PROFILE].includes(e)}),!0).validate("subscribePageSize",t,K({min:1,max:200}),!0).validate("offset",n,K({min:0}),!0).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(lr,JSON.stringify({pageSize:t,offset:n}),i),[4,o.getSubscribeUserList(e,t,n)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",a[u](vr,JSON.stringify({code:c,data:d}),i),c===r.SUCCESS?[2,{code:c,data:d}]:[2,{code:c}]}}))}))}))]}))}))}function cd(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(sr,cr).validate("subscribeType",e,(function(e){return[W.ONLINE_STATUS,W.USER_PROFILE].includes(e)}),!0).validate("subscribeUserIds",t,B({maxLength:200,minLength:1,itemValidator:x}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(dr,JSON.stringify({userIds:t}),n),[4,i.getSubscribeUserStatus(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](ur,JSON.stringify({code:s}),n),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s}]}}))}))}))]}))}))}function dd(e){var t=this;return new I(Sr,hr).validate("profile",e,v.OBJECT,!0).validate("profile",e.name,v.ONLY_STRING).validate("profile",e.portraitUri,v.ONLY_STRING).validate("profile",e.email,v.ONLY_STRING).validate("profile",e.birthday,v.ONLY_STRING).validate("profile",e.gender,v.NUMBER).validate("profile",e.location,v.ONLY_STRING).validate("profile",e.role,v.NUMBER).validate("profile",e.level,v.NUMBER).validate("profile",e.extraProfile,v.OBJECT).validate("profile",e.extraProfile,(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"string"!=typeof e[t])return!1;return!0})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=i.createTraceId(),i.info(Sr,JSON.stringify({profile:e}),t),o=e.extraProfile,a={},["name","portraitUri","email","birthday","gender","location","role","level"].forEach((function(t){H(e[t])||(a[t]=e[t])})),H(o)||(a.extraProfile=X({},o)),[4,n.updateMyUserProfile(a)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",i[u](hr,JSON.stringify({code:c,data:d}),t),[2,{code:c,data:d}]}}))}))}))}function ud(e){var t=this;return new I(Tr,Ir).validate("userId",e,B({minLength:1,itemValidator:F}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(Tr,JSON.stringify({userIds:e}),t),[4,n.getUserProfiles(e)];case 1:return o=d.sent(),a=o.code,s=o.data,c=a===r.SUCCESS?"info":"warn",i[c](Ir,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]}}))}))}))}function ld(){var e=this;return new I(_r,mr).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(_r,"",e),[4,t.getMyUserProfile()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](mr,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]}}))}))}))}function vd(e){var t=this;return new I(pr,Nr).validate("userProfileVisibility",e,(function(e){return[z.NOT_SET,z.INVISIBLE,z.EVERYONE].includes(e)}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(pr,e,t),[4,n.updateMyUserProfileVisibility(e)];case 1:return o=d.sent(),a=o.code,s=o.data,c=a===r.SUCCESS?"info":"warn",i[c](Nr,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]}}))}))}))}function fd(){var e=this;return new I(Er,yr).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(Er,"",e),[4,t.getMyUserProfileVisibility()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](yr,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]}}))}))}))}function gd(e){var t=this;return new I(Rr,Cr).validate("uniqueId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(Rr,e,t),[4,n.searchUserProfileByUniqueId(e)];case 1:return o=d.sent(),a=o.code,s=o.data,c=a===r.SUCCESS?"info":"warn",i[c](Cr,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]}}))}))}))}export{fs as BaseMessage,ms as CombineMessage,ps as CombineV2Message,As as CommandMessage,$c as ConnectType,xe as Events,Ns as FileMessage,Es as GIFMessage,ws as GroupNotificationMessage,Ts as HQVoiceMessage,hs as ImageMessage,Us as InformationNotificationMessage,Rs as LocationMessage,Ke as MessageAuditType,ed as MessageType,Cs as ReferenceMessage,Os as RichContentMessage,Is as SightMessage,_s as TextMessage,qs as UploadTask,ys as VoiceMessage,Kr as __addSDKVersion,Kc as addConversationsToTag,Jr as addEventListener,Vc as addTag,ds as addToBlacklist,yc as batchClearRemoteHistoryMessages,mc as batchGetMessageReadReceiptInfoV4,aa as batchRemoveConversation,Ia as batchSetConversationNotificationLevel,Ca as batchSetConversationToTop,cs as bindRTCRoomForChatroom,Sa as clearAllMessagesUnreadStatus,kr as clearEventListeners,Ec as clearHistoryMessages,Dc as clearMessages,ga as clearMessagesUnreadStatus,da as clearTextMessageDraft,xc as clearUnreadCountByTimestamp,ta as connect,Qs as createUploadTask,Jc as deleteLocalMessagesByTimestamp,Nc as deleteMessages,Hr as destroy,na as disconnect,td as electronExtension,os as forceRemoveChatRoomEntry,ts as forceSetChatRoomEntry,as as getAllChatRoomEntries,Pa as getAllConversationState,Ya as getAllUltraGroupUnreadCount,qa as getAllUltraGroupUnreadMentionedCount,wa as getAllUnreadMentionedCount,ls as getBlacklist,vs as getBlacklistStatus,ba as getBlockUltraGroupList,Na as getBlockedConversationList,rs as getChatRoomEntry,Za as getChatRoomInfo,ss as getChatroomHistoryMessages,Fr as getConnectionStatus,oa as getConversation,ia as getConversationList,ma as getConversationNotificationLevel,pa as getConversationNotificationStatus,ya as getConversationTypeNotificationLevel,Qc as getConversationsFromTagByPage,qr as getCurrentUserId,zr as getDeviceId,ec as getDownloadAuth,$s as getFileToken,tc as getFileUrl,wc as getFirstUnreadMessage,Pc as getFirstUnreadMessageInfo,uc as getHistoryMessages,bc as getMessage,_c as getMessageReadReceiptV4,Ac as getMessageReader,ld as getMyUserProfile,fd as getMyUserProfileVisibility,id as getProxy,lc as getRemoteHistoryMessages,Yr as getServerTime,sd as getSubscribeUserList,cd as getSubscribeUserStatus,Yc as getTags,qc as getTagsFromConversation,sa as getTextMessageDraft,Oa as getTopConversationList,ua as getTotalUnreadCount,la as getTotalUnreadCountByLevels,va as getTotalUnreadMentionedCountByLevels,Va as getUltraGroupDefaultNotificationLevel,za as getUltraGroupFirstUnreadMessageTimestamp,Ma as getUltraGroupList,Ga as getUltraGroupMessageListByMessageUId,Fa as getUltraGroupUnreadCountByTargetId,Wa as getUltraGroupUnreadInfoList,ka as getUltraGroupUnreadMentionedCountByTargetId,Ka as getUltraGroupUnreadMentionedMessages,Aa as getUnreadConversationList,fa as getUnreadCount,Xc as getUnreadCountByTag,Ua as getUnreadMentionedCount,Lc as getUnreadMentionedMessages,ud as getUserProfiles,Vr as init,Mc as insertMessage,Wr as installPlugin,ja as joinChatRoom,Qa as joinExistChatRoom,xa as modifyMessage,Dr as onceEventListener,Xa as quitChatRoom,pc as recallMessage,Uc as registerMessageType,Ba as removeAllExpansionForUltraGroupMessage,is as removeChatRoomEntries,ns as removeChatRoomEntry,ra as removeConversation,zc as removeConversationsFromTag,Br as removeEventListener,xr as removeEventListeners,Da as removeExpansionForUltraGroupMessage,us as removeFromBlacklist,Cc as removeMessageExpansionForKey,Hc as removeTag,jc as removeTagFromConversations,Wc as removeTagsFromConversation,ca as saveTextMessageDraft,Bc as searchConversationByContent,Gc as searchMessages,gd as searchUserProfileByUniqueId,rc as sendFileMessage,sc as sendGIFMessage,cc as sendHQVoiceMessage,ac as sendImageMessage,nc as sendMessage,vc as sendReadReceiptMessage,Ic as sendReadReceiptMessageV4,fc as sendReadReceiptRequest,gc as sendReadReceiptResponse,hc as sendReadReceiptResponseV2,dc as sendSightMessage,Tc as sendSyncReadStatusMessage,ic as sendTextMessage,Oc as sendTypingStatusMessage,La as sendUltraGroupTypingStatus,es as setChatRoomEntries,$a as setChatRoomEntry,Ta as setConversationNotificationLevel,_a as setConversationNotificationStatus,Ra as setConversationToTop,Zc as setConversationToTopInTag,Ea as setConversationTypeNotificationLevel,kc as setMessageReceivedStatus,nd as setProxy,Ha as setUltraGroupDefaultNotificationLevel,Xs as stopUploadTask,rd as subscribeUserStatus,od as testProxy,ad as unSubscribeUserStatus,Ja as updateExpansionForUltraGroupMessage,Rc as updateMessageExpansion,dd as updateMyUserProfile,vd as updateMyUserProfileVisibility,Fc as updateTag,Zs as upload};
15
+ ***************************************************************************** */var j=function(e,t){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},j(e,t)};function Q(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var X=function(){return X=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},X.apply(this,arguments)};function Z(e,t,n,i){return new(n||(n=Promise))((function(o,r){function a(e){try{c(i.next(e))}catch(e){r(e)}}function s(e){try{c(i.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((i=i.apply(e,t||[])).next())}))}function $(e,t){var n,i,o,r,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function s(r){return function(s){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return a.label++,{value:r[1],done:!1};case 5:a.label++,i=r[1],r=[0];continue;case 7:r=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){a=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){a.label=r[1];break}if(6===r[0]&&a.label<o[1]){a.label=o[1],o=r;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(r);break}o[2]&&a.ops.pop(),a.trys.pop();continue}r=t.call(e,a)}catch(e){r=[6,e],i=0}finally{n=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,s])}}}var ee=function(){return!("undefined"==typeof uni||!function(e){for(var t=["request","getSystemInfo"],n=0,i=t.length;n<i;n++)if(!e[t[n]])return!1;return!0}(uni))},te=ee();var ne=null,ie=function(e){return Z(void 0,void 0,void 0,(function(){var t;return $(this,(function(n){switch(n.label){case 0:return[4,oe.getNetworkType()];case 1:return t=n.sent(),ne({status:"online"===e.type,type:t}),[2]}}))}))};var oe={tag:"browser",httpReq:function(t){return e(t).result()},localStorage:null===window||void 0===window?void 0:window.localStorage,sessionStorage:null===window||void 0===window?void 0:window.sessionStorage,useNavi:!0,connectPlatform:"",isFromUniapp:te,createWebSocket:function(e,t){var n=new WebSocket(e,t);return n.binaryType="arraybuffer",{id:Date.now(),onClose:function(e){n.onclose=function(t){var n=t.code,i=t.reason;e(n,i)}},onError:function(e){n.onerror=e},onMessage:function(e){n.onmessage=function(t){e(t.data)}},onOpen:function(e){n.onopen=e},send:function(e){n.send(e)},close:function(e,t){n.close()}}},getNetworkType:function(){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection||{effectiveType:t.UNKONWN},n=e.type,i=e.effectiveType,o=n||i||t.UNKONWN;return Promise.resolve(o)},setNetworkStatusListener:function(e){ne=e,"undefined"!=typeof window&&window&&(window.addEventListener("offline",ie),window.addEventListener("online",ie))},removeNetworkStatusListener:function(){"undefined"!=typeof window&&window&&(window.removeEventListener("offline",ie),window.removeEventListener("online",ie)),ne=null}},re=ee(),ae=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return wx[e].apply(wx,t)}catch(e){null===console||void 0===console||console.error(e)}}},se={setItem:ae("setStorageSync"),getItem:ae("getStorageSync"),removeItem:ae("removeStorageSync"),clear:ae("clearStorageSync")},ce=null,de=function(e){var t=e.isConnected,n=e.networkType;ce({status:t,type:n})};var ue={tag:"wechat",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){wx.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:se,sessionStorage:se,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:re,createWebSocket:function(e,t){var n=wx.connectSocket({url:e,protocols:t});return{id:Date.now(),onClose:function(e){n.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){e(t.data)}))},onOpen:function(e){n.onOpen(e)},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){wx.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ce=e,wx.onNetworkStatusChange(de)},removeNetworkStatusListener:function(){wx.offNetworkStatusChange(de),ce=null}},le=ee(),ve=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{if("setStorageSync"===e)return my[e]({key:t[0],data:JSON.parse(t[1])});if("clearStorageSync"===e)return my[e]();if("removeStorageSync"===e)return my[e]({key:t[0]});var i=my[e]({key:t[0]}).data;return i?JSON.stringify(i):i}catch(e){}}},fe={setItem:ve("setStorageSync"),getItem:ve("getStorageSync"),removeItem:ve("removeStorageSync"),clear:ve("clearStorageSync")},ge=null,Se=function(e){var t=e.isConnected,n=e.networkType;ge({status:t,type:n})};var he={tag:"alipay",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c),l=e.dataType||"json";return new Promise((function(e){my.request({url:u,method:t,headers:s,timeout:a,data:d,dataType:l,success:function(t){e({data:t.data,status:t.status})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:fe,sessionStorage:fe,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:le,createWebSocket:function(e){var t=my.connectSocket({url:e,multiple:!0});return{id:Date.now(),onClose:function(e){t.onClose(e)},onError:function(e){t.onError((function(t){e(t.errMsg)}))},onMessage:function(e){t.onMessage((function(t){t.data.isBuffer?e(my.base64ToArrayBuffer(t.data.data)):e(t.data.data)}))},onOpen:function(e){t.onOpen(e)},send:function(e){t.send({data:my.arrayBufferToBase64(e),isBuffer:!0})},close:function(){t.close()}}},getNetworkType:function(){return new Promise((function(e){my.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){ge=e,my.onNetworkStatusChange(Se)},removeNetworkStatusListener:function(){my.offNetworkStatusChange(Se),ge=null}},Te=ee(),Ie=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return tt[e].apply(tt,t)}catch(e){}}},_e={setItem:Ie("setStorageSync"),getItem:Ie("getStorageSync"),removeItem:Ie("removeStorageSync"),clear:Ie("clearStorageSync")},me=null,pe=function(e){var t=e.isConnected,n=e.networkType;me({status:t,type:n})};var Ne={tag:"toutiao",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Te,localStorage:_e,sessionStorage:_e,httpReq:function(e){return new Promise((function(t){tt.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},i={data:JSON.stringify(n),status:e.statusCode};t(i)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=tt.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){tt.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){me=e,tt.onNetworkStatusChange(pe)},removeNetworkStatusListener:function(){tt.offNetworkStatusChange(pe),me=null}},Ee=ee(),ye=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return swan[e].apply(swan,t)}catch(e){}}},Re={setItem:ye("setStorageSync"),getItem:ye("getStorageSync"),removeItem:ye("removeStorageSync"),clear:ye("clearStorageSync")},Ce=null,Oe=function(e){var t=e.isConnected,n=e.networkType;Ce({status:t,type:n})};var Ae={tag:"baidu",useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ee,localStorage:Re,sessionStorage:Re,httpReq:function(e){return new Promise((function(t){swan.request({url:e.url,data:e.body,header:e.headers,method:e.method,success:function(e){var n=(null==e?void 0:e.data)||{},i={data:JSON.stringify(n),status:e.statusCode};t(i)},fail:function(e){t({status:r.RC_HTTP_REQ_FAIL})}})}))},createWebSocket:function(e,t){var n=swan.connectSocket({url:e,protocols:t});return{id:Date.now(),onOpen:function(e){n.onOpen(e)},onClose:function(e){n.onClose((function(t){return e(t.code,t.reason)}))},onError:function(e){n.onError((function(t){return e(t.errMsg)}))},onMessage:function(e){n.onMessage((function(t){return e(t.data)}))},send:function(e){n.send({data:e})},close:function(e,t){n.close({code:e,reason:t})}}},getNetworkType:function(){return Z(this,void 0,void 0,(function(){return $(this,(function(e){return[2,new Promise((function(e){swan.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))]}))}))},setNetworkStatusListener:function(e){Ce=e,swan.onNetworkStatusChange(Oe)},removeNetworkStatusListener:function(){swan.offNetworkStatusChange(Oe),Ce=null}},Ue=ee(),we=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return jd[e].apply(jd,t)}catch(e){null===console||void 0===console||console.error(e)}}},Pe={setItem:we("setStorageSync"),getItem:we("getStorageSync"),removeItem:we("removeStorageSync"),clear:we("clearStorageSync")},Me=null,be=function(e){var t=e.isConnected,n=e.networkType;Me({status:t,type:n})};var Le={tag:"jingdong",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){jd.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Pe,sessionStorage:Pe,useNavi:!1,connectPlatform:"MiniProgram",isFromUniapp:Ue,createWebSocket:function(e,t){return jd.connectSocket({url:e,protocols:t}),{id:Date.now(),onClose:function(e){jd.onSocketClose((function(t){e(t.code,t.reason)}))},onError:function(e){jd.onSocketError((function(t){e(t.errMsg)}))},onMessage:function(e){jd.onSocketMessage((function(t){e(t.data)}))},onOpen:function(e){jd.onSocketOpen(e)},send:function(e){jd.sendSocketMessage({data:e})},close:function(e,t){jd.closeSocket({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){jd.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){Me=e,jd.onNetworkStatusChange(be)},removeNetworkStatusListener:function(){jd.offNetworkStatusChange(be),Me=null}},Ge=function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return uni[e].apply(uni,t)}catch(e){null===console||void 0===console||console.error(e)}}},Je={setItem:Ge("setStorageSync"),getItem:Ge("getStorageSync"),removeItem:Ge("removeStorageSync"),clear:Ge("clearStorageSync")},De=null,Be=function(e){var t=e.isConnected,n=e.networkType;De({status:t,type:n})};var xe,ke={tag:"uniapp",httpReq:function(e){var t=e.method||n.GET,a=e.timeout||i,s=e.headers,c=e.query,d=e.body,u=o(e.url,c);return new Promise((function(e){uni.request({url:u,method:t,header:s,timeout:a,data:d,success:function(t){e({data:t.data,status:t.statusCode})},fail:function(){e({status:r.RC_HTTP_REQ_FAIL})}})}))},localStorage:Je,sessionStorage:Je,useNavi:!0,connectPlatform:"",isFromUniapp:!0,createWebSocket:function(e,t){var n={complete:function(){},url:e,protocols:t},i=uni.connectSocket(n);return{id:Date.now(),onClose:function(e){i.onClose((function(t){e(t.code,t.reason)}))},onError:function(e){i.onError((function(t){e(t.errMsg)}))},onMessage:function(e){i.onMessage((function(t){e(t.data)}))},onOpen:function(e){i.onOpen(e)},send:function(e){i.send({data:e})},close:function(e,t){i.close({code:e,reason:t})}}},getNetworkType:function(){return new Promise((function(e){uni.getNetworkType({success:function(t){var n=t.networkType;e(n)},fail:function(){e(t.UNKONWN)}})}))},setNetworkStatusListener:function(e){De=e,uni.onNetworkStatusChange(Be)},removeNetworkStatusListener:function(){uni.offNetworkStatusChange(Be),De=null}},Ve=function(e){return e&&e.request&&e.getSystemInfo},He="undefined"!=typeof uni&&Ve(uni)?function(){switch(process.env.VUE_APP_PLATFORM){case"app-plus":return ke;case"mp-jd":return Le;case"mp-baidu":return Ae;case"mp-toutiao":return Ne;case"mp-alipay":return he;case"mp-weixin":return ue;default:return oe}}():"undefined"!=typeof jd&&Ve(jd)?Le:"undefined"!=typeof my&&Ve(my)?he:"undefined"!=typeof tt&&Ve(tt)?Ne:"undefined"!=typeof swan&&Ve(swan)?Ae:"undefined"!=typeof wx&&Ve(wx)?ue:oe;function Fe(e){var t=e.conversationType,n=e.channelId,i=e.messageType,o=e.content,r=e.senderUserId,s=e.targetId,c=e.sentTime,d=e.receivedTime,u=e.messageUId,l=e.messageDirection,v=e.isPersited,f=e.isCounted,g=e.isOffLineMessage,S=e.canIncludeExpansion,h=e.expansion,T=e.receivedStatus,I=e.receivedStatusInfo,_=e.disableNotification,m=e.isMentioned,p=e.isStatusMessage,N=e.readReceiptInfo,E=e.pushConfig,y=e.messageId,R=e.isInterrupt,C=e.isModifyMessage,O=e.channelType,A=e.sentStatus,U=e.directedUserIds;return T||(T=a.UNREAD),{messageType:i,channelId:n||"",content:o,senderUserId:r,targetId:s,conversationType:t,sentTime:c,receivedTime:d,messageUId:u,messageDirection:l,isPersited:v,isCounted:f,isMentioned:m,disableNotification:_,isStatusMessage:p,canIncludeExpansion:S,expansion:h,receivedStatus:T,receivedStatusInfo:I,readReceiptInfo:N,pushConfig:E,messageId:y,isInterrupt:R,isModifyMessage:C,sentStatus:A,isOffLineMessage:g,channelType:O,directedUserIds:U}}function Ye(e){var t=e.conversationType,n=e.targetId,i=e.latestMessage,o=e.unreadMessageCount,r=e.hasMentioned,a=e.mentionedInfo,c=e.lastUnreadTime,d=e.notificationStatus,u=e.notificationLevel,l=e.isTop,v=e.channelId,f=e.unreadMentionedCount,g=e.matchCount,S=e.operationTime,h=e.draft,T={conversationType:t,targetId:n,latestMessage:i&&Fe(i),unreadMessageCount:o,hasMentioned:r,mentionedInfo:r?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0,lastUnreadTime:c,notificationStatus:d,notificationLevel:u,isTop:l,channelId:v,unreadMentionedCount:f,matchCount:g,operationTime:S,draft:h||""};return T.conversationType===s.ULTRA_GROUP&&(T.firstUnreadMessage=e.firstUnreadMessage,T.channelType=e.channelType,T.unreadMentionedMeCount=e.unreadMentionedMeCount),T}function qe(e,t){null===console||void 0===console||console.warn("Method '"+e+"' is deprecated, please use '"+t+"' instead")}!function(e){e.CONNECTING="CONNECTING",e.CONNECTED="CONNECTED",e.DISCONNECT="DISCONNECT",e.SUSPEND="SUSPEND",e.MESSAGES="MESSAGES",e.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",e.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",e.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",e.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",e.SYNC_READ_STATUS="SYNC_READ_STATUS",e.CONVERSATION="CONVERSATION",e.CHATROOM="CHATROOM",e.EXPANSION="EXPANSION",e.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",e.TAG="TAG",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="ULTRA_GROUP_MESSAGE_MODIFIED",e.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",e.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",e.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",e.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",e.PRIVATE_MESSAGE_DELIVERED="PRIVATE_MESSAGE_DELIVERED",e.GROUP_MESSAGE_DELIVERED="GROUP_MESSAGE_DELIVERED",e.USER_GROUP_STATUS="USER_GROUP_STATUS",e.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",e.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",e.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED",e.OWN_USER_PROFILE_CHANGED="OWN_USER_PROFILE_CHANGED"}(xe||(xe={}));var Ke,ze="A-add_to_blacklist-T",We="A-add_to_blacklist-R",je="A-remove_from_blacklist-T",Qe="A-remove_from_blacklist-R",Xe="A-get_blacklist-T",Ze="A-get_blacklist-R",$e="A-get_blacklist_status-T",et="A-get_blacklist_status-R",nt="A-get_chatroom_info-T",it="A-get_chatroom_info-R",ot="A-set_chatroom_entry-T",rt="A-set_chatroom_entry-R",at="A-set_chatroom_entries-T",st="A-set_chatroom_entries-R",ct="A-force_set_chatroom_entry-T",dt="A-force_set_chatroom_entry-R",ut="A-remove_chatroom_entry-T",lt="A-remove_chatroom_entry-R",vt="A-remove_chatroom_entries-T",ft="A-remove_chatroom_entries-R",gt="A-force_remove_chatroom_entry-T",St="A-force_remove_chatroom_entry-R",ht="A-get_chatroom_entry-T",Tt="A-get_chatroom_entry-R",It="A-get_all_chatroom_entries-T",_t="A-get_all_chatroom_entries-R",mt="A-get_chatroom_history_messages-T",pt="A-get_chatroom_history_messages-R",Nt="A-bind_rtc_room_for_chatroom-T",Et="A-bind_rtc_room_for_chatroom-R",yt="A-get_top_conversation_list-R",Rt="A-get_top_conversation_list-T",Ct="A-get_conversation_list-T",Ot="A-get_conversation_list-R",At="A-get_conversation-T",Ut="A-get_conversation-R",wt="A-remove_conversation-T",Pt="A-remove_conversation-R",Mt="A-get_conversation_message_draft-T",bt="A-get_conversation_message_draft-R",Lt="A-save_conversation_message_draft-T",Gt="A-save_conversation_message_draft-R",Jt="A-clear_conversation_message_draft-T",Dt="A-clear_conversation_message_draft-R",Bt="A-get_total_unread_count-T",xt="A-get_total_unread_count-R",kt="A-get_total_unread_count_by_levels-T",Vt="A-get_total_unread_count_by_levels-R",Ht="A-get_unread_count-T",Ft="A-get_unread_count-R",Yt="A-clear_unread_count-T",qt="A-clear_unread_count-R",Kt="A-clear_all_unread_count-O",zt="A-set_conversation_notification_level-T",Wt="A-set_conversation_notification_level-R",jt="A-set_conversation_status-T",Qt="A-set_conversation_status-R",Xt="A-get_conversation_notification_level-T",Zt="A-get_conversation_notification_level-R",$t="A-get_conversation_notification_status-T",en="A-get_conversation_notification_status-R",tn="A-set_conversation_notification_status-T",nn="A-set_conversation_notification_status-R",on="A-get_unread_conversation_list-T",rn="A-get_unread_conversation_list-R",an="A-get_unread_mentioned_count-T",sn="A-get_unread_mentioned_count-R",cn="A-get_all_unread_mentioned_count-T",dn="A-get_all_unread_mentioned_count-R",un="A-get_all_conversation-state-T",ln="A-e_get_all_conversation_list-T",vn="A-e_get_all_conversation_list-R",fn="A-e_get_conversation_list-T",gn="A-e_get_conversation_list-R",Sn="A-e_search_conversation_by_content-T",hn="A-e_search_conversation_by_content-R",Tn="A-get_conversations-T",In="A-get_conversations-R",_n="A-e_search_messages-T",mn="A-e_search_messages-R",pn="A-e_search_message_in_time_range-T",Nn="A-e_search_message_in_time_range-R",En="A-e_search_messages_by_user-T",yn="A-e_search_messages_by_user-R",Rn="A-e_get_history_messages_by_message_types-T",Cn="A-e_get_history_messages_by_message_types-R",On="A-e_get_continuous_messages-T",An="A-e_get_continuous_messages-R",Un="A-e_set_message_status_to_read-T",wn="A-e_set_message_status_to_read-R",Pn="A-e_set_message_received_status-T",Mn="A-e_set_message_received_status-R",bn="A-e_set_message_sent_status-T",Ln="A-e_set_message_sent_status-R",Gn="A-e_set_message_sent_status_info-T",Jn="A-e_set_message_sent_status_info-R",Dn="A-e_set_message_content-T",Bn="A-e_set_message_content-R",xn="A-e_delete_messages-T",kn="A-e_delete_messages-R",Vn="A-e_clear_messages-T",Hn="A-e_clear_messages-R",Fn="A-e_delete_messages_by_timestamp-T",Yn="A-e_delete_messages_by_timestamp-R",qn="A-e_insert_message-T",Kn="A-e_insert_message-R",zn="A-e_batch_insert_message-T",Wn="A-e_batch_insert_message-R",jn="A-e_get_message_count-T",Qn="A-e_get_message_count-R",Xn="A-e_get_private_message_deliver_time-T",Zn="A-e_get_private_message_deliver_time-R",$n="A-e_get_group_message_deliver_list-T",ei="A-e_get_group_message_deliver_list-R",ti="A-e_set_check_duplicate_message-T",ni="A-e_set_check_duplicate_message-R",ii="A-e_set_check_duplicate_message-T",oi="A-e_set_check_duplicate_message-R",ri="A-batch_Remove_conversation-T",ai="A-batch_Remove_conversation-R",si="A-batch_set_con_notifi_level-T",ci="A-batch_set_con_notifi_level-R",di="A-batch_set_con_to_top-T",ui="A-batch_set_con_to_top-R",li="A-batch_clear_remote_msg-T",vi="A-batch_clear_remote_msg-R",fi="A-batch_clear_msg-T",gi="A-batch_clear_msg-R",Si="A-get_remote_history_messages-T",hi="A-get_remote_history_messages-R",Ti="A-recall_message-T",Ii="A-recall_message-R",_i="A-delete_remote_message-T",mi="A-delete_remote_message-R",pi="A-delete_remote_message_by_timestamp-T",Ni="A-delete_remote_message_by_timestamp-R",Ei="A-update_message_expansion-T",yi="A-update_message_expansion-R",Ri="A-remove_message_expansion_for_key-T",Ci="A-remove_message_expansion_for_key-R",Oi="A-get_message_reader-T",Ai="A-get_message_reader-R",Ui="A-get_first_unread_message-T",wi="A-get_first_unread_message-R",Pi="A-get_first_unread_message_info-T",Mi="A-get_first_unread_message_info-R",bi="A-insert_message-T",Li="A-insert_message-R",Gi="A-get_message-T",Ji="A-get_message-R",Di="A-get_unread_mentioned_messages-T",Bi="A-get_unread_mentioned_messages-R",xi="A-delete_local_messages_by_timestamp-T",ki="A-delete_local_messages_by_timestamp-R",Vi="A-clear_messages-T",Hi="A-clear_messages-R",Fi="A-search_conversation_by_content-T",Yi="A-search_conversation_by_content-R",qi="A-clear_unread_count_by_timestamp-T",Ki="A-clear_unread_count_by_timestamp-R",zi="A-set_message_received_status-T",Wi="A-set_message_received_status-R",ji="A-set_proxy-T",Qi="A-set_proxy-R",Xi="A-get_proxy-T",Zi="A-get_proxy-R",$i="A-test_proxy-T",eo="A-test_proxy-R",to="A-add_tag-T",no="A-add_tag-R",io="A-remove_tag-T",oo="A-remove_tag-R",ro="A-update_tag-T",ao="A-update_tag-R",so="A-get_tags-T",co="A-get_tags-R",uo="A-get_tags_for_conversation-T",lo="A-get_tags_for_conversation-R",vo="A-add_tag_for_conversations-T",fo="A-add_tag_for_conversations-R",go="A-remove_conversations_from_tag-T",So="A-remove_conversations_from_tag-R",ho="A-remove_tags_from_conversation-T",To="A-remove_tags_from_conversation-R",Io="A-remove_tag_from_conversations-T",_o="A-remove_tag_from_conversations-R",mo="A-get_conversations_from_tag_by_page-T",po="A-get_conversations_from_tag_by_page-R",No="A-get_unread_count_by_tag-T",Eo="A-get_unread_count_by_tag-R",yo="A-set_conversation_status_in_tag-R",Ro="A-get_ultra_group_list-T",Co="A-get_ultra_group_list-R",Oo="A-get_block_ultra_group_list-T",Ao="A-get_block_ultra_group_list-R",Uo="A-send_ultra_group_typing_status-T",wo="A-send_ultra_group_typing_status-R",Po="A-get_ultra_group_message_list_by_message_uid-T",Mo="A-get_ultra_group_message_list_by_message_uid-R",bo="A-update_expansion_for_ultra_group_message-T",Lo="A-update_expansion_for_ultra_group_message-R",Go="A-remove_expansion_for_ultra_group_message-T",Jo="A-remove_expansion_for_ultra_group_message-R",Do="A-remove_all_expansion_for_ultra_group_message-T",Bo="A-remove_all_expansion_for_ultra_group_message-R",xo="A-modify_message-T",ko="A-modify_message-R",Vo="A-get_ultra_group_unread_mentioned_count_by_target_id-T",Ho="A-get_ultra_group_unread_mentioned_count_by_target_id-R",Fo="A-get_ultra_group_default_notification_level-T",Yo="A-get_ultra_group_default_notification_level-R",qo="A-set_ultra_group_default_notification_level-T",Ko="A-set_ultra_group_default_notification_level-R",zo="A-get_ultra_group_unread_count_by_target_id-T",Wo="A-get_ultra_group_unread_count_by_target_id-R",jo="A-get_all_ultra_group_unread_count-T",Qo="A-get_all_ultra_group_unread_count-R",Xo="A-get_all_ultra_group_unread_mentioned_count-T",Zo="A-get_all_ultra_group_unread_mentioned_count-R",$o="A-get_ultra_group_unread_mentioned_messages-T",er="A-get_ultra_group_unread_mentioned_messages-R",tr="A-get_ultra_group_first_unread_message_timestamp-T",nr="A-get_ultra_group_first_unread_message_timestamp-R",ir="A-get_ultra_group_unread_info_list-T",or="A-get_ultra_group_unread_info_list-R",rr="A-subscribe_user_status-T",ar="A-subscribe_user_status-R",sr="A-unsubscribe_user_status-T",cr="A-unsubscribe_user_status-R",dr="A-get_subscribe_user_status-T",ur="A-get_subscribe_user_status-R",lr="A-get_subscribe_user_status_list-T",vr="A-get_subscribe_user_status_list-R",fr="A-get_message_by_timestamp-T",gr="A-get_message_by_timestamp-R",Sr="A-update_my_user_profile-T",hr="A-update_my_user_profile-R",Tr="A-get_user_profiles-T",Ir="A-get_user_profiles-R",_r="A-get_my_user_profile-T",mr="A-get_my_user_profile-R",pr="A-update_my_user_profile_visibility-T",Nr="A-update_my_user_profile_visibility-R",Er="A-get_my_user_profile_visibility-T",yr="A-get_my_user_profile_visibility-R",Rr="A-search_user_profile_by_unique_id-T",Cr="A-search_user_profile_by_unique_id-R";!function(e){e[e.DISALLOW=0]="DISALLOW",e[e.ALLOW=1]="ALLOW"}(Ke||(Ke={}));var Or=new c,Ar={connection:function(e,t){switch(e){case d.CONNECTED:Or.emit(xe.CONNECTED);break;case d.CONNECTING:Or.emit(xe.CONNECTING);break;case d.SUSPENDED:Or.emit(xe.SUSPEND,t);break;case d.DISCONNECTED:Or.emit(xe.DISCONNECT,t)}},batchMessage:function(e){Or.emit(xe.MESSAGES,{messages:e.map((function(e){return Fe(e)}))})},typingState:function(e){Or.emit(xe.TYPING_STATUS,{status:e})},readReceiptReceived:function(e,t,n,i){Or.emit(xe.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:i})},messageReceiptRequest:function(e,t,n){Or.emit(xe.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:function(e,t,n){Or.emit(xe.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:function(e){var t=e.map((function(e){var t=e.conversationType,n={conversationType:t,latestMessage:e.latestMessage?Fe(e.latestMessage):null,targetId:e.targetId,unreadMessageCount:e.unreadMessageCount,unreadMentionedCount:e.unreadMentionedCount,notificationStatus:e.notificationStatus,notificationLevel:e.notificationLevel,lastUnreadTime:e.lastUnreadTime,channelId:e.channelId};return t===s.ULTRA_GROUP?(n.versionTime=e.versionTime,n.unreadMessageCount=Ur(e.unreadMessageCount||0),n.unreadMentionedCount=Ur(e.unreadMentionedCount||0),n.unreadMentionedMeCount=Ur(e.unreadMentionedMeCount||0),{conversation:n}):(n.hasMentioned=e.hasMentioned,n.mentionedInfo=e.mentionedInfo,n.isTop=e.isTop,{conversation:n,updatedItems:e.updatedItems})}));Or.emit(xe.CONVERSATION,{conversationList:t})},chatroomState:function(e){Or.emit(xe.CHATROOM,e)},expansion:function(e){Or.emit(xe.EXPANSION,e)},pullFinished:function(){Or.emit(xe.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){Or.emit(xe.TAG)},conversationTagChanged:function(){Or.emit(xe.CONVERSATION_TAG)},messageBlocked:function(e){Or.emit(xe.MESSAGE_BLOCKED,e)},messageDelivered:function(e){Or.emit(xe.PRIVATE_MESSAGE_DELIVERED,e)},groupMessageDeliveredStatus:function(e){Or.emit(xe.GROUP_MESSAGE_DELIVERED,e)},ultraGroupEnable:function(e){Or.emit(xe.ULTRA_GROUP_ENABLE,e.map((function(e){return Ye(e)})))},operateStatus:function(e){Or.emit(xe.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:function(e){Or.emit(xe.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((function(e){return Fe(e)})))},ultraGroupMessageModified:function(e){Or.emit(xe.ULTRA_GROUP_MESSAGE_MODIFIED,e.map((function(e){return Fe(e)})))},ultraGroupMessageRecalled:function(e){Or.emit(xe.ULTRA_GROUP_MESSAGE_RECALLED,e.map((function(e){return Fe(e)})))},ultraGroupChannelChangeType:function(e){Or.emit(xe.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:function(e){Or.emit(xe.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:function(e){Or.emit(xe.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:function(e){Or.emit(xe.USER_GROUP_STATUS,e)},messageReadReceipt:function(e){Or.emit(xe.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:function(e){Or.emit(xe.SYNC_READ_STATUS,e)},subscribedUserStatusChange:function(e){Or.emit(xe.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:function(e){Or.emit(xe.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:function(e){Or.emit(xe.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:function(e){Or.emit(xe.OWN_USER_PROFILE_CHANGED,e)}};function Ur(e){return e>999?999:e}u.add("imlib-next","5.10.2");var wr=null,Pr=null,Mr=null;function br(){return Z(this,void 0,void 0,(function(){return $(this,(function(e){switch(e.label){case 0:return wr?(Mr.info(h.A_DESTROY_O),[4,S.destroy()]):[2];case 1:return e.sent(),Pr=null,wr=null,Mr=null,[2]}}))}))}function Lr(e){if(!wr)throw new Error("Not initialized yet!");return e(wr,Mr,Pr)}function Gr(e){return wr?e(wr,Mr,Pr):Promise.resolve({code:r.BIZ_ERROR_CLIENT_NOT_INIT})}function Jr(e,t,n){Or.on(e,t,n)}function Dr(e,t,n){Or.once(e,t,n)}function Br(e,t,n){Or.off(e,t,n)}function xr(e){Or.removeAll(e)}function kr(){Or.clear()}function Vr(e){!function(e){var t,n,i=e.appkey,o=e.navigators;wr?Mr.warn(h.A_INIT_REPEAT_O):(l("options.appkey",e.appkey,v.STRING,!0),l("options.navigators",e.navigators,(function(e){return f(e)&&(0===e.length||e.every(g))})),Pr=e,wr=S.init((null===(t=e.__runtimeCreator__)||void 0===t?void 0:t.call(e))||He,{appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,__reportLogLevel:e.__reportLogLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,uploadDomain:e.uploadDomain,environment:null!==(n=e.environment)&&void 0!==n?n:"default"}),(Mr=wr.createLogger("RC-IM","IM")).setOutputLevel(e.logOutputLevel),Mr.info(h.A_INIT_O,JSON.stringify({appkey:i,navigators:o,version:"5.10.2",commit:"3cbfa0729fd40ab8df50322aa87f2e7cc2601fcc"})),wr.assignWatcher(Ar),T.init(Mr))}(e)}function Hr(){return Z(this,void 0,void 0,(function(){return $(this,(function(e){return wr?(kr(),[2,br()]):[2]}))}))}function Fr(){return Lr((function(e){return e.getConnectionStatus()}))}function Yr(){return Lr((function(e){return e.getServerTime()}))}function qr(){return Lr((function(e){return e.getCurrentUserId()}))}function Kr(e,t){u.add(e,t)}function zr(){return Lr((function(e){return e.getDeviceId()}))}function Wr(e,t){return Lr((function(n){return n.install(e,t)}))}var jr={TIMEOUT:{code:-1,msg:"Network timeout"},REJECTED_BY_BLACKLIST:{code:405,msg:"Blacklisted by the other party"},SEND_TOO_FAST:{code:20604,msg:"Sending messages too quickly"},NOT_IN_GROUP:{code:22406,msg:"Not in group"},ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL:{code:r.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL,msg:"ultra group user not in private channel"},FORBIDDEN_IN_GROUP:{code:22408,msg:"Forbbiden from speaking in the group"},NOT_IN_CHATROOM:{code:23406,msg:"Not in chatRoom"},FORBIDDEN_IN_CHATROOM:{code:23408,msg:"Forbbiden from speaking in the chatRoom"},KICKED_FROM_CHATROOM:{code:23409,msg:"Kicked out and forbbiden from joining the chatRoom"},CHATROOM_NOT_EXIST:{code:23410,msg:"ChatRoom does not exist"},CHATROOM_IS_FULL:{code:23411,msg:"ChatRoom members exceeded"},PARAMETER_INVALID_CHATROOM:{code:23412,msg:"Invalid chatRoom parameters"},ROAMING_SERVICE_UNAVAILABLE_CHATROOM:{code:23414,msg:"ChatRoom message roaming service is not open, Please go to the developer to open this service"},RECALLMESSAGE_PARAMETER_INVALID:{code:25101,msg:"Invalid recall message parameter"},ROAMING_SERVICE_UNAVAILABLE_MESSAGE:{code:25102,msg:"Single group chat roaming service is not open, Please go to the developer to open this service"},PUSHSETTING_PARAMETER_INVALID:{code:26001,msg:"Invalid push parameter"},OPERATION_BLOCKED:{code:20605,msg:"Operation is blocked"},OPERATION_NOT_SUPPORT:{code:20606,msg:"Operation is not supported"},MSG_BLOCKED_SENSITIVE_WORD:{code:21501,msg:"The sent message contains sensitive words"},REPLACED_SENSITIVE_WORD:{code:21502,msg:"Sensitive words in the message have been replaced"},NOT_CONNECTED:{code:30001,msg:"Please connect successfully first"},NAVI_REQUEST_ERROR:{code:30007,msg:"Navigation http request failed"},CMP_REQUEST_ERROR:{code:30010,msg:"CMP sniff http request failed"},CONN_APPKEY_FAKE:{code:31002,msg:"Your appkey is fake"},CONN_MINI_SERVICE_NOT_OPEN:{code:31003,msg:"Mini program service is not open, Please go to the developer to open this service"},CONN_ACK_TIMEOUT:{code:31e3,msg:"Connection ACK timeout"},CONN_TOKEN_INCORRECT:{code:31004,msg:"Your token is not valid or expired"},CONN_NOT_AUTHRORIZED:{code:31005,msg:"AppKey and Token do not match"},CONN_REDIRECTED:{code:31006,msg:"Connection redirection"},CONN_APP_BLOCKED_OR_DELETED:{code:31008,msg:"AppKey is banned or deleted"},CONN_USER_BLOCKED:{code:31009,msg:"User blocked"},CONN_DOMAIN_INCORRECT:{code:31012,msg:"Connect domain error, Please check the set security domain"},ROAMING_SERVICE_UNAVAILABLE:{code:33007,msg:"Roaming service cloud is not open, Please go to the developer to open this service"},RC_CONNECTION_EXIST:{code:34001,msg:"Connection already exists"},CHATROOM_KV_EXCEED:{code:23423,msg:"ChatRoom KV setting exceeds maximum"},CHATROOM_KV_OVERWRITE_INVALID:{code:23424,msg:"ChatRoom KV already exists"},CHATROOM_KV_STORE_NOT_OPEN:{code:23426,msg:"ChatRoom KV storage service is not open, Please go to the developer to open this service"},CHATROOM_KEY_NOT_EXIST:{code:23427,msg:"ChatRoom key does not exist"},MSG_KV_NOT_SUPPORT:{code:34008,msg:"The message cannot be extended"},SEND_MESSAGE_KV_FAIL:{code:34009,msg:"Sending RC expansion message fail"},EXPANSION_LIMIT_EXCEET:{code:34010,msg:"The message expansion size is beyond the limit"},ILLGAL_PARAMS:{code:33003,msg:"Incorrect parameters passed in while calling the interface"},UPLOAD_FILE_FAILED:{code:35020,msg:"File upload failed"},CHATROOM_KV_STORE_NOT_ALL_SUCCESS:{code:23428,msg:"Chatroom kv store not all success"},CHATROOM_KV_STORE_OUT_LIMIT:{code:23429,msg:"Chatroom kv's length is out of limit"},TAG_EXISTS:{code:33101,msg:"The tag already exists"},TAG_NOT_EXIST:{code:33100,msg:"The tag does not exist"},NOT_SUPPORT:{code:r.NOT_SUPPORT,msg:"The method is not supported in a browser!"}},Qr={},Xr={};for(var Zr in jr){var $r=jr[Zr],ea=$r.code;Qr[ea]=Zr,Xr[ea]=$r}function ta(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_CONNECT_T,h.A_CONNECT_R).validate("token",e,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(h.A_CONNECT_T,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,i.connect(e,!!t,n)];case 1:return a=c.sent(),s=a.code===r.SUCCESS?"info":"warn",o[s](h.A_CONNECT_R,JSON.stringify({code:a.code,userId:a.userId}),n),a.code===r.SUCCESS?[2,{code:a.code,data:{userId:a.userId}}]:[2,{code:a.code,msg:Qr[a.code]}]}}))}))}))]}))}))}function na(e){return T.info(h.A_DISCONNECT_O,{}),Lr((function(t){return t.disconnect(e)}))}function ia(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Ct,Ot).validate("count",null==e?void 0:e.count,v.NUMBER).validate("startTime",null==e?void 0:e.startTime,v.NUMBER).validate("order",null==e?void 0:e.order,v.NUMBER).validate("channelId",t,v.CHANNEL_ID).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(Ct,JSON.stringify({count:null==e?void 0:e.count,startTime:null==e?void 0:e.startTime,order:null==e?void 0:e.order,channelId:t}),n),[4,i.getConversationList(null==e?void 0:e.count,void 0,null==e?void 0:e.startTime,null==e?void 0:e.order,t)];case 1:return a=u.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=c.map((function(e){return Ye(e)})),o.info(Ot,JSON.stringify({code:s,list:d.length}),n),[2,{code:0,data:d}]):(o.warn(Ot,JSON.stringify({code:s})),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function oa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(At,Ut).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(At,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversation(t,o,a||"")];case 1:return c=v.sent(),d=c.code,u=c.data,l=d===r.SUCCESS?"info":"warn",i[l](Ut,JSON.stringify({code:d}),s),d!==r.SUCCESS?[2,{code:d,msg:Qr[d]}]:[2,{code:d,data:u?Ye(u):null}]}}))}))}))]}))}))}function ra(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(wt,Pt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(wt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.removeConversation(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Pt,JSON.stringify({code:c}),s),c!==r.SUCCESS?[2,{code:c,msg:Qr[c]}]:[2,{code:c}]}}))}))}))]}))}))}function aa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(ri,ai).validate("conversations",e,(function(t){if(!_("conversations",t,v.ARRAY,!0))return!1;if(t.length>20||0===t.length)return!1;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(!(_("conversations",o,v.OBJECT,!0)&&_("conversations.targetId",o.targetId,v.STRING,!0)&&_("conversations.conversationType",o.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(ai,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",o.channelId,v.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),o=i.createTraceId(),i.info(ri,"conversations: "+JSON.stringify(t),o),[4,n.batchRemoveConversation(t)];case 1:return a=s.sent(),i[r.SUCCESS===a?"info":"warn"](ai,"code: "+a,o),[2,{code:a}]}}))}))}))]}))}))}function sa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Mt,bt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Mt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationMessageDraft(t,o,a)];case 1:return c=v.sent(),d=c.code,u=c.data,l=d===r.SUCCESS?"info":"warn",i[l](bt,JSON.stringify({code:d,data:u}),s),d===r.SUCCESS?[2,{code:d,data:u||""}]:[2,{code:d,msg:Qr[d]}]}}))}))}))]}))}))}function ca(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Lt,Gt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("draft",t,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(Lt,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,draft:t}),n),[4,i.saveConversationMessageDraft(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Gt,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function da(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Jt,Dt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Jt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearConversationMessageDraft(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Dt,JSON.stringify({code:c}),s),c===r.SUCCESS?[2,{code:c}]:[2,{code:c,msg:Qr[c]}]}}))}))}))]}))}))}function ua(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Bt,xt).validate("conversationTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!1).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Bt,JSON.stringify({conversationTypes:t,includeMuted:e}),n),[4,i.getTotalUnreadCount("",t,e)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(xt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(xt,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function la(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(kt,Vt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!0).validate("levels",t,(function(e){return!!f(t)&&!e.some((function(e){return!p(e)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(kt,JSON.stringify({conversationTypes:e,levels:t,isMentioned:!1}),n),[4,i.getTotalUnreadCountByLevels(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Vt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Vt,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function va(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(kt,Vt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!0).validate("levels",t,(function(e){return!!f(e)&&!e.some((function(e){return!p(e)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(kt,JSON.stringify({conversationTypes:e,levels:t,isMentioned:!0}),n),[4,i.getTotalUnreadCountByLevels(e,t,!0)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Vt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Vt,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function fa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Ht,Ft).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ht,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getUnreadCount(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Ft,JSON.stringify({code:d,data:u})),[2,{code:d,data:u}]):(i.warn(Ft,JSON.stringify({code:d})),[2,{code:d,msg:Qr[d]}])}}))}))}))]}))}))}function ga(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Yt,qt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Yt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearUnreadCount(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](qt,JSON.stringify({code:c}),s),c!==r.SUCCESS?[2,{code:c,msg:Qr[c]}]:[2,{code:c}]}}))}))}))]}))}))}function Sa(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I("","").ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e;return $(this,(function(i){switch(i.label){case 0:return e=n.createTraceId(),n.info(Kt,"",e),[4,t.clearAllUnreadCount()];case 1:return[2,{code:i.sent()}]}}))}))}))]}))}))}jr.ROAMING_SERVICE_UNAVAILABLE.code;var ha=function(e,t,n,i){return void 0===i&&(i=""),Z(void 0,void 0,void 0,(function(){var o,a;return $(this,(function(s){switch(s.label){case 0:return o=function(e,t,n){void 0===n&&(n="");var i="conversationType:"+t.conversationType+",targetId:"+t.targetId;return e.debug(h.O,n+" -> "+i),i}(e,t,i),[4,n()];case 1:return(a=s.sent())!==r.SUCCESS?(e.warn(h.O,i+" fail -> "+a+" : "+Qr[a]+" , "+o),[2,{code:a,msg:Qr[a]}]):[2,{code:a}]}}))}))};function Ta(e,t){return Z(this,void 0,void 0,(function(){return $(this,(function(n){return[2,new I(zt,Wt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationLevel",t,(function(e){return void 0!==N[e]}),!0).ifReady((function(n,i){return ha(i,e,(function(){return n.setConversationNotificationLevel(e.conversationType,e.targetId,t,e.channelId)}),"setConversationNotificationLevel")}))]}))}))}function Ia(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(si,ci).validate("conversations",e,(function(e){if(!_("conversations",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("conversations",i,v.OBJECT,!0)&&_("conversations.targetId",i.targetId,v.STRING,!0)&&_("conversations.conversationType",i.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(ai,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).validate("notificationLevel",t,(function(e){return[-1,0,1,2,3,4,5].includes(e)}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),a=o.createTraceId(),o.info(si,"conversations: "+JSON.stringify(n),a),[4,i.batchSetConversationNotificationLevel(n,t)];case 1:return s=c.sent(),o[r.SUCCESS===s?"info":"warn"](ci,"code: "+s,a),[2,{code:s}]}}))}))}))]}))}))}function _a(e,t){return Z(this,void 0,void 0,(function(){return $(this,(function(n){return[2,new I(tn,nn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationStatus",t,(function(e){return 1===e||2===e}),!0).ifReady((function(n,i){return ha(i,e,(function(){return n.setConversationStatus(e.conversationType,e.targetId,void 0,t,e.channelId)}),"setConversationNotificationStatus")}))]}))}))}function ma(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Zt,Zt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Xt,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationNotificationLevel(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Zt,JSON.stringify({code:d,data:u}),s),[2,{code:d,data:u}]):(i.warn(Zt,JSON.stringify({code:d}),s),[2,{code:d,msg:Qr[d]}])}}))}))}))]}))}))}function pa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I($t,en).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info($t,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getConversationNotificationStatus(t,o,a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(en,JSON.stringify({code:d,data:u}),s),[2,{code:d,data:u}]):(i.warn(en,JSON.stringify({code:d}),s),[2,{code:d,msg:Qr[d]}])}}))}))}))]}))}))}function Na(){return Z(this,void 0,void 0,(function(){return $(this,(function(e){return[2,new I("","").ifReady((function(e){return e.getBlockConversationList()}))]}))}))}function Ea(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return _("conversationType",e,(function(){return[s.PRIVATE,s.GROUP,s.SYSTEM,s.PUBLIC_SERVICE,s.APP_PUBLIC_SERVICE,s.ULTRA_GROUP].includes(e)}))&&_("level",t,p)?[2,Gr((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return o.info(h.O,"setConversationTypeNotificationLevel ->conversationType:"+e+",level:"+t),[4,i.setConversationTypeNotificationLevel(e,t)];case 1:return n=c.sent(),a=n.code,s=n.data,a===r.SUCCESS?[2,{code:a,data:s}]:(o.warn(h.O,"setConversationTypeNotificationLevel ->conversationType:"+e+",level:"+t),[2,{code:a,msg:Qr[a]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function ya(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return _("conversationType",e,(function(){return[s.PRIVATE,s.GROUP,s.SYSTEM,s.PUBLIC_SERVICE,s.APP_PUBLIC_SERVICE,s.ULTRA_GROUP].includes(e)}))?[2,Gr((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return i.info(h.O,"getConversationTypeNotificationLevel ->conversationType:"+e),[4,n.getConversationTypeNotificationLevel(e)];case 1:return t=s.sent(),o=t.code,a=t.data,o===r.SUCCESS?[2,{code:o,data:a}]:(i.warn(h.O,"getConversationTypeNotificationLevel ->conversationType:"+e),[2,{code:o,msg:Qr[o]}])}}))}))}))]:[2,{code:r.BIZ_ERROR_INVALID_PARAMETER}]}))}))}function Ra(e,t,n){return void 0===t&&(t=!0),void 0===n&&(n=!0),Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(jt,Qt).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("isTop",t,v.BOOLEAN).validate("isUpdateTime",n,v.BOOLEAN).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return i=e.conversationType,s=e.targetId,c=e.channelId,d=a.createTraceId(),a.info(jt,JSON.stringify({conversationType:i,targetId:s,channelId:c,isTop:t}),d),[4,o.setConversationStatus(e.conversationType,e.targetId,t,void 0,e.channelId,n)];case 1:return u=v.sent(),l=u===r.SUCCESS?"info":"warn",a[l](Qt,JSON.stringify({code:u}),d),u!==r.SUCCESS?[2,{code:u,msg:Qr[u]}]:[2,{code:u}]}}))}))}))]}))}))}function Ca(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(di,ui).validate("conversations",e,(function(e){if(!_("conversations",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("conversations",i,v.OBJECT,!0)&&_("conversations.targetId",i.targetId,v.STRING,!0)&&_("conversations.conversationType",i.conversationType,(function(e){var t=[s.PRIVATE,s.GROUP,s.SYSTEM].includes(e);return t||console.warn(ai,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.SYSTEM,\n "),t}),!0)&&_("conversations.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).validate("isTop",t,v.BOOLEAN,!0).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c;return $(this,(function(d){switch(d.label){case 0:return i=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),s=a.createTraceId(),a.info(di,"conversations: "+JSON.stringify(i),s),[4,o.batchSetConversationToTop(i,t,n)];case 1:return c=d.sent(),a[r.SUCCESS===c?"info":"warn"](ui,"code: "+c,s),[2,{code:c}]}}))}))}))]}))}))}function Oa(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Rt,yt).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))})).validate("channelId",t,v.CHANNEL_ID).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(Rt,JSON.stringify({conversationTypes:e,channelId:t}),n),[4,i.getTopConversationList(e,t)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.map((function(e){return d.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId}),Ye(e)})),o.info(yt,JSON.stringify({code:s,list:d}),n),[2,{code:0,data:u}]):(o.warn(h.A_GET_TOP_CONVERSATION_LIST_E,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function Aa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(on,rn).validate("conversationTypes",e,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=i.createTraceId(),i.info(on,JSON.stringify({conversationTypes:e}),t),[4,n.getUnreadConversationList(e)];case 1:return o=u.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(c=[],d=s.map((function(e){return c.push({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,unreadMessageCount:e.unreadMessageCount}),Ye(e)})),i.info(rn,JSON.stringify({code:a,list:c}),t),[2,{code:0,data:d}]):(i.warn(rn,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]}))}))}function Ua(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I($t,en).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(an,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),t),[4,n.getUnreadMentionedCount(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(sn,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(sn,JSON.stringify({code:a}),t),[2,{code:a}])}}))}))}))]}))}))}function wa(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I("","").ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a;return $(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(cn,"",e),[4,t.getAllUnreadMentionedCount()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.warn(dn,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):[2,{code:o}]}}))}))}))]}))}))}function Pa(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I("","").ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(un,"",e),[4,t.getAllConversationState()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Qt,JSON.stringify({code:o}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o}]}}))}))}))]}))}))}function Ma(e){return void 0===e&&(e={}),Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Ro,Co).validate("targetId",null==e?void 0:e.targetId,v.STRING,!1).validate("channelType",null==e?void 0:e.channelType,(function(e){return void 0!==E[e]}),!1).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Ro,JSON.stringify({targetId:e.targetId,channelType:e.channelType}),t),[4,n.getUltraGroupList(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Co,JSON.stringify({code:a,length:null==s?void 0:s.length}),t),[2,{code:r.SUCCESS,data:s}]):(i.warn(Co,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]}))}))}function ba(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I("","").ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a;return $(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(Oo,"",e),[4,t.getBlockUltraGroupList()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.info(Ao,JSON.stringify({code:o,length:null==a?void 0:a.length}),e),[2,{code:r.SUCCESS,data:a}]):(n.warn(Ao,JSON.stringify({code:o}),e),[2,{code:o,msg:Qr[o]}])}}))}))}))]}))}))}function La(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Uo,wo).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Uo,JSON.stringify({targetId:e.targetId,channelId:e.channelId}),t),[4,n.sendUltraGroupTypingStatus(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](wo,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function Ga(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Po,Mo).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messages",t,v.ARRAY,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h;return $(this,(function(T){switch(T.label){case 0:return n=e.targetId,a=e.conversationType,s=e.channelId,c=[],t.forEach((function(e){var t=e.sendTime,n=e.messageUId;c.push({sendTime:t,messageUId:n,channelId:s})})),d={targetId:n,conversationType:a,messages:c},u=o.createTraceId(),o.info(Po,JSON.stringify(d),u),[4,i.getUltraGroupMessageListByMessageUId(d)];case 1:if(l=T.sent(),v=l.code,f=l.data,v===r.SUCCESS){for(h in g={},S=[],f)S.push(h),g[h]=f[h]?Fe(f[h]):void 0;return o.info(Mo,JSON.stringify({code:v,messageUIds:S}),u),[2,{code:r.SUCCESS,data:g}]}return o.warn(Mo,JSON.stringify({code:v}),u),[2,{code:v,msg:Qr[v]}]}}))}))}))]}))}))}function Ja(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(bo,Lo).validate("expansion",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g;return $(this,(function(S){switch(S.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l=o.createTraceId(),o.info(bo,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:u}),l),v={targetId:a,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:s,expansion:e},[4,i.expandUltraMessage(v)];case 1:return f=S.sent().code,g=f===r.SUCCESS?"info":"warn",o[g](Lo,JSON.stringify({code:f}),l),f===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:f,msg:Qr[f]}]}}))}))}))]}))}))}function Da(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Go,Jo).validate("expansion",e,v.ARRAY,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g;return $(this,(function(S){switch(S.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.sentTime,d=t.canIncludeExpansion,u=t.channelId,l=o.createTraceId(),o.info(Go,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:u}),l),v={targetId:a,channelId:u,conversationType:n,sendTime:c,canIncludeExpansion:d,messageUId:s,keys:e},[4,i.expandUltraMessage(v)];case 1:return f=S.sent().code,g=f===r.SUCCESS?"info":"warn",o[g](Jo,JSON.stringify({code:f}),l),f===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:f,msg:Qr[f]}]}}))}))}))]}))}))}function Ba(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Do,Bo).validate("message",e,v.OBJECT,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,v,f;return $(this,(function(g){switch(g.label){case 0:return t=e.conversationType,o=e.targetId,a=e.messageUId,s=e.sentTime,c=e.canIncludeExpansion,d=e.channelId,u=i.createTraceId(),i.info(Do,JSON.stringify({conversationType:t,targetId:o,messageUId:a,channelId:d}),u),l={targetId:o,channelId:d,conversationType:t,sendTime:s,canIncludeExpansion:c,messageUId:a,removeAll:!0},[4,n.expandUltraMessage(l)];case 1:return v=g.sent().code,f=v===r.SUCCESS?"info":"warn",i[f](Bo,JSON.stringify({code:v}),u),v===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:v,msg:Qr[v]}]}}))}))}))]}))}))}function xa(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ko,ko).validate("content",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S;return $(this,(function(h){switch(h.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.senderUserId,d=t.sentTime,u=t.canIncludeExpansion,l=t.channelId,v=o.createTraceId(),o.info(xo,JSON.stringify({conversationType:n,targetId:a,messageUId:s,channelId:l}),v),f={targetId:a,channelId:l,conversationType:n,fromUserId:c,sendTime:d,canIncludeExpansion:u,messageUId:s,content:e},[4,i.modifyMessage(f)];case 1:return g=h.sent().code,S=g===r.SUCCESS?"info":"warn",o[S](ko,JSON.stringify({code:g}),v),g===r.SUCCESS?[2,{code:r.SUCCESS}]:[2,{code:g,msg:Qr[g]}]}}))}))}))]}))}))}function ka(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Vo,Vo).validate("targetId",e,v.STRING,!0).validate("notificationLevels",t,v.ARRAY).validate("notificationLevels",t,(function(e){return!(null==t?void 0:t.some((function(e){return!p(e)})))})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(Vo,JSON.stringify({targetId:e,notificationLevels:t}),n),[4,i.getUltraGroupUnreadMentionedCountByTargetId(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Ho,JSON.stringify({code:s,data:c}),e),[2,{code:r.SUCCESS,data:c}]):(o.warn(Ho,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function Va(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Fo,Yo).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Fo,JSON.stringify({targetId:e.targetId,channelId:e.channelId}),t),[4,n.getUltraGroupDefaultNotificationLevel(e.targetId,e.channelId)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Yo,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(Yo,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]}))}))}function Ha(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return e.channelId=e.channelId||"",[2,new I(qo,Ko).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("notificationLevel",t,(function(e){return void 0!==N[e]}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(qo,JSON.stringify({targetId:e.targetId,channelId:e.channelId,notificationLevel:t}),n),[4,i.setUltraGroupDefaultNotificationLevel(e.targetId,t,e.channelId)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](Ko,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function Fa(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(zo,Wo).validate("targetId",e,v.STRING,!0).validate("notificationLevels",t,v.ARRAY).validate("notificationLevels",t,(function(e){return!(null==t?void 0:t.some((function(e){return!p(e)})))})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(zo,JSON.stringify({targetId:e,notificationLevels:t}),n),[4,i.getUltraGroupUnreadCountByTargetId(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](Wo,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]}}))}))}))]}))}))}function Ya(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I(jo,Qo).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(jo,"getAllUltraGroupUnreadCount",e),[4,t.getAllUltraGroupUnreadCount()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Qo,JSON.stringify({code:o,data:a}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function qa(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I(Xo,Zo).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(Xo,"getAllUltraGroupUnreadCount",e),[4,t.getAllUltraGroupUnreadCount(true)];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](Zo,JSON.stringify({code:o,data:a}),e),o===r.SUCCESS?[2,{code:o,data:a}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function Ka(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return e.channelId=e.channelId||"",[2,new I($o,er).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("sentTime",null==e?void 0:e.sentTime,v.NUMBER,!0).validate("count",null==e?void 0:e.count,(function(e){return y(e)&&e>0&&e<=50}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l,v;return $(this,(function(f){switch(f.label){case 0:return t=e.targetId,o=e.channelId,a=e.sentTime,s=e.count,c={targetId:t,channelId:o,sentTime:a,count:s},d=i.createTraceId(),i.info($o,JSON.stringify(c),d),[4,n.getUltraGroupUnreadMentionedMessages(c)];case 1:return u=f.sent(),l=u.code,v=u.data,l===r.SUCCESS?(i.info(er,JSON.stringify({code:l,data:null==v?void 0:v.map((function(e){return e.messageUId}))}),d),[2,{code:l,data:v}]):(i.warn(er,JSON.stringify({code:l}),d),[2,{code:l,msg:Qr[l]}])}}))}))}))]}))}))}function za(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I($o,er).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=e.targetId,o=e.channelId,a={targetId:t,channelId:o},s=i.createTraceId(),i.info(tr,JSON.stringify(a),s),[4,n.getUltraGroupFirstUnreadMessageTimestamp(a)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(nr,JSON.stringify({code:d,sentTime:null==u?void 0:u.sentTime}),s),[2,{code:d,data:u}]):(i.warn(nr,JSON.stringify({code:d}),s),[2,{code:d,msg:Qr[d]}])}}))}))}))]}))}))}function Wa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(ir,or).validate("targetIds",e,(function(t){return!!_("targetIds",e,v.ARRAY,!0)&&(!(t.length<=0||t.length>20)&&!e.some((function(e){return!R(e)})))})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.filter((function(t,n){return e.indexOf(t)===n})),o=i.createTraceId(),i.info(ir,JSON.stringify({targetIds:e}),o),[4,n.getUltraGroupUnreadInfoList(t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",i[d](or,JSON.stringify({code:s}),o),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Qr[s]}]}}))}))}))]}))}))}function ja(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_JOIN_CHATROOM_T,h.A_JOIN_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",t,v.OBJECT,!0).validate("count",null==t?void 0:t.count,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!1}),n),[4,i.joinChatroom(e,t.count,n)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](h.A_JOIN_CHATROOM_R,JSON.stringify({code:a,timestamp:(new Date).getTime()}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function Qa(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_JOIN_CHATROOM_T,h.A_JOIN_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",null==t?void 0:t.count,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(h.A_JOIN_CHATROOM_T,JSON.stringify({chatroomId:e,count:t.count,joinExist:!0}),n),[4,i.joinExistChatroom(e,t.count,n)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](h.A_JOIN_CHATROOM_R,JSON.stringify({code:s,timestamp:(new Date).getTime()}),n),s!==r.SUCCESS?[2,{code:s,msg:Qr[s]}]:[2,{code:s,data:c}]}}))}))}))]}))}))}function Xa(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(h.A_QUIT_CHATROOM_T,h.A_QUIT_CHATROOM_R).validate("targetId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(h.A_QUIT_CHATROOM_T,JSON.stringify({chatroomId:e}),t),[4,n.quitChatroom(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](h.A_QUIT_CHATROOM_R,JSON.stringify({code:o}),t),o!==r.SUCCESS?[2,{code:o,msg:Qr[o]}]:[2,{code:o}]}}))}))}))]}))}))}function Za(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_QUIT_CHATROOM_T,h.A_QUIT_CHATROOM_R).validate("targetId",e,v.STRING,!0).validate("count",null==t?void 0:t.count,v.NUMBER).validate("order",null==t?void 0:t.order,(function(e){return[0,1,2].includes(e)})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(nt,JSON.stringify({chatroomId:e,count:null==t?void 0:t.count,order:null==t?void 0:t.order}),n),[4,i.getChatroomInfo(e,null==t?void 0:t.count,null==t?void 0:t.order)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](it,JSON.stringify({code:s}),n),s===r.SUCCESS&&c?[2,{code:s,data:c}]:[2,{code:s,msg:Qr[s]}]}}))}))}))]}))}))}function $a(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ot,rt).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("value",null==t?void 0:t.value,v.STRING,!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ot,JSON.stringify({chatroomId:e,key:t.key,value:t.value,isSendNotification:t.isSendNotification,isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra}),n),[4,i.setChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](rt,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function es(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(at,st).validate("targetId",e,v.STRING,!0).validate("entries",null==t?void 0:t.entries,(function(e){return!!_("entry.key",e,v.ARRAY,!0)&&t.entries.every((function(e){return _("entry.key",e.key,v.STRING,!0)&&_("entry.value",e.value,v.STRING,!0)}))}),!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isForce",null==t?void 0:t.isForce,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t.entries.length>10?[2,jr.CHATROOM_KV_STORE_OUT_LIMIT]:(n=o.createTraceId(),o.info(at,JSON.stringify({chatroomId:e,entries:t.entries.map((function(e){return{key:e.key,value:e.value}})),isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra,isForce:t.isForce}),n),[4,i.setChatroomEntries(e,t)]);case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](st,JSON.stringify({code:s}),n),s!==r.SUCCESS?[2,{code:s,msg:Qr[s],data:c}]:[2,{code:s}]}}))}))}))]}))}))}function ts(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ct,dt).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("value",null==t?void 0:t.value,v.STRING,!0).validate("isAutoDelete",null==t?void 0:t.isAutoDelete,v.BOOLEAN).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ct,JSON.stringify({chatroomId:e,key:t.key,value:t.value,isSendNotification:t.isSendNotification,isAutoDelete:t.isAutoDelete,notificationExtra:t.notificationExtra}),n),[4,i.forceSetChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](dt,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function ns(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ut,lt).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ut,JSON.stringify({chatroomId:e,key:t.key,isSendNotification:t.isSendNotification,notificationExtra:t.notificationExtra}),n),[4,i.removeChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](lt,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function is(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(vt,ft).validate("targetId",e,v.STRING,!0).validate("entries",null==t?void 0:t.entries,(function(e){return!!_("entry.key",e,v.ARRAY,!0)&&t.entries.every((function(e){return _("key",e,v.STRING,!0)}))}),!0).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=t.entries.map((function(e){return{key:e}})),a=o.createTraceId(),o.info(vt,JSON.stringify({chatroomId:e,notificationExtra:t.notificationExtra,entries:n}),a),[4,i.removeChatroomEntries(e,{entries:n,notificationExtra:t.notificationExtra})];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",o[u](ft,JSON.stringify({code:c}),a),c!==r.SUCCESS?[2,{code:c,msg:Qr[c],data:d}]:[2,{code:c}]}}))}))}))]}))}))}function os(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(gt,St).validate("targetId",e,v.STRING,!0).validate("key",null==t?void 0:t.key,v.STRING,!0).validate("isSendNotification",null==t?void 0:t.isSendNotification,v.BOOLEAN).validate("notificationExtra",null==t?void 0:t.notificationExtra,C({maxLength:O})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(gt,JSON.stringify({chatroomId:e,key:t.key,isSendNotification:t.isSendNotification,notificationExtra:t.notificationExtra}),n),[4,i.forceRemoveChatroomEntry(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](St,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:a}]}}))}))}))]}))}))}function rs(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ht,Tt).validate("targetId",e,v.STRING,!0).validate("key",t,(function(e){return R(e)&&/[\w+=-]+/.test(e)&&e.length<=128}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(ht,JSON.stringify({chatroomId:e,key:t}),n),[4,i.getChatroomEntry(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(o.info(Tt,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Tt,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function as(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(It,_t).validate("targetId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(It,JSON.stringify({chatroomId:e}),t),[4,n.getAllChatroomEntries(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(i.info(_t,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(_t,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]}))}))}function ss(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(mt,pt).validate("targetId",e,v.STRING,!0).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(mt,JSON.stringify({chatroomId:e,timestamp:t.timestamp,count:t.count,order:t.order}),n),[4,i.getChatRoomHistoryMessages(e,t.count,t.order,t.timestamp)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),Fe(e)})),o.info(pt,JSON.stringify({code:s,data:d}),n),[2,{code:s,data:{list:u,hasMore:!!c.hasMore}}]):(o.warn(pt,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function cs(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Nt,Et).validate("targetId",null==e?void 0:e.chatRoomId,v.STRING,!0).validate("rtcRoomId",null==e?void 0:e.rtcRoomId,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(Nt,JSON.stringify({chatRoomId:e.chatRoomId,rtcRoomId:e.rtcRoomId}),t),[4,n.bindRTCRoomForChatroom(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](Et,JSON.stringify({code:o}),t),[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function ds(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(ze,We).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(ze,JSON.stringify({userId:e}),t),[4,n.addToBlacklist(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](We,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]}))}))}function us(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(je,Qe).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(je,JSON.stringify({userId:e}),t),[4,n.removeFromBlacklist(e)];case 1:return o=s.sent(),a=o===r.SUCCESS?"info":"warn",i[a](Qe,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]}))}))}function ls(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I(Xe,Ze).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a;return $(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(Xe,"getBlacklist -> ",e),[4,t.getBlacklist()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS&&a?(n.info(Ze,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):(n.warn(Ze,JSON.stringify({code:o}),e),[2,{code:o}])}}))}))}))]}))}))}function vs(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I($e,et).validate("userId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info($e,JSON.stringify({userId:e}),t),[4,n.getBlacklistStatus(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(et,JSON.stringify({code:a,data:0===s}),t),[2,{code:a,data:0===s}]):(i.warn(et,JSON.stringify({code:a}),t),[2,{code:a}])}}))}))}))]}))}))}var fs=function(e,t,n,i){void 0===n&&(n=!0),void 0===i&&(i=!0),this.messageType=e,this.content=t,this.isPersited=n,this.isCounted=i};function gs(e,t,n){void 0===t&&(t=!0),void 0===n&&(n=!0);return function(i){return new fs(e,i,t,n)}}var Ss,hs=gs("RC:ImgMsg"),Ts=gs("RC:HQVCMsg"),Is=gs("RC:SightMsg"),_s=gs("RC:TxtMsg"),ms=gs("RC:CombineMsg"),ps=gs(A.COMBINE_V2),Ns=gs("RC:FileMsg"),Es=gs("RC:GIFMsg"),ys=gs("RC:VcMsg"),Rs=gs("RC:LBSMsg"),Cs=gs("RC:ReferenceMsg"),Os=gs("RC:ImgTextMsg"),As=gs("RC:CmdMsg"),Us=gs("RC:InfoNtf"),ws=gs("RC:GrpNtf");!function(e){e.ALIYUN="aliyun",e.S3="s3",e.STC="stc",e.MINIO="minio",e.QINIU="qiniu",e.BAIDU="baidu",e.RCX="rcx"}(Ss||(Ss={}));var Ps,Ms=function(){function e(e,t,n){this.isSupportMultipart=!1,this._serverType=0,this._isAbort=!1,this._url=e,this._getFileToken=t,this._serverType=n}return e.prototype.isAbort=function(){return this._isAbort},e.prototype.abort=function(){this._isAbort=!0,this._abortHandler()},e.prototype.upload=function(e){return e.file.size>U?Promise.resolve({code:r.UPLOAD_FAIL,msg:"the file size is over 5GB!"}):e.file.size>w&&this.isSupportMultipart?this.multipartUpload(e):this.commonUpload(e)},e}(),bs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),this._promise=e({url:M(this._url),headers:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.QINIU}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype.multipartUpload=function(e){return Z(this,void 0,void 0,(function(){return $(this,(function(e){throw new Error("Method not implemented.")}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms),Ls=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=M(a.ossBucketName+"."+this._url),(c=new FormData).set("token",a.token),c.set("OSSAccessKeyId",a.osskeyId),c.set("policy",a.ossPolicy),c.set("Signature",a.ossSign),c.set("success_action_status","200"),c.set("key",a.fileName),c.set("file",n),this._promise=e({url:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.ALI}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n}(Ms),Gs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,a=t.contentDisposition,v.label=1;case 1:return v.trys.push([1,3,,4]),[4,this._getFileToken(o<=b.FILE?o:b.FILE)];case 2:return s=v.sent(),[3,4];case 3:return[2,{code:v.sent()}];case 4:return c=a||("text/html"===n.type?"inline":"attachment"),d={authorization:s.bosToken,"x-bce-date":s.bosDate,"Content-Disposition":c+"; filename="+encodeURIComponent(n.name)+";"},u=M(""+this._url+s.path),this._promise=e({url:u,headers:d,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:n,timeout:0}),[4,this._promise.result()];case 5:return l=v.sent().status,this._promise=null,200===l||204===l?[2,{code:r.SUCCESS,data:{uniqueName:s.fileName,downloadUrl:u}}]:[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms),Js=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=M(this._url+"/"+a.minioBucketName+"/"+a.fileName),c=this.getBaseHeaders(n,a,t),this._promise=e({url:s,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:d.toString()}]}}))}))},n.prototype.multipartUpload=function(t){var n;return Z(this,void 0,void 0,(function(){var i,o,a,s,c,d,u,l,v,f,g,S,h,T,I,_;return $(this,(function(m){switch(m.label){case 0:i=t.file,o=t.fileType,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,this._getFileToken(o,i.name,"POST","uploads")];case 2:return a=m.sent(),[3,4];case 3:return[2,{code:m.sent()}];case 4:return s=M(this._url+"/"+a.minioBucketName+"/"+a.fileName),c=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploads",headers:c,method:"POST"}),[4,this._promise.result()];case 5:return d=m.sent(),u=d.status,l=d.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!v?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,i,v,a.fileName,t,f)]);case 6:if(g=m.sent(),S=g.code,h=g.msg,S!==r.SUCCESS)return[2,{code:S,msg:h}];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=m.sent(),[3,10];case 9:return[2,{code:m.sent()}];case 10:return T=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),T="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+T+"</CompleteMultipartUpload>",I=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploadId="+v,headers:I,method:"POST",body:T,timeout:0}),[4,this._promise.result()];case 11:return _=m.sent().status,this._promise=null,200===_||204===_?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.MINIO}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,i,o,a,s,c,d){return void 0===c&&(c=1),void 0===d&&(d=0),Z(this,void 0,void 0,(function(){var u,l,v,f,g,S,h,T,I;return $(this,(function(_){switch(_.label){case 0:if(d>=5)return[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];u=(c-1)*w,l=Math.min(w,n.size-u),v="partNumber="+c+"&uploadId="+i,_.label=1;case 1:return _.trys.push([1,3,,4]),[4,this._getFileToken(a.fileType,o,"PUT",v)];case 2:return f=_.sent(),[3,4];case 3:return[2,{code:_.sent()}];case 4:return g=n.slice(u,c*w),S=this.getBaseHeaders(n,f,a),this._promise=e({url:t+"?"+v,headers:S,method:"PUT",body:g,timeout:0,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,u+e.loaded,n.size)}}),[4,this._promise.result()];case 5:return h=_.sent(),T=h.status,I=h.xhr,this._promise=null,200===T||204===T?(s.push((null==I?void 0:I.getResponseHeader("ETag"))||""),u+l<n.size?[2,this.requestUploadPart(t,n,i,o,a,s,c+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(t,n,i,o,a,s,c,d+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":e.type||"text/plain"}},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms),Ds=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e.isSupportMultipart=!0,e._promise=null,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l,v,f;return $(this,(function(g){switch(g.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,g.label=1;case 1:return g.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return a=g.sent(),[3,4];case 3:return[2,{code:g.sent()}];case 4:return s={},(c=new FormData).set("token",a.token),c.set("key",a.fileName),c.set("file",n),d=M(this._url),this._promise=e({url:d,headers:s,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 5:return u=g.sent(),l=u.status,v=u.data,this._promise=null,200!==l&&204!==l||!v?[2,{code:r.UPLOAD_FAIL,msg:l.toString()}]:(f=JSON.parse(v),[2,{code:r.SUCCESS,data:{uniqueName:f.rc_url.file_name,downloadUrl:d+"/"+f.rc_url.path}}])}}))}))},n.prototype.multipartUpload=function(e){return Z(this,void 0,void 0,(function(){var t,n,i,o,r;return $(this,(function(a){switch(a.label){case 0:t=e.file,n=e.onProgress,i=e.fileType,o=L(),a.label=1;case 1:return a.trys.push([1,3,,4]),[4,this._getFileToken(i,t.name)];case 2:return r=a.sent(),[3,4];case 3:return[2,{code:a.sent()}];case 4:return[2,this._requestUploadPart(o,t,r.token,n)]}}))}))},n.prototype._requestUploadPart=function(t,n,i,o,a){return void 0===a&&(a=0),Z(this,void 0,void 0,(function(){var s,c,d,u,l,v,f,g,S,h;return $(this,(function(T){switch(T.label){case 0:return s=Math.min(w,n.size-a),c=t+n.name.substring(n.name.lastIndexOf(".")),d={Range:"bytes="+a+"-"+(a+s),"X-File-TransactionId":c,"X-File-Total-Size":n.size.toString()},u=n.slice(a,a+s),(l=new FormData).set("file",u,n.name),l.set("key",c),l.set("name",c),l.set("token",i),v=M(this._url),this._promise=e({url:v,headers:d,onProgress:function(e){return null==o?void 0:o(a+e.loaded,n.size)},method:"POST",body:l,timeout:0}),[4,this._promise.result()];case 1:return f=T.sent(),g=f.status,S=f.data,this._promise=null,200===g||204===g?a+s<n.size?[2,this._requestUploadPart(t,n,i,o,a+s)]:(h=JSON.parse(S),[2,{code:r.SUCCESS,data:{uniqueName:h.rc_url.file_name,downloadUrl:v+"/"+h.rc_url.path}}]):[2,{code:r.UPLOAD_FAIL,msg:g.toString()}]}}))}))},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms),Bs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d,u,l,v;return $(this,(function(f){switch(f.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,a=t.contentDisposition,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,this._getFileToken(o,n.name)];case 2:return s=f.sent(),[3,4];case 3:return[2,{code:f.sent()}];case 4:return c={},d=M(s.s3BucketName+"."+this._url),u=new FormData,a?u.set("Content-Disposition",a):u.set("Content-Disposition","text/html"===n.type?"inline;":"attachment;"),u.set("Content-Type",n.type),u.set("x-amz-credential",s.s3Credential),u.set("x-amz-algorithm",s.s3Algorithm),u.set("x-amz-date",s.s3Date),u.set("policy",s.s3Policy),u.set("x-amz-signature",s.s3Signature),u.set("key",s.fileName),u.set("file",n),this._promise=e({url:d,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"POST",body:u,timeout:0}),[4,this._promise.result()];case 5:return l=f.sent(),v=l.status,this._promise=null,200===v||204===v?[2,{code:r.SUCCESS,data:{uniqueName:s.fileName,uploadMethod:P.AWS}}]:[2,{code:r.UPLOAD_FAIL,msg:v.toString()}]}}))}))},n.prototype.multipartUpload=function(e){throw new Error("Method not implemented.")},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms),xs=function(t){function n(){var e=null!==t&&t.apply(this,arguments)||this;return e._promise=null,e.isSupportMultipart=!0,e}return Q(n,t),n.prototype.commonUpload=function(t){return Z(this,void 0,void 0,(function(){var n,i,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:n=t.file,i=t.onProgress,o=t.fileType,u.label=1;case 1:return u.trys.push([1,3,,4]),[4,this._getFileToken(o)];case 2:return a=u.sent(),[3,4];case 3:return[2,{code:u.sent()}];case 4:return s=M(this._url+"/"+a.stcBucketName+"/"+a.fileName),c=this.getBaseHeaders(n,a,t),this._promise=e({url:s,headers:c,onProgress:function(e){return null==i?void 0:i(e.loaded,e.total)},method:"PUT",body:n,timeout:0}),[4,this._promise.result()];case 5:return d=u.sent().status,this._promise=null,200===d||204===d?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.STC}}]:[2,{code:r.UPLOAD_FAIL}]}}))}))},n.prototype.multipartUpload=function(t){var n;return Z(this,void 0,void 0,(function(){var i,o,a,s,c,d,u,l,v,f,g,S,h,T,I,_;return $(this,(function(m){switch(m.label){case 0:i=t.file,o=t.fileType,m.label=1;case 1:return m.trys.push([1,3,,4]),[4,this._getFileToken(o,i.name,"POST","uploads")];case 2:return a=m.sent(),[3,4];case 3:return[2,{code:m.sent()}];case 4:return s=M(this._url+"/"+a.stcBucketName+"/"+a.fileName),c=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploads",headers:c,method:"POST"}),[4,this._promise.result()];case 5:return d=m.sent(),u=d.status,l=d.data,this._promise=null,v=null===(n=null==l?void 0:l.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===n?void 0:n[1],200!==u&&204!==u||!v?[2,{code:r.UPLOAD_FAIL,msg:"start upload fail"}]:(f=[],[4,this.requestUploadPart(s,i,v,a.fileName,t,f)]);case 6:if(g=m.sent(),S=g.code,h=g.msg,S!==r.SUCCESS)return[2,{code:S,msg:h}];m.label=7;case 7:return m.trys.push([7,9,,10]),[4,this._getFileToken(o,a.fileName,"POST","uploadId="+v)];case 8:return a=m.sent(),[3,10];case 9:return[2,{code:m.sent()}];case 10:return T=f.map((function(e,t){return"<Part><PartNumber>"+(t+1)+"</PartNumber><ETag>"+e+"</ETag></Part>"})).join(""),T="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>"+T+"</CompleteMultipartUpload>",I=this.getBaseHeaders(i,a,t),this._promise=e({url:s+"?uploadId="+v,headers:I,method:"POST",body:T}),[4,this._promise.result()];case 11:return _=m.sent().status,this._promise=null,200===_||204===_?[2,{code:r.SUCCESS,data:{uniqueName:a.fileName,uploadMethod:P.STC}}]:[2,{code:r.UPLOAD_FAIL,msg:"end upload fail"}]}}))}))},n.prototype.requestUploadPart=function(t,n,i,o,a,s,c,d){return void 0===c&&(c=1),void 0===d&&(d=0),Z(this,void 0,void 0,(function(){var u,l,v,f,g,S,h,T,I;return $(this,(function(_){switch(_.label){case 0:if(d>=5)return[2,{code:r.UPLOAD_FAIL,msg:"Upload retry times exceeded 5. Procedure"}];u=(c-1)*w,l=Math.min(w,n.size-u),v="partNumber="+c+"&uploadId="+i,_.label=1;case 1:return _.trys.push([1,3,,4]),[4,this._getFileToken(a.fileType,o,"PUT",v)];case 2:return f=_.sent(),[3,4];case 3:return[2,{code:_.sent()}];case 4:return g=n.slice(u,c*w),S=this.getBaseHeaders(n,f,a),this._promise=e({url:t+"?"+v,headers:S,method:"PUT",body:g,onProgress:function(e){var t;return null===(t=null==a?void 0:a.onProgress)||void 0===t?void 0:t.call(a,u+e.loaded,n.size)},timeout:0}),[4,this._promise.result()];case 5:return h=_.sent(),T=h.status,I=h.xhr,this._promise=null,200===T||204===T?(s.push((null==I?void 0:I.getResponseHeader("ETag"))||""),u+l<n.size?[2,this.requestUploadPart(t,n,i,o,a,s,c+1,0)]:[2,{code:r.SUCCESS}]):[2,this.requestUploadPart(t,n,i,o,a,s,c,d+1)]}}))}))},n.prototype.getBaseHeaders=function(e,t,n){return{"Content-Disposition":(n.contentDisposition||("text/html"===e.type?"inline":"attachment"))+"; filename="+encodeURIComponent(e.name)+";",Authorization:t.stcAuthorization,"x-amz-content-sha256":t.stcContentSha256,"x-amz-date":t.stcDate,"Content-Type":e.type||"text/plain"}},n.prototype._abortHandler=function(){var e;null===(e=this._promise)||void 0===e||e.abort()},n}(Ms);var ks=((Ps={})[Ss.QINIU]=bs,Ps[Ss.ALIYUN]=Ls,Ps[Ss.BAIDU]=Gs,Ps[Ss.S3]=Bs,Ps[Ss.STC]=xs,Ps[Ss.MINIO]=Js,Ps[Ss.RCX]=Ds,Ps);function Vs(e,t,n,i){var o=document.createElement("canvas"),a=o.getContext("2d"),s=new Image;s.onload=function(t){var c=i||{},d=c.maxHeight,u=void 0===d?160:d,l=c.maxWidth,v=void 0===l?160:l,f=c.quality,g=void 0===f?.7:f,S=c.scale,h=void 0===S?1:S,T=Fs(s.width,s.height,{maxHeight:u,maxWidth:v,scale:h});o.width=Math.min(T.w,v),o.height=Math.min(T.h,u),a.drawImage(s,T.x,T.y,T.w,T.h);var I=Hs(o,g);I=I.replace(/data:image\/[^;]+;base64,/,""),e({code:r.SUCCESS,data:X(X({},n),{thumbnail:I,width:T.w,height:T.h})})},s.onerror=function(t){e({code:r.UPLOAD_FAIL,msg:"get image info fail:"+JSON.stringify(t)})},s.src=(window.URL||window.webkitURL).createObjectURL(t)}function Hs(e,t){var n=e.toDataURL("image/jpeg",t);return n.length>G-10240?Hs(e,t-.1):n}var Fs=function(e,t,n){var i,o,r=n.maxHeight,a=void 0===r?160:r,s=n.maxWidth,c=void 0===s?160:s,d=n.scale,u=e<t,l=0,v=0;return(u?t/e:e/t)>(void 0===d?1:d)?(u?(i=100,v=((o=t/(e/100))-a)/2):(o=100,l=((i=e/(t/100))-c)/2),{w:i,h:o,x:-l,y:-v}):(u?(o=a,i=e/(t/a)):(i=c,o=t/(e/c)),{w:i,h:o,x:-l,y:-v})},Ys=0,qs=function(){function e(e,t){this._client=null,this.id=++Ys,this._promise=this._handleUpload(e,t)}return e.prototype.abort=function(){var e;this._resolve({code:r.UPLOAD_FAIL,msg:"upload abort"}),null===(e=this._client)||void 0===e||e.abort()},e.prototype._uploadInLoop=function(e,t,n,i,o){return void 0===o&&(o=[]),Z(this,void 0,void 0,(function(){var a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:a=0,v.label=1;case 1:return a<e.length?(s=e[a],this._client=new ks[s.type](s.url,n,i),[4,this._client.upload(t)]):[3,4];case 2:if(c=v.sent(),d=c.code,u=c.data,l=c.msg,d===r.SUCCESS)return[2,{code:d,data:u}];if(this._client.isAbort())return this._client=null,[2,{code:d,data:u,msg:l}];this._client=null,o.push({type:s.type,url:s.url,code:d,msg:l}),v.label=3;case 3:return a++,[3,1];case 4:return[2,{code:r.UPLOAD_FAIL,msg:"Failed to upload all channels, msg: "+JSON.stringify(o)}]}}))}))},e.prototype._handleUpload=function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new Promise((function(i){return Z(n,void 0,void 0,(function(){var n,o,a,s,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N;return $(this,(function(E){switch(E.label){case 0:return this._resolve=i,n=t.getFileToken,o=t.serverType,a=t.customDomain,s=t.ossConfig,c=t.uploadServer,d=t.bosAddr,u=e.file,l=e.fileType,v=e.thumbnailConfig,f=function(e,t,n,i,o){if(n)return[{type:Ss.RCX,url:n,p:"1"}];if(e)return JSON.parse(e).map((function(e){var t={type:Ss.QINIU,url:"",p:""};return Object.keys(e).forEach((function(n){"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort((function(e,t){return e.p-t.p}));var r=[];return i&&r.push({type:Ss.QINIU,url:i,p:"1"}),o&&r.push({type:Ss.BAIDU,url:o,p:"2"}),r}(s,0,a,c,d),0===f.length?(i({code:r.INVALID_PARAMETER_MEDIA_URL,msg:"uploadUrlList is empty"}),[2]):[4,this._uploadInLoop(f,e,n,o)];case 1:if(g=E.sent(),S=g.code,h=g.data,T=g.msg,S!==r.SUCCESS||!h)return i({code:S,msg:T}),[2];if(I=h.downloadUrl)return[3,5];E.label=2;case 2:return E.trys.push([2,4,,5]),[4,t.getFileUrl(l,h.uniqueName,u.name,void 0,h.uploadMethod)];case 3:return _=E.sent(),I=_.downloadUrl,[3,5];case 4:return m=E.sent(),i({code:m,msg:"Get download url fail"}),[3,5];case 5:return I?(p={downloadUrl:I,uniqueName:(null==h?void 0:h.uniqueName)||"",name:u.name,size:u.size,type:u.type},l!==b.AUDIO?[3,7]:[4,u.arrayBuffer()]):(i({code:r.UPLOAD_FAIL,msg:"Get download url fail"}),[2]);case 6:return N=E.sent(),function(e,t,n){(new AudioContext).decodeAudioData(t,(function(t){e({code:r.SUCCESS,data:X(X({},n),{duration:t.duration,length:t.length})})}),(function(t){e({code:r.UPLOAD_FAIL,msg:"get audio info fail:"+JSON.stringify(t)})}))}(i,N,p),[2];case 7:return l===b.IMAGE?(Vs(i,u,p,v),[2]):(i({code:S,data:p}),[2])}}))}))}))]}))}))},e.prototype.awaitResult=function(){return Z(this,void 0,void 0,(function(){return $(this,(function(e){return[2,this._promise]}))}))},e}(),Ks={};function zs(e,t){var n=new qs(e,t);return function(e){Z(this,void 0,void 0,(function(){return $(this,(function(t){switch(t.label){case 0:return Ks[e.id]=e,[4,e.awaitResult()];case 1:return t.sent(),delete Ks[e.id],[2]}}))}))}(n),n}function Ws(e){var t=Ks[e];return!!t&&(t.abort(),!0)}var js=function(e,t){var n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t.uploadDomain||"",serverType:null==n?void 0:n.type,ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer,bosAddr:null==n?void 0:n.bosAddr}};function Qs(e){return Z(this,void 0,void 0,(function(){var t,n,i;return $(this,(function(o){return t=e.contentDisposition,n=e.fileType,i=e.file,[2,new I("","").validate("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",n,(function(e){return!!b[e]}),!0).validate("file",i,(function(e){return e instanceof File&&(!(n===b.IMAGE&&!e.type.match(/^image\//))&&!(n===b.AUDIO&&!e.type.match(/^audio\//)))}),!0).ifReadySync((function(t,n,i){var o=zs(e,js(t,i));return{code:r.SUCCESS,data:o}}))]}))}))}function Xs(e){return Z(this,void 0,void 0,(function(){return $(this,(function(t){return[2,{code:r.SUCCESS,data:Ws(e)}]}))}))}function Zs(e){return Z(this,void 0,void 0,(function(){var t,n,i;return $(this,(function(o){return t=e.contentDisposition,n=e.fileType,i=e.file,[2,new I("","").validate("contentDisposition",t,(function(e){return"inline"===e||"attachment"===e}),!1).validate("fileType",n,(function(e){return!!b[e]}),!0).validate("file",i,(function(e){return e instanceof File&&(!(n===b.IMAGE&&!e.type.match(/^image\//))&&!(n===b.AUDIO&&!e.type.match(/^audio\//)))}),!0).ifReady((function(t,n,i){return function(e,t){return Z(this,void 0,void 0,(function(){return $(this,(function(n){return[2,new qs(e,t).awaitResult()]}))}))}(e,js(t,i))}))]}))}))}function $s(e,t,n,i){return Gr((function(o){return new Promise((function(a){o.getFileToken(e,t,n,i).then((function(e){a({code:r.SUCCESS,data:e})})).catch((function(e){a({code:e,msg:Qr[e]})}))}))}))}function ec(e){return new I("","").validate("mediaUrl",e,v.STRING,!0).ifReady((function(t){return new Promise((function(n){t.getFileToken(1,void 0,void 0,void 0,e).then((function(e){var t=e.token,i=e.downloadAuthInfo,o=e.deadline;n({code:r.SUCCESS,data:{token:t,downloadAuthInfo:i,deadline:o}})})).catch((function(e){n({code:e,msg:Qr[e]})}))}))}))}function tc(e,t,n,i,o){return new I("","").validate("fileType",e,J,!0).validate("filename",t,v.STRING).validate("saveName",n,v.STRING).validate("serverType",o,v.NUMBER).ifReady((function(a){return new Promise((function(s){a.getFileUrl(e,t,n,i,o).then((function(e){s({code:r.SUCCESS,data:e})})).catch((function(e){s({code:e})}))}))}))}function nc(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("message",t,(function(){return t instanceof fs}),!0).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("isStatusMessage",null==n?void 0:n.isStatusMessage,v.BOOLEAN).validate("disableNotification",null==n?void 0:n.disableNotification,v.BOOLEAN).validate("pushContent",null==n?void 0:n.pushContent,v.STRING).validate("pushData",null==n?void 0:n.pushData,v.STRING).validate("isMentioned",null==n?void 0:n.isMentioned,v.BOOLEAN).validate("mentionedType",null==n?void 0:n.mentionedType,v.NUMBER).validate("mentionedUserIdList",null==n?void 0:n.mentionedUserIdList,B({itemValidator:x})).validate("directionalUserIdList",null==n?void 0:n.directionalUserIdList,B({maxLength:300,itemValidator:x})).validate("isVoipPush",null==n?void 0:n.isVoipPush,v.BOOLEAN).validate("canIncludeExpansion",null==n?void 0:n.canIncludeExpansion,v.BOOLEAN).validate("expansion",null==n?void 0:n.expansion,v.OBJECT).validate("pushConfig",null==n?void 0:n.pushConfig,v.OBJECT).validate("messageId",null==n?void 0:n.messageId,v.NUMBER).ifReady((function(o,c){return Z(i,void 0,void 0,(function(){var i,d,u,l,v,f,g,S,T,I,_,m,p,N,E,y,R,C,O,A,U;return $(this,(function(w){switch(w.label){case 0:return d=(i=n||{}).disableNotification,u=i.isMentioned,l=i.directionalUserIdList,v=i.canIncludeExpansion,f=i.onSendBefore,g=i.expansion,S=i.pushConfig,T=i.isStatusMessage,I=c.createTraceId(),_=e.conversationType,m=e.targetId,p=e.channelId,l&&l.length>0&&![3,10].includes(_)?[2,{code:r.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE}]:(N=function(e,t,n){var i=e.isStatusMessage,o=e.disableNotification,r=e.pushContent,a=e.pushData,s=e.isMentioned,c=e.mentionedType,d=e.mentionedUserIdList,u=e.directionalUserIdList,l=e.isVoipPush,v=e.canIncludeExpansion,f=e.expansion,g=e.isFilerWhiteBlacklist,S=e.pushConfig,h=e.messageId,T=n.channelId;return X({isStatusMessage:i,disableNotification:o,pushContent:r,pushData:a,isMentioned:s,mentionedType:c,mentionedUserIdList:d,directionalUserIdList:u,isVoipPush:l,canIncludeExpansion:v,expansion:f,isFilerWhiteBlacklist:g,pushConfig:S,channelId:T||"",messageId:h},t)}(n||{},t,e),E={isMentioned:!!u,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!d,canIncludeExpansion:!!v,expansion:g||null,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId,senderUserId:o.getCurrentUserId(),messageUId:"",messageDirection:k.SEND,receivedTime:0,isStatusMessage:!!T,receivedStatus:a.UNREAD,isOffLineMessage:!1,pushConfig:S,sentStatus:V.SENDING,sentTime:0,directedUserIds:l||[]},_!==s.ULTRA_GROUP&&(E.isOffLineMessage=!1),y=function(e){E.messageId=e;try{f&&f(Fe(E))}catch(e){c.error(h.A_SEND_MSG_T,'Callback method "onSendBefore" execution error.\n'+(null==e?void 0:e.stack),I)}},c.info(h.A_SEND_MSG_T,JSON.stringify({messageType:t.messageType,conversationType:_,targetId:m,channelId:p}),I),[4,o.sendMessage(_,m,N,y,I)]);case 1:return R=w.sent(),C=R.code,O=R.data,A=R.msg,C===r.SUCCESS?(c.info(h.A_SEND_MSG_R,JSON.stringify({code:C,messageUId:O.messageUId,messageId:O.messageId}),I),U=Fe(O),[2,{code:C,data:U}]):(c.warn(h.A_SEND_MSG_R,JSON.stringify({code:C}),I),E.sentTime=(null==O?void 0:O.sentTime)||0,E.sentStatus=null==O?void 0:O.sentStatus,[2,{code:C,msg:A||Qr[C],data:Fe(E)}])}}))}))}))]}))}))}function ic(e,t,n){return nc(e,new _s(t),n)}function oc(e,t){return function(n,i,o,a){var s;if(!_("sendOptions.contentDisposition",null==a?void 0:a.contentDisposition,(function(e){return["inline","attachment"].includes(e)})))return Promise.resolve({code:r.INVALID_PARAMETER_SENDOPTIONS});var c={contentDisposition:null==a?void 0:a.contentDisposition};if(a&&"thumbnailConfig"in a){var d=null===(s=a)||void 0===s?void 0:s.thumbnailConfig;if(!(_("sendOptions.maxHeight",null==d?void 0:d.maxHeight,v.NUMBER)&&_("sendOptions.maxWidth",null==d?void 0:d.maxWidth,v.NUMBER)&&_("sendOptions.quality",null==d?void 0:d.quality,v.NUMBER)&&_("sendOptions.scale",null==d?void 0:d.scale,v.NUMBER)))return Promise.resolve({code:r.INVALID_PARAMETER_SENDOPTIONS});c.thumbnailConfig=d}return Gr((function(s,d,u){return new Promise((function(s){var u=d.createTraceId();d.info(h.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:e}),u),Zs({file:i.file,fileType:e,onProgress:function(e,t){var n;null===(n=null==o?void 0:o.onProgress)||void 0===n||n.call(o,Math.floor(e/t*100))},contentDisposition:c.contentDisposition,thumbnailConfig:c.thumbnailConfig}).then((function(e){var c,l=e.code,v=e.data,f=e.msg;if(l===r.SUCCESS&&v){var g=(null===(c=null==o?void 0:o.onComplete)||void 0===c?void 0:c.call(o,X({url:v.downloadUrl},v)))||t(v,i);return d.info(h.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:v.downloadUrl,code:r.SUCCESS}),u),void nc(n,g,a).then(s)}s({code:l,msg:f})}))}))}))}}var rc=oc(b.FILE,(function(e,t){var n,i,o={name:e.name,size:t.file.size,type:(n=e.name,i=n.match(/\.(\w+)$/),i?i[1]:"bin"),fileUrl:e.downloadUrl};return t.user&&(o.user=t.user),t.extra&&(o.extra=t.extra),t.mentionedInfo&&(o.mentionedInfo=t.mentionedInfo),new Ns(o)})),ac=oc(b.IMAGE,(function(e,t){var n={content:e.thumbnail,imageUri:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new hs(n)})),sc=oc(b.IMAGE,(function(e,t){var n={gifDataSize:e.size,remoteUrl:e.downloadUrl,width:e.width,height:e.height};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new Es(n)})),cc=oc(b.AUDIO,(function(e,t){var n={remoteUrl:e.downloadUrl,duration:e.duration,type:e.type};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new Ts(n)})),dc=oc(b.SIGHT,(function(e,t){var n={sightUrl:e.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||e.size,name:t.name||e.name};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),t.audit&&(n.audit=t.audit),new Is(n)}));function uc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_GET_HISTORY_MSG_T,h.A_GET_HISTORY_MSG_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){if(D())return!0;var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(h.A_GET_HISTORY_MSG_T,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count}),n),[4,i.getHistoryMessage(e.conversationType,e.targetId,null==t?void 0:t.timestamp,null==t?void 0:t.count,null==t?void 0:t.order,null==e?void 0:e.channelId,"",n)];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),Fe(e)})),o.info(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:d}),n),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(o.warn(h.A_GET_HISTORY_MSG_R,JSON.stringify({code:s,messageUIds:""}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function lc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Si,hi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){return e>0&&e<=100})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=o.createTraceId(),o.info(Si,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:null==t?void 0:t.timestamp,count:null==t?void 0:t.count,order:null==t?void 0:t.order}),n),[4,i.getRemoteHistoryMessages(e.conversationType,e.targetId,(null==t?void 0:t.timestamp)||0,(null==t?void 0:t.count)||20,(null==t?void 0:t.order)||0,e.channelId||"")];case 1:return a=l.sent(),s=a.code,c=a.data,s===r.SUCCESS&&c?(d=[],u=c.list.map((function(e){return d.push(e.messageUId),Fe(e)})),o.info(hi,JSON.stringify({code:s,messageUIds:d})),[2,{code:s,data:{list:u,hasMore:c.hasMore}}]):(o.warn(hi,JSON.stringify({code:s})),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function vc(e,t,n,i){return Z(this,void 0,void 0,(function(){var o=this;return $(this,(function(r){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).validate("timestamp",n,v.NUMBER,!0).validate("channelId",i,v.CHANNEL_ID).ifReady((function(r){return Z(o,void 0,void 0,(function(){var o,r,a,c,d;return $(this,(function(u){switch(u.label){case 0:return o={targetId:e,conversationType:s.PRIVATE,channelId:i},r=new fs("RC:ReadNtf",{messageUId:t,lastMessageSendTime:n,type:1}),[4,nc(o,r)];case 1:return a=u.sent(),c=a.code,d=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:d}]}}))}))}))]}))}))}function fc(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,r){return Z(i,void 0,void 0,(function(){var i,o,a,c,d;return $(this,(function(u){switch(u.label){case 0:return i="messageUId:"+t+",targetId:"+e,r.debug(h.A_SEND_MSG_T,"send read receipt message ->"+i),o=new fs("RC:RRReqMsg",{messageUId:t}),[4,nc({targetId:e,conversationType:s.GROUP,channelId:n},o)];case 1:return a=u.sent(),c=a.code,d=a.msg,0===c?[2,{code:c}]:[2,{code:c,msg:d}]}}))}))}))]}))}))}function gc(e,t,n){return Z(this,void 0,void 0,(function(){return $(this,(function(e){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}oc(b.COMBINE_HTML,(function(e,t){var n={remoteUrl:e.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new ms(n)}));var Sc=function(e,t,n,i){return Z(void 0,void 0,void 0,(function(){var o,a;return $(this,(function(s){switch(s.label){case 0:return!_("messageList",i,v.OBJECT,!0)||Object.keys(i).some((function(e){return!_(e,i[e],v.ARRAY)}))?[2,Promise.resolve({code:r.MSG_LIMIT_ERROR})]:(o=[],Object.keys(i).forEach((function(e){i[e].forEach((function(e){-1===o.indexOf(e)&&o.push(e)}))})),o.length?[4,e.sendReadReceiptMessage(n.targetId,o,n.channelId)]:(t.warn(h.A_SEND_MSG_R,JSON.stringify({code:r.MSG_LIMIT_ERROR,msg:"Error in parameter messageList."})),[2,Promise.resolve({code:r.MSG_LIMIT_ERROR})]));case 1:return a=s.sent().code,[2,Promise.resolve({code:a})]}}))}))};function hc(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("targetId",e,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,c,d,u,l;return $(this,(function(f){switch(f.label){case 0:return i={targetId:e,conversationType:s.GROUP,channelId:n},d=o.getNaviInfoFromCache(),1!==(null==d?void 0:d.grpRRVer)?[3,2]:[4,Sc(o,a,i,t)];case 1:return c=f.sent(),[3,4];case 2:return!_("messageList",t,v.OBJECT,!1)||t&&Object.keys(t).some((function(e){return!_(e,t[e],v.ARRAY)}))?[2,{code:r.MSG_LIMIT_ERROR}]:(u=new fs("RC:RRRspMsg",{receiptMessageDic:t}),[4,nc(i,u)]);case 3:c=f.sent(),f.label=4;case 4:return(l=c.code)===r.SUCCESS?[2,{code:l}]:[2,{code:l,msg:Qr[l]}]}}))}))}))]}))}))}function Tc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_SYNC_READ_STATUS_T,h.A_SYNC_READ_STATUS_R).validate("timestamp",t,v.NUMBER,!0).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return[s.GROUP,s.PRIVATE,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE,s.SYSTEM].includes(e)}),!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", timestamp:"+t,a=o.createTraceId(),o.info(h.A_SYNC_READ_STATUS_T,n,a),1!==(null==(s=i.getNaviInfoFromCache())?void 0:s.sesDriven)?[3,2]:[4,i.updateConversationReadTime(e,t)];case 1:return c=v.sent(),[3,4];case 2:return d=new fs("RC:SRSMsg",{lastMessageSendTime:t}),[4,nc(e,d)];case 3:c=v.sent(),v.label=4;case 4:return u=c.code,l=c.msg,o[u===r.SUCCESS?"info":"warn"](h.A_SYNC_READ_STATUS_R,"code: "+u+", msg: "+l,a),[2,{code:u,msg:l}]}}))}))}))]}))}))}function Ic(e,t,n){return void 0===n&&(n=""),Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(h.A_SEND_MESSAGE_READ_RECEIPT_V4_T,h.A_SEND_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP||e===s.PRIVATE}),!0,"It should be ConversationType.GROUP or ConversationType.PRIVATE").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("startMsgUId",n,v.ONLY_STRING,!0).validate("endMsgUId",t,v.STRING,!0).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return i=a.createTraceId(),s="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", startMsgUId:"+n+", endMsgUId: "+t,a.info(h.A_SEND_MESSAGE_READ_RECEIPT_V4_T,s,i),3!==(null==(c=o.getNaviInfoFromCache())?void 0:c.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,o.sendReadReceiptMessageV4(e,n,t)];case 1:return d=v.sent(),u=d.code,l=d.msg,a[u===r.SUCCESS?"info":"warn"](h.A_SEND_MESSAGE_READ_RECEIPT_V4_R,"code: "+u+", msg: "+l,i),[2,{code:u,msg:l}]}}))}))}))]}))}))}function _c(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_GET_MESSAGE_READ_RECEIPT_V4_T,h.A_GET_MESSAGE_READ_RECEIPT_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", messageUid:"+t,a=o.createTraceId(),o.info(h.A_GET_MESSAGE_READ_RECEIPT_V4_T,n,a),3!==(null==(s=i.getNaviInfoFromCache())?void 0:s.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,i.getMessageReadReceiptV4(e,t)];case 1:return c=v.sent(),d=c.code,u=c.msg,l=c.data,o[d===r.SUCCESS?"info":"warn"](h.A_GET_MESSAGE_READ_RECEIPT_V4_R,"code: "+d+", msg: "+u,a),d===r.SUCCESS&&l?[2,{code:d,data:l}]:[2,{code:d,msg:u}]}}))}))}))]}))}))}function mc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,(function(e){return e===s.GROUP}),!0,"It should be ConversationType.GROUP").validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t,(function(e){return!!_("messageUIds",e,v.ARRAY,!0)&&!e.some((function(e){return!R(e)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return n="conversationType:"+e.conversationType+",targetId:"+e.targetId+",\n channelId: "+e.channelId+", messageUid:"+t.toString(),a=o.createTraceId(),o.info(h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_T,n,a),3!==(null==(s=i.getNaviInfoFromCache())?void 0:s.grpRRVer)?[2,{code:r.READ_RECEIPT_V4_NOT_SUPPORT}]:[4,i.batchGetMessageReadReceiptInfoV4(e,t)];case 1:return c=v.sent(),d=c.code,u=c.msg,l=c.data,o[d===r.SUCCESS?"info":"warn"](h.A_BATCH_GET_MESSAGE_READ_RECEIPT_INFO_V4_R,"code: "+d+", msg: "+u,a),d===r.SUCCESS?[2,{code:d,data:l}]:[2,{code:d,msg:u}]}}))}))}))]}))}))}function pc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Ti,Ii).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageUId",t.messageUId,v.STRING,!0).validate("sentTime",t.sentTime,v.NUMBER,!0).validate("disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN).validate("pushConfig",null==t?void 0:t.pushConfig,v.OBJECT).validate("directionalUserIdList",null==t?void 0:t.directionalUserIdList,B({maxLength:300,minLength:1,itemValidator:function(e){return R(e)}})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n={user:t.user,channelId:e.channelId||"",disableNotification:null==t?void 0:t.disableNotification,pushConfig:null==t?void 0:t.pushConfig,extra:t.extra,isDelete:t.isDelete,directionalUserIdList:t.directionalUserIdList},a=o.createTraceId(),o.info(Ti,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,messageUId:t.messageUId}),a),[4,i.recallMessage(e.conversationType,e.targetId,t.messageUId,t.sentTime,n)];case 1:return s=u.sent(),c=s.code,d=s.data,c===r.SUCCESS&&d?(o.info(Ii,JSON.stringify({code:c,messageUId:d.messageUId}),a),[2,{code:c,data:Fe(d)}]):c===r.SUCCESS?[2,{code:c}]:(o.warn(Ii,JSON.stringify({code:c}),a),[2,{code:c,msg:Qr[c]}])}}))}))}))]}))}))}function Nc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(_i,mi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messages",t,(function(e){return f(e)&&e.length}),!0).validate("messages",t,(function(e){return!(!e||!f(e))&&!e.some((function(e){return!R(null==e?void 0:e.messageUId)||!y(null==e?void 0:e.sentTime)||!_("options.messageDirection",null==e?void 0:e.messageDirection,(function(e){return 1===e||2===e}),!0)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(_i,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,messages:t.map((function(e){return e.messageUId}))}),n),[4,i.deleteRemoteMessage(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](mi,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:r.SUCCESS}]}}))}))}))]}))}))}function Ec(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(pi,Ni).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(pi,JSON.stringify({targetId:e.targetId,conversationType:e.conversationType,channelId:e.channelId,timestamp:t}),n),[4,i.deleteRemoteMessageByTimestamp(e.conversationType,e.targetId,t,e.channelId)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Ni,JSON.stringify({code:a}),n),a!==r.SUCCESS?[2,{code:a,msg:Qr[a]}]:[2,{code:r.SUCCESS}]}}))}))}))]}))}))}function yc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(li,vi).validate("clearMessageOption",e,(function(e){if(!_("clearMessageOption",e,v.ARRAY,!0))return!1;if(e.length>20||0===e.length)return!1;for(var t=0,n=e;t<n.length;t++){var i=n[t];if(!(_("options",i,v.OBJECT,!0)&&_("options.targetId",i.targetId,v.STRING,!0)&&_("options.conversationType",i.conversationType,(function(e){return[s.PRIVATE,s.GROUP,s.CHATROOM,s.SYSTEM].includes(e)}),!0)&&_("options.timestamp",i.timestamp,v.NUMBER,!0)&&_("options.channelId",i.channelId,v.ONLY_STRING)))return!1}return!0}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),a=o.createTraceId(),o.info(li,"options: "+JSON.stringify(n)+", isDeleteLocal: "+!!t,a),[4,i.batchClearRemoteHistoryMessages(n,!!t)];case 1:return s=c.sent(),o[r.SUCCESS===s?"info":"warn"](vi,"code: "+s,a),[2,{code:s}]}}))}))}))]}))}))}function Rc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Ei,yi).validate("expansion",e,v.OBJECT,!0).validate("message",t,v.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,v.NUMBER,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).validate("messageUId",null==t?void 0:t.messageUId,v.STRING,!0).validate("expansion",null==t?void 0:t.expansion,v.OBJECT).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f;return $(this,(function(g){switch(g.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,d=t.expansion,u=t.channelId,l=o.createTraceId(),o.info(Ei,JSON.stringify({targetId:a,channelId:u,conversationType:n,messageUId:s,canIncludeExpansion:c}),l),[4,i.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,expansion:e,canIncludeExpansion:c,originExpansion:d,channelId:u})];case 1:return v=g.sent().code,f=v===r.SUCCESS?"info":"warn",o[f](yi,JSON.stringify({code:v}),l),v!==r.SUCCESS?[2,{code:v,msg:Qr[v]}]:[2,{code:v}]}}))}))}))]}))}))}function Cc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Ri,Ci).validate("keys",e,v.ARRAY,!0).validate("message",t,v.OBJECT,!0).validate("conversationType",null==t?void 0:t.conversationType,v.NUMBER,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).validate("messageUId",null==t?void 0:t.messageUId,v.STRING,!0).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v;return $(this,(function(f){switch(f.label){case 0:return n=t.conversationType,a=t.targetId,s=t.messageUId,c=t.canIncludeExpansion,d=t.channelId,u=o.createTraceId(),o.info(Ri,JSON.stringify({targetId:a,channelId:d,conversationType:n,messageUId:s,canIncludeExpansion:c}),u),[4,i.sendExpansionMessage({conversationType:n,targetId:a,messageUId:s,canIncludeExpansion:c,keys:e,channelId:d})];case 1:return l=f.sent().code,v=l===r.SUCCESS?"info":"warn",o[v](Ci,JSON.stringify({code:l}),u),l!==r.SUCCESS?[2,{code:l,msg:Qr[l]}]:[2,{code:l}]}}))}))}))]}))}))}function Oc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(h.A_SEND_MSG_T,h.A_SEND_MSG_R).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("messageType",t,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n={messageType:"RC:TypSts",content:{typingContentType:t},isStatusMessage:!0,channelId:e.channelId},a=o.createTraceId(),o.info(h.A_SEND_MSG_T,JSON.stringify({messageType:n.messageType,conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),a),[4,i.sendMessage(e.conversationType,e.targetId,n,void 0,a)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",o[u](h.A_SEND_MSG_R,JSON.stringify({code:c,messageUId:d?d.messageUId:"",messageId:d?d.messageId:""}),a),c===r.SUCCESS?[2,{code:c,data:Fe(d)}]:[2,{code:c,msg:Qr[c]}]}}))}))}))]}))}))}function Ac(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(Oi,Ai).validate("messageUId",t,v.STRING,!0).validate("targetId",e,v.STRING,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d;return $(this,(function(u){switch(u.label){case 0:return i=a.createTraceId(),a.info(Oi,JSON.stringify({targetId:e,messageUId:t,channelId:n}),i),[4,o.getMessageReader(e,t,n)];case 1:return s=u.sent(),c=s.code,d=s.data,c===r.SUCCESS?(a.info(Ai,JSON.stringify({code:c,totalMemberCount:null==d?void 0:d.totalMemberCount}),i),[2,{code:c,data:d}]):(a.warn(Ai,JSON.stringify({code:c})),[2,{code:c,msg:Qr[c]}])}}))}))}))]}))}))}function Uc(e,t,n,i,o){return Lr((function(r,a){return l("messageType",e,v.STRING,!0),l("isPersited",t,v.BOOLEAN,!0),l("isCounted",n,v.BOOLEAN,!0),l("isStatusMessage",o,v.BOOLEAN,!1),l("searchProps",i,v.ARRAY),a.info(h.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:o,isPersited:t})),r.registerMessageType(e,t,n,i,o),gs(e,t,n)}))}function wc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(Ui,wi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Ui,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getFirstUnreadMessage(t,o,a)];case 1:return c=v.sent(),d=c.code,u=c.data,d===r.SUCCESS?(l=u&&Fe(u)||null,i.info(wi,JSON.stringify({code:d,messageUId:null==u?void 0:u.messageUId}),s),[2,{code:d,data:l}]):(i.warn(wi,JSON.stringify({code:d}),s),[2,{code:d,msg:Qr[d]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Pc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(Pi,Mi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Pi,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.getFirstUnreadMessageInfo(t,o,a||"")];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(i.info(Mi,JSON.stringify({code:d,messageUId:null==u?void 0:u.messageUId,sentTime:null==u?void 0:u.sentTime}),s),[2,{code:d,data:u}]):(i.warn(Mi,JSON.stringify({code:d}),s),[2,{code:d,msg:Qr[d]}])}}))}))}))]}))}))}function Mc(e,t,n){return void 0===n&&(n={}),Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return qe("RongIMLib.insertMessage","RongIMLib.ElectronExtension.insertMessage"),D()?[2,new I(bi,Li).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("searchContent",null==n?void 0:n.searchContent,v.STRING).validate("senderUserId",null==t?void 0:t.senderUserId,v.STRING,!0).validate("messageType",null==t?void 0:t.messageType,v.STRING,!0).validate("content",null==t?void 0:t.content,v.OBJECT,!0).validate("messageDirection",null==t?void 0:t.messageDirection,v.NUMBER,!0).validate("canIncludeExpansion",null==t?void 0:t.canIncludeExpansion,v.BOOLEAN).validate("expansion",null==t?void 0:t.expansion,v.OBJECT).validate("disableNotification",null==t?void 0:t.disableNotification,v.BOOLEAN).validate("sentTime",null==t?void 0:t.sentTime,v.NUMBER).validate("sentStatus",null==t?void 0:t.sentStatus,v.NUMBER).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N;return $(this,(function(E){switch(E.label){case 0:return i=t.senderUserId,s=t.messageType,c=t.content,d=t.messageDirection,u=t.messageUId,l=t.canIncludeExpansion,v=t.expansion,f=t.disableNotification,g=t.sentTime,S=t.sentStatus,h=a.createTraceId(),a.info(bi,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),h),T=n.isUnread,I=n.searchContent,_={senderUserId:i,messageType:s,content:c,messageDirection:d,sentTime:g,sentStatus:S,searchContent:I,isUnread:!!T,messageUId:u,disableNotification:f,canIncludeExpansion:l,expansionMsg:JSON.stringify(v),channelId:e.channelId||""},[4,o.insertMessage(e.conversationType,e.targetId,_)];case 1:return m=E.sent(),p=m.code,N=m.data,p===r.SUCCESS?(a.info(Li,JSON.stringify({code:p,messageId:null==N?void 0:N.messageId}),h),[2,{code:p,data:Fe(N)}]):(a.warn(Li,JSON.stringify({code:p}),h),[2,{code:p,msg:Qr[p]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function bc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(Gi,Ji).validate("messageId",e,(function(e){return y(e)||R(e)}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Gi,JSON.stringify({messageId:e}),t),[4,n.getMessage(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Ji,JSON.stringify({code:a,messageUId:null==s?void 0:s.messageUId,messageId:null==s?void 0:s.messageId})),[2,{code:a,data:Fe(s)}]):(i.warn(Ji,JSON.stringify({code:a})),[2,{code:a,msg:Qr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Lc(e){return D()?new I(Di,Bi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReadySync((function(t,n){var i=e.conversationType,o=e.targetId,a=e.channelId,s=n.createTraceId();n.info(Di,JSON.stringify({conversationType:i,targetId:o,channelId:a}),s);var c=t.getUnreadMentionedMessages(i,o,a),d=[];return c&&c.length&&c.forEach((function(e){return d.push(Fe(e))})),n.info(Bi,JSON.stringify({code:r.SUCCESS,count:d.length}),s),{code:r.SUCCESS,data:d}})):{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}}function Gc(e,t,n,i){return Z(this,void 0,void 0,(function(){var o=this;return $(this,(function(a){return qe("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessages"),D()?[2,new I("A-search_messages-T","A-search_messages-R").validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("keyword",t,v.STRING,!0).validate("timestamp",n,v.NUMBER).validate("count",i,v.NUMBER).ifReady((function(a,s){return Z(o,void 0,void 0,(function(){var o,c,d,u;return $(this,(function(l){switch(l.label){case 0:return[4,a.searchMessageByContent(e.conversationType,e.targetId,t,n,i,1,e.channelId)];case 1:return o=l.sent(),c=o.code,d=o.data,c===r.SUCCESS?(u=[],(null==d?void 0:d.messages)&&d.messages.length&&d.messages.forEach((function(e){return u.push(Fe(e))})),[2,{code:c,data:{messages:u,count:null==d?void 0:d.count}}]):(s.warn(h.O,"searchMessages ->code:"+c+",targetId:"+e.targetId),[2,{code:c,msg:Qr[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Jc(e,t,n){return Z(this,void 0,void 0,(function(){var i,o,a,s=this;return $(this,(function(c){return qe("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.ElectronExtension.deleteMessagesByTimestamp"),D()?(i=e.conversationType,o=e.targetId,a=e.channelId,[2,new I(xi,ki).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).validate("cleanSpace",n,v.BOOLEAN).ifReady((function(e,c){return Z(s,void 0,void 0,(function(){var s,d,u;return $(this,(function(l){switch(l.label){case 0:return s=c.createTraceId(),c.info(xi,JSON.stringify({conversationType:i,targetId:o,channelId:a,timestamp:t,cleanSpace:n}),s),[4,e.deleteMessagesByTimestamp(i,o,t,n,a)];case 1:return d=l.sent(),c.debug(h.A_DELETE_MESSAGES_S,JSON.stringify({code:d,conversationType:i,targetId:o,channelId:a,timestamp:t})),u=d===r.SUCCESS?"info":"warn",c[u](ki,JSON.stringify({code:d}),s),d===r.SUCCESS?[2,{code:d}]:[2,{code:d,msg:Qr[d]}]}}))}))}))]):[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Dc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return qe("RongIMLib.clearMessages","RongIMLib.ElectronExtension.clearMessages"),D()?[2,new I(Vi,Hi).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,a=e.channelId,s=i.createTraceId(),i.info(Vi,JSON.stringify({conversationType:t,targetId:o,channelId:a}),s),[4,n.clearMessages(t,o,a)];case 1:return c=u.sent(),d=c===r.SUCCESS?"info":"warn",i[d](Hi,JSON.stringify({code:c}),s),c===r.SUCCESS?[2,{code:c}]:[2,{code:c,msg:Qr[c]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Bc(e,t,n,i){return Z(this,void 0,void 0,(function(){var o=this;return $(this,(function(a){return qe("RongIMLib.searchConversationByContent","RongIMLib.ElectronExtension.searchConversationByContent"),D()?[2,new I(Fi,Yi).validate("keyword",e,v.STRING,!0).validate("conversationTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!m(e)}))}),!1).validate("messageTypes",n,(function(e){return!!f(e)&&!(null==n?void 0:n.some((function(e){return!R(e)})))}),!1).validate("channelId",i,v.STRING).ifReady((function(a,s){return Z(o,void 0,void 0,(function(){var o,c,d,u;return $(this,(function(l){switch(l.label){case 0:return o=s.createTraceId(),s.info(Fi,JSON.stringify({keyword:e,conversationTypes:t,messageTypes:n,channelId:i}),o),[4,a.searchConversationByContent(e,n,i,t)];case 1:return c=l.sent(),d=c.code,u=c.data,d===r.SUCCESS?(s.info(Yi,JSON.stringify({code:d,count:null==u?void 0:u.length}),o),[2,{code:d,data:u}]):(s.warn(Yi,JSON.stringify({code:d}),o),[2,{code:d,msg:Qr[d]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function xc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(qi,Ki).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return n=e.conversationType,a=e.targetId,s=e.channelId,c=o.createTraceId(),o.info(qi,JSON.stringify({conversationType:n,targetId:a,channelId:s,timestamp:t}),c),[4,i.clearUnreadCountByTimestamp(n,a,t,s)];case 1:return d=l.sent(),u=d===r.SUCCESS?"info":"warn",o[u](Ki,JSON.stringify({code:d}),c),d===r.SUCCESS?[2,{code:d}]:[2,{code:d,msg:Qr[d]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function kc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return qe("RongIMLib.setMessageReceivedStatus","RongIMLib.ElectronExtension.setMessageReceivedStatus"),D()?[2,new I(zi,Wi).validate("messageId",e,v.NUMBER,!0).validate("receivedStatus",t,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(zi,JSON.stringify({messageId:e,receivedStatus:t}),n),[4,i.setMessageReceivedStatus(e,t)];case 1:return a=c.sent(),s=a===r.SUCCESS?"info":"warn",o[s](Wi,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))}function Vc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(to,no).validate("tagId",null==e?void 0:e.tagId,v.STRING,!0).validate("tagId",null==e?void 0:e.tagId,(function(e){return!!e&&e.length<=10})).validate("tagName",null==e?void 0:e.tagName,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(to,JSON.stringify({tagId:e.tagId,tagName:e.tagName}),t),[4,n.createTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](no,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function Hc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(io,oo).validate("tagId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(io,JSON.stringify({tagId:e}),t),[4,n.removeTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](oo,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function Fc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(ro,ao).validate("tagId",null==e?void 0:e.tagId,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,v.STRING,!0).validate("tagName",null==e?void 0:e.tagName,(function(e){return!!e&&e.length<=15})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(ro,JSON.stringify({tagId:e.tagId,tagName:e.tagName}),t),[4,n.updateTag(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](ao,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function Yc(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I("","").ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(so,"",e),[4,t.getTagList()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](co,JSON.stringify({code:o}),e),[2,{code:r.SUCCESS,data:a}]}}))}))}))]}))}))}function qc(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(uo,lo).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(uo,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,channelId:e.channelId}),t),[4,n.getTagsForConversation(e)];case 1:return o=d.sent(),a=o.code,s=o.data,c=a===r.SUCCESS?"info":"warn",i[c](lo,JSON.stringify({code:a}),t),a===r.SUCCESS?[2,{code:a,data:s}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function Kc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(vo,fo).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(vo,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.addTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](fo,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function zc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(go,So).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(go,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.removeTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](So,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function Wc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(ho,To).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("tagIds",t,(function(e){return!!_("tagIds",e,v.ARRAY,!0)&&!e.some((function(e){return!R(e)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(ho,JSON.stringify({tagIds:t,targetId:e.targetId,conversationType:e.conversationType}),n),[4,i.removeTagsForConversation(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](To,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function jc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(Io,_o).validate("tagId",e,v.STRING,!0).validate("conversations",t,(function(e){return!(!_("conversations",e,v.ARRAY,!0)||e.length<=0)&&!e.some((function(e){return!_("conversation",e,v.CONVERSATION,!0)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(Io,JSON.stringify({conversations:t.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId}})),tagId:e}),n),[4,i.removeTagForConversations(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](_o,JSON.stringify({code:a}),n),a===r.SUCCESS?[2,{code:a}]:[2,{code:a,msg:Qr[a]}]}}))}))}))]}))}))}function Qc(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(mo,po).validate("tagId",e,v.STRING,!0).validate("count",t,v.NUMBER,!0).validate("startTime",n,v.NUMBER,!0).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(mo,JSON.stringify({tagId:e,count:t,startTime:n}),i),[4,o.getConversationListByTag(e,n,t)];case 1:return s=l.sent(),c=s.code,d=s.data,c===r.SUCCESS?(u=null==d?void 0:d.map((function(e){return function(e){return X(X({},Ye(e)),{isTopInTag:e.isTopInTag})}(e)})),a.info(po,JSON.stringify({code:c,length:null==u?void 0:u.length}),i),[2,{code:c,data:u}]):(a.warn(po,JSON.stringify({code:c}),i),[2,{code:c,msg:Qr[c]}])}}))}))}))]}))}))}function Xc(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(No,Eo).validate("tagId",e,v.STRING,!0).validate("containMuted",t,v.BOOLEAN,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(No,JSON.stringify({tagId:e,containMuted:t}),n),[4,i.getUnreadCountByTag(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](No,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]}}))}))}))]}))}))}function Zc(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(No,Eo).validate("tagId",e,v.STRING,!0).validate("isTop",n,v.BOOLEAN,!0).validate("conversationType",null==t?void 0:t.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==t?void 0:t.targetId,v.STRING,!0).validate("channelId",null==t?void 0:t.channelId,v.CHANNEL_ID).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c;return $(this,(function(d){switch(d.label){case 0:return i=a.createTraceId(),a.info(No,JSON.stringify({tagId:e,targetId:t.targetId,conversationType:t.conversationType,isTop:n}),i),[4,o.setConversationStatusInTag(e,t,{isTop:n})];case 1:return s=d.sent().code,c=s===r.SUCCESS?"info":"warn",a[c](yo,JSON.stringify({code:s}),i),s===r.SUCCESS?[2,{code:s}]:[2,{code:s,msg:Qr[s]}]}}))}))}))]}))}))}var $c={COMET:"comet",WEBSOCKET:"websocket"},ed={TEXT:"RC:TxtMsg",VOICE:"RC:VcMsg",HQ_VOICE:"RC:HQVCMsg",IMAGE:"RC:ImgMsg",GIF:"RC:GIFMsg",RICH_CONTENT:"RC:ImgTextMsg",LOCATION:"RC:LBSMsg",FILE:"RC:FileMsg",SIGHT:"RC:SightMsg",COMBINE:"RC:CombineMsg",COMBINE_V2:"RC:CombineV2Msg",CHRM_KV_NOTIFY:"RC:chrmKVNotiMsg",LOG_COMMAND:"RC:LogCmdMsg",EXPANSION_NOTIFY:"RC:MsgExMsg",REFERENCE:"RC:ReferenceMsg",RECALL_MESSAGE_TYPE:"RC:RcCmd"};var td=Object.freeze({__proto__:null,getAllConversationList:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(ln,vn).validate("channelId",e,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(ln,JSON.stringify({channelId:e}),t),H(e)?[4,n.getConversationListWithAllChannel()]:[3,2];case 1:return o=d.sent(),[3,4];case 2:return[4,n.getConversationList(void 0,void 0,void 0,void 0,e)];case 3:o=d.sent(),d.label=4;case 4:return a=o.code,s=o.data,i.info(vn,JSON.stringify({code:a,length:null==s?void 0:s.length}),t),a===r.SUCCESS&&s?(c=s.map((function(e){return Ye(e)})),[2,{code:a,data:c}]):(i.warn(vn,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getConversationList:function(e,t,n,i){return Z(this,void 0,void 0,(function(){var o=this;return $(this,(function(a){return D()?[2,new I(fn,gn).validate("startTime",e,v.NUMBER,!0).validate("count",t,v.NUMBER,!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(a,s){return Z(o,void 0,void 0,(function(){var o,c,d,u,l,v;return $(this,(function(f){switch(f.label){case 0:return o=s.createTraceId(),s.info(fn,JSON.stringify({startTime:e,count:t,channelId:n}),o),H(n)?[4,a.getConversationListWithAllChannelByPage(e,t)]:[3,2];case 1:return c=f.sent(),[3,4];case 2:return d=[1,2,3,5,6,7,8],[4,a.getConversationsByPage(d,e,t,n,!!i)];case 3:c=f.sent(),f.label=4;case 4:return u=c.code,l=c.data,u===r.SUCCESS&&l?(v=l.map((function(e){return Ye(e)})),s.info(gn,JSON.stringify({code:u,length:v.length}),o),[2,{code:u,data:v}]):(s.warn(gn,JSON.stringify({code:u}),o),[2,{code:u,msg:Qr[u]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},searchConversationByContent:function(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return D()?[2,new I(Sn,hn).validate("keyword",e,v.STRING,!0).validate("messageTypes",t,(function(e){return!!f(e)&&!e.some((function(e){return!F(e)}))}),!0).validate("channelId",n,v.CHANNEL_ID).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(Sn,JSON.stringify({keyword:e,messageTypes:t,channelId:n}),i),H(n)?[4,o.searchConversationByContentWithAllChannel(e,t)]:[3,2];case 1:return s=l.sent(),[3,4];case 2:return[4,o.searchConversationByContent(e,t,n)];case 3:s=l.sent(),l.label=4;case 4:return c=s.code,d=s.data,c===r.SUCCESS&&d?(u=d.map((function(e){return Ye(e)})),a.info(hn,JSON.stringify({code:c,length:u.length}),i),[2,{code:c,data:u}]):(a.warn(hn,JSON.stringify({code:c}),i),[2,{code:c,msg:Qr[c]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getConversations:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(Tn,In).validate("conversationList",e,B({maxLength:100,minLength:1,itemValidator:function(e){return Y(e,[s.PRIVATE,s.GROUP,s.SYSTEM])}}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(Tn,JSON.stringify({conversations:e}),t),[4,n.getConversations(e)];case 1:return o=d.sent(),a=o.code,s=o.data,a===r.SUCCESS&&s?(c=s.map((function(e){return Ye(e)})),i.info(In,JSON.stringify({code:a,length:c.length}),t),[2,{code:a,data:c}]):(i.warn(In,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},searchMessages:function(e,t,n,i,o){return Z(this,void 0,void 0,(function(){var a=this;return $(this,(function(s){return D()?[2,new I(_n,mn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("keyword",t,v.STRING,!0).validate("startTime",n,v.NUMBER,!0).validate("count",i,v.NUMBER,!0).validate("messageTypes",o,B({itemValidator:F})).ifReady((function(s,c){return Z(a,void 0,void 0,(function(){var a,d,u,l,v,f,g,S,h,T,I;return $(this,(function(_){switch(_.label){case 0:return a=e.targetId,d=e.conversationType,u=e.channelId,l=c.createTraceId(),c.info(_n,JSON.stringify({targetId:a,conversationType:d,channelId:u,keyword:t,startTime:n,count:i}),l),o?[4,s.searchMessageByContentAndMessageType(d,a,t,n,i,o,u)]:[3,2];case 1:return v=_.sent(),[3,6];case 2:return H(u)?[4,s.searchMessageByContentWithAllChannel(d,a,t,n,i)]:[3,4];case 3:return v=_.sent(),[3,6];case 4:return[4,s.searchMessageByContent(d,a,t,n,i,0,u)];case 5:v=_.sent(),_.label=6;case 6:return f=v.code,g=v.data,f===r.SUCCESS&&g?(S=g.messages,h=g.count,T=[],I=S.map((function(e){return T.push(e.messageUId),Fe(e)})),c.info(mn,JSON.stringify({code:f,list:T}),l),[2,{code:f,data:{messages:I,count:h}}]):(c.warn(mn,JSON.stringify({code:f}),l),[2,{code:f,msg:Qr[f]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},searchMessageInTimeRange:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(pn,Nn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("startTime",null==t?void 0:t.startTime,v.NUMBER,!0).validate("endTime",null==t?void 0:t.endTime,v.NUMBER,!0).validate("offset",null==t?void 0:t.offset,v.NUMBER).validate("limit",null==t?void 0:t.limit,v.NUMBER).validate("keyword",null==t?void 0:t.keyword,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S;return $(this,(function(h){switch(h.label){case 0:return n=e.conversationType,a=e.targetId,s=t.keyword,c=t.startTime,d=t.endTime,u=t.offset,l=t.limit,u=u||0,l=l||5,v=o.createTraceId(),o.info(pn,JSON.stringify({targetId:a,conversationType:n,keyword:s,startTime:c,endTime:d,offset:u,limit:l}),v),[4,i.searchMessageByContentInTimeRangeWithAllChannel(n,a,s,c,d,u,l)];case 1:return f=h.sent(),g=f.code,S=f.data,g===r.SUCCESS&&S?[2,{code:g,data:{messages:S.messages.map((function(e){return Fe(e)}))}}]:(o.warn(Nn,JSON.stringify({code:g}),v),[2,{code:g}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},searchMessagesByUser:function(e,t,n,i){return Z(this,void 0,void 0,(function(){var o=this;return $(this,(function(a){return D()?[2,new I(En,yn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("userId",t,v.STRING,!0).validate("startTime",n,v.NUMBER,!0).validate("count",i,v.NUMBER,!0).ifReady((function(a,s){return Z(o,void 0,void 0,(function(){var o,c,d,u,l,v,f;return $(this,(function(g){switch(g.label){case 0:return o=e.conversationType,c=e.targetId,d=e.channelId,u=s.createTraceId(),s.info(En,JSON.stringify({targetId:c,conversationType:o,channelId:d,startTime:n,userId:t,count:i}),u),[4,a.searchMessagesByUser(o,c,t,n,i,d)];case 1:return l=g.sent(),v=l.code,f=l.data,v===r.SUCCESS&&f?[2,{code:v,data:{messages:f.messages.map((function(e){return Fe(e)}))}}]:(s.warn(yn,JSON.stringify({code:v})),[2,{code:v}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getHistoryMessagesByMessageTypes:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(Rn,Cn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error("option.count is invalid, It should be greater than 0 and less than 100"),t})).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("order",null==t?void 0:t.order,(function(e){return[0,1].includes(e)})).validate("messageTypes",null==t?void 0:t.messageTypes,(function(e){return!!f(e)&&!e.some((function(e){return!F(e)}))}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N,E;return $(this,(function(y){switch(y.label){case 0:return n=t.count,a=void 0===n?20:n,s=t.timestamp,c=void 0===s?0:s,d=t.order,u=void 0===d?0:d,l=t.messageTypes,v=e.conversationType,f=e.targetId,g=e.channelId,S=void 0===g?"":g,h=o.createTraceId(),o.info(Rn,JSON.stringify({targetId:f,conversationType:v,channelId:S,count:a,timestamp:c,messageTypes:l}),h),[4,i.getHistoryMessagesByObjectNames(v,f,c,a,l,u,S)];case 1:return T=y.sent(),I=T.code,_=T.data,I===r.SUCCESS?(p=(m=_).list,N=m.hasMore,E=p.map((function(e){return Fe(e)})),[2,{code:I,data:{messages:E,hasMore:N,list:E}}]):(o.warn(Cn,JSON.stringify({code:I})),[2,{code:I,msg:Qr[I]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getContinuousMessages:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(On,An).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,v.NUMBER).validate("count",null==t?void 0:t.count,v.NUMBER).validate("count",null==t?void 0:t.count,(function(e){var t=e>0&&e<=100;return t||null===console||void 0===console||console.error('"options.count" is invalid, It should be greater than 0 and less than 100'),t})).validate("order",null==t?void 0:t.order,(function(e){return 0===e||1===e})).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l,v,f,g,S,h,T,I,_;return $(this,(function(m){switch(m.label){case 0:return n=t.count,a=t.timestamp,s=t.order,c=e.conversationType,d=e.targetId,u=e.channelId,l=o.createTraceId(),o.info(On,JSON.stringify({targetId:d,conversationType:c,channelId:u,count:n,timestamp:a}),l),(i.getNaviInfoFromCache()||{}).historyMsg?[4,i.getContinuousMessages(c,d,a||0,n||20,s||0,u||"")]:[2,{code:r.MESSAGE_STORAGE_SERVICE_UNAVAILABLE}];case 1:return v=m.sent(),f=v.code,g=v.data,f===r.SUCCESS?(h=(S=g).list,T=S.timestamp,I=S.hasMore,_=h.map((function(e){return Fe(e)})),[2,{code:f,data:{list:_,timestamp:T,hasMore:I}}]):(o.warn(An,JSON.stringify({code:f})),[2,{code:f,msg:Qr[f]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setMessageStatusToRead:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(Un,wn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,r,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=e.conversationType,r=e.targetId,a=e.channelId,s=o.createTraceId(),o.info(Un,JSON.stringify({targetId:r,conversationType:n,channelId:a,timestamp:t}),s),[4,i.setMessageStatusToRead(n,r,t,a)];case 1:return c=d.sent(),o.info(wn,JSON.stringify(c),s),[2,c]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatus:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return console.warn("`setMessageSentStatus` has being deprecated, use `setMessageReceivedStatusInfo` instead."),D()?[2,new I(Pn,Mn).validate("messageId",e,v.NUMBER,!0).validate("receivedStatus",t,(function(e){return!H(a[e])}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,r;return $(this,(function(a){switch(a.label){case 0:return n=o.createTraceId(),o.info(Pn,JSON.stringify({messageId:e,receivedStatus:t}),n),[4,i.setMessageReceivedStatus(e,t)];case 1:return r=a.sent(),o.info(Mn,JSON.stringify({code:r}),n),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setMessageReceivedStatusInfo:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(Gn,Jn).validate("messageId",e,v.NUMBER,!0).validate("receivedStatusInfo",t,v.OBJECT,!0).validate("receivedStatusInfo",null==t?void 0:t.isRead,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isListened,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isDownload,v.BOOLEAN).validate("receivedStatusInfo",null==t?void 0:t.isRetrieved,v.BOOLEAN).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,r,a;return $(this,(function(s){switch(s.label){case 0:return n=q(t),r=o.createTraceId(),o.info(Gn,JSON.stringify({messageId:e,sentStatus:n}),r),[4,i.setMessageReceivedStatus(e,n)];case 1:return a=s.sent(),o.info(Jn,JSON.stringify({code:a}),r),[2,{code:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setMessageSentStatus:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(bn,bn).validate("messageId",e,v.NUMBER,!0).validate("sentStatus",t,(function(e){return!H(V[e])}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,r;return $(this,(function(a){switch(a.label){case 0:return n=o.createTraceId(),o.info(bn,JSON.stringify({messageId:e,sentStatus:t}),n),[4,i.setMessageSentStatus(e,t)];case 1:return r=a.sent(),o.info(Ln,JSON.stringify({code:r}),n),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setMessageContent:function(e,t,n){return void 0===n&&(n=""),Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return D()?[2,new I(Dn,Bn).validate("messageId",e,v.NUMBER,!0).validate("content",t,v.OBJECT,!0).validate("messageType",n,v.ONLY_STRING,!0).ifReady((function(o,r){return Z(i,void 0,void 0,(function(){var i,a;return $(this,(function(s){switch(s.label){case 0:return i=r.createTraceId(),r.info(Dn,JSON.stringify({messageId:e,messageType:n}),i),[4,o.setMessageContent(e,t,n)];case 1:return a=s.sent(),r.info(Bn,JSON.stringify({code:a}),i),[2,{code:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},deleteMessages:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(xn,kn).validate("messageIds",e,(function(e){return!!f(e)&&!e.some((function(e){return!y(e)}))}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o;return $(this,(function(r){switch(r.label){case 0:return t=i.createTraceId(),i.info(xn,JSON.stringify({messageIds:e}),t),[4,n.deleteMessages(e)];case 1:return o=r.sent(),i.info(kn,JSON.stringify({code:o}),t),[2,{code:o}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},clearMessages:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(Vn,Hn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,r,a,s;return $(this,(function(c){switch(c.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,a=i.createTraceId(),i.info(Vn,JSON.stringify({conversationType:t,targetId:o,channelId:r}),a),[4,n.clearMessages(t,o,r)];case 1:return s=c.sent(),i.info(Hn,JSON.stringify({code:s}),a),[2,{code:s}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},deleteMessagesByTimestamp:function(e,t,n){return Z(this,void 0,void 0,(function(){var i,o,a,s=this;return $(this,(function(c){return D()?(i=e.conversationType,o=e.targetId,a=e.channelId,[2,new I(Fn,Yn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",t,v.NUMBER,!0).validate("cleanSpace",n,v.BOOLEAN).ifReady((function(e,c){return Z(s,void 0,void 0,(function(){var s,d,u;return $(this,(function(l){switch(l.label){case 0:return s=c.createTraceId(),c.info(Fn,JSON.stringify({conversationType:i,targetId:o,channelId:a,timestamp:t,cleanSpace:n}),s),[4,e.deleteMessagesByTimestamp(i,o,t,n,a)];case 1:return d=l.sent(),u=d===r.SUCCESS?"info":"warn",c[u](Yn,JSON.stringify({code:d}),s),[2,{code:d}]}}))}))}))]):[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},batchClearMessagesByTimestamp:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(fi,gi).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,c;return $(this,(function(d){switch(d.label){case 0:return t=function(e,t){if(!_("options",e,v.ARRAY,!0)||!_("options",e,(function(n){return!(e.length>20||0===e.length)||(t.error(gi,"conversations length should not be greater than 20 and not be equal to 0"),!1)}),!0))return r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST;for(var n=0,i=e;n<i.length;n++){var o=i[n];if(!(_("options",o,v.OBJECT,!0)&&_("options.targetId",o.targetId,v.STRING,!0)&&_("options.conversationType",o.conversationType,(function(e){var n=[s.PRIVATE,s.GROUP,s.CHATROOM,s.SYSTEM].includes(e);return n||t.error(gi,"conversations.conversationType is invalid, It should be one of the following values:\n ConversationType.PRIVATE,\n ConversationType.GROUP,\n ConversationType.CHATROOM,\n ConversationType.SYSTEM,\n "),n}),!0)&&_("options.timestamp",o.timestamp,v.NUMBER,!0)&&_("options.channelId",o.channelId,v.ONLY_STRING)))return r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}}(e,i),t?[2,{code:r.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST}]:(o=e.map((function(e){return{conversationType:e.conversationType,targetId:e.targetId,timestamp:e.timestamp,channelId:e.channelId||""}})),a=i.createTraceId(),i.info(fi,"options: "+JSON.stringify(o),a),[4,n.batchClearMessagesByTimestamp(o)]);case 1:return c=d.sent(),i[r.SUCCESS===c?"info":"warn"](gi,"code: "+c,a),[2,{code:c}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},insertMessage:function(e,t,n){return void 0===n&&(n={}),Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return D()?[2,new I(qn,Kn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("userId",t,(function(e){return e instanceof fs||_("message.senderUserId",null==e?void 0:e.senderUserId,v.STRING,!0)}),!0).validate("messageType",null==t?void 0:t.messageType,v.STRING,!0).validate("content",null==t?void 0:t.content,v.OBJECT,!0).validate("messageDirection",t,(function(e){return e instanceof fs||_("message.messageDirection",null==e?void 0:e.messageDirection,v.NUMBER,!0)}),!0).validate("canIncludeExpansion",t,(function(e){return e instanceof fs||_("message.canIncludeExpansion",null==e?void 0:e.canIncludeExpansion,v.BOOLEAN)})).validate("expansion",t,(function(e){return e instanceof fs||_("message.expansion",null==e?void 0:e.expansion,v.OBJECT)})).validate("disableNotification",t,(function(e){return e instanceof fs||_("message.expansion",null==e?void 0:e.disableNotification,v.BOOLEAN)})).validate("timestamp",t,(function(e){return e instanceof fs||_("message.sentTime",null==e?void 0:e.sentTime,v.NUMBER)})).validate("sentStatus",t,(function(e){return e instanceof fs||_("message.sentStatus",null==e?void 0:e.sentStatus,v.NUMBER)})).validate("receivedStatus",t,(function(e){return e instanceof fs||_("message.receivedStatus",null==e?void 0:e.receivedStatus,v.NUMBER)})).validate("receivedStatusInfo",t,(function(e){return e instanceof fs||_("message.receivedStatusInfo",null==e?void 0:e.receivedStatusInfo,v.OBJECT)})).validate("directedUserIds",t,(function(e){return e instanceof fs||!(null==e?void 0:e.directedUserIds)||!(!(null==e?void 0:e.directedUserIds)||!f(null==e?void 0:e.directedUserIds))&&(!e.directedUserIds.some((function(e){return!R(e)}))&&e.directedUserIds.length<300)})).validate("searchContent",null==n?void 0:n.searchContent,v.STRING).ifReady((function(o,s){return Z(i,void 0,void 0,(function(){var i,c,d,u,l,v,f,g,S,h,T,I,_,m,p,N,E,y,R,C;return $(this,(function(O){switch(O.label){case 0:return i="",c=1,v=!1,g=a.UNREAD,T=t.messageType,I=t.content,t instanceof fs||(i=t.senderUserId,c=t.messageDirection,v=t.canIncludeExpansion,f=t.expansion,l=t.disableNotification,d=t.sentTime,u=t.sentStatus,g=t.receivedStatus,S=t.receivedStatusInfo,h=t.directedUserIds),_=s.createTraceId(),s.info(qn,JSON.stringify({conversationType:e.conversationType,targetId:e.targetId,messageType:T,sentTime:d}),_),m=n.isUnread,p=n.searchContent,N=g,S&&(N=q(S)),E={senderUserId:i,messageType:T,content:I,messageDirection:c,sentTime:d,sentStatus:u,searchContent:p,isUnread:!!m,messageUId:"",disableNotification:l,canIncludeExpansion:v,expansionMsg:JSON.stringify(f),channelId:e.channelId||"",readStatus:N,directedUserIds:h},[4,o.insertMessage(e.conversationType,e.targetId,E)];case 1:return y=O.sent(),R=y.code,C=y.data,R===r.SUCCESS?(s.info(Kn,JSON.stringify({code:R,messageId:null==C?void 0:C.messageId}),_),[2,{code:R,data:Fe(C)}]):(s.warn(Kn,JSON.stringify({code:R}),_),[2,{code:R,msg:Qr[R]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},batchInsertMessage:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(Wn,Wn).validate("messages",e,(function(e){var t,n,i,o;if(!_("messages",e,v.ARRAY,!0))return!1;if(e.length<=0||e.length>=500)return!1;for(var r in e)if(!_("message",e[r],v.OBJECT,!0)||!_("message.conversationType",e[r].conversationType,(function(e){return[s.PRIVATE,s.DISCUSSION,s.GROUP,s.CUSTOMER_SERVICE,s.SYSTEM,s.APP_PUBLIC_SERVICE,s.PUBLIC_SERVICE].includes(e)}),!0)||!_("message.targetId",e[r].targetId,v.STRING,!0)||!_("message.senderUserId",e[r].senderUserId,v.STRING,!0)||!_("message.messageType",e[r].messageType,v.STRING,!0)||!_("message.content",e[r].content,v.OBJECT,!0)||!_("message.messageDirection",e[r].messageDirection,v.NUMBER,!0)||!_("message.canIncludeExpansion",e[r].canIncludeExpansion,v.BOOLEAN)||!_("message.expansion",e[r].expansion,v.OBJECT)||!_("message.disableNotification",e[r].disableNotification,v.BOOLEAN)||!_("message.sentTime",e[r].sentTime,v.NUMBER)||!_("message.sentStatus",e[r].sentStatus,v.NUMBER)||!_("options.isUnread",null===(t=e[r])||void 0===t?void 0:t.isUnread,v.BOOLEAN)||!_("options.searchContent",null===(n=e[r])||void 0===n?void 0:n.searchContent,v.STRING)||!_("options.receivedStatus",null===(i=e[r])||void 0===i?void 0:i.receivedStatus,v.NUMBER)||!_("options.receivedStatusInfo",null===(o=e[r])||void 0===o?void 0:o.receivedStatusInfo,v.OBJECT)||e[r].directedUserIds&&e[r].directedUserIds.some((function(e){return!_("userId",e,v.STRING,!0)}))&&e[r].directedUserIds.length<300)return console.warn("then "+r+" index message validation failed"),!1;return!0}),!0).validate("checkDuplicate",t,v.BOOLEAN).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info(zn,JSON.stringify({checkDuplicate:t,length:e.length}),n),[4,i.batchInsertMessage(e,t)];case 1:return a=d.sent(),s=a.code,c=a.data,s===r.SUCCESS?(o.info(Wn,JSON.stringify({code:s,data:c}),n),[2,{code:s,data:c}]):(o.warn(Wn,JSON.stringify({code:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getMessageCount:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(jn,Qn).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,v.STRING,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,r,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return t=e.conversationType,o=e.targetId,r=e.channelId,a=i.createTraceId(),i.info(jn,JSON.stringify({conversationType:t,targetId:o,channelId:r}),a),[4,n.getMessageCount(t,o,r)];case 1:return s=u.sent(),c=s.code,d=s.data,i.info(Qn,JSON.stringify({code:c,data:d}),a),[2,{code:c,data:d}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getPrivateMessageDeliverTime:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(Xn,Zn).validate("messageUId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s;return $(this,(function(c){switch(c.label){case 0:return t=i.createTraceId(),i.info(Xn,JSON.stringify({messageUId:e}),t),[4,n.getPrivateMessageDeliverTime(e)];case 1:return o=c.sent(),a=o.code,s=o.data,a===r.SUCCESS?(i.info(Zn,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]):(i.warn(Zn,JSON.stringify({code:a}),t),[2,{code:a,msg:Qr[a]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getGroupMessageDeliverList:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I($n,ei).validate("targetId",e,v.STRING,!0).validate("messageUId",t,v.STRING,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info($n,JSON.stringify({targetId:e,messageUId:t}),n),[4,i.getGroupMessageDeliverList(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](ei,JSON.stringify({code:s}),n),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s,msg:Qr[s]}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setCheckDuplicateMessage:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(ti,ni).validate("checkDuplicate",e,v.BOOLEAN).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,r,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(ti,JSON.stringify({checkDuplicate:e}),t),[4,n.setCheckDuplicateMessage(!!e)];case 1:return o=s.sent(),r=o.code,a=o.data,i.info(ni,JSON.stringify({code:r,data:a}),t),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},setCheckChatRoomDuplicateMessage:function(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return D()?[2,new I(ii,oi).validate("checkDuplicate",e,v.BOOLEAN).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,r,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(ii,JSON.stringify({checkDuplicate:e}),t),[4,n.setCheckChatRoomDuplicateMessage(!!e)];case 1:return o=s.sent(),r=o.code,a=o.data,i.info(oi,JSON.stringify({code:r,data:a}),t),[2,{code:r}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},getMessagesAroundTimestamp:function(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return D()?[2,new I(fr,gr).validate("conversation",e,v.OBJECT,!0).validate("conversationType",null==e?void 0:e.conversationType,v.CONVERSATION_TYPE,!0).validate("targetId",null==e?void 0:e.targetId,x,!0).validate("channelId",null==e?void 0:e.channelId,v.CHANNEL_ID).validate("timestamp",null==t?void 0:t.timestamp,K({min:0}),!0).validate("beforeCount",null==t?void 0:t.beforeCount,K({min:0}),!0).validate("afterCount",null==t?void 0:t.afterCount,K({min:0}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d,u,l;return $(this,(function(v){switch(v.label){case 0:return n=o.createTraceId(),o.info(fr,JSON.stringify({option:t,conversation:e}),n),a=t.timestamp,s=t.beforeCount,c=t.afterCount,[4,i.getMessagesByTimestamp(e,a,s,c)];case 1:return d=v.sent(),u=d.code,l=d.data,u===r.SUCCESS?(o.info(gr,JSON.stringify({code:u,data:l}),n),[2,{code:u,data:null==l?void 0:l.map((function(e){return Fe(e)}))}]):(o.warn(gr,JSON.stringify({code:u}),n),[2,{code:u,msg:Qr[u]}])}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},clearLocalData:function(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return D()?[2,Gr((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(ti,"clearLocalData ->",e),[4,t.clearData()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](ni,JSON.stringify({code:o}),e),[2,{code:o,data:a}]}}))}))}))]:[2,{code:r.NOT_SUPPORT,msg:Qr[r.NOT_SUPPORT]}]}))}))},enable:function(){return D()}});function nd(e){return Z(this,void 0,void 0,(function(){var t=this;return $(this,(function(n){return[2,new I(ji,Qi).validate("set.proxy",e,(function(t){return!!(!e||_("proxy.socksHost",e.socksHost,v.STRING,!0)&&_("proxy.socksPort",e.socksPort,v.NUMBER,!0))})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a;return $(this,(function(s){switch(s.label){case 0:return t=i.createTraceId(),i.info(ji,JSON.stringify({socksHost:null==e?void 0:e.socksHost,socksPort:null==e?void 0:e.socksPort}),t),[4,n.setProxy(e)];case 1:return o=s.sent().code,a=o===r.SUCCESS?"info":"warn",i[a](Qi,JSON.stringify({code:o}),t),o===r.SUCCESS?[2,{code:o}]:[2,{code:o,msg:Qr[o]}]}}))}))}))]}))}))}function id(){return Z(this,void 0,void 0,(function(){var e=this;return $(this,(function(t){return[2,new I(Xi,Zi).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a;return $(this,(function(s){switch(s.label){case 0:return e=n.createTraceId(),n.info(Xi,"",e),[4,t.getProxy()];case 1:return i=s.sent(),o=i.code,a=i.data,o===r.SUCCESS?(n.info(Zi,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]):(n.warn(Zi,JSON.stringify({code:o}),e),[2,{code:o,msg:Qr[o]}])}}))}))}))]}))}))}function od(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I($i,eo).validate("test.proxy",e,v.OBJECT,!0).validate("test.proxy.socksHost",null==e?void 0:e.socksHost,v.STRING,!0).validate("test.proxy.socksPort",null==e?void 0:e.socksPort,v.NUMBER,!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c;return $(this,(function(d){switch(d.label){case 0:return n=o.createTraceId(),o.info($i,JSON.stringify({socksHost:null==e?void 0:e.socksHost,socksPort:null==e?void 0:e.socksPort}),n),[4,i.testProxy(e,t)];case 1:return a=d.sent(),s=a.status,c=a.data,s===r.SUCCESS?[2,{code:s,msg:c}]:(o.warn(eo,JSON.stringify({status:s}),n),[2,{code:s,msg:Qr[s]}])}}))}))}))]}))}))}function rd(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(rr,ar).validate("subscribeUserIds",e,B({maxLength:200,minLength:1,itemValidator:x}),!0).validate("subscribeType",t,(function(e){return[W.ONLINE_STATUS,W.USER_PROFILE].includes(e)}),!0).validate("expiry",n,K({min:60,max:2592e3}),!0).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(rr,JSON.stringify({userIds:e,subscribeType:t,expiry:n}),i),[4,o.subscribeUser(e,t,n)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",a[u](ar,JSON.stringify({code:c,data:d}),i),[2,{code:c,data:d}]}}))}))}))]}))}))}function ad(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(sr,cr).validate("subscribeUserIds",e,B({maxLength:200,minLength:1,itemValidator:x}),!0).validate("subscribeType",t,(function(e){return[W.ONLINE_STATUS,W.USER_PROFILE].includes(e)}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s;return $(this,(function(c){switch(c.label){case 0:return n=o.createTraceId(),o.info(sr,JSON.stringify({userIds:e,subscribeType:t}),n),[4,i.unSubscribeUser(e,t)];case 1:return a=c.sent().code,s=a===r.SUCCESS?"info":"warn",o[s](cr,JSON.stringify({code:a}),n),[2,{code:a}]}}))}))}))]}))}))}function sd(e,t,n){return Z(this,void 0,void 0,(function(){var i=this;return $(this,(function(o){return[2,new I(lr,vr).validate("subscribeType",e,(function(e){return[W.ONLINE_STATUS,W.USER_PROFILE].includes(e)}),!0).validate("subscribePageSize",t,K({min:1,max:200}),!0).validate("offset",n,K({min:0}),!0).ifReady((function(o,a){return Z(i,void 0,void 0,(function(){var i,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return i=a.createTraceId(),a.info(lr,JSON.stringify({pageSize:t,offset:n}),i),[4,o.getSubscribeUserList(e,t,n)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",a[u](vr,JSON.stringify({code:c,data:d}),i),c===r.SUCCESS?[2,{code:c,data:d}]:[2,{code:c}]}}))}))}))]}))}))}function cd(e,t){return Z(this,void 0,void 0,(function(){var n=this;return $(this,(function(i){return[2,new I(sr,cr).validate("subscribeType",e,(function(e){return[W.ONLINE_STATUS,W.USER_PROFILE].includes(e)}),!0).validate("subscribeUserIds",t,B({maxLength:200,minLength:1,itemValidator:x}),!0).ifReady((function(i,o){return Z(n,void 0,void 0,(function(){var n,a,s,c,d;return $(this,(function(u){switch(u.label){case 0:return n=o.createTraceId(),o.info(dr,JSON.stringify({userIds:t}),n),[4,i.getSubscribeUserStatus(e,t)];case 1:return a=u.sent(),s=a.code,c=a.data,d=s===r.SUCCESS?"info":"warn",o[d](ur,JSON.stringify({code:s}),n),s===r.SUCCESS?[2,{code:s,data:c}]:[2,{code:s}]}}))}))}))]}))}))}function dd(e){var t=this;return new I(Sr,hr).validate("profile",e,v.OBJECT,!0).validate("profile",e.name,v.ONLY_STRING).validate("profile",e.portraitUri,v.ONLY_STRING).validate("profile",e.email,v.ONLY_STRING).validate("profile",e.birthday,v.ONLY_STRING).validate("profile",e.gender,v.NUMBER).validate("profile",e.location,v.ONLY_STRING).validate("profile",e.role,v.NUMBER).validate("profile",e.level,v.NUMBER).validate("profile",e.extraProfile,v.OBJECT).validate("profile",e.extraProfile,(function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"string"!=typeof e[t])return!1;return!0})).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c,d,u;return $(this,(function(l){switch(l.label){case 0:return t=i.createTraceId(),i.info(Sr,JSON.stringify({profile:e}),t),o=e.extraProfile,a={},["name","portraitUri","email","birthday","gender","location","role","level"].forEach((function(t){H(e[t])||(a[t]=e[t])})),H(o)||(a.extraProfile=X({},o)),[4,n.updateMyUserProfile(a)];case 1:return s=l.sent(),c=s.code,d=s.data,u=c===r.SUCCESS?"info":"warn",i[u](hr,JSON.stringify({code:c,data:d}),t),[2,{code:c,data:d}]}}))}))}))}function ud(e){var t=this;return new I(Tr,Ir).validate("userId",e,B({minLength:1,itemValidator:F}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(Tr,JSON.stringify({userIds:e}),t),[4,n.getUserProfiles(e)];case 1:return o=d.sent(),a=o.code,s=o.data,c=a===r.SUCCESS?"info":"warn",i[c](Ir,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]}}))}))}))}function ld(){var e=this;return new I(_r,mr).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(_r,"",e),[4,t.getMyUserProfile()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](mr,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]}}))}))}))}function vd(e){var t=this;return new I(pr,Nr).validate("userProfileVisibility",e,(function(e){return[z.NOT_SET,z.INVISIBLE,z.EVERYONE].includes(e)}),!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(pr,e,t),[4,n.updateMyUserProfileVisibility(e)];case 1:return o=d.sent(),a=o.code,s=o.data,c=a===r.SUCCESS?"info":"warn",i[c](Nr,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]}}))}))}))}function fd(){var e=this;return new I(Er,yr).ifReady((function(t,n){return Z(e,void 0,void 0,(function(){var e,i,o,a,s;return $(this,(function(c){switch(c.label){case 0:return e=n.createTraceId(),n.info(Er,"",e),[4,t.getMyUserProfileVisibility()];case 1:return i=c.sent(),o=i.code,a=i.data,s=o===r.SUCCESS?"info":"warn",n[s](yr,JSON.stringify({code:o,data:a}),e),[2,{code:o,data:a}]}}))}))}))}function gd(e){var t=this;return new I(Rr,Cr).validate("uniqueId",e,v.STRING,!0).ifReady((function(n,i){return Z(t,void 0,void 0,(function(){var t,o,a,s,c;return $(this,(function(d){switch(d.label){case 0:return t=i.createTraceId(),i.info(Rr,e,t),[4,n.searchUserProfileByUniqueId(e)];case 1:return o=d.sent(),a=o.code,s=o.data,c=a===r.SUCCESS?"info":"warn",i[c](Cr,JSON.stringify({code:a,data:s}),t),[2,{code:a,data:s}]}}))}))}))}export{fs as BaseMessage,ms as CombineMessage,ps as CombineV2Message,As as CommandMessage,$c as ConnectType,xe as Events,Ns as FileMessage,Es as GIFMessage,ws as GroupNotificationMessage,Ts as HQVoiceMessage,hs as ImageMessage,Us as InformationNotificationMessage,Rs as LocationMessage,Ke as MessageAuditType,ed as MessageType,Cs as ReferenceMessage,Os as RichContentMessage,Is as SightMessage,_s as TextMessage,qs as UploadTask,ys as VoiceMessage,Kr as __addSDKVersion,Kc as addConversationsToTag,Jr as addEventListener,Vc as addTag,ds as addToBlacklist,yc as batchClearRemoteHistoryMessages,mc as batchGetMessageReadReceiptInfoV4,aa as batchRemoveConversation,Ia as batchSetConversationNotificationLevel,Ca as batchSetConversationToTop,cs as bindRTCRoomForChatroom,Sa as clearAllMessagesUnreadStatus,kr as clearEventListeners,Ec as clearHistoryMessages,Dc as clearMessages,ga as clearMessagesUnreadStatus,da as clearTextMessageDraft,xc as clearUnreadCountByTimestamp,ta as connect,Qs as createUploadTask,Jc as deleteLocalMessagesByTimestamp,Nc as deleteMessages,Hr as destroy,na as disconnect,td as electronExtension,os as forceRemoveChatRoomEntry,ts as forceSetChatRoomEntry,as as getAllChatRoomEntries,Pa as getAllConversationState,Ya as getAllUltraGroupUnreadCount,qa as getAllUltraGroupUnreadMentionedCount,wa as getAllUnreadMentionedCount,ls as getBlacklist,vs as getBlacklistStatus,ba as getBlockUltraGroupList,Na as getBlockedConversationList,rs as getChatRoomEntry,Za as getChatRoomInfo,ss as getChatroomHistoryMessages,Fr as getConnectionStatus,oa as getConversation,ia as getConversationList,ma as getConversationNotificationLevel,pa as getConversationNotificationStatus,ya as getConversationTypeNotificationLevel,Qc as getConversationsFromTagByPage,qr as getCurrentUserId,zr as getDeviceId,ec as getDownloadAuth,$s as getFileToken,tc as getFileUrl,wc as getFirstUnreadMessage,Pc as getFirstUnreadMessageInfo,uc as getHistoryMessages,bc as getMessage,_c as getMessageReadReceiptV4,Ac as getMessageReader,ld as getMyUserProfile,fd as getMyUserProfileVisibility,id as getProxy,lc as getRemoteHistoryMessages,Yr as getServerTime,sd as getSubscribeUserList,cd as getSubscribeUserStatus,Yc as getTags,qc as getTagsFromConversation,sa as getTextMessageDraft,Oa as getTopConversationList,ua as getTotalUnreadCount,la as getTotalUnreadCountByLevels,va as getTotalUnreadMentionedCountByLevels,Va as getUltraGroupDefaultNotificationLevel,za as getUltraGroupFirstUnreadMessageTimestamp,Ma as getUltraGroupList,Ga as getUltraGroupMessageListByMessageUId,Fa as getUltraGroupUnreadCountByTargetId,Wa as getUltraGroupUnreadInfoList,ka as getUltraGroupUnreadMentionedCountByTargetId,Ka as getUltraGroupUnreadMentionedMessages,Aa as getUnreadConversationList,fa as getUnreadCount,Xc as getUnreadCountByTag,Ua as getUnreadMentionedCount,Lc as getUnreadMentionedMessages,ud as getUserProfiles,Vr as init,Mc as insertMessage,Wr as installPlugin,ja as joinChatRoom,Qa as joinExistChatRoom,xa as modifyMessage,Dr as onceEventListener,Xa as quitChatRoom,pc as recallMessage,Uc as registerMessageType,Ba as removeAllExpansionForUltraGroupMessage,is as removeChatRoomEntries,ns as removeChatRoomEntry,ra as removeConversation,zc as removeConversationsFromTag,Br as removeEventListener,xr as removeEventListeners,Da as removeExpansionForUltraGroupMessage,us as removeFromBlacklist,Cc as removeMessageExpansionForKey,Hc as removeTag,jc as removeTagFromConversations,Wc as removeTagsFromConversation,ca as saveTextMessageDraft,Bc as searchConversationByContent,Gc as searchMessages,gd as searchUserProfileByUniqueId,rc as sendFileMessage,sc as sendGIFMessage,cc as sendHQVoiceMessage,ac as sendImageMessage,nc as sendMessage,vc as sendReadReceiptMessage,Ic as sendReadReceiptMessageV4,fc as sendReadReceiptRequest,gc as sendReadReceiptResponse,hc as sendReadReceiptResponseV2,dc as sendSightMessage,Tc as sendSyncReadStatusMessage,ic as sendTextMessage,Oc as sendTypingStatusMessage,La as sendUltraGroupTypingStatus,es as setChatRoomEntries,$a as setChatRoomEntry,Ta as setConversationNotificationLevel,_a as setConversationNotificationStatus,Ra as setConversationToTop,Zc as setConversationToTopInTag,Ea as setConversationTypeNotificationLevel,kc as setMessageReceivedStatus,nd as setProxy,Ha as setUltraGroupDefaultNotificationLevel,Xs as stopUploadTask,rd as subscribeUserStatus,od as testProxy,ad as unSubscribeUserStatus,Ja as updateExpansionForUltraGroupMessage,Rc as updateMessageExpansion,dd as updateMyUserProfile,vd as updateMyUserProfileVisibility,Fc as updateTag,Zs as upload};