@rongcloud/imlib-next 5.42.0 → 5.44.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.cjs +2 -2
- package/index.cjs.js +2 -2
- package/index.d.ts +1 -1
- package/index.esm.js +2 -2
- package/index.mjs +2 -2
- package/package.json +2 -2
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{ConversationType as
|
|
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";
|
|
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
|
-
***************************************************************************** */var G=function(n,t){return G=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])},G(n,t)};function w(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function e(){this.constructor=n}G(n,t),n.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}var F,H=function(){return H=Object.assign||function(n){for(var t,e=1,i=arguments.length;e<i;e++)for(var r in t=arguments[e])Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},H.apply(this,arguments)};function B(n,t,e,i){return new(e||(e=Promise))((function(r,o){function u(n){try{a(i.next(n))}catch(n){o(n)}}function s(n){try{a(i.throw(n))}catch(n){o(n)}}function a(n){var t;n.done?r(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(u,s)}a((i=i.apply(n,t||[])).next())}))}function k(n,t){var e,i,r,o,u={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(e)throw new TypeError("Generator is already executing.");for(;u;)try{if(e=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return u.label++,{value:o[1],done:!1};case 5:u.label++,i=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(r=u.trys,(r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){u=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){u.label=o[1];break}if(6===o[0]&&u.label<r[1]){u.label=r[1],r=o;break}if(r&&u.label<r[2]){u.label=r[2],u.ops.push(o);break}r[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(n,u)}catch(n){o=[6,n],i=0}finally{e=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function V(n,t){var e="function"==typeof Symbol&&n[Symbol.iterator];if(!e)return n;var i,r,o=e.call(n),u=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)u.push(i.value)}catch(n){r={error:n}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(r)throw r.error}}return u}function j(n,t,e){if(e||2===arguments.length)for(var i,r=0,o=t.length;r<o;r++)!i&&r in t||(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return n.concat(i||Array.prototype.slice.call(t))}function Y(n){return H(H({},n),{channelId:n.channelId||""})}function z(t){var e=t.conversationType,i=t.targetId,r=t.latestMessage,o=t.unreadMessageCount,u=t.hasMentioned,s=t.mentionedInfo,a=t.lastUnreadTime,c=t.notificationStatus,f=t.notificationLevel,d=t.isTop,l=t.channelId,h=t.unreadMentionedCount,v=t.matchCount,p=t.operationTime,g=t.draft,m=t.translateStrategy,E=t.editedMessageDraft,S=t.includeRobot,_=t.dataMgmtInfo,T={conversationType:e,targetId:i,latestMessage:r&&Y(r),unreadMessageCount:o,hasMentioned:u,mentionedInfo:u?{type:null==s?void 0:s.type,userIdList:null==s?void 0:s.userIdList}:void 0,lastUnreadTime:a,notificationStatus:c,notificationLevel:f,isTop:d,channelId:l,unreadMentionedCount:h,matchCount:v,operationTime:p,draft:g||"",translateStrategy:m,editedMessageDraft:E,includeRobot:S,dataMgmtInfo:_};return T.conversationType===n.ULTRA_GROUP&&(T.firstUnreadMessage=t.firstUnreadMessage,T.channelType=t.channelType,T.unreadMentionedMeCount=t.unreadMentionedMeCount),T}function q(n,t){null===console||void 0===console||console.warn("Method '".concat(n,"' is deprecated, please use '").concat(t,"' instead"))}!function(n){n.CONNECTING="CONNECTING",n.CONNECTED="CONNECTED",n.DISCONNECT="DISCONNECT",n.SUSPEND="SUSPEND",n.MESSAGES="MESSAGES",n.READ_RECEIPT_RECEIVED="READ_RECEIPT_RECEIVED",n.MESSAGE_RECEIPT_REQUEST="MESSAGE_RECEIPT_REQUEST",n.MESSAGE_RECEIPT_RESPONSE="MESSAGE_RECEIPT_RESPONSE",n.MESSAGE_READ_RECEIPT_V4="MESSAGE_READ_RECEIPT_V4",n.SYNC_READ_STATUS="SYNC_READ_STATUS",n.CONVERSATION="CONVERSATION",n.CHATROOM="CHATROOM",n.EXPANSION="EXPANSION",n.PULL_OFFLINE_MESSAGE_FINISHED="PULL_OFFLINE_MESSAGE_FINISHED",n.TAG="TAG",n.USER_SETTINGS_SYNCED="USER_SETTINGS_SYNCED",n.USER_SETTINGS_CHANGED="USER_SETTINGS_CHANGED",n.CONVERSATIONS_SETTINGS_SYNCED="CONVERSATIONS_SETTINGS_SYNCED",n.CONVERSATION_TAG="CONVERSATION_TAG",n.TYPING_STATUS="TYPING_STATUS",n.MESSAGE_BLOCKED="MESSAGE_BLOCKED",n.ULTRA_GROUP_ENABLE="ULTRA_GROUP_ENABLE",n.CONVERSATIONS_SYNCED="CONVERSATIONS_SYNCED",n.OPERATE_STATUS="OPERATE_STATUS",n.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED="ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",n.ULTRA_GROUP_MESSAGE_MODIFIED="MESSAGE_MODIFIED",n.ULTRA_GROUP_MESSAGE_RECALLED="ULTRA_GROUP_MESSAGE_RECALLED",n.ULTRA_GROUP_CHANNEL_TYPE_CHANGE="ULTRA_GROUP_CHANNEL_TYPE_CHANGE",n.ULTRA_GROUP_CHANNEL_DELETE="ULTRA_GROUP_CHANNEL_DELETE",n.ULTRA_GROUP_CHANNEL_USER_KICKED="ULTRA_GROUP_CHANNEL_USER_KICKED",n.USER_GROUP_STATUS="USER_GROUP_STATUS",n.SUBSCRIBED_USER_STATUS_CHANGE="SUBSCRIBED_USER_STATUS_CHANGE",n.SUBSCRIBED_RELATION_CHANGE="SUBSCRIBED_RELATION_CHANGE",n.SYNC_SUBSCRIBED_USER_STATUS_FINISHED="SYNC_SUBSCRIBED_USER_STATUS_FINISHED",n.OWN_USER_PROFILE_CHANGED="OWN_USER_PROFILE_CHANGED",n.GROUP_OPERATION="GROUP_OPERATION",n.GROUP_INFO_CHANGED="GROUP_INFO_CHANGED",n.GROUP_MEMBER_INFO_CHANGED="GROUP_MEMBER_INFO_CHANGED",n.GROUP_APPLICATION_EVENT="GROUP_APPLICATION_EVENT",n.GROUP_REMARK_CHANGED_SYNC="GROUP_REMARK_CHANGED_SYNC",n.GROUP_FOLLOWS_CHANGED_SYNC="GROUP_FOLLOWS_CHANGED_SYNC",n.FRIEND_ADDED="FRIEND_ADDED",n.FRIEND_DELETE="FRIEND_DELETE",n.FRIEND_APPLICATION_STATUS_CHANGED="FRIEND_APPLICATION_STATUS_CHANGED",n.FRIEND_CLEARED="FRIEND_CLEARED",n.FRIEND_INFO_CHANGED_SYNC="FRIEND_INFO_CHANGED_SYNC",n.DATABASE_OPENED="DATABASE_OPENED",n.DATABASE_UPGRADE_WILL_START="DATABASE_UPGRADE_WILL_START",n.DATABASE_UPGRADING="DATABASE_UPGRADING",n.DATABASE_UPGRADE_DID_COMPLETE="DATABASE_UPGRADE_DID_COMPLETE",n.STREAM_MESSAGE_RESPONSE="STREAM_MESSAGE_RESPONSE",n.MESSAGE_RECEIPT_RESPONSE_V5="MESSAGE_RECEIPT_RESPONSE_V5",n.SPEECH_TO_TEXT_RESPONSE="SPEECH_TO_TEXT_RESPONSE",n.TRANSLATE_RESPONSE="TRANSLATE_RESPONSE",n.MESSAGE_MODIFIED="MESSAGE_MODIFIED",n.MESSAGE_MODIFIED_SYNC_COMPLETED="MESSAGE_MODIFIED_SYNC_COMPLETED",n.ROBOTS_SYNCED="ROBOTS_SYNCED",n.SYNC_SERVER_SAVE_UNREAD_COMPLETED="SYNC_SERVER_SAVE_UNREAD_COMPLETED",n.MESSAGE_REACTION_CHANGED="MESSAGE_REACTION_CHANGED"}(F||(F={}));var W=new t,X={connection:function(n,t){switch(n){case e.CONNECTED:W.emit(F.CONNECTED);break;case e.CONNECTING:W.emit(F.CONNECTING);break;case e.SUSPENDED:W.emit(F.SUSPEND,t);break;case e.DISCONNECTED:W.emit(F.DISCONNECT,t)}},batchMessage:function(n){W.emit(F.MESSAGES,{messages:n.map((function(n){return Y(n)}))})},typingState:function(n){W.emit(F.TYPING_STATUS,{status:n})},readReceiptReceived:function(n,t,e,i){W.emit(F.READ_RECEIPT_RECEIVED,{conversation:n,messageUId:t,sentTime:e,sendUserId:i})},messageReceiptRequest:function(n,t,e){W.emit(F.MESSAGE_RECEIPT_REQUEST,{conversation:n,messageUId:t,senderUserId:e})},messageReceiptResponse:function(n,t,e){W.emit(F.MESSAGE_RECEIPT_RESPONSE,{conversation:n,receivedUserId:t,messageUIdList:e})},conversationState:function(t){var e=t.map((function(t){var e=t.conversation,i=t.updatedItems,r=e.conversationType,o=z(e);return r===n.ULTRA_GROUP&&(o.versionTime=e.versionTime,o.unreadMessageCount=Q(e.unreadMessageCount||0),o.unreadMentionedCount=Q(e.unreadMentionedCount||0),o.unreadMentionedMeCount=Q(e.unreadMentionedMeCount||0)),{conversation:o,updatedItems:i}}));W.emit(F.CONVERSATION,{conversationList:e})},chatroomState:function(n){W.emit(F.CHATROOM,n)},expansion:function(n){W.emit(F.EXPANSION,n)},pullFinished:function(){W.emit(F.PULL_OFFLINE_MESSAGE_FINISHED)},tag:function(){W.emit(F.TAG)},userSettingsSynced:function(n){W.emit(F.USER_SETTINGS_SYNCED,n)},userSettingsChanged:function(n){W.emit(F.USER_SETTINGS_CHANGED,n)},conversationStatusSynced:function(n){W.emit(F.CONVERSATIONS_SETTINGS_SYNCED,n)},robotsSynced:function(n,t){W.emit(F.ROBOTS_SYNCED,n,t)},conversationTagChanged:function(){W.emit(F.CONVERSATION_TAG)},messageBlocked:function(n){W.emit(F.MESSAGE_BLOCKED,n)},ultraGroupEnable:function(){W.emit(F.ULTRA_GROUP_ENABLE)},sgRelationsSynced:function(n){W.emit(F.CONVERSATIONS_SYNCED,n)},operateStatus:function(n){W.emit(F.OPERATE_STATUS,n)},ultraGroupMessageExpansionUpdated:function(n){W.emit(F.ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED,n.map((function(n){return Y(n)})))},ultraGroupMessageRecalled:function(n){W.emit(F.ULTRA_GROUP_MESSAGE_RECALLED,n.map((function(n){return Y(n)})))},ultraGroupChannelChangeType:function(n){W.emit(F.ULTRA_GROUP_CHANNEL_TYPE_CHANGE,n)},ultraGroupChannelUserKicked:function(n){W.emit(F.ULTRA_GROUP_CHANNEL_USER_KICKED,n)},ultraGroupChannelDelete:function(n){W.emit(F.ULTRA_GROUP_CHANNEL_DELETE,n)},userGroupStatus:function(n){W.emit(F.USER_GROUP_STATUS,n)},messageReadReceipt:function(n){W.emit(F.MESSAGE_READ_RECEIPT_V4,n)},syncReadStatus:function(n){W.emit(F.SYNC_READ_STATUS,n)},subscribedUserStatusChange:function(n){W.emit(F.SUBSCRIBED_USER_STATUS_CHANGE,n)},subscribedRelationChange:function(n){W.emit(F.SUBSCRIBED_RELATION_CHANGE,n)},syncSubscribedUserStatusFinished:function(n){W.emit(F.SYNC_SUBSCRIBED_USER_STATUS_FINISHED,n)},ownUserProfileChanged:function(n){W.emit(F.OWN_USER_PROFILE_CHANGED,n)},groupOperation:function(n){W.emit(F.GROUP_OPERATION,n)},groupInfoChanged:function(n){W.emit(F.GROUP_INFO_CHANGED,n)},groupMemberInfoChanged:function(n){W.emit(F.GROUP_MEMBER_INFO_CHANGED,n)},groupApplicationEvent:function(n){W.emit(F.GROUP_APPLICATION_EVENT,n)},groupRemarkChangedSync:function(n){W.emit(F.GROUP_REMARK_CHANGED_SYNC,n)},groupFollowsChangedSync:function(n){W.emit(F.GROUP_FOLLOWS_CHANGED_SYNC,n)},friendAdd:function(n){W.emit(F.FRIEND_ADDED,n)},friendDelete:function(n){W.emit(F.FRIEND_DELETE,n)},friendApplicationStatusChanged:function(n){W.emit(F.FRIEND_APPLICATION_STATUS_CHANGED,n)},friendCleared:function(n){W.emit(F.FRIEND_CLEARED,n)},friendInfoChangedSync:function(n){W.emit(F.FRIEND_INFO_CHANGED_SYNC,n)},databaseOpened:function(n,t){W.emit(F.DATABASE_OPENED,n,t)},databaseUpgradeWillStart:function(){W.emit(F.DATABASE_UPGRADE_WILL_START)},databaseUpgrading:function(n){W.emit(F.DATABASE_UPGRADING,n)},databaseUpgradeDidComplete:function(n){W.emit(F.DATABASE_UPGRADE_DID_COMPLETE,n)},readReceiptResponseV5:function(n){W.emit(F.MESSAGE_RECEIPT_RESPONSE_V5,n)},speechToTextResponse:function(n){W.emit(F.SPEECH_TO_TEXT_RESPONSE,n)},translateResponse:function(n){W.emit(F.TRANSLATE_RESPONSE,n)},messagesModified:function(n){W.emit(F.MESSAGE_MODIFIED,n.map((function(n){return Y(n)})))},messageModifiedSyncCompleted:function(){W.emit(F.MESSAGE_MODIFIED_SYNC_COMPLETED)},syncServerSaveUnreadCompleted:function(){W.emit(F.SYNC_SERVER_SAVE_UNREAD_COMPLETED)},messageReaction:function(n){W.emit(F.MESSAGE_REACTION_CHANGED,n)}};function Q(n){return n>999?999:n}i.add("imlib-next","5.42.0");var K=null,J=null,Z=null;function $(){return B(this,void 0,void 0,(function(){return k(this,(function(n){switch(n.label){case 0:return K?[4,c.destroy()]:[2];case 1:return n.sent(),J=null,K=null,Z=null,[2]}}))}))}function nn(n){if(!K)throw new Error("Not initialized yet!");return n(K,Z,J)}function tn(){return K?l(K):f(d.BIZ_ERROR_CLIENT_NOT_INIT)}function en(n,t){return nn((function(e){return e.install(n,t)}))}var rn=0,on=new Map;function un(n,t){var e=function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var r=[],o=[];j([],V(on.values()),!1).forEach((function(n){var t=V(n,3),i=t[0],u=t[1],s=t[2];i===e&&(o.push(u),s&&r.push(s))})),r.forEach((function(t){n=t(n)}));var u=t.apply(void 0,j([],V(n),!1));return o.forEach((function(t){t(n,u)})),u};return Object.defineProperty(e,"original",{value:t,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(e,"name",{value:n,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(e,"monitorable",{value:!0,writable:!1,enumerable:!1,configurable:!1}),e}function sn(n,t,e){if(!n.monitorable)throw new Error("Not monitorable API: ".concat(n.name));var i=++rn;return on.set(i,[n,t,e]),i}function an(n){on.delete(n)}function cn(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.connect(n,!!t)}))];case 1:return[2,e.sent().trans((function(n){return{userId:n}}))]}}))}))}var fn=un("disconnect",(function(n,t){return nn((function(e){return e.disconnect(n,t)}))}));function dn(n,t,e){W.on(n,t,e)}function ln(n,t,e){W.once(n,t,e)}function hn(n,t,e){W.off(n,t,e)}function vn(n){W.removeAll(n)}function pn(){W.clear()}var gn=function(n,t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!0),Object.defineProperty(this,"messageType",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"isPersited",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"isCounted",{enumerable:!0,configurable:!0,writable:!0,value:i})},mn=function(n){function t(t,e,i){return n.call(this,t,i,e.isPersited,e.isCounted)||this}return w(t,n),t}(gn);var En,Sn=function(n){function t(t){return n.call(this,v.COMBINE,p(v.COMBINE),t)||this}return w(t,n),t}(mn),_n=function(n){function t(t){return n.call(this,v.COMBINE_V2,p(v.COMBINE_V2),t)||this}return w(t,n),t}(mn),Tn=function(n){function t(t){return n.call(this,"RC:CmdMsg",p("RC:CmdMsg"),t)||this}return w(t,n),t}(mn),In=function(n){function t(t){return n.call(this,v.FILE,p(v.FILE),t)||this}return w(t,n),t}(mn),Cn=function(n){function t(t){return n.call(this,v.GIF,p(v.GIF),t)||this}return w(t,n),t}(mn),An=function(n){function t(t){return n.call(this,"RC:GrpNtf",p("RC:GrpNtf"),t)||this}return w(t,n),t}(mn),Rn=function(n){function t(t){return n.call(this,v.IMAGE,p(v.IMAGE),t)||this}return w(t,n),t}(mn),bn=function(n){function t(t){return n.call(this,"RC:InfoNtf",p("RC:InfoNtf"),t)||this}return w(t,n),t}(mn),Nn=function(n){function t(t){return n.call(this,v.LOCATION,p(v.LOCATION),t)||this}return w(t,n),t}(mn),Mn=function(n){function t(t){return n.call(this,v.REFERENCE,p(v.REFERENCE),t)||this}return w(t,n),t}(mn),Un=function(n){function t(t){return n.call(this,v.RICH_CONTENT,p(v.RICH_CONTENT),t)||this}return w(t,n),t}(mn),On=function(n){function t(t){return n.call(this,v.SIGHT,p(v.SIGHT),t)||this}return w(t,n),t}(mn),yn=function(n){function t(t){return n.call(this,v.TEXT,p(v.TEXT),t)||this}return w(t,n),t}(mn),xn=function(n){function t(t){return n.call(this,v.HQ_VOICE,p(v.HQ_VOICE),t)||this}return w(t,n),t}(mn),Pn=function(n){function t(t){return n.call(this,v.VOICE,p(v.VOICE),t)||this}return w(t,n),t}(mn);!function(n){n.ALIYUN="aliyun",n.S3="s3",n.MINIO="minio",n.QINIU="qiniu",n.RCX="rcx"}(En||(En={}));var Dn=function(){function n(n,t,e){Object.defineProperty(this,"_url",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_authInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_getFileToken",{enumerable:!0,configurable:!0,writable:!0,value:e}),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})}return Object.defineProperty(n.prototype,"isAbort",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._isAbort}}),Object.defineProperty(n.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._isAbort=!0,this._abortHandler()}}),Object.defineProperty(n.prototype,"upload",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return n.file.size>g?Promise.resolve(f(d.UPLOAD_FAIL,"the file size is over 5GB!")):n.file.size>m&&this.multipartUpload?this.multipartUpload(n):this.commonUpload(n)}}),n}(),Ln=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return Object.defineProperty(t,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),t}return w(t,n),Object.defineProperty(t.prototype,"commonUpload",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return B(this,void 0,void 0,(function(){var t,e,i,r,o,u;return k(this,(function(s){switch(s.label){case 0:return t=n.file,e=n.onProgress,n.fileType,i=this._authInfo,r={},(o=new FormData).set("token",i.token),o.set("key",i.fileName),o.set("file",t),this._promise=S({url:_(this._url),headers:r,onProgress:function(n){return null==e?void 0:e(n.loaded,n.total)},method:"POST",body:o,timeout:0}),[4,this._promise.result()];case 1:return u=s.sent().status,this._promise=null,200===u||204===u?[2,l({uniqueName:i.fileName,uploadMethod:E.QINIU})]:[2,f(d.UPLOAD_FAIL,u.toString())]}}))}))}}),Object.defineProperty(t.prototype,"_abortHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n;null===(n=this._promise)||void 0===n||n.abort()}}),t}(Dn),Gn=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return Object.defineProperty(t,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),t}return w(t,n),Object.defineProperty(t.prototype,"commonUpload",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return B(this,void 0,void 0,(function(){var t,e,i,r,o,u;return k(this,(function(s){switch(s.label){case 0:return t=n.file,e=n.onProgress,n.fileType,i=this._authInfo,r=_("".concat(i.ossBucketName,".").concat(this._url)),(o=new FormData).set("token",i.token),o.set("OSSAccessKeyId",i.osskeyId),o.set("policy",i.ossPolicy),o.set("Signature",i.ossSign),o.set("success_action_status","200"),o.set("key",i.fileName),o.set("file",t),this._promise=S({url:r,onProgress:function(n){return null==e?void 0:e(n.loaded,n.total)},method:"POST",body:o,timeout:0}),[4,this._promise.result()];case 1:return u=s.sent().status,this._promise=null,200===u||204===u?[2,l({uniqueName:i.fileName,uploadMethod:E.ALI})]:[2,f(d.UPLOAD_FAIL,u.toString())]}}))}))}}),Object.defineProperty(t.prototype,"_abortHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n;null===(n=this._promise)||void 0===n||n.abort()}}),t}(Dn);function wn(n){return Math.ceil(n/1024)||0}var Fn,Hn=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return Object.defineProperty(t,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(t,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:function(n){return B(t,void 0,void 0,(function(){var t,e,i,r,o,u,s,a,c,h,v,p,g,m,T,I;return k(this,(function(C){switch(C.label){case 0:return t=n.file,e=n.fileType,[4,this._getFileToken(e,t.name,"POST","uploads",void 0,wn(t.size))];case 1:return(i=C.sent()).isOk?(r=i.data,o=_("".concat(this._url,"/").concat(r.minioBucketName,"/").concat(r.fileName)),u=this.getBaseHeaders(t,r,n),this._promise=S({url:"".concat(o,"?uploads"),headers:u,method:"POST"}),[4,this._promise.result()]):[2,i.wipe()];case 2:return s=C.sent(),a=s.status,c=s.data,this._promise=null,h=null===(I=null==c?void 0:c.match(/(?:<UploadId>)(\S*?)(?:<\/UploadId>)/))||void 0===I?void 0:I[1],200!==a&&204!==a||!h?[2,f(d.UPLOAD_FAIL,"start upload fail")]:(v=[],[4,this.requestUploadPart(o,t,h,r.fileName,n,v)]);case 3:return(p=C.sent()).isOk?[4,this._getFileToken(e,r.fileName,"POST","uploadId=".concat(h),void 0,wn(t.size))]:[2,p.wipe()];case 4:return(i=C.sent()).isOk?(r=i.data,g=v.map((function(n,t){return"<Part><PartNumber>".concat(t+1,"</PartNumber><ETag>").concat(n,"</ETag></Part>")})).join(""),g="<CompleteMultipartUpload xmlns='http://s3.amazonaws.com/doc/2006-03-01/'>".concat(g,"</CompleteMultipartUpload>"),m=this.getBaseHeaders(t,r,n),this._promise=S({url:"".concat(o,"?uploadId=").concat(h),headers:m,method:"POST",body:g,timeout:0}),[4,this._promise.result()]):[2,i.wipe()];case 5:return T=C.sent().status,this._promise=null,200===T||204===T?[2,l({uniqueName:r.fileName,uploadMethod:E.MINIO})]:[2,f(d.UPLOAD_FAIL,"end upload fail")]}}))}))}}),t}return w(t,n),Object.defineProperty(t.prototype,"commonUpload",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return B(this,void 0,void 0,(function(){var t,e,i,r,o,u;return k(this,(function(s){switch(s.label){case 0:return t=n.file,e=n.onProgress,n.fileType,i=this._authInfo,r=_("".concat(this._url,"/").concat(i.minioBucketName,"/").concat(i.fileName)),o=this.getBaseHeaders(t,i,n),this._promise=S({url:r,headers:o,onProgress:function(n){return null==e?void 0:e(n.loaded,n.total)},method:"PUT",body:t,timeout:0}),[4,this._promise.result()];case 1:return u=s.sent().status,this._promise=null,200===u||204===u?[2,l({uniqueName:i.fileName,uploadMethod:E.MINIO})]:[2,f(d.UPLOAD_FAIL,u.toString())]}}))}))}}),Object.defineProperty(t.prototype,"requestUploadPart",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t,e,i,r,o,u,s){return void 0===u&&(u=1),void 0===s&&(s=0),B(this,void 0,void 0,(function(){var a,c,h,v,p,g,E,_,T,I;return k(this,(function(C){switch(C.label){case 0:return s>=5?[2,f(d.UPLOAD_FAIL,"Upload retry times exceeded 5. Procedure")]:(a=(u-1)*m,c=Math.min(m,t.size-a),h="partNumber=".concat(u,"&uploadId=").concat(e),[4,this._getFileToken(r.fileType,i,"PUT",h,void 0,wn(t.size))]);case 1:return(v=C.sent()).isOk?(p=v.data,g=t.slice(a,u*m),E=this.getBaseHeaders(t,p,r),this._promise=S({url:"".concat(n,"?").concat(h),headers:E,method:"PUT",body:g,timeout:0,onProgress:function(n){var e;return null===(e=null==r?void 0:r.onProgress)||void 0===e?void 0:e.call(r,a+n.loaded,t.size)}}),[4,this._promise.result()]):[2,v.wipe()];case 2:return _=C.sent(),T=_.status,I=_.xhr,this._promise=null,200===T||204===T?(o.push((null==I?void 0:I.getResponseHeader("ETag"))||""),a+c<t.size?[2,this.requestUploadPart(n,t,e,i,r,o,u+1,0)]:[2,l()]):[2,this.requestUploadPart(n,t,e,i,r,o,u,s+1)]}}))}))}}),Object.defineProperty(t.prototype,"getBaseHeaders",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t,e){var i=e.contentDisposition||("text/html"===n.type?"inline":"attachment");return{"Content-Disposition":"".concat(i,"; filename=").concat(encodeURIComponent(n.name),";"),Authorization:t.minioAuthorization,"x-amz-content-sha256":t.minioContentSha256,"x-amz-date":t.minioDate,"Content-Type":n.type||"text/plain"}}}),Object.defineProperty(t.prototype,"_abortHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n;null===(n=this._promise)||void 0===n||n.abort()}}),t}(Dn),Bn=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return Object.defineProperty(t,"isSupportMultipart",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(t,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(t,"multipartUpload",{enumerable:!0,configurable:!0,writable:!0,value:function(n){return B(t,void 0,void 0,(function(){var t,e,i,r;return k(this,(function(o){return t=n.file,e=n.onProgress,n.fileType,i=T.gen(),r=this._authInfo,[2,this._requestUploadPart(i,t,r.token,e)]}))}))}}),t}return w(t,n),Object.defineProperty(t.prototype,"commonUpload",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return B(this,void 0,void 0,(function(){var t,e,i,r,o,u,s,a,c,h;return k(this,(function(v){switch(v.label){case 0:return t=n.file,e=n.onProgress,n.fileType,i=this._authInfo,r={},(o=new FormData).set("token",i.token),o.set("key",i.fileName),o.set("file",t),u=_(this._url),this._promise=S({url:u,headers:r,onProgress:function(n){return null==e?void 0:e(n.loaded,n.total)},method:"POST",body:o,timeout:0}),[4,this._promise.result()];case 1:return s=v.sent(),a=s.status,c=s.data,this._promise=null,200!==a&&204!==a||!c?[2,f(d.UPLOAD_FAIL,a.toString())]:(h=JSON.parse(c),[2,l({uniqueName:h.rc_url.file_name,downloadUrl:"".concat(u,"/").concat(h.rc_url.path),uploadMethod:E.QINIU})])}}))}))}}),Object.defineProperty(t.prototype,"_requestUploadPart",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t,e,i,r){return void 0===r&&(r=0),B(this,void 0,void 0,(function(){var o,u,s,a,c,h,v,p,g,T;return k(this,(function(I){switch(I.label){case 0:return o=Math.min(m,t.size-r),u=n+t.name.substring(t.name.lastIndexOf(".")),s={Range:"bytes=".concat(r,"-").concat(r+o),"X-File-TransactionId":u,"X-File-Total-Size":t.size.toString()},a=t.slice(r,r+o),(c=new FormData).set("file",a,t.name),c.set("key",u),c.set("name",u),c.set("token",e),h=_(this._url),this._promise=S({url:h,headers:s,onProgress:function(n){return null==i?void 0:i(r+n.loaded,t.size)},method:"POST",body:c,timeout:0}),[4,this._promise.result()];case 1:return v=I.sent(),p=v.status,g=v.data,this._promise=null,200===p||204===p?r+o<t.size?[2,this._requestUploadPart(n,t,e,i,r+o)]:(T=JSON.parse(g),[2,l({uniqueName:T.rc_url.file_name,downloadUrl:"".concat(h,"/").concat(T.rc_url.path),uploadMethod:E.QINIU})]):[2,f(d.UPLOAD_FAIL,p.toString())]}}))}))}}),Object.defineProperty(t.prototype,"_abortHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n;null===(n=this._promise)||void 0===n||n.abort()}}),t}(Dn),kn=function(n){function t(){var t=null!==n&&n.apply(this,arguments)||this;return Object.defineProperty(t,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:null}),t}return w(t,n),Object.defineProperty(t.prototype,"commonUpload",{enumerable:!1,configurable:!0,writable:!0,value:function(n){return B(this,void 0,void 0,(function(){var t,e,i,r,o,u,s,a,c;return k(this,(function(h){switch(h.label){case 0:return t=n.file,e=n.onProgress,n.fileType,i=n.contentDisposition,r=this._authInfo,o={},u=_("".concat(r.s3BucketName,".").concat(this._url)),s=new FormData,i?s.set("Content-Disposition",i):s.set("Content-Disposition","text/html"===t.type?"inline;":"attachment;"),s.set("Content-Type",t.type),s.set("x-amz-credential",r.s3Credential),s.set("x-amz-algorithm",r.s3Algorithm),s.set("x-amz-date",r.s3Date),s.set("policy",r.s3Policy),s.set("x-amz-signature",r.s3Signature),s.set("key",r.fileName),s.set("file",t),this._promise=S({url:u,headers:o,onProgress:function(n){return null==e?void 0:e(n.loaded,n.total)},method:"POST",body:s,timeout:0}),[4,this._promise.result()];case 1:return a=h.sent(),c=a.status,a.data,this._promise=null,200===c||204===c?[2,l({uniqueName:r.fileName,uploadMethod:E.AWS})]:[2,f(d.UPLOAD_FAIL,c.toString())]}}))}))}}),Object.defineProperty(t.prototype,"_abortHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n;null===(n=this._promise)||void 0===n||n.abort()}}),t}(Dn);function Vn(n,t){var e=new AudioContext({sampleRate:16e3}),i=C(),r=i.promise,o=i.resolve;return e.decodeAudioData(n,(function(n){var e,i;o(l(H(H({},t),{duration:n.duration,length:n.length,sampleRate:null!==(e=n.sampleRate)&&void 0!==e?e:void 0,numberOfChannels:null!==(i=n.numberOfChannels)&&void 0!==i?i:void 0})))}),(function(n){o(f(d.UPLOAD_FAIL,"get audio info fail:".concat(JSON.stringify(n))))})),r}var jn=((Fn={})[En.QINIU]=Ln,Fn[En.ALIYUN]=Gn,Fn[En.S3]=kn,Fn[En.MINIO]=Hn,Fn[En.RCX]=Bn,Fn);function Yn(n,t,e){var i=C(),r=i.promise,o=i.resolve,u=document.createElement("canvas"),s=u.getContext("2d"),a=new Image;return a.onload=function(n){var i=e||{},r=i.maxHeight,c=void 0===r?160:r,f=i.maxWidth,d=void 0===f?160:f,h=i.quality,v=void 0===h?1:h,p=i.scale,g=void 0===p?1:p,m=qn(a.width,a.height,{maxHeight:c,maxWidth:d,scale:g});u.width=Math.min(m.w,d),u.height=Math.min(m.h,c),s.drawImage(a,m.x,m.y,m.w,m.h);var E=zn(u,v);E=E.replace(/data:image\/[^;]+;base64,/,""),o(l(H(H({},t),{thumbnail:E,width:Math.ceil(m.w),height:Math.ceil(m.h)})))},a.onerror=function(n){o(f(d.UPLOAD_FAIL,"get image info fail:".concat(JSON.stringify(n))))},a.src=(window.URL||window.webkitURL).createObjectURL(n),r}function zn(n,t){var e=n.toDataURL("image/jpeg",t);return e.length>A-10240?zn(n,t-.1):e}var qn=function(n,t,e){var i,r,o=e.maxHeight,u=void 0===o?160:o,s=e.maxWidth,a=void 0===s?160:s,c=e.scale,f=n<t,d=0,l=0;return(f?t/n:n/t)>(void 0===c?1:c)?(f?(i=160,(r=t/(n/160))>u&&(l=(r-u)/2)):(r=160,(i=n/(t/160))>a&&(d=(i-a)/2)),{w:i,h:r,x:-d,y:-l}):(f?(r=u,i=n/(t/u)):(i=a,r=t/(n/a)),{w:i,h:r,x:-d,y:-l})},Wn=0,Xn=function(){function n(n,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:++Wn}),this._promise=this._handleUpload(n,t)}return Object.defineProperty(n.prototype,"abort",{enumerable:!1,configurable:!0,writable:!0,value:function(){var n;null===(n=this._client)||void 0===n||n.abort()}}),Object.defineProperty(n.prototype,"_uploadInLoop",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t,e,i,r){return void 0===r&&(r=[]),B(this,void 0,void 0,(function(){var o,u,s,a,c;return k(this,(function(l){switch(l.label){case 0:o=0,l.label=1;case 1:return o<n.length?(u=n[o],(s=jn[u.type])?(this._client=new s(u.url,e,i),[4,this._client.upload(t)]):(r.push({type:u.type,url:u.url,code:d.UPLOAD_FAIL,msg:"Upload type not supported"}),[3,3])):[3,4];case 2:if((a=l.sent()).isOk)return[2,a];if(c=a.code,[d.RC_FILE_SIZE_EXCEED_LIMIT,d.INVALID_PARAMETER_SIZE_NOT_FOUND].includes(a.code))return[2,a];if(this._client.isAbort())return this._client=null,[2,a];this._client=null,r.push({type:u.type,url:u.url,code:c,msg:a.msg}),l.label=3;case 3:return o++,[3,1];case 4:return[2,f(d.UPLOAD_FAIL,"Failed to upload all channels, msg: ".concat(JSON.stringify(r)))]}}))}))}}),Object.defineProperty(n.prototype,"_handleUpload",{enumerable:!1,configurable:!0,writable:!0,value:function(n,t){return B(this,void 0,void 0,(function(){var e,i,r,o,u,s,a,c,h,v,p,g,m,E,S,_,T,C,A;return k(this,(function(R){switch(R.label){case 0:return e=t.getFileToken,i=t.customDomain,r=t.uploadServer,o=t.ossConfig,u=n.file,s=n.fileType,a=n.thumbnailConfig,[4,e(s,u.name,void 0,void 0,void 0,wn(u.size))];case 1:return(c=R.sent()).isOk?(h=c.data,v=function(n,t,e){if(t)return[{type:En.RCX,url:t,p:"1"}];if(n)return JSON.parse(n).map((function(n){var t={type:En.QINIU,url:"",p:""};return Object.keys(n).forEach((function(e){"p"===e?t.p=n[e]:(t.type=e,t.url=n[e])})),t})).sort((function(n,t){return n.p-t.p}));var i=[];return e&&i.push({type:En.QINIU,url:e,p:"1"}),i}(h.ossConfig||o,i,r),0===v.length?[2,f(d.INVALID_PARAMETER_MEDIA_URL,"uploadUrlList is empty")]:[4,this._uploadInLoop(v,n,h,e)]):[2,c.wipe()];case 2:return p=R.sent(),g=p.code,m=p.data,E=p.msg,p.isOk?(_=(S=m).downloadUrl,T=S.uploadMethod,_?[3,4]:[4,t.getFileUrl(s,m.uniqueName,T,u.name)]):[2,f(g,E)];case 3:if(!(C=R.sent()).isOk)return[2,f(C.code,"Get download url fail")];_=C.data.downloadUrl,R.label=4;case 4:return _?(A={downloadUrl:_,uniqueName:(null==m?void 0:m.uniqueName)||"",name:u.name,size:u.size,type:u.type},s!==I.AUDIO?[3,6]:[4,u.arrayBuffer()]):[2,f(d.UPLOAD_FAIL,"Get download url fail")];case 5:return[2,Vn(R.sent(),A)];case 6:return s===I.IMAGE?[2,Yn(u,A,a)]:[2,l(A)]}}))}))}}),Object.defineProperty(n.prototype,"awaitResult",{enumerable:!1,configurable:!0,writable:!0,value:function(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,this._promise]}))}))}}),n}(),Qn={};function Kn(n,t){var e=new Xn(n,t);return function(n){B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return Qn[n.id]=n,[4,n.awaitResult()];case 1:return t.sent(),delete Qn[n.id],[2]}}))}))}(e),e}function Jn(n){var t=Qn[n];return!!t&&(t.abort(),!0)}var Zn=function(n,t){var e=n.getNaviInfoFromCache();return{getFileToken:n.getFileToken.bind(n),getFileUrl:n.getFileUrl.bind(n),customDomain:t||"",ossConfig:null==e?void 0:e.ossConfig,uploadServer:null==e?void 0:e.uploadServer}};function $n(n){return B(this,void 0,void 0,(function(){var t=this;return k(this,(function(e){return[2,tn().next((function(e){return B(t,void 0,void 0,(function(){var t,i,r;return k(this,(function(o){return t=n.contentDisposition,i=n.fileType,r=n.file,[2,R.create("createUploadTask").validate("contentDisposition",t,(function(n){return"inline"===n||"attachment"===n}),!1).fail(d.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",i,I,!0).fail(d.INVALID_PARAMETER_MEDIA_TYPE).validate("file",r,(function(n){return n instanceof File&&(!(i===I.IMAGE&&!n.type.match(/^image\//))&&!(i===I.AUDIO&&!n.type.match(/^audio\//)))}),!0).fail(d.MEDIA_EXCEPTION).result().trans((function(){return Kn(n,Zn(e,e.getOptions().uploadDomain))}))]}))}))}))]}))}))}function nt(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,l(Jn(n))]}))}))}function tt(n){return B(this,void 0,void 0,(function(){var t,e,i,r=this;return k(this,(function(o){return t=n.contentDisposition,e=n.fileType,i=n.file,[2,tn().next((function(o){return B(r,void 0,void 0,(function(){return k(this,(function(r){switch(r.label){case 0:return[4,R.create("upload").validate("contentDisposition",t,(function(n){return"inline"===n||"attachment"===n}),!1).fail(d.INVALID_PARAMETER_CONTENT_DISPOSITION).isNumberEnum("fileType",e,I,!0).fail(d.INVALID_PARAMETER_MEDIA_TYPE).validate("file",i,(function(n){return n instanceof File&&(!(e===I.IMAGE&&!n.type.match(/^image\//))&&!(e===I.AUDIO&&!n.type.match(/^audio\//)))}),!0).fail(d.MEDIA_EXCEPTION).result().next((function(){return function(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,new Xn(n,t).awaitResult()]}))}))}(n,Zn(o,o.getOptions().uploadDomain))}))];case 1:return[2,r.sent()]}}))}))}))]}))}))}function et(n,t,e,i){return tn().next((function(r){return r.getFileToken(n,t,e,i)}))}function it(n){var t=this;return tn().next((function(e){return B(t,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,R.create("getDownloadAuth").isNotEmptyString("url",n,!0).fail(d.INVALID_PARAMETER_MEDIA_URL).result().next((function(){return e.getFileToken(1,void 0,void 0,void 0,n)}))];case 1:return[2,t.sent().trans((function(n){return{deadline:n.deadline,token:n.token,downloadAuthInfo:n.downloadAuthInfo}}))]}}))}))}))}function rt(n,t,e,i,r){return B(this,void 0,void 0,(function(){return k(this,(function(o){return(null==i?void 0:i.isBosRes)?[2,l(i)]:[2,tn().next((function(i){return i.getFileUrl(n,t,r||E.QINIU,e)}))]}))}))}var ot=Ui,ut=un("sendMessage",(function(n,t,e){return B(void 0,void 0,void 0,(function(){var i,r,o,u,s,a,c,d,l,v,p,g,m;return k(this,(function(E){switch(E.label){case 0:return r=(i=e||{}).disableNotification,o=i.isMentioned,u=i.directionalUserIdList,s=i.canIncludeExpansion,a=i.onSendBefore,c=i.expansion,d=i.pushConfig,l=i.isStatusMessage,v=i.disableUpdateLastMessage,p=function(n,t){var e=n.disableNotification,i=n.pushContent,r=n.pushData,o=n.isMentioned,u=n.mentionedType,s=n.mentionedUserIdList,a=n.directionalUserIdList,c=n.isVoipPush,f=n.canIncludeExpansion,d=n.expansion,l=n.isFilerWhiteBlacklist,h=n.pushConfig,v=n.messageId,p=n.disableUpdateLastMessage,g=n.needReceipt,m=n.quoteInfo;return H({disableNotification:e,pushContent:i,pushData:r,isMentioned:o,mentionedType:u,mentionedUserIdList:s,directionalUserIdList:a,isVoipPush:c,canIncludeExpansion:f,expansion:d,isFilerWhiteBlacklist:l,pushConfig:h,messageId:v,disableUpdateLastMessage:p,needReceipt:g,quoteInfo:m},t)}(e||{},t),g=H(H({},n),{isMentioned:!!o,content:t.content,messageType:t.messageType,isPersited:!!t.isPersited,isCounted:!!t.isCounted,disableNotification:!!r,canIncludeExpansion:!!s,expansion:c||null,senderUserId:"",messageUId:"",messageDirection:N.SEND,receivedTime:0,isStatusMessage:!!l,receivedStatus:M.UNREAD,isOffLineMessage:!1,pushConfig:d,sentStatus:b.SENDING,sentTime:0,directedUserIds:u||[],disableUpdateLastMessage:v}),[4,tn().next((function(t){g.senderUserId=t.getCurrentUserId();return t.sendMessage(n,p,(function(n){g.messageId=n;try{a&&a(Y(g))}catch(n){t.logger.error(h.L_CALLBACK_E,'Callback method "onSendBefore" execution error.\n'.concat(null==n?void 0:n.stack)),console.error(n)}}))}))];case 1:return(m=E.sent()).isOk?[2,m.trans((function(n){return Y(n)}))]:(g.sentStatus=b.FAILED,[2,f(m.code,m.msg,Y(g))])}}))}))}));function st(n,t,e){return ut(n,new yn(t),e)}function at(n,t){var e=this;return function(i,r,u,s){return B(e,void 0,void 0,(function(){var e,a,c,l,v,p,g,m,E,S,_,T,I;return k(this,(function(C){switch(C.label){case 0:if(!(e=tn()).isOk)return[2,e.wipe()];if(a=e.data,!U("sendOptions.contentDisposition",null==s?void 0:s.contentDisposition,(function(n){return["inline","attachment"].includes(n)})))return[2,f(d.INVALID_PARAMETER_SENDOPTIONS)];if(c={contentDisposition:null==s?void 0:s.contentDisposition},s&&"thumbnailConfig"in s){if(l=null===(T=s)||void 0===T?void 0:T.thumbnailConfig,!(U("sendOptions.maxHeight",null==l?void 0:l.maxHeight,o.NUMBER)&&U("sendOptions.maxWidth",null==l?void 0:l.maxWidth,o.NUMBER)&&U("sendOptions.quality",null==l?void 0:l.quality,o.NUMBER)&&U("sendOptions.scale",null==l?void 0:l.scale,o.NUMBER)))return[2,f(d.INVALID_PARAMETER_SENDOPTIONS)];c.thumbnailConfig=l}return v=a.logger,p=v.createTraceId(),v.info(h.L_MEDIA_UPLOAD_T,JSON.stringify({filesize:r.file.size,type:n}),p),[4,tt({file:r.file,fileType:n,onProgress:function(n,t){var e;null===(e=null==u?void 0:u.onProgress)||void 0===e||e.call(u,Math.floor(n/t*100))},contentDisposition:c.contentDisposition,thumbnailConfig:c.thumbnailConfig})];case 1:return g=C.sent(),m=g.code,E=g.data,S=g.msg,m===d.SUCCESS&&E?(_=(null===(I=null==u?void 0:u.onComplete)||void 0===I?void 0:I.call(u,H({url:E.downloadUrl},E)))||t(E,r),v.info(h.L_MEDIA_UPLOAD_R,JSON.stringify({downurl:E.downloadUrl,code:d.SUCCESS}),p),[2,ut(i,_,s)]):[2,f(m,S)]}}))}))}}var ct=at(I.FILE,(function(n,t){var e,i,r={name:n.name,size:t.file.size,type:(e=n.name,i=e.match(/\.(\w+)$/),i?i[1]:"bin"),fileUrl:n.downloadUrl};return t.user&&(r.user=t.user),t.extra&&(r.extra=t.extra),t.mentionedInfo&&(r.mentionedInfo=t.mentionedInfo),new In(r)})),ft=at(I.IMAGE,(function(n,t){var e={content:n.thumbnail,imageUri:n.downloadUrl,thumWidth:n.width,thumHeight:n.height};return t.user&&(e.user=t.user),t.extra&&(e.extra=t.extra),t.mentionedInfo&&(e.mentionedInfo=t.mentionedInfo),t.audit&&(e.audit=t.audit),new Rn(e)})),dt=at(I.IMAGE,(function(n,t){var e={gifDataSize:n.size,remoteUrl:n.downloadUrl,width:n.width,height:n.height};return t.user&&(e.user=t.user),t.extra&&(e.extra=t.extra),t.mentionedInfo&&(e.mentionedInfo=t.mentionedInfo),t.audit&&(e.audit=t.audit),new Cn(e)})),lt=at(I.AUDIO,(function(n,t){var e,i={remoteUrl:n.downloadUrl,duration:Math.floor(null!==(e=n.duration)&&void 0!==e?e:0),sampleRate:n.sampleRate,numberOfChannels:n.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 xn(i)})),ht=at(I.SIGHT,(function(n,t){var e={sightUrl:n.downloadUrl,content:t.thumbnail,duration:t.duration,size:t.file.size||n.size,name:t.name||n.name};return t.user&&(e.user=t.user),t.extra&&(e.extra=t.extra),t.mentionedInfo&&(e.mentionedInfo=t.mentionedInfo),t.audit&&(e.audit=t.audit),new On(e)}));function vt(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.getHistoryMessage(n,t)}))];case 1:return[2,e.sent().trans((function(n){var t=n.list;return{hasMore:n.hasMore,list:t.map((function(n){return Y(n)}))}}))]}}))}))}function pt(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.getRemoteHistoryMessages(n,t)}))];case 1:return[2,e.sent().trans((function(n){var t=n.list;return{hasMore:n.hasMore,list:t.map((function(n){return Y(n)}))}}))]}}))}))}function gt(t,e,i,r){return B(this,void 0,void 0,(function(){return k(this,(function(o){return[2,tn().next((function(o){return o.chat.sendReadReceiptMessage({targetId:t,conversationType:n.PRIVATE,channelId:r},e,i)}))]}))}))}function mt(t,e,i){return B(this,void 0,void 0,(function(){return k(this,(function(r){return[2,tn().next((function(r){return r.chat.sendReadReceiptRequest({targetId:t,conversationType:n.GROUP,channelId:i},e)}))]}))}))}function Et(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(n){throw new Error("This method is deprecated, please use method sendReadReceiptResponseV2.")}))}))}function St(t,e,i){return B(this,void 0,void 0,(function(){return k(this,(function(r){return[2,tn().next((function(r){return r.chat.sendReadReceipt({targetId:t,conversationType:n.GROUP,channelId:i},e)}))]}))}))}function _t(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chat.sendSyncReadStatusMessage(n,t)}))]}))}))}function Tt(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.chat.sendReadReceiptMessageV4(n,t,e)}))]}))}))}function It(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chat.getMessageReadReceiptV4(n,t)}))]}))}))}function Ct(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chat.batchGetMessageReadReceiptInfoV4(n,t)}))]}))}))}at(I.COMBINE_HTML,(function(n,t){var e={remoteUrl:n.downloadUrl,nameList:t.nameList,summaryList:t.summaryList,conversationType:t.conversationType};return t.user&&(e.user=t.user),t.extra&&(e.extra=t.extra),t.mentionedInfo&&(e.mentionedInfo=t.mentionedInfo),new Sn(e)}));var At=un("recallMessage",(function(n,t){return B(void 0,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return B(void 0,void 0,void 0,(function(){return k(this,(function(i){switch(i.label){case 0:return[4,e.recallMessage(n,t)];case 1:return[2,i.sent().trans((function(n){return Y(n)}))]}}))}))}))]}))}))}));function Rt(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.deleteRemoteMessage(n,t)}))]}))}))}function bt(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.deleteRemoteMessageByTimestamp(n,t)}))]}))}))}function Nt(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.batchClearRemoteHistoryMessages(n,t)}))]}))}))}function Mt(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.updateMessageExpansion(n,t)}))]}))}))}function Ut(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.removeMessageExpansion(n,t)}))]}))}))}function Ot(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.chat.sendTypingStatus(n,t)}))];case 1:return[2,e.sent().trans(Y)]}}))}))}function yt(n,t,e){return B(this,void 0,void 0,(function(){var i=this;return k(this,(function(r){return[2,tn().next((function(r){return B(i,void 0,void 0,(function(){return k(this,(function(i){return[2,r.chat.getMessageReader(n,t,e)]}))}))}))]}))}))}function xt(n,t,e,i,u){return nn((function(s,a){return r("messageType",n,o.STRING,!0),r("isPersited",t,o.BOOLEAN,!0),r("isCounted",e,o.BOOLEAN,!0),r("isStatusMessage",u,o.BOOLEAN),r("searchProps",i,o.ARRAY),a.info(h.A_REGTYP_O,JSON.stringify({messageType:n,isCounted:e,isStatusMessage:u,isPersited:t,searchProps:i})),s.registerMessageType(n,t,e,i,u),function(n,t,e){return void 0===t&&(t=!0),void 0===e&&(e=!0),function(i){return new gn(n,i,t,e)}}(n,t,e)}))}function Pt(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){return t.getFirstUnreadMessage(n)}))];case 1:return[2,t.sent().trans((function(n){return n?Y(n):null}))]}}))}))}function Dt(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getFirstUnreadMessageDigest(n)}))]}))}))}function Lt(n,t,e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){return k(this,(function(i){return q("insertMessage","electronExtension.insertMessage"),[2,bi(n,t,e)]}))}))}function Gt(n){throw new Error("getUnreadMentionedMessages is deprecated, please use electronExtension.getUnreadMentionedMessages instead")}function wt(n,t,e,i){return B(this,void 0,void 0,(function(){return k(this,(function(r){return q("RongIMLib.searchMessages","RongIMLib.ElectronExtension.searchMessagesWithParams"),[2,Ii(n,t,e,i)]}))}))}function Ft(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return q("RongIMLib.deleteLocalMessagesByTimestamp","RongIMLib.electronExtension.deleteMessagesByTimestamp"),[2,Ri(n,t,e)]}))}))}function Ht(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return q("RongIMLib.clearMessages","RongIMLib.electronExtension.clearMessages"),[2,Ai(n)]}))}))}function Bt(n,t,e,i){return B(this,void 0,void 0,(function(){return k(this,(function(r){return q("searchConversationByContent","electronExtension.searchConversationByContent"),[2,_i(n,null!=e?e:[v.TEXT,v.FILE],i,t)]}))}))}function kt(n,t){return B(this,void 0,void 0,(function(){var e=this;return k(this,(function(i){return[2,tn().next((function(i){return B(e,void 0,void 0,(function(){return k(this,(function(e){return[2,i.chat.clearUnreadCountByTimestamp(n,t)]}))}))}))]}))}))}function Vt(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,Ci(n,t)]}))}))}function jt(n){return tn().next((function(t){return t.sse.requestStreamMessageContent(n)}))}function Yt(n,t){return B(this,void 0,void 0,(function(){var e=this;return k(this,(function(i){return[2,tn().next((function(i){return B(e,void 0,void 0,(function(){return k(this,(function(e){return[2,i.sendReadReceiptResponseV5(n,t)]}))}))}))]}))}))}function zt(n,t){return B(this,void 0,void 0,(function(){var e=this;return k(this,(function(i){return[2,tn().next((function(i){return B(e,void 0,void 0,(function(){return k(this,(function(e){return[2,i.getMessageReadReceiptInfoV5(n,t)]}))}))}))]}))}))}function qt(n){return B(this,void 0,void 0,(function(){var t=this;return k(this,(function(e){return[2,tn().next((function(e){return B(t,void 0,void 0,(function(){return k(this,(function(t){return[2,e.getMessageReadReceiptInfoV5ByIdentifiers(n)]}))}))}))]}))}))}function Wt(n,t,e){return B(this,void 0,void 0,(function(){var i=this;return k(this,(function(r){return[2,tn().next((function(r){return B(i,void 0,void 0,(function(){return k(this,(function(i){return[2,r.getMessagesReadReceiptUsersByPageV5(n,t,e)]}))}))}))]}))}))}function Xt(n,t,e){return B(this,void 0,void 0,(function(){var i=this;return k(this,(function(r){return[2,tn().next((function(r){return B(i,void 0,void 0,(function(){return k(this,(function(i){return[2,r.getMessagesReadReceiptByUsersV5(n,t,e)]}))}))}))]}))}))}function Qt(n,t){return tn().next((function(e){return e.requestSpeechToTextForMessage(n,t)}))}function Kt(n){return tn().next((function(t){return t.translateMessagesWithParams(n)}))}function Jt(n){return tn().next((function(t){return t.translateTextsWithParams(n)}))}function Zt(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return q("modifyMessage","modifyMessageWithParams"),[2,$t({messageUId:null==t?void 0:t.messageUId,messageContent:n,conversation:{conversationType:null==t?void 0:t.conversationType,targetId:null==t?void 0:t.targetId,channelId:null==t?void 0:t.channelId}})]}))}))}function $t(n){return tn().next((function(t){return t.modifyMessageWithParams(n)}))}function ne(n){return tn().next((function(t){var e=function(n){return n.map((function(n){return{messageUId:n.messageUId,message:n.message?Y(n.message):void 0,code:n.code}}))};return t.refreshReferenceMessageWithParams(H(H({},n),{remoteMessageBlock:function(t){n.remoteMessageBlock&&n.remoteMessageBlock(e(t))},localMessageBlock:function(t){n.localMessageBlock&&n.localMessageBlock(e(t))}}))}))}function te(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){return t.getMessagesByUIds(n.conversationIdentifier,n.messageUIds)}))];case 1:return[2,t.sent().trans((function(n){return n.map((function(n){return{messageUId:n.messageUId,message:n.message?Y(n.message):void 0,code:n.code}}))}))]}}))}))}function ee(n,t){return B(this,void 0,void 0,(function(){var e=this;return k(this,(function(i){switch(i.label){case 0:return q("getConversationList","getConversationListByTimestamp"),[4,tn().next((function(i){return B(e,void 0,void 0,(function(){return k(this,(function(e){return[2,i.getConversationList({count:(null==n?void 0:n.count)||300,startTime:(null==n?void 0:n.startTime)||0,order:null==n?void 0:n.order,channelId:t})]}))}))}))];case 1:return[2,i.sent().trans((function(n){return n.map(z)}))]}}))}))}function ie(n){return B(this,void 0,void 0,(function(){var t=this;return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return B(t,void 0,void 0,(function(){return k(this,(function(t){return[2,e.getAllConversationList(n)]}))}))}))];case 1:return[2,e.sent().trans((function(n){return n.map(z)}))]}}))}))}function re(n){return B(this,void 0,void 0,(function(){var t=this;return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return B(t,void 0,void 0,(function(){return k(this,(function(t){return[2,e.getConversationListByTimestamp(n)]}))}))}))];case 1:return[2,e.sent().trans((function(n){return n.map(z)}))]}}))}))}function oe(n){return B(this,void 0,void 0,(function(){var t=this;return k(this,(function(e){return[2,tn().next((function(e){return B(t,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,e.getConversation(n)];case 1:return[2,t.sent().trans((function(n){return z(n)}))]}}))}))}))]}))}))}var ue=un("removeConversation",(function(n,t){return B(void 0,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.removeConversation(n,t)}))]}))}))}));function se(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return q("batchRemoveConversation","batchDeleteConversations"),[2,ae({identifiers:n,deleteRemotely:!1,deleteMessages:!1})]}))}))}function ae(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.batchDeleteConversations(n)}))]}))}))}function ce(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getTextMessageDraft(n)}))]}))}))}function fe(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.saveTextMessageDraft(n,t)}))]}))}))}function de(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.clearTextMessageDraft(n)}))]}))}))}function le(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.getTotalUnreadCount(t,n)}))]}))}))}function he(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.getTotalUnreadCountByLevels(n,t)}))]}))}))}function ve(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.getTotalUnreadCountByLevels(n,t,!0)}))]}))}))}function pe(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getUnreadCount(n)}))]}))}))}var ge=un("clearMessagesUnreadStatus",(function(n){return B(void 0,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.chat.clearUnreadCount(n)}))]}))}))}));function me(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,tn().next((function(n){return n.chat.clearAllUnreadCount()}))]}))}))}var Ee=un("setConversationNotificationLevel",(function(n,t){return B(void 0,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.batchSetConversationNotificationLevel([n],t)}))]}))}))}));function Se(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.batchSetConversationNotificationLevel(n,t)}))]}))}))}function _e(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.batchSetConversationTranslateStrategy(n,t)}))]}))}))}function Te(n,t){return B(this,void 0,void 0,(function(){var e=this;return k(this,(function(i){return[2,tn().next((function(i){return B(e,void 0,void 0,(function(){var e;return k(this,(function(r){return t!==O.CLOSE&&t!==O.OPEN?[2,f(d.INVALID_PARAMETER_NOTIFICATION_LEVEL)]:(e=y(t),[2,i.batchSetConversationNotificationLevel([n],e)])}))}))}))]}))}))}function Ie(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getConversationNotificationLevel(n)}))]}))}))}function Ce(n){return B(this,void 0,void 0,(function(){var t=this;return k(this,(function(e){return[2,tn().next((function(e){return B(t,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,e.getConversationNotificationLevel(n)];case 1:return[2,t.sent().trans((function(n){return x(n)}))]}}))}))}))]}))}))}function Ae(){return B(this,void 0,void 0,(function(){return k(this,(function(n){switch(n.label){case 0:return[4,tn().next((function(n){return n.getBlockedConversationList()}))];case 1:return[2,n.sent().trans((function(n){return n.map(z)}))]}}))}))}function Re(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.setConversationTypeNotificationLevel(n,t)}))]}))}))}function be(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getConversationTypeNotificationLevel(n)}))]}))}))}var Ne=un("setConversationToTop",(function(n,t,e,i){return void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===i&&(i=!1),B(void 0,void 0,void 0,(function(){return k(this,(function(r){return[2,tn().next((function(r){return r.batchSetConversationToTop([n],!!t,e,i)}))]}))}))}));function Me(n,t,e,i){return void 0===e&&(e=!0),void 0===i&&(i=!0),B(this,void 0,void 0,(function(){return k(this,(function(r){return[2,tn().next((function(r){return r.batchSetConversationToTop(n,!!t,i,e)}))]}))}))}function Ue(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.getTopConversationList(n,t)}))];case 1:return[2,e.sent().trans((function(n){return n.map(z)}))]}}))}))}function Oe(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){return t.getUnreadConversationList(n)}))];case 1:return[2,t.sent().trans((function(n){return n.map(z)}))]}}))}))}function ye(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getUnreadMentionedCount(n)}))]}))}))}function xe(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,tn().next((function(n){return n.getAllUnreadMentionedCount()}))]}))}))}function Pe(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){var e,i,r;return t.getRealtimeConversations(null!==(e=null==n?void 0:n.count)&&void 0!==e?e:30,null!==(i=null==n?void 0:n.startTime)&&void 0!==i?i:0,null!==(r=null==n?void 0:n.order)&&void 0!==r?r:0)}))];case 1:return[2,t.sent().trans((function(n){return n.map(z)}))]}}))}))}function De(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,tn().next((function(n){return n.getRealtimeConTotalUnreadCount()}))]}))}))}function Le(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.clearRealtimeConUnreadCount(n)}))]}))}))}function Ge(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.removeRealtimeConversations(n)}))]}))}))}function we(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.batchGetRealtimeConUnreadCount(n)}))]}))}))}function Fe(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){return t.getUnreadMentionMeConversationList(n)}))];case 1:return[2,t.sent().trans((function(n){return n.map(z)}))]}}))}))}function He(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.chat.createConversationListLoader(n)}))]}))}))}function Be(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){return t.chat.getConversationsIncludingRobots(n)}))];case 1:return[2,t.sent().trans((function(n){return n.map(z)}))]}}))}))}function ke(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.chat.markRemoteConversationAsRead(n)}))]}))}))}function Ve(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getUltraGroupList(n)}))]}))}))}function je(){return B(this,void 0,void 0,(function(){return k(this,(function(n){switch(n.label){case 0:return[4,tn().next((function(n){return n.getBlockedUGList()}))];case 1:return[2,n.sent().trans((function(n){return n.map((function(n){return z(n)}))}))]}}))}))}function Ye(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.chat.sendUltraGroupTypingStatus(n)}))]}))}))}function ze(n,t){return B(this,void 0,void 0,(function(){var e=this;return k(this,(function(i){switch(i.label){case 0:return[4,tn().next((function(i){return B(e,void 0,void 0,(function(){return k(this,(function(e){return[2,i.getUltraGroupMessageListByMessageUId(n,t)]}))}))}))];case 1:return[2,i.sent().trans((function(n){var t={};for(var e in n)t[e]=n[e]?Y(n[e]):void 0;return t}))]}}))}))}function qe(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return q("updateExpansionForUltraGroupMessage","updateMessageExpansion"),[2,Mt(n,t)]}))}))}function We(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return q("removeExpansionForUltraGroupMessage","removeMessageExpansionForKey"),[2,Ut(n,t)]}))}))}function Xe(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.removeAllMessageExpansion(n)}))]}))}))}function Qe(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.getUGUnreadCountForAllChannels(n,!0,t)}))]}))}))}function Ke(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getUltraGroupDefaultNotificationLevel(null==n?void 0:n.targetId,null==n?void 0:n.channelId)}))]}))}))}function Je(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.setUltraGroupDefaultNotificationLevel(null==n?void 0:n.targetId,t,null==n?void 0:n.channelId)}))]}))}))}function Ze(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.getUGUnreadCountForAllChannels(n,!1,t)}))]}))}))}function $e(){return B(this,void 0,void 0,(function(){return k(this,(function(t){return q("getAllUltraGroupUnreadCount","getTotalUnreadCountByLevels"),[2,he([n.ULTRA_GROUP],[])]}))}))}function ni(){return B(this,void 0,void 0,(function(){return k(this,(function(t){return q("getAllUltraGroupUnreadMentionedCount","getTotalUnreadMentionedCountByLevels"),[2,ve([n.ULTRA_GROUP],[])]}))}))}function ti(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getUGUnreadMentionedDigest(n)}))]}))}))}function ei(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getUGFirstUnreadMessageDigest(n)}))]}))}))}function ii(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getUGUnreadInfoList(n)}))]}))}))}function ri(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.addToBlacklist(n)}))]}))}))}function oi(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.removeFromBlacklist(n)}))]}))}))}function ui(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,tn().next((function(n){return n.getBlacklist()}))]}))}))}function si(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){return t.getBlacklistStatus(n)}))];case 1:return[2,t.sent().trans((function(n){return 0===n}))]}}))}))}function ai(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.createTag(n)}))]}))}))}function ci(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.removeTag(n)}))]}))}))}function fi(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.updateTag(n)}))]}))}))}function di(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,tn().next((function(n){return n.getTagList()}))]}))}))}function li(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getTagsForConversation(n)}))]}))}))}function hi(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.addTagForConversations(n,t)}))]}))}))}function vi(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.removeTagForConversations(n,t)}))]}))}))}function pi(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.removeTagsForConversation(n,t)}))]}))}))}function gi(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.removeTagForConversations(n,t)}))]}))}))}function mi(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){switch(i.label){case 0:return q("getConversationsFromTagByPage","createConversationListLoader"),[4,tn().next((function(i){return i.getConversationListByTag(n,e,t)}))];case 1:return[2,i.sent().trans((function(n){return n.map((function(n){return H(H({},z(t=n)),{isTopInTag:t.isTopInTag});var t}))}))]}}))}))}function Ei(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.getUnreadCountByTag(n,t)}))]}))}))}function Si(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.setConversationStatusInTag(n,t,{isTop:e})}))]}))}))}function _i(n,t,e,i){return B(this,void 0,void 0,(function(){var r=this;return k(this,(function(o){return[2,tn().next((function(o){return B(r,void 0,void 0,(function(){return k(this,(function(r){switch(r.label){case 0:return[4,o.searchConversationByContent(n,t,e,i)];case 1:return[2,r.sent().trans((function(n){return n.map((function(n){return z(n)}))}))]}}))}))}))]}))}))}function Ti(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.searchMessages(n,t)}))];case 1:return[2,e.sent().trans((function(n){var t=n.totalMatched,e=n.messages;return n.conditionsMatched,{count:t,messages:e.map((function(n){return Y(n)}))}}))]}}))}))}function Ii(n,t,e,i,r){return B(this,void 0,void 0,(function(){return k(this,(function(o){return q("RongIMLib.electronExtension.searchMessages","RongIMLib.electronExtension.searchMessagesWithParams"),[2,Ti(n,{keyword:t,limit:i||D,order:0,timeRange:{endTime:e?e-1:e||0},messageFilter:{objectNames:r}})]}))}))}function Ci(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return q("setMessageReceivedStatus","setMessageReceivedStatusInfo"),[2,tn().next((function(e){return e.setMessageReceivedStatus(n,t)}))]}))}))}function Ai(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.clearLocalMessages(n)}))]}))}))}function Ri(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.deleteLocalMessagesByTimestamp(n,t,e)}))]}))}))}function bi(n,t,e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){return k(this,(function(i){return t instanceof gn?[2,Mi(n,t,e)]:[2,Ni(n,t,e)]}))}))}function Ni(n,t,e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){var i,r,o,u;return k(this,(function(s){switch(s.label){case 0:return i=!!(null==e?void 0:e.isUnread),r=null==e?void 0:e.searchContent,o=null==e?void 0:e.disableUpdateLastMessage,u={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)?P(t.receivedStatusInfo):null==t?void 0:t.receivedStatus,sentTime:null==t?void 0:t.sentTime,sentStatus:null==t?void 0:t.sentStatus,searchContent:r,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)||o,quoteInfo:null==t?void 0:t.quoteInfo},[4,tn().next((function(t){return t.insertMessage(n,u)}))];case 1:return[2,s.sent().trans(Y)]}}))}))}function Mi(n,t,e){return void 0===e&&(e={}),B(this,void 0,void 0,(function(){var i,r,o,u;return k(this,(function(s){switch(s.label){case 0:return i=!!(null==e?void 0:e.isUnread),r=null==e?void 0:e.searchContent,o=null==e?void 0:e.disableUpdateLastMessage,u={senderUserId:"",messageType:null==t?void 0:t.messageType,content:null==t?void 0:t.content,searchContent:r,messageDirection:N.SEND,isUnread:i,messageUId:"",disableUpdateLastMessage:o,quoteInfo:e.quoteInfo},[4,tn().next((function(t){return t.insertMessage(n,u)}))];case 1:return[2,s.sent().trans(Y)]}}))}))}function Ui(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){return t.getLocalMessage(n)}))];case 1:return[2,t.sent().trans((function(n){return Y(n)}))]}}))}))}var Oi=Object.freeze({__proto__:null,getAllConversationList:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return q("electronExtension.getAllConversationList","getAllConversationList"),[2,ie(n)]}))}))},getConversationList:function(n,t,e,i){return B(this,void 0,void 0,(function(){var r=this;return k(this,(function(o){switch(o.label){case 0:return q("electronExtension.getConversationList","getAllConversationList or getConversationListByTimestamp"),[4,tn().next((function(o){return B(r,void 0,void 0,(function(){return k(this,(function(r){return[2,o.getConversationList({startTime:n,count:t,channelId:e,topPriority:i})]}))}))}))];case 1:return[2,o.sent().trans((function(n){return n.map((function(n){return z(n)}))}))]}}))}))},searchConversationByContent:_i,getConversations:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){return t.getConversations(n)}))];case 1:return[2,t.sent().trans((function(n){return n.map(z)}))]}}))}))},getUntaggedConversationListByPage:function(n,t,e){return B(this,void 0,void 0,(function(){var i=this;return k(this,(function(r){return[2,tn().next((function(r){return B(i,void 0,void 0,(function(){return k(this,(function(i){switch(i.label){case 0:return[4,r.getUntaggedConversationListByPage(n,t,e)];case 1:return[2,i.sent().trans((function(n){return n.map((function(n){return z(n)}))}))]}}))}))}))]}))}))},getRemoteConversations:function(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,tn().next((function(n){return n.syncRemoteConversations()}))]}))}))},saveEditedMessageDraft:function(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chat.saveEditedMessageDraft(n,t)}))]}))}))},getEditedMessageDraft:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.chat.getEditedMessageDraft(n)}))]}))}))},clearEditedMessageDraft:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.chat.clearEditedMessageDraft(n)}))]}))}))},searchMessages:Ii,searchMessageInTimeRange:function(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return q("RongIMLib.electronExtension.searchMessageInTimeRange","RongIMLib.electronExtension.searchMessagesWithParams"),[2,Ti(n,{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(n,t,e,i){return B(this,void 0,void 0,(function(){return k(this,(function(r){switch(r.label){case 0:return q("RongIMLib.electronExtension.searchMessagesByUser","RongIMLib.electronExtension.searchMessagesWithParams"),[4,Ti(n,{limit:i,keyword:"",order:0,timeRange:{endTime:e?e-1:e||0},messageFilter:{senderIds:[t]}})];case 1:return[2,r.sent().trans((function(n){return{messages:n.messages}}))]}}))}))},getHistoryMessagesByMessageTypes:function(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.getHistoryMessagesByObjectNames(n,t)}))];case 1:return[2,e.sent().trans((function(n){var t=n.list,e=n.hasMore,i=t.map(Y);return{messages:i,hasMore:e,list:i}}))]}}))}))},getContinuousMessages:function(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.getContinuousMessages(n,t)}))];case 1:return[2,e.sent().trans((function(n){var t=n.list,e=n.hasMore,i=n.timestamp;return{hasMore:e,list:t.map(Y),timestamp:i}}))]}}))}))},setMessageStatusToRead:function(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.setMessageStatusToRead(n,t)}))]}))}))},setMessageReceivedStatus:Ci,setMessageReceivedStatusInfo:function(n,t){return B(this,void 0,void 0,(function(){var e;return k(this,(function(i){return e=P(t||{}),[2,tn().next((function(t){return t.setMessageReceivedStatus(n,e)}))]}))}))},setMessageSentStatus:function(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.setMessageSentStatus(n,t)}))]}))}))},setMessageContent:function(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.setMessageContent(n,t,e)}))]}))}))},deleteMessages:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.deleteLocalMessages(n)}))]}))}))},clearMessages:Ai,deleteMessagesByTimestamp:Ri,batchClearMessagesByTimestamp:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.batchClearLocalMessagesByTimestamp(n)}))]}))}))},insertMessage:bi,batchInsertMessage:function(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.batchInsertMessage(n,t)}))]}))}))},getMessageCount:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.getLocalMessageCount(n)}))]}))}))},setCheckDuplicateMessage:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.setCheckDuplicateMessage(n)}))]}))}))},setCheckChatRoomDuplicateMessage:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.chatroom.setCheckChatRoomDuplicateMessage(!!n)}))]}))}))},getMessagesAroundTimestamp:function(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){var i=null==t?void 0:t.timestamp,r=null==t?void 0:t.beforeCount,o=null==t?void 0:t.afterCount;return e.getMessagesAroundTimestamp(n,i,r,o)}))];case 1:return[2,e.sent().trans((function(n){return n.map(Y)}))]}}))}))},getLocalMessage:Ui,searchMessagesWithParams:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){return t.searchMessagesWithParams(n)}))];case 1:return[2,t.sent().trans((function(n){n.totalMatched;var t=n.messages;return{count:n.conditionsMatched,messages:t.map((function(n){return Y(n)}))}}))]}}))}))},setMessageSpeechToTextVisible:function(n,t){return tn().next((function(e){return e.setMessageSpeechToTextVisible(n,t)}))},deleteUltraGroupMessagesForAllChannel:function(n,t){return tn().next((function(e){return e.deleteLocalUGMessagesForAllChannel(n,t)}))},getUnreadMentionedMessages:function(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,tn().next((function(t){return t.getUnreadMentionedMessages(n)}))];case 1:return[2,t.sent().trans((function(n){return n.map(Y)}))]}}))}))},clearLocalData:function(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,tn().next((function(n){return n.clearLocalData()}))]}))}))},enable:function(){return L()}});function yi(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.setProxy(n)}))]}))}))}function xi(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,tn().next((function(n){return n.getProxy()}))]}))}))}function Pi(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.testProxy(n,t)}))]}))}))}function Di(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.subscribeUser(n,t,e)}))]}))}))}function Li(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.unSubscribeUser(n,t)}))];case 1:return[2,e.sent().wipe()]}}))}))}function Gi(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.getSubscribeUserList(n,t,e)}))]}))}))}function wi(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.getSubscribeUserStatus(n,t)}))]}))}))}function Fi(n){return tn().next((function(t){return t.updateMyUserProfile(n)}))}function Hi(n){return tn().next((function(t){return t.getUserProfiles(n)}))}function Bi(){return tn().next((function(n){return n.getMyUserProfile()}))}function ki(n){return tn().next((function(t){return t.dataHosting.updateMyUserProfileVisibility(n)}))}function Vi(){return tn().next((function(n){return n.dataHosting.getMyUserProfileVisibility()}))}function ji(n){return tn().next((function(t){return t.dataHosting.searchUserProfileByUniqueId(n)}))}function Yi(n){return tn().next((function(t){return t.getSubscribeUsersOnlineStatus(n)}))}function zi(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.createGroup(n,t)}))]}))}))}function qi(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.dataHosting.updateGroupInfo(n)}))]}))}))}function Wi(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.dataHosting.getGroupsInfo(n)}))]}))}))}function Xi(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.dataHosting.kickGroupMembers(n,t,e)}))]}))}))}function Qi(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.quitGroup(n,t)}))]}))}))}function Ki(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.dataHosting.dismissGroup(n)}))]}))}))}function Ji(n,t,e,i){return B(this,void 0,void 0,(function(){return k(this,(function(r){return[2,tn().next((function(r){return r.dataHosting.transferGroupOwner(n,t,!!e,i)}))]}))}))}function Zi(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.addGroupManagers(n,t)}))]}))}))}function $i(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.removeGroupManagers(n,t)}))]}))}))}function nr(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.dataHosting.getGroupMembersByRole(n,t,e)}))]}))}))}function tr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.getGroupMembers(n,t)}))]}))}))}function er(n,t,e,i){return B(this,void 0,void 0,(function(){return k(this,(function(r){return[2,tn().next((function(r){return r.dataHosting.setGroupMemberInfo(n,t,e,i)}))]}))}))}function ir(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.dataHosting.searchGroupMembers(n,t,e)}))]}))}))}function rr(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.dataHosting.joinGroup(n)}))]}))}))}function or(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.inviteUsersToGroup(n,t)}))]}))}))}function ur(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.acceptGroupInvite(n,t)}))]}))}))}function sr(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.dataHosting.refuseGroupInvite(n,t,e)}))]}))}))}function ar(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.dataHosting.acceptGroupApplication(n,t,e)}))]}))}))}function cr(n,t,e,i){return B(this,void 0,void 0,(function(){return k(this,(function(r){return[2,tn().next((function(r){return r.dataHosting.refuseGroupApplication(n,t,e,i)}))]}))}))}function fr(n,t,e){return B(this,void 0,void 0,(function(){return k(this,(function(i){return[2,tn().next((function(i){return i.dataHosting.getGroupApplications(n,t,e)}))]}))}))}function dr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.getJoinedGroupsByRole(t,n)}))]}))}))}function lr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.searchJoinedGroups(n,t)}))]}))}))}function hr(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.dataHosting.getJoinedGroups(n)}))]}))}))}function vr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.setGroupRemark(n,t)}))]}))}))}function pr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.addGroupFollows(n,t)}))]}))}))}function gr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.dataHosting.removeGroupFollows(n,t)}))]}))}))}function mr(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.dataHosting.getGroupFollows(n)}))]}))}))}function Er(n,t,e){return tn().next((function(i){return i.dataHosting.addFriend(n,t,e)}))}function Sr(n,t){return tn().next((function(e){return e.dataHosting.deleteFriends(n,t)}))}function _r(n){return tn().next((function(t){return t.dataHosting.acceptFriendRequest(n)}))}function Tr(n){return tn().next((function(t){return t.dataHosting.refuseFriendRequest(n)}))}function Ir(n,t,e){return tn().next((function(i){return i.dataHosting.setFriendInfo(n,t||"",e)}))}function Cr(n,t){return tn().next((function(e){return e.dataHosting.checkFriends(n,t)}))}function Ar(n,t){return tn().next((function(e){return e.dataHosting.getFriends(n,t)}))}function Rr(n,t,e){return tn().next((function(i){return i.dataHosting.getFriendApplications(n,t,e)}))}function br(n){return tn().next((function(t){return t.dataHosting.getFriendsInfo(n)}))}function Nr(n){return tn().next((function(t){return t.dataHosting.searchFriendsInfo(n)}))}function Mr(n){return tn().next((function(t){return t.dataHosting.setFriendAddPermission(n)}))}function Ur(){return tn().next((function(n){return n.dataHosting.getFriendAddPermission()}))}function Or(n){!function(n){var t,e,i;K?Z.warn(h.A_INIT_REPEAT_O):(r("options.appkey",n.appkey,o.STRING,!0),r("options.navigators",n.navigators,(function(n){return u(n)&&(0===n.length||n.every(s))})),r("options.loggerProxy",n.loggerProxy,(function(n){return n instanceof a})),J=n,K=c.init({appkey:n.appkey,navigators:n.navigators||[],miniCMPProxy:n.customCMP||[],logOutputLevel:n.logOutputLevel,httpInMainProcess:!!n.httpInMainProcess,logExpireTime:n.logExpireTime,areaCode:n.areaCode,logServerUrl:n.logServerUrl,uploadDomain:n.uploadDomain,environment:null!==(t=n.environment)&&void 0!==t?t:"default",eventLoopBlockingCheck:n.eventLoopBlockingCheck,enableReadReceiptStorage:null===(e=n.enableReadReceiptStorage)||void 0===e||e,useNaviV2:null!==(i=n.useNaviV2)&&void 0!==i&&i,loggerProxy:n.loggerProxy,conversationCachePolicy:n.conversationCachePolicy}),Z=K.logger,K.assignWatcher(X),K.sse.on("message",(function(n,t){var e=H(H({},t),{message:t.message?Y(t.message):void 0});W.emit(F.STREAM_MESSAGE_RESPONSE,e)})))}(n)}function yr(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return pn(),[2,$()]}))}))}function xr(){return nn((function(n){return n.getConnectionStatus()}))}function Pr(){return nn((function(n){return n.getServerTime()}))}function Dr(){return nn((function(n){return n.getCurrentUserId()}))}function Lr(n,t){i.add(n,t)}function Gr(){return nn((function(n){return n.getDeviceId()}))}function wr(){var n=tn().tryTrans((function(n){return n.getAppSettings()}));return n.isOk?n.data:null}var Fr={COMET:"_",WEBSOCKET:"_"};function Hr(n){return tn().next((function(t){return t.setNotificationQuietHoursWithSetting(n)}))}function Br(){return tn().next((function(n){return n.removeNotificationQuietHoursSetting()}))}function kr(){return tn().next((function(n){return n.getNotificationQuietHoursSetting()}))}function Vr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.chatroom.joinChatroom(n,null==t?void 0:t.count,!0,null==t?void 0:t.extra)}))];case 1:return[2,e.sent().wipe()]}}))}))}function jr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chatroom.joinChatroom(n,null==t?void 0:t.count,!1,null==t?void 0:t.extra)}))]}))}))}function Yr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chatroom.quitChatroom(n,t)}))]}))}))}function zr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chatroom.getChatroomInfo(n,null==t?void 0:t.count,null==t?void 0:t.order)}))]}))}))}function qr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chatroom.setChatroomEntry(n,t,!1)}))]}))}))}function Wr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.chatroom.setChatroomEntries(n,t)}))];case 1:return[2,e.sent().wipe()]}}))}))}function Xr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chatroom.setChatroomEntry(n,t,!0)}))]}))}))}function Qr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chatroom.removeChatroomEntry(n,t,!1)}))]}))}))}function Kr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chatroom.removeChatroomEntries(n,{keys:null==t?void 0:t.entries,notificationExtra:null==t?void 0:t.notificationExtra})}))]}))}))}function Jr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chatroom.removeChatroomEntry(n,t,!0)}))]}))}))}function Zr(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){return[2,tn().next((function(e){return e.chatroom.getChatroomEntry(n,t)}))]}))}))}function $r(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.chatroom.getAllChatroomEntries(n)}))]}))}))}function no(n,t){return B(this,void 0,void 0,(function(){return k(this,(function(e){switch(e.label){case 0:return[4,tn().next((function(e){return e.chatroom.getChatroomHistoryMessages(n,null==t?void 0:t.count,null==t?void 0:t.order,null==t?void 0:t.timestamp)}))];case 1:return[2,e.sent().trans((function(n){var t=n.list;return{hasMore:n.hasMore,list:t.map((function(n){return Y(n)}))}}))]}}))}))}function to(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.chatroom.bindRTCRoomForChatroom(n)}))]}))}))}function eo(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.setTranslationLanguage(n)}))]}))}))}function io(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,tn().next((function(n){return n.getTranslationLanguage()}))]}))}))}function ro(n){return B(this,void 0,void 0,(function(){return k(this,(function(t){return[2,tn().next((function(t){return t.setAutoTranslateEnabled(n)}))]}))}))}function oo(){return B(this,void 0,void 0,(function(){return k(this,(function(n){return[2,tn().next((function(n){return n.getAutoTranslateEnabled()}))]}))}))}function uo(){return tn().next((function(n){return n.getAllRobots()}))}function so(n){return tn().next((function(t){return t.getRobotById(n)}))}function ao(n){return tn().next((function(t){return t.chat.addMessageReaction(n)}))}function co(n){return tn().next((function(t){return t.chat.removeMessageReaction(n)}))}function fo(n){return tn().next((function(t){return t.chat.batchGetMessageReactionSummaries(n)}))}function lo(n){return tn().next((function(t){return t.chat.getMessageReactions(n)}))}function ho(n){return tn().next((function(t){return t.chat.getMessageReactionUsers(n)}))}export{gn as BaseMessage,Sn as CombineMessage,_n as CombineV2Message,Tn as CommandMessage,Fr as ConnectType,F as Events,In as FileMessage,Cn as GIFMessage,An as GroupNotificationMessage,xn as HQVoiceMessage,Rn as ImageMessage,bn as InformationNotificationMessage,Nn as LocationMessage,Mn as ReferenceMessage,Un as RichContentMessage,On as SightMessage,yn as TextMessage,Xn as UploadTask,Pn as VoiceMessage,Lr as __addSDKVersion,_r as acceptFriendApplication,ar as acceptGroupApplication,ur as acceptGroupInvite,hi as addConversationsToTag,dn as addEventListener,Er as addFriend,pr as addGroupFollows,Zi as addGroupManagers,ao as addMessageReaction,sn as addMonitor,ai as addTag,ri as addToBlacklist,Nt as batchClearRemoteHistoryMessages,ae as batchDeleteConversations,fo as batchGetMessageReactionSummaries,Ct as batchGetMessageReadReceiptInfoV4,se as batchRemoveConversation,Se as batchSetConversationNotificationLevel,Me as batchSetConversationToTop,_e as batchSetConversationTranslateStrategy,to as bindRTCRoomForChatroom,Cr as checkFriends,me as clearAllMessagesUnreadStatus,pn as clearEventListeners,bt as clearHistoryMessages,Ht as clearMessages,ge as clearMessagesUnreadStatus,Le as clearRealtimeConUnreadCount,de as clearTextMessageDraft,kt as clearUnreadCountByTimestamp,cn as connect,He as createConversationListLoader,zi as createGroup,$n as createUploadTask,Sr as deleteFriends,Ft as deleteLocalMessagesByTimestamp,Rt as deleteMessages,yr as destroy,fn as disconnect,Ki as dismissGroup,Oi as electronExtension,Jr as forceRemoveChatRoomEntry,Xr as forceSetChatRoomEntry,$r as getAllChatRoomEntries,ie as getAllConversationList,uo as getAllRobots,$e as getAllUltraGroupUnreadCount,ni as getAllUltraGroupUnreadMentionedCount,xe as getAllUnreadMentionedCount,wr as getAppSettings,oo as getAutoTranslateEnabled,ui as getBlacklist,si as getBlacklistStatus,je as getBlockUltraGroupList,Ae as getBlockedConversationList,Zr as getChatRoomEntry,zr as getChatRoomInfo,no as getChatroomHistoryMessages,xr as getConnectionStatus,oe as getConversation,ee as getConversationList,re as getConversationListByTimestamp,Ie as getConversationNotificationLevel,Ce as getConversationNotificationStatus,be as getConversationTypeNotificationLevel,mi as getConversationsFromTagByPage,Be as getConversationsIncludingRobots,Dr as getCurrentUserId,Gr as getDeviceId,it as getDownloadAuth,et as getFileToken,rt as getFileUrl,Pt as getFirstUnreadMessage,Dt as getFirstUnreadMessageInfo,Ur as getFriendAddPermission,Rr as getFriendApplications,Ar as getFriends,br as getFriendsInfo,fr as getGroupApplications,mr as getGroupFollows,tr as getGroupMembers,nr as getGroupMembersByRole,Wi as getGroupsInfo,vt as getHistoryMessages,hr as getJoinedGroups,dr as getJoinedGroupsByRole,ot as getMessage,ho as getMessageReactionUsers,lo as getMessageReactions,zt as getMessageReadReceiptInfoV5,qt as getMessageReadReceiptInfoV5ByIdentifiers,It as getMessageReadReceiptV4,yt as getMessageReader,te as getMessagesByUIds,Xt as getMessagesReadReceiptByUsersV5,Wt as getMessagesReadReceiptUsersByPageV5,Bi as getMyUserProfile,Vi as getMyUserProfileVisibility,kr as getNotificationQuietHoursSetting,xi as getProxy,De as getRealtimeConTotalUnreadCount,we as getRealtimeConUnreadCounts,Pe as getRealtimeConversations,pt as getRemoteHistoryMessages,so as getRobotById,Pr as getServerTime,Gi as getSubscribeUserList,wi as getSubscribeUserStatus,Yi as getSubscribeUsersOnlineStatus,di as getTags,li as getTagsFromConversation,ce as getTextMessageDraft,Ue as getTopConversationList,le as getTotalUnreadCount,he as getTotalUnreadCountByLevels,ve as getTotalUnreadMentionedCountByLevels,io as getTranslationLanguage,Ke as getUltraGroupDefaultNotificationLevel,ei as getUltraGroupFirstUnreadMessageTimestamp,Ve as getUltraGroupList,ze as getUltraGroupMessageListByMessageUId,Ze as getUltraGroupUnreadCountByTargetId,ii as getUltraGroupUnreadInfoList,Qe as getUltraGroupUnreadMentionedCountByTargetId,ti as getUltraGroupUnreadMentionedMessages,Oe as getUnreadConversationList,pe as getUnreadCount,Ei as getUnreadCountByTag,Fe as getUnreadMentionMeConversationList,ye as getUnreadMentionedCount,Gt as getUnreadMentionedMessages,Hi as getUserProfiles,Or as init,Lt as insertMessage,en as installPlugin,or as inviteUsersToGroup,Vr as joinChatRoom,jr as joinExistChatRoom,rr as joinGroup,Xi as kickGroupMembers,ke as markRemoteConversationAsRead,Zt as modifyMessage,$t as modifyMessageWithParams,ln as onceEventListener,Yr as quitChatRoom,Qi as quitGroup,At as recallMessage,ne as refreshReferenceMessageWithParams,Tr as refuseFriendApplication,cr as refuseGroupApplication,sr as refuseGroupInvite,xt as registerMessageType,Xe as removeAllExpansionForUltraGroupMessage,Kr as removeChatRoomEntries,Qr as removeChatRoomEntry,ue as removeConversation,vi as removeConversationsFromTag,hn as removeEventListener,vn as removeEventListeners,We as removeExpansionForUltraGroupMessage,oi as removeFromBlacklist,gr as removeGroupFollows,$i as removeGroupManagers,Ut as removeMessageExpansionForKey,co as removeMessageReaction,an as removeMonitor,Br as removeNotificationQuietHoursSetting,Ge as removeRealtimeConversations,ci as removeTag,gi as removeTagFromConversations,pi as removeTagsFromConversation,Qt as requestSpeechToTextForMessage,jt as requestStreamMessageContent,fe as saveTextMessageDraft,Bt as searchConversationByContent,Nr as searchFriendsInfo,ir as searchGroupMembers,lr as searchJoinedGroups,wt as searchMessages,ji as searchUserProfileByUniqueId,ct as sendFileMessage,dt as sendGIFMessage,lt as sendHQVoiceMessage,ft as sendImageMessage,ut as sendMessage,gt as sendReadReceiptMessage,Tt as sendReadReceiptMessageV4,mt as sendReadReceiptRequest,Et as sendReadReceiptResponse,St as sendReadReceiptResponseV2,Yt as sendReadReceiptResponseV5,ht as sendSightMessage,_t as sendSyncReadStatusMessage,st as sendTextMessage,Ot as sendTypingStatusMessage,Ye as sendUltraGroupTypingStatus,ro as setAutoTranslateEnabled,Wr as setChatRoomEntries,qr as setChatRoomEntry,Ee as setConversationNotificationLevel,Te as setConversationNotificationStatus,Ne as setConversationToTop,Si as setConversationToTopInTag,Re as setConversationTypeNotificationLevel,Mr as setFriendAddPermission,Ir as setFriendInfo,er as setGroupMemberInfo,vr as setGroupRemark,Vt as setMessageReceivedStatus,Hr as setNotificationQuietHoursWithSetting,yi as setProxy,eo as setTranslationLanguage,Je as setUltraGroupDefaultNotificationLevel,nt as stopUploadTask,Di as subscribeUserStatus,Pi as testProxy,Ji as transferGroupOwner,Kt as translateMessagesWithParams,Jt as translateTextsWithParams,Li as unSubscribeUserStatus,qe as updateExpansionForUltraGroupMessage,qi as updateGroupInfo,Mt as updateMessageExpansion,Fi as updateMyUserProfile,ki as updateMyUserProfileVisibility,fi as updateTag,tt as upload};
|
|
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.44.0-alpha.1");let Y=null,z=null,$=null;function q(e){if(!Y)throw new Error("Not initialized yet!");return e(Y,$,z)}function W(){return Y?f(Y):c(l.BIZ_ERROR_CLIENT_NOT_INIT)}function X(e,t){return q((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)=>q((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 ze=gi,$e=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}),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 qe(e,t,n){return $e(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),$e(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 q(((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 zt(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 $t(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 qt=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 zn(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.getUGUnreadInfoList(e)))}))}function $n(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.addToBlacklist(e)))}))}function qn(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 zi(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.inviteUsersToGroup(e,t)))}))}function $i(e,t){return G(this,void 0,void 0,(function*(){return W().next((n=>n.dataHosting.acceptGroupInvite(e,t)))}))}function qi(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?$.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)),z=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}),$=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(),z=null,Y=null,$=null)}))}()}))}function So(){return q((e=>e.getConnectionStatus()))}function _o(){return q((e=>e.getServerTime()))}function To(){return q((e=>e.getCurrentUserId()))}function Io(e,t){i.add(e,t)}function Co(){return q((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 zo(e){return G(this,void 0,void 0,(function*(){return W().next((t=>t.setAutoTranslateEnabled(e)))}))}function $o(){return G(this,void 0,void 0,(function*(){return W().next((e=>e.getAutoTranslateEnabled()))}))}function qo(){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,$i 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,$n 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,qo as getAllRobots,kn as getAllUltraGroupUnreadCount,Vn as getAllUltraGroupUnreadMentionedCount,_n as getAllUnreadMentionedCount,Ao as getAppSettings,$o 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,$t as getConversation,jt as getConversationList,zt 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,ze 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,zn 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,zi 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,qi as refuseGroupInvite,St as registerMessageType,Gn as removeAllExpansionForUltraGroupMessage,Fo as removeChatRoomEntries,Go as removeChatRoomEntry,qt as removeConversation,ni as removeConversationsFromTag,re as removeEventListener,se as removeEventListeners,bn as removeExpansionForUltraGroupMessage,qn 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,$e 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,qe as sendTextMessage,mt as sendTypingStatusMessage,Pn as sendUltraGroupTypingStatus,zo 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};
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"types": "./index.d.ts"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
"version": "5.
|
|
22
|
+
"version": "5.44.0-alpha.1",
|
|
23
23
|
"author": "pass-web@rongcloud.cn",
|
|
24
24
|
"license": "SEE LICENSE IN LICENSE",
|
|
25
25
|
"homepage": "https://www.rongcloud.cn",
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
"globals": "RongIMLib"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@rongcloud/engine": "=5.
|
|
39
|
+
"@rongcloud/engine": "=5.44.0-alpha.1"
|
|
40
40
|
}
|
|
41
41
|
}
|