@rongcloud/imlib-next 5.46.1-alpha.3 → 5.48.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import{ConversationType as e,EventEmitter as t,RCConnectionStatus as n,VersionManage as i,assert as o,AssertRules as r,isArray as s,isHttpUrl as a,LogDBProxy as u,APIContext as d,fail as c,ErrorCode as l,ok as f,LogTagId as v,MessageType as h,getMessageTypeDescription as g,MAX_UPLOAD_FILE_SIZE as E,UPLOAD_FILE_CHUNK_SIZE as m,httpRequest as p,fixUrlProtocol as S,UploadMethod as _,UUId as T,FileType as I,promiseWithResolvers as C,MAX_MESSAGE_CONTENT_BYTES as A,Validator as R,validate as N,MessageDirection as M,ReceivedStatus as U,SentStatus as O,NotificationStatus as x,trans2NotificationLevel as y,trans2NotificationStatus as P,transformReceivedStatusFlag as D,MAX_U32_INTEGER as L,usingCppEngine as b}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ConversationUnreadCountFilter,DirectionType,ErrorCode,FileType,FilterRobotType,FriendAddPermission,FriendApplicationStatus,FriendApplicationType,FriendRelationType,GroupApplicationDirection,GroupApplicationStatus,GroupApplicationType,GroupInviteHandlePermission,GroupJoinPermission,GroupMemberInfoEditPermission,GroupMemberRole,GroupOperation,GroupOperationPermission,GroupReadReceiptVersion,InterruptionLevel,LogL,LogLevel,MentionedType,MessageAuditType,MessageBlockSourceType,MessageBlockType,MessageDirection,MessageReactionOperationType,MessageType,NotificationLevel,NotificationStatus,OnlineStatus,OperateStatus,Platform,Platform as PlatformInfo,PushImportanceHonor,PushNotificationQuietHoursLevel,QueryFriendsDirectionType,QuoteMessageStatus,RCConnectionStatus,ReceivedStatus,ReferenceMessageStatus,SentStatus,SpeechToTextStatus,StreamMessageResponseEventType,SubscribeOperationType,SubscribeType,TranslateMessageParam,TranslateMode,TranslateStatus,TranslateStrategy,TranslateTextParam,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod,UserProfileVisibility,UserSettingsChangedKey,UserType,createLogDBProxy,fail,ok}from"@rongcloud/engine";
1
+ import{ConversationType as e,EventEmitter as t,RCConnectionStatus as n,VersionManage as i,APIContext as o,assert as r,AssertRules as s,isArray as a,isHttpUrl as u,LogDBProxy as d,LogTagId as c,MessageType as l,getMessageTypeDescription as f,MAX_UPLOAD_FILE_SIZE as v,fail as E,ErrorCode as h,UPLOAD_FILE_CHUNK_SIZE as m,sdkHttpRequest as p,fixUrlProtocol as g,ok as S,UploadMethod as _,UUId as I,FileType as T,promiseWithResolvers as A,MAX_MESSAGE_CONTENT_BYTES as R,Validator as C,getFileUrl as N,getFileToken as M,batchClearLocalMessagesByTimestamp as O,batchInsertMessage as U,clearLocalMessages as y,deleteLocalMessages as P,deleteLocalMessagesByTimestamp as D,deleteLocalUGMessagesForAllChannel as b,getContinuousMessages as L,getHistoryMessagesByObjectNames as G,getLocalMessage as x,getLocalMessageCount as F,getMessagesAroundTimestamp as w,getUnreadMentionedMessages as B,searchMessagesWithParams as H,setCheckChatRoomDuplicateMessage as k,setCheckDuplicateMessage as V,setMessageContent as j,setMessageReceivedStatus as Y,transformReceivedStatusFlag as z,setMessageSentStatus as $,setMessageSpeechToTextVisible as q,setMessageStatusToRead as W,MessageDirection as X,insertMessage as Q,searchMessages as K,MAX_U32_INTEGER as J,batchDeleteConversations as Z,batchSetConversationNotificationLevel as ee,batchSetConversationToTop as te,batchSetConversationTranslateStrategy as ne,clearAllUnreadCount as ie,clearUnreadCount as oe,clearRealtimeConUnreadCount as re,clearTextMessageDraft as se,createConversationListLoader as ae,getAllConversationList as ue,getAllUnreadMentionedCount as de,getBlockedConversationList as ce,getConversation as le,getConversationList as fe,getConversationListByTimestamp as ve,getConversationNotificationLevel as Ee,trans2NotificationStatus as he,getConversationTypeNotificationLevel as me,getConversationsIncludingRobots as pe,getRealtimeConTotalUnreadCount as ge,batchGetRealtimeConUnreadCount as Se,getRealtimeConversations as _e,getTextMessageDraft as Ie,getTopConversationList as Te,getTotalUnreadCount as Ae,getTotalUnreadCountByLevels as Re,getUnreadConversationList as Ce,getConversationUnreadCount as Ne,getUnreadMentionMeConversationList as Me,getUnreadMentionedCount as Oe,markRemoteConversationAsRead as Ue,removeConversation as ye,removeRealtimeConversations as Pe,saveTextMessageDraft as De,NotificationStatus as be,trans2NotificationLevel as Le,setConversationTypeNotificationLevel as Ge,clearEditedMessageDraft as xe,getConversations as Fe,getEditedMessageDraft as we,syncRemoteConversations as Be,getUntaggedConversationListByPage as He,saveEditedMessageDraft as ke,searchConversationByContent as Ve,validate as je,batchClearRemoteHistoryMessages as Ye,batchGetMessageReadReceiptInfoV4 as ze,deleteRemoteMessageByTimestamp as $e,clearUnreadCountByTimestamp as qe,deleteRemoteMessage as We,getFirstUnreadMessage as Xe,getFirstUnreadMessageDigest as Qe,getHistoryMessage as Ke,getMessageCountDetail as Je,getMessageReadReceiptInfoV5 as Ze,getMessageReadReceiptInfoV5ByIdentifiers as et,getMessageReadReceiptV4 as tt,getMessageReader as nt,getMessagesByUIds as it,getMessagesReadReceiptByUsersV5 as ot,getMessagesReadReceiptUsersByPageV5 as rt,getRemoteHistoryMessages as st,modifyMessageWithParams as at,recallMessage as ut,refreshReferenceMessageWithParams as dt,removeMessageExpansion as ct,requestSpeechToTextForMessage as lt,requestStreamMessageContent as ft,sendReadReceiptMessage as vt,sendReadReceiptMessageV4 as Et,sendReadReceiptRequest as ht,sendReadReceipt as mt,sendReadReceiptResponseV5 as pt,sendSyncReadStatusMessage as gt,sendTypingStatus as St,translateMessagesWithParams as _t,translateTextsWithParams as It,updateMessageExpansion as Tt,SentStatus as At,ReceivedStatus as Rt,getBlockedUGList as Ct,getUGDefaultNotificationLevel as Nt,getUGFirstUnreadMessageDigest as Mt,getUltraGroupList as Ot,getRemoteMessagesByUIds as Ut,getUGUnreadCountForAllChannels as yt,getUGUnreadInfoList as Pt,getUGUnreadMentionedDigest as Dt,removeAllMessageExpansion as bt,sendUltraGroupTypingStatus as Lt,setUGDefaultNotificationLevel as Gt,addToBlacklist as xt,getBlacklist as Ft,getBlacklistStatus as wt,removeFromBlacklist as Bt,addTagForConversations as Ht,createTag as kt,getConversationListByTag as Vt,getTagList as jt,getTagsForConversation as Yt,getUnreadCountByTag as zt,removeTagForConversations as $t,removeTag as qt,removeTagsForConversation as Wt,setConversationStatusInTag as Xt,updateTag as Qt,clearLocalData as Kt,usingCppEngine as Jt,getProxy as Zt,setProxy as en,testProxy as tn,getMyUserProfile as nn,getMyUserProfileVisibility as on,getSubscribeUserList as rn,getSubscribeUserStatus as sn,getSubscribeUsersOnlineStatus as an,getUserProfiles as un,searchUserProfileByUniqueId as dn,subscribeUser as cn,unSubscribeUser as ln,updateMyUserProfile as fn,updateMyUserProfileVisibility as vn,acceptGroupApplication as En,acceptGroupInvite as hn,addGroupFollows as mn,addGroupManagers as pn,createGroup as gn,dismissGroup as Sn,getGroupApplications as _n,getGroupFollows as In,getGroupMembers as Tn,getGroupMembersByRole as An,getGroupsInfo as Rn,getJoinedGroups as Cn,getJoinedGroupsByRole as Nn,inviteUsersToGroup as Mn,joinGroup as On,kickGroupMembers as Un,quitGroup as yn,refuseGroupApplication as Pn,refuseGroupInvite as Dn,removeGroupFollows as bn,removeGroupManagers as Ln,searchGroupMembers as Gn,searchJoinedGroups as xn,setGroupMemberInfo as Fn,setGroupRemark as wn,transferGroupOwner as Bn,updateGroupInfo as Hn,acceptFriendRequest as kn,addFriend as Vn,checkFriends as jn,deleteFriends as Yn,getFriendAddPermission as zn,getFriendApplications as $n,getFriends as qn,getFriendsInfo as Wn,refuseFriendRequest as Xn,searchFriendsInfo as Qn,setFriendAddPermission as Kn,setFriendInfo as Jn,getAppSettings as Zn,getNotificationQuietHoursSetting as ei,removeNotificationQuietHoursSetting as ti,setNotificationQuietHoursWithSetting as ni,bindRTCRoomForChatroom as ii,removeChatroomEntry as oi,setChatroomEntry as ri,getAllChatroomEntries as si,getChatroomEntry as ai,getChatroomInfo as ui,getChatroomHistoryMessages as di,joinChatroom as ci,quitChatroom as li,removeChatroomEntries as fi,setChatroomEntries as vi,getAutoTranslateEnabled as Ei,getTranslationLanguage as hi,setAutoTranslateEnabled as mi,setTranslationLanguage as pi,getAllRobots as gi,getRobotById as Si,addMessageReaction as _i,batchGetMessageReactionSummaries as Ii,getMessageReactionUsers as Ti,getMessageReactions as Ai,removeMessageReaction as Ri}from"@rongcloud/engine";export{AreaCode,ChatroomEntryType,ChatroomSyncStatusReason,ChatroomUserChangeType,ChrmMemBanType,ChrmMemOperateType,ChrmSyncStatus,ConnectionStatus,ConversationType,ConversationUnreadCountFilter,DirectionType,ErrorCode,FileType,FilterRobotType,FriendAddPermission,FriendApplicationStatus,FriendApplicationType,FriendRelationType,GroupApplicationDirection,GroupApplicationStatus,GroupApplicationType,GroupInviteHandlePermission,GroupJoinPermission,GroupMemberInfoEditPermission,GroupMemberRole,GroupOperation,GroupOperationPermission,GroupReadReceiptVersion,InterruptionLevel,LogL,LogLevel,MentionedType,MessageAuditType,MessageBlockSourceType,MessageBlockType,MessageDirection,MessageReactionOperationType,MessageType,NotificationLevel,NotificationStatus,OnlineStatus,OperateStatus,Platform,Platform as PlatformInfo,PushImportanceHonor,PushNotificationQuietHoursLevel,QueryFriendsDirectionType,QuoteMessageStatus,RCConnectionStatus,ReceivedStatus,ReferenceMessageStatus,SentStatus,SpeechToTextStatus,StreamMessageResponseEventType,SubscribeOperationType,SubscribeType,TranslateMessageParam,TranslateMode,TranslateStatus,TranslateStrategy,TranslateTextParam,UltraGroupChannelChangeType,UltraGroupChannelType,UploadMethod,UserProfileVisibility,UserSettingsChangedKey,UserType,createLogDBProxy,fail,ok}from"@rongcloud/engine";
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -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
- ***************************************************************************** */function G(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{u(i.next(e))}catch(e){r(e)}}function a(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}function F(e){return Object.assign(Object.assign({},e),{channelId:e.channelId||""})}function H(t){const{conversationType:n,targetId:i,latestMessage:o,unreadMessageCount:r,hasMentioned:s,mentionedInfo:a,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:h,operationTime:g,draft:E,translateStrategy:m,editedMessageDraft:p,includeRobot:S,dataMgmtInfo:_}=t,T=o&&F(o);let I;I=s?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0;const C={conversationType:n,targetId:i,latestMessage:T,unreadMessageCount:r,hasMentioned:s,mentionedInfo:I,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:h,operationTime:g,draft:E||"",translateStrategy:m,editedMessageDraft:p,includeRobot:S,dataMgmtInfo:_};return C.conversationType===e.ULTRA_GROUP&&(C.firstUnreadMessage=t.firstUnreadMessage,C.channelType=t.channelType,C.unreadMentionedMeCount=t.unreadMentionedMeCount),C}function B(e,t){null===console||void 0===console||console.warn(`Method '${e}' is deprecated, please use '${t}' instead`)}var w;!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.USER_SETTINGS_SYNCED="USER_SETTINGS_SYNCED",e.USER_SETTINGS_CHANGED="USER_SETTINGS_CHANGED",e.CONVERSATIONS_SETTINGS_SYNCED="CONVERSATIONS_SETTINGS_SYNCED",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.CONVERSATIONS_SYNCED="CONVERSATIONS_SYNCED",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="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.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",e.GROUP_OPERATION="GROUP_OPERATION",e.GROUP_INFO_CHANGED="GROUP_INFO_CHANGED",e.GROUP_MEMBER_INFO_CHANGED="GROUP_MEMBER_INFO_CHANGED",e.GROUP_APPLICATION_EVENT="GROUP_APPLICATION_EVENT",e.GROUP_REMARK_CHANGED_SYNC="GROUP_REMARK_CHANGED_SYNC",e.GROUP_FOLLOWS_CHANGED_SYNC="GROUP_FOLLOWS_CHANGED_SYNC",e.FRIEND_ADDED="FRIEND_ADDED",e.FRIEND_DELETE="FRIEND_DELETE",e.FRIEND_APPLICATION_STATUS_CHANGED="FRIEND_APPLICATION_STATUS_CHANGED",e.FRIEND_CLEARED="FRIEND_CLEARED",e.FRIEND_INFO_CHANGED_SYNC="FRIEND_INFO_CHANGED_SYNC",e.DATABASE_OPENED="DATABASE_OPENED",e.DATABASE_UPGRADE_WILL_START="DATABASE_UPGRADE_WILL_START",e.DATABASE_UPGRADING="DATABASE_UPGRADING",e.DATABASE_UPGRADE_DID_COMPLETE="DATABASE_UPGRADE_DID_COMPLETE",e.STREAM_MESSAGE_RESPONSE="STREAM_MESSAGE_RESPONSE",e.MESSAGE_RECEIPT_RESPONSE_V5="MESSAGE_RECEIPT_RESPONSE_V5",e.SPEECH_TO_TEXT_RESPONSE="SPEECH_TO_TEXT_RESPONSE",e.TRANSLATE_RESPONSE="TRANSLATE_RESPONSE",e.MESSAGE_MODIFIED="MESSAGE_MODIFIED",e.MESSAGE_MODIFIED_SYNC_COMPLETED="MESSAGE_MODIFIED_SYNC_COMPLETED",e.ROBOTS_SYNCED="ROBOTS_SYNCED",e.SYNC_SERVER_SAVE_UNREAD_COMPLETED="SYNC_SERVER_SAVE_UNREAD_COMPLETED",e.MESSAGE_REACTION_CHANGED="MESSAGE_REACTION_CHANGED"}(w||(w={}));const k=new t,V={connection(e,t){switch(e){case n.CONNECTED:k.emit(w.CONNECTED);break;case n.CONNECTING:k.emit(w.CONNECTING);break;case n.SUSPENDED:k.emit(w.SUSPEND,t);break;case n.DISCONNECTED:k.emit(w.DISCONNECT,t)}},batchMessage:e=>{k.emit(w.MESSAGES,{messages:e.map((e=>F(e)))})},typingState:e=>{k.emit(w.TYPING_STATUS,{status:e})},readReceiptReceived:(e,t,n,i)=>{k.emit(w.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:i})},messageReceiptRequest:(e,t,n)=>{k.emit(w.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:(e,t,n)=>{k.emit(w.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:t=>{const n=t.map((({conversation:t,updatedItems:n})=>{const{conversationType:i}=t,o=H(t);return i===e.ULTRA_GROUP&&(o.versionTime=t.versionTime,o.unreadMessageCount=j(t.unreadMessageCount||0),o.unreadMentionedCount=j(t.unreadMentionedCount||0),o.unreadMentionedMeCount=j(t.unreadMentionedMeCount||0)),{conversation:o,updatedItems:n}}));k.emit(w.CONVERSATION,{conversationList:n})},chatroomState:e=>{k.emit(w.CHATROOM,e)},expansion:e=>{k.emit(w.EXPANSION,e)},pullFinished:()=>{k.emit(w.PULL_OFFLINE_MESSAGE_FINISHED)},tag:()=>{k.emit(w.TAG)},userSettingsSynced:e=>{k.emit(w.USER_SETTINGS_SYNCED,e)},userSettingsChanged:e=>{k.emit(w.USER_SETTINGS_CHANGED,e)},conversationStatusSynced:e=>{k.emit(w.CONVERSATIONS_SETTINGS_SYNCED,e)},robotsSynced:(e,t)=>{k.emit(w.ROBOTS_SYNCED,e,t)},conversationTagChanged:()=>{k.emit(w.CONVERSATION_TAG)},messageBlocked:e=>{k.emit(w.MESSAGE_BLOCKED,e)},ultraGroupEnable:()=>{k.emit(w.ULTRA_GROUP_ENABLE)},sgRelationsSynced:e=>{k.emit(w.CONVERSATIONS_SYNCED,e)},operateStatus:e=>{k.emit(w.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:e=>{k.emit(w.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((e=>F(e))))},ultraGroupMessageRecalled:e=>{k.emit(w.ULTRA_GROUP_MESSAGE_RECALLED,e.map((e=>F(e))))},ultraGroupChannelChangeType:e=>{k.emit(w.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:e=>{k.emit(w.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:e=>{k.emit(w.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:e=>{k.emit(w.USER_GROUP_STATUS,e)},messageReadReceipt:e=>{k.emit(w.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:e=>{k.emit(w.SYNC_READ_STATUS,e)},subscribedUserStatusChange:e=>{k.emit(w.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:e=>{k.emit(w.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:e=>{k.emit(w.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:e=>{k.emit(w.OWN_USER_PROFILE_CHANGED,e)},groupOperation:e=>{k.emit(w.GROUP_OPERATION,e)},groupInfoChanged:e=>{k.emit(w.GROUP_INFO_CHANGED,e)},groupMemberInfoChanged:e=>{k.emit(w.GROUP_MEMBER_INFO_CHANGED,e)},groupApplicationEvent:e=>{k.emit(w.GROUP_APPLICATION_EVENT,e)},groupRemarkChangedSync:e=>{k.emit(w.GROUP_REMARK_CHANGED_SYNC,e)},groupFollowsChangedSync:e=>{k.emit(w.GROUP_FOLLOWS_CHANGED_SYNC,e)},friendAdd:e=>{k.emit(w.FRIEND_ADDED,e)},friendDelete:e=>{k.emit(w.FRIEND_DELETE,e)},friendApplicationStatusChanged:e=>{k.emit(w.FRIEND_APPLICATION_STATUS_CHANGED,e)},friendCleared:e=>{k.emit(w.FRIEND_CLEARED,e)},friendInfoChangedSync:e=>{k.emit(w.FRIEND_INFO_CHANGED_SYNC,e)},databaseOpened:(e,t)=>{k.emit(w.DATABASE_OPENED,e,t)},databaseUpgradeWillStart:()=>{k.emit(w.DATABASE_UPGRADE_WILL_START)},databaseUpgrading:e=>{k.emit(w.DATABASE_UPGRADING,e)},databaseUpgradeDidComplete:e=>{k.emit(w.DATABASE_UPGRADE_DID_COMPLETE,e)},readReceiptResponseV5:e=>{k.emit(w.MESSAGE_RECEIPT_RESPONSE_V5,e)},speechToTextResponse:e=>{k.emit(w.SPEECH_TO_TEXT_RESPONSE,e)},translateResponse:e=>{k.emit(w.TRANSLATE_RESPONSE,e)},messagesModified:e=>{k.emit(w.MESSAGE_MODIFIED,e.map((e=>F(e))))},messageModifiedSyncCompleted:()=>{k.emit(w.MESSAGE_MODIFIED_SYNC_COMPLETED)},syncServerSaveUnreadCompleted:()=>{k.emit(w.SYNC_SERVER_SAVE_UNREAD_COMPLETED)},messageReaction(e){k.emit(w.MESSAGE_REACTION_CHANGED,e)}};function j(e){return e>999?999:e}i.add("imlib-next","5.46.1-alpha.3");let Y=null,q=null,z=null;function $(e){if(!Y)throw new Error("Not initialized yet!");return e(Y,z,q)}function W(){return Y?f(Y):c(l.BIZ_ERROR_CLIENT_NOT_INIT)}function X(e,t){return $((n=>n.install(e,t)))}let Q=0;const K=new Map;function J(e,t){const n=(...e)=>{const i=[],o=[];[...K.values()].forEach((([e,t,r])=>{e===n&&(o.push(t),r&&i.push(r))})),i.forEach((t=>{e=t(e)}));const r=t(...e);return o.forEach((t=>{t(e,r)})),r};return Object.defineProperty(n,"original",{value:t,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"monitorable",{value:!0,writable:!1,enumerable:!1,configurable:!1}),n}function Z(e,t,n){if(!e.monitorable)throw new Error(`Not monitorable API: ${e.name}`);const i=++Q;return K.set(i,[e,t,n]),i}function ee(e){K.delete(e)}function te(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.connect(e,!!t)))).trans((e=>({userId:e})))}))}const ne=J("disconnect",((e,t)=>$((n=>n.disconnect(e,t)))));function ie(e,t,n){k.on(e,t,n)}function oe(e,t,n){k.once(e,t,n)}function re(e,t,n){k.off(e,t,n)}function se(e){k.removeAll(e)}function ae(){k.clear()}class ue{constructor(e,t,n=!0,i=!0){Object.defineProperty(this,"messageType",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"isPersited",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isCounted",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class de extends ue{constructor(e,t,n){super(e,n,t.isPersited,t.isCounted)}}class ce extends de{constructor(e){super(h.COMBINE,g(h.COMBINE),e)}}class le extends de{constructor(e){super(h.COMBINE_V2,g(h.COMBINE_V2),e)}}class fe extends de{constructor(e){super(h.COMMAND,g(h.COMMAND),e)}}class ve extends de{constructor(e){super(h.FILE,g(h.FILE),e)}}class he extends de{constructor(e){super(h.GIF,g(h.GIF),e)}}const ge=h.GROUP_NOTIFICATION;class Ee extends de{constructor(e){super(ge,g(ge),e)}}class me extends de{constructor(e){super(h.IMAGE,g(h.IMAGE),e)}}const pe=h.INFORMATION_NOTIFICATION;class Se extends de{constructor(e){super(pe,g(pe),e)}}class _e extends de{constructor(e){super(h.LOCATION,g(h.LOCATION),e)}}class Te extends de{constructor(e){super(h.REFERENCE,g(h.REFERENCE),e)}}class Ie extends de{constructor(e){super(h.RICH_CONTENT,g(h.RICH_CONTENT),e)}}class Ce extends de{constructor(e){super(h.SIGHT,g(h.SIGHT),e)}}class Ae extends de{constructor(e){super(h.TEXT,g(h.TEXT),e)}}class Re extends de{constructor(e){super(h.HQ_VOICE,g(h.HQ_VOICE),e)}}class Ne extends de{constructor(e){super(h.VOICE,g(h.VOICE),e)}}var Me;!function(e){e.ALIYUN="aliyun",e.S3="s3",e.MINIO="minio",e.QINIU="qiniu",e.RCX="rcx"}(Me||(Me={}));class Ue{constructor(e,t,n){Object.defineProperty(this,"_url",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_authInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_getFileToken",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isAbort",{enumerable:!0,configurable:!0,writable:!0,value:!1})}isAbort(){return this._isAbort}abort(){this._isAbort=!0,this._abortHandler()}upload(e){return e.file.size>E?Promise.resolve(c(l.UPLOAD_FAIL,"the file size is over 5GB!")):e.file.size>m&&this.multipartUpload?this.multipartUpload(e):this.commonUpload(e)}}function Oe(e){return Math.ceil(e/1024)||0}const xe={[Me.QINIU]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t),this._promise=p({url:S(this._url),headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:s}=yield this._promise.result();return this._promise=null,200===s||204===s?f({uniqueName:o.fileName,uploadMethod:_.QINIU}):c(l.UPLOAD_FAIL,s.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.ALIYUN]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=S(`${o.ossBucketName}.${this._url}`),s=new FormData;s.set("token",o.token),s.set("OSSAccessKeyId",o.osskeyId),s.set("policy",o.ossPolicy),s.set("Signature",o.ossSign),s.set("success_action_status","200"),s.set("key",o.fileName),s.set("file",t),this._promise=p({url:r,onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:s,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?f({uniqueName:o.fileName,uploadMethod:_.ALI}):c(l.UPLOAD_FAIL,a.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.S3]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i,contentDisposition:o}=e;let r=this._authInfo;const s=S(`${r.s3BucketName}.${this._url}`),a=new FormData;o?a.set("Content-Disposition",o):a.set("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),a.set("Content-Type",t.type),a.set("x-amz-credential",r.s3Credential),a.set("x-amz-algorithm",r.s3Algorithm),a.set("x-amz-date",r.s3Date),a.set("policy",r.s3Policy),a.set("x-amz-signature",r.s3Signature),a.set("key",r.fileName),a.set("file",t),this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:a,timeout:0});const{status:u,data:d}=yield this._promise.result();return this._promise=null,200===u||204===u?f({uniqueName:r.fileName,uploadMethod:_.AWS}):c(l.UPLOAD_FAIL,u.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.MINIO]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>G(this,void 0,void 0,(function*(){var t;const{file:n,fileType:i}=e;let o=yield this._getFileToken(i,n.name,"POST","uploads",void 0,Oe(n.size));if(!o.isOk)return o.wipe();let r=o.data;const s=S(`${this._url}/${r.minioBucketName}/${r.fileName}`),a=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploads`,headers:a,method:"POST"});const{status:u,data:d}=yield this._promise.result();this._promise=null;const v=null===(t=null==d?void 0:d.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===t?void 0:t[1];if(200!==u&&204!==u||!v)return c(l.UPLOAD_FAIL,"start upload fail");const h=[],g=yield this.requestUploadPart(s,n,v,r.fileName,e,h);if(!g.isOk)return g.wipe();if(o=yield this._getFileToken(i,r.fileName,"POST",`uploadId=${v}`,void 0,Oe(n.size)),!o.isOk)return o.wipe();r=o.data;let E=h.map(((e,t)=>`<Part><PartNumber>${t+1}</PartNumber><ETag>${e}</ETag></Part>`)).join("");E=`<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>${E}</CompleteMultipartUpload>`;const m=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploadId=${v}`,headers:m,method:"POST",body:E,timeout:0});const{status:T}=yield this._promise.result();return this._promise=null,200===T||204===T?f({uniqueName:r.fileName,uploadMethod:_.MINIO}):c(l.UPLOAD_FAIL,"end upload fail")}))})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=S(`${this._url}/${o.minioBucketName}/${o.fileName}`),s=this.getBaseHeaders(t,o,e);this._promise=p({url:r,headers:s,onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"PUT",body:t,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?f({uniqueName:o.fileName,uploadMethod:_.MINIO}):c(l.UPLOAD_FAIL,a.toString())}))}requestUploadPart(e,t,n,i,o,r,s=1,a=0){return G(this,void 0,void 0,(function*(){if(a>=5)return c(l.UPLOAD_FAIL,"Upload retry times exceeded 5. Procedure");const u=(s-1)*m,d=Math.min(m,t.size-u),v=`partNumber=${s}&uploadId=${n}`,h=yield this._getFileToken(o.fileType,i,"PUT",v,void 0,Oe(t.size));if(!h.isOk)return h.wipe();const g=h.data,E=t.slice(u,s*m),S=this.getBaseHeaders(t,g,o);this._promise=p({url:`${e}?${v}`,headers:S,method:"PUT",body:E,timeout:0,onProgress:e=>{var n;return null===(n=null==o?void 0:o.onProgress)||void 0===n?void 0:n.call(o,u+e.loaded,t.size)}});const{status:_,xhr:T}=yield this._promise.result();return this._promise=null,200===_||204===_?(r.push((null==T?void 0:T.getResponseHeader("ETag"))||""),u+d<t.size?this.requestUploadPart(e,t,n,i,o,r,s+1,0):f()):this.requestUploadPart(e,t,n,i,o,r,s,a+1)}))}getBaseHeaders(e,t,n){const{contentDisposition:i}=n;return{"Content-Disposition":`${i||("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"}}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[Me.RCX]:class extends Ue{constructor(){super(...arguments),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e,o=T.gen();let r=this._authInfo;return this._requestUploadPart(o,t,r.token,n)}))})}commonUpload(e){return G(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t);const s=S(this._url);this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:a,data:u}=yield this._promise.result();if(this._promise=null,(200===a||204===a)&&u){const e=JSON.parse(u);return f({uniqueName:e.rc_url.file_name,downloadUrl:`${s}/${e.rc_url.path}`,uploadMethod:_.QINIU})}return c(l.UPLOAD_FAIL,a.toString())}))}_requestUploadPart(e,t,n,i,o=0){return G(this,void 0,void 0,(function*(){const r=Math.min(m,t.size-o),s=e+t.name.substring(t.name.lastIndexOf(".")),a={Range:`bytes=${o}-${o+r}`,"X-File-TransactionId":s,"X-File-Total-Size":t.size.toString()},u=t.slice(o,o+r),d=new FormData;d.set("file",u,t.name),d.set("key",s),d.set("name",s),d.set("token",n);const v=S(this._url);this._promise=p({url:v,headers:a,onProgress:e=>null==i?void 0:i(o+e.loaded,t.size),method:"POST",body:d,timeout:0});const{status:h,data:g}=yield this._promise.result();if(this._promise=null,200===h||204===h){if(o+r<t.size)return this._requestUploadPart(e,t,n,i,o+r);const s=JSON.parse(g);return f({uniqueName:s.rc_url.file_name,downloadUrl:`${v}/${s.rc_url.path}`,uploadMethod:_.QINIU})}return c(l.UPLOAD_FAIL,h.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}}};function ye(e,t,n){const{promise:i,resolve:o}=C(),r=document.createElement("canvas"),s=r.getContext("2d"),a=new Image;return a.onload=e=>{const{maxHeight:i=160,maxWidth:u=160,quality:d=1,scale:c=1}=n||{},l=De(a.width,a.height,{maxHeight:i,maxWidth:u,scale:c});r.width=Math.min(l.w,u),r.height=Math.min(l.h,i),s.drawImage(a,l.x,l.y,l.w,l.h);let v=Pe(r,d);v=v.replace(/data:image\/[^;]+;base64,/,""),o(f(Object.assign(Object.assign({},t),{thumbnail:v,width:Math.ceil(l.w),height:Math.ceil(l.h)})))},a.onerror=e=>{o(c(l.UPLOAD_FAIL,`get image info fail:${JSON.stringify(e)}`))},a.src=(window.URL||window.webkitURL).createObjectURL(e),i}function Pe(e,t){let n=e.toDataURL("image/jpeg",t);return n.length>A-10240?Pe(e,t-.1):n}const De=(e,t,n)=>{const{maxHeight:i=160,maxWidth:o=160,scale:r=1}=n,s=e<t;let a,u,d,c=0,l=0;return(s?t/e:e/t)>r?(s?(a=e/160,u=160,d=t/a,d>i&&(l=(d-i)/2)):(a=t/160,d=160,u=e/a,u>o&&(c=(u-o)/2)),{w:u,h:d,x:-c,y:-l}):(s?(a=t/i,d=i,u=e/a):(a=e/o,u=o,d=t/a),{w:u,h:d,x:-c,y:-l})};let Le=0;class be{constructor(e,t){Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:++Le}),this._promise=this._handleUpload(e,t)}abort(){var e;null===(e=this._client)||void 0===e||e.abort()}_uploadInLoop(e,t,n,i,o=[]){return G(this,void 0,void 0,(function*(){for(let r=0;r<e.length;r++){const s=e[r],a=xe[s.type];if(!a){o.push({type:s.type,url:s.url,code:l.UPLOAD_FAIL,msg:"Upload type not supported"});continue}this._client=new a(s.url,n,i);const u=yield this._client.upload(t);if(u.isOk)return u;const{code:d}=u;if([l.RC_FILE_SIZE_EXCEED_LIMIT,l.INVALID_PARAMETER_SIZE_NOT_FOUND].includes(u.code))return u;if(this._client.isAbort())return this._client=null,u;this._client=null,o.push({type:s.type,url:s.url,code:d,msg:u.msg})}return c(l.UPLOAD_FAIL,`Failed to upload all channels, msg: ${JSON.stringify(o)}`)}))}_handleUpload(e,t){return G(this,void 0,void 0,(function*(){const{getFileToken:n,customDomain:i,uploadServer:o,ossConfig:r}=t,{file:s,fileType:a,thumbnailConfig:u}=e,d=yield n(a,s.name,void 0,void 0,void 0,Oe(s.size));if(!d.isOk)return d.wipe();const v=d.data,h=function(e,t,n){if(t)return[{type:Me.RCX,url:t,p:"1"}];if(e)return JSON.parse(e).map((e=>{const t={type:Me.QINIU,url:"",p:""};return Object.keys(e).forEach((n=>{"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort(((e,t)=>e.p-t.p));const i=[];return n&&i.push({type:Me.QINIU,url:n,p:"1"}),i}(v.ossConfig||r,i,o);if(0===h.length)return c(l.INVALID_PARAMETER_MEDIA_URL,"uploadUrlList is empty");const{code:g,data:E,msg:m,isOk:p}=yield this._uploadInLoop(h,e,v,n);if(!p)return c(g,m);let{downloadUrl:S,uploadMethod:_}=E;if(!S){const e=yield t.getFileUrl(a,E.uniqueName,_,s.name);if(!e.isOk)return c(e.code,"Get download url fail");S=e.data.downloadUrl}if(!S)return c(l.UPLOAD_FAIL,"Get download url fail");const T={downloadUrl:S,uniqueName:(null==E?void 0:E.uniqueName)||"",name:s.name,size:s.size,type:s.type};if(a===I.AUDIO){return function(e,t){const n=new AudioContext({sampleRate:16e3}),{promise:i,resolve:o}=C();return n.decodeAudioData(e,(e=>{var n,i;o(f(Object.assign(Object.assign({},t),{duration:e.duration,length:e.length,sampleRate:null!==(n=e.sampleRate)&&void 0!==n?n:void 0,numberOfChannels:null!==(i=e.numberOfChannels)&&void 0!==i?i:void 0})))}),(e=>{o(c(l.UPLOAD_FAIL,`get audio info fail:${JSON.stringify(e)}`))})),i}(yield s.arrayBuffer(),T)}return a===I.IMAGE?ye(s,T,u):f(T)}))}awaitResult(){return G(this,void 0,void 0,(function*(){return this._promise}))}}const Ge={};function Fe(e,t){const n=new be(e,t);return function(e){G(this,void 0,void 0,(function*(){Ge[e.id]=e,yield e.awaitResult(),delete Ge[e.id]}))}(n),n}const He=(e,t)=>{const n=e.getNaviInfoFromCache();return{getFileToken:e.getFileToken.bind(e),getFileUrl:e.getFileUrl.bind(e),customDomain:t||"",ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer}};function Be(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){const{contentDisposition:n,fileType:i,file:o}=e;return R.create("createUploadTask").validate("contentDisposition",n,(e=>"inline"===e||"attachment"===e),!1).fail(l.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",i,I,!0).fail(l.INVALID_PARAMETER_MEDIA_TYPE).validate("file",o,(e=>e instanceof File&&(!(i===I.IMAGE&&!e.type.match(/^image\//))&&!(i===I.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(l.MEDIA_EXCEPTION).result().trans((()=>Fe(e,He(t,t.getOptions().uploadDomain))))}))))}))}function we(e){return G(this,void 0,void 0,(function*(){return f(function(e){const t=Ge[e];return!!t&&(t.abort(),!0)}(e))}))}function ke(e){return G(this,void 0,void 0,(function*(){const{contentDisposition:t,fileType:n,file:i}=e;return W().next((o=>G(this,void 0,void 0,(function*(){const r=yield R.create("upload").validate("contentDisposition",t,(e=>"inline"===e||"attachment"===e),!1).fail(l.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",n,I,!0).fail(l.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(e=>e instanceof File&&(!(n===I.IMAGE&&!e.type.match(/^image\//))&&!(n===I.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(l.MEDIA_EXCEPTION).result().next((()=>function(e,t){return G(this,void 0,void 0,(function*(){return new be(e,t).awaitResult()}))}(e,He(o,o.getOptions().uploadDomain))));return r}))))}))}function Ve(e,t,n,i){return W().next((o=>o.getFileToken(e,t,n,i)))}function je(e){return W().next((t=>G(this,void 0,void 0,(function*(){return(yield R.create("getDownloadAuth").isNotEmptyString("url",e,!0).fail(l.INVALID_PARAMETER_MEDIA_URL).result().next((()=>t.getFileToken(1,void 0,void 0,void 0,e)))).trans((({deadline:e,token:t,downloadAuthInfo:n})=>({deadline:e,token:t,downloadAuthInfo:n})))}))))}function Ye(e,t,n,i,o){return G(this,void 0,void 0,(function*(){return(null==i?void 0:i.isBosRes)?f(i):W().next((i=>i.getFileUrl(e,t,o||_.QINIU,n)))}))}const qe=gi,ze=J("sendMessage",((e,t,n)=>G(void 0,void 0,void 0,(function*(){const{disableNotification:i,isMentioned:o,directionalUserIdList:r,canIncludeExpansion:s,onSendBefore:a,expansion:u,pushConfig:d,isStatusMessage:l,disableUpdateLastMessage:f}=n||{},h=function(e,t){const{disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:h,disableUpdateLastMessage:g,needReceipt:E,quoteInfo:m}=e;return Object.assign({disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:h,disableUpdateLastMessage:g,needReceipt:E,quoteInfo:m},t)}(n||{},t),g=Object.assign(Object.assign({},e),{isMentioned:!!o,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!i,canIncludeExpansion:!!s,expansion:u||null,senderUserId:"",messageUId:"",messageDirection:M.SEND,receivedTime:0,isStatusMessage:!!l,receivedStatus:U.UNREAD,isOffLineMessage:!1,pushConfig:d,sentStatus:O.SENDING,sentTime:0,directedUserIds:r||[],disableUpdateLastMessage:f,quoteInfo:h.quoteInfo}),E=yield W().next((t=>{g.senderUserId=t.getCurrentUserId();return t.sendMessage(e,h,(e=>{g.messageId=e;try{a&&a(F(g))}catch(e){t.logger.error(v.L_CALLBACK_E,`Callback method "onSendBefore" execution error.\n${null==e?void 0:e.stack}`),console.error(e)}}))}));return E.isOk?E.trans((e=>F(e))):(g.sentStatus=O.FAILED,c(E.code,E.msg,F(g)))}))));function $e(e,t,n){return ze(e,new Ae(t),n)}function We(e,t){return(n,i,o,s)=>G(this,void 0,void 0,(function*(){var a,u;const d=W();if(!d.isOk)return d.wipe();const f=d.data;if(!N("sendOptions.contentDisposition",null==s?void 0:s.contentDisposition,(e=>["inline","attachment"].includes(e))))return c(l.INVALID_PARAMETER_SENDOPTIONS);const h={contentDisposition:null==s?void 0:s.contentDisposition};if(s&&"thumbnailConfig"in s){const e=null===(a=s)||void 0===a?void 0:a.thumbnailConfig;if(!(N("sendOptions.maxHeight",null==e?void 0:e.maxHeight,r.NUMBER)&&N("sendOptions.maxWidth",null==e?void 0:e.maxWidth,r.NUMBER)&&N("sendOptions.quality",null==e?void 0:e.quality,r.NUMBER)&&N("sendOptions.scale",null==e?void 0:e.scale,r.NUMBER)))return c(l.INVALID_PARAMETER_SENDOPTIONS);h.thumbnailConfig=e}const{logger:g}=f,E=g.createTraceId();g.info(v.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:i.file.size,type:e}),E);const m=yield ke({file:i.file,fileType:e,onProgress:(e,t)=>{var n;null===(n=null==o?void 0:o.onProgress)||void 0===n||n.call(o,Math.floor(e/t*100))},contentDisposition:h.contentDisposition,thumbnailConfig:h.thumbnailConfig}),{code:p,data:S,msg:_}=m;if(p===l.SUCCESS&&S){const e=(null===(u=null==o?void 0:o.onComplete)||void 0===u?void 0:u.call(o,Object.assign({url:S.downloadUrl},S)))||t(S,i);return g.info(v.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:S.downloadUrl,code:l.SUCCESS}),E),ze(n,e,s)}return c(p,_)}))}const Xe=e=>{const t=e.match(/\.(\w+)$/);return t?t[1]:"bin"},Qe=We(I.FILE,((e,t)=>{const n={name:e.name,size:t.file.size,type:Xe(e.name),fileUrl:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new ve(n)})),Ke=We(I.IMAGE,((e,t)=>{const n={content:e.thumbnail,imageUri:e.downloadUrl,thumWidth:e.width,thumHeight: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 me(n)})),Je=We(I.IMAGE,((e,t)=>{const 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 he(n)})),Ze=We(I.AUDIO,((e,t)=>{var n;const i={remoteUrl:e.downloadUrl,duration:Math.floor(null!==(n=e.duration)&&void 0!==n?n:0),sampleRate:e.sampleRate,numberOfChannels:e.numberOfChannels};return t.user&&(i.user=t.user),t.extra&&(i.extra=t.extra),t.mentionedInfo&&(i.mentionedInfo=t.mentionedInfo),t.audit&&(i.audit=t.audit),new Re(i)})),et=We(I.SIGHT,((e,t)=>{const 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 Ce(n)}));function tt(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getHistoryMessage(e,t)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>F(e)))})))}))}function nt(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getRemoteHistoryMessages(e,t)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>F(e)))})))}))}function it(t,n,i,o){return G(this,void 0,void 0,(function*(){return W().next((r=>r.chat.sendReadReceiptMessage({targetId:t,conversationType:e.PRIVATE,channelId:o},n,i)))}))}function ot(t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.chat.sendReadReceiptRequest({targetId:t,conversationType:e.GROUP,channelId:i},n)))}))}function rt(e,t,n){return G(this,void 0,void 0,(function*(){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}function st(t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.chat.sendReadReceipt({targetId:t,conversationType:e.GROUP,channelId:i},n)))}))}function at(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.sendSyncReadStatusMessage(e,t)))}))}function ut(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.chat.sendReadReceiptMessageV4(e,t,n)))}))}function dt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.getMessageReadReceiptV4(e,t)))}))}function ct(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.batchGetMessageReadReceiptInfoV4(e,t)))}))}We(I.COMBINE_HTML,((e,t)=>{const 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 ce(n)}));const lt=J("recallMessage",((e,t)=>G(void 0,void 0,void 0,(function*(){return W().next((n=>G(void 0,void 0,void 0,(function*(){return(yield n.recallMessage(e,t)).trans((e=>F(e)))}))))}))));function ft(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.deleteRemoteMessage(e,t)))}))}function vt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.deleteRemoteMessageByTimestamp(e,t)))}))}function ht(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchClearRemoteHistoryMessages(e,t)))}))}function gt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.updateMessageExpansion(e,t)))}))}function Et(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeMessageExpansion(e,t)))}))}function mt(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chat.sendTypingStatus(e,t)))).trans(F)}))}function pt(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return i.chat.getMessageReader(e,t,n)}))))}))}function St(e,t,n,i,s){return $(((a,u)=>(o("messageType",e,r.STRING,!0),o("isPersited",t,r.BOOLEAN,!0),o("isCounted",n,r.BOOLEAN,!0),o("isStatusMessage",s,r.BOOLEAN),o("searchProps",i,r.ARRAY),u.info(v.A_REGTYP_O,JSON.stringify({messageType:e,isCounted:n,isStatusMessage:s,isPersited:t,searchProps:i})),a.registerMessageType(e,t,n,i,s),function(e,t=!0,n=!0){return function(i){return new ue(e,i,t,n)}}(e,t,n))))}function _t(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getFirstUnreadMessage(e)))).trans((e=>e?F(e):null))}))}function Tt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getFirstUnreadMessageDigest(e)))}))}function It(e,t,n={}){return G(this,void 0,void 0,(function*(){return B("insertMessage","electronExtension.insertMessage"),hi(e,t,n)}))}function Ct(e){throw new Error("getUnreadMentionedMessages is deprecated, please use electronExtension.getUnreadMentionedMessages instead")}function At(e,t,n,i){return G(this,void 0,void 0,(function*(){return B("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessagesWithParams"),ci(e,t,n,i)}))}function Rt(e,t,n){return G(this,void 0,void 0,(function*(){return B("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.electronExtension.deleteMessagesByTimestamp"),vi(e,t,n)}))}function Nt(e){return G(this,void 0,void 0,(function*(){return B("RongIMLib.clearMessages","RongIMLib.electronExtension.clearMessages"),fi(e)}))}function Mt(e,t,n,i){return G(this,void 0,void 0,(function*(){return B("searchConversationByContent","electronExtension.searchConversationByContent"),ui(e,null!=n?n:[h.TEXT,h.FILE],i,t)}))}function Ut(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){return n.chat.clearUnreadCountByTimestamp(e,t)}))))}))}function Ot(e,t){return G(this,void 0,void 0,(function*(){return li(e,t)}))}function xt(e){return W().next((t=>t.sse.requestStreamMessageContent(e)))}function yt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){return n.sendReadReceiptResponseV5(e,t)}))))}))}function Pt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){return n.getMessageReadReceiptInfoV5(e,t)}))))}))}function Dt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){return t.getMessageReadReceiptInfoV5ByIdentifiers(e)}))))}))}function Lt(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return i.getMessagesReadReceiptUsersByPageV5(e,t,n)}))))}))}function bt(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return i.getMessagesReadReceiptByUsersV5(e,t,n)}))))}))}function Gt(e,t){return W().next((n=>n.requestSpeechToTextForMessage(e,t)))}function Ft(e){return W().next((t=>t.translateMessagesWithParams(e)))}function Ht(e){return W().next((t=>t.translateTextsWithParams(e)))}function Bt(e,t){return G(this,void 0,void 0,(function*(){return B("modifyMessage","modifyMessageWithParams"),wt({messageUId:null==t?void 0:t.messageUId,messageContent:e,conversation:{conversationType:null==t?void 0:t.conversationType,targetId:null==t?void 0:t.targetId,channelId:null==t?void 0:t.channelId}})}))}function wt(e){return W().next((t=>t.modifyMessageWithParams(e)))}function kt(e){return W().next((t=>{const n=e=>e.map((e=>({messageUId:e.messageUId,message:e.message?F(e.message):void 0,code:e.code})));return t.refreshReferenceMessageWithParams(Object.assign(Object.assign({},e),{remoteMessageBlock:t=>{e.remoteMessageBlock&&e.remoteMessageBlock(n(t))},localMessageBlock:t=>{e.localMessageBlock&&e.localMessageBlock(n(t))}}))}))}function Vt(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getMessagesByUIds(e.conversationIdentifier,e.messageUIds)))).trans((e=>e.map((e=>({messageUId:e.messageUId,message:e.message?F(e.message):void 0,code:e.code})))))}))}function jt(e,t){return G(this,void 0,void 0,(function*(){B("getConversationList","getConversationListByTimestamp");return(yield W().next((n=>G(this,void 0,void 0,(function*(){return n.getConversationList({count:(null==e?void 0:e.count)||300,startTime:(null==e?void 0:e.startTime)||0,order:null==e?void 0:e.order,channelId:t})}))))).trans((e=>e.map(H)))}))}function Yt(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>G(this,void 0,void 0,(function*(){return t.getAllConversationList(e)}))))).trans((e=>e.map(H)))}))}function qt(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>G(this,void 0,void 0,(function*(){return t.getConversationListByTimestamp(e)}))))).trans((e=>e.map(H)))}))}function zt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){return(yield t.getConversation(e)).trans((e=>H(e)))}))))}))}const $t=J("removeConversation",((e,t)=>G(void 0,void 0,void 0,(function*(){return W().next((n=>n.removeConversation(e,t)))}))));function Wt(e){return G(this,void 0,void 0,(function*(){return B("batchRemoveConversation","batchDeleteConversations"),Xt({identifiers:e,deleteRemotely:!1,deleteMessages:!1})}))}function Xt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.batchDeleteConversations(e)))}))}function Qt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getTextMessageDraft(e)))}))}function Kt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.saveTextMessageDraft(e,t)))}))}function Jt(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.clearTextMessageDraft(e)))}))}function Zt(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getTotalUnreadCount(t,e)))}))}function en(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getTotalUnreadCountByLevels(e,t)))}))}function tn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getTotalUnreadCountByLevels(e,t,!0)))}))}function nn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUnreadCount(e)))}))}const on=J("clearMessagesUnreadStatus",(e=>G(void 0,void 0,void 0,(function*(){return W().next((t=>t.chat.clearUnreadCount(e)))}))));function rn(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.chat.clearAllUnreadCount()))}))}const sn=J("setConversationNotificationLevel",((e,t)=>G(void 0,void 0,void 0,(function*(){return W().next((n=>n.batchSetConversationNotificationLevel([e],t)))}))));function an(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchSetConversationNotificationLevel(e,t)))}))}function un(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchSetConversationTranslateStrategy(e,t)))}))}function dn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>G(this,void 0,void 0,(function*(){if(t!==x.CLOSE&&t!==x.OPEN)return c(l.INVALID_PARAMETER_NOTIFICATION_LEVEL);const i=y(t);return n.batchSetConversationNotificationLevel([e],i)}))))}))}function cn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getConversationNotificationLevel(e)))}))}function ln(e){return G(this,void 0,void 0,(function*(){return W().next((t=>G(this,void 0,void 0,(function*(){return(yield t.getConversationNotificationLevel(e)).trans((e=>P(e)))}))))}))}function fn(){return G(this,void 0,void 0,(function*(){return(yield W().next((e=>e.getBlockedConversationList()))).trans((e=>e.map(H)))}))}function vn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setConversationTypeNotificationLevel(e,t)))}))}function hn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getConversationTypeNotificationLevel(e)))}))}const gn=J("setConversationToTop",((e,t=!0,n=!0,i=!1)=>G(void 0,void 0,void 0,(function*(){return W().next((o=>o.batchSetConversationToTop([e],!!t,n,i)))}))));function En(e,t,n=!0,i=!0){return G(this,void 0,void 0,(function*(){return W().next((o=>o.batchSetConversationToTop(e,!!t,i,n)))}))}function mn(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getTopConversationList(e,t)))).trans((e=>e.map(H)))}))}function pn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getUnreadConversationList(e)))).trans((e=>e.map(H)))}))}function Sn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUnreadMentionedCount(e)))}))}function _n(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getAllUnreadMentionedCount()))}))}function Tn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>{var n,i,o;return t.getRealtimeConversations(null!==(n=null==e?void 0:e.count)&&void 0!==n?n:30,null!==(i=null==e?void 0:e.startTime)&&void 0!==i?i:0,null!==(o=null==e?void 0:e.order)&&void 0!==o?o:0)}))).trans((e=>e.map(H)))}))}function In(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getRealtimeConTotalUnreadCount()))}))}function Cn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.clearRealtimeConUnreadCount(e)))}))}function An(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeRealtimeConversations(e)))}))}function Rn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.batchGetRealtimeConUnreadCount(e)))}))}function Nn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getUnreadMentionMeConversationList(e)))).trans((e=>e.map(H)))}))}function Mn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.createConversationListLoader(e)))}))}function Un(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.chat.getConversationsIncludingRobots(e)))).trans((e=>e.map(H)))}))}function On(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.markRemoteConversationAsRead(e)))}))}function xn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUltraGroupList(e)))}))}function yn(){return G(this,void 0,void 0,(function*(){return(yield W().next((e=>e.getBlockedUGList()))).trans((e=>e.map((e=>H(e)))))}))}function Pn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.sendUltraGroupTypingStatus(e)))}))}function Dn(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>G(this,void 0,void 0,(function*(){return n.getUltraGroupMessageListByMessageUId(e,t)}))))).trans((e=>{const t={};for(const n in e)t[n]=e[n]?F(e[n]):void 0;return t}))}))}function Ln(e,t){return G(this,void 0,void 0,(function*(){return B("updateExpansionForUltraGroupMessage","updateMessageExpansion"),gt(e,t)}))}function bn(e,t){return G(this,void 0,void 0,(function*(){return B("removeExpansionForUltraGroupMessage","removeMessageExpansionForKey"),Et(e,t)}))}function Gn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeAllMessageExpansion(e)))}))}function Fn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getUGUnreadCountForAllChannels(e,!0,t)))}))}function Hn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUltraGroupDefaultNotificationLevel(null==e?void 0:e.targetId,null==e?void 0:e.channelId)))}))}function Bn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setUltraGroupDefaultNotificationLevel(null==e?void 0:e.targetId,t,null==e?void 0:e.channelId)))}))}function wn(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getUGUnreadCountForAllChannels(e,!1,t)))}))}function kn(){return G(this,void 0,void 0,(function*(){return B("getAllUltraGroupUnreadCount","getTotalUnreadCountByLevels"),en([e.ULTRA_GROUP],[])}))}function Vn(){return G(this,void 0,void 0,(function*(){return B("getAllUltraGroupUnreadMentionedCount","getTotalUnreadMentionedCountByLevels"),tn([e.ULTRA_GROUP],[])}))}function jn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUGUnreadMentionedDigest(e)))}))}function Yn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUGFirstUnreadMessageDigest(e)))}))}function qn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUGUnreadInfoList(e)))}))}function zn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.addToBlacklist(e)))}))}function $n(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeFromBlacklist(e)))}))}function Wn(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getBlacklist()))}))}function Xn(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getBlacklistStatus(e)))).trans((e=>0===e))}))}function Qn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.createTag(e)))}))}function Kn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.removeTag(e)))}))}function Jn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.updateTag(e)))}))}function Zn(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getTagList()))}))}function ei(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getTagsForConversation(e)))}))}function ti(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.addTagForConversations(e,t)))}))}function ni(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeTagForConversations(e,t)))}))}function ii(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeTagsForConversation(e,t)))}))}function oi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.removeTagForConversations(e,t)))}))}function ri(e,t,n){return G(this,void 0,void 0,(function*(){B("getConversationsFromTagByPage","createConversationListLoader");return(yield W().next((i=>i.getConversationListByTag(e,n,t)))).trans((e=>e.map((e=>{return t=e,Object.assign(Object.assign({},H(t)),{isTopInTag:t.isTopInTag});var t}))))}))}function si(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getUnreadCountByTag(e,t)))}))}function ai(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.setConversationStatusInTag(e,t,{isTop:n})))}))}function ui(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>G(this,void 0,void 0,(function*(){return(yield o.searchConversationByContent(e,t,n,i)).trans((e=>e.map((e=>H(e)))))}))))}))}function di(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.searchMessages(e,t)))).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:e,messages:t.map((e=>F(e)))})))}))}function ci(e,t,n,i,o){return G(this,void 0,void 0,(function*(){return B("RongIMLib.electronExtension.searchMessages","RongIMLib.electronExtension.searchMessagesWithParams"),di(e,{keyword:t,limit:i||L,order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{objectNames:o}})}))}function li(e,t){return G(this,void 0,void 0,(function*(){return B("setMessageReceivedStatus","setMessageReceivedStatusInfo"),W().next((n=>n.setMessageReceivedStatus(e,t)))}))}function fi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.clearLocalMessages(e)))}))}function vi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.deleteLocalMessagesByTimestamp(e,t,n)))}))}function hi(e,t,n={}){return G(this,void 0,void 0,(function*(){return t instanceof ue?function(e,t,n={}){return G(this,void 0,void 0,(function*(){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:"",messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,searchContent:o,messageDirection:M.SEND,isUnread:i,messageUId:"",disableUpdateLastMessage:r,quoteInfo:n.quoteInfo};return(yield W().next((t=>t.insertMessage(e,s)))).trans(F)}))}(e,t,n):function(e,t,n={}){return G(this,void 0,void 0,(function*(){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:null==t?void 0:t.senderUserId,messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,messageDirection:null==t?void 0:t.messageDirection,readStatus:"object"==typeof(null==t?void 0:t.receivedStatusInfo)?D(t.receivedStatusInfo):null==t?void 0:t.receivedStatus,sentTime:null==t?void 0:t.sentTime,sentStatus:null==t?void 0:t.sentStatus,searchContent:o,messageUId:"",isUnread:i,disableNotification:null==t?void 0:t.disableNotification,canIncludeExpansion:null==t?void 0:t.canIncludeExpansion,expansion:(null==t?void 0:t.expansion)||void 0,directedUserIds:null==t?void 0:t.directedUserIds,disableUpdateLastMessage:(null==t?void 0:t.disableUpdateLastMessage)||r,quoteInfo:null==t?void 0:t.quoteInfo};return(yield W().next((t=>t.insertMessage(e,s)))).trans(F)}))}(e,t,n)}))}function gi(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getLocalMessage(e)))).trans((e=>F(e)))}))}var Ei=Object.freeze({__proto__:null,getAllConversationList:function(e){return G(this,void 0,void 0,(function*(){return B("electronExtension.getAllConversationList","getAllConversationList"),Yt(e)}))},getConversationList:function(e,t,n,i){return G(this,void 0,void 0,(function*(){B("electronExtension.getConversationList","getAllConversationList or getConversationListByTimestamp");return(yield W().next((o=>G(this,void 0,void 0,(function*(){return o.getConversationList({startTime:e,count:t,channelId:n,topPriority:i})}))))).trans((e=>e.map((e=>H(e)))))}))},searchConversationByContent:ui,getConversations:function(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getConversations(e)))).trans((e=>e.map(H)))}))},getUntaggedConversationListByPage:function(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>G(this,void 0,void 0,(function*(){return(yield i.getUntaggedConversationListByPage(e,t,n)).trans((e=>e.map((e=>H(e)))))}))))}))},getRemoteConversations:function(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.syncRemoteConversations()))}))},saveEditedMessageDraft:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chat.saveEditedMessageDraft(e,t)))}))},getEditedMessageDraft:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.getEditedMessageDraft(e)))}))},clearEditedMessageDraft:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chat.clearEditedMessageDraft(e)))}))},searchMessages:ci,searchMessageInTimeRange:function(e,t){return G(this,void 0,void 0,(function*(){return B("RongIMLib.electronExtension.searchMessageInTimeRange","RongIMLib.electronExtension.searchMessagesWithParams"),di(e,{keyword:null==t?void 0:t.keyword,limit:(null==t?void 0:t.limit)||5,offset:null==t?void 0:t.offset,order:0,timeRange:{startTime:null==t?void 0:t.startTime,endTime:null==t?void 0:t.endTime}})}))},searchMessagesByUser:function(e,t,n,i){return G(this,void 0,void 0,(function*(){B("RongIMLib.electronExtension.searchMessagesByUser","RongIMLib.electronExtension.searchMessagesWithParams");return(yield di(e,{limit:i,keyword:"",order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{senderIds:[t]}})).trans((({messages:e})=>({messages:e})))}))},getHistoryMessagesByMessageTypes:function(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getHistoryMessagesByObjectNames(e,t)))).trans((({list:e,hasMore:t})=>{const n=e.map(F);return{messages:n,hasMore:t,list:n}}))}))},getContinuousMessages:function(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.getContinuousMessages(e,t)))).trans((({list:e,hasMore:t,timestamp:n})=>({hasMore:t,list:e.map(F),timestamp:n})))}))},setMessageStatusToRead:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setMessageStatusToRead(e,t)))}))},setMessageReceivedStatus:li,setMessageReceivedStatusInfo:function(e,t){return G(this,void 0,void 0,(function*(){const n=D(t||{});return W().next((t=>t.setMessageReceivedStatus(e,n)))}))},setMessageSentStatus:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.setMessageSentStatus(e,t)))}))},setMessageContent:function(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.setMessageContent(e,t,n)))}))},deleteMessages:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.deleteLocalMessages(e)))}))},clearMessages:fi,deleteMessagesByTimestamp:vi,batchClearMessagesByTimestamp:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.batchClearLocalMessagesByTimestamp(e)))}))},insertMessage:hi,batchInsertMessage:function(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.batchInsertMessage(e,t)))}))},getMessageCount:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getLocalMessageCount(e)))}))},setCheckDuplicateMessage:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setCheckDuplicateMessage(e)))}))},setCheckChatRoomDuplicateMessage:function(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chatroom.setCheckChatRoomDuplicateMessage(!!e)))}))},getMessagesAroundTimestamp:function(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>{const i=null==t?void 0:t.timestamp,o=null==t?void 0:t.beforeCount,r=null==t?void 0:t.afterCount;return n.getMessagesAroundTimestamp(e,i,o,r)}))).trans((e=>e.map(F)))}))},getLocalMessage:gi,searchMessagesWithParams:function(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.searchMessagesWithParams(e)))).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:n,messages:t.map((e=>F(e)))})))}))},setMessageSpeechToTextVisible:function(e,t){return W().next((n=>n.setMessageSpeechToTextVisible(e,t)))},deleteUltraGroupMessagesForAllChannel:function(e,t){return W().next((n=>n.deleteLocalUGMessagesForAllChannel(e,t)))},getUnreadMentionedMessages:function(e){return G(this,void 0,void 0,(function*(){return(yield W().next((t=>t.getUnreadMentionedMessages(e)))).trans((e=>e.map(F)))}))},clearLocalData:function(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.clearLocalData()))}))},enable:function(){return b()}});function mi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setProxy(e)))}))}function pi(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getProxy()))}))}function Si(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.testProxy(e,t)))}))}function _i(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.subscribeUser(e,t,n)))}))}function Ti(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.unSubscribeUser(e,t)))).wipe()}))}function Ii(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.getSubscribeUserList(e,t,n)))}))}function Ci(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.getSubscribeUserStatus(e,t)))}))}function Ai(e){return W().next((t=>t.updateMyUserProfile(e)))}function Ri(e){return W().next((t=>t.getUserProfiles(e)))}function Ni(){return W().next((e=>e.getMyUserProfile()))}function Mi(e){return W().next((t=>t.dataHosting.updateMyUserProfileVisibility(e)))}function Ui(){return W().next((e=>e.dataHosting.getMyUserProfileVisibility()))}function Oi(e){return W().next((t=>t.dataHosting.searchUserProfileByUniqueId(e)))}function xi(e){return W().next((t=>t.getSubscribeUsersOnlineStatus(e)))}function yi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.createGroup(e,t)))}))}function Pi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.updateGroupInfo(e)))}))}function Di(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.getGroupsInfo(e)))}))}function Li(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.kickGroupMembers(e,t,n)))}))}function bi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.quitGroup(e,t)))}))}function Gi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.dismissGroup(e)))}))}function Fi(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.dataHosting.transferGroupOwner(e,t,!!n,i)))}))}function Hi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.addGroupManagers(e,t)))}))}function Bi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.removeGroupManagers(e,t)))}))}function wi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.getGroupMembersByRole(e,t,n)))}))}function ki(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.getGroupMembers(e,t)))}))}function Vi(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.dataHosting.setGroupMemberInfo(e,t,n,i)))}))}function ji(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.searchGroupMembers(e,t,n)))}))}function Yi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.joinGroup(e)))}))}function qi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.inviteUsersToGroup(e,t)))}))}function zi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.acceptGroupInvite(e,t)))}))}function $i(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.refuseGroupInvite(e,t,n)))}))}function Wi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.acceptGroupApplication(e,t,n)))}))}function Xi(e,t,n,i){return G(this,void 0,void 0,(function*(){return W().next((o=>o.dataHosting.refuseGroupApplication(e,t,n,i)))}))}function Qi(e,t,n){return G(this,void 0,void 0,(function*(){return W().next((i=>i.dataHosting.getGroupApplications(e,t,n)))}))}function Ki(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.getJoinedGroupsByRole(t,e)))}))}function Ji(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.searchJoinedGroups(e,t)))}))}function Zi(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.getJoinedGroups(e)))}))}function eo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.setGroupRemark(e,t)))}))}function to(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.addGroupFollows(e,t)))}))}function no(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.removeGroupFollows(e,t)))}))}function io(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.dataHosting.getGroupFollows(e)))}))}function oo(e,t,n){return W().next((i=>i.dataHosting.addFriend(e,t,n)))}function ro(e,t){return W().next((n=>n.dataHosting.deleteFriends(e,t)))}function so(e){return W().next((t=>t.dataHosting.acceptFriendRequest(e)))}function ao(e){return W().next((t=>t.dataHosting.refuseFriendRequest(e)))}function uo(e,t,n){return W().next((i=>i.dataHosting.setFriendInfo(e,t||"",n)))}function co(e,t){return W().next((n=>n.dataHosting.checkFriends(e,t)))}function lo(e,t){return W().next((n=>n.dataHosting.getFriends(e,t)))}function fo(e,t,n){return W().next((i=>i.dataHosting.getFriendApplications(e,t,n)))}function vo(e){return W().next((t=>t.dataHosting.getFriendsInfo(e)))}function ho(e){return W().next((t=>t.dataHosting.searchFriendsInfo(e)))}function go(e){return W().next((t=>t.dataHosting.setFriendAddPermission(e)))}function Eo(){return W().next((e=>e.dataHosting.getFriendAddPermission()))}function mo(e){!function(e){var t,n,i;Y?z.warn(v.A_INIT_REPEAT_O):(o("options.appkey",e.appkey,r.STRING,!0),o("options.navigators",e.navigators,(e=>s(e)&&(0===e.length||e.every(a)))),o("options.loggerProxy",e.loggerProxy,(e=>e instanceof u)),q=e,Y=d.init({appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,uploadDomain:e.uploadDomain,environment:null!==(t=e.environment)&&void 0!==t?t:"default",eventLoopBlockingCheck:e.eventLoopBlockingCheck,enableReadReceiptStorage:null===(n=e.enableReadReceiptStorage)||void 0===n||n,useNaviV2:null!==(i=e.useNaviV2)&&void 0!==i&&i,loggerProxy:e.loggerProxy,conversationCachePolicy:e.conversationCachePolicy}),z=Y.logger,Y.assignWatcher(V),Y.sse.on("message",((e,t)=>{const n=Object.assign(Object.assign({},t),{message:t.message?F(t.message):void 0});k.emit(w.STREAM_MESSAGE_RESPONSE,n)})))}(e)}function po(){return G(this,void 0,void 0,(function*(){return ae(),function(){return G(this,void 0,void 0,(function*(){Y&&(yield d.destroy(),q=null,Y=null,z=null)}))}()}))}function So(){return $((e=>e.getConnectionStatus()))}function _o(){return $((e=>e.getServerTime()))}function To(){return $((e=>e.getCurrentUserId()))}function Io(e,t){i.add(e,t)}function Co(){return $((e=>e.getDeviceId()))}function Ao(){const e=W().tryTrans((e=>e.getAppSettings()));return e.isOk?e.data:null}const Ro={COMET:"_",WEBSOCKET:"_"};function No(e){return W().next((t=>t.setNotificationQuietHoursWithSetting(e)))}function Mo(){return W().next((e=>e.removeNotificationQuietHoursSetting()))}function Uo(){return W().next((e=>e.getNotificationQuietHoursSetting()))}function Oo(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chatroom.joinChatroom(e,null==t?void 0:t.count,!0,null==t?void 0:t.extra)))).wipe()}))}function xo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.joinChatroom(e,null==t?void 0:t.count,!1,null==t?void 0:t.extra)))}))}function yo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.quitChatroom(e,t)))}))}function Po(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.getChatroomInfo(e,null==t?void 0:t.count,null==t?void 0:t.order)))}))}function Do(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.setChatroomEntry(e,t,!1)))}))}function Lo(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chatroom.setChatroomEntries(e,t)))).wipe()}))}function bo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.setChatroomEntry(e,t,!0)))}))}function Go(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.removeChatroomEntry(e,t,!1)))}))}function Fo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.removeChatroomEntries(e,{keys:null==t?void 0:t.entries,notificationExtra:null==t?void 0:t.notificationExtra})))}))}function Ho(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.removeChatroomEntry(e,t,!0)))}))}function Bo(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.chatroom.getChatroomEntry(e,t)))}))}function wo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chatroom.getAllChatroomEntries(e)))}))}function ko(e,t){return G(this,void 0,void 0,(function*(){return(yield W().next((n=>n.chatroom.getChatroomHistoryMessages(e,null==t?void 0:t.count,null==t?void 0:t.order,null==t?void 0:t.timestamp)))).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>F(e)))})))}))}function Vo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.chatroom.bindRTCRoomForChatroom(e)))}))}function jo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setTranslationLanguage(e)))}))}function Yo(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getTranslationLanguage()))}))}function qo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setAutoTranslateEnabled(e)))}))}function zo(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getAutoTranslateEnabled()))}))}function $o(){return W().next((e=>e.getAllRobots()))}function Wo(e){return W().next((t=>t.getRobotById(e)))}function Xo(e){return W().next((t=>t.chat.addMessageReaction(e)))}function Qo(e){return W().next((t=>t.chat.removeMessageReaction(e)))}function Ko(e){return W().next((t=>t.chat.batchGetMessageReactionSummaries(e)))}function Jo(e){return W().next((t=>t.chat.getMessageReactions(e)))}function Zo(e){return W().next((t=>t.chat.getMessageReactionUsers(e)))}export{ue as BaseMessage,ce as CombineMessage,le as CombineV2Message,fe as CommandMessage,Ro as ConnectType,w as Events,ve as FileMessage,he as GIFMessage,Ee as GroupNotificationMessage,Re as HQVoiceMessage,me as ImageMessage,Se as InformationNotificationMessage,_e as LocationMessage,Te as ReferenceMessage,Ie as RichContentMessage,Ce as SightMessage,Ae as TextMessage,be as UploadTask,Ne as VoiceMessage,Io as __addSDKVersion,so as acceptFriendApplication,Wi as acceptGroupApplication,zi as acceptGroupInvite,ti as addConversationsToTag,ie as addEventListener,oo as addFriend,to as addGroupFollows,Hi as addGroupManagers,Xo as addMessageReaction,Z as addMonitor,Qn as addTag,zn as addToBlacklist,ht as batchClearRemoteHistoryMessages,Xt as batchDeleteConversations,Ko as batchGetMessageReactionSummaries,ct as batchGetMessageReadReceiptInfoV4,Wt as batchRemoveConversation,an as batchSetConversationNotificationLevel,En as batchSetConversationToTop,un as batchSetConversationTranslateStrategy,Vo as bindRTCRoomForChatroom,co as checkFriends,rn as clearAllMessagesUnreadStatus,ae as clearEventListeners,vt as clearHistoryMessages,Nt as clearMessages,on as clearMessagesUnreadStatus,Cn as clearRealtimeConUnreadCount,Jt as clearTextMessageDraft,Ut as clearUnreadCountByTimestamp,te as connect,Mn as createConversationListLoader,yi as createGroup,Be as createUploadTask,ro as deleteFriends,Rt as deleteLocalMessagesByTimestamp,ft as deleteMessages,po as destroy,ne as disconnect,Gi as dismissGroup,Ei as electronExtension,Ho as forceRemoveChatRoomEntry,bo as forceSetChatRoomEntry,wo as getAllChatRoomEntries,Yt as getAllConversationList,$o as getAllRobots,kn as getAllUltraGroupUnreadCount,Vn as getAllUltraGroupUnreadMentionedCount,_n as getAllUnreadMentionedCount,Ao as getAppSettings,zo as getAutoTranslateEnabled,Wn as getBlacklist,Xn as getBlacklistStatus,yn as getBlockUltraGroupList,fn as getBlockedConversationList,Bo as getChatRoomEntry,Po as getChatRoomInfo,ko as getChatroomHistoryMessages,So as getConnectionStatus,zt as getConversation,jt as getConversationList,qt as getConversationListByTimestamp,cn as getConversationNotificationLevel,ln as getConversationNotificationStatus,hn as getConversationTypeNotificationLevel,ri as getConversationsFromTagByPage,Un as getConversationsIncludingRobots,To as getCurrentUserId,Co as getDeviceId,je as getDownloadAuth,Ve as getFileToken,Ye as getFileUrl,_t as getFirstUnreadMessage,Tt as getFirstUnreadMessageInfo,Eo as getFriendAddPermission,fo as getFriendApplications,lo as getFriends,vo as getFriendsInfo,Qi as getGroupApplications,io as getGroupFollows,ki as getGroupMembers,wi as getGroupMembersByRole,Di as getGroupsInfo,tt as getHistoryMessages,Zi as getJoinedGroups,Ki as getJoinedGroupsByRole,qe as getMessage,Zo as getMessageReactionUsers,Jo as getMessageReactions,Pt as getMessageReadReceiptInfoV5,Dt as getMessageReadReceiptInfoV5ByIdentifiers,dt as getMessageReadReceiptV4,pt as getMessageReader,Vt as getMessagesByUIds,bt as getMessagesReadReceiptByUsersV5,Lt as getMessagesReadReceiptUsersByPageV5,Ni as getMyUserProfile,Ui as getMyUserProfileVisibility,Uo as getNotificationQuietHoursSetting,pi as getProxy,In as getRealtimeConTotalUnreadCount,Rn as getRealtimeConUnreadCounts,Tn as getRealtimeConversations,nt as getRemoteHistoryMessages,Wo as getRobotById,_o as getServerTime,Ii as getSubscribeUserList,Ci as getSubscribeUserStatus,xi as getSubscribeUsersOnlineStatus,Zn as getTags,ei as getTagsFromConversation,Qt as getTextMessageDraft,mn as getTopConversationList,Zt as getTotalUnreadCount,en as getTotalUnreadCountByLevels,tn as getTotalUnreadMentionedCountByLevels,Yo as getTranslationLanguage,Hn as getUltraGroupDefaultNotificationLevel,Yn as getUltraGroupFirstUnreadMessageTimestamp,xn as getUltraGroupList,Dn as getUltraGroupMessageListByMessageUId,wn as getUltraGroupUnreadCountByTargetId,qn as getUltraGroupUnreadInfoList,Fn as getUltraGroupUnreadMentionedCountByTargetId,jn as getUltraGroupUnreadMentionedMessages,pn as getUnreadConversationList,nn as getUnreadCount,si as getUnreadCountByTag,Nn as getUnreadMentionMeConversationList,Sn as getUnreadMentionedCount,Ct as getUnreadMentionedMessages,Ri as getUserProfiles,mo as init,It as insertMessage,X as installPlugin,qi as inviteUsersToGroup,Oo as joinChatRoom,xo as joinExistChatRoom,Yi as joinGroup,Li as kickGroupMembers,On as markRemoteConversationAsRead,Bt as modifyMessage,wt as modifyMessageWithParams,oe as onceEventListener,yo as quitChatRoom,bi as quitGroup,lt as recallMessage,kt as refreshReferenceMessageWithParams,ao as refuseFriendApplication,Xi as refuseGroupApplication,$i as refuseGroupInvite,St as registerMessageType,Gn as removeAllExpansionForUltraGroupMessage,Fo as removeChatRoomEntries,Go as removeChatRoomEntry,$t as removeConversation,ni as removeConversationsFromTag,re as removeEventListener,se as removeEventListeners,bn as removeExpansionForUltraGroupMessage,$n as removeFromBlacklist,no as removeGroupFollows,Bi as removeGroupManagers,Et as removeMessageExpansionForKey,Qo as removeMessageReaction,ee as removeMonitor,Mo as removeNotificationQuietHoursSetting,An as removeRealtimeConversations,Kn as removeTag,oi as removeTagFromConversations,ii as removeTagsFromConversation,Gt as requestSpeechToTextForMessage,xt as requestStreamMessageContent,Kt as saveTextMessageDraft,Mt as searchConversationByContent,ho as searchFriendsInfo,ji as searchGroupMembers,Ji as searchJoinedGroups,At as searchMessages,Oi as searchUserProfileByUniqueId,Qe as sendFileMessage,Je as sendGIFMessage,Ze as sendHQVoiceMessage,Ke as sendImageMessage,ze as sendMessage,it as sendReadReceiptMessage,ut as sendReadReceiptMessageV4,ot as sendReadReceiptRequest,rt as sendReadReceiptResponse,st as sendReadReceiptResponseV2,yt as sendReadReceiptResponseV5,et as sendSightMessage,at as sendSyncReadStatusMessage,$e as sendTextMessage,mt as sendTypingStatusMessage,Pn as sendUltraGroupTypingStatus,qo as setAutoTranslateEnabled,Lo as setChatRoomEntries,Do as setChatRoomEntry,sn as setConversationNotificationLevel,dn as setConversationNotificationStatus,gn as setConversationToTop,ai as setConversationToTopInTag,vn as setConversationTypeNotificationLevel,go as setFriendAddPermission,uo as setFriendInfo,Vi as setGroupMemberInfo,eo as setGroupRemark,Ot as setMessageReceivedStatus,No as setNotificationQuietHoursWithSetting,mi as setProxy,jo as setTranslationLanguage,Bn as setUltraGroupDefaultNotificationLevel,we as stopUploadTask,_i as subscribeUserStatus,Si as testProxy,Fi as transferGroupOwner,Ft as translateMessagesWithParams,Ht as translateTextsWithParams,Ti as unSubscribeUserStatus,Ln as updateExpansionForUltraGroupMessage,Pi as updateGroupInfo,gt as updateMessageExpansion,Ai as updateMyUserProfile,Mi as updateMyUserProfileVisibility,Jn as updateTag,ke as upload};
15
+ ***************************************************************************** */function Ci(e,t,n,i){return new(n||(n=Promise))((function(o,r){function s(e){try{u(i.next(e))}catch(e){r(e)}}function a(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}u((i=i.apply(e,t||[])).next())}))}function Ni(e){return Object.assign(Object.assign({},e),{channelId:e.channelId||""})}function Mi(t){const{conversationType:n,targetId:i,latestMessage:o,unreadMessageCount:r,hasMentioned:s,mentionedInfo:a,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:E,operationTime:h,draft:m,translateStrategy:p,editedMessageDraft:g,includeRobot:S,dataMgmtInfo:_}=t,I=o&&Ni(o);let T;T=s?{type:null==a?void 0:a.type,userIdList:null==a?void 0:a.userIdList}:void 0;const A={conversationType:n,targetId:i,latestMessage:I,unreadMessageCount:r,hasMentioned:s,mentionedInfo:T,lastUnreadTime:u,notificationStatus:d,notificationLevel:c,isTop:l,channelId:f,unreadMentionedCount:v,matchCount:E,operationTime:h,draft:m||"",translateStrategy:p,editedMessageDraft:g,includeRobot:S,dataMgmtInfo:_};return A.conversationType===e.ULTRA_GROUP&&(A.firstUnreadMessage=t.firstUnreadMessage,A.channelType=t.channelType,A.unreadMentionedMeCount=t.unreadMentionedMeCount),A}function Oi(e,t){null===console||void 0===console||console.warn(`Method '${e}' is deprecated, please use '${t}' instead`)}var Ui;!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.USER_SETTINGS_SYNCED="USER_SETTINGS_SYNCED",e.USER_SETTINGS_CHANGED="USER_SETTINGS_CHANGED",e.CONVERSATIONS_SETTINGS_SYNCED="CONVERSATIONS_SETTINGS_SYNCED",e.CONVERSATION_TAG="CONVERSATION_TAG",e.TYPING_STATUS="TYPING_STATUS",e.MESSAGE_BLOCKED="MESSAGE_BLOCKED",e.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",e.CONVERSATIONS_SYNCED="CONVERSATIONS_SYNCED",e.OPERATE_STATUS="OPERATE_STATUS",e.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",e.ULTRA_GROUP_MESSAGE_MODIFIED="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.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",e.GROUP_OPERATION="GROUP_OPERATION",e.GROUP_INFO_CHANGED="GROUP_INFO_CHANGED",e.GROUP_MEMBER_INFO_CHANGED="GROUP_MEMBER_INFO_CHANGED",e.GROUP_APPLICATION_EVENT="GROUP_APPLICATION_EVENT",e.GROUP_REMARK_CHANGED_SYNC="GROUP_REMARK_CHANGED_SYNC",e.GROUP_FOLLOWS_CHANGED_SYNC="GROUP_FOLLOWS_CHANGED_SYNC",e.FRIEND_ADDED="FRIEND_ADDED",e.FRIEND_DELETE="FRIEND_DELETE",e.FRIEND_APPLICATION_STATUS_CHANGED="FRIEND_APPLICATION_STATUS_CHANGED",e.FRIEND_CLEARED="FRIEND_CLEARED",e.FRIEND_INFO_CHANGED_SYNC="FRIEND_INFO_CHANGED_SYNC",e.DATABASE_OPENED="DATABASE_OPENED",e.DATABASE_UPGRADE_WILL_START="DATABASE_UPGRADE_WILL_START",e.DATABASE_UPGRADING="DATABASE_UPGRADING",e.DATABASE_UPGRADE_DID_COMPLETE="DATABASE_UPGRADE_DID_COMPLETE",e.STREAM_MESSAGE_RESPONSE="STREAM_MESSAGE_RESPONSE",e.MESSAGE_RECEIPT_RESPONSE_V5="MESSAGE_RECEIPT_RESPONSE_V5",e.SPEECH_TO_TEXT_RESPONSE="SPEECH_TO_TEXT_RESPONSE",e.TRANSLATE_RESPONSE="TRANSLATE_RESPONSE",e.MESSAGE_MODIFIED="MESSAGE_MODIFIED",e.MESSAGE_MODIFIED_SYNC_COMPLETED="MESSAGE_MODIFIED_SYNC_COMPLETED",e.ROBOTS_SYNCED="ROBOTS_SYNCED",e.SYNC_SERVER_SAVE_UNREAD_COMPLETED="SYNC_SERVER_SAVE_UNREAD_COMPLETED",e.MESSAGE_REACTION_CHANGED="MESSAGE_REACTION_CHANGED"}(Ui||(Ui={}));const yi=new t,Pi={connection(e,t){switch(e){case n.CONNECTED:yi.emit(Ui.CONNECTED);break;case n.CONNECTING:yi.emit(Ui.CONNECTING);break;case n.SUSPENDED:yi.emit(Ui.SUSPEND,t);break;case n.DISCONNECTED:yi.emit(Ui.DISCONNECT,t)}},batchMessage:e=>{yi.emit(Ui.MESSAGES,{messages:e.map((e=>Ni(e)))})},typingState:e=>{yi.emit(Ui.TYPING_STATUS,{status:e})},readReceiptReceived:(e,t,n,i)=>{yi.emit(Ui.READ_RECEIPT_RECEIVED,{conversation:e,messageUId:t,sentTime:n,sendUserId:i})},messageReceiptRequest:(e,t,n)=>{yi.emit(Ui.MESSAGE_RECEIPT_REQUEST,{conversation:e,messageUId:t,senderUserId:n})},messageReceiptResponse:(e,t,n)=>{yi.emit(Ui.MESSAGE_RECEIPT_RESPONSE,{conversation:e,receivedUserId:t,messageUIdList:n})},conversationState:t=>{const n=t.map((({conversation:t,updatedItems:n})=>{const{conversationType:i}=t,o=Mi(t);return i===e.ULTRA_GROUP&&(o.versionTime=t.versionTime,o.unreadMessageCount=Di(t.unreadMessageCount||0),o.unreadMentionedCount=Di(t.unreadMentionedCount||0),o.unreadMentionedMeCount=Di(t.unreadMentionedMeCount||0)),{conversation:o,updatedItems:n}}));yi.emit(Ui.CONVERSATION,{conversationList:n})},chatroomState:e=>{yi.emit(Ui.CHATROOM,e)},expansion:e=>{yi.emit(Ui.EXPANSION,e)},pullFinished:()=>{yi.emit(Ui.PULL_OFFLINE_MESSAGE_FINISHED)},tag:()=>{yi.emit(Ui.TAG)},userSettingsSynced:e=>{yi.emit(Ui.USER_SETTINGS_SYNCED,e)},userSettingsChanged:e=>{yi.emit(Ui.USER_SETTINGS_CHANGED,e)},conversationStatusSynced:e=>{yi.emit(Ui.CONVERSATIONS_SETTINGS_SYNCED,e)},robotsSynced:(e,t)=>{yi.emit(Ui.ROBOTS_SYNCED,e,t)},conversationTagChanged:()=>{yi.emit(Ui.CONVERSATION_TAG)},messageBlocked:e=>{yi.emit(Ui.MESSAGE_BLOCKED,e)},ultraGroupEnable:()=>{yi.emit(Ui.ULTRA_GROUP_ENABLE)},sgRelationsSynced:e=>{yi.emit(Ui.CONVERSATIONS_SYNCED,e)},operateStatus:e=>{yi.emit(Ui.OPERATE_STATUS,e)},ultraGroupMessageExpansionUpdated:e=>{yi.emit(Ui.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,e.map((e=>Ni(e))))},ultraGroupMessageRecalled:e=>{yi.emit(Ui.ULTRA_GROUP_MESSAGE_RECALLED,e.map((e=>Ni(e))))},ultraGroupChannelChangeType:e=>{yi.emit(Ui.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,e)},ultraGroupChannelUserKicked:e=>{yi.emit(Ui.ULTRA_GROUP_CHANNEL_USER_KICKED,e)},ultraGroupChannelDelete:e=>{yi.emit(Ui.ULTRA_GROUP_CHANNEL_DELETE,e)},userGroupStatus:e=>{yi.emit(Ui.USER_GROUP_STATUS,e)},messageReadReceipt:e=>{yi.emit(Ui.MESSAGE_READ_RECEIPT_V4,e)},syncReadStatus:e=>{yi.emit(Ui.SYNC_READ_STATUS,e)},subscribedUserStatusChange:e=>{yi.emit(Ui.SUBSCRIBED_USER_STATUS_CHANGE,e)},subscribedRelationChange:e=>{yi.emit(Ui.SUBSCRIBED_RELATION_CHANGE,e)},syncSubscribedUserStatusFinished:e=>{yi.emit(Ui.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,e)},ownUserProfileChanged:e=>{yi.emit(Ui.OWN_USER_PROFILE_CHANGED,e)},groupOperation:e=>{yi.emit(Ui.GROUP_OPERATION,e)},groupInfoChanged:e=>{yi.emit(Ui.GROUP_INFO_CHANGED,e)},groupMemberInfoChanged:e=>{yi.emit(Ui.GROUP_MEMBER_INFO_CHANGED,e)},groupApplicationEvent:e=>{yi.emit(Ui.GROUP_APPLICATION_EVENT,e)},groupRemarkChangedSync:e=>{yi.emit(Ui.GROUP_REMARK_CHANGED_SYNC,e)},groupFollowsChangedSync:e=>{yi.emit(Ui.GROUP_FOLLOWS_CHANGED_SYNC,e)},friendAdd:e=>{yi.emit(Ui.FRIEND_ADDED,e)},friendDelete:e=>{yi.emit(Ui.FRIEND_DELETE,e)},friendApplicationStatusChanged:e=>{yi.emit(Ui.FRIEND_APPLICATION_STATUS_CHANGED,e)},friendCleared:e=>{yi.emit(Ui.FRIEND_CLEARED,e)},friendInfoChangedSync:e=>{yi.emit(Ui.FRIEND_INFO_CHANGED_SYNC,e)},databaseOpened:(e,t)=>{yi.emit(Ui.DATABASE_OPENED,e,t)},databaseUpgradeWillStart:()=>{yi.emit(Ui.DATABASE_UPGRADE_WILL_START)},databaseUpgrading:e=>{yi.emit(Ui.DATABASE_UPGRADING,e)},databaseUpgradeDidComplete:e=>{yi.emit(Ui.DATABASE_UPGRADE_DID_COMPLETE,e)},readReceiptResponseV5:e=>{yi.emit(Ui.MESSAGE_RECEIPT_RESPONSE_V5,e)},speechToTextResponse:e=>{yi.emit(Ui.SPEECH_TO_TEXT_RESPONSE,e)},translateResponse:e=>{yi.emit(Ui.TRANSLATE_RESPONSE,e)},messagesModified:e=>{yi.emit(Ui.MESSAGE_MODIFIED,e.map((e=>Ni(e))))},messageModifiedSyncCompleted:()=>{yi.emit(Ui.MESSAGE_MODIFIED_SYNC_COMPLETED)},syncServerSaveUnreadCompleted:()=>{yi.emit(Ui.SYNC_SERVER_SAVE_UNREAD_COMPLETED)},messageReaction(e){yi.emit(Ui.MESSAGE_REACTION_CHANGED,e)},streamMessageResponse(e){const t=Object.assign(Object.assign({},e),{message:e.message?Ni(e.message):void 0});yi.emit(Ui.STREAM_MESSAGE_RESPONSE,t)}};function Di(e){return e>999?999:e}i.add("imlib-next","5.48.0-alpha.1");let bi=null,Li=null,Gi=null;function xi(e){if(!bi)throw new Error("Not initialized yet!");return e(bi,Gi,Li)}const{setup:Fi}=o;function wi(e,t){return xi((n=>n.install(e,t)))}let Bi=0;const Hi=new Map;function ki(e,t){const n=(...e)=>{const i=[],o=[];[...Hi.values()].forEach((([e,t,r])=>{e===n&&(o.push(t),r&&i.push(r))})),i.forEach((t=>{e=t(e)}));const r=t(...e);return o.forEach((t=>{t(e,r)})),r};return Object.defineProperty(n,"original",{value:t,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(n,"monitorable",{value:!0,writable:!1,enumerable:!1,configurable:!1}),n}function Vi(e,t,n){if(!e.monitorable)throw new Error(`Not monitorable API: ${e.name}`);const i=++Bi;return Hi.set(i,[e,t,n]),i}function ji(e){Hi.delete(e)}function Yi(e,t){return Ci(this,void 0,void 0,(function*(){return(yield Fi().next((n=>n.connect(e,!!t)))).trans((e=>({userId:e})))}))}const zi=ki("disconnect",((e,t)=>xi((n=>n.disconnect(e,t)))));function $i(e,t,n){yi.on(e,t,n)}function qi(e,t,n){yi.once(e,t,n)}function Wi(e,t,n){yi.off(e,t,n)}function Xi(e){yi.removeAll(e)}function Qi(){yi.clear()}class Ki{constructor(e,t,n=!0,i=!0){Object.defineProperty(this,"messageType",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"isPersited",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isCounted",{enumerable:!0,configurable:!0,writable:!0,value:i})}}class Ji extends Ki{constructor(e,t,n){super(e,n,t.isPersited,t.isCounted)}}class Zi extends Ji{constructor(e){super(l.COMBINE,f(l.COMBINE),e)}}class eo extends Ji{constructor(e){super(l.COMBINE_V2,f(l.COMBINE_V2),e)}}class to extends Ji{constructor(e){super(l.COMMAND,f(l.COMMAND),e)}}class no extends Ji{constructor(e){super(l.FILE,f(l.FILE),e)}}class io extends Ji{constructor(e){super(l.GIF,f(l.GIF),e)}}const oo=l.GROUP_NOTIFICATION;class ro extends Ji{constructor(e){super(oo,f(oo),e)}}class so extends Ji{constructor(e){super(l.IMAGE,f(l.IMAGE),e)}}const ao=l.INFORMATION_NOTIFICATION;class uo extends Ji{constructor(e){super(ao,f(ao),e)}}class co extends Ji{constructor(e){super(l.LOCATION,f(l.LOCATION),e)}}class lo extends Ji{constructor(e){super(l.REFERENCE,f(l.REFERENCE),e)}}class fo extends Ji{constructor(e){super(l.RICH_CONTENT,f(l.RICH_CONTENT),e)}}class vo extends Ji{constructor(e){super(l.SIGHT,f(l.SIGHT),e)}}class Eo extends Ji{constructor(e){super(l.TEXT,f(l.TEXT),e)}}class ho extends Ji{constructor(e){super(l.HQ_VOICE,f(l.HQ_VOICE),e)}}class mo extends Ji{constructor(e){super(l.VOICE,f(l.VOICE),e)}}var po;!function(e){e.ALIYUN="aliyun",e.S3="s3",e.MINIO="minio",e.QINIU="qiniu",e.RCX="rcx"}(po||(po={}));class go{constructor(e,t,n){Object.defineProperty(this,"_url",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_authInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_getFileToken",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isAbort",{enumerable:!0,configurable:!0,writable:!0,value:!1})}isAbort(){return this._isAbort}abort(){this._isAbort=!0,this._abortHandler()}upload(e){return e.file.size>v?Promise.resolve(E(h.UPLOAD_FAIL,"the file size is over 5GB!")):e.file.size>m&&this.multipartUpload?this.multipartUpload(e):this.commonUpload(e)}}function So(e){return Math.ceil(e/1024)||0}const _o={[po.QINIU]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t),this._promise=p({url:g(this._url),headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:s}=yield this._promise.result();return this._promise=null,200===s||204===s?S({uniqueName:o.fileName,uploadMethod:_.QINIU}):E(h.UPLOAD_FAIL,s.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[po.ALIYUN]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=g(`${o.ossBucketName}.${this._url}`),s=new FormData;s.set("token",o.token),s.set("OSSAccessKeyId",o.osskeyId),s.set("policy",o.ossPolicy),s.set("Signature",o.ossSign),s.set("success_action_status","200"),s.set("key",o.fileName),s.set("file",t),this._promise=p({url:r,onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:s,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?S({uniqueName:o.fileName,uploadMethod:_.ALI}):E(h.UPLOAD_FAIL,a.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[po.S3]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i,contentDisposition:o}=e;let r=this._authInfo;const s=g(`${r.s3BucketName}.${this._url}`),a=new FormData;o?a.set("Content-Disposition",o):a.set("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),a.set("Content-Type",t.type),a.set("x-amz-credential",r.s3Credential),a.set("x-amz-algorithm",r.s3Algorithm),a.set("x-amz-date",r.s3Date),a.set("policy",r.s3Policy),a.set("x-amz-signature",r.s3Signature),a.set("key",r.fileName),a.set("file",t),this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:a,timeout:0});const{status:u,data:d}=yield this._promise.result();return this._promise=null,200===u||204===u?S({uniqueName:r.fileName,uploadMethod:_.AWS}):E(h.UPLOAD_FAIL,u.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[po.MINIO]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>Ci(this,void 0,void 0,(function*(){var t;const{file:n,fileType:i}=e;let o=yield this._getFileToken(i,n.name,"POST","uploads",void 0,So(n.size));if(!o.isOk)return o.wipe();let r=o.data;const s=g(`${this._url}/${r.minioBucketName}/${r.fileName}`),a=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploads`,headers:a,method:"POST"});const{status:u,data:d}=yield this._promise.result();this._promise=null;const c=null===(t=null==d?void 0:d.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===t?void 0:t[1];if(200!==u&&204!==u||!c)return E(h.UPLOAD_FAIL,"start upload fail");const l=[],f=yield this.requestUploadPart(s,n,c,r.fileName,e,l);if(!f.isOk)return f.wipe();if(o=yield this._getFileToken(i,r.fileName,"POST",`uploadId=${c}`,void 0,So(n.size)),!o.isOk)return o.wipe();r=o.data;let v=l.map(((e,t)=>`<Part><PartNumber>${t+1}</PartNumber><ETag>${e}</ETag></Part>`)).join("");v=`<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>${v}</CompleteMultipartUpload>`;const m=this.getBaseHeaders(n,r,e);this._promise=p({url:`${s}?uploadId=${c}`,headers:m,method:"POST",body:v,timeout:0});const{status:I}=yield this._promise.result();return this._promise=null,200===I||204===I?S({uniqueName:r.fileName,uploadMethod:_.MINIO}):E(h.UPLOAD_FAIL,"end upload fail")}))})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=g(`${this._url}/${o.minioBucketName}/${o.fileName}`),s=this.getBaseHeaders(t,o,e);this._promise=p({url:r,headers:s,onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"PUT",body:t,timeout:0});const{status:a}=yield this._promise.result();return this._promise=null,200===a||204===a?S({uniqueName:o.fileName,uploadMethod:_.MINIO}):E(h.UPLOAD_FAIL,a.toString())}))}requestUploadPart(e,t,n,i,o,r){return Ci(this,arguments,void 0,(function*(e,t,n,i,o,r,s=1,a=0){if(a>=5)return E(h.UPLOAD_FAIL,"Upload retry times exceeded 5. Procedure");const u=(s-1)*m,d=Math.min(m,t.size-u),c=`partNumber=${s}&uploadId=${n}`,l=yield this._getFileToken(o.fileType,i,"PUT",c,void 0,So(t.size));if(!l.isOk)return l.wipe();const f=l.data,v=t.slice(u,s*m),g=this.getBaseHeaders(t,f,o);this._promise=p({url:`${e}?${c}`,headers:g,method:"PUT",body:v,timeout:0,onProgress:e=>{var n;return null===(n=null==o?void 0:o.onProgress)||void 0===n?void 0:n.call(o,u+e.loaded,t.size)}});const{status:_,xhr:I}=yield this._promise.result();return this._promise=null,200===_||204===_?(r.push((null==I?void 0:I.getResponseHeader("ETag"))||""),u+d<t.size?this.requestUploadPart(e,t,n,i,o,r,s+1,0):S()):this.requestUploadPart(e,t,n,i,o,r,s,a+1)}))}getBaseHeaders(e,t,n){const{contentDisposition:i}=n;return{"Content-Disposition":`${i||("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"}}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}},[po.RCX]:class extends go{constructor(){super(...arguments),Object.defineProperty(this,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:e=>Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e,o=I.gen();let r=this._authInfo;return this._requestUploadPart(o,t,r.token,n)}))})}commonUpload(e){return Ci(this,void 0,void 0,(function*(){const{file:t,onProgress:n,fileType:i}=e;let o=this._authInfo;const r=new FormData;r.set("token",o.token),r.set("key",o.fileName),r.set("file",t);const s=g(this._url);this._promise=p({url:s,headers:{},onProgress:e=>null==n?void 0:n(e.loaded,e.total),method:"POST",body:r,timeout:0});const{status:a,data:u}=yield this._promise.result();if(this._promise=null,(200===a||204===a)&&u){const e=JSON.parse(u);return S({uniqueName:e.rc_url.file_name,downloadUrl:`${s}/${e.rc_url.path}`,uploadMethod:_.QINIU})}return E(h.UPLOAD_FAIL,a.toString())}))}_requestUploadPart(e,t,n,i){return Ci(this,arguments,void 0,(function*(e,t,n,i,o=0){const r=Math.min(m,t.size-o),s=e+t.name.substring(t.name.lastIndexOf(".")),a={Range:`bytes=${o}-${o+r}`,"X-File-TransactionId":s,"X-File-Total-Size":t.size.toString()},u=t.slice(o,o+r),d=new FormData;d.set("file",u,t.name),d.set("key",s),d.set("name",s),d.set("token",n);const c=g(this._url);this._promise=p({url:c,headers:a,onProgress:e=>null==i?void 0:i(o+e.loaded,t.size),method:"POST",body:d,timeout:0});const{status:l,data:f}=yield this._promise.result();if(this._promise=null,200===l||204===l){if(o+r<t.size)return this._requestUploadPart(e,t,n,i,o+r);const s=JSON.parse(f);return S({uniqueName:s.rc_url.file_name,downloadUrl:`${c}/${s.rc_url.path}`,uploadMethod:_.QINIU})}return E(h.UPLOAD_FAIL,l.toString())}))}_abortHandler(){var e;null===(e=this._promise)||void 0===e||e.abort()}}};function Io(e,t,n){const{promise:i,resolve:o}=A(),r=document.createElement("canvas"),s=r.getContext("2d"),a=new Image;return a.onload=e=>{const{maxHeight:i=160,maxWidth:u=160,quality:d=1,scale:c=1}=n||{},l=Ao(a.width,a.height,{maxHeight:i,maxWidth:u,scale:c});r.width=Math.min(l.w,u),r.height=Math.min(l.h,i),s.drawImage(a,l.x,l.y,l.w,l.h);let f=To(r,d);f=f.replace(/data:image\/[^;]+;base64,/,""),o(S(Object.assign(Object.assign({},t),{thumbnail:f,width:Math.ceil(l.w),height:Math.ceil(l.h)})))},a.onerror=e=>{o(E(h.UPLOAD_FAIL,`get image info fail:${JSON.stringify(e)}`))},a.src=(window.URL||window.webkitURL).createObjectURL(e),i}function To(e,t){let n=e.toDataURL("image/jpeg",t);return n.length>R-10240?To(e,t-.1):n}const Ao=(e,t,n)=>{const{maxHeight:i=160,maxWidth:o=160,scale:r=1}=n,s=e<t;let a,u,d,c=0,l=0;return(s?t/e:e/t)>r?(s?(a=e/160,u=160,d=t/a,d>i&&(l=(d-i)/2)):(a=t/160,d=160,u=e/a,u>o&&(c=(u-o)/2)),{w:u,h:d,x:-c,y:-l}):(s?(a=t/i,d=i,u=e/a):(a=e/o,u=o,d=t/a),{w:u,h:d,x:-c,y:-l})};let Ro=0;class Co{constructor(e,t){Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_client",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:++Ro}),this._promise=this._handleUpload(e,t)}abort(){var e;null===(e=this._client)||void 0===e||e.abort()}_uploadInLoop(e,t,n,i){return Ci(this,arguments,void 0,(function*(e,t,n,i,o=[]){for(let r=0;r<e.length;r++){const s=e[r],a=_o[s.type];if(!a){o.push({type:s.type,url:s.url,code:h.UPLOAD_FAIL,msg:"Upload type not supported"});continue}this._client=new a(s.url,n,i);const u=yield this._client.upload(t);if(u.isOk)return u;const{code:d}=u;if([h.RC_FILE_SIZE_EXCEED_LIMIT,h.INVALID_PARAMETER_SIZE_NOT_FOUND].includes(u.code))return u;if(this._client.isAbort())return this._client=null,u;this._client=null,o.push({type:s.type,url:s.url,code:d,msg:u.msg})}return E(h.UPLOAD_FAIL,`Failed to upload all channels, msg: ${JSON.stringify(o)}`)}))}_handleUpload(e,t){return Ci(this,void 0,void 0,(function*(){const{getFileToken:n,customDomain:i,uploadServer:o,ossConfig:r}=t,{file:s,fileType:a,thumbnailConfig:u}=e,d=yield n(a,s.name,void 0,void 0,void 0,So(s.size));if(!d.isOk)return d.wipe();const c=d.data,l=function(e,t,n){if(t)return[{type:po.RCX,url:t,p:"1"}];if(e)return JSON.parse(e).map((e=>{const t={type:po.QINIU,url:"",p:""};return Object.keys(e).forEach((n=>{"p"===n?t.p=e[n]:(t.type=n,t.url=e[n])})),t})).sort(((e,t)=>e.p-t.p));const i=[];return n&&i.push({type:po.QINIU,url:n,p:"1"}),i}(c.ossConfig||r,i,o);if(0===l.length)return E(h.INVALID_PARAMETER_MEDIA_URL,"uploadUrlList is empty");const{code:f,data:v,msg:m,isOk:p}=yield this._uploadInLoop(l,e,c,n);if(!p)return E(f,m);let{downloadUrl:g,uploadMethod:_}=v;if(!g){const e=yield t.getFileUrl(a,v.uniqueName,_,s.name);if(!e.isOk)return E(e.code,"Get download url fail");g=e.data.downloadUrl}if(!g)return E(h.UPLOAD_FAIL,"Get download url fail");const I={downloadUrl:g,uniqueName:(null==v?void 0:v.uniqueName)||"",name:s.name,size:s.size,type:s.type};if(a===T.AUDIO){return function(e,t){const n=new AudioContext({sampleRate:16e3}),{promise:i,resolve:o}=A();return n.decodeAudioData(e,(e=>{var n,i;o(S(Object.assign(Object.assign({},t),{duration:e.duration,length:e.length,sampleRate:null!==(n=e.sampleRate)&&void 0!==n?n:void 0,numberOfChannels:null!==(i=e.numberOfChannels)&&void 0!==i?i:void 0})))}),(e=>{o(E(h.UPLOAD_FAIL,`get audio info fail:${JSON.stringify(e)}`))})),i}(yield s.arrayBuffer(),I)}return a===T.IMAGE?Io(s,I,u):S(I)}))}awaitResult(){return Ci(this,void 0,void 0,(function*(){return this._promise}))}}const No={};function Mo(e,t){const n=new Co(e,t);return function(e){Ci(this,void 0,void 0,(function*(){No[e.id]=e,yield e.awaitResult(),delete No[e.id]}))}(n),n}const Oo=(e,t)=>{const n=e.getNaviInfoFromCache();return{getFileToken:M,getFileUrl:N,customDomain:t||"",ossConfig:null==n?void 0:n.ossConfig,uploadServer:null==n?void 0:n.uploadServer}};function Uo(e){return Ci(this,void 0,void 0,(function*(){return Fi().next((t=>Ci(this,void 0,void 0,(function*(){const{contentDisposition:n,fileType:i,file:o}=e;return C.create("createUploadTask").validate("contentDisposition",n,(e=>"inline"===e||"attachment"===e),!1).fail(h.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",i,T,!0).fail(h.INVALID_PARAMETER_MEDIA_TYPE).validate("file",o,(e=>e instanceof File&&(!(i===T.IMAGE&&!e.type.match(/^image\//))&&!(i===T.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(h.MEDIA_EXCEPTION).result().trans((()=>Mo(e,Oo(t,t.getOptions().uploadDomain))))}))))}))}function yo(e){return Ci(this,void 0,void 0,(function*(){return S(function(e){const t=No[e];return!!t&&(t.abort(),!0)}(e))}))}function Po(e){return Ci(this,void 0,void 0,(function*(){const{contentDisposition:t,fileType:n,file:i}=e;return Fi().next((o=>Ci(this,void 0,void 0,(function*(){const r=yield C.create("upload").validate("contentDisposition",t,(e=>"inline"===e||"attachment"===e),!1).fail(h.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",n,T,!0).fail(h.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(e=>e instanceof File&&(!(n===T.IMAGE&&!e.type.match(/^image\//))&&!(n===T.AUDIO&&!e.type.match(/^audio\//)))),!0).fail(h.MEDIA_EXCEPTION).result().next((()=>function(e,t){return Ci(this,void 0,void 0,(function*(){return new Co(e,t).awaitResult()}))}(e,Oo(o,o.getOptions().uploadDomain))));return r}))))}))}function Do(e,t,n,i){return M(e,t,n,i)}function bo(e){return Fi().next((t=>Ci(this,void 0,void 0,(function*(){return(yield C.create("getDownloadAuth").isNotEmptyString("url",e,!0).fail(h.INVALID_PARAMETER_MEDIA_URL).result().next((()=>M(1,void 0,void 0,void 0,e)))).trans((({deadline:e,token:t,downloadAuthInfo:n})=>({deadline:e,token:t,downloadAuthInfo:n})))}))))}function Lo(e,t,n,i,o){return Ci(this,void 0,void 0,(function*(){return(null==i?void 0:i.isBosRes)?S(i):N(e,t,o||_.QINIU,n)}))}function Go(e,t){return Ci(this,void 0,void 0,(function*(){return(yield K(e,t)).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:e,messages:t.map((e=>Ni(e)))})))}))}function xo(e,t,n,i,o){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.electronExtension.searchMessages","RongIMLib.electronExtension.searchMessagesWithParams"),Go(e,{keyword:t,limit:i||J,order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{objectNames:o}})}))}function Fo(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("setMessageReceivedStatus","setMessageReceivedStatusInfo"),Y(e,t)}))}function wo(e){return Ci(this,void 0,void 0,(function*(){return y(e)}))}function Bo(e,t,n){return Ci(this,void 0,void 0,(function*(){return D(e,t,n)}))}function Ho(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){return t instanceof Ki?function(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:"",messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,searchContent:o,messageDirection:X.SEND,isUnread:i,messageUId:"",disableUpdateLastMessage:r,quoteInfo:n.quoteInfo};return(yield Q(e,s)).trans(Ni)}))}(e,t,n):function(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){const i=!!(null==n?void 0:n.isUnread),o=null==n?void 0:n.searchContent,r=null==n?void 0:n.disableUpdateLastMessage,s={senderUserId:null==t?void 0:t.senderUserId,messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,messageDirection:null==t?void 0:t.messageDirection,readStatus:"object"==typeof(null==t?void 0:t.receivedStatusInfo)?z(t.receivedStatusInfo):null==t?void 0:t.receivedStatus,sentTime:null==t?void 0:t.sentTime,sentStatus:null==t?void 0:t.sentStatus,searchContent:o,messageUId:"",isUnread:i,disableNotification:null==t?void 0:t.disableNotification,canIncludeExpansion:null==t?void 0:t.canIncludeExpansion,expansion:(null==t?void 0:t.expansion)||void 0,directedUserIds:null==t?void 0:t.directedUserIds,disableUpdateLastMessage:(null==t?void 0:t.disableUpdateLastMessage)||r,quoteInfo:null==t?void 0:t.quoteInfo};return(yield Q(e,s)).trans(Ni)}))}(e,t,n)}))}function ko(e){return Ci(this,void 0,void 0,(function*(){return(yield x(e)).trans((e=>Ni(e)))}))}function Vo(e,t){return Ci(this,void 0,void 0,(function*(){Oi("getConversationList","getConversationListByTimestamp");return(yield fe({count:(null==e?void 0:e.count)||300,startTime:(null==e?void 0:e.startTime)||0,order:null==e?void 0:e.order,channelId:t})).trans((e=>e.map(Mi)))}))}function jo(e){return Ci(this,void 0,void 0,(function*(){return(yield ue(e)).trans((e=>e.map(Mi)))}))}function Yo(e){return Ci(this,void 0,void 0,(function*(){return(yield ve(e)).trans((e=>e.map(Mi)))}))}function zo(e){return Ci(this,void 0,void 0,(function*(){return(yield le(e)).trans((e=>Mi(e)))}))}const $o=ki("removeConversation",((e,t)=>Ci(void 0,void 0,void 0,(function*(){return ye(e,t)}))));function qo(e){return Ci(this,void 0,void 0,(function*(){return Oi("batchRemoveConversation","batchDeleteConversations"),Wo({identifiers:e,deleteRemotely:!1,deleteMessages:!1})}))}function Wo(e){return Ci(this,void 0,void 0,(function*(){return Z(e)}))}function Xo(e){return Ci(this,void 0,void 0,(function*(){return Ie(e)}))}function Qo(e,t){return Ci(this,void 0,void 0,(function*(){return De(e,t)}))}function Ko(e){return Ci(this,void 0,void 0,(function*(){return se(e)}))}function Jo(e,t){return Ci(this,void 0,void 0,(function*(){return Ae(t,e)}))}function Zo(e,t){return Ci(this,void 0,void 0,(function*(){return Re(e,t)}))}function er(e,t){return Ci(this,void 0,void 0,(function*(){return Re(e,t,!0)}))}function tr(e){return Ci(this,void 0,void 0,(function*(){return Ne(e)}))}const nr=ki("clearMessagesUnreadStatus",(e=>Ci(void 0,void 0,void 0,(function*(){return oe(e)}))));function ir(){return Ci(this,void 0,void 0,(function*(){return ie()}))}const or=ki("setConversationNotificationLevel",((e,t)=>Ci(void 0,void 0,void 0,(function*(){return ee([e],t)}))));function rr(e,t){return Ci(this,void 0,void 0,(function*(){return ee(e,t)}))}function sr(e,t){return Ci(this,void 0,void 0,(function*(){return ne(e,t)}))}function ar(e,t){return Ci(this,void 0,void 0,(function*(){return Fi().next((n=>Ci(this,void 0,void 0,(function*(){if(t!==be.CLOSE&&t!==be.OPEN)return E(h.INVALID_PARAMETER_NOTIFICATION_LEVEL);const n=Le(t);return ee([e],n)}))))}))}function ur(e){return Ci(this,void 0,void 0,(function*(){return Ee(e)}))}function dr(e){return Ci(this,void 0,void 0,(function*(){return(yield Ee(e)).trans((e=>he(e)))}))}function cr(){return Ci(this,void 0,void 0,(function*(){return(yield ce()).trans((e=>e.map(Mi)))}))}function lr(e,t){return Ci(this,void 0,void 0,(function*(){return Ge(e,t)}))}function fr(e){return Ci(this,void 0,void 0,(function*(){return me(e)}))}const vr=ki("setConversationToTop",((e,...t)=>Ci(void 0,[e,...t],void 0,(function*(e,t=!0,n=!0,i=!1){return te([e],!!t,n,i)}))));function Er(e,t){return Ci(this,arguments,void 0,(function*(e,t,n=!0,i=!0){return te(e,!!t,i,n)}))}function hr(e,t){return Ci(this,void 0,void 0,(function*(){return(yield Te(e,t)).trans((e=>e.map(Mi)))}))}function mr(e){return Ci(this,void 0,void 0,(function*(){return(yield Ce(e)).trans((e=>e.map(Mi)))}))}function pr(e){return Ci(this,void 0,void 0,(function*(){return Oe(e)}))}function gr(){return Ci(this,void 0,void 0,(function*(){return de()}))}function Sr(e){return Ci(this,void 0,void 0,(function*(){var t,n,i;return(yield _e(null!==(t=null==e?void 0:e.count)&&void 0!==t?t:30,null!==(n=null==e?void 0:e.startTime)&&void 0!==n?n:0,null!==(i=null==e?void 0:e.order)&&void 0!==i?i:0)).trans((e=>e.map(Mi)))}))}function _r(){return Ci(this,void 0,void 0,(function*(){return ge()}))}function Ir(e){return Ci(this,void 0,void 0,(function*(){return re(e)}))}function Tr(e){return Ci(this,void 0,void 0,(function*(){return Pe(e)}))}function Ar(e){return Ci(this,void 0,void 0,(function*(){return Se(e)}))}function Rr(e){return Ci(this,void 0,void 0,(function*(){return(yield Me(e)).trans((e=>e.map(Mi)))}))}function Cr(e){return Ci(this,void 0,void 0,(function*(){return ae(e)}))}function Nr(e){return Ci(this,void 0,void 0,(function*(){return(yield pe(e)).trans((e=>e.map(Mi)))}))}function Mr(e){return Ci(this,void 0,void 0,(function*(){return Ue(e)}))}function Or(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return(yield Ve(e,t,n,i)).trans((e=>e.map((e=>Mi(e)))))}))}const Ur=ko,yr=ki("sendMessage",((e,t,n)=>Ci(void 0,void 0,void 0,(function*(){const{disableNotification:i,isMentioned:o,directionalUserIdList:r,canIncludeExpansion:s,onSendBefore:a,expansion:u,pushConfig:d,isStatusMessage:l,disableUpdateLastMessage:f}=n||{},v=function(e,t){const{disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:E,disableUpdateLastMessage:h,needReceipt:m,quoteInfo:p}=e;return Object.assign({disableNotification:n,pushContent:i,pushData:o,isMentioned:r,mentionedType:s,mentionedUserIdList:a,directionalUserIdList:u,isVoipPush:d,canIncludeExpansion:c,expansion:l,isFilerWhiteBlacklist:f,pushConfig:v,messageId:E,disableUpdateLastMessage:h,needReceipt:m,quoteInfo:p},t)}(n||{},t),h=Object.assign(Object.assign({},e),{isMentioned:!!o,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!i,canIncludeExpansion:!!s,expansion:u||null,senderUserId:"",messageUId:"",messageDirection:X.SEND,receivedTime:0,isStatusMessage:!!l,receivedStatus:Rt.UNREAD,isOffLineMessage:!1,pushConfig:d,sentStatus:At.SENDING,sentTime:0,directedUserIds:r||[],disableUpdateLastMessage:f,quoteInfo:v.quoteInfo}),m=yield Fi().next((t=>{h.senderUserId=t.getCurrentUserId();return t.sendMessage(e,v,(e=>{h.messageId=e;try{a&&a(Ni(h))}catch(e){t.logger.error(c.L_CALLBACK_E,`Callback method "onSendBefore" execution error.\n${null==e?void 0:e.stack}`),console.error(e)}}))}));return m.isOk?m.trans((e=>Ni(e))):(h.sentStatus=At.FAILED,E(m.code,m.msg,Ni(h)))}))));function Pr(e,t,n){return yr(e,new Eo(t),n)}function Dr(e,t){return(n,i,o,r)=>Ci(this,void 0,void 0,(function*(){var a;const u=Fi();if(!u.isOk)return u.wipe();const d=u.data;if(!je("sendOptions.contentDisposition",null==r?void 0:r.contentDisposition,(e=>["inline","attachment"].includes(e))))return E(h.INVALID_PARAMETER_SENDOPTIONS);const c={contentDisposition:null==r?void 0:r.contentDisposition};if(r&&"thumbnailConfig"in r){const e=null==r?void 0:r.thumbnailConfig;if(!(je("sendOptions.maxHeight",null==e?void 0:e.maxHeight,s.NUMBER)&&je("sendOptions.maxWidth",null==e?void 0:e.maxWidth,s.NUMBER)&&je("sendOptions.quality",null==e?void 0:e.quality,s.NUMBER)&&je("sendOptions.scale",null==e?void 0:e.scale,s.NUMBER)))return E(h.INVALID_PARAMETER_SENDOPTIONS);c.thumbnailConfig=e}const{logger:l}=d,f=l.createTraceId();l.info("L-media_upload-T",JSON.stringify({filesize:i.file.size,type:e}),f);const v=yield Po({file:i.file,fileType:e,onProgress:(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}),{code:m,data:p,msg:g}=v;if(m===h.SUCCESS&&p){const e=(null===(a=null==o?void 0:o.onComplete)||void 0===a?void 0:a.call(o,Object.assign({url:p.downloadUrl},p)))||t(p,i);return l.info("L-media_upload-R",JSON.stringify({downurl:p.downloadUrl,code:h.SUCCESS}),f),yr(n,e,r)}return E(m,g)}))}const br=e=>{const t=e.match(/\.(\w+)$/);return t?t[1]:"bin"},Lr=Dr(T.FILE,((e,t)=>{const n={name:e.name,size:t.file.size,type:br(e.name),fileUrl:e.downloadUrl};return t.user&&(n.user=t.user),t.extra&&(n.extra=t.extra),t.mentionedInfo&&(n.mentionedInfo=t.mentionedInfo),new no(n)})),Gr=Dr(T.IMAGE,((e,t)=>{const n={content:e.thumbnail,imageUri:e.downloadUrl,thumWidth:e.width,thumHeight: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 so(n)})),xr=Dr(T.IMAGE,((e,t)=>{const 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 io(n)})),Fr=Dr(T.AUDIO,((e,t)=>{var n;const i={remoteUrl:e.downloadUrl,duration:Math.floor(null!==(n=e.duration)&&void 0!==n?n:0),sampleRate:e.sampleRate,numberOfChannels:e.numberOfChannels};return t.user&&(i.user=t.user),t.extra&&(i.extra=t.extra),t.mentionedInfo&&(i.mentionedInfo=t.mentionedInfo),t.audit&&(i.audit=t.audit),new ho(i)})),wr=Dr(T.SIGHT,((e,t)=>{const 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 vo(n)}));function Br(e,t){return Ci(this,void 0,void 0,(function*(){return(yield Ke(e,t)).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>Ni(e)))})))}))}function Hr(e,t){return Ci(this,void 0,void 0,(function*(){return(yield st(e,t)).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>Ni(e)))})))}))}function kr(t,n,i,o){return Ci(this,void 0,void 0,(function*(){return vt({targetId:t,conversationType:e.PRIVATE,channelId:o},n,i)}))}function Vr(t,n,i){return Ci(this,void 0,void 0,(function*(){return ht({targetId:t,conversationType:e.GROUP,channelId:i},n)}))}function jr(e,t,n){return Ci(this,void 0,void 0,(function*(){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}function Yr(t,n,i){return Ci(this,void 0,void 0,(function*(){return mt({targetId:t,conversationType:e.GROUP,channelId:i},n)}))}function zr(e,t){return Ci(this,void 0,void 0,(function*(){return gt(e,t)}))}function $r(e,t,n){return Ci(this,void 0,void 0,(function*(){return Et(e,t,n)}))}function qr(e,t){return Ci(this,void 0,void 0,(function*(){return tt(e,t)}))}function Wr(e,t){return Ci(this,void 0,void 0,(function*(){return ze(e,t)}))}Dr(T.COMBINE_HTML,((e,t)=>{const 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 Zi(n)}));const Xr=ki("recallMessage",((e,t)=>Ci(void 0,void 0,void 0,(function*(){return(yield ut(e,t)).trans((e=>Ni(e)))}))));function Qr(e,t){return Ci(this,void 0,void 0,(function*(){return We(e,t)}))}function Kr(e,t){return Ci(this,void 0,void 0,(function*(){return $e(e,t)}))}function Jr(e,t){return Ci(this,void 0,void 0,(function*(){return Ye(e,t)}))}function Zr(e,t){return Ci(this,void 0,void 0,(function*(){return Tt(e,t)}))}function es(e,t){return Ci(this,void 0,void 0,(function*(){return ct(e,t)}))}function ts(e,t){return Ci(this,void 0,void 0,(function*(){return(yield St(e,t)).trans(Ni)}))}function ns(e,t,n){return Ci(this,void 0,void 0,(function*(){return nt(e,t,n)}))}function is(e,t,n,i,o){return xi(((a,u)=>(r("messageType",e,s.STRING,!0),r("isPersited",t,s.BOOLEAN,!0),r("isCounted",n,s.BOOLEAN,!0),r("isStatusMessage",o,s.BOOLEAN),r("searchProps",i,s.ARRAY),u.info("A-regtyp-O",JSON.stringify({messageType:e,isCounted:n,isStatusMessage:o,isPersited:t,searchProps:i})),a.registerMessageType(e,t,n,i,o),function(e,t=!0,n=!0){return function(i){return new Ki(e,i,t,n)}}(e,t,n))))}function os(e){return Ci(this,void 0,void 0,(function*(){return(yield Xe(e)).trans((e=>e?Ni(e):null))}))}function rs(e){return Ci(this,void 0,void 0,(function*(){return Qe(e)}))}function ss(e,t){return Ci(this,arguments,void 0,(function*(e,t,n={}){return Oi("insertMessage","electronExtension.insertMessage"),Ho(e,t,n)}))}function as(e){throw new Error("getUnreadMentionedMessages is deprecated, please use electronExtension.getUnreadMentionedMessages instead")}function us(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessagesWithParams"),xo(e,t,n,i)}))}function ds(e,t,n){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.electronExtension.deleteMessagesByTimestamp"),Bo(e,t,n)}))}function cs(e){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.clearMessages","RongIMLib.electronExtension.clearMessages"),wo(e)}))}function ls(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Oi("searchConversationByContent","electronExtension.searchConversationByContent"),Or(e,null!=n?n:[l.TEXT,l.FILE],i,t)}))}function fs(e,t){return Ci(this,void 0,void 0,(function*(){return qe(e,t)}))}function vs(e,t){return Ci(this,void 0,void 0,(function*(){return Fo(e,t)}))}function Es(e){return ft(e)}function hs(e,t){return Ci(this,void 0,void 0,(function*(){return pt(e,t)}))}function ms(e,t){return Ci(this,void 0,void 0,(function*(){return Ze(e,t)}))}function ps(e){return Ci(this,void 0,void 0,(function*(){return et(e)}))}function gs(e,t,n){return Ci(this,void 0,void 0,(function*(){return rt(e,t,n)}))}function Ss(e,t,n){return Ci(this,void 0,void 0,(function*(){return ot(e,t,n)}))}function _s(e,t){return lt(e,t)}function Is(e){return _t(e)}function Ts(e){return It(e)}function As(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("modifyMessage","modifyMessageWithParams"),Rs({messageUId:null==t?void 0:t.messageUId,messageContent:e,conversation:{conversationType:null==t?void 0:t.conversationType,targetId:null==t?void 0:t.targetId,channelId:null==t?void 0:t.channelId}})}))}function Rs(e){return at(e)}function Cs(e){const t=e=>e.map((e=>({messageUId:e.messageUId,message:e.message?Ni(e.message):void 0,code:e.code})));return dt(Object.assign(Object.assign({},e),{remoteMessageBlock:n=>{e.remoteMessageBlock&&e.remoteMessageBlock(t(n))},localMessageBlock:n=>{e.localMessageBlock&&e.localMessageBlock(t(n))}}))}function Ns(e){return Ci(this,void 0,void 0,(function*(){return(yield it(e.conversationIdentifier,e.messageUIds)).trans((e=>e.map((e=>({messageUId:e.messageUId,message:e.message?Ni(e.message):void 0,code:e.code})))))}))}function Ms(e,t){return Ci(this,void 0,void 0,(function*(){return Je(e,t)}))}function Os(e){return Ci(this,void 0,void 0,(function*(){return(yield Ot(e)).trans((e=>e))}))}function Us(){return Ci(this,void 0,void 0,(function*(){return(yield Ct()).trans((e=>e.map((e=>Mi(e)))))}))}function ys(e){return Ci(this,void 0,void 0,(function*(){return Lt(e)}))}function Ps(e,t){return Ci(this,void 0,void 0,(function*(){const n=Array.isArray(t)?t.map((e=>null==e?void 0:e.messageUId)):t;return(yield Ut(e,n)).trans((e=>{const n={};return e.forEach((e=>{n[e.messageUId]=Ni(e)})),t.forEach((({messageUId:e})=>{e in n||(n[e]=void 0)})),n}))}))}function Ds(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("updateExpansionForUltraGroupMessage","updateMessageExpansion"),Zr(e,t)}))}function bs(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("removeExpansionForUltraGroupMessage","removeMessageExpansionForKey"),es(e,t)}))}function Ls(e){return Ci(this,void 0,void 0,(function*(){return bt(e)}))}function Gs(e,t){return Ci(this,void 0,void 0,(function*(){return yt(e,t,!0)}))}function xs(e){return Ci(this,void 0,void 0,(function*(){return Nt(null==e?void 0:e.targetId,null==e?void 0:e.channelId)}))}function Fs(e,t){return Ci(this,void 0,void 0,(function*(){return Gt(null==e?void 0:e.targetId,t,null==e?void 0:e.channelId)}))}function ws(e,t){return Ci(this,void 0,void 0,(function*(){return yt(e,t,!1)}))}function Bs(){return Ci(this,void 0,void 0,(function*(){return Oi("getAllUltraGroupUnreadCount","getTotalUnreadCountByLevels"),Zo([e.ULTRA_GROUP],[])}))}function Hs(){return Ci(this,void 0,void 0,(function*(){return Oi("getAllUltraGroupUnreadMentionedCount","getTotalUnreadMentionedCountByLevels"),er([e.ULTRA_GROUP],[])}))}function ks(e){return Ci(this,void 0,void 0,(function*(){return Dt(e)}))}function Vs(t){return Ci(this,void 0,void 0,(function*(){return Mt(Object.assign(Object.assign({},t),{conversationType:e.ULTRA_GROUP}))}))}function js(e){return Ci(this,void 0,void 0,(function*(){return Pt(e)}))}function Ys(e){return Ci(this,void 0,void 0,(function*(){return xt(e)}))}function zs(e){return Ci(this,void 0,void 0,(function*(){return Bt(e)}))}function $s(){return Ci(this,void 0,void 0,(function*(){return Ft()}))}function qs(e){return Ci(this,void 0,void 0,(function*(){return(yield wt(e)).trans((e=>0===e))}))}function Ws(e){return Ci(this,void 0,void 0,(function*(){return kt(e)}))}function Xs(e){return Ci(this,void 0,void 0,(function*(){return qt(e)}))}function Qs(e){return Ci(this,void 0,void 0,(function*(){return Qt(e)}))}function Ks(){return Ci(this,void 0,void 0,(function*(){return jt()}))}function Js(e){return Ci(this,void 0,void 0,(function*(){return Yt(e)}))}function Zs(e,t){return Ci(this,void 0,void 0,(function*(){return Ht(e,t)}))}function ea(e,t){return Ci(this,void 0,void 0,(function*(){return $t(e,t)}))}function ta(e,t){return Ci(this,void 0,void 0,(function*(){return Wt(e,t)}))}function na(e,t){return Ci(this,void 0,void 0,(function*(){return $t(e,t)}))}function ia(e,t,n){return Ci(this,void 0,void 0,(function*(){Oi("getConversationsFromTagByPage","createConversationListLoader");return(yield Vt(e,n,t)).trans((e=>e.map((e=>{return t=e,Object.assign(Object.assign({},Mi(t)),{isTopInTag:t.isTopInTag});var t}))))}))}function oa(e,t){return Ci(this,void 0,void 0,(function*(){return zt(e,t)}))}function ra(e,t,n){return Ci(this,void 0,void 0,(function*(){return Xt(e,t,{isTop:n})}))}var sa=Object.freeze({__proto__:null,batchClearMessagesByTimestamp:function(e){return Ci(this,void 0,void 0,(function*(){return O(e)}))},batchInsertMessage:function(e,t){return Ci(this,void 0,void 0,(function*(){return U(e,t)}))},clearEditedMessageDraft:function(e){return Ci(this,void 0,void 0,(function*(){return xe(e)}))},clearLocalData:function(){return Ci(this,void 0,void 0,(function*(){return Kt()}))},clearMessages:wo,deleteMessages:function(e){return Ci(this,void 0,void 0,(function*(){return P(e)}))},deleteMessagesByTimestamp:Bo,deleteUltraGroupMessagesForAllChannel:function(e,t){return b(e,t)},enable:function(){return Jt()},getAllConversationList:function(e){return Ci(this,void 0,void 0,(function*(){return Oi("electronExtension.getAllConversationList","getAllConversationList"),jo(e)}))},getContinuousMessages:function(e,t){return Ci(this,void 0,void 0,(function*(){return(yield L(e,t)).trans((({list:e,hasMore:t,timestamp:n})=>({hasMore:t,list:e.map(Ni),timestamp:n})))}))},getConversationList:function(e,t,n,i){return Ci(this,void 0,void 0,(function*(){Oi("electronExtension.getConversationList","getAllConversationList or getConversationListByTimestamp");return(yield fe({startTime:e,count:t,channelId:n,topPriority:i})).trans((e=>e.map((e=>Mi(e)))))}))},getConversations:function(e){return Ci(this,void 0,void 0,(function*(){return(yield Fe(e)).trans((e=>e.map(Mi)))}))},getEditedMessageDraft:function(e){return Ci(this,void 0,void 0,(function*(){return we(e)}))},getHistoryMessagesByMessageTypes:function(e,t){return Ci(this,void 0,void 0,(function*(){return(yield G(e,t)).trans((({list:e,hasMore:t})=>{const n=e.map(Ni);return{messages:n,hasMore:t,list:n}}))}))},getLocalMessage:ko,getMessageCount:function(e){return Ci(this,void 0,void 0,(function*(){return F(e)}))},getMessagesAroundTimestamp:function(e,t){return Ci(this,void 0,void 0,(function*(){const n=null==t?void 0:t.timestamp,i=null==t?void 0:t.beforeCount,o=null==t?void 0:t.afterCount;return(yield w(e,n,i,o)).trans((e=>e.map(Ni)))}))},getRemoteConversations:function(){return Ci(this,void 0,void 0,(function*(){return Be()}))},getUnreadMentionedMessages:function(e){return Ci(this,void 0,void 0,(function*(){return(yield B(e)).trans((e=>e.map(Ni)))}))},getUntaggedConversationListByPage:function(e,t,n){return Ci(this,void 0,void 0,(function*(){return(yield He(e,t,n)).trans((e=>e.map((e=>Mi(e)))))}))},insertMessage:Ho,saveEditedMessageDraft:function(e,t){return Ci(this,void 0,void 0,(function*(){return ke(e,t)}))},searchConversationByContent:Or,searchMessageInTimeRange:function(e,t){return Ci(this,void 0,void 0,(function*(){return Oi("RongIMLib.electronExtension.searchMessageInTimeRange","RongIMLib.electronExtension.searchMessagesWithParams"),Go(e,{keyword:null==t?void 0:t.keyword,limit:(null==t?void 0:t.limit)||5,offset:null==t?void 0:t.offset,order:0,timeRange:{startTime:null==t?void 0:t.startTime,endTime:null==t?void 0:t.endTime}})}))},searchMessages:xo,searchMessagesByUser:function(e,t,n,i){return Ci(this,void 0,void 0,(function*(){Oi("RongIMLib.electronExtension.searchMessagesByUser","RongIMLib.electronExtension.searchMessagesWithParams");return(yield Go(e,{limit:i,keyword:"",order:0,timeRange:{endTime:n?n-1:n||0},messageFilter:{senderIds:[t]}})).trans((({messages:e})=>({messages:e})))}))},searchMessagesWithParams:function(e){return Ci(this,void 0,void 0,(function*(){return(yield H(e)).trans((({totalMatched:e,messages:t,conditionsMatched:n})=>({count:n,messages:t.map((e=>Ni(e)))})))}))},setCheckChatRoomDuplicateMessage:function(e){return Ci(this,void 0,void 0,(function*(){return k(!!e)}))},setCheckDuplicateMessage:function(e){return Ci(this,void 0,void 0,(function*(){return V(e)}))},setMessageContent:function(e,t,n){return Ci(this,void 0,void 0,(function*(){return j(e,t,n)}))},setMessageReceivedStatus:Fo,setMessageReceivedStatusInfo:function(e,t){return Ci(this,void 0,void 0,(function*(){const n=z(t||{});return Y(e,n)}))},setMessageSentStatus:function(e,t){return Ci(this,void 0,void 0,(function*(){return $(e,t)}))},setMessageSpeechToTextVisible:function(e,t){return q(e,t)},setMessageStatusToRead:function(e,t){return Ci(this,void 0,void 0,(function*(){return W(e,t)}))}});function aa(e){return Ci(this,void 0,void 0,(function*(){return en(e)}))}function ua(){return Ci(this,void 0,void 0,(function*(){return Zt()}))}function da(e,t){return Ci(this,void 0,void 0,(function*(){return tn(e,t)}))}function ca(e,t,n){return Ci(this,void 0,void 0,(function*(){return cn(e,t,n)}))}function la(e,t){return Ci(this,void 0,void 0,(function*(){return(yield ln(e,t)).wipe()}))}function fa(e,t,n){return Ci(this,void 0,void 0,(function*(){return rn(e,t,n)}))}function va(e,t){return Ci(this,void 0,void 0,(function*(){return sn(e,t)}))}function Ea(e){return fn(e)}function ha(e){return un(e)}function ma(){return nn()}function pa(e){return vn(e)}function ga(){return on()}function Sa(e){return dn(e)}function _a(e){return an(e)}function Ia(e,t){return Ci(this,void 0,void 0,(function*(){return gn(e,t)}))}function Ta(e){return Ci(this,void 0,void 0,(function*(){return Hn(e)}))}function Aa(e){return Ci(this,void 0,void 0,(function*(){return Rn(e)}))}function Ra(e,t,n){return Ci(this,void 0,void 0,(function*(){return Un(e,t,n)}))}function Ca(e,t){return Ci(this,void 0,void 0,(function*(){return yn(e,t)}))}function Na(e){return Ci(this,void 0,void 0,(function*(){return Sn(e)}))}function Ma(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Bn(e,t,!!n,i)}))}function Oa(e,t){return Ci(this,void 0,void 0,(function*(){return pn(e,t)}))}function Ua(e,t){return Ci(this,void 0,void 0,(function*(){return Ln(e,t)}))}function ya(e,t,n){return Ci(this,void 0,void 0,(function*(){return An(e,t,n)}))}function Pa(e,t){return Ci(this,void 0,void 0,(function*(){return Tn(e,t)}))}function Da(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return Fn(e,t,n,i)}))}function ba(e,t,n){return Ci(this,void 0,void 0,(function*(){return Gn(e,t,n)}))}function La(e){return Ci(this,void 0,void 0,(function*(){return On(e)}))}function Ga(e,t){return Ci(this,void 0,void 0,(function*(){return Mn(e,t)}))}function xa(e,t){return Ci(this,void 0,void 0,(function*(){return(yield hn(e,t)).wipe()}))}function Fa(e,t,n){return Ci(this,void 0,void 0,(function*(){return(yield Dn(e,t,n)).wipe()}))}function wa(e,t,n){return Ci(this,void 0,void 0,(function*(){return En(e,t,n)}))}function Ba(e,t,n,i){return Ci(this,void 0,void 0,(function*(){return(yield Pn(e,t,n,i)).wipe()}))}function Ha(e,t,n){return Ci(this,void 0,void 0,(function*(){return _n(e,t,n)}))}function ka(e,t){return Ci(this,void 0,void 0,(function*(){return Nn(t,e)}))}function Va(e,t){return Ci(this,void 0,void 0,(function*(){return xn(e,t)}))}function ja(e){return Ci(this,void 0,void 0,(function*(){return Cn(e)}))}function Ya(e,t){return Ci(this,void 0,void 0,(function*(){return wn(e,t)}))}function za(e,t){return Ci(this,void 0,void 0,(function*(){return mn(e,t)}))}function $a(e,t){return Ci(this,void 0,void 0,(function*(){return bn(e,t)}))}function qa(e){return Ci(this,void 0,void 0,(function*(){return In(e)}))}function Wa(e,t,n){return Vn(e,t,n)}function Xa(e,t){return Yn(e,t)}function Qa(e){return kn(e)}function Ka(e){return Xn(e)}function Ja(e,t,n){return Jn(e,t||"",n)}function Za(e,t){return jn(e,t)}function eu(e,t){return qn(e,t)}function tu(e,t,n){return $n(e,t,n)}function nu(e){return Wn(e)}function iu(e){return Qn(e)}function ou(e){return Kn(e)}function ru(){return zn()}function su(e){!function(e){var t,n,i;bi?Gi.warn(c.A_INIT_REPEAT_O):(r("options.appkey",e.appkey,s.STRING,!0),r("options.navigators",e.navigators,(e=>a(e)&&(0===e.length||e.every(u)))),r("options.loggerProxy",e.loggerProxy,(e=>e instanceof d)),Li=e,bi=o.init({appkey:e.appkey,navigators:e.navigators||[],miniCMPProxy:e.customCMP||[],logOutputLevel:e.logOutputLevel,httpInMainProcess:!!e.httpInMainProcess,logExpireTime:e.logExpireTime,areaCode:e.areaCode,logServerUrl:e.logServerUrl,uploadDomain:e.uploadDomain,environment:null!==(t=e.environment)&&void 0!==t?t:"default",eventLoopBlockingCheck:e.eventLoopBlockingCheck,enableReadReceiptStorage:null===(n=e.enableReadReceiptStorage)||void 0===n||n,useNaviV2:null!==(i=e.useNaviV2)&&void 0!==i&&i,loggerProxy:e.loggerProxy,conversationCachePolicy:e.conversationCachePolicy}),Gi=bi.logger,bi.assignWatcher(Pi))}(e)}function au(){return Ci(this,void 0,void 0,(function*(){return Qi(),function(){return Ci(this,void 0,void 0,(function*(){bi&&(yield o.destroy(),Li=null,bi=null,Gi=null)}))}()}))}function uu(){return xi((e=>e.getConnectionStatus()))}function du(){return xi((e=>e.getServerTime()))}function cu(){return xi((e=>e.getCurrentUserId()))}function lu(e,t){i.add(e,t)}function fu(){return xi((e=>e.getDeviceId()))}function vu(){const e=Zn();return e.isOk?e.data:null}const Eu={COMET:"_",WEBSOCKET:"_"};function hu(e){return ni(e)}function mu(){return ti()}function pu(){return ei()}function gu(e,t){return Ci(this,void 0,void 0,(function*(){return(yield ci(e,null==t?void 0:t.count,!0,null==t?void 0:t.extra)).wipe()}))}function Su(e,t){return Ci(this,void 0,void 0,(function*(){return ci(e,null==t?void 0:t.count,!1,null==t?void 0:t.extra)}))}function _u(e,t){return Ci(this,void 0,void 0,(function*(){return li(e,t)}))}function Iu(e,t){return Ci(this,void 0,void 0,(function*(){return ui(e,null==t?void 0:t.count,null==t?void 0:t.order)}))}function Tu(e,t){return Ci(this,void 0,void 0,(function*(){return ri(e,t,!1)}))}function Au(e,t){return Ci(this,void 0,void 0,(function*(){return(yield vi(e,t)).wipe()}))}function Ru(e,t){return Ci(this,void 0,void 0,(function*(){return ri(e,t,!0)}))}function Cu(e,t){return Ci(this,void 0,void 0,(function*(){return oi(e,t,!1)}))}function Nu(e,t){return Ci(this,void 0,void 0,(function*(){return fi(e,{keys:null==t?void 0:t.entries,notificationExtra:null==t?void 0:t.notificationExtra})}))}function Mu(e,t){return Ci(this,void 0,void 0,(function*(){return oi(e,t,!0)}))}function Ou(e,t){return Ci(this,void 0,void 0,(function*(){return ai(e,t)}))}function Uu(e){return Ci(this,void 0,void 0,(function*(){return si(e)}))}function yu(e,t){return Ci(this,void 0,void 0,(function*(){return(yield di(e,null==t?void 0:t.count,null==t?void 0:t.order,null==t?void 0:t.timestamp)).trans((({list:e,hasMore:t})=>({hasMore:t,list:e.map((e=>Ni(e)))})))}))}function Pu(e){return Ci(this,void 0,void 0,(function*(){return ii(e)}))}function Du(e){return Ci(this,void 0,void 0,(function*(){return pi(e)}))}function bu(){return Ci(this,void 0,void 0,(function*(){return hi()}))}function Lu(e){return Ci(this,void 0,void 0,(function*(){return mi(e)}))}function Gu(){return Ci(this,void 0,void 0,(function*(){return Ei()}))}function xu(){return gi()}function Fu(e){return Si(e)}function wu(e){return _i(e)}function Bu(e){return Ri(e)}function Hu(e){return Ii(e)}function ku(e){return Ai(e)}function Vu(e){return Ti(e)}export{Ki as BaseMessage,Zi as CombineMessage,eo as CombineV2Message,to as CommandMessage,Eu as ConnectType,Ui as Events,no as FileMessage,io as GIFMessage,ro as GroupNotificationMessage,ho as HQVoiceMessage,so as ImageMessage,uo as InformationNotificationMessage,co as LocationMessage,lo as ReferenceMessage,fo as RichContentMessage,vo as SightMessage,Eo as TextMessage,Co as UploadTask,mo as VoiceMessage,lu as __addSDKVersion,Qa as acceptFriendApplication,wa as acceptGroupApplication,xa as acceptGroupInvite,Zs as addConversationsToTag,$i as addEventListener,Wa as addFriend,za as addGroupFollows,Oa as addGroupManagers,wu as addMessageReaction,Vi as addMonitor,Ws as addTag,Ys as addToBlacklist,Jr as batchClearRemoteHistoryMessages,Wo as batchDeleteConversations,Hu as batchGetMessageReactionSummaries,Wr as batchGetMessageReadReceiptInfoV4,qo as batchRemoveConversation,rr as batchSetConversationNotificationLevel,Er as batchSetConversationToTop,sr as batchSetConversationTranslateStrategy,Pu as bindRTCRoomForChatroom,Za as checkFriends,ir as clearAllMessagesUnreadStatus,Qi as clearEventListeners,Kr as clearHistoryMessages,cs as clearMessages,nr as clearMessagesUnreadStatus,Ir as clearRealtimeConUnreadCount,Ko as clearTextMessageDraft,fs as clearUnreadCountByTimestamp,Yi as connect,Cr as createConversationListLoader,Ia as createGroup,Uo as createUploadTask,Xa as deleteFriends,ds as deleteLocalMessagesByTimestamp,Qr as deleteMessages,au as destroy,zi as disconnect,Na as dismissGroup,sa as electronExtension,Mu as forceRemoveChatRoomEntry,Ru as forceSetChatRoomEntry,Uu as getAllChatRoomEntries,jo as getAllConversationList,xu as getAllRobots,Bs as getAllUltraGroupUnreadCount,Hs as getAllUltraGroupUnreadMentionedCount,gr as getAllUnreadMentionedCount,vu as getAppSettings,Gu as getAutoTranslateEnabled,$s as getBlacklist,qs as getBlacklistStatus,Us as getBlockUltraGroupList,cr as getBlockedConversationList,Ou as getChatRoomEntry,Iu as getChatRoomInfo,yu as getChatroomHistoryMessages,uu as getConnectionStatus,zo as getConversation,Vo as getConversationList,Yo as getConversationListByTimestamp,ur as getConversationNotificationLevel,dr as getConversationNotificationStatus,fr as getConversationTypeNotificationLevel,ia as getConversationsFromTagByPage,Nr as getConversationsIncludingRobots,cu as getCurrentUserId,fu as getDeviceId,bo as getDownloadAuth,Do as getFileToken,Lo as getFileUrl,os as getFirstUnreadMessage,rs as getFirstUnreadMessageInfo,ru as getFriendAddPermission,tu as getFriendApplications,eu as getFriends,nu as getFriendsInfo,Ha as getGroupApplications,qa as getGroupFollows,Pa as getGroupMembers,ya as getGroupMembersByRole,Aa as getGroupsInfo,Br as getHistoryMessages,ja as getJoinedGroups,ka as getJoinedGroupsByRole,Ur as getMessage,Ms as getMessageCountDetail,Vu as getMessageReactionUsers,ku as getMessageReactions,ms as getMessageReadReceiptInfoV5,ps as getMessageReadReceiptInfoV5ByIdentifiers,qr as getMessageReadReceiptV4,ns as getMessageReader,Ns as getMessagesByUIds,Ss as getMessagesReadReceiptByUsersV5,gs as getMessagesReadReceiptUsersByPageV5,ma as getMyUserProfile,ga as getMyUserProfileVisibility,pu as getNotificationQuietHoursSetting,ua as getProxy,_r as getRealtimeConTotalUnreadCount,Ar as getRealtimeConUnreadCounts,Sr as getRealtimeConversations,Hr as getRemoteHistoryMessages,Fu as getRobotById,du as getServerTime,fa as getSubscribeUserList,va as getSubscribeUserStatus,_a as getSubscribeUsersOnlineStatus,Ks as getTags,Js as getTagsFromConversation,Xo as getTextMessageDraft,hr as getTopConversationList,Jo as getTotalUnreadCount,Zo as getTotalUnreadCountByLevels,er as getTotalUnreadMentionedCountByLevels,bu as getTranslationLanguage,xs as getUltraGroupDefaultNotificationLevel,Vs as getUltraGroupFirstUnreadMessageTimestamp,Os as getUltraGroupList,Ps as getUltraGroupMessageListByMessageUId,ws as getUltraGroupUnreadCountByTargetId,js as getUltraGroupUnreadInfoList,Gs as getUltraGroupUnreadMentionedCountByTargetId,ks as getUltraGroupUnreadMentionedMessages,mr as getUnreadConversationList,tr as getUnreadCount,oa as getUnreadCountByTag,Rr as getUnreadMentionMeConversationList,pr as getUnreadMentionedCount,as as getUnreadMentionedMessages,ha as getUserProfiles,su as init,ss as insertMessage,wi as installPlugin,Ga as inviteUsersToGroup,gu as joinChatRoom,Su as joinExistChatRoom,La as joinGroup,Ra as kickGroupMembers,Mr as markRemoteConversationAsRead,As as modifyMessage,Rs as modifyMessageWithParams,qi as onceEventListener,_u as quitChatRoom,Ca as quitGroup,Xr as recallMessage,Cs as refreshReferenceMessageWithParams,Ka as refuseFriendApplication,Ba as refuseGroupApplication,Fa as refuseGroupInvite,is as registerMessageType,Ls as removeAllExpansionForUltraGroupMessage,Nu as removeChatRoomEntries,Cu as removeChatRoomEntry,$o as removeConversation,ea as removeConversationsFromTag,Wi as removeEventListener,Xi as removeEventListeners,bs as removeExpansionForUltraGroupMessage,zs as removeFromBlacklist,$a as removeGroupFollows,Ua as removeGroupManagers,es as removeMessageExpansionForKey,Bu as removeMessageReaction,ji as removeMonitor,mu as removeNotificationQuietHoursSetting,Tr as removeRealtimeConversations,Xs as removeTag,na as removeTagFromConversations,ta as removeTagsFromConversation,_s as requestSpeechToTextForMessage,Es as requestStreamMessageContent,Qo as saveTextMessageDraft,ls as searchConversationByContent,iu as searchFriendsInfo,ba as searchGroupMembers,Va as searchJoinedGroups,us as searchMessages,Sa as searchUserProfileByUniqueId,Lr as sendFileMessage,xr as sendGIFMessage,Fr as sendHQVoiceMessage,Gr as sendImageMessage,yr as sendMessage,kr as sendReadReceiptMessage,$r as sendReadReceiptMessageV4,Vr as sendReadReceiptRequest,jr as sendReadReceiptResponse,Yr as sendReadReceiptResponseV2,hs as sendReadReceiptResponseV5,wr as sendSightMessage,zr as sendSyncReadStatusMessage,Pr as sendTextMessage,ts as sendTypingStatusMessage,ys as sendUltraGroupTypingStatus,Lu as setAutoTranslateEnabled,Au as setChatRoomEntries,Tu as setChatRoomEntry,or as setConversationNotificationLevel,ar as setConversationNotificationStatus,vr as setConversationToTop,ra as setConversationToTopInTag,lr as setConversationTypeNotificationLevel,ou as setFriendAddPermission,Ja as setFriendInfo,Da as setGroupMemberInfo,Ya as setGroupRemark,vs as setMessageReceivedStatus,hu as setNotificationQuietHoursWithSetting,aa as setProxy,Du as setTranslationLanguage,Fs as setUltraGroupDefaultNotificationLevel,yo as stopUploadTask,ca as subscribeUserStatus,da as testProxy,Ma as transferGroupOwner,Is as translateMessagesWithParams,Ts as translateTextsWithParams,la as unSubscribeUserStatus,Ds as updateExpansionForUltraGroupMessage,Ta as updateGroupInfo,Zr as updateMessageExpansion,Ea as updateMyUserProfile,pa as updateMyUserProfileVisibility,Qs as updateTag,Po as upload};