@rongcloud/electron 5.42.1 → 5.44.0
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/binding/electron-darwin-arm64.node +0 -0
- package/binding/electron-darwin-x64.node +0 -0
- package/binding/electron-linux-arm64.node +0 -0
- package/binding/electron-linux-x64.node +0 -0
- package/binding/electron-win32-ia32.node +0 -0
- package/binding/electron-win32-x64.node +0 -0
- package/index.cjs +2 -2
- package/index.cjs.js +2 -2
- package/index.esm.js +2 -2
- package/index.mjs +2 -2
- package/package.json +1 -1
- package/sub-process.cjs.js +1 -1
- package/sub-process.esm.js +1 -1
package/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{resolve as e,dirname as t}from"path";import{app as s,ipcMain as r}from"electron";import{platform as i,arch as n,networkInterfaces as o,cpus as a,release as c,type as _,version as l,uptime as d,freemem as E,totalmem as u}from"os";import{fork as R,execSync as h}from"child_process";import{createRequire as I}from"module";import{createDecipheriv as g,createHash as T}from"crypto";import{existsSync as N,mkdirSync as C,readFileSync as O,writeFileSync as p}from"fs";import{fileURLToPath as S,parse as A}from"url";import{request as f,Agent as m}from"http";import{request as v,Agent as P}from"https";import L from"zlib";import{isIP as M,Socket as U}from"net";import{EventEmitter as D}from"events";import{connect as b}from"tls";
|
|
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 D=function(e,t){return D=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},D(e,t)};function w(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}D(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var j,V=function(){return V=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},V.apply(this,arguments)};function G(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(e){o(e)}}function s(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function k(e,t){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[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(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function F(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function H(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)a.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return a}function B(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function J(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function x(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}!function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC",e[e.MINIO=5]="MINIO"}(j||(j={}));var W,Y,K,X,Q,Z,q,z,$,ee,te,re,ne,ie,oe,ae,se,ue,ce,le,de,fe,_e,pe,Ee,ge,he,be,Re,ve,Ie="L-connect-T",Oe="L-connect-R",Te="L-connect-S",Ne="L-TEST-O",me="L-get_navi-T",Ce="L-get_navi-R",Se="L-request-T",ye="L-request-R",Ae="L-parse_navi-E",Pe="L-rejoin_chatroom-T",Le="L-rejoin_chatroom-R",Me="L-check_alive_im-T",Ue="L-check_alive_im-R",De="L-check_alive_im-S",we="L-report_full_log-O",je="L-report_full_log-T",Ve="L-report_full_log-R",Ge="L-parse_navi_logpolicy-E",ke="A-remove_proxy-O",Fe="L-set_proxy-O",He="L-test_proxy-T",Be="L-test_proxy-R",Je="L-get_static_conf-T",xe="L-get_static_conf-R",We="L-get_static_conf-E",Ye="L-cloud_disabled",Ke="L-cloud_overclock",Xe="L-cloud_appkey_region_error",Qe="L-cloud_config_data_error",Ze="L-cloud_set_area_code-O",qe="L-cloud_set_mrtr-O",ze="L-parse_json-E",$e="L-event_loop_blocking-S",et="P-get_sys_version-E",tt="L-pull_offline_message_finished-S";!function(e){e[e.BOTH=2]="BOTH"}(W||(W={})),function(e){e[e.BOTH=2]="BOTH"}(Y||(Y={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(K||(K={})),function(e){e[e.NONE=0]="NONE",e[e.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",e[e.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",e[e.BOTH_WAY=3]="BOTH_WAY"}(X||(X={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(Q||(Q={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(Z||(Z={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(q||(q={})),function(e){e[e.FRIEND_APPLY=0]="FRIEND_APPLY",e[e.FRIEND_REFUSE=1]="FRIEND_REFUSE",e[e.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",e[e.FRIENDS_INPUT=3]="FRIENDS_INPUT",e[e.FRIEND_CLEAR=4]="FRIEND_CLEAR",e[e.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",e[e.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(z||(z={})),function(e){e[e.OWNER_VERIFY=0]="OWNER_VERIFY",e[e.FREE=1]="FREE",e[e.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}($||($={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(ee||(ee={})),function(e){e[e.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",e[e.OWNER_OR_SELF=1]="OWNER_OR_SELF",e[e.SELF=2]="SELF"}(te||(te={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(re||(re={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(ne||(ne={})),function(e){e[e.CREATE=0]="CREATE",e[e.JOIN=1]="JOIN",e[e.KICK=2]="KICK",e[e.QUIT=3]="QUIT",e[e.DISMISS=4]="DISMISS",e[e.ADD_MANAGER=5]="ADD_MANAGER",e[e.REMOVE_MANAGER=6]="REMOVE_MANAGER",e[e.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER"}(ie||(ie={})),function(e){e[e.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",e[e.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",e[e.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",e[e.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(oe||(oe={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(ae||(ae={})),function(e){e[e.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",e[e.MANAGER_REFUSED=1]="MANAGER_REFUSED",e[e.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",e[e.INVITEE_REFUSED=3]="INVITEE_REFUSED",e[e.JOINED=4]="JOINED",e[e.EXPIRED=5]="EXPIRED"}(se||(se={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(ue||(ue={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(ce||(ce={})),function(e){e[e.GROUP_OPERATION=11]="GROUP_OPERATION",e[e.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",e[e.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",e[e.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(le||(le={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(de||(de={})),function(e){e[e.APPLICATION_SENT=0]="APPLICATION_SENT",e[e.INVITATION_SENT=1]="INVITATION_SENT",e[e.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",e[e.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED"}(fe||(fe={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(_e||(_e={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(pe||(pe={})),function(e){e[e.LeaveOnMyOwn=1]="LeaveOnMyOwn",e[e.OtherDeviceLogin=2]="OtherDeviceLogin"}(Ee||(Ee={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(ge||(ge={})),function(e){e[e.UnmuteUsers=0]="UnmuteUsers",e[e.MuteUsers=1]="MuteUsers",e[e.UnmuteAll=2]="UnmuteAll",e[e.MuteAll=3]="MuteAll",e[e.RemoveWhitelist=4]="RemoveWhitelist",e[e.AddWhitelist=5]="AddWhitelist",e[e.UnmuteGloble=6]="UnmuteGloble",e[e.MuteGloble=7]="MuteGloble"}(he||(he={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(be||(be={})),function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.NOT_IN_WHITELIST=407]="NOT_IN_WHITELIST",e[e.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",e[e.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",e[e.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",e[e.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",e[e.MESSAGE_OVER_MODIFY_TIME_FAIL=20114]="MESSAGE_OVER_MODIFY_TIME_FAIL",e[e.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",e[e.MESSAGE_UNSUPPORTED_MODIFY=20116]="MESSAGE_UNSUPPORTED_MODIFY",e[e.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",e[e.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",e[e.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",e[e.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",e[e.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",e[e.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",e[e.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",e[e.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",e[e.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",e[e.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",e[e.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",e[e.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",e[e.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",e[e.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",e[e.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",e[e.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",e[e.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",e[e.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",e[e.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",e[e.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",e[e.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",e[e.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",e[e.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",e[e.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",e[e.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",e[e.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",e[e.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",e[e.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",e[e.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",e[e.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",e[e.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",e[e.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",e[e.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",e[e.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",e[e.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",e[e.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",e[e.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",e[e.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",e[e.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",e[e.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",e[e.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",e[e.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",e[e.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",e[e.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",e[e.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",e[e.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",e[e.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",e[e.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",e[e.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",e[e.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",e[e.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",e[e.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",e[e.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",e[e.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",e[e.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",e[e.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",e[e.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",e[e.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",e[e.RC_FRIEND_NOT_SUPPORT_ROBOT=25474]="RC_FRIEND_NOT_SUPPORT_ROBOT",e[e.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",e[e.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",e[e.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",e[e.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",e[e.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",e[e.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",e[e.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",e[e.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",e[e.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",e[e.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",e[e.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",e[e.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",e[e.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",e[e.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",e[e.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",e[e.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",e[e.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",e[e.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",e[e.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",e[e.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",e[e.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",e[e.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",e[e.MSG_REACTION_LIMIT_REACHED=26323]="MSG_REACTION_LIMIT_REACHED",e[e.MSG_REACTION_USER_LIMIT_REACHED=26324]="MSG_REACTION_USER_LIMIT_REACHED",e[e.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",e[e.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",e[e.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",e[e.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",e[e.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",e[e.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",e[e.TRANS_FAILED=28401]="TRANS_FAILED",e[e.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",e[e.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",e[e.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",e[e.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",e[e.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",e[e.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",e[e.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",e[e.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",e[e.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",e[e.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",e[e.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",e[e.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",e[e.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",e[e.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",e[e.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",e[e.RC_TCP_RESET=32054]="RC_TCP_RESET",e[e.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",e[e.PROTOCOL_DECODE_ERROR=32546]="PROTOCOL_DECODE_ERROR",e[e.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.METHOD_BUSY=33103]="METHOD_BUSY",e[e.SDK_PULL_CONVERSATION=33302]="SDK_PULL_CONVERSATION",e[e.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",e[e.QUOTE_MSG_NOT_FOUND=33403]="QUOTE_MSG_NOT_FOUND",e[e.INVALID_PARAMETER_QUOTE_INFO=33404]="INVALID_PARAMETER_QUOTE_INFO",e[e.REACTION_ID_INVALID=33405]="REACTION_ID_INVALID",e[e.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",e[e.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",e[e.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.UPLOAD_FAIL=34011]="UPLOAD_FAIL",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",e[e.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",e[e.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",e[e.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",e[e.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",e[e.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",e[e.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",e[e.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",e[e.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",e[e.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",e[e.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",e[e.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",e[e.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",e[e.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",e[e.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",e[e.INVALID_PARAMETER_REQUEST_URL=34208]="INVALID_PARAMETER_REQUEST_URL",e[e.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",e[e.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",e[e.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",e[e.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",e[e.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",e[e.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",e[e.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",e[e.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",e[e.INVALID_PARAMETER_NOTMEDIAMESSAGE=34223]="INVALID_PARAMETER_NOTMEDIAMESSAGE",e[e.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",e[e.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",e[e.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",e[e.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",e[e.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",e[e.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",e[e.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",e[e.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",e[e.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",e[e.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",e[e.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",e[e.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",e[e.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",e[e.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",e[e.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",e[e.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",e[e.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",e[e.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",e[e.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",e[e.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",e[e.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",e[e.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",e[e.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",e[e.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",e[e.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",e[e.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",e[e.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",e[e.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",e[e.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",e[e.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",e[e.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",e[e.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",e[e.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",e[e.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",e[e.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",e[e.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",e[e.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",e[e.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",e[e.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",e[e.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",e[e.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",e[e.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",e[e.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",e[e.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",e[e.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",e[e.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",e[e.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",e[e.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",e[e.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",e[e.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",e[e.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",e[e.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",e[e.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",e[e.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",e[e.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",e[e.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",e[e.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",e[e.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",e[e.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",e[e.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",e[e.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",e[e.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",e[e.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",e[e.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",e[e.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",e[e.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",e[e.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",e[e.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",e[e.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",e[e.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",e[e.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",e[e.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",e[e.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",e[e.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",e[e.INVALID_PARAMETER_PAGE_TOKEN=34346]="INVALID_PARAMETER_PAGE_TOKEN",e[e.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN=34435]="SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN",e[e.SERVER_RECORD_UNREAD_COUNT_DISABLED=34436]="SERVER_RECORD_UNREAD_COUNT_DISABLED",e[e.DATABASEDISKFULL=34439]="DATABASEDISKFULL",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.NOT_SUPPORT=35004]="NOT_SUPPORT",e[e.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",e[e.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",e[e.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",e[e.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",e[e.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",e[e.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",e[e.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",e[e.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",e[e.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",e[e.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",e[e.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",e[e.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",e[e.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",e[e.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",e[e.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",e[e.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",e[e.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",e[e.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",e[e.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",e[e.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",e[e.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",e[e.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",e[e.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",e[e.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",e[e.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",e[e.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",e[e.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",e[e.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",e[e.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",e[e.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",e[e.DNS_PROXY_DATA_ERROR=35053]="DNS_PROXY_DATA_ERROR",e[e.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",e[e.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",e[e.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",e[e.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",e[e.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",e[e.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",e[e.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",e[e.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",e[e.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",e[e.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",e[e.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",e[e.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",e[e.MSG_BLOCK_SEND=35066]="MSG_BLOCK_SEND",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",e[e.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",e[e.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",e[e.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",e[e.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",e[e.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.TIMEOUT=-1]="TIMEOUT"}(Re||(Re={})),function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.ULTRA_GROUP=10]="ULTRA_GROUP",e[e.RTC_ROOM=12]="RTC_ROOM"}(ve||(ve={}));var rt,nt,it,ot=0,at=1,st=2,ut=3,ct=4,lt=5,dt=6,ft=7,_t=function(e){var t=[ve.PRIVATE,ve.GROUP,ve.SYSTEM,ve.PUBLIC_SERVICE,ve.APP_PUBLIC_SERVICE];switch(e){case ot:return t;case at:return[ve.PRIVATE,ve.GROUP];case st:return B(B([],H(t),!1),[ve.ULTRA_GROUP],!1);case ut:return B(B([],H(t),!1),[ve.ULTRA_GROUP,ve.CHATROOM],!1);case ct:return B(B([],H(t),!1),[ve.ULTRA_GROUP,ve.CHATROOM,ve.RTC_ROOM,ve.CUSTOMER_SERVICE,ve.DISCUSSION],!1);case lt:return[ve.PRIVATE,ve.GROUP,ve.ULTRA_GROUP];case dt:return[ve.GROUP];case ft:return[ve.PRIVATE]}};!function(e){e[e.RMTP=1]="RMTP",e[e.TLS=2]="TLS",e[e.RPP=3]="RPP",e[e.QUIC=4]="QUIC",e[e.WS=5]="WS",e[e.WSS=6]="WSS",e[e.HTTP=11]="HTTP",e[e.HTTPS=12]="HTTPS"}(rt||(rt={})),function(e){e[e.IMAGE=1]="IMAGE",e[e.AUDIO=2]="AUDIO",e[e.VIDEO=3]="VIDEO",e[e.FILE=4]="FILE",e[e.SIGHT=5]="SIGHT",e[e.COMBINE_HTML=6]="COMBINE_HTML"}(nt||(nt={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(it||(it={}));var pt,Et,gt,ht,bt,Rt,vt,It,Ot,Tt,Nt,mt,Ct,St,yt,At,Pt,Lt,Mt,Ut,Dt,wt="RC:TxtMsg",jt="RC:VcMsg",Vt="RC:HQVCMsg",Gt="RC:LogCmdMsg",kt="RC:MsgExMsg",Ft="RC:ReferenceMsg",Ht="RC:RcCmd",Bt="RC:RcNtf",Jt="RC:ReadNtf",xt="RC:RRReqMsg",Wt="RC:RRRspMsg",Yt="RC:SRSMsg",Kt="RC:RRMsg",Xt="RC:RSMsg",Qt="RC:Delivered",Zt="RC:DRMsg",qt="RC:ChrmMemChange",zt="RC:ChrmSyncMsg",$t="RC:ChrmBlockMsg",er="RC:ChrmBanMsg",tr="RC:CCConfigChangeRequestMsg";!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(pt||(pt={})),function(e){e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(Et||(Et={})),function(e){e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY",e[e.MSG_RECALL=3]="MSG_RECALL",e[e.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",e[e.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE",e[e.UG_DEL=6]="UG_DEL"}(gt||(gt={})),function(e){e[e.CHANNEL_DELETE=1]="CHANNEL_DELETE",e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PRIVATE_CHANNEL_USER_JOIN_PUBLIC=4]="PRIVATE_CHANNEL_USER_JOIN_PUBLIC",e[e.CHANNEL_USER_KICKED=5]="CHANNEL_USER_KICKED",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(ht||(ht={})),function(e){e[e.REMOVE_USER_GROUP=1]="REMOVE_USER_GROUP",e[e.JOIN_USER_GROUP=2]="JOIN_USER_GROUP",e[e.EXIT_USER_GROUP=3]="EXIT_USER_GROUP",e[e.CHANNEL_BIND_USER_GROUP=4]="CHANNEL_BIND_USER_GROUP",e[e.CHANNEL_UNBIND_USER_GROUP=5]="CHANNEL_UNBIND_USER_GROUP"}(bt||(bt={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(Rt||(Rt={})),function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(vt||(vt={})),function(e){e[e.typing=0]="typing"}(It||(It={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(Ot||(Ot={})),function(e){e[e.Other=0]="Other",e[e.iOS=1]="iOS",e[e.Android=2]="Android",e[e.Web=3]="Web",e[e.PC=4]="PC",e[e.Mini=5]="Mini",e[e.HarmonyOS=6]="HarmonyOS"}(Tt||(Tt={})),function(e){e[e.ONLINE_STATUS=1]="ONLINE_STATUS",e[e.USER_PROFILE=2]="USER_PROFILE",e[e.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",e[e.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE"}(Nt||(Nt={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(mt||(mt={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(Ct||(Ct={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(St||(St={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(yt||(yt={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(At||(At={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(Pt||(Pt={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(Lt||(Lt={})),function(e){e.IM_NAVI="IM-stats_navi-S",e.IM_WEBSOCKET="IM-stats_websocket-S",e.IM_CONNECTION_DURATION="IM-stats_con_dur-S",e.IM_CMP="IM-stats_cmp-S",e.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",e.IM_STATS_CS="IM-stats_cs-S",e.IM_NETWORK_CHANGE="IM-stats_network_change-S",e.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",e.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",e.IM_MSG_SEND="IM-msg_send-S",e.IM_MSG_RECEIVE="IM-msg_receive-S"}(Mt||(Mt={})),function(e){e[e.ALL_MESSAGE=-1]="ALL_MESSAGE",e[e.NOT_SET=0]="NOT_SET",e[e.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",e[e.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",e[e.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",e[e.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(Ut||(Ut={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(Dt||(Dt={}));var rr,nr,ir,or,ar,sr,ur,cr,lr,dr=function(e){return e<=Ut.NOT_SET?Dt.CLOSE:Dt.OPEN};!function(e){e[e.READ=1]="READ",e[e.LISTENED=2]="LISTENED",e[e.DOWNLOADED=4]="DOWNLOADED",e[e.RETRIEVED=8]="RETRIEVED",e[e.UNREAD=0]="UNREAD"}(rr||(rr={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(nr||(nr={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(ir||(ir={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(or||(or={})),function(e){e[e.CURRENT=2]="CURRENT"}(ar||(ar={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(sr||(sr={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(ur||(ur={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(cr||(cr={})),function(e){e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED"}(lr||(lr={}));var fr,_r,pr=0,Er=0;!function(e){e.WIFI="wifi",e.FOUR_G="4g",e.THREE_G="3g",e.TWO_G="2g",e.FIVE_G="2g",e.THREE_GENT="3gnet",e.UNKONWN="unknown"}(fr||(fr={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(_r||(_r={}));var gr=72e5,hr="5.42.1".replace(/-.+$/,""),br="rongcloudsystem",Rr="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{},vr="engine";Rr[vr]="5.42.1";var Ir=function(){function e(){}return Object.defineProperty(e,"add",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){["imlib-next","engine","electron-main","electron-renderer","imlib-v2-adapter","Global_IM_UIKit","IMKit","imkit-store","rtclib","calllib","callplus","plugin-wechat-rtc"].includes(e)&&(Rr[e]=t)}}),Object.defineProperty(e,"validEngine",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;var r=t[0].split(".").map((function(e){return e.padStart(3,"0")})).join("");return Rr[vr].match(/\d+\.\d+\.\d+/)[0].split(".").map((function(e){return e.padStart(3,"0")})).join("")>=r}}),Object.defineProperty(e,"getInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Rr}}),e}();var Or=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=Math.floor(36*Math.random());return("x"===e?t:3&t|8).toString(36)}))},Tr=function(e){void 0===e&&(e=22);var t,r=Date.now(),n=r.toString(36),i=Math.floor(Math.random()*r).toString(36),o=e-n.length-i.length;return[i,n,o>0?(t=o,Array.from({length:t}).map((function(){return Math.floor(36*Math.random()).toString(36)})).join("")):""].join("").slice(0,e)}(22),Nr=Date.now(),mr=function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")},Cr=function(e){return function(e){return"string"==typeof e}(e)&&/https?:\/\//.test(e)},Sr=function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},yr=function(e){return{isRead:(e&rr.READ)===rr.READ,isListened:(e&rr.LISTENED)===rr.LISTENED,isDownload:(e&rr.DOWNLOADED)===rr.DOWNLOADED,isRetrieved:(e&rr.RETRIEVED)===rr.RETRIEVED}},Ar=function(e){return[Tt.iOS,Tt.Android,Tt.Web,Tt.PC,Tt.Mini,Tt.HarmonyOS].map((function(t){var r=e.findIndex((function(e){return e.platform===t}));return-1===r?{platform:t,changeTime:0,eventValue:0}:e[r]}))},Pr=function(e,t,r){return t?1===r?rt.TLS:rt.RMTP:"http"===e?rt.WS:rt.WSS},Lr=function(e,t){var r=e.server,n=e.backupServer,i=e.bs,o=e.serverAddr,a=e.protocol,s=e.openTLS;if(o)return B([],H(o.filter((function(e){return e.addr}))),!1);var u=[],c=[];return r&&c.push(r),(n||i||"").split(",").forEach((function(e){c.indexOf(e)<0&&c.push(e)})),c.forEach((function(e,n){e&&u.push({addr:e,protocol:Pr(a,t,s),weight:r.length-n,race:!1})})),B([],H(u),!1)},Mr=function(e){if(void 0!==e){var t=Number(e);return Number.isNaN(t)?void 0:t}},Ur=function(e){return e.reduce((function(e,t){return e[t.key]=t.value,e}),{})},Dr=function(e,t){var r=Math.floor(1e3*Math.random()%1e4),n=Or(),i=function(e){e=e||"-";var t=new Date,r=t.getFullYear(),n=t.getMonth()+1,i=t.getDate();return"".concat(r).concat(e).concat(n).concat(e).concat(i)}(),o=(new Date).getTime(),a="";if(t){var s=t.split(".");a=".".concat(s[s.length-1])}return"".concat(e,"__RC-").concat(i,"_").concat(r,"_").concat(o).concat(n).concat(a)},wr=function(e,t,r){void 0===e&&(e={}),void 0===t&&(t={}),void 0===r&&(r={});var n=t.channelIdMi,i=t.channelIdHW,o=t.channelIdOPPO,a=t.typeVivo,s=t.importanceHW,u=t.categoryHW,c=t.imageUrlHW,l=t.categoryVivo,d=t.importanceHonor,f=t.imageUrlHonor,_=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var r=e.threadId,n=e.apnsCollapseId,i=e.category,o=e.richMediaUri,a=e.interruptionLevel,s=t.googleConfig,u={};u["thread-id"]=r||"",u["apns-collapse-id"]=n||"",u.category=i||"",u.richMediaUri=o||"",u["interruption-level"]=a||"active";var c={};c.collapse_key=null==s?void 0:s.collapseKey,c.imageUrl=null==s?void 0:s.imageUrl;var l=null==s?void 0:s.priority;return l&&!["high","normal"].includes(l)&&(l="normal"),c.priority=l,{APNS:u,FCM:c}}(e,t),p=[{HW:{channelId:i||"",importance:s||"NORMAL",image:c||"",category:u||""}},{MI:{channelId:n||""}},{OPPO:{channelId:o||""}},{VIVO:{classification:a||"",category:l||""}},{APNS:_.APNS},{FCM:_.FCM},{HONOR:{importance:d||Lt.NORMAL,image:f||""}},{OHOS:{category:r.category||null,image:r.image||""}}];return JSON.stringify(p)},jr=function(){var e=Ir.getInfo(),t="electron";for(var r in e)"engine"!==r&&(t=["imlib-v2-adapter","imlib-next"].includes(r)?r:"electron");return t};function Vr(e,t){var r;if(!e)return"";var n="undefined"!=typeof window&&"https:"===(null===(r=null===window||void 0===window?void 0:window.location)||void 0===r?void 0:r.protocol);return/^https?:\/\//.test(e)?n?e.replace(/^https?:\/\//i,"https://"):e:t!==rt.HTTP||n?"https://".concat(e):"http://".concat(e)}var Gr=function(e,t){if(!e)return"";var r=e.ossConfig,n=void 0===r?"":r,i="";try{var o=JSON.parse(n);if(o.length>0){var a=o.find((function(e){return e.minio}));a&&(i=a.minio)}}catch(e){t.warn(ze,JSON.stringify({ossConfig:n,error:e}))}return i};var kr,Fr=function(e){function t(t){var r=e.call(this,t)||this;return r.name="RCError",r}return w(t,e),Object.defineProperty(t,"InvalidParameters",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(null==e?void 0:e.length)?new t("Invalid parameter -> ".concat(e)):new t("Invalid parameters.")}}),Object.defineProperty(t,"ParameterTypeError",{enumerable:!1,configurable:!0,writable:!0,value:function(){return new t("Wrong parameter type")}}),t}(Error),Hr=function(){function e(){kr.set(this,!1)}return Object.defineProperty(e.prototype,"stopPropagation",{enumerable:!1,configurable:!0,writable:!0,value:function(){x(this,kr,!0,"f")}}),Object.defineProperty(e.prototype,"isStopPropagation",{get:function(){return J(this,kr,"f")},enumerable:!1,configurable:!0}),e}();kr=new WeakMap;var Br=function(){function e(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}return Object.defineProperty(e.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){void 0===i&&(i=0);var o=Symbol(),a=this._map.get(e)||this._map.set(e,[]).get(e),s={symbol:o,priority:Math.min(i,100),listener:t.bind(n),once:r},u=a.findIndex((function(e){return e.priority>i}));return-1===u?a.push(s):a.splice(u,0,s),o}}),Object.defineProperty(e.prototype,"on",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!1,r,n)}}),Object.defineProperty(e.prototype,"once",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=0),this._addItem(e,t,!0,r,n)}}),Object.defineProperty(e.prototype,"off",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;try{for(var n=F(this._map),i=n.next();!i.done;i=n.next()){var o=H(i.value,2),a=(o[0],o[1]),s=a.findIndex((function(t){return t.symbol===e}));if(-1!==s)return void a.splice(s,1)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this._map.get(e);if(n&&n.length>0)for(var i=new Hr,o=0;o<n.length;o+=1){var a=n[o],s=a.once,u=a.listener;s&&n.splice(o,1);try{u.apply(void 0,B([i],H(t),!1))}catch(e){null===console||void 0===console||console.error(e)}if(i.isStopPropagation)return}B([],H(this._piped.entries()),!1).forEach((function(r){var n=H(r,2),i=n[0],o=n[1];(0===o.length||o.includes(e))&&i.emit.apply(i,B([e],H(t),!1))}))}}),Object.defineProperty(e.prototype,"removeAll",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._map.delete(e)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._piped.clear(),this._map.clear()}}),Object.defineProperty(e.prototype,"pipe",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._piped.set(e,t||[])}}),e}();!function(e){function t(t){var r=e.call(this)||this;return Object.defineProperty(r,"_name",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"_versionQueue",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(r,"_pullingPromise",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(r,"_dataVersion",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_invervalTimer",{enumerable:!0,configurable:!0,writable:!0,value:-1}),Object.defineProperty(r,"_started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),r}w(t,e),Object.defineProperty(t.prototype,"length",{get:function(){return this._versionQueue.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"_isPulling",{get:function(){return null!==this._pullingPromise},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setInitVersion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!1),-1===this._dataVersion&&(this._dataVersion=e,t&&this._execPulling())}}),Object.defineProperty(t.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._versionQueue.push(e),-1!==this._dataVersion&&this._execPulling()}}),Object.defineProperty(t.prototype,"_execPulling",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e,t,r,n,i,o;return k(this,(function(a){switch(a.label){case 0:return this._pullingPromise?[2]:(this._pullingPromise=this._handleSyncData(this._dataVersion),[4,this._pullingPromise]);case 1:if(e=a.sent(),t=e.isOk,r=e.data,this._pullingPromise=null,!t)return[2];if(void 0===(null==r?void 0:r.version)||r.version<this._dataVersion)throw new Error("".concat(this._name,": version error, please check: lastVersion: ").concat(this._dataVersion,", newVersion: ").concat(null==r?void 0:r.version));return n=r.version,i=r.hasNext,o=this._versionQueue.filter((function(e){return e>n})),this._versionQueue=B([],H(o),!1),this._dataVersion=n,i?[2,this._execPulling()]:this._versionQueue.length>0?(this._versionQueue.length=0,[2,this._execPulling()]):[2]}}))}))}}),Object.defineProperty(t.prototype,"startInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;this._started||(this._started=!0,t&&this._execPulling(),this._invervalTimer=setInterval((function(){return r._execPulling()}),e))}}),Object.defineProperty(t.prototype,"stopInterval",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._started&&(this._started=!1,clearInterval(this._invervalTimer),this._invervalTimer=-1)}}),Object.defineProperty(t.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.stopInterval(),this._versionQueue.length=0,this._dataVersion=-1}})}(Br);var Jr=function(){function e(e,t,r){Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e,this.code=e,this.msg=t,this.data=r}return Object.defineProperty(e,"from",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return new e(t,r||"fail: ".concat(t),n)}}),Object.defineProperty(e,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return new e(0,r||"success",t)}}),Object.defineProperty(e,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return new e(t,r||"fail: ".concat(t),n)}}),Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){return k(this,(function(t){return this.isOk?[2,e(this.data)]:[2,this.wipe()]}))}))}}),Object.defineProperty(e.prototype,"or",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){return k(this,(function(t){return this.isOk?[2,this]:[2,e(this.code)]}))}))}}),Object.defineProperty(e.prototype,"orSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?this:e(this.code)}}),Object.defineProperty(e.prototype,"trans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?xr(e(this.data)):this.wipe()}}),Object.defineProperty(e.prototype,"tryTrans",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isOk?e(this.data):this.wipe()}}),Object.defineProperty(e.prototype,"errmsg",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify({code:this.code,msg:this.msg})}}),Object.defineProperty(e.prototype,"wipe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isOk?xr(void 0,this.msg):Wr(this.code,this.msg)}}),e}(),xr=Jr.ok,Wr=Jr.fail;!function(){function e(e){Object.defineProperty(this,"_apiName",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_isValid",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_code",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_errmsg",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}Object.defineProperty(e,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return new e(t)}}),Object.defineProperty(e.prototype,"isFailed",{get:function(){return!this._isValid},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isFailed&&(0===this._code||r)&&(this._code=e,this._errmsg=t||this._errmsg),this}}),Object.defineProperty(e.prototype,"setFailed",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._isValid=!1,this.fail(e,t)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.isFailed&&0===this._code)throw new Error("Validator: result() should not be called without fail()");return this.isFailed?Wr(this._code,this._errmsg):xr()}}),Object.defineProperty(e.prototype,"check",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.isFailed||e(this),this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),this.isFailed)return this;var i=n?r(t):null==t||r(t);return this._isValid=i,this.isFailed&&(this._errmsg="param '".concat(e,"' is invalid")),this}}),Object.defineProperty(e.prototype,"assert",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(void 0===n&&(n=!1),this.isFailed)return this;if(this.validate(e,t,r,n),this.isFailed)throw Fr.InvalidParameters("'".concat(e,"' at '").concat(this._apiName,"'"));return this}}),Object.defineProperty(e.prototype,"isString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"assertString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(){return"string"==typeof t}),r)}}),Object.defineProperty(e.prototype,"isHttpUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isNotEmptyString(e,t,r).validate(e,t,(function(e){return/^https?:\/\//.test(e)}))}}),Object.defineProperty(e.prototype,"isNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isString(e,t,r).validate(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"assertNotEmptyString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assertString(e,t,r),this.assert(e,t,(function(e){return e.trim().length>0}),r)}}),Object.defineProperty(e.prototype,"isLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isString(e,t,i).validate(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedString",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertString(e,t,i),this.assert(e,t,(function(e){return e.length>=r&&e.length<=n}),i)}}),Object.defineProperty(e.prototype,"isBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertBoolean",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"boolean"==typeof e}),r)}}),Object.defineProperty(e.prototype,"isNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"assertNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"number"==typeof e&&!Number.isNaN(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isNumber(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"assertLimitedNumber",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertNumber(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"assertInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return Number.isInteger(e)}),r)}}),Object.defineProperty(e.prototype,"isLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.isInteger(e,t,i).validate(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.isLimitedInteger(e,t,0,Number.MAX_SAFE_INTEGER,r)}}),Object.defineProperty(e.prototype,"assertLimitedInteger",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===i&&(i=!1),this.assertInteger(e,t,i),this.assert(e,t,(function(e){return e>=r&&e<=n}),i)}}),Object.defineProperty(e.prototype,"isArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"assertArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return-1!==Object.prototype.toString.call(e).indexOf("Array")}),r)}}),Object.defineProperty(e.prototype,"isLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.isArray(e,t,n).validate(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"assertLimitedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return void 0===n&&(n=!1),void 0===i&&(i=1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.length>=i&&e.length<=r}),n)}}),Object.defineProperty(e.prototype,"isTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isArray(e,t,n).validate(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"assertTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assertArray(e,t,n),this.assert(e,t,(function(e){return e.every(r)}),n)}}),Object.defineProperty(e.prototype,"isLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.isLimitedArray(e,t,r,i,o).validate(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"assertLimitedTypedArray",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return void 0===i&&(i=!1),void 0===o&&(o=1),this.assertLimitedArray(e,t,r,i,o),this.assert(e,t,(function(e){return e.every(n)}),i)}}),Object.defineProperty(e.prototype,"isObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"assertObject",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"[object Object]"===Object.prototype.toString.call(e)}),r)}}),Object.defineProperty(e.prototype,"isStringEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isString(e,t,n).validate(e,t,(function(e){return Object.values(r).includes(e)}),n)}}),Object.defineProperty(e.prototype,"isNumberEnum",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.isNumber(e,t,n).validate(e,t,(function(e){return Object.values(r).includes(e)}),n)}}),Object.defineProperty(e.prototype,"assertValueOf",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return void 0===n&&(n=!1),this.assert(e,t,(function(){return Object.values(r).includes(t)}),n)}}),Object.defineProperty(e.prototype,"isFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.validate(e,t,(function(e){return"function"==typeof e}),r)}}),Object.defineProperty(e.prototype,"assertFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this.assert(e,t,(function(e){return"function"==typeof e}),r)}})}();var Yr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function Kr(e){var t,r,n,i,o,a,s="",u=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");u<e.length;)t=Yr.indexOf(e.charAt(u++))<<2|(i=Yr.indexOf(e.charAt(u++)))>>4,r=(15&i)<<4|(o=Yr.indexOf(e.charAt(u++)))>>2,n=(3&o)<<6|(a=Yr.indexOf(e.charAt(u++))),s+=String.fromCharCode(t),64!==o&&(s+=String.fromCharCode(r)),64!==a&&(s+=String.fromCharCode(n));return s}var Xr,Qr=function(){var e,t=new Promise((function(t){e=t}));return{resolve:e,promise:t}},Zr=1732584193,qr=4023233417,zr=2562383102,$r=271733878,en=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],tn=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713,3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745];function rn(e,t){return e<<t|e>>>32-t}function nn(e,t,r){return e&r|t&~r}function on(e,t,r){return e^t^r}function an(e,t,r){return t^(e|~r)}function sn(e){for(var t=[],r=0;r<e.length;r+=4)t.push((e[r]||0)|(e[r+1]||0)<<8|(e[r+2]||0)<<16|(e[r+3]||0)<<24);return t}function un(e){var t=new Uint8Array(4);return t[0]=255&e,t[1]=e>>8&255,t[2]=e>>16&255,t[3]=e>>24&255,t}function cn(e){var t=8*e.length,r=e.length%64<56?56-e.length%64:120-e.length%64,n=new Uint8Array(e.length+r+8);n.set(e),n[e.length]=128;for(var i=1;i<r;i++)n[e.length+i]=0;var o=new Uint8Array(8),a=4294967295&t,s=4294967295&Math.floor(t/4294967296);o.set(un(a),0),o.set(un(s),4),n.set(o,e.length+r);var u,c=Zr,l=qr,d=zr,f=$r;for(i=0;i<n.length;i+=64){for(var _=sn(n.slice(i,i+64)),p=c,E=l,g=d,h=f,b=0;b<64;b++){var R=void 0,v=void 0;b<16?(R=(u=l)&d|~u&f,v=b):b<32?(R=nn(l,d,f),v=(5*b+1)%16):b<48?(R=on(l,d,f),v=(3*b+5)%16):(R=an(l,d,f),v=7*b%16);var I=f;f=d,d=l,l+=rn(c+R+tn[b]+_[v]&4294967295,en[b]),c=I}c=c+p&4294967295,l=l+E&4294967295,d=d+g&4294967295,f=f+h&4294967295}var O=new Uint8Array(16);return O.set(un(c),0),O.set(un(l),4),O.set(un(d),8),O.set(un(f),12),function(e){return Array.from(e).map((function(e){return e.toString(16).padStart(2,"0")})).join("")}(O)}function ln(e){var t=function(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);var t=unescape(encodeURIComponent(e)).split("").map((function(e){return e.charCodeAt(0)}));return new Uint8Array(t)}(e);return cn(t)}function dn(e){if(!e||0===e.length)return[];var t=new Set;return e.forEach((function(e){t.add(e)})),Array.from(t)}!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(Xr||(Xr={}));var fn,_n,pn=0,En=1;!function(e){e[e.BJ=1]="BJ",e[e.SG=2]="SG",e[e.NA=3]="NA",e[e.SG_A=4]="SG_A",e[e.SG_B=4]="SG_B",e[e.SA=5]="SA",e[e.OM=6]="OM"}(_n||(_n={}));var gn=((fn={})[_n.BJ]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:rt.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},fn[_n.SG]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:rt.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},fn[_n.NA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:rt.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},fn[_n.SG_B]={naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:rt.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},fn[_n.SA]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:rt.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},fn[_n.OM]={naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:rt.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]},fn);function hn(e){return _n[e]?e:_n.BJ}var bn,Rn=function(){function e(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.initOption=e}}),Object.defineProperty(e.prototype,"getNaviUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this.initOption||{},i=n.areaCode,o=n.navigators,a=(r=i,void 0===r&&(r=_n.BJ),gn[hn(r)].naviUrlBase64).map((function(e){return Kr(e)})),s=[],u=H(e.split("@"),2)[1];t&&(s=u?u.split(";"):[]);var c=o&&o.length>0?B(B([],H(s),!1),H(o),!1):B(B([],H(s),!1),H(a),!1);return c.filter((function(e,t){return c.indexOf(e)===t})).map((function(e){return Vr(e)}))}}),Object.defineProperty(e.prototype,"getLogUrlPolicyList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=e||{},i=n.log,o=n.logPolicy,a=this.initOption||{},s=a.areaCode,u=a.logServerUrl,c=(r=s,void 0===r&&(r=_n.BJ),gn[hn(r)].logUrlBase64).map((function(e){return V(V({},e),{addr:Kr(e.addr)})})),l=[],d={level:1,itv:6,times:5};if(i)l.push.apply(l,B([],H(i.addrs),!1)),Object.assign(d,i.policy);else if(o)try{var f=JSON.parse(o);l.push({addr:f.url,protocol:rt.HTTPS,weight:1}),d.level=f.level,d.itv=f.itv,d.times=f.times}catch(r){t.warn(Ge,JSON.stringify({policy:e.logPolicy}))}var _=u?B([{addr:u,protocol:rt.HTTPS,weight:101}],H(l),!1):B(B([],H(l),!1),H(c),!1);return{policy:d,addrs:_.filter((function(e,t){return _.findIndex((function(t){return t.addr===e.addr&&t.protocol===e.protocol}))===t})).map((function(e){return V(V({},e),{addr:Vr(e.addr,e.protocol)})})).sort((function(e,t){return t.weight-e.weight}))}}}),Object.defineProperty(e.prototype,"getMiniCmpUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t,r=(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=_n.BJ),gn[hn(t)].miniCmpBase64).map((function(e){return Kr(e)})),n=(this.initOption||{}).miniCMPProxy;return n&&n.length>0?n:r}}),Object.defineProperty(e.prototype,"getStaticConfigUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode,void 0===t&&(t=_n.BJ),gn[hn(t)].staticConfigUrlBase64).map((function(e){return Kr(e)}))}}),Object.defineProperty(e.prototype,"getCloudControllerUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode;return(r=n,void 0===r&&(r=_n.BJ),gn[hn(r)].cloudControllerUrlBase64).map((function(e){return Kr(e)}))}}),Object.defineProperty(e.prototype,"getAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:_n.BJ}}),Object.defineProperty(e.prototype,"setAreaCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!(!e||!_n[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n=e||{},i=n.active,o=n.activeServer,a=(null==i?void 0:i.addrs)||[],s=(r=null===(t=this.initOption)||void 0===t?void 0:t.areaCode,void 0===r&&(r=_n.BJ),gn[hn(r)].statsUrlBase64).map((function(e){return Kr(e)})),u=[];return 0!==a.length?u.push.apply(u,B([],H(a.sort((function(e,t){return t.weight-e.weight})).map((function(e){return Vr(e.addr,e.protocol)}))),!1)):o&&u.push(Vr(o,rt.HTTPS)),s.forEach((function(e){u.includes(e)||u.push(e)})),u}}),e}(),vn=new Rn,In=function(){function e(e,t){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticUrls",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"getStaticConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return G(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u;return k(this,(function(c){switch(c.label){case 0:if(!(t=this.getCache()))return[3,6];c.label=1;case 1:return c.trys.push([1,4,,5]),r=JSON.parse(t),Date.now()-(null==r?void 0:r.time)<18e5?[4,this.decryptData(r.val)]:[3,3];case 2:return n=c.sent(),(i=n.resources.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:i.map((function(e){return Vr(e.addr,e.protocol)}))||[]}];case 3:return[3,5];case 4:return o=c.sent(),this.logger.error(We,JSON.stringify({error:null==o?void 0:o.stack})),[3,5];case 5:this.clearCache(),c.label=6;case 6:return[4,this._requestHandle()];case 7:return(a=c.sent())?[4,this.decryptData(a)]:[2];case 8:return(null==(s=c.sent())?void 0:s.areaCode)!==vn.getAreaCode()?[2]:(this.setCache(JSON.stringify({time:Date.now(),val:a})),this.staticUrls=(null==s?void 0:s.bootstrap)||[],(u=null===(e=null==s?void 0:s.resources)||void 0===e?void 0:e.navi.slice()).sort((function(e,t){return t.weight-e.weight})),[2,{navi:u.map((function(e){return Vr(e.addr,e.protocol)}))||[]}])}}))}))}}),Object.defineProperty(e.prototype,"_requestHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e,t,r,n,i,o,a,s,u,c,l;return k(this,(function(d){switch(d.label){case 0:e=(e=B(B([],H(this.staticUrls),!1),H(vn.getStaticConfigUrl()),!1).map((function(e){return Vr(e)}))).filter((function(t,r){return e.indexOf(t)===r})),d.label=1;case 1:d.trys.push([1,6,7,8]),t=F(e),r=t.next(),d.label=2;case 2:return r.done?[3,5]:(n=r.value,this.logger.info(Je,JSON.stringify({url:n})),i=Date.now(),[4,this.sendRequest("".concat(n,"/").concat(this.appkey))]);case 3:if(o=d.sent(),a=o.code,s=o.data,200===a)return this.logger.info(xe,JSON.stringify({url:n,code:a,duration:Date.now()-i})),[2,s];this.logger.warn(xe,JSON.stringify({url:n,code:a,duration:Date.now()-i})),d.label=4;case 4:return r=t.next(),[3,2];case 5:return[3,8];case 6:return u=d.sent(),c={error:u},[3,8];case 7:try{r&&!r.done&&(l=t.return)&&l.call(t)}finally{if(c)throw c.error}return[7];case 8:return[2]}}))}))}}),e}();!function(e){e[e.STATISTICS=-2]="STATISTICS",e[e.RECORD=-1]="RECORD",e[e.FATAL=0]="FATAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG"}(bn||(bn={}));var On,Tn,Nn=function(){function e(e,t,r,n){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"proxy",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:bn.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,bn.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,bn.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,bn.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,bn.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,bn.STATISTICS)}),Object.defineProperty(this,"record",{enumerable:!0,configurable:!0,writable:!0,value:this.__statistics})}return Object.defineProperty(e.prototype,"_write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.tag,r=e.level,n=e.content,i=e.traceId;/^[\w-]+$/.test(t)?r!==bn.DEBUG&&this.proxy.write(e):console.error("".concat((new Date).toISOString(),"[").concat(this._id,"]['ERROR']: ").concat(t," | ").concat(n," | ").concat(i))}}),Object.defineProperty(e.prototype,"createTraceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"".concat(++e._traceIdCount)}}),Object.defineProperty(e.prototype,"getSessionId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Tr}}),Object.defineProperty(e.prototype,"_stdout",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.time,r=e.tag,n=e.content,i=e.traceId,o=e.level,a=e.loggerId;if(console&&!(o<=bn.FATAL||o>this.outputLevel)){var s=["error","warn","info","debug"][o-1],u="".concat(new Date(t).toISOString(),"[").concat(null!=a?a:this._id,"][").concat((s||"stat").toUpperCase(),"]: ").concat(r," | ").concat(n," | ").concat(i);console[s||"warn"](u)}}}),Object.defineProperty(e.prototype,"setOutputLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){(function(e){return[bn.DEBUG,bn.INFO,bn.WARN,bn.ERROR].some((function(t){return t===e}))})(e)&&(this.outputLevel=e)}}),Object.defineProperty(e.prototype,"_log",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i={time:Date.now(),level:e,tag:t,content:r,traceId:n,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(i),this._write(i)}}),Object.defineProperty(e.prototype,"summary",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){if(void 0===n&&(n={}),t.isOk){var a=null==i?void 0:i(t.data);this.info(e,JSON.stringify(V(V({isOk:!0},n),a)),r)}else{a=null==o?void 0:o(t.data);this.warn(e,JSON.stringify(V(V({code:t.code,msg:t.msg},n),a)),r)}}}),Object.defineProperty(e,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),e}(),mn=function(){function e(e,t,r,n,i){void 0===i&&(i=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}return Object.defineProperty(e.prototype,"_getLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){return G(this,void 0,void 0,(function(){var i,a;return k(this,(function(s){switch(s.label){case 0:i=[],s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.logDB.read(e,t,r,n,o)];case 2:return a=s.sent(),mr(a.logs)&&(i=a.logs.filter((function(e){return!(!e||"object"!=typeof e)}))),[3,4];case 3:return s.sent(),[3,4];case 4:return[2,{logs:i}]}}))}))}}),Object.defineProperty(e.prototype,"checkStart",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n,i;return k(this,(function(o){return this.started?[2]:(this.userId=e.userId,!e.logSwitch||this.disableLogReport||(r=vn.getLogUrlPolicyList(e,this.logger),n=r.policy,i=r.addrs,this.started=!0,this.itvByNavi=n.itv,this.timesByNavi=n.times,i.length>0&&this.realtimeReport(i[0].addr,n.level,n.itv,t)),[2])}))}))}}),Object.defineProperty(e.prototype,"_sendLogs2Realtime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_;return k(this,(function(p){switch(p.label){case 0:return[4,this.compressLogs(e)];case 1:return i=p.sent(),o=i.success,a=i.data,o?(s=Cr(r)?r:"https://".concat(r),s+="?version=".concat("5.42.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.getDeviceId(),"&deviceInfo=").concat(this.deviceInfo,"&platform=Web"),[4,this.send({url:s,body:a,method:"POST"})]):[2,{isOk:!1,itv:n}];case 2:if(u=p.sent(),c=u.status,l=u.data,200!==c)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(n+=n),this.reportFailedNumber++,[2,{isOk:!1,itv:n}];if(this.reportFailedNumber=0,l)try{(_=JSON.parse(l)).nextTime&&(n=_.nextTime),d=_.level,f=_.logSwitch}catch(e){this.logger.warn(ze,JSON.stringify({error:null==e?void 0:e.stack}),t)}return[2,{isOk:!0,itv:n,level:d,logSwitch:f}]}}))}))}}),Object.defineProperty(e.prototype,"realtimeReport",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p=this;return k(this,(function(E){switch(E.label){case 0:return i=Date.now(),o=this.logger.getTimestamp4RealtimeLog()||Nr,a=Math.max(i-3e4,o+1),s=this.logger.createTraceId(),[4,this._getLogs(o,a,t,!0,s,n)];case 1:return 0!==(u=E.sent().logs).length?[3,2]:[3,4];case 2:return u.length>0?[4,this._sendLogs2Realtime(u,s,e,r)]:[3,4];case 3:c=E.sent(),l=c.itv,d=c.level,f=c.logSwitch,c.isOk&&(_=Math.max.apply(Math,B([],H(u.map((function(e){return e.time}))),!1)),this.logger.setTimestamp4RealtimeLog(_+1),0===f&&(this.started=!1),void 0!==d&&(t=d)),r=l,E.label=4;case 4:return this.started&&(r>=60&&this.itvByNavi<60&&(r=60),this.timer=setTimeout((function(){return p.realtimeReport(e,t,r,n)}),1e3*r)),[2]}}))}))}}),Object.defineProperty(e.prototype,"report",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a){return void 0===a&&(a=!1),G(this,void 0,void 0,(function(){var s,u,c,l,d,f,_,p;return k(this,(function(E){switch(E.label){case 0:return"web"!==r.toLowerCase()||this.disableLogReport?[2]:(s=this.logger.createTraceId(),this.logger.info(je,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:o,isCloudControl:a}),s),[4,this._getLogs(e,t,bn.DEBUG,!1,s)]);case 1:return u=E.sent().logs,this.logger.info(we,JSON.stringify({count:u.length}),s),c=Cr(n)?n:"https://".concat(n),c+="?version=".concat("5.42.1","&appkey=").concat(this.appkey,"&userId=").concat(encodeURIComponent(this.userId),"&deviceId=").concat(this.getDeviceId(),"&deviceInfo=").concat(this.deviceInfo,"&platform=Web&logId=").concat(i),u.length>0?[4,this.compressLogs(u)]:[3,3];case 2:return d=E.sent(),f=d.success,_=d.data,l=f?_:"compress failed",[3,4];case 3:l="no data or no database",E.label=4;case 4:return this.logger.debug(we,"compress done",s),a&&(c+="&source=cloud"),[4,this.send({url:c,body:l,method:"POST"})];case 5:return p=E.sent().status,this.logger.info(Ve,JSON.stringify({status:p}),s),[2]}}))}))}}),Object.defineProperty(e.prototype,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1}}),e}();function Cn(e){try{return!(!e||"object"!=typeof e)&&("number"==typeof e.time&&("string"==typeof e.tag&&("string"==typeof e.sessionId&&("string"==typeof e.type&&"number"==typeof e.level))))}catch(e){return!1}}function Sn(){return G(this,void 0,void 0,(function(){return k(this,(function(e){return[2,{logs:[]}]}))}))}function yn(){}var An=function(){function e(e,t){On.set(this,void 0),Tn.set(this,void 0),x(this,On,e,"f"),x(this,Tn,t,"f")}return Object.defineProperty(e.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return G(this,void 0,void 0,(function(){var o,a;return k(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,J(this,On,"f").call(this,e,t,r,n,i)];case 1:return(o=s.sent())&&Array.isArray(o.logs)?[2,{logs:o.logs.filter(Cn)}]:[2,{logs:[]}];case 2:return a=s.sent(),console.error("[LogDBProxy] read error",a),[2,{logs:[]}];case 3:return[2]}}))}))}}),Object.defineProperty(e.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{J(this,Tn,"f").call(this,e)}catch(e){console.error("[LogDBProxy] write error",e)}}}),Object.defineProperty(e.prototype,"setLogReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&x(this,On,e,"f"),this}}),Object.defineProperty(e.prototype,"setLogWriter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"function"==typeof e&&x(this,Tn,e,"f"),this}}),e}();On=new WeakMap,Tn=new WeakMap;var Pn=function(){function e(){}var t,r,n,i,o,a;return Object.defineProperty(e,"start",{enumerable:!1,configurable:!0,writable:!0,value:function(e){J(this,t,"f",r)||(x(this,t,e,"f",r),e.info($e,"start"),J(this,t,"m",a).call(this))}}),Object.defineProperty(e,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){J(this,t,"f",r)&&(J(this,t,"f",r).info($e,"stop"),x(this,t,null,"f",r),J(this,t,"f",n)&&(clearTimeout(J(this,t,"f",n)),x(this,t,null,"f",n)))}}),t=e,a=function e(){var a=this,s=Date.now();x(this,t,setTimeout((function(){var n=Date.now()-s;n>=J(a,t,"f",o)&&J(a,t,"f",r).warn($e,"delta time: ".concat(n,"ms")),J(a,t,"m",e).call(a)}),J(this,t,"f",i)),"f",n)},r={value:null},n={value:null},i={value:30},o={value:1500},e}(),Ln=1,Mn=2,Un=3,Dn=function(){function e(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}return Object.defineProperty(e.prototype,"uploadLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.uploadTask.push(e),this.enqueueTask()}}),Object.defineProperty(e.prototype,"reportLogCmdTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o=this;this.taskLock=!1;var a=null!==(t=e.startTime)&&void 0!==t?t:0,s=null!==(r=e.endTime)&&void 0!==r?r:0,u=null!==(n=e.platform)&&void 0!==n?n:"",c=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==c&&(this.logId=e.logId,this.reporter.report(a,s,u,c,e.logId,"",!0).finally((function(){o.taskLock=!0,o.uploadTask.length>0&&o.enqueueTask()})))}}),Object.defineProperty(e.prototype,"enqueueTask",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.taskLock){var e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}}}),e}();var wn,jn,Vn,Gn,kn=function(){function e(e,t,r){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isEable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"expire",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"interval",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastRequestTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uploadTaskManage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"changeAreaCode",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.uploadTaskManage=new Dn(r)}return Object.defineProperty(e.prototype,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(){try{var e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):{timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}catch(e){this._cache={timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}this._cache&&(this.interval=this._cache.cc.interval,this.expire=this._cache.cc.expire,this.timestamp=this._cache.timestamp||0,this.isEable=this._cache.cc.enable,this.lastRequestTime=this._cache.lastRequestTime,this.logCmdMsgTasks(this._cache),this.setMRTRConfig(this._handleMrtrData(this._cache.mrtr)))}}),Object.defineProperty(e.prototype,"isExire",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.timestamp<this.expire}}),Object.defineProperty(e.prototype,"isOverclock",{enumerable:!1,configurable:!0,writable:!0,value:function(){return(new Date).getTime()-this.lastRequestTime<this.interval}}),Object.defineProperty(e.prototype,"logCmdMsgTasks",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.uploadLog&&e.uploadLog.tasks.forEach((function(e){e.objectName===Gt&&t.uploadTaskManage.uploadLogCmdTask(e)}))}}),Object.defineProperty(e.prototype,"dataHandle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._cache;t.lastRequestTime=this.lastRequestTime,Sr(e)&&(t.timestamp=e.timestamp,e.uploadLog&&!e.uploadLog.temporary&&(t.uploadLog=e.uploadLog),e.cc&&!e.cc.temporary&&(t.cc=e.cc),e.mrtr&&!e.mrtr.temporary&&(t.mrtr=this._handleMrtrData(e.mrtr)),e.mrtr&&this.setMRTRConfig(this._handleMrtrData(e.mrtr))),this.setCloudControllerCache(t),this.expire=t.cc.expire,this.interval=t.cc.interval,this.timestamp=t.timestamp,this.logCmdMsgTasks(e)}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f;return k(this,(function(_){switch(_.label){case 0:return!this.isEable&&t===Ln&&this.isExire()?(this.logger.info(Ye,JSON.stringify({msg:"cloud controller is disabled"})),[2,this.timestamp]):!this.isEable&&t===Mn&&this.isOverclock()?(this.logger.info(Ke,JSON.stringify({msg:"cloud controller is overclock"})),[2,this.timestamp]):(n=Vr(e),this.lastRequestTime=(new Date).getTime(),i="".concat(n,"/v1/config"),o={"Content-Type":"application/json","RC-App-Key":this.appkey},r&&(o["RC-Token"]=r),a={platform:"web",version:"5.42.1",timestamp:this.timestamp},this.logger.record(Mt.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!r,uri:i})),[4,this.httpRequest(i,_r.POST,o,a)]);case 1:return s=_.sent(),u=s.code,c=s.data,this.logger.record(Mt.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),u===Re.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion?(l=c.targetRegion,this.changeAreaCode===l?[2,this.timestamp]:(d=vn.setAreaCode(l),this.logger.info(Ze,JSON.stringify({isChangeSuccess:d,originAreaCode:vn.getAreaCode(),newAreaCode:l})),this.changeAreaCode=l,(f=vn.getCloudControllerUrl(l))[0]?[2,this.request(f[0],Un)]:(this.logger.info(Xe,JSON.stringify({appkey:this.appkey,uri:i,msg:"appkey region error"})),[2,this.timestamp]))):(c&&this.dataHandle(c),[2,this.timestamp||this.lastRequestTime])}}))}))}}),Object.defineProperty(e.prototype,"_handleMrtrData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return{chatroom:(null==e?void 0:e.chatroom)||0,group:(null==e?void 0:e.group)||0,private:(null==e?void 0:e.private)||0,ultraGroup:(null==e?void 0:e.ultraGroup)||0,temporary:!!(null==e?void 0:e.temporary)}}}),e}(),Fn=function(e){return e===Re.RC_CONN_REDIRECTED},Hn=function(e){function t(t,r,n){var i=e.call(this)||this;return wn.add(i),Object.defineProperty(i,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"navi",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(i,"_fromSuspend",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"curCmpUrl",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"uuid",{enumerable:!0,configurable:!0,writable:!0,value:""}),Gn.set(i,0),Object.defineProperty(i,"_doConnectReason",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"_network",{enumerable:!0,configurable:!0,writable:!0,value:{status:!0,type:fr.UNKONWN}}),Object.defineProperty(i,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:St.DISCONNECTED}),Object.defineProperty(i,"_crtUserId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(i,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(i,"cmpWeightCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_crtConnectionTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(i,"_failedCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(i,"ALLOW_FAILED_TIMES",{enumerable:!0,configurable:!0,writable:!0,value:2}),i}return w(t,e),Object.defineProperty(t.prototype,"getToken",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.token}}),Object.defineProperty(t.prototype,"cid",{get:function(){return"".concat(this.uuid,"_").concat(this.retryCount)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtUserId}}),Object.defineProperty(t.prototype,"setConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===St.DISCONNECTED&&e===St.CONNECTING&&(this._doConnectReason=ur.CONNECT,J(this,wn,"m",Vn).call(this)),this._crtConnectionStatus===St.CONNECTED&&e===St.SUSPENDED&&(t===Re.RC_PING_EXCEED_LIMIT?this._doConnectReason=ur.TIMEOUT:t===Re.RC_CONN_REDIRECTED?this._doConnectReason=ur.REDIRECTED:this._doConnectReason=ur.RECONNECT),this._crtConnectionStatus===St.CONNECTED){var r={bid:jr(),cod:t,net:this.getNetwork().type,dur:Date.now()-J(this,Gn,"f"),cid:this.cid};this.logger.record(Mt.IM_CONNECTION_DURATION,JSON.stringify(r)),e===St.SUSPENDED&&J(this,wn,"m",Vn).call(this)}switch(this._crtConnectionStatus=e,e){case St.CONNECTED:this.logger.info(Te,"status: ".concat(e)),this.checkAlive(),J(this,wn,"m",jn).call(this).emit("onConnected",this._fromSuspend);break;case St.CONNECTING:this.logger.warn(Te,"status: ".concat(e)),J(this,wn,"m",jn).call(this).emit("onConnecting");break;case St.SUSPENDED:this._fromSuspend=!0,this.logger.warn(Te,"status: ".concat(e,", code: ").concat(t)),Fn(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),J(this,wn,"m",jn).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(Te,"status: ".concat(e,", code: ").concat(t)),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),J(this,wn,"m",jn).call(this).emit("onDisconnected",t)}}}}),Object.defineProperty(t.prototype,"getConnectionStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._crtConnectionStatus}}),Object.defineProperty(t.prototype,"isConnected",{get:function(){return this._crtConnectionStatus===St.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!t){var r={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record(Mt.IM_NETWORK_CHANGE,JSON.stringify(r))}this._network=e}}),Object.defineProperty(t.prototype,"getNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._network}}),Object.defineProperty(t.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a;return k(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus===St.CONNECTED?[2,xr(this._crtUserId)]:this._crtConnectionTask?[2,this._crtConnectionTask]:(this._openCallPlus=r,this.token=e,this.setConnectionStatus(St.CONNECTING),[4,this.try2Connect(e,t,!1,n,!0)]);case 1:return i=s.sent(),o=i.code,a=i.data,o!==Re.SUCCESS?(this.setConnectionStatus(St.DISCONNECTED,o),[2,Wr(o)]):(this.setConnectionStatus(St.CONNECTED),[2,xr(a)])}}))}))}}),Object.defineProperty(t.prototype,"try2Connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return G(this,void 0,void 0,(function(){var o;return k(this,(function(a){switch(a.label){case 0:return this._crtConnectionTask?[2,this._crtConnectionTask]:(this._crtConnectionTask=this.createConnectionTask(e,t,r,n,i),[4,this._crtConnectionTask]);case 1:return o=a.sent(),this._crtConnectionTask=null,[2,o]}}))}))}}),Object.defineProperty(t.prototype,"createConnectionTask",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return G(this,void 0,void 0,(function(){var o,a,s,u,c,l,d,f,_,p;return k(this,(function(E){switch(E.label){case 0:return o={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0},this.logger.record(Mt.IM_STATS_CS,JSON.stringify(o)),a={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},[4,this.navi.request(e,r,!1,n,a)];case 1:return s=E.sent(),u=s.code,c=s.data,u!==Re.SUCCESS?[2,Wr(u)]:1===(l=c).type?[2,Wr(Re.PACKAGE_ENVIRONMENT_ERROR)]:(this.logger.info(Ie,JSON.stringify({token:e,reconnectKickEnable:t}),n),[4,this._connectWithToken(e.replace(/@.+$/,"@"),l,t,n)]);case 2:return d=E.sent(),f=d.code,_=d.data,i||f===Re.SUCCESS||(this.retryCount+=1),Fn(f)?(this.logger.warn(Oe,"redirect code: ".concat(f),n),this.clearCmpWeightCache(),[2,this.createConnectionTask(e,t,!0,n,i)]):[Re.RC_TCP_RESET,Re.RC_CONN_ACK_TIMEOUT,Re.RC_TCP_DISCONNECTED_NO_RMTP,Re.CONNECTION_REFUSED].includes(f)&&this.cmpWeightCache&&this.cmpWeightCache.length>1?(this.updateCmpWeight(this.curCmpUrl,!1),p=this.cmpWeightCache.every((function(e){return e.failed})),i&&p?(this.logger.warn(Oe,"cpp code:".concat(f,",reture code:").concat(Re.SERVER_UNAVAILABLE),n),[2,Wr(Re.SERVER_UNAVAILABLE)]):(this.logger.warn(Oe,"cmp ack timeout, code: ".concat(f),n),this.setConnectionStatus(St.SUSPENDED,f),this.setConnectionStatus(St.CONNECTING),[2,this.createConnectionTask(e,t,!1,n,i)])):f!==Re.SUCCESS?(this.logger.warn(Oe,"code: ".concat(f),n),[2,Wr(f)]):(this.logger.info(Oe,"userId: ".concat(_),n),x(this,Gn,Date.now(),"f"),this._crtUserId=_,[2,xr(_)])}}))}))}}),Object.defineProperty(t.prototype,"try2Reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n,i=this;return k(this,(function(o){return r=this.logger.createTraceId(),this.logger.debug(Ne,"try2Reconnect -> ignoreNaviCache: ".concat(e,", reason: ").concat(t),r),this.stopReconnectTimer(),n=function(){return G(i,void 0,void 0,(function(){var i,o,a;return k(this,(function(s){switch(s.label){case 0:return this._crtConnectionStatus!==St.SUSPENDED?[2]:(this.setConnectionStatus(St.CONNECTING,t),[4,this.try2Connect(this.token,!0,e,r,!1)]);case 1:return i=s.sent(),o=i.code,a=i.isOk,this.reconnectTimer=null,a?(this.setConnectionStatus(St.CONNECTED),[2]):[Re.SERVER_UNAVAILABLE,Re.TIMEOUT,Re.RC_SOCKET_DISCONNECTED,Re.RC_SOCKET_NOT_CREATED,Re.RC_CONN_ACK_TIMEOUT,Re.RC_TCP_RESET,Re.RC_NAVI_REQ_FAILED,Re.RC_NETWORK_DOWN,Re.RC_TCP_DISCONNECTED_NO_RMTP].includes(o)?(this._crtConnectionStatus!==St.CONNECTING||(this.setConnectionStatus(St.SUSPENDED,o),this.reconnectTimer=setTimeout(n,5e3)),[2]):(this.setConnectionStatus(St.DISCONNECTED,o),[2])}}))}))},n(),[2]}))}))}}),Object.defineProperty(t.prototype,"onDisconnectByServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return Fn(e)?(this.setConnectionStatus(St.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===Re.RC_UDP_DISCONNECTED?(this.setConnectionStatus(St.SUSPENDED,e),void setTimeout((function(){r.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(St.DISCONNECTED,e)}}),Object.defineProperty(t.prototype,"onDisconenctUnusual",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.setConnectionStatus(St.SUSPENDED,e),this.try2Reconnect(!1,e)}}),Object.defineProperty(t.prototype,"checkAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e,t,r=this;return k(this,(function(n){switch(n.label){case 0:return this._crtConnectionStatus!==St.CONNECTED?(this._failedCount=0,this.logger.debug(De,"stop ping because of no connection"),[2]):(e=this.logger.createTraceId(),this.logger.debug(Me,null,e),[4,this.sendPing(15e3)]);case 1:return(t=n.sent())===Re.SUCCESS?(this.logger.debug(Ue,t,e),this._failedCount=0,this._checkAliveTimer=setTimeout((function(){return r.checkAlive()}),15e3),[2]):this._crtConnectionStatus!==St.CONNECTED?[2]:(this._failedCount+=1,this.logger.debug(Ue,"code: ".concat(t,", count: ").concat(this._failedCount),e),this._failedCount<this.ALLOW_FAILED_TIMES?[2,this.checkAlive()]:(this._failedCount=0,this.logger.warn(De,"ping timeout, close connection to reconnect!"),[4,this.close(!0)]));case 2:return n.sent(),this.setConnectionStatus(St.SUSPENDED,Re.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,Re.RC_PING_EXCEED_LIMIT),[2]}}))}))}}),Object.defineProperty(t.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){return k(this,(function(r){switch(r.label){case 0:return this.stopReconnectTimer(),this._crtConnectionTask?[4,this._crtConnectionTask]:[3,2];case 1:r.sent(),r.label=2;case 2:return this.setConnectionStatus(St.DISCONNECTED,Re.ACTIVE_DISCONNECT),[2,this.close(!1,e,t)]}}))}))}}),Object.defineProperty(t.prototype,"stopReconnectTimer",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}}),Object.defineProperty(t.prototype,"getCmpList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return B([],H(this.cmpWeightCache),!1);var r=Lr(e,t);return this.cmpWeightCache=B([],H(r),!1),B([],H(r),!1)}}),Object.defineProperty(t.prototype,"updateCmpWeight",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(this.cmpWeightCache){var n=this.cmpWeightCache.find((function(t){return r?t.addr===e&&t.protocol===rt.QUIC:t.addr===e}));if(n)if(t){var i=Math.max.apply(Math,B([],H(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==i&&(n.weight=i+1)}else{var o=Math.min.apply(Math,B([],H(this.cmpWeightCache.map((function(e){return e.weight}))),!1));n.weight!==o&&(n.weight=o-1),n.failed=!0}}}}),Object.defineProperty(t.prototype,"clearCmpWeightCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.cmpWeightCache=void 0}}),Object.defineProperty(t.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this.token=e,this._openCallPlus=r,this.onDisconenctUnusual(n)}}),t}(Br);Gn=new WeakMap,wn=new WeakSet,jn=function(){return this},Vn=function(){this.uuid=Or(),this.retryCount=0};var Bn=function(e){return e.replace(/@.+$/,"@")},Jn=function(){function e(e,t,r,n,i,o){void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=!1),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}return Object.defineProperty(e.prototype,"getCatchKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e+(this._environment?"-".concat(this._environment):"")}}),Object.defineProperty(e.prototype,"request",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){return G(this,void 0,void 0,(function(){var o;return k(this,(function(a){switch(a.label){case 0:return this.crtRequest?[2,this.crtRequest]:(this.crtRequest=this.sendRequest(e,t,r,n,i),[4,this.crtRequest]);case 1:return o=a.sent(),this.crtRequest=null,[2,o]}}))}))}}),Object.defineProperty(e.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o;return G(this,void 0,void 0,(function(){var a,s,u,c,l,d,f,_,p,E,g,h,b,R,v,I,O;return k(this,(function(T){switch(T.label){case 0:return a=Bn(e),s=this.getNaviCache(a),!t&&s&&(u=s.timestamp,c=s.naviInfo,r||Date.now()-u<gr)?(this.logger.info(Se,JSON.stringify({fromCache:!0,naviInfo:c}),n),i&&(l=i.uuid,d=i.retryCount,f=i.reason,_={bid:jr(),ptc:ir.NAVI,cod:Re.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(o=c.type)&&void 0!==o?o:0,hos:"",cache:or.LOCAL,v:ar.CURRENT,rsn:f,cid:"".concat(l,"_").concat(d),count:d},this.logger.record(Mt.IM_NAVI,JSON.stringify(_),n)),[2,xr(c)]):(p=vn.getNaviUrlList(e,this.isUseDynamicNaviUrl),this.logger.info(me,JSON.stringify({token:e,uris:p}),n),[4,this.requestHandler(p,e,n,i)]);case 1:return E=T.sent(),g=E.code,h=E.data,g===Re.RC_NAVI_REQ_FAILED&&this.isRequestProfile?[4,this.staticConfigManager.getStaticConfig()]:[3,4];case 2:return(null==(b=T.sent())?void 0:b.navi)&&(null==b?void 0:b.navi.length)>0?(R=b.navi,[4,this.requestHandler(R,e,n,i)]):[3,4];case 3:v=T.sent(),g=v.code,h=v.data,T.label=4;case 4:return g!==Re.SUCCESS?(this.logger.warn(Ce,g,n),[2,Wr(g)]):(I=h).code&&200!==I.code?(this.logger.warn(Ce,I.code,n),[2,Wr(this.transHttpCode(I.code))]):Lr(I).length>0?(this.logger.info(Ce,JSON.stringify({naviInfo:I}),n),this.setNaviCache(a,I),[2,xr(I)]):(O={server:I.server,backupServer:I.backupServer,serverAddr:I.serverAddr,bs:I.bs},this.logger.warn(Ce,"navi server address invalid: ".concat(JSON.stringify(O)),n),[2,Wr(Re.SERVER_UNAVAILABLE)])}}))}))}}),Object.defineProperty(e.prototype,"requestHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f;return k(this,(function(_){switch(_.label){case 0:i=0,o=e.length,_.label=1;case 1:return i<o?(a=i===e.length-1,s=this.useV2Navi()?this.httpRequestV2:this.httpRequest,u=Date.now(),[4,s.call(this,e[i],this.appkey,t,r,a)]):[3,4];case 2:if(c=_.sent(),l=c.code,d=c.data,f={bid:jr(),ptc:ir.NAVI,cod:l,net:null==n?void 0:n.type,dur:Date.now()-u,spr:0,pr:(null==d?void 0:d.type)||0,hos:e[i],cache:or.REQUEST,v:ar.CURRENT,rsn:null==n?void 0:n.reason,cid:"".concat(null==n?void 0:n.uuid,"_").concat(null==n?void 0:n.retryCount),count:null==n?void 0:n.retryCount},this.logger.record(Mt.IM_NAVI,JSON.stringify(f),r),[Re.SUCCESS,Re.RC_CONN_TOKEN_INCORRECT,Re.RC_LICENSE_EXPIRED].includes(l))return[2,l===Re.SUCCESS?xr(d):Wr(l)];_.label=3;case 3:return i+=1,[3,1];case 4:return[2,Wr(Re.RC_NAVI_REQ_FAILED)]}}))}))}}),Object.defineProperty(e.prototype,"transHttpCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){switch(e){case 401:case 403:return Re.RC_CONN_TOKEN_INCORRECT;case 416:return Re.RC_LICENSE_EXPIRED;default:return Re.RC_NAVI_REQ_FAILED}}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getNaviCache(Bn(e));return t?t.naviInfo:null}}),Object.defineProperty(e.prototype,"updateVoipCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getNaviInfoFromCache(e);r&&this.setNaviCache(Bn(e),V(V({},r),{voipCallInfo:t}))}}),Object.defineProperty(e.prototype,"getNaviV2RequestOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.uri,n=e.token,i=e.platform,o=e.protocol,a=e.mac;t="".concat(r,"/v2/navi.json?cloud=").concat(0);var s="token=".concat(encodeURIComponent(n),"&v=").concat(hr,"&platfrom=").concat(i);return a&&(s+="&m=".concat(a)),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":"conn=".concat(o,";rtc=4;log=2;iptype=v4,v6")},body:s,url:t,timeout:1e4}}}),Object.defineProperty(e.prototype,"useV2Navi",{enumerable:!1,configurable:!0,writable:!0,value:function(){return!0}}),e}(),xn=new Map([["RC:TxtMsg",{isCounted:!0,isPersited:!0}],["RC:ImgMsg",{isCounted:!0,isPersited:!0}],["RC:VcMsg",{isCounted:!0,isPersited:!0}],["RC:ImgTextMsg",{isCounted:!0,isPersited:!0,searchProps:["content","title"]}],["RC:FileMsg",{isCounted:!0,isPersited:!0,searchProps:["name"]}],["RC:HQVCMsg",{isCounted:!0,isPersited:!0}],["RC:LBSMsg",{isCounted:!0,isPersited:!0}],["RC:PSImgTxtMsg",{isCounted:!0,isPersited:!0}],["RC:PSMultiImgTxtMsg",{isCounted:!0,isPersited:!0}],["RCJrmf:RpMsg",{isCounted:!0,isPersited:!0}],["RCJrmf:RpOpendMsg",{isCounted:!0,isPersited:!0}],["RC:CombineMsg",{isCounted:!0,isPersited:!0}],["RC:CombineV2Msg",{isCounted:!0,isPersited:!0}],["RC:ReferenceMsg",{isCounted:!0,isPersited:!0,searchProps:["content"]}],["RC:SightMsg",{isCounted:!0,isPersited:!0}],["RC:GIFMsg",{isCounted:!0,isPersited:!0}],["RC:RLStart",{isCounted:!0,isPersited:!0}],["RC:RLEnd",{isCounted:!0,isPersited:!0}],["RC:StreamMsg",{isCounted:!0,isPersited:!0}],["RC:InfoNtf",{isCounted:!1,isPersited:!0}],["RC:ContactNtf",{isCounted:!1,isPersited:!0}],["RC:ProfileNtf",{isCounted:!1,isPersited:!0}],["RC:CmdNtf",{isCounted:!1,isPersited:!0}],["RC:GrpNtf",{isCounted:!1,isPersited:!0}],["RC:RcNtf",{isCounted:!1,isPersited:!0}],["RC:CmdMsg",{isCounted:!1,isPersited:!1}],["RC:TypSts",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:PSCmd",{isCounted:!1,isPersited:!1}],["RC:SRSMsg",{isCounted:!1,isPersited:!1}],["RC:RcCmd",{isCounted:!1,isPersited:!0}],["RC:RRReqMsg",{isCounted:!1,isPersited:!1}],["RC:RRRspMsg",{isCounted:!1,isPersited:!1}],["RC:CsChaR",{isCounted:!1,isPersited:!1}],["RC:CSCha",{isCounted:!1,isPersited:!1}],["RC:CsEva",{isCounted:!1,isPersited:!1}],["RC:CsContact",{isCounted:!1,isPersited:!1}],["RC:CsHs",{isCounted:!1,isPersited:!1}],["RC:CsHsR",{isCounted:!1,isPersited:!1}],["RC:CsSp",{isCounted:!1,isPersited:!1}],["RC:CsEnd",{isCounted:!1,isPersited:!1}],["RC:CsUpdate",{isCounted:!1,isPersited:!1}],["RC:ReadNtf",{isCounted:!1,isPersited:!1}],["RC:chrmKVNotiMsg",{isCounted:!1,isPersited:!1}],["RC:VCAccept",{isCounted:!1,isPersited:!1}],["RC:VCRinging",{isCounted:!1,isPersited:!1}],["RC:VCSummary",{isCounted:!1,isPersited:!1}],["RC:VCHangup",{isCounted:!1,isPersited:!1}],["RC:VCInvite",{isCounted:!1,isPersited:!1}],["RC:VCModifyMedia",{isCounted:!1,isPersited:!1}],["RC:VCModifyMem",{isCounted:!1,isPersited:!1}],["RC:MsgExMsg",{isCounted:!1,isPersited:!1}],["RC:Delivered",{isCounted:!1,isPersited:!1}],["RC:RRMsg",{isCounted:!1,isPersited:!1}],["RC:LogCmdMsg",{isCounted:!1,isPersited:!1}],["RC:InterceptMsg",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:RLJoin",{isCounted:!1,isPersited:!1}],["RC:RLQuit",{isCounted:!1,isPersited:!1}],["RC:RL",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:CCConfigChangeRequestMsg",{isCounted:!1,isPersited:!1}]]);function Wn(){return Array.from(xn.keys()).map((function(e){return V({objectName:e},xn.get(e))})).filter((function(e){return!e.isCustom}))}var Yn=function(){function e(e,t,r,n){Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sourceLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"targetLanguage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"text",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.identifier=e,this.sourceLanguage=t||"auto",this.targetLanguage=r,this.text=n}return Object.defineProperty(e.prototype,"isValid",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"string"==typeof this.identifier&&this.identifier.length>0&&"string"==typeof this.sourceLanguage&&(void 0===this.targetLanguage||"string"==typeof this.targetLanguage)&&(e?"string"==typeof this.text:void 0===this.text||"string"==typeof this.text)}}),Object.defineProperty(e.prototype,"toInnerParam",{enumerable:!1,configurable:!0,writable:!0,value:function(){return{identifier:this.identifier,sourceLanguage:this.sourceLanguage,targetLanguage:this.targetLanguage,content:this.text}}}),e}();!function(e){function t(t,r,n,i){return e.call(this,t,r,n,i)||this}w(t,e)}(Yn),function(e){function t(t,r,n){return e.call(this,ln(t),r,n,t)||this}w(t,e)}(Yn);var Kn,Xn=0,Qn=0,Zn=4,qn=5;!function(e){e.P_INIT_O="P-init-O",e.P_DB_OPEN_O="P-db_open-O",e.P_DB_UPGRATE_START_S="P-db_upgrate_start-S",e.P_DB_UPGRATING_S="P-db_upgrating-S",e.P_DB_UPGRATE_COMPLETE_S="P-db_upgrate_complete-S",e.P_CALL_MAIN_SYNC_E="P-call_main_sync-E",e.P_CALL_MAIN_E="P-call_main-E",e.P_SEND_2_MAIN_E="P-send_2_main-E",e.P_CALL_ADDON_E="P-call_addon-E",e.P_CALL_ADDON_T="P-call_addon-T",e.P_CALL_ADDON_O="P-call_addon-O",e.P_CALL_ADDON_R="P-call_addon-R",e.P_CALL_EXTRA_E="P-call_extra-E",e.P_CONNECT_S="P-connect-S",e.P_CONNECT_T="P-connect-T",e.P_CONNECT_R="P-connect-R",e.P_CONNECT_E="P-connect-E",e.P_CONNECT_ENTRY_S="P-connect_entry-S",e.P_REPORT_VER_O="P-report_version-O",e.P_PARSE_JSON_MSGS_E="P-parse_json_messsages-E",e.P_PARSE_JSON_MSGS_R="P-parse_json_messsages-R",e.P_RECEIVE_MESSAGE_E="P-receive_message-E",e.P_HTTP_REQ_E="P-http_request-E",e.P_SET_MSG_EXTEN_O="P-set_msg_extension-O",e.P_SEND_MSG_T="P-send_msg-T",e.P_SEND_MSG_R="P-send_msg-R",e.P_PARSE_JSON_SUBSCRIBE_DATA_E="P-parse_json_subscribe_data-E",e.P_PARSE_JSON_USER_PROFILE_E="P-parse_json_user_profile-E",e.P_PARSE_JSON_USER_PROFILE_LIST_E="P-parse_json_user_profile_list-E",e.P_WRITE_LOG_O="P_WRITE_LOG_O",e.P_PARSE_JSON_E="P-parse_json-E",e.L_HANDLE_LOW_PRIORITY_MESSAGES_T="L-handle_low_priority_messages-T",e.L_HANDLE_LOW_PRIORITY_MESSAGES_R="L-handle_low_priority_messages-R",e.L_JS_FUNC_EXEC_O="L-js_func_execute-O",e.L_JS_FUNC_EXEC_E="L-js_func_execute-E",e.L_HADNLE_RECALL_CMD_T="L-handle_recall_cmd-T",e.L_HADNLE_RECALL_CMD_R="L-handle_recall_cmd-R"}(Kn||(Kn={}));var zn=function(e,t,r){return G(void 0,void 0,void 0,(function(){var n,i;return k(this,(function(o){return n=h("aes-256-cbc",t,r),i=n.update(e,"base64","utf-8"),[2,i+=n.final("utf8")]}))}))},$n=function(e){if(!R(e)){var r=t(e,"..");R(r)||$n(r),v(e)}},ei=function(e){return Object.entries(e).map((function(e){var t=H(e,2),r=t[0],n=t[1];return{key:r,value:String(n)}}))},ti=function(e){return{removeMute:!!(null==e?void 0:e.removeMuteStatus),removeWhiteList:!!(null==e?void 0:e.removeWhiteList),removeFavoriteMembers:!!(null==e?void 0:e.removeFollow)}},ri=function(){return"undefined"==typeof __dirname?e(T(import.meta.url)):__dirname};function ni(e){return JSON.parse(e).list.map((function(e){return e.value}))}var ii=t(ri(),"binding","electron-".concat(i(),"-").concat(o(),".node")),oi={addon:null};try{var ai=g(import.meta.url);oi.addon=ai(ii)}catch(e){console.error("error ->",ii,"\n",e)}oi.addon||console.error("error -> cannot find module: ",ii);var si,ui=oi.addon,ci=function(e,t){var r,n=Buffer.from(e),i=n.length;for(t.push(i),r=0;r<i;r++)t.push(n[r])},li=function(e){return"string"==typeof e},di=function(e){return li(e)?e.toUpperCase():""},fi=function(e,t){var r="";return 2!==e.length?r="Unexpected number of bytes received.":5!==e[0]?r="Unexpected SOCKS version number: ".concat(e[0],"."):255===e[1]?r="No acceptable authentication methods were offered.":-1===t.indexOf(e[1])&&(r="Unexpected SOCKS authentication method: ".concat(e[1],".")),r},_i=function(e){var t="";return 2!==e.length?t="Unexpected number of bytes received.":1!==e[0]?t="Unexpected authentication method code: ".concat(e[0],"."):0!==e[1]&&(t="Username and password authentication failure: ".concat(e[1],".")),t},pi=function(e){var t=di(e.method)||"GET",r=e.pathname||"/",n=e.headers||{},i=e.search||"";n.Host=e.host||"loclahost";var o="";for(var a in o="".concat(t," ").concat(r+i," HTTP/1.1\n"),n)if(Object.hasOwnProperty.call(n,a)){var s=n[a];o+="".concat(a,": ").concat(s,"\n")}return e.body&&(o+="Content-Length: ".concat(e.body.length,"\n")),o+="\n","POST"===t&&e.body&&(o+="".concat(e.body)),o},Ei=function(e){return new Promise((function(t){var r,n;e.socket.once("data",(function(n){var i,o=fi(n,r);if(!o)return 2===n[1]?(e.socket.once("data",(function(r){var n=_i(r);n?e.emit("error",new Error("SOCKS authentication failed. ".concat(n))):t()})),i=[1],ci(e.socksUsername,i),ci(e.socksPassword,i),void e.write(Buffer.from(i))):void t();e.emit("error",new Error("SOCKS authentication failed. ".concat(o)))})),r=[0],e.socksUsername&&r.push(2),(n=Buffer.alloc(2+r.length))[0]=5,n[1]=r.length,r.forEach((function(e,t){n[2+t]=e})),e.write(n)}))},gi=function(e,t,r){return new Promise((function(n){var i,o;switch(e.socket.once("data",(function(t){var r;5!==t[0]?r="Unexpected SOCKS version number: ".concat(t[0],"."):0!==t[1]?r="".concat(function(e){switch(e){case 1:return"General SOCKS server failure";case 2:return"Connection not allowed by ruleset";case 3:return"Network unreachable";case 4:return"Host unreachable";case 5:return"Connection refused";case 6:return"TTL expired";case 7:return"Command not supported";case 8:return"Address type not supported";default:return"Unknown status code ".concat(e)}}(t[1]),"."):0!==t[2]&&(r="The reserved byte must be 0x00."),r?e.emit("error",new Error("SOCKS connection failed. ".concat(r))):n()})),(i=[]).push(5),i.push(1),i.push(0),P(t)){case 0:i.push(3),ci(t,i);break;case 4:i.push(1),function(e,t){var r,n,i=e.split(".");for(r=0;r<4;r++)n=parseInt(i[r],10),t.push(n)}(t,i);break;case 6:e.emit("error",new Error("Does not support IPV6"))}i.length+=2,(o=Buffer.from(i)).writeUInt16BE(r,o.length-2),e.write(o)}))},hi=function(e){function t(t){var r=e.call(this)||this;return Object.defineProperty(r,"socket",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"socksHost",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"socksPort",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"socksUsername",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"socksPassword",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"writable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"readable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),r.socket=new L,r.options=t,r.socksHost=t.socksHost||"localhost",r.socksPort=t.socksPort||1080,r.socksUsername=t.socksUsername||"",r.socksPassword=t.socksPassword||"",r.socket.on("error",(function(e){r.emit("error",e)})),r.on("error",(function(){r.socket.destroyed||r.socket.destroy()})),r.on("end",r.end),r}return w(t,e),Object.defineProperty(t.prototype,"ref",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.ref()}}),Object.defineProperty(t.prototype,"unref",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.unref()}}),Object.defineProperty(t.prototype,"setTimeout",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.socket.setTimeout(e,t)}}),Object.defineProperty(t.prototype,"setNoDelay",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.socket.setNoDelay(e)}}),Object.defineProperty(t.prototype,"setKeepAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.socket.setKeepAlive(e,t)}}),Object.defineProperty(t.prototype,"address",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.address()}}),Object.defineProperty(t.prototype,"cork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.cork()}}),Object.defineProperty(t.prototype,"uncork",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.uncork()}}),Object.defineProperty(t.prototype,"pause",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.pause()}}),Object.defineProperty(t.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.socket.resume()}}),Object.defineProperty(t.prototype,"pipe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.socket.pipe(e)}}),Object.defineProperty(t.prototype,"end",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.socket.end(e,t);return this.writable=this.socket.writable,r}}),Object.defineProperty(t.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.socket.destroy(e)}}),Object.defineProperty(t.prototype,"setEncoding",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.socket.setEncoding(e)}}),Object.defineProperty(t.prototype,"write",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return this.socket.write(e,t,r)}}),Object.defineProperty(t.prototype,"read",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.socket.read(e)}}),Object.defineProperty(t.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if("string"==typeof e&&/^\d+$/.test(e)&&(e=parseInt(e,10)),!Number.isInteger(e)||e<1||e>65535)throw new TypeError("Invalid port: ".concat(e));if(!t||"string"!=typeof t)throw new TypeError("Invalid host: ".concat(t));return this.socket.connect({port:this.socksPort,host:this.socksHost},(function(){return G(r,void 0,void 0,(function(){var r;return k(this,(function(n){switch(n.label){case 0:return[4,Ei(this)];case 1:return n.sent(),[4,gi(this,t,e)];case 2:return n.sent(),this.onProxied(),r=pi(this.options),this.socket.write(Buffer.from(r)),[2]}}))}))})),this}}),Object.defineProperty(t.prototype,"onProxied",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.socket.on("close",(function(t){e.emit("close",t)})),this.socket.on("end",(function(){e.emit("end")})),this.socket.on("data",(function(t){e.emit("data",t)})),this.writable=!0,this.readable=!0,this.emit("connect")}}),t}(M),bi=function(e){var t,r=e.hostname,n=e.port;return!e.host||r&&n||(t=e.host.split(":")),!n&&t&&(n=parseInt(t[1],10)||0),!r&&t&&(r=H(t,1)[0]),new hi(e).connect(n,r)},Ri=function(e){function t(t){var r=e.call(this)||this;return Object.defineProperty(r,"createConnection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r.createConnection=bi,r}return w(t,e),t}(m),vi=function(e,t,r){return(t=V(V({},t),N(e))).port||(t.port=80),t.agent=new Ri(t),C(t,r)},Ii=function(e){var t,r;return t=bi(e),r=t.onProxied,t.onProxied=function(){var n;e.socket=t.socket,e.hostname?e.servername=e.hostname:e.host&&(n=H(e.host.split(":"),1),e.servername=n[0]),t.socket=U(e,(function(){t.authorized=t.socket.authorized,r.call(t)})),t.socket.on("error",(function(e){t.emit("error",e)}))},t},Oi=function(e){function t(t,r){var n=e.call(this,r)||this;return Object.defineProperty(n,"socksHost",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"socksPort",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"createConnection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n.url=t,n.socksHost=r.socksHost||"localhost",n.socksPort=r.socksPort||1080,n.createConnection=Ii,n}return w(t,e),t}(S),Ti=function(e,t,r,n){var i,o;return t.protocol="https:",!t.port&&t.host&&(i=H(t.host.split(":"),2),t.port=i[0],t.port=i[1]),t.port||(t.port=443),o=new Oi(e,t),t.agent=o,y(e,t,r)},Ni=null;function mi(e,t,r){void 0===r&&(r=!1);var n=t.url,i=t.headers,o=t.body,a=t.method,s=t.query,u=t.timeout,c=void 0===u?6e4:u;return new Promise((function(t){var u=/^https/.test(n),l={headers:V(V({},i),{"Accept-Encoding":"gzip, br"}),method:a};u&&(l.rejectUnauthorized=r);var d=null;Ni?((l=V(V({},l),Ni)).body=o,d=u?Ti:vi):(d=C,u&&(l.agent=new S(l),d=y));var f=d(function(e,t){if(e=e.replace(/\?$/,""),!t)return e;var r=Object.keys(t).map((function(e){return"".concat(e,"=").concat(t[e])})).filter((function(e){return!!e}));return r.length?[e,r.join("&")].join("?"):e}(n,s),l,(function(e){var r,n,i=e.statusCode,o="";if("gzip"===(null===(r=e.headers)||void 0===r?void 0:r["content-encoding"])){var a=A.createGunzip();e.pipe(a),a.on("data",(function(e){o+=e})),a.on("end",(function(){t({status:i,data:o})}))}else if("br"===(null===(n=e.headers)||void 0===n?void 0:n["content-encoding"])){var s=A.createBrotliDecompress();e.pipe(s),s.on("data",(function(e){o+=e})),s.on("end",(function(){t({status:i,data:o})}))}else e.setEncoding("utf8"),e.on("data",(function(e){o+=e})),e.once("end",(function(){t({status:i||0,data:o})}))}));f.once("timeout",(function(){e.warn(Kn.P_HTTP_REQ_E,JSON.stringify({msg:"timeout",url:n,method:a,query:s,timeout:c})),t({status:0})})),f.setTimeout(c),f.once("error",(function(r){e.warn(Kn.P_HTTP_REQ_E,JSON.stringify({msg:r.stack,url:n,method:a,query:s,timeout:c})),t({status:0})})),f.write(o),f.end()}))}function Ci(e,t){return e?(Ni=V(V({},Ni),e),t.info(Fe,JSON.stringify({socks5Proxy:Ni})),xr()):(Ni=null,t.info(ke),xr())}function Si(){return xr(Ni||void 0)}!function(e){e[e.ERROR=-1]="ERROR",e[e.RESPONSE=0]="RESPONSE",e[e.CALLBACK=1]="CALLBACK"}(si||(si={}));var yi,Ai=function(){function e(e,t,r,n){var i=this;Object.defineProperty(this,"p",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"emit",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"callback",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"errorHandle",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"count",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"maps",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.p.on("message",(function(e){var t=e.type,o=e.data;switch(t){case si.RESPONSE:var a=o,s=a.reqId,u=a.success,c=a.data,l=i.maps[s];if(!l)return;l({success:u,data:c}),delete i.maps[s];break;case si.CALLBACK:null==r||r(o);break;case si.ERROR:var d=o.msg;null==n||n(d)}})),this.p.on("error",(function(e){null==n||n("SubProcessProxy error ".concat(e))})),this.p.on("exit",(function(e,t){if(0!==e){for(var r in i.maps){if(Object.prototype.hasOwnProperty.call(i.maps,r))(0,i.maps[r])({success:!0,data:{code:Re.SUB_PROCESS_EXIT,msg:"sub process exit"}})}null==n||n("SubProcessProxy exit ".concat(e," ").concat(t),!0)}})),this.p.on("close",(function(e,t){console.log("SubProcessProxy close",e,t)}))}return Object.defineProperty(e.prototype,"call",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return G(this,void 0,void 0,(function(){var r=this;return k(this,(function(n){return this.p.killed||this.p.exitCode?[2,Promise.resolve({success:!1,data:{code:Re.SUB_PROCESS_EXIT,msg:"sub process exit"}})]:[2,new Promise((function(n){var i=++r.count;r.maps[i]=n;var o={reqId:i,method:e,args:t,hasResponse:!0};r.p.send(o)}))]}))}))}}),Object.defineProperty(e.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];return G(this,void 0,void 0,(function(){var n;return k(this,(function(i){return(this.p.killed||this.p.exitCode)&&(null===(t=this.errorHandle)||void 0===t||t.call(this,"sub process exit")),n={reqId:-1,method:e,args:r},this.p.send(n),[2]}))}))}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.send("destroy")}}),e}(),Pi=function(e,t,r,n,i){return G(void 0,void 0,void 0,(function(){var o,a,s,u,c,l;return k(this,(function(d){switch(d.label){case 0:return o=Qr(),a=o.resolve,s=o.promise,ui.getLog(e,t,r,n,(function(e){a(xr(e))}),(function(e){a(Wr(e))})),[4,s];case 1:return(u=d.sent()).isOk?(c=0,l=JSON.parse(u.data).filter((function(e){return c+=function(e){return e.content.length+e.tag.length+e.sessionId.length+e.type.length+2+13+6}(e),!!i||e.level>0})),[2,xr({logs:l,size:c})]):[2,u.wipe()]}}))}))},Li=function(e,t,r){return G(void 0,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f;return k(this,(function(_){switch(_.label){case 0:return n=e.startTime,i=e.endTime,o=e.level,a=e.isRealtimeReport,[4,Pi(o,n,i,s=300,a)];case 1:return(u=_.sent()).isOk?(c=u.data,l=c.logs,d=c.size,0===l.length||(t+=d)>=20971520?[2]:l.length<s?(r.push.apply(r,B([],H(l),!1)),[2]):(f=l[l.length-1].time,n===f&&(f+=1),e.startTime=f,r.push.apply(r,B([],H(l.filter((function(e){return e.time<f}))),!1)),[2,Li(e,t,r)])):[2]}}))}))},Mi=[],Ui=!1,Di=function(){return G(void 0,void 0,void 0,(function(){var e,t,r,n;return k(this,(function(i){switch(i.label){case 0:return Ui||0===Mi.length?[2]:(Ui=!0,e=Mi.shift(),t=e.resolve,r=e.args,[4,Li(r,0,n=[])]);case 1:return i.sent(),t({logs:n,dbReady:!0}),Ui=!1,Di(),[2]}}))}))},wi=function(e){function r(t,r,n,i,o){void 0===i&&(i=!1);var a,s=process.versions.electron,u="Electron|".concat(s,"|").concat(process.arch,"|").concat(process.platform);return a=e.call(this,t,u,o,n,i)||this,Object.defineProperty(a,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_subProcess",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),a}return w(r,e),Object.defineProperty(r.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.deviceId}}),Object.defineProperty(r.prototype,"send",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return mi(this.logger,e)}}),Object.defineProperty(r.prototype,"stop",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._subProcess&&this._subProcess.destroy(),e.prototype.stop.call(this)}}),Object.defineProperty(r.prototype,"compressLogs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var r,n,i,o;return k(this,(function(a){switch(a.label){case 0:return this._subProcess||(r=p(t(ri(),"sub-process.cjs.js"),{stdio:["inherit","inherit","inherit","ipc"]}),this._subProcess=new Ai(r)),[4,this._subProcess.call("compressLogs",e)];case 1:return n=a.sent(),i=n.success,o=n.data,i?[2,{success:i,data:o.data}]:[2,{success:i,data:""}]}}))}))}}),r}(mn),ji="rc-realtime-log-timestamp",Vi=!1,Gi=function(){var e=new An(Sn,yn);return e.setLogReader((function(e,t,r,n){return G(void 0,void 0,void 0,(function(){return k(this,(function(i){switch(i.label){case 0:return[4,(o={startTime:e,endTime:t,level:r,isRealtimeReport:n},G(void 0,void 0,void 0,(function(){return k(this,(function(e){return[2,new Promise((function(e){Mi.push({resolve:e,args:o}),Di()}))]}))})))];case 1:return[2,{logs:i.sent().logs}]}var o}))}))})),e.setLogWriter((function(e){Fi(e)})),e},ki=[],Fi=function(e){Vi&&(ki.push(e),yi||(yi=setImmediate((function(){return function(){if(yi&&(clearImmediate(yi),yi=null),ki.length){var e=ki.splice(0).map((function(e){var t=e.sessionId,r=e.level,n=e.time,i=e.type,o=e.tag,a=e.loggerId,s=e.content,u=e.traceId;return{level:r,time:n,type:i,tag:o,sessionId:"".concat(Tr,":").concat(Tr===t?"main":t),content:JSON.stringify({loggerId:a,content:s,traceId:u})}})),t=JSON.stringify(e);ui.writeLog(t)}}()}))))},Hi=function(e){function t(t,r,n,i){var o=e.call(this,t,r,n,i)||this;return Vi||(Vi=!0),o}return w(t,e),Object.defineProperty(t.prototype,"getTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=ui.getStoreValue(ji);return parseInt(e,10)||0}}),Object.defineProperty(t.prototype,"setTimestamp4RealtimeLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){ui.setStoreValue(ji,e.toString())}}),Object.defineProperty(t.prototype,"recvRendererLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._stdout(e),this._write(e)}}),Object.defineProperty(t.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){Vi=!1}}),t}(Nn),Bi=function(){var e,t=Date.now(),r=[o(),i(),process.pid,t,Math.floor(Math.random()*t)].join("__");return e=r,b("md5").update(e).digest("hex")},Ji=function(){function e(e){Object.defineProperty(this,"_callCppProxy",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_setTime",{enumerable:!0,configurable:!0,writable:!0,value:15962112e5})}return Object.defineProperty(e.prototype,"_setToProtocol",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=JSON.stringify(r);"{}"!==n&&e.info(Kn.P_SET_MSG_EXTEN_O,JSON.stringify({messageUId:t,ext:r})),this._callCppProxy("setMessageExtension",1,"1",t,n,"")}}),Object.defineProperty(e.prototype,"setLocalFromExtMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){t.channelId,t.conversationType,t.targetId;var r=t.content,n=t.sentTime,i=r,o=i.put,a=this._callCppProxy("getMessage",i.mid),s=JSON.parse(a).extMsg,u=JSON.parse(s||"{}");if(o)for(var c in o){var l=u[c];l&&l.ts<n-this._setTime?(l.v=o[c],l.ts=n-this._setTime):(u[c]={v:"",ts:0},u[c].v=o[c],u[c].ts=n-this._setTime)}i.del&&i.del.forEach((function(e){delete u[e]})),this._setToProtocol(e,i.mid,u)}}),Object.defineProperty(e.prototype,"parseReceiveExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e.extMsg||"{}"),r={};for(var n in t)r[n]=t[n].v;return r}}),e}(),xi=[rt.RMTP,rt.TLS];"darwin"===process.platform&&xi.push(rt.QUIC);var Wi=function(e){return"RongCloud/navis/".concat(e,"/navi-cache.json")},Yi=function(e){return"RongCloud/caches/".concat(e,"/staticConfig.json")},Ki=function(e){return"RongCloud/cloudControl/".concat(e,"/cloudControl.json")};function Xi(e){var t,r;void 0===e&&(e="IPv4");var n=a(),i=[];try{for(var o=F(Object.values(n)),s=o.next();!s.done;s=o.next()){var u=s.value;if(u&&-1!==Object.prototype.toString.call(u).indexOf("Array")){var c=u.filter((function(t){return!(t.internal||(r=t.mac,/^(0{1,2}[:-]){5}0{1,2}$/.test(r))||t.family&&t.family!==e);var r})).map((function(e){return e.mac}));i.push.apply(i,B([],H(c),!1))}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i.length?B([],H(i),!1).sort()[0]:""}var Qi,Zi,qi=function(t){function r(r,n,i,o){var a=t.call(this,r,n,o)||this;Object.defineProperty(a,"naviPath",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(a,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),a.naviPath="".concat(i,"/").concat(Wi(r));var s=e(a.naviPath);return R(s)||$n(s),a}return w(r,t),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a,s,u;return k(this,(function(c){switch(c.label){case 0:return i="token=".concat(encodeURIComponent(r),"&v=").concat(hr,"&p=PC&ev=").concat("5.42.1","&m=").concat(Xi()),o="".concat(e,"/navi.json?r=").concat(Date.now(),"&env=").concat(this._environment),this.logger.info(Se,JSON.stringify({url:o,body:i}),n),[4,mi(this.logger,{method:"POST",headers:{appId:t},body:i,url:o,timeout:1e4})];case 1:if(200!==(a=c.sent()).status)return this.logger.warn(ye,JSON.stringify({url:o,code:a.status}),n),[2,Wr(this.transHttpCode(a.status))];this.logger.info(ye,JSON.stringify({url:o,data:a.data}),n);try{return s=JSON.parse(a.data),u=/^https/.test(o)?"https":"http",s.protocol=u,s.code&&200!==s.code?[2,Wr(this.transHttpCode(s.code))]:[2,xr(s)]}catch(e){return this.logger.error(Ae,a.data,n),[2,Wr(Re.RC_NAVI_REQ_FAILED)]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"httpRequestV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a,s;return k(this,(function(u){switch(u.label){case 0:return i=this.getNaviV2RequestOption({appkey:t,token:r,uri:e,platform:"electron",protocol:xi.join(","),mac:Xi()}),this.logger.info(Se,JSON.stringify({url:i.url,body:i.body,headers:i.headers}),n),[4,mi(this.logger,i)];case 1:if(200!==(o=u.sent()).status)return this.logger.warn(ye,JSON.stringify({url:i.url,code:o.status}),n),[2,Wr(this.transHttpCode(o.status))];this.logger.info(ye,JSON.stringify({url:i.url,data:o.data}),n);try{return a=JSON.parse(o.data),s=/^https/.test(i.url)?"https":"http",a.protocol=s,[2,xr(a)]}catch(e){return this.logger.error(Ae,o.data,n),[2,Wr(Re.RC_NAVI_REQ_FAILED)]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"getNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getCatchKey(e),r=this._caches[t];if(r)return r;if(!R(this.naviPath))return null;var n=I(this.naviPath,{encoding:"utf8"});try{return this._caches=JSON.parse(n),this._caches[t]}catch(e){this.logger.error(Ae,n)}return null}}),Object.defineProperty(r.prototype,"setNaviCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Date.now(),n=this.getCatchKey(e);if(Sr(this._caches))for(var i in this._caches){(r-this._caches[i].timestamp>gr||n===i)&&delete this._caches[i]}this._caches[n]={token:e,naviInfo:t,timestamp:Date.now(),environment:this._environment},O(this.naviPath,JSON.stringify(this._caches))}}),Object.defineProperty(r.prototype,"setEnvironment",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._environment=e}}),Object.defineProperty(r.prototype,"setUseNaviV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.useNaviV2=e}}),r}(Jn);function zi(e,t,r){for(var n=[],i=3;i<arguments.length;i++)n[i-3]=arguments[i];var o,a=e.createTraceId();if(e.info(Kn.P_CALL_ADDON_T,JSON.stringify({method:r,params:n}),a),!ui[r])throw e.error(Kn.P_CALL_ADDON_E,"Method ".concat(r," not found in addon"),a),new Error("Method ".concat(r," not found in addon"));try{o=ui[r].apply(ui,B([],H(n),!1))}catch(t){throw e.error(Kn.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:r}),a),t}return e.info(Kn.P_CALL_ADDON_R,JSON.stringify({method:r,result:t?o:void 0}),a),o}var $i,eo,to,ro,no=function(){function e(e,t,r){var n=this;Qi.add(this),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_method",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_traceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._traceId=null!=r?r:this._logger.createTraceId(),this._promise=new Promise((function(e){n._resolve=e}))}return Object.defineProperty(e,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n){return new e(t,r,null!=n?n:t.createTraceId())}}),Object.defineProperty(e.prototype,"invoke",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=J(this,Qi,"m",Zi)).call.apply(e,B([this,!0],H(t),!1))}}),Object.defineProperty(e.prototype,"asyncInvoke",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=J(this,Qi,"m",Zi)).call.apply(e,B([this,!1],H(t),!1))}}),Object.defineProperty(e.prototype,"ok",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._flush(xr(e))}}),Object.defineProperty(e.prototype,"fail",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._flush(Wr(e,"",t))}}),Object.defineProperty(e.prototype,"_flush",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this._logger.summary(Kn.P_CALL_ADDON_R,e,this._traceId),setImmediate((function(){return t._resolve(e)}))}}),Object.defineProperty(e.prototype,"flush",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._flush(e)}}),Object.defineProperty(e.prototype,"result",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._promise}}),e}();Qi=new WeakSet,Zi=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=this,o=i._method,a=i._traceId,s=i._logger;s.info(Kn.P_CALL_ADDON_T,JSON.stringify({method:o,params:r}),a);try{t=ui[o].apply(ui,B([],H(r),!1))}catch(e){throw s.error(Kn.P_CALL_ADDON_E,JSON.stringify({stack:null==e?void 0:e.stack,method:o}),a),e}return e&&t!==Re.SUCCESS&&this.fail(t),this},function(e){e[e.SUCCESS=0]="SUCCESS",e[e.NOT_INIT=-1]="NOT_INIT",e[e.CANCELED=-2]="CANCELED",e[e.REPEAT=-3]="REPEAT"}(ro||(ro={}));var io=function(e){function t(t,r,n,i){var o=e.call(this,t,n,i)||this;return $i.add(o),Object.defineProperty(o,"callCppProxy",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(o,"_naviInfo",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(o,"_excludeLogTag",{enumerable:!0,configurable:!0,writable:!0,value:["P-API_RCGetValueForKey-T","P-API_RCGetValueForKey-E","P-API_RCGetValueForKey-R","P-API_RCSetValueForKey-T","P-API_RCSetValueForKey-E","P-API_RCSetValueForKey-R"]}),Object.defineProperty(o,"_connectingTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(o,"_tcpDuration",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(o,"pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:null}),o.callCppProxy("setConnectionStatusListener",J(o,$i,"m",eo).bind(o),(function(e,t,r){o.logger.info(Kn.P_DB_OPEN_O,JSON.stringify({code:e,recreate:t,recreateReason:r})),o.emit("onDBOpen",e,t,r)}),(function(){return o.recvPong(Re.SUCCESS)}),J(o,$i,"m",to).bind(o),o._onTcpConnectResponse.bind(o),(function(){o.logger.info(Kn.P_DB_UPGRATE_START_S),o.emit("onDBUpgrateStart")}),(function(e){o.logger.info(Kn.P_DB_UPGRATING_S,e),o.emit("onDBUpgrading",e)}),(function(e){o.logger.info(Kn.P_DB_UPGRATE_COMPLETE_S,e),o.emit("onDBUpgradeComplete",e)})),o}return w(t,e),Object.defineProperty(t.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._connectedTime}}),Object.defineProperty(t.prototype,"_connectWithToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p,E,g,h,b=this;return k(this,(function(R){switch(R.label){case 0:return i=this._connectingTask=no.create(this.logger,"connectWithToken",n),this._naviInfo=t,o={},(a=Si().data)&&(o={proxy_passwd:a.socksPassword||"",proxy_name:a.socksUsername||"",proxy_port:a.socksPort||1082,proxy_host:a.socksHost||"localhost",proxy_type:0}),s=JSON.stringify(V(V({},o),{call_plus:this._openCallPlus,cid:this.cid})),u=this.getCmpList(t,!0).filter((function(e){return xi.includes(e.protocol)})).sort((function(e,t){return t.weight-e.weight})),c=[],u.forEach((function(e){var t=c.find((function(t){return t.addr===e.addr}));t?t.protocol!==rt.QUIC&&e.protocol!==rt.QUIC||(t.race=!0,t.protocol=rt.QUIC):(e.race=!1,c.push(e))})),this.logger.info(Kn.P_CONNECT_T,JSON.stringify({}),n),l=Date.now(),[4,i.asyncInvoke(e,hr,JSON.stringify(V(V({},t),{serverAddr:c,tagBlacklist:this._excludeLogTag.join(",")})),r,s).result()];case 1:return d=R.sent(),this.logger.summary(Kn.P_CONNECT_R,d,n,{data:d.data}),f=JSON.parse(d.data),_=f.cid,p=f.userId,E=f.sessionId,g=Date.now()-(l+this._tcpDuration),h={bid:jr(),cod:d.code,net:this.getNetwork().type,dur:g,spr:0,cid:_,v:ar.CURRENT,count:this.retryCount,sts:Date.now(),ssid:E},this.logger.record(Mt.IM_CMP_RMTP,JSON.stringify(h)),this._connectingTask=null,[2,d.trans((function(e){return b._connectedTime=Date.now()-b.callCppProxy("getDeltaTime"),p}))]}}))}))}}),Object.defineProperty(t.prototype,"close",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n;return k(this,(function(i){switch(i.label){case 0:return e?[3,2]:[4,(n=no.create(this.logger,"disconnect")).asyncInvoke("boolean"!=typeof t||t,!!r,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()];case 1:i.sent(),i.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(t.prototype,"sendPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return new Promise((function(r){t.pingResolve=r,t.callCppProxy("sendHeartbeat"),setTimeout((function(){return t.recvPong(Re.TIMEOUT)}),e)}))}}),Object.defineProperty(t.prototype,"recvPong",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.pingResolve&&(this.pingResolve(e),this.pingResolve=null)}}),Object.defineProperty(t.prototype,"recvConnectRes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){t?this.onDisconnectByServer(e,r):e===Re.RC_SOCKET_DISCONNECTED&&this.getConnectionStatus()!==St.CONNECTED||this.onDisconenctUnusual(e)}}),Object.defineProperty(t.prototype,"_onTcpConnectResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o,a){var s,u=this.cmpWeightCache.findIndex((function(e){return e.addr==="".concat(t,":").concat(r)})),c={bid:jr(),ptc:ir.TCP,cod:e,net:this.getNetwork().type,dur:n,spr:0,pr:(null===(s=this._naviInfo)||void 0===s?void 0:s.type)||0,hos:"".concat(t,":").concat(r),idx:u,rct:this.retryCount?sr.RECONNECT:sr.CONNECT,cid:this.cid,v:ar.CURRENT,rsn:this._doConnectReason,ddu:i,count:this.retryCount,weight:u>=0?this.cmpWeightCache[u].weight:-1};if(this.logger.record(Mt.IM_CMP,JSON.stringify(c)),this.logger.info(Kn.P_CONNECT_ENTRY_S,JSON.stringify({code:e,host:t,port:r,duration:n,dnsDuration:i,index:o,isQuic:a})),e===ro.SUCCESS)this.curCmpUrl="".concat(t,":").concat(r),this.updateCmpWeight("".concat(t,":").concat(r),!0,a);else if(e!==ro.NOT_INIT){var l=r&&0!==r?"".concat(t,":").concat(r):"".concat(t);this.updateCmpWeight(l,!1)}}}),t}(Hn);$i=new WeakSet,eo=function(e,t){10!==e&&(this._connectingTask?e===Re.SUCCESS?this._connectingTask.ok(t):this._connectingTask.fail(e,t):this.logger.warn(Kn.P_CONNECT_E,JSON.stringify({msg:"connect complete but no connecting task"})))},to=function(e,t){switch(this.logger.info(Kn.P_CONNECT_S,JSON.stringify({status:e,delay:t})),e){case Re.RC_CONN_REDIRECTED:this.recvConnectRes(e,!0);break;case 11:case 10:case 12:break;case Re.CONNECTION_REFUSED:case Re.RC_SOCKET_DISCONNECTED:case Re.RC_SOCKET_NOT_CREATED:case Re.RC_CONN_ACK_TIMEOUT:case Re.RC_TCP_RESET:this.recvConnectRes(e,!1);break;case Re.RC_UDP_DISCONNECTED:this.recvConnectRes(e,!0,t);break;default:this.recvConnectRes(e,!0)}};var oo,ao,so,uo,co,lo,fo,_o,po,Eo,go,ho,bo,Ro,vo,Io,Oo,To,No,mo,Co,So,yo,Ao,Po,Lo,Mo,Uo,Do,wo,jo,Vo,Go,ko,Fo,Ho,Bo,Jo,xo,Wo,Yo,Ko=function(t){function r(r,n,i){var o=t.call(this,r,n)||this;Object.defineProperty(o,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(o,"logger",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(o,"dbpath",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(o,"_cachePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),o._cachePath="".concat(i,"/").concat(Yi(r));var a=e(o._cachePath);return R(a)||$n(a),o}return w(r,t),Object.defineProperty(r.prototype,"getCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this._cachePath)&&I(this._cachePath,{encoding:"utf8"})||null}}),Object.defineProperty(r.prototype,"setCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){O(this._cachePath,e)}}),Object.defineProperty(r.prototype,"clearCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){O(this._cachePath,"")}}),Object.defineProperty(r.prototype,"sendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n;return k(this,(function(i){switch(i.label){case 0:return[4,mi(this.logger,{url:e,body:""})];case 1:return t=i.sent(),r=t.status,n=t.data,[2,{code:r,data:n}]}}))}))}}),Object.defineProperty(r.prototype,"decryptData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r;return k(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,zn(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91")];case 1:return t=n.sent(),[2,JSON.parse(t)];case 2:return r=n.sent(),this.logger.error(We,JSON.stringify({error:null==r?void 0:r.stack})),[3,3];case 3:return[2]}}))}))}}),r}(In),Xo=function(t){function r(r,n,i,o,a){var s=t.call(this,n,r,i)||this;Object.defineProperty(s,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:o}),Object.defineProperty(s,"model",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(s,"catchFilePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),s.model="Electron|".concat(process.platform,"|").concat(process.arch),s.catchFilePath="".concat(a,"/").concat(Ki(r));var u=e(s.catchFilePath);return R(u)||$n(u),s.init(),s}return w(r,t),Object.defineProperty(r.prototype,"httpRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f;return k(this,(function(_){switch(_.label){case 0:return(i=n).deviceId=this.deviceId,i.model=this.model,o={url:e,method:t,headers:r,body:JSON.stringify(i)},a=this.logger.createTraceId(),this.logger.info(Se,JSON.stringify(o),a),[4,mi(this.logger,o)];case 1:s=_.sent(),u=s.status,c=s.data,l=void 0===c?"":c,this.logger.info(ye,JSON.stringify({status:u,data:l}),a);try{return d=JSON.parse(l),f=d.data,[2,{code:u,data:f}]}catch(e){return this.logger.warn(Qe,JSON.stringify({status:u,data:l,error:e})),[2,{code:u,msg:e}]}return[2]}}))}))}}),Object.defineProperty(r.prototype,"setCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){O(this.catchFilePath,JSON.stringify(e))}}),Object.defineProperty(r.prototype,"getLocalCloudControllerCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return R(this.catchFilePath)?I(this.catchFilePath,{encoding:"utf8"}):null}}),Object.defineProperty(r.prototype,"setMRTRConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={mrtrChatroom:e.chatroom,mrtrGroup:e.group,mrtrPrivate:e.private,mrtrUltraGroup:e.ultraGroup};this.logger.info(qe,JSON.stringify(t)),ui.setCloudConfig(JSON.stringify(t))}}),r}(kn),Qo=[Gt,tr,kt,Yt,Xt,xt,Wt,Jt,Kt,Qt,Zt],Zo=function(){return{logCmdQueue:[],cloudControllerVers:[],srsmsgs:[],readNtfs:[],expansionMsgQueue:new Map,v1ReceiptMsgs:[],privateRSMsgs:[],groupRSMsgs:new Map,rrmsgs:new Map,messageUIds:new Set}},qo=function(){function e(){Object.defineProperty(this,"_report",{enumerable:!0,configurable:!0,writable:!0,value:Zo()}),Object.defineProperty(this,"_count",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"isLowPriorityMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Qo.includes(e)}}),Object.defineProperty(e.prototype,"isEmpty",{enumerable:!1,configurable:!0,writable:!0,value:function(){return 0===this._count}}),Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"push",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;this._count++;var n=e.messageType,i=e.senderUserId,o=e.content;if(n!==Gt)if(n!==tr)if(n!==Yt)if(n!==kt)if(n!==Jt){if(n===xt){var a=o.messageUId;if(!a)return;return this._report.messageUIds.add(a),void this._report.v1ReceiptMsgs.push(e)}if(n===Wt){var s=o.receiptMessageDic;if(i!==t){var u=s[t];if(!u||0===u.length)return;return u.forEach((function(e){return r._report.messageUIds.add(e)})),void this._report.v1ReceiptMsgs.push(e)}return Object.values(s).forEach((function(e){e.forEach((function(e){return r._report.messageUIds.add(e)}))})),void this._report.v1ReceiptMsgs.push(e)}n!==Kt?n===Xt&&this._handleRSMsg(e):this._handleRRMsg(e)}else this._handleReadNtf(e);else this._handleExpansionNotify(e);else this._handleSRSMsg(e,t);else i===br&&this._report.cloudControllerVers.push(e.sentTime);else if(i===br){var c=o.startTime,l=o.endTime,d=o.platform,f=o.logId,_=o.uri;this._report.logCmdQueue.push({startTime:parseInt(c,10),endTime:parseInt(l,10),platform:d,logId:f,uri:_,messageUId:e.messageUId})}}}),Object.defineProperty(e.prototype,"_handleRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.senderUserId;var t=e.content,r=e.conversationType,n=e.targetId,i=e.channelId;if(r!==ve.PRIVATE){var o=t,a=o.msgId,s=o.rrn,u=o.tmn,c=this._report.groupRSMsgs.get(a);c?(c.totalCount=u,c.readedCount=s):this._report.groupRSMsgs.set(a,{totalCount:u,readedCount:s}),this._report.messageUIds.add(a)}else{var l=this._report.privateRSMsgs.find((function(e){return e.conversationType===r&&e.targetId===n&&e.channelId===i}));l?l.timestamp=Math.max(l.timestamp,t.endMsgTime):this._report.privateRSMsgs.push({conversationType:r,targetId:n,channelId:i,timestamp:t.endMsgTime})}}}),Object.defineProperty(e.prototype,"_handleRRMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content.msgId;this._report.rrmsgs.set(t,e),this._report.messageUIds.add(t)}}),Object.defineProperty(e.prototype,"_handleExpansionNotify",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.content,r=t.put,n=t.mid,i=t.del,o=t.clear;this._report.messageUIds.add(n),this._report.expansionMsgQueue.has(n)&&!o?this._report.expansionMsgQueue.get(n).push({put:r,del:i,clear:o}):this._report.expansionMsgQueue.set(n,[{put:r,del:i,clear:o}])}}),Object.defineProperty(e.prototype,"_handleSRSMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.targetId,i=e.channelId;e.senderUserId===t&&(this._report.srsmsgs=this._report.srsmsgs.filter((function(e){return e.conversationType!==r||e.targetId!==n||e.channelId!==i})),this._report.srsmsgs.push(e))}}),Object.defineProperty(e.prototype,"_handleReadNtf",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;t===ve.PRIVATE&&(this._report.readNtfs=this._report.readNtfs.filter((function(i){return i.conversationType!==t||i.targetId!==r||i.channelId!==n||i.senderUserId!==e.senderUserId})),this._report.readNtfs.push(e))}}),Object.defineProperty(e.prototype,"build",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._report;return this._report=Zo(),this._count=0,e}}),e}(),zo=function(){function e(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}return Object.defineProperty(e.prototype,"gen",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];r.logger.info(Kn.L_JS_FUNC_EXEC_O,e);try{t.apply(void 0,B([],H(n),!1))}catch(t){r.logger.error(Kn.L_JS_FUNC_EXEC_E,"name: ".concat(e,"\n").concat(t.stack)),console.warn.apply(console,B(["L-js_callback_exception-E: args -> "],H(n),!1))}}}}),e}();function $o(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}}!function(e){e[e.cuid=1]="cuid",e[e.uid=2]="uid",e[e.all=4]="all"}(Yo||(Yo={}));var ea,ta,ra=function(){function e(e,t){var r=this;oo.add(this),Object.defineProperty(this,"_dispatchEvent",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_msgExpansionHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tcpMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"cloudControllerLock",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"cloudControllerMsgs",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isConnected",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_offlineFinishedPending",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullOfflineMessageFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_lowPriorityMessageHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_catcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_needDispatchMessageModifiedSyncCompleted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_opts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_buildSubscribeEventData",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=[];try{JSON.parse(e).list.forEach((function(e){var n=JSON.parse(e.obj),i=n.userId,o=n.subscribeType,a=n.subscribeTime,s=n.duration,u=n.operationType,c=n.details,l=void 0===c?[]:c,d=n.userProfile,f={userId:i,subscribeType:o,subscribeTime:a,expiry:s,operationType:u};[Nt.ONLINE_STATUS,Nt.FRIEND_ONLINE_STATUS].includes(o)&&(f.details=l.map((function(e){var t=JSON.parse(e);return{changeTime:t.changeTime,eventValue:t.changeValue,platform:t.platform}}))),[Nt.USER_PROFILE,Nt.FRIEND_USER_PROFILE].includes(o)&&(f.userProfile=r._string2userProfileInfo(d)),t.push(f)}))}catch(t){r.logger.error(Kn.P_PARSE_JSON_SUBSCRIBE_DATA_E,JSON.stringify({error:null==t?void 0:t.stack,data:e}))}return t}}),Object.defineProperty(this,"_chatroomCache",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"rtcHeartbeatResolves",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._opts=e;var n=e.dbpath,i=e.appkey,o=e.logOutputLevel,a=e.disableLogReport,s=e.eventLoopBlockingCheck,u=e.enableSyncEmptyTopConversation,c=this._deviceId=Bi(),l=Gi();this.logger=new Hi(i,"RC-M","IM",l),this._catcher=new zo(this.logger),ui.initWithAppkey(i,n,hr,this.logger.getSessionId()),ui.setConsoleLogLevel(o+1),this.logger.setOutputLevel(o),this.reporter=new wi(i,c,this.logger,a,l),this.logger.info(Kn.P_INIT_O,JSON.stringify({appkey:i,dbpath:n,proto_commit:ui.getNodeVersion(),deviceId:c,commit:"7f954602d659cfb16f91987f74aee812abaa6188",processName:process.title,processPId:process.pid,disableLogReport:a,eventLoopBlockingCheck:s})),s&&Pn.start(this.logger),zi(this.logger,!1,"setDeviceId",c),this._staticConfigManager=new Ko(i,this.logger,n),this._lowPriorityMessageHandler=new qo,this.navi=new qi(i,this.logger,n,this._staticConfigManager),this.tcpMgr=new io(i,this._callCppProxy.bind(this),this.navi,this.logger),this.tcpMgr.on("onConnected",this.onConnected,this),this.tcpMgr.on("onSuspend",this.onSuspend,this),this.tcpMgr.on("onDisconnected",this.onDisconnected,this),this.tcpMgr.on("onConnecting",this.onConnecting,this),this.tcpMgr.on("onDBOpen",this.dbOpened,this),this.tcpMgr.on("onDBUpgrateStart",this.dbUpgradeStart,this),this.tcpMgr.on("onDBUpgrading",this.dbUpgrading,this),this.tcpMgr.on("onDBUpgradeComplete",this.dbUpgradeComplete,this),this._enableCreateEmptyTopConversation(u),this._initCloudController(i,c,n),this._registerBuildinMessageTypes(),ui.setOnReceiveMessageListener(this._catcher.gen("setOnReceiveMessageListener[0]",J(this,oo,"m",Ro).bind(this)),this._catcher.gen("setOnReceiveMessageListener[1]",J(this,oo,"m",vo).bind(this)),this._catcher.gen("setOnReceiveMessageListener[2]",this._handleMessageModified.bind(this))),ui.setRTConversationListener(this._catcher.gen("setRTConversationListener",(function(e){return r._dispatchEvent("sgRelationsSynced",e)}))),this._setConversationStatusListener(),this._setPushNotificationListener(),this._setRTCHeartbeatListener(),this._setRTCLivingRoomEventListener(),this._setChatroomEventListener(),this._setCallInfoListener(),this._setSubscribeEventListener(),this._setUserProfileListener(),this._setEntrustGroupListener(),this._setFriendEventListener(),ui.setReadReceiptListener(this._catcher.gen("setReadReceiptListener",(function(e,t){var n=JSON.parse(t).map((function(e){return{identifier:{conversationType:e.conIdentifier.type,targetId:e.conIdentifier.targetId,channelId:e.conIdentifier.channelId},messageUId:e.msgUid,readCount:e.readCount,unreadCount:e.unreadCount,totalCount:e.totalCount,users:e.readUsers.map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:e.mentioned}}))}}));r._dispatchEvent("readReceiptResponseV5",n)}))),ui.setTranslateEventListener(this._catcher.gen("setTranslateEventListener",(function(e){var t=JSON.parse(e).map((function(e){return{translateInfo:{targetLanguage:e.translateResult.targetLanguage,translatedText:e.translateResult.translatedText,status:e.translateResult.translateStatus},code:e.code,identifier:e.messageRecognitionIdentifier.messageUid,from:e.messageRecognitionIdentifier.inputSource}}));r._dispatchEvent("translateResponse",t)}))),this._msgExpansionHandler=new Ji(this._callCppProxy.bind(this)),ui.setUltraGroupListener(this._catcher.gen("setUltraGroupListener[0]",(function(e){return r._dispatchEvent("ultraGroupEnable")})),this._catcher.gen("setUltraGroupListener[1]",(function(e,t,n){return J(r,oo,"m",uo).call(r,e,t,n)})),this._catcher.gen("setUltraGroupListener[2]",(function(e){return J(r,oo,"m",co).call(r,e)})),this._catcher.gen("setUltraGroupListener[3]",(function(e){return J(r,oo,"m",lo).call(r,e)})),this._catcher.gen("setUltraGroupListener[4]",(function(e){return J(r,oo,"m",fo).call(r,e)})),this._catcher.gen("setUltraGroupListener[5]",(function(e){return J(r,oo,"m",_o).call(r,e)})),this._catcher.gen("setUltraGroupListener[6]",(function(e){return J(r,oo,"m",po).call(r,e)})),this._catcher.gen("setUltraGroupListener[7]",(function(e){return J(r,oo,"m",ao).call(r,e)})),this._catcher.gen("setUltraGroupListener[8]",(function(e){return J(r,oo,"m",so).call(r,e)}))),ui.setRobotEventListener(this._catcher.gen("setRobotEventListener",(function(e,t){r._dispatchEvent("robotsSynced",e,J(r,oo,"m",Wo).call(r,t))}))),ui.setMessageReactionListener(this._catcher.gen("setMessageReactionListener",(function(e){var t=JSON.parse(e).map((function(e){var t,r=e.conversationIdentifier,n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}(e,["conversationIdentifier"]);return V({conversationIdentifier:(t=r,{conversationType:t.type,targetId:t.targetId,channelId:t.channelId})},n)}));r._dispatchEvent("messageReaction",{reactions:t})})))}return Object.defineProperty(e.prototype,"_setDeviceInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=s()[0].model,t=u();try{"darwin"===process.platform?t=E("sw_vers -ProductVersion",{encoding:"utf-8"}):"win32"===process.platform&&(t=E("ver",{encoding:"utf-8"}))}catch(e){this.logger.error(et,JSON.stringify({error:e}))}ui.setDeviceInfo("",e,"PC",t,"","")}}),Object.defineProperty(e.prototype,"_initCloudController",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n;n=H(vn.getCloudControllerUrl(),1),this.cloudControllerUri=n[0],this.cloudController=new Xo(e,this.logger,this.reporter,t,r),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Ln)}}),Object.defineProperty(e.prototype,"callProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return G(this,void 0,void 0,(function(){var r,n,i;return k(this,(function(o){switch(o.label){case 0:if(!(r=this[e]))return this.logger.warn(Kn.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"})),[2,Wr(Re.NOT_SUPPORT)];n="",o.label=1;case 1:return o.trys.push([1,3,,4]),[4,r.call.apply(r,B([this],H(t),!1))];case 2:return[2,o.sent()];case 3:return i=o.sent(),n=JSON.stringify({error:null==i?void 0:i.stack,method:e}),this.logger.error(Kn.P_CALL_MAIN_E,n),[3,4];case 4:return[2,Wr(Re.MAIN_PROCESS_ERROR,n)]}}))}))}}),Object.defineProperty(e.prototype,"sendProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){if(!(r=this[e]))return this.logger.warn(Kn.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"})),[2];try{r.call.apply(r,B([this],H(t),!1))}catch(t){this.logger.error(Kn.P_CALL_MAIN_E,JSON.stringify({error:null==t?void 0:t.stack,method:e}))}return[2]}))}))}}),Object.defineProperty(e.prototype,"setRenderInitOption",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.navigators,r=e.areaCode,n=e.logServerUrl,i=e.environment,o=e.useNaviV2,a=e.enableReadReceiptStorage;this._environment=i||"default",this.navi.setEnvironment(this._environment),this._enableReadReceiptStorage=a,this.navi.setUseNaviV2(o),vn.init({areaCode:r,navigators:t,logServerUrl:n})}}),Object.defineProperty(e.prototype,"onConnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._isConnected=!0;var r=this.getNaviInfoFromCache();this.reporter.checkStart(r,""),this._try2RejoinChatroom();var n=this.getMainProcessCache();this._dispatchEvent("onConnected",t,n),this._offlineFinishedPending&&(this._offlineFinishedPending=!1,this.logger.info(tt),this._dispatchEvent("pullFinished")),this._needDispatchMessageModifiedSyncCompleted&&(this._needDispatchMessageModifiedSyncCompleted=!1,this._dispatchEvent("messageModifiedSyncCompleted"))}}),Object.defineProperty(e.prototype,"onConnecting",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._isConnected=!1,this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._needDispatchMessageModifiedSyncCompleted=!0,this._dispatchEvent("onConnecting")}}),Object.defineProperty(e.prototype,"onSuspend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._dispatchEvent("onSuspend",t)}}),Object.defineProperty(e.prototype,"onDisconnected",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._isConnected=!1,this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._dispatchEvent("onDisconnected",t)}}),Object.defineProperty(e.prototype,"dbOpened",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){this._dispatchEvent("databaseOpened",t,r)}}),Object.defineProperty(e.prototype,"dbUpgradeStart",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._dispatchEvent("databaseUpgradeWillStart")}}),Object.defineProperty(e.prototype,"dbUpgrading",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._dispatchEvent("databaseUpgrading",t)}}),Object.defineProperty(e.prototype,"dbUpgradeComplete",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._dispatchEvent("databaseUpgradeDidComplete",t)}}),Object.defineProperty(e.prototype,"_callCppProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this.logger.createTraceId();try{return this.logger.debug(Kn.P_CALL_ADDON_O,JSON.stringify({method:e,content:t}),n),ui[e].apply(ui,B([],H(t),!1))}catch(t){throw this.logger.error(Kn.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:e}),n),t}}}),Object.defineProperty(e.prototype,"refetchNaviInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.navi.request(this.tcpMgr.getToken(),!0,!0,this.logger.createTraceId())}}),Object.defineProperty(e.prototype,"sendHTTPRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return mi(this.logger,e)}}),Object.defineProperty(e.prototype,"onReceiveRendererLog",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.logger.recvRendererLog(e)}}),Object.defineProperty(e.prototype,"setNetwork",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.tcpMgr.setNetwork(e,t),e.status&&this.cloudController){var r=this.tcpMgr.getToken();this.cloudController.request(this.cloudControllerUri,Mn,r)}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){Pn.stop(),this.reporter.stop(),this.logger.destroy(),ui.destroy()}}),Object.defineProperty(e.prototype,"getHistoryMessagesByObjectNames",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c,l,d,f=this;return k(this,(function(_){return r=e.conversationType,n=e.targetId,i=e.channelId,o=t.timestamp,a=t.count,s=t.order,u=t.messageTypes,c=a+1,l=zi(this.logger,!1,"getHistoryMessagesByObjectNames",r,n,o,c,u,0===s,i||""),d=JSON.parse(l).list.reverse().map((function(e){var t=e.obj;return f._buildMessage(t)})),[2,xr({list:c===d.length?d.slice(1,c):d,hasMore:a<d.length})]}))}))}}),Object.defineProperty(e.prototype,"_updateMessageReceiptStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return zi(this.logger,!0,"updateMessageReceiptStatus",e,t,r,n||"")}}),Object.defineProperty(e.prototype,"updateMessageReceiptStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i;return k(this,(function(o){return i=this._updateMessageReceiptStatus(e,t,r,n),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"getNaviInfoFromCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getConnectionStatus()!==St.CONNECTED?null:this.navi.getNaviInfoFromCache(this.tcpMgr.getToken())}}),Object.defineProperty(e.prototype,"getConnectedTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getConnectedTime()}}),Object.defineProperty(e.prototype,"_getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Date.now()-ui.getDeltaTime()}}),Object.defineProperty(e.prototype,"_getCurrentUserId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.tcpMgr.getCurrentUserId()}}),Object.defineProperty(e.prototype,"getMainProcessCache",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.tcpMgr.getConnectedTime(),t=this.tcpMgr.getConnectionStatus(),r=this.getNaviInfoFromCache(),n=this.tcpMgr.getCurrentUserId();return{connectedTime:e,deviceId:this._deviceId,crtUserId:n,naviInfo:r,connectionStatus:t,deltaTime:ui.getDeltaTime(),commitId:"7f954602d659cfb16f91987f74aee812abaa6188"}}}),Object.defineProperty(e.prototype,"_enableCreateEmptyTopConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){zi(this.logger,!1,"enableCreateEmptyTopConversation",e)}}),Object.defineProperty(e.prototype,"_registerBuildinMessageTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;Wn().forEach((function(t){e.registerMessageType(t.objectName,t)}))}}),Object.defineProperty(e.prototype,"_parseMessageJsonContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;try{r=e?JSON.parse(e):{}}catch(n){r=e,this.logger.error(Kn.P_PARSE_JSON_MSGS_E,JSON.stringify({content:e,messageId:t}))}return r}}),Object.defineProperty(e.prototype,"_buildSupportExt",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=null;return e&&(r=this._msgExpansionHandler.parseReceiveExpansion(t)),r}}),Object.defineProperty(e.prototype,"_handleReadReceiptRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e),r=this.getNaviInfoFromCache();if(!(null==r?void 0:r.grpRRVer))return t;var n=t,i=n.hasRespond,o=n.readerInfo,a=void 0===o?{}:o,s=n.readCount,u=n.totalCount,c=n.readerList,l=void 0===c?[]:c,d={readCount:s,totalCount:u};if(1===(null==r?void 0:r.grpRRVer)){var f=[];for(var _ in a)f.push({userId:_,readTime:a[_]});d.readerList=f,d.hasRespond=i}return 3===(null==r?void 0:r.grpRRVer)&&(d.readerList=l),d}}),Object.defineProperty(e.prototype,"_buildMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=JSON.parse(e);return J(this,oo,"m",Eo).call(this,r,t)}}),Object.defineProperty(e.prototype,"_updateReadReceiptInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=J(this,oo,"m",jo).call(this,e);if(r.isOk){var n=r.data,i=n.readReceiptRequest?JSON.parse(n.readReceiptRequest):{},o=V(V({},i),t);zi(this.logger,!1,"updateReadReceiptRequestInfo",e,JSON.stringify(o))}}}),Object.defineProperty(e.prototype,"_buildConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e);return J(this,oo,"m",go).call(this,t)}}),Object.defineProperty(e.prototype,"_convertResultList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=JSON.parse(e).list;return r=r.map((function(e){var r=JSON.parse(e.obj);return t?t(r):r}))}}),Object.defineProperty(e.prototype,"_getMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(0===e.length)return[];var r=zi(this.logger,!1,"getMessageByUids",e);return JSON.parse(r).list.map((function(e){return J(t,oo,"m",Eo).call(t,JSON.parse(e.obj))}))}}),Object.defineProperty(e.prototype,"_handleLowPriorityMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,n=this;if(!this._lowPriorityMessageHandler.isEmpty()){var i=Date.now(),o=this._lowPriorityMessageHandler.count,a=this.logger.createTraceId();this.logger.info(Kn.L_HANDLE_LOW_PRIORITY_MESSAGES_T,JSON.stringify({startTime:i,count:o}),a);var s=this._lowPriorityMessageHandler.build(),u=s.srsmsgs,c=s.readNtfs,l=s.expansionMsgQueue,d=s.v1ReceiptMsgs,f=s.privateRSMsgs,_=s.groupRSMsgs,p=s.rrmsgs,E=s.logCmdQueue,g=s.cloudControllerVers,h=s.messageUIds,b=new Map;this._getMessagesByUIds(B([],H(h.values()),!1)).forEach((function(e){b.set(e.messageUId,e)})),this._handleExpansionMsgQueue(l,b),this._sendMessageNotification(c,!1),this._handlerReadReceiptMsgV1(d,b,e),this._handleSRSMsgs(u,t),this._handlerPrivateRSMsgs(f),this._handlerGroupRSMsgs(_,b),this._handlerRRMsgs(p,b),g.length>0&&((r=this.cloudControllerMsgs).push.apply(r,B([],H(g),!1)),this._ccMsgHandler()),E.forEach((function(e){var t=e.startTime,r=e.endTime,i=e.platform,o=e.logId,a=e.uri,s=e.messageUId;n.reporter.report(t,r,i,a,o,s)})),this.logger.info(Kn.L_HANDLE_LOW_PRIORITY_MESSAGES_R,JSON.stringify({startTime:i,cost:Date.now()-i}),a)}}}),Object.defineProperty(e.prototype,"_updateReadReceiptRequestInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(0!==e.length){var t=e.map((function(e){return JSON.stringify({message_uid:e.messageUId,request_info:JSON.stringify(e.readReceiptInfo)})}));zi(this.logger,!1,"updateReadReceiptRequestInfoList",t)}}}),Object.defineProperty(e.prototype,"_handlerRRMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=[],n=[];Array.from(e.entries()).forEach((function(e){var i=H(e,2),o=i[0],a=i[1],s=t.get(o);if(s){var u=a.content,c=u.rrn,l=u.tmn,d=s.readReceiptInfo||{};d=V(V({},d),{readCount:c,totalCount:l}),s.readReceiptInfo=d,r.push({messageUId:o,readReceiptInfo:d}),n.push(a)}})),this._updateReadReceiptRequestInfoList(r),this._sendMessageNotification(n,!1)}}),Object.defineProperty(e.prototype,"_handlerGroupRSMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=[],i=[];Array.from(e.entries()).forEach((function(e){var r=H(e,2),o=r[0],a=r[1],s=a.totalCount,u=a.readedCount,c=t.get(o);if(c){var l=c.conversationType,d=c.targetId,f=c.channelId,_=c.readReceiptInfo||{};_=V(V({},_),{readCount:u,totalCount:s}),c.readReceiptInfo=_,n.push({messageUId:o,readReceiptInfo:_}),i.push({conversationType:l,targetId:d,channelId:f,readedCount:u,totalCount:s,messageUId:o})}})),this._updateReadReceiptRequestInfoList(n),i.forEach((function(e){return r._sendMessageReadReceipt({groupReadReceipt:e})}))}}),Object.defineProperty(e.prototype,"_handlerPrivateRSMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;e.forEach((function(e){var r=e.conversationType,n=e.targetId,i=e.channelId,o=e.timestamp;t._updateMessageReceiptStatus(r,n,o,i||""),t._sendMessageReadReceipt({privateReadReceipt:{conversationType:r,targetId:n,channelId:i||"",endMsgTime:o}})}))}}),Object.defineProperty(e.prototype,"_handleSRSMsgs",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;1!==this.getNaviInfoFromCache().sesDriven?this._sendMessageNotification(e,!1):e.forEach((function(e){var n=e.conversationType,i=e.targetId,o=e.channelId,a=e.sentTime,s=e.content;a>t||r._sendsyncReadStatus({conversationType:n,targetId:i,channelId:o,timestamp:s.lastMessageSendTime})}))}}),Object.defineProperty(e.prototype,"_handlerReadReceiptMsgV1",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(0!==e.length){var n=new Set,i=[];e.forEach((function(e){var o=e.messageType,a=e.senderUserId,s=e.content;if(o===xt){var u=s.messageUId,c=t.get(u);if(!c||c.senderUserId!==a)return;return c.readReceiptInfo=a===r?{isReceiptRequestMessage:!0,readerList:[]}:{isReceiptRequestMessage:!0,hasRespond:!1},n.add(c),void i.push(e)}var l=s.receiptMessageDic;if(a===r)return Object.values(l).forEach((function(e){e.forEach((function(e){var r=t.get(e);r&&(r.readReceiptInfo=V(V({},r.readReceiptInfo),{hasRespond:!0}),n.add(r))}))})),void i.push(e);var d=l[r];d&&0!==d.length&&(d.forEach((function(e){var r=t.get(e);if(r){var i=r.readReceiptInfo,o=((null==i?void 0:i.readerList)||[]).concat(a);r.readReceiptInfo=V(V({},r.readReceiptInfo),{readerList:o}),n.add(r)}})),i.push(e))})),this._enableReadReceiptStorage&&this._updateReadReceiptRequestInfoList(Array.from(n.values()).map((function(e){return{messageUId:e.messageUId,readReceiptInfo:e.readReceiptInfo}}))),this._sendMessageNotification(i,!1)}}}),Object.defineProperty(e.prototype,"_handleExpansionMsgQueue",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if(0!==e.size){var n=[],i=[];Array.from(e.entries()).forEach((function(e){var r=H(e,2),o=r[0],a=r[1],s=t.get(o);if(s&&a.length){var u=new Set,c=new Set,l=s.expansion||{};a.forEach((function(e){var t=e.put,r=e.del;if(e.clear)return Object.keys(l).forEach((function(e){u.add(e),c.clear()})),void(l={});t&&(Object.keys(t).forEach((function(e){u.delete(e),c.add(e)})),l=V(V({},l),t)),r&&r.forEach((function(e){u.add(e),c.delete(e),delete l[e]}))})),s.expansion=l;var d={};Object.keys(l).forEach((function(e){d[e]={v:l[e]}})),n.push({messageUId:o,expansion:JSON.stringify(d)});var f={},_=s.conversationType,p=s.targetId,E=s.channelId,g=!1;u.size>0&&(g=!0,f.deletedExpansion={conversationType:_,targetId:p,channelId:E||"",messageUId:o,deletedKeys:Array.from(u)}),c.size>0&&(g=!0,f.updatedExpansion={conversationType:_,targetId:p,channelId:E||"",messageUId:o,expansion:l}),g&&i.push(f)}})),J(this,oo,"m",Io).call(this,n),i.forEach((function(e){return r._dispatchEvent("expansion",e)}))}}}),Object.defineProperty(e.prototype,"_handleHighPriorityMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.filter((function(e){var t=e.messageType,n=e.conversationType;return t!==Bt&&(t===Ht?J(r,oo,"m",Oo).call(r,e,"highPriorityMessages"):n!==ve.CHATROOM||J(r,oo,"m",bo).call(r,e))}));this._sendMessageNotification(n,t)}}),Object.defineProperty(e.prototype,"_ccMsgHandler",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e;return G(this,void 0,void 0,(function(){var t,r;return k(this,(function(n){switch(n.label){case 0:return this.cloudControllerLock?(this.cloudControllerLock=!1,this.cloudControllerMsgs.shift()?(t=this.tcpMgr.getToken(),[4,null===(e=this.cloudController)||void 0===e?void 0:e.request(this.cloudControllerUri,Un,t)]):[3,2]):[2];case 1:r=n.sent()||0,this.cloudControllerMsgs=this.cloudControllerMsgs.filter((function(e){return e>r})),this.cloudControllerLock=!0,this._ccMsgHandler(),n.label=2;case 2:return[2]}}))}))}}),Object.defineProperty(e.prototype,"_sendMessageNotification",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e.length>0&&this._dispatchEvent("batchMessage",e,void 0,t)}}),Object.defineProperty(e.prototype,"_sendPullOfflineFinished",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._isConnected?(this.logger.info(tt),this._dispatchEvent("pullFinished")):this._offlineFinishedPending=!0}}),Object.defineProperty(e.prototype,"_handleMessageModified",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=JSON.parse(e).list.map((function(e){var t=e.obj;return n._buildMessage(t)}));if(1===r)i.length&&this._dispatchEvent("messagesModified",i);else if(2===r){var o=i.filter((function(e){return J(n,oo,"m",Oo).call(n,e,"messageModified")}));this._sendMessageNotification(o,!1)}this._needDispatchMessageModifiedSyncCompleted&&!t&&this._isConnected&&(this._needDispatchMessageModifiedSyncCompleted=!1,this._dispatchEvent("messageModifiedSyncCompleted"))}}),Object.defineProperty(e.prototype,"_handleChatroomKVUpdate",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.roomId,i=r.key,o=r.value;return r.operator,{chatroomId:n,key:i,value:o,timestamp:r.version,type:r.isDeleted?_e.DELETE:_e.UPDATE}}));t.length&&this._sendChatroomEvents({updatedEntries:t})}}),Object.defineProperty(e.prototype,"_handleChatroomFullKVSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this._chatroomCache.get(e);if(n){n.isKVSynced||(n.isKVSynced=!0,this._sendChatroomEvents({entriesSynced:e}));var i=function(e){return JSON.parse(e).list.map((function(e){var t=e.obj;return JSON.parse(t)})).reduce((function(e,t){return e.set(t.key,t)}),new Map)},o=i(t),a=i(r),s=[];Array.from(o.entries()).forEach((function(e){var t=H(e,2),r=t[0],n=t[1],i=n.roomId,o=n.value;n.operator;var u=n.version;n.isDeleted;var c=a.get(r);c?(a.delete(r),s.push({chatroomId:i,key:r,value:c.value,timestamp:c.version,type:_e.UPDATE})):s.push({chatroomId:i,key:r,value:o,timestamp:u,type:_e.DELETE})})),Array.from(a.entries()).forEach((function(t){var r=H(t,2),n=r[0],i=r[1];s.push({chatroomId:e,key:n,value:i.value,timestamp:i.version,type:_e.UPDATE})})),s.length&&this._sendChatroomEvents({updatedEntries:s})}}}),Object.defineProperty(e.prototype,"_sendChatroomEvents",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("chatroom",e)}}),Object.defineProperty(e.prototype,"_sendMessageReadReceipt",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("messageReadReceipt",e)}}),Object.defineProperty(e.prototype,"_sendsyncReadStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("syncReadStatus",e)}}),Object.defineProperty(e.prototype,"_setConversationStatusListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ui.setConversationStatusListener(this._catcher.gen("setConversationStatusListener[0]",(function(t){var r=JSON.parse(t).list.map((function(e){var t=JSON.parse(e.obj),r={conversation:{channelId:t.channelId,conversationType:t.conversationType,targetId:t.targetId},updatedItems:{}};return t.status.forEach((function(e){var t=JSON.parse(e.item),n=t.type,i=t.value;if(1===n){var o=Number(i)||Ut.NOT_SET;r.updatedItems.notificationLevel={val:o,time:0},r.updatedItems.notificationStatus={val:dr(o),time:0}}else 2===n?r.updatedItems.isTop={val:"1"===i,time:0}:4===n&&(r.updatedItems.translateStrategy={val:Number(i),time:0})})),r}));r.length>0&&e._dispatchEvent("conversation",r)})),this._catcher.gen("setConversationStatusListener[1]",(function(t){e._dispatchEvent("conversationTag")})),this._catcher.gen("setConversationStatusListener[2]",(function(t,r,n,i){e._clearUnreadCountByTimestamp({conversationType:t,targetId:r,channelId:n},i),e._sendsyncReadStatus({conversationType:t,targetId:r,channelId:n,timestamp:i})})),this._catcher.gen("setConversationStatusListener[3]",(function(t){return e._dispatchEvent("conversationStatusSynced",t)})),this._catcher.gen("setConversationStatusListener[4]",(function(){e._dispatchEvent("syncServerSaveUnreadCompleted")})),this._catcher.gen("setConversationStatusListener[5]",(function(t){var r=J(e,oo,"m",ho).call(e,t,"OnConversationUnreadChanged");if(r.isOk){var n=r.data.map((function(e){return{conversation:e,updatedItems:{unreadMessageCount:{val:e.unreadMessageCount,time:0},hasMentioned:{val:!!e.hasMentioned,time:0}}}}));e._dispatchEvent("conversation",n)}})))}}),Object.defineProperty(e.prototype,"_setPushNotificationListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ui.setPushNotificationListener(this._catcher.gen("setPushNotificationListener[0]",(function(t){return e._getRTCProfile()})),this._catcher.gen("setPushNotificationListener[1]",(function(){return e._dispatchEvent("tag")})),this._catcher.gen("setPushNotificationListener[2]",(function(t){return e._dispatchEvent("userSettingsSynced",t)})),this._catcher.gen("setPushNotificationListener[3]",(function(t){return e._dispatchEvent("userSettingsChanged",{key:En,value:t})})),this._catcher.gen("setPushNotificationListener[4]",(function(t){return e._dispatchEvent("userSettingsChanged",{key:pn,value:t})})))}}),Object.defineProperty(e.prototype,"_getRTCProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this._callCppProxy("getRTCProfile");if(e){var t=this.tcpMgr.getToken();this.navi.updateVoipCallInfo(t,e);var r=this.navi.getNaviInfoFromCache(t);this._dispatchEvent("onNaviDataChange",r)}}}),Object.defineProperty(e.prototype,"_setRTCLivingRoomEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ui.setRTCRoomEventListener(this._catcher.gen("setRTCRoomEventListener",(function(t){e._dispatchEvent("onRTCDataChange",Array.prototype.slice.call(t))})))}}),Object.defineProperty(e.prototype,"_setChatroomEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ui.setChatroomEventListener(this._catcher.gen("setChatroomEventListener[0]",(function(t,r){return e._sendChatroomEvents({chatroomDestroyed:t,chatroomDestroyedType:r})}))),ui.setChatroomStatusListener(this._catcher.gen("setChatroomEventListener[1]",(function(t,r,n){return e._handleChatroomFullKVSync(t,r,n)})),this._catcher.gen("setChatroomEventListener[2]",(function(t){return e._handleChatroomKVUpdate(t)})))}}),Object.defineProperty(e.prototype,"_setCallInfoListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ui.setCallInfoListener(this._catcher.gen("setCallInfoListener[0]",(function(t){var r=[];try{JSON.parse(t).list.forEach((function(e){Object.entries(e).forEach((function(e){var t=H(e,2),n=t[0],i=t[1];r.push({key:n,value:i})}))}))}catch(t){e.logger.error(Kn.P_PARSE_JSON_E,JSON.stringify({error:t}))}e._dispatchEvent("callInfo",JSON.stringify({list:r}))})))}}),Object.defineProperty(e.prototype,"_setSubscribeEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ui.setSubscribeEventListener(this._catcher.gen("setSubscribeEventListener[0]",(function(){})),this._catcher.gen("setSubscribeEventListener[1]",(function(t){e._dispatchEvent("syncSubscribedUserStatusFinished",t)})),this._catcher.gen("setSubscribeEventListener[2]",(function(t){var r=e._buildSubscribeEventData(t).map((function(e){return{userId:e.userId,subscribeType:e.subscribeType,subscribeTime:e.subscribeTime,expiry:e.expiry,operationType:e.operationType}}));e._dispatchEvent("subscribedRelationChange",r)})),this._catcher.gen("setSubscribeEventListener[3]",(function(t){var r=e._buildSubscribeEventData(t).map((function(e){var t=e.userId,r=e.subscribeType,n=e.subscribeTime,i=e.expiry,o=e.details,a=e.userProfile,s={userId:t,subscribeType:r,subscribeTime:n,expiry:i};return[Nt.ONLINE_STATUS,Nt.FRIEND_ONLINE_STATUS].includes(r)?s.details=o:[Nt.USER_PROFILE,Nt.FRIEND_USER_PROFILE].includes(r)&&(s.userProfile=a),s}));e._dispatchEvent("subscribedUserStatusChange",r)})))}}),Object.defineProperty(e.prototype,"_setUserProfileListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ui.setUserProfileListener(this._catcher.gen("setUserProfileListener[0]",(function(t){e._dispatchEvent("syncSubscribedUserStatusFinished",t)})),this._catcher.gen("setUserProfileListener[1]",(function(t){e._dispatchEvent("ownUserProfileChanged",e._string2userProfileInfo(t))})))}}),Object.defineProperty(e.prototype,"_onGroupOperationChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o,a,s,u=[];try{a=JSON.parse(n),u=JSON.parse(i),s=JSON.parse(e);var c={groupId:a[0]?a[0].groupId:"",operatorInfo:this._convertGroupMemberInfoList([s])[0],operation:t,operationTime:r};0===t?(o=H(this._convertGroupInfoList(a),1),c.groupInfo=o[0]):c.memberInfos=this._convertGroupMemberInfoList(u),this._dispatchEvent("groupOperation",c)}catch(t){this.logger.error(Kn.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfoJson:n,membersJson:i,operatorInfo:e}))}}}),Object.defineProperty(e.prototype,"_onGroupInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){try{var a=JSON.parse(r),s=this._convertUpdateGroupInfoList(JSON.parse(i))[0];switch(e){case oe.GROUP_INFO_CHANGE:this._dispatchEvent("groupInfoChanged",{operatorInfo:this._convertGroupMemberInfoList([a])[0],operationTime:o,groupInfo:s,changedGroupInfo:s,fullGroupInfo:n?this._convertUpdateGroupInfoList(JSON.parse(n))[0]:s});break;case oe.GROUP_REMARK_DELETE:case oe.GROUP_REMARK_SET:var u=e===oe.GROUP_REMARK_SET?ae.ADD:ae.REMOVE;this._dispatchEvent("groupRemarkChangedSync",{groupId:t,operationType:u,operationTime:o,groupRemark:(null==s?void 0:s.remark)||""})}}catch(e){this.logger.error(Kn.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfoJson:i,operatorInfoJson:r}))}}}),Object.defineProperty(e.prototype,"_onGroupMemberInfoChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){try{var i=JSON.parse(t),o=JSON.parse(r),a={groupId:e,operatorInfo:this._convertGroupMemberInfoList([i])[0],memberInfo:this._convertGroupMemberInfoList([o])[0],operationTime:n};this._dispatchEvent("groupMemberInfoChanged",a)}catch(e){this.logger.error(Kn.P_PARSE_JSON_E,JSON.stringify({error:e,operatorInfoJson:t,updateMemberInfoJson:r}))}}}),Object.defineProperty(e.prototype,"_onGroupRequestChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){try{var i=JSON.parse(r),o=i.groupId,a=i.joinUser,s=i.approverUser,u=i.inviterUser,c=i.type,l=i.status,d=i.direction,f=i.remark,_=V(V(V(V({groupId:o},a&&{joinMemberInfo:this._convertGroupMemberInfoList([a])[0]}),u&&u.userId&&{inviterInfo:this._convertGroupMemberInfoList([u])[0]}),s&&s.userId&&{operatorInfo:this._convertGroupMemberInfoList([s])[0]}),{status:l,direction:d,type:c,operationTime:n,reason:f});this._dispatchEvent("groupApplicationEvent",_)}catch(e){this.logger.error(Kn.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfo:t,requestInfoJson:r}))}}}),Object.defineProperty(e.prototype,"_onFavoriteMembersChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){try{var i=JSON.parse(r),o=[];i&&mr(i.list)&&(o=i.list.map((function(e){return e.value}))),this._dispatchEvent("groupFollowsChangedSync",{groupId:e,operationType:t,operationTime:n,userIds:o})}catch(e){this.logger.error(Kn.P_PARSE_JSON_E,JSON.stringify({error:e,memberIds:r}))}}}),Object.defineProperty(e.prototype,"_setEntrustGroupListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){ui.setEntrustGroupListener(this._catcher.gen("setEntrustGroupListener[0]",this._onGroupOperationChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[1]",this._onGroupInfoChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[2]",this._onGroupMemberInfoChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[3]",this._onGroupRequestChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[4]",this._onFavoriteMembersChanged.bind(this)))}}),Object.defineProperty(e.prototype,"_onFriendApplicationStatusChanged",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){this._dispatchEvent("friendApplicationStatusChanged",{userId:e,applicationType:t,applicationStatus:r,directionType:n,operationTime:i,extra:null!=o?o:""})}}),Object.defineProperty(e.prototype,"_onFriendAdd",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){this._dispatchEvent("friendAdd",{userId:t,name:r,portraitUri:n,directionType:e,operationTime:i})}}),Object.defineProperty(e.prototype,"_onFriendDelete",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n={directionType:e,operationTime:r,userIds:JSON.parse(t).list.map((function(e){return e.value}))};this._dispatchEvent("friendDelete",n)}}),Object.defineProperty(e.prototype,"_onFriendsClearedFromServer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._dispatchEvent("friendCleared",e)}}),Object.defineProperty(e.prototype,"_onFriendInfoChangedSync",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){try{var n=JSON.parse(r);this._dispatchEvent("friendInfoChangedSync",{userId:e,remark:t,extProfile:n.list,operationTime:0})}catch(e){this.logger.error(Kn.P_PARSE_JSON_E,JSON.stringify({error:e,profiles:r}))}}}),Object.defineProperty(e.prototype,"_setFriendEventListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){ui.setFriendEventListener(this._catcher.gen("setFriendEventListener[0]",this._onFriendApplicationStatusChanged.bind(this)),this._catcher.gen("setFriendEventListener[1]",this._onFriendAdd.bind(this)),this._catcher.gen("setFriendEventListener[2]",this._onFriendDelete.bind(this)),this._catcher.gen("setFriendEventListener[3]",this._onFriendsClearedFromServer.bind(this)),this._catcher.gen("setFriendEventListener[4]",this._onFriendInfoChangedSync.bind(this)))}}),Object.defineProperty(e.prototype,"registerMessageType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){t.isPersited=e!==Ht&&t.isPersited;var r=0,n=t.isCounted,i=t.isCustom,o=t.isStatusMessage,a=t.searchProps;t.isPersited&&(r|=1),n&&(r|=2),o&&(r=16),i&&function(e,t){var r=xn.get(e);r&&!r.isCustom&&console.warn("Builtin message type '".concat(e,"' cannot be registered")),t.isStatusMessage&&(t.isCounted=t.isPersited=!1),xn.set(e,V(V({},t),{isCustom:!0}))}(e,t),zi(this.logger,!1,"registerMessageType",e,r,a||[])}}),Object.defineProperty(e.prototype,"connect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this.tcpMgr.connect(e,t,r,n)}}),Object.defineProperty(e.prototype,"reconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Re.RC_SOCKET_DISCONNECTED;return this.tcpMgr.reconnect(e,t,r,n)}}),Object.defineProperty(e.prototype,"reportSDKInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.stringify(V(V({},e),{"electron-main":"5.42.1"}));this.logger.info(Kn.P_REPORT_VER_O,t),zi(this.logger,!1,"uploadSDKVersion",t,"")}}),Object.defineProperty(e.prototype,"disconnect",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){return k(this,(function(r){switch(r.label){case 0:return e=e||!0,this._chatroomCache.clear(),this.reporter.stop(),Ci(null,this.logger),[4,this.tcpMgr.disconnect(e,t)];case 1:return r.sent(),[2,xr()]}}))}))}}),Object.defineProperty(e.prototype,"setUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"setUserStatus");return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"getUserStatus");return t.asyncInvoke(e,(function(e){return t.ok({status:e})}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"_handleDirectionalUserIdList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.messageType,n=e.content,i=e.directionalUserIdList,o=void 0===i?[]:i,a=t===ve.GROUP;if(r===Wt&&n.receiptMessageDic&&a)for(var s in n.receiptMessageDic)o.push(s);return r===Yt&&(o=function(e,t){return t&&0!==t.length?[ve.GROUP,ve.ULTRA_GROUP,ve.APP_PUBLIC_SERVICE,ve.PUBLIC_SERVICE].includes(e)?t:[]:t||[]}(t,[this._getCurrentUserId()])),o}}),Object.defineProperty(e.prototype,"_handleMessage2Callback",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;switch(e.messageType){case kt:this._msgExpansionHandler.setLocalFromExtMsg(this.logger,e);break;case xt:this._enableReadReceiptStorage&&this._updateReadReceiptInfo(t.content.messageUId,{isReceiptRequestMessage:!0,readerList:[]});break;case Wt:if(this._enableReadReceiptStorage){var n=t.content.receiptMessageDic;if(!n)return;for(var i in n)n[i].forEach((function(e){r._updateReadReceiptInfo(e,{isReceiptRequestMessage:!0,hasRespond:!0})}))}}}}),Object.defineProperty(e.prototype,"sendMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,d,f,_,p,E,g,h,b,R,v,I,O,T,N,m,C,S,y,A,P,L,M,U,D,w,j,V,G,F,H,B,J,x,W,Y,K,X,Q,Z,q,z,$,ee,te=this;return k(this,(function(k){for(X in i=e.conversationType,o=e.targetId,a=e.channelId,s=t.messageType,u=t.content,c=t.expansion,l=t.pushConfig,d=t.pushContent,f=void 0===d?"":d,_=t.pushData,p=void 0===_?"":_,E=t.directionalUserIdList,void 0===E?[]:E,h=t.disableNotification,b=void 0!==h&&h,R=t.canIncludeExpansion,v=void 0!==R&&R,I=t.isVoipPush,O=void 0!==I&&I,T=t.messageId,N=void 0===T?0:T,m=t.disableUpdateLastMessage,C=t.needReceipt,S=t.quoteInfo,A=(y=l||{}).iOSConfig,P=y.androidConfig,L=y.harmonyOSConfig,M=y.templateId,U=void 0===M?"":M,D=y.pushTitle,w=void 0===D?"":D,j=y.pushContent,V=void 0===j?f:j,G=y.pushData,F=void 0===G?p:G,H=y.disablePushTitle,B=void 0!==H&&H,J=y.forceShowDetailContent,x=void 0!==J&&J,W=wr(A,P,L),f=V,p=F,Y=(null==P?void 0:P.notificationId)||"",g=this._handleDirectionalUserIdList(t,i),K={},c)K[X]={v:c[X]};return Q=U,this.logger.info(Kn.P_SEND_MSG_T,JSON.stringify({messageType:s,conversationType:i,targetId:o,channelId:a}),r),Z=no.create(this.logger,"sendMessage"),q=function(e,n){var i=te._buildMessage(e,!1);te.logger.info(Kn.P_SEND_MSG_R,JSON.stringify({code:n,messageUId:i.messageUId}),r),n!==Re.SENSITIVE_REPLACE?(te._handleMessage2Callback(i,t),Z.ok(i)):Z.fail(n)},z=function(e,t){var n=te._buildMessage(e,!1);te.logger.warn(Kn.P_SEND_MSG_R,JSON.stringify({code:t,messageId:n.messageId}),r),n.sentTime=Date.now()-ui.getDeltaTime(),Z.fail(t,n)},$=zi(this.logger,!1,"sendMessage",q,z,i,o,s,JSON.stringify(u),g,b,B,x,f,p,Y,w,W,Q,v,JSON.stringify(K),O,a||"",N,!!m,!!C,(null==S?void 0:S.messageUId)||"",(null==S?void 0:S.senderId)||"",(null==S?void 0:S.objectName)||""),ee=JSON.parse($),null==n||n(ee.messageId),[2,Z.result()]}))}))}}),Object.defineProperty(e.prototype,"recallMsg",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r;return G(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l,d,f,_,p,E,g,h,b,R,v,I=this;return k(this,(function(O){return n=e.channelId||"",i=e.targetId,o=e.conversationType,a=t.user,s=t.pushContent,u=t.extra,c=t.pushConfig,l=t.disableNotification,d=t.isDelete,f=t.directionalUserIdList,_=t.disableUpdateLastMessage,p=t.isAdmin,E=t.messageUId,g=t.sentTime,h={conversationType:o,targetId:i,messageUId:E,sentTime:g,user:a,extra:u,channelId:n,isDelete:d||!1,isAdmin:p},a&&(h.user=a),u&&(h.extra=u),b={conversationType:o,targetId:i,senderUserId:this.tcpMgr.getCurrentUserId(),content:h,objectName:Ht,messageUid:E,direction:Pt.SEND,status:rr.UNREAD,sentTime:g,channelId:n},R=this._buildMessage(JSON.stringify(b),!1),[2,(v=no.create(this.logger,"recallMessage")).asyncInvoke((function(e){return G(I,void 0,void 0,(function(){return k(this,(function(e){return J(this,oo,"m",Oo).call(this,R,"recall"),o===ve.ULTRA_GROUP&&this._dispatchEvent("ultraGroupMessageRecalled",[R]),R.pushConfig=c,v.ok(R),[2]}))}))}),(function(e){return v.fail(e)}),Ht,JSON.stringify(h),l||!1,(null==c?void 0:c.disablePushTitle)||!1,(null==c?void 0:c.forceShowDetailContent)||!1,s||"",(null==c?void 0:c.pushData)||"",(null===(r=null==c?void 0:c.androidConfig)||void 0===r?void 0:r.notificationId)||"",(null==c?void 0:c.pushTitle)||"",wr(null==c?void 0:c.iOSConfig,null==c?void 0:c.androidConfig,null==c?void 0:c.harmonyOSConfig),(null==c?void 0:c.templateId)||"",n,f||[],E,null!=_&&_).result()]}))}))}}),Object.defineProperty(e.prototype,"getHistoryMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){return k(this,(function(n){return r?[2,xr(J(this,oo,"m",To).call(this,e,t))]:[2,J(this,oo,"m",No).call(this,e,t)]}))}))}}),Object.defineProperty(e.prototype,"getContinuousMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c=this;return k(this,(function(l){switch(l.label){case 0:return r=t.timestamp,n=t.count,i=t.order,o=e.conversationType,a=e.targetId,s=e.channelId,[4,(u=no.create(this.logger,"getContinuousMessages",this.logger.createTraceId())).asyncInvoke(o,a,r,n,(function(e,t,r){return u.ok({listJson:e,hasMore:r,nextTime:t})}),(function(e){return u.fail(e)}),0===i,s||"").result()];case 1:return[2,l.sent().trans((function(e){var t=e.listJson,r=e.hasMore,n=e.nextTime,i=JSON.parse(t).list.map((function(e){var t=e.obj;return c._buildMessage(t)})).reverse();return{list:i,hasMore:!!r,timestamp:n}}))]}}))}))}}),Object.defineProperty(e.prototype,"deleteRemoteMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.targetId,i=e.channelId,o=JSON.stringify(t),a=this.logger.createTraceId(),s=no.create(this.logger,"deleteRemoteHistoryMessages",a);return s.asyncInvoke(r,n,o,!1,i||"",(function(){return s.ok()}),(function(e){return s.fail(e)})).result()}}),Object.defineProperty(e.prototype,"deleteRemoteMessageByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId(),n=no.create(this.logger,"clearRemoteHistoryMessages",r);return n.asyncInvoke(e.conversationType,e.targetId,t,(function(){return n.ok()}),(function(e){return n.fail(e)}),e.channelId||"").result()}}),Object.defineProperty(e.prototype,"clearLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){return k(this,(function(t){return J(this,oo,"m",mo).call(this,e),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"getConversationListByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c,l=this;return k(this,(function(d){return r=e.channelId,n=e.count,i=e.startTime,e.order,o=e.conversationTypes,a=e.topPriority,s=o&&o.length>0?o:_t(t?st:ot),u=s.map((function(e){return{conversationType:e,channelId:e===ve.ULTRA_GROUP?J(l,oo,"m",So).call(l,""):r,channelIdValid:e===ve.ULTRA_GROUP||"string"==typeof r}})),c=zi(this.logger,!1,"getConversationListByPageWithTopPriorityV2",u,i,n,!!a),[2,J(this,oo,"m",ho).call(this,c,"getConversationListByPageWithTopPriorityV2")]}))}))}}),Object.defineProperty(e.prototype,"getTopConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i,o,a=this;return k(this,(function(s){return n=((null==t?void 0:t.length)||0)>0?t:_t(e?st:ot),i=n.map((function(e){return{conversationType:e,channelId:e===ve.ULTRA_GROUP?J(a,oo,"m",So).call(a,""):r,channelIdValid:e===ve.ULTRA_GROUP||"string"==typeof r}})),o=zi(this.logger,!1,"getTopConversationsV2",i),[2,J(this,oo,"m",ho).call(this,o,"getTopConversationsV2")]}))}))}}),Object.defineProperty(e.prototype,"getUnreadConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n,i,o=this;return k(this,(function(a){return r=((null==t?void 0:t.length)||0)>0?t:_t(e?st:ot),n=r.map((function(e){return{conversationType:e,channelId:e===ve.ULTRA_GROUP?J(o,oo,"m",So).call(o,""):"",channelIdValid:e===ve.ULTRA_GROUP}})),i=zi(this.logger,!1,"getUnreadConversationListV2",n),[2,J(this,oo,"m",ho).call(this,i,"getUnreadConversationListV2")]}))}))}}),Object.defineProperty(e.prototype,"getAllConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n,i,o=this;return k(this,(function(a){return r=_t(e?st:ot),n=r.map((function(e){return{conversationType:e,channelId:e===ve.ULTRA_GROUP?J(o,oo,"m",So).call(o,""):t,channelIdValid:e===ve.ULTRA_GROUP||"string"==typeof t}})),i=zi(this.logger,!1,"getConversationsV2",n),[2,J(this,oo,"m",ho).call(this,i,"getConversationsV2")]}))}))}}),Object.defineProperty(e.prototype,"getConversationListByPageIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n;return k(this,(function(i){return r=_t(ot).map((function(e){return{conversationType:e,channelIdValid:!1}})),n=zi(this.logger,!1,"getConversationListByPageWithTopPriorityV2",r,e,t,!0),[2,J(this,oo,"m",ho).call(this,n,"getConversationListByPageWithTopPriorityV2")]}))}))}}),Object.defineProperty(e.prototype,"getUntaggedConversationListByPage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n;return k(this,(function(i){return n=zi(this.logger,!1,"getConversationsByPageWithoutTag",e,t,r),[2,J(this,oo,"m",ho).call(this,n,"getConversationsByPageWithoutTag")]}))}))}}),Object.defineProperty(e.prototype,"getConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c,l,d,f;return k(this,(function(_){switch(_.label){case 0:return t=e.conversationType,r=e.targetId,n=e.channelId,(i=J(this,oo,"m",yo).call(this,e))?[2,xr(i)]:(o=J(this,oo,"m",To).call(this,e,{timestamp:0,count:1,order:0,messageType:""}),a=(null==o?void 0:o.list[0])||null,s=JSON.parse(zi(this.logger,!1,"getConversationStatus",JSON.stringify([{conversation_type:t,target_id:r,channel_id:n,channel_id_valid:"string"==typeof n&&n.length>0}])))[0],u=!!(null==s?void 0:s.is_top),c=(null==s?void 0:s.translate_strategy)||Xn,[4,this.getConversationNotificationLevel(e)]);case 1:return l=_.sent(),d=l.data,f={conversationType:t,targetId:r,channelId:n,latestMessage:a,lastUnreadTime:0,isTop:u,notificationLevel:d,notificationStatus:dr(d),translateStrategy:c,unreadMessageCount:J(this,oo,"m",Ao).call(this,e)},[2,xr(f)]}}))}))}}),Object.defineProperty(e.prototype,"batchDeleteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.identifiers,r=e.deleteRemotely,n=e.deleteMessages,i=no.create(this.logger,"batchDeleteConversations",this.logger.createTraceId());return i.invoke({conversationIdentifiers:t.map((function(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}})),deleteMessages:n,deleteRemotely:r},(function(){return i.ok()}),(function(e){return i.fail(e)})).result()}}),Object.defineProperty(e.prototype,"clearConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var t,r,n;return k(this,(function(i){return t=e instanceof Array?e:_t(st),r=t.map((function(e){return{conversationType:e,channelIdValid:!1}})),[2,(n=zi(this.logger,!0,"clearConversationsV2",r))===Re.SUCCESS?xr():Wr(n)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i,o=this;return k(this,(function(a){return n=e.map((function(e){return{conversationType:e,channelId:e===ve.ULTRA_GROUP?J(o,oo,"m",So).call(o,""):r,channelIdValid:e===ve.ULTRA_GROUP||"string"==typeof r}})),i=zi(this.logger,!0,"getTotalUnreadCount2",n,t),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"getConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return t=J(this,oo,"m",Ao).call(this,e),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"clearConversationUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i,o;return k(this,(function(a){return t=e.conversationType,r=e.targetId,n=e.channelId,t===ve.ULTRA_GROUP?(i=this._getServerTime(),[2,(o=no.create(this.logger,"setReadTimestamp",this.logger.createTraceId())).asyncInvoke(t,r,i,(function(){return o.ok()}),(function(e){return o.fail(e)}),n||"").result()]):(J(this,oo,"m",Po).call(this,e),[2,xr()])}))}))}}),Object.defineProperty(e.prototype,"clearAllSGUnreadCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e,t=this;return k(this,(function(r){switch(r.label){case 0:return[4,this.getUnreadConversationList(!1)];case 1:return(e=r.sent()).isOk?(e.data.forEach((function(e){e.conversationType!==ve.ULTRA_GROUP&&J(t,oo,"m",Po).call(t,e)})),[2,xr()]):[2,e.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"_clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.conversationType,n=e.targetId,i=e.channelId;zi(this.logger,!1,"clearUnreadCountByTimestamp",r,n,t,i||"")}}),Object.defineProperty(e.prototype,"clearUnreadCountByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){return k(this,(function(r){return this._clearUnreadCountByTimestamp(e,t),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return t=J(this,oo,"m",Lo).call(this,e),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"getFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return t=J(this,oo,"m",Lo).call(this,e),[2,xr(t?{messageUId:t.messageUId,sentTime:t.sentTime}:null)]}))}))}}),Object.defineProperty(e.prototype,"batchSetConversationToTop",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return J(this,oo,"m",Mo).call(this,e,-1,t?1:0,-1,r,n)}}),Object.defineProperty(e.prototype,"batchSetConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.logger.createTraceId(),n=no.create(this.logger,"setBlockPushLevelInBatches",r),i=e.map((function(e){return{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId,level:t}}));return n.asyncInvoke(JSON.stringify(i),(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"batchSetConversationTranslateStrategy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return J(this,oo,"m",Mo).call(this,e,-1,-1,t,!1,!1)}}),Object.defineProperty(e.prototype,"setConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"setBlockPushLevelForType",this.logger.createTraceId());return r.asyncInvoke(e,t,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getConversationTypeNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return t=zi(this.logger,!0,"getBlockPushLevelForType",e),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a,s,u=this;return k(this,(function(c){switch(c.label){case 0:return i=this.logger.createTraceId(),o=no.create(this.logger,"searchConversationByContentV2",i),a=n.map((function(e){return{conversationType:e,channelId:r,channelIdValid:!0}})),[4,o.asyncInvoke(a,e,t,(function(e,t,r){e===Re.SUCCESS?o.ok({result:t,matchedNumber:r}):o.fail(e)})).result()];case 1:return(s=c.sent()).isOk?[2,s.trans((function(e){return JSON.parse(e.result).map((function(e){return J(u,oo,"m",go).call(u,e)}))}))]:[2,xr([])]}}))}))}}),Object.defineProperty(e.prototype,"searchConversationByContentWithAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i,o,a,s=this;return k(this,(function(u){switch(u.label){case 0:return r=r||_t(ot),n=this.logger.createTraceId(),i=no.create(this.logger,"searchConversationByContentV2",n),o=r.map((function(e){return{conversationType:e,channelIdValid:!1}})),[4,i.asyncInvoke(o,e,t,(function(e,t,r){e===Re.SUCCESS?i.ok({result:t,matchedNumber:r}):i.fail(e)})).result()];case 1:return(a=u.sent()).isOk?[2,a.trans((function(e){return JSON.parse(e.result).map((function(e){return J(s,oo,"m",go).call(s,e)}))}))]:[2,xr([])]}}))}))}}),Object.defineProperty(e.prototype,"searchMessagesWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r,n,i,o;return G(this,void 0,void 0,(function(){var a,s,u,c,l=this;return k(this,(function(d){switch(d.label){case 0:return a=this.logger.createTraceId(),s=function(e){if(!e)return[];var t=[],r=function(e){if(0!==t.length){var r=[];e.forEach((function(e){r.push.apply(r,B([],H(t.map((function(t){return V(V({},t),e)}))),!1))})),t=r}else t.push.apply(t,B([],H(e),!1))},n=e.conversationTypes,i=void 0===n?[]:n,o=e.targetIds,a=void 0===o?[]:o,s=e.channelIds,u=void 0===s?[]:s,c=dn(i).map((function(e){return{conversationType:e}})),l=dn(a).map((function(e){return{targetId:e}})),d=dn(u).length?u.map((function(e){return{channelId:e}})):[{channelIdValid:!1}];return r(c),r(l),r(d),t}(e.conversationFilter),u={keyword:e.keyword,limit:e.limit,desc:!e.order,offset:null!==(t=e.offset)&&void 0!==t?t:0,needMatchCount:!0,startTime:null===(r=e.timeRange)||void 0===r?void 0:r.startTime,endTime:null===(n=e.timeRange)||void 0===n?void 0:n.endTime,objectNames:dn((null===(i=e.messageFilter)||void 0===i?void 0:i.objectNames)||[]),senderIds:dn((null===(o=e.messageFilter)||void 0===o?void 0:o.senderIds)||[])},[4,(c=no.create(this.logger,"searchMessage",a)).invoke(s,u,(function(e,t,r,n){e===Re.SUCCESS?c.ok({result:t,totalMatched:r,conditionsMatched:n}):c.fail(e)})).result()];case 1:return[2,d.sent().trans((function(e){var t=e.result,r=e.totalMatched,n=e.conditionsMatched;return{messages:JSON.parse(t).list.map((function(e){return JSON.parse(e.obj)})).map((function(e){return J(l,oo,"m",Eo).call(l,e)})),totalMatched:r,conditionsMatched:n}}))]}}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i,o,a=this;return k(this,(function(s){return t=e.conversationType,r=e.targetId,n=e.channelId,i=zi(this.logger,!1,"getUnreadMentionedMessages",t,r,n||""),o=JSON.parse(i).list.map((function(e){var t=e.obj;return J(a,oo,"m",Eo).call(a,JSON.parse(t))})),[2,xr(o)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){return r=J(this,oo,"m",yo).call(this,e),[2,xr(null!==(t=null==r?void 0:r.unreadMentionedCount)&&void 0!==t?t:0)]}))}))}}),Object.defineProperty(e.prototype,"addToBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"addToBlacklist",this.logger.createTraceId());return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeFromBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"removeFromBlacklist",this.logger.createTraceId());return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getBlacklist",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=no.create(this.logger,"getBlacklist",this.logger.createTraceId());return e.asyncInvoke((function(t){return e.ok(t)}),(function(t){return e.fail(t)})).result()}}),Object.defineProperty(e.prototype,"getBlacklistStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"getBlacklistStatus",this.logger.createTraceId());return t.asyncInvoke(e,(function(e){return t.ok(e)}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"insertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){return[2,-1===(r=J(this,oo,"m",Uo).call(this,e,t)).messageId?Wr(Re.MSG_INSERT_ERROR,"insert message failed",r):xr(r)]}))}))}}),Object.defineProperty(e.prototype,"batchInsertMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!1),G(this,void 0,void 0,(function(){var r;return k(this,(function(n){return r=e.map((function(e){var t=e.content,r=e.senderUserId,n=e.messageType,i=e.messageDirection,o=e.receivedStatus,a=void 0===o?0:o,s=e.sentStatus,u=e.sentTime,c=e.searchContent,l=e.isUnread,d=e.messageUId,f=e.disableNotification,_=e.canIncludeExpansion,p=e.expansion,E=e.channelId,g=e.conversationType,h=e.targetId,b=e.source,R=e.isMentioned,v=e.receivedStatusInfo,I=e.directedUserIds,O=e.disableUpdateLastMessage,T=v?function(e){var t=rr.UNREAD;return(null==e?void 0:e.isRead)&&(t|=rr.READ),(null==e?void 0:e.isListened)&&(t|=rr.LISTENED),(null==e?void 0:e.isDownload)&&(t|=rr.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=rr.RETRIEVED),t}(v):a,N=u||0,m={};if(p)for(var C in p)m[C]={v:p[C],ts:N};var S=e.quoteInfo?{messageUId:e.quoteInfo.messageUId,senderId:e.quoteInfo.senderId,objectName:e.quoteInfo.objectName,quoteMessageStatus:e.quoteInfo.quoteMessageStatus||Er}:void 0;return{conversationType:g,targetId:h,channelId:E||"",direction:i,senderUserId:r,status:s||10,sentTime:N,objectName:n,content:JSON.stringify(t),messageUid:d||"",noNotification:!!f,supportExt:!!_,extMsg:JSON.stringify(m),readStatus:T,searchContent:c||"",isUnread:!!l,source:b||"",isMention:R,directedUsers:I,disableUpdateLastMessage:!!O,quoteInfo:S}})),[2,zi(this.logger,!0,"insertMessages",JSON.stringify(r),t)?xr(!0):Wr(Re.MSG_INSERT_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getLocalMessageCount",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i;return k(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=zi(this.logger,!0,"getMessageCount",t,r,n||""),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){return k(this,(function(t){return J(this,oo,"m",Do).call(this,e),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"deleteLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){return k(this,(function(n){return J(this,oo,"m",wo).call(this,e,t,r),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"batchClearLocalMessagesByTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return t=e.map((function(e){return{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId||"",send_time:e.timestamp}})),zi(this.logger,!1,"deleteMessageBySendTimeInBatches",JSON.stringify(t)),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"batchClearRemoteHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.map((function(e){return{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId||"",send_time:e.timestamp}})),n=no.create(this.logger,"deleteRemoteMessageBySendTimeInBatches",this.logger.createTraceId());return n.asyncInvoke(JSON.stringify(r),!!t,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){return k(this,(function(t){return[2,J(this,oo,"m",Vo).call(this,e)]}))}))}}),Object.defineProperty(e.prototype,"setMessageContent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){return k(this,(function(n){return J(this,oo,"m",Go).call(this,e,t,r),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"setMessageSearchField",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){return k(this,(function(n){return zi(this.logger,!1,"setMessageSearchField",e,t,r),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"setMessageSentStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){return k(this,(function(r){return zi(this.logger,!1,"setMessageSentStatus",e,t),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"setMessageReceivedStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){return k(this,(function(r){return J(this,oo,"m",ko).call(this,e,t),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"saveTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n,i;return k(this,(function(o){return r=e.conversationType,n=e.targetId,i=e.channelId,[2,zi(this.logger,!1,"saveTextMessageDraft",r,n,t,i||"")?xr():Wr(Re.DRAFT_SAVE_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i;return k(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=zi(this.logger,!0,"getTextMessageDraft",t,r,n||""),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"clearTextMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n;return k(this,(function(i){return t=e.conversationType,r=e.targetId,n=e.channelId,[2,zi(this.logger,!1,"clearTextMessageDraft",t,r,n||"")?xr():Wr(Re.DRAFT_REMOVE_ERROR)]}))}))}}),Object.defineProperty(e.prototype,"getConversationNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i;return k(this,(function(o){return t=e.conversationType,r=e.targetId,n=e.channelId,i=zi(this.logger,!0,"getBlockPushLevelForConversation",r,n||"",t),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"getTotalUnreadCountByLevels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i;return k(this,(function(o){return n=e.map((function(e){return{conversationType:e,channelIdValid:!1}})),0!==(i=zi(this.logger,!0,"getUnreadAndMentionCountByLevel",n,t)).code?[2,Wr(i.code)]:[2,xr(r?i.mention:i.unread)]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptV2",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i,o=this;return k(this,(function(a){switch(a.label){case 0:return[4,(n=no.create(this.logger,"sendReadReceipt",this.logger.createTraceId())).asyncInvoke(e,r||"",t,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()];case 1:return(i=a.sent()).isOk&&t.forEach((function(e){o._updateReadReceiptInfo(e,{hasRespond:!0});var t=J(o,oo,"m",jo).call(o,e);t.isOk&&J(o,oo,"m",ko).call(o,t.data.messageId,1)})),[2,i]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReader",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=this,i=no.create(this.logger,"getMessageReader",this.logger.createTraceId());return i.asyncInvoke(e,r,t,(function(e,r){var o=[],a={};JSON.parse(e).list.forEach((function(e){var t=JSON.parse(e.obj),r=t.id,n=t.time;o.push({userId:r,readTime:n}),a[r]=n}));var s={readerInfo:a,readCount:o.length,totalCount:r};n._updateReadReceiptInfo(t,s),i.ok({list:o,totalMemberCount:r})}),(function(e){return i.fail(e)})).result()}}),Object.defineProperty(e.prototype,"sendReadReceiptMessageV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"sendMessageReadReceipt",this.logger.createTraceId()),i=e.conversationType,o=e.targetId,a=e.channelId;return n.asyncInvoke(i,o,a||"",t,r,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getMessageReadReceiptV4",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=e.targetId,i=e.channelId,o=no.create(this.logger,"getMessageReadReceipt",this.logger.createTraceId());return o.asyncInvoke(n,i||"",t,(function(e,n,i){return G(r,void 0,void 0,(function(){var r,a,s,u,c,l,d,f,_;return k(this,(function(p){r=[],a=this._callCppProxy("getMessage",t),s=JSON.parse(a);try{JSON.parse(i).list.forEach((function(e){var t=JSON.parse(e.obj),n=t.id,i=t.time;r.push({userId:n,readTime:i})}))}catch(e){this.logger.error(Kn.P_PARSE_JSON_E,"method: getMessageReadReceipt, info: ".concat(i,", error: ").concat(e))}return u=JSON.parse(s.readReceiptRequest||"{}"),c=u.readerList,l=void 0===c?[]:c,d=u.readCount,f=void 0===d?0:d,_=!1,l.length<r.length&&(l=r,_=!0),f<n&&(f=n,_=!0),_&&this._callCppProxy("updateReadReceiptRequestInfo",t,JSON.stringify({readerList:l,readCount:f,totalCount:e})),o.ok({list:r,totalCount:e,readCount:f}),[2]}))}))}),(function(e){return o.fail(e)})).result()}}),Object.defineProperty(e.prototype,"updateConversationReadTime",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"updateConversationReadTime",this.logger.createTraceId()),n=e.conversationType,i=e.targetId,o=e.channelId;return r.asyncInvoke(n,i,o||"",t,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"_try2RejoinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(0!==this._chatroomCache.size){var t=this.logger.createTraceId();this._chatroomCache.forEach((function(r){return G(e,void 0,void 0,(function(){var e,n,i,o,a,s,u;return k(this,(function(c){switch(c.label){case 0:return e=r.chatroomId,n=r.count,i=r.extra,this.logger.info(Pe,e,t),[4,this._joinChrm(e,n,!1,!0,i)];case 1:return o=c.sent(),this.logger.summary(Le,o,t),a=o.code,s=o.isOk,u=o.data,s?(this._sendChatroomEvents({rejoinedRoom:V({chatroomId:e,count:n},u)}),[2]):(a!==Re.RC_CHATROOM_USER_KICKED&&a!==Re.RC_CHATROOM_NOT_EXIST||this._chatroomCache.delete(e),this._sendChatroomEvents({rejoinedRoom:{chatroomId:e,errorCode:a}}),[2])}}))}))}))}}}),Object.defineProperty(e.prototype,"_joinChrm",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i){var o=this,a=r?"joinChatRoom":"joinExistChatRoom";n||J(this,oo,"m",Co).call(this,e,!0,!0);var s=no.create(this.logger,a,this.logger.createTraceId());return s.asyncInvoke(e,t,(function(r,a,u,c,l,d,f){o._chatroomCache.set(e,{chatroomId:e,count:t,extra:i||"",isKVSynced:n}),s.ok({createTime:Number(r),memberCount:a,isAllChatroomBanned:u,isCurrentUserBanned:c,isCurrentChatroomBanned:l,isCurrentChatroomInWhitelist:d,joinTime:f})}),(function(e){return s.fail(e)}),i||"").result()}}),Object.defineProperty(e.prototype,"joinChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){return k(this,(function(i){return[2,this._joinChrm(e,t,r,!1,n)]}))}))}}),Object.defineProperty(e.prototype,"quitChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._chatroomCache.delete(e);var r=no.create(this.logger,"quitChatRoom",this.logger.createTraceId());return r.asyncInvoke(e,(function(){return r.ok()}),(function(e){return r.fail(e)}),t||"").result()}}),Object.defineProperty(e.prototype,"getChatroomInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"getChatroomInfo",this.logger.createTraceId());return n.asyncInvoke(e,t,r,(function(e,t){var r=(e?JSON.parse(e).list:[]).map((function(e){return JSON.parse(e.obj)}));n.ok({userInfos:r,userCount:t})}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getChatroomHistoryMessages",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a=this;return k(this,(function(s){return i=this.logger.createTraceId(),[2,(o=no.create(this.logger,"getChatroomHistoryMessage",i)).asyncInvoke(e,t,r,n,(function(e){var t;try{t=JSON.parse(e)}catch(e){t={list:[],hasMore:!1}}var r=t.list;if(r&&r.length)try{t.list=r.map((function(e){return a._buildMessage(e.obj)}))}catch(e){t.list=[]}o.ok(t)}),(function(e){return o.fail(e)}),"").result()]}))}))}}),Object.defineProperty(e.prototype,"setChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"setChatroomStatus",this.logger.createTraceId());return n.asyncInvoke(e,t.key,t.value,!!t.isAutoDelete,r,!!t.isSendNotification,t.notificationExtra||"",(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"setChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"setChatroomKV");return r.asyncInvoke(e,JSON.stringify(t.entries),!!t.isAutoDelete,!!t.isForce,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"deleteChatroomStatus",this.logger.createTraceId());return n.asyncInvoke(e,t.key,r,!!t.isSendNotification,t.notificationExtra||"",(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"deleteChatroomKV",this.logger.createTraceId());return r.asyncInvoke(e,t.keys,!1,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getChatroomEntry",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){return k(this,(function(r){switch(r.label){case 0:return[4,this.getAllChatroomEntries(e)];case 1:return[2,r.sent().tryTrans((function(e){var r=e[t];return"string"!=typeof r?Wr(Re.CHATROOM_KEY_NOT_EXIST):xr(r)}))]}}))}))}}),Object.defineProperty(e.prototype,"getAllChatroomEntries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"getChatroomKV",this.logger.createTraceId());return t.asyncInvoke(e,(function(e){var r={};try{(e?JSON.parse(e):{list:[]}).list.forEach((function(e){var t=e.obj,n=JSON.parse(t);r[n.key]=n.value?n.value:""}))}catch(e){}t.ok(r)}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getFileToken",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n,i,o){var a;r=r||"",i=i||"",a=(n=n||"")&&"uploads"!==n?t||"":Dr(e,t);var s=this.getNaviInfoFromCache(),u={uploadDomain:Gr(s,this.logger),env:this._environment};o=o?Math.ceil(o):0;var c=no.create(this.logger,"getUploadToken");return c.asyncInvoke(e,a,r,n,i,JSON.stringify(u),o,s.ipType||0,(function(e,t,r,n,i,o,s,u,l,d,f,_,p,E,g,h,b,R,v,I,O,T,N,m){c.ok({token:e,deadline:0,bosToken:t,bosDate:r,path:n,osskeyId:i,ossPolicy:o,ossSign:s,ossBucketName:u,fileName:a,s3Credential:l,s3Algorithm:d,s3Date:f,s3Policy:_,s3Signature:p,s3BucketName:E,stcAuthorization:g,stcContentSha256:h,stcDate:b,stcBucketName:R,minioAuthorization:v,minioContentSha256:I,minioDate:O,minioBucketName:T,downloadAuthInfo:N?JSON.parse(N):null})}),(function(e){return c.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getFileUrl",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this.getNaviInfoFromCache(),o=Gr(i,this.logger),a=this.logger.createTraceId(),s=no.create(this.logger,"getDownloadUrl",a);return s.asyncInvoke(e,r,n,t-1,JSON.stringify({url:o}),-1,i.ipType||0,(function(e){return s.ok({downloadUrl:e})}),(function(e){return s.fail(e)})).result()}}),Object.defineProperty(e.prototype,"clearLocalData",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e;return k(this,(function(t){return e=zi(this.logger,!0,"clearData"),[2,xr(e)]}))}))}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._deviceId}}),Object.defineProperty(e.prototype,"getVoIPKey",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return new Promise((function(n){r._callCppProxy("getVoIPKey",e,t,"",(function(e){setTimeout((function(){n({code:Re.SUCCESS,data:e})}),0)}),(function(e){setTimeout((function(){n({code:e})}),0)}))}))}}),Object.defineProperty(e.prototype,"bindRTCRoomForChatroom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"bindRTCRoomForChatroom",this.logger.createTraceId());return t.asyncInvoke(e.chatRoomId,e.rtcRoomId,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"rtcSignaling",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=no.create(this.logger,"rtcSignaling");return i.asyncInvoke(e,t,r,n,(function(e){var t=Array.prototype.slice.call(e);i.ok(t)}),(function(e){return i.fail(e)}),30).result()}}),Object.defineProperty(e.prototype,"_setRTCHeartbeatListener",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;ui.setRTCHeartbeatListener(this._catcher.gen("setRTCHeartbeatListener[0]",(function(t,r){var n=e.rtcHeartbeatResolves[t];if(n){var i=n.find((function(e){return""===e.seqId}));i&&(i.seqId=r)}})),this._catcher.gen("setRTCHeartbeatListener[1]",(function(t,r,n,i){var o=e.rtcHeartbeatResolves[t];if(o){var a=o.findIndex((function(e){return e.seqId===n}));-1!==a&&o.splice(a,1)[0].resolve({code:r,data:{version:Number(i)}})}})))}}),Object.defineProperty(e.prototype,"rtcPing",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=Qr(),i=n.promise,o={resolve:n.resolve,seqId:""},a=this.rtcHeartbeatResolves[e];return a?a.push(o):this.rtcHeartbeatResolves[e]=[o],zi(this.logger,!1,"sendRTCHeartbeat",[e],30),i}}),Object.defineProperty(e.prototype,"createTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"addTag");return t.asyncInvoke(e.tagId,e.tagName,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"deleteTag");return t.asyncInvoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"updateTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"renameTag");return t.asyncInvoke(e.tagId,e.tagName,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getTagList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e,t;return k(this,(function(r){return e=zi(this.logger,!1,"getTags"),t=this._convertResultList(e,(function(e){return{tagId:e.tagId,tagName:e.tagName,conversationCount:e.conversationCount,createdTime:e.tagTime}})),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"addTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"addConversationsForTag"),n=t.map((function(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId}}));return r.asyncInvoke(e,JSON.stringify(n),(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeTagForConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"removeConversationsForTag"),n=t.map((function(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId}}));return r.asyncInvoke(e,JSON.stringify(n),(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"removeTagsForConversation");return r.asyncInvoke(e.conversationType,e.targetId,e.channelId||"",t,(function(){return r.ok()}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getConversationListByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i,o=this;return k(this,(function(a){return n=zi(this.logger,!1,"getConversationsForTagByPage",e,t,r,""),i=this._convertResultList(n,(function(e){return V(V({},o._buildConversation(JSON.stringify(e))),{isTopInTag:e.topForTag})})),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadCountByTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){return r=zi(this.logger,!0,"getConversationUnreadCountForTag",e,t),[2,xr(r)]}))}))}}),Object.defineProperty(e.prototype,"setConversationStatusInTag",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"setConversationToTopForTag");return n.asyncInvoke(e,t.conversationType,t.targetId,t.channelId||"",!!r.isTop,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getTagsForConversation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r;return k(this,(function(n){return t=zi(this.logger,!1,"getTagsForConversation",e.conversationType,e.targetId,e.channelId||""),r=this._convertResultList(t,(function(e){return{tagId:e.tagId,tagName:e.tagName,isTop:e.isTop,createdTime:e.tagTime}})),[2,xr(r)]}))}))}}),Object.defineProperty(e.prototype,"getAllUnreadMentionedCount",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e,t;return k(this,(function(r){return e=[ve.GROUP].map((function(e){return{conversationType:e,channelIdValid:!1}})),0!==(t=zi(this.logger,!0,"getUnreadAndMentionCountV2",e)).code?[2,Wr(t.code)]:[2,xr(t.mention)]}))}))}}),Object.defineProperty(e.prototype,"getOSInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e;return k(this,(function(t){return e={arch:o(),platform:i(),type:c(),version:l(),release:u(),uptime:d(),cpus:s(),freemem:f(),totalmem:_(),networkInterfaces:a()},[2,xr(e)]}))}))}}),Object.defineProperty(e.prototype,"getMainProcessInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){return k(this,(function(e){return[2,xr({title:process.title,pid:process.pid,ppid:process.ppid,platform:process.platform,arch:process.arch,uptime:process.uptime(),cpuUsage:process.cpuUsage(),memoryUsage:process.memoryUsage(),resourceUsage:process.resourceUsage()})]}))}))}}),Object.defineProperty(e.prototype,"setCallInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"callInfoSignaling");return n.asyncInvoke(e,t,r,(function(e,t){return n.ok({key:e,value:t})}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"setProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){return k(this,(function(t){return this.tcpMgr.getConnectionStatus()!==St.DISCONNECTED?[2,Wr(Re.RC_CONN_PROXY_UNAVAILABLE)]:[2,Ci(e,this.logger)]}))}))}}),Object.defineProperty(e.prototype,"getProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Promise.resolve(Si())}}),Object.defineProperty(e.prototype,"testProxy",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return function(e,t,r){return G(this,void 0,void 0,(function(){var n,i,o,a,s,u,c,l;return k(this,(function(d){switch(d.label){case 0:return n=Qr(),i=n.resolve,o=n.promise,a=/^https/.test(t),s=a?Ti:vi,u=r.createTraceId(),r.info(He,JSON.stringify({proxy:e,testHost:t}),u),c=s(t,e,(function(e){var t=200===e.statusCode;e.setEncoding("utf8");var r="";e.on("data",(function(e){r+=e})),e.once("end",(function(){var n=t?xr(r):Wr(Re.RC_HTTP_REQ_FAIL,"fail: ".concat(e.statusCode),r);i(n)}))})),c.once("timeout",(function(){return i(Wr(Re.TIMEOUT))})),c.once("error",(function(e){return i(Wr(Re.RC_HTTP_REQ_FAIL,e.stack))})),c.end(),[4,o];case 1:return l=d.sent(),r.summary(Be,l,u),[2,l.wipe()]}}))}))}(e,t,this.logger)}}),Object.defineProperty(e.prototype,"setCheckDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return t=zi(this.logger,!0,"checkDuplicateMessage",e),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"subscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"updateSubscribeStatus");return n.asyncInvoke(t,mt.SUBSCRIBE,e,(function(){return n.ok()}),(function(e,t){return n.fail(e,t)}),r).result()}}),Object.defineProperty(e.prototype,"unSubscribeUser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"updateSubscribeStatus");return r.asyncInvoke(t,mt.UNSUBSCRIBE,e,(function(){return r.ok()}),(function(e,t){return r.fail(e,t)}),0).result()}}),Object.defineProperty(e.prototype,"getSubscribeUserList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i,o;return k(this,(function(a){return n=zi(this.logger,!1,"getSubscribeUserList",e,t,r),i=this._buildSubscribeEventData(n),o=i.map((function(e){var t=e.userId,r=e.subscribeType,n=e.subscribeTime,i=e.expiry,o=e.details,a={userId:t,subscribeType:r,subscribeTime:n,expiry:i};return r===Nt.ONLINE_STATUS&&(a.details=Ar(o)),a})),[2,xr(o)]}))}))}}),Object.defineProperty(e.prototype,"setCheckChatRoomDuplicateMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return[2,(t=zi(this.logger,!1,"setDuplicateMessageConfig",[ve.CHATROOM],Yo.cuid,e))===Re.SUCCESS?xr():Wr(t)]}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUserStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r=this;return k(this,(function(n){switch(n.label){case 0:return[4,J(this,oo,"m",xo).call(this,[e],t)];case 1:return[2,n.sent().trans((function(e){var t=r._buildSubscribeEventData(e).map((function(e){var t=e.userId,r=e.subscribeType,n=e.subscribeTime,i=e.expiry,o=e.details,a={userId:t,subscribeType:r,subscribeTime:n,expiry:i};return r===Nt.ONLINE_STATUS&&(a.details=Ar(o)),a}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"updateMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[],r=[];Object.keys(e).forEach((function(n){var i;if("extraProfile"===n&&e.extraProfile){if(e.extraProfile){var o=e.extraProfile;Object.keys(o).forEach((function(e){r.push(JSON.stringify({key:e,value:o[e]||""}))}))}}else t.push(JSON.stringify({key:n,value:(null===(i=e[n])||void 0===i?void 0:i.toString())||""}))}));var n=no.create(this.logger,"updateUserProfile");return n.invoke(t,r,(function(e,t){if(e===Re.SUCCESS)n.ok();else{var r=ni(t);n.fail(e,{errorKey:r[0],errorKeys:r})}})).result()}}),Object.defineProperty(e.prototype,"getUserProfiles",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=no.create(this.logger,"getUserProfiles");return r.invoke(e,(function(e,n){e===Re.SUCCESS?r.ok(t._string2UserProfileInfoList(n)):r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getMyUserProfile",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=no.create(this.logger,"getOwnUserProfile");return t.asyncInvoke((function(r,n){t.flush(Jr.from(r).trans((function(){return e._string2userProfileInfo(n)})))})).result()}}),Object.defineProperty(e.prototype,"_string2userProfileInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;try{var r=JSON.parse(e),n=r.userProfile.reduce((function(e,t){var r=JSON.parse(t);return["gender","role","level"].includes(r.key)?e[r.key]=Number(r.value):e[r.key]=r.value,e}),{});return n.userId=r.userId,n.extraProfile=(null===(t=r.userExtProfile)||void 0===t?void 0:t.reduce((function(e,t){var r=JSON.parse(t);return e[r.key]=r.value,e}),{}))||{},n}catch(t){this.logger.error(Kn.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return{}}}),Object.defineProperty(e.prototype,"_string2UserProfileInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;try{return JSON.parse(e).list.map((function(e){return t._string2userProfileInfo(e.obj)}))}catch(t){this.logger.error(Kn.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return[]}}),Object.defineProperty(e.prototype,"updateMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"updateUserProfilePermission");return t.invoke(e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getMyUserProfileVisibility",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=no.create(this.logger,"getUserProfilePermission");return e.asyncInvoke((function(t,r){e.flush(Jr.from(t).trans((function(){return r})))})).result()}}),Object.defineProperty(e.prototype,"searchUserProfileByUniqueId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=no.create(this.logger,"getUserProfileByUniqueId");return r.asyncInvoke(e,(function(e,n){r.flush(Jr.from(e).trans((function(){return t._string2userProfileInfo(n)})))})).result()}}),Object.defineProperty(e.prototype,"getMessagesAroundTimestamp",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a,s,u,c=this;return k(this,(function(l){return i=e.conversationType,o=e.targetId,a=e.channelId,s=zi(this.logger,!1,"getMatchedMessage",i,o,t,r,n,a||""),u=JSON.parse(s).list.map((function(e){var t=e.obj;return c._buildMessage(t)})),[2,xr(u)]}))}))}}),Object.defineProperty(e.prototype,"getConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return t=J(this,oo,"m",Fo).call(this,e),[2,xr(t)]}))}))}}),Object.defineProperty(e.prototype,"handleErrorCode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e!==Re.SUCCESS&&setTimeout((function(){return t(Wr(e))}),0)}}),Object.defineProperty(e.prototype,"_convertGroupInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e&&0!==e.length?e.map((function(e){var t=e.groupId,r=e.baseInfo,n=e.createTime,i=e.createUserId,o=e.extraInfo,a=e.memberCount,s=e.ownerId,u=e.remark,c=e.joinTime,l=e.role,d=Ur(r),f=Ur(o);return{groupId:t,groupName:d.name||"",portraitUri:d.portraitUrl||"",introduction:d.introduction||"",notice:d.announcement||"",joinPermission:~~d.joinPerm,removeMemberPermission:~~d.removePerm,invitePermission:~~d.memInvitePerm,inviteHandlePermission:~~d.invitePerm,groupInfoEditPermission:~~d.profilePerm,memberInfoEditPermission:~~d.memProfilePerm,extProfile:f,creatorId:i||"",ownerId:s||"",createTime:n||0,membersCount:a||0,remark:u||"",joinedTime:c||0,role:l||ne.UNDEF}})):[]}}),Object.defineProperty(e.prototype,"_convertUpdateGroupInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&0!==e.length?e.map((function(e){var t=e.groupId,r=e.baseInfo,n=e.createTime,i=e.createUserId,o=e.extraInfo,a=e.memberCount,s=e.ownerId,u=e.remark,c=e.joinTime,l=e.role,d=Ur(r),f=Ur(o);return JSON.parse(JSON.stringify(V(V(V(V(V(V(V(V(V({groupId:t},function(e){return JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Mr(e.joinPerm),removeMemberPermission:Mr(e.removePerm),invitePermission:Mr(e.memInvitePerm),inviteHandlePermission:Mr(e.invitePerm),groupInfoEditPermission:Mr(e.profilePerm),memberInfoEditPermission:Mr(e.memProfilePerm)}))}(d)),o.length>0&&{extProfile:f}),i&&{creatorId:i}),s&&{ownerId:s}),n&&{createTime:n}),a&&{membersCount:a}),u&&{remark:u}),c&&{joinedTime:c}),l&&{role:l})))})):[]}}),Object.defineProperty(e.prototype,"_convertGroupMemberInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e&&0!==e.length?e.map((function(e){var t=e.userId,r=e.nickname,n=e.groupNickname,i=e.portraitUrl,o=e.joinTime;return{userId:t,name:r||"",portraitUri:i||"",nickname:n||"",role:e.role||0,joinedTime:o||0,extra:e.extra||"",isRobot:!!e.isRobot}})):[]}}),Object.defineProperty(e.prototype,"createGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a;return k(this,(function(s){return i=ei(t),o=ei(r||{}),[2,(a=no.create(this.logger,"createGroup")).invoke(e,n||[],JSON.stringify(i),JSON.stringify(o),(function(e,t,r,n){e===Re.SUCCESS?a.ok():a.fail(e,{errorKeys:ni(n),processCode:t})})).result()]}))}))}}),Object.defineProperty(e.prototype,"updateGroupInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i,o;return k(this,(function(a){return n=ei(t),i=ei(r||{}),[2,(o=no.create(this.logger,"updateGroupInfo")).invoke(e,JSON.stringify(n),JSON.stringify(i),(function(e,t,r,n){e===Re.SUCCESS?o.ok():o.fail(e,{errorKeys:ni(n)})})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r=this;return k(this,(function(n){return[2,(t=no.create(this.logger,"getGroupInfoByIds")).invoke(e,(function(e,n,i,o){var a=Jr.from(e).trans((function(){var e=JSON.parse(o);return r._convertGroupInfoList(e)}));t.flush(a)})).result()]}))}))}}),Object.defineProperty(e.prototype,"kickGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n;return k(this,(function(i){return[2,(n=no.create(this.logger,"kickOutGroupMember")).invoke(e,t,JSON.stringify(ti(r)),(function(e,t){return n.flush(Jr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"quitGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){return[2,(r=no.create(this.logger,"quitGroup")).invoke(e,JSON.stringify(ti(t)),(function(e,t){return r.flush(Jr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"dismissGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return[2,(t=no.create(this.logger,"disbandGroup")).invoke(e,(function(e,r){return t.flush(Jr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"transferGroupOwner",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i;return k(this,(function(o){return[2,(i=no.create(this.logger,"transferGroup")).invoke(e,t,r,JSON.stringify(ti(n)),(function(e,t){return i.flush(Jr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"setGroupManagers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n;return k(this,(function(i){return[2,(n=no.create(this.logger,"updateGroupAdmins")).invoke(t,r,e,(function(e,t){return n.flush(Jr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupMembersByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i=this;return k(this,(function(o){return[2,(n=no.create(this.logger,"getGroupMembers")).invoke(e,t===ne.UNDEF?[1,2,3]:[t],r.pageToken,r.count,r.order?1:0,r.filterRobotType,(function(e,t,r,o){if(e===Re.SUCCESS){var a=i._convertGroupMemberInfoList(JSON.parse(o));n.ok({totalCount:r||0,data:a,pageToken:t||""})}else n.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n=this;return k(this,(function(i){return[2,(r=no.create(this.logger,"getGroupMembersByIds")).invoke(e,t,(function(e,t,i,o){var a=Jr.from(e).trans((function(){var e=JSON.parse(o);return n._convertGroupMemberInfoList(e)}));r.flush(a)})).result()]}))}))}}),Object.defineProperty(e.prototype,"setGroupMemberInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i;return k(this,(function(o){return[2,(i=no.create(this.logger,"updateGroupMemberInfo")).invoke(e,t,r,n||"",(function(e,t,r,n){e===Re.SUCCESS?i.ok():i.fail(e,{errorKeys:ni(n)})})).result()]}))}))}}),Object.defineProperty(e.prototype,"searchGroupMembers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i=this;return k(this,(function(o){return[2,(n=no.create(this.logger,"getGroupMembersByNickname")).invoke(e,t,r.pageToken,r.count,r.order?1:0,(function(e,t,r,o){if(e===Re.SUCCESS){var a=i._convertGroupMemberInfoList(JSON.parse(o));n.ok({totalCount:r||0,data:a,pageToken:t||""})}else n.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"joinGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return[2,(t=no.create(this.logger,"joinGroup")).invoke(e,(function(e,r,n){e===Re.SUCCESS?t.ok({processCode:r}):t.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"inviteUsersToGroup",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){return[2,(r=no.create(this.logger,"inviteUsersToGroup")).invoke(e,t,(function(e,t,n){e===Re.SUCCESS?r.ok({processCode:t}):r.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"memberInviteResponse",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c;return k(this,(function(l){return t=e.groupId,r=e.inviterId,n=e.optType,i=e.optResult,o=e.joinUserId,a=e.reason,u=(s=1===n?1:0)&&o?o:"",[2,(c=no.create(this.logger,"handleGroupInvite")).invoke(t,u,r,i,s,a||"",(function(e,t,r){var n=Jr.from(e).trans((function(){return{processCode:t}}));c.flush(n)})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i;return k(this,(function(o){return n=e.order?1:0,[2,(i=no.create(this.logger,"getGroupRequests")).invoke(t,r,"",e.pageToken||"",e.count,n,(function(e,t,r,n){if(e===Re.SUCCESS){var o=JSON.parse(n).map((function(e){var t=e.groupId,r=e.joinUser,n=e.approverUser,i=e.inviterUser,o=e.type;return{groupId:t,joinMemberInfo:r,inviterInfo:i,operatorInfo:n,status:e.status,direction:e.direction,type:o,operationTime:e.operateTime,reason:e.remark}}));i.ok({totalCount:r,data:o,pageToken:t})}else i.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroupsByRole",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n,i,o=this;return k(this,(function(a){return r=no.create(this.logger,"getGroups"),n=t.order?1:0,i=e===ne.UNDEF?[1,2,3]:[e],[2,r.invoke(i,t.pageToken,t.count,n,(function(e,t,n,i){if(e===Re.SUCCESS){var a=JSON.parse(i),s=o._convertGroupInfoList(a);r.ok({totalCount:n,data:s,pageToken:t})}else r.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"searchJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n=this;return k(this,(function(i){return[2,(r=no.create(this.logger,"getGroupsByGroupName")).invoke(e,t.pageToken,t.count,t.order?1:0,(function(e,t,i,o){if(e===Re.SUCCESS){var a=JSON.parse(o),s=n._convertGroupInfoList(a);r.ok({totalCount:i,data:s,pageToken:t})}else r.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"getJoinedGroups",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r=this;return k(this,(function(n){return[2,(t=no.create(this.logger,"getGroupsByIds")).invoke(e,(function(e,n,i,o){if(e===Re.SUCCESS){var a=JSON.parse(o),s=r._convertGroupInfoList(a);t.ok(s)}else t.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"setGroupRemark",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){return[2,(r=no.create(this.logger,"updateGroupRemark")).invoke(e,t,t?ae.ADD:ae.REMOVE,(function(e,t){return r.flush(Jr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"setGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n;return k(this,(function(i){return[2,(n=no.create(this.logger,"updateFavoriteMembers",this.logger.createTraceId())).invoke(t,r,e,(function(e,t){return n.flush(Jr.from(e))})).result()]}))}))}}),Object.defineProperty(e.prototype,"getGroupFollows",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return[2,(t=no.create(this.logger,"getGroupFavoriteMembers")).invoke(e,"",1e3,0,(function(e,r,n,i){var o=Jr.from(e).trans((function(){return JSON.parse(i).map((function(e){return{userId:e.userId,time:e.followTime}}))}));t.flush(o)})).result()]}))}))}}),Object.defineProperty(e.prototype,"addFriend",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"addFriend");return n.invoke(e,t,r,(function(e,t,r){e===Re.SUCCESS?n.ok({processCode:t}):n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"deleteFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"removeFriends",this.logger.createTraceId());return r.invoke(e,t,(function(e,t){return r.flush(Jr.from(e))})).result()}}),Object.defineProperty(e.prototype,"acceptFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"acceptFriendRequest",this.logger.createTraceId());return t.invoke(e,"",(function(e,r){return t.flush(Jr.from(e))})).result()}}),Object.defineProperty(e.prototype,"refuseFriendRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"rejectFriendRequest",this.logger.createTraceId());return r.invoke(e,t||"",(function(e,t){return r.flush(Jr.from(e))})).result()}}),Object.defineProperty(e.prototype,"setFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"setFriendInfo"),i=ei(r);return n.invoke(e,t,JSON.stringify(i),(function(e,t,r,i){e===Re.SUCCESS?n.ok():n.fail(e,{errorKeys:ni(i)})})).result()}}),Object.defineProperty(e.prototype,"checkFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){switch(n.label){case 0:return[4,(r=no.create(this.logger,"checkFriendRelationship")).invoke(e,t,(function(e,t){e===Re.SUCCESS?r.ok(t):r.fail(e)})).result()];case 1:return[2,n.sent().trans((function(e){return JSON.parse(e).map((function(e){return{userId:e.userId,relationType:e.status}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getFriends",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var t,r=this;return k(this,(function(n){switch(n.label){case 0:return[4,(t=no.create(this.logger,"getFriends",this.logger.createTraceId())).invoke(e,0,(function(e,r){e===Re.SUCCESS?t.ok(r):t.fail(e)})).result()];case 1:return[2,n.sent().trans((function(e){var t=JSON.parse(e);return{data:r._convertFriendInfo(t),pageToken:""}}))]}}))}))}}),Object.defineProperty(e.prototype,"getFriendApplications",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"getFriendRequestListByPage",this.logger.createTraceId());return n.invoke([1,2].every((function(e){return t.includes(e)}))?3:t[0],r,e.count,e.pageToken,e.order?1:0,(function(e,t,r){if(e===Re.SUCCESS){var i=JSON.parse(r).map((function(e){return{userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.friendRequestType,applicationStatus:e.friendRequestStatus,operationTime:e.operateTime,extra:e.extra}}));n.ok({pageToken:t,data:i})}else n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"_convertFriendInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.map((function(e){var t=e.userId,r=e.userName,n=e.remark;return{userId:t,name:r,portraitUri:e.portraitUrl,remark:n,directionType:e.friendType,extProfile:e.extProfiles,addTime:e.addTime,inBlackList:!!e.friendAttribute}}))}}),Object.defineProperty(e.prototype,"getFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=no.create(this.logger,"getFriendByIds");return r.invoke(e,(function(e,n){if(e===Re.SUCCESS){var i=JSON.parse(n),o=t._convertFriendInfo(i);r.ok(o)}else r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"searchFriendsInfo",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=no.create(this.logger,"getFriendByNickname");return r.invoke(e,(function(e,n){if(e===Re.SUCCESS){var i=JSON.parse(n),o=t._convertFriendInfo(i);r.ok(o)}else r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"setFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"setFriendAuthPermission");return t.invoke(e,(function(e){e!==Re.SUCCESS?t.fail(e):t.ok()})).result()}}),Object.defineProperty(e.prototype,"getFriendAddPermission",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=no.create(this.logger,"getFriendAuthPermission");return e.invoke((function(t,r){t!==Re.SUCCESS?e.fail(t):e.ok(r)})).result()}}),Object.defineProperty(e.prototype,"setNotificationQuietHoursWithSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.startTime,r=e.spanMinutes,n=e.level,i=e.timezone,o=no.create(this.logger,"addPushSetting");return o.invoke(t,r,n,i||"",(function(){return o.ok()}),(function(e){return o.fail(e)})).result()}}),Object.defineProperty(e.prototype,"removeNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=no.create(this.logger,"removePushSetting");return e.invoke((function(){return e.ok()}),(function(t){return e.fail(t)})).result()}}),Object.defineProperty(e.prototype,"getNotificationQuietHoursSetting",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=no.create(this.logger,"queryPushSetting");return e.invoke((function(t,r,n,i){var o={startTime:t,spanMinutes:r,level:n,timezone:i};e.ok(o)}),(function(t){return e.fail(t)})).result()}}),Object.defineProperty(e.prototype,"setDataBaseLogConfig",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._callCppProxy("setDataBaseLogConfig",e)}}),Object.defineProperty(e.prototype,"getStatsUrlList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){return k(this,(function(e){return[2,xr(vn.getStatsUrlList(this.getNaviInfoFromCache()))]}))}))}}),Object.defineProperty(e.prototype,"sendReadReceiptResponseV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"sendReadReceiptByReadReceiptType");return r.invoke(e.conversationType,e.targetId,e.channelId||"",Qn,t,(function(e,t,n){e!==Re.SUCCESS?r.fail(e):r.ok()})).result()}}),Object.defineProperty(e.prototype,"getMessageReadReceiptInfoV5ByIdentifiers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r;return k(this,(function(n){switch(n.label){case 0:return t=e.map((function(e){var t=e.identifier,r=e.messageUId;return{conIdentifier:{type:t.conversationType,targetId:t.targetId,channelId:t.channelId||""},uid:r}})),[4,(r=no.create(this.logger,"getReadReceiptCount")).invoke(JSON.stringify(t),(function(e,t){e!==Re.SUCCESS?r.fail(e):r.ok(t)})).result()];case 1:return[2,n.sent().trans((function(e){return JSON.parse(e).map((function(e){return{identifier:{conversationType:e.conIdentifier.type,targetId:e.conIdentifier.targetId,channelId:e.conIdentifier.channelId},messageUId:e.msgUid,readCount:e.readCount,unreadCount:e.unreadCount,totalCount:e.totalCount}}))}))]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptUsersByPageV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"getReadReceiptUsersByUid");return n.invoke(e.conversationType,e.targetId,e.channelId||"",t,r.pageToken||"",!r.readStatus,r.pageCount,0===r.order,(function(e,t,r,i){if(e===Re.SUCCESS){var o={pageToken:t,totalCount:i,users:JSON.parse(r).map((function(e){return JSON.parse(e)})).map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}}))};n.ok(o)}else n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getMessagesReadReceiptByUsersV5",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"getReadReceiptStatusForUsersInMessage");return n.invoke(e.conversationType,e.targetId,e.channelId||"",t,r,(function(e,t,r,i){if(e===Re.SUCCESS){var o=JSON.parse(r).map((function(e){return JSON.parse(e)})).map((function(e){return{userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned}}));n.ok({pageToken:"",totalCount:0,users:o})}else n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"requestSpeechToTextForMessage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n=this;return k(this,(function(i){return t=function(t,r){var i=JSON.parse(r),o={status:i.status,text:i.text,isVisible:i.visible};setImmediate((function(){n._dispatchEvent("speechToTextResponse",{code:t,messageUId:e,sttInfo:o})}))},[2,(r=zi(this.logger,!0,"speechToText",e,t))===Re.SUCCESS?xr():Wr(r)]}))}))}}),Object.defineProperty(e.prototype,"setMessageSpeechToTextVisible",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){return[2,(r=zi(this.logger,!0,"updateSpeechToTextVisible",e,t))===Re.SUCCESS?xr():Wr(r)]}))}))}}),Object.defineProperty(e.prototype,"setTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"setPushSetting");return t.invoke(Zn,e,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getTranslationLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e;return k(this,(function(t){return e=zi(this.logger,!0,"getPushSetting",Zn),[2,xr(e)]}))}))}}),Object.defineProperty(e.prototype,"setAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"setPushSetting");return t.invoke(qn,e?"1":"0",(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getAutoTranslateEnabled",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e;return k(this,(function(t){return e=zi(this.logger,!0,"getPushSetting",qn),[2,xr("1"===e)]}))}))}}),Object.defineProperty(e.prototype,"translateWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return G(this,void 0,void 0,(function(){var i,o,a;return k(this,(function(s){return i=zi(this.logger,!0,"getPushSetting",Zn)||"zh",o=no.create(this.logger,"translateMessages"),a=e.map((function(e){return{messageRecognitionIdentifier:{messageUid:e.identifier,customText:0===n?"":e.content,inputSource:n},sourceLanguage:e.sourceLanguage,targetLanguage:e.targetLanguage||i}})),[2,o.invoke(a,{forceRetranslate:r,translationServiceType:t},(function(e){e!==Re.SUCCESS?o.fail(e):o.ok()})).result()]}))}))}}),Object.defineProperty(e.prototype,"modifyMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=JSON.stringify(e.messageContent),r=no.create(this.logger,"editMessage",this.logger.createTraceId());return r.asyncInvoke((function(){return r.ok()}),(function(e){return r.fail(e)}),e.messageUId,t).result()}}),Object.defineProperty(e.prototype,"refreshReferenceMessageWithParams",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this,o=no.create(this.logger,"getQuotingMessageByUId");return o.asyncInvoke(t.conversationType,t.targetId,t.channelId||"",e,(function(e){o.fail(e)}),(function(e){o.ok(),setTimeout((function(){return J(i,oo,"m",Bo).call(i,e,n)}),0)}),(function(e){o.ok(),setTimeout((function(){return J(i,oo,"m",Bo).call(i,e,r)}),0)})).result()}}),Object.defineProperty(e.prototype,"syncRemoteConversations",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e;return k(this,(function(t){return[2,(e=zi(this.logger,!0,"getRemoteConversations"))===Re.SUCCESS?xr():Wr(e)]}))}))}}),Object.defineProperty(e.prototype,"sendUltraGroupTypingStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"sendUGOperateStatus",this.logger.createTraceId());return t.asyncInvoke(e.targetId,0,e.channelId,(function(){return t.ok()}),(function(e){return t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUltraGroupList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i,o=this;return k(this,(function(a){return t=null==e?void 0:e.targetId,r=null==e?void 0:e.channelType,n=zi(this.logger,!1,"getUGConversationListForAllChannel"),i=JSON.parse(n).list.map((function(e){var t=e.obj,r=JSON.parse(t);return J(o,oo,"m",go).call(o,r)})).filter((function(e){return!("string"==typeof t&&t!==e.targetId||"number"==typeof r&&r!==e.channelType)})).sort((function(e,t){var r,n,i=(null===(r=e.latestMessage)||void 0===r?void 0:r.sentTime)||0;return((null===(n=t.latestMessage)||void 0===n?void 0:n.sentTime)||0)-i})),[2,xr(i)]}))}))}}),Object.defineProperty(e.prototype,"getRemoteMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n,i,o,a=this;return k(this,(function(s){switch(s.label){case 0:return r=no.create(this.logger,"getRemoteMessageByUids",this.logger.createTraceId()),n=e.targetId,i=e.conversationType,o=e.channelId,[4,r.asyncInvoke(n,i,t.map((function(e){return{messageUId:e,channelId:o||"",sentTime:0}})),(function(e){return r.ok(e)}),(function(e){return r.fail(e)})).result()];case 1:return[2,s.sent().trans((function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t);return J(a,oo,"m",Eo).call(a,r)}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadMentionedDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i,o;return k(this,(function(a){switch(a.label){case 0:return t=no.create(this.logger,"getUltraGroupUnreadMentionedDigest",this.logger.createTraceId()),r=e.targetId,n=e.channelId,i=e.sentTime,o=e.count,[4,t.asyncInvoke(r,n||"",i,o,(function(e){return t.ok(e)}),(function(e){return t.fail(e)})).result()];case 1:return[2,a.sent().trans((function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t);return{messageUId:r.msgUId,messageType:r.objectName,sentTime:r.sentTime,mentionedType:r.isMentionedAll?it.ALL:it.SINGAL}}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"deleteLocalUGMessagesForAllChannel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){return k(this,(function(r){return zi(this.logger,!1,"clearUGMessageByTimestamp",e,t,!1),[2,xr()]}))}))}}),Object.defineProperty(e.prototype,"updateUGMessageExpansion",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"updateUGMessageExpansion",this.logger.createTraceId());return n.asyncInvoke(e.targetId,t.mid,r,JSON.stringify(t),e.channelId,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"setUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=no.create(this.logger,"setDefaultBlockPushLevel",this.logger.createTraceId());return n.asyncInvoke(e,r||"",ve.ULTRA_GROUP,t,(function(){return n.ok()}),(function(e){return n.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUGDefaultNotificationLevel",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=no.create(this.logger,"getDefaultBlockPushLevel",this.logger.createTraceId());return r.asyncInvoke(e,t||"",ve.ULTRA_GROUP,(function(e){return r.ok(e)}),(function(e){return r.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getUGUnreadCountForAllChannels",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i;return k(this,(function(o){return t.length>0?(n=zi(this.logger,!0,r?"getUltraGroupUnreadMentionedCount":"getUltraGroupUnreadCount",e,t),[2,xr(n)]):(i=zi(this.logger,!0,r?"getUGMentionCount":"getUGUnreadCount",e),[2,xr(i)])}))}))}}),Object.defineProperty(e.prototype,"getUGUnreadInfoList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r;return k(this,(function(n){return t=zi(this.logger,!1,"getInfoForConversations",e),r=JSON.parse(t).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.targetId,i=r.conversationType,o=r.channelId,a=r.unreadCount;return{targetId:n,conversationType:i,channelId:o,unreadCount:a,mentionedCount:r.mentionCount,mentionedMeCount:r.mentionMeCount,notificationLevel:r.blockStatus,type:ve.ULTRA_GROUP,unreadMessageCount:a}})),[2,xr(r)]}))}))}}),Object.defineProperty(e.prototype,"getUGFirstUnreadMessageDigest",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return(t=J(this,oo,"m",Lo).call(this,e))?[2,xr({sentTime:t.sentTime,messageType:t.messageType,messageUId:t.messageUId})]:[2,Wr(Re.RC_DB_DATA_NOT_FOUND)]}))}))}}),Object.defineProperty(e.prototype,"getBlockedUGList",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){return k(this,(function(e){return[2,J(this,oo,"m",Jo).call(this,[{conversationType:ve.ULTRA_GROUP,channelIdValid:!1}])]}))}))}}),Object.defineProperty(e.prototype,"getBlockedConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n=this;return k(this,(function(i){return t=_t(e?st:ot),r=t.map((function(e){return{conversationType:e,channelId:e===ve.ULTRA_GROUP?J(n,oo,"m",So).call(n,""):"",channelIdValid:e===ve.ULTRA_GROUP}})),[2,J(this,oo,"m",Jo).call(this,r).trans((function(e){return e.reverse()}))]}))}))}}),Object.defineProperty(e.prototype,"getSubscribeUsersOnlineStatus",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){return k(this,(function(t){switch(t.label){case 0:return[4,J(this,oo,"m",xo).call(this,[Nt.ONLINE_STATUS,Nt.FRIEND_ONLINE_STATUS],e)];case 1:return[2,t.sent().trans((function(e){var t=JSON.parse(e).list.map((function(e){var t,r=e.obj,n=JSON.parse(r),i=n.userId,o=n.details,a=(void 0===o?[]:o).map((function(e){var t=JSON.parse(e),r=t.changeTime,n=t.changeValue;return{platform:t.platform,isOnline:!!n,updateTime:r}})),s=a.some((function(e){return e.isOnline}));return t={userId:i,isOnline:s,details:a},[Tt.iOS,Tt.Android,Tt.Web,Tt.PC,Tt.Mini,Tt.HarmonyOS].forEach((function(e){t.details.some((function(t){return t.platform===e}))||t.details.push({platform:e,isOnline:!1,updateTime:0})})),t}));return t}))]}}))}))}}),Object.defineProperty(e.prototype,"saveEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){return[2,(r=zi(this.logger,!1,"saveEditedMessageDraft",$o(t),e.messageUId,e.content))===Re.SUCCESS?xr():Wr(r)]}))}))}}),Object.defineProperty(e.prototype,"getEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i,o;return k(this,(function(a){return t=zi(this.logger,!1,"getConversationMetadata",$o(e)),(r=t.find((function(e){return"edited_message_draft"===e.key})))?(n=JSON.parse(r.value),i=n.msg_uid,o=n.content,[2,xr({messageUId:i,content:o})]):[2,xr(null)]}))}))}}),Object.defineProperty(e.prototype,"clearEditedMessageDraft",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t;return k(this,(function(r){return[2,(t=zi(this.logger,!1,"removeConversationMetadata",$o(e),["edited_message_draft"]))===Re.SUCCESS?xr():Wr(t)]}))}))}}),Object.defineProperty(e.prototype,"getUnreadMentionMeConversationList",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var t,r,n,i,o,a,s,u,c,l=this;return k(this,(function(d){return t=e.timestamp,r=e.count,n=e.conversationTypes,i=n.map((function(e){return{conversationType:e,channelId:e===ve.ULTRA_GROUP?"RCDefault":"",channelIdValid:e===ve.ULTRA_GROUP}})),o=zi(this.logger,!1,"getUnreadMentionMeConversationsByPageWithTopPriority",i,t,r,!!e.topPriority),a=JSON.parse(o),s=a.code,u=a.list,s!==Re.SUCCESS?[2,Wr(s)]:(c=u.map((function(e){return l._buildConversation(e.obj)})),[2,xr(c)])}))}))}}),Object.defineProperty(e.prototype,"getAllRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(){return G(this,void 0,void 0,(function(){var e,t=this;return k(this,(function(r){return[2,(e=no.create(this.logger,"getAllRobots")).asyncInvoke((function(r,n){var i=J(t,oo,"m",Wo).call(t,n);r!==Re.SUCCESS?e.fail(r,i):e.ok(i)})).result()]}))}))}}),Object.defineProperty(e.prototype,"getConversationsIncludingRobots",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i,o,a=this;return k(this,(function(s){return t=e.conversationTypes,r=e.count,n=e.timestamp,i=e.topPriority,[2,(o=no.create(this.logger,"getConversationsIncludingRobots")).invoke(t.map((function(e){return{conversationType:e,channelId:"",targetId:"",channelIdValid:!1}})),n,r,i,(function(e,t){e!==Re.SUCCESS?o.fail(e):o.flush(J(a,oo,"m",ho).call(a,t,"getConversationsIncludingRobots"))})).result()]}))}))}}),Object.defineProperty(e.prototype,"markRemoteConversationAsRead",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return G(this,void 0,void 0,(function(){var n,i;return k(this,(function(o){switch(o.label){case 0:return[4,this.sendMessage(e,t,r)];case 1:return(n=o.sent()).isOk&&(i=n.data.sentTime,this._clearUnreadCountByTimestamp(e,i)),[2,n.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessagesByUIds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return G(this,void 0,void 0,(function(){var r,n=this;return k(this,(function(i){return[2,(r=no.create(this.logger,"getMessagesByUIds")).invoke({conversationQueryParam:V(V({},$o(e)),{channelIdValid:"string"==typeof e.channelId}),messageUIds:t,enableRemoteQuery:!0},(function(e){var t=JSON.parse(e).list.map((function(e){var t=e.message,r=e.messageUId,i=e.code;return{messageUId:r,message:t?J(n,oo,"m",Eo).call(n,t):void 0,code:i}}));r.ok(t)}),(function(e){r.fail(e)})).result()]}))}))}}),Object.defineProperty(e.prototype,"_trans2ICppUpdateMessageReactionParam",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r=e.messageUId,n=e.reactionId,i=e.pushConfig;return{messageUId:r,reactionId:n,pushConfig:{forceShowDetail:(null==i?void 0:i.forceShowDetailContent)||!1,templateId:(null==i?void 0:i.templateId)||"",content:(null==i?void 0:i.pushContent)||"",disableTitle:(null==i?void 0:i.disablePushTitle)||!1,id:(null===(t=null==i?void 0:i.androidConfig)||void 0===t?void 0:t.notificationId)||"",data:(null==i?void 0:i.pushData)||"",config:wr(null==i?void 0:i.iOSConfig,null==i?void 0:i.androidConfig,null==i?void 0:i.harmonyOSConfig),title:(null==i?void 0:i.pushTitle)||""}}}}),Object.defineProperty(e.prototype,"addMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"addMessageReaction"),r=this._trans2ICppUpdateMessageReactionParam(e);return t.invoke(r,(function(e){return t.flush(Jr.from(e))})).result()}}),Object.defineProperty(e.prototype,"removeMessageReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"removeMessageReaction"),r=this._trans2ICppUpdateMessageReactionParam(e);return t.invoke(r,(function(e){return t.flush(Jr.from(e))})).result()}}),Object.defineProperty(e.prototype,"_trans2CppConversationQueryParam",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return{conversationType:t,targetId:r,channelId:t===ve.ULTRA_GROUP?J(this,oo,"m",So).call(this,n):n,channelIdValid:"string"==typeof n}}}),Object.defineProperty(e.prototype,"batchGetMessageReactionSummaries",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return G(this,void 0,void 0,(function(){var t,r,n,i,o,a;return k(this,(function(s){switch(s.label){case 0:return t=no.create(this.logger,"batchGetMessageReactionSummaries"),r=e.conversationIdentifier,n=e.messageUIds,i={messageUIds:n,conversationQueryParam:this._trans2CppConversationQueryParam(r)},[4,t.invoke(i,(function(e,r){return t.flush(Jr.from(e,"",r))})).result()];case 1:return(o=s.sent()).isOk?(a=JSON.parse(o.data),[2,xr(a)]):[2,o.wipe()]}}))}))}}),Object.defineProperty(e.prototype,"getMessageReactions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"getMessageReactions"),r=e.pageToken,n={messageUId:e.messageUId,count:e.count,pageToken:r||""};return t.invoke(n,(function(e,r,n){if(e===Re.SUCCESS){var i={pageToken:n,reactions:JSON.parse(r)};t.ok(i)}else t.fail(e)})).result()}}),Object.defineProperty(e.prototype,"getMessageReactionUsers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=no.create(this.logger,"getReactionUsers"),r=e.pageToken,n=e.reactionId,i=e.count,o={messageUId:e.messageUId,reactionId:n,count:i,pageToken:r||""};return t.invoke(o,(function(e,r,n,i){if(e===Re.SUCCESS){var o={totalCount:n,pageToken:i,users:JSON.parse(r)};t.ok(o)}else t.fail(e)})).result()}}),e}();oo=new WeakSet,ao=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj;return JSON.parse(t)})),r=[],n=[],i=[];t.forEach((function(e){var t=e.changeTime,o=e.changeType,a=e.channelId,s=e.channelType,u=e.targetId,c=e.userId;switch(o){case ht.CHANNEL_DELETE:n.push({targetId:u,channelId:a,channelType:s,deleteTime:t});break;case ht.PUBLIC_TO_PRIVATE:r.push({targetId:u,channelId:a,changeType:Et.PUBLIC_TO_PRIVATE,channelType:pt.PRIVATE});break;case ht.PRIVATE_TO_PUBLIC:r.push({targetId:u,channelId:a,changeType:Et.PRIVATE_TO_PUBLIC,channelType:pt.PUBLIC});break;case ht.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:break;case ht.CHANNEL_USER_KICKED:i.push({targetId:u,channelId:a,userId:c,channelType:s});break;case ht.PUBLIC_TO_PRIVATE_USER_NOT_IN:r.push({targetId:u,channelId:a,changeType:Et.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:s})}})),r.length>0&&this._dispatchEvent("ultraGroupChannelChangeType",r),n.length>0&&this._dispatchEvent("ultraGroupChannelDelete",n),i.length>0&&this._dispatchEvent("ultraGroupChannelUserKicked",i)},so=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj;return JSON.parse(t)})),r=[],n=[],i=[],o=[],a=[],s=ve.ULTRA_GROUP;t.forEach((function(e){var t=e.targetId,u=e.userGroupId,c=e.eventType,l=e.channelId,d=e.channelType;switch(c){case bt.REMOVE_USER_GROUP:r.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case bt.JOIN_USER_GROUP:n.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case bt.EXIT_USER_GROUP:i.push({conversation:{conversationType:s,targetId:t},userGroupIds:u});break;case bt.CHANNEL_BIND_USER_GROUP:o.push({conversation:{conversationType:s,targetId:t,channelId:l},channelType:d,userGroupIds:u});break;case bt.CHANNEL_UNBIND_USER_GROUP:a.push({conversation:{conversationType:s,targetId:t,channelId:l},channelType:d,userGroupIds:u})}}));var u={};r.length>0&&(u.userGroupDisband=r),n.length>0&&(u.userAdded=n),i.length>0&&(u.userRemoved=i),o.length>0&&(u.userGroupBindChannel=o),a.length>0&&(u.userGroupUnBindChannel=a),this._dispatchEvent("userGroupStatus",u)},uo=function(e,t,r){return G(this,void 0,void 0,(function(){var n,i;return k(this,(function(o){switch(o.label){case 0:return[4,this.getConversation({conversationType:ve.ULTRA_GROUP,targetId:e,channelId:t})];case 1:return n=o.sent(),i=n.data,this._dispatchEvent("conversation",[{conversation:i,updatedItems:{unreadMessageCount:{val:i.unreadMessageCount,time:r}}}]),[2]}}))}))},co=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.channelId,i=r.operateTime;return{channelId:n,operationType:r.operateType,operationTime:i,targetId:r.targetId,userId:r.userId}}));this._dispatchEvent("operateStatus",{conversationType:ve.ULTRA_GROUP,info:t,hasInfo:!0,hasSummary:!1,summary:[]})},lo=function(e){var t=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t);return{targetId:r.targetId,channelId:r.channelId,count:r.userNum,operationType:r.operateType}}));this._dispatchEvent("operateStatus",{conversationType:ve.ULTRA_GROUP,info:[],hasInfo:!1,hasSummary:!0,summary:t})},fo=function(e){var t=this,r=JSON.parse(e).list.map((function(e){var r=e.obj;return t._buildMessage(r)}));this._dispatchEvent("ultraGroupMessageExpansionUpdated",r)},_o=function(e){var t=this,r=JSON.parse(e).list.map((function(e){var r=e.obj;return t._buildMessage(r)}));this._dispatchEvent("messagesModified",r)},po=function(e){var t=this,r=JSON.parse(e).list.map((function(e){var t=e.obj,r=JSON.parse(t),n=r.channelId,i=r.conversationType,o=r.isAdmin,a=r.isDel;r.mentionType;var s=r.msgUId,u=r.operatorId,c=r.sentTime,l=r.targetId;return{targetId:l,conversationType:i,sentTime:c,messageUId:s,senderUserId:u,channelId:n,content:{conversationType:i,targetId:l,channelId:n,isAdmin:o,isDelete:a,sentTime:c,messageUId:s},messageDirection:1,messageType:Ht,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:rr.UNREAD,receivedStatusInfo:yr(rr.UNREAD)}}));r.length>0&&(r.slice().forEach((function(e){return J(t,oo,"m",Oo).call(t,e,"ugRecall")})),this._dispatchEvent("ultraGroupMessageRecalled",r))},Eo=function(e,t){var r=e.channelId,n=e.senderUserId,i=e.content,o=e.objectName,a=e.direction,s=e.status,u=e.messageId,c=e.sentTime,l=e.readReceiptRequest,d=e.supportExt,f=e.pushContent,_=e.pushTitle,p=e.pushId,E=e.pushConfig,g=e.templateId,h=e.disableTitle,b=e.forcePushDetail,R=e.hasMore,v=e.directedUsers,I=e.noNotification,O=e.disableUpdateLastMessage,T=e.needReceipt,N=e.sendReceipt,m=e.contentRecognition,C=e.convertExt,S=e.editTime,y=e.editContent,A=e.editStatus,P=e.quotedMsgStatus,L=e.hasChanged,M=e.quoteInfo,U=e.hasReactions,D=e.conversationType,w=e.targetId,j=e.messageUid,G=this._parseMessageJsonContent(i,u),k=!!G.mentionedInfo;if(o===Ht&&n===this.tcpMgr.getCurrentUserId()&&(D=G.conversationType,w=G.targetId,j=G.messageUId),C){var F=JSON.parse(C);if(F.trans){var H=F.trans,B={targetLanguage:H.targetLanguage,translatedText:H.translatedText,status:H.translateStatus};G.translateInfo=B}}if(o===jt||o===Vt){var J=m?JSON.parse(m):{status:pr,text:"",visible:!1},x={status:J.status,text:J.text,isVisible:J.visible};G.sttInfo=x}var W,Y=function(e){return xn.get(e)}(o)||{isPersited:!1,isCounted:!1,isStatusMessage:!1},K=this._buildSupportExt(d,e),X=void 0===(W=t)||"[object Undefined]"===Object.prototype.toString.call(W)?c<this.tcpMgr.getConnectedTime():t,Q={};E&&(Q=function(e,t){var r={},n={notificationId:t||""},i={};if(!e)return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i};try{var o=JSON.parse(e);null==o||o.forEach((function(e){var t,o,a,s,u,c,l,d,f,_,p,E,g=Object.keys(e);if(0!==g.length){var h=g[0];switch(h){case"HW":return n.channelIdHW=null===(t=e[h])||void 0===t?void 0:t.channelId,n.importanceHW=null===(o=e[h])||void 0===o?void 0:o.importance,n.imageUrlHW=null===(a=e[h])||void 0===a?void 0:a.image,void(n.categoryHW=null===(s=e[h])||void 0===s?void 0:s.category);case"MI":return void(n.channelIdMi=null===(u=e[h])||void 0===u?void 0:u.channelId);case"OPPO":return void(n.channelIdOPPO=null===(c=e[h])||void 0===c?void 0:c.channelId);case"VIVO":return n.typeVivo=null===(l=e[h])||void 0===l?void 0:l.classification,void(n.categoryVivo=null===(d=e[h])||void 0===d?void 0:d.category);case"APNS":return r.threadId=e[h]["thread-id"],r.apnsCollapseId=e[h]["apns-collapse-id"],r.category=e[h].category,r.richMediaUri=e[h].richMediaUri,void(r.interruptionLevel=e[h]["interruption-level"]);case"FCM":return void(n.googleConfig={collapseKey:e[h].collapse_key||"",imageUrl:e[h].imageUrl||"",priority:e[h].priority||""});case"HONOR":return n.importanceHonor=null===(f=e[h])||void 0===f?void 0:f.importance,void(n.imageUrlHonor=null===(_=e[h])||void 0===_?void 0:_.image);case"OHOS":i.category=null===(p=e[h])||void 0===p?void 0:p.category,i.image=null===(E=e[h])||void 0===E?void 0:E.image}}}))}catch(e){}return{iOSConfig:r,androidConfig:n,harmonyOSConfig:i}}(E,p));var Z=V(V({},Q),{pushTitle:_,pushContent:f,pushData:f,disablePushTitle:h,forceShowDetailContent:b,templateId:g}),q={channelId:r,conversationType:D,targetId:w,senderUserId:n,content:G||{},messageType:o,messageUId:j||"",messageDirection:a,isOffLineMessage:X,sentTime:c,receivedTime:0,isPersited:Y.isPersited,isCounted:Y.isCounted,isMentioned:k,disableNotification:I,isStatusMessage:Y.isStatusMessage||!1,canIncludeExpansion:d,expansion:d?K:null,receivedStatus:0,receivedStatusInfo:void 0,sentStatus:void 0,messageId:u,pushConfig:Z,hasMore:R,directedUserIds:v||[],disableUpdateLastMessage:O,needReceipt:T,sendReceipt:N,hasReactions:U};if(M&&(q.quoteInfo=M),a===Pt.RECEIVE?(q.receivedStatus=s,q.receivedStatusInfo=yr(s)):q.sentStatus=s,l){var z=this._handleReadReceiptRequest(l);q.readReceiptInfo=z}return D===ve.ULTRA_GROUP?q.isModifyMessage=!!L:(q.isModifyMessage=!(!S&&!A),q.isModifyMessage&&(q.modifyInfo={timestamp:S,content:y?JSON.parse(y):{},status:A})),o===Ft&&(q.content.referMsgStatus=P),q},go=function(e){var t=e.channelId,r=e.conversationType,n=e.targetId,i=e.lastestMsg,o=e.isTop,a=e.blockStatus,s=e.matchCount,u=e.hasUnreadMention,c=e.unreadCount,l=e.mentionCount,d=e.mentionMeCount,f=e.conversationTime,_=e.draft,p=e.translateStrategy,E=e.channelType,g=e.metadata,h=e.includeRobot,b=e.entrustInfo,R=-1===JSON.parse(i).messageId?null:this._buildMessage(i),v=g?JSON.parse(g):{},I=v.edited_message_draft?JSON.parse(v.edited_message_draft):void 0,O=JSON.parse(b),T={name:O.name,portraitUri:O.portraitUrl};return{channelId:t,conversationType:r,targetId:n,channelType:E,unreadMessageCount:c,unreadMentionedCount:l,unreadMentionedMeCount:d,hasMentioned:u,latestMessage:R,notificationStatus:dr(a),isTop:o,lastUnreadTime:0,matchCount:s,operationTime:f,notificationLevel:a,draft:_,translateStrategy:p,editedMessageDraft:I?{messageUId:I.msg_uid,content:I.content}:void 0,includeRobot:!!h,dataMgmtInfo:T}},ho=function(e,t){var r=this;try{var n=JSON.parse(e).list.map((function(e){return r._buildConversation(e.obj)}));return xr(n)}catch(e){var i="parse conversation list result error, method: ".concat(t);return Wr(Re.MAIN_PROCESS_ERROR,i)}},bo=function(e){var t,r=e.messageType,n=e.targetId;if(r===qt){var i=function(e){var t={},r=[],n=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((function(e){t[e.userId]=e.status,r.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:n,userList:r}}(e);return this._sendChatroomEvents({userChange:i}),!1}if(r===zt){var o=function(e){var t=e.content;return{chatroomId:t.chatroomId,status:t.status,reason:t.reason,time:t.time,extra:t.extra||""}}(e);return this._sendChatroomEvents({chatroomNotifyMultiLoginSync:o}),!1}if(r===$t){var a=function(e){var t=e.content;return{chatroomId:t.chatroomId,operateType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return a.operateType===be.Blocked&&(null===(t=null==a?void 0:a.userIdList)||void 0===t?void 0:t.includes(this.tcpMgr.getCurrentUserId()))&&this._chatroomCache.delete(n),this._sendChatroomEvents({chatroomNotifyBlock:a}),!1}if(r===er){var s=function(e){var t=e.content;return{chatroomId:t.chatroomId,banType:t.operateType,durationTime:t.durationTime,operateTime:t.operateTime,userIdList:t.userList,extra:t.extra||""}}(e);return this._sendChatroomEvents({chatroomNotifyBan:s}),!1}return!0},Ro=function(e){var t=JSON.parse(e),r=J(this,oo,"m",Eo).call(this,t,!1),n=r.messageType,i=r.conversationType;if(n!==Ht||i!==ve.ULTRA_GROUP){if(this._lowPriorityMessageHandler.isLowPriorityMessage(n)){var o=this.tcpMgr.getCurrentUserId();return this._lowPriorityMessageHandler.push(r,o),void this._handleLowPriorityMessages(o,this.tcpMgr.getConnectedTime())}this._handleHighPriorityMessages([r],!1)}},vo=function(e,t){var r=this,n=this.tcpMgr.getConnectedTime(),i=this.tcpMgr.getCurrentUserId(),o=[],a=[];JSON.parse(e).list.forEach((function(e){var t=JSON.parse(e.obj),s=t.sentTime<n,u=J(r,oo,"m",Eo).call(r,t,s),c=u.messageType;r._lowPriorityMessageHandler.isLowPriorityMessage(c)?r._lowPriorityMessageHandler.push(u,i):s?o.push(u):a.push(u)})),o.length>0&&this._handleHighPriorityMessages(o,!!t);var s=!1;(!t||a.length>0)&&!this._pullOfflineMessageFinished&&(s=this._pullOfflineMessageFinished=!0),a.length>0&&this._handleHighPriorityMessages(a,!!t),(this._pullOfflineMessageFinished||this._lowPriorityMessageHandler.count>=1e4)&&this._handleLowPriorityMessages(i,n),s&&this._sendPullOfflineFinished()},Io=function(e){0!==e.length&&zi(this.logger,!1,"setExtraMessageInBatches",e)},Oo=function(e,t){var r,n=e.content,i=n.messageUId,o=n.sentTime,a=n.isAdmin,s=n.isDelete,u=n.extra,c=this.logger.createTraceId();if(this.logger.info(Kn.L_HADNLE_RECALL_CMD_T,JSON.stringify({recalledMessageUId:i,isDelete:s,source:t}),c),"number"!=typeof o||"string"!=typeof i||!i.length)return this.logger.warn(Kn.L_HADNLE_RECALL_CMD_R,"Invalid message",c),!1;var l=J(this,oo,"m",Vo).call(this,i);if(!l.isOk)return this.logger.info(Kn.L_HADNLE_RECALL_CMD_R,"Msg Not Found",c),!1;var d=l.data;if(s)return J(this,oo,"m",Do).call(this,[d.messageId],o),this.logger.info(Kn.L_HADNLE_RECALL_CMD_R,"Delete Msg, messageId: ".concat(d.messageId),c),!0;if(d.messageType===Bt)return this.logger.info(Kn.L_HADNLE_RECALL_CMD_R,"Msg has been processed",c),!1;(null===(r=d.receivedStatusInfo)||void 0===r?void 0:r.isRead)||J(this,oo,"m",ko).call(this,d.messageId,1,o);var f={operatorId:e.senderUserId,recallTime:d.sentTime,originalObjectName:d.messageType,originalMessageContent:d.content,recallActionTime:e.sentTime,admin:!!a,delete:!!s,isDelete:!!s,extra:u};return e.content.user&&(f.user=e.content.user),e.content.extra&&(f.extra=e.content.extra),d.messageType===wt&&(f.recallContent=d.content.content),J(this,oo,"m",Go).call(this,d.messageId,JSON.stringify(f),Bt),this.logger.info(Kn.L_HADNLE_RECALL_CMD_R,"Replace Msg with RC:RcNtf, messageId: ".concat(d.messageId),c),!0},To=function(e,t){var r=this,n=t.timestamp,i=t.count,o=t.order,a=t.messageType,s=e.conversationType,u=e.targetId,c=e.channelId,l=zi(this.logger,!1,"getHistoryMessages",s,u,n,i+1,a,0===o,c||""),d=JSON.parse(l).list.map((function(e){var t=e.obj;return r._buildMessage(t)})).reverse();return{list:i===d.length-1?d.slice(1):d,hasMore:i<d.length}},No=function(e,t){return G(this,void 0,void 0,(function(){var r,n,i,o,a,s,u,c=this;return k(this,(function(l){switch(l.label){case 0:return r=t.timestamp,n=t.count,i=t.order,o=e.conversationType,a=e.targetId,s=e.channelId,[4,(u=no.create(this.logger,"getRemoteHistoryMessages",this.logger.createTraceId())).asyncInvoke(o,a,r,n,(function(e,t){return u.ok({listJson:e,hasMore:t})}),(function(e){return u.fail(e)}),i,!0,s||"",!0).result()];case 1:return[2,l.sent().trans((function(e){var t=e.listJson,r=e.hasMore,n=JSON.parse(t).list.map((function(e){var t=e.obj;return c._buildMessage(t)}));return 0===i&&n.reverse(),{list:n,hasMore:!!r}}))]}}))}))},mo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;zi(this.logger,!1,"clearMessages",t,r,n||"")},Co=function(e,t,r){zi(this.logger,!1,"deleteChatroomMessageAndKV",e,t,r)},So=function(e){var t;return!!(2&((null===(t=this.getNaviInfoFromCache())||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e||""},yo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=zi(this.logger,!1,"getConversation",t,r,n||"");return i?this._buildConversation(i):null},Ao=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return zi(this.logger,!0,"getUnreadCount",t,r,n||"")},Po=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return zi(this.logger,!1,"clearUnreadCount",t,r,n||"")},Lo=function(e){var t=e.conversationType,r=e.targetId,n=e.channelId,i=zi(this.logger,!0,"getTheFirstUnreadMessage",t,r,n||""),o=this._buildMessage(i);return-1!==o.messageId?o:null},Mo=function(e,t,r,n,i,o){var a=this.logger.createTraceId(),s=no.create(this.logger,"updateConversationStatus",a),u=JSON.stringify(e.map((function(e){return{conversation_query_param:{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId,channel_id_valid:"string"==typeof e.channelId&&e.channelId.length>0},block_op:t,translate_strategy_op:n,top_op:r,create_conversation:!!o,update_time:!!i}})));return s.invoke(u,(function(){return s.ok()}),(function(e){return s.fail(e)})).result()},Uo=function(e,t){var r=e.conversationType,n=e.targetId,i=e.channelId,o=t.content,a=t.senderUserId,s=t.messageType,u=t.messageDirection,c=t.readStatus,l=t.sentStatus,d=t.sentTime,f=t.searchContent,_=t.isUnread,p=t.messageUId,E=t.disableNotification,g=t.canIncludeExpansion,h=t.expansion,b=t.directedUserIds,R=t.disableUpdateLastMessage,v=t.quoteInfo,I=d||0,O={};if(h)for(var T in h)O[T]={v:h[T],ts:I};var N=function(){},m=zi(this.logger,!0,"insertMessage",r,n,a,s,JSON.stringify(o),N,N,u,c||1,l||30,I,f||"",_?0:1,p||"",!!E,!!g,JSON.stringify(O),i||"",b||[],!!R,(null==v?void 0:v.messageUId)||"",(null==v?void 0:v.senderId)||"",(null==v?void 0:v.objectName)||"",(null==v?void 0:v.quoteMessageStatus)||0),C=this._buildMessage(m,!1);return C.messageUId=p,C.sentTime=d,C},Do=function(e,t){void 0===t&&(t=0),zi(this.logger,!1,"deleteMessages",e,t)},wo=function(e,t,r){zi(this.logger,!1,"deleteMessagesByTimestamp",e.conversationType,e.targetId,t,r,e.channelId||"")},jo=function(e){var t=zi(this.logger,!0,"getMessage",e),r=JSON.parse(t);return r.messageId<=0?Wr(Re.RC_DB_DATA_NOT_FOUND,"msg not found: ".concat(e)):xr(r)},Vo=function(e){var t=this;return J(this,oo,"m",jo).call(this,e).trans((function(e){return J(t,oo,"m",Eo).call(t,e,!1)}))},Go=function(e,t,r){return zi(this.logger,!1,"setMessageContent",e,t,r)},ko=function(e,t,r){void 0===r&&(r=0),zi(this.logger,!1,"setMessageReceivedStatus",e,t,r)},Fo=function(e){var t=this,r=e.map((function(e){var t=e.conversationType,r=e.targetId,n=e.channelId;return{targetId:r,channelId:void 0===n?"":n,type:t}})),n=zi(this.logger,!0,"getConversations",JSON.stringify(r));return JSON.parse(n).list.map((function(e){return t._buildConversation(e.obj)}))},Ho=function(e){var t=this,r=[];return e&&e.length>0&&(r=e.map((function(e){var r=JSON.parse(e.obj);return{messageUId:r.msg_uid,message:r.msg?t._buildMessage(r.msg):void 0,code:r.code}}))),r},Bo=function(e,t){try{var r=JSON.parse(e).list;t(J(this,oo,"m",Ho).call(this,r))}catch(t){this.logger.error(Kn.P_PARSE_JSON_MSGS_E,e)}},Jo=function(e){var t=zi(this.logger,!1,"getBlockedConversations",e);return J(this,oo,"m",ho).call(this,t,"getBlockedConversations")},xo=function(e,t){return G(this,void 0,void 0,(function(){var r;return k(this,(function(n){return[2,(r=no.create(this.logger,"getSubscribeStatusByUserIds",this.logger.createTraceId())).invoke(e,t,(function(e,t){e!==Re.SUCCESS?r.fail(e):r.ok(t)})).result()]}))}))},Wo=function(e){return JSON.parse(e).list.map((function(e){var t=JSON.parse(e);return{robotId:t.robotId,name:t.robotName,portraitUri:t.robotPortrait,robotType:t.robotType,metadata:t.metadata?JSON.parse(t.metadata):{},createTime:t.createTime,updateTime:t.updateTime}}))};var na=function(){function e(e){var t=this;Object.defineProperty(this,"_rendererInitOptions",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_senders",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),this._svr=new ra(e,this._send2AllRenderer.bind(this)),this._initIpcEventListeners(),n.on("before-quit",(function(){return t.destroy()})),n.on("window-all-closed",(function(){return t.destroy()}))}return Object.defineProperty(e,"init",{enumerable:!1,configurable:!0,writable:!0,value:function(r){if(J(this,ea,"f",ta))return J(this,ea,"f",ta);if(!r.appkey)throw new Error("Initializ failed, `appkey` is required!");var i={appkey:r.appkey,dbpath:r.dbpath||t(n.getPath("userData")),logOutputLevel:r.logOutputLevel||bn.WARN,enableSyncEmptyTopConversation:!!r.enableSyncEmptyTopConversation,disableLogReport:!!r.disableLogReport,eventLoopBlockingCheck:!!r.eventLoopBlockingCheck,environment:r.environment||"default",reconnectKickEnable:!!r.reconnectKickEnable,runInMainProcess:!!r.runInMainProcess};return x(this,ea,new e(i),"f",ta),J(this,ea,"f",ta)}}),Object.defineProperty(e.prototype,"_initIpcEventListeners",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;r.on("__RC_CHANNEL_CALL_MAIN_SYNC__",(function(t,r){for(var n,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];t.returnValue=(n=e._svr[r]).call.apply(n,B([e._svr],H(i),!1))})),r.on("__RC_CHANNEL_CALL_MAIN__",(function(t,r,n){for(var i=t.sender,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];return G(e,void 0,void 0,(function(){var e,t,a,s,u,c,l,d,f,_,p=this;return k(this,(function(E){switch(E.label){case 0:return this._senders.has(i)?("sendMessage"===n?(t=H(o,4),d=t[0],a=t[1],s=t[2],u=t[3],e=this._svr.sendMessage(d,a,s,(function(e){p._send2Renderer(i,"__RC_CHANNEL_RESULT_FROM_MAIN__",u,e)}))):"refreshReferenceMessageWithParams"===n?(c=H(o,4),l=c[0],d=c[1],f=c[2],_=c[3],e=this._svr.refreshReferenceMessageWithParams(l,d,(function(e){p._send2Renderer(i,"__RC_CHANNEL_RESULT_FROM_MAIN__",f,e)}),(function(e){p._send2Renderer(i,"__RC_CHANNEL_RESULT_FROM_MAIN__",_,e)}))):e=this._svr[n].apply(this._svr,o),e instanceof Promise?[4,e]:[3,2]):(this._send2Renderer(i,"__RC_CHANNEL_RESULT_FROM_MAIN__",r,Wr(Re.BIZ_ERROR_CLIENT_NOT_INIT)),[2]);case 1:e=E.sent(),E.label=2;case 2:return this._send2Renderer(i,"__RC_CHANNEL_RESULT_FROM_MAIN__",r,e),[2]}}))}))})),r.on("__RC_CHANNEL_SEND_2_MAIN__",(function(t,r){for(var n=t.sender,i=[],o=2;o<arguments.length;o++)i[o-2]=arguments[o];e._senders.has(n)&&e._svr[r].apply(e._svr,i)})),r.on("__RC_INNER_COMMAND_INIT__",this._registerRenderers.bind(this))}}),Object.defineProperty(e.prototype,"_registerRenderers",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if("7f954602d659cfb16f91987f74aee812abaa6188"===t.commitId){var n=e.sender;this._rendererInitOptions||(this._rendererInitOptions=t,this._svr.setRenderInitOption(t)),this._senders.has(n)||(this._senders.add(n),n.once("destroyed",(function(){r._senders.delete(n)})))}}}),Object.defineProperty(e.prototype,"_send2Renderer",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];e.isDestroyed()?this._senders.delete(e):e.send.apply(e,B([t],H(r),!1))}}),Object.defineProperty(e.prototype,"_send2AllRenderer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._senders.forEach((function(n){t._send2Renderer.apply(t,B([n,"__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",e],H(r),!1))}))}}),Object.defineProperty(e.prototype,"getCppProto",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return{destroy:function(){console.warn("`.getCppProto().destroy()` has being deprecated, use `.destroy()` instead."),e.destroy()}}}}),Object.defineProperty(e.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._svr.destroy()}}),Object.defineProperty(e.prototype,"getDeviceId",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._svr.getDeviceId()}}),Object.defineProperty(e.prototype,"getServerTime",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._svr.getConnectedTime()}}),Object.defineProperty(e.prototype,"setDatabaseOperationTimeThreshold",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._svr.setDataBaseLogConfig(e)}}),e}();ea=na,ta={value:void 0};var ia=function(e){return na.init(e)};export{ia as default};
|
|
15
|
+
***************************************************************************** */function y(e,t,s,r){return new(s||(s=Promise))((function(i,n){function o(e){try{c(r.next(e))}catch(e){n(e)}}function a(e){try{c(r.throw(e))}catch(e){n(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof s?t:new s((function(e){e(t)}))).then(o,a)}c((r=r.apply(e,t||[])).next())}))}function V(e,t,s,r){if("a"===s&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?r:"a"===s?r.call(e):r?r.value:t.get(e)}function G(e,t,s,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,s):i?i.value=s:t.set(e,s),s}var k;!function(e){e[e.QINIU=1]="QINIU",e[e.ALI=2]="ALI",e[e.AWS=3]="AWS",e[e.STC=4]="STC",e[e.MINIO=5]="MINIO"}(k||(k={}));const F="L-connect-T",w="L-connect-R",H="L-connect-S",B="L-TEST-O",J="L-get_navi-T",j="L-get_navi-R",W="L-request-T",x="L-request-R",Y="L-parse_navi-E",K="L-rejoin_chatroom-T",X="L-rejoin_chatroom-R",Q="L-check_alive_im-T",$="L-check_alive_im-R",Z="L-check_alive_im-S",q="L-report_full_log-O",z="L-report_full_log-T",ee="L-report_full_log-R",te="L-parse_navi_logpolicy-E",se="A-remove_proxy-O",re="L-set_proxy-O",ie="L-test_proxy-T",ne="L-test_proxy-R",oe="L-get_static_conf-T",ae="L-get_static_conf-R",ce="L-get_static_conf-E",_e="L-cloud_disabled",le="L-cloud_overclock",de="L-cloud_appkey_region_error",Ee="L-cloud_config_data_error",ue="L-cloud_set_area_code-O",Re="L-cloud_set_mrtr-O",he="L-parse_json-E",Ie="L-event_loop_blocking-S",ge="P-get_sys_version-E",Te="L-pull_offline_message_finished-S";var Ne,Ce,Oe,pe,Se,Ae,fe,me,ve,Pe,Le,Me,Ue,De,be,ye,Ve,Ge,ke,Fe,we,He,Be,Je,je,We,xe,Ye,Ke,Xe;!function(e){e[e.BOTH=2]="BOTH"}(Ne||(Ne={})),function(e){e[e.BOTH=2]="BOTH"}(Ce||(Ce={})),function(e){e[e.FREE=1]="FREE",e[e.NEED_VERIFY=2]="NEED_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(Oe||(Oe={})),function(e){e[e.NONE=0]="NONE",e[e.IN_MY_FRIEND_LIST=1]="IN_MY_FRIEND_LIST",e[e.IN_OTHER_FRIEND_LIST=2]="IN_OTHER_FRIEND_LIST",e[e.BOTH_WAY=3]="BOTH_WAY"}(pe||(pe={})),function(e){e[e.SENT=1]="SENT",e[e.RECEIVED=2]="RECEIVED"}(Se||(Se={})),function(e){e[e.UNHANDLED=0]="UNHANDLED",e[e.ACCEPTED=1]="ACCEPTED",e[e.REFUSED=2]="REFUSED",e[e.EXPIRED=3]="EXPIRED"}(Ae||(Ae={})),function(e){e[e.FRIEND_APPLICATION=31]="FRIEND_APPLICATION"}(fe||(fe={})),function(e){e[e.FRIEND_APPLY=0]="FRIEND_APPLY",e[e.FRIEND_REFUSE=1]="FRIEND_REFUSE",e[e.FRIEND_USER_INFO=2]="FRIEND_USER_INFO",e[e.FRIENDS_INPUT=3]="FRIENDS_INPUT",e[e.FRIEND_CLEAR=4]="FRIEND_CLEAR",e[e.FRIEND_INFO_CHANGE=5]="FRIEND_INFO_CHANGE",e[e.FRIEND_INFO_CHANGE_SYNC=6]="FRIEND_INFO_CHANGE_SYNC"}(me||(me={})),function(e){e[e.OWNER_VERIFY=0]="OWNER_VERIFY",e[e.FREE=1]="FREE",e[e.OWNER_OR_MANAGER_VERIFY=2]="OWNER_OR_MANAGER_VERIFY",e[e.NO_ONE_ALLOWED=3]="NO_ONE_ALLOWED"}(ve||(ve={})),function(e){e[e.OWNER=0]="OWNER",e[e.OWNER_OR_MANAGER=1]="OWNER_OR_MANAGER",e[e.EVERYONE=2]="EVERYONE"}(Pe||(Pe={})),function(e){e[e.OWNER_OR_MANAGER_OR_SELF=0]="OWNER_OR_MANAGER_OR_SELF",e[e.OWNER_OR_SELF=1]="OWNER_OR_SELF",e[e.SELF=2]="SELF"}(Le||(Le={})),function(e){e[e.FREE=0]="FREE",e[e.INVITEE_VERIFY=1]="INVITEE_VERIFY"}(Me||(Me={})),function(e){e[e.UNDEF=0]="UNDEF",e[e.NORMAL=1]="NORMAL",e[e.MANAGER=2]="MANAGER",e[e.OWNER=3]="OWNER"}(Ue||(Ue={})),function(e){e[e.CREATE=0]="CREATE",e[e.JOIN=1]="JOIN",e[e.KICK=2]="KICK",e[e.QUIT=3]="QUIT",e[e.DISMISS=4]="DISMISS",e[e.ADD_MANAGER=5]="ADD_MANAGER",e[e.REMOVE_MANAGER=6]="REMOVE_MANAGER",e[e.TRANSFER_GROUP_OWNER=7]="TRANSFER_GROUP_OWNER"}(De||(De={})),function(e){e[e.GROUP_INFO_CHANGE=0]="GROUP_INFO_CHANGE",e[e.MEMBER_PROFILE_CHANGE=1]="MEMBER_PROFILE_CHANGE",e[e.GROUP_REMARK_SET=2]="GROUP_REMARK_SET",e[e.GROUP_REMARK_DELETE=3]="GROUP_REMARK_DELETE"}(be||(be={})),function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE"}(ye||(ye={})),function(e){e[e.MANAGER_UNHANDLED=0]="MANAGER_UNHANDLED",e[e.MANAGER_REFUSED=1]="MANAGER_REFUSED",e[e.INVITEE_UNHANDLED=2]="INVITEE_UNHANDLED",e[e.INVITEE_REFUSED=3]="INVITEE_REFUSED",e[e.JOINED=4]="JOINED",e[e.EXPIRED=5]="EXPIRED"}(Ve||(Ve={})),function(e){e[e.REFUSE=0]="REFUSE",e[e.ACCEPT=1]="ACCEPT"}(Ge||(Ge={})),function(e){e[e.APPLICANT=0]="APPLICANT",e[e.MANAGER=1]="MANAGER"}(ke||(ke={})),function(e){e[e.GROUP_OPERATION=11]="GROUP_OPERATION",e[e.GROUP_PROFILE_CHANGE=12]="GROUP_PROFILE_CHANGE",e[e.GROUP_APPLICATION_INVITATION=13]="GROUP_APPLICATION_INVITATION",e[e.GROUP_FOLLOW_USER_CHANGE=14]="GROUP_FOLLOW_USER_CHANGE"}(Fe||(Fe={})),function(e){e[e.APPLICATION=0]="APPLICATION",e[e.INVITATION=1]="INVITATION"}(we||(we={})),function(e){e[e.APPLICATION_SENT=0]="APPLICATION_SENT",e[e.INVITATION_SENT=1]="INVITATION_SENT",e[e.INVITATION_RECEIVED=2]="INVITATION_RECEIVED",e[e.APPLICATION_RECEIVED=3]="APPLICATION_RECEIVED"}(He||(He={})),function(e){e[e.UPDATE=1]="UPDATE",e[e.DELETE=2]="DELETE"}(Be||(Be={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(Je||(Je={})),function(e){e[e.LeaveOnMyOwn=1]="LeaveOnMyOwn",e[e.OtherDeviceLogin=2]="OtherDeviceLogin"}(je||(je={})),function(e){e[e.QUIT=0]="QUIT",e[e.JOIN=1]="JOIN"}(We||(We={})),function(e){e[e.UnmuteUsers=0]="UnmuteUsers",e[e.MuteUsers=1]="MuteUsers",e[e.UnmuteAll=2]="UnmuteAll",e[e.MuteAll=3]="MuteAll",e[e.RemoveWhitelist=4]="RemoveWhitelist",e[e.AddWhitelist=5]="AddWhitelist",e[e.UnmuteGloble=6]="UnmuteGloble",e[e.MuteGloble=7]="MuteGloble"}(xe||(xe={})),function(e){e[e.Deblock=0]="Deblock",e[e.Blocked=1]="Blocked"}(Ye||(Ye={})),function(e){e[e.SUCCESS=0]="SUCCESS",e[e.ACTIVE_DISCONNECT=2]="ACTIVE_DISCONNECT",e[e.REJECTED_BY_BLACKLIST=405]="REJECTED_BY_BLACKLIST",e[e.NOT_IN_WHITELIST=407]="NOT_IN_WHITELIST",e[e.FORBIDDEN_IN_PRIVATE=20106]="FORBIDDEN_IN_PRIVATE",e[e.SYS_CONVERSATION_NOT_SUPPORT_MESSAGE=20109]="SYS_CONVERSATION_NOT_SUPPORT_MESSAGE",e[e.DANGEROUS_CONTENT=20112]="DANGEROUS_CONTENT",e[e.CONTENT_REVIEW_REJECTED=20113]="CONTENT_REVIEW_REJECTED",e[e.MESSAGE_OVER_MODIFY_TIME_FAIL=20114]="MESSAGE_OVER_MODIFY_TIME_FAIL",e[e.MESSAGE_SIZE_EXCEEDED=20115]="MESSAGE_SIZE_EXCEEDED",e[e.MESSAGE_UNSUPPORTED_MODIFY=20116]="MESSAGE_UNSUPPORTED_MODIFY",e[e.CLOUD_DATA_CENTER_INVALID=20512]="CLOUD_DATA_CENTER_INVALID",e[e.SEND_FREQUENCY_TOO_FAST=20604]="SEND_FREQUENCY_TOO_FAST",e[e.OPERATION_BLOCKED=20605]="OPERATION_BLOCKED",e[e.OPERATION_NOT_SUPPORT=20606]="OPERATION_NOT_SUPPORT",e[e.REQUEST_OVER_FREQUENCY=20607]="REQUEST_OVER_FREQUENCY",e[e.NOT_IN_DISCUSSION=21406]="NOT_IN_DISCUSSION",e[e.SENSITIVE_SHIELD=21501]="SENSITIVE_SHIELD",e[e.SENSITIVE_REPLACE=21502]="SENSITIVE_REPLACE",e[e.MESSAGE_EXPAND_NOT_EXIST=22201]="MESSAGE_EXPAND_NOT_EXIST",e[e.MESSAGE_EXPAND_NOT_SUPPORT=22202]="MESSAGE_EXPAND_NOT_SUPPORT",e[e.MESSAGE_EXPAND_FORMAT_ERROR=22203]="MESSAGE_EXPAND_FORMAT_ERROR",e[e.MESSAGE_EXPAND_NOT_AUTHORIZED=22204]="MESSAGE_EXPAND_NOT_AUTHORIZED",e[e.NOT_IN_GROUP=22406]="NOT_IN_GROUP",e[e.FORBIDDEN_IN_GROUP=22408]="FORBIDDEN_IN_GROUP",e[e.NOT_IN_CHATROOM=23406]="NOT_IN_CHATROOM",e[e.GET_USERINFO_ERROR=23407]="GET_USERINFO_ERROR",e[e.FORBIDDEN_IN_CHATROOM=23408]="FORBIDDEN_IN_CHATROOM",e[e.RC_CHATROOM_USER_KICKED=23409]="RC_CHATROOM_USER_KICKED",e[e.RC_CHATROOM_NOT_EXIST=23410]="RC_CHATROOM_NOT_EXIST",e[e.RC_CHATROOM_IS_FULL=23411]="RC_CHATROOM_IS_FULL",e[e.RC_CHATROOM_PATAMETER_INVALID=23412]="RC_CHATROOM_PATAMETER_INVALID",e[e.CHATROOM_GET_HISTORYMSG_ERROR=23413]="CHATROOM_GET_HISTORYMSG_ERROR",e[e.CHATROOM_NOT_OPEN_HISTORYMSG_STORE=23414]="CHATROOM_NOT_OPEN_HISTORYMSG_STORE",e[e.CHATROOM_KV_EXCEED=23423]="CHATROOM_KV_EXCEED",e[e.CHATROOM_KV_OVERWRITE_INVALID=23424]="CHATROOM_KV_OVERWRITE_INVALID",e[e.CHATROOM_SET_PROPERTY_OVER_FREQUENCY=23425]="CHATROOM_SET_PROPERTY_OVER_FREQUENCY",e[e.CHATROOM_KV_STORE_NOT_OPEN=23426]="CHATROOM_KV_STORE_NOT_OPEN",e[e.CHATROOM_KEY_NOT_EXIST=23427]="CHATROOM_KEY_NOT_EXIST",e[e.CHATROOM_KV_STORE_NOT_ALL_SUCCESS=23428]="CHATROOM_KV_STORE_NOT_ALL_SUCCESS",e[e.CHATROOM_KV_STORE_OUT_LIMIT=23429]="CHATROOM_KV_STORE_OUT_LIMIT",e[e.CHATROOM_KV_SET_ERROR=23431]="CHATROOM_KV_SET_ERROR",e[e.HAVNODEVICEID=24001]="HAVNODEVICEID",e[e.DEVICEIDISHAVE=24002]="DEVICEIDISHAVE",e[e.FEILD=24009]="FEILD",e[e.INTERNALERRROR=24015]="INTERNALERRROR",e[e.RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET=24360]="RC_USER_PROFILE_KEY_NOT_ALLOW_SDK_SET",e[e.RC_USER_PROFILE_KEY_NOT_EXIST=24361]="RC_USER_PROFILE_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KEY_NOT_EXIST=24362]="RC_USER_PROFILE_EXT_KEY_NOT_EXIST",e[e.RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT=24363]="RC_USER_PROFILE_EXT_KV_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT=24364]="RC_USER_PROFILE_VALUE_LENGTH_EXCEED_LIMIT",e[e.RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT=24365]="RC_USER_PROFILE_QUERY_COUNT_EXCEED_LIMIT",e[e.RC_USER_PROFILE_USER_NOT_EXIST=24366]="RC_USER_PROFILE_USER_NOT_EXIST",e[e.RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS=24367]="RC_USER_PROFILE_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_USER_PROFILE_VALUE_EXCEED_RANGE=24368]="RC_USER_PROFILE_VALUE_EXCEED_RANGE",e[e.RC_USER_PROFILE_SERVICE_UNAVAILABLE=24369]="RC_USER_PROFILE_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_UNAVAILABLE=24401]="ULTRA_GROUP_SERVICE_UNAVAILABLE",e[e.ULTRA_GROUP_SERVICE_ERROR=24402]="ULTRA_GROUP_SERVICE_ERROR",e[e.ULTRA_GROUP_PARAMETER_ERROR=24403]="ULTRA_GROUP_PARAMETER_ERROR",e[e.ULTRA_GROUP_UNKNOWN_ERROR=24404]="ULTRA_GROUP_UNKNOWN_ERROR",e[e.NOT_IN_ULTRA_GROUP=24406]="NOT_IN_ULTRA_GROUP",e[e.FORBIDDEN_IN_ULTRA_GROUP=24408]="FORBIDDEN_IN_ULTRA_GROUP",e[e.ULTRA_GROUP_NOT_EXIST=24410]="ULTRA_GROUP_NOT_EXIST",e[e.ULTRA_GROUP_MEMBERS_OVERSIZE=24411]="ULTRA_GROUP_MEMBERS_OVERSIZE",e[e.ULTRA_GROUP_JOINED_OVERSIZE=24412]="ULTRA_GROUP_JOINED_OVERSIZE",e[e.ULTRA_GROUP_CHANNELS_OVERSIZE=24413]="ULTRA_GROUP_CHANNELS_OVERSIZE",e[e.ULTRA_GROUP_CHANNEL_ID_NOT_EXIST=24414]="ULTRA_GROUP_CHANNEL_ID_NOT_EXIST",e[e.ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY=24415]="ULTRA_GROUP_MESSAGE_SENT_OVER_FREQUENCY",e[e.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL=24416]="ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL",e[e.RECALL_MESSAGE=25101]="RECALL_MESSAGE",e[e.MESSAGE_STORAGE_SERVICE_UNAVAILABLE=25102]="MESSAGE_STORAGE_SERVICE_UNAVAILABLE",e[e.RC_SERVER_UNKOWN_ERROR=25104]="RC_SERVER_UNKOWN_ERROR",e[e.RECALL_MESSAGE_USER_INVALID=25107]="RECALL_MESSAGE_USER_INVALID",e[e.RC_ENTRUST_SERVER_ERROR=25402]="RC_ENTRUST_SERVER_ERROR",e[e.RC_ENTRUST_SERVER_PARAMETER_ERROR=25403]="RC_ENTRUST_SERVER_PARAMETER_ERROR",e[e.RC_GROUP_ILLEGAL_ERROR=25404]="RC_GROUP_ILLEGAL_ERROR",e[e.RC_GROUP_AUTHORITY_ERROR=25405]="RC_GROUP_AUTHORITY_ERROR",e[e.RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT=25406]="RC_GROUP_PARAMETER_LENGTH_EXCEED_LIMIT",e[e.RC_GROUP_PARAMETER_FORMAT_ERROR=25407]="RC_GROUP_PARAMETER_FORMAT_ERROR",e[e.RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS=25408]="RC_GROUP_PARAMETER_VALUE_CAN_ONLY_BE_NUMBERS",e[e.RC_GROUP_ID_ALREADY_EXIST=25409]="RC_GROUP_ID_ALREADY_EXIST",e[e.RC_GROUP_ID_NOT_EXIST=25410]="RC_GROUP_ID_NOT_EXIST",e[e.RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT=25411]="RC_GROUP_MEMBERS_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_MEMBERS_ALREADY_IN_GROUP=25412]="RC_GROUP_MEMBERS_ALREADY_IN_GROUP",e[e.RC_GROUP_NOT_ALLOW_SDK_OPERATION=25413]="RC_GROUP_NOT_ALLOW_SDK_OPERATION",e[e.RC_GROUP_NOT_ALLOW_JOIN=25414]="RC_GROUP_NOT_ALLOW_JOIN",e[e.RC_GROUP_EXT_KEY_NOT_EXIST=25415]="RC_GROUP_EXT_KEY_NOT_EXIST",e[e.RC_GROUP_REQUEST_OVERFREQUENCY=25416]="RC_GROUP_REQUEST_OVERFREQUENCY",e[e.RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK=25417]="RC_GROUP_OWNER_NOT_ALLOW_QUIT_OR_KICK",e[e.RC_GROUP_USER_NOT_IN_GROUP=25418]="RC_GROUP_USER_NOT_IN_GROUP",e[e.RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT=25419]="RC_GROUP_MANAGER_OR_FOLLOW_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP=25420]="RC_GROUP_USER_IS_NOT_MANAGER_IN_GROUP",e[e.RC_GROUP_APPLICATION_NOT_EXIST=25421]="RC_GROUP_APPLICATION_NOT_EXIST",e[e.RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT=25422]="RC_GROUP_QUERY_GROUP_COUNT_EXCEED_LIMIT",e[e.RC_GROUP_NAME_INVALID=25423]="RC_GROUP_NAME_INVALID",e[e.RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT=25424]="RC_GROUP_JOIN_GROUP_NEED_MANAGER_ACCEPT",e[e.RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER=25425]="RC_GROUP_OWNER_NOT_ALLOW_BE_MANAGER",e[e.RC_GROUP_NO_INVITE_PERMISSION=25426]="RC_GROUP_NO_INVITE_PERMISSION",e[e.RC_GROUP_NEED_INVITEE_ACCEPT=25427]="RC_GROUP_NEED_INVITEE_ACCEPT",e[e.RC_GROUP_APPLICATION_ALREADY_HANDLE=25428]="RC_GROUP_APPLICATION_ALREADY_HANDLE",e[e.RC_GROUP_OLD_GROUP_NOT_ENTRUST=25429]="RC_GROUP_OLD_GROUP_NOT_ENTRUST",e[e.RC_GROUP_ID_INVALID=25430]="RC_GROUP_ID_INVALID",e[e.RC_PAGE_TOKEN_PARSING_FAILED=25432]="RC_PAGE_TOKEN_PARSING_FAILED",e[e.RC_FRIEND_ALREADY_FRIEND=25460]="RC_FRIEND_ALREADY_FRIEND",e[e.RC_FRIEND_NEED_ACCEPT=25461]="RC_FRIEND_NEED_ACCEPT",e[e.RC_FRIEND_IN_OTHER_BLACK_LIST=25462]="RC_FRIEND_IN_OTHER_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_OTHER_WHITE_LIST=25463]="RC_FRIEND_NOT_IN_OTHER_WHITE_LIST",e[e.RC_FRIEND_IN_MY_BLACK_LIST=25464]="RC_FRIEND_IN_MY_BLACK_LIST",e[e.RC_FRIEND_NOT_IN_MY_WHITE_LIST=25465]="RC_FRIEND_NOT_IN_MY_WHITE_LIST",e[e.RC_FRIEND_APPLICATION_NOT_EXIST=25466]="RC_FRIEND_APPLICATION_NOT_EXIST",e[e.RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT=25467]="RC_FRIEND_MY_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT=25468]="RC_FRIEND_OTHER_FRIEND_COUNT_EXCEED_LIMIT",e[e.RC_FRIEND_NOT_FRIEND=25469]="RC_FRIEND_NOT_FRIEND",e[e.RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT=25470]="RC_FRIEND_FIELDS_LENGTH_EXCEED_LIMIT",e[e.RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND=25471]="RC_FRIEND_OTHER_NOT_ALLOW_ADD_FRIEND",e[e.RC_FRIEND_NOT_EXIST=25472]="RC_FRIEND_NOT_EXIST",e[e.RC_FRIEND_NOT_ALLOW_ADD_SELF=25473]="RC_FRIEND_NOT_ALLOW_ADD_SELF",e[e.RC_FRIEND_NOT_SUPPORT_ROBOT=25474]="RC_FRIEND_NOT_SUPPORT_ROBOT",e[e.SERVICE_INFORMATION_AUDIT_FAILED=25480]="SERVICE_INFORMATION_AUDIT_FAILED",e[e.PUSH_PARAMETER_INVALID=26001]="PUSH_PARAMETER_INVALID",e[e.USER_SETTING_SYNCED_ERROR=26002]="USER_SETTING_SYNCED_ERROR",e[e.CONVERSATION_TAG_OVERSIZE=26004]="CONVERSATION_TAG_OVERSIZE",e[e.RC_READ_RECEIPT_V4_INVALID=26005]="RC_READ_RECEIPT_V4_INVALID",e[e.RC_SERVER_DRIVE_UNREAD_COUNT_INVALID=26006]="RC_SERVER_DRIVE_UNREAD_COUNT_INVALID",e[e.RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED=26007]="RC_SERVER_PARAMETER_MESSAGEUIDS_CONFUSED",e[e.RC_SERVER_PARAMETER_MESSAGEUID_INVALID=26009]="RC_SERVER_PARAMETER_MESSAGEUID_INVALID",e[e.RC_SERVER_PARAMETER_INVALID=26010]="RC_SERVER_PARAMETER_INVALID",e[e.RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE=26020]="RC_SUBSCRIBE_ONLINE_SERVICE_UNAVAILABLE",e[e.RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT=26021]="RC_BESUBSCRIBED_USERIDS_COUNT_EXCEED_LIMIT",e[e.RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT=26022]="RC_SUBSCRIBED_USERIDS_EXCEED_LIMIT",e[e.RC_FILE_SIZE_EXCEED_LIMIT=26106]="RC_FILE_SIZE_EXCEED_LIMIT",e[e.INVALID_PARAMETER_SIZE_NOT_FOUND=26107]="INVALID_PARAMETER_SIZE_NOT_FOUND",e[e.SERVICE_RRSV5_UNAVAILABLE=26314]="SERVICE_RRSV5_UNAVAILABLE",e[e.SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT=26315]="SERVICE_RRSV5_READ_RECEIPT_NOT_SUPPORT",e[e.SERVICE_RRSV5_PARAM_LENGTH_EXCEED=26316]="SERVICE_RRSV5_PARAM_LENGTH_EXCEED",e[e.SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT=26317]="SERVICE_RRSV5_CONVERSATION_NOT_SUPPORT",e[e.SERVICE_RRSV5_QUERY_NOT_SUPPORT=26318]="SERVICE_RRSV5_QUERY_NOT_SUPPORT",e[e.SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH=26320]="SERVICE_RRSV5_MESSAGE_SENDER_MISMATCH",e[e.SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS=26321]="SERVICE_RRSV5_MESSAGE_RECEIPT_NEEDLESS",e[e.SERVICE_RRSV5_MESSAGE_NOT_EXIST=26322]="SERVICE_RRSV5_MESSAGE_NOT_EXIST",e[e.MSG_REACTION_LIMIT_REACHED=26323]="MSG_REACTION_LIMIT_REACHED",e[e.MSG_REACTION_USER_LIMIT_REACHED=26324]="MSG_REACTION_USER_LIMIT_REACHED",e[e.SERVICE_STT_UNAVAILABLE=28300]="SERVICE_STT_UNAVAILABLE",e[e.SERVICE_STT_CONVERTED_FAILED=28304]="SERVICE_STT_CONVERTED_FAILED",e[e.SERVICE_STT_INTERNAL_ERROR=28305]="SERVICE_STT_INTERNAL_ERROR",e[e.SERVICE_STT_PARAM_MISS=28306]="SERVICE_STT_PARAM_MISS",e[e.SERVICE_STT_USAGE_EXCEED=28307]="SERVICE_STT_USAGE_EXCEED",e[e.TRANS_SERVICE_NOT_OPEN=28400]="TRANS_SERVICE_NOT_OPEN",e[e.TRANS_FAILED=28401]="TRANS_FAILED",e[e.TRANS_INTERNAL_ERROR=28402]="TRANS_INTERNAL_ERROR",e[e.TRANS_PARAM_MISSING=28403]="TRANS_PARAM_MISSING",e[e.TRANS_PARAM_ERROR=28404]="TRANS_PARAM_ERROR",e[e.TRANS_QUOTA_LIMIT=28405]="TRANS_QUOTA_LIMIT",e[e.TRANS_TEXT_LENGTH_EXCEEDS_LIMIT=28406]="TRANS_TEXT_LENGTH_EXCEEDS_LIMIT",e[e.TRANS_LANGUAGE_NOT_SUPPORT=28407]="TRANS_LANGUAGE_NOT_SUPPORT",e[e.RC_NET_CHANNEL_INVALID=30001]="RC_NET_CHANNEL_INVALID",e[e.RC_NET_UNAVAILABLE=30002]="RC_NET_UNAVAILABLE",e[e.RC_MSG_RESP_TIMEOUT=30003]="RC_MSG_RESP_TIMEOUT",e[e.RC_HTTP_SEND_FAIL=30004]="RC_HTTP_SEND_FAIL",e[e.RC_HTTP_REQ_FAIL=30005]="RC_HTTP_REQ_FAIL",e[e.RC_HTTP_RECV_FAIL=30006]="RC_HTTP_RECV_FAIL",e[e.RC_NAVI_REQ_FAILED=30007]="RC_NAVI_REQ_FAILED",e[e.RC_NODE_NOT_FOUND=30008]="RC_NODE_NOT_FOUND",e[e.RC_DOMAIN_NOT_RESOLVE=30009]="RC_DOMAIN_NOT_RESOLVE",e[e.RC_SOCKET_NOT_CREATED=30010]="RC_SOCKET_NOT_CREATED",e[e.RC_SOCKET_DISCONNECTED=30011]="RC_SOCKET_DISCONNECTED",e[e.RC_PING_EXCEED_LIMIT=30012]="RC_PING_EXCEED_LIMIT",e[e.PONG_RECEIVED_ERROR=30013]="PONG_RECEIVED_ERROR",e[e.RC_MSG_SEND_FAIL=30014]="RC_MSG_SEND_FAIL",e[e.CONNECT_OVER_FREQUENCY=30015]="CONNECT_OVER_FREQUENCY",e[e.RC_MSG_CONTENT_EXCEED_LIMIT=30016]="RC_MSG_CONTENT_EXCEED_LIMIT",e[e.MESSAGE_NOT_SUPPORT_SENDING=30017]="MESSAGE_NOT_SUPPORT_SENDING",e[e.RC_NETWORK_DOWN=30019]="RC_NETWORK_DOWN",e[e.RC_TCP_DISCONNECTED_NO_RMTP=30021]="RC_TCP_DISCONNECTED_NO_RMTP",e[e.RC_CONN_ACK_TIMEOUT=31e3]="RC_CONN_ACK_TIMEOUT",e[e.RC_CONN_PROTO_VERSION_ERROR=31001]="RC_CONN_PROTO_VERSION_ERROR",e[e.RC_CONN_IDENTIFIER_REJECTED=31002]="RC_CONN_IDENTIFIER_REJECTED",e[e.RC_CONN_SERVER_UNAVAILABLE=31003]="RC_CONN_SERVER_UNAVAILABLE",e[e.RC_CONN_TOKEN_INCORRECT=31004]="RC_CONN_TOKEN_INCORRECT",e[e.RC_CONN_NOT_AUTHRORIZED=31005]="RC_CONN_NOT_AUTHRORIZED",e[e.RC_CONN_REDIRECTED=31006]="RC_CONN_REDIRECTED",e[e.RC_CONN_PACKAGE_NAME_INVALID=31007]="RC_CONN_PACKAGE_NAME_INVALID",e[e.RC_CONN_APP_BLOCKED_OR_DELETED=31008]="RC_CONN_APP_BLOCKED_OR_DELETED",e[e.RC_CONN_USER_BLOCKED=31009]="RC_CONN_USER_BLOCKED",e[e.RC_DISCONN_KICK=31010]="RC_DISCONN_KICK",e[e.RC_DISCONN_EXCEPTION=31011]="RC_DISCONN_EXCEPTION",e[e.CONNECTION_ENCRYPT_AUTHORIZED_ERROR=31012]="CONNECTION_ENCRYPT_AUTHORIZED_ERROR",e[e.RC_CONN_TOKEN_EXPIRED=31020]="RC_CONN_TOKEN_EXPIRED",e[e.RC_CONN_DEVICE_ERROR=31021]="RC_CONN_DEVICE_ERROR",e[e.RC_CONN_HOSTNAME_ERROR=31022]="RC_CONN_HOSTNAME_ERROR",e[e.RC_DISCONN_SAME_CLIENT_ON_LINE=31023]="RC_DISCONN_SAME_CLIENT_ON_LINE",e[e.RC_LISCENSE_COUNT_OUT_OF_LIMIT=31024]="RC_LISCENSE_COUNT_OUT_OF_LIMIT",e[e.RC_CONN_WRONG_CLUSTER=31025]="RC_CONN_WRONG_CLUSTER",e[e.RC_APP_AUTH_NOT_PASS=31026]="RC_APP_AUTH_NOT_PASS",e[e.RC_OTP_USED=31027]="RC_OTP_USED",e[e.RC_PLATFORM_ERROR=31028]="RC_PLATFORM_ERROR",e[e.RC_ACCOUNT_CANCELLATION=31029]="RC_ACCOUNT_CANCELLATION",e[e.RC_LICENSE_EXPIRED=31030]="RC_LICENSE_EXPIRED",e[e.RC_QUERY_ACK_NO_DATA=32001]="RC_QUERY_ACK_NO_DATA",e[e.RC_MSG_DATA_INCOMPLETE=32002]="RC_MSG_DATA_INCOMPLETE",e[e.RC_UDP_DISCONNECTED=32011]="RC_UDP_DISCONNECTED",e[e.RC_TCP_RESET=32054]="RC_TCP_RESET",e[e.CONNECTION_REFUSED=32061]="CONNECTION_REFUSED",e[e.PROTOCOL_DECODE_ERROR=32546]="PROTOCOL_DECODE_ERROR",e[e.PROTOCOL_MESSAGE_SAVED_ERROR=33e3]="PROTOCOL_MESSAGE_SAVED_ERROR",e[e.BIZ_ERROR_CLIENT_NOT_INIT=33001]="BIZ_ERROR_CLIENT_NOT_INIT",e[e.BIZ_ERROR_DATABASE_ERROR=33002]="BIZ_ERROR_DATABASE_ERROR",e[e.BIZ_ERROR_INVALID_PARAMETER=33003]="BIZ_ERROR_INVALID_PARAMETER",e[e.BIZ_ERROR_NO_CHANNEL=33004]="BIZ_ERROR_NO_CHANNEL",e[e.BIZ_ERROR_RECONNECT_SUCCESS=33005]="BIZ_ERROR_RECONNECT_SUCCESS",e[e.BIZ_ERROR_CONNECTING=33006]="BIZ_ERROR_CONNECTING",e[e.MSG_ROAMING_SERVICE_UNAVAILABLE=33007]="MSG_ROAMING_SERVICE_UNAVAILABLE",e[e.MSG_INSERT_ERROR=33008]="MSG_INSERT_ERROR",e[e.MSG_DEL_ERROR=33009]="MSG_DEL_ERROR",e[e.TAG_NOT_EXIST=33100]="TAG_NOT_EXIST",e[e.TAG_EXISTS=33101]="TAG_EXISTS",e[e.NO_TAG_IN_CONVER=33102]="NO_TAG_IN_CONVER",e[e.METHOD_BUSY=33103]="METHOD_BUSY",e[e.NOT_ALLOW_PULL_CONVERSATION=33301]="NOT_ALLOW_PULL_CONVERSATION",e[e.SDK_PULL_CONVERSATION=33302]="SDK_PULL_CONVERSATION",e[e.MODIFIED_MESSAGE_IS_NOT_SENT=33401]="MODIFIED_MESSAGE_IS_NOT_SENT",e[e.MODIFIED_MESSAGE_TIMEOUT=33402]="MODIFIED_MESSAGE_TIMEOUT",e[e.QUOTE_MSG_NOT_FOUND=33403]="QUOTE_MSG_NOT_FOUND",e[e.INVALID_PARAMETER_QUOTE_INFO=33404]="INVALID_PARAMETER_QUOTE_INFO",e[e.REACTION_ID_INVALID=33405]="REACTION_ID_INVALID",e[e.INVALID_PARAMETER_UNREAD_COUNT_FILTER=33406]="INVALID_PARAMETER_UNREAD_COUNT_FILTER",e[e.RC_CONNECTION_EXIST=34001]="RC_CONNECTION_EXIST",e[e.PACKAGE_ENVIRONMENT_ERROR=34005]="PACKAGE_ENVIRONMENT_ERROR",e[e.CONNECTION_TIMEOUT=34006]="CONNECTION_TIMEOUT",e[e.MESSAGE_KV_NOT_SUPPORT=34008]="MESSAGE_KV_NOT_SUPPORT",e[e.MESSAGE_EXPANDED_ERROR=34009]="MESSAGE_EXPANDED_ERROR",e[e.EXPANSION_LIMIT_EXCEET=34010]="EXPANSION_LIMIT_EXCEET",e[e.UPLOAD_FAIL=34011]="UPLOAD_FAIL",e[e.CONVER_OUT_LIMIT_ERROR=34013]="CONVER_OUT_LIMIT_ERROR",e[e.READ_RECEIPT_ERROR=34014]="READ_RECEIPT_ERROR",e[e.PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE=34016]="PUSH_CONTENT_CONFIG_SERVICE_UNAVAILABLE",e[e.MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE=34017]="MESSAGE_INTERCEPTION_PRODUCED_NULL_MESSAGE",e[e.MEDIA_EXCEPTION=34018]="MEDIA_EXCEPTION",e[e.MESSAGE_NOT_REGISTERED=34021]="MESSAGE_NOT_REGISTERED",e[e.METHOD_NOT_SUPPORT=34022]="METHOD_NOT_SUPPORT",e[e.ULTRA_GROUP_CHANNEL_NOT_EXIST=34024]="ULTRA_GROUP_CHANNEL_NOT_EXIST",e[e.INCONSISTENT_CONVERSATION_TYPE=34025]="INCONSISTENT_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_LAUGUAGE=34200]="INVALID_PARAMETER_LAUGUAGE",e[e.CONVERSATION_TYPE_NOT_SUPPORT=34201]="CONVERSATION_TYPE_NOT_SUPPORT",e[e.INVALID_PARAMETER_TIMESTAMP=34202]="INVALID_PARAMETER_TIMESTAMP",e[e.INVALID_PARAMETER_MESSAGE_UID=34203]="INVALID_PARAMETER_MESSAGE_UID",e[e.INVALID_PARAMETER_MESSAGE_ID=34204]="INVALID_PARAMETER_MESSAGE_ID",e[e.INVALID_PARAMETER_MESSAGE_CONTENT=34205]="INVALID_PARAMETER_MESSAGE_CONTENT",e[e.MSG_LIMIT_ERROR=34206]="MSG_LIMIT_ERROR",e[e.INVALID_PARAMETER_MEDIA_TYPE=34207]="INVALID_PARAMETER_MEDIA_TYPE",e[e.INVALID_PARAMETER_REQUEST_URL=34208]="INVALID_PARAMETER_REQUEST_URL",e[e.INVALID_PARAMETER_CONVERSATION_TYPE=34209]="INVALID_PARAMETER_CONVERSATION_TYPE",e[e.INVALID_PARAMETER_TARGET_ID=34210]="INVALID_PARAMETER_TARGET_ID",e[e.INVALID_PARAMETER_CHANNEL_ID=34211]="INVALID_PARAMETER_CHANNEL_ID",e[e.INVALID_PARAMETER_TAG_ID=34212]="INVALID_PARAMETER_TAG_ID",e[e.INVALID_PARAMETER_TAG_NAME=34213]="INVALID_PARAMETER_TAG_NAME",e[e.INVALID_PARAMETER_USER_ID=34214]="INVALID_PARAMETER_USER_ID",e[e.INVALID_PARAMETER_USERIDLIST=34215]="INVALID_PARAMETER_USERIDLIST",e[e.INVALID_PARAMETER_DOWNLOADMEDIAFILENAME=34217]="INVALID_PARAMETER_DOWNLOADMEDIAFILENAME",e[e.INVALID_PARAMETER_MESSAGE_EXPANSION=34220]="INVALID_PARAMETER_MESSAGE_EXPANSION",e[e.INVALID_PARAMETER_NOTMEDIAMESSAGE=34223]="INVALID_PARAMETER_NOTMEDIAMESSAGE",e[e.INVALID_PARAMETER_TIMESTRING=34224]="INVALID_PARAMETER_TIMESTRING",e[e.INVALID_PARAMETER_CONVERSATION=34225]="INVALID_PARAMETER_CONVERSATION",e[e.INVALID_PARAMETER_NOTIFICATION_LEVEL=34228]="INVALID_PARAMETER_NOTIFICATION_LEVEL",e[e.INVALID_PARAMETER_MESSAGE_ARRAY=34229]="INVALID_PARAMETER_MESSAGE_ARRAY",e[e.INVALID_PARAMETER_RECEIVED_STATUS=34230]="INVALID_PARAMETER_RECEIVED_STATUS",e[e.INVALID_PARAMETER_CHANNEL_TYPE=34231]="INVALID_PARAMETER_CHANNEL_TYPE",e[e.INVALID_PARAMETER_COUNT=34232]="INVALID_PARAMETER_COUNT",e[e.INVALID_PARAMETER_MEDIA_URL=34235]="INVALID_PARAMETER_MEDIA_URL",e[e.INVALID_PARAMETER_UNIQUE_ID=34236]="INVALID_PARAMETER_UNIQUE_ID",e[e.INVALID_PARAMETER_PROXY=34238]="INVALID_PARAMETER_PROXY",e[e.INVALID_PARAMETER_TESTHOST=34239]="INVALID_PARAMETER_TESTHOST",e[e.INVALID_CONNECT_TESTHOST_FAILED=34240]="INVALID_CONNECT_TESTHOST_FAILED",e[e.INVALID_PARAMETER_CONVERSATIONS=34242]="INVALID_PARAMETER_CONVERSATIONS",e[e.INVALID_PARAMETER_SENT_STATUS=34244]="INVALID_PARAMETER_SENT_STATUS",e[e.RC_CONN_PROXY_UNAVAILABLE=34245]="RC_CONN_PROXY_UNAVAILABLE",e[e.INVALID_PARAMETER_RTCROOMID=34259]="INVALID_PARAMETER_RTCROOMID",e[e.INVALID_PARAMETER_KEY=34260]="INVALID_PARAMETER_KEY",e[e.INVALID_PARAMETER_KEYS=34261]="INVALID_PARAMETER_KEYS",e[e.INVALID_PARAMETER_VALUE=34262]="INVALID_PARAMETER_VALUE",e[e.INVALID_PARAMETER_ENTRIES=34263]="INVALID_PARAMETER_ENTRIES",e[e.INVALID_PARAMETER_NOTIFICATION_EXTRA=34264]="INVALID_PARAMETER_NOTIFICATION_EXTRA",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME=34271]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME",e[e.INVALID_PARAMETER_BEFORE=34272]="INVALID_PARAMETER_BEFORE",e[e.INVALID_PARAMETER_AFTER=34273]="INVALID_PARAMETER_AFTER",e[e.INVALID_PARAMETER_KEYWORD=34274]="INVALID_PARAMETER_KEYWORD",e[e.INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST=34275]="INVALID_PARAMETER_MESSAGE_OBJECT_NAME_LIST",e[e.INVALID_PARAMETER_OFFSET=34276]="INVALID_PARAMETER_OFFSET",e[e.INVALID_PARAMETER_START_TIME=34277]="INVALID_PARAMETER_START_TIME",e[e.INVALID_PARAMETER_END_TIME=34278]="INVALID_PARAMETER_END_TIME",e[e.INVALID_PARAMETER_LIMIT=34279]="INVALID_PARAMETER_LIMIT",e[e.INVALID_MESSAGE_DIRECTION=34280]="INVALID_MESSAGE_DIRECTION",e[e.INVALID_MESSAGE_SENT_STATUS=34281]="INVALID_MESSAGE_SENT_STATUS",e[e.INVALID_PARAMETER_TARGETID_LIST=34282]="INVALID_PARAMETER_TARGETID_LIST",e[e.INVALID_PARAMETER_SPAN_MINUTES=34283]="INVALID_PARAMETER_SPAN_MINUTES",e[e.INVALID_PARAMETER_CONVERSATION_TYPE_LIST=34284]="INVALID_PARAMETER_CONVERSATION_TYPE_LIST",e[e.INVALID_PARAMETER_CONVERSATION_LIST=34287]="INVALID_PARAMETER_CONVERSATION_LIST",e[e.INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST=34288]="INVALID_PARAMETER_CLEAR_MESSAGE_OPTION_LIST",e[e.INVALID_PARAMETER_START_MESSAGE_UID=34289]="INVALID_PARAMETER_START_MESSAGE_UID",e[e.INVALID_PARAMETER_END_MESSAGE_UID=34290]="INVALID_PARAMETER_END_MESSAGE_UID",e[e.READ_RECEIPT_V4_NOT_SUPPORT=34291]="READ_RECEIPT_V4_NOT_SUPPORT",e[e.READ_RECEIPT_V4_UPDATE_NOT_SUPPORT=34292]="READ_RECEIPT_V4_UPDATE_NOT_SUPPORT",e[e.RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE=34296]="RC_DIRECTIONAL_MESSAGE_INVALID_CONVERSATION_TYPE",e[e.RC_DB_NOT_INIT=34301]="RC_DB_NOT_INIT",e[e.RC_DB_CORRUPT=34302]="RC_DB_CORRUPT",e[e.RC_DB_SQL_ERROR=34303]="RC_DB_SQL_ERROR",e[e.RC_DB_DATA_NOT_FOUND=34304]="RC_DB_DATA_NOT_FOUND",e[e.RC_NET_DATA_ERROR=34305]="RC_NET_DATA_ERROR",e[e.INVALID_PARAMETER_SUBSCRIBE_TYPE=34306]="INVALID_PARAMETER_SUBSCRIBE_TYPE",e[e.INVALID_PARAMETER_SUBSCRIBE_EXPIRY=34307]="INVALID_PARAMETER_SUBSCRIBE_EXPIRY",e[e.INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS=34308]="INVALID_PARAMETER_SUBSCRIBE_PUBLISHER_USERIDS",e[e.INVALID_PARAMETER_SUBSCRIBE_PAGESIZE=34309]="INVALID_PARAMETER_SUBSCRIBE_PAGESIZE",e[e.SUB_PROCESS_EXIT=34310]="SUB_PROCESS_EXIT",e[e.ADDON_NOT_EXIST=34311]="ADDON_NOT_EXIST",e[e.INVALID_PARAMETER_USER_PROFILE=34312]="INVALID_PARAMETER_USER_PROFILE",e[e.INVALID_PARAMETER_USER_PROFILE_VISIBILITY=34313]="INVALID_PARAMETER_USER_PROFILE_VISIBILITY",e[e.INVALID_PARAMETER_EXTRA=34314]="INVALID_PARAMETER_EXTRA",e[e.DB_UPGRADE_FAILED=34315]="DB_UPGRADE_FAILED",e[e.INVALID_PARAMETER_GROUP_INFO=34318]="INVALID_PARAMETER_GROUP_INFO",e[e.INVALID_PARAMETER_GROUP_ID=34319]="INVALID_PARAMETER_GROUP_ID",e[e.INVALID_PARAMETER_GROUP_NAME=34320]="INVALID_PARAMETER_GROUP_NAME",e[e.INVALID_PARAMETER_GROUP_IDS=34321]="INVALID_PARAMETER_GROUP_IDS",e[e.INVALID_PARAMETER_GROUP_MEMBER_ROLE=34322]="INVALID_PARAMETER_GROUP_MEMBER_ROLE",e[e.INVALID_PARAMETER_GROUP_APPLICATION_STATUS=34323]="INVALID_PARAMETER_GROUP_APPLICATION_STATUS",e[e.INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION=34324]="INVALID_PARAMETER_GROUP_APPLICATION_DIRECTION",e[e.INVALID_PARAMETER_NICK_NAME=34325]="INVALID_PARAMETER_NICK_NAME",e[e.INVALID_PARAMETER_REASON=34326]="INVALID_PARAMETER_REASON",e[e.INVALID_PARAMETER_REMARK=34327]="INVALID_PARAMETER_REMARK",e[e.INVALID_PARAMETER_PAGING_QUERY_OPTION=34328]="INVALID_PARAMETER_PAGING_QUERY_OPTION",e[e.NET_DATA_IS_SYNCHRONIZING=34329]="NET_DATA_IS_SYNCHRONIZING",e[e.INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE=34330]="INVALID_PARAMETER_QUERY_FRIENDS_DIRECTION_TYPE",e[e.INVALID_PARAMETER_DIRECTION_TYPE=34331]="INVALID_PARAMETER_DIRECTION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_TYPE=34332]="INVALID_PARAMETER_FRIEND_APPLICATION_TYPE",e[e.INVALID_PARAMETER_FRIEND_APPLICATION_STATUS=34333]="INVALID_PARAMETER_FRIEND_APPLICATION_STATUS",e[e.INVALID_PARAMETER_FRIEND_ADD_PERMISSION=34334]="INVALID_PARAMETER_FRIEND_ADD_PERMISSION",e[e.INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS=34335]="INVALID_PARAMETER_FRIEND_INFO_EXT_FIELDS",e[e.RC_REAL_TIME_CONVERSATION_UNAVAILABLE=34336]="RC_REAL_TIME_CONVERSATION_UNAVAILABLE",e[e.SERVER_DATA_ERROR=34344]="SERVER_DATA_ERROR",e[e.INVALID_PARAMETER_MESSAGE_INFO_MAP=34345]="INVALID_PARAMETER_MESSAGE_INFO_MAP",e[e.INVALID_PARAMETER_PAGE_TOKEN=34346]="INVALID_PARAMETER_PAGE_TOKEN",e[e.SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN=34435]="SERVER_RECORD_UNREAD_COUNT_ENABLED_FORBIDDEN",e[e.SERVER_RECORD_UNREAD_COUNT_DISABLED=34436]="SERVER_RECORD_UNREAD_COUNT_DISABLED",e[e.DATABASEDISKFULL=34439]="DATABASEDISKFULL",e[e.GROUP_SYNC_ERROR=35001]="GROUP_SYNC_ERROR",e[e.GROUP_MATCH_ERROR=35002]="GROUP_MATCH_ERROR",e[e.NOT_SUPPORT=35004]="NOT_SUPPORT",e[e.MAIN_PROCESS_ERROR=35005]="MAIN_PROCESS_ERROR",e[e.CAN_NOT_RECONNECT=35007]="CAN_NOT_RECONNECT",e[e.SERVER_UNAVAILABLE=35008]="SERVER_UNAVAILABLE",e[e.HOSTNAME_ERROR=35009]="HOSTNAME_ERROR",e[e.HAS_OHTER_SAME_CLIENT_ON_LINE=35010]="HAS_OHTER_SAME_CLIENT_ON_LINE",e[e.METHOD_NOT_AVAILABLE=35011]="METHOD_NOT_AVAILABLE",e[e.METHOD_ONLY_SUPPORT_ULTRA_GROUP=35014]="METHOD_ONLY_SUPPORT_ULTRA_GROUP",e[e.DRAFT_SAVE_ERROR=35015]="DRAFT_SAVE_ERROR",e[e.DRAFT_REMOVE_ERROR=35016]="DRAFT_REMOVE_ERROR",e[e.CONVER_REMOVE_ERROR=35020]="CONVER_REMOVE_ERROR",e[e.CONVER_GET_ERROR=35021]="CONVER_GET_ERROR",e[e.SEARCH_PROPS_LIMIT_ERROR=35022]="SEARCH_PROPS_LIMIT_ERROR",e[e.INVALID_PARAMETER_MESSAGE_TYPE=35024]="INVALID_PARAMETER_MESSAGE_TYPE",e[e.INVALID_PARAMETER_ORDER=35025]="INVALID_PARAMETER_ORDER",e[e.INVALID_PARAMETER_DRAFT=35028]="INVALID_PARAMETER_DRAFT",e[e.INVALID_PARAMETER_MESSAGE=35029]="INVALID_PARAMETER_MESSAGE",e[e.INVALID_PARAMETER_PUSH_CONTENT=35030]="INVALID_PARAMETER_PUSH_CONTENT",e[e.INVALID_PARAMETER_SENDOPTIONS=35031]="INVALID_PARAMETER_SENDOPTIONS",e[e.INVALID_PARAMETER_CONTENT_DISPOSITION=35032]="INVALID_PARAMETER_CONTENT_DISPOSITION",e[e.INVALID_PARAMETER_SAVE_NAME=35033]="INVALID_PARAMETER_SAVE_NAME",e[e.INVALID_PARAMETER_SERVER_TYPE=35034]="INVALID_PARAMETER_SERVER_TYPE",e[e.INVALID_PARAMETER_CLEAN_SPACE=35035]="INVALID_PARAMETER_CLEAN_SPACE",e[e.INVALID_PARAMETER_CAN_INCLUDE_EXPANSION=35036]="INVALID_PARAMETER_CAN_INCLUDE_EXPANSION",e[e.INVALID_PARAMETER_DISABLE_NOTIFICATION=35037]="INVALID_PARAMETER_DISABLE_NOTIFICATION",e[e.INVALID_PARAMETER_CHECK_DUPLICATE=35038]="INVALID_PARAMETER_CHECK_DUPLICATE",e[e.INVALID_PARAMETER_IS_AUTO_DELETE=35039]="INVALID_PARAMETER_IS_AUTO_DELETE",e[e.INVALID_PARAMETER_IS_SEND_NOTIFICATION=35040]="INVALID_PARAMETER_IS_SEND_NOTIFICATION",e[e.INVALID_PARAMETER_IS_FORCE=35041]="INVALID_PARAMETER_IS_FORCE",e[e.INVALID_PARAMETER_IS_TOP=35042]="INVALID_PARAMETER_IS_TOP",e[e.INVALID_PARAMETER_IS_UPDATE_TIME=35043]="INVALID_PARAMETER_IS_UPDATE_TIME",e[e.INVALID_PARAMETER_CONTAIN_MUTED=35044]="INVALID_PARAMETER_CONTAIN_MUTED",e[e.INVALID_PARAMETER_IS_STATUS_MESSAGE=35045]="INVALID_PARAMETER_IS_STATUS_MESSAGE",e[e.INVALID_PARAMETER_IS_MENTIONED=35046]="INVALID_PARAMETER_IS_MENTIONED",e[e.INVALID_PARAMETER_IS_VOIP_PUSH=35047]="INVALID_PARAMETER_IS_VOIP_PUSH",e[e.INVALID_PARAMETER_MENTIONED_TYPE=35048]="INVALID_PARAMETER_MENTIONED_TYPE",e[e.INVALID_PARAMETER_PUSH_CONFIG=35049]="INVALID_PARAMETER_PUSH_CONFIG",e[e.INVALID_PARAMETER_PUSH_DATA=35050]="INVALID_PARAMETER_PUSH_DATA",e[e.DNS_PROXY_TIMEOUT=35051]="DNS_PROXY_TIMEOUT",e[e.DNS_PROXY_ERROR=35052]="DNS_PROXY_ERROR",e[e.DNS_PROXY_DATA_ERROR=35053]="DNS_PROXY_DATA_ERROR",e[e.INVALID_DISABLE_UPDATE_LAST_MESSAGE=35054]="INVALID_DISABLE_UPDATE_LAST_MESSAGE",e[e.ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING=35055]="ONLY_DEFAULT_CHANNEL_SUPPORTS_PINNING",e[e.SEND_READ_RECEIPT_CONF_ERROR=35056]="SEND_READ_RECEIPT_CONF_ERROR",e[e.SPEECH_TO_TEXT_DISABLE=35057]="SPEECH_TO_TEXT_DISABLE",e[e.SPEECH_TO_TEXT_REQUEST_IN_PROCESS=35058]="SPEECH_TO_TEXT_REQUEST_IN_PROCESS",e[e.SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED=35059]="SPEECH_TO_TEXT_MESSAGE_CONTENT_UNSUPPORTED",e[e.TRANSLATION_PARAMS_TYPE_INVALID=35060]="TRANSLATION_PARAMS_TYPE_INVALID",e[e.TRANSLATION_PARAMS_LIST_INVALID=35061]="TRANSLATION_PARAMS_LIST_INVALID",e[e.INVALID_PARAMETER_TRANSLATE_STRATEGY=35062]="INVALID_PARAMETER_TRANSLATE_STRATEGY",e[e.TRANSLATION_LANGUAGE_SAME=35063]="TRANSLATION_LANGUAGE_SAME",e[e.INVALID_PARAMETER_TRANSLATE_MODE=35064]="INVALID_PARAMETER_TRANSLATE_MODE",e[e.TRANSLATION_TEXT_INVALID=35065]="TRANSLATION_TEXT_INVALID",e[e.MSG_BLOCK_SEND=35066]="MSG_BLOCK_SEND",e[e.CHATROOM_ID_ISNULL=36001]="CHATROOM_ID_ISNULL",e[e.CHARTOOM_JOIN_ERROR=36002]="CHARTOOM_JOIN_ERROR",e[e.CHATROOM_HISMESSAGE_ERROR=36003]="CHATROOM_HISMESSAGE_ERROR",e[e.CHATROOM_KV_NOT_FOUND=36004]="CHATROOM_KV_NOT_FOUND",e[e.BLACK_ADD_ERROR=37001]="BLACK_ADD_ERROR",e[e.BLACK_GETSTATUS_ERROR=37002]="BLACK_GETSTATUS_ERROR",e[e.BLACK_REMOVE_ERROR=37003]="BLACK_REMOVE_ERROR",e[e.DRAF_GET_ERROR=38001]="DRAF_GET_ERROR",e[e.STREAM_MESSAGE_DISABLE=39001]="STREAM_MESSAGE_DISABLE",e[e.STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED=39002]="STREAM_MESSAGE_REQUEST_COUNT_LIMIT_EXCEEDED",e[e.STREAM_MESSAGE_EXPANSION_KEY_ERROR=39003]="STREAM_MESSAGE_EXPANSION_KEY_ERROR",e[e.STREAM_MESSAGE_REQUEST_FAIL=39005]="STREAM_MESSAGE_REQUEST_FAIL",e[e.STREAM_MESSAGE_REQUEST_IN_PROCESS=39006]="STREAM_MESSAGE_REQUEST_IN_PROCESS",e[e.STREAM_MESSAGE_SYNCED=39007]="STREAM_MESSAGE_SYNCED",e[e.QNTKN_GET_ERROR=41002]="QNTKN_GET_ERROR",e[e.TIMEOUT=-1]="TIMEOUT"}(Ke||(Ke={})),function(e){e[e.NONE=0]="NONE",e[e.PRIVATE=1]="PRIVATE",e[e.DISCUSSION=2]="DISCUSSION",e[e.GROUP=3]="GROUP",e[e.CHATROOM=4]="CHATROOM",e[e.CUSTOMER_SERVICE=5]="CUSTOMER_SERVICE",e[e.SYSTEM=6]="SYSTEM",e[e.APP_PUBLIC_SERVICE=7]="APP_PUBLIC_SERVICE",e[e.PUBLIC_SERVICE=8]="PUBLIC_SERVICE",e[e.ULTRA_GROUP=10]="ULTRA_GROUP",e[e.RTC_ROOM=12]="RTC_ROOM"}(Xe||(Xe={}));const Qe=0,$e=1,Ze=2,qe=3,ze=4,et=5,tt=6,st=7,rt=e=>{const t=[Xe.PRIVATE,Xe.GROUP,Xe.SYSTEM,Xe.PUBLIC_SERVICE,Xe.APP_PUBLIC_SERVICE];switch(e){case Qe:return t;case $e:return[Xe.PRIVATE,Xe.GROUP];case Ze:return[...t,Xe.ULTRA_GROUP];case qe:return[...t,Xe.ULTRA_GROUP,Xe.CHATROOM];case ze:return[...t,Xe.ULTRA_GROUP,Xe.CHATROOM,Xe.RTC_ROOM,Xe.CUSTOMER_SERVICE,Xe.DISCUSSION];case et:return[Xe.PRIVATE,Xe.GROUP,Xe.ULTRA_GROUP];case tt:return[Xe.GROUP];case st:return[Xe.PRIVATE]}};var it,nt,ot;!function(e){e[e.RMTP=1]="RMTP",e[e.TLS=2]="TLS",e[e.RPP=3]="RPP",e[e.QUIC=4]="QUIC",e[e.WS=5]="WS",e[e.WSS=6]="WSS",e[e.HTTP=11]="HTTP",e[e.HTTPS=12]="HTTPS"}(it||(it={})),function(e){e[e.IMAGE=1]="IMAGE",e[e.AUDIO=2]="AUDIO",e[e.VIDEO=3]="VIDEO",e[e.FILE=4]="FILE",e[e.SIGHT=5]="SIGHT",e[e.COMBINE_HTML=6]="COMBINE_HTML"}(nt||(nt={})),function(e){e[e.ALL=1]="ALL",e[e.SINGAL=2]="SINGAL"}(ot||(ot={}));const at="RC:TxtMsg",ct="RC:VcMsg",_t="RC:HQVCMsg",lt="RC:LogCmdMsg",dt="RC:MsgExMsg",Et="RC:ReferenceMsg",ut="RC:RcCmd",Rt="RC:RcNtf",ht="RC:ReadNtf",It="RC:RRReqMsg",gt="RC:RRRspMsg",Tt="RC:SRSMsg",Nt="RC:RRMsg",Ct="RC:RSMsg",Ot="RC:Delivered",pt="RC:DRMsg",St="RC:ChrmMemChange",At="RC:ChrmSyncMsg",ft="RC:ChrmBlockMsg",mt="RC:ChrmBanMsg",vt="RC:CCConfigChangeRequestMsg",Pt="RC:CmdMsg",Lt="RC:CmdNtf",Mt="RC:InfoNtf",Ut="RC:GrpNtf";var Dt,bt,yt,Vt,Gt,kt,Ft,wt,Ht,Bt,Jt,jt,Wt,xt,Yt,Kt,Xt,Qt,$t,Zt,qt;!function(e){e[e.PUBLIC=0]="PUBLIC",e[e.PRIVATE=1]="PRIVATE"}(Dt||(Dt={})),function(e){e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(bt||(bt={})),function(e){e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY",e[e.MSG_RECALL=3]="MSG_RECALL",e[e.CHANNEL_CHANGE=4]="CHANNEL_CHANGE",e[e.USER_GROUP_CHANGE=5]="USER_GROUP_CHANGE",e[e.UG_DEL=6]="UG_DEL"}(yt||(yt={})),function(e){e[e.CHANNEL_DELETE=1]="CHANNEL_DELETE",e[e.PUBLIC_TO_PRIVATE=2]="PUBLIC_TO_PRIVATE",e[e.PRIVATE_TO_PUBLIC=3]="PRIVATE_TO_PUBLIC",e[e.PRIVATE_CHANNEL_USER_JOIN_PUBLIC=4]="PRIVATE_CHANNEL_USER_JOIN_PUBLIC",e[e.CHANNEL_USER_KICKED=5]="CHANNEL_USER_KICKED",e[e.PUBLIC_TO_PRIVATE_USER_NOT_IN=6]="PUBLIC_TO_PRIVATE_USER_NOT_IN"}(Vt||(Vt={})),function(e){e[e.REMOVE_USER_GROUP=1]="REMOVE_USER_GROUP",e[e.JOIN_USER_GROUP=2]="JOIN_USER_GROUP",e[e.EXIT_USER_GROUP=3]="EXIT_USER_GROUP",e[e.CHANNEL_BIND_USER_GROUP=4]="CHANNEL_BIND_USER_GROUP",e[e.CHANNEL_UNBIND_USER_GROUP=5]="CHANNEL_UNBIND_USER_GROUP"}(Gt||(Gt={})),function(e){e[e.NOT_MENTIONED=0]="NOT_MENTIONED",e[e.ALL=1]="ALL",e[e.ME=2]="ME"}(kt||(kt={})),function(e){e[e.SENDING=10]="SENDING",e[e.FAILED=20]="FAILED",e[e.SENT=30]="SENT",e[e.RECEIVED=40]="RECEIVED",e[e.READ=50]="READ",e[e.DESTROYED=60]="DESTROYED"}(Ft||(Ft={})),function(e){e[e.typing=0]="typing"}(wt||(wt={})),function(e){e[e.ONLINE=1]="ONLINE",e[e.OFFLINE=0]="OFFLINE"}(Ht||(Ht={})),function(e){e[e.Other=0]="Other",e[e.iOS=1]="iOS",e[e.Android=2]="Android",e[e.Web=3]="Web",e[e.PC=4]="PC",e[e.Mini=5]="Mini",e[e.HarmonyOS=6]="HarmonyOS"}(Bt||(Bt={})),function(e){e[e.ONLINE_STATUS=1]="ONLINE_STATUS",e[e.USER_PROFILE=2]="USER_PROFILE",e[e.FRIEND_ONLINE_STATUS=3]="FRIEND_ONLINE_STATUS",e[e.FRIEND_USER_PROFILE=4]="FRIEND_USER_PROFILE"}(Jt||(Jt={})),function(e){e[e.SUBSCRIBE=0]="SUBSCRIBE",e[e.UNSUBSCRIBE=1]="UNSUBSCRIBE"}(jt||(jt={})),function(e){e[e.NOT_SET=0]="NOT_SET",e[e.INVISIBLE=1]="INVISIBLE",e[e.EVERYONE=2]="EVERYONE",e[e.FriendVisible=3]="FriendVisible"}(Wt||(Wt={})),function(e){e[e.CONNECTED=0]="CONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.DISCONNECTED=2]="DISCONNECTED",e[e.SUSPENDED=3]="SUSPENDED"}(xt||(xt={})),function(e){e[e.GLOBAL=1]="GLOBAL",e[e.CUSTOM=2]="CUSTOM",e[e.THIRD_PARTY=3]="THIRD_PARTY"}(Yt||(Yt={})),function(e){e[e.MSG_ORIGINAL=0]="MSG_ORIGINAL",e[e.MSG_EXPANSION=1]="MSG_EXPANSION",e[e.MSG_MODIFY=2]="MSG_MODIFY"}(Kt||(Kt={})),function(e){e[e.SEND=1]="SEND",e[e.RECEIVE=2]="RECEIVE"}(Xt||(Xt={})),function(e){e.NORMAL="NORMAL",e.LOW="LOW"}(Qt||(Qt={})),function(e){e.IM_NAVI="IM-stats_navi-S",e.IM_WEBSOCKET="IM-stats_websocket-S",e.IM_CONNECTION_DURATION="IM-stats_con_dur-S",e.IM_CMP="IM-stats_cmp-S",e.IM_CMP_RMTP="IM-stats_cmp_rmtp-S",e.IM_STATS_CS="IM-stats_cs-S",e.IM_NETWORK_CHANGE="IM-stats_network_change-S",e.L_CLOUD_INFO_FETCH_T="L-cloud_info_fetch-T",e.L_CLOUD_INFO_FETCH_R="L-cloud_info_fetch-R",e.IM_MSG_SEND="IM-msg_send-S",e.IM_MSG_RECEIVE="IM-msg_receive-S"}($t||($t={})),function(e){e[e.ALL_MESSAGE=-1]="ALL_MESSAGE",e[e.NOT_SET=0]="NOT_SET",e[e.AT_MESSAGE_NOTIFICATION=1]="AT_MESSAGE_NOTIFICATION",e[e.AT_USER_NOTIFICATION=2]="AT_USER_NOTIFICATION",e[e.AT_GROUP_ALL_USER_NOTIFICATION=4]="AT_GROUP_ALL_USER_NOTIFICATION",e[e.NOT_MESSAGE_NOTIFICATION=5]="NOT_MESSAGE_NOTIFICATION"}(Zt||(Zt={})),function(e){e[e.OPEN=1]="OPEN",e[e.CLOSE=2]="CLOSE"}(qt||(qt={}));const zt=e=>e<=Zt.NOT_SET?qt.CLOSE:qt.OPEN;var es,ts,ss,rs,is,ns,os,as,cs;!function(e){e[e.READ=1]="READ",e[e.LISTENED=2]="LISTENED",e[e.DOWNLOADED=4]="DOWNLOADED",e[e.RETRIEVED=8]="RETRIEVED",e[e.UNREAD=0]="UNREAD"}(es||(es={})),function(e){e[e.PRIVATE=1]="PRIVATE",e[e.OPEN=0]="OPEN"}(ts||(ts={})),function(e){e[e.NAVI=1]="NAVI",e[e.TCP=2]="TCP",e[e.WS=3]="WS"}(ss||(ss={})),function(e){e[e.REQUEST=0]="REQUEST",e[e.LOCAL=1]="LOCAL"}(rs||(rs={})),function(e){e[e.CURRENT=2]="CURRENT"}(is||(is={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT"}(ns||(ns={})),function(e){e[e.CONNECT=0]="CONNECT",e[e.RECONNECT=1]="RECONNECT",e[e.REDIRECTED=3]="REDIRECTED",e[e.TIMEOUT=4]="TIMEOUT"}(os||(os={})),function(e){e.PASSIVE="passive",e.ACTIVE="active",e.TIME_SENSITIVE="time-sensitive",e.CRITICAL="critical"}(as||(as={})),function(e){e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT=0]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_DEFAULT",e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE=1]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_MENTION_MESSAGE",e[e.PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED=5]="PUSH_NOTIFICATION_QUIET_HOURS_LEVEL_BLOCKED"}(cs||(cs={}));const _s=0,ls=0,ds=0;var Es,us;!function(e){e.WIFI="wifi",e.FOUR_G="4g",e.THREE_G="3g",e.TWO_G="2g",e.FIVE_G="2g",e.THREE_GENT="3gnet",e.UNKONWN="unknown"}(Es||(Es={})),function(e){e.GET="GET",e.POST="POST",e.PUT="PUT"}(us||(us={}));const Rs=72e5,hs=6e4,Is="5.44.0".replace(/-.+$/,""),gs="rongcloudsystem",Ts="undefined"!=typeof window&&window?(window.__RCVersionInfo||(window.__RCVersionInfo={}),window.__RCVersionInfo):{},Ns="engine";Ts[Ns]="5.44.0";class Cs{static add(e,t){["imlib-next","engine","electron-main","electron-renderer","imlib-v2-adapter","Global_IM_UIKit","IMKit","imkit-store","rtclib","calllib","callplus","plugin-wechat-rtc"].includes(e)&&(Ts[e]=t)}static validEngine(e){const t=e.match(/\d+\.\d+\.\d+/);if(!t)return!1;const s=t[0].split(".").map((e=>e.padStart(3,"0"))).join("");return Ts[Ns].match(/\d+\.\d+\.\d+/)[0].split(".").map((e=>e.padStart(3,"0"))).join("")>=s}static getInfo(){return Ts}}const Os={gen:()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=Math.floor(36*Math.random());return("x"===e?t:3&t|8).toString(36)})),genWithLen(e=22){const t=Date.now(),s=t.toString(36),r=Math.floor(Math.random()*t).toString(36),i=e-s.length-r.length;var n;return[r,s,i>0?(n=i,Array.from({length:n}).map((()=>Math.floor(36*Math.random()).toString(36))).join("")):""].join("").slice(0,e)}},ps=Os.genWithLen(22),Ss=Date.now(),As=e=>-1!==Object.prototype.toString.call(e).indexOf("Array"),fs=e=>(e=>"string"==typeof e)(e)&&/https?:\/\//.test(e),ms=e=>{for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1},vs=e=>({isRead:(e&es.READ)===es.READ,isListened:(e&es.LISTENED)===es.LISTENED,isDownload:(e&es.DOWNLOADED)===es.DOWNLOADED,isRetrieved:(e&es.RETRIEVED)===es.RETRIEVED}),Ps=e=>[Bt.iOS,Bt.Android,Bt.Web,Bt.PC,Bt.Mini,Bt.HarmonyOS].map((t=>{const s=e.findIndex((e=>e.platform===t));return-1===s?{platform:t,changeTime:0,eventValue:0}:e[s]})),Ls=(e,t,s)=>t?1===s?it.TLS:it.RMTP:"http"===e?it.WS:it.WSS,Ms=(e,t)=>{const{server:s,backupServer:r,bs:i,serverAddr:n,protocol:o,openTLS:a}=e;if(n){return[...n.filter((e=>e.addr))]}const c=[],_=[];return s&&_.push(s),(r||i||"").split(",").forEach((e=>{_.indexOf(e)<0&&_.push(e)})),_.forEach(((e,r)=>{e&&c.push({addr:e,protocol:Ls(o,t,a),weight:s.length-r,race:!1})})),[...c]},Us=e=>{if(void 0===e)return;const t=Number(e);return Number.isNaN(t)?void 0:t},Ds=e=>e.reduce(((e,t)=>(e[t.key]=t.value,e)),{}),bs=(e,t)=>{const s=Math.floor(1e3*Math.random()%1e4),r=Os.gen(),i=(e=>{e=e||"-";const t=new Date;return`${t.getFullYear()}${e}${t.getMonth()+1}${e}${t.getDate()}`})(),n=(new Date).getTime();let o="";if(t){const e=t.split(".");o=`.${e[e.length-1]}`}return`${e}__RC-${i}_${s}_${n}${r}${o}`},ys=(e={},t={},s={})=>{const{channelIdMi:r,channelIdHW:i,channelIdOPPO:n,typeVivo:o,importanceHW:a,categoryHW:c,imageUrlHW:_,categoryVivo:l,importanceHonor:d,imageUrlHonor:E}=t,{APNS:u,FCM:R}=((e={},t={})=>{const{threadId:s,apnsCollapseId:r,category:i,richMediaUri:n,interruptionLevel:o}=e,{googleConfig:a}=t,c={};c["thread-id"]=s||"",c["apns-collapse-id"]=r||"",c.category=i||"",c.richMediaUri=n||"",c["interruption-level"]=o||"active";const _={};_.collapse_key=null==a?void 0:a.collapseKey,_.imageUrl=null==a?void 0:a.imageUrl;let l=null==a?void 0:a.priority;return l&&!["high","normal"].includes(l)&&(l="normal"),_.priority=l,{APNS:c,FCM:_}})(e,t),h=[{HW:{channelId:i||"",importance:a||"NORMAL",image:_||"",category:c||""}},{MI:{channelId:r||""}},{OPPO:{channelId:n||""}},{VIVO:{classification:o||"",category:l||""}},{APNS:u},{FCM:R},{HONOR:{importance:d||Qt.NORMAL,image:E||""}},{OHOS:{category:s.category||null,image:s.image||""}}];return JSON.stringify(h)},Vs=()=>{const e=Cs.getInfo();let t="electron";for(let s in e)"engine"!==s&&(t=["imlib-v2-adapter","imlib-next"].includes(s)?s:"electron");return t};function Gs(e,t){var s;if(!e)return"";const r="undefined"!=typeof window&&"https:"===(null===(s=null===window||void 0===window?void 0:window.location)||void 0===s?void 0:s.protocol);return/^https?:\/\//.test(e)?r?e.replace(/^https?:\/\//i,"https://"):e:t!==it.HTTP||r?`https://${e}`:`http://${e}`}const ks=(e,t)=>{if(!e)return"";const{ossConfig:s=""}=e;let r="";try{const e=JSON.parse(s);if(e.length>0){const t=e.find((e=>e.minio));t&&(r=t.minio)}}catch(e){t.warn(he,JSON.stringify({ossConfig:s,error:e}))}return r};var Fs;class ws{constructor(){Fs.set(this,!1)}stopPropagation(){G(this,Fs,!0,"f")}get isStopPropagation(){return V(this,Fs,"f")}}Fs=new WeakMap;class Hs{constructor(){Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_piped",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}_addItem(e,t,s,r,i=0){const n=Symbol(),o=this._map.get(e)||this._map.set(e,[]).get(e),a={symbol:n,priority:Math.min(i,100),listener:t.bind(r),once:s},c=o.findIndex((e=>e.priority>i));return-1===c?o.push(a):o.splice(c,0,a),n}on(e,t,s,r=0){return this._addItem(e,t,!1,s,r)}once(e,t,s,r=0){return this._addItem(e,t,!0,s,r)}off(e){for(let[t,s]of this._map){const t=s.findIndex((t=>t.symbol===e));if(-1!==t)return void s.splice(t,1)}}emit(e,...t){const s=this._map.get(e);if(s&&s.length>0){const e=new ws;for(let r=0;r<s.length;r+=1){const{once:i,listener:n}=s[r];i&&s.splice(r,1);try{n(e,...t)}catch(e){null===console||void 0===console||console.error(e)}if(e.isStopPropagation)return}}[...this._piped.entries()].forEach((([s,r])=>{(0===r.length||r.includes(e))&&s.emit(e,...t)}))}removeAll(e){this._map.delete(e)}clear(){this._piped.clear(),this._map.clear()}pipe(e,t){this._piped.set(e,t||[])}}class Bs{constructor(e,t,s){Object.defineProperty(this,"isOk",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"msg",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.isOk=0===e,this.code=e,this.msg=t,this.data=s}static from(e,t,s){return new Bs(e,t||`fail: ${e}`,s)}static ok(e,t){return new Bs(0,t||"success",e)}static fail(e,t,s){return new Bs(e,t||`fail: ${e}`,s)}next(e){return y(this,void 0,void 0,(function*(){return this.isOk?e(this.data):this.wipe()}))}or(e){return y(this,void 0,void 0,(function*(){return this.isOk?this:e(this.code)}))}orSync(e){return this.isOk?this:e(this.code)}trans(e){return this.isOk?Js(e(this.data)):this.wipe()}tryTrans(e){return this.isOk?e(this.data):this.wipe()}errmsg(){return JSON.stringify({code:this.code,msg:this.msg})}wipe(){return this.isOk?Js(void 0,this.msg):js(this.code,this.msg)}}const{ok:Js}=Bs,{fail:js}=Bs,Ws="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function xs(e){let t,s,r,i,n,o,a,c="",_=0;for(e=e.replace(/[^A-Za-z0-9+/=]/g,"");_<e.length;)i=Ws.indexOf(e.charAt(_++)),n=Ws.indexOf(e.charAt(_++)),o=Ws.indexOf(e.charAt(_++)),a=Ws.indexOf(e.charAt(_++)),t=i<<2|n>>4,s=(15&n)<<4|o>>2,r=(3&o)<<6|a,c+=String.fromCharCode(t),64!==o&&(c+=String.fromCharCode(s)),64!==a&&(c+=String.fromCharCode(r));return c}const Ys=()=>{let e,t=new Promise((t=>{e=t}));return{resolve:e,promise:t}};function Ks(e){if(!e||0===e.length)return[];const t=new Set;return e.forEach((e=>{t.add(e)})),Array.from(t)}var Xs;!function(e){e[e.add=1]="add",e[e.update=2]="update",e[e.delete=3]="delete"}(Xs||(Xs={}));const Qs=0,$s=1;var Zs;!function(e){e[e.BJ=1]="BJ",e[e.SG=2]="SG",e[e.NA=3]="NA",e[e.SG_A=4]="SG_A",e[e.SG_B=4]="SG_B",e[e.SA=5]="SA",e[e.OM=6]="OM"}(Zs||(Zs={}));const qs={[Zs.BJ]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5yb25nLWVkZ2UuY29t","bmF2LWIucm9uZy1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ucm9uZy1lZGdlLmNvbQ==",protocol:it.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnJvbmctZWRnZS5jb20=","d3MtYi5yb25nLWVkZ2UuY29t"],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWMtMS5vc3MtY24tYmVpamluZy5hbGl5dW5jcy5jb20="],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5yb25nLWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIucm9uZy1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5yb25nLWVkZ2UuY29t"]},[Zs.SG]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zZy1saWdodC1lZGdlLmNvbQ==","bmF2LWIuc2ctbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2ctbGlnaHQtZWRnZS5jb20=",protocol:it.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWxpZ2h0LWVkZ2UuY29t","d3MtYi5zZy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:["aHR0cHM6Ly9ib290c3RyYXBwcm9maWxlLWItMi5zMy5hcC1zb3V0aGVhc3QtMS5hbWF6b25hd3MuY29t"],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIuc2ctbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1saWdodC1lZGdlLmNvbQ=="]},[Zs.NA]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi51cy1saWdodC1lZGdlLmNvbQ==","bmF2LWIudXMtbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24udXMtbGlnaHQtZWRnZS5jb20=",protocol:it.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnVzLWxpZ2h0LWVkZ2UuY29t","d3MtYi51cy1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC51cy1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIudXMtbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy51cy1saWdodC1lZGdlLmNvbQ=="]},[Zs.SG_B]:{naviUrlBase64:["bmF2LnNnLWItbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],logUrlBase64:[{addr:"Y29sbGVjdGlvbi5zZy1iLWxpZ2h0LWVkZ2UuY29t",protocol:it.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNnLWItbGlnaHQtZWRnZS5jb20=","d3MtYi5zZy1iLWxpZ2h0LWVkZ2UuY29t"],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zZy1iLWxpZ2h0LWVkZ2UuY29t","Y2xvdWRjb250cm9sLWIuc2ctYi1saWdodC1lZGdlLmNvbQ=="],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zZy1iLWxpZ2h0LWVkZ2UuY29t"]},[Zs.SA]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5zYXUtbGlnaHQtZWRnZS5jb20=","bmF2LWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24uc2F1LWxpZ2h0LWVkZ2UuY29t",protocol:it.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLnNhdS1saWdodC1lZGdlLmNvbQ==","d3MtYi5zYXUtbGlnaHQtZWRnZS5jb20="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5zYXUtbGlnaHQtZWRnZS5jb20=","Y2xvdWRjb250cm9sLWIuc2F1LWxpZ2h0LWVkZ2UuY29t"],statsUrlBase64:["aHR0cHM6Ly9zdGF0cy5zYXUtbGlnaHQtZWRnZS5jb20="]},[Zs.OM]:{naviUrlBase64:["ZHVhbHN0YWNrLW5hdi5vbS1saWdodC1lZGdlLmNvbQ==","bmF2LWIub20tbGlnaHQtZWRnZS5jb20="],logUrlBase64:[{addr:"ZHVhbHN0YWNrLWNvbGxlY3Rpb24ub20tbGlnaHQtZWRnZS5jb20=",protocol:it.HTTPS,weight:-1}],miniCmpBase64:["ZHVhbHN0YWNrLXdzLm9tLWxpZ2h0LWVkZ2UuY29t","d3MtYi5vbS1saWdodC1lZGdlLmNvbQ=="],staticConfigUrlBase64:[],cloudControllerUrlBase64:["ZHVhbHN0YWNrLWNsb3VkY29udHJvbC5vbS1saWdodC1lZGdlLmNvbQ==","Y2xvdWRjb250cm9sLWIub20tbGlnaHQtZWRnZS5jb20="],statsUrlBase64:["aHR0cHM6Ly9kdWFsc3RhY2stc3RhdHMub20tbGlnaHQtZWRnZS5jb20="]}};function zs(e){return Zs[e]?e:Zs.BJ}const er=new class{constructor(){Object.defineProperty(this,"initOption",{enumerable:!0,configurable:!0,writable:!0,value:{}})}init(e){this.initOption=e}getNaviUrlList(e,t){const{areaCode:s,navigators:r}=this.initOption||{},i=function(e=Zs.BJ){return qs[zs(e)].naviUrlBase64}(s).map((e=>xs(e)));let n=[];const[,o]=e.split("@");t&&(n=o?o.split(";"):[]);const a=r&&r.length>0?[...n,...r]:[...n,...i];return a.filter(((e,t)=>a.indexOf(e)===t)).map((e=>Gs(e)))}getLogUrlPolicyList(e,t){const{log:s,logPolicy:r}=e||{},{areaCode:i,logServerUrl:n}=this.initOption||{},o=function(e=Zs.BJ){return qs[zs(e)].logUrlBase64}(i).map((e=>Object.assign(Object.assign({},e),{addr:xs(e.addr)}))),a=[],c={level:1,itv:6,times:5};if(s)a.push(...s.addrs),Object.assign(c,s.policy);else if(r)try{const e=JSON.parse(r);a.push({addr:e.url,protocol:it.HTTPS,weight:1}),c.level=e.level,c.itv=e.itv,c.times=e.times}catch(s){t.warn(te,JSON.stringify({policy:e.logPolicy}))}const _=n?[{addr:n,protocol:it.HTTPS,weight:101},...a]:[...a,...o];return{policy:c,addrs:_.filter(((e,t)=>_.findIndex((t=>t.addr===e.addr&&t.protocol===e.protocol))===t)).map((e=>Object.assign(Object.assign({},e),{addr:Gs(e.addr,e.protocol)}))).sort(((e,t)=>t.weight-e.weight))}}getMiniCmpUrlList(){var e;const t=function(e=Zs.BJ){return qs[zs(e)].miniCmpBase64}(null===(e=this.initOption)||void 0===e?void 0:e.areaCode).map((e=>xs(e))),{miniCMPProxy:s}=this.initOption||{};return s&&s.length>0?s:t}getStaticConfigUrl(){var e;return function(e=Zs.BJ){return qs[zs(e)].staticConfigUrlBase64}(null===(e=this.initOption)||void 0===e?void 0:e.areaCode).map((e=>xs(e)))}getCloudControllerUrl(e){var t;return function(e=Zs.BJ){return qs[zs(e)].cloudControllerUrlBase64}(null!=e?e:null===(t=this.initOption)||void 0===t?void 0:t.areaCode).map((e=>xs(e)))}getAreaCode(){var e,t;return null!==(t=null===(e=this.initOption)||void 0===e?void 0:e.areaCode)&&void 0!==t?t:Zs.BJ}setAreaCode(e){return!(!e||!Zs[e]||e===this.initOption.areaCode)&&(this.initOption.areaCode=e,!0)}getStatsUrlList(e){var t;const{active:s,activeServer:r}=e||{};let i=(null==s?void 0:s.addrs)||[];const n=function(e=Zs.BJ){return qs[zs(e)].statsUrlBase64}(null===(t=this.initOption)||void 0===t?void 0:t.areaCode).map((e=>xs(e))),o=[];return 0!==i.length?o.push(...i.sort(((e,t)=>t.weight-e.weight)).map((e=>Gs(e.addr,e.protocol)))):r&&o.push(Gs(r,it.HTTPS)),n.forEach((e=>{o.includes(e)||o.push(e)})),o}};class tr{constructor(e,t){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticUrls",{enumerable:!0,configurable:!0,writable:!0,value:[]})}getStaticConfig(){var e;return y(this,void 0,void 0,(function*(){const t=this.getCache();if(t){try{const e=JSON.parse(t);if(Date.now()-(null==e?void 0:e.time)<18e5){const t=(yield this.decryptData(e.val)).resources.navi.slice();return t.sort(((e,t)=>t.weight-e.weight)),{navi:t.map((e=>Gs(e.addr,e.protocol)))||[]}}}catch(e){this.logger.error(ce,JSON.stringify({error:null==e?void 0:e.stack}))}this.clearCache()}const s=yield this._requestHandle();if(!s)return;const r=yield this.decryptData(s);if((null==r?void 0:r.areaCode)!==er.getAreaCode())return;this.setCache(JSON.stringify({time:Date.now(),val:s})),this.staticUrls=(null==r?void 0:r.bootstrap)||[];const i=null===(e=null==r?void 0:r.resources)||void 0===e?void 0:e.navi.slice();return i.sort(((e,t)=>t.weight-e.weight)),{navi:i.map((e=>Gs(e.addr,e.protocol)))||[]}}))}_requestHandle(){return y(this,void 0,void 0,(function*(){let e=[...this.staticUrls,...er.getStaticConfigUrl()].map((e=>Gs(e)));e=e.filter(((t,s)=>e.indexOf(t)===s));for(let t of e){this.logger.info(oe,JSON.stringify({url:t}));const e=Date.now(),{code:s,data:r}=yield this.sendRequest(`${t}/${this.appkey}`);if(200===s)return this.logger.info(ae,JSON.stringify({url:t,code:s,duration:Date.now()-e})),r;this.logger.warn(ae,JSON.stringify({url:t,code:s,duration:Date.now()-e}))}}))}}var sr;!function(e){e[e.STATISTICS=-2]="STATISTICS",e[e.RECORD=-1]="RECORD",e[e.FATAL=0]="FATAL",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG"}(sr||(sr={}));class rr{constructor(e,t,s,r){Object.defineProperty(this,"_appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_id",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_type",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"proxy",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"outputLevel",{enumerable:!0,configurable:!0,writable:!0,value:sr.WARN}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,sr.DEBUG)}),Object.defineProperty(this,"info",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,sr.INFO)}),Object.defineProperty(this,"warn",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,sr.WARN)}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,sr.ERROR)}),Object.defineProperty(this,"__statistics",{enumerable:!0,configurable:!0,writable:!0,value:this._log.bind(this,sr.STATISTICS)}),Object.defineProperty(this,"record",{enumerable:!0,configurable:!0,writable:!0,value:this.__statistics})}_write(e){const{tag:t,level:s,content:r,traceId:i}=e;/^[\w-]+$/.test(t)?s!==sr.DEBUG&&this.proxy.write(e):console.error(`${(new Date).toISOString()}[${this._id}]['ERROR']: ${t} | ${r} | ${i}`)}createTraceId(){return""+ ++rr._traceIdCount}getSessionId(){return ps}_stdout(e){const{time:t,tag:s,content:r,traceId:i,level:n,loggerId:o}=e;if(!console)return;if(n<=sr.FATAL)return;if(n>this.outputLevel)return;const a=["error","warn","info","debug"][n-1],c=`${new Date(t).toISOString()}[${null!=o?o:this._id}][${(a||"stat").toUpperCase()}]: ${s} | ${r} | ${i}`;console[a||"warn"](c)}setOutputLevel(e){(e=>[sr.DEBUG,sr.INFO,sr.WARN,sr.ERROR].some((t=>t===e)))(e)&&(this.outputLevel=e)}_log(e,t,s,r){const i={time:Date.now(),level:e,tag:t,content:s,traceId:r,loggerId:this._id,sessionId:this.getSessionId(),type:this._type};this._stdout(i),this._write(i)}summary(e,t,s,r={},i,n){if(t.isOk){const n=null==i?void 0:i(t.data);this.info(e,JSON.stringify(Object.assign(Object.assign({isOk:!0},r),n)),s)}else{const i=null==n?void 0:n(t.data);this.warn(e,JSON.stringify(Object.assign(Object.assign({code:t.code,msg:t.msg},r),i)),s)}}}Object.defineProperty(rr,"_traceIdCount",{enumerable:!0,configurable:!0,writable:!0,value:0});class ir{constructor(e,t,s,r,i=!1){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"deviceInfo",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logDB",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"disableLogReport",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"userId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"started",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"reportFailedNumber",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"itvByNavi",{enumerable:!0,configurable:!0,writable:!0,value:6}),Object.defineProperty(this,"timesByNavi",{enumerable:!0,configurable:!0,writable:!0,value:5})}_getLogs(e,t,s,r,i,n){return y(this,void 0,void 0,(function*(){let i=[];try{const o=yield this.logDB.read(e,t,s,r,n);As(o.logs)&&(i=o.logs.filter((e=>!(!e||"object"!=typeof e))))}catch(e){}return{logs:i}}))}checkStart(e,t){return y(this,void 0,void 0,(function*(){if(this.started)return;if(this.userId=e.userId,!e.logSwitch||this.disableLogReport)return;const{policy:s,addrs:r}=er.getLogUrlPolicyList(e,this.logger);this.started=!0,this.itvByNavi=s.itv,this.timesByNavi=s.times,r.length>0&&this.realtimeReport(r[0].addr,s.level,s.itv,t)}))}_sendLogs2Realtime(e,t,s,r){return y(this,void 0,void 0,(function*(){const{success:i,data:n}=yield this.compressLogs(e);if(!i)return{isOk:!1,itv:r};let o=fs(s)?s:`https://${s}`;o+=`?version=5.44.0&appkey=${this.appkey}&userId=${encodeURIComponent(this.userId)}&deviceId=${this.getDeviceId()}&deviceInfo=${this.deviceInfo}&platform=Web`;const{status:a,data:c}=yield this.send({url:o,body:n,method:"POST"});if(200!==a)return this.reportFailedNumber>this.timesByNavi&&this.itvByNavi<60&&(r+=r),this.reportFailedNumber++,{isOk:!1,itv:r};let _,l;if(this.reportFailedNumber=0,c)try{const e=JSON.parse(c);e.nextTime&&(r=e.nextTime),_=e.level,l=e.logSwitch}catch(e){this.logger.warn(he,JSON.stringify({error:null==e?void 0:e.stack}),t)}return{isOk:!0,itv:r,level:_,logSwitch:l}}))}realtimeReport(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=Date.now(),n=this.logger.getTimestamp4RealtimeLog()||Ss,o=Math.max(i-3e4,n+1),a=this.logger.createTraceId(),{logs:c}=yield this._getLogs(n,o,t,!0,a,r);if(0===c.length);else if(c.length>0){const{itv:r,level:i,logSwitch:n,isOk:o}=yield this._sendLogs2Realtime(c,a,e,s);if(o){const e=Math.max(...c.map((e=>e.time)));this.logger.setTimestamp4RealtimeLog(e+1),0===n&&(this.started=!1),void 0!==i&&(t=i)}s=r}this.started&&(s>=60&&this.itvByNavi<60&&(s=60),this.timer=setTimeout((()=>this.realtimeReport(e,t,s,r)),1e3*s))}))}report(e,t,s,r,i,n,o=!1){return y(this,void 0,void 0,(function*(){if("web"!==s.toLowerCase()||this.disableLogReport)return;const a=this.logger.createTraceId();this.logger.info(z,JSON.stringify({startTime:e,endTime:t,logId:i,messageUId:n,isCloudControl:o}),a);const{logs:c}=yield this._getLogs(e,t,sr.DEBUG,!1,a);this.logger.info(q,JSON.stringify({count:c.length}),a);let _,l=fs(r)?r:`https://${r}`;if(l+=`?version=5.44.0&appkey=${this.appkey}&userId=${encodeURIComponent(this.userId)}&deviceId=${this.getDeviceId()}&deviceInfo=${this.deviceInfo}&platform=Web&logId=${i}`,c.length>0){const{success:e,data:t}=yield this.compressLogs(c);_=e?t:"compress failed"}else _="no data or no database";this.logger.debug(q,"compress done",a),o&&(l+="&source=cloud");const{status:d}=yield this.send({url:l,body:_,method:"POST"});this.logger.info(ee,JSON.stringify({status:d}),a)}))}stop(){this.timer&&(clearTimeout(this.timer),this.timer=null),this.started=!1}}function nr(e){try{return!(!e||"object"!=typeof e)&&("number"==typeof e.time&&("string"==typeof e.tag&&("string"==typeof e.sessionId&&("string"==typeof e.type&&"number"==typeof e.level))))}catch(e){return!1}}var or,ar,cr,_r,lr,dr,Er,ur;function Rr(){return y(this,void 0,void 0,(function*(){return{logs:[]}}))}function hr(){}class Ir{constructor(e,t){or.set(this,void 0),ar.set(this,void 0),G(this,or,e,"f"),G(this,ar,t,"f")}read(e,t,s,r,i){return y(this,void 0,void 0,(function*(){try{const n=yield V(this,or,"f").call(this,e,t,s,r,i);if(!n||!Array.isArray(n.logs))return{logs:[]};return{logs:n.logs.filter(nr)}}catch(e){return console.error("[LogDBProxy] read error",e),{logs:[]}}}))}write(e){try{V(this,ar,"f").call(this,e)}catch(e){console.error("[LogDBProxy] write error",e)}}setLogReader(e){return"function"==typeof e&&G(this,or,e,"f"),this}setLogWriter(e){return"function"==typeof e&&G(this,ar,e,"f"),this}}or=new WeakMap,ar=new WeakMap;class gr{static start(e){V(this,cr,"f",_r)||(G(this,cr,e,"f",_r),e.info(Ie,"start"),V(this,cr,"m",ur).call(this))}static stop(){V(this,cr,"f",_r)&&(V(this,cr,"f",_r).info(Ie,"stop"),G(this,cr,null,"f",_r),V(this,cr,"f",lr)&&(clearTimeout(V(this,cr,"f",lr)),G(this,cr,null,"f",lr)))}}cr=gr,ur=function e(){const t=Date.now();G(this,cr,setTimeout((()=>{const s=Date.now()-t;s>=V(this,cr,"f",Er)&&V(this,cr,"f",_r).warn(Ie,`delta time: ${s}ms`),V(this,cr,"m",e).call(this)}),V(this,cr,"f",dr)),"f",lr)},_r={value:null},lr={value:null},dr={value:30},Er={value:1500};const Tr=1,Nr=2,Cr=3;class Or{constructor(e){Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"uploadTask",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"taskLock",{enumerable:!0,configurable:!0,writable:!0,value:!0})}uploadLogCmdTask(e){this.uploadTask.push(e),this.enqueueTask()}reportLogCmdTask(e){var t,s,r,i;this.taskLock=!1;const n=null!==(t=e.startTime)&&void 0!==t?t:0,o=null!==(s=e.endTime)&&void 0!==s?s:0,a=null!==(r=e.platform)&&void 0!==r?r:"",c=null!==(i=e.uri)&&void 0!==i?i:"";e.logId!==this.logId&&""!==c&&(this.logId=e.logId,this.reporter.report(n,o,a,c,e.logId,"",!0).finally((()=>{this.taskLock=!0,this.uploadTask.length>0&&this.enqueueTask()})))}enqueueTask(){if(!this.taskLock)return;const e=this.uploadTask.shift();e&&this.reportLogCmdTask(e)}}class pr{constructor(e,t,s){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"isEable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"expire",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"interval",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"timestamp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"lastRequestTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uploadTaskManage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"changeAreaCode",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_cache",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.uploadTaskManage=new Or(s)}init(){try{const e=this.getLocalCloudControllerCache();this._cache=e?JSON.parse(e):{timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}catch(e){this._cache={timestamp:0,lastRequestTime:0,cc:{temporary:!1,enable:!0,expire:72e5,interval:6e5},uploadLog:{temporary:!0,tasks:[]},mrtr:{chatroom:0,group:0,private:0,ultraGroup:0,temporary:!1}}}this._cache&&(this.interval=this._cache.cc.interval,this.expire=this._cache.cc.expire,this.timestamp=this._cache.timestamp||0,this.isEable=this._cache.cc.enable,this.lastRequestTime=this._cache.lastRequestTime,this.logCmdMsgTasks(this._cache),this.setMRTRConfig(this._handleMrtrData(this._cache.mrtr)))}isExire(){return(new Date).getTime()-this.timestamp<this.expire}isOverclock(){return(new Date).getTime()-this.lastRequestTime<this.interval}logCmdMsgTasks(e){if(e.uploadLog){const{tasks:t}=e.uploadLog;t.forEach((e=>{e.objectName===lt&&this.uploadTaskManage.uploadLogCmdTask(e)}))}}dataHandle(e){const t=this._cache;t.lastRequestTime=this.lastRequestTime,ms(e)&&(t.timestamp=e.timestamp,e.uploadLog&&!e.uploadLog.temporary&&(t.uploadLog=e.uploadLog),e.cc&&!e.cc.temporary&&(t.cc=e.cc),e.mrtr&&!e.mrtr.temporary&&(t.mrtr=this._handleMrtrData(e.mrtr)),e.mrtr&&this.setMRTRConfig(this._handleMrtrData(e.mrtr))),this.setCloudControllerCache(t),this.expire=t.cc.expire,this.interval=t.cc.interval,this.timestamp=t.timestamp,this.logCmdMsgTasks(e)}request(e,t,s){return y(this,void 0,void 0,(function*(){if(!this.isEable&&t===Tr&&this.isExire())return this.logger.info(_e,JSON.stringify({msg:"cloud controller is disabled"})),this.timestamp;if(!this.isEable&&t===Nr&&this.isOverclock())return this.logger.info(le,JSON.stringify({msg:"cloud controller is overclock"})),this.timestamp;const r=Gs(e);this.lastRequestTime=(new Date).getTime();const i=`${r}/v1/config`,n={"Content-Type":"application/json","RC-App-Key":this.appkey};s&&(n["RC-Token"]=s);const o={platform:"web",version:"5.44.0",timestamp:this.timestamp};this.logger.record($t.L_CLOUD_INFO_FETCH_T,JSON.stringify({appKey:this.appkey,timestamp:this.timestamp,token:!!s,uri:i}));const{code:a,data:c}=yield this.httpRequest(i,us.POST,n,o);if(this.logger.record($t.L_CLOUD_INFO_FETCH_R,JSON.stringify({appkey:this.appkey,info:c})),a===Ke.CLOUD_DATA_CENTER_INVALID&&c&&c.targetRegion){const e=c.targetRegion;if(this.changeAreaCode===e)return this.timestamp;const t=er.setAreaCode(e);this.logger.info(ue,JSON.stringify({isChangeSuccess:t,originAreaCode:er.getAreaCode(),newAreaCode:e})),this.changeAreaCode=e;const s=er.getCloudControllerUrl(e);return s[0]?this.request(s[0],Cr):(this.logger.info(de,JSON.stringify({appkey:this.appkey,uri:i,msg:"appkey region error"})),this.timestamp)}return c&&this.dataHandle(c),this.timestamp||this.lastRequestTime}))}_handleMrtrData(e){return{chatroom:(null==e?void 0:e.chatroom)||0,group:(null==e?void 0:e.group)||0,private:(null==e?void 0:e.private)||0,ultraGroup:(null==e?void 0:e.ultraGroup)||0,temporary:!!(null==e?void 0:e.temporary)}}}var Sr,Ar,fr,mr;const vr=e=>e===Ke.RC_CONN_REDIRECTED;class Pr extends Hs{constructor(e,t,s){super(),Sr.add(this),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"navi",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_fromSuspend",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"token",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"curCmpUrl",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"retryCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"uuid",{enumerable:!0,configurable:!0,writable:!0,value:""}),mr.set(this,0),Object.defineProperty(this,"_doConnectReason",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_network",{enumerable:!0,configurable:!0,writable:!0,value:{status:!0,type:Es.UNKONWN}}),Object.defineProperty(this,"_checkAliveTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_crtConnectionStatus",{enumerable:!0,configurable:!0,writable:!0,value:xt.DISCONNECTED}),Object.defineProperty(this,"_crtUserId",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_openCallPlus",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"cmpWeightCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_crtConnectionTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"reconnectTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_failedCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ALLOW_FAILED_TIMES",{enumerable:!0,configurable:!0,writable:!0,value:2})}getToken(){return this.token}get cid(){return`${this.uuid}_${this.retryCount}`}getCurrentUserId(){return this._crtUserId}setConnectionStatus(e,t){if(this._crtConnectionStatus!==e){if(this._crtConnectionStatus===xt.DISCONNECTED&&e===xt.CONNECTING&&(this._doConnectReason=os.CONNECT,V(this,Sr,"m",fr).call(this)),this._crtConnectionStatus===xt.CONNECTED&&e===xt.SUSPENDED&&(t===Ke.RC_PING_EXCEED_LIMIT?this._doConnectReason=os.TIMEOUT:t===Ke.RC_CONN_REDIRECTED?this._doConnectReason=os.REDIRECTED:this._doConnectReason=os.RECONNECT),this._crtConnectionStatus===xt.CONNECTED){const s={bid:Vs(),cod:t,net:this.getNetwork().type,dur:Date.now()-V(this,mr,"f"),cid:this.cid};this.logger.record($t.IM_CONNECTION_DURATION,JSON.stringify(s)),e===xt.SUSPENDED&&V(this,Sr,"m",fr).call(this)}switch(this._crtConnectionStatus=e,e){case xt.CONNECTED:this.logger.info(H,`status: ${e}`),this.checkAlive(),V(this,Sr,"m",Ar).call(this).emit("onConnected",this._fromSuspend);break;case xt.CONNECTING:this.logger.warn(H,`status: ${e}`),V(this,Sr,"m",Ar).call(this).emit("onConnecting");break;case xt.SUSPENDED:this._fromSuspend=!0,this.logger.warn(H,`status: ${e}, code: ${t}`),vr(t)&&this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),V(this,Sr,"m",Ar).call(this).emit("onSuspend",t);break;default:this._fromSuspend=!1,this._crtUserId="",this.logger.warn(H,`status: ${e}, code: ${t}`),this.clearCmpWeightCache(),this._checkAliveTimer&&clearTimeout(this._checkAliveTimer),V(this,Sr,"m",Ar).call(this).emit("onDisconnected",t)}}}getConnectionStatus(){return this._crtConnectionStatus}get isConnected(){return this._crtConnectionStatus===xt.CONNECTED}setNetwork(e,t){if(!t){const t={cid:this.cid,cn:e.type,on:this._network.type};this.logger.record($t.IM_NETWORK_CHANGE,JSON.stringify(t))}this._network=e}getNetwork(){return this._network}connect(e,t,s,r){return y(this,void 0,void 0,(function*(){if(this._crtConnectionStatus===xt.CONNECTED)return Js(this._crtUserId);if(this._crtConnectionTask)return this._crtConnectionTask;this._openCallPlus=s,this.token=e,this.setConnectionStatus(xt.CONNECTING);const{code:i,data:n}=yield this.try2Connect(e,t,!1,r,!0);return i!==Ke.SUCCESS?(this.setConnectionStatus(xt.DISCONNECTED,i),js(i)):(this.setConnectionStatus(xt.CONNECTED),Js(n))}))}try2Connect(e,t,s,r,i){return y(this,void 0,void 0,(function*(){if(this._crtConnectionTask)return this._crtConnectionTask;this._crtConnectionTask=this.createConnectionTask(e,t,s,r,i);const n=yield this._crtConnectionTask;return this._crtConnectionTask=null,n}))}createConnectionTask(e,t,s,r,i){return y(this,void 0,void 0,(function*(){const n={cid:this.cid,reason:this._doConnectReason,net:this.getNetwork().type,spr:0,sts:Date.now(),timelimit:0};this.logger.record($t.IM_STATS_CS,JSON.stringify(n));const o={retryCount:this.retryCount,uuid:this.uuid,type:this.getNetwork().type,reason:this._doConnectReason},{code:a,data:c}=yield this.navi.request(e,s,!1,r,o);if(a!==Ke.SUCCESS)return js(a);const _=c;if(1===_.type)return js(Ke.PACKAGE_ENVIRONMENT_ERROR);this.logger.info(F,JSON.stringify({token:e,reconnectKickEnable:t}),r);const{code:l,data:d}=yield this._connectWithToken(e.replace(/@.+$/,"@"),_,t,r);if(i||l===Ke.SUCCESS||(this.retryCount+=1),vr(l))return this.logger.warn(w,`redirect code: ${l}`,r),this.clearCmpWeightCache(),this.createConnectionTask(e,t,!0,r,i);if([Ke.RC_TCP_RESET,Ke.RC_CONN_ACK_TIMEOUT,Ke.RC_TCP_DISCONNECTED_NO_RMTP,Ke.CONNECTION_REFUSED].includes(l)&&this.cmpWeightCache&&this.cmpWeightCache.length>1){this.updateCmpWeight(this.curCmpUrl,!1);const s=this.cmpWeightCache.every((e=>e.failed));return i&&s?(this.logger.warn(w,`cpp code:${l},reture code:${Ke.SERVER_UNAVAILABLE}`,r),js(Ke.SERVER_UNAVAILABLE)):(this.logger.warn(w,`cmp ack timeout, code: ${l}`,r),this.setConnectionStatus(xt.SUSPENDED,l),this.setConnectionStatus(xt.CONNECTING),this.createConnectionTask(e,t,!1,r,i))}return l!==Ke.SUCCESS?(this.logger.warn(w,`code: ${l}`,r),js(l)):(this.logger.info(w,`userId: ${d}`,r),G(this,mr,Date.now(),"f"),this._crtUserId=d,Js(d))}))}try2Reconnect(e,t){return y(this,void 0,void 0,(function*(){const s=this.logger.createTraceId();this.logger.debug(B,`try2Reconnect -> ignoreNaviCache: ${e}, reason: ${t}`,s),this.stopReconnectTimer();const r=()=>y(this,void 0,void 0,(function*(){if(this._crtConnectionStatus!==xt.SUSPENDED)return;this.setConnectionStatus(xt.CONNECTING,t);const{code:i,isOk:n}=yield this.try2Connect(this.token,!0,e,s,!1);this.reconnectTimer=null,n?this.setConnectionStatus(xt.CONNECTED):[Ke.SERVER_UNAVAILABLE,Ke.TIMEOUT,Ke.RC_SOCKET_DISCONNECTED,Ke.RC_SOCKET_NOT_CREATED,Ke.RC_CONN_ACK_TIMEOUT,Ke.RC_TCP_RESET,Ke.RC_NAVI_REQ_FAILED,Ke.RC_NETWORK_DOWN,Ke.RC_TCP_DISCONNECTED_NO_RMTP].includes(i)?this._crtConnectionStatus===xt.CONNECTING&&(this.setConnectionStatus(xt.SUSPENDED,i),this.reconnectTimer=setTimeout(r,5e3)):this.setConnectionStatus(xt.DISCONNECTED,i)}));r()}))}onDisconnectByServer(e,t){return vr(e)?(this.setConnectionStatus(xt.SUSPENDED,e),void this.try2Reconnect(!0,e)):e===Ke.RC_UDP_DISCONNECTED?(this.setConnectionStatus(xt.SUSPENDED,e),void setTimeout((()=>{this.try2Reconnect(!0,e)}),1e3*(t||0))):void this.setConnectionStatus(xt.DISCONNECTED,e)}onDisconenctUnusual(e){this.setConnectionStatus(xt.SUSPENDED,e),this.try2Reconnect(!1,e)}checkAlive(){return y(this,void 0,void 0,(function*(){if(this._crtConnectionStatus!==xt.CONNECTED)return this._failedCount=0,void this.logger.debug(Z,"stop ping because of no connection");const e=this.logger.createTraceId();this.logger.debug(Q,null,e);const t=yield this.sendPing(15e3);if(t===Ke.SUCCESS)return this.logger.debug($,t,e),this._failedCount=0,void(this._checkAliveTimer=setTimeout((()=>this.checkAlive()),15e3));if(this._crtConnectionStatus===xt.CONNECTED){if(this._failedCount+=1,this.logger.debug($,`code: ${t}, count: ${this._failedCount}`,e),this._failedCount<this.ALLOW_FAILED_TIMES)return this.checkAlive();this._failedCount=0,this.logger.warn(Z,"ping timeout, close connection to reconnect!"),yield this.close(!0),this.setConnectionStatus(xt.SUSPENDED,Ke.RC_PING_EXCEED_LIMIT),this.try2Reconnect(!1,Ke.RC_PING_EXCEED_LIMIT)}}))}disconnect(e,t){return y(this,void 0,void 0,(function*(){return this.stopReconnectTimer(),this._crtConnectionTask&&(yield this._crtConnectionTask),this.setConnectionStatus(xt.DISCONNECTED,Ke.ACTIVE_DISCONNECT),this.close(!1,e,t)}))}stopReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}getCmpList(e,t){if(this.cmpWeightCache&&this.cmpWeightCache.length>0)return[...this.cmpWeightCache];const s=Ms(e,t);return this.cmpWeightCache=[...s],[...s]}updateCmpWeight(e,t,s){if(!this.cmpWeightCache)return;const r=this.cmpWeightCache.find((t=>s?t.addr===e&&t.protocol===it.QUIC:t.addr===e));if(r)if(t){const e=Math.max(...this.cmpWeightCache.map((e=>e.weight)));r.weight!==e&&(r.weight=e+1)}else{const e=Math.min(...this.cmpWeightCache.map((e=>e.weight)));r.weight!==e&&(r.weight=e-1),r.failed=!0}}clearCmpWeightCache(){this.cmpWeightCache=void 0}reconnect(e,t,s,r){this.token=e,this._openCallPlus=s,this.onDisconenctUnusual(r)}}mr=new WeakMap,Sr=new WeakSet,Ar=function(){return this},fr=function(){this.uuid=Os.gen(),this.retryCount=0};const Lr=e=>e.replace(/@.+$/,"@");class Mr{constructor(e,t,s,r=!0,i=!0,n=!1){Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"isRequestProfile",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"isUseDynamicNaviUrl",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"useNaviV2",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"crtRequest",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:"default"})}getCatchKey(e){return e+(this._environment?`-${this._environment}`:"")}request(e,t,s,r,i){return y(this,void 0,void 0,(function*(){if(this.crtRequest)return this.crtRequest;this.crtRequest=this.sendRequest(e,t,s,r,i);const n=yield this.crtRequest;return this.crtRequest=null,n}))}sendRequest(e,t,s,r,i){var n;return y(this,void 0,void 0,(function*(){const o=Lr(e),a=this.getNaviCache(o);if(!t&&a){const{timestamp:e,naviInfo:t}=a;if(s||Date.now()-e<Rs){if(this.logger.info(W,JSON.stringify({fromCache:!0,naviInfo:t}),r),i){const{uuid:e,retryCount:s,reason:o}=i,a={bid:Vs(),ptc:ss.NAVI,cod:Ke.SUCCESS,net:i.type,dur:0,spr:0,pr:null!==(n=t.type)&&void 0!==n?n:0,hos:"",cache:rs.LOCAL,v:is.CURRENT,rsn:o,cid:`${e}_${s}`,count:s};this.logger.record($t.IM_NAVI,JSON.stringify(a),r)}return Js(t)}}const c=er.getNaviUrlList(e,this.isUseDynamicNaviUrl);this.logger.info(J,JSON.stringify({token:e,uris:c}),r);let{code:_,data:l}=yield this.requestHandler(c,e,r,i);if(_===Ke.RC_NAVI_REQ_FAILED&&this.isRequestProfile){const t=yield this.staticConfigManager.getStaticConfig();if((null==t?void 0:t.navi)&&(null==t?void 0:t.navi.length)>0){const{navi:s}=t,n=yield this.requestHandler(s,e,r,i);_=n.code,l=n.data}}if(_!==Ke.SUCCESS)return this.logger.warn(j,_,r),js(_);const d=l;if(d.code&&200!==d.code)return this.logger.warn(j,d.code,r),js(this.transHttpCode(d.code));if(!(Ms(d).length>0)){const e={server:d.server,backupServer:d.backupServer,serverAddr:d.serverAddr,bs:d.bs};return this.logger.warn(j,`navi server address invalid: ${JSON.stringify(e)}`,r),js(Ke.SERVER_UNAVAILABLE)}return this.logger.info(j,JSON.stringify({naviInfo:d}),r),this.setNaviCache(o,d),Js(d)}))}requestHandler(e,t,s,r){return y(this,void 0,void 0,(function*(){for(let i=0,n=e.length;i<n;i+=1){const n=i===e.length-1,o=this.useV2Navi()?this.httpRequestV2:this.httpRequest,a=Date.now(),{code:c,data:_}=yield o.call(this,e[i],this.appkey,t,s,n),l={bid:Vs(),ptc:ss.NAVI,cod:c,net:null==r?void 0:r.type,dur:Date.now()-a,spr:0,pr:(null==_?void 0:_.type)||0,hos:e[i],cache:rs.REQUEST,v:is.CURRENT,rsn:null==r?void 0:r.reason,cid:`${null==r?void 0:r.uuid}_${null==r?void 0:r.retryCount}`,count:null==r?void 0:r.retryCount};if(this.logger.record($t.IM_NAVI,JSON.stringify(l),s),[Ke.SUCCESS,Ke.RC_CONN_TOKEN_INCORRECT,Ke.RC_LICENSE_EXPIRED].includes(c))return c===Ke.SUCCESS?Js(_):js(c)}return js(Ke.RC_NAVI_REQ_FAILED)}))}transHttpCode(e){switch(e){case 401:case 403:return Ke.RC_CONN_TOKEN_INCORRECT;case 416:return Ke.RC_LICENSE_EXPIRED;default:return Ke.RC_NAVI_REQ_FAILED}}getNaviInfoFromCache(e){const t=this.getNaviCache(Lr(e));return t?t.naviInfo:null}updateVoipCallInfo(e,t){const s=this.getNaviInfoFromCache(e);s&&this.setNaviCache(Lr(e),Object.assign(Object.assign({},s),{voipCallInfo:t}))}getNaviV2RequestOption(e){const{uri:t,token:s,platform:r,protocol:i,mac:n}=e;let o="";o=`${t}/v2/navi.json?cloud=0`;let a=`token=${encodeURIComponent(s)}&v=${Is}&platfrom=${r}`;return n&&(a+=`&m=${n}`),{method:"POST",headers:{"RC-Appkey":this.appkey,"Content-Type":"Application/x-www-form-urlencoded","RC-Negotiate":`conn=${i};rtc=4;log=2;iptype=v4,v6`},body:a,url:o,timeout:1e4}}useV2Navi(){return!0}}const Ur=new Map([["RC:TxtMsg",{isCounted:!0,isPersited:!0}],["RC:ImgMsg",{isCounted:!0,isPersited:!0}],["RC:VcMsg",{isCounted:!0,isPersited:!0}],["RC:ImgTextMsg",{isCounted:!0,isPersited:!0,searchProps:["content","title"]}],["RC:FileMsg",{isCounted:!0,isPersited:!0,searchProps:["name"]}],["RC:HQVCMsg",{isCounted:!0,isPersited:!0}],["RC:LBSMsg",{isCounted:!0,isPersited:!0}],["RC:PSImgTxtMsg",{isCounted:!0,isPersited:!0}],["RC:PSMultiImgTxtMsg",{isCounted:!0,isPersited:!0}],["RCJrmf:RpMsg",{isCounted:!0,isPersited:!0}],["RCJrmf:RpOpendMsg",{isCounted:!0,isPersited:!0}],["RC:CombineMsg",{isCounted:!0,isPersited:!0}],["RC:CombineV2Msg",{isCounted:!0,isPersited:!0}],["RC:ReferenceMsg",{isCounted:!0,isPersited:!0,searchProps:["content"]}],["RC:SightMsg",{isCounted:!0,isPersited:!0}],["RC:GIFMsg",{isCounted:!0,isPersited:!0}],["RC:RLStart",{isCounted:!0,isPersited:!0}],["RC:RLEnd",{isCounted:!0,isPersited:!0}],["RC:StreamMsg",{isCounted:!0,isPersited:!0}],[Mt,{isCounted:!1,isPersited:!0}],["RC:ContactNtf",{isCounted:!1,isPersited:!0}],["RC:ProfileNtf",{isCounted:!1,isPersited:!0}],[Lt,{isCounted:!1,isPersited:!0}],[Ut,{isCounted:!1,isPersited:!0}],["RC:RcNtf",{isCounted:!1,isPersited:!0}],[Pt,{isCounted:!1,isPersited:!1}],["RC:TypSts",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:PSCmd",{isCounted:!1,isPersited:!1}],["RC:SRSMsg",{isCounted:!1,isPersited:!1}],["RC:RcCmd",{isCounted:!1,isPersited:!0}],["RC:RRReqMsg",{isCounted:!1,isPersited:!1}],["RC:RRRspMsg",{isCounted:!1,isPersited:!1}],["RC:CsChaR",{isCounted:!1,isPersited:!1}],["RC:CSCha",{isCounted:!1,isPersited:!1}],["RC:CsEva",{isCounted:!1,isPersited:!1}],["RC:CsContact",{isCounted:!1,isPersited:!1}],["RC:CsHs",{isCounted:!1,isPersited:!1}],["RC:CsHsR",{isCounted:!1,isPersited:!1}],["RC:CsSp",{isCounted:!1,isPersited:!1}],["RC:CsEnd",{isCounted:!1,isPersited:!1}],["RC:CsUpdate",{isCounted:!1,isPersited:!1}],["RC:ReadNtf",{isCounted:!1,isPersited:!1}],["RC:chrmKVNotiMsg",{isCounted:!1,isPersited:!1}],["RC:VCAccept",{isCounted:!1,isPersited:!1}],["RC:VCRinging",{isCounted:!1,isPersited:!1}],["RC:VCSummary",{isCounted:!1,isPersited:!1}],["RC:VCHangup",{isCounted:!1,isPersited:!1}],["RC:VCInvite",{isCounted:!1,isPersited:!1}],["RC:VCModifyMedia",{isCounted:!1,isPersited:!1}],["RC:VCModifyMem",{isCounted:!1,isPersited:!1}],["RC:MsgExMsg",{isCounted:!1,isPersited:!1}],["RC:Delivered",{isCounted:!1,isPersited:!1}],["RC:RRMsg",{isCounted:!1,isPersited:!1}],["RC:LogCmdMsg",{isCounted:!1,isPersited:!1}],["RC:InterceptMsg",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:RLJoin",{isCounted:!1,isPersited:!1}],["RC:RLQuit",{isCounted:!1,isPersited:!1}],["RC:RL",{isCounted:!1,isPersited:!1,isStatusMessage:!0}],["RC:CCConfigChangeRequestMsg",{isCounted:!1,isPersited:!1}]]);function Dr(){return Array.from(Ur.keys()).map((e=>Object.assign({objectName:e},Ur.get(e)))).filter((e=>!e.isCustom))}const br=0,yr=0,Vr=4,Gr=5;var kr;!function(e){e.P_INIT_O="P-init-O",e.P_DB_OPEN_O="P-db_open-O",e.P_DB_UPGRATE_START_S="P-db_upgrate_start-S",e.P_DB_UPGRATING_S="P-db_upgrating-S",e.P_DB_UPGRATE_COMPLETE_S="P-db_upgrate_complete-S",e.P_CALL_MAIN_SYNC_E="P-call_main_sync-E",e.P_CALL_MAIN_E="P-call_main-E",e.P_SEND_2_MAIN_E="P-send_2_main-E",e.P_CALL_ADDON_E="P-call_addon-E",e.P_CALL_ADDON_T="P-call_addon-T",e.P_CALL_ADDON_O="P-call_addon-O",e.P_CALL_ADDON_R="P-call_addon-R",e.P_CALL_EXTRA_E="P-call_extra-E",e.P_CONNECT_S="P-connect-S",e.P_CONNECT_T="P-connect-T",e.P_CONNECT_R="P-connect-R",e.P_CONNECT_E="P-connect-E",e.P_CONNECT_ENTRY_S="P-connect_entry-S",e.P_REPORT_VER_O="P-report_version-O",e.P_PARSE_JSON_MSGS_E="P-parse_json_messsages-E",e.P_PARSE_JSON_MSGS_R="P-parse_json_messsages-R",e.P_RECEIVE_MESSAGE_E="P-receive_message-E",e.P_HTTP_REQ_E="P-http_request-E",e.P_SET_MSG_EXTEN_O="P-set_msg_extension-O",e.P_SEND_MSG_T="P-send_msg-T",e.P_SEND_MSG_R="P-send_msg-R",e.P_PARSE_JSON_SUBSCRIBE_DATA_E="P-parse_json_subscribe_data-E",e.P_PARSE_JSON_USER_PROFILE_E="P-parse_json_user_profile-E",e.P_PARSE_JSON_USER_PROFILE_LIST_E="P-parse_json_user_profile_list-E",e.P_WRITE_LOG_O="P_WRITE_LOG_O",e.P_PARSE_JSON_E="P-parse_json-E",e.L_HANDLE_LOW_PRIORITY_MESSAGES_T="L-handle_low_priority_messages-T",e.L_HANDLE_LOW_PRIORITY_MESSAGES_R="L-handle_low_priority_messages-R",e.L_JS_FUNC_EXEC_O="L-js_func_execute-O",e.L_JS_FUNC_EXEC_E="L-js_func_execute-E",e.L_HADNLE_RECALL_CMD_T="L-handle_recall_cmd-T",e.L_HADNLE_RECALL_CMD_R="L-handle_recall_cmd-R"}(kr||(kr={}));const Fr=t=>{if(N(t))return;const s=e(t,"..");N(s)||Fr(s),C(t)},wr=e=>Object.entries(e).map((([e,t])=>({key:e,value:String(t)}))),Hr=e=>({removeMute:!!(null==e?void 0:e.removeMuteStatus),removeWhiteList:!!(null==e?void 0:e.removeWhiteList),removeFavoriteMembers:!!(null==e?void 0:e.removeFollow)}),Br=()=>"undefined"==typeof __dirname?t(S(import.meta.url)):__dirname;function Jr(e){return JSON.parse(e).list.map((e=>e.value))}const jr=e(Br(),"binding",`electron-${i()}-${n()}.node`),Wr={addon:null};try{let e=I(import.meta.url);Wr.addon=e(jr)}catch(e){console.error("error ->",jr,"\n",e)}Wr.addon||console.error("error -> cannot find module: ",jr);const xr=Wr.addon,Yr=(e,t)=>{let s,r=Buffer.from(e),i=r.length;for(t.push(i),s=0;s<i;s++)t.push(r[s])},Kr=e=>"string"==typeof e,Xr=e=>Kr(e)?e.toUpperCase():"",Qr=(e,t)=>{let s="";return 2!==e.length?s="Unexpected number of bytes received.":5!==e[0]?s=`Unexpected SOCKS version number: ${e[0]}.`:255===e[1]?s="No acceptable authentication methods were offered.":-1===t.indexOf(e[1])&&(s=`Unexpected SOCKS authentication method: ${e[1]}.`),s},$r=e=>{let t="";return 2!==e.length?t="Unexpected number of bytes received.":1!==e[0]?t=`Unexpected authentication method code: ${e[0]}.`:0!==e[1]&&(t=`Username and password authentication failure: ${e[1]}.`),t};var Zr=e=>{let t=Xr(e.method)||"GET";const s=e.pathname||"/",r=e.headers||{},i=e.search||"";r.Host=e.host||"loclahost";let n="";n=`${t} ${s+i} HTTP/1.1\n`;for(const e in r)if(Object.hasOwnProperty.call(r,e)){n+=`${e}: ${r[e]}\n`}return e.body&&(n+=`Content-Length: ${e.body.length}\n`),n+="\n","POST"===t&&e.body&&(n+=`${e.body}`),n},qr=e=>new Promise((t=>{let s,r;e.socket.once("data",(r=>{let i,n=Qr(r,s);if(!n)return 2===r[1]?(e.socket.once("data",(s=>{let r=$r(s);r?e.emit("error",new Error(`SOCKS authentication failed. ${r}`)):t()})),i=[1],Yr(e.socksUsername,i),Yr(e.socksPassword,i),void e.write(Buffer.from(i))):void t();e.emit("error",new Error(`SOCKS authentication failed. ${n}`))})),s=[0],e.socksUsername&&s.push(2),r=Buffer.alloc(2+s.length),r[0]=5,r[1]=s.length,s.forEach(((e,t)=>{r[2+t]=e})),e.write(r)})),zr=(e,t,s)=>new Promise((r=>{let i,n;switch(e.socket.once("data",(t=>{let s;5!==t[0]?s=`Unexpected SOCKS version number: ${t[0]}.`:0!==t[1]?s=`${(e=>{switch(e){case 1:return"General SOCKS server failure";case 2:return"Connection not allowed by ruleset";case 3:return"Network unreachable";case 4:return"Host unreachable";case 5:return"Connection refused";case 6:return"TTL expired";case 7:return"Command not supported";case 8:return"Address type not supported";default:return`Unknown status code ${e}`}})(t[1])}.`:0!==t[2]&&(s="The reserved byte must be 0x00."),s?e.emit("error",new Error(`SOCKS connection failed. ${s}`)):r()})),i=[],i.push(5),i.push(1),i.push(0),M(t)){case 0:i.push(3),Yr(t,i);break;case 4:i.push(1),((e,t)=>{let s,r,i=e.split(".");for(s=0;s<4;s++)r=parseInt(i[s],10),t.push(r)})(t,i);break;case 6:e.emit("error",new Error("Does not support IPV6"))}i.length+=2,n=Buffer.from(i),n.writeUInt16BE(s,n.length-2),e.write(n)}));class ei extends D{constructor(e){super(),Object.defineProperty(this,"socket",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socksHost",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socksPort",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socksUsername",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socksPassword",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"writable",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"readable",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this.socket=new U,this.options=e,this.socksHost=e.socksHost||"localhost",this.socksPort=e.socksPort||1080,this.socksUsername=e.socksUsername||"",this.socksPassword=e.socksPassword||"",this.socket.on("error",(e=>{this.emit("error",e)})),this.on("error",(()=>{this.socket.destroyed||this.socket.destroy()})),this.on("end",this.end)}ref(){return this.socket.ref()}unref(){return this.socket.unref()}setTimeout(e,t){return this.socket.setTimeout(e,t)}setNoDelay(e){return this.socket.setNoDelay(e)}setKeepAlive(e,t){return this.socket.setKeepAlive(e,t)}address(){return this.socket.address()}cork(){return this.socket.cork()}uncork(){return this.socket.uncork()}pause(){return this.socket.pause()}resume(){return this.socket.resume()}pipe(e){return this.socket.pipe(e)}end(e,t){let s=this.socket.end(e,t);return this.writable=this.socket.writable,s}destroy(e){return this.socket.destroy(e)}setEncoding(e){return this.socket.setEncoding(e)}write(e,t,s){return this.socket.write(e,t,s)}read(e){return this.socket.read(e)}connect(e,t){if("string"==typeof e&&/^\d+$/.test(e)&&(e=parseInt(e,10)),!Number.isInteger(e)||e<1||e>65535)throw new TypeError(`Invalid port: ${e}`);if(!t||"string"!=typeof t)throw new TypeError(`Invalid host: ${t}`);return this.socket.connect({port:this.socksPort,host:this.socksHost},(()=>y(this,void 0,void 0,(function*(){yield qr(this),yield zr(this,t,e),this.onProxied();const s=Zr(this.options);this.socket.write(Buffer.from(s))})))),this}onProxied(){this.socket.on("close",(e=>{this.emit("close",e)})),this.socket.on("end",(()=>{this.emit("end")})),this.socket.on("data",(e=>{this.emit("data",e)})),this.writable=!0,this.readable=!0,this.emit("connect")}}const ti=e=>{let t,{hostname:s,port:r}=e;return!e.host||s&&r||(t=e.host.split(":")),!r&&t&&(r=parseInt(t[1],10)||0),!s&&t&&([s]=t),new ei(e).connect(r,s)};class si extends m{constructor(e){super(),Object.defineProperty(this,"createConnection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.createConnection=ti}}const ri=(e,t,s)=>((t=Object.assign(Object.assign({},t),A(e))).port||(t.port=80),t.agent=new si(t),f(t,s)),ii=e=>{let t,s;return t=ti(e),s=t.onProxied,t.onProxied=()=>{e.socket=t.socket,e.hostname?e.servername=e.hostname:e.host&&([e.servername]=e.host.split(":")),t.socket=b(e,(()=>{t.authorized=t.socket.authorized,s.call(t)})),t.socket.on("error",(e=>{t.emit("error",e)}))},t};class ni extends P{constructor(e,t){super(t),Object.defineProperty(this,"socksHost",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"socksPort",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"createConnection",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=e,this.socksHost=t.socksHost||"localhost",this.socksPort=t.socksPort||1080,this.createConnection=ii}}const oi=(e,t,s,r)=>{let i;return t.protocol="https:",!t.port&&t.host&&([t.port,t.port]=t.host.split(":")),t.port||(t.port=443),i=new ni(e,t),t.agent=i,v(e,t,s)};let ai=null;function ci(e,t,s=!1){const{url:r,headers:i,body:n,method:o,query:a,timeout:c=hs}=t;return new Promise((t=>{const _=/^https/.test(r);let l={headers:Object.assign(Object.assign({},i),{"Accept-Encoding":"gzip, br"}),method:o};_&&(l.rejectUnauthorized=s);let d=null;ai?(l=Object.assign(Object.assign({},l),ai),l.body=n,d=_?oi:ri):(d=f,_&&(l.agent=new P(l),d=v));const E=d(((e,t)=>{if(e=e.replace(/\?$/,""),!t)return e;const s=Object.keys(t).map((e=>`${e}=${t[e]}`)).filter((e=>!!e));return s.length?[e,s.join("&")].join("?"):e})(r,a),l,(e=>{var s,r;const i=e.statusCode;let n="";if("gzip"===(null===(s=e.headers)||void 0===s?void 0:s["content-encoding"])){const s=L.createGunzip();e.pipe(s),s.on("data",(e=>{n+=e})),s.on("end",(()=>{t({status:i,data:n})}))}else if("br"===(null===(r=e.headers)||void 0===r?void 0:r["content-encoding"])){const s=L.createBrotliDecompress();e.pipe(s),s.on("data",(e=>{n+=e})),s.on("end",(()=>{t({status:i,data:n})}))}else e.setEncoding("utf8"),e.on("data",(e=>{n+=e})),e.once("end",(()=>{t({status:i||0,data:n})}))}));E.once("timeout",(()=>{e.warn(kr.P_HTTP_REQ_E,JSON.stringify({msg:"timeout",url:r,method:o,query:a,timeout:c})),t({status:0})})),E.setTimeout(c),E.once("error",(s=>{e.warn(kr.P_HTTP_REQ_E,JSON.stringify({msg:s.stack,url:r,method:o,query:a,timeout:c})),t({status:0})})),E.write(n),E.end()}))}function _i(e,t){return e?(ai=Object.assign(Object.assign({},ai),e),t.info(re,JSON.stringify({socks5Proxy:ai})),Js()):(ai=null,t.info(se),Js())}function li(){return Js(ai||void 0)}var di;!function(e){e[e.ERROR=-1]="ERROR",e[e.RESPONSE=0]="RESPONSE",e[e.CALLBACK=1]="CALLBACK"}(di||(di={}));class Ei{constructor(e,t,s,r){Object.defineProperty(this,"p",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"emit",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"callback",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"errorHandle",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"count",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"maps",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.p.on("message",(e=>{const{type:t,data:i}=e;switch(t){case di.RESPONSE:{const{reqId:e,success:t,data:s}=i,r=this.maps[e];if(!r)return;r({success:t,data:s}),delete this.maps[e];break}case di.CALLBACK:null==s||s(i);break;case di.ERROR:{const{msg:e}=i;null==r||r(e)}}})),this.p.on("error",(e=>{null==r||r(`SubProcessProxy error ${e}`)})),this.p.on("exit",((e,t)=>{if(0!==e){for(const e in this.maps)if(Object.prototype.hasOwnProperty.call(this.maps,e)){(0,this.maps[e])({success:!0,data:{code:Ke.SUB_PROCESS_EXIT,msg:"sub process exit"}})}null==r||r(`SubProcessProxy exit ${e} ${t}`,!0)}})),this.p.on("close",((e,t)=>{console.log("SubProcessProxy close",e,t)}))}call(e,...t){return y(this,void 0,void 0,(function*(){return this.p.killed||this.p.exitCode?Promise.resolve({success:!1,data:{code:Ke.SUB_PROCESS_EXIT,msg:"sub process exit"}}):new Promise((s=>{const r=++this.count;this.maps[r]=s;const i={reqId:r,method:e,args:t,hasResponse:!0};this.p.send(i)}))}))}send(e,...t){var s;return y(this,void 0,void 0,(function*(){(this.p.killed||this.p.exitCode)&&(null===(s=this.errorHandle)||void 0===s||s.call(this,"sub process exit"));const r={reqId:-1,method:e,args:t};this.p.send(r)}))}destroy(){this.send("destroy")}}const ui=(e,t,s)=>y(void 0,void 0,void 0,(function*(){const{startTime:r,endTime:i,level:n,isRealtimeReport:o}=e,a=yield((e,t,s,r,i)=>y(void 0,void 0,void 0,(function*(){const{resolve:n,promise:o}=Ys();xr.getLog(e,t,s,r,(e=>{n(Js(e))}),(e=>{n(js(e))}));const a=yield o;if(!a.isOk)return a.wipe();let c=0;const _=JSON.parse(a.data).filter((e=>(c+=(e=>e.content.length+e.tag.length+e.sessionId.length+e.type.length+2+13+6)(e),!!i||e.level>0)));return Js({logs:_,size:c})})))(n,r,i,300,o);if(!a.isOk)return;let{logs:c,size:_}=a.data;if(0===c.length)return;if((t+=_)>=20971520)return;if(c.length<300)return void s.push(...c);let{time:l}=c[c.length-1];return r===l&&(l+=1),e.startTime=l,s.push(...c.filter((e=>e.time<l))),ui(e,t,s)})),Ri=[];let hi=!1;const Ii=()=>y(void 0,void 0,void 0,(function*(){if(hi||0===Ri.length)return;hi=!0;const e=Ri.shift(),{resolve:t,args:s}=e,r=[];yield ui(s,0,r),t({logs:r,dbReady:!0}),hi=!1,Ii()}));class gi extends ir{constructor(e,t,s,r=!1,i){super(e,`Electron|${process.versions.electron}|${process.arch}|${process.platform}`,i,s,r),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_subProcess",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}getDeviceId(){return this.deviceId}send(e){return ci(this.logger,e)}stop(){this._subProcess&&this._subProcess.destroy(),super.stop()}compressLogs(t){return y(this,void 0,void 0,(function*(){if(!this._subProcess){const t="sub-process.cjs.js",s=R(e(Br(),t),{stdio:["inherit","inherit","inherit","ipc"]});this._subProcess=new Ei(s)}const{success:s,data:r}=yield this._subProcess.call("compressLogs",t);return s?{success:s,data:r.data}:{success:s,data:""}}))}}const Ti="rc-realtime-log-timestamp";let Ni=!1;const Ci=()=>{const e=new Ir(Rr,hr);return e.setLogReader(((e,t,s,r)=>y(void 0,void 0,void 0,(function*(){const{logs:i}=yield(n={startTime:e,endTime:t,level:s,isRealtimeReport:r},y(void 0,void 0,void 0,(function*(){return new Promise((e=>{Ri.push({resolve:e,args:n}),Ii()}))})));var n;return{logs:i}})))),e.setLogWriter((e=>{Si(e)})),e};let Oi,pi=[];const Si=e=>{Ni&&(pi.push(e),Oi||(Oi=setImmediate((()=>(()=>{if(Oi&&(clearImmediate(Oi),Oi=null),!pi.length)return;const e=pi.splice(0).map((e=>{const{sessionId:t,level:s,time:r,type:i,tag:n,loggerId:o,content:a,traceId:c}=e;return{level:s,time:r,type:i,tag:n,sessionId:`${ps}:${ps===t?"main":t}`,content:JSON.stringify({loggerId:o,content:a,traceId:c})}})),t=JSON.stringify(e);xr.writeLog(t)})()))))};class Ai extends rr{constructor(e,t,s,r){super(e,t,s,r),Ni||(Ni=!0)}getTimestamp4RealtimeLog(){const e=xr.getStoreValue(Ti);return parseInt(e,10)||0}setTimestamp4RealtimeLog(e){xr.setStoreValue(Ti,e.toString())}recvRendererLog(e){this._stdout(e),this._write(e)}destroy(){Ni=!1}}const fi=()=>{const e=Date.now(),t=[n(),i(),process.pid,e,Math.floor(Math.random()*e)].join("__");return s=t,T("md5").update(s).digest("hex");var s};class mi{constructor(e){Object.defineProperty(this,"_callCppProxy",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_setTime",{enumerable:!0,configurable:!0,writable:!0,value:15962112e5})}_setToProtocol(e,t,s){const r=JSON.stringify(s);"{}"!==r&&e.info(kr.P_SET_MSG_EXTEN_O,JSON.stringify({messageUId:t,ext:s})),this._callCppProxy("setMessageExtension",1,"1",t,r,"")}setLocalFromExtMsg(e,t){const{channelId:s,conversationType:r,targetId:i,content:n,sentTime:o}=t,a=n,c=a.put,_=this._callCppProxy("getMessage",a.mid),l=JSON.parse(_).extMsg,d=JSON.parse(l||"{}");if(c)for(const e in c){const t=d[e];t&&t.ts<o-this._setTime?(t.v=c[e],t.ts=o-this._setTime):(d[e]={v:"",ts:0},d[e].v=c[e],d[e].ts=o-this._setTime)}a.del&&a.del.forEach((e=>{delete d[e]})),this._setToProtocol(e,a.mid,d)}parseReceiveExpansion(e){const t=JSON.parse(e.extMsg||"{}"),s={};for(const e in t)s[e]=t[e].v;return s}}const vi=[it.RMTP,it.TLS];"darwin"===process.platform&&vi.push(it.QUIC);const Pi=e=>`RongCloud/navis/${e}/navi-cache.json`,Li=e=>`RongCloud/caches/${e}/staticConfig.json`,Mi=e=>`RongCloud/cloudControl/${e}/cloudControl.json`;function Ui(e="IPv4"){const t=o(),s=[];for(const r of Object.values(t))if(r&&-1!==Object.prototype.toString.call(r).indexOf("Array")){const t=r.filter((t=>{return!(t.internal||(s=t.mac,/^(0{1,2}[:-]){5}0{1,2}$/.test(s))||t.family&&t.family!==e);var s})).map((e=>e.mac));s.push(...t)}return s.length?[...s].sort()[0]:""}class Di extends Mr{constructor(e,s,r,i){super(e,s,i),Object.defineProperty(this,"naviPath",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"_caches",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.naviPath=`${r}/${Pi(e)}`;const n=t(this.naviPath);N(n)||Fr(n)}httpRequest(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=`token=${encodeURIComponent(s)}&v=${Is}&p=PC&ev=5.44.0&m=${Ui()}`,n=`${e}/navi.json?r=${Date.now()}&env=${this._environment}`;this.logger.info(W,JSON.stringify({url:n,body:i}),r);const o=yield ci(this.logger,{method:"POST",headers:{appId:t},body:i,url:n,timeout:1e4});if(200!==o.status)return this.logger.warn(x,JSON.stringify({url:n,code:o.status}),r),js(this.transHttpCode(o.status));this.logger.info(x,JSON.stringify({url:n,data:o.data}),r);try{const e=JSON.parse(o.data),t=/^https/.test(n)?"https":"http";return e.protocol=t,e.code&&200!==e.code?js(this.transHttpCode(e.code)):Js(e)}catch(e){return this.logger.error(Y,o.data,r),js(Ke.RC_NAVI_REQ_FAILED)}}))}httpRequestV2(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=this.getNaviV2RequestOption({appkey:t,token:s,uri:e,platform:"electron",protocol:vi.join(","),mac:Ui()});this.logger.info(W,JSON.stringify({url:i.url,body:i.body,headers:i.headers}),r);const n=yield ci(this.logger,i);if(200!==n.status)return this.logger.warn(x,JSON.stringify({url:i.url,code:n.status}),r),js(this.transHttpCode(n.status));this.logger.info(x,JSON.stringify({url:i.url,data:n.data}),r);try{const e=JSON.parse(n.data),t=/^https/.test(i.url)?"https":"http";return e.protocol=t,Js(e)}catch(e){return this.logger.error(Y,n.data,r),js(Ke.RC_NAVI_REQ_FAILED)}}))}getNaviCache(e){const t=this.getCatchKey(e),s=this._caches[t];if(s)return s;if(!N(this.naviPath))return null;const r=O(this.naviPath,{encoding:"utf8"});try{this._caches=JSON.parse(r);return this._caches[t]}catch(e){this.logger.error(Y,r)}return null}setNaviCache(e,t){const s=Date.now(),r=this.getCatchKey(e);if(ms(this._caches))for(const e in this._caches){(s-this._caches[e].timestamp>Rs||r===e)&&delete this._caches[e]}this._caches[r]={token:e,naviInfo:t,timestamp:Date.now(),environment:this._environment},p(this.naviPath,JSON.stringify(this._caches))}setEnvironment(e){this._environment=e}setUseNaviV2(e){this.useNaviV2=e}}var bi,yi,Vi,Gi,ki,Fi;function wi(e,t,s,...r){const i=e.createTraceId();let n;if(e.info(kr.P_CALL_ADDON_T,JSON.stringify({method:s,params:r}),i),!xr[s])throw e.error(kr.P_CALL_ADDON_E,`Method ${s} not found in addon`,i),new Error(`Method ${s} not found in addon`);try{n=xr[s](...r)}catch(t){throw e.error(kr.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:s}),i),t}return e.info(kr.P_CALL_ADDON_R,JSON.stringify({method:s,result:t?n:void 0}),i),n}class Hi{constructor(e,t,s){bi.add(this),Object.defineProperty(this,"_logger",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"_method",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_promise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolve",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_traceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this._traceId=null!=s?s:this._logger.createTraceId(),this._promise=new Promise((e=>{this._resolve=e}))}static create(e,t,s){return new Hi(e,t,null!=s?s:e.createTraceId())}invoke(...e){return V(this,bi,"m",yi).call(this,!0,...e)}asyncInvoke(...e){return V(this,bi,"m",yi).call(this,!1,...e)}ok(e){this._flush(Js(e))}fail(e,t){this._flush(js(e,"",t))}_flush(e){this._logger.summary(kr.P_CALL_ADDON_R,e,this._traceId),setImmediate((()=>this._resolve(e)))}flush(e){this._flush(e)}result(){return this._promise}}bi=new WeakSet,yi=function(e,...t){let s;const{_method:r,_traceId:i,_logger:n}=this;n.info(kr.P_CALL_ADDON_T,JSON.stringify({method:r,params:t}),i);try{s=xr[r](...t)}catch(e){throw n.error(kr.P_CALL_ADDON_E,JSON.stringify({stack:null==e?void 0:e.stack,method:r}),i),e}return e&&s!==Ke.SUCCESS&&this.fail(s),this},function(e){e[e.SUCCESS=0]="SUCCESS",e[e.NOT_INIT=-1]="NOT_INIT",e[e.CANCELED=-2]="CANCELED",e[e.REPEAT=-3]="REPEAT"}(Fi||(Fi={}));class Bi extends Pr{constructor(e,t,s,r){super(e,s,r),Vi.add(this),Object.defineProperty(this,"callCppProxy",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_connectedTime",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_naviInfo",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_excludeLogTag",{enumerable:!0,configurable:!0,writable:!0,value:["P-API_RCGetValueForKey-T","P-API_RCGetValueForKey-E","P-API_RCGetValueForKey-R","P-API_RCSetValueForKey-T","P-API_RCSetValueForKey-E","P-API_RCSetValueForKey-R"]}),Object.defineProperty(this,"_connectingTask",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_tcpDuration",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pingResolve",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.callCppProxy("setConnectionStatusListener",V(this,Vi,"m",Gi).bind(this),((e,t,s)=>{this.logger.info(kr.P_DB_OPEN_O,JSON.stringify({code:e,recreate:t,recreateReason:s})),this.emit("onDBOpen",e,t,s)}),(()=>this.recvPong(Ke.SUCCESS)),V(this,Vi,"m",ki).bind(this),this._onTcpConnectResponse.bind(this),(()=>{this.logger.info(kr.P_DB_UPGRATE_START_S),this.emit("onDBUpgrateStart")}),(e=>{this.logger.info(kr.P_DB_UPGRATING_S,e),this.emit("onDBUpgrading",e)}),(e=>{this.logger.info(kr.P_DB_UPGRATE_COMPLETE_S,e),this.emit("onDBUpgradeComplete",e)}))}getConnectedTime(){return this._connectedTime}_connectWithToken(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=this._connectingTask=Hi.create(this.logger,"connectWithToken",r);this._naviInfo=t;let n={};const{data:o}=li();o&&(n={proxy_passwd:o.socksPassword||"",proxy_name:o.socksUsername||"",proxy_port:o.socksPort||1082,proxy_host:o.socksHost||"localhost",proxy_type:0});const a=JSON.stringify(Object.assign(Object.assign({},n),{call_plus:this._openCallPlus,cid:this.cid})),c=this.getCmpList(t,!0).filter((e=>vi.includes(e.protocol))).sort(((e,t)=>t.weight-e.weight)),_=[];c.forEach((e=>{const t=_.find((t=>t.addr===e.addr));t?t.protocol!==it.QUIC&&e.protocol!==it.QUIC||(t.race=!0,t.protocol=it.QUIC):(e.race=!1,_.push(e))})),this.logger.info(kr.P_CONNECT_T,JSON.stringify({}),r);const l=Date.now(),d=yield i.asyncInvoke(e,Is,JSON.stringify(Object.assign(Object.assign({},t),{serverAddr:_,tagBlacklist:this._excludeLogTag.join(",")})),s,a).result();this.logger.summary(kr.P_CONNECT_R,d,r,{data:d.data});const{cid:E,userId:u,sessionId:R}=JSON.parse(d.data),h=Date.now()-(l+this._tcpDuration),I={bid:Vs(),cod:d.code,net:this.getNetwork().type,dur:h,spr:0,cid:E,v:is.CURRENT,count:this.retryCount,sts:Date.now(),ssid:R};return this.logger.record($t.IM_CMP_RMTP,JSON.stringify(I)),this._connectingTask=null,d.trans((e=>(this._connectedTime=Date.now()-this.callCppProxy("getDeltaTime"),u)))}))}close(e,t,s){return y(this,void 0,void 0,(function*(){if(!e){const e=Hi.create(this.logger,"disconnect");yield e.asyncInvoke("boolean"!=typeof t||t,!!s,(()=>e.ok()),(t=>e.fail(t))).result()}}))}sendPing(e){return new Promise((t=>{this.pingResolve=t,this.callCppProxy("sendHeartbeat"),setTimeout((()=>this.recvPong(Ke.TIMEOUT)),e)}))}recvPong(e){this.pingResolve&&(this.pingResolve(e),this.pingResolve=null)}recvConnectRes(e,t,s){t?this.onDisconnectByServer(e,s):e===Ke.RC_SOCKET_DISCONNECTED&&this.getConnectionStatus()!==xt.CONNECTED||this.onDisconenctUnusual(e)}_onTcpConnectResponse(e,t,s,r,i,n,o){var a;const c=this.cmpWeightCache.findIndex((e=>e.addr===`${t}:${s}`)),_={bid:Vs(),ptc:ss.TCP,cod:e,net:this.getNetwork().type,dur:r,spr:0,pr:(null===(a=this._naviInfo)||void 0===a?void 0:a.type)||0,hos:`${t}:${s}`,idx:c,rct:this.retryCount?ns.RECONNECT:ns.CONNECT,cid:this.cid,v:is.CURRENT,rsn:this._doConnectReason,ddu:i,count:this.retryCount,weight:c>=0?this.cmpWeightCache[c].weight:-1};if(this.logger.record($t.IM_CMP,JSON.stringify(_)),this.logger.info(kr.P_CONNECT_ENTRY_S,JSON.stringify({code:e,host:t,port:s,duration:r,dnsDuration:i,index:n,isQuic:o})),e===Fi.SUCCESS)this.curCmpUrl=`${t}:${s}`,this.updateCmpWeight(`${t}:${s}`,!0,o);else if(e!==Fi.NOT_INIT){const e=s&&0!==s?`${t}:${s}`:`${t}`;this.updateCmpWeight(e,!1)}}}Vi=new WeakSet,Gi=function(e,t){10!==e&&(this._connectingTask?e===Ke.SUCCESS?this._connectingTask.ok(t):this._connectingTask.fail(e,t):this.logger.warn(kr.P_CONNECT_E,JSON.stringify({msg:"connect complete but no connecting task"})))},ki=function(e,t){switch(this.logger.info(kr.P_CONNECT_S,JSON.stringify({status:e,delay:t})),e){case Ke.RC_CONN_REDIRECTED:this.recvConnectRes(e,!0);break;case 11:case 10:case 12:break;case Ke.CONNECTION_REFUSED:case Ke.RC_SOCKET_DISCONNECTED:case Ke.RC_SOCKET_NOT_CREATED:case Ke.RC_CONN_ACK_TIMEOUT:case Ke.RC_TCP_RESET:this.recvConnectRes(e,!1);break;case Ke.RC_UDP_DISCONNECTED:this.recvConnectRes(e,!0,t);break;default:this.recvConnectRes(e,!0)}};class Ji extends tr{constructor(e,s,r){super(e,s),Object.defineProperty(this,"appkey",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"dbpath",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(this,"_cachePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),this._cachePath=`${r}/${Li(e)}`;const i=t(this._cachePath);N(i)||Fr(i)}getCache(){if(!N(this._cachePath))return null;return O(this._cachePath,{encoding:"utf8"})||null}setCache(e){p(this._cachePath,e)}clearCache(){p(this._cachePath,"")}sendRequest(e){return y(this,void 0,void 0,(function*(){const{status:t,data:s}=yield ci(this.logger,{url:e,body:""});return{code:t,data:s}}))}decryptData(e){return y(this,void 0,void 0,(function*(){try{const t=yield((e,t,s)=>y(void 0,void 0,void 0,(function*(){const r=g("aes-256-cbc",t,s);let i=r.update(e,"base64","utf-8");return i+=r.final("utf8"),i})))(e,"cd4936151214ce45dc1d12673a59d94c","51ad078e5eb17a91");return JSON.parse(t)}catch(e){this.logger.error(ce,JSON.stringify({error:null==e?void 0:e.stack}))}}))}}class ji extends pr{constructor(e,s,r,i,n){super(s,e,r),Object.defineProperty(this,"deviceId",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"catchFilePath",{enumerable:!0,configurable:!0,writable:!0,value:""}),this.model=`Electron|${process.platform}|${process.arch}`,this.catchFilePath=`${n}/${Mi(e)}`;const o=t(this.catchFilePath);N(o)||Fr(o),this.init()}httpRequest(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=r;i.deviceId=this.deviceId,i.model=this.model;const n={url:e,method:t,headers:s,body:JSON.stringify(i)},o=this.logger.createTraceId();this.logger.info(W,JSON.stringify(n),o);const{status:a,data:c=""}=yield ci(this.logger,n);this.logger.info(x,JSON.stringify({status:a,data:c}),o);try{const e=JSON.parse(c);return{code:a,data:e.data}}catch(e){return this.logger.warn(Ee,JSON.stringify({status:a,data:c,error:e})),{code:a,msg:e}}}))}setCloudControllerCache(e){p(this.catchFilePath,JSON.stringify(e))}getLocalCloudControllerCache(){if(!N(this.catchFilePath))return null;return O(this.catchFilePath,{encoding:"utf8"})}setMRTRConfig(e){const t={mrtrChatroom:e.chatroom,mrtrGroup:e.group,mrtrPrivate:e.private,mrtrUltraGroup:e.ultraGroup};this.logger.info(Re,JSON.stringify(t)),xr.setCloudConfig(JSON.stringify(t))}}const Wi=[lt,vt,dt,Tt,Ct,It,gt,ht,Nt,Ot,pt],xi=()=>({logCmdQueue:[],cloudControllerVers:[],srsmsgs:[],readNtfs:[],expansionMsgQueue:new Map,v1ReceiptMsgs:[],privateRSMsgs:[],groupRSMsgs:new Map,rrmsgs:new Map,messageUIds:new Set});class Yi{constructor(){Object.defineProperty(this,"_report",{enumerable:!0,configurable:!0,writable:!0,value:xi()}),Object.defineProperty(this,"_count",{enumerable:!0,configurable:!0,writable:!0,value:0})}isLowPriorityMessage(e){return Wi.includes(e)}isEmpty(){return 0===this._count}get count(){return this._count}push(e,t){this._count++;const{messageType:s,senderUserId:r,content:i}=e;if(s!==lt)if(s!==vt)if(s!==Tt)if(s!==dt)if(s!==ht){if(s===It){const{messageUId:t}=i;if(!t)return;return this._report.messageUIds.add(t),void this._report.v1ReceiptMsgs.push(e)}if(s===gt){const s=i.receiptMessageDic;if(r!==t){const r=s[t];if(!r||0===r.length)return;return r.forEach((e=>this._report.messageUIds.add(e))),void this._report.v1ReceiptMsgs.push(e)}return Object.values(s).forEach((e=>{e.forEach((e=>this._report.messageUIds.add(e)))})),void this._report.v1ReceiptMsgs.push(e)}s!==Nt?s===Ct&&this._handleRSMsg(e):this._handleRRMsg(e)}else this._handleReadNtf(e);else this._handleExpansionNotify(e);else this._handleSRSMsg(e,t);else r===gs&&this._report.cloudControllerVers.push(e.sentTime);else if(r===gs){const{startTime:t,endTime:s,platform:r,logId:n,uri:o}=i;this._report.logCmdQueue.push({startTime:parseInt(t,10),endTime:parseInt(s,10),platform:r,logId:n,uri:o,messageUId:e.messageUId})}}_handleRSMsg(e){const{senderUserId:t,content:s,conversationType:r,targetId:i,channelId:n}=e;if(r===Xe.PRIVATE){const e=this._report.privateRSMsgs.find((e=>e.conversationType===r&&e.targetId===i&&e.channelId===n));return void(e?e.timestamp=Math.max(e.timestamp,s.endMsgTime):this._report.privateRSMsgs.push({conversationType:r,targetId:i,channelId:n,timestamp:s.endMsgTime}))}const{msgId:o,rrn:a,tmn:c}=s,_=this._report.groupRSMsgs.get(o);_?(_.totalCount=c,_.readedCount=a):this._report.groupRSMsgs.set(o,{totalCount:c,readedCount:a}),this._report.messageUIds.add(o)}_handleRRMsg(e){const{msgId:t}=e.content;this._report.rrmsgs.set(t,e),this._report.messageUIds.add(t)}_handleExpansionNotify(e){const{put:t,mid:s,del:r,clear:i}=e.content;this._report.messageUIds.add(s),this._report.expansionMsgQueue.has(s)&&!i?this._report.expansionMsgQueue.get(s).push({put:t,del:r,clear:i}):this._report.expansionMsgQueue.set(s,[{put:t,del:r,clear:i}])}_handleSRSMsg(e,t){const{conversationType:s,targetId:r,channelId:i,senderUserId:n}=e;n===t&&(this._report.srsmsgs=this._report.srsmsgs.filter((e=>e.conversationType!==s||e.targetId!==r||e.channelId!==i)),this._report.srsmsgs.push(e))}_handleReadNtf(e){const{conversationType:t,targetId:s,channelId:r}=e;t===Xe.PRIVATE&&(this._report.readNtfs=this._report.readNtfs.filter((i=>i.conversationType!==t||i.targetId!==s||i.channelId!==r||i.senderUserId!==e.senderUserId)),this._report.readNtfs.push(e))}build(){const e=this._report;return this._report=xi(),this._count=0,e}}class Ki{constructor(e){Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:e})}gen(e,t){return(...s)=>{this.logger.info(kr.L_JS_FUNC_EXEC_O,e);try{t(...s)}catch(t){this.logger.error(kr.L_JS_FUNC_EXEC_E,`name: ${e}\n${t.stack}`),console.warn("L-js_callback_exception-E: args -> ",...s)}}}}function Xi(e){return{type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}}var Qi,$i,Zi,qi,zi,en,tn,sn,rn,nn,on,an,cn,_n,ln,dn,En,un,Rn,hn,In,gn,Tn,Nn,Cn,On,pn,Sn,An,fn,mn,vn,Pn,Ln,Mn,Un,Dn,bn,yn,Vn,Gn,kn,Fn;!function(e){e[e.cuid=1]="cuid",e[e.uid=2]="uid",e[e.all=4]="all"}(Gn||(Gn={}));class wn{constructor(e,t){Qi.add(this),Object.defineProperty(this,"_dispatchEvent",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_msgExpansionHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"logger",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reporter",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"navi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tcpMgr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_environment",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_staticConfigManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cloudController",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cloudControllerUri",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"cloudControllerLock",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"cloudControllerMsgs",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"_deviceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_enableReadReceiptStorage",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_isConnected",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_offlineFinishedPending",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_pullOfflineMessageFinished",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_lowPriorityMessageHandler",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_catcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_needDispatchMessageModifiedSyncCompleted",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"_opts",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_buildSubscribeEventData",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const t=[];try{const{list:s}=JSON.parse(e);s.forEach((e=>{const{userId:s,subscribeType:r,subscribeTime:i,duration:n,operationType:o,details:a=[],userProfile:c}=JSON.parse(e.obj),_={userId:s,subscribeType:r,subscribeTime:i,expiry:n,operationType:o};[Jt.ONLINE_STATUS,Jt.FRIEND_ONLINE_STATUS].includes(r)&&(_.details=a.map((e=>{const{changeTime:t,changeValue:s,platform:r}=JSON.parse(e);return{changeTime:t,eventValue:s,platform:r}}))),[Jt.USER_PROFILE,Jt.FRIEND_USER_PROFILE].includes(r)&&(_.userProfile=this._string2userProfileInfo(c)),t.push(_)}))}catch(t){this.logger.error(kr.P_PARSE_JSON_SUBSCRIBE_DATA_E,JSON.stringify({error:null==t?void 0:t.stack,data:e}))}return t}}),Object.defineProperty(this,"_chatroomCache",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"rtcHeartbeatResolves",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this._opts=e;const{dbpath:s,appkey:r,logOutputLevel:i,disableLogReport:n,eventLoopBlockingCheck:o,enableSyncEmptyTopConversation:a}=e,c=this._deviceId=fi(),_=Ci();this.logger=new Ai(r,"RC-M","IM",_),this._catcher=new Ki(this.logger),xr.initWithAppkey(r,s,Is,this.logger.getSessionId()),xr.setConsoleLogLevel(i+1),this.logger.setOutputLevel(i),this.reporter=new gi(r,c,this.logger,n,_),this.logger.info(kr.P_INIT_O,JSON.stringify({appkey:r,dbpath:s,proto_commit:xr.getNodeVersion(),deviceId:c,commit:"38f2b6b488580bc24bb1fddd69df5e25adfcf61c",processName:process.title,processPId:process.pid,disableLogReport:n,eventLoopBlockingCheck:o})),o&&gr.start(this.logger),wi(this.logger,!1,"setDeviceId",c),this._staticConfigManager=new Ji(r,this.logger,s),this._lowPriorityMessageHandler=new Yi,this.navi=new Di(r,this.logger,s,this._staticConfigManager),this.tcpMgr=new Bi(r,this._callCppProxy.bind(this),this.navi,this.logger),this.tcpMgr.on("onConnected",this.onConnected,this),this.tcpMgr.on("onSuspend",this.onSuspend,this),this.tcpMgr.on("onDisconnected",this.onDisconnected,this),this.tcpMgr.on("onConnecting",this.onConnecting,this),this.tcpMgr.on("onDBOpen",this.dbOpened,this),this.tcpMgr.on("onDBUpgrateStart",this.dbUpgradeStart,this),this.tcpMgr.on("onDBUpgrading",this.dbUpgrading,this),this.tcpMgr.on("onDBUpgradeComplete",this.dbUpgradeComplete,this),this._enableCreateEmptyTopConversation(a),this._initCloudController(r,c,s),this._registerBuildinMessageTypes(),xr.setOnReceiveMessageListener(this._catcher.gen("setOnReceiveMessageListener[0]",V(this,Qi,"m",_n).bind(this)),this._catcher.gen("setOnReceiveMessageListener[1]",V(this,Qi,"m",ln).bind(this)),this._catcher.gen("setOnReceiveMessageListener[2]",this._handleMessageModified.bind(this))),xr.setRTConversationListener(this._catcher.gen("setRTConversationListener",(e=>this._dispatchEvent("sgRelationsSynced",e)))),this._setConversationStatusListener(),this._setPushNotificationListener(),this._setRTCHeartbeatListener(),this._setRTCLivingRoomEventListener(),this._setChatroomEventListener(),this._setCallInfoListener(),this._setSubscribeEventListener(),this._setUserProfileListener(),this._setEntrustGroupListener(),this._setFriendEventListener(),xr.setReadReceiptListener(this._catcher.gen("setReadReceiptListener",((e,t)=>{const s=JSON.parse(t).map((e=>({identifier:{conversationType:e.conIdentifier.type,targetId:e.conIdentifier.targetId,channelId:e.conIdentifier.channelId},messageUId:e.msgUid,readCount:e.readCount,unreadCount:e.unreadCount,totalCount:e.totalCount,users:e.readUsers.map((e=>({userId:e.userId,timestamp:e.receiptTime,isMentioned:e.mentioned})))})));this._dispatchEvent("readReceiptResponseV5",s)}))),xr.setTranslateEventListener(this._catcher.gen("setTranslateEventListener",(e=>{const t=JSON.parse(e).map((e=>({translateInfo:{targetLanguage:e.translateResult.targetLanguage,translatedText:e.translateResult.translatedText,status:e.translateResult.translateStatus},code:e.code,identifier:e.messageRecognitionIdentifier.messageUid,from:e.messageRecognitionIdentifier.inputSource})));this._dispatchEvent("translateResponse",t)}))),this._msgExpansionHandler=new mi(this._callCppProxy.bind(this)),xr.setUltraGroupListener(this._catcher.gen("setUltraGroupListener[0]",(e=>this._dispatchEvent("ultraGroupEnable"))),this._catcher.gen("setUltraGroupListener[1]",((e,t,s)=>V(this,Qi,"m",qi).call(this,e,t,s))),this._catcher.gen("setUltraGroupListener[2]",(e=>V(this,Qi,"m",zi).call(this,e))),this._catcher.gen("setUltraGroupListener[3]",(e=>V(this,Qi,"m",en).call(this,e))),this._catcher.gen("setUltraGroupListener[4]",(e=>V(this,Qi,"m",tn).call(this,e))),this._catcher.gen("setUltraGroupListener[5]",(e=>V(this,Qi,"m",sn).call(this,e))),this._catcher.gen("setUltraGroupListener[6]",(e=>V(this,Qi,"m",rn).call(this,e))),this._catcher.gen("setUltraGroupListener[7]",(e=>V(this,Qi,"m",$i).call(this,e))),this._catcher.gen("setUltraGroupListener[8]",(e=>V(this,Qi,"m",Zi).call(this,e)))),xr.setRobotEventListener(this._catcher.gen("setRobotEventListener",((e,t)=>{this._dispatchEvent("robotsSynced",e,V(this,Qi,"m",Vn).call(this,t))}))),xr.setMessageReactionListener(this._catcher.gen("setMessageReactionListener",(e=>{const t=JSON.parse(e).map((e=>{var t,{conversationIdentifier:s}=e,r=function(e,t){var s={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(s[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(s[r[i]]=e[r[i]])}return s}(e,["conversationIdentifier"]);return Object.assign({conversationIdentifier:(t=s,{conversationType:t.type,targetId:t.targetId,channelId:t.channelId})},r)}));this._dispatchEvent("messageReaction",{reactions:t})})))}_setDeviceInfo(){const{model:e}=a()[0];let t=c();try{"darwin"===process.platform?t=h("sw_vers -ProductVersion",{encoding:"utf-8"}):"win32"===process.platform&&(t=h("ver",{encoding:"utf-8"}))}catch(e){this.logger.error(ge,JSON.stringify({error:e}))}xr.setDeviceInfo("",e,"PC",t,"","")}_initCloudController(e,t,s){const r=er.getCloudControllerUrl();[this.cloudControllerUri]=r,this.cloudController=new ji(e,this.logger,this.reporter,t,s),this.cloudControllerUri&&this.cloudController.request(this.cloudControllerUri,Tr)}callProxy(e,...t){return y(this,void 0,void 0,(function*(){const s=this[e];if(!s)return this.logger.warn(kr.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"})),js(Ke.NOT_SUPPORT);let r="";try{return yield s.call(this,...t)}catch(t){r=JSON.stringify({error:null==t?void 0:t.stack,method:e}),this.logger.error(kr.P_CALL_MAIN_E,r)}return js(Ke.MAIN_PROCESS_ERROR,r)}))}sendProxy(e,...t){return y(this,void 0,void 0,(function*(){const s=this[e];if(s)try{s.call(this,...t)}catch(t){this.logger.error(kr.P_CALL_MAIN_E,JSON.stringify({error:null==t?void 0:t.stack,method:e}))}else this.logger.warn(kr.P_CALL_MAIN_E,JSON.stringify({method:e,error:"not found"}))}))}setRenderInitOption(e){const{navigators:t,areaCode:s,logServerUrl:r,environment:i,useNaviV2:n,enableReadReceiptStorage:o}=e;this._environment=i||"default",this.navi.setEnvironment(this._environment),this._enableReadReceiptStorage=o,this.navi.setUseNaviV2(n),er.init({areaCode:s,navigators:t,logServerUrl:r})}onConnected(e,t){this._isConnected=!0;const s=this.getNaviInfoFromCache();this.reporter.checkStart(s,""),this._try2RejoinChatroom();const r=this.getMainProcessCache();this._dispatchEvent("onConnected",t,r),this._offlineFinishedPending&&(this._offlineFinishedPending=!1,this.logger.info(Te),this._dispatchEvent("pullFinished")),this._needDispatchMessageModifiedSyncCompleted&&(this._needDispatchMessageModifiedSyncCompleted=!1,this._dispatchEvent("messageModifiedSyncCompleted"))}onConnecting(){this._isConnected=!1,this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._needDispatchMessageModifiedSyncCompleted=!0,this._dispatchEvent("onConnecting")}onSuspend(e,t){this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._dispatchEvent("onSuspend",t)}onDisconnected(e,t){this._isConnected=!1,this._pullOfflineMessageFinished=!1,this._offlineFinishedPending=!1,this._dispatchEvent("onDisconnected",t)}dbOpened(e,t,s,r){this._dispatchEvent("databaseOpened",t,s)}dbUpgradeStart(){this._dispatchEvent("databaseUpgradeWillStart")}dbUpgrading(e,t){this._dispatchEvent("databaseUpgrading",t)}dbUpgradeComplete(e,t){this._dispatchEvent("databaseUpgradeDidComplete",t)}_callCppProxy(e,...t){const s=this.logger.createTraceId();try{this.logger.debug(kr.P_CALL_ADDON_O,JSON.stringify({method:e,content:t}),s);return xr[e](...t)}catch(t){throw this.logger.error(kr.P_CALL_ADDON_E,JSON.stringify({stack:null==t?void 0:t.stack,method:e}),s),t}}refetchNaviInfo(){return this.navi.request(this.tcpMgr.getToken(),!0,!0,this.logger.createTraceId())}sendHTTPRequest(e){return ci(this.logger,e)}onReceiveRendererLog(e){this.logger.recvRendererLog(e)}setNetwork(e,t){if(this.tcpMgr.setNetwork(e,t),e.status&&this.cloudController){const e=this.tcpMgr.getToken();this.cloudController.request(this.cloudControllerUri,Nr,e)}}destroy(){gr.stop(),this.reporter.stop(),this.logger.destroy(),xr.destroy()}getHistoryMessagesByObjectNames(e,t){return y(this,void 0,void 0,(function*(){const{conversationType:s,targetId:r,channelId:i}=e,{timestamp:n,count:o,order:a,messageTypes:c}=t,_=o+1,l=wi(this.logger,!1,"getHistoryMessagesByObjectNames",s,r,n,_,c,0===a,i||""),d=JSON.parse(l).list.reverse().map((({obj:e})=>this._buildMessage(e)));return Js({list:_===d.length?d.slice(1,_):d,hasMore:o<d.length})}))}_updateMessageReceiptStatus(e,t,s,r){return wi(this.logger,!0,"updateMessageReceiptStatus",e,t,s,r||"")}updateMessageReceiptStatus(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=this._updateMessageReceiptStatus(e,t,s,r);return Js(i)}))}getNaviInfoFromCache(){return this.tcpMgr.getConnectionStatus()!==xt.CONNECTED?null:this.navi.getNaviInfoFromCache(this.tcpMgr.getToken())}getConnectedTime(){return this.tcpMgr.getConnectedTime()}_getServerTime(){return Date.now()-xr.getDeltaTime()}_getCurrentUserId(){return this.tcpMgr.getCurrentUserId()}getMainProcessCache(){const e=this.tcpMgr.getConnectedTime(),t=this.tcpMgr.getConnectionStatus(),s=this.getNaviInfoFromCache(),r=this.tcpMgr.getCurrentUserId();return{connectedTime:e,deviceId:this._deviceId,crtUserId:r,naviInfo:s,connectionStatus:t,deltaTime:xr.getDeltaTime(),commitId:"38f2b6b488580bc24bb1fddd69df5e25adfcf61c"}}_enableCreateEmptyTopConversation(e){wi(this.logger,!1,"enableCreateEmptyTopConversation",e)}_registerBuildinMessageTypes(){Dr().forEach((e=>{this.registerMessageType(e.objectName,e)}))}_parseMessageJsonContent(e,t){let s;try{s=e?JSON.parse(e):{}}catch(r){s=e,this.logger.error(kr.P_PARSE_JSON_MSGS_E,JSON.stringify({content:e,messageId:t}))}return s}_buildSupportExt(e,t){let s=null;return e&&(s=this._msgExpansionHandler.parseReceiveExpansion(t)),s}_handleReadReceiptRequest(e){const t=JSON.parse(e),s=this.getNaviInfoFromCache();if(!(null==s?void 0:s.grpRRVer))return t;const{hasRespond:r,readerInfo:i={},readCount:n,totalCount:o,readerList:a=[]}=t,c={readCount:n,totalCount:o};if(1===(null==s?void 0:s.grpRRVer)){const e=[];for(const t in i)e.push({userId:t,readTime:i[t]});c.readerList=e,c.hasRespond=r}return 3===(null==s?void 0:s.grpRRVer)&&(c.readerList=a),c}_buildMessage(e,t){const s=JSON.parse(e);return V(this,Qi,"m",nn).call(this,s,t)}_updateReadReceiptInfo(e,t){const s=V(this,Qi,"m",mn).call(this,e);if(!s.isOk)return;const r=s.data,i=r.readReceiptRequest?JSON.parse(r.readReceiptRequest):{},n=Object.assign(Object.assign({},i),t);wi(this.logger,!1,"updateReadReceiptRequestInfo",e,JSON.stringify(n))}_buildConversation(e){const t=JSON.parse(e);return V(this,Qi,"m",on).call(this,t)}_convertResultList(e,t){let{list:s}=JSON.parse(e);return s=s.map((e=>{const s=JSON.parse(e.obj);return t?t(s):s})),s}_getMessagesByUIds(e){if(0===e.length)return[];const t=wi(this.logger,!1,"getMessageByUids",e);return JSON.parse(t).list.map((e=>V(this,Qi,"m",nn).call(this,JSON.parse(e.obj))))}_handleLowPriorityMessages(e,t){if(this._lowPriorityMessageHandler.isEmpty())return;const s=Date.now(),{count:r}=this._lowPriorityMessageHandler,i=this.logger.createTraceId();this.logger.info(kr.L_HANDLE_LOW_PRIORITY_MESSAGES_T,JSON.stringify({startTime:s,count:r}),i);const n=this._lowPriorityMessageHandler.build(),{srsmsgs:o,readNtfs:a,expansionMsgQueue:c,v1ReceiptMsgs:_,privateRSMsgs:l,groupRSMsgs:d,rrmsgs:E,logCmdQueue:u,cloudControllerVers:R,messageUIds:h}=n,I=new Map;this._getMessagesByUIds([...h.values()]).forEach((e=>{I.set(e.messageUId,e)})),this._handleExpansionMsgQueue(c,I),this._sendMessageNotification(a,!1),this._handlerReadReceiptMsgV1(_,I,e),this._handleSRSMsgs(o,t),this._handlerPrivateRSMsgs(l),this._handlerGroupRSMsgs(d,I),this._handlerRRMsgs(E,I),R.length>0&&(this.cloudControllerMsgs.push(...R),this._ccMsgHandler()),u.forEach((e=>{const{startTime:t,endTime:s,platform:r,logId:i,uri:n,messageUId:o}=e;this.reporter.report(t,s,r,n,i,o)})),this.logger.info(kr.L_HANDLE_LOW_PRIORITY_MESSAGES_R,JSON.stringify({startTime:s,cost:Date.now()-s}),i)}_updateReadReceiptRequestInfoList(e){if(0===e.length)return;const t=e.map((e=>JSON.stringify({message_uid:e.messageUId,request_info:JSON.stringify(e.readReceiptInfo)})));wi(this.logger,!1,"updateReadReceiptRequestInfoList",t)}_handlerRRMsgs(e,t){const s=[],r=[];Array.from(e.entries()).forEach((([e,i])=>{const n=t.get(e);if(!n)return;const{rrn:o,tmn:a}=i.content;let c=n.readReceiptInfo||{};c=Object.assign(Object.assign({},c),{readCount:o,totalCount:a}),n.readReceiptInfo=c,s.push({messageUId:e,readReceiptInfo:c}),r.push(i)})),this._updateReadReceiptRequestInfoList(s),this._sendMessageNotification(r,!1)}_handlerGroupRSMsgs(e,t){const s=[],r=[];Array.from(e.entries()).forEach((([e,{totalCount:i,readedCount:n}])=>{const o=t.get(e);if(!o)return;const{conversationType:a,targetId:c,channelId:_}=o;let l=o.readReceiptInfo||{};l=Object.assign(Object.assign({},l),{readCount:n,totalCount:i}),o.readReceiptInfo=l,s.push({messageUId:e,readReceiptInfo:l}),r.push({conversationType:a,targetId:c,channelId:_,readedCount:n,totalCount:i,messageUId:e})})),this._updateReadReceiptRequestInfoList(s),r.forEach((e=>this._sendMessageReadReceipt({groupReadReceipt:e})))}_handlerPrivateRSMsgs(e){e.forEach((e=>{const{conversationType:t,targetId:s,channelId:r,timestamp:i}=e;this._updateMessageReceiptStatus(t,s,i,r||""),this._sendMessageReadReceipt({privateReadReceipt:{conversationType:t,targetId:s,channelId:r||"",endMsgTime:i}})}))}_handleSRSMsgs(e,t){1!==this.getNaviInfoFromCache().sesDriven?this._sendMessageNotification(e,!1):e.forEach((e=>{const{conversationType:s,targetId:r,channelId:i,sentTime:n,content:o}=e;n>t||this._sendsyncReadStatus({conversationType:s,targetId:r,channelId:i,timestamp:o.lastMessageSendTime})}))}_handlerReadReceiptMsgV1(e,t,s){if(0===e.length)return;const r=new Set,i=[];e.forEach((e=>{const{messageType:n,senderUserId:o,content:a}=e;if(n===It){const{messageUId:n}=a,c=t.get(n);if(!c||c.senderUserId!==o)return;return c.readReceiptInfo=o===s?{isReceiptRequestMessage:!0,readerList:[]}:{isReceiptRequestMessage:!0,hasRespond:!1},r.add(c),void i.push(e)}const c=a.receiptMessageDic;if(o===s)return Object.values(c).forEach((e=>{e.forEach((e=>{const s=t.get(e);s&&(s.readReceiptInfo=Object.assign(Object.assign({},s.readReceiptInfo),{hasRespond:!0}),r.add(s))}))})),void i.push(e);const _=c[s];_&&0!==_.length&&(_.forEach((e=>{const s=t.get(e);if(!s)return;const i=s.readReceiptInfo,n=((null==i?void 0:i.readerList)||[]).concat(o);s.readReceiptInfo=Object.assign(Object.assign({},s.readReceiptInfo),{readerList:n}),r.add(s)})),i.push(e))})),this._enableReadReceiptStorage&&this._updateReadReceiptRequestInfoList(Array.from(r.values()).map((e=>({messageUId:e.messageUId,readReceiptInfo:e.readReceiptInfo})))),this._sendMessageNotification(i,!1)}_handleExpansionMsgQueue(e,t){if(0===e.size)return;const s=[],r=[];Array.from(e.entries()).forEach((([e,i])=>{const n=t.get(e);if(!n||!i.length)return;const o=new Set,a=new Set;let c=n.expansion||{};i.forEach((({put:e,del:t,clear:s})=>{if(s)return Object.keys(c).forEach((e=>{o.add(e),a.clear()})),void(c={});e&&(Object.keys(e).forEach((e=>{o.delete(e),a.add(e)})),c=Object.assign(Object.assign({},c),e)),t&&t.forEach((e=>{o.add(e),a.delete(e),delete c[e]}))})),n.expansion=c;const _={};Object.keys(c).forEach((e=>{_[e]={v:c[e]}})),s.push({messageUId:e,expansion:JSON.stringify(_)});const l={},{conversationType:d,targetId:E,channelId:u}=n;let R=!1;o.size>0&&(R=!0,l.deletedExpansion={conversationType:d,targetId:E,channelId:u||"",messageUId:e,deletedKeys:Array.from(o)}),a.size>0&&(R=!0,l.updatedExpansion={conversationType:d,targetId:E,channelId:u||"",messageUId:e,expansion:c}),R&&r.push(l)})),V(this,Qi,"m",dn).call(this,s),r.forEach((e=>this._dispatchEvent("expansion",e)))}_handleHighPriorityMessages(e,t){const s=e.filter((e=>{const{messageType:t,conversationType:s}=e;return t!==Rt&&(t===ut?V(this,Qi,"m",En).call(this,e,"highPriorityMessages"):s!==Xe.CHATROOM||V(this,Qi,"m",cn).call(this,e))}));this._sendMessageNotification(s,t)}_ccMsgHandler(){var e;return y(this,void 0,void 0,(function*(){if(!this.cloudControllerLock)return;this.cloudControllerLock=!1;if(this.cloudControllerMsgs.shift()){const t=this.tcpMgr.getToken(),s=(yield null===(e=this.cloudController)||void 0===e?void 0:e.request(this.cloudControllerUri,Cr,t))||0;this.cloudControllerMsgs=this.cloudControllerMsgs.filter((e=>e>s)),this.cloudControllerLock=!0,this._ccMsgHandler()}}))}_sendMessageNotification(e,t){e.length>0&&this._dispatchEvent("batchMessage",e,void 0,t)}_sendPullOfflineFinished(){this._isConnected?(this.logger.info(Te),this._dispatchEvent("pullFinished")):this._offlineFinishedPending=!0}_handleMessageModified(e,t,s){const r=JSON.parse(e).list.map((({obj:e})=>this._buildMessage(e)));if(1===s)r.length&&this._dispatchEvent("messagesModified",r);else if(2===s){const e=r.filter((e=>V(this,Qi,"m",En).call(this,e,"messageModified")));this._sendMessageNotification(e,!1)}this._needDispatchMessageModifiedSyncCompleted&&!t&&this._isConnected&&(this._needDispatchMessageModifiedSyncCompleted=!1,this._dispatchEvent("messageModifiedSyncCompleted"))}_handleChatroomKVUpdate(e){const t=JSON.parse(e).list.map((({obj:e})=>{const{roomId:t,key:s,value:r,operator:i,version:n,isDeleted:o}=JSON.parse(e);return{chatroomId:t,key:s,value:r,timestamp:n,type:o?Be.DELETE:Be.UPDATE}}));t.length&&this._sendChatroomEvents({updatedEntries:t})}_handleChatroomFullKVSync(e,t,s){const r=this._chatroomCache.get(e);if(!r)return;r.isKVSynced||(r.isKVSynced=!0,this._sendChatroomEvents({entriesSynced:e}));const i=e=>JSON.parse(e).list.map((({obj:e})=>JSON.parse(e))).reduce(((e,t)=>e.set(t.key,t)),new Map),n=i(t),o=i(s),a=[];Array.from(n.entries()).forEach((([e,t])=>{const{roomId:s,value:r,operator:i,version:n,isDeleted:c}=t,_=o.get(e);_?(o.delete(e),a.push({chatroomId:s,key:e,value:_.value,timestamp:_.version,type:Be.UPDATE})):a.push({chatroomId:s,key:e,value:r,timestamp:n,type:Be.DELETE})})),Array.from(o.entries()).forEach((([t,s])=>{a.push({chatroomId:e,key:t,value:s.value,timestamp:s.version,type:Be.UPDATE})})),a.length&&this._sendChatroomEvents({updatedEntries:a})}_sendChatroomEvents(e){this._dispatchEvent("chatroom",e)}_sendMessageReadReceipt(e){this._dispatchEvent("messageReadReceipt",e)}_sendsyncReadStatus(e){this._dispatchEvent("syncReadStatus",e)}_setConversationStatusListener(){xr.setConversationStatusListener(this._catcher.gen("setConversationStatusListener[0]",(e=>{const t=JSON.parse(e).list.map((e=>{const t=JSON.parse(e.obj),s={conversation:{channelId:t.channelId,conversationType:t.conversationType,targetId:t.targetId},updatedItems:{}};return t.status.forEach((e=>{const{type:t,value:r}=JSON.parse(e.item);if(1===t){const e=Number(r)||Zt.NOT_SET;s.updatedItems.notificationLevel={val:e,time:0},s.updatedItems.notificationStatus={val:zt(e),time:0}}else 2===t?s.updatedItems.isTop={val:"1"===r,time:0}:4===t&&(s.updatedItems.translateStrategy={val:Number(r),time:0})})),s}));t.length>0&&this._dispatchEvent("conversation",t)})),this._catcher.gen("setConversationStatusListener[1]",(e=>{this._dispatchEvent("conversationTag")})),this._catcher.gen("setConversationStatusListener[2]",((e,t,s,r)=>{this._clearUnreadCountByTimestamp({conversationType:e,targetId:t,channelId:s},r),this._sendsyncReadStatus({conversationType:e,targetId:t,channelId:s,timestamp:r})})),this._catcher.gen("setConversationStatusListener[3]",(e=>this._dispatchEvent("conversationStatusSynced",e))),this._catcher.gen("setConversationStatusListener[4]",(()=>{this._dispatchEvent("syncServerSaveUnreadCompleted")})),this._catcher.gen("setConversationStatusListener[5]",(e=>{const t=V(this,Qi,"m",an).call(this,e,"OnConversationUnreadChanged");if(!t.isOk)return;const s=t.data.map((e=>({conversation:e,updatedItems:{unreadMessageCount:{val:e.unreadMessageCount,time:0},hasMentioned:{val:!!e.hasMentioned,time:0}}})));this._dispatchEvent("conversation",s)})))}_setPushNotificationListener(){xr.setPushNotificationListener(this._catcher.gen("setPushNotificationListener[0]",(e=>this._getRTCProfile())),this._catcher.gen("setPushNotificationListener[1]",(()=>this._dispatchEvent("tag"))),this._catcher.gen("setPushNotificationListener[2]",(e=>this._dispatchEvent("userSettingsSynced",e))),this._catcher.gen("setPushNotificationListener[3]",(e=>this._dispatchEvent("userSettingsChanged",{key:$s,value:e}))),this._catcher.gen("setPushNotificationListener[4]",(e=>this._dispatchEvent("userSettingsChanged",{key:Qs,value:e}))))}_getRTCProfile(){const e=this._callCppProxy("getRTCProfile");if(!e)return;const t=this.tcpMgr.getToken();this.navi.updateVoipCallInfo(t,e);const s=this.navi.getNaviInfoFromCache(t);this._dispatchEvent("onNaviDataChange",s)}_setRTCLivingRoomEventListener(){xr.setRTCRoomEventListener(this._catcher.gen("setRTCRoomEventListener",(e=>{this._dispatchEvent("onRTCDataChange",Array.prototype.slice.call(e))})))}_setChatroomEventListener(){xr.setChatroomEventListener(this._catcher.gen("setChatroomEventListener[0]",((e,t)=>this._sendChatroomEvents({chatroomDestroyed:e,chatroomDestroyedType:t})))),xr.setChatroomStatusListener(this._catcher.gen("setChatroomEventListener[1]",((e,t,s)=>this._handleChatroomFullKVSync(e,t,s))),this._catcher.gen("setChatroomEventListener[2]",(e=>this._handleChatroomKVUpdate(e))))}_setCallInfoListener(){xr.setCallInfoListener(this._catcher.gen("setCallInfoListener[0]",(e=>{const t=[];try{JSON.parse(e).list.forEach((e=>{Object.entries(e).forEach((([e,s])=>{t.push({key:e,value:s})}))}))}catch(e){this.logger.error(kr.P_PARSE_JSON_E,JSON.stringify({error:e}))}this._dispatchEvent("callInfo",JSON.stringify({list:t}))})))}_setSubscribeEventListener(){xr.setSubscribeEventListener(this._catcher.gen("setSubscribeEventListener[0]",(()=>{})),this._catcher.gen("setSubscribeEventListener[1]",(e=>{this._dispatchEvent("syncSubscribedUserStatusFinished",e)})),this._catcher.gen("setSubscribeEventListener[2]",(e=>{const t=this._buildSubscribeEventData(e).map((e=>({userId:e.userId,subscribeType:e.subscribeType,subscribeTime:e.subscribeTime,expiry:e.expiry,operationType:e.operationType})));this._dispatchEvent("subscribedRelationChange",t)})),this._catcher.gen("setSubscribeEventListener[3]",(e=>{const t=this._buildSubscribeEventData(e).map((e=>{const{userId:t,subscribeType:s,subscribeTime:r,expiry:i,details:n,userProfile:o}=e,a={userId:t,subscribeType:s,subscribeTime:r,expiry:i};return[Jt.ONLINE_STATUS,Jt.FRIEND_ONLINE_STATUS].includes(s)?a.details=n:[Jt.USER_PROFILE,Jt.FRIEND_USER_PROFILE].includes(s)&&(a.userProfile=o),a}));this._dispatchEvent("subscribedUserStatusChange",t)})))}_setUserProfileListener(){xr.setUserProfileListener(this._catcher.gen("setUserProfileListener[0]",(e=>{this._dispatchEvent("syncSubscribedUserStatusFinished",e)})),this._catcher.gen("setUserProfileListener[1]",(e=>{this._dispatchEvent("ownUserProfileChanged",this._string2userProfileInfo(e))})))}_onGroupOperationChanged(e,t,s,r,i){let n,o,a=[];try{n=JSON.parse(r),a=JSON.parse(i),o=JSON.parse(e);let c={groupId:n[0]?n[0].groupId:"",operatorInfo:this._convertGroupMemberInfoList([o])[0],operation:t,operationTime:s};0===t?[c.groupInfo]=this._convertGroupInfoList(n):c.memberInfos=this._convertGroupMemberInfoList(a),this._dispatchEvent("groupOperation",c)}catch(t){this.logger.error(kr.P_PARSE_JSON_E,JSON.stringify({error:t,groupInfoJson:r,membersJson:i,operatorInfo:e}))}}_onGroupInfoChanged(e,t,s,r,i,n){try{const o=this._convertUpdateGroupInfoList(JSON.parse(i))[0];switch(e){case be.GROUP_INFO_CHANGE:const i=JSON.parse(s),a={operatorInfo:i.userId?this._convertGroupMemberInfoList([i])[0]:void 0,operationTime:n,groupInfo:o,changedGroupInfo:o,fullGroupInfo:r?this._convertUpdateGroupInfoList(JSON.parse(r))[0]:o};this._dispatchEvent("groupInfoChanged",a);break;case be.GROUP_REMARK_DELETE:case be.GROUP_REMARK_SET:{const s=e===be.GROUP_REMARK_SET?ye.ADD:ye.REMOVE;this._dispatchEvent("groupRemarkChangedSync",{groupId:t,operationType:s,operationTime:n,groupRemark:(null==o?void 0:o.remark)||""});break}}}catch(e){this.logger.error(kr.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfoJson:i,operatorInfoJson:s}))}}_onGroupMemberInfoChanged(e,t,s,r){try{const i=JSON.parse(t),n=JSON.parse(s),o={groupId:e,operatorInfo:i.userId?this._convertGroupMemberInfoList([i])[0]:void 0,memberInfo:this._convertGroupMemberInfoList([n])[0],operationTime:r};this._dispatchEvent("groupMemberInfoChanged",o)}catch(e){this.logger.error(kr.P_PARSE_JSON_E,JSON.stringify({error:e,operatorInfoJson:t,updateMemberInfoJson:s}))}}_onGroupRequestChanged(e,t,s,r){try{const e=JSON.parse(s),{groupId:t,joinUser:i,approverUser:n,inviterUser:o,type:a,status:c,direction:_,remark:l}=e,d=Object.assign(Object.assign(Object.assign(Object.assign({groupId:t},i&&{joinMemberInfo:this._convertGroupMemberInfoList([i])[0]}),o&&o.userId&&{inviterInfo:this._convertGroupMemberInfoList([o])[0]}),n&&n.userId&&{operatorInfo:this._convertGroupMemberInfoList([n])[0]}),{status:c,direction:_,type:a,operationTime:r,reason:l});this._dispatchEvent("groupApplicationEvent",d)}catch(e){this.logger.error(kr.P_PARSE_JSON_E,JSON.stringify({error:e,groupInfo:t,requestInfoJson:s}))}}_onFavoriteMembersChanged(e,t,s,r){try{const i=JSON.parse(s);let n=[];i&&As(i.list)&&(n=i.list.map((e=>e.value))),this._dispatchEvent("groupFollowsChangedSync",{groupId:e,operationType:t,operationTime:r,userIds:n})}catch(e){this.logger.error(kr.P_PARSE_JSON_E,JSON.stringify({error:e,memberIds:s}))}}_setEntrustGroupListener(){xr.setEntrustGroupListener(this._catcher.gen("setEntrustGroupListener[0]",this._onGroupOperationChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[1]",this._onGroupInfoChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[2]",this._onGroupMemberInfoChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[3]",this._onGroupRequestChanged.bind(this)),this._catcher.gen("setEntrustGroupListener[4]",this._onFavoriteMembersChanged.bind(this)))}_onFriendApplicationStatusChanged(e,t,s,r,i,n){this._dispatchEvent("friendApplicationStatusChanged",{userId:e,applicationType:t,applicationStatus:s,directionType:r,operationTime:i,extra:null!=n?n:""})}_onFriendAdd(e,t,s,r,i){this._dispatchEvent("friendAdd",{userId:t,name:s,portraitUri:r,directionType:e,operationTime:i})}_onFriendDelete(e,t,s){const r={directionType:e,operationTime:s,userIds:JSON.parse(t).list.map((e=>e.value))};this._dispatchEvent("friendDelete",r)}_onFriendsClearedFromServer(e){this._dispatchEvent("friendCleared",e)}_onFriendInfoChangedSync(e,t,s){try{const r=JSON.parse(s);this._dispatchEvent("friendInfoChangedSync",{userId:e,remark:t,extProfile:r.list,operationTime:0})}catch(e){this.logger.error(kr.P_PARSE_JSON_E,JSON.stringify({error:e,profiles:s}))}}_setFriendEventListener(){xr.setFriendEventListener(this._catcher.gen("setFriendEventListener[0]",this._onFriendApplicationStatusChanged.bind(this)),this._catcher.gen("setFriendEventListener[1]",this._onFriendAdd.bind(this)),this._catcher.gen("setFriendEventListener[2]",this._onFriendDelete.bind(this)),this._catcher.gen("setFriendEventListener[3]",this._onFriendsClearedFromServer.bind(this)),this._catcher.gen("setFriendEventListener[4]",this._onFriendInfoChangedSync.bind(this)))}registerMessageType(e,t){t.isPersited=e!==ut&&t.isPersited;let s=0;const{isCounted:r,isCustom:i,isStatusMessage:n,searchProps:o,isPersited:a}=t;a&&(s|=1),r&&(s|=2),n&&(s=16),i&&function(e,t){const s=Ur.get(e);s&&!s.isCustom&&console.warn(`Builtin message type '${e}' cannot be registered`),t.isStatusMessage&&(t.isCounted=t.isPersited=!1),Ur.set(e,Object.assign(Object.assign({},t),{isCustom:!0}))}(e,t),wi(this.logger,!1,"registerMessageType",e,s,o||[])}connect(e,t,s,r){return this.tcpMgr.connect(e,t,s,r)}reconnect(e,t,s){const r=Ke.RC_SOCKET_DISCONNECTED;return this.tcpMgr.reconnect(e,t,s,r)}reportSDKInfo(e){const t=JSON.stringify(Object.assign(Object.assign({},e),{"electron-main":"5.44.0"}));this.logger.info(kr.P_REPORT_VER_O,t),wi(this.logger,!1,"uploadSDKVersion",t,"")}disconnect(e,t){return y(this,void 0,void 0,(function*(){return e=e||!0,this._chatroomCache.clear(),this.reporter.stop(),_i(null,this.logger),yield this.tcpMgr.disconnect(e,t),Js()}))}setUserStatus(e){const t=Hi.create(this.logger,"setUserStatus");return t.asyncInvoke(e,(()=>t.ok()),(e=>t.fail(e))).result()}getUserStatus(e){const t=Hi.create(this.logger,"getUserStatus");return t.asyncInvoke(e,(e=>t.ok({status:e})),(e=>t.fail(e))).result()}_handleDirectionalUserIdList(e,t){let{messageType:s,content:r,directionalUserIdList:i=[]}=e;const n=t===Xe.GROUP;if(s===gt&&r.receiptMessageDic&&n)for(const e in r.receiptMessageDic)i.push(e);return s===Tt&&(i=((e,t)=>t&&0!==t.length?[Xe.GROUP,Xe.ULTRA_GROUP,Xe.APP_PUBLIC_SERVICE,Xe.PUBLIC_SERVICE].includes(e)?t:[]:t||[])(t,[this._getCurrentUserId()])),i}_handleMessage2Callback(e,t){switch(e.messageType){case dt:this._msgExpansionHandler.setLocalFromExtMsg(this.logger,e);break;case It:this._enableReadReceiptStorage&&this._updateReadReceiptInfo(t.content.messageUId,{isReceiptRequestMessage:!0,readerList:[]});break;case gt:if(this._enableReadReceiptStorage){const{receiptMessageDic:e}=t.content;if(!e)return;for(const t in e)e[t].forEach((e=>{this._updateReadReceiptInfo(e,{isReceiptRequestMessage:!0,hasRespond:!0})}))}}}sendMessage(e,t,s,r){return y(this,void 0,void 0,(function*(){const{conversationType:i,targetId:n,channelId:o}=e;let{messageType:a,content:c,expansion:_,pushConfig:l,pushContent:d="",pushData:E="",directionalUserIdList:u=[],disableNotification:R=!1,canIncludeExpansion:h=!1,isVoipPush:I=!1,messageId:g=0,disableUpdateLastMessage:T,needReceipt:N,quoteInfo:C}=t,{iOSConfig:O,androidConfig:p,harmonyOSConfig:S,templateId:A="",pushTitle:f="",pushContent:m=d,pushData:v=E,disablePushTitle:P=!1,forceShowDetailContent:L=!1}=l||{};const M=ys(O,p,S);d=m,E=v;const U=(null==p?void 0:p.notificationId)||"";u=this._handleDirectionalUserIdList(t,i);const D={};for(const e in _)D[e]={v:_[e]};const b=A;this.logger.info(kr.P_SEND_MSG_T,JSON.stringify({messageType:a,conversationType:i,targetId:n,channelId:o}),s);const y=Hi.create(this.logger,"sendMessage"),V=wi(this.logger,!1,"sendMessage",((e,r)=>{const i=this._buildMessage(e,!1);this.logger.info(kr.P_SEND_MSG_R,JSON.stringify({code:r,messageUId:i.messageUId}),s),r!==Ke.SENSITIVE_REPLACE?(this._handleMessage2Callback(i,t),y.ok(i)):y.fail(r)}),((e,t)=>{const r=this._buildMessage(e,!1);this.logger.warn(kr.P_SEND_MSG_R,JSON.stringify({code:t,messageId:r.messageId}),s),r.sentTime=Date.now()-xr.getDeltaTime(),y.fail(t,r)}),i,n,a,JSON.stringify(c),u,R,P,L,d,E,U,f,M,b,h,JSON.stringify(D),I,o||"",g,!!T,!!N,(null==C?void 0:C.messageUId)||"",(null==C?void 0:C.senderId)||"",(null==C?void 0:C.objectName)||""),G=JSON.parse(V);return null==r||r(G.messageId),y.result()}))}recallMsg(e,t){var s;return y(this,void 0,void 0,(function*(){const r=e.channelId||"",{targetId:i,conversationType:n}=e,{user:o,pushContent:a,extra:c,pushConfig:_,disableNotification:l,isDelete:d,directionalUserIdList:E,disableUpdateLastMessage:u,isAdmin:R,messageUId:h,sentTime:I}=t,g={conversationType:n,targetId:i,messageUId:h,sentTime:I,user:o,extra:c,channelId:r,isDelete:d||!1,isAdmin:R};o&&(g.user=o),c&&(g.extra=c);const T={conversationType:n,targetId:i,senderUserId:this.tcpMgr.getCurrentUserId(),content:g,objectName:ut,messageUid:h,direction:Xt.SEND,status:es.UNREAD,sentTime:I,channelId:r},N=this._buildMessage(JSON.stringify(T),!1),C=Hi.create(this.logger,"recallMessage");return C.asyncInvoke((e=>y(this,void 0,void 0,(function*(){V(this,Qi,"m",En).call(this,N,"recall"),n===Xe.ULTRA_GROUP&&this._dispatchEvent("ultraGroupMessageRecalled",[N]),N.pushConfig=_,C.ok(N)}))),(e=>C.fail(e)),ut,JSON.stringify(g),l||!1,(null==_?void 0:_.disablePushTitle)||!1,(null==_?void 0:_.forceShowDetailContent)||!1,a||"",(null==_?void 0:_.pushData)||"",(null===(s=null==_?void 0:_.androidConfig)||void 0===s?void 0:s.notificationId)||"",(null==_?void 0:_.pushTitle)||"",ys(null==_?void 0:_.iOSConfig,null==_?void 0:_.androidConfig,null==_?void 0:_.harmonyOSConfig),(null==_?void 0:_.templateId)||"",r,E||[],h,null!=u&&u).result()}))}getHistoryMessage(e,t,s){return y(this,void 0,void 0,(function*(){return s?Js(V(this,Qi,"m",un).call(this,e,t)):V(this,Qi,"m",Rn).call(this,e,t)}))}getContinuousMessages(e,t){return y(this,void 0,void 0,(function*(){const{timestamp:s,count:r,order:i}=t,{conversationType:n,targetId:o,channelId:a}=e,c=Hi.create(this.logger,"getContinuousMessages",this.logger.createTraceId());return(yield c.asyncInvoke(n,o,s,r,((e,t,s)=>c.ok({listJson:e,hasMore:s,nextTime:t})),(e=>c.fail(e)),0===i,a||"").result()).trans((({listJson:e,hasMore:t,nextTime:s})=>({list:JSON.parse(e).list.map((({obj:e})=>this._buildMessage(e))).reverse(),hasMore:!!t,timestamp:s})))}))}deleteRemoteMessage(e,t){const{conversationType:s,targetId:r,channelId:i}=e,n=JSON.stringify(t),o=this.logger.createTraceId(),a=Hi.create(this.logger,"deleteRemoteHistoryMessages",o);return a.asyncInvoke(s,r,n,!1,i||"",(()=>a.ok()),(e=>a.fail(e))).result()}deleteRemoteMessageByTimestamp(e,t){const s=this.logger.createTraceId(),r=Hi.create(this.logger,"clearRemoteHistoryMessages",s);return r.asyncInvoke(e.conversationType,e.targetId,t,(()=>r.ok()),(e=>r.fail(e)),e.channelId||"").result()}clearLocalMessages(e){return y(this,void 0,void 0,(function*(){return V(this,Qi,"m",hn).call(this,e),Js()}))}getConversationListByTimestamp(e,t){return y(this,void 0,void 0,(function*(){const{channelId:s,count:r,startTime:i,order:n,conversationTypes:o,topPriority:a,unreadCountFilter:c}=e,_=(o&&o.length>0?o:rt(t?Ze:Qe)).map((e=>({conversationType:e,channelId:e===Xe.ULTRA_GROUP?V(this,Qi,"m",gn).call(this,""):s,channelIdValid:e===Xe.ULTRA_GROUP||"string"==typeof s}))),l={sendTime:i,limit:r,sort:a?1:0,unreadFilter:c||ds},d=Hi.create(this.logger,"getConversationListByPageWithTopPriorityV2"),E=yield d.invoke(_,l,((e,t)=>d.flush(Bs.from(e,void 0,t)))).result();return E.isOk?V(this,Qi,"m",an).call(this,E.data,"getConversationListByPageWithTopPriorityV2"):E.wipe()}))}getTopConversationList(e,t,s){return y(this,void 0,void 0,(function*(){const r=(((null==t?void 0:t.length)||0)>0?t:rt(e?Ze:Qe)).map((e=>({conversationType:e,channelId:e===Xe.ULTRA_GROUP?V(this,Qi,"m",gn).call(this,""):s,channelIdValid:e===Xe.ULTRA_GROUP||"string"==typeof s}))),i=wi(this.logger,!1,"getTopConversationsV2",r);return V(this,Qi,"m",an).call(this,i,"getTopConversationsV2")}))}getUnreadConversationList(e,t){return y(this,void 0,void 0,(function*(){const s=(((null==t?void 0:t.length)||0)>0?t:rt(e?Ze:Qe)).map((e=>({conversationType:e,channelId:e===Xe.ULTRA_GROUP?V(this,Qi,"m",gn).call(this,""):"",channelIdValid:e===Xe.ULTRA_GROUP}))),r=wi(this.logger,!1,"getUnreadConversationListV2",s);return V(this,Qi,"m",an).call(this,r,"getUnreadConversationListV2")}))}getAllConversationList(e,t){return y(this,void 0,void 0,(function*(){const s=rt(e?Ze:Qe).map((e=>({conversationType:e,channelId:e===Xe.ULTRA_GROUP?V(this,Qi,"m",gn).call(this,""):t,channelIdValid:e===Xe.ULTRA_GROUP||"string"==typeof t}))),r=wi(this.logger,!1,"getConversationsV2",s);return V(this,Qi,"m",an).call(this,r,"getConversationsV2")}))}getUntaggedConversationListByPage(e,t,s){return y(this,void 0,void 0,(function*(){const r=wi(this.logger,!1,"getConversationsByPageWithoutTag",e,t,s);return V(this,Qi,"m",an).call(this,r,"getConversationsByPageWithoutTag")}))}getConversation(e){return y(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e,i=V(this,Qi,"m",Tn).call(this,e);if(i)return Js(i);const n=V(this,Qi,"m",un).call(this,e,{timestamp:0,count:1,order:0,messageType:""}),o=(null==n?void 0:n.list[0])||null,a=JSON.parse(wi(this.logger,!1,"getConversationStatus",JSON.stringify([{conversation_type:t,target_id:s,channel_id:r,channel_id_valid:"string"==typeof r&&r.length>0}])))[0],c=!!(null==a?void 0:a.is_top),_=(null==a?void 0:a.translate_strategy)||br,l=(yield this.getConversationNotificationLevel(e)).data,d={conversationType:t,targetId:s,channelId:r,latestMessage:o,lastUnreadTime:0,isTop:c,notificationLevel:l,notificationStatus:zt(l),translateStrategy:_,unreadMessageCount:V(this,Qi,"m",Nn).call(this,e)};return Js(d)}))}batchDeleteConversations(e){const{identifiers:t,deleteRemotely:s,deleteMessages:r}=e,i=Hi.create(this.logger,"batchDeleteConversations",this.logger.createTraceId());return i.invoke({conversationIdentifiers:t.map((e=>({type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""}))),deleteMessages:r,deleteRemotely:s},(()=>i.ok()),(e=>i.fail(e))).result()}clearConversations(e,t){return y(this,void 0,void 0,(function*(){const t=(e instanceof Array?e:rt(Ze)).map((e=>({conversationType:e,channelIdValid:!1}))),s=wi(this.logger,!0,"clearConversationsV2",t);return s===Ke.SUCCESS?Js():js(s)}))}getTotalUnreadCount(e,t,s){return y(this,void 0,void 0,(function*(){const r=e.map((e=>({conversationType:e,channelId:e===Xe.ULTRA_GROUP?V(this,Qi,"m",gn).call(this,""):s,channelIdValid:e===Xe.ULTRA_GROUP||"string"==typeof s})));let i=wi(this.logger,!0,"getTotalUnreadCount2",r,t);return Js(i)}))}getConversationUnreadCount(e){return y(this,void 0,void 0,(function*(){const t=V(this,Qi,"m",Nn).call(this,e);return Js(t)}))}clearConversationUnreadCount(e){return y(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e;if(t===Xe.ULTRA_GROUP){const e=this._getServerTime(),i=Hi.create(this.logger,"setReadTimestamp",this.logger.createTraceId());return i.asyncInvoke(t,s,e,(()=>i.ok()),(e=>i.fail(e)),r||"").result()}return V(this,Qi,"m",Cn).call(this,e),Js()}))}clearAllSGUnreadCount(){return y(this,void 0,void 0,(function*(){const e=yield this.getUnreadConversationList(!1);return e.isOk?(e.data.forEach((e=>{e.conversationType!==Xe.ULTRA_GROUP&&V(this,Qi,"m",Cn).call(this,e)})),Js()):e.wipe()}))}_clearUnreadCountByTimestamp(e,t){const{conversationType:s,targetId:r,channelId:i}=e;wi(this.logger,!1,"clearUnreadCountByTimestamp",s,r,t,i||"")}clearUnreadCountByTimestamp(e,t){return y(this,void 0,void 0,(function*(){return this._clearUnreadCountByTimestamp(e,t),Js()}))}getFirstUnreadMessage(e){return y(this,void 0,void 0,(function*(){const t=V(this,Qi,"m",On).call(this,e);return Js(t)}))}getFirstUnreadMessageDigest(e){return y(this,void 0,void 0,(function*(){const t=V(this,Qi,"m",On).call(this,e);return Js(t?{messageUId:t.messageUId,sentTime:t.sentTime}:null)}))}batchSetConversationToTop(e,t,s,r){return V(this,Qi,"m",pn).call(this,e,-1,t?1:0,-1,s,r)}batchSetConversationNotificationLevel(e,t){const s=this.logger.createTraceId(),r=Hi.create(this.logger,"setBlockPushLevelInBatches",s),i=e.map((e=>({conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId,level:t})));return r.asyncInvoke(JSON.stringify(i),(()=>r.ok()),(e=>r.fail(e))).result()}batchSetConversationTranslateStrategy(e,t){return V(this,Qi,"m",pn).call(this,e,-1,-1,t,!1,!1)}setConversationTypeNotificationLevel(e,t){const s=Hi.create(this.logger,"setBlockPushLevelForType",this.logger.createTraceId());return s.asyncInvoke(e,t,(()=>s.ok()),(e=>s.fail(e))).result()}getConversationTypeNotificationLevel(e){return y(this,void 0,void 0,(function*(){const t=wi(this.logger,!0,"getBlockPushLevelForType",e);return Js(t)}))}searchConversationByContent(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=this.logger.createTraceId(),n=Hi.create(this.logger,"searchConversationByContentV2",i),o=r.map((e=>({conversationType:e,channelId:s,channelIdValid:!0}))),a=yield n.asyncInvoke(o,e,t,((e,t,s)=>{e===Ke.SUCCESS?n.ok({result:t,matchedNumber:s}):n.fail(e)})).result();return a.isOk?a.trans((e=>JSON.parse(e.result).map((e=>V(this,Qi,"m",on).call(this,e))))):Js([])}))}searchConversationByContentWithAllChannel(e,t,s){return y(this,void 0,void 0,(function*(){s=s||rt(Qe);const r=this.logger.createTraceId(),i=Hi.create(this.logger,"searchConversationByContentV2",r),n=s.map((e=>({conversationType:e,channelIdValid:!1}))),o=yield i.asyncInvoke(n,e,t,((e,t,s)=>{e===Ke.SUCCESS?i.ok({result:t,matchedNumber:s}):i.fail(e)})).result();return o.isOk?o.trans((e=>JSON.parse(e.result).map((e=>V(this,Qi,"m",on).call(this,e))))):Js([])}))}searchMessagesWithParams(e){var t,s,r,i,n;return y(this,void 0,void 0,(function*(){const o=this.logger.createTraceId(),a=function(e){if(!e)return[];let t=[];const s=e=>{if(0===t.length)return void t.push(...e);const s=[];e.forEach((e=>{s.push(...t.map((t=>Object.assign(Object.assign({},t),e))))})),t=s},{conversationTypes:r=[],targetIds:i=[],channelIds:n=[]}=e,o=Ks(r).map((e=>({conversationType:e}))),a=Ks(i).map((e=>({targetId:e}))),c=Ks(n).length?n.map((e=>({channelId:e}))):[{channelIdValid:!1}];return s(o),s(a),s(c),t}(e.conversationFilter),c={keyword:e.keyword,limit:e.limit,desc:!e.order,offset:null!==(t=e.offset)&&void 0!==t?t:0,needMatchCount:!0,startTime:null===(s=e.timeRange)||void 0===s?void 0:s.startTime,endTime:null===(r=e.timeRange)||void 0===r?void 0:r.endTime,objectNames:Ks((null===(i=e.messageFilter)||void 0===i?void 0:i.objectNames)||[]),senderIds:Ks((null===(n=e.messageFilter)||void 0===n?void 0:n.senderIds)||[])},_=Hi.create(this.logger,"searchMessage",o);return(yield _.invoke(a,c,((e,t,s,r)=>{e===Ke.SUCCESS?_.ok({result:t,totalMatched:s,conditionsMatched:r}):_.fail(e)})).result()).trans((({result:e,totalMatched:t,conditionsMatched:s})=>({messages:JSON.parse(e).list.map((e=>JSON.parse(e.obj))).map((e=>V(this,Qi,"m",nn).call(this,e))),totalMatched:t,conditionsMatched:s})))}))}getUnreadMentionedMessages(e){return y(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e,i=wi(this.logger,!1,"getUnreadMentionedMessages",t,s,r||""),n=JSON.parse(i).list.map((({obj:e})=>V(this,Qi,"m",nn).call(this,JSON.parse(e))));return Js(n)}))}getUnreadMentionedCount(e){var t;return y(this,void 0,void 0,(function*(){const s=V(this,Qi,"m",Tn).call(this,e);return Js(null!==(t=null==s?void 0:s.unreadMentionedCount)&&void 0!==t?t:0)}))}addToBlacklist(e){const t=Hi.create(this.logger,"addToBlacklist",this.logger.createTraceId());return t.asyncInvoke(e,(()=>t.ok()),(e=>t.fail(e))).result()}removeFromBlacklist(e){const t=Hi.create(this.logger,"removeFromBlacklist",this.logger.createTraceId());return t.asyncInvoke(e,(()=>t.ok()),(e=>t.fail(e))).result()}getBlacklist(){const e=Hi.create(this.logger,"getBlacklist",this.logger.createTraceId());return e.asyncInvoke((t=>e.ok(t)),(t=>e.fail(t))).result()}getBlacklistStatus(e){const t=Hi.create(this.logger,"getBlacklistStatus",this.logger.createTraceId());return t.asyncInvoke(e,(e=>t.ok(e)),(e=>t.fail(e))).result()}insertMessage(e,t){return y(this,void 0,void 0,(function*(){const s=V(this,Qi,"m",Sn).call(this,e,t);return-1===s.messageId?js(Ke.MSG_INSERT_ERROR,"insert message failed",s):Js(s)}))}batchInsertMessage(e,t=!1){return y(this,void 0,void 0,(function*(){const s=e.map((e=>{const{content:t,senderUserId:s,messageType:r,messageDirection:i,receivedStatus:n=0,sentStatus:o,sentTime:a,searchContent:c,isUnread:_,messageUId:l,disableNotification:d,canIncludeExpansion:E,expansion:u,channelId:R,conversationType:h,targetId:I,source:g,isMentioned:T,receivedStatusInfo:N,directedUserIds:C,disableUpdateLastMessage:O}=e,p=N?(e=>{let t=es.UNREAD;return(null==e?void 0:e.isRead)&&(t|=es.READ),(null==e?void 0:e.isListened)&&(t|=es.LISTENED),(null==e?void 0:e.isDownload)&&(t|=es.DOWNLOADED),(null==e?void 0:e.isRetrieved)&&(t|=es.RETRIEVED),t})(N):n,S=a||0,A={};if(u)for(const e in u)A[e]={v:u[e],ts:S};const f=e.quoteInfo?{messageUId:e.quoteInfo.messageUId,senderId:e.quoteInfo.senderId,objectName:e.quoteInfo.objectName,quoteMessageStatus:e.quoteInfo.quoteMessageStatus||ls}:void 0;return{conversationType:h,targetId:I,channelId:R||"",direction:i,senderUserId:s,status:o||10,sentTime:S,objectName:r,content:JSON.stringify(t),messageUid:l||"",noNotification:!!d,supportExt:!!E,extMsg:JSON.stringify(A),readStatus:p,searchContent:c||"",isUnread:!!_,source:g||"",isMention:T,directedUsers:C,disableUpdateLastMessage:!!O,quoteInfo:f}}));return wi(this.logger,!0,"insertMessages",JSON.stringify(s),t)?Js(!0):js(Ke.MSG_INSERT_ERROR)}))}getLocalMessageCount(e){return y(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e,i=wi(this.logger,!0,"getMessageCount",t,s,r||"");return Js(i)}))}deleteLocalMessages(e){return y(this,void 0,void 0,(function*(){return V(this,Qi,"m",An).call(this,e),Js()}))}deleteLocalMessagesByTimestamp(e,t,s){return y(this,void 0,void 0,(function*(){return V(this,Qi,"m",fn).call(this,e,t,s),Js()}))}batchClearLocalMessagesByTimestamp(e){return y(this,void 0,void 0,(function*(){const t=e.map((e=>({conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId||"",send_time:e.timestamp})));return wi(this.logger,!1,"deleteMessageBySendTimeInBatches",JSON.stringify(t)),Js()}))}batchClearRemoteHistoryMessages(e,t){const s=e.map((e=>({conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId||"",send_time:e.timestamp}))),r=Hi.create(this.logger,"deleteRemoteMessageBySendTimeInBatches",this.logger.createTraceId());return r.asyncInvoke(JSON.stringify(s),!!t,(()=>r.ok()),(e=>r.fail(e))).result()}getMessage(e){return y(this,void 0,void 0,(function*(){return V(this,Qi,"m",vn).call(this,e)}))}setMessageContent(e,t,s){return y(this,void 0,void 0,(function*(){return V(this,Qi,"m",Pn).call(this,e,t,s),Js()}))}setMessageSearchField(e,t,s){return y(this,void 0,void 0,(function*(){return wi(this.logger,!1,"setMessageSearchField",e,t,s),Js()}))}setMessageSentStatus(e,t){return y(this,void 0,void 0,(function*(){return wi(this.logger,!1,"setMessageSentStatus",e,t),Js()}))}setMessageReceivedStatus(e,t){return y(this,void 0,void 0,(function*(){return V(this,Qi,"m",Ln).call(this,e,t),Js()}))}saveTextMessageDraft(e,t){return y(this,void 0,void 0,(function*(){const{conversationType:s,targetId:r,channelId:i}=e;return wi(this.logger,!1,"saveTextMessageDraft",s,r,t,i||"")?Js():js(Ke.DRAFT_SAVE_ERROR)}))}getTextMessageDraft(e){return y(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e,i=wi(this.logger,!0,"getTextMessageDraft",t,s,r||"");return Js(i)}))}clearTextMessageDraft(e){return y(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e;return wi(this.logger,!1,"clearTextMessageDraft",t,s,r||"")?Js():js(Ke.DRAFT_REMOVE_ERROR)}))}getConversationNotificationLevel(e){return y(this,void 0,void 0,(function*(){const{conversationType:t,targetId:s,channelId:r}=e,i=wi(this.logger,!0,"getBlockPushLevelForConversation",s,r||"",t);return Js(i)}))}getTotalUnreadCountByLevels(e,t,s){return y(this,void 0,void 0,(function*(){const r=e.map((e=>({conversationType:e,channelIdValid:!1}))),i=wi(this.logger,!0,"getUnreadAndMentionCountByLevel",r,t);return 0!==i.code?js(i.code):Js(s?i.mention:i.unread)}))}sendReadReceiptV2(e,t,s){return y(this,void 0,void 0,(function*(){const r=Hi.create(this.logger,"sendReadReceipt",this.logger.createTraceId()),i=yield r.asyncInvoke(e,s||"",t,(()=>r.ok()),(e=>r.fail(e))).result();return i.isOk&&t.forEach((e=>{this._updateReadReceiptInfo(e,{hasRespond:!0});const t=V(this,Qi,"m",mn).call(this,e);t.isOk&&V(this,Qi,"m",Ln).call(this,t.data.messageId,1)})),i}))}getMessageReader(e,t,s){const r=Hi.create(this.logger,"getMessageReader",this.logger.createTraceId());return r.asyncInvoke(e,s,t,((e,s)=>{const i=[],n={};JSON.parse(e).list.forEach((e=>{const{id:t,time:s}=JSON.parse(e.obj);i.push({userId:t,readTime:s}),n[t]=s}));const o={readerInfo:n,readCount:i.length,totalCount:s};this._updateReadReceiptInfo(t,o),r.ok({list:i,totalMemberCount:s})}),(e=>r.fail(e))).result()}sendReadReceiptMessageV4(e,t,s){const r=Hi.create(this.logger,"sendMessageReadReceipt",this.logger.createTraceId()),{conversationType:i,targetId:n,channelId:o}=e;return r.asyncInvoke(i,n,o||"",t,s,(()=>r.ok()),(e=>r.fail(e))).result()}getMessageReadReceiptV4(e,t){const{targetId:s,channelId:r}=e,i=Hi.create(this.logger,"getMessageReadReceipt",this.logger.createTraceId());return i.asyncInvoke(s,r||"",t,((e,s,r)=>y(this,void 0,void 0,(function*(){const n=[],o=this._callCppProxy("getMessage",t),a=JSON.parse(o);try{JSON.parse(r).list.forEach((e=>{const{id:t,time:s}=JSON.parse(e.obj);n.push({userId:t,readTime:s})}))}catch(e){this.logger.error(kr.P_PARSE_JSON_E,`method: getMessageReadReceipt, info: ${r}, error: ${e}`)}let{readerList:c=[],readCount:_=0}=JSON.parse(a.readReceiptRequest||"{}"),l=!1;c.length<n.length&&(c=n,l=!0),_<s&&(_=s,l=!0),l&&this._callCppProxy("updateReadReceiptRequestInfo",t,JSON.stringify({readerList:c,readCount:_,totalCount:e})),i.ok({list:n,totalCount:e,readCount:_})}))),(e=>i.fail(e))).result()}updateConversationReadTime(e,t){const s=Hi.create(this.logger,"updateConversationReadTime",this.logger.createTraceId()),{conversationType:r,targetId:i,channelId:n}=e;return s.asyncInvoke(r,i,n||"",t,(()=>s.ok()),(e=>s.fail(e))).result()}_try2RejoinChatroom(){if(0===this._chatroomCache.size)return;const e=this.logger.createTraceId();this._chatroomCache.forEach((t=>y(this,void 0,void 0,(function*(){const{chatroomId:s,count:r,extra:i}=t;this.logger.info(K,s,e);const n=yield this._joinChrm(s,r,!1,!0,i);this.logger.summary(X,n,e);const{code:o,isOk:a,data:c}=n;a?this._sendChatroomEvents({rejoinedRoom:Object.assign({chatroomId:s,count:r},c)}):(o!==Ke.RC_CHATROOM_USER_KICKED&&o!==Ke.RC_CHATROOM_NOT_EXIST||this._chatroomCache.delete(s),this._sendChatroomEvents({rejoinedRoom:{chatroomId:s,errorCode:o}}))}))))}_joinChrm(e,t,s,r,i){const n=s?"joinChatRoom":"joinExistChatRoom";r||V(this,Qi,"m",In).call(this,e,!0,!0);const o=Hi.create(this.logger,n,this.logger.createTraceId());return o.asyncInvoke(e,t,((s,n,a,c,_,l,d)=>{this._chatroomCache.set(e,{chatroomId:e,count:t,extra:i||"",isKVSynced:r}),o.ok({createTime:Number(s),memberCount:n,isAllChatroomBanned:a,isCurrentUserBanned:c,isCurrentChatroomBanned:_,isCurrentChatroomInWhitelist:l,joinTime:d})}),(e=>o.fail(e)),i||"").result()}joinChatroom(e,t,s,r){return y(this,void 0,void 0,(function*(){return this._joinChrm(e,t,s,!1,r)}))}quitChatroom(e,t){this._chatroomCache.delete(e);const s=Hi.create(this.logger,"quitChatRoom",this.logger.createTraceId());return s.asyncInvoke(e,(()=>s.ok()),(e=>s.fail(e)),t||"").result()}getChatroomInfo(e,t,s){const r=Hi.create(this.logger,"getChatroomInfo",this.logger.createTraceId());return r.asyncInvoke(e,t,s,((e,t)=>{const s=(e?JSON.parse(e).list:[]).map((e=>JSON.parse(e.obj)));r.ok({userInfos:s,userCount:t})}),(e=>r.fail(e))).result()}getChatroomHistoryMessages(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=this.logger.createTraceId(),n=Hi.create(this.logger,"getChatroomHistoryMessage",i);return n.asyncInvoke(e,t,s,r,(e=>{let t;try{t=JSON.parse(e)}catch(e){t={list:[],hasMore:!1}}const{list:s}=t;if(s&&s.length)try{t.list=s.map((e=>this._buildMessage(e.obj)))}catch(e){t.list=[]}n.ok(t)}),(e=>n.fail(e)),"").result()}))}setChatroomEntry(e,t,s){const r=Hi.create(this.logger,"setChatroomStatus",this.logger.createTraceId());return r.asyncInvoke(e,t.key,t.value,!!t.isAutoDelete,s,!!t.isSendNotification,t.notificationExtra||"",(()=>r.ok()),(e=>r.fail(e))).result()}setChatroomEntries(e,t){const s=Hi.create(this.logger,"setChatroomKV");return s.asyncInvoke(e,JSON.stringify(t.entries),!!t.isAutoDelete,!!t.isForce,(()=>s.ok()),(e=>s.fail(e))).result()}removeChatroomEntry(e,t,s){const r=Hi.create(this.logger,"deleteChatroomStatus",this.logger.createTraceId());return r.asyncInvoke(e,t.key,s,!!t.isSendNotification,t.notificationExtra||"",(()=>r.ok()),(e=>r.fail(e))).result()}removeChatroomEntries(e,t){const s=Hi.create(this.logger,"deleteChatroomKV",this.logger.createTraceId());return s.asyncInvoke(e,t.keys,!1,(()=>s.ok()),(e=>s.fail(e))).result()}getChatroomEntry(e,t){return y(this,void 0,void 0,(function*(){return(yield this.getAllChatroomEntries(e)).tryTrans((e=>{const s=e[t];return"string"!=typeof s?js(Ke.CHATROOM_KEY_NOT_EXIST):Js(s)}))}))}getAllChatroomEntries(e){const t=Hi.create(this.logger,"getChatroomKV",this.logger.createTraceId());return t.asyncInvoke(e,(e=>{const s={};try{(e?JSON.parse(e):{list:[]}).list.forEach((({obj:e})=>{const t=JSON.parse(e);s[t.key]=t.value?t.value:""}))}catch(e){}t.ok(s)}),(e=>t.fail(e))).result()}getFileToken(e,t,s,r,i,n){let o;s=s||"",i=i||"",o=(r=r||"")&&"uploads"!==r?t||"":bs(e,t);const a=this.getNaviInfoFromCache(),c={uploadDomain:ks(a,this.logger),env:this._environment};n=n?Math.ceil(n):0;const _=Hi.create(this.logger,"getUploadToken");return _.asyncInvoke(e,o,s,r,i,JSON.stringify(c),n,a.ipType||0,((e,t,s,r,i,n,a,c,l,d,E,u,R,h,I,g,T,N,C,O,p,S,A,f)=>{_.ok({token:e,deadline:0,bosToken:t,bosDate:s,path:r,osskeyId:i,ossPolicy:n,ossSign:a,ossBucketName:c,fileName:o,s3Credential:l,s3Algorithm:d,s3Date:E,s3Policy:u,s3Signature:R,s3BucketName:h,stcAuthorization:I,stcContentSha256:g,stcDate:T,stcBucketName:N,minioAuthorization:C,minioContentSha256:O,minioDate:p,minioBucketName:S,downloadAuthInfo:A?JSON.parse(A):null})}),(e=>_.fail(e))).result()}getFileUrl(e,t,s,r){const i=this.getNaviInfoFromCache(),n=ks(i,this.logger),o=this.logger.createTraceId(),a=Hi.create(this.logger,"getDownloadUrl",o);return a.asyncInvoke(e,s,r,t-1,JSON.stringify({url:n}),-1,i.ipType||0,(e=>a.ok({downloadUrl:e})),(e=>a.fail(e))).result()}clearLocalData(){return y(this,void 0,void 0,(function*(){const e=wi(this.logger,!0,"clearData");return Js(e)}))}getDeviceId(){return this._deviceId}getVoIPKey(e,t){return new Promise((s=>{this._callCppProxy("getVoIPKey",e,t,"",(e=>{setTimeout((()=>{s({code:Ke.SUCCESS,data:e})}),0)}),(e=>{setTimeout((()=>{s({code:e})}),0)}))}))}bindRTCRoomForChatroom(e){const t=Hi.create(this.logger,"bindRTCRoomForChatroom",this.logger.createTraceId());return t.asyncInvoke(e.chatRoomId,e.rtcRoomId,(()=>t.ok()),(e=>t.fail(e))).result()}rtcSignaling(e,t,s,r){const i=Hi.create(this.logger,"rtcSignaling");return i.asyncInvoke(e,t,s,r,(e=>{const t=Array.prototype.slice.call(e);i.ok(t)}),(e=>i.fail(e)),30).result()}_setRTCHeartbeatListener(){xr.setRTCHeartbeatListener(this._catcher.gen("setRTCHeartbeatListener[0]",((e,t)=>{const s=this.rtcHeartbeatResolves[e];if(!s)return;const r=s.find((e=>""===e.seqId));r&&(r.seqId=t)})),this._catcher.gen("setRTCHeartbeatListener[1]",((e,t,s,r)=>{const i=this.rtcHeartbeatResolves[e];if(!i)return;const n=i.findIndex((e=>e.seqId===s));-1!==n&&i.splice(n,1)[0].resolve({code:t,data:{version:Number(r)}})})))}rtcPing(e,t,s){const{promise:r,resolve:i}=Ys(),n={resolve:i,seqId:""},o=this.rtcHeartbeatResolves[e];return o?o.push(n):this.rtcHeartbeatResolves[e]=[n],wi(this.logger,!1,"sendRTCHeartbeat",[e],30),r}createTag(e){const t=Hi.create(this.logger,"addTag");return t.asyncInvoke(e.tagId,e.tagName,(()=>t.ok()),(e=>t.fail(e))).result()}removeTag(e){const t=Hi.create(this.logger,"deleteTag");return t.asyncInvoke(e,(()=>t.ok()),(e=>t.fail(e))).result()}updateTag(e){const t=Hi.create(this.logger,"renameTag");return t.asyncInvoke(e.tagId,e.tagName,(()=>t.ok()),(e=>t.fail(e))).result()}getTagList(){return y(this,void 0,void 0,(function*(){const e=wi(this.logger,!1,"getTags"),t=this._convertResultList(e,(e=>({tagId:e.tagId,tagName:e.tagName,conversationCount:e.conversationCount,createdTime:e.tagTime})));return Js(t)}))}addTagForConversations(e,t){const s=Hi.create(this.logger,"addConversationsForTag"),r=t.map((({conversationType:e,targetId:t,channelId:s})=>({type:e,targetId:t,channelId:s})));return s.asyncInvoke(e,JSON.stringify(r),(()=>s.ok()),(e=>s.fail(e))).result()}removeTagForConversations(e,t){const s=Hi.create(this.logger,"removeConversationsForTag"),r=t.map((({conversationType:e,targetId:t,channelId:s})=>({type:e,targetId:t,channelId:s})));return s.asyncInvoke(e,JSON.stringify(r),(()=>s.ok()),(e=>s.fail(e))).result()}removeTagsForConversation(e,t){const s=Hi.create(this.logger,"removeTagsForConversation");return s.asyncInvoke(e.conversationType,e.targetId,e.channelId||"",t,(()=>s.ok()),(e=>s.fail(e))).result()}getConversationListByTag(e,t,s){return y(this,void 0,void 0,(function*(){const r=wi(this.logger,!1,"getConversationsForTagByPage",e,t,s,""),i=this._convertResultList(r,(e=>Object.assign(Object.assign({},this._buildConversation(JSON.stringify(e))),{isTopInTag:e.topForTag})));return Js(i)}))}getUnreadCountByTag(e,t){return y(this,void 0,void 0,(function*(){const s=wi(this.logger,!0,"getConversationUnreadCountForTag",e,t);return Js(s)}))}setConversationStatusInTag(e,t,s){const r=Hi.create(this.logger,"setConversationToTopForTag");return r.asyncInvoke(e,t.conversationType,t.targetId,t.channelId||"",!!s.isTop,(()=>r.ok()),(e=>r.fail(e))).result()}getTagsForConversation(e){return y(this,void 0,void 0,(function*(){const t=wi(this.logger,!1,"getTagsForConversation",e.conversationType,e.targetId,e.channelId||""),s=this._convertResultList(t,(e=>({tagId:e.tagId,tagName:e.tagName,isTop:e.isTop,createdTime:e.tagTime})));return Js(s)}))}getAllUnreadMentionedCount(){return y(this,void 0,void 0,(function*(){const e=[Xe.GROUP].map((e=>({conversationType:e,channelIdValid:!1}))),t=wi(this.logger,!0,"getUnreadAndMentionCountV2",e);return 0!==t.code?js(t.code):Js(t.mention)}))}getOSInfo(){return y(this,void 0,void 0,(function*(){const e={arch:n(),platform:i(),type:_(),version:l(),release:c(),uptime:d(),cpus:a(),freemem:E(),totalmem:u(),networkInterfaces:o()};return Js(e)}))}getMainProcessInfo(){return y(this,void 0,void 0,(function*(){return Js({title:process.title,pid:process.pid,ppid:process.ppid,platform:process.platform,arch:process.arch,uptime:process.uptime(),cpuUsage:process.cpuUsage(),memoryUsage:process.memoryUsage(),resourceUsage:process.resourceUsage()})}))}setCallInfo(e,t,s){const r=Hi.create(this.logger,"callInfoSignaling");return r.asyncInvoke(e,t,s,((e,t)=>r.ok({key:e,value:t})),(e=>r.fail(e))).result()}setProxy(e){return y(this,void 0,void 0,(function*(){return this.tcpMgr.getConnectionStatus()!==xt.DISCONNECTED?js(Ke.RC_CONN_PROXY_UNAVAILABLE):_i(e,this.logger)}))}getProxy(){return Promise.resolve(li())}testProxy(e,t){return function(e,t,s){return y(this,void 0,void 0,(function*(){const{resolve:r,promise:i}=Ys(),n=/^https/.test(t)?oi:ri,o=s.createTraceId();s.info(ie,JSON.stringify({proxy:e,testHost:t}),o);const a=n(t,e,(e=>{const t=200===e.statusCode;e.setEncoding("utf8");let s="";e.on("data",(e=>{s+=e})),e.once("end",(()=>{const i=t?Js(s):js(Ke.RC_HTTP_REQ_FAIL,`fail: ${e.statusCode}`,s);r(i)}))}));a.once("timeout",(()=>r(js(Ke.TIMEOUT)))),a.once("error",(e=>r(js(Ke.RC_HTTP_REQ_FAIL,e.stack)))),a.end();const c=yield i;return s.summary(ne,c,o),c.wipe()}))}(e,t,this.logger)}setCheckDuplicateMessage(e){return y(this,void 0,void 0,(function*(){const t=wi(this.logger,!0,"checkDuplicateMessage",e);return Js(t)}))}subscribeUser(e,t,s){const r=Hi.create(this.logger,"updateSubscribeStatus");return r.asyncInvoke(t,jt.SUBSCRIBE,e,(()=>r.ok()),((e,t)=>r.fail(e,t)),s).result()}unSubscribeUser(e,t){const s=Hi.create(this.logger,"updateSubscribeStatus");return s.asyncInvoke(t,jt.UNSUBSCRIBE,e,(()=>s.ok()),((e,t)=>s.fail(e,t)),0).result()}getSubscribeUserList(e,t,s){return y(this,void 0,void 0,(function*(){const r=wi(this.logger,!1,"getSubscribeUserList",e,t,s),i=this._buildSubscribeEventData(r).map((e=>{const{userId:t,subscribeType:s,subscribeTime:r,expiry:i,details:n}=e,o={userId:t,subscribeType:s,subscribeTime:r,expiry:i};return s===Jt.ONLINE_STATUS&&(o.details=Ps(n)),o}));return Js(i)}))}setCheckChatRoomDuplicateMessage(e){return y(this,void 0,void 0,(function*(){const t=wi(this.logger,!1,"setDuplicateMessageConfig",[Xe.CHATROOM],Gn.cuid,e);return t===Ke.SUCCESS?Js():js(t)}))}getSubscribeUserStatus(e,t){return y(this,void 0,void 0,(function*(){return(yield V(this,Qi,"m",yn).call(this,[e],t)).trans((e=>{const t=this._buildSubscribeEventData(e).map((e=>{const{userId:t,subscribeType:s,subscribeTime:r,expiry:i,details:n}=e,o={userId:t,subscribeType:s,subscribeTime:r,expiry:i};return s===Jt.ONLINE_STATUS&&(o.details=Ps(n)),o}));return t}))}))}updateMyUserProfile(e){const t=[],s=[];Object.keys(e).forEach((r=>{var i;if("extraProfile"===r&&e.extraProfile){if(e.extraProfile){const{extraProfile:t}=e;Object.keys(t).forEach((e=>{s.push(JSON.stringify({key:e,value:t[e]||""}))}))}}else t.push(JSON.stringify({key:r,value:(null===(i=e[r])||void 0===i?void 0:i.toString())||""}))}));const r=Hi.create(this.logger,"updateUserProfile");return r.invoke(t,s,((e,t)=>{if(e===Ke.SUCCESS)r.ok();else{const s=Jr(t);r.fail(e,{errorKey:s[0],errorKeys:s})}})).result()}getUserProfiles(e){const t=Hi.create(this.logger,"getUserProfiles");return t.invoke(e,((e,s)=>{e===Ke.SUCCESS?t.ok(this._string2UserProfileInfoList(s)):t.fail(e)})).result()}getMyUserProfile(){const e=Hi.create(this.logger,"getOwnUserProfile");return e.asyncInvoke(((t,s)=>{e.flush(Bs.from(t).trans((()=>this._string2userProfileInfo(s))))})).result()}_string2userProfileInfo(e){var t;try{const s=JSON.parse(e),r=s.userProfile.reduce(((e,t)=>{const s=JSON.parse(t);return["gender","role","level"].includes(s.key)?e[s.key]=Number(s.value):e[s.key]=s.value,e}),{});return r.userId=s.userId,r.extraProfile=(null===(t=s.userExtProfile)||void 0===t?void 0:t.reduce(((e,t)=>{const s=JSON.parse(t);return e[s.key]=s.value,e}),{}))||{},r}catch(t){this.logger.error(kr.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return{}}_string2UserProfileInfoList(e){try{return JSON.parse(e).list.map((e=>this._string2userProfileInfo(e.obj)))}catch(t){this.logger.error(kr.P_PARSE_JSON_USER_PROFILE_E,JSON.stringify({error:null==t?void 0:t.stack,str:e}))}return[]}updateMyUserProfileVisibility(e){const t=Hi.create(this.logger,"updateUserProfilePermission");return t.invoke(e,(()=>t.ok()),(e=>t.fail(e))).result()}getMyUserProfileVisibility(){const e=Hi.create(this.logger,"getUserProfilePermission");return e.asyncInvoke(((t,s)=>{e.flush(Bs.from(t).trans((()=>s)))})).result()}searchUserProfileByUniqueId(e){const t=Hi.create(this.logger,"getUserProfileByUniqueId");return t.asyncInvoke(e,((e,s)=>{t.flush(Bs.from(e).trans((()=>this._string2userProfileInfo(s))))})).result()}getMessagesAroundTimestamp(e,t,s,r){return y(this,void 0,void 0,(function*(){const{conversationType:i,targetId:n,channelId:o}=e,a=wi(this.logger,!1,"getMatchedMessage",i,n,t,s,r,o||""),c=JSON.parse(a).list.map((({obj:e})=>this._buildMessage(e)));return Js(c)}))}getConversations(e){return y(this,void 0,void 0,(function*(){const t=V(this,Qi,"m",Mn).call(this,e);return Js(t)}))}handleErrorCode(e,t){e!==Ke.SUCCESS&&setTimeout((()=>t(js(e))),0)}_convertGroupInfoList(e,t=!1){return e&&0!==e.length?e.map((e=>{const{groupId:t,baseInfo:s,createTime:r,createUserId:i,extraInfo:n,memberCount:o,ownerId:a,remark:c,joinTime:_,role:l}=e,d=Ds(s),E=Ds(n);return{groupId:t,groupName:d.name||"",portraitUri:d.portraitUrl||"",introduction:d.introduction||"",notice:d.announcement||"",joinPermission:~~d.joinPerm,removeMemberPermission:~~d.removePerm,invitePermission:~~d.memInvitePerm,inviteHandlePermission:~~d.invitePerm,groupInfoEditPermission:~~d.profilePerm,memberInfoEditPermission:~~d.memProfilePerm,extProfile:E,creatorId:i||"",ownerId:a||"",createTime:r||0,membersCount:o||0,remark:c||"",joinedTime:_||0,role:l||Ue.UNDEF}})):[]}_convertUpdateGroupInfoList(e){return e&&0!==e.length?e.map((e=>{const{groupId:t,baseInfo:s,createTime:r,createUserId:i,extraInfo:n,memberCount:o,ownerId:a,remark:c,joinTime:_,role:l}=e,d=Ds(s),E=Ds(n);return JSON.parse(JSON.stringify(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({groupId:t},(e=>JSON.parse(JSON.stringify({groupName:e.name,portraitUri:e.portraitUrl,introduction:e.introduction,notice:e.announcement,joinPermission:Us(e.joinPerm),removeMemberPermission:Us(e.removePerm),invitePermission:Us(e.memInvitePerm),inviteHandlePermission:Us(e.invitePerm),groupInfoEditPermission:Us(e.profilePerm),memberInfoEditPermission:Us(e.memProfilePerm)})))(d)),n.length>0&&{extProfile:E}),i&&{creatorId:i}),a&&{ownerId:a}),r&&{createTime:r}),o&&{membersCount:o}),c&&{remark:c}),_&&{joinedTime:_}),l&&{role:l})))})):[]}_convertGroupMemberInfoList(e){return e&&0!==e.length?e.map((e=>{const{userId:t,nickname:s,groupNickname:r,portraitUrl:i,joinTime:n,role:o,extra:a,isRobot:c}=e;return{userId:t,name:s||"",portraitUri:i||"",nickname:r||"",role:o||0,joinedTime:n||0,extra:a||"",isRobot:!!c}})):[]}createGroup(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=wr(t),n=wr(s||{}),o=Hi.create(this.logger,"createGroup");return o.invoke(e,r||[],JSON.stringify(i),JSON.stringify(n),((e,t,s,r)=>{e===Ke.SUCCESS?o.ok():o.fail(e,{errorKeys:Jr(r),processCode:t})})).result()}))}updateGroupInfo(e,t,s){return y(this,void 0,void 0,(function*(){const r=wr(t),i=wr(s||{}),n=Hi.create(this.logger,"updateGroupInfo");return n.invoke(e,JSON.stringify(r),JSON.stringify(i),((e,t,s,r)=>{e===Ke.SUCCESS?n.ok():n.fail(e,{errorKeys:Jr(r)})})).result()}))}getGroupsInfo(e){return y(this,void 0,void 0,(function*(){const t=Hi.create(this.logger,"getGroupInfoByIds");return t.invoke(e,((e,s,r,i)=>{const n=Bs.from(e).trans((()=>{const e=JSON.parse(i);return this._convertGroupInfoList(e)}));t.flush(n)})).result()}))}kickGroupMembers(e,t,s){return y(this,void 0,void 0,(function*(){const r=Hi.create(this.logger,"kickOutGroupMember");return r.invoke(e,t,JSON.stringify(Hr(s)),((e,t)=>r.flush(Bs.from(e)))).result()}))}quitGroup(e,t){return y(this,void 0,void 0,(function*(){const s=Hi.create(this.logger,"quitGroup");return s.invoke(e,JSON.stringify(Hr(t)),((e,t)=>s.flush(Bs.from(e)))).result()}))}dismissGroup(e){return y(this,void 0,void 0,(function*(){const t=Hi.create(this.logger,"disbandGroup");return t.invoke(e,((e,s)=>t.flush(Bs.from(e)))).result()}))}transferGroupOwner(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=Hi.create(this.logger,"transferGroup");return i.invoke(e,t,s,JSON.stringify(Hr(r)),((e,t)=>i.flush(Bs.from(e)))).result()}))}setGroupManagers(e,t,s){return y(this,void 0,void 0,(function*(){const r=Hi.create(this.logger,"updateGroupAdmins");return r.invoke(t,s,e,((e,t)=>r.flush(Bs.from(e)))).result()}))}getGroupMembersByRole(e,t,s){return y(this,void 0,void 0,(function*(){const r=Hi.create(this.logger,"getGroupMembers");return r.invoke(e,t===Ue.UNDEF?[1,2,3]:[t],s.pageToken,s.count,s.order?1:0,s.filterRobotType,((e,t,s,i)=>{if(e!==Ke.SUCCESS)return void r.fail(e);const n=this._convertGroupMemberInfoList(JSON.parse(i));r.ok({totalCount:s||0,data:n,pageToken:t||""})})).result()}))}getGroupMembers(e,t){return y(this,void 0,void 0,(function*(){const s=Hi.create(this.logger,"getGroupMembersByIds");return s.invoke(e,t,((e,t,r,i)=>{const n=Bs.from(e).trans((()=>{const e=JSON.parse(i);return this._convertGroupMemberInfoList(e)}));s.flush(n)})).result()}))}setGroupMemberInfo(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=Hi.create(this.logger,"updateGroupMemberInfo");return i.invoke(e,t,s,r||"",((e,t,s,r)=>{e===Ke.SUCCESS?i.ok():i.fail(e,{errorKeys:Jr(r)})})).result()}))}searchGroupMembers(e,t,s){return y(this,void 0,void 0,(function*(){const r=Hi.create(this.logger,"getGroupMembersByNickname");return r.invoke(e,t,s.pageToken,s.count,s.order?1:0,((e,t,s,i)=>{if(e!==Ke.SUCCESS)return void r.fail(e);const n=this._convertGroupMemberInfoList(JSON.parse(i));r.ok({totalCount:s||0,data:n,pageToken:t||""})})).result()}))}joinGroup(e){return y(this,void 0,void 0,(function*(){const t=Hi.create(this.logger,"joinGroup");return t.invoke(e,((e,s,r)=>{e===Ke.SUCCESS?t.ok({processCode:s}):t.fail(e)})).result()}))}inviteUsersToGroup(e,t){return y(this,void 0,void 0,(function*(){const s=Hi.create(this.logger,"inviteUsersToGroup");return s.invoke(e,t,((e,t,r)=>{e===Ke.SUCCESS?s.ok({processCode:t}):s.fail(e)})).result()}))}memberInviteResponse(e){return y(this,void 0,void 0,(function*(){const{groupId:t,inviterId:s,optType:r,optResult:i,joinUserId:n,reason:o}=e,a=1===r?1:0,c=a&&n?n:"",_=Hi.create(this.logger,"handleGroupInvite");return _.invoke(t,c,s,i,a,o||"",((e,t,s)=>{const r=Bs.from(e).trans((()=>({processCode:t})));_.flush(r)})).result()}))}getGroupApplications(e,t,s){return y(this,void 0,void 0,(function*(){const r=e.order?1:0,i=Hi.create(this.logger,"getGroupRequests");return i.invoke(t,s,"",e.pageToken||"",e.count,r,((e,t,s,r)=>{if(e!==Ke.SUCCESS)return void i.fail(e);const n=JSON.parse(r).map((e=>{const{groupId:t,joinUser:s,approverUser:r,inviterUser:i,type:n,status:o,direction:a,operateTime:c,remark:_}=e;return{groupId:t,joinMemberInfo:s,inviterInfo:i,operatorInfo:r,status:o,direction:a,type:n,operationTime:c,reason:_}}));i.ok({totalCount:s,data:n,pageToken:t})})).result()}))}getJoinedGroupsByRole(e,t){return y(this,void 0,void 0,(function*(){const s=Hi.create(this.logger,"getGroups"),r=t.order?1:0,i=e===Ue.UNDEF?[1,2,3]:[e];return s.invoke(i,t.pageToken,t.count,r,((e,t,r,i)=>{if(e!==Ke.SUCCESS)return void s.fail(e);const n=JSON.parse(i),o=this._convertGroupInfoList(n);s.ok({totalCount:r,data:o,pageToken:t})})).result()}))}searchJoinedGroups(e,t){return y(this,void 0,void 0,(function*(){const s=Hi.create(this.logger,"getGroupsByGroupName");return s.invoke(e,t.pageToken,t.count,t.order?1:0,((e,t,r,i)=>{if(e!==Ke.SUCCESS)return void s.fail(e);const n=JSON.parse(i),o=this._convertGroupInfoList(n);s.ok({totalCount:r,data:o,pageToken:t})})).result()}))}getJoinedGroups(e){return y(this,void 0,void 0,(function*(){const t=Hi.create(this.logger,"getGroupsByIds");return t.invoke(e,((e,s,r,i)=>{if(e!==Ke.SUCCESS)return void t.fail(e);const n=JSON.parse(i),o=this._convertGroupInfoList(n);t.ok(o)})).result()}))}setGroupRemark(e,t){return y(this,void 0,void 0,(function*(){const s=Hi.create(this.logger,"updateGroupRemark");return s.invoke(e,t,t?ye.ADD:ye.REMOVE,((e,t)=>s.flush(Bs.from(e)))).result()}))}setGroupFollows(e,t,s){return y(this,void 0,void 0,(function*(){const r=Hi.create(this.logger,"updateFavoriteMembers",this.logger.createTraceId());return r.invoke(t,s,e,((e,t)=>r.flush(Bs.from(e)))).result()}))}getGroupFollows(e){return y(this,void 0,void 0,(function*(){const t=Hi.create(this.logger,"getGroupFavoriteMembers");return t.invoke(e,"",1e3,0,((e,s,r,i)=>{const n=Bs.from(e).trans((()=>JSON.parse(i).map((e=>({userId:e.userId,time:e.followTime})))));t.flush(n)})).result()}))}addFriend(e,t,s){const r=Hi.create(this.logger,"addFriend");return r.invoke(e,t,s,((e,t,s)=>{e===Ke.SUCCESS?r.ok({processCode:t}):r.fail(e)})).result()}deleteFriends(e,t){const s=Hi.create(this.logger,"removeFriends",this.logger.createTraceId());return s.invoke(e,t,((e,t)=>s.flush(Bs.from(e)))).result()}acceptFriendRequest(e){const t=Hi.create(this.logger,"acceptFriendRequest",this.logger.createTraceId());return t.invoke(e,"",((e,s)=>t.flush(Bs.from(e)))).result()}refuseFriendRequest(e,t){const s=Hi.create(this.logger,"rejectFriendRequest",this.logger.createTraceId());return s.invoke(e,t||"",((e,t)=>s.flush(Bs.from(e)))).result()}setFriendInfo(e,t,s){const r=Hi.create(this.logger,"setFriendInfo"),i=wr(s);return r.invoke(e,t,JSON.stringify(i),((e,t,s,i)=>{e===Ke.SUCCESS?r.ok():r.fail(e,{errorKeys:Jr(i)})})).result()}checkFriends(e,t){return y(this,void 0,void 0,(function*(){const s=Hi.create(this.logger,"checkFriendRelationship");return(yield s.invoke(e,t,((e,t)=>{e===Ke.SUCCESS?s.ok(t):s.fail(e)})).result()).trans((e=>JSON.parse(e).map((e=>{const{userId:t,status:s}=e;return{userId:t,relationType:s}}))))}))}getFriends(e,t){return y(this,void 0,void 0,(function*(){const t=Hi.create(this.logger,"getFriends",this.logger.createTraceId());return(yield t.invoke(e,0,((e,s)=>{e===Ke.SUCCESS?t.ok(s):t.fail(e)})).result()).trans((e=>{const t=JSON.parse(e);return{data:this._convertFriendInfo(t),pageToken:""}}))}))}getFriendApplications(e,t,s){const r=Hi.create(this.logger,"getFriendRequestListByPage",this.logger.createTraceId());return r.invoke([1,2].every((e=>t.includes(e)))?3:t[0],s,e.count,e.pageToken,e.order?1:0,((e,t,s)=>{if(e!==Ke.SUCCESS)return void r.fail(e);const i=JSON.parse(s).map((e=>({userId:e.userId,name:e.name,portraitUri:e.portraitUrl,applicationType:e.friendRequestType,applicationStatus:e.friendRequestStatus,operationTime:e.operateTime,extra:e.extra})));r.ok({pageToken:t,data:i})})).result()}_convertFriendInfo(e){return e.map((e=>{const{userId:t,userName:s,remark:r,portraitUrl:i,friendType:n,extProfiles:o,addTime:a,friendAttribute:c}=e;return{userId:t,name:s,portraitUri:i,remark:r,directionType:n,extProfile:o,addTime:a,inBlackList:!!c}}))}getFriendsInfo(e){const t=Hi.create(this.logger,"getFriendByIds");return t.invoke(e,((e,s)=>{if(e!==Ke.SUCCESS)return void t.fail(e);const r=JSON.parse(s),i=this._convertFriendInfo(r);t.ok(i)})).result()}searchFriendsInfo(e){const t=Hi.create(this.logger,"getFriendByNickname");return t.invoke(e,((e,s)=>{if(e!==Ke.SUCCESS)return void t.fail(e);const r=JSON.parse(s),i=this._convertFriendInfo(r);t.ok(i)})).result()}setFriendAddPermission(e){const t=Hi.create(this.logger,"setFriendAuthPermission");return t.invoke(e,(e=>{e!==Ke.SUCCESS?t.fail(e):t.ok()})).result()}getFriendAddPermission(){const e=Hi.create(this.logger,"getFriendAuthPermission");return e.invoke(((t,s)=>{t!==Ke.SUCCESS?e.fail(t):e.ok(s)})).result()}setNotificationQuietHoursWithSetting(e){const{startTime:t,spanMinutes:s,level:r,timezone:i}=e,n=Hi.create(this.logger,"addPushSetting");return n.invoke(t,s,r,i||"",(()=>n.ok()),(e=>n.fail(e))).result()}removeNotificationQuietHoursSetting(){const e=Hi.create(this.logger,"removePushSetting");return e.invoke((()=>e.ok()),(t=>e.fail(t))).result()}getNotificationQuietHoursSetting(){const e=Hi.create(this.logger,"queryPushSetting");return e.invoke(((t,s,r,i)=>{const n={startTime:t,spanMinutes:s,level:r,timezone:i};e.ok(n)}),(t=>e.fail(t))).result()}setDataBaseLogConfig(e){this._callCppProxy("setDataBaseLogConfig",e)}getStatsUrlList(){return y(this,void 0,void 0,(function*(){return Js(er.getStatsUrlList(this.getNaviInfoFromCache()))}))}sendReadReceiptResponseV5(e,t){const s=Hi.create(this.logger,"sendReadReceiptByReadReceiptType");return s.invoke(e.conversationType,e.targetId,e.channelId||"",yr,t,((e,t,r)=>{e!==Ke.SUCCESS?s.fail(e):s.ok()})).result()}getMessageReadReceiptInfoV5ByIdentifiers(e){return y(this,void 0,void 0,(function*(){const t=e.map((({identifier:e,messageUId:t})=>({conIdentifier:{type:e.conversationType,targetId:e.targetId,channelId:e.channelId||""},uid:t}))),s=Hi.create(this.logger,"getReadReceiptCount");return(yield s.invoke(JSON.stringify(t),((e,t)=>{e!==Ke.SUCCESS?s.fail(e):s.ok(t)})).result()).trans((e=>JSON.parse(e).map((e=>({identifier:{conversationType:e.conIdentifier.type,targetId:e.conIdentifier.targetId,channelId:e.conIdentifier.channelId},messageUId:e.msgUid,readCount:e.readCount,unreadCount:e.unreadCount,totalCount:e.totalCount})))))}))}getMessagesReadReceiptUsersByPageV5(e,t,s){const r=Hi.create(this.logger,"getReadReceiptUsersByUid");return r.invoke(e.conversationType,e.targetId,e.channelId||"",t,s.pageToken||"",!s.readStatus,s.pageCount,0===s.order,((e,t,s,i)=>{if(e!==Ke.SUCCESS)return void r.fail(e);const n={pageToken:t,totalCount:i,users:JSON.parse(s).map((e=>JSON.parse(e))).map((e=>({userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned})))};r.ok(n)})).result()}getMessagesReadReceiptByUsersV5(e,t,s){const r=Hi.create(this.logger,"getReadReceiptStatusForUsersInMessage");return r.invoke(e.conversationType,e.targetId,e.channelId||"",t,s,((e,t,s,i)=>{if(e!==Ke.SUCCESS)return void r.fail(e);const n=JSON.parse(s).map((e=>JSON.parse(e))).map((e=>({userId:e.userId,timestamp:e.receiptTime,isMentioned:!!e.mentioned})));r.ok({pageToken:"",totalCount:0,users:n})})).result()}requestSpeechToTextForMessage(e){return y(this,void 0,void 0,(function*(){const t=wi(this.logger,!0,"speechToText",e,((t,s)=>{const r=JSON.parse(s),i={status:r.status,text:r.text,isVisible:r.visible};setImmediate((()=>{this._dispatchEvent("speechToTextResponse",{code:t,messageUId:e,sttInfo:i})}))}));return t===Ke.SUCCESS?Js():js(t)}))}setMessageSpeechToTextVisible(e,t){return y(this,void 0,void 0,(function*(){const s=wi(this.logger,!0,"updateSpeechToTextVisible",e,t);return s===Ke.SUCCESS?Js():js(s)}))}setTranslationLanguage(e){const t=Hi.create(this.logger,"setPushSetting");return t.invoke(Vr,e,(()=>t.ok()),(e=>t.fail(e))).result()}getTranslationLanguage(){return y(this,void 0,void 0,(function*(){const e=wi(this.logger,!0,"getPushSetting",Vr);return Js(e)}))}setAutoTranslateEnabled(e){const t=Hi.create(this.logger,"setPushSetting");return t.invoke(Gr,e?"1":"0",(()=>t.ok()),(e=>t.fail(e))).result()}getAutoTranslateEnabled(){return y(this,void 0,void 0,(function*(){const e=wi(this.logger,!0,"getPushSetting",Gr);return Js("1"===e)}))}translateWithParams(e,t,s,r){return y(this,void 0,void 0,(function*(){const i=wi(this.logger,!0,"getPushSetting",Vr)||"zh",n=Hi.create(this.logger,"translateMessages"),o=e.map((e=>({messageRecognitionIdentifier:{messageUid:e.identifier,customText:0===r?"":e.content,inputSource:r},sourceLanguage:e.sourceLanguage,targetLanguage:e.targetLanguage||i})));return n.invoke(o,{forceRetranslate:s,translationServiceType:t},(e=>{e!==Ke.SUCCESS?n.fail(e):n.ok()})).result()}))}modifyMessageWithParams(e){const t=JSON.stringify(e.messageContent),s=Hi.create(this.logger,"editMessage",this.logger.createTraceId());return s.asyncInvoke((()=>s.ok()),(e=>s.fail(e)),e.messageUId,t).result()}refreshReferenceMessageWithParams(e,t,s,r){const i=Hi.create(this.logger,"getQuotingMessageByUId");return i.asyncInvoke(t.conversationType,t.targetId,t.channelId||"",e,(e=>{i.fail(e)}),(e=>{i.ok(),setTimeout((()=>V(this,Qi,"m",Dn).call(this,e,r)),0)}),(e=>{i.ok(),setTimeout((()=>V(this,Qi,"m",Dn).call(this,e,s)),0)})).result()}syncRemoteConversations(){return y(this,void 0,void 0,(function*(){const e=wi(this.logger,!0,"getRemoteConversations");return e===Ke.SUCCESS?Js():js(e)}))}sendUltraGroupTypingStatus(e){const t=Hi.create(this.logger,"sendUGOperateStatus",this.logger.createTraceId());return t.asyncInvoke(e.targetId,0,e.channelId,(()=>t.ok()),(e=>t.fail(e))).result()}getUltraGroupList(e){return y(this,void 0,void 0,(function*(){const t=null==e?void 0:e.targetId,s=null==e?void 0:e.channelType,r=wi(this.logger,!1,"getUGConversationListForAllChannel"),i=JSON.parse(r).list.map((({obj:e})=>{const t=JSON.parse(e);return V(this,Qi,"m",on).call(this,t)})).filter((e=>!("string"==typeof t&&t!==e.targetId||"number"==typeof s&&s!==e.channelType))).sort(((e,t)=>{var s,r;const i=(null===(s=e.latestMessage)||void 0===s?void 0:s.sentTime)||0;return((null===(r=t.latestMessage)||void 0===r?void 0:r.sentTime)||0)-i}));return Js(i)}))}getRemoteMessagesByUIds(e,t){return y(this,void 0,void 0,(function*(){const s=Hi.create(this.logger,"getRemoteMessageByUids",this.logger.createTraceId()),{targetId:r,conversationType:i,channelId:n}=e;return(yield s.asyncInvoke(r,i,t.map((e=>({messageUId:e,channelId:n||"",sentTime:0}))),(e=>s.ok(e)),(e=>s.fail(e))).result()).trans((e=>JSON.parse(e).list.map((({obj:e})=>{const t=JSON.parse(e);return V(this,Qi,"m",nn).call(this,t)}))))}))}getUGUnreadMentionedDigest(e){return y(this,void 0,void 0,(function*(){const t=Hi.create(this.logger,"getUltraGroupUnreadMentionedDigest",this.logger.createTraceId()),{targetId:s,channelId:r,sentTime:i,count:n}=e;return(yield t.asyncInvoke(s,r||"",i,n,(e=>t.ok(e)),(e=>t.fail(e))).result()).trans((e=>{const t=JSON.parse(e).list.map((({obj:e})=>{const{msgUId:t,objectName:s,sentTime:r,isMentionedAll:i}=JSON.parse(e);return{messageUId:t,messageType:s,sentTime:r,mentionedType:i?ot.ALL:ot.SINGAL}}));return t}))}))}deleteLocalUGMessagesForAllChannel(e,t){return y(this,void 0,void 0,(function*(){return wi(this.logger,!1,"clearUGMessageByTimestamp",e,t,!1),Js()}))}updateUGMessageExpansion(e,t,s){const r=Hi.create(this.logger,"updateUGMessageExpansion",this.logger.createTraceId());return r.asyncInvoke(e.targetId,t.mid,s,JSON.stringify(t),e.channelId,(()=>r.ok()),(e=>r.fail(e))).result()}setUGDefaultNotificationLevel(e,t,s){const r=Hi.create(this.logger,"setDefaultBlockPushLevel",this.logger.createTraceId());return r.asyncInvoke(e,s||"",Xe.ULTRA_GROUP,t,(()=>r.ok()),(e=>r.fail(e))).result()}getUGDefaultNotificationLevel(e,t){const s=Hi.create(this.logger,"getDefaultBlockPushLevel",this.logger.createTraceId());return s.asyncInvoke(e,t||"",Xe.ULTRA_GROUP,(e=>s.ok(e)),(e=>s.fail(e))).result()}getUGUnreadCountForAllChannels(e,t,s){return y(this,void 0,void 0,(function*(){if(t.length>0){const r=wi(this.logger,!0,s?"getUltraGroupUnreadMentionedCount":"getUltraGroupUnreadCount",e,t);return Js(r)}const r=wi(this.logger,!0,s?"getUGMentionCount":"getUGUnreadCount",e);return Js(r)}))}getUGUnreadInfoList(e){return y(this,void 0,void 0,(function*(){const t=wi(this.logger,!1,"getInfoForConversations",e),s=JSON.parse(t).list.map((({obj:e})=>{const{targetId:t,conversationType:s,channelId:r,unreadCount:i,mentionCount:n,mentionMeCount:o,blockStatus:a}=JSON.parse(e);return{targetId:t,conversationType:s,channelId:r,unreadCount:i,mentionedCount:n,mentionedMeCount:o,notificationLevel:a,type:Xe.ULTRA_GROUP,unreadMessageCount:i}}));return Js(s)}))}getUGFirstUnreadMessageDigest(e){return y(this,void 0,void 0,(function*(){const t=V(this,Qi,"m",On).call(this,e);return t?Js({sentTime:t.sentTime,messageType:t.messageType,messageUId:t.messageUId}):js(Ke.RC_DB_DATA_NOT_FOUND)}))}getBlockedUGList(){return y(this,void 0,void 0,(function*(){return V(this,Qi,"m",bn).call(this,[{conversationType:Xe.ULTRA_GROUP,channelIdValid:!1}])}))}getBlockedConversationList(e){return y(this,void 0,void 0,(function*(){const t=rt(e?Ze:Qe).map((e=>({conversationType:e,channelId:e===Xe.ULTRA_GROUP?V(this,Qi,"m",gn).call(this,""):"",channelIdValid:e===Xe.ULTRA_GROUP})));return V(this,Qi,"m",bn).call(this,t).trans((e=>e.reverse()))}))}getSubscribeUsersOnlineStatus(e){return y(this,void 0,void 0,(function*(){return(yield V(this,Qi,"m",yn).call(this,[Jt.ONLINE_STATUS,Jt.FRIEND_ONLINE_STATUS],e)).trans((e=>{const t=JSON.parse(e).list.map((({obj:e})=>{const{userId:t,details:s=[]}=JSON.parse(e),r=s.map((e=>{const{changeTime:t,changeValue:s,platform:r}=JSON.parse(e);return{platform:r,isOnline:!!s,updateTime:t}})),i=r.some((e=>e.isOnline));return n={userId:t,isOnline:i,details:r},[Bt.iOS,Bt.Android,Bt.Web,Bt.PC,Bt.Mini,Bt.HarmonyOS].forEach((e=>{n.details.some((t=>t.platform===e))||n.details.push({platform:e,isOnline:!1,updateTime:0})})),n;var n}));return t}))}))}saveEditedMessageDraft(e,t){return y(this,void 0,void 0,(function*(){const s=wi(this.logger,!1,"saveEditedMessageDraft",Xi(t),e.messageUId,e.content);return s===Ke.SUCCESS?Js():js(s)}))}getEditedMessageDraft(e){return y(this,void 0,void 0,(function*(){const t=wi(this.logger,!1,"getConversationMetadata",Xi(e)).find((e=>"edited_message_draft"===e.key));if(!t)return Js(null);const{msg_uid:s,content:r}=JSON.parse(t.value);return Js({messageUId:s,content:r})}))}clearEditedMessageDraft(e){return y(this,void 0,void 0,(function*(){const t=wi(this.logger,!1,"removeConversationMetadata",Xi(e),["edited_message_draft"]);return t===Ke.SUCCESS?Js():js(t)}))}getUnreadMentionMeConversationList(e,t){return y(this,void 0,void 0,(function*(){const{timestamp:t,count:s,conversationTypes:r}=e,i=r.map((e=>({conversationType:e,channelId:e===Xe.ULTRA_GROUP?"RCDefault":"",channelIdValid:e===Xe.ULTRA_GROUP}))),n=wi(this.logger,!1,"getUnreadMentionMeConversationsByPageWithTopPriority",i,t,s,!!e.topPriority),{code:o,list:a}=JSON.parse(n);if(o!==Ke.SUCCESS)return js(o);const c=a.map((e=>this._buildConversation(e.obj)));return Js(c)}))}getAllRobots(){return y(this,void 0,void 0,(function*(){const e=Hi.create(this.logger,"getAllRobots");return e.asyncInvoke(((t,s)=>{const r=V(this,Qi,"m",Vn).call(this,s);t!==Ke.SUCCESS?e.fail(t,r):e.ok(r)})).result()}))}getConversationsIncludingRobots(e){return y(this,void 0,void 0,(function*(){const{conversationTypes:t,count:s,timestamp:r,topPriority:i}=e,n=Hi.create(this.logger,"getConversationsIncludingRobots");return n.invoke(t.map((e=>({conversationType:e,channelId:"",targetId:"",channelIdValid:!1}))),r,s,i,((e,t)=>{e!==Ke.SUCCESS?n.fail(e):n.flush(V(this,Qi,"m",an).call(this,t,"getConversationsIncludingRobots"))})).result()}))}markRemoteConversationAsRead(e,t,s){return y(this,void 0,void 0,(function*(){const r=yield this.sendMessage(e,t,s);if(r.isOk){const{sentTime:t}=r.data;this._clearUnreadCountByTimestamp(e,t)}return r.wipe()}))}getMessagesByUIds(e,t){return y(this,void 0,void 0,(function*(){const s=Hi.create(this.logger,"getMessagesByUIds");return s.invoke({conversationQueryParam:Object.assign(Object.assign({},Xi(e)),{channelIdValid:"string"==typeof e.channelId}),messageUIds:t,enableRemoteQuery:!0},(e=>{const t=JSON.parse(e).list.map((e=>{const{message:t,messageUId:s,code:r}=e;return{messageUId:s,message:t?V(this,Qi,"m",nn).call(this,t):void 0,code:r}}));s.ok(t)}),(e=>{s.fail(e)})).result()}))}_trans2ICppUpdateMessageReactionParam(e){var t;const{messageUId:s,reactionId:r,pushConfig:i}=e;return{messageUId:s,reactionId:r,pushConfig:{forceShowDetail:(null==i?void 0:i.forceShowDetailContent)||!1,templateId:(null==i?void 0:i.templateId)||"",content:(null==i?void 0:i.pushContent)||"",disableTitle:(null==i?void 0:i.disablePushTitle)||!1,id:(null===(t=null==i?void 0:i.androidConfig)||void 0===t?void 0:t.notificationId)||"",data:(null==i?void 0:i.pushData)||"",config:ys(null==i?void 0:i.iOSConfig,null==i?void 0:i.androidConfig,null==i?void 0:i.harmonyOSConfig),title:(null==i?void 0:i.pushTitle)||""}}}addMessageReaction(e){const t=Hi.create(this.logger,"addMessageReaction"),s=this._trans2ICppUpdateMessageReactionParam(e);return t.invoke(s,(e=>t.flush(Bs.from(e)))).result()}removeMessageReaction(e){const t=Hi.create(this.logger,"removeMessageReaction"),s=this._trans2ICppUpdateMessageReactionParam(e);return t.invoke(s,(e=>t.flush(Bs.from(e)))).result()}_trans2CppConversationQueryParam(e){const{conversationType:t,targetId:s,channelId:r}=e;return{conversationType:t,targetId:s,channelId:t===Xe.ULTRA_GROUP?V(this,Qi,"m",gn).call(this,r):r,channelIdValid:"string"==typeof r}}batchGetMessageReactionSummaries(e){return y(this,void 0,void 0,(function*(){const t=Hi.create(this.logger,"batchGetMessageReactionSummaries"),{conversationIdentifier:s,messageUIds:r}=e,i={messageUIds:r,conversationQueryParam:this._trans2CppConversationQueryParam(s)},n=yield t.invoke(i,((e,s)=>t.flush(Bs.from(e,"",s)))).result();if(!n.isOk)return n.wipe();const o=JSON.parse(n.data);return Js(o)}))}getMessageReactions(e){const t=Hi.create(this.logger,"getMessageReactions"),{pageToken:s,messageUId:r,count:i}=e,n={messageUId:r,count:i,pageToken:s||""};return t.invoke(n,((e,s,r)=>{if(e!==Ke.SUCCESS)return void t.fail(e);const i={pageToken:r,reactions:JSON.parse(s)};t.ok(i)})).result()}getMessageReactionUsers(e){const t=Hi.create(this.logger,"getReactionUsers"),{pageToken:s,reactionId:r,count:i,messageUId:n}=e,o={messageUId:n,reactionId:r,count:i,pageToken:s||""};return t.invoke(o,((e,s,r,i)=>{if(e!==Ke.SUCCESS)return void t.fail(e);const n={totalCount:r,pageToken:i,users:JSON.parse(s)};t.ok(n)})).result()}}Qi=new WeakSet,$i=function(e){const t=JSON.parse(e).list.map((({obj:e})=>JSON.parse(e))),s=[],r=[],i=[];t.forEach((e=>{const{changeTime:t,changeType:n,channelId:o,channelType:a,targetId:c,userId:_}=e;switch(n){case Vt.CHANNEL_DELETE:r.push({targetId:c,channelId:o,channelType:a,deleteTime:t});break;case Vt.PUBLIC_TO_PRIVATE:s.push({targetId:c,channelId:o,changeType:bt.PUBLIC_TO_PRIVATE,channelType:Dt.PRIVATE});break;case Vt.PRIVATE_TO_PUBLIC:s.push({targetId:c,channelId:o,changeType:bt.PRIVATE_TO_PUBLIC,channelType:Dt.PUBLIC});break;case Vt.PRIVATE_CHANNEL_USER_JOIN_PUBLIC:break;case Vt.CHANNEL_USER_KICKED:i.push({targetId:c,channelId:o,userId:_,channelType:a});break;case Vt.PUBLIC_TO_PRIVATE_USER_NOT_IN:s.push({targetId:c,channelId:o,changeType:bt.PUBLIC_TO_PRIVATE_USER_NOT_IN,channelType:a})}})),s.length>0&&this._dispatchEvent("ultraGroupChannelChangeType",s),r.length>0&&this._dispatchEvent("ultraGroupChannelDelete",r),i.length>0&&this._dispatchEvent("ultraGroupChannelUserKicked",i)},Zi=function(e){const t=JSON.parse(e).list.map((({obj:e})=>JSON.parse(e))),s=[],r=[],i=[],n=[],o=[],a=Xe.ULTRA_GROUP;t.forEach((e=>{const{targetId:t,userGroupId:c,eventType:_,channelId:l,channelType:d}=e;switch(_){case Gt.REMOVE_USER_GROUP:s.push({conversation:{conversationType:a,targetId:t},userGroupIds:c});break;case Gt.JOIN_USER_GROUP:r.push({conversation:{conversationType:a,targetId:t},userGroupIds:c});break;case Gt.EXIT_USER_GROUP:i.push({conversation:{conversationType:a,targetId:t},userGroupIds:c});break;case Gt.CHANNEL_BIND_USER_GROUP:n.push({conversation:{conversationType:a,targetId:t,channelId:l},channelType:d,userGroupIds:c});break;case Gt.CHANNEL_UNBIND_USER_GROUP:o.push({conversation:{conversationType:a,targetId:t,channelId:l},channelType:d,userGroupIds:c})}}));const c={};s.length>0&&(c.userGroupDisband=s),r.length>0&&(c.userAdded=r),i.length>0&&(c.userRemoved=i),n.length>0&&(c.userGroupBindChannel=n),o.length>0&&(c.userGroupUnBindChannel=o),this._dispatchEvent("userGroupStatus",c)},qi=function(e,t,s){return y(this,void 0,void 0,(function*(){const r=(yield this.getConversation({conversationType:Xe.ULTRA_GROUP,targetId:e,channelId:t})).data;this._dispatchEvent("conversation",[{conversation:r,updatedItems:{unreadMessageCount:{val:r.unreadMessageCount,time:s}}}])}))},zi=function(e){const t=JSON.parse(e).list.map((({obj:e})=>{const{channelId:t,operateTime:s,operateType:r,targetId:i,userId:n}=JSON.parse(e);return{channelId:t,operationType:r,operationTime:s,targetId:i,userId:n}}));this._dispatchEvent("operateStatus",{conversationType:Xe.ULTRA_GROUP,info:t,hasInfo:!0,hasSummary:!1,summary:[]})},en=function(e){const t=JSON.parse(e).list.map((({obj:e})=>{const{targetId:t,channelId:s,userNum:r,operateType:i}=JSON.parse(e);return{targetId:t,channelId:s,count:r,operationType:i}}));this._dispatchEvent("operateStatus",{conversationType:Xe.ULTRA_GROUP,info:[],hasInfo:!1,hasSummary:!0,summary:t})},tn=function(e){const t=JSON.parse(e).list.map((({obj:e})=>this._buildMessage(e)));this._dispatchEvent("ultraGroupMessageExpansionUpdated",t)},sn=function(e){const t=JSON.parse(e).list.map((({obj:e})=>this._buildMessage(e)));this._dispatchEvent("messagesModified",t)},rn=function(e){const t=JSON.parse(e).list.map((({obj:e})=>{const{channelId:t,conversationType:s,isAdmin:r,isDel:i,mentionType:n,msgUId:o,operatorId:a,sentTime:c,targetId:_}=JSON.parse(e);return{targetId:_,conversationType:s,sentTime:c,messageUId:o,senderUserId:a,channelId:t,content:{conversationType:s,targetId:_,channelId:t,isAdmin:r,isDelete:i,sentTime:c,messageUId:o},messageDirection:1,messageType:ut,isOffLineMessage:!1,receivedTime:Date.now(),isPersited:!1,isCounted:!1,isMentioned:!1,disableNotification:!1,isStatusMessage:!1,canIncludeExpansion:!1,expansion:null,receivedStatus:es.UNREAD,receivedStatusInfo:vs(es.UNREAD)}}));t.length>0&&(t.slice().forEach((e=>V(this,Qi,"m",En).call(this,e,"ugRecall"))),this._dispatchEvent("ultraGroupMessageRecalled",t))},nn=function(e,t){const{channelId:s,senderUserId:r,content:i,objectName:n,direction:o,status:a,messageId:c,sentTime:_,readReceiptRequest:l,supportExt:d,pushContent:E,pushTitle:u,pushId:R,pushConfig:h,templateId:I,disableTitle:g,forcePushDetail:T,hasMore:N,directedUsers:C,noNotification:O,disableUpdateLastMessage:p,needReceipt:S,sendReceipt:A,contentRecognition:f,convertExt:m,editTime:v,editContent:P,editStatus:L,quotedMsgStatus:M,hasChanged:U,quoteInfo:D,hasReactions:b}=e;let{conversationType:y,targetId:V,messageUid:G}=e,k=this._parseMessageJsonContent(i,c);const F=!!k.mentionedInfo;if(n===ut&&r===this.tcpMgr.getCurrentUserId()&&(y=k.conversationType,V=k.targetId,G=k.messageUId),m){const e=JSON.parse(m);if(e.trans){const{targetLanguage:t,translatedText:s,translateStatus:r}=e.trans,i={targetLanguage:t,translatedText:s,status:r};k.translateInfo=i}}if(n===ct||n===_t){const e=f?JSON.parse(f):{status:_s,text:"",visible:!1},t={status:e.status,text:e.text,isVisible:e.visible};k.sttInfo=t}const w=function(e){return Ur.get(e)}(n)||{isPersited:!1,isCounted:!1,isStatusMessage:!1};let H=this._buildSupportExt(d,e);const B=void 0===(J=t)||"[object Undefined]"===Object.prototype.toString.call(J)?_<this.tcpMgr.getConnectedTime():t;var J;let j={};h&&(j=((e,t)=>{const s={},r={notificationId:t||""},i={};if(!e)return{iOSConfig:s,androidConfig:r,harmonyOSConfig:i};try{const t=JSON.parse(e);null==t||t.forEach((e=>{var t,n,o,a,c,_,l,d,E,u,R,h;const I=Object.keys(e);if(0===I.length)return;const g=I[0];switch(g){case"HW":return r.channelIdHW=null===(t=e[g])||void 0===t?void 0:t.channelId,r.importanceHW=null===(n=e[g])||void 0===n?void 0:n.importance,r.imageUrlHW=null===(o=e[g])||void 0===o?void 0:o.image,void(r.categoryHW=null===(a=e[g])||void 0===a?void 0:a.category);case"MI":return void(r.channelIdMi=null===(c=e[g])||void 0===c?void 0:c.channelId);case"OPPO":return void(r.channelIdOPPO=null===(_=e[g])||void 0===_?void 0:_.channelId);case"VIVO":return r.typeVivo=null===(l=e[g])||void 0===l?void 0:l.classification,void(r.categoryVivo=null===(d=e[g])||void 0===d?void 0:d.category);case"APNS":return s.threadId=e[g]["thread-id"],s.apnsCollapseId=e[g]["apns-collapse-id"],s.category=e[g].category,s.richMediaUri=e[g].richMediaUri,void(s.interruptionLevel=e[g]["interruption-level"]);case"FCM":return void(r.googleConfig={collapseKey:e[g].collapse_key||"",imageUrl:e[g].imageUrl||"",priority:e[g].priority||""});case"HONOR":return r.importanceHonor=null===(E=e[g])||void 0===E?void 0:E.importance,void(r.imageUrlHonor=null===(u=e[g])||void 0===u?void 0:u.image);case"OHOS":i.category=null===(R=e[g])||void 0===R?void 0:R.category,i.image=null===(h=e[g])||void 0===h?void 0:h.image}}))}catch(e){}return{iOSConfig:s,androidConfig:r,harmonyOSConfig:i}})(h,R));const W=Object.assign(Object.assign({},j),{pushTitle:u,pushContent:E,pushData:E,disablePushTitle:g,forceShowDetailContent:T,templateId:I}),x={channelId:s,conversationType:y,targetId:V,senderUserId:r,content:k||{},messageType:n,messageUId:G||"",messageDirection:o,isOffLineMessage:B,sentTime:_,receivedTime:0,isPersited:w.isPersited,isCounted:w.isCounted,isMentioned:F,disableNotification:O,isStatusMessage:w.isStatusMessage||!1,canIncludeExpansion:d,expansion:d?H:null,receivedStatus:0,receivedStatusInfo:void 0,sentStatus:void 0,messageId:c,pushConfig:W,hasMore:N,directedUserIds:C||[],disableUpdateLastMessage:p,needReceipt:S,sendReceipt:A,hasReactions:b};if(D&&(x.quoteInfo=D),o===Xt.RECEIVE?(x.receivedStatus=a,x.receivedStatusInfo=vs(a)):x.sentStatus=a,l){const e=this._handleReadReceiptRequest(l);x.readReceiptInfo=e}return y===Xe.ULTRA_GROUP?x.isModifyMessage=!!U:(x.isModifyMessage=!(!v&&!L),x.isModifyMessage&&(x.modifyInfo={timestamp:v,content:P?JSON.parse(P):{},status:L})),n===Et&&(x.content.referMsgStatus=M),x},on=function(e){const{channelId:t,conversationType:s,targetId:r,lastestMsg:i,isTop:n,blockStatus:o,matchCount:a,hasUnreadMention:c,unreadCount:_,mentionCount:l,mentionMeCount:d,conversationTime:E,draft:u,translateStrategy:R,channelType:h,metadata:I,includeRobot:g,entrustInfo:T}=e,N=-1===JSON.parse(i).messageId?null:this._buildMessage(i),C=I?JSON.parse(I):{},O=C.edited_message_draft?JSON.parse(C.edited_message_draft):void 0,p=JSON.parse(T),S={name:p.name,portraitUri:p.portraitUrl};return{channelId:t,conversationType:s,targetId:r,channelType:h,unreadMessageCount:_,unreadMentionedCount:l,unreadMentionedMeCount:d,hasMentioned:c,latestMessage:N,notificationStatus:zt(o),isTop:n,lastUnreadTime:0,matchCount:a,operationTime:E,notificationLevel:o,draft:u,translateStrategy:R,editedMessageDraft:O?{messageUId:O.msg_uid,content:O.content}:void 0,includeRobot:!!g,dataMgmtInfo:S}},an=function(e,t){try{const{list:t}=JSON.parse(e),s=t.map((e=>this._buildConversation(e.obj)));return Js(s)}catch(e){const s=`parse conversation list result error, method: ${t}`;return js(Ke.MAIN_PROCESS_ERROR,s)}},cn=function(e){var t;const{messageType:s,targetId:r}=e;if(s===St){const t=function(e){const t={},s=[],r=e.content.memberCount||0;return Array.isArray(e.content.userList)&&e.content.userList.forEach((e=>{t[e.userId]=e.status,s.push({userId:e.userId,action:e.status,extra:e.extra})})),{users:t,chatroomId:e.targetId,memberCount:r,userList:s}}(e);return this._sendChatroomEvents({userChange:t}),!1}if(s===At){const t=function(e){const{chatroomId:t,status:s,reason:r,time:i,extra:n}=e.content;return{chatroomId:t,status:s,reason:r,time:i,extra:n||""}}(e);return this._sendChatroomEvents({chatroomNotifyMultiLoginSync:t}),!1}if(s===ft){const s=function(e){const{chatroomId:t,operateType:s,durationTime:r,operateTime:i,userList:n,extra:o}=e.content;return{chatroomId:t,operateType:s,durationTime:r,operateTime:i,userIdList:n,extra:o||""}}(e);return s.operateType===Ye.Blocked&&(null===(t=null==s?void 0:s.userIdList)||void 0===t?void 0:t.includes(this.tcpMgr.getCurrentUserId()))&&this._chatroomCache.delete(r),this._sendChatroomEvents({chatroomNotifyBlock:s}),!1}if(s===mt){const t=function(e){const{chatroomId:t,operateType:s,durationTime:r,operateTime:i,userList:n,extra:o}=e.content;return{chatroomId:t,banType:s,durationTime:r,operateTime:i,userIdList:n,extra:o||""}}(e);return this._sendChatroomEvents({chatroomNotifyBan:t}),!1}return!0},_n=function(e){const t=JSON.parse(e),s=V(this,Qi,"m",nn).call(this,t,!1),{messageType:r,conversationType:i}=s;if(r!==ut||i!==Xe.ULTRA_GROUP){if(this._lowPriorityMessageHandler.isLowPriorityMessage(r)){const e=this.tcpMgr.getCurrentUserId();return this._lowPriorityMessageHandler.push(s,e),void this._handleLowPriorityMessages(e,this.tcpMgr.getConnectedTime())}this._handleHighPriorityMessages([s],!1)}},ln=function(e,t){const s=this.tcpMgr.getConnectedTime(),r=this.tcpMgr.getCurrentUserId(),i=[],n=[];JSON.parse(e).list.forEach((e=>{const t=JSON.parse(e.obj),o=t.sentTime<s,a=V(this,Qi,"m",nn).call(this,t,o),{messageType:c}=a;this._lowPriorityMessageHandler.isLowPriorityMessage(c)?this._lowPriorityMessageHandler.push(a,r):o?i.push(a):n.push(a)})),i.length>0&&this._handleHighPriorityMessages(i,!!t);let o=!1;(!t||n.length>0)&&!this._pullOfflineMessageFinished&&(o=this._pullOfflineMessageFinished=!0),n.length>0&&this._handleHighPriorityMessages(n,!!t),(this._pullOfflineMessageFinished||this._lowPriorityMessageHandler.count>=1e4)&&this._handleLowPriorityMessages(r,s),o&&this._sendPullOfflineFinished()},dn=function(e){0!==e.length&&wi(this.logger,!1,"setExtraMessageInBatches",e)},En=function(e,t){var s;const{messageUId:r,sentTime:i,isAdmin:n,isDelete:o,extra:a}=e.content,c=this.logger.createTraceId();if(this.logger.info(kr.L_HADNLE_RECALL_CMD_T,JSON.stringify({recalledMessageUId:r,isDelete:o,source:t}),c),"number"!=typeof i||"string"!=typeof r||!r.length)return this.logger.warn(kr.L_HADNLE_RECALL_CMD_R,"Invalid message",c),!1;const _=V(this,Qi,"m",vn).call(this,r);if(!_.isOk)return this.logger.info(kr.L_HADNLE_RECALL_CMD_R,"Msg Not Found",c),!1;const l=_.data;if(o)return V(this,Qi,"m",An).call(this,[l.messageId],i),this.logger.info(kr.L_HADNLE_RECALL_CMD_R,`Delete Msg, messageId: ${l.messageId}`,c),!0;if(l.messageType===Rt)return this.logger.info(kr.L_HADNLE_RECALL_CMD_R,"Msg has been processed",c),!1;(null===(s=l.receivedStatusInfo)||void 0===s?void 0:s.isRead)||V(this,Qi,"m",Ln).call(this,l.messageId,1,i);const d={operatorId:e.senderUserId,recallTime:l.sentTime,originalObjectName:l.messageType,originalMessageContent:l.content,recallActionTime:e.sentTime,admin:!!n,delete:!!o,isDelete:!!o,extra:a};return e.content.user&&(d.user=e.content.user),e.content.extra&&(d.extra=e.content.extra),l.messageType===at&&(d.recallContent=l.content.content),V(this,Qi,"m",Pn).call(this,l.messageId,JSON.stringify(d),Rt),this.logger.info(kr.L_HADNLE_RECALL_CMD_R,`Replace Msg with RC:RcNtf, messageId: ${l.messageId}`,c),!0},un=function(e,t){const{timestamp:s,count:r,order:i,messageType:n}=t,{conversationType:o,targetId:a,channelId:c}=e,_=wi(this.logger,!1,"getHistoryMessages",o,a,s,r+1,n,0===i,c||""),l=JSON.parse(_).list.map((({obj:e})=>this._buildMessage(e))).reverse();return{list:r===l.length-1?l.slice(1):l,hasMore:r<l.length}},Rn=function(e,t){return y(this,void 0,void 0,(function*(){const{timestamp:s,count:r,order:i}=t,{conversationType:n,targetId:o,channelId:a}=e,c=Hi.create(this.logger,"getRemoteHistoryMessages",this.logger.createTraceId());return(yield c.asyncInvoke(n,o,s,r,((e,t)=>c.ok({listJson:e,hasMore:t})),(e=>c.fail(e)),i,!0,a||"",!0).result()).trans((({listJson:e,hasMore:t})=>{const s=JSON.parse(e).list.map((({obj:e})=>this._buildMessage(e)));return 0===i&&s.reverse(),{list:s,hasMore:!!t}}))}))},hn=function(e){const{conversationType:t,targetId:s,channelId:r}=e;wi(this.logger,!1,"clearMessages",t,s,r||"")},In=function(e,t,s){wi(this.logger,!1,"deleteChatroomMessageAndKV",e,t,s)},gn=function(e){var t;return!!(2&((null===(t=this.getNaviInfoFromCache())||void 0===t?void 0:t.ugDriven)||0))&&!e?"RCDefault":e||""},Tn=function(e){const{conversationType:t,targetId:s,channelId:r}=e,i=wi(this.logger,!1,"getConversation",t,s,r||"");return i?this._buildConversation(i):null},Nn=function(e){const{conversationType:t,targetId:s,channelId:r}=e;return wi(this.logger,!0,"getUnreadCount",t,s,r||"")},Cn=function(e){const{conversationType:t,targetId:s,channelId:r}=e;return wi(this.logger,!1,"clearUnreadCount",t,s,r||"")},On=function(e){const{conversationType:t,targetId:s,channelId:r}=e,i=wi(this.logger,!0,"getTheFirstUnreadMessage",t,s,r||""),n=this._buildMessage(i);return-1!==n.messageId?n:null},pn=function(e,t,s,r,i,n){const o=this.logger.createTraceId(),a=Hi.create(this.logger,"updateConversationStatus",o),c=JSON.stringify(e.map((e=>({conversation_query_param:{conversation_type:e.conversationType,target_id:e.targetId,channel_id:e.channelId,channel_id_valid:"string"==typeof e.channelId&&e.channelId.length>0},block_op:t,translate_strategy_op:r,top_op:s,create_conversation:!!n,update_time:!!i}))));return a.invoke(c,(()=>a.ok()),(e=>a.fail(e))).result()},Sn=function(e,t){const{conversationType:s,targetId:r,channelId:i}=e,{content:n,senderUserId:o,messageType:a,messageDirection:c,readStatus:_,sentStatus:l,sentTime:d,searchContent:E,isUnread:u,messageUId:R,disableNotification:h,canIncludeExpansion:I,expansion:g,directedUserIds:T,disableUpdateLastMessage:N,quoteInfo:C}=t,O=d||0,p={};if(g)for(const e in g)p[e]={v:g[e],ts:O};const S=()=>{},A=wi(this.logger,!0,"insertMessage",s,r,o,a,JSON.stringify(n),S,S,c,_||1,l||30,O,E||"",u?0:1,R||"",!!h,!!I,JSON.stringify(p),i||"",T||[],!!N,(null==C?void 0:C.messageUId)||"",(null==C?void 0:C.senderId)||"",(null==C?void 0:C.objectName)||"",(null==C?void 0:C.quoteMessageStatus)||0),f=this._buildMessage(A,!1);return f.messageUId=R,f.sentTime=d,f},An=function(e,t=0){wi(this.logger,!1,"deleteMessages",e,t)},fn=function(e,t,s){wi(this.logger,!1,"deleteMessagesByTimestamp",e.conversationType,e.targetId,t,s,e.channelId||"")},mn=function(e){const t=wi(this.logger,!0,"getMessage",e),s=JSON.parse(t);return s.messageId<=0?js(Ke.RC_DB_DATA_NOT_FOUND,`msg not found: ${e}`):Js(s)},vn=function(e){return V(this,Qi,"m",mn).call(this,e).trans((e=>V(this,Qi,"m",nn).call(this,e,!1)))},Pn=function(e,t,s){return wi(this.logger,!1,"setMessageContent",e,t,s)},Ln=function(e,t,s=0){wi(this.logger,!1,"setMessageReceivedStatus",e,t,s)},Mn=function(e){const t=e.map((e=>{const{conversationType:t,targetId:s,channelId:r=""}=e;return{targetId:s,channelId:r,type:t}})),s=wi(this.logger,!0,"getConversations",JSON.stringify(t));return JSON.parse(s).list.map((e=>this._buildConversation(e.obj)))},Un=function(e){let t=[];return e&&e.length>0&&(t=e.map((e=>{const t=JSON.parse(e.obj);return{messageUId:t.msg_uid,message:t.msg?this._buildMessage(t.msg):void 0,code:t.code}}))),t},Dn=function(e,t){try{const{list:s}=JSON.parse(e);t(V(this,Qi,"m",Un).call(this,s))}catch(t){this.logger.error(kr.P_PARSE_JSON_MSGS_E,e)}},bn=function(e){const t=wi(this.logger,!1,"getBlockedConversations",e);return V(this,Qi,"m",an).call(this,t,"getBlockedConversations")},yn=function(e,t){return y(this,void 0,void 0,(function*(){const s=Hi.create(this.logger,"getSubscribeStatusByUserIds",this.logger.createTraceId());return s.invoke(e,t,((e,t)=>{e!==Ke.SUCCESS?s.fail(e):s.ok(t)})).result()}))},Vn=function(e){return JSON.parse(e).list.map((e=>{const t=JSON.parse(e);return{robotId:t.robotId,name:t.robotName,portraitUri:t.robotPortrait,robotType:t.robotType,metadata:t.metadata?JSON.parse(t.metadata):{},createTime:t.createTime,updateTime:t.updateTime}}))};class Hn{constructor(e){Object.defineProperty(this,"_rendererInitOptions",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"_svr",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_senders",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),this._svr=new wn(e,this._send2AllRenderer.bind(this)),this._initIpcEventListeners(),s.on("before-quit",(()=>this.destroy())),s.on("window-all-closed",(()=>this.destroy()))}static init(t){if(V(this,kn,"f",Fn))return V(this,kn,"f",Fn);if(!t.appkey)throw new Error("Initializ failed, `appkey` is required!");const r={appkey:t.appkey,dbpath:t.dbpath||e(s.getPath("userData")),logOutputLevel:t.logOutputLevel||sr.WARN,enableSyncEmptyTopConversation:!!t.enableSyncEmptyTopConversation,disableLogReport:!!t.disableLogReport,eventLoopBlockingCheck:!!t.eventLoopBlockingCheck,environment:t.environment||"default",reconnectKickEnable:!!t.reconnectKickEnable,runInMainProcess:!!t.runInMainProcess};return G(this,kn,new Hn(r),"f",Fn),V(this,kn,"f",Fn)}_initIpcEventListeners(){r.on("__RC_CHANNEL_CALL_MAIN_SYNC__",((e,t,...s)=>{e.returnValue=this._svr[t].call(this._svr,...s)})),r.on("__RC_CHANNEL_CALL_MAIN__",(({sender:e},t,s,...r)=>y(this,void 0,void 0,(function*(){if(!this._senders.has(e))return void this._send2Renderer(e,"__RC_CHANNEL_RESULT_FROM_MAIN__",t,js(Ke.BIZ_ERROR_CLIENT_NOT_INIT));let i;if("sendMessage"===s){const[t,s,n,o]=r;i=this._svr.sendMessage(t,s,n,(t=>{this._send2Renderer(e,"__RC_CHANNEL_RESULT_FROM_MAIN__",o,t)}))}else if("refreshReferenceMessageWithParams"===s){const[t,s,n,o]=r;i=this._svr.refreshReferenceMessageWithParams(t,s,(t=>{this._send2Renderer(e,"__RC_CHANNEL_RESULT_FROM_MAIN__",n,t)}),(t=>{this._send2Renderer(e,"__RC_CHANNEL_RESULT_FROM_MAIN__",o,t)}))}else i=this._svr[s].apply(this._svr,r);i instanceof Promise&&(i=yield i),this._send2Renderer(e,"__RC_CHANNEL_RESULT_FROM_MAIN__",t,i)})))),r.on("__RC_CHANNEL_SEND_2_MAIN__",(({sender:e},t,...s)=>{this._senders.has(e)&&this._svr[t].apply(this._svr,s)})),r.on("__RC_INNER_COMMAND_INIT__",this._registerRenderers.bind(this))}_registerRenderers(e,t){if("38f2b6b488580bc24bb1fddd69df5e25adfcf61c"!==t.commitId)return;const{sender:s}=e;this._rendererInitOptions||(this._rendererInitOptions=t,this._svr.setRenderInitOption(t)),this._senders.has(s)||(this._senders.add(s),s.once("destroyed",(()=>{this._senders.delete(s)})))}_send2Renderer(e,t,...s){e.isDestroyed()?this._senders.delete(e):e.send(t,...s)}_send2AllRenderer(e,...t){this._senders.forEach((s=>{this._send2Renderer(s,"__RC_CHANNEL_NOTIFICATION_FROM_MAIN__",e,...t)}))}getCppProto(){return{destroy:()=>{console.warn("`.getCppProto().destroy()` has being deprecated, use `.destroy()` instead."),this.destroy()}}}destroy(){this._svr.destroy()}getDeviceId(){return this._svr.getDeviceId()}getServerTime(){return this._svr.getConnectedTime()}setDatabaseOperationTimeThreshold(e){return this._svr.setDataBaseLogConfig(e)}}kn=Hn,Fn={value:void 0};var Bn=e=>Hn.init(e);export{Bn as default};
|